detail.vue 115 KB

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