detail.vue 121 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035
  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. gradeId: this.gradeId,
  1378. orderGoodsId:this.orderGoodsId,
  1379. courseId:this.courseId
  1380. }).then(async res => {
  1381. if(res.data.data) {
  1382. this.moduleId = res.data.data.moduleId
  1383. this.chapterId = res.data.data.chapterId
  1384. if(res.data.data.sectionType == 1) { //录播
  1385. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1386. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1387. this.sectionItem = res.data.data;
  1388. await this.getPhotoLastRecord() // 获取拍照历史
  1389. this.playVideo(res.data.data)
  1390. } else if(res.data.data.sectionType == 2) { //直播
  1391. this.studyRecordGetLastLive();
  1392. } else if(res.data.data.sectionType == 3) { //回放
  1393. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1394. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1395. this.sectionItem = res.data.data;
  1396. this.playVideo(res.data.data)
  1397. }
  1398. // 查询用户最后一次看的录播的信息
  1399. this.$http({
  1400. url: '/study/record/getUserWatchLast',
  1401. method: 'get',
  1402. data: {
  1403. orderGoodsId: this.orderGoodsId,
  1404. }
  1405. }).then((res) => {
  1406. if (res.data.code == 200) {
  1407. this.sectionItem = res.data.data || {}
  1408. }
  1409. })
  1410. }
  1411. })
  1412. },
  1413. /**
  1414. * 模块大节播放完毕,刷新列表
  1415. */
  1416. sectionPlayEnd(isRebuild, index) {
  1417. if (this.reMenuList.length > 0) {
  1418. //有重修目录
  1419. if (isRebuild.isRebuild) {
  1420. //从重修点击
  1421. this.$api
  1422. .reMenuList({
  1423. orderGoodsId: this.orderGoodsId,
  1424. courseId: this.courseId,
  1425. rebuild: 1,
  1426. gradeId: this.gradeId,
  1427. })
  1428. .then((res) => {
  1429. if (res.data.code == 200) {
  1430. if (res.data.rows.length) {
  1431. res.data.rows[index].name = res.data.rows[index].menuName;
  1432. this.$set(this.reMenuList,index,res.data.rows[index])
  1433. for (let i = 0; i < res.data.rows.length; i++) {
  1434. let item = res.data.rows[i];
  1435. item.down = true;
  1436. item.id = item.menuId;
  1437. item.name = item.menuName;
  1438. }
  1439. this.reMenuList = []
  1440. this.$nextTick(() => {
  1441. this.reMenuList = res.data.rows;
  1442. // console.log(this.reMenuList,'this.reMenuList1')
  1443. })
  1444. } else {
  1445. this.reMenuList = [];
  1446. }
  1447. this.$nextTick(() => {
  1448. if (this.reMenuList.length > 0) {
  1449. this.list = [
  1450. {
  1451. name: "目录",
  1452. },
  1453. {
  1454. name: "讲义",
  1455. },
  1456. {
  1457. name: "笔记",
  1458. },
  1459. {
  1460. name: "答疑",
  1461. },
  1462. { name: "重修目录" },
  1463. ];
  1464. } else {
  1465. this.list = [
  1466. {
  1467. name: "目录",
  1468. },
  1469. {
  1470. name: "讲义",
  1471. },
  1472. {
  1473. name: "笔记",
  1474. },
  1475. {
  1476. name: "答疑",
  1477. },
  1478. ];
  1479. if (this.current == 4) {
  1480. this.current = 0;
  1481. }
  1482. }
  1483. });
  1484. }
  1485. });
  1486. this.$api
  1487. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  1488. .then((res) => {
  1489. if (res.data.code == 200) {
  1490. for (let i = 0; i < res.data.rows.length; i++) {
  1491. let item = res.data.rows[i];
  1492. item.down = true;
  1493. item.id = item.menuId;
  1494. item.name = item.menuName;
  1495. item.menuType = item.type;
  1496. }
  1497. this.menuList = [];
  1498. this.$nextTick(() => {
  1499. this.menuList = res.data.rows;
  1500. });
  1501. }
  1502. });
  1503. } else {
  1504. //从普通目录点击
  1505. this.$api
  1506. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  1507. .then((res) => {
  1508. if (res.data.code == 200) {
  1509. res.data.rows[index].name = res.data.rows[index].menuName;
  1510. res.data.rows[index].id = res.data.rows[index].menuId;
  1511. this.$set(this.menuList, index, res.data.rows[index]);
  1512. }
  1513. });
  1514. this.$api
  1515. .reMenuList({
  1516. orderGoodsId: this.orderGoodsId,
  1517. courseId: this.courseId,
  1518. rebuild: 1,
  1519. gradeId: this.gradeId,
  1520. })
  1521. .then((res) => {
  1522. if (res.data.code == 200) {
  1523. if (res.data.rows.length) {
  1524. // for (let i = 0; i < res.data.rows.length; i++) {
  1525. // let item = res.data.rows[i];
  1526. // item.down = true;
  1527. // item.id = item.menuId;
  1528. // item.name = item.menuName;
  1529. // }
  1530. // this.reMenuList = res.data.rows;
  1531. } else {
  1532. this.reMenuList = [];
  1533. }
  1534. this.$nextTick(() => {
  1535. if (this.reMenuList.length > 0) {
  1536. this.list = [
  1537. {
  1538. name: "目录",
  1539. },
  1540. {
  1541. name: "讲义",
  1542. },
  1543. {
  1544. name: "笔记",
  1545. },
  1546. {
  1547. name: "答疑",
  1548. },
  1549. { name: "重修目录" },
  1550. ];
  1551. } else {
  1552. this.list = [
  1553. {
  1554. name: "目录",
  1555. },
  1556. {
  1557. name: "讲义",
  1558. },
  1559. {
  1560. name: "笔记",
  1561. },
  1562. {
  1563. name: "答疑",
  1564. },
  1565. ];
  1566. if (this.current == 4) {
  1567. this.current = 0;
  1568. }
  1569. }
  1570. });
  1571. }
  1572. });
  1573. }
  1574. } else {
  1575. console.log('--模块大节播放完毕,刷新列表-');
  1576. //没有重修目录
  1577. this.$api
  1578. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId ,orderGoodsId: this.orderGoodsId,})
  1579. .then((res) => {
  1580. if (res.data.code == 200) {
  1581. res.data.rows[index].name = res.data.rows[index].menuName;
  1582. res.data.rows[index].id = res.data.rows[index].menuId;
  1583. this.$set(this.menuList, index, res.data.rows[index]);
  1584. }
  1585. });
  1586. }
  1587. },
  1588. goLive(item) {
  1589. let moduleId = item.moduleId || 0;
  1590. let chapterId = item.chapterId || 0;
  1591. let sectionId = item.sectionId || item.menuId;
  1592. let uuid = new Date().valueOf() + ""
  1593. // buyCourse 是否购买课程:1是 0否
  1594. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
  1595. +item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+
  1596. '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
  1597. uni.navigateTo({
  1598. url:`../../pages/webview/index?url=`+encode
  1599. })
  1600. },
  1601. studyRecordMenuAllList() {
  1602. // study/record/menuAllList
  1603. this.$api.studyRecordMenuAllList({
  1604. courseId:this.courseId,
  1605. gradeId:this.gradeId,
  1606. goodsId:this.goodsId
  1607. }).then(res => {
  1608. let nowTime = Number(new Date().getTime()/1000).toFixed(0)
  1609. if (res.data.data) {
  1610. this.menuAllList = res.data.data
  1611. // console.log('======0', this.sectionItem);
  1612. this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
  1613. }
  1614. })
  1615. },
  1616. getbaseprofiletplists() {
  1617. return new Promise(resolve => {
  1618. let self = this;
  1619. this.getCameraSetting();
  1620. this.$api.getbaseprofiletplists({ goodsId: self.goodsId,orderGoodsId: this.orderGoodsId, }).then((res) => {
  1621. if (res.data.code === 200 && res.data.rows.length) {
  1622. if (res.data.rows[0].keyValue) {
  1623. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  1624. if (baseRes.data.code === 200) {
  1625. if (baseRes.data.data) {
  1626. // base/profile/tp/getInfo
  1627. self.$api
  1628. .getbaseprofiletpgetInfo({
  1629. goodsId: self.goodsId,
  1630. orderGoodsId: self.orderGoodsId,
  1631. })
  1632. .then((result) => {
  1633. if (result.data.code === 200) {
  1634. if (
  1635. !result.data.data ||
  1636. (result.data.data.status === 3 &&
  1637. result.data.data.changeStatus === 1)
  1638. ) {
  1639. if (!result.data.data) {
  1640. self.needProfileModal = true;
  1641. uni.showModal({
  1642. content: "请前往填写资料",
  1643. cancelText: "返回",
  1644. success: function (resultst) {
  1645. if (resultst.confirm) {
  1646. self.$navTo.togo("/pages2/verify/input", {
  1647. id: self.goodsId,
  1648. orderGoodsId: self.orderGoodsId,
  1649. });
  1650. }
  1651. if (resultst.cancel) {
  1652. uni.navigateBack();
  1653. }
  1654. },
  1655. });
  1656. } else {
  1657. self.needProfileModal = true;
  1658. uni.showModal({
  1659. content: "资料审核不通过,请前往重新填写",
  1660. cancelText: "返回",
  1661. success: function (resultst) {
  1662. if (resultst.confirm) {
  1663. self.$navTo.togo("/pages2/verify/input", {
  1664. id: self.goodsId,
  1665. orderGoodsId: self.orderGoodsId,
  1666. });
  1667. }
  1668. if (resultst.cancel) {
  1669. uni.navigateBack();
  1670. }
  1671. },
  1672. });
  1673. }
  1674. }
  1675. else if (
  1676. result.data.data.status === 1 &&
  1677. JSON.parse(res.data.rows[0].keyValue2)[0]
  1678. ) {
  1679. self.$api
  1680. .getbaseprofileStampgetInfo({
  1681. goodsId: self.goodsId,
  1682. orderGoodsId: self.orderGoodsId,
  1683. })
  1684. .then((k) => {
  1685. if (k.data.code === 200) {
  1686. if (
  1687. !k.data.data ||
  1688. (k.data.data.status === 3 &&
  1689. k.data.data.changeStatus === 1)
  1690. ) {
  1691. if (!k.data.data) {
  1692. self.needProfileModal = true;
  1693. uni.showModal({
  1694. cancelText: "返回",
  1695. content: "请前往填写盖章资料",
  1696. success: function (resultst) {
  1697. if (resultst.confirm) {
  1698. self.$navTo.togo(
  1699. "/pages2/verify/input2",
  1700. {
  1701. id: self.goodsId,
  1702. orderGoodsId: self.orderGoodsId,
  1703. }
  1704. );
  1705. }
  1706. if (resultst.cancel) {
  1707. uni.navigateBack();
  1708. }
  1709. },
  1710. });
  1711. } else {
  1712. self.needProfileModal = true;
  1713. uni.showModal({
  1714. cancelText: "返回",
  1715. content:
  1716. "资料盖章审核不通过,请前往重新填写",
  1717. success: function (resultst) {
  1718. if (resultst.confirm) {
  1719. self.$navTo.togo(
  1720. "/pages2/verify/input2",
  1721. {
  1722. id: self.goodsId,
  1723. orderGoodsId: self.orderGoodsId,
  1724. }
  1725. );
  1726. }
  1727. if (resultst.cancel) {
  1728. uni.navigateBack();
  1729. }
  1730. },
  1731. });
  1732. }
  1733. } else {
  1734. resolve();
  1735. }
  1736. }
  1737. });
  1738. } else {
  1739. resolve();
  1740. }
  1741. }
  1742. });
  1743. } else {
  1744. resolve();
  1745. }
  1746. }
  1747. });
  1748. } else {
  1749. resolve();
  1750. }
  1751. } else {
  1752. resolve();
  1753. }
  1754. });
  1755. if (this.gradeId > 0) {
  1756. //提交完资料返回判断是否已开班
  1757. this.getGradeInfo();
  1758. }
  1759. })
  1760. },
  1761. // /**
  1762. // * 获取业务层次详情
  1763. // */
  1764. // courseBusiness() {
  1765. // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1766. // this.businessData = res.data.data;
  1767. // });
  1768. // },
  1769. /**
  1770. * 计算tabs宽度
  1771. */
  1772. itemWidth() {
  1773. return 100 / this.list.length + "%";
  1774. },
  1775. /**
  1776. * 获取讲义权限
  1777. */
  1778. courseHandouts() {
  1779. this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1780. this.courseHandoutsData = res.data.data;
  1781. });
  1782. },
  1783. findMenuNextSection(index) {
  1784. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1785. let item = this.reMenuList[i];
  1786. if (item.type == 3) {
  1787. return item;
  1788. }
  1789. }
  1790. return {};
  1791. },
  1792. loadedmetadata(event) {
  1793. console.log('------: loadedmetadata', this.hasStart);
  1794. if (this.hasStart) { // 防止loadedmetadata事件第二次触发
  1795. return
  1796. }
  1797. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1798. this.hasStart = true;
  1799. uni.$off('playPause')
  1800. uni.$on('playPause',() => {
  1801. polyvPlayerContext.pause()
  1802. })
  1803. if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
  1804. this.postStudyRecord(0)
  1805. }
  1806. this.studyTimer = setInterval(() => {
  1807. this.postStudyRecord(0)
  1808. }, 15 * 1000)
  1809. },
  1810. getPhotoLastRecord() {
  1811. let self = this;
  1812. let data = {
  1813. sectionId: parseInt(self.playSectionId),
  1814. goodsId: parseInt(self.goodsId),
  1815. courseId: parseInt(self.courseId),
  1816. gradeId: parseInt(self.gradeId),
  1817. chapterId: parseInt(self.chapterId),
  1818. moduleId: parseInt(self.moduleId),
  1819. orderGoodsId: this.orderGoodsId,
  1820. };
  1821. // /course/photo/log/getLastInfo'
  1822. this.$api.getPhotoLastRecord(data).then((res) => {
  1823. if (res.data.code == 200) {
  1824. //清空历史数据
  1825. self.photoHistoryList = [];
  1826. this.photoIndex = 0;
  1827. self.photoList = [];
  1828. for (let i = 0; i < res.data.data.length; i++) {
  1829. //-2存储随机拍照数组
  1830. if (res.data.data[i].photoIndex == -2) {
  1831. self.photoList = res.data.data[i].timeInterval.split(",");
  1832. } else {
  1833. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1834. }
  1835. }
  1836. // console.log('7777', this.photoHistoryList, this.photoList);
  1837. }
  1838. });
  1839. },
  1840. //postTime 只提交随机时间
  1841. postCoursePhotoRecord(postTime = false) {
  1842. return new Promise((resolve, reject) => {
  1843. let currentTime = 0;
  1844. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1845. if (polyvPlayerContext) {
  1846. currentTime = polyvPlayerContext.getCurrentTime();
  1847. }
  1848. let self = this;
  1849. let photoIndex = self.photoIndex;
  1850. let data = {
  1851. photo: self.ossAvatarUrl,
  1852. sectionId: parseInt(self.playSectionId),
  1853. goodsId: parseInt(self.goodsId),
  1854. courseId: parseInt(self.courseId),
  1855. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1856. gradeId: parseInt(self.gradeId),
  1857. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1858. photoNum: parseInt(self.photoNum),
  1859. chapterId: parseInt(self.chapterId),
  1860. moduleId: parseInt(self.moduleId),
  1861. timeInterval: postTime ? self.photoList.join(",") : "",
  1862. orderGoodsId: this.orderGoodsId,
  1863. };
  1864. // console.log("提交接口", data);
  1865. this.$api
  1866. .coursePhotoRecord(data)
  1867. .then((res) => {
  1868. if (res.data.code == 200) {
  1869. resolve();
  1870. } else {
  1871. reject();
  1872. }
  1873. })
  1874. .catch((err) => {
  1875. reject();
  1876. });
  1877. });
  1878. },
  1879. randomNum(minNum, maxNum) {
  1880. switch (arguments.length) {
  1881. case 1:
  1882. return parseInt(Math.random() * minNum + 1, 10);
  1883. break;
  1884. case 2:
  1885. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1886. break;
  1887. default:
  1888. return 0;
  1889. break;
  1890. }
  1891. },
  1892. //配置随机拍照时间
  1893. configPhoto() {
  1894. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1895. let totalVideoTime = polyvPlayerContext.getDuration();
  1896. let duration = polyvPlayerContext.getCurrentTime();
  1897. let photoNum = this.photoNum;
  1898. if (!this.photoConfig) {
  1899. this.photoConfig = true;
  1900. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1901. // if(spaceTime<5){//区间小于5秒
  1902. // photoNum = Math.floor(totalVideoTime/5)
  1903. // spaceTime = 5
  1904. // }
  1905. // if(photoNum<1){
  1906. // photoNum = 1 //只要设置,至少拍一次
  1907. // spaceTime = totalVideoTime
  1908. // }
  1909. // let initSpace = 0
  1910. //没有历史拍照间隔数据
  1911. if (this.photoList.length == 0) {
  1912. if (totalVideoTime >= 900) {
  1913. //大于15分钟
  1914. if (photoNum == 1) {
  1915. //开头拍1张
  1916. this.photoList.push(0);
  1917. } else if (photoNum == 3) {
  1918. //拍3张
  1919. this.photoList.push(0); //开头拍一张
  1920. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1921. let centerMinTime = centerTime - 300; //前后5分钟
  1922. let centerMaxTime = centerTime + 300;
  1923. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1924. this.photoList.push(centerTakeTime); //中间拍一张
  1925. let endMaxTime = totalVideoTime - 60;
  1926. let endMinTime = totalVideoTime - 300;
  1927. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1928. this.photoList.push(endTakeTime); //最后拍一张
  1929. }
  1930. } else {
  1931. //小于15分钟,只拍前后各一张
  1932. if (photoNum == 1) {
  1933. //开头拍1张
  1934. this.photoList.push(0);
  1935. } else if (photoNum == 3) {
  1936. //拍2张
  1937. if (totalVideoTime <= 300) {
  1938. //小于5分钟
  1939. this.photoList.push(0); //开头拍一张
  1940. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1941. this.photoList.push(endTakeTime);
  1942. } else {
  1943. this.photoList.push(0); //开头拍一张
  1944. let endMaxTime = totalVideoTime - 60;
  1945. let endMinTime = totalVideoTime - 300;
  1946. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1947. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1948. }
  1949. }
  1950. }
  1951. // for(let i=0;i<photoNum;i++){
  1952. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1953. // if(s>totalVideoTime){
  1954. // s = totalVideoTime-1
  1955. // }
  1956. // if(s<=5){
  1957. // s =5 //避免出现5秒内拍照时间
  1958. // }
  1959. // this.photoList.push(s)
  1960. // initSpace+=spaceTime
  1961. // }
  1962. // console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1963. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1964. }
  1965. //兼容已有观看历史
  1966. for (let i = 0; i < this.photoList.length - 1; i++) {
  1967. if (
  1968. this.photoList[i] < duration &&
  1969. this.photoList[i + 1] > duration
  1970. ) {
  1971. this.photoIndex = i + 1;
  1972. break;
  1973. }
  1974. if (duration > this.photoList[this.photoList.length - 1]) {
  1975. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1976. break;
  1977. }
  1978. }
  1979. // console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1980. }
  1981. },
  1982. getLiveUid(channelId) {
  1983. let self = this;
  1984. return new Promise((resolve) => {
  1985. let data = {
  1986. channelId: channelId,
  1987. orderGoodsId: this.orderGoodsId,
  1988. };
  1989. self.$api.polyvSign(data).then((res) => {
  1990. resolve(res.data.data);
  1991. });
  1992. });
  1993. },
  1994. timeEventLiving() {
  1995. if (plv != null) {
  1996. if (this.livePlay) {
  1997. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1998. if (this.liveDuration == 2) {
  1999. //直播第2秒拍照
  2000. if (
  2001. this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
  2002. this.channelItem.learning != 1 && this.photoHistoryList.length == 0
  2003. ) {
  2004. //开启直播拍照
  2005. this.openPhoto();
  2006. } else {
  2007. this.postStudyRecord(0);
  2008. }
  2009. }
  2010. }
  2011. }
  2012. },
  2013. playerLiveStatusChange(e) {
  2014. const status = e.detail.status;
  2015. if (status === "live") {
  2016. //开始播放
  2017. if (this.timer) {
  2018. clearInterval(this.timer);
  2019. }
  2020. this.livePlay = true;
  2021. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  2022. }
  2023. if (status === "end") {
  2024. this.hasStart = false;
  2025. if (this.livePlay) {
  2026. //只有播放过的结束才提交,避免未开播触发结束
  2027. this.postStudyRecord(1);
  2028. }
  2029. this.livePlay = false;
  2030. // 未开始
  2031. }
  2032. },
  2033. closePlv() {
  2034. if (plv) {
  2035. plv.destroy();
  2036. }
  2037. },
  2038. playChannel(item) {
  2039. if (this.timer) {
  2040. clearInterval(this.timer);
  2041. }
  2042. this.startStatus = true;
  2043. this.initLive();
  2044. },
  2045. setLiveOption(status) {
  2046. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  2047. this.detail;
  2048. const playRecordFile =
  2049. playbackEnabled && recordFileSimpleModel && status === "end";
  2050. this.videoOption = {
  2051. mode: "live",
  2052. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  2053. cid: this.playChannelId,
  2054. openId: this.userInfo.userAccount,
  2055. isAutoChange: false,
  2056. forceVideo: false,
  2057. };
  2058. },
  2059. async initLive() {
  2060. this.liveObj = await this.getLiveUid(this.playChannelId);
  2061. this.initLiveOk = true;
  2062. let optionsData = {};
  2063. optionsData.mode = "live";
  2064. optionsData.forceVideo = false;
  2065. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  2066. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  2067. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  2068. let self = this;
  2069. this.closePlv();
  2070. plv.init(optionsData).then(({ detail, chat }) => {
  2071. self.liveDetail = detail;
  2072. // 设置mode为live的videoOption
  2073. this.setLiveOption();
  2074. if (detail.isPPT) {
  2075. chat.on(chat.events.SLICESTART, () => {
  2076. // 开始直播
  2077. });
  2078. } else {
  2079. plv.api.getOrdinaryLiveStatus(detail.stream);
  2080. }
  2081. });
  2082. },
  2083. openSetting(res) {
  2084. console.log(res, 98);
  2085. },
  2086. getCameraSetting() {
  2087. const self = this;
  2088. wx.getSetting({
  2089. success: (res) => {
  2090. if (res.authSetting["scope.camera"]) {
  2091. // 用户已经授权
  2092. self.showSet = false;
  2093. this.prendreAutoCarme = false
  2094. } else {
  2095. this.prendreAutoCarme = true
  2096. // 用户还没有授权,向用户发起授权请求
  2097. wx.authorize({
  2098. scope: "scope.camera",
  2099. success:() =>{
  2100. // 用户同意授权
  2101. self.showSet = false;
  2102. this.prendreAutoCarme = false
  2103. },
  2104. fail:() => {
  2105. // 用户不同意授权
  2106. self.showSet = true;
  2107. },
  2108. });
  2109. }
  2110. },
  2111. fail: (res) => {},
  2112. });
  2113. },
  2114. studyNotice() {
  2115. this.noticeShow = true;
  2116. },
  2117. //播放笔记视频
  2118. async playNoteVideo(item) {
  2119. if (this.timer) {
  2120. clearInterval(this.timer);
  2121. }
  2122. if (this.vid) {
  2123. //切换视频
  2124. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2125. polyvPlayerContext.changeVid(item.recordingUrl);
  2126. } else {
  2127. this.vid = item.recordingUrl;
  2128. }
  2129. this.recordObj = { videoCurrentTime: item.noteSecond };
  2130. if (this.recordObj.videoCurrentTime) {
  2131. this.needSeek = true; //需要跳转到播放记录
  2132. }
  2133. this.startStatus = true;
  2134. //获取节笔记
  2135. this.getNoteList();
  2136. },
  2137. //正常播放视频
  2138. async playVideo(item) {
  2139. console.log(item.recordingUrl,'22222222', this.vid);
  2140. if (this.timer) {
  2141. clearInterval(this.timer);
  2142. }
  2143. if (this.vid) {
  2144. //切换视频
  2145. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2146. polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
  2147. } else {
  2148. this.vid = item.recordingUrl;
  2149. }
  2150. this.recordObj = null;
  2151. this.recordObj = await this.getRecordLast();
  2152. // console.log('this.recordObj:', this.recordObj)
  2153. this.needSeek = true; //跳转到播放记录
  2154. this.startStatus = true;
  2155. // 提交学习记录
  2156. this.postStudyRecord(0)
  2157. //获取节笔记
  2158. this.getNoteList();
  2159. },
  2160. getRecordLast() {
  2161. return new Promise((resolve) => {
  2162. let data = {
  2163. gradeId: this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2164. goodsId: this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2165. sectionId: this.playSectionId || 0,
  2166. courseId: this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  2167. chapterId: this.chapterId || 0,
  2168. moduleId: this.moduleId || 0,
  2169. orderGoodsId: this.orderGoodsId,
  2170. };
  2171. this.$api.recordLast(data).then((res) => {
  2172. resolve(res.data.data);
  2173. });
  2174. });
  2175. },
  2176. jumpNote(item) {
  2177. this.noteId = item.noteId;
  2178. //没视频播放
  2179. if (this.playSectionId == 0) {
  2180. this.$u.toast("即将跳到笔记位置");
  2181. this.$store.commit("setPlaySectionId", {
  2182. playSectionId: item.sectionId || item.menuId,
  2183. });
  2184. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  2185. this.playNoteVideo(item);
  2186. } else {
  2187. //正在看当前笔记视频
  2188. this.$u.toast("即将跳到笔记位置");
  2189. //跳到笔记时刻
  2190. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2191. polyvPlayerContext.seek(item.noteSecond);
  2192. polyvPlayerContext.play();
  2193. }
  2194. },
  2195. postNote() {
  2196. let self = this;
  2197. if (!(this.playSectionId > 0)) {
  2198. this.$u.toast("目前无播放视频");
  2199. return;
  2200. }
  2201. if (!this.noteValue) {
  2202. this.$u.toast("请输入内容");
  2203. return;
  2204. }
  2205. if (!this.gradeId) {
  2206. this.$u.toast("暂无班级数据");
  2207. return;
  2208. }
  2209. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2210. let noteDate = this.$method.getZeroTime();
  2211. let noteSecond = polyvPlayerContext.getCurrentTime();
  2212. if (!noteSecond) {
  2213. if (noteSecond == 0) {
  2214. //播放结束
  2215. noteSecond = polyvPlayerContext.getDuration();
  2216. }
  2217. if (!noteSecond) {
  2218. this.$u.toast("视频暂未开始");
  2219. return;
  2220. }
  2221. }
  2222. let data = {
  2223. gradeId: this.gradeId,
  2224. goodsId: this.goodsId,
  2225. sectionId: this.playSectionId,
  2226. courseId: this.courseId,
  2227. noteText: this.noteValue,
  2228. noteDate: noteDate,
  2229. noteSecond: noteSecond,
  2230. orderGoodsId: this.orderGoodsId,
  2231. };
  2232. this.$api.postNote(data).then((res) => {
  2233. if (res.data.code == 200) {
  2234. this.$u.toast("发布成功");
  2235. self.getNoteList();
  2236. this.noteValue = "";
  2237. }
  2238. });
  2239. },
  2240. getGradeInfo() {
  2241. let self = this;
  2242. this.$store.state.allowLoading = false;
  2243. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2244. if (res.data.code == 200) {
  2245. self.gradeDetail = res.data.data;
  2246. if (self.needProfileModal) {
  2247. return;
  2248. }
  2249. if (self.gradeDetail.learningStatus == 2) {
  2250. uni.showModal({
  2251. showCancel: false,
  2252. confirmText: "确定",
  2253. content:
  2254. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2255. success: function (resultst) {
  2256. uni.navigateBack();
  2257. },
  2258. });
  2259. }
  2260. if (
  2261. self.gradeDetail.learningStatus == 3 &&
  2262. Number(self.gradeDetail.learningTimeStart) >
  2263. Number(new Date() / 1000)
  2264. ) {
  2265. uni.showModal({
  2266. showCancel: false,
  2267. cancelText: "返回",
  2268. content:
  2269. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2270. success: function (resultst) {
  2271. uni.navigateBack();
  2272. },
  2273. });
  2274. }
  2275. }
  2276. });
  2277. this.$store.state.allowLoading = true;
  2278. },
  2279. getNoteList() {
  2280. let self = this;
  2281. self.noteList = [];
  2282. let data = {
  2283. courseId: this.courseId,
  2284. gradeId: this.gradeId,
  2285. goodsId: this.goodsId,
  2286. orderGoodsId: this.orderGoodsId,
  2287. };
  2288. if (this.playSectionId > 0) {
  2289. data.sectionId = this.playSectionId;
  2290. }
  2291. this.$api.noteList(data).then((res) => {
  2292. if (res.data.code == 200) {
  2293. self.noteList = res.data.rows;
  2294. }
  2295. });
  2296. },
  2297. delAnswer(answerId) {
  2298. let self = this;
  2299. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  2300. this.$api.delAnswer(data).then((res) => {
  2301. if (res.data.code == 200) {
  2302. self.getAnswerList();
  2303. }
  2304. });
  2305. },
  2306. clearCtx() {
  2307. this.placeholder = "您可以在这里输入答疑内容";
  2308. this.ctxValue = "";
  2309. this.assignUserId = 0;
  2310. },
  2311. focusNote(event) {
  2312. this.bottomHeight = event.detail.height
  2313. },
  2314. blurNote() {
  2315. this.bottomHeight = 0
  2316. },
  2317. blur() {
  2318. this.bottomHeight = 0
  2319. this.clearTimer = setTimeout(() => {
  2320. this.ctxValue = ""
  2321. this.isFocus = false;
  2322. this.assignUserId = 0;
  2323. this.placeholder = '您可以在这里输入答疑内容';
  2324. },2000)
  2325. },
  2326. replyContent(item) {
  2327. this.isFocus = true;
  2328. this.assignUserId = item.userId;
  2329. this.placeholder = "@" + item.realname;
  2330. },
  2331. delContent(item) {
  2332. this.delAnswer(item.answerId);
  2333. },
  2334. postAnswer() {
  2335. let self = this;
  2336. let data = {
  2337. courseId: this.courseId,
  2338. answerText: this.ctxValue,
  2339. goodsId: this.goodsId,
  2340. orderGoodsId: this.orderGoodsId,
  2341. };
  2342. if (this.assignUserId > 0) {
  2343. data.assignUserId = this.assignUserId;
  2344. }
  2345. this.$api.postAnswer(data).then((res) => {
  2346. if (res.data.code == 200) {
  2347. this.$u.toast("发布成功");
  2348. self.getAnswerList();
  2349. this.isFocus = false;
  2350. this.placeholder = "您可以在这里输入答疑内容";
  2351. this.ctxValue = "";
  2352. this.assignUserId = 0;
  2353. }
  2354. });
  2355. },
  2356. postContent() {
  2357. if (!this.ctxValue || this.ctxValue == "") {
  2358. this.$u.toast("请输入内容");
  2359. return;
  2360. }
  2361. this.postAnswer();
  2362. },
  2363. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2364. // console.log('学习记录接口的playSectionId', sectionId);
  2365. let currentTime = 0;
  2366. let PlayDuration = 0;
  2367. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2368. if (polyvPlayerContext) {
  2369. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  2370. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2371. }
  2372. if (this.playChannelId > 0) {
  2373. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2374. }
  2375. let self = this;
  2376. let data = {
  2377. fromPlat: 1, //来源平台 1小程序 2网站
  2378. photo: self.ossAvatarUrl,
  2379. sectionId: sectionId || 0,
  2380. goodsId: parseInt(self.goodsId),
  2381. courseId: parseInt(self.courseId),
  2382. orderGoodsId: this.orderGoodsId,
  2383. studyDuration: parseInt(
  2384. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2385. ),
  2386. gradeId: parseInt(self.gradeId),
  2387. chapterId: this.chapterId || 0,
  2388. moduleId: this.moduleId || 0,
  2389. videoCurrentTime: parseInt(
  2390. currentTime > 0 ? currentTime : self.studyDuration
  2391. ),
  2392. };
  2393. if (this.ossAvatarUrl) {
  2394. data.similarity = this.compareFaceData // 相似度
  2395. }
  2396. if (status > 0) {
  2397. data.status = status;
  2398. }
  2399. // console.log("提交接口:", data,'sectionId:', sectionId,'chapterId:', self.chapterId,'moduleId:', self.moduleId, 'courseId:', this.courseId);
  2400. this.$api.studyRecord(data).then((res) => {
  2401. if (res.data.code == 200) {
  2402. if (status > 0) {
  2403. this.studyRecordMenuAllList()
  2404. let moduleId = this.moduleId || 0;
  2405. let chapterId = this.chapterId || 0;
  2406. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2407. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2408. uni.$emit("playNext" + playNextIdisRebuild, {
  2409. fromRebuild: this.isRebuild,
  2410. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2411. uni.$emit("playNext" + playNextId); //通知播放结束
  2412. }
  2413. self.ossAvatarUrl = "";
  2414. } else {
  2415. this.uploadLock = false;
  2416. uni.showToast({
  2417. icon: "none",
  2418. title: res.data.msg,
  2419. });
  2420. }
  2421. }).catch(err => {
  2422. this.studyRecordMenuAllList()
  2423. })
  2424. },
  2425. uploadFile(options, int) {
  2426. var self = this;
  2427. return new Promise((resolve, reject) => {
  2428. var data = {
  2429. imageStatus: int,
  2430. gradeId: this.gradeId,
  2431. orderGoodsId: this.orderGoodsId,
  2432. };
  2433. self.$api.aliyunpolicy(data).then((res) => {
  2434. if (res.data.code != 200) {
  2435. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2436. return;
  2437. }
  2438. var ossToken = res.data.data.resultContent;
  2439. if (ossToken.host == null || ossToken.host == undefined) {
  2440. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2441. return;
  2442. }
  2443. uni.uploadFile({
  2444. url: ossToken.host,
  2445. name: "file",
  2446. filePath: options,
  2447. fileType: "image",
  2448. header: {
  2449. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2450. },
  2451. formData: {
  2452. key: ossToken.dir,
  2453. OSSAccessKeyId: ossToken.accessid,
  2454. policy: ossToken.policy,
  2455. Signature: ossToken.signature,
  2456. callback: ossToken.callback,
  2457. success_action_status: 200,
  2458. },
  2459. success: (result) => {
  2460. // if (result.statusCode === 200) {
  2461. this.$u.toast('上传成功')
  2462. self.ossAvatarUrl = ossToken.dir;
  2463. resolve();
  2464. // } else {
  2465. // uni.showToast({
  2466. // title: "上传失败",
  2467. // icon: "none",
  2468. // });
  2469. // this.openPhoto();
  2470. // return;
  2471. // }
  2472. },
  2473. fail: (error) => {
  2474. uni.showToast({
  2475. title: "上传接口报错,请重新拍照上传" + error,
  2476. icon: "none",
  2477. });
  2478. this.openPhoto();
  2479. return;
  2480. },
  2481. });
  2482. });
  2483. });
  2484. },
  2485. imageInfos() {
  2486. var self = this;
  2487. return new Promise((resolve, reject) => {
  2488. uni.getImageInfo({
  2489. src: self.avatarUrl,
  2490. success: async (res) => {
  2491. let canvasWidth = res.width; //图片原始长宽
  2492. let canvasHeight = res.height;
  2493. if (canvasWidth > 2000 || canvasHeight > 2000) {
  2494. uni.compressImage({
  2495. src: self.avatarUrl,
  2496. quality: 75,
  2497. width: "35%",
  2498. height: "35%",
  2499. success: async (rest) => {
  2500. const waitUpload = await self.uploadFile(
  2501. rest.tempFilePath,
  2502. 0
  2503. );
  2504. resolve(waitUpload);
  2505. },
  2506. });
  2507. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  2508. uni.compressImage({
  2509. src: self.avatarUrl,
  2510. quality: 75,
  2511. width: "50%",
  2512. height: "50%",
  2513. success: async (rest) => {
  2514. const waitUpload = await self.uploadFile(
  2515. rest.tempFilePath,
  2516. 0
  2517. );
  2518. resolve(waitUpload);
  2519. },
  2520. });
  2521. } else {
  2522. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2523. resolve(waitUpload);
  2524. }
  2525. },
  2526. fail: (err) => {
  2527. this.$u.toast('图片上传失败')
  2528. }
  2529. });
  2530. });
  2531. },
  2532. timeEvent() {
  2533. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2534. if (polyvPlayerContext != null) {
  2535. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2536. console.log(789, this.photoHistoryList, 'this.photoList:', this.photoList, 'photoNum:', this.photoNum, 'playTime:', this.playTime)
  2537. //判断是否需要拍照
  2538. if (this.photoNum > 0) {
  2539. this.configPhoto();
  2540. let photoTime = 0; //获取拍照秒数
  2541. for (let i = 0; i < this.photoList.length; i++) {
  2542. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2543. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2544. //3秒区间内才触发拍照,避免拉动滚动条
  2545. if (
  2546. this.photoHistoryList.indexOf(i) < 0 &&
  2547. this.sectionItem.learning != 1
  2548. ) {
  2549. //不存在拍照历史,没有重修过,没有学过,则拍照
  2550. //启动拍照
  2551. //暂停
  2552. polyvPlayerContext.exitFullScreen();
  2553. polyvPlayerContext.pause();
  2554. this.photoIndex = i;
  2555. if (uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) == this.goodsId) {
  2556. this.openPhoto();
  2557. } else {
  2558. this.popupPhotoShow = true
  2559. uni.setStorageSync(`tabkePhotoShow${this.goodsId}`, this.goodsId) // 本地缓存用来判断是否已经弹出过弹窗
  2560. }
  2561. }
  2562. }
  2563. }
  2564. }
  2565. }
  2566. },
  2567. closeToast() {
  2568. clearTimeout(this.toastTimer);
  2569. this.videoToastShow = false;
  2570. },
  2571. restart() {
  2572. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2573. polyvPlayerContext.seek(0);
  2574. clearTimeout(this.toastTimer);
  2575. this.videoToastShow = false;
  2576. },
  2577. // 新增用户视频学习日志
  2578. studyLog() {
  2579. this.$http({
  2580. url: '/user/study/log',
  2581. method: 'post',
  2582. data: {
  2583. goodsId: this.goodsId,
  2584. courseId: this.courseId,
  2585. moduleId: this.moduleId || 0,
  2586. chapterId: this.chapterId || 0,
  2587. sectionId: this.playSectionId || 0,
  2588. fromPlat: 1, //来源平台 1小程序 2PC网站
  2589. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  2590. orderGoodsId: this.orderGoodsId,
  2591. }
  2592. }).then((res) => {
  2593. })
  2594. },
  2595. onStateChange(newstate, oldstate) {
  2596. console.log('视频的开始播放事件', newstate.detail.newstate, this.needSeek)
  2597. if (newstate.detail.newstate == "playing") {
  2598. if (this.needSeek) {
  2599. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2600. if (this.recordObj.videoCurrentTime) {
  2601. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  2602. this.seekTime = this.$method.secondToDate(
  2603. this.recordObj.videoCurrentTime
  2604. );
  2605. this.videoToastShow = true;
  2606. this.toastTimer = setTimeout(() => {
  2607. this.videoToastShow = false;
  2608. }, 3000);
  2609. } else {
  2610. polyvPlayerContext.seek(1); //避免相同节继续播放
  2611. }
  2612. polyvPlayerContext.play();
  2613. this.needSeek = false;
  2614. // 新增用户视频学习日志
  2615. this.studyLog()
  2616. // 提交学习记录
  2617. }
  2618. //开始播放
  2619. if (this.timer) {
  2620. clearInterval(this.timer);
  2621. }
  2622. this.timer = setInterval(this.timeEvent, 1000); //定时器
  2623. }
  2624. if (newstate.detail.newstate == "pause") {
  2625. clearInterval(this.timer);
  2626. //暂停提交记录
  2627. /* this.ossAvatarUrl = ""
  2628. this.postStudyRecord() */
  2629. }
  2630. if (newstate.detail.newstate == "ended") {
  2631. clearInterval(this.timer);
  2632. uni.showToast({
  2633. icon: "none",
  2634. title: "播放完毕",
  2635. });
  2636. this.hasStart = false;
  2637. this.postStudyRecord(1);
  2638. this.nextSection()
  2639. // uni.$emit('playNext') //播放重修下一节
  2640. }
  2641. },
  2642. //播放下一节
  2643. nextSection(){
  2644. if(!this.menuAllList.length){
  2645. return
  2646. }
  2647. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  2648. let i_sectionId = item.sectionId || 0
  2649. let i_chapterId = item.chapterId || 0
  2650. let i_moduleId = item.moduleId || 0
  2651. return i_sectionId == this.playSectionId && i_chapterId == this.chapterId && i_moduleId == this.moduleId
  2652. })
  2653. let data = this.menuAllList[this.curPlayIndex+1];
  2654. if (!data) {
  2655. //第二个弹窗
  2656. uni.showModal({
  2657. title: '温馨提示',
  2658. content: '当前最后一节视频已学完 请检查所有章节是否学习完成?',
  2659. showCancel: false,
  2660. success: (res) => {
  2661. if (res.confirm) {
  2662. }
  2663. }
  2664. })
  2665. } else {
  2666. uni.showModal({
  2667. title: '温馨提示',
  2668. content: '当前节视频已学完,继续学习下一节?',
  2669. success: async (res) => {
  2670. if (res.confirm) {
  2671. this.moduleId = data.moduleId
  2672. this.chapterId = data.chapterId
  2673. this.sectionId = data.sectionId
  2674. if(data.sectionType == 1) { //录播
  2675. this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
  2676. this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
  2677. this.hasStart = false;
  2678. this.photoConfig = false;
  2679. this.photoIndex = 0;
  2680. this.sectionItem = data;
  2681. await this.getPhotoLastRecord() // 获取拍照历史
  2682. this.playVideo(data)
  2683. } else if(data.sectionType == 2) { //直播
  2684. this.studyRecordGetLastLive();
  2685. } else if(data.sectionType == 3) { //回放
  2686. this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
  2687. this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
  2688. this.sectionItem = data
  2689. this.playVideo(data)
  2690. }
  2691. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  2692. this.$store.commit("updatePlayNextId", playNextId);
  2693. this.updateChapterOpen(true)
  2694. this.reStart = false
  2695. this.getMenuList()
  2696. }
  2697. }
  2698. })
  2699. }
  2700. },
  2701. //拍照
  2702. openPhoto() {
  2703. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2704. if (polyvPlayerContext) {
  2705. polyvPlayerContext.exitFullScreen();
  2706. }
  2707. this.enableAutoRotation = false;
  2708. this.photoPopup = true;
  2709. this.isTaking = true;
  2710. uni.setKeepScreenOn({
  2711. keepScreenOn: true,
  2712. });
  2713. uni.authorize({
  2714. scope: "scope.camera",
  2715. success() {},
  2716. });
  2717. },
  2718. /**
  2719. * 人脸匹配
  2720. */
  2721. faceRecognition() {
  2722. return new Promise((resolve) => {
  2723. let fileSystem = uni.getFileSystemManager();
  2724. fileSystem.readFile({
  2725. filePath: `${this.avatarUrl}`,
  2726. encoding: "base64",
  2727. position: 0,
  2728. success: (res) => {
  2729. let base64 = "data:image/jpg;base64," + res.data;
  2730. // console.log('base64Data人脸识别参数:', {
  2731. // imageA: base64,
  2732. // orderGoodsId: this.orderGoodsId,
  2733. // gradeId: this.gradeId,
  2734. // })
  2735. let timer = setTimeout(() => {
  2736. uni.showToast({
  2737. icon: "none",
  2738. title: '拍照超时,请重新拍照',
  2739. duration: 2000,
  2740. success: () => {
  2741. setTimeout(() => {
  2742. uni.navigateBack()
  2743. }, 1000)
  2744. }
  2745. })
  2746. }, 10 * 1000)
  2747. this.$api
  2748. .faceCertificationCompareFace({
  2749. imageA: base64,
  2750. orderGoodsId: this.orderGoodsId,
  2751. gradeId: this.gradeId,
  2752. })
  2753. .then((res) => {
  2754. clearTimeout(timer)
  2755. console.log(res, "人脸识别成功res");
  2756. resolve(res.data.data);
  2757. }).catch((err) => {
  2758. clearTimeout(timer)
  2759. // 当前网络延迟,
  2760. console.log('人脸识别错误:', err)
  2761. uni.showModal({
  2762. content: "当前网络延迟",
  2763. showCancel: false,
  2764. success: (resultst) => {
  2765. if (resultst.confirm) {
  2766. uni.navigateBack()
  2767. }
  2768. },
  2769. })
  2770. })
  2771. },
  2772. fail(err) {
  2773. // this.$u.toast('人脸识别错误!')
  2774. console.error(err, "err-----人脸识别错误");
  2775. },
  2776. });
  2777. });
  2778. },
  2779. // 确定拍照
  2780. async submit() {
  2781. if (this.uploadLock) {
  2782. return;
  2783. }
  2784. this.uploadLock = true;
  2785. let compareFaceData = await this.faceRecognition();
  2786. // console.log(compareFaceData,'compareFaceData')
  2787. this.compareFaceData = compareFaceData
  2788. if (compareFaceData >= 80) {
  2789. const waitYS = await this.imageInfos();
  2790. this.postCoursePhotoRecord()
  2791. .then((res) => {
  2792. this.photoHistoryList.push(this.photoIndex);
  2793. // console.log('拍照确定提交', this.photoHistoryList);
  2794. this.postStudyRecord(); //提交记录
  2795. //恢复播放
  2796. uni.setKeepScreenOn({
  2797. keepScreenOn: false,
  2798. });
  2799. this.photoPopup = false;
  2800. this.uploadLock = false;
  2801. this.enableAutoRotation = true;
  2802. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2803. if (polyvPlayerContext != null) {
  2804. polyvPlayerContext.play();
  2805. }
  2806. })
  2807. .catch((err) => {
  2808. uni.showToast({
  2809. title: "上传接口报错,请重新拍照上传" + err,
  2810. icon: "none",
  2811. });
  2812. this.uploadLock = false;
  2813. this.openPhoto();
  2814. });
  2815. } else {
  2816. uni.showToast({
  2817. title: "人脸匹配不通过,请重新拍照上传",
  2818. icon: "none",
  2819. duration: 2000,
  2820. });
  2821. setTimeout(() => {
  2822. this.uploadLock = false;
  2823. this.openPhoto();
  2824. }, 2000);
  2825. }
  2826. },
  2827. reTake() {
  2828. this.isTaking = true;
  2829. },
  2830. toTakePhoto() {
  2831. this.popupPhotoShow = false
  2832. this.openPhoto()
  2833. },
  2834. takePhTips() {
  2835. this.popupPhotoShow = true
  2836. this.isTaking = false
  2837. this.photoPopup = false
  2838. this.enableAutoRotation = false
  2839. },
  2840. //确认拍照
  2841. takePhoto() {
  2842. var self = this;
  2843. const ctx = uni.createCameraContext();
  2844. ctx.takePhoto({
  2845. quality: "high",
  2846. success: (res) => {
  2847. self.avatarUrl = res.tempImagePath;
  2848. this.isTaking = false;
  2849. },
  2850. fail: (err) => {
  2851. },
  2852. });
  2853. },
  2854. playError(e) {
  2855. console.log(e);
  2856. },
  2857. //拍照报错
  2858. error(e) {
  2859. console.log(e.detail);
  2860. },
  2861. //关闭相机
  2862. closePhoto() {
  2863. this.photoPopup = false;
  2864. self.enableAutoRotation = true;
  2865. },
  2866. /**
  2867. * 进入全屏
  2868. */
  2869. fullscreenchange(event) {
  2870. if (event.detail.direction == "vertical") {
  2871. this.navShow = true;
  2872. } else if (event.detail.direction == "horizontal") {
  2873. this.navShow = false;
  2874. }
  2875. },
  2876. getGoodsDetail() {
  2877. let self = this;
  2878. // '/goods/'+ data,
  2879. this.$api.goodsDetail(this.goodsId).then((res) => {
  2880. this.goodsData = res.data.data;
  2881. if(self.goodsData.buyNote) {
  2882. this.baseHandoutTipList()
  2883. }
  2884. self.gradeId = self.goodsData.gradeId;
  2885. this.courseBusiness(this.goodsData.businessId);
  2886. this.courseHandouts();
  2887. self.getMenuList();
  2888. self.getReMenuList(); //获取重修目录
  2889. setTimeout(function () {
  2890. if (!self.needProfileModal) {
  2891. self.getGradeInfo();
  2892. }
  2893. }, 500);
  2894. //获取节笔记
  2895. this.getNoteList();
  2896. if (self.goodsData.goodsPlayConfig) {
  2897. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2898. // if (self.goodsPlayConfig.autoPlay > 0) {
  2899. // self.autoplay = true;
  2900. // }
  2901. if (self.goodsPlayConfig.drag > 0) {
  2902. self.isAllowSeek = "yes";
  2903. }
  2904. if (self.goodsPlayConfig.speed > 0) {
  2905. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2906. }
  2907. }
  2908. if (self.goodsData.goodsPhotographConfig) {
  2909. self.goodsPhotographConfig = JSON.parse(
  2910. self.goodsData.goodsPhotographConfig
  2911. );
  2912. if (self.goodsPhotographConfig.photoNum > 0) {
  2913. self.photoNum = self.goodsPhotographConfig.photoNum;
  2914. // console.log(self.photoNum, 777777);
  2915. }
  2916. }
  2917. });
  2918. },
  2919. startVideo() {
  2920. this.startStatus = true;
  2921. },
  2922. getAnswerList() {
  2923. let self = this;
  2924. this.$api
  2925. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2926. .then((res) => {
  2927. if (res.data.code == 200) {
  2928. self.answerList = res.data.rows;
  2929. }
  2930. });
  2931. },
  2932. getReMenuList() {
  2933. // console.log('重修的目录');
  2934. let self = this;
  2935. this.$api
  2936. .reMenuList({
  2937. orderGoodsId: this.orderGoodsId,
  2938. courseId: this.courseId,
  2939. rebuild: 1,
  2940. gradeId: this.gradeId,
  2941. })
  2942. .then((res) => {
  2943. if (res.data.code == 200) {
  2944. for (let i = 0; i < res.data.rows.length; i++) {
  2945. let item = res.data.rows[i];
  2946. item.down = true;
  2947. item.id = item.menuId;
  2948. item.name = item.menuName;
  2949. }
  2950. self.reMenuList = res.data.rows;
  2951. if (self.reMenuList.length > 0) {
  2952. this.showNotes = false;
  2953. self.list = [
  2954. {
  2955. name: "目录",
  2956. },
  2957. {
  2958. name: "讲义",
  2959. },
  2960. {
  2961. name: "笔记",
  2962. },
  2963. {
  2964. name: "答疑",
  2965. },
  2966. { name: "重修目录" },
  2967. ];
  2968. this.current = 0;
  2969. if (Object.keys(this.sectionItem).length) {
  2970. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  2971. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  2972. }
  2973. } else {
  2974. if (Object.keys(this.sectionItem).length) {
  2975. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  2976. this.$store.commit("updatePlayNextId", playNextId);
  2977. }
  2978. self.list = [
  2979. {
  2980. name: "目录",
  2981. },
  2982. {
  2983. name: "讲义",
  2984. },
  2985. {
  2986. name: "笔记",
  2987. },
  2988. {
  2989. name: "答疑",
  2990. },
  2991. ];
  2992. this.current = 0;
  2993. }
  2994. }
  2995. });
  2996. },
  2997. getMenuList() {
  2998. // console.log('menuList的目录');
  2999. let self = this;
  3000. // /course/menuList 查询课程目录结构列表
  3001. this.$api
  3002. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  3003. .then((res) => {
  3004. if (res.data.code == 200) {
  3005. for (let i = 0; i < res.data.rows.length; i++) {
  3006. let item = res.data.rows[i];
  3007. item.down = true;
  3008. item.id = item.menuId;
  3009. item.name = item.menuName;
  3010. item.menuType = item.type;
  3011. }
  3012. self.menuList = res.data.rows;
  3013. this.reStart = true
  3014. for (let i = 0; i < res.data.rows.length; i++) {
  3015. if (res.data.rows[i].type == 1) {
  3016. // 模块
  3017. if (Object.keys(this.sectionItem).length) {
  3018. if (res.data.rows[i].menuId == this.sectionItem.moduleId) {
  3019. this.menuIndex = [i];
  3020. break;
  3021. }
  3022. } else {
  3023. this.menuIndex = [i];
  3024. break;
  3025. }
  3026. } else if (res.data.rows[i].type == 2) {
  3027. // 章
  3028. if (Object.keys(this.sectionItem).length) {
  3029. if (res.data.rows[i].menuId == this.sectionItem.chapterId && (!this.sectionItem.moduleId || this.sectionItem.moduleId == 0)) {
  3030. this.menuIndex = [i];
  3031. break;
  3032. }
  3033. } else {
  3034. this.menuIndex = [i];
  3035. break;
  3036. }
  3037. }
  3038. }
  3039. // console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
  3040. }
  3041. });
  3042. },
  3043. courseDetail() {
  3044. let self = this;
  3045. // '/course/'+data,
  3046. this.$api.courseDetail(this.courseId).then((res) => {
  3047. if (res.data.code == 200) {
  3048. // if (res.data.data.educationName == "继续教育") {
  3049. this.$api
  3050. .lockLockAction({
  3051. action: "jxjy",
  3052. uuid:this.$method.getUuid()
  3053. })
  3054. .then((res) => {});
  3055. this.lockTimer = setInterval(() => {
  3056. this.$api
  3057. .lockLockAction({
  3058. action: "jxjy",
  3059. uuid:this.$method.getUuid()
  3060. })
  3061. .then((res) => {});
  3062. }, 10000);
  3063. // websocket.sendMsg("doCourse");
  3064. // }
  3065. self.detail = res.data.data;
  3066. }
  3067. });
  3068. },
  3069. open(item) {
  3070. item.showChildren = !item.showChildren;
  3071. },
  3072. change(index) {
  3073. this.current = index;
  3074. },
  3075. openDocument() {
  3076. this.downLoading = true
  3077. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  3078. uni.downloadFile({
  3079. url: url,
  3080. success: (res) => {
  3081. var filePath = res.tempFilePath;
  3082. uni.openDocument({
  3083. filePath: filePath,
  3084. showMenu: this.courseHandoutsData.canDownload == 1 ? true : false,
  3085. success: (res) => {
  3086. this.downLoading = false
  3087. uni.setStorageSync('current', this.current)
  3088. },
  3089. fail: (err) => {
  3090. this.downLoading = false
  3091. uni.showToast({
  3092. icon: "none",
  3093. title: "文档地址错误",
  3094. });
  3095. },
  3096. });
  3097. },
  3098. fail: (err) => {
  3099. this.downLoading = false
  3100. uni.showModal({
  3101. title: "提示",
  3102. content: "文档错误," + err.errMsg,
  3103. showCancel: false,
  3104. });
  3105. },
  3106. });
  3107. },
  3108. clickMulu() {
  3109. this.muluStyle = !this.muluStyle
  3110. }
  3111. },
  3112. };
  3113. </script>
  3114. <style lang="scss" scope>
  3115. @import './css/detail.scss';
  3116. .top {
  3117. &__header {
  3118. position:relative;
  3119. width:100%;
  3120. height:150rpx;
  3121. padding:24rpx 150rpx 24rpx 24rpx;
  3122. .img {
  3123. position:absolute;
  3124. left:0;
  3125. top:0;
  3126. width:100%;
  3127. }
  3128. .note {
  3129. position:relative;
  3130. z-index: 10;
  3131. font-size: 24rpx;
  3132. font-family: PingFang SC;
  3133. font-weight: bold;
  3134. color: #EFDBFF;
  3135. }
  3136. .title {
  3137. position:relative;
  3138. z-index: 10;
  3139. font-size: 26rpx;
  3140. font-family: PingFang SC;
  3141. font-weight: bold;
  3142. color: #FFFFFF;
  3143. }
  3144. }
  3145. }
  3146. #top {
  3147. position: relative;
  3148. z-index: 99;
  3149. }
  3150. .polyv_detail {
  3151. display: flex;
  3152. flex-direction: column;
  3153. height: 100vh;
  3154. position: relative;
  3155. top: 0;
  3156. left: 0;
  3157. .pops {
  3158. position: absolute;
  3159. top: 0;
  3160. left: 0;
  3161. background: #ccc;
  3162. opacity: 0.5;
  3163. width: 100%;
  3164. height: 300rpx;
  3165. z-index: 9999;
  3166. }
  3167. .box {
  3168. flex: 1;
  3169. overflow: hidden;
  3170. margin: 16rpx 16rpx 100rpx 16rpx;
  3171. .box_in {
  3172. height: 100%;
  3173. }
  3174. }
  3175. .first_ml {
  3176. margin: 16rpx 16rpx 16rpx 16rpx;
  3177. }
  3178. }
  3179. .btnSet {
  3180. width: 440rpx;
  3181. height: 80rpx;
  3182. background: #007aff;
  3183. border-radius: 40rpx;
  3184. color: #ffffff;
  3185. font-size: 28rpx;
  3186. line-height: 80rpx;
  3187. }
  3188. .btnReply {
  3189. width: 80rpx;
  3190. height: 40rpx;
  3191. background: #e3f0ff;
  3192. border-radius: 16rpx;
  3193. text-align: center;
  3194. color: #007aff;
  3195. }
  3196. .btnDel {
  3197. width: 80rpx;
  3198. height: 40rpx;
  3199. background: #ffedf0;
  3200. border-radius: 16rpx;
  3201. text-align: center;
  3202. color: #ff2d55;
  3203. }
  3204. .btnReply {
  3205. width: 80rpx;
  3206. height: 40rpx;
  3207. background: #e3f0ff;
  3208. border-radius: 16rpx;
  3209. font-size: 24rpx;
  3210. }
  3211. .lecture-box {
  3212. display: flex;
  3213. align-items: center;
  3214. height: 80rpx;
  3215. background: #ffffff;
  3216. border-radius: 16rpx 16rpx 16rpx 16rpx;
  3217. .title {
  3218. padding: 10rpx;
  3219. flex: 1;
  3220. overflow: hidden;
  3221. text-overflow: ellipsis;
  3222. white-space: nowrap;
  3223. color: #333;
  3224. font-weight: bold;
  3225. font-size: 32rpx;
  3226. }
  3227. .btn {
  3228. display: flex;
  3229. align-items: center;
  3230. justify-content: center;
  3231. width: 80rpx;
  3232. height: 80rpx;
  3233. background: #ffffff;
  3234. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  3235. border-radius: 16rpx 16rpx 16rpx 16rpx;
  3236. }
  3237. @keyframes rotation{
  3238. from {-webkit-transform: rotate(0deg);}
  3239. to {-webkit-transform: rotate(360deg);}
  3240. }
  3241. .loading_down {
  3242. transform: rotate(360deg);
  3243. animation: rotation 3s linear infinite;
  3244. }
  3245. }
  3246. .lecture-content {
  3247. background: #fff;
  3248. margin-top: 10rpx;
  3249. padding: 10rpx;
  3250. border-radius: 16rpx;
  3251. }
  3252. .photoBox {
  3253. width: 100%;
  3254. // background-color: #ffffff;
  3255. // border-radius: 24px 24px 0px 0px;
  3256. .photoTop {
  3257. width: 100%;
  3258. height: 74rpx;
  3259. border-radius: 20px 20px 0px 0px;
  3260. background-color: #ffffff;
  3261. display: flex;
  3262. align-items: center;
  3263. justify-content: center;
  3264. padding: 0rpx 38rpx;
  3265. .sqzz {
  3266. width: 28rpx;
  3267. height: 28rpx;
  3268. display: flex;
  3269. align-items: center;
  3270. justify-content: center;
  3271. }
  3272. .centersq {
  3273. color: #333;
  3274. font-size: 30rpx;
  3275. font-weight: 500;
  3276. }
  3277. }
  3278. .photoCenter {
  3279. width: 750rpx;
  3280. height: 75vh;
  3281. position: relative;
  3282. .center_camera {
  3283. width: 100%;
  3284. height: 75vh;
  3285. position: fixed;
  3286. .head_take {
  3287. width: 100%;
  3288. height: 75vh;
  3289. display: flex;
  3290. flex-direction: column;
  3291. }
  3292. .headTake_up {
  3293. width: 100%;
  3294. height: 100rpx;
  3295. }
  3296. .headTake_minddle {
  3297. display: flex;
  3298. .min_img {
  3299. width: 500rpx;
  3300. height: 550rpx;
  3301. }
  3302. .min_left, .min_right {
  3303. flex: 1;
  3304. height: 550rpx;
  3305. }
  3306. }
  3307. .headTake_down {
  3308. width: 100%;
  3309. flex: 1;
  3310. }
  3311. .color {
  3312. background-color: #333;
  3313. opacity: 0.5;
  3314. }
  3315. }
  3316. .custom {
  3317. width: 750rpx;
  3318. height: 75vh;
  3319. position: absolute;
  3320. z-index: 1000;
  3321. top: 0;
  3322. left: 0;
  3323. image {
  3324. width: 100%;
  3325. height: 100%;
  3326. }
  3327. }
  3328. }
  3329. .btns {
  3330. display: flex;
  3331. .takePhoto_btn {
  3332. width: 100%;
  3333. display: flex;
  3334. align-items: center;
  3335. justify-content: space-between;
  3336. background: #A9A7A9;
  3337. padding: 40rpx 26rpx;
  3338. .middle_btn {
  3339. width: 120rpx;
  3340. height: 120rpx;
  3341. border-radius: 40rpx;
  3342. border: 4rpx solid #FFFFFF;
  3343. display: flex;
  3344. align-items: center;
  3345. justify-content: center;
  3346. }
  3347. .square {
  3348. width: 96rpx;
  3349. height: 96rpx;
  3350. background: #FFFFFF;
  3351. border-radius: 28rpx;
  3352. }
  3353. .rights {
  3354. font-size: 32rpx;
  3355. font-weight: 500;
  3356. color: #FFFFFF;
  3357. }
  3358. }
  3359. .btnResult {
  3360. height: 100rpx;
  3361. flex: 1;
  3362. background-color: #07c160;
  3363. text-align: center;
  3364. line-height: 100rpx;
  3365. color: #fff;
  3366. font-size: 32rpx;
  3367. font-weight: bold;
  3368. }
  3369. }
  3370. }
  3371. .chat_box {
  3372. display: flex;
  3373. padding: 20rpx;
  3374. justify-content: space-between;
  3375. }
  3376. .chat3 {
  3377. font-size: 30rpx;
  3378. font-family: PingFang SC;
  3379. font-weight: 500;
  3380. color: #666666;
  3381. margin-top: 10rpx;
  3382. }
  3383. .chat2 {
  3384. font-size: 20rpx;
  3385. font-family: PingFang SC;
  3386. font-weight: 500;
  3387. color: #999999;
  3388. margin-top: 10rpx;
  3389. }
  3390. .chat1 {
  3391. font-size: 24rpx;
  3392. font-family: PingFang SC;
  3393. font-weight: 500;
  3394. color: #333333;
  3395. }
  3396. .leftPadding {
  3397. margin-left: 8rpx;
  3398. }
  3399. .t2Content {
  3400. font-size: 24rpx;
  3401. font-family: PingFang SC;
  3402. font-weight: bold;
  3403. color: #999999;
  3404. line-height: 48rpx;
  3405. }
  3406. .tBox2 {
  3407. display: flex;
  3408. padding-top: 10rpx;
  3409. color: #333333;
  3410. font-size: 30rpx;
  3411. font-weight: 400;
  3412. }
  3413. .tBox {
  3414. display: flex;
  3415. align-items: center;
  3416. padding-top: 10rpx;
  3417. }
  3418. .title {
  3419. font-size: 24rpx;
  3420. color: #999999;
  3421. }
  3422. .Answering {
  3423. .answer_item {
  3424. &:nth-child(2) {
  3425. border-radius: 16rpx 16rpx 0rpx 0rpx;
  3426. }
  3427. &:nth-last-child(1) {
  3428. border-radius: 0rpx 0rpx 16rpx 16rpx;
  3429. }
  3430. }
  3431. }
  3432. .inputBottom {
  3433. position: fixed;
  3434. left: 0;
  3435. bottom: 0;
  3436. background: #ffffff;
  3437. height: 98rpx;
  3438. display: flex;
  3439. align-items: center;
  3440. width: 100%;
  3441. .flex_auto {
  3442. flex: 1;
  3443. margin-left: 10%;
  3444. // .input {
  3445. // height: 60rpx;
  3446. // }
  3447. }
  3448. .btn {
  3449. color: #007aff;
  3450. font-size: 30rpx;
  3451. font-weight: bold;
  3452. width: 15%;
  3453. text-align: center;
  3454. }
  3455. .input {
  3456. background: rgba(244, 244, 244, 0.98);
  3457. height: 60rpx;
  3458. border-radius: 24rpx;
  3459. margin-top: 12rpx;
  3460. }
  3461. }
  3462. .noteBox {
  3463. width: 100%;
  3464. background: #ffffff;
  3465. padding: 0rpx 10rpx 20rpx;
  3466. border-radius: 16rpx;
  3467. overflow: hidden;
  3468. .left_ti {
  3469. padding-top: 14rpx;
  3470. }
  3471. }
  3472. .dateBox {
  3473. width: 216rpx;
  3474. height: 48rpx;
  3475. background: #ffffff;
  3476. border-radius: 24rpx;
  3477. font-size: 24rpx;
  3478. color: #666666;
  3479. text-align: center;
  3480. line-height: 48rpx;
  3481. margin: 16rpx 0rpx 8rpx;
  3482. }
  3483. .t_content1 {
  3484. color: #007aff;
  3485. margin-left: 10rpx;
  3486. }
  3487. .tag1 {
  3488. border: 2rpx solid #007aff;
  3489. border-radius: 8rpx;
  3490. font-size: 20rpx;
  3491. color: #007aff;
  3492. padding: 5rpx;
  3493. }
  3494. .b_title {
  3495. color: #333333;
  3496. font-size: 30rpx;
  3497. font-weight: bold;
  3498. }
  3499. page {
  3500. background: #eaeef1;
  3501. }
  3502. .menuBox {
  3503. width: 100%;
  3504. background: #ffffff;
  3505. border-radius: 16rpx;
  3506. padding: 0rpx 20rpx;
  3507. margin-bottom: 20rpx;
  3508. }
  3509. .btnspric {
  3510. border-top: 1rpx solid #eee;
  3511. display: flex;
  3512. align-items: center;
  3513. justify-content: space-between;
  3514. height: 108rpx;
  3515. padding-left: 43rpx;
  3516. padding-right: 32rpx;
  3517. }
  3518. .btnspric > .lefprL {
  3519. font-size: 36rpx;
  3520. color: #0c141f;
  3521. font-weight: bold;
  3522. }
  3523. .btnspric > .lefprR {
  3524. padding: 0rpx 24rpx;
  3525. height: 60rpx;
  3526. line-height: 60rpx;
  3527. text-align: center;
  3528. color: #fff;
  3529. background: #32467b;
  3530. border-radius: 24rpx;
  3531. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3532. }
  3533. .yhj,
  3534. .hdyhj {
  3535. padding: 24rpx 29rpx 24rpx 34rpx;
  3536. }
  3537. .yhj {
  3538. border-bottom: 16rpx solid #f9f9f9;
  3539. }
  3540. .yhjtit {
  3541. font-size: 30rpx;
  3542. color: #0c141f;
  3543. font-weight: 500;
  3544. margin-bottom: 14rpx;
  3545. }
  3546. .yhjList {
  3547. display: flex;
  3548. align-items: center;
  3549. justify-content: space-between;
  3550. margin-bottom: 14rpx;
  3551. }
  3552. .yhjList > .yhjLefts {
  3553. display: flex;
  3554. align-items: center;
  3555. }
  3556. .yhjLefts > .yhl {
  3557. color: #32467b;
  3558. font-size: 30rpx;
  3559. margin-right: 31rpx;
  3560. }
  3561. .yhjLefts > .yhbq {
  3562. font-size: 24rpx;
  3563. color: #ff9500;
  3564. border-radius: 18rpx;
  3565. background-color: rgba(255, 149, 0, 0.2);
  3566. border: 2rpx solid #ff9500;
  3567. height: 38rpx;
  3568. line-height: 38rpx;
  3569. padding: 0rpx 16rpx;
  3570. }
  3571. .ts {
  3572. font-size: 24rpx;
  3573. color: #999;
  3574. margin: 14rpx 0rpx;
  3575. padding-right: 29rpx;
  3576. padding-left: 34rpx;
  3577. }
  3578. .yh {
  3579. padding-top: 20rpx;
  3580. }
  3581. .yh > .yhtitle {
  3582. display: flex;
  3583. align-items: center;
  3584. justify-content: space-between;
  3585. padding-right: 29rpx;
  3586. padding-left: 34rpx;
  3587. }
  3588. .priceBxs {
  3589. display: flex;
  3590. align-items: center;
  3591. }
  3592. .priceBxs > .pricleft {
  3593. border-radius: 24rpx;
  3594. border: 1rpx solid #e91313;
  3595. background-color: rgba(233, 19, 19, 0.1);
  3596. padding: 0rpx 18rpx;
  3597. height: 49rpx;
  3598. line-height: 49rpx;
  3599. text-align: center;
  3600. font-size: 30rpx;
  3601. font-weight: 500;
  3602. color: #e91313;
  3603. margin-right: 13rpx;
  3604. }
  3605. .topBox {
  3606. padding: 32rpx 32rpx 24rpx;
  3607. border-bottom: 1rpx solid #eeeeee;
  3608. }
  3609. .topBox > .boldFonstType {
  3610. font-weight: 500;
  3611. font-size: 30rpx;
  3612. margin: 16rpx 0rpx 23rpx;
  3613. }
  3614. .topBox > .firstTopL {
  3615. display: flex;
  3616. align-items: center;
  3617. }
  3618. .topBox > .firstTopL > .imageBs {
  3619. width: 331rpx;
  3620. height: 160rpx;
  3621. border-radius: 6rpx;
  3622. overflow: hidden;
  3623. margin-right: 8rpx;
  3624. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  3625. }
  3626. .topBox > .firstTopL > .imageBs > image {
  3627. width: 100%;
  3628. height: 100%;
  3629. }
  3630. .topBox > .firstTopL > .textBs {
  3631. font-size: 30rpx;
  3632. font-weight: bold;
  3633. color: #0c141f;
  3634. }
  3635. .content {
  3636. padding: 24rpx;
  3637. text-align: left;
  3638. }
  3639. .catalogBox {
  3640. display: flex;
  3641. align-items: center;
  3642. flex-wrap: nowrap;
  3643. overflow-x: auto;
  3644. padding-left: 38rpx;
  3645. max-height: 305rpx;
  3646. overflow-y: auto;
  3647. transition: all 0.4s;
  3648. }
  3649. .catalogBox > .catalogA {
  3650. min-width: 200rpx;
  3651. height: 48rpx;
  3652. line-height: 48rpx;
  3653. // text-align: center;
  3654. border: 2rpx solid transparent;
  3655. white-space: nowrap;
  3656. text-overflow: ellipsis;
  3657. overflow: hidden;
  3658. word-break: break-all;
  3659. border-radius: 10rpx;
  3660. background: rgba(22, 119, 255, 0.05);
  3661. padding-left: 19rpx;
  3662. box-sizing: border-box;
  3663. padding-right: 15rpx;
  3664. margin-right: 16rpx;
  3665. margin-bottom: 20rpx;
  3666. margin-top: 15rpx;
  3667. font-size: 24rpx;
  3668. color: #666;
  3669. }
  3670. .catalogBox > .activesq {
  3671. border-color: #1677ff;
  3672. }
  3673. .changeCatalogBox {
  3674. display: block;
  3675. }
  3676. .catalogBox::-webkit-scrollbar {
  3677. display: none; /* Chrome Safari */
  3678. }
  3679. .price_t2 {
  3680. font-size: 18rpx;
  3681. font-family: PingFang SC;
  3682. font-weight: 500;
  3683. text-decoration: line-through;
  3684. color: #999999;
  3685. }
  3686. .price_t1 {
  3687. font-size: 33rpx;
  3688. font-family: PingFang SC;
  3689. font-weight: bold;
  3690. color: #e91313;
  3691. }
  3692. .sc_t {
  3693. font-size: 22rpx;
  3694. color: #000000;
  3695. }
  3696. .sc {
  3697. width: 29rpx;
  3698. height: 29rpx;
  3699. }
  3700. .buy {
  3701. width: 138rpx;
  3702. height: 48rpx;
  3703. line-height: 48rpx;
  3704. background: #32467b;
  3705. border-radius: 10rpx;
  3706. color: #ffffff;
  3707. font-size: 28rpx;
  3708. text-align: center;
  3709. vertical-align: middle;
  3710. position: absolute;
  3711. right: 30rpx;
  3712. }
  3713. .video_body {
  3714. padding-bottom: 96rpx;
  3715. }
  3716. .footer_tab {
  3717. position: fixed;
  3718. bottom: 0;
  3719. height: 96rpx;
  3720. width: 100%;
  3721. background-color: #ffffff;
  3722. }
  3723. .tj_box {
  3724. width: 50%;
  3725. display: inline-block;
  3726. text-align: center;
  3727. margin: 10rpx 0;
  3728. }
  3729. .teacher_t {
  3730. font-size: 24rpx;
  3731. font-family: PingFang SC;
  3732. font-weight: 400;
  3733. color: #666666;
  3734. line-height: 36rpx;
  3735. margin-left: 15rpx;
  3736. }
  3737. .teacher_img {
  3738. width: 87rpx;
  3739. height: 129rpx;
  3740. }
  3741. .t2 {
  3742. font-size: 24rpx;
  3743. font-family: PingFang SC;
  3744. color: #666666;
  3745. line-height: 36rpx;
  3746. margin: 15rpx;
  3747. }
  3748. .r_t2 {
  3749. width: 201rpx;
  3750. height: 49rpx;
  3751. background: rgba(22, 119, 255, 0.05);
  3752. border: 1rpx solid #32467b;
  3753. border-radius: 16rpx;
  3754. color: #666666;
  3755. font-size: 23rpx;
  3756. text-align: center;
  3757. display: flex;
  3758. align-items: center;
  3759. padding: 5rpx;
  3760. }
  3761. .scroll_box {
  3762. width: 100%;
  3763. height: 60rpx;
  3764. background: #ffffff;
  3765. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3766. white-space: nowrap;
  3767. overflow: hidden;
  3768. margin: 15rpx 0;
  3769. }
  3770. .r_sliper {
  3771. padding: 0 20rpx;
  3772. }
  3773. .top_line {
  3774. width: 6rpx;
  3775. height: 22rpx;
  3776. background: #32467b;
  3777. margin-right: 10rpx;
  3778. }
  3779. .video_t2 {
  3780. font-size: 24rpx;
  3781. font-family: PingFang SC;
  3782. font-weight: 500;
  3783. color: #666666;
  3784. }
  3785. .video_play {
  3786. position: absolute;
  3787. width: 95rpx;
  3788. height: 95rpx;
  3789. top: 0;
  3790. left: 0;
  3791. right: 0;
  3792. bottom: 0;
  3793. margin: auto;
  3794. }
  3795. .video_box {
  3796. position: relative;
  3797. #playerVideo {
  3798. position: relative;
  3799. z-index: 99;
  3800. }
  3801. .video-toast {
  3802. position: absolute;
  3803. width: 686rpx;
  3804. height: 80rpx;
  3805. background: rgba(0, 0, 0, 0.6);
  3806. border-radius: 24rpx;
  3807. bottom: 100rpx;
  3808. left: 50%;
  3809. transform: translateX(-50%);
  3810. color: #fff;
  3811. display: flex;
  3812. font-size: 26rpx;
  3813. align-items: center;
  3814. overflow: visible;
  3815. &__text {
  3816. flex: 1;
  3817. margin-left: 40rpx;
  3818. }
  3819. &__btn {
  3820. width: 180rpx;
  3821. text-align: center;
  3822. border-left: 1rpx solid #fff;
  3823. }
  3824. }
  3825. .video-toast__close {
  3826. position: absolute;
  3827. right: 32rpx;
  3828. bottom: 184rpx;
  3829. width: 40rpx;
  3830. height: 40rpx;
  3831. line-height: 40rpx;
  3832. text-align: center;
  3833. background: rgba(0, 0, 0, 0.6);
  3834. border-radius: 50%;
  3835. color: rgba(255, 255, 255, 0.3);
  3836. }
  3837. }
  3838. .rotoct {
  3839. transform: rotate(90deg);
  3840. }
  3841. .slot-content {
  3842. padding: 0 20rpx;
  3843. }
  3844. .notice_modal {
  3845. .content {
  3846. width: 100%;
  3847. height: 100%;
  3848. padding: 56rpx 56rpx 56rpx 64rpx;
  3849. .title {
  3850. color: #222;
  3851. line-height: 40rpx;
  3852. font-size: 36rpx;
  3853. text-align: center;
  3854. font-weight: bold;
  3855. margin-bottom: 24rpx;
  3856. }
  3857. .text {
  3858. height: 340rpx;
  3859. line-height: 40rpx;
  3860. text-indent: 2em;
  3861. font-size: 32rpx;
  3862. color: #222;
  3863. }
  3864. .had_read {
  3865. width: 100%;
  3866. height: 88rpx;
  3867. line-height: 88rpx;
  3868. text-align: center;
  3869. background: #3577E8;
  3870. border-radius: 240rpx;
  3871. font-size: 32rpx;
  3872. font-weight: 500;
  3873. color: #fff;
  3874. margin-top: 20rpx;
  3875. &.gray {
  3876. background: #BBBEC5;
  3877. }
  3878. }
  3879. }
  3880. }
  3881. .full_mulu {
  3882. position: absolute;
  3883. top: 100rpx;
  3884. right: 20rpx;
  3885. width: 700rpx;
  3886. height: 515rpx;
  3887. color: #333;
  3888. display: flex;
  3889. align-items: center;
  3890. justify-content: space-between;
  3891. z-index: 99999;
  3892. .mulus {
  3893. width: 623rpx;
  3894. // height: 515rpx;
  3895. height: 400rpx;
  3896. overflow-y: scroll;
  3897. // overflow: scroll;
  3898. }
  3899. .mulu_box_in {
  3900. background-color: #b7b7b7;
  3901. border-radius: 16rpx;
  3902. // transition: all 0.5s;
  3903. &::after {
  3904. content: "";
  3905. width: 0;
  3906. height: 0;
  3907. position: absolute;
  3908. top: 235rpx;
  3909. right: 27px;
  3910. border-top: 16rpx solid transparent;
  3911. border-right: 16rpx solid transparent;
  3912. border-left: 16rpx solid #b7b7b7;
  3913. border-bottom: 16rpx solid transparent;
  3914. }
  3915. }
  3916. .mulu_box_out {
  3917. // visibility: hidden;
  3918. display: none;
  3919. }
  3920. .menuBox_mulu {
  3921. // width: 100%;
  3922. background: #ffffff;
  3923. border-radius: 16rpx;
  3924. padding: 0rpx 20rpx;
  3925. margin-bottom: 20rpx;
  3926. }
  3927. .ml_img {
  3928. position: absolute;
  3929. right: 0;
  3930. top: 100rpx;
  3931. }
  3932. .items {
  3933. width: 620rpx;
  3934. height: 100rpx;
  3935. border: 1rpx solid red;
  3936. }
  3937. }
  3938. </style>