detail.vue 114 KB

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