detail.vue 121 KB

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