detail.vue 115 KB

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