detail.vue 116 KB

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