detail.vue 114 KB

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