detail.vue 115 KB

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