detail.vue 121 KB

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