detail.vue 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291
  1. <template>
  2. <view class="polyv_detail">
  3. <!-- <nav-bar
  4. :title="detail.courseName || '课程详情'"
  5. v-show="navShow"
  6. ></nav-bar> -->
  7. <uni-nav-bar
  8. left-icon="back"
  9. :statusBar="true"
  10. fixed='true'
  11. :title="detail.courseName || '课程详情'"
  12. @clickLeft="clickLeft"
  13. ></uni-nav-bar>
  14. <view id="top">
  15. <view class="video_box" v-if="!startStatus">
  16. <image
  17. :src="$method.splitImgHost(goodsData.coverUrl)"
  18. mode="widthFix"
  19. style="width: 100%; height: 421rpx"
  20. ></image>
  21. <image
  22. v-if="false"
  23. class="video_play"
  24. src="/static/play.png"
  25. @click="startVideo"
  26. ></image>
  27. </view>
  28. <view v-else>
  29. <view
  30. class="video_box"
  31. style="width: 100%; height: 421rpx"
  32. v-if="playVID"
  33. >
  34. <polyv-player
  35. id="playerVideo"
  36. playerId="playerVideo"
  37. height="421rpx"
  38. :vid="vid"
  39. :showSettingBtn="true"
  40. :enablePlayGesture="true"
  41. :custom-cache="false"
  42. :object-fit="'contain'"
  43. @statechange="onStateChange"
  44. @fullscreenchange="fullscreenchange"
  45. @error="playError"
  46. :autoplay="autoplay"
  47. :page-gesture="true"
  48. :vslide-gesture="true"
  49. :vslide-gesture-in-fullscreen="true"
  50. :isAllowSeek="isAllowSeek"
  51. :playbackRate="playbackRate"
  52. :startTime="startTime"
  53. :enableAutoRotation="enableAutoRotation"
  54. @loadedmetadata="loadedmetadata"
  55. ></polyv-player>
  56. <cover-view
  57. class="video-toast__close"
  58. v-if="videoToastShow"
  59. @click="closeToast()"
  60. >X</cover-view
  61. >
  62. <cover-view class="video-toast" v-if="videoToastShow">
  63. <cover-view class="video-toast__text"
  64. >您上次看到 {{ seekTime }},正在自动续播</cover-view
  65. >
  66. <cover-view class="video-toast__btn" @click="restart()"
  67. >从头播放</cover-view
  68. >
  69. </cover-view>
  70. <!-- 全屏时的目录 -->
  71. </view>
  72. <view
  73. class="video_box"
  74. style="width: 100%; height: 421rpx"
  75. v-if="playChannelId > 0"
  76. >
  77. <player
  78. class="plv-mp-demo-player"
  79. :videoOption="videoOption"
  80. :page-gesture="true"
  81. :vslide-gesture="true"
  82. :vslide-gesture-in-fullscreen="true"
  83. @onLiveStatusChange="playerLiveStatusChange"
  84. />
  85. </view>
  86. </view>
  87. <view class="course_name">
  88. <u-row>
  89. <u-col span="10">
  90. <view class="video_t1">{{ detail.courseName }}</view>
  91. </u-col>
  92. <u-col span="2">
  93. <div class="notice_wrap" v-if="goodsData.buyNote">
  94. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  95. </div>
  96. </u-col>
  97. </u-row>
  98. </view>
  99. <u-line color="#D6D6DB" />
  100. <view>
  101. <view
  102. ><u-tabs
  103. gutter="0"
  104. :item-width="itemWidth()"
  105. :list="list"
  106. font-size="32"
  107. bar-width="24"
  108. :current="current"
  109. @change="change"
  110. active-color="#007AFF"
  111. ></u-tabs
  112. ></view>
  113. </view>
  114. <u-line color="#D6D6DB" />
  115. </view>
  116. <view class="box" :class="{'first_ml': current == 0}">
  117. <scroll-view class="box_in" scroll-y="true">
  118. <!--目录 -->
  119. <view v-show="current == 0">
  120. <view class="top__header" v-if="livingItem" @click="goLive(livingItem)">
  121. <image class="img" src="/pages3/static/imgs/live.png" mode="widthFix"></image>
  122. <view class="note">正在直播中</view>
  123. <view class="title">{{livingItem.sectionName}}</view>
  124. </view>
  125. <view class="menuBox" v-for="(item, index) in menuList" :key="index">
  126. <!--模块 -->
  127. <view v-if="item.type == 1"
  128. ><courseModule
  129. :orderGoodsId="orderGoodsId"
  130. :sectionMaxNum="goodsData.sectionMaxNum"
  131. :needOpen="menuIndex[0] === index ? true : false"
  132. :courseId="courseId"
  133. :preItem="menuList[index - 1]"
  134. :learningOrder="businessData.goodsLearningOrder"
  135. :goodsId="goodsId"
  136. :gradeId="gradeId"
  137. :isBuy="true"
  138. :menuItem="item"
  139. :levelId="item.menuId"
  140. ></courseModule
  141. ></view>
  142. <!--章 -->
  143. <view v-if="item.type == 2"
  144. ><courseChapter
  145. :orderGoodsId="orderGoodsId"
  146. :sectionMaxNum="goodsData.sectionMaxNum"
  147. :needOpen="menuIndex[0] === index ? true : false"
  148. :courseId="courseId"
  149. :preItem="menuList[index - 1]"
  150. @playEnd="sectionPlayEnd($event, index)"
  151. :learningOrder="businessData.goodsLearningOrder"
  152. :goodsId="goodsId"
  153. :gradeId="gradeId"
  154. :isBuy="true"
  155. :menuItem="item"
  156. :levelId="'0-' + item.menuId"
  157. ></courseChapter
  158. ></view>
  159. <!--节 -->
  160. <view v-if="item.type == 3"
  161. ><courseSection
  162. :orderGoodsId="orderGoodsId"
  163. :sectionMaxNum="goodsData.sectionMaxNum"
  164. @playEnd="sectionPlayEnd($event, index)"
  165. :courseId="courseId"
  166. :preItem="menuList[index - 1]"
  167. :learningOrder="businessData.goodsLearningOrder"
  168. :goodsId="goodsId"
  169. :gradeId="gradeId"
  170. :isBuy="true"
  171. :menuItem="item"
  172. :levelId="'0-0-' + item.menuId"
  173. ></courseSection
  174. ></view>
  175. </view>
  176. </view>
  177. <!--讲义 -->
  178. <view v-show="current == 1">
  179. <view class="lecture-box" v-if="courseHandoutsData">
  180. <view class="title">
  181. {{ courseHandoutsData.handoutsName }}
  182. <!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
  183. </view>
  184. <view class="btn" @click="openDocument">
  185. <image v-if="!downLoading" src="/pages3/static/imgs/downLoad.png" style="width: 40rpx;height: 40rpx;"></image>
  186. <image v-else src="/pages3/static/imgs/downLoading.png" class="loading_down" style="width: 40rpx;height: 40rpx;"></image>
  187. </view>
  188. </view>
  189. </view>
  190. <!--笔记 -->
  191. <view v-show="current == 2">
  192. <view v-if="noteList.length == 0" style="text-align: center"
  193. >暂无笔记</view
  194. >
  195. <view v-for="(item, index) in noteList" :key="index">
  196. <view class="dateBox">{{
  197. $method.timestampToTime(item.dateNote)
  198. }}</view>
  199. <view class="noteBox">
  200. <view
  201. v-for="(item1, index1) in item.userNotes"
  202. :key="index1"
  203. style="margin-top: 30rpx"
  204. @click="jumpNote(item1)"
  205. >
  206. <view style="display: flex">
  207. <view class="left_ti">
  208. <view>
  209. <image
  210. src="/static/icon/note2.png"
  211. v-if="noteId != item1.noteId"
  212. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  213. ></image>
  214. <image
  215. src="/static/icon/note1.png"
  216. v-if="noteId == item1.noteId"
  217. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  218. ></image>
  219. </view>
  220. <view
  221. class="title"
  222. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  223. >{{ $method.secondToDate(item1.noteSecond) }}</view
  224. >
  225. </view>
  226. <view style="margin-left: 10rpx">
  227. <view class="t2Content leftPadding">{{
  228. item1.sectionName
  229. }}</view>
  230. <view class="tBox2">{{ item1.noteText }}</view>
  231. </view>
  232. </view>
  233. </view>
  234. </view>
  235. </view>
  236. </view>
  237. <!--答疑 -->
  238. <view v-show="current == 3" class="Answering">
  239. <!-- <view class="inputBottom">
  240. <view class="flex_auto">
  241. <u-input
  242. height="60"
  243. fixed="true"
  244. :focus="isFocus"
  245. :placeholder="placeholder"
  246. type="input"
  247. @blur="blur"
  248. :custom-style="inputStyle"
  249. v-model="ctxValue"
  250. />
  251. </view>
  252. <view class="btn" @click="postContent">提交</view>
  253. </view> -->
  254. <view
  255. v-for="(item, index) in answerList"
  256. :key="index"
  257. style="background-color: #ffffff;"
  258. class="answer_item"
  259. >
  260. <view class="chat_box" @click.stop="clearCtx">
  261. <view style="display: flex; flex: 1">
  262. <view
  263. ><image
  264. :src="
  265. item.assignUserId > 0 && !item.realname
  266. ? '/static/logo_xcx.png'
  267. : $method.splitImgHost(item.avatar)
  268. "
  269. style="width: 64rpx; height: 64rpx"
  270. ></image
  271. ></view>
  272. <view style="margin-left: 15rpx">
  273. <view class="chat1">{{
  274. item.assignUserId > 0 && !item.realname
  275. ? "祥粤老师"
  276. : item.realname
  277. }}</view>
  278. <view class="chat2">{{
  279. $method.timestampToTime(item.createTime, false)
  280. }}</view>
  281. <view class="chat3">
  282. <text v-if="item.assignUserId > 0">回复</text>
  283. <text v-if="item.assignUserId > 0" style="color: #007aff"
  284. >@{{ item.assignRealname }}</text
  285. >
  286. <view style="word-break: break-all">{{
  287. item.answerText
  288. }}</view>
  289. </view>
  290. </view>
  291. </view>
  292. <view
  293. class="btnReply"
  294. @click.stop="replyContent(item)"
  295. v-if="item.userId != userInfo.userId"
  296. >回复</view
  297. >
  298. <view v-else class="btnDel" @click.stop="delContent(item)"
  299. >删除</view
  300. >
  301. </view>
  302. <u-line color="#D6D6DB" />
  303. </view>
  304. <view v-if="answerList.length == 0" style="text-align: center"
  305. >暂无记录</view
  306. >
  307. </view>
  308. <!--目录 -->
  309. <view v-show="current == 4">
  310. <view
  311. class="menuBox"
  312. v-for="(item, index) in reMenuList"
  313. :key="index"
  314. >
  315. <!--模块 -->
  316. <view v-if="item.type == 1"
  317. ><courseModule
  318. :orderGoodsId="orderGoodsId"
  319. :sectionMaxNum="goodsData.sectionMaxNum"
  320. :courseId="courseId"
  321. :goodsId="goodsId"
  322. :gradeId="gradeId"
  323. :isRebuild="true"
  324. :isBuy="true"
  325. :menuItem="item"
  326. :levelId="item.menuId"
  327. ></courseModule
  328. ></view>
  329. <!--章 -->
  330. <view v-if="item.type == 2">
  331. <courseChapter
  332. :orderGoodsId="orderGoodsId"
  333. :courseId="courseId"
  334. :sectionMaxNum="goodsData.sectionMaxNum"
  335. @playEnd="sectionPlayEnd($event, index)"
  336. :gradeId="gradeId"
  337. :goodsId="goodsId"
  338. :isRebuild="true"
  339. :isBuy="true"
  340. :menuItem="item"
  341. :levelId="'0-' + item.menuId"
  342. ></courseChapter>
  343. </view>
  344. <!--节 -->
  345. <view v-if="item.type == 3">
  346. <courseSection
  347. :orderGoodsId="orderGoodsId"
  348. :courseId="courseId"
  349. :sectionMaxNum="goodsData.sectionMaxNum"
  350. @playEnd="sectionPlayEnd($event, index)"
  351. :gradeId="gradeId"
  352. :goodsId="goodsId"
  353. :isRebuild="true"
  354. :isBuy="true"
  355. :nextMenuItem="findMenuNextSection(index)"
  356. :menuItem="item"
  357. :levelId="'0-0-' + item.menuId"
  358. ></courseSection>
  359. </view>
  360. </view>
  361. </view>
  362. </scroll-view>
  363. <!-- 底部固定按钮 -->
  364. <!-- 笔记的输入框 -->
  365. <template v-if="current == 2">
  366. <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0" :style="{ bottom: bottomHeight + 'px' }">
  367. <view style="width: 10%"
  368. ><image
  369. src="/static/icon/note3.png"
  370. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  371. ></image
  372. ></view>
  373. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  374. <input
  375. v-model="noteValue"
  376. height="60"
  377. fixed="true"
  378. placeholder="您可以在这里输入笔记内容"
  379. type="text"
  380. :custom-style="inputStyle"
  381. :adjust-position="false"
  382. class="input"
  383. @focus="focusNote"
  384. @blur="blurNote"
  385. />
  386. </view>
  387. <view
  388. style="
  389. color: #007aff;
  390. font-size: 30rpx;
  391. font-weight: bold;
  392. width: 15%;
  393. text-align: center;
  394. "
  395. @click="postNote"
  396. >提交</view
  397. >
  398. </view>
  399. </template>
  400. <!-- 答疑的输入框 -->
  401. <view v-if="current == 3" class="inputBottom" :style="{ bottom: bottomHeight + 'px' }">
  402. <view class="flex_auto">
  403. <input
  404. v-model="ctxValue"
  405. height="60"
  406. fixed="true"
  407. :focus="isFocus"
  408. :placeholder="placeholder"
  409. type="text"
  410. :custom-style="inputStyle"
  411. :adjust-position="false"
  412. class="input"
  413. @focus="focusNote"
  414. @blur="blur"
  415. />
  416. </view>
  417. <view class="btn" @click="postContent">提交</view>
  418. </view>
  419. </view>
  420. <!-- 播放前拍照end -->
  421. <u-popup
  422. v-model="showSet"
  423. :mask-close-able="false"
  424. mode="center"
  425. border-radius="24"
  426. >
  427. <view
  428. style="
  429. align-items: center;
  430. padding: 0 40rpx;
  431. display: flex;
  432. flex-direction: column;
  433. justify-content: center;
  434. "
  435. >
  436. <view
  437. style="
  438. font-weight: bold;
  439. color: #333333;
  440. font-size: 30rpx;
  441. margin-top: 30rpx;
  442. "
  443. >温馨提示</view
  444. >
  445. <view
  446. style="
  447. width: 457rpx;
  448. color: #666666;
  449. font-size: 30rpx;
  450. margin-top: 30rpx;
  451. "
  452. >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
  453. 是否授权使用?</view
  454. >
  455. <view style="margin: 40rpx 0">
  456. <button
  457. open-type="openSetting"
  458. @bindopensetting="openSetting"
  459. class="btnSet"
  460. >
  461. 去授权
  462. </button>
  463. </view>
  464. </view>
  465. </u-popup>
  466. <u-mask :show="photoPopup">
  467. <!-- 播放前拍照start -->
  468. <view
  469. v-if="photoPopup"
  470. :mask-close-able="false"
  471. style="bottom: 0; position: fixed; width: 100%; z-index: 999"
  472. >
  473. <view class="photoBox">
  474. <view class="photoTop">
  475. <view class="sqzz" v-if="false"
  476. ><u-icon
  477. name="close"
  478. color="#333333"
  479. size="30"
  480. @click="closePhoto"
  481. ></u-icon
  482. ></view>
  483. <view class="centersq">请正视手机屏幕</view>
  484. <view class="sqzz"></view>
  485. </view>
  486. <view class="photoCenter">
  487. <view
  488. style="width: 100%; height: 979rpx; position: fixed"
  489. v-if="photoPopup && isTaking"
  490. >
  491. <camera
  492. device-position="front"
  493. flash="off"
  494. @error="error"
  495. style="width: 100%; height: 100%"
  496. ></camera>
  497. </view>
  498. <view class="custom" v-if="!isTaking"
  499. ><image :src="avatarUrl" mode=""></image
  500. ></view>
  501. </view>
  502. <view class="btns">
  503. <view class="btnResult" v-if="isTaking" @click="takePhoto"
  504. >拍照</view
  505. >
  506. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  507. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  508. </view>
  509. </view>
  510. </view>
  511. </u-mask>
  512. <u-popup
  513. v-model="noticeShow"
  514. class="notice_modal"
  515. @close="closeNotice"
  516. mode="center"
  517. border-radius="14"
  518. width="700rpx"
  519. height="900rpx"
  520. >
  521. <div class="content">
  522. <scroll-view scroll-y="true" style="height: 100%">
  523. <view class="title">学员须知</view>
  524. <text class="text">
  525. {{ goodsData.buyNote }}
  526. </text>
  527. </scroll-view>
  528. </div>
  529. </u-popup>
  530. <u-modal v-model="showMark" title="提示" @confirm="markConfirm" @cancel="markCancel" confirm-text="复制学习网址" :show-cancel-button="true"
  531. cancel-text="关闭">
  532. <view class="slot-content">
  533. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  534. <view>1.复制学习地址:{{markContent}}</view>
  535. <view>2.在【浏览器中】打开复制的学习网址</view>
  536. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  537. <view>(1)账号:您个人的身份证号码</view>
  538. <view>(2)密码:身份证号码,再加111111</view>
  539. </view>
  540. </u-modal>
  541. </view>
  542. </template>
  543. <script>
  544. import plv from "../static/polyv-sdk/index";
  545. import courseModule from "@/components/course/courseModule.vue";
  546. import courseChapter from "@/components/course/courseChapter.vue";
  547. import courseSection from "@/components/course/courseSection.vue";
  548. // import courseModuleMulu from "@/components/course/courseModuleMulu.vue"
  549. // import courseChapterMulu from "@/components/course/courseChapterMulu.vue";
  550. // import courseSectionMulu from "@/components/course/courseSectionMulu.vue";
  551. import {WEBVIEW_URL} from '@/common/request.js'
  552. // import { websocket } from "@/common/socket.js";
  553. import { mapGetters, mapMutations } from "vuex";
  554. export default {
  555. components: {
  556. courseModule,
  557. courseChapter,
  558. courseSection,
  559. // courseModuleMulu,
  560. // courseChapterMulu,
  561. // courseSectionMulu,
  562. },
  563. data() {
  564. return {
  565. markContent: 'http://admin.zhujianpeixun.com/',
  566. showMark: false,
  567. hasStart:false,
  568. channelItem:null,
  569. lockTimer: null,
  570. orderGoodsId: 0,
  571. noticeShow: false,
  572. navShow: true,
  573. enableAutoRotation: true,
  574. seekTime: "",
  575. toastTimer: null,
  576. videoToastShow: false,
  577. initLiveOk: false,
  578. livePlay: false, //是否正在播放直播,不含暂停
  579. liveDuration: 0, //直播观看时长
  580. videoOption: {
  581. mode: "live",
  582. uid: "",
  583. cid: "",
  584. openId: "",
  585. isAutoChange: false,
  586. forceVideo: false,
  587. },
  588. courseHandoutsData: "",
  589. liveDetail: {},
  590. showSet: false,
  591. startStatus: false,
  592. detail: {},
  593. courseId: 0,
  594. placeholder:
  595. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  596. inputStyle: {
  597. background: "rgba(244, 244, 244, 0.98)",
  598. borderRadius: "24rpx",
  599. padding: "8rpx",
  600. marginBottom: "10rpx",
  601. },
  602. list: [],
  603. menuList: [],
  604. current: 0,
  605. vid: "",
  606. goodsId: 0,
  607. goodsData: {},
  608. photoPopup: false,
  609. goodsPlayConfig: null,
  610. autoplay: false,
  611. isAllowSeek: "no",
  612. playbackRate: [1.0],
  613. timer: null,
  614. answerTimer: null,
  615. goodsPhotographConfig: null,
  616. intervalTimeList: [], // 间隔拍照时长
  617. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  618. playTime: 0, //页面播放时长,不含暂停
  619. currentTime: 0,
  620. avatarUrl: "",
  621. ossAvatarUrl: "",
  622. studyDuration: 0, // 当前视频时长
  623. gradeId: 0,
  624. chapterId: 0,
  625. moduleId: 0,
  626. reMenuList: [],
  627. answerList: [],
  628. assignUserId: 0,
  629. placeholder: "您可以在这里输入答疑内容",
  630. ctxValue: "",
  631. noteList: [],
  632. noteValue: "",
  633. noteId: 0,
  634. recordObj: 0,
  635. gradeDetail: {},
  636. isTaking: true, //是否正在拍照
  637. needSeek: false, //第一次播放是否需要跳转
  638. needProfileModal: false, //是否需要资料审核弹框
  639. liveObj: {},
  640. photoNum: 0,
  641. photoList: [], //拍照的时间点
  642. photoConfig: false, //是否配置好拍照次数
  643. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  644. photoHistoryList: [], //已拍照历史的下标点
  645. sectionItem: null,
  646. businessData: {},
  647. showNotes: true,
  648. menuIndex: [],
  649. uploadLock: false, //上传图片
  650. isPlayRebuild: false, //是否正在播放重修视频
  651. isRebuild: false, //视频是否从重修目录点击
  652. isFocus:false,
  653. clearTimer:null,
  654. livingItem:'',
  655. option:null,
  656. isOther:'',
  657. downLoading: false, //下载讲义加载
  658. muluStyle: false, //显示和隐藏目录样式
  659. bottomHeight: 0,
  660. };
  661. },
  662. computed: {
  663. ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
  664. },
  665. onLoad(option) {
  666. this.courseId = Number(option.id);
  667. this.goodsId = Number(option.goodsId);
  668. this.orderGoodsId = Number(option.orderGoodsId) || '';
  669. this.isOther = option.isOther
  670. this.option = option
  671. // this.courseDetail();
  672. // this.getGoodsDetail();
  673. // this.getAnswerList();
  674. // this.studyRecordMenuAllList();
  675. // this.answerTimer = setInterval(() => {
  676. // this.getAnswerList();
  677. // }, 5000);
  678. // let noteSecond = Number(option.noteSecond);
  679. // if (noteSecond > 0) {
  680. // //我的消息跳过来,播放节
  681. // let item = {
  682. // sectionId: Number(option.sectionId),
  683. // recordingUrl: option.recordingUrl,
  684. // noteSecond: noteSecond,
  685. // studyDuration: noteSecond,
  686. // };
  687. // let playNextId = `moduleId${option.moduleId}chapterId${
  688. // option.chapterId
  689. // }sectionId${option.sectionId}${option.isRebuild ? "isRebuild" : ""}`;
  690. // this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
  691. // this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  692. // this.$store.commit("updatePlayNextId", playNextId);
  693. // console.log("this.playNoteVideo");
  694. // this.playNoteVideo(item)
  695. // } else {
  696. // this.studyRecordQueryLiveLast();
  697. // }
  698. },
  699. onShow() {
  700. if(this.isOther) {
  701. this.showMark = true;
  702. return;
  703. }
  704. this.getbaseprofiletplists().then(res => {
  705. this.courseDetail();
  706. this.getGoodsDetail();
  707. this.getAnswerList();
  708. this.studyRecordMenuAllList();
  709. this.answerTimer = setInterval(() => {
  710. this.getAnswerList();
  711. }, 5000);
  712. let noteSecond = Number(this.option.noteSecond);
  713. if (noteSecond > 0) {
  714. //我的消息跳过来,播放节
  715. let item = {
  716. sectionId: Number(this.option.sectionId),
  717. recordingUrl: this.option.recordingUrl,
  718. noteSecond: noteSecond,
  719. studyDuration: noteSecond,
  720. };
  721. let playNextId = `moduleId${this.option.moduleId}chapterId${
  722. this.option.chapterId
  723. }sectionId${this.option.sectionId}${this.option.isRebuild ? "isRebuild" : ""}`;
  724. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
  725. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  726. this.$store.commit("updatePlayNextId", playNextId);
  727. this.playNoteVideo(item)
  728. } else {
  729. this.studyRecordQueryLiveLast();
  730. }
  731. });
  732. this.current = uni.getStorageSync('current') || 0
  733. },
  734. onHide() {
  735. },
  736. onUnload() {
  737. if (this.playSectionId > 0 && this.hasStart) {
  738. //退出提交记录
  739. this.postStudyRecord();
  740. }
  741. //清除正在播放的节ID
  742. // this.$store.commit('setPlayObj',null)
  743. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  744. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  745. this.$store.commit("setPlayVID", { playVID: null });
  746. this.closePlv();
  747. console.log("onUnload");
  748. //移除所有的事件监听器
  749. uni.$off();
  750. clearInterval(this.answerTimer);
  751. if (this.timer) {
  752. clearInterval(this.timer);
  753. }
  754. console.log(this.lockTimer, "this.lockTimer");
  755. if (this.lockTimer) {
  756. clearInterval(this.lockTimer);
  757. this.$api
  758. .lockDelLock({
  759. action: "jxjy",
  760. uuid:this.$method.getUuid()
  761. })
  762. .then((res) => {});
  763. }
  764. uni.removeStorageSync('current')
  765. // websocket.sendMsg("delAction");
  766. },
  767. mounted() {
  768. uni.$on("changeSection", (oldSectionId) => {
  769. console.log(this.playVID);
  770. this.hasStart = false;
  771. this.photoConfig = false;
  772. this.photoIndex = 0;
  773. var polyvPlayerContext = this.selectComponent("#playerVideo");
  774. if (polyvPlayerContext) {
  775. //解决同个节视频切换问题
  776. polyvPlayerContext.seek(0);
  777. polyvPlayerContext.pause();
  778. }
  779. //清除直播
  780. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  781. this.postStudyRecord(0, oldSectionId);
  782. });
  783. uni.$on("getSection", (item) => {
  784. //清除直播
  785. this.hasStart = false;
  786. this.isPlayRebuild = item.rebuild;
  787. this.photoConfig = false;
  788. this.photoIndex = 0;
  789. this.sectionItem = item;
  790. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  791. //获取拍照历史
  792. this.getPhotoLastRecord();
  793. this.playVideo(item);
  794. });
  795. uni.$on("levelId", (item) => {
  796. let arr = item.split("-");
  797. //点击节获取的各层级ID
  798. this.moduleId = arr[0];
  799. this.chapterId = arr[1];
  800. });
  801. uni.$on("getChannel", (item) => {
  802. //清除录播
  803. this.hasStart = false;
  804. this.$store.commit("setPlayVID", { playVID: null });
  805. this.getPhotoLastRecord();
  806. this.playChannel(item);
  807. this.channelItem = item;
  808. });
  809. uni.$on("isRebuild", (item) => {
  810. console.log(item);
  811. this.isRebuild = item;
  812. });
  813. this.updateChapterOpen(true);
  814. },
  815. methods: {
  816. ...mapMutations(["updateChapterOpen","updateLiveLast"]),
  817. clickLeft() {
  818. uni.navigateBack()
  819. },
  820. markCancel() {
  821. uni.navigateBack({
  822. delta:1
  823. })
  824. },
  825. markConfirm() {
  826. uni.setClipboardData({
  827. data: this.markContent,
  828. success: function() {
  829. setTimeout(() => {
  830. uni.navigateBack({
  831. delta:1
  832. })
  833. },1000)
  834. }
  835. });
  836. },
  837. closeNotice() {
  838. this.$api.baseHandoutTip({
  839. orderGoodsId:this.orderGoodsId
  840. }).then(res => {
  841. })
  842. },
  843. baseHandoutTipList() {
  844. this.$api.baseHandoutTipList({
  845. orderGoodsId:this.orderGoodsId
  846. }).then(res => {
  847. if(res.data.rows.length == 0) {
  848. this.noticeShow = true;
  849. }
  850. })
  851. },
  852. /**
  853. * 获取上次观看的直播
  854. */
  855. studyRecordGetLastLive() {
  856. this.$api.studyRecordGetLastLive({
  857. orderGoodsId:this.orderGoodsId,
  858. courseId:this.courseId
  859. }).then(res => {
  860. console.log(res,'liveres')
  861. this.updateLiveLast(res.data.data)
  862. })
  863. },
  864. studyRecordQueryLiveLast() {
  865. this.$api.studyRecordQueryLiveLast({
  866. orderGoodsId:this.orderGoodsId,
  867. courseId:this.courseId
  868. }).then(res => {
  869. console.log(res,'couse')
  870. if(res.data.data) {
  871. if(res.data.data.sectionType == 1) { //录播
  872. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  873. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  874. this.sectionItem = res.data.data;
  875. this.playVideo(res.data.data)
  876. } else if(res.data.data.sectionType == 2) { //直播
  877. this.studyRecordGetLastLive();
  878. } else if(res.data.data.sectionType == 3) { //回放
  879. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  880. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  881. this.sectionItem = res.data.data;
  882. this.playVideo(res.data.data)
  883. }
  884. }
  885. })
  886. },
  887. /**
  888. * 模块大节播放完毕,刷新列表
  889. */
  890. sectionPlayEnd(isRebuild, index) {
  891. console.log("sectionPlayEnd");
  892. console.log("isRebuild", isRebuild), console.log("index", index);
  893. if (this.reMenuList.length > 0) {
  894. //有重修目录
  895. if (isRebuild.isRebuild) {
  896. //从重修点击
  897. this.$api
  898. .reMenuList({
  899. orderGoodsId: this.orderGoodsId,
  900. courseId: this.courseId,
  901. rebuild: 1,
  902. gradeId: this.gradeId,
  903. })
  904. .then((res) => {
  905. console.log("Rebuild1");
  906. if (res.data.code == 200) {
  907. if (res.data.rows.length) {
  908. res.data.rows[index].name = res.data.rows[index].menuName;
  909. this.$set(this.reMenuList,index,res.data.rows[index])
  910. for (let i = 0; i < res.data.rows.length; i++) {
  911. let item = res.data.rows[i];
  912. item.down = true;
  913. item.id = item.menuId;
  914. item.name = item.menuName;
  915. }
  916. this.reMenuList = []
  917. this.$nextTick(() => {
  918. this.reMenuList = res.data.rows;
  919. console.log(this.reMenuList,'this.reMenuList1')
  920. })
  921. } else {
  922. this.reMenuList = [];
  923. }
  924. this.$nextTick(() => {
  925. if (this.reMenuList.length > 0) {
  926. this.list = [
  927. {
  928. name: "目录",
  929. },
  930. {
  931. name: "讲义",
  932. },
  933. {
  934. name: "笔记",
  935. },
  936. {
  937. name: "答疑",
  938. },
  939. { name: "重修目录" },
  940. ];
  941. } else {
  942. this.list = [
  943. {
  944. name: "目录",
  945. },
  946. {
  947. name: "讲义",
  948. },
  949. {
  950. name: "笔记",
  951. },
  952. {
  953. name: "答疑",
  954. },
  955. ];
  956. if (this.current == 4) {
  957. this.current = 0;
  958. }
  959. }
  960. });
  961. }
  962. });
  963. this.$api
  964. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  965. .then((res) => {
  966. console.log("noRebuild1");
  967. if (res.data.code == 200) {
  968. for (let i = 0; i < res.data.rows.length; i++) {
  969. let item = res.data.rows[i];
  970. item.down = true;
  971. item.id = item.menuId;
  972. item.name = item.menuName;
  973. item.menuType = item.type;
  974. }
  975. this.menuList = [];
  976. this.$nextTick(() => {
  977. this.menuList = res.data.rows;
  978. });
  979. }
  980. });
  981. } else {
  982. //从普通目录点击
  983. this.$api
  984. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  985. .then((res) => {
  986. console.log("noRebuild2");
  987. if (res.data.code == 200) {
  988. res.data.rows[index].name = res.data.rows[index].menuName;
  989. res.data.rows[index].id = res.data.rows[index].menuId;
  990. this.$set(this.menuList, index, res.data.rows[index]);
  991. }
  992. });
  993. this.$api
  994. .reMenuList({
  995. orderGoodsId: this.orderGoodsId,
  996. courseId: this.courseId,
  997. rebuild: 1,
  998. gradeId: this.gradeId,
  999. })
  1000. .then((res) => {
  1001. console.log("Rebuild2");
  1002. if (res.data.code == 200) {
  1003. if (res.data.rows.length) {
  1004. // for (let i = 0; i < res.data.rows.length; i++) {
  1005. // let item = res.data.rows[i];
  1006. // item.down = true;
  1007. // item.id = item.menuId;
  1008. // item.name = item.menuName;
  1009. // }
  1010. // this.reMenuList = res.data.rows;
  1011. } else {
  1012. this.reMenuList = [];
  1013. }
  1014. this.$nextTick(() => {
  1015. if (this.reMenuList.length > 0) {
  1016. this.list = [
  1017. {
  1018. name: "目录",
  1019. },
  1020. {
  1021. name: "讲义",
  1022. },
  1023. {
  1024. name: "笔记",
  1025. },
  1026. {
  1027. name: "答疑",
  1028. },
  1029. { name: "重修目录" },
  1030. ];
  1031. } else {
  1032. this.list = [
  1033. {
  1034. name: "目录",
  1035. },
  1036. {
  1037. name: "讲义",
  1038. },
  1039. {
  1040. name: "笔记",
  1041. },
  1042. {
  1043. name: "答疑",
  1044. },
  1045. ];
  1046. if (this.current == 4) {
  1047. this.current = 0;
  1048. }
  1049. }
  1050. });
  1051. }
  1052. });
  1053. }
  1054. } else {
  1055. //没有重修目录
  1056. this.$api
  1057. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId ,orderGoodsId: this.orderGoodsId,})
  1058. .then((res) => {
  1059. console.log("noRebuild3");
  1060. console.log("noRebuild3index", index);
  1061. if (res.data.code == 200) {
  1062. res.data.rows[index].name = res.data.rows[index].menuName;
  1063. res.data.rows[index].id = res.data.rows[index].menuId;
  1064. this.$set(this.menuList, index, res.data.rows[index]);
  1065. }
  1066. });
  1067. }
  1068. },
  1069. goLive(item) {
  1070. let moduleId = item.moduleId || 0;
  1071. let chapterId = item.chapterId || 0;
  1072. let sectionId = item.sectionId || item.menuId;
  1073. let uuid = new Date().valueOf() + ""
  1074. // buyCourse 是否购买课程:1是 0否
  1075. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
  1076. +item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+
  1077. '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
  1078. uni.navigateTo({
  1079. url:`../../pages/webview/index?url=`+encode
  1080. })
  1081. },
  1082. studyRecordMenuAllList() {
  1083. this.$api.studyRecordMenuAllList({
  1084. courseId:this.courseId,
  1085. gradeId:this.gradeId,
  1086. goodsId:this.goodsId
  1087. }).then(res => {
  1088. let nowTime = Number(new Date().getTime()/1000).toFixed(0)
  1089. // this.livingItem = res.data.data[0]
  1090. this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
  1091. })
  1092. },
  1093. getbaseprofiletplists() {
  1094. return new Promise(resolve => {
  1095. let self = this;
  1096. this.getCameraSetting();
  1097. this.$api.getbaseprofiletplists({ goodsId: self.goodsId,orderGoodsId: this.orderGoodsId, }).then((res) => {
  1098. console.log(res, "res1");
  1099. if (res.data.code === 200 && res.data.rows.length) {
  1100. if (res.data.rows[0].keyValue) {
  1101. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  1102. if (baseRes.data.code === 200) {
  1103. if (baseRes.data.data) {
  1104. self.$api
  1105. .getbaseprofiletpgetInfo({
  1106. goodsId: self.goodsId,
  1107. orderGoodsId: self.orderGoodsId,
  1108. })
  1109. .then((result) => {
  1110. console.log(result, "result");
  1111. if (result.data.code === 200) {
  1112. if (
  1113. !result.data.data ||
  1114. (result.data.data.status === 3 &&
  1115. result.data.data.changeStatus === 1)
  1116. ) {
  1117. if (!result.data.data) {
  1118. self.needProfileModal = true;
  1119. uni.showModal({
  1120. content: "请前往填写资料",
  1121. cancelText: "返回",
  1122. success: function (resultst) {
  1123. if (resultst.confirm) {
  1124. self.$navTo.togo("/pages2/verify/input", {
  1125. id: self.goodsId,
  1126. orderGoodsId: self.orderGoodsId,
  1127. });
  1128. }
  1129. if (resultst.cancel) {
  1130. uni.navigateBack();
  1131. }
  1132. },
  1133. });
  1134. } else {
  1135. self.needProfileModal = true;
  1136. uni.showModal({
  1137. content: "资料审核不通过,请前往重新填写",
  1138. cancelText: "返回",
  1139. success: function (resultst) {
  1140. if (resultst.confirm) {
  1141. self.$navTo.togo("/pages2/verify/input", {
  1142. id: self.goodsId,
  1143. orderGoodsId: self.orderGoodsId,
  1144. });
  1145. }
  1146. if (resultst.cancel) {
  1147. uni.navigateBack();
  1148. }
  1149. },
  1150. });
  1151. }
  1152. }
  1153. else if (
  1154. result.data.data.status === 1 &&
  1155. JSON.parse(res.data.rows[0].keyValue2)[0]
  1156. ) {
  1157. self.$api
  1158. .getbaseprofileStampgetInfo({
  1159. goodsId: self.goodsId,
  1160. orderGoodsId: self.orderGoodsId,
  1161. })
  1162. .then((k) => {
  1163. if (k.data.code === 200) {
  1164. if (
  1165. !k.data.data ||
  1166. (k.data.data.status === 3 &&
  1167. k.data.data.changeStatus === 1)
  1168. ) {
  1169. if (!k.data.data) {
  1170. self.needProfileModal = true;
  1171. uni.showModal({
  1172. cancelText: "返回",
  1173. content: "请前往填写盖章资料",
  1174. success: function (resultst) {
  1175. if (resultst.confirm) {
  1176. self.$navTo.togo(
  1177. "/pages2/verify/input2",
  1178. {
  1179. id: self.goodsId,
  1180. orderGoodsId: self.orderGoodsId,
  1181. }
  1182. );
  1183. }
  1184. if (resultst.cancel) {
  1185. uni.navigateBack();
  1186. }
  1187. },
  1188. });
  1189. } else {
  1190. self.needProfileModal = true;
  1191. uni.showModal({
  1192. cancelText: "返回",
  1193. content:
  1194. "资料盖章审核不通过,请前往重新填写",
  1195. success: function (resultst) {
  1196. if (resultst.confirm) {
  1197. self.$navTo.togo(
  1198. "/pages2/verify/input2",
  1199. {
  1200. id: self.goodsId,
  1201. orderGoodsId: self.orderGoodsId,
  1202. }
  1203. );
  1204. }
  1205. if (resultst.cancel) {
  1206. uni.navigateBack();
  1207. }
  1208. },
  1209. });
  1210. }
  1211. } else {
  1212. resolve();
  1213. }
  1214. }
  1215. });
  1216. } else {
  1217. resolve();
  1218. }
  1219. }
  1220. });
  1221. } else {
  1222. resolve();
  1223. }
  1224. }
  1225. });
  1226. } else {
  1227. resolve();
  1228. }
  1229. } else {
  1230. resolve();
  1231. }
  1232. });
  1233. if (this.gradeId > 0) {
  1234. //提交完资料返回判断是否已开班
  1235. this.getGradeInfo();
  1236. }
  1237. })
  1238. },
  1239. /**
  1240. * 获取业务层次详情
  1241. */
  1242. courseBusiness() {
  1243. this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1244. this.businessData = res.data.data;
  1245. });
  1246. },
  1247. /**
  1248. * 计算tabs宽度
  1249. */
  1250. itemWidth() {
  1251. return 100 / this.list.length + "%";
  1252. },
  1253. /**
  1254. * 获取讲义权限
  1255. */
  1256. courseHandouts() {
  1257. this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1258. this.courseHandoutsData = res.data.data;
  1259. });
  1260. },
  1261. findMenuNextSection(index) {
  1262. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1263. let item = this.reMenuList[i];
  1264. if (item.type == 3) {
  1265. return item;
  1266. }
  1267. }
  1268. return {};
  1269. },
  1270. loadedmetadata(e) {
  1271. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1272. this.hasStart = true;
  1273. uni.$off('playPause')
  1274. uni.$on('playPause',() => {
  1275. polyvPlayerContext.pause()
  1276. })
  1277. if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
  1278. this.postStudyRecord(0)
  1279. }
  1280. },
  1281. getPhotoLastRecord() {
  1282. let self = this;
  1283. let data = {
  1284. sectionId: parseInt(self.playSectionId),
  1285. goodsId: parseInt(self.goodsId),
  1286. courseId: parseInt(self.courseId),
  1287. gradeId: parseInt(self.gradeId),
  1288. chapterId: parseInt(self.chapterId),
  1289. moduleId: parseInt(self.moduleId),
  1290. orderGoodsId: this.orderGoodsId,
  1291. };
  1292. this.$api.getPhotoLastRecord(data).then((res) => {
  1293. if (res.data.code == 200) {
  1294. //清空历史数据
  1295. self.photoHistoryList = [];
  1296. this.photoIndex = 0;
  1297. self.photoList = [];
  1298. for (let i = 0; i < res.data.data.length; i++) {
  1299. //-2存储随机拍照数组
  1300. if (res.data.data[i].photoIndex == -2) {
  1301. self.photoList = res.data.data[i].timeInterval.split(",");
  1302. } else {
  1303. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1304. }
  1305. }
  1306. }
  1307. });
  1308. },
  1309. //postTime 只提交随机时间
  1310. postCoursePhotoRecord(postTime = false) {
  1311. return new Promise((resolve, reject) => {
  1312. let currentTime = 0;
  1313. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1314. if (polyvPlayerContext) {
  1315. currentTime = polyvPlayerContext.getCurrentTime();
  1316. }
  1317. let self = this;
  1318. let photoIndex = self.photoIndex;
  1319. let data = {
  1320. photo: self.ossAvatarUrl,
  1321. sectionId: parseInt(self.playSectionId),
  1322. goodsId: parseInt(self.goodsId),
  1323. courseId: parseInt(self.courseId),
  1324. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1325. gradeId: parseInt(self.gradeId),
  1326. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1327. photoNum: parseInt(self.photoNum),
  1328. chapterId: parseInt(self.chapterId),
  1329. moduleId: parseInt(self.moduleId),
  1330. timeInterval: postTime ? self.photoList.join(",") : "",
  1331. orderGoodsId: this.orderGoodsId,
  1332. };
  1333. console.log("提交接口", data);
  1334. this.$api
  1335. .coursePhotoRecord(data)
  1336. .then((res) => {
  1337. console.log(res,'postCoursePhotoRecord')
  1338. if (res.data.code == 200) {
  1339. resolve();
  1340. } else {
  1341. reject();
  1342. }
  1343. })
  1344. .catch((err) => {
  1345. reject();
  1346. });
  1347. });
  1348. },
  1349. randomNum(minNum, maxNum) {
  1350. switch (arguments.length) {
  1351. case 1:
  1352. return parseInt(Math.random() * minNum + 1, 10);
  1353. break;
  1354. case 2:
  1355. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1356. break;
  1357. default:
  1358. return 0;
  1359. break;
  1360. }
  1361. },
  1362. //配置随机拍照时间
  1363. configPhoto() {
  1364. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1365. let totalVideoTime = polyvPlayerContext.getDuration();
  1366. let duration = polyvPlayerContext.getCurrentTime();
  1367. let photoNum = this.photoNum;
  1368. if (!this.photoConfig) {
  1369. this.photoConfig = true;
  1370. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1371. // if(spaceTime<5){//区间小于5秒
  1372. // photoNum = Math.floor(totalVideoTime/5)
  1373. // spaceTime = 5
  1374. // }
  1375. // if(photoNum<1){
  1376. // photoNum = 1 //只要设置,至少拍一次
  1377. // spaceTime = totalVideoTime
  1378. // }
  1379. // let initSpace = 0
  1380. //没有历史拍照间隔数据
  1381. if (this.photoList.length == 0) {
  1382. if (totalVideoTime >= 900) {
  1383. //大于15分钟
  1384. if (photoNum == 1) {
  1385. //开头拍1张
  1386. this.photoList.push(0);
  1387. } else if (photoNum == 3) {
  1388. //拍3张
  1389. this.photoList.push(0); //开头拍一张
  1390. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1391. let centerMinTime = centerTime - 300; //前后5分钟
  1392. let centerMaxTime = centerTime + 300;
  1393. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1394. this.photoList.push(centerTakeTime); //中间拍一张
  1395. let endMaxTime = totalVideoTime - 60;
  1396. let endMinTime = totalVideoTime - 300;
  1397. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1398. this.photoList.push(endTakeTime); //最后拍一张
  1399. }
  1400. } else {
  1401. //小于15分钟,只拍前后各一张
  1402. if (photoNum == 1) {
  1403. //开头拍1张
  1404. this.photoList.push(0);
  1405. } else if (photoNum == 3) {
  1406. //拍2张
  1407. if (totalVideoTime <= 300) {
  1408. //小于5分钟
  1409. this.photoList.push(0); //开头拍一张
  1410. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1411. this.photoList.push(endTakeTime);
  1412. } else {
  1413. this.photoList.push(0); //开头拍一张
  1414. let endMaxTime = totalVideoTime - 60;
  1415. let endMinTime = totalVideoTime - 300;
  1416. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1417. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1418. }
  1419. }
  1420. }
  1421. // for(let i=0;i<photoNum;i++){
  1422. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1423. // if(s>totalVideoTime){
  1424. // s = totalVideoTime-1
  1425. // }
  1426. // if(s<=5){
  1427. // s =5 //避免出现5秒内拍照时间
  1428. // }
  1429. // this.photoList.push(s)
  1430. // initSpace+=spaceTime
  1431. // }
  1432. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1433. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1434. }
  1435. console.log(this.photoList, "随机拍照时间数组");
  1436. //兼容已有观看历史
  1437. for (let i = 0; i < this.photoList.length - 1; i++) {
  1438. if (
  1439. this.photoList[i] < duration &&
  1440. this.photoList[i + 1] > duration
  1441. ) {
  1442. this.photoIndex = i + 1;
  1443. // console.log("我的修改了photoIndex")
  1444. break;
  1445. }
  1446. if (duration > this.photoList[this.photoList.length - 1]) {
  1447. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1448. // console.log("我的修改了photoIndex")
  1449. break;
  1450. }
  1451. }
  1452. }
  1453. },
  1454. getLiveUid(channelId) {
  1455. let self = this;
  1456. return new Promise((resolve) => {
  1457. let data = {
  1458. channelId: channelId,
  1459. orderGoodsId: this.orderGoodsId,
  1460. };
  1461. self.$api.polyvSign(data).then((res) => {
  1462. resolve(res.data.data);
  1463. });
  1464. });
  1465. },
  1466. timeEventLiving() {
  1467. if (plv != null) {
  1468. if (this.livePlay) {
  1469. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1470. if (this.liveDuration == 2) {
  1471. //直播第2秒拍照
  1472. console.log(this.channelItem)
  1473. console.log(this.photoHistoryList,'this.photoHistoryList')
  1474. if (
  1475. this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
  1476. this.channelItem.learning != 1 && this.photoHistoryList.length == 0
  1477. ) {
  1478. //开启直播拍照
  1479. this.openPhoto();
  1480. } else {
  1481. this.postStudyRecord(0);
  1482. }
  1483. }
  1484. }
  1485. }
  1486. },
  1487. playerLiveStatusChange(e) {
  1488. const status = e.detail.status;
  1489. console.log("直播状态", status);
  1490. if (status === "live") {
  1491. console.log("开始直播");
  1492. //开始播放
  1493. if (this.timer) {
  1494. clearInterval(this.timer);
  1495. }
  1496. this.livePlay = true;
  1497. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1498. }
  1499. if (status === "end") {
  1500. this.hasStart = false;
  1501. if (this.livePlay) {
  1502. //只有播放过的结束才提交,避免未开播触发结束
  1503. this.postStudyRecord(1);
  1504. }
  1505. console.log("结束直播");
  1506. this.livePlay = false;
  1507. // 未开始
  1508. }
  1509. },
  1510. closePlv() {
  1511. if (plv) {
  1512. plv.destroy();
  1513. }
  1514. },
  1515. playChannel(item) {
  1516. if (this.timer) {
  1517. clearInterval(this.timer);
  1518. }
  1519. this.startStatus = true;
  1520. this.initLive();
  1521. },
  1522. setLiveOption(status) {
  1523. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  1524. this.detail;
  1525. const playRecordFile =
  1526. playbackEnabled && recordFileSimpleModel && status === "end";
  1527. this.videoOption = {
  1528. mode: "live",
  1529. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1530. cid: this.playChannelId,
  1531. openId: this.userInfo.userAccount,
  1532. isAutoChange: false,
  1533. forceVideo: false,
  1534. };
  1535. },
  1536. async initLive() {
  1537. console.log(this.playChannelId, 7111);
  1538. this.liveObj = await this.getLiveUid(this.playChannelId);
  1539. this.initLiveOk = true;
  1540. let optionsData = {};
  1541. optionsData.mode = "live";
  1542. optionsData.forceVideo = false;
  1543. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  1544. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  1545. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  1546. let self = this;
  1547. this.closePlv();
  1548. plv.init(optionsData).then(({ detail, chat }) => {
  1549. self.liveDetail = detail;
  1550. // 设置mode为live的videoOption
  1551. this.setLiveOption();
  1552. if (detail.isPPT) {
  1553. chat.on(chat.events.SLICESTART, () => {
  1554. // 开始直播
  1555. });
  1556. } else {
  1557. plv.api.getOrdinaryLiveStatus(detail.stream);
  1558. }
  1559. });
  1560. },
  1561. openSetting(res) {
  1562. console.log(res, 98);
  1563. },
  1564. getCameraSetting() {
  1565. const self = this;
  1566. wx.getSetting({
  1567. success: (res) => {
  1568. if (res.authSetting["scope.camera"]) {
  1569. // 用户已经授权
  1570. self.showSet = false;
  1571. } else {
  1572. // 用户还没有授权,向用户发起授权请求
  1573. wx.authorize({
  1574. scope: "scope.camera",
  1575. success() {
  1576. // 用户同意授权
  1577. self.showSet = false;
  1578. },
  1579. fail() {
  1580. // 用户不同意授权
  1581. self.showSet = true;
  1582. /* wx.showToast({
  1583. title: '摄像头授权失败',
  1584. icon: 'none',
  1585. duration: 3000
  1586. }) */
  1587. },
  1588. });
  1589. }
  1590. },
  1591. fail: (res) => {},
  1592. });
  1593. },
  1594. studyNotice() {
  1595. this.noticeShow = true;
  1596. },
  1597. //播放笔记视频
  1598. async playNoteVideo(item) {
  1599. console.log(item, "noteItem");
  1600. if (this.timer) {
  1601. clearInterval(this.timer);
  1602. }
  1603. if (this.vid) {
  1604. //切换视频
  1605. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1606. polyvPlayerContext.changeVid(item.recordingUrl);
  1607. } else {
  1608. this.vid = item.recordingUrl;
  1609. }
  1610. this.recordObj = { videoCurrentTime: item.noteSecond };
  1611. if (this.recordObj.videoCurrentTime) {
  1612. this.needSeek = true; //需要跳转到播放记录
  1613. }
  1614. this.startStatus = true;
  1615. //获取节笔记
  1616. this.getNoteList();
  1617. },
  1618. //正常播放视频
  1619. async playVideo(item) {
  1620. console.log(item,'222');
  1621. if (this.timer) {
  1622. clearInterval(this.timer);
  1623. }
  1624. if (this.vid) {
  1625. //切换视频
  1626. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1627. polyvPlayerContext.changeVid(item.recordingUrl);
  1628. } else {
  1629. this.vid = item.recordingUrl;
  1630. }
  1631. this.recordObj = null;
  1632. this.recordObj = await this.getRecordLast();
  1633. this.needSeek = true; //跳转到播放记录
  1634. this.startStatus = true;
  1635. //获取节笔记
  1636. this.getNoteList();
  1637. },
  1638. getRecordLast() {
  1639. let self = this;
  1640. return new Promise((resolve) => {
  1641. let data = {
  1642. gradeId: Number(self.gradeId),
  1643. goodsId: Number(self.goodsId),
  1644. sectionId: Number(self.playSectionId),
  1645. courseId: Number(self.courseId),
  1646. chapterId: parseInt(self.chapterId),
  1647. moduleId: parseInt(self.moduleId),
  1648. orderGoodsId: this.orderGoodsId,
  1649. };
  1650. self.$api.recordLast(data).then((res) => {
  1651. resolve(res.data.data);
  1652. });
  1653. });
  1654. },
  1655. jumpNote(item) {
  1656. this.noteId = item.noteId;
  1657. //没视频播放
  1658. if (this.playSectionId == 0) {
  1659. console.log("即将跳到笔记位置1");
  1660. this.$u.toast("即将跳到笔记位置");
  1661. this.$store.commit("setPlaySectionId", {
  1662. playSectionId: item.sectionId,
  1663. });
  1664. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1665. this.playNoteVideo(item);
  1666. } else {
  1667. //正在看当前笔记视频
  1668. console.log("即将跳到笔记位置2");
  1669. this.$u.toast("即将跳到笔记位置");
  1670. //跳到笔记时刻
  1671. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1672. polyvPlayerContext.seek(item.noteSecond);
  1673. polyvPlayerContext.play();
  1674. }
  1675. },
  1676. postNote() {
  1677. let self = this;
  1678. if (!(this.playSectionId > 0)) {
  1679. this.$u.toast("目前无播放视频");
  1680. return;
  1681. }
  1682. if (!this.noteValue) {
  1683. this.$u.toast("请输入内容");
  1684. return;
  1685. }
  1686. if (!this.gradeId) {
  1687. this.$u.toast("暂无班级数据");
  1688. return;
  1689. }
  1690. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1691. let noteDate = this.$method.getZeroTime();
  1692. let noteSecond = polyvPlayerContext.getCurrentTime();
  1693. console.log(noteSecond, 698);
  1694. if (!noteSecond) {
  1695. if (noteSecond == 0) {
  1696. //播放结束
  1697. noteSecond = polyvPlayerContext.getDuration();
  1698. console.log(noteSecond, 63398);
  1699. }
  1700. if (!noteSecond) {
  1701. this.$u.toast("视频暂未开始");
  1702. return;
  1703. }
  1704. }
  1705. let data = {
  1706. gradeId: this.gradeId,
  1707. goodsId: this.goodsId,
  1708. sectionId: this.playSectionId,
  1709. courseId: this.courseId,
  1710. noteText: this.noteValue,
  1711. noteDate: noteDate,
  1712. noteSecond: noteSecond,
  1713. orderGoodsId: this.orderGoodsId,
  1714. };
  1715. this.$api.postNote(data).then((res) => {
  1716. if (res.data.code == 200) {
  1717. this.$u.toast("发布成功");
  1718. self.getNoteList();
  1719. this.noteValue = "";
  1720. }
  1721. });
  1722. },
  1723. getGradeInfo() {
  1724. let self = this;
  1725. this.$store.state.allowLoading = false;
  1726. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  1727. if (res.data.code == 200) {
  1728. self.gradeDetail = res.data.data;
  1729. if (self.needProfileModal) {
  1730. return;
  1731. }
  1732. if (self.gradeDetail.learningStatus == 2) {
  1733. uni.showModal({
  1734. showCancel: false,
  1735. confirmText: "确定",
  1736. content:
  1737. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1738. success: function (resultst) {
  1739. uni.navigateBack();
  1740. },
  1741. });
  1742. }
  1743. if (
  1744. self.gradeDetail.learningStatus == 3 &&
  1745. Number(self.gradeDetail.learningTimeStart) >
  1746. Number(new Date() / 1000)
  1747. ) {
  1748. uni.showModal({
  1749. showCancel: false,
  1750. cancelText: "返回",
  1751. content:
  1752. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1753. success: function (resultst) {
  1754. uni.navigateBack();
  1755. },
  1756. });
  1757. }
  1758. }
  1759. });
  1760. this.$store.state.allowLoading = true;
  1761. },
  1762. getNoteList() {
  1763. let self = this;
  1764. self.noteList = [];
  1765. let data = {
  1766. courseId: this.courseId,
  1767. gradeId: this.gradeId,
  1768. goodsId: this.goodsId,
  1769. orderGoodsId: this.orderGoodsId,
  1770. };
  1771. if (this.playSectionId > 0) {
  1772. data.sectionId = this.playSectionId;
  1773. }
  1774. this.$api.noteList(data).then((res) => {
  1775. if (res.data.code == 200) {
  1776. self.noteList = res.data.rows;
  1777. }
  1778. });
  1779. },
  1780. delAnswer(answerId) {
  1781. let self = this;
  1782. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  1783. this.$api.delAnswer(data).then((res) => {
  1784. if (res.data.code == 200) {
  1785. self.getAnswerList();
  1786. }
  1787. });
  1788. },
  1789. clearCtx() {
  1790. console.log(4234);
  1791. this.placeholder = "您可以在这里输入答疑内容";
  1792. this.ctxValue = "";
  1793. this.assignUserId = 0;
  1794. },
  1795. focusNote(event) {
  1796. console.log('event', event.detail.height)
  1797. this.bottomHeight = event.detail.height
  1798. },
  1799. blurNote() {
  1800. this.bottomHeight = 0
  1801. },
  1802. blur() {
  1803. this.bottomHeight = 0
  1804. this.clearTimer = setTimeout(() => {
  1805. this.ctxValue = ""
  1806. this.isFocus = false;
  1807. this.assignUserId = 0;
  1808. this.placeholder = '您可以在这里输入答疑内容';
  1809. },2000)
  1810. },
  1811. replyContent(item) {
  1812. this.isFocus = true;
  1813. this.assignUserId = item.userId;
  1814. this.placeholder = "@" + item.realname;
  1815. },
  1816. delContent(item) {
  1817. this.delAnswer(item.answerId);
  1818. },
  1819. postAnswer() {
  1820. let self = this;
  1821. let data = {
  1822. courseId: this.courseId,
  1823. answerText: this.ctxValue,
  1824. goodsId: this.goodsId,
  1825. orderGoodsId: this.orderGoodsId,
  1826. };
  1827. if (this.assignUserId > 0) {
  1828. data.assignUserId = this.assignUserId;
  1829. }
  1830. this.$api.postAnswer(data).then((res) => {
  1831. if (res.data.code == 200) {
  1832. this.$u.toast("发布成功");
  1833. self.getAnswerList();
  1834. this.isFocus = false;
  1835. this.placeholder = "您可以在这里输入答疑内容";
  1836. this.ctxValue = "";
  1837. this.assignUserId = 0;
  1838. }
  1839. });
  1840. },
  1841. postContent() {
  1842. if (!this.ctxValue || this.ctxValue == "") {
  1843. this.$u.toast("请输入内容");
  1844. return;
  1845. }
  1846. this.postAnswer();
  1847. },
  1848. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1849. console.log("status", status);
  1850. let currentTime = 0;
  1851. let PlayDuration = 0;
  1852. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1853. if (polyvPlayerContext) {
  1854. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  1855. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  1856. }
  1857. if (this.playChannelId > 0) {
  1858. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1859. }
  1860. let self = this;
  1861. let data = {
  1862. photo: self.ossAvatarUrl,
  1863. sectionId: parseInt(sectionId),
  1864. goodsId: parseInt(self.goodsId),
  1865. courseId: parseInt(self.courseId),
  1866. orderGoodsId: this.orderGoodsId,
  1867. studyDuration: parseInt(
  1868. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1869. ),
  1870. gradeId: parseInt(self.gradeId),
  1871. chapterId: parseInt(self.chapterId),
  1872. moduleId: parseInt(self.moduleId),
  1873. videoCurrentTime: parseInt(
  1874. currentTime > 0 ? currentTime : self.studyDuration
  1875. ),
  1876. };
  1877. if (status > 0) {
  1878. console.log(sectionId, "sectionId");
  1879. data.status = status;
  1880. }
  1881. console.log("提交接口", data);
  1882. this.$api.studyRecord(data).then((res) => {
  1883. if (res.data.code == 200) {
  1884. if (status > 0) {
  1885. let moduleId = this.moduleId || 0;
  1886. let chapterId = this.chapterId || 0;
  1887. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1888. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1889. console.log(playNextId, "playNextId");
  1890. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  1891. uni.$emit("playNext" + playNextIdisRebuild, {
  1892. fromRebuild: this.isRebuild,
  1893. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1894. uni.$emit("playNext" + playNextId); //通知播放结束
  1895. }
  1896. self.ossAvatarUrl = "";
  1897. } else {
  1898. this.uploadLock = false;
  1899. uni.showToast({
  1900. icon: "none",
  1901. title: res.data.msg,
  1902. });
  1903. }
  1904. console.log(res, "res");
  1905. });
  1906. },
  1907. uploadFile(options, int) {
  1908. console.log(options)
  1909. var self = this;
  1910. return new Promise((resolve, reject) => {
  1911. var data = {
  1912. imageStatus: int,
  1913. gradeId: this.gradeId,
  1914. orderGoodsId: this.orderGoodsId,
  1915. };
  1916. self.$api.aliyunpolicy(data).then((res) => {
  1917. if (res.data.code != 200) {
  1918. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1919. return;
  1920. }
  1921. var ossToken = res.data.data.resultContent;
  1922. if (ossToken.host == null || ossToken.host == undefined) {
  1923. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1924. return;
  1925. }
  1926. uni.uploadFile({
  1927. url: ossToken.host,
  1928. name: "file",
  1929. filePath: options,
  1930. fileType: "image",
  1931. header: {
  1932. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1933. },
  1934. formData: {
  1935. key: ossToken.dir,
  1936. OSSAccessKeyId: ossToken.accessid,
  1937. policy: ossToken.policy,
  1938. Signature: ossToken.signature,
  1939. callback: ossToken.callback,
  1940. success_action_status: 200,
  1941. },
  1942. success: (result) => {
  1943. // if (result.statusCode === 200) {
  1944. this.$u.toast('上传成功')
  1945. self.ossAvatarUrl = ossToken.dir;
  1946. resolve();
  1947. // } else {
  1948. // uni.showToast({
  1949. // title: "上传失败",
  1950. // icon: "none",
  1951. // });
  1952. // this.openPhoto();
  1953. // return;
  1954. // }
  1955. },
  1956. fail: (error) => {
  1957. uni.showToast({
  1958. title: "上传接口报错,请重新拍照上传" + error,
  1959. icon: "none",
  1960. });
  1961. this.openPhoto();
  1962. return;
  1963. },
  1964. });
  1965. });
  1966. });
  1967. },
  1968. imageInfos() {
  1969. var self = this;
  1970. return new Promise((resolve, reject) => {
  1971. uni.getImageInfo({
  1972. src: self.avatarUrl,
  1973. success: async (res) => {
  1974. let canvasWidth = res.width; //图片原始长宽
  1975. let canvasHeight = res.height;
  1976. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1977. uni.compressImage({
  1978. src: self.avatarUrl,
  1979. quality: 75,
  1980. width: "35%",
  1981. height: "35%",
  1982. success: async (rest) => {
  1983. const waitUpload = await self.uploadFile(
  1984. rest.tempFilePath,
  1985. 0
  1986. );
  1987. resolve(waitUpload);
  1988. },
  1989. });
  1990. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1991. uni.compressImage({
  1992. src: self.avatarUrl,
  1993. quality: 75,
  1994. width: "50%",
  1995. height: "50%",
  1996. success: async (rest) => {
  1997. const waitUpload = await self.uploadFile(
  1998. rest.tempFilePath,
  1999. 0
  2000. );
  2001. resolve(waitUpload);
  2002. },
  2003. });
  2004. } else {
  2005. console.log("无需压缩");
  2006. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2007. resolve(waitUpload);
  2008. }
  2009. },
  2010. fail: (err) => {
  2011. this.$u.toast('图片上传失败')
  2012. }
  2013. });
  2014. });
  2015. },
  2016. timeEvent() {
  2017. let self = this;
  2018. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2019. if (polyvPlayerContext != null) {
  2020. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2021. // console.log(this.playTime,789,this.photoHistoryList)
  2022. //判断是否需要拍照
  2023. if (this.photoNum > 0) {
  2024. this.configPhoto();
  2025. let photoTime = 0; //获取拍照秒数
  2026. for (let i = 0; i < this.photoList.length; i++) {
  2027. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2028. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2029. //3秒区间内才触发拍照,避免拉动滚动条
  2030. if (
  2031. this.photoHistoryList.indexOf(i) < 0 &&
  2032. this.sectionItem.learning != 1
  2033. ) {
  2034. //不存在拍照历史,没有重修过,没有学过,则拍照
  2035. //启动拍照
  2036. //暂停
  2037. polyvPlayerContext.exitFullScreen();
  2038. polyvPlayerContext.pause();
  2039. this.photoIndex = i;
  2040. this.openPhoto();
  2041. }
  2042. }
  2043. }
  2044. }
  2045. }
  2046. },
  2047. closeToast() {
  2048. clearTimeout(this.toastTimer);
  2049. this.videoToastShow = false;
  2050. },
  2051. restart() {
  2052. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2053. polyvPlayerContext.seek(0);
  2054. clearTimeout(this.toastTimer);
  2055. this.videoToastShow = false;
  2056. },
  2057. onStateChange(newstate, oldstate) {
  2058. if (newstate.detail.newstate == "playing") {
  2059. if (this.needSeek) {
  2060. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2061. if (this.recordObj.videoCurrentTime) {
  2062. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  2063. this.seekTime = this.$method.secondToDate(
  2064. this.recordObj.videoCurrentTime
  2065. );
  2066. this.videoToastShow = true;
  2067. this.toastTimer = setTimeout(() => {
  2068. this.videoToastShow = false;
  2069. }, 3000);
  2070. } else {
  2071. polyvPlayerContext.seek(1); //避免相同节继续播放
  2072. }
  2073. polyvPlayerContext.play();
  2074. this.needSeek = false;
  2075. }
  2076. //开始播放
  2077. if (this.timer) {
  2078. clearInterval(this.timer);
  2079. }
  2080. this.timer = setInterval(this.timeEvent, 1000); //定时器
  2081. }
  2082. if (newstate.detail.newstate == "pause") {
  2083. clearInterval(this.timer);
  2084. //暂停提交记录
  2085. /* this.ossAvatarUrl = ""
  2086. this.postStudyRecord() */
  2087. }
  2088. if (newstate.detail.newstate == "ended") {
  2089. clearInterval(this.timer);
  2090. uni.showToast({
  2091. icon: "none",
  2092. title: "播放完毕",
  2093. });
  2094. this.hasStart = false;
  2095. this.postStudyRecord(1);
  2096. // uni.$emit('playNext') //播放重修下一节
  2097. }
  2098. },
  2099. //拍照
  2100. openPhoto() {
  2101. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2102. if (polyvPlayerContext) {
  2103. polyvPlayerContext.exitFullScreen();
  2104. }
  2105. this.enableAutoRotation = false;
  2106. this.photoPopup = true;
  2107. this.isTaking = true;
  2108. uni.setKeepScreenOn({
  2109. keepScreenOn: true,
  2110. });
  2111. uni.authorize({
  2112. scope: "scope.camera",
  2113. success() {},
  2114. });
  2115. },
  2116. /**
  2117. * 人脸匹配
  2118. */
  2119. faceRecognition() {
  2120. return new Promise((resolve) => {
  2121. let fileSystem = uni.getFileSystemManager();
  2122. fileSystem.readFile({
  2123. filePath: `${this.avatarUrl}`,
  2124. encoding: "base64",
  2125. position: 0,
  2126. success: (res) => {
  2127. console.log(res);
  2128. let base64 = "data:image/jpg;base64," + res.data;
  2129. console.log({
  2130. imageA: base64,
  2131. orderGoodsId: this.orderGoodsId,
  2132. gradeId: this.gradeId,
  2133. },'base64Data')
  2134. this.$api
  2135. .faceCertificationCompareFace({
  2136. imageA: base64,
  2137. orderGoodsId: this.orderGoodsId,
  2138. gradeId: this.gradeId,
  2139. })
  2140. .then((res) => {
  2141. console.log(res, "res");
  2142. resolve(res.data.data);
  2143. });
  2144. },
  2145. fail(err) {
  2146. console.error(err, "err");
  2147. },
  2148. });
  2149. });
  2150. },
  2151. async submit() {
  2152. if (this.uploadLock) {
  2153. return;
  2154. }
  2155. this.uploadLock = true;
  2156. let compareFaceData = await this.faceRecognition();
  2157. console.log(compareFaceData,'compareFaceData')
  2158. if (compareFaceData >= 80) {
  2159. const waitYS = await this.imageInfos();
  2160. this.postCoursePhotoRecord()
  2161. .then((res) => {
  2162. this.photoHistoryList.push(this.photoIndex);
  2163. this.postStudyRecord(); //提交记录
  2164. //恢复播放
  2165. uni.setKeepScreenOn({
  2166. keepScreenOn: false,
  2167. });
  2168. this.photoPopup = false;
  2169. this.uploadLock = false;
  2170. this.enableAutoRotation = true;
  2171. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2172. if (polyvPlayerContext != null) {
  2173. polyvPlayerContext.play();
  2174. }
  2175. })
  2176. .catch((err) => {
  2177. uni.showToast({
  2178. title: "上传接口报错,请重新拍照上传" + err,
  2179. icon: "none",
  2180. });
  2181. this.uploadLock = false;
  2182. this.openPhoto();
  2183. });
  2184. } else {
  2185. uni.showToast({
  2186. title: "人脸匹配不通过,请重新拍照上传",
  2187. icon: "none",
  2188. duration: 2000,
  2189. });
  2190. setTimeout(() => {
  2191. this.uploadLock = false;
  2192. this.openPhoto();
  2193. }, 2000);
  2194. return;
  2195. }
  2196. },
  2197. reTake() {
  2198. this.isTaking = true;
  2199. },
  2200. //确认拍照
  2201. takePhoto() {
  2202. var self = this;
  2203. const ctx = uni.createCameraContext();
  2204. ctx.takePhoto({
  2205. quality: "high",
  2206. success: (res) => {
  2207. self.avatarUrl = res.tempImagePath;
  2208. this.isTaking = false;
  2209. // self.submit();
  2210. // self.photoPopup = false;
  2211. // self.enableAutoRotation = true;
  2212. },
  2213. fail: (err) => {
  2214. },
  2215. });
  2216. },
  2217. playError(e) {
  2218. console.log(e);
  2219. },
  2220. //拍照报错
  2221. error(e) {
  2222. console.log(e.detail);
  2223. },
  2224. //关闭相机
  2225. closePhoto() {
  2226. this.photoPopup = false;
  2227. self.enableAutoRotation = true;
  2228. },
  2229. /**
  2230. * 进入全屏
  2231. */
  2232. fullscreenchange(event) {
  2233. console.log('进入全屏',event);
  2234. if (event.detail.direction == "vertical") {
  2235. this.navShow = true;
  2236. } else if (event.detail.direction == "horizontal") {
  2237. this.navShow = false;
  2238. }
  2239. },
  2240. getGoodsDetail() {
  2241. let self = this;
  2242. this.$api.goodsDetail(this.goodsId).then((res) => {
  2243. self.goodsData = res.data.data;
  2244. if(self.goodsData.buyNote) {
  2245. this.baseHandoutTipList()
  2246. }
  2247. self.gradeId = self.goodsData.gradeId;
  2248. console.log(self.gradeId, "班级ID");
  2249. this.courseBusiness();
  2250. this.courseHandouts();
  2251. self.getMenuList();
  2252. self.getReMenuList(); //获取重修目录
  2253. setTimeout(function () {
  2254. if (!self.needProfileModal) {
  2255. self.getGradeInfo();
  2256. }
  2257. }, 500);
  2258. //获取节笔记
  2259. this.getNoteList();
  2260. if (self.goodsData.goodsPlayConfig) {
  2261. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2262. if (self.goodsPlayConfig.autoPlay > 0) {
  2263. self.autoplay = true;
  2264. }
  2265. if (self.goodsPlayConfig.drag > 0) {
  2266. self.isAllowSeek = "yes";
  2267. }
  2268. if (self.goodsPlayConfig.speed > 0) {
  2269. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2270. }
  2271. }
  2272. if (self.goodsData.goodsPhotographConfig) {
  2273. self.goodsPhotographConfig = JSON.parse(
  2274. self.goodsData.goodsPhotographConfig
  2275. );
  2276. if (self.goodsPhotographConfig.photoNum > 0) {
  2277. self.photoNum = self.goodsPhotographConfig.photoNum;
  2278. console.log(self.photoNum, 777777);
  2279. }
  2280. }
  2281. });
  2282. },
  2283. startVideo() {
  2284. this.startStatus = true;
  2285. },
  2286. getAnswerList() {
  2287. let self = this;
  2288. this.$api
  2289. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2290. .then((res) => {
  2291. if (res.data.code == 200) {
  2292. self.answerList = res.data.rows;
  2293. }
  2294. });
  2295. },
  2296. getReMenuList() {
  2297. let self = this;
  2298. this.$api
  2299. .reMenuList({
  2300. orderGoodsId: this.orderGoodsId,
  2301. courseId: this.courseId,
  2302. rebuild: 1,
  2303. gradeId: this.gradeId,
  2304. })
  2305. .then((res) => {
  2306. if (res.data.code == 200) {
  2307. for (let i = 0; i < res.data.rows.length; i++) {
  2308. let item = res.data.rows[i];
  2309. item.down = true;
  2310. item.id = item.menuId;
  2311. item.name = item.menuName;
  2312. }
  2313. self.reMenuList = res.data.rows;
  2314. if (self.reMenuList.length > 0) {
  2315. this.showNotes = false;
  2316. self.list = [
  2317. {
  2318. name: "目录",
  2319. },
  2320. {
  2321. name: "讲义",
  2322. },
  2323. {
  2324. name: "笔记",
  2325. },
  2326. {
  2327. name: "答疑",
  2328. },
  2329. { name: "重修目录" },
  2330. ];
  2331. this.current = 0;
  2332. } else {
  2333. self.list = [
  2334. {
  2335. name: "目录",
  2336. },
  2337. {
  2338. name: "讲义",
  2339. },
  2340. {
  2341. name: "笔记",
  2342. },
  2343. {
  2344. name: "答疑",
  2345. },
  2346. ];
  2347. this.current = 0;
  2348. }
  2349. }
  2350. });
  2351. },
  2352. getMenuList() {
  2353. let self = this;
  2354. this.$api
  2355. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2356. .then((res) => {
  2357. if (res.data.code == 200) {
  2358. for (let i = 0; i < res.data.rows.length; i++) {
  2359. let item = res.data.rows[i];
  2360. item.down = true;
  2361. item.id = item.menuId;
  2362. item.name = item.menuName;
  2363. item.menuType = item.type;
  2364. }
  2365. self.menuList = res.data.rows;
  2366. for (let i = 0; i < res.data.rows.length; i++) {
  2367. if (res.data.rows[i].type == 1) {
  2368. this.menuIndex = [i];
  2369. break;
  2370. } else if (res.data.rows[i].type == 2) {
  2371. this.menuIndex = [i];
  2372. break;
  2373. }
  2374. }
  2375. }
  2376. });
  2377. },
  2378. courseDetail() {
  2379. let self = this;
  2380. this.$api.courseDetail(this.courseId).then((res) => {
  2381. if (res.data.code == 200) {
  2382. // if (res.data.data.educationName == "继续教育") {
  2383. this.$api
  2384. .lockLockAction({
  2385. action: "jxjy",
  2386. uuid:this.$method.getUuid()
  2387. })
  2388. .then((res) => {});
  2389. this.lockTimer = setInterval(() => {
  2390. this.$api
  2391. .lockLockAction({
  2392. action: "jxjy",
  2393. uuid:this.$method.getUuid()
  2394. })
  2395. .then((res) => {});
  2396. }, 10000);
  2397. // websocket.sendMsg("doCourse");
  2398. // }
  2399. self.detail = res.data.data;
  2400. }
  2401. });
  2402. },
  2403. open(item) {
  2404. item.showChildren = !item.showChildren;
  2405. },
  2406. change(index) {
  2407. this.current = index;
  2408. },
  2409. openDocument() {
  2410. this.downLoading = true
  2411. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2412. console.log(url);
  2413. uni.downloadFile({
  2414. url: url,
  2415. success: (res) => {
  2416. console.log(999);
  2417. var filePath = res.tempFilePath;
  2418. uni.openDocument({
  2419. filePath: filePath,
  2420. showMenu: this.courseHandoutsData.canDownload == 1 ? true : false,
  2421. success: (res) => {
  2422. this.downLoading = false
  2423. uni.setStorageSync('current', this.current)
  2424. console.log(res, "打开文档成功");
  2425. },
  2426. fail: (err) => {
  2427. this.downLoading = false
  2428. console.log(err);
  2429. uni.showToast({
  2430. icon: "none",
  2431. title: "文档地址错误",
  2432. });
  2433. },
  2434. });
  2435. },
  2436. fail: (err) => {
  2437. this.downLoading = false
  2438. uni.showModal({
  2439. title: "提示",
  2440. content: "文档错误," + err.errMsg,
  2441. showCancel: false,
  2442. });
  2443. },
  2444. });
  2445. },
  2446. clickMulu() {
  2447. this.muluStyle = !this.muluStyle
  2448. }
  2449. },
  2450. };
  2451. </script>
  2452. <style lang="scss" scope>
  2453. .top {
  2454. &__header {
  2455. position:relative;
  2456. width:100%;
  2457. height:150rpx;
  2458. padding:24rpx 150rpx 24rpx 24rpx;
  2459. .img {
  2460. position:absolute;
  2461. left:0;
  2462. top:0;
  2463. width:100%;
  2464. }
  2465. .note {
  2466. position:relative;
  2467. z-index: 10;
  2468. font-size: 24rpx;
  2469. font-family: PingFang SC;
  2470. font-weight: bold;
  2471. color: #EFDBFF;
  2472. }
  2473. .title {
  2474. position:relative;
  2475. z-index: 10;
  2476. font-size: 26rpx;
  2477. font-family: PingFang SC;
  2478. font-weight: bold;
  2479. color: #FFFFFF;
  2480. }
  2481. }
  2482. }
  2483. #top {
  2484. position: relative;
  2485. z-index: 99;
  2486. }
  2487. .polyv_detail {
  2488. display: flex;
  2489. flex-direction: column;
  2490. height: 100vh;
  2491. position: relative;
  2492. top: 0;
  2493. left: 0;
  2494. .pops {
  2495. position: absolute;
  2496. top: 0;
  2497. left: 0;
  2498. background: #ccc;
  2499. opacity: 0.5;
  2500. width: 100%;
  2501. height: 300rpx;
  2502. z-index: 9999;
  2503. }
  2504. .box {
  2505. flex: 1;
  2506. overflow: hidden;
  2507. margin: 16rpx 16rpx 100rpx 16rpx;
  2508. .box_in {
  2509. height: 100%;
  2510. }
  2511. }
  2512. .first_ml {
  2513. margin: 16rpx 16rpx 16rpx 16rpx;
  2514. }
  2515. }
  2516. .btnSet {
  2517. width: 440rpx;
  2518. height: 80rpx;
  2519. background: #007aff;
  2520. border-radius: 40rpx;
  2521. color: #ffffff;
  2522. font-size: 28rpx;
  2523. line-height: 80rpx;
  2524. }
  2525. .btnReply {
  2526. width: 80rpx;
  2527. height: 40rpx;
  2528. background: #e3f0ff;
  2529. border-radius: 16rpx;
  2530. text-align: center;
  2531. color: #007aff;
  2532. }
  2533. .btnDel {
  2534. width: 80rpx;
  2535. height: 40rpx;
  2536. background: #ffedf0;
  2537. border-radius: 16rpx;
  2538. text-align: center;
  2539. color: #ff2d55;
  2540. }
  2541. .btnReply {
  2542. width: 80rpx;
  2543. height: 40rpx;
  2544. background: #e3f0ff;
  2545. border-radius: 16rpx;
  2546. font-size: 24rpx;
  2547. }
  2548. .lecture-box {
  2549. display: flex;
  2550. align-items: center;
  2551. height: 80rpx;
  2552. background: #ffffff;
  2553. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2554. .title {
  2555. padding: 10rpx;
  2556. flex: 1;
  2557. overflow: hidden;
  2558. text-overflow: ellipsis;
  2559. white-space: nowrap;
  2560. color: #333;
  2561. font-weight: bold;
  2562. font-size: 32rpx;
  2563. }
  2564. .btn {
  2565. display: flex;
  2566. align-items: center;
  2567. justify-content: center;
  2568. width: 80rpx;
  2569. height: 80rpx;
  2570. background: #ffffff;
  2571. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2572. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2573. }
  2574. @keyframes rotation{
  2575. from {-webkit-transform: rotate(0deg);}
  2576. to {-webkit-transform: rotate(360deg);}
  2577. }
  2578. .loading_down {
  2579. transform: rotate(360deg);
  2580. animation: rotation 3s linear infinite;
  2581. }
  2582. }
  2583. .lecture-content {
  2584. background: #fff;
  2585. margin-top: 10rpx;
  2586. padding: 10rpx;
  2587. border-radius: 16rpx;
  2588. }
  2589. .photoBox {
  2590. background-color: #ffffff;
  2591. border-radius: 32px 32px 0px 0px;
  2592. .photoTop {
  2593. height: 74rpx;
  2594. display: flex;
  2595. align-items: center;
  2596. justify-content: space-between;
  2597. padding: 0rpx 38rpx;
  2598. .sqzz {
  2599. width: 28rpx;
  2600. height: 28rpx;
  2601. display: flex;
  2602. align-items: center;
  2603. justify-content: center;
  2604. }
  2605. .centersq {
  2606. color: #333;
  2607. font-size: 30rpx;
  2608. font-weight: 500;
  2609. }
  2610. }
  2611. .photoCenter {
  2612. width: 750rpx;
  2613. height: 979rpx;
  2614. position: relative;
  2615. .custom {
  2616. width: 750rpx;
  2617. height: 979rpx;
  2618. position: absolute;
  2619. z-index: 1000;
  2620. top: 0;
  2621. left: 0;
  2622. image {
  2623. width: 100%;
  2624. height: 100%;
  2625. }
  2626. }
  2627. }
  2628. .btns {
  2629. display: flex;
  2630. .btnResult {
  2631. height: 100rpx;
  2632. flex: 1;
  2633. background-color: #07c160;
  2634. text-align: center;
  2635. line-height: 100rpx;
  2636. color: #fff;
  2637. font-size: 32rpx;
  2638. font-weight: bold;
  2639. }
  2640. }
  2641. }
  2642. .chat_box {
  2643. display: flex;
  2644. padding: 20rpx;
  2645. justify-content: space-between;
  2646. }
  2647. .chat3 {
  2648. font-size: 30rpx;
  2649. font-family: PingFang SC;
  2650. font-weight: 500;
  2651. color: #666666;
  2652. margin-top: 10rpx;
  2653. }
  2654. .chat2 {
  2655. font-size: 20rpx;
  2656. font-family: PingFang SC;
  2657. font-weight: 500;
  2658. color: #999999;
  2659. margin-top: 10rpx;
  2660. }
  2661. .chat1 {
  2662. font-size: 24rpx;
  2663. font-family: PingFang SC;
  2664. font-weight: 500;
  2665. color: #333333;
  2666. }
  2667. .leftPadding {
  2668. margin-left: 8rpx;
  2669. }
  2670. .t2Content {
  2671. font-size: 24rpx;
  2672. font-family: PingFang SC;
  2673. font-weight: bold;
  2674. color: #999999;
  2675. line-height: 48rpx;
  2676. }
  2677. .tBox2 {
  2678. display: flex;
  2679. padding-top: 10rpx;
  2680. color: #333333;
  2681. font-size: 30rpx;
  2682. font-weight: 400;
  2683. }
  2684. .tBox {
  2685. display: flex;
  2686. align-items: center;
  2687. padding-top: 10rpx;
  2688. }
  2689. .title {
  2690. font-size: 24rpx;
  2691. color: #999999;
  2692. }
  2693. .Answering {
  2694. .answer_item {
  2695. &:nth-child(2) {
  2696. border-radius: 16rpx 16rpx 0rpx 0rpx;
  2697. }
  2698. &:nth-last-child(1) {
  2699. border-radius: 0rpx 0rpx 16rpx 16rpx;
  2700. }
  2701. }
  2702. }
  2703. .inputBottom {
  2704. position: fixed;
  2705. left: 0;
  2706. bottom: 0;
  2707. background: #ffffff;
  2708. height: 98rpx;
  2709. display: flex;
  2710. align-items: center;
  2711. width: 100%;
  2712. .flex_auto {
  2713. flex: 1;
  2714. margin-left: 10%;
  2715. // .input {
  2716. // height: 60rpx;
  2717. // }
  2718. }
  2719. .btn {
  2720. color: #007aff;
  2721. font-size: 30rpx;
  2722. font-weight: bold;
  2723. width: 15%;
  2724. text-align: center;
  2725. }
  2726. .input {
  2727. background: rgba(244, 244, 244, 0.98);
  2728. height: 60rpx;
  2729. border-radius: 24rpx;
  2730. margin-top: 12rpx;
  2731. }
  2732. }
  2733. .noteBox {
  2734. width: 100%;
  2735. background: #ffffff;
  2736. padding: 0rpx 10rpx 20rpx;
  2737. border-radius: 16rpx;
  2738. overflow: hidden;
  2739. .left_ti {
  2740. padding-top: 14rpx;
  2741. }
  2742. }
  2743. .dateBox {
  2744. width: 216rpx;
  2745. height: 48rpx;
  2746. background: #ffffff;
  2747. border-radius: 24rpx;
  2748. font-size: 24rpx;
  2749. color: #666666;
  2750. text-align: center;
  2751. line-height: 48rpx;
  2752. margin: 16rpx 0rpx 8rpx;
  2753. }
  2754. .t_content1 {
  2755. color: #007aff;
  2756. margin-left: 10rpx;
  2757. }
  2758. .tag1 {
  2759. border: 2rpx solid #007aff;
  2760. border-radius: 8rpx;
  2761. font-size: 20rpx;
  2762. color: #007aff;
  2763. padding: 5rpx;
  2764. }
  2765. .b_title {
  2766. color: #333333;
  2767. font-size: 30rpx;
  2768. font-weight: bold;
  2769. }
  2770. page {
  2771. background: #eaeef1;
  2772. }
  2773. .menuBox {
  2774. width: 100%;
  2775. background: #ffffff;
  2776. border-radius: 16rpx;
  2777. padding: 0rpx 20rpx;
  2778. margin-bottom: 20rpx;
  2779. }
  2780. .btnspric {
  2781. border-top: 1rpx solid #eee;
  2782. display: flex;
  2783. align-items: center;
  2784. justify-content: space-between;
  2785. height: 108rpx;
  2786. padding-left: 43rpx;
  2787. padding-right: 32rpx;
  2788. }
  2789. .btnspric > .lefprL {
  2790. font-size: 36rpx;
  2791. color: #0c141f;
  2792. font-weight: bold;
  2793. }
  2794. .btnspric > .lefprR {
  2795. padding: 0rpx 24rpx;
  2796. height: 60rpx;
  2797. line-height: 60rpx;
  2798. text-align: center;
  2799. color: #fff;
  2800. background: #32467b;
  2801. border-radius: 24rpx;
  2802. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2803. }
  2804. .yhj,
  2805. .hdyhj {
  2806. padding: 24rpx 29rpx 24rpx 34rpx;
  2807. }
  2808. .yhj {
  2809. border-bottom: 16rpx solid #f9f9f9;
  2810. }
  2811. .yhjtit {
  2812. font-size: 30rpx;
  2813. color: #0c141f;
  2814. font-weight: 500;
  2815. margin-bottom: 14rpx;
  2816. }
  2817. .yhjList {
  2818. display: flex;
  2819. align-items: center;
  2820. justify-content: space-between;
  2821. margin-bottom: 14rpx;
  2822. }
  2823. .yhjList > .yhjLefts {
  2824. display: flex;
  2825. align-items: center;
  2826. }
  2827. .yhjLefts > .yhl {
  2828. color: #32467b;
  2829. font-size: 30rpx;
  2830. margin-right: 31rpx;
  2831. }
  2832. .yhjLefts > .yhbq {
  2833. font-size: 24rpx;
  2834. color: #ff9500;
  2835. border-radius: 18rpx;
  2836. background-color: rgba(255, 149, 0, 0.2);
  2837. border: 2rpx solid #ff9500;
  2838. height: 38rpx;
  2839. line-height: 38rpx;
  2840. padding: 0rpx 16rpx;
  2841. }
  2842. .ts {
  2843. font-size: 24rpx;
  2844. color: #999;
  2845. margin: 14rpx 0rpx;
  2846. padding-right: 29rpx;
  2847. padding-left: 34rpx;
  2848. }
  2849. .yh {
  2850. padding-top: 20rpx;
  2851. }
  2852. .yh > .yhtitle {
  2853. display: flex;
  2854. align-items: center;
  2855. justify-content: space-between;
  2856. padding-right: 29rpx;
  2857. padding-left: 34rpx;
  2858. }
  2859. .priceBxs {
  2860. display: flex;
  2861. align-items: center;
  2862. }
  2863. .priceBxs > .pricleft {
  2864. border-radius: 24rpx;
  2865. border: 1rpx solid #e91313;
  2866. background-color: rgba(233, 19, 19, 0.1);
  2867. padding: 0rpx 18rpx;
  2868. height: 49rpx;
  2869. line-height: 49rpx;
  2870. text-align: center;
  2871. font-size: 30rpx;
  2872. font-weight: 500;
  2873. color: #e91313;
  2874. margin-right: 13rpx;
  2875. }
  2876. .topBox {
  2877. padding: 32rpx 32rpx 24rpx;
  2878. border-bottom: 1rpx solid #eeeeee;
  2879. }
  2880. .topBox > .boldFonstType {
  2881. font-weight: 500;
  2882. font-size: 30rpx;
  2883. margin: 16rpx 0rpx 23rpx;
  2884. }
  2885. .topBox > .firstTopL {
  2886. display: flex;
  2887. align-items: center;
  2888. }
  2889. .topBox > .firstTopL > .imageBs {
  2890. width: 331rpx;
  2891. height: 160rpx;
  2892. border-radius: 6rpx;
  2893. overflow: hidden;
  2894. margin-right: 8rpx;
  2895. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2896. }
  2897. .topBox > .firstTopL > .imageBs > image {
  2898. width: 100%;
  2899. height: 100%;
  2900. }
  2901. .topBox > .firstTopL > .textBs {
  2902. font-size: 30rpx;
  2903. font-weight: bold;
  2904. color: #0c141f;
  2905. }
  2906. .content {
  2907. padding: 24rpx;
  2908. text-align: left;
  2909. }
  2910. .catalogBox {
  2911. display: flex;
  2912. align-items: center;
  2913. flex-wrap: nowrap;
  2914. overflow-x: auto;
  2915. padding-left: 38rpx;
  2916. max-height: 305rpx;
  2917. overflow-y: auto;
  2918. transition: all 0.4s;
  2919. }
  2920. .catalogBox > .catalogA {
  2921. min-width: 200rpx;
  2922. height: 48rpx;
  2923. line-height: 48rpx;
  2924. // text-align: center;
  2925. border: 2rpx solid transparent;
  2926. white-space: nowrap;
  2927. text-overflow: ellipsis;
  2928. overflow: hidden;
  2929. word-break: break-all;
  2930. border-radius: 10rpx;
  2931. background: rgba(22, 119, 255, 0.05);
  2932. padding-left: 19rpx;
  2933. box-sizing: border-box;
  2934. padding-right: 15rpx;
  2935. margin-right: 16rpx;
  2936. margin-bottom: 20rpx;
  2937. margin-top: 15rpx;
  2938. font-size: 24rpx;
  2939. color: #666;
  2940. }
  2941. .catalogBox > .activesq {
  2942. border-color: #1677ff;
  2943. }
  2944. .changeCatalogBox {
  2945. display: block;
  2946. }
  2947. .catalogBox::-webkit-scrollbar {
  2948. display: none; /* Chrome Safari */
  2949. }
  2950. .price_t2 {
  2951. font-size: 18rpx;
  2952. font-family: PingFang SC;
  2953. font-weight: 500;
  2954. text-decoration: line-through;
  2955. color: #999999;
  2956. }
  2957. .price_t1 {
  2958. font-size: 33rpx;
  2959. font-family: PingFang SC;
  2960. font-weight: bold;
  2961. color: #e91313;
  2962. }
  2963. .sc_t {
  2964. font-size: 22rpx;
  2965. color: #000000;
  2966. }
  2967. .sc {
  2968. width: 29rpx;
  2969. height: 29rpx;
  2970. }
  2971. .buy {
  2972. width: 138rpx;
  2973. height: 48rpx;
  2974. line-height: 48rpx;
  2975. background: #32467b;
  2976. border-radius: 10rpx;
  2977. color: #ffffff;
  2978. font-size: 28rpx;
  2979. text-align: center;
  2980. vertical-align: middle;
  2981. position: absolute;
  2982. right: 30rpx;
  2983. }
  2984. .video_body {
  2985. padding-bottom: 96rpx;
  2986. }
  2987. .footer_tab {
  2988. position: fixed;
  2989. bottom: 0;
  2990. height: 96rpx;
  2991. width: 100%;
  2992. background-color: #ffffff;
  2993. }
  2994. .tj_box {
  2995. width: 50%;
  2996. display: inline-block;
  2997. text-align: center;
  2998. margin: 10rpx 0;
  2999. }
  3000. .teacher_t {
  3001. font-size: 24rpx;
  3002. font-family: PingFang SC;
  3003. font-weight: 400;
  3004. color: #666666;
  3005. line-height: 36rpx;
  3006. margin-left: 15rpx;
  3007. }
  3008. .teacher_img {
  3009. width: 87rpx;
  3010. height: 129rpx;
  3011. }
  3012. .t2 {
  3013. font-size: 24rpx;
  3014. font-family: PingFang SC;
  3015. color: #666666;
  3016. line-height: 36rpx;
  3017. margin: 15rpx;
  3018. }
  3019. .r_t2 {
  3020. width: 201rpx;
  3021. height: 49rpx;
  3022. background: rgba(22, 119, 255, 0.05);
  3023. border: 1rpx solid #32467b;
  3024. border-radius: 16rpx;
  3025. color: #666666;
  3026. font-size: 23rpx;
  3027. text-align: center;
  3028. display: flex;
  3029. align-items: center;
  3030. padding: 5rpx;
  3031. }
  3032. .scroll_box {
  3033. width: 100%;
  3034. height: 60rpx;
  3035. background: #ffffff;
  3036. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3037. white-space: nowrap;
  3038. overflow: hidden;
  3039. margin: 15rpx 0;
  3040. }
  3041. .r_sliper {
  3042. padding: 0 20rpx;
  3043. }
  3044. .top_line {
  3045. width: 6rpx;
  3046. height: 22rpx;
  3047. background: #32467b;
  3048. margin-right: 10rpx;
  3049. }
  3050. .video_t2 {
  3051. font-size: 24rpx;
  3052. font-family: PingFang SC;
  3053. font-weight: 500;
  3054. color: #666666;
  3055. }
  3056. .course_name {
  3057. height: 80rpx;
  3058. background-color: #fff;
  3059. }
  3060. .video_t1 {
  3061. height: 80rpx;
  3062. color: #333333;
  3063. line-height: 80rpx;
  3064. font-size: 30rpx;
  3065. font-family: PingFang SC;
  3066. font-weight: bold;
  3067. color: #333333;
  3068. overflow: hidden;
  3069. text-overflow: ellipsis;
  3070. white-space: nowrap;
  3071. }
  3072. .notice_wrap {
  3073. height: 80rpx;
  3074. display: flex;
  3075. align-items: center;
  3076. justify-content: flex-end;
  3077. .video_t1_t {
  3078. width: 100%;
  3079. height: 40rpx;
  3080. line-height: 40rpx;
  3081. text-align: center;
  3082. background: rgba(245, 154, 35, 1);
  3083. color: #333;
  3084. border-radius: 10rpx;
  3085. font-size: 24rpx;
  3086. }
  3087. }
  3088. .video_play {
  3089. position: absolute;
  3090. width: 95rpx;
  3091. height: 95rpx;
  3092. top: 0;
  3093. left: 0;
  3094. right: 0;
  3095. bottom: 0;
  3096. margin: auto;
  3097. }
  3098. .video_box {
  3099. position: relative;
  3100. #playerVideo {
  3101. position: relative;
  3102. z-index: 99;
  3103. }
  3104. .video-toast {
  3105. position: absolute;
  3106. width: 686rpx;
  3107. height: 80rpx;
  3108. background: rgba(0, 0, 0, 0.6);
  3109. border-radius: 24rpx;
  3110. bottom: 100rpx;
  3111. left: 50%;
  3112. transform: translateX(-50%);
  3113. color: #fff;
  3114. display: flex;
  3115. font-size: 26rpx;
  3116. align-items: center;
  3117. overflow: visible;
  3118. &__text {
  3119. flex: 1;
  3120. margin-left: 40rpx;
  3121. }
  3122. &__btn {
  3123. width: 180rpx;
  3124. text-align: center;
  3125. border-left: 1rpx solid #fff;
  3126. }
  3127. }
  3128. .video-toast__close {
  3129. position: absolute;
  3130. right: 32rpx;
  3131. bottom: 184rpx;
  3132. width: 40rpx;
  3133. height: 40rpx;
  3134. line-height: 40rpx;
  3135. text-align: center;
  3136. background: rgba(0, 0, 0, 0.6);
  3137. border-radius: 50%;
  3138. color: rgba(255, 255, 255, 0.3);
  3139. }
  3140. }
  3141. .rotoct {
  3142. transform: rotate(90deg);
  3143. }
  3144. .slot-content {
  3145. padding: 0 20rpx;
  3146. }
  3147. .notice_modal {
  3148. .content {
  3149. width: 100%;
  3150. height: 100%;
  3151. padding: 20rpx;
  3152. .title {
  3153. color: #333;
  3154. line-height: 40rpx;
  3155. font-size: 30rpx;
  3156. text-align: center;
  3157. font-weight: bold;
  3158. }
  3159. .text {
  3160. line-height: 40rpx;
  3161. }
  3162. }
  3163. }
  3164. .full_mulu {
  3165. position: absolute;
  3166. top: 100rpx;
  3167. right: 20rpx;
  3168. width: 700rpx;
  3169. height: 515rpx;
  3170. color: #333;
  3171. display: flex;
  3172. align-items: center;
  3173. justify-content: space-between;
  3174. z-index: 99999;
  3175. .mulus {
  3176. width: 623rpx;
  3177. // height: 515rpx;
  3178. height: 400rpx;
  3179. overflow-y: scroll;
  3180. // overflow: scroll;
  3181. }
  3182. .mulu_box_in {
  3183. background-color: #b7b7b7;
  3184. border-radius: 16rpx;
  3185. // transition: all 0.5s;
  3186. &::after {
  3187. content: "";
  3188. width: 0;
  3189. height: 0;
  3190. position: absolute;
  3191. top: 235rpx;
  3192. right: 27px;
  3193. border-top: 16rpx solid transparent;
  3194. border-right: 16rpx solid transparent;
  3195. border-left: 16rpx solid #b7b7b7;
  3196. border-bottom: 16rpx solid transparent;
  3197. }
  3198. }
  3199. .mulu_box_out {
  3200. // visibility: hidden;
  3201. display: none;
  3202. }
  3203. .menuBox_mulu {
  3204. // width: 100%;
  3205. background: #ffffff;
  3206. border-radius: 16rpx;
  3207. padding: 0rpx 20rpx;
  3208. margin-bottom: 20rpx;
  3209. }
  3210. .ml_img {
  3211. position: absolute;
  3212. right: 0;
  3213. top: 100rpx;
  3214. }
  3215. .items {
  3216. width: 620rpx;
  3217. height: 100rpx;
  3218. border: 1rpx solid red;
  3219. }
  3220. }
  3221. </style>