detail.vue 113 KB

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