detail.vue 114 KB

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