detail.vue 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025
  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. @playerError="playerError"
  32. ></my-player>
  33. </view>
  34. <view class="course_name">
  35. <view class="course_titles">
  36. <view class="video_t1" :class="{ one: !goodsData.buyNote }">{{
  37. detail.courseName
  38. }}</view>
  39. <view class="notice_wrap" v-if="goodsData.buyNote">
  40. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  41. </view>
  42. <view
  43. class="toggle_course"
  44. v-if="goodsTeacher.length > 1"
  45. @click="changeCourses()"
  46. >
  47. <image
  48. class="img"
  49. src="/pages3/static/imgs/toggle.png"
  50. mode="widthFix"
  51. ></image>
  52. <view class="toggle_name">切换课程</view>
  53. <!-- courseTotal -->
  54. <view class="numbers">共{{ goodsTeacher.length }}门</view>
  55. </view>
  56. </view>
  57. </view>
  58. <u-line color="#D6D6DB" />
  59. <view>
  60. <view>
  61. <u-tabs
  62. :item-width="itemWidth()"
  63. :list="list"
  64. font-size="32"
  65. bar-width="24"
  66. :current="current"
  67. @change="change"
  68. active-color="#007AFF"
  69. ></u-tabs>
  70. </view>
  71. </view>
  72. <u-line color="#D6D6DB" />
  73. </view>
  74. <view class="box" :class="{ first_ml: current == 0 }">
  75. <scroll-view class="box_in" scroll-y="true">
  76. <!--目录 -->
  77. <view v-show="current == 0">
  78. <view
  79. class="top__header"
  80. v-if="livingItem"
  81. @click="goLive(livingItem)"
  82. >
  83. <image
  84. class="img"
  85. src="/pages3/static/imgs/live.png"
  86. mode="widthFix"
  87. ></image>
  88. <view class="note">正在直播中</view>
  89. <view class="title">{{ livingItem.sectionName }}</view>
  90. </view>
  91. <course-tree
  92. v-if="sectionItem.id || sectionItem.sectionId"
  93. :orderGoodsId="orderGoodsId"
  94. :sectionMaxNum="goodsData.sectionMaxNum"
  95. :courseId="courseId"
  96. :learningOrder="orderNum"
  97. :goodsId="goodsId"
  98. :gradeId="gradeId"
  99. :isRebuild="false"
  100. :isBuy="true"
  101. :goodsType="1"
  102. :menuAllList="menuAllList"
  103. :sectionItem="sectionItem"
  104. ></course-tree>
  105. </view>
  106. <!--讲义 -->
  107. <view v-show="current == 1">
  108. <handouts-box
  109. :handoutsId="goodsData.handoutsId"
  110. v-if="goodsData.handoutsId"
  111. ></handouts-box>
  112. </view>
  113. <!--笔记 -->
  114. <view v-if="current == 2">
  115. <note-Box
  116. :isPlayRebuild="sectionItem.rebuild"
  117. :refPlv="refPlv"
  118. @jumpNote="jumpNote"
  119. :params="params()"
  120. ></note-Box>
  121. </view>
  122. <!--答疑 -->
  123. <view v-show="current == 3">
  124. <answer-box
  125. :userId="userInfo ? userInfo.userId : 0"
  126. :params="params(['orderGoodsId', 'goodsId', 'courseId', 'gradeId'])"
  127. ></answer-box>
  128. </view>
  129. <!--目录 -->
  130. <view v-show="current == 4">
  131. <view
  132. class="menuBox"
  133. v-for="(item, index) in reMenuList"
  134. :key="index"
  135. >
  136. <!--模块 -->
  137. <view v-if="item.type == 1"
  138. ><courseModule
  139. :orderGoodsId="orderGoodsId"
  140. :sectionMaxNum="goodsData.sectionMaxNum"
  141. :courseId="courseId"
  142. :learningOrder="orderNum"
  143. :goodsId="goodsId"
  144. :gradeId="gradeId"
  145. :isRebuild="true"
  146. :isBuy="true"
  147. :menuItem="item"
  148. :levelId="item.menuId"
  149. :goodsType="1"
  150. :menuAllList="menuAllList"
  151. :sectionItem="sectionItem"
  152. ></courseModule
  153. ></view>
  154. <!--章 -->
  155. <view v-if="item.type == 2">
  156. <courseChapter
  157. :orderGoodsId="orderGoodsId"
  158. :courseId="courseId"
  159. :learningOrder="orderNum"
  160. :sectionMaxNum="goodsData.sectionMaxNum"
  161. @playEnd="sectionPlayEnd($event, index)"
  162. :gradeId="gradeId"
  163. :goodsId="goodsId"
  164. :isRebuild="true"
  165. :isBuy="true"
  166. :menuItem="item"
  167. :levelId="'0-' + item.menuId"
  168. :goodsType="1"
  169. :menuAllList="menuAllList"
  170. ></courseChapter>
  171. </view>
  172. <!--节 -->
  173. <view v-if="item.type == 3">
  174. <courseSection
  175. :orderGoodsId="orderGoodsId"
  176. :courseId="courseId"
  177. :learningOrder="orderNum"
  178. :sectionMaxNum="goodsData.sectionMaxNum"
  179. @playEnd="sectionPlayEnd($event, index)"
  180. :gradeId="gradeId"
  181. :goodsId="goodsId"
  182. :isRebuild="true"
  183. :isBuy="true"
  184. :nextMenuItem="findMenuNextSection(index)"
  185. :menuItem="item"
  186. :levelId="'0-0-' + item.menuId"
  187. :goodsType="1"
  188. :testType="3"
  189. :menuAllList="menuAllList"
  190. ></courseSection>
  191. </view>
  192. </view>
  193. </view>
  194. </scroll-view>
  195. </view>
  196. <u-popup
  197. v-model="noticeShow"
  198. class="notice_modal"
  199. mode="center"
  200. border-radius="28"
  201. width="650rpx"
  202. height="622rpx"
  203. :mask-close-able="false"
  204. @close="closeNotice"
  205. >
  206. <view class="content">
  207. <view class="title">学员须知</view>
  208. <scroll-view scroll-y="true">
  209. <view
  210. class="text"
  211. v-html="
  212. goodsData.buyNote && goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
  213. "
  214. >
  215. </view>
  216. </scroll-view>
  217. <view
  218. class="had_read"
  219. :class="{ gray: CountTo >= 0 }"
  220. @click="noticeConfirm()"
  221. >
  222. <text v-if="CountTo >= 0">请阅读学员须知,30s后可关闭</text>
  223. <text v-else>我已阅读学员须知</text>
  224. <text v-if="CountTo >= 0">{{ " " + CountTo + "s" }}</text>
  225. </view>
  226. </view>
  227. </u-popup>
  228. <!-- 倒计时提交 -->
  229. <u-popup
  230. v-model="noticeShow1"
  231. class="notice_modal"
  232. mode="center"
  233. border-radius="28"
  234. width="650rpx"
  235. height="262rpx"
  236. :mask-close-able="false"
  237. >
  238. <view class="content">
  239. <view class="title">提示</view>
  240. <view class="had_read">
  241. <text v-if="CountTo1 >= 0">视频学习时长不达标,请等待</text>
  242. <text v-if="CountTo1 >= 0">{{ " " + CountTo1 + "s" }}</text>
  243. </view>
  244. </view>
  245. </u-popup>
  246. <u-modal
  247. v-model="showMark"
  248. title="提示"
  249. @confirm="markConfirm"
  250. @cancel="toBack"
  251. confirm-text="复制学习网址"
  252. :show-cancel-button="true"
  253. cancel-text="关闭"
  254. >
  255. <view class="slot-content">
  256. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  257. <view>1.复制学习地址:{{ markContent }}</view>
  258. <view>2.在【浏览器中】打开复制的学习网址</view>
  259. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  260. <view>(1)账号:您个人的身份证号码</view>
  261. <view>(2)密码:身份证号码,再加111111</view>
  262. </view>
  263. </u-modal>
  264. <!-- 切换课程弹窗 -->
  265. <u-popup
  266. v-model="toggleCourseShow"
  267. mode="bottom"
  268. border-radius="40"
  269. :mask-close-able="false"
  270. >
  271. <view class="popup_box">
  272. <view class="check_head">
  273. <view class="headers">
  274. <view class="grade">切换课程</view>
  275. <u-icon
  276. name="close"
  277. color="#9C9C9C"
  278. size="40"
  279. @click="closePop()"
  280. ></u-icon>
  281. </view>
  282. <view class="coruse_num">共{{ goodsTeacher.length }}门</view>
  283. <view class="menuSel">
  284. <scroll-view class="sub_sliper" scroll-x="true">
  285. <view
  286. v-for="(item, index) in subList"
  287. :key="index"
  288. style="margin-right: 50rpx; display: inline-block"
  289. >
  290. <view
  291. class="r_t1"
  292. :class="{ nactive: subIndex == index }"
  293. @click="cMenu(item, index)"
  294. >
  295. {{ item.subjectName }}
  296. </view>
  297. </view>
  298. </scroll-view>
  299. </view>
  300. </view>
  301. <view class="check_con">
  302. <scroll-view scroll-y="true" style="height: 700rpx">
  303. <view v-for="(courseItem, gTindex) in goodsTeacher" :key="gTindex">
  304. <view
  305. v-for="(item, index) in courseItem.courseList"
  306. :key="index"
  307. v-show="
  308. item.subjectId === newActiveSubjectId || !newActiveSubjectId
  309. "
  310. >
  311. <view class="course_items" v-if="item.show && item.show == 1">
  312. <view class="course_lefts">
  313. <view class="course_title">
  314. {{ item.courseName }}
  315. </view>
  316. <view
  317. v-if="courseItem.teaList && courseItem.teaList.length > 0"
  318. class="teacher_names"
  319. >
  320. <view
  321. v-for="(tea, tindex) in courseItem.teaList"
  322. :key="tindex"
  323. class="names"
  324. >{{ tea.aliasName }}</view
  325. >
  326. </view>
  327. <view class="course_pros">
  328. 学习进度
  329. <text>
  330. {{ item.stuAllNum + item.recordNum }}/{{
  331. item.secAllNum + item.examNum
  332. }}</text
  333. >
  334. </view>
  335. </view>
  336. <view
  337. class="course_rights"
  338. @click="jump(item, gTindex, 'jump')"
  339. >
  340. <view class="cicles">
  341. <u-icon
  342. name="arrow-right"
  343. color="#498AFE"
  344. size="20"
  345. ></u-icon>
  346. </view>
  347. <view class="intoStudy">进入学习</view>
  348. </view>
  349. </view>
  350. </view>
  351. </view>
  352. </scroll-view>
  353. </view>
  354. </view>
  355. </u-popup>
  356. <!-- 摄像头 -->
  357. <Popup-camera :goodsId="goodsId" ref="camera"></Popup-camera>
  358. </view>
  359. </template>
  360. <script>
  361. import plv from "../static/polyv-sdk/index";
  362. import courseModule from "@/components/course/courseModule.vue";
  363. import courseChapter from "@/components/course/courseChapter.vue";
  364. import courseSection from "@/components/course/courseSection.vue";
  365. import handoutsBox from "@/components/course/handoutsBox.vue";
  366. import courseTree from "@/components/course/courseTree.vue";
  367. import PopupCamera from "../../components/popup/camera.vue";
  368. import myCompressImage from "@/common/compressPhoto.js";
  369. import myPlayer from "@/components/myPlayer/polyvPlayer.vue";
  370. import noteBox from "@/components/course/noteBox.vue";
  371. import answerBox from "@/components/course/answerBox.vue";
  372. import { mapGetters, mapMutations } from "vuex";
  373. import { lockAction } from "../../utils/lock";
  374. export default {
  375. components: {
  376. courseModule,
  377. courseChapter,
  378. courseSection,
  379. handoutsBox,
  380. myPlayer,
  381. noteBox,
  382. answerBox,
  383. courseTree,
  384. PopupCamera,
  385. },
  386. data() {
  387. return {
  388. markContent: "http://admin.zhujianpeixun.com/",
  389. showMark: false,
  390. hasStart: false,
  391. channelItem: null,
  392. lockTimer: null,
  393. orderGoodsId: 0,
  394. noticeShow: false,
  395. enableAutoRotation: true,
  396. seekTime: "",
  397. toastTimer: null,
  398. videoToastShow: false,
  399. showSet: false,
  400. startStatus: false,
  401. courseId: 0,
  402. menuList: [],
  403. current: 0,
  404. vid: "",
  405. goodsId: 0,
  406. goodsData: {},
  407. photoPopup: false,
  408. goodsPlayConfig: null,
  409. autoplay: false,
  410. isAllowSeek: "no",
  411. playbackRate: [1.0],
  412. timer: null,
  413. goodsPhotographConfig: null,
  414. intervalTimeList: [], // 间隔拍照时长
  415. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  416. playTime: 0, //页面播放时长,不含暂停
  417. currentTime: 0,
  418. avatarUrl: "",
  419. ossAvatarUrl: "",
  420. studyDuration: 0, // 当前视频时长
  421. gradeId: 0,
  422. chapterId: 0,
  423. moduleId: 0,
  424. reMenuList: [],
  425. recordObj: {},
  426. isTaking: true, //是否正在拍照
  427. needSeek: false, //第一次播放是否需要跳转
  428. photoNum: 0,
  429. photoList: [], //拍照的时间点
  430. photoConfig: false, //是否配置好拍照次数
  431. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  432. photoHistoryList: [], //已拍照历史的下标点
  433. sectionItem: {},
  434. showNotes: true,
  435. uploadLock: false, //上传图片
  436. isPlayRebuild: false, //是否正在播放重修视频needOpen
  437. isRebuild: false, //视频是否从重修目录点击
  438. clearTimer: null,
  439. livingItem: "",
  440. option: null,
  441. toggleCourseShow: false, // 切换课程弹窗
  442. courseList: [], // 课程列表
  443. subList: [],
  444. subIndex: 0,
  445. goodsTeacher: [],
  446. teacherList: [],
  447. teacherIndex: 0,
  448. newActiveSubjectId: "", //当前选中ID
  449. compareFaceData: 0, // 拍照匹配相似度
  450. prendreAutoCarme: false, // 是否发起授权相机
  451. studyTimer: null, // 学习记录定时器
  452. CountTo: 30, // 倒计时
  453. CountTo1: 0,
  454. handoutTipLength: 0,
  455. menuAllList: [],
  456. curPlayIndex: 0, // 正在播放的节的下标
  457. faceUrl: "",
  458. erJianErZao: false,
  459. jjShiGongYuan: false,
  460. pauseTime: 0,
  461. pauseTimer: null,
  462. barTimer: null,
  463. isReach: false,
  464. noticeShow1: false,
  465. refPlv: null,
  466. };
  467. },
  468. computed: {
  469. ...mapGetters([
  470. "userInfo",
  471. "playSectionId",
  472. "playChannelId",
  473. "playVID",
  474. "config",
  475. ]),
  476. playSecIsLearn() {
  477. return this.sectionItem.learning != 1;
  478. },
  479. orderNum() {
  480. return 0;
  481. return this.goodsData.goodsLearningOrder;
  482. },
  483. list() {
  484. let list = [
  485. {
  486. name: "目录",
  487. },
  488. {
  489. name: "讲义",
  490. },
  491. {
  492. name: "笔记",
  493. },
  494. {
  495. name: "答疑",
  496. },
  497. ];
  498. if (this.reMenuList.length > 0) {
  499. list.push({ name: "重修目录" });
  500. }
  501. return list;
  502. },
  503. params: function () {
  504. return (keys = ["orderGoodsId", "goodsId", "courseId"]) => {
  505. let params = {};
  506. for (const key of keys) {
  507. params[key] = this[key];
  508. }
  509. return params;
  510. };
  511. },
  512. detail() {
  513. if (!this.courseId || !this.courseList.length) {
  514. return {};
  515. }
  516. return this.courseList.find((e) => e.courseId == this.courseId);
  517. },
  518. },
  519. watch: {
  520. showSet(n) {
  521. if (n) {
  522. if (polyvPlayerContext) {
  523. // #ifdef MP-WEIXIN
  524. polyvPlayerContext.pause();
  525. // #endif
  526. // #ifdef H5
  527. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  528. // #endif
  529. }
  530. }
  531. },
  532. photoPopup(n) {
  533. if (n) {
  534. if (this.prendreAutoCarme) {
  535. this.photoPopup = false;
  536. }
  537. this.showSet && (this.photoPopup = false);
  538. }
  539. },
  540. },
  541. async onLoad(option) {
  542. if (option.isOther) {
  543. this.showMark = true;
  544. return;
  545. }
  546. this.option = option;
  547. let { skipPort, id, goodsId, orderGoodsId, gradeId, informId } = option;
  548. if (skipPort) {
  549. await this.$method.skipLogin(skipPort);
  550. }
  551. if (this.$method.isGoLogin()) {
  552. return;
  553. }
  554. this.option.isQ !== "" && (await this.qCheckIsCanLearn(orderGoodsId));
  555. !this.userInfo && this.$api.refreshUserInfo();
  556. this.courseId = Number(id) || "";
  557. this.goodsId = Number(goodsId);
  558. this.orderGoodsId = Number(orderGoodsId) || "";
  559. this.gradeId = Number(gradeId);
  560. // 公众号模板消息的数据埋点
  561. informId && this.clickOfficial(informId);
  562. this.init();
  563. this.courseCourseList();
  564. },
  565. async onShow() {
  566. // this.closePhoto();
  567. },
  568. onUnload() {
  569. console.log("onUnloadonUnloadonUnloadonUnload");
  570. this.originUnload();
  571. this.clears();
  572. clearInterval(this.lockTimer);
  573. },
  574. onHide() {
  575. this.originUnload();
  576. },
  577. mounted() {},
  578. methods: {
  579. ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
  580. init() {
  581. // #ifdef MP-WEIXIN
  582. this.isAllowSeek = "no";
  583. // #endif
  584. // #ifdef H5
  585. this.isAllowSeek = "on";
  586. // #endif
  587. // 锁
  588. lockAction();
  589. this.lockTimer = setInterval(lockAction, 10000);
  590. },
  591. // 七大员是否能进入学习
  592. async qCheckIsCanLearn(orderGoodsId) {
  593. let res = await this.$api.qCheckIsCanLearn(orderGoodsId);
  594. if (res.data.code !== 200) {
  595. uni.showModal({
  596. showCancel: false,
  597. title: "提示",
  598. content: res.data.msg,
  599. success: (resultst) => {
  600. uni.navigateBack();
  601. },
  602. });
  603. return Promise.reject();
  604. }
  605. let res1 = await this.$api.syncSevenPublicClass({
  606. orderGoodsId,
  607. });
  608. if (res1.data.code !== 200) {
  609. uni.showModal({
  610. showCancel: false,
  611. title: "提示",
  612. content: "无法进入学习!",
  613. success: (resultst) => {
  614. uni.navigateBack();
  615. },
  616. });
  617. return Promise.reject();
  618. }
  619. },
  620. // 新增微信公众号模板消息点击数据
  621. clickOfficial(informId) {
  622. this.$http({
  623. url: "/data/click",
  624. method: "post",
  625. data: { informId },
  626. });
  627. },
  628. // 点击课程目录
  629. cMenu(item, index) {
  630. this.subIndex = index;
  631. this.newActiveSubjectId = item.subjectId;
  632. },
  633. courseCourseList() {
  634. this.courseList = [];
  635. this.menuList = [];
  636. this.photoConfig = false;
  637. this.$api
  638. .courseCourseList({
  639. pageNum: 1,
  640. pageSize: 200,
  641. goodsId: this.goodsId,
  642. gradeId: this.gradeId,
  643. orderGoodsId: this.orderGoodsId,
  644. })
  645. .then((res) => {
  646. if (res.data.code == 200) {
  647. this.courseList = res.data.rows;
  648. // 科目
  649. let allItem = [{ subjectId: 0, subjectName: "所有" }];
  650. let ids = [];
  651. const newArr = [];
  652. this.courseList.forEach((item) => {
  653. if (ids.indexOf(item.subjectId) == -1) {
  654. ids.push(item.subjectId);
  655. newArr.push(item);
  656. }
  657. });
  658. this.subList = [...allItem, ...newArr];
  659. if (res.data.total > 1) {
  660. this.getUserWatchLast();
  661. } else {
  662. this.originOnShow();
  663. this.originMounted();
  664. }
  665. }
  666. });
  667. },
  668. // 查询用户最后一次看的录播的信息
  669. getUserWatchLast() {
  670. this.$http({
  671. url: "/study/record/getUserWatchLast",
  672. method: "get",
  673. data: {
  674. orderGoodsId: this.orderGoodsId,
  675. },
  676. }).then((res) => {
  677. console.log("🚀 ~ file: detail.vue:859 ~ getUserWatchLast ~ res:", res);
  678. if (res.data.code == 200 && res.data.data) {
  679. this.courseId = res.data.data.courseId;
  680. }
  681. if (!this.courseId) {
  682. this.courseId = this.courseList[0].courseId;
  683. }
  684. this.originOnShow();
  685. this.originMounted();
  686. //获取商品双师资模板
  687. this.getCourseTeacher(this.courseList);
  688. });
  689. },
  690. getCourseTeacher(rows) {
  691. this.goodsTeacher = [];
  692. //获取商品双师资模板
  693. this.$api
  694. .courseTeacherList({
  695. goodsId: this.goodsId,
  696. })
  697. .then((res1) => {
  698. if (res1.data.data && res1.data.data.length > 0) {
  699. //课程老师模板
  700. let teacherTel = res1.data.data;
  701. //商品课程
  702. let courses = rows;
  703. teacherTel.forEach((tea) => {
  704. let dataList = [];
  705. let teacherList = [];
  706. courses.forEach((item) => {
  707. let data = tea.courseList.filter(
  708. (x) => x.courseId == item.courseId
  709. );
  710. if (data && data.length > 0) {
  711. dataList.push(item);
  712. teacherList = tea.courseList;
  713. }
  714. });
  715. let result = {
  716. teaList: teacherList,
  717. courseList: dataList,
  718. };
  719. this.goodsTeacher.push(result);
  720. });
  721. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  722. let courseIds = [];
  723. this.goodsTeacher.forEach((item) => {
  724. item.courseList.forEach((course) => {
  725. courseIds.push(course.courseId);
  726. });
  727. });
  728. if (courseIds.length > 0) {
  729. courses.forEach((item) => {
  730. if (!courseIds.includes(item.courseId)) {
  731. let data = {
  732. teaList: [],
  733. courseList: [],
  734. };
  735. data.courseList.push(item);
  736. this.goodsTeacher.push(data);
  737. }
  738. });
  739. }
  740. this.goodsTeacher.forEach((item) => {
  741. if (item.courseList && item.courseList.length > 0) {
  742. item.courseList[0].show = 1;
  743. }
  744. });
  745. }
  746. } else {
  747. //没有双师资模板
  748. rows.forEach((item) => {
  749. item.show = 1;
  750. let data = {
  751. teaList: [],
  752. courseList: [],
  753. };
  754. data.courseList.push(item);
  755. this.goodsTeacher.push(data);
  756. });
  757. }
  758. this.goodsTeacher.forEach((item) => {
  759. if (item.courseList.some((x) => x.courseId == this.courseId)) {
  760. this.teacherList = item.teaList;
  761. }
  762. });
  763. });
  764. },
  765. erJianErZaoPauseTip() {
  766. if (this.playSecIsLearn && this.erJianErZao) {
  767. if (this.pauseTimer) {
  768. return;
  769. }
  770. this.pauseTime = Date.now();
  771. console.log("开启定时器");
  772. this.pauseTimer = setInterval(() => {
  773. console.log("暂停时间", Date.now() - this.pauseTime, this.pauseTime);
  774. if (Date.now() - this.pauseTime > 5 * 60 * 1000) {
  775. // 5 * 60 * 1000
  776. let text = this.photoPopup ? "拍照停留" : "暂停";
  777. this.photoPopup = false;
  778. uni.showModal({
  779. title: "提示",
  780. showCancel: false,
  781. content: `检测${text}时间过长,刷新当前页面`,
  782. cancelText: "取消",
  783. confirmText: "确定",
  784. success: (res) => {
  785. if (res.confirm) {
  786. // #ifdef H5
  787. location.reload();
  788. // #endif
  789. // #ifdef MP-WEIXIN
  790. this.courseCourseList();
  791. // #endif
  792. }
  793. },
  794. });
  795. this.clearPauseTimer();
  796. }
  797. }, 5000);
  798. }
  799. },
  800. // 原来onshow里面的内容
  801. async originOnShow() {
  802. this.getReMenuList();
  803. await this.studyRecordMenuAllList();
  804. // 消息过来 定位某个节
  805. if (this.option.noteSecond) {
  806. this.jumpNote({
  807. sectionType: 1,
  808. ...this.option,
  809. });
  810. return;
  811. }
  812. this.studyRecordQueryLiveLast();
  813. },
  814. // 原来的mouted内容
  815. originMounted() {
  816. uni.$on("changeSection", (oldSectionId) => {
  817. console.log(
  818. "切换课程-originMounted->playVID:",
  819. this.playVID,
  820. oldSectionId
  821. );
  822. this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
  823. this.clearPauseTimer();
  824. this.hasStart = false;
  825. this.photoConfig = false;
  826. this.photoIndex = 0;
  827. //清除直播
  828. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  829. // 防止原先初始化错误
  830. if (!this.refPlv) {
  831. this.refPlv = this.$refs.player;
  832. }
  833. this.postStudyRecord(0, oldSectionId);
  834. });
  835. uni.$on("getSection", (item) => {
  836. //清除直播
  837. this.studyTimer && clearInterval(this.studyTimer);
  838. this.hasStart = false;
  839. this.isPlayRebuild = item.rebuild;
  840. this.photoConfig = false;
  841. this.photoIndex = 0;
  842. this.sectionItem = item;
  843. this.moduleId = item.moduleId || null;
  844. this.chapterId = item.chapterId || null;
  845. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  846. //获取拍照历史
  847. this.getPhotoLastRecord();
  848. this.playVideo(item);
  849. });
  850. uni.$on("levelId", (item) => {
  851. let arr = item.split("-");
  852. //点击节获取的各层级ID
  853. this.moduleId = arr[0];
  854. this.chapterId = arr[1];
  855. });
  856. uni.$on("getChannel", (item) => {
  857. //清除录播
  858. this.studyTimer && clearInterval(this.studyTimer);
  859. this.hasStart = false;
  860. this.$store.commit("setPlayVID", { playVID: null });
  861. this.moduleId = item.moduleId;
  862. this.chapterId = item.chapterId;
  863. this.$store.commit("setPlaySectionId", {
  864. playSectionId: item.sectionId || item.menuId,
  865. });
  866. this.getPhotoLastRecord();
  867. this.playChannel(item);
  868. this.channelItem = item;
  869. });
  870. uni.$on("isRebuild", (item) => {
  871. this.isRebuild = item;
  872. });
  873. this.updateChapterOpen(true);
  874. },
  875. clearPauseTimer() {
  876. if (this.pauseTimer) {
  877. this.pauseTime = 0;
  878. clearInterval(this.pauseTimer);
  879. this.pauseTimer = null;
  880. }
  881. },
  882. clearBarTimer() {
  883. if (this.barTimer) {
  884. clearInterval(this.barTimer);
  885. this.barTimer = null;
  886. }
  887. },
  888. // 原来onUnload里面的内容
  889. originUnload() {
  890. if (this.playSectionId > 0 && this.hasStart) {
  891. //退出提交记录
  892. this.postStudyRecord();
  893. }
  894. //清除正在播放的节ID
  895. // this.$store.commit('setPlayObj',null)
  896. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  897. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  898. this.$store.commit("setPlayVID", { playVID: null });
  899. this.closePlv();
  900. //移除所有的事件监听器
  901. uni.$off();
  902. this.clearTimer && clearTimeout(this.clearTimer);
  903. this.toastTimer && clearTimeout(this.toastTimer);
  904. if (this.studyTimer) {
  905. clearInterval(this.studyTimer);
  906. this.hasStart = false;
  907. }
  908. this.clearPauseTimer();
  909. this.clearBarTimer();
  910. if (this.lockTimer) {
  911. clearInterval(this.lockTimer);
  912. this.$api
  913. .lockDelLock({
  914. action: "jxjy",
  915. uuid: this.$method.getUuid(),
  916. })
  917. .then((res) => {
  918. uni.hideLoading();
  919. });
  920. }
  921. },
  922. changeCourses() {
  923. this.toggleCourseShow = true;
  924. },
  925. closePop() {
  926. this.toggleCourseShow = false;
  927. },
  928. async activeFunc(item, index) {
  929. this.teacherIndex = index;
  930. let findResult = "";
  931. this.goodsTeacher.forEach((citem, index) => {
  932. citem.courseList.forEach((e, e_index) => {
  933. if (e.courseId == item.courseId) {
  934. findResult = e;
  935. }
  936. });
  937. });
  938. this.jump(findResult, 1);
  939. },
  940. // 进入学习
  941. async jump(item, index, type) {
  942. if (this.courseId === item.courseId) {
  943. this.toggleCourseShow = false;
  944. return;
  945. }
  946. if (this.orderNum == 2 && index != 0) {
  947. let prevItem = this.courseList[index - 1];
  948. if (
  949. prevItem.stuAllNum + prevItem.recordNum <
  950. prevItem.secAllNum + prevItem.examNum
  951. ) {
  952. uni.showToast({
  953. icon: "none",
  954. title: "请按顺序学完上一课再学习这一课",
  955. });
  956. return;
  957. }
  958. }
  959. // 打回 需重修
  960. if (item.rebuild === 0) {
  961. this.$navTo.togo("/pages2/learn/details", {
  962. id: item.courseId,
  963. gradeId: item.gradeId,
  964. goodsId: this.goodsId,
  965. orderGoodsId: this.orderGoodsId,
  966. });
  967. return;
  968. }
  969. if (type) {
  970. this.teacherIndex = 0;
  971. this.goodsTeacher.forEach((citem) => {
  972. if (citem.courseList.some((x) => x.courseId == item.courseId)) {
  973. this.teacherList = citem.teaList;
  974. }
  975. });
  976. }
  977. this.sectionItem = {};
  978. this.toggleCourseShow = false;
  979. this.courseId = item.courseId;
  980. this.originOnShow();
  981. },
  982. async nextCourses(item, type) {
  983. this.vid = "";
  984. this.hasStart = true;
  985. await this.originUnload();
  986. this.courseId = item.courseId;
  987. this.gradeId = item.gradeId;
  988. this.toggleCourseShow = false;
  989. },
  990. clickLeft() {
  991. // uni.navigateBack()
  992. uni.switchTab({
  993. url: "/pages/learn/index",
  994. });
  995. },
  996. toBack(delta = 1) {
  997. uni.navigateBack({
  998. delta,
  999. });
  1000. },
  1001. markConfirm() {
  1002. uni.setClipboardData({
  1003. data: this.markContent,
  1004. success: () => {
  1005. setTimeout(this.toBack, 1000);
  1006. },
  1007. });
  1008. },
  1009. closeNotice() {
  1010. this.$api
  1011. .baseHandoutTip({
  1012. orderGoodsId: this.orderGoodsId,
  1013. })
  1014. .then((res) => {});
  1015. },
  1016. noticeConfirm() {
  1017. if (this.CountTo < 0) {
  1018. this.noticeShow = false;
  1019. if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
  1020. this.autoplay = true;
  1021. this.refPlv.resumeVideo();
  1022. }
  1023. }
  1024. },
  1025. baseHandoutTipList() {
  1026. this.$api
  1027. .baseHandoutTipList({
  1028. orderGoodsId: this.orderGoodsId,
  1029. })
  1030. .then((res) => {
  1031. this.handoutTipLength = res.data.rows.length;
  1032. if (res.data.rows.length == 0) {
  1033. this.noticeShow = true;
  1034. if (this.CountTo == 30) {
  1035. var timer = setInterval(() => {
  1036. this.CountTo--;
  1037. if (this.CountTo < 0) {
  1038. clearInterval(timer);
  1039. }
  1040. }, 1000);
  1041. }
  1042. } else {
  1043. this.CountTo = -1;
  1044. }
  1045. });
  1046. },
  1047. /**
  1048. * 获取上次观看的直播
  1049. */
  1050. studyRecordGetLastLive() {
  1051. this.$api
  1052. .studyRecordGetLastLive({
  1053. orderGoodsId: this.orderGoodsId,
  1054. courseId: this.courseId,
  1055. })
  1056. .then((res) => {
  1057. this.updateLiveLast(res.data.data);
  1058. });
  1059. },
  1060. async initPlayVideo(sectionItem) {
  1061. this.moduleId = sectionItem.moduleId;
  1062. this.chapterId = sectionItem.chapterId;
  1063. if (sectionItem.sectionType == 1) {
  1064. //录播
  1065. await this.getPhotoLastRecord(); // 获取拍照历史
  1066. this.playVideo(sectionItem);
  1067. } else if (sectionItem.sectionType == 2) {
  1068. //直播
  1069. this.studyRecordGetLastLive();
  1070. } else if (sectionItem.sectionType == 3) {
  1071. //回放
  1072. this.playVideo(sectionItem);
  1073. } else if (sectionItem.doType == 2) {
  1074. uni.showModal({
  1075. title: "温馨提示",
  1076. content: "当前节视频已学完,是否进入考试?",
  1077. success: (res) => {
  1078. if (res.confirm) {
  1079. this.toQuestionBank(sectionItem);
  1080. }
  1081. },
  1082. });
  1083. return;
  1084. }
  1085. },
  1086. toQuestionBank(sectionItem) {
  1087. uni.navigateTo({
  1088. url:
  1089. "/pages2/class/questionBank?courseId=" +
  1090. this.courseId +
  1091. "&gradeId=" +
  1092. this.gradeId +
  1093. "&isFromVideo=1&id=" +
  1094. sectionItem.id +
  1095. "&goodsid=" +
  1096. this.goodsId +
  1097. "&moduleId=" +
  1098. (sectionItem.moduleId || 0) +
  1099. "&chapterId=" +
  1100. (sectionItem.chapterId || 0) +
  1101. "&orderGoodsId=" +
  1102. this.orderGoodsId +
  1103. "&type=" +
  1104. (sectionItem.type == 4 ? 1 : 3) +
  1105. "&learning=" +
  1106. sectionItem.studyStatus +
  1107. "&isBackVideo=" +
  1108. 1,
  1109. });
  1110. },
  1111. studyRecordQueryLiveLast() {
  1112. // /study/record/queryLiveLast
  1113. this.$api
  1114. .studyRecordQueryLiveLast({
  1115. gradeId: this.gradeId,
  1116. orderGoodsId: this.orderGoodsId,
  1117. courseId: this.courseId,
  1118. })
  1119. .then((res) => {
  1120. let { data } = res.data;
  1121. if (!data.sectionId) {
  1122. data = this.menuAllList[0];
  1123. }
  1124. // if (data.learning == 1 && this.orderNum == 2) {
  1125. // let next = this.menuAllList.find((e) => e.studyStatus != 1);
  1126. // next && (data = next);
  1127. // }
  1128. this.initPlayVideo(data);
  1129. });
  1130. },
  1131. /**
  1132. * 模块大节播放完毕,刷新列表
  1133. */
  1134. sectionPlayEnd(isRebuild, index) {
  1135. if (this.reMenuList.length > 0) {
  1136. //有重修目录
  1137. if (isRebuild.isRebuild) {
  1138. //从重修点击
  1139. this.$api
  1140. .reMenuList({
  1141. orderGoodsId: this.orderGoodsId,
  1142. courseId: this.courseId,
  1143. rebuild: 1,
  1144. gradeId: this.gradeId,
  1145. })
  1146. .then((res) => {
  1147. if (res.data.code == 200) {
  1148. if (res.data.rows.length) {
  1149. res.data.rows[index].name = res.data.rows[index].menuName;
  1150. this.$set(this.reMenuList, index, res.data.rows[index]);
  1151. for (let i = 0; i < res.data.rows.length; i++) {
  1152. let item = res.data.rows[i];
  1153. item.down = true;
  1154. item.id = item.menuId;
  1155. item.name = item.menuName;
  1156. }
  1157. this.reMenuList = [];
  1158. this.$nextTick(() => {
  1159. this.reMenuList = res.data.rows;
  1160. // console.log(this.reMenuList,'this.reMenuList1')
  1161. });
  1162. } else {
  1163. this.reMenuList = [];
  1164. }
  1165. }
  1166. });
  1167. this.$api
  1168. .reMenuList({
  1169. courseId: this.courseId,
  1170. gradeId: this.gradeId,
  1171. orderGoodsId: this.orderGoodsId,
  1172. })
  1173. .then((res) => {
  1174. if (res.data.code == 200) {
  1175. for (let i = 0; i < res.data.rows.length; i++) {
  1176. let item = res.data.rows[i];
  1177. item.down = true;
  1178. item.id = item.menuId;
  1179. item.name = item.menuName;
  1180. item.menuType = item.type;
  1181. }
  1182. this.menuList = [];
  1183. this.$nextTick(() => {
  1184. this.menuList = res.data.rows;
  1185. });
  1186. }
  1187. });
  1188. } else {
  1189. //从普通目录点击
  1190. this.$api
  1191. .reMenuList({
  1192. courseId: this.courseId,
  1193. gradeId: this.gradeId,
  1194. orderGoodsId: this.orderGoodsId,
  1195. })
  1196. .then((res) => {
  1197. if (res.data.code == 200) {
  1198. res.data.rows[index].name = res.data.rows[index].menuName;
  1199. res.data.rows[index].id = res.data.rows[index].menuId;
  1200. this.$set(this.menuList, index, res.data.rows[index]);
  1201. }
  1202. });
  1203. this.$api
  1204. .reMenuList({
  1205. orderGoodsId: this.orderGoodsId,
  1206. courseId: this.courseId,
  1207. rebuild: 1,
  1208. gradeId: this.gradeId,
  1209. })
  1210. .then((res) => {
  1211. if (res.data.code == 200) {
  1212. if (res.data.rows.length) {
  1213. // for (let i = 0; i < res.data.rows.length; i++) {
  1214. // let item = res.data.rows[i];
  1215. // item.down = true;
  1216. // item.id = item.menuId;
  1217. // item.name = item.menuName;
  1218. // }
  1219. // this.reMenuList = res.data.rows;
  1220. } else {
  1221. this.reMenuList = [];
  1222. }
  1223. }
  1224. });
  1225. }
  1226. } else {
  1227. console.log("--模块大节播放完毕,刷新列表-");
  1228. //没有重修目录
  1229. this.$api
  1230. .reMenuList({
  1231. courseId: this.courseId,
  1232. gradeId: this.gradeId,
  1233. orderGoodsId: this.orderGoodsId,
  1234. })
  1235. .then((res) => {
  1236. if (res.data.code == 200) {
  1237. res.data.rows[index].name = res.data.rows[index].menuName;
  1238. res.data.rows[index].id = res.data.rows[index].menuId;
  1239. this.$set(this.menuList, index, res.data.rows[index]);
  1240. }
  1241. });
  1242. }
  1243. },
  1244. goLive(item) {
  1245. let moduleId = item.moduleId || 0;
  1246. let chapterId = item.chapterId || 0;
  1247. let sectionId = item.sectionId || item.menuId;
  1248. let uuid = new Date().valueOf() + "";
  1249. // buyCourse 是否购买课程:1是 0否
  1250. let encode = encodeURIComponent(
  1251. this.config.hostLive +
  1252. "/pages/live/index?token=" +
  1253. uni.getStorageSync("token") +
  1254. "&userInfo=" +
  1255. JSON.stringify(this.userInfo) +
  1256. "&channelId=" +
  1257. item.liveUrl +
  1258. "&gradeId=" +
  1259. this.gradeId +
  1260. "&courseId=" +
  1261. this.courseId +
  1262. "&goodsId=" +
  1263. this.goodsId +
  1264. "&orderGoodsId=" +
  1265. this.orderGoodsId +
  1266. "&sectionId=" +
  1267. sectionId +
  1268. "&chapterId=" +
  1269. chapterId +
  1270. "&moduleId=" +
  1271. moduleId +
  1272. "&buyCourse=1" +
  1273. "&ident=" +
  1274. uuid
  1275. );
  1276. uni.navigateTo({
  1277. url: `../../pages/webview/index?url=` + encode,
  1278. });
  1279. },
  1280. studyRecordMenuAllList() {
  1281. // study/record/menuAllList
  1282. return this.$api
  1283. .studMenuAllList({
  1284. courseId: this.courseId,
  1285. gradeId: this.gradeId,
  1286. goodsId: this.goodsId,
  1287. orderGoodsId: this.orderGoodsId,
  1288. })
  1289. .then((res) => {
  1290. let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1291. if (res.data.data) {
  1292. this.menuAllList = res.data.data.filter(
  1293. (e) => e.doType != 1 || (e.doType == 2 && e.studyStatus == 1)
  1294. );
  1295. this.livingItem = res.data.data.find(
  1296. (item) =>
  1297. item.liveStartTime <= nowTime && item.liveEndTime > nowTime
  1298. );
  1299. }
  1300. return Promise.resolve();
  1301. });
  1302. },
  1303. async getbaseprofiletplists() {
  1304. let {
  1305. data: { code, rows },
  1306. } = await this.$api.getbaseprofiletplists({
  1307. goodsId: this.goodsId,
  1308. orderGoodsId: this.orderGoodsId,
  1309. });
  1310. if (code === 200 && rows.length && rows[0].keyValue) {
  1311. let baseRes = await this.$api.getbaseprofiletpId(this.goodsId);
  1312. if (baseRes.data.code === 200 && baseRes.data.data) {
  1313. let {
  1314. data: { code, data },
  1315. } = await this.$api.getbaseprofiletpgetInfo({
  1316. goodsId: this.goodsId,
  1317. orderGoodsId: this.orderGoodsId,
  1318. });
  1319. if (
  1320. code === 200 &&
  1321. (!data || (data.status === 3 && data.changeStatus === 1))
  1322. ) {
  1323. uni.showModal({
  1324. content: !data
  1325. ? "请前往填写资料"
  1326. : "资料审核不通过,请前往重新填写",
  1327. cancelText: "返回",
  1328. success: (resultst) => {
  1329. if (resultst.confirm) {
  1330. this.$navTo.togo("/pages2/verify/input", {
  1331. id: this.goodsId,
  1332. orderGoodsId: this.orderGoodsId,
  1333. });
  1334. }
  1335. if (resultst.cancel) {
  1336. uni.navigateBack();
  1337. }
  1338. },
  1339. });
  1340. return Promise.reject();
  1341. } else if (data.status === 1 && JSON.parse(rows[0].keyValue2)[0]) {
  1342. let {
  1343. data: { code, data },
  1344. } = await this.$api.getbaseprofileStampgetInfo({
  1345. goodsId: this.goodsId,
  1346. orderGoodsId: this.orderGoodsId,
  1347. });
  1348. if (
  1349. code === 200 &&
  1350. (!data || (data.status === 3 && data.changeStatus === 1))
  1351. ) {
  1352. uni.showModal({
  1353. content: !data
  1354. ? "请前往填写盖章资料"
  1355. : "资料盖章审核不通过,请前往重新填写",
  1356. cancelText: "返回",
  1357. success: (resultst) => {
  1358. if (resultst.confirm) {
  1359. this.$navTo.togo("/pages2/verify/input2", {
  1360. id: this.goodsId,
  1361. orderGoodsId: this.orderGoodsId,
  1362. });
  1363. }
  1364. if (resultst.cancel) {
  1365. uni.navigateBack();
  1366. }
  1367. },
  1368. });
  1369. return Promise.reject();
  1370. }
  1371. }
  1372. }
  1373. }
  1374. return Promise.resolve();
  1375. },
  1376. async isCanLearn() {
  1377. await this.getbaseprofiletplists();
  1378. await this.getGradeInfo();
  1379. await this.getGoodsDetail();
  1380. },
  1381. /**
  1382. * 计算tabs宽度
  1383. */
  1384. itemWidth() {
  1385. return 100 / this.list.length + "%";
  1386. },
  1387. findMenuNextSection(index) {
  1388. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1389. let item = this.reMenuList[i];
  1390. if (item.type == 3) {
  1391. return item;
  1392. }
  1393. }
  1394. return {};
  1395. },
  1396. loadedmetadata(event) {
  1397. this.$refs["camera"].openCamera();
  1398. this.refPlv = this.$refs.player;
  1399. },
  1400. getPhotoLastRecord() {
  1401. if (this.erJianErZao || !this.playSecIsLearn || this.photoNum <= 0) {
  1402. return;
  1403. }
  1404. let self = this;
  1405. let data = {
  1406. sectionId: parseInt(self.playSectionId),
  1407. goodsId: parseInt(self.goodsId),
  1408. courseId: parseInt(self.courseId),
  1409. gradeId: parseInt(self.gradeId),
  1410. chapterId: parseInt(self.chapterId),
  1411. moduleId: parseInt(self.moduleId),
  1412. orderGoodsId: this.orderGoodsId,
  1413. };
  1414. // /course/photo/log/getLastInfo'
  1415. this.$api.getPhotoLastRecord(data).then((res) => {
  1416. if (res.data.code == 200) {
  1417. //清空历史数据
  1418. self.photoHistoryList = [];
  1419. this.photoIndex = 0;
  1420. self.photoList = [];
  1421. for (let i = 0; i < res.data.data.length; i++) {
  1422. //-2存储随机拍照数组
  1423. if (res.data.data[i].photoIndex == -2) {
  1424. self.photoList =
  1425. res.data.data[i].timeInterval &&
  1426. res.data.data[i].timeInterval.split(",");
  1427. } else {
  1428. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1429. }
  1430. }
  1431. }
  1432. });
  1433. },
  1434. //postTime 只提交随机时间
  1435. postCoursePhotoRecord(postTime = false) {
  1436. return new Promise((resolve, reject) => {
  1437. let currentTime = 0;
  1438. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1439. if (polyvPlayerContext) {
  1440. // #ifdef MP-WEIXIN
  1441. currentTime = polyvPlayerContext.getCurrentTime();
  1442. // #endif
  1443. // #ifdef H5
  1444. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  1445. // #endif
  1446. }
  1447. let self = this;
  1448. let photoIndex = self.photoIndex;
  1449. let data = {
  1450. photo: self.ossAvatarUrl,
  1451. sectionId: parseInt(self.playSectionId),
  1452. goodsId: parseInt(self.goodsId),
  1453. courseId: parseInt(self.courseId),
  1454. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1455. gradeId: parseInt(self.gradeId),
  1456. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1457. photoNum: parseInt(self.photoNum),
  1458. chapterId: parseInt(self.chapterId),
  1459. moduleId: parseInt(self.moduleId),
  1460. timeInterval: postTime ? self.photoList.join(",") : "",
  1461. orderGoodsId: this.orderGoodsId,
  1462. };
  1463. // console.log("提交接口", data);
  1464. this.$api
  1465. .coursePhotoRecord(data)
  1466. .then((res) => {
  1467. if (res.data.code == 200) {
  1468. resolve();
  1469. } else {
  1470. reject();
  1471. }
  1472. })
  1473. .catch((err) => {
  1474. reject();
  1475. });
  1476. });
  1477. },
  1478. randomNum(minNum, maxNum) {
  1479. switch (arguments.length) {
  1480. case 1:
  1481. return parseInt(Math.random() * minNum + 1, 10);
  1482. break;
  1483. case 2:
  1484. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1485. break;
  1486. default:
  1487. return 0;
  1488. break;
  1489. }
  1490. },
  1491. //配置随机拍照时间
  1492. configPhoto() {
  1493. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1494. let totalVideoTime = 0;
  1495. let duration = 0;
  1496. // #ifdef MP-WEIXIN
  1497. totalVideoTime = polyvPlayerContext.getDuration();
  1498. duration = polyvPlayerContext.getCurrentTime();
  1499. // #endif
  1500. // #ifdef H5
  1501. totalVideoTime = polyvPlayerContext.j2s_getDuration();
  1502. duration = polyvPlayerContext.j2s_getCurrentTime();
  1503. // #endif
  1504. if (!this.photoConfig) {
  1505. this.photoConfig = true;
  1506. if (this.erJianErZao) {
  1507. this.photoList = this.randomConfig(totalVideoTime, duration);
  1508. return;
  1509. }
  1510. //没有历史拍照间隔数据
  1511. if (!this.photoList || this.photoList.length == 0) {
  1512. this.photoList = this.commonConfig(
  1513. totalVideoTime,
  1514. this.jjShiGongYuan ? 46 * 60 : undefined
  1515. );
  1516. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1517. }
  1518. //兼容已有观看历史
  1519. for (let i = 0; i < this.photoList.length - 1; i++) {
  1520. if (
  1521. this.photoList[i] < duration &&
  1522. this.photoList[i + 1] > duration
  1523. ) {
  1524. this.photoIndex = i + 1;
  1525. break;
  1526. }
  1527. if (duration > this.photoList[this.photoList.length - 1]) {
  1528. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1529. break;
  1530. }
  1531. }
  1532. }
  1533. },
  1534. // 二建随机拍摄时间
  1535. randomConfig(totalVideoTime, duration) {
  1536. this.photoHistoryList = [];
  1537. let photoList = [duration];
  1538. let pre = duration;
  1539. if (totalVideoTime > 300) {
  1540. while (pre <= totalVideoTime) {
  1541. pre += this.randomNum(780, 900);
  1542. pre <= totalVideoTime && photoList.push(pre);
  1543. }
  1544. if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
  1545. photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
  1546. }
  1547. }
  1548. return photoList;
  1549. },
  1550. // 随机前后五分钟
  1551. commonConfig(totalVideoTime, fixS) {
  1552. console.log("🚀 ~ file: detail.vue:2407 ~ commonConfig ~ fixS:", fixS);
  1553. let photoList = [0];
  1554. // 固定间隔时间取
  1555. if (fixS) {
  1556. let num = Math.ceil(totalVideoTime / fixS);
  1557. for (let i = 1; i < num; i++) {
  1558. photoList.push(i * fixS);
  1559. }
  1560. } else {
  1561. if (this.photoNum == 3) {
  1562. if (totalVideoTime >= 900) {
  1563. //大于15分钟
  1564. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1565. let centerMinTime = centerTime - 300; //前后5分钟
  1566. let centerMaxTime = centerTime + 300;
  1567. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1568. photoList.push(centerTakeTime); //中间拍一张
  1569. let endMaxTime = totalVideoTime - 60;
  1570. let endMinTime = totalVideoTime - 300;
  1571. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1572. photoList.push(endTakeTime); //最后拍一张
  1573. } else {
  1574. //小于15分钟
  1575. let centerTime = this.randomNum(
  1576. (1 / 3) * totalVideoTime,
  1577. (2 / 3) * totalVideoTime
  1578. );
  1579. photoList.push(centerTime);
  1580. let endTakeTime = this.randomNum(
  1581. (2 / 3) * totalVideoTime,
  1582. totalVideoTime
  1583. );
  1584. photoList.push(endTakeTime);
  1585. }
  1586. }
  1587. }
  1588. return photoList;
  1589. },
  1590. getLiveUid(channelId) {
  1591. let self = this;
  1592. return new Promise((resolve) => {
  1593. let data = {
  1594. channelId: channelId,
  1595. orderGoodsId: this.orderGoodsId,
  1596. };
  1597. self.$api.polyvSign(data).then((res) => {
  1598. resolve(res.data.data);
  1599. });
  1600. });
  1601. },
  1602. timeEventLiving() {
  1603. if (plv != null) {
  1604. if (this.livePlay) {
  1605. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1606. if (this.liveDuration == 2) {
  1607. //直播第2秒拍照
  1608. if (
  1609. this.goodsPhotographConfig &&
  1610. this.goodsPhotographConfig.livephotograph == 1 &&
  1611. this.channelItem.learning != 1 &&
  1612. this.photoHistoryList.length == 0
  1613. ) {
  1614. //开启直播拍照
  1615. this.openPhoto();
  1616. } else {
  1617. this.postStudyRecord(0);
  1618. }
  1619. }
  1620. }
  1621. }
  1622. },
  1623. playerLiveStatusChange(e) {
  1624. const status = e.detail.status;
  1625. if (status === "live") {
  1626. //开始播放
  1627. if (this.timer) {
  1628. clearInterval(this.timer);
  1629. }
  1630. this.livePlay = true;
  1631. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1632. }
  1633. if (status === "end") {
  1634. this.hasStart = false;
  1635. if (this.livePlay) {
  1636. //只有播放过的结束才提交,避免未开播触发结束
  1637. this.postStudyRecord(1);
  1638. }
  1639. this.livePlay = false;
  1640. // 未开始
  1641. }
  1642. },
  1643. closePlv() {
  1644. if (plv) {
  1645. plv.destroy();
  1646. }
  1647. },
  1648. studyNotice() {
  1649. this.noticeShow = true;
  1650. },
  1651. //正常播放视频
  1652. async playVideo(item) {
  1653. this.sectionItem = item;
  1654. let { learning, videoCurrentTime, sectionId, recordingUrl } = item;
  1655. console.log(this.sectionItem, "this.sectionItem");
  1656. if (this.timer) {
  1657. clearInterval(this.timer);
  1658. }
  1659. this.recordObj = videoCurrentTime
  1660. ? { videoCurrentTime }
  1661. : await this.getRecordLast(item);
  1662. // 查找拍照历史
  1663. if (this.photoNum > 0 && learning != 1) {
  1664. await this.getPhotoLastRecord();
  1665. }
  1666. this.$store.commit("setPlayVID", {
  1667. playVID: recordingUrl,
  1668. });
  1669. this.$store.commit("setPlaySectionId", {
  1670. playSectionId: sectionId,
  1671. });
  1672. this.startStatus = true;
  1673. if (this.refPlv) {
  1674. this.refPlv.changeVid({
  1675. vid: recordingUrl,
  1676. videoCurrentTime: this.recordObj.videoCurrentTime,
  1677. });
  1678. }
  1679. },
  1680. getRecordLast(sectionItem) {
  1681. let { chapterId, sectionId, courseId, moduleId } = sectionItem;
  1682. return new Promise((resolve) => {
  1683. let data = {
  1684. gradeId:
  1685. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  1686. goodsId:
  1687. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  1688. sectionId: sectionId || 0,
  1689. courseId: courseId || courseId == 0 ? Number(courseId) : null,
  1690. chapterId: chapterId || 0,
  1691. moduleId: moduleId || 0,
  1692. orderGoodsId: this.orderGoodsId,
  1693. };
  1694. this.$api.recordLast(data).then((res) => {
  1695. resolve(res.data.data);
  1696. });
  1697. });
  1698. },
  1699. jumpNote(item) {
  1700. this.$u.toast("即将跳到笔记位置");
  1701. if (this.playSectionId != item.sectionId) {
  1702. this.initPlayVideo({
  1703. sectionType: 1,
  1704. ...item,
  1705. videoCurrentTime: Number(item.noteSecond),
  1706. });
  1707. } else {
  1708. this.refPlv.seekVideo(item.noteSecond);
  1709. }
  1710. },
  1711. getGradeInfo() {
  1712. // 即刻 1 待定2 日期3
  1713. return this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  1714. if (res.data.code == 200) {
  1715. let { data } = res.data;
  1716. if (
  1717. data.learningStatus == 2 ||
  1718. (data.learningStatus == 3 &&
  1719. Number(data.learningTimeStart) > Number(new Date() / 1000))
  1720. ) {
  1721. uni.showModal({
  1722. showCancel: false,
  1723. confirmText: "确定",
  1724. content:
  1725. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1726. success: function (resultst) {
  1727. uni.navigateBack();
  1728. },
  1729. });
  1730. return Promise.reject(123);
  1731. }
  1732. }
  1733. });
  1734. },
  1735. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1736. if (!this.refPlv) {
  1737. return;
  1738. }
  1739. let currentTime = this.refPlv.playCurrentTime();
  1740. let PlayDuration = this.refPlv.playVideoTime();
  1741. if (currentTime < 10 && !this.ossAvatarUrl) {
  1742. return;
  1743. }
  1744. if (this.playChannelId > 0) {
  1745. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1746. }
  1747. let self = this;
  1748. let data = {
  1749. fromPlat: 1, //来源平台 1小程序 2网站
  1750. photo: self.ossAvatarUrl,
  1751. sectionId: sectionId || 0,
  1752. goodsId: parseInt(self.goodsId),
  1753. courseId: parseInt(self.courseId),
  1754. orderGoodsId: this.orderGoodsId,
  1755. studyDuration: parseInt(
  1756. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1757. ),
  1758. gradeId: parseInt(self.gradeId),
  1759. chapterId: this.chapterId || 0,
  1760. moduleId: this.moduleId || 0,
  1761. videoCurrentTime: parseInt(
  1762. currentTime > 0 ? currentTime : self.studyDuration
  1763. ),
  1764. erJianErZao: this.erJianErZao,
  1765. };
  1766. if (this.ossAvatarUrl) {
  1767. data.similarity = this.compareFaceData; // 相似度
  1768. }
  1769. if (status > 0) {
  1770. data.status = status;
  1771. }
  1772. console.log(data, "记录参数");
  1773. return new Promise((resolve, reject) => {
  1774. this.$api
  1775. .studyRecord(data)
  1776. .then((res) => {
  1777. console.log(res, "记录返回");
  1778. let { code, msg } = res.data;
  1779. if (code == 200) {
  1780. if (status > 0) {
  1781. this.studyRecordMenuAllList();
  1782. let moduleId = this.moduleId || 0;
  1783. let chapterId = this.chapterId || 0;
  1784. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1785. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1786. uni.$emit("playNext" + playNextIdisRebuild, {
  1787. fromRebuild: this.isRebuild,
  1788. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1789. uni.$emit("playNext" + playNextId); //通知播放结束
  1790. }
  1791. self.ossAvatarUrl = "";
  1792. } else if (code == 600) {
  1793. uni.showModal({
  1794. showCancel: false,
  1795. title: "提示",
  1796. content: msg,
  1797. success: (resultst) => {
  1798. uni.navigateBack();
  1799. },
  1800. });
  1801. } else if (code == 558) {
  1802. this.CountTo1 = msg.split(",")[1];
  1803. this.noticeShow1 = true;
  1804. var timer = setInterval(() => {
  1805. this.CountTo1--;
  1806. if (this.CountTo1 < 0) {
  1807. this.noticeShow1 = false;
  1808. clearInterval(timer);
  1809. this.postStudyRecord(1);
  1810. }
  1811. }, 1000);
  1812. reject("中断执行");
  1813. } else {
  1814. this.uploadLock = false;
  1815. uni.showToast({
  1816. icon: "none",
  1817. title: res.data.msg,
  1818. duration: 2000,
  1819. });
  1820. if (this.erJianErZao && code == 559) {
  1821. this.isReach = true;
  1822. this.openPhoto();
  1823. }
  1824. if (code == 559 || code == 588) {
  1825. reject("中断执行");
  1826. }
  1827. }
  1828. resolve();
  1829. })
  1830. .catch((err) => {
  1831. this.studyRecordMenuAllList();
  1832. });
  1833. });
  1834. },
  1835. uploadFile(options, int) {
  1836. var self = this;
  1837. return new Promise((resolve, reject) => {
  1838. var data = {
  1839. imageStatus: int,
  1840. gradeId: this.gradeId,
  1841. orderGoodsId: this.orderGoodsId,
  1842. };
  1843. self.$api.aliyunpolicy(data).then((res) => {
  1844. if (res.data.code != 200) {
  1845. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1846. return;
  1847. }
  1848. var ossToken = res.data.data.resultContent;
  1849. if (ossToken.host == null || ossToken.host == undefined) {
  1850. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1851. return;
  1852. }
  1853. let filePath = "";
  1854. // #ifdef H5
  1855. var localData = options; //dataUrl为base64位
  1856. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  1857. let length = base.length;
  1858. let url = new Uint8Array(length);
  1859. while (length--) {
  1860. url[length] = base.charCodeAt(length);
  1861. }
  1862. filePath = new File([url], "a.jpg", {
  1863. type: "image/jpg",
  1864. });
  1865. uni.uploadFile({
  1866. url: ossToken.host,
  1867. name: "file",
  1868. file: filePath,
  1869. fileType: "image",
  1870. header: {
  1871. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1872. },
  1873. formData: {
  1874. key: ossToken.dir,
  1875. OSSAccessKeyId: ossToken.accessid,
  1876. policy: ossToken.policy,
  1877. Signature: ossToken.signature,
  1878. callback: ossToken.callback,
  1879. success_action_status: 200,
  1880. },
  1881. success: (result) => {
  1882. this.$u.toast("上传成功");
  1883. self.ossAvatarUrl = ossToken.dir;
  1884. resolve(ossToken.dir);
  1885. },
  1886. fail: (error) => {
  1887. uni.showToast({
  1888. title: "上传接口报错,请重新拍照上传" + error,
  1889. icon: "none",
  1890. });
  1891. this.openPhoto();
  1892. return;
  1893. },
  1894. });
  1895. // #endif
  1896. // #ifdef MP-WEIXIN
  1897. uni.uploadFile({
  1898. url: ossToken.host,
  1899. name: "file",
  1900. filePath: options,
  1901. fileType: "image",
  1902. header: {
  1903. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1904. },
  1905. formData: {
  1906. key: ossToken.dir,
  1907. OSSAccessKeyId: ossToken.accessid,
  1908. policy: ossToken.policy,
  1909. Signature: ossToken.signature,
  1910. callback: ossToken.callback,
  1911. success_action_status: 200,
  1912. },
  1913. success: (result) => {
  1914. // if (result.statusCode === 200) {
  1915. this.$u.toast("上传成功");
  1916. self.ossAvatarUrl = ossToken.dir;
  1917. resolve(ossToken.dir);
  1918. },
  1919. fail: (error) => {
  1920. uni.showToast({
  1921. title: "上传接口报错,请重新拍照上传" + error,
  1922. icon: "none",
  1923. });
  1924. this.openPhoto();
  1925. return;
  1926. },
  1927. });
  1928. // #endif
  1929. });
  1930. });
  1931. },
  1932. imageInfos() {
  1933. var self = this;
  1934. return new Promise(async (resolve, reject) => {
  1935. let resPath = await myCompressImage(this.avatarUrl || this.faceUrl, 50);
  1936. const waitUpload = await self.uploadFile(resPath, 0);
  1937. resolve(waitUpload);
  1938. });
  1939. },
  1940. timeEvent(playTime) {
  1941. this.configPhoto();
  1942. let photoTime = 0; //获取拍照秒数
  1943. for (let i = 0; i < this.photoList.length; i++) {
  1944. photoTime = Number(this.photoList[i]); //获取拍照秒数
  1945. if (
  1946. (this.erJianErZao && !this.photoHistoryList.length) ||
  1947. (photoTime < playTime && photoTime > playTime - 8)
  1948. ) {
  1949. //3秒区间内才触发拍照,避免拉动滚动条
  1950. if (this.photoHistoryList.indexOf(i) < 0) {
  1951. //不存在拍照历史,没有重修过,没有学过,则拍照
  1952. //启动拍照
  1953. //暂停
  1954. console.log("去拍照");
  1955. this.refPlv.playPause();
  1956. this.refPlv.exitFullScreen();
  1957. this.photoIndex = i;
  1958. }
  1959. }
  1960. }
  1961. },
  1962. closeToast() {
  1963. clearTimeout(this.toastTimer);
  1964. this.videoToastShow = false;
  1965. },
  1966. // 新增用户视频学习日志
  1967. studyLog() {
  1968. this.$http({
  1969. url: "/user/study/log",
  1970. method: "post",
  1971. data: {
  1972. goodsId: this.goodsId,
  1973. courseId: this.courseId,
  1974. moduleId: this.moduleId || 0,
  1975. chapterId: this.chapterId || 0,
  1976. sectionId: this.playSectionId || 0,
  1977. fromPlat: 1, //来源平台 1小程序 2PC网站
  1978. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  1979. orderGoodsId: this.orderGoodsId,
  1980. },
  1981. }).then((res) => {});
  1982. },
  1983. timeupdate(time) {
  1984. // console.log("播放中", time);
  1985. this.clearPauseTimer();
  1986. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  1987. this.isReach = false;
  1988. this.timeEvent();
  1989. }
  1990. },
  1991. playing() {
  1992. console.log("playing");
  1993. if (this.noticeShow) {
  1994. this.refPlv.playPause();
  1995. return;
  1996. }
  1997. this.$refs["camera"].openCamera();
  1998. this.studyLog();
  1999. if (!this.recordObj.videoCurrentTime) {
  2000. this.postStudyRecord(0);
  2001. }
  2002. this.studyTimer && clearInterval(this.studyTimer);
  2003. this.studyTimer = setInterval(() => {
  2004. this.postStudyRecord(0);
  2005. }, 15000);
  2006. },
  2007. openCamera(){
  2008. this.$refs["camera"].openCamera();
  2009. },
  2010. pause() {
  2011. this.erJianErZaoPauseTip();
  2012. clearInterval(this.timer);
  2013. clearInterval(this.studyTimer);
  2014. },
  2015. async ended() {
  2016. this.hasStart = false;
  2017. uni.showToast({
  2018. icon: "none",
  2019. title: "播放完毕",
  2020. });
  2021. clearInterval(this.timer);
  2022. clearInterval(this.studyTimer);
  2023. await this.postStudyRecord(1);
  2024. this.nextSection();
  2025. },
  2026. playerError() {
  2027. console.log(46546);
  2028. },
  2029. //播放下一节
  2030. nextSection() {
  2031. console.log("播放下一节");
  2032. if (!this.menuAllList.length) {
  2033. return;
  2034. }
  2035. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  2036. let i_sectionId = item.sectionId || 0;
  2037. let i_chapterId = item.chapterId || 0;
  2038. let i_moduleId = item.moduleId || 0;
  2039. return (
  2040. i_sectionId == this.playSectionId &&
  2041. i_chapterId == this.chapterId &&
  2042. i_moduleId == this.moduleId
  2043. );
  2044. });
  2045. let data = this.menuAllList[this.curPlayIndex + 1];
  2046. if (!data) {
  2047. //第二个弹窗
  2048. uni.showModal({
  2049. title: "温馨提示",
  2050. content:
  2051. "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
  2052. showCancel: !this.erJianErZao,
  2053. success: (res) => {
  2054. if (res.confirm) {
  2055. uni.switchTab({
  2056. url: "/pages/learn/index",
  2057. });
  2058. }
  2059. },
  2060. });
  2061. } else {
  2062. if (data.doType == 2) {
  2063. if (data.studyStatus == 1) {
  2064. uni.showToast({
  2065. title: "试卷已合格!",
  2066. duration: 2000,
  2067. icon: "none",
  2068. });
  2069. return;
  2070. }
  2071. uni.showModal({
  2072. title: "温馨提示",
  2073. content: "当前节视频已学完,是否进入考试?",
  2074. success: (res) => {
  2075. if (res.confirm) {
  2076. this.toQuestionBank(data);
  2077. }
  2078. },
  2079. });
  2080. return;
  2081. }
  2082. uni.showModal({
  2083. title: "温馨提示",
  2084. content: "当前节视频已学完,继续学习下一节?",
  2085. success: async (res) => {
  2086. if (res.confirm) {
  2087. this.moduleId = data.moduleId;
  2088. this.chapterId = data.chapterId;
  2089. this.sectionId = data.sectionId;
  2090. if (data.sectionType == 1) {
  2091. //录播
  2092. this.$store.commit("setPlaySectionId", {
  2093. playSectionId: data.sectionId,
  2094. });
  2095. this.$store.commit("setPlayVID", {
  2096. playVID: data.recordingUrl,
  2097. });
  2098. this.hasStart = false;
  2099. this.photoConfig = false;
  2100. this.photoIndex = 0;
  2101. this.sectionItem = data;
  2102. await this.getPhotoLastRecord(); // 获取拍照历史
  2103. this.playVideo(data);
  2104. } else if (data.sectionType == 2) {
  2105. //直播
  2106. this.studyRecordGetLastLive();
  2107. } else if (data.sectionType == 3) {
  2108. //回放
  2109. this.$store.commit("setPlaySectionId", {
  2110. playSectionId: data.sectionId,
  2111. });
  2112. this.$store.commit("setPlayVID", {
  2113. playVID: data.recordingUrl,
  2114. });
  2115. this.sectionItem = data;
  2116. this.playVideo(data);
  2117. }
  2118. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  2119. this.$store.commit("updatePlayNextId", playNextId);
  2120. this.updateChapterOpen(true);
  2121. }
  2122. },
  2123. });
  2124. }
  2125. },
  2126. //拍照
  2127. openPhoto() {
  2128. if (polyvPlayerContext) {
  2129. // #ifdef MP-WEIXIN
  2130. polyvPlayerContext.exitFullScreen();
  2131. // #endif
  2132. // #ifdef H5
  2133. if (this.isFullScreen()) {
  2134. this.exitFullscreen();
  2135. }
  2136. // #endif
  2137. }
  2138. // #ifdef MP-WEIXIN
  2139. this.enableAutoRotation = false;
  2140. this.photoPopup = true;
  2141. this.isTaking = true;
  2142. uni.setKeepScreenOn({
  2143. keepScreenOn: true,
  2144. });
  2145. uni.authorize({
  2146. scope: "scope.camera",
  2147. success() {},
  2148. });
  2149. // #endif
  2150. // #ifdef H5
  2151. if (
  2152. (window.navigator.mediaDevices &&
  2153. window.navigator.mediaDevices.getUserMedia) ||
  2154. window.navigator.getUserMedia ||
  2155. window.navigator.webkitGetUserMedia ||
  2156. window.navigator.mozGetUserMedia
  2157. ) {
  2158. console.log("getUserMedia----");
  2159. // 调用用户媒体设备, 访问摄像头
  2160. this.getUserMedia(
  2161. {
  2162. video: {
  2163. width: 400,
  2164. height: 300,
  2165. facingMode: "user",
  2166. },
  2167. },
  2168. this.photographSuccess,
  2169. this.photographError
  2170. );
  2171. } else {
  2172. console.log("1111没有摄像");
  2173. this.photographError();
  2174. }
  2175. // #endif
  2176. },
  2177. /**
  2178. * 人脸匹配
  2179. */
  2180. faceRecognition() {
  2181. return new Promise((resolve) => {
  2182. // #ifdef MP-WEIXIN
  2183. let fileSystem = uni.getFileSystemManager();
  2184. fileSystem.readFile({
  2185. filePath: `${this.avatarUrl}`,
  2186. encoding: "base64",
  2187. position: 0,
  2188. success: (res) => {
  2189. let base64 = "data:image/jpg;base64," + res.data;
  2190. // console.log('base64Data人脸识别参数:', {
  2191. // imageA: base64,
  2192. // orderGoodsId: this.orderGoodsId,
  2193. // gradeId: this.gradeId,
  2194. // })
  2195. this.CompareFace(base64, resolve);
  2196. },
  2197. fail(err) {
  2198. // this.$u.toast('人脸识别错误!')
  2199. console.error(err, "err-----人脸识别错误");
  2200. },
  2201. });
  2202. // #endif
  2203. // #ifdef H5
  2204. this.CompareFace(this.faceUrl, resolve);
  2205. // #endif
  2206. });
  2207. },
  2208. CompareFace(url, resolve) {
  2209. let timer = setTimeout(() => {
  2210. uni.showToast({
  2211. icon: "none",
  2212. title: "拍照超时,请重新拍照",
  2213. duration: 2000,
  2214. success: () => {
  2215. setTimeout(() => {
  2216. uni.navigateBack();
  2217. }, 1000);
  2218. },
  2219. });
  2220. }, 10 * 1000);
  2221. this.$api
  2222. .faceCertificationCompareFace({
  2223. imageA: url,
  2224. orderGoodsId: this.orderGoodsId,
  2225. gradeId: this.gradeId,
  2226. })
  2227. .then((res) => {
  2228. clearTimeout(timer);
  2229. console.log(res, "人脸识别成功res");
  2230. resolve(res.data.data);
  2231. })
  2232. .catch((err) => {
  2233. clearTimeout(timer);
  2234. // 当前网络延迟,
  2235. console.log("人脸识别错误:", err);
  2236. uni.showModal({
  2237. content: "当前网络延迟",
  2238. showCancel: false,
  2239. success: (resultst) => {
  2240. if (resultst.confirm) {
  2241. uni.navigateBack();
  2242. }
  2243. },
  2244. });
  2245. });
  2246. },
  2247. //确认拍照
  2248. takePhoto() {
  2249. // #ifdef MP-WEIXIN
  2250. const ctx = uni.createCameraContext();
  2251. ctx.takePhoto({
  2252. quality: "high",
  2253. success: (res) => {
  2254. this.avatarUrl = res.tempImagePath;
  2255. console.log("开始拍照this.avatarUrl:", this.avatarUrl);
  2256. this.isTaking = false;
  2257. },
  2258. fail: (err) => {},
  2259. });
  2260. // #endif
  2261. // #ifdef H5
  2262. const canvas = document.createElement("canvas");
  2263. canvas.width = 400;
  2264. canvas.height = 400;
  2265. const context = canvas.getContext("2d");
  2266. const box = document.querySelector(".photo_v");
  2267. const video = box.querySelector("video");
  2268. context.drawImage(video, 0, 0, 400, 400);
  2269. this.faceUrl = canvas.toDataURL("image/png");
  2270. this.isTaking = false;
  2271. // #endif
  2272. },
  2273. playError(e) {
  2274. console.log(e);
  2275. },
  2276. //拍照报错
  2277. error(e) {
  2278. console.log(e.detail);
  2279. },
  2280. //关闭相机
  2281. closePhoto() {
  2282. this.photoPopup = false;
  2283. this.enableAutoRotation = true;
  2284. },
  2285. async userConfirmInfoDetail() {
  2286. let info = await this.$api.userConfirmInfoDetail({
  2287. orderGoodsId: this.orderGoodsId,
  2288. });
  2289. if (!info.data.data || info.data.data.pushInfo !== 1) {
  2290. uni.showModal({
  2291. showCancel: false,
  2292. title: "提示",
  2293. content: "开通信息推送不成功,无法进入学习!",
  2294. success: (resultst) => {
  2295. uni.navigateBack();
  2296. },
  2297. });
  2298. return Promise.reject();
  2299. }
  2300. },
  2301. checkFinishRequiredCourse() {
  2302. return this.$api
  2303. .checkFinishRequiredCourse({
  2304. businessId: this.goodsData.businessId,
  2305. goodsId: this.goodsId,
  2306. })
  2307. .then((res) => {
  2308. if (res.data.data > 0) {
  2309. uni.showModal({
  2310. showCancel: false,
  2311. confirmText: "确定",
  2312. content: "该业务层次下有未学完的商品,无法学习新商品!",
  2313. success: function (resultst) {
  2314. uni.navigateBack();
  2315. },
  2316. });
  2317. return Promise.reject();
  2318. }
  2319. return Promise.resolve();
  2320. });
  2321. },
  2322. async getGoodsDetail() {
  2323. let { data } = await this.$api.goodsDetail(this.goodsId);
  2324. console.log("🚀 ~ file: detail.vue:2342 ~ getGoodsDetail ~ data:", data)
  2325. this.goodsData = data.data;
  2326. this.erJianErZao = this.goodsData.erJianErZao;
  2327. this.erJianErZao && (await this.userConfirmInfoDetail());
  2328. this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
  2329. this.goodsData.buyNote && this.baseHandoutTipList();
  2330. this.gradeId = this.goodsData.gradeId;
  2331. if (this.goodsData.goodsPlayConfig) {
  2332. this.goodsPlayConfig = JSON.parse(this.goodsData.goodsPlayConfig);
  2333. if (this.goodsPlayConfig.autoPlay > 0) {
  2334. this.autoplay = true;
  2335. }
  2336. if (this.goodsPlayConfig.drag > 0 && !this.erJianErZao) {
  2337. // #ifdef MP-WEIXIN
  2338. this.isAllowSeek = "yes";
  2339. // #endif
  2340. // #ifdef H5
  2341. this.isAllowSeek = "off";
  2342. // #endif
  2343. }
  2344. if (this.goodsPlayConfig.speed > 0) {
  2345. this.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2346. }
  2347. }
  2348. if (this.goodsData.goodsPhotographConfig) {
  2349. this.goodsPhotographConfig = JSON.parse(
  2350. this.goodsData.goodsPhotographConfig
  2351. );
  2352. if (this.goodsPhotographConfig.photoNum > 0) {
  2353. this.photoNum = this.goodsPhotographConfig.photoNum;
  2354. }
  2355. }
  2356. },
  2357. getReMenuList() {
  2358. let self = this;
  2359. this.$api
  2360. .reMenuList({
  2361. orderGoodsId: this.orderGoodsId,
  2362. courseId: this.courseId,
  2363. rebuild: 1,
  2364. gradeId: this.gradeId,
  2365. })
  2366. .then((res) => {
  2367. if (res.data.code == 200) {
  2368. for (let i = 0; i < res.data.rows.length; i++) {
  2369. let item = res.data.rows[i];
  2370. item.down = true;
  2371. item.id = item.menuId;
  2372. item.name = item.menuName;
  2373. }
  2374. self.reMenuList = res.data.rows;
  2375. this.current = 0;
  2376. if (self.reMenuList.length > 0) {
  2377. this.showNotes = false;
  2378. if (Object.keys(this.sectionItem).length) {
  2379. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  2380. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  2381. }
  2382. } else {
  2383. if (Object.keys(this.sectionItem).length) {
  2384. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  2385. this.$store.commit("updatePlayNextId", playNextId);
  2386. }
  2387. }
  2388. }
  2389. });
  2390. },
  2391. courseDetail() {
  2392. this.$api.courseDetail(this.courseId).then((res) => {
  2393. if (res.data.code == 200) {
  2394. this.detail = res.data.data;
  2395. }
  2396. });
  2397. },
  2398. open(item) {
  2399. item.showChildren = !item.showChildren;
  2400. },
  2401. change(index) {
  2402. this.current = index;
  2403. },
  2404. clears() {
  2405. return new Promise((resolve, reject) => {
  2406. this.vid = "";
  2407. polyvPlayerContext && polyvPlayerContext.destroy();
  2408. polyvPlayerContext = null;
  2409. resolve();
  2410. });
  2411. },
  2412. /**
  2413. * 退出全屏
  2414. */
  2415. exitFullscreen() {
  2416. try {
  2417. var de = document;
  2418. if (de.exitFullscreen) {
  2419. de.exitFullscreen();
  2420. } else if (de.mozCancelFullScreen) {
  2421. de.mozCancelFullScreen();
  2422. } else if (de.webkitCancelFullScreen) {
  2423. de.webkitCancelFullScreen();
  2424. }
  2425. } catch (err) {}
  2426. },
  2427. fullele() {
  2428. return (
  2429. document.fullscreenElement ||
  2430. document.webkitFullscreenElement ||
  2431. document.msFullscreenElement ||
  2432. document.mozFullScreenElement ||
  2433. null
  2434. );
  2435. },
  2436. //判断是否全屏
  2437. isFullScreen() {
  2438. return !!(document.webkitIsFullScreen || this.fullele());
  2439. },
  2440. getUserMedia(constraints, success, error) {
  2441. console.log("getUserMedia===", constraints, "success:", success);
  2442. if (window.navigator.mediaDevices.getUserMedia) {
  2443. // 最新的标准API
  2444. window.navigator.mediaDevices
  2445. .getUserMedia(constraints)
  2446. .then(success)
  2447. .catch(error);
  2448. } else if (window.navigator.webkitGetUserMedia) {
  2449. // webkit核心浏览器
  2450. window.navigator.webkitGetUserMedia(constraints, success, error);
  2451. } else if (window.navigator.mozGetUserMedia) {
  2452. // firfox浏览器
  2453. window.navigator.mozGetUserMedia(constraints, success, error);
  2454. } else if (window.navigator.getUserMedia) {
  2455. // 旧版API
  2456. window.navigator.getUserMedia(constraints, success, error);
  2457. }
  2458. },
  2459. photographSuccess(stream) {
  2460. console.log("有摄像头---", stream);
  2461. this.photoPopup = true;
  2462. this.isTaking = true;
  2463. this.enableAutoRotation = false;
  2464. this.$nextTick(() => {
  2465. const box = document.querySelector(".photo_v");
  2466. const video = box.querySelector("video");
  2467. video.srcObject = stream;
  2468. video.play();
  2469. });
  2470. },
  2471. photographError(err) {
  2472. console.log("没有摄像头:", err);
  2473. uni.showModal({
  2474. title: "提示",
  2475. content:
  2476. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  2477. cancelText: "取消",
  2478. confirmText: "确定",
  2479. success: (res) => {
  2480. if (res.confirm) {
  2481. uni.navigateBack();
  2482. } else if (res.cancel) {
  2483. }
  2484. },
  2485. });
  2486. },
  2487. },
  2488. };
  2489. </script>
  2490. <style lang="scss" scope>
  2491. @import "./css/detail.scss";
  2492. .top {
  2493. &__header {
  2494. position: relative;
  2495. width: 100%;
  2496. height: 150rpx;
  2497. padding: 24rpx 150rpx 24rpx 24rpx;
  2498. .img {
  2499. position: absolute;
  2500. left: 0;
  2501. top: 0;
  2502. width: 100%;
  2503. }
  2504. .note {
  2505. position: relative;
  2506. z-index: 10;
  2507. font-size: 24rpx;
  2508. font-family: PingFang SC;
  2509. font-weight: bold;
  2510. color: #efdbff;
  2511. }
  2512. .title {
  2513. position: relative;
  2514. z-index: 10;
  2515. font-size: 26rpx;
  2516. font-family: PingFang SC;
  2517. font-weight: bold;
  2518. color: #ffffff;
  2519. }
  2520. }
  2521. }
  2522. #top {
  2523. position: relative;
  2524. z-index: 99;
  2525. }
  2526. .polyv_detail {
  2527. display: flex;
  2528. flex-direction: column;
  2529. height: 100vh;
  2530. position: relative;
  2531. top: 0;
  2532. left: 0;
  2533. .pops {
  2534. position: absolute;
  2535. top: 0;
  2536. left: 0;
  2537. background: #ccc;
  2538. opacity: 0.5;
  2539. width: 100%;
  2540. height: 300rpx;
  2541. z-index: 9999;
  2542. }
  2543. .box {
  2544. flex: 1;
  2545. overflow: hidden;
  2546. margin: 16rpx 16rpx 100rpx 16rpx;
  2547. .box_in {
  2548. height: 100%;
  2549. }
  2550. }
  2551. .first_ml {
  2552. margin: 16rpx 16rpx 16rpx 16rpx;
  2553. }
  2554. }
  2555. .btnSet {
  2556. width: 440rpx;
  2557. height: 80rpx;
  2558. background: #007aff;
  2559. border-radius: 40rpx;
  2560. color: #ffffff;
  2561. font-size: 28rpx;
  2562. line-height: 80rpx;
  2563. }
  2564. .lecture-content {
  2565. background: #fff;
  2566. margin-top: 10rpx;
  2567. padding: 10rpx;
  2568. border-radius: 16rpx;
  2569. }
  2570. .tBox {
  2571. display: flex;
  2572. align-items: center;
  2573. padding-top: 10rpx;
  2574. }
  2575. .title {
  2576. font-size: 24rpx;
  2577. color: #999999;
  2578. }
  2579. .t_content1 {
  2580. color: #007aff;
  2581. margin-left: 10rpx;
  2582. }
  2583. .tag1 {
  2584. border: 2rpx solid #007aff;
  2585. border-radius: 8rpx;
  2586. font-size: 20rpx;
  2587. color: #007aff;
  2588. padding: 5rpx;
  2589. }
  2590. .b_title {
  2591. color: #333333;
  2592. font-size: 30rpx;
  2593. font-weight: bold;
  2594. }
  2595. page {
  2596. background: #eaeef1;
  2597. }
  2598. .menuBox {
  2599. width: 100%;
  2600. background: #ffffff;
  2601. border-radius: 16rpx;
  2602. padding: 0rpx 20rpx;
  2603. margin-bottom: 20rpx;
  2604. }
  2605. .btnspric {
  2606. border-top: 1rpx solid #eee;
  2607. display: flex;
  2608. align-items: center;
  2609. justify-content: space-between;
  2610. height: 108rpx;
  2611. padding-left: 43rpx;
  2612. padding-right: 32rpx;
  2613. }
  2614. .btnspric > .lefprL {
  2615. font-size: 36rpx;
  2616. color: #0c141f;
  2617. font-weight: bold;
  2618. }
  2619. .btnspric > .lefprR {
  2620. padding: 0rpx 24rpx;
  2621. height: 60rpx;
  2622. line-height: 60rpx;
  2623. text-align: center;
  2624. color: #fff;
  2625. background: #32467b;
  2626. border-radius: 24rpx;
  2627. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2628. }
  2629. .yhj,
  2630. .hdyhj {
  2631. padding: 24rpx 29rpx 24rpx 34rpx;
  2632. }
  2633. .yhj {
  2634. border-bottom: 16rpx solid #f9f9f9;
  2635. }
  2636. .yhjtit {
  2637. font-size: 30rpx;
  2638. color: #0c141f;
  2639. font-weight: 500;
  2640. margin-bottom: 14rpx;
  2641. }
  2642. .yhjList {
  2643. display: flex;
  2644. align-items: center;
  2645. justify-content: space-between;
  2646. margin-bottom: 14rpx;
  2647. }
  2648. .yhjList > .yhjLefts {
  2649. display: flex;
  2650. align-items: center;
  2651. }
  2652. .yhjLefts > .yhl {
  2653. color: #32467b;
  2654. font-size: 30rpx;
  2655. margin-right: 31rpx;
  2656. }
  2657. .yhjLefts > .yhbq {
  2658. font-size: 24rpx;
  2659. color: #ff9500;
  2660. border-radius: 18rpx;
  2661. background-color: rgba(255, 149, 0, 0.2);
  2662. border: 2rpx solid #ff9500;
  2663. height: 38rpx;
  2664. line-height: 38rpx;
  2665. padding: 0rpx 16rpx;
  2666. }
  2667. .ts {
  2668. font-size: 24rpx;
  2669. color: #999;
  2670. margin: 14rpx 0rpx;
  2671. padding-right: 29rpx;
  2672. padding-left: 34rpx;
  2673. }
  2674. .yh {
  2675. padding-top: 20rpx;
  2676. }
  2677. .yh > .yhtitle {
  2678. display: flex;
  2679. align-items: center;
  2680. justify-content: space-between;
  2681. padding-right: 29rpx;
  2682. padding-left: 34rpx;
  2683. }
  2684. .priceBxs {
  2685. display: flex;
  2686. align-items: center;
  2687. }
  2688. .priceBxs > .pricleft {
  2689. border-radius: 24rpx;
  2690. border: 1rpx solid #e91313;
  2691. background-color: rgba(233, 19, 19, 0.1);
  2692. padding: 0rpx 18rpx;
  2693. height: 49rpx;
  2694. line-height: 49rpx;
  2695. text-align: center;
  2696. font-size: 30rpx;
  2697. font-weight: 500;
  2698. color: #e91313;
  2699. margin-right: 13rpx;
  2700. }
  2701. .topBox {
  2702. padding: 32rpx 32rpx 24rpx;
  2703. border-bottom: 1rpx solid #eeeeee;
  2704. }
  2705. .topBox > .boldFonstType {
  2706. font-weight: 500;
  2707. font-size: 30rpx;
  2708. margin: 16rpx 0rpx 23rpx;
  2709. }
  2710. .topBox > .firstTopL {
  2711. display: flex;
  2712. align-items: center;
  2713. }
  2714. .topBox > .firstTopL > .imageBs {
  2715. width: 331rpx;
  2716. height: 160rpx;
  2717. border-radius: 6rpx;
  2718. overflow: hidden;
  2719. margin-right: 8rpx;
  2720. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2721. }
  2722. .topBox > .firstTopL > .imageBs > image {
  2723. width: 100%;
  2724. height: 100%;
  2725. }
  2726. .topBox > .firstTopL > .textBs {
  2727. font-size: 30rpx;
  2728. font-weight: bold;
  2729. color: #0c141f;
  2730. }
  2731. .content {
  2732. padding: 24rpx;
  2733. text-align: left;
  2734. }
  2735. .catalogBox {
  2736. display: flex;
  2737. align-items: center;
  2738. flex-wrap: nowrap;
  2739. overflow-x: auto;
  2740. padding-left: 38rpx;
  2741. max-height: 305rpx;
  2742. overflow-y: auto;
  2743. transition: all 0.4s;
  2744. }
  2745. .catalogBox > .catalogA {
  2746. min-width: 200rpx;
  2747. height: 48rpx;
  2748. line-height: 48rpx;
  2749. // text-align: center;
  2750. border: 2rpx solid transparent;
  2751. white-space: nowrap;
  2752. text-overflow: ellipsis;
  2753. overflow: hidden;
  2754. word-break: break-all;
  2755. border-radius: 10rpx;
  2756. background: rgba(22, 119, 255, 0.05);
  2757. padding-left: 19rpx;
  2758. box-sizing: border-box;
  2759. padding-right: 15rpx;
  2760. margin-right: 16rpx;
  2761. margin-bottom: 20rpx;
  2762. margin-top: 15rpx;
  2763. font-size: 24rpx;
  2764. color: #666;
  2765. }
  2766. .catalogBox > .activesq {
  2767. border-color: #1677ff;
  2768. }
  2769. .changeCatalogBox {
  2770. display: block;
  2771. }
  2772. .catalogBox::-webkit-scrollbar {
  2773. display: none; /* Chrome Safari */
  2774. }
  2775. .price_t2 {
  2776. font-size: 18rpx;
  2777. font-family: PingFang SC;
  2778. font-weight: 500;
  2779. text-decoration: line-through;
  2780. color: #999999;
  2781. }
  2782. .price_t1 {
  2783. font-size: 33rpx;
  2784. font-family: PingFang SC;
  2785. font-weight: bold;
  2786. color: #e91313;
  2787. }
  2788. .sc_t {
  2789. font-size: 22rpx;
  2790. color: #000000;
  2791. }
  2792. .sc {
  2793. width: 29rpx;
  2794. height: 29rpx;
  2795. }
  2796. .buy {
  2797. width: 138rpx;
  2798. height: 48rpx;
  2799. line-height: 48rpx;
  2800. background: #32467b;
  2801. border-radius: 10rpx;
  2802. color: #ffffff;
  2803. font-size: 28rpx;
  2804. text-align: center;
  2805. vertical-align: middle;
  2806. position: absolute;
  2807. right: 30rpx;
  2808. }
  2809. .video_body {
  2810. padding-bottom: 96rpx;
  2811. }
  2812. .footer_tab {
  2813. position: fixed;
  2814. bottom: 0;
  2815. height: 96rpx;
  2816. width: 100%;
  2817. background-color: #ffffff;
  2818. }
  2819. .tj_box {
  2820. width: 50%;
  2821. display: inline-block;
  2822. text-align: center;
  2823. margin: 10rpx 0;
  2824. }
  2825. .teacher_t {
  2826. font-size: 24rpx;
  2827. font-family: PingFang SC;
  2828. font-weight: 400;
  2829. color: #666666;
  2830. line-height: 36rpx;
  2831. margin-left: 15rpx;
  2832. }
  2833. .teacher_img {
  2834. width: 87rpx;
  2835. height: 129rpx;
  2836. }
  2837. .t2 {
  2838. font-size: 24rpx;
  2839. font-family: PingFang SC;
  2840. color: #666666;
  2841. line-height: 36rpx;
  2842. margin: 15rpx;
  2843. }
  2844. .r_t2 {
  2845. width: 201rpx;
  2846. height: 49rpx;
  2847. background: rgba(22, 119, 255, 0.05);
  2848. border: 1rpx solid #32467b;
  2849. border-radius: 16rpx;
  2850. color: #666666;
  2851. font-size: 23rpx;
  2852. text-align: center;
  2853. display: flex;
  2854. align-items: center;
  2855. padding: 5rpx;
  2856. }
  2857. .scroll_box {
  2858. width: 100%;
  2859. height: 60rpx;
  2860. background: #ffffff;
  2861. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2862. white-space: nowrap;
  2863. overflow: hidden;
  2864. margin: 15rpx 0;
  2865. }
  2866. .r_sliper {
  2867. padding: 0 20rpx;
  2868. }
  2869. .top_line {
  2870. width: 6rpx;
  2871. height: 22rpx;
  2872. background: #32467b;
  2873. margin-right: 10rpx;
  2874. }
  2875. .video_t2 {
  2876. font-size: 24rpx;
  2877. font-family: PingFang SC;
  2878. font-weight: 500;
  2879. color: #666666;
  2880. }
  2881. .video_play {
  2882. position: absolute;
  2883. width: 95rpx;
  2884. height: 95rpx;
  2885. top: 0;
  2886. left: 0;
  2887. right: 0;
  2888. bottom: 0;
  2889. margin: auto;
  2890. }
  2891. .video_box {
  2892. position: relative;
  2893. }
  2894. .rotoct {
  2895. transform: rotate(90deg);
  2896. }
  2897. .slot-content {
  2898. padding: 0 20rpx;
  2899. }
  2900. .notice_modal {
  2901. .content {
  2902. width: 100%;
  2903. height: 100%;
  2904. padding: 56rpx 56rpx 56rpx 64rpx;
  2905. .title {
  2906. color: #222;
  2907. line-height: 40rpx;
  2908. font-size: 36rpx;
  2909. text-align: center;
  2910. font-weight: bold;
  2911. margin-bottom: 24rpx;
  2912. }
  2913. .text {
  2914. height: 340rpx;
  2915. line-height: 40rpx;
  2916. text-indent: 2em;
  2917. font-size: 32rpx;
  2918. color: #222;
  2919. }
  2920. .had_read {
  2921. width: 100%;
  2922. height: 88rpx;
  2923. line-height: 88rpx;
  2924. text-align: center;
  2925. background: #3577e8;
  2926. border-radius: 240rpx;
  2927. font-size: 32rpx;
  2928. font-weight: 500;
  2929. color: #fff;
  2930. margin-top: 20rpx;
  2931. &.gray {
  2932. background: #bbbec5;
  2933. }
  2934. }
  2935. }
  2936. }
  2937. .full_mulu {
  2938. position: absolute;
  2939. top: 100rpx;
  2940. right: 20rpx;
  2941. width: 700rpx;
  2942. height: 515rpx;
  2943. color: #333;
  2944. display: flex;
  2945. align-items: center;
  2946. justify-content: space-between;
  2947. z-index: 99999;
  2948. .mulus {
  2949. width: 623rpx;
  2950. // height: 515rpx;
  2951. height: 400rpx;
  2952. overflow-y: scroll;
  2953. // overflow: scroll;
  2954. }
  2955. .mulu_box_in {
  2956. background-color: #b7b7b7;
  2957. border-radius: 16rpx;
  2958. // transition: all 0.5s;
  2959. &::after {
  2960. content: "";
  2961. width: 0;
  2962. height: 0;
  2963. position: absolute;
  2964. top: 235rpx;
  2965. right: 27px;
  2966. border-top: 16rpx solid transparent;
  2967. border-right: 16rpx solid transparent;
  2968. border-left: 16rpx solid #b7b7b7;
  2969. border-bottom: 16rpx solid transparent;
  2970. }
  2971. }
  2972. .mulu_box_out {
  2973. // visibility: hidden;
  2974. display: none;
  2975. }
  2976. .menuBox_mulu {
  2977. // width: 100%;
  2978. background: #ffffff;
  2979. border-radius: 16rpx;
  2980. padding: 0rpx 20rpx;
  2981. margin-bottom: 20rpx;
  2982. }
  2983. .ml_img {
  2984. position: absolute;
  2985. right: 0;
  2986. top: 100rpx;
  2987. }
  2988. .items {
  2989. width: 620rpx;
  2990. height: 100rpx;
  2991. border: 1rpx solid red;
  2992. }
  2993. }
  2994. </style>