detail.vue 114 KB

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