detail.vue 115 KB

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