detail.vue 115 KB

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