detail.vue 114 KB

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