detail.vue 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730
  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. photoHistoryList: [], //已拍照历史的下标点
  432. sectionItem: {},
  433. showNotes: true,
  434. uploadLock: false, //上传图片
  435. isPlayRebuild: false, //是否正在播放重修视频needOpen
  436. isRebuild: false, //视频是否从重修目录点击
  437. clearTimer: null,
  438. livingItem: "",
  439. option: null,
  440. toggleCourseShow: false, // 切换课程弹窗
  441. courseList: [], // 课程列表
  442. subList: [],
  443. subIndex: 0,
  444. goodsTeacher: [],
  445. teacherList: [],
  446. teacherIndex: 0,
  447. newActiveSubjectId: "", //当前选中ID
  448. compareFaceData: 0, // 拍照匹配相似度
  449. prendreAutoCarme: false, // 是否发起授权相机
  450. studyTimer: null, // 学习记录定时器
  451. CountTo: 30, // 倒计时
  452. CountTo1: 0,
  453. handoutTipLength: 0,
  454. menuAllList: [],
  455. curPlayIndex: 0, // 正在播放的节的下标
  456. faceUrl: "",
  457. erJianErZao: false,
  458. jjShiGongYuan: false,
  459. pauseTime: 0,
  460. pauseTimer: null,
  461. barTimer: null,
  462. isReach: false,
  463. noticeShow1: false,
  464. refPlv: null,
  465. };
  466. },
  467. computed: {
  468. ...mapGetters([
  469. "userInfo",
  470. "playSectionId",
  471. "playChannelId",
  472. "playVID",
  473. "config",
  474. ]),
  475. playSecIsLearn() {
  476. return this.sectionItem.learning != 1;
  477. },
  478. orderNum() {
  479. return 0;
  480. return this.goodsData.goodsLearningOrder;
  481. },
  482. list() {
  483. let list = [
  484. {
  485. name: "目录",
  486. },
  487. {
  488. name: "讲义",
  489. },
  490. {
  491. name: "笔记",
  492. },
  493. {
  494. name: "答疑",
  495. },
  496. ];
  497. if (this.reMenuList.length > 0) {
  498. list.push({ name: "重修目录" });
  499. }
  500. return list;
  501. },
  502. params: function () {
  503. return (keys = ["orderGoodsId", "goodsId", "courseId"]) => {
  504. let params = {};
  505. for (const key of keys) {
  506. params[key] = this[key];
  507. }
  508. return params;
  509. };
  510. },
  511. detail() {
  512. if (!this.courseId || !this.courseList.length) {
  513. return {};
  514. }
  515. return this.courseList.find((e) => e.courseId == this.courseId);
  516. },
  517. },
  518. watch: {
  519. showSet(n) {
  520. if (n) {
  521. if (polyvPlayerContext) {
  522. // #ifdef MP-WEIXIN
  523. polyvPlayerContext.pause();
  524. // #endif
  525. // #ifdef H5
  526. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  527. // #endif
  528. }
  529. }
  530. },
  531. photoPopup(n) {
  532. if (n) {
  533. if (this.prendreAutoCarme) {
  534. this.photoPopup = false;
  535. }
  536. this.showSet && (this.photoPopup = false);
  537. }
  538. },
  539. },
  540. async onLoad(option) {
  541. if (option.isOther) {
  542. this.showMark = true;
  543. return;
  544. }
  545. this.option = option;
  546. let { skipPort, id, goodsId, orderGoodsId, gradeId, informId } = option;
  547. if (skipPort) {
  548. await this.$method.skipLogin(skipPort);
  549. }
  550. if (this.$method.isGoLogin()) {
  551. return;
  552. }
  553. this.orderGoodsId = Number(orderGoodsId) || "";
  554. this.isCanLearn();
  555. !this.userInfo && this.$api.refreshUserInfo();
  556. this.courseId = Number(id) || "";
  557. this.goodsId = Number(goodsId);
  558. this.gradeId = Number(gradeId);
  559. // 公众号模板消息的数据埋点
  560. informId && this.clickOfficial(informId);
  561. this.init();
  562. this.courseCourseList();
  563. },
  564. async onShow() {
  565. // this.closePhoto();
  566. },
  567. onUnload() {
  568. console.log("onUnloadonUnloadonUnloadonUnload");
  569. this.originUnload();
  570. this.clears();
  571. clearInterval(this.lockTimer);
  572. },
  573. onHide() {
  574. this.originUnload();
  575. },
  576. mounted() {},
  577. methods: {
  578. ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
  579. init() {
  580. // #ifdef MP-WEIXIN
  581. this.isAllowSeek = "no";
  582. // #endif
  583. // #ifdef H5
  584. this.isAllowSeek = "on";
  585. // #endif
  586. // 锁
  587. lockAction();
  588. this.lockTimer = setInterval(lockAction, 10000);
  589. },
  590. // 七大员是否能进入学习
  591. async qCheckIsCanLearn() {
  592. let res = await this.$api.qCheckIsCanLearn(this.orderGoodsId);
  593. if (res.data.code !== 200) {
  594. uni.showModal({
  595. showCancel: false,
  596. title: "提示",
  597. content: res.data.msg,
  598. success: (resultst) => {
  599. uni.navigateBack();
  600. },
  601. });
  602. return Promise.reject();
  603. }
  604. let res1 = await this.$api.syncSevenPublicClass({
  605. orderGoodsId: this.orderGoodsId,
  606. });
  607. if (res1.data.code !== 200) {
  608. uni.showModal({
  609. showCancel: false,
  610. title: "提示",
  611. content: "无法进入学习!",
  612. success: (resultst) => {
  613. uni.navigateBack();
  614. },
  615. });
  616. return Promise.reject();
  617. }
  618. },
  619. // 新增微信公众号模板消息点击数据
  620. clickOfficial(informId) {
  621. this.$http({
  622. url: "/data/click",
  623. method: "post",
  624. data: { informId },
  625. });
  626. },
  627. // 点击课程目录
  628. cMenu(item, index) {
  629. this.subIndex = index;
  630. this.newActiveSubjectId = item.subjectId;
  631. },
  632. courseCourseList() {
  633. this.courseList = [];
  634. this.menuList = [];
  635. this.photoConfig = false;
  636. this.$api
  637. .courseCourseList({
  638. pageNum: 1,
  639. pageSize: 200,
  640. goodsId: this.goodsId,
  641. gradeId: this.gradeId,
  642. orderGoodsId: this.orderGoodsId,
  643. })
  644. .then((res) => {
  645. if (res.data.code == 200) {
  646. this.courseList = res.data.rows;
  647. // 科目
  648. let allItem = [{ subjectId: 0, subjectName: "所有" }];
  649. let ids = [];
  650. const newArr = [];
  651. this.courseList.forEach((item) => {
  652. if (ids.indexOf(item.subjectId) == -1) {
  653. ids.push(item.subjectId);
  654. newArr.push(item);
  655. }
  656. });
  657. this.subList = [...allItem, ...newArr];
  658. if (res.data.total > 1) {
  659. this.getUserWatchLast();
  660. } else {
  661. this.originOnShow();
  662. this.originMounted();
  663. }
  664. }
  665. });
  666. },
  667. // 查询用户最后一次看的录播的信息
  668. getUserWatchLast() {
  669. this.$http({
  670. url: "/study/record/getUserWatchLast",
  671. method: "get",
  672. data: {
  673. orderGoodsId: this.orderGoodsId,
  674. },
  675. }).then((res) => {
  676. console.log("🚀 ~ file: detail.vue:859 ~ getUserWatchLast ~ res:", res);
  677. if (res.data.code == 200 && res.data.data) {
  678. this.courseId = res.data.data.courseId;
  679. }
  680. if (!this.courseId) {
  681. this.courseId = this.courseList[0].courseId;
  682. }
  683. this.originOnShow();
  684. this.originMounted();
  685. //获取商品双师资模板
  686. this.getCourseTeacher(this.courseList);
  687. });
  688. },
  689. getCourseTeacher(rows) {
  690. this.goodsTeacher = [];
  691. //获取商品双师资模板
  692. this.$api
  693. .courseTeacherList({
  694. goodsId: this.goodsId,
  695. })
  696. .then((res1) => {
  697. if (res1.data.data && res1.data.data.length > 0) {
  698. //课程老师模板
  699. let teacherTel = res1.data.data;
  700. //商品课程
  701. let courses = rows;
  702. teacherTel.forEach((tea) => {
  703. let dataList = [];
  704. let teacherList = [];
  705. courses.forEach((item) => {
  706. let data = tea.courseList.filter(
  707. (x) => x.courseId == item.courseId
  708. );
  709. if (data && data.length > 0) {
  710. dataList.push(item);
  711. teacherList = tea.courseList;
  712. }
  713. });
  714. let result = {
  715. teaList: teacherList,
  716. courseList: dataList,
  717. };
  718. this.goodsTeacher.push(result);
  719. });
  720. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  721. let courseIds = [];
  722. this.goodsTeacher.forEach((item) => {
  723. item.courseList.forEach((course) => {
  724. courseIds.push(course.courseId);
  725. });
  726. });
  727. if (courseIds.length > 0) {
  728. courses.forEach((item) => {
  729. if (!courseIds.includes(item.courseId)) {
  730. let data = {
  731. teaList: [],
  732. courseList: [],
  733. };
  734. data.courseList.push(item);
  735. this.goodsTeacher.push(data);
  736. }
  737. });
  738. }
  739. this.goodsTeacher.forEach((item) => {
  740. if (item.courseList && item.courseList.length > 0) {
  741. item.courseList[0].show = 1;
  742. }
  743. });
  744. }
  745. } else {
  746. //没有双师资模板
  747. rows.forEach((item) => {
  748. item.show = 1;
  749. let data = {
  750. teaList: [],
  751. courseList: [],
  752. };
  753. data.courseList.push(item);
  754. this.goodsTeacher.push(data);
  755. });
  756. }
  757. this.goodsTeacher.forEach((item) => {
  758. if (item.courseList.some((x) => x.courseId == this.courseId)) {
  759. this.teacherList = item.teaList;
  760. }
  761. });
  762. });
  763. },
  764. erJianErZaoPauseTip() {
  765. if (this.playSecIsLearn && this.erJianErZao) {
  766. if (this.pauseTimer) {
  767. return;
  768. }
  769. this.pauseTime = Date.now();
  770. console.log("开启定时器");
  771. this.pauseTimer = setInterval(() => {
  772. console.log("暂停时间", Date.now() - this.pauseTime, this.pauseTime);
  773. if (Date.now() - this.pauseTime > 5 * 60 * 1000) {
  774. // 5 * 60 * 1000
  775. let text = this.photoPopup ? "拍照停留" : "暂停";
  776. this.photoPopup = false;
  777. uni.showModal({
  778. title: "提示",
  779. showCancel: false,
  780. content: `检测${text}时间过长,刷新当前页面`,
  781. cancelText: "取消",
  782. confirmText: "确定",
  783. success: (res) => {
  784. if (res.confirm) {
  785. // #ifdef H5
  786. location.reload();
  787. // #endif
  788. // #ifdef MP-WEIXIN
  789. this.courseCourseList();
  790. // #endif
  791. }
  792. },
  793. });
  794. this.clearPauseTimer();
  795. }
  796. }, 5000);
  797. }
  798. },
  799. // 原来onshow里面的内容
  800. async originOnShow() {
  801. this.getReMenuList();
  802. await this.studyRecordMenuAllList();
  803. // 消息过来 定位某个节
  804. if (this.option.noteSecond) {
  805. this.jumpNote({
  806. sectionType: 1,
  807. ...this.option,
  808. });
  809. return;
  810. }
  811. this.studyRecordQueryLiveLast();
  812. },
  813. // 原来的mouted内容
  814. originMounted() {
  815. uni.$on("changeSection", (oldSectionId) => {
  816. console.log(
  817. "切换课程-originMounted->playVID:",
  818. this.playVID,
  819. oldSectionId
  820. );
  821. this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
  822. this.clearPauseTimer();
  823. this.hasStart = false;
  824. this.photoConfig = false;
  825. //清除直播
  826. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  827. // 防止原先初始化错误
  828. if (!this.refPlv) {
  829. this.refPlv = this.$refs.player;
  830. }
  831. this.postStudyRecord(0, oldSectionId);
  832. });
  833. uni.$on("getSection", (item) => {
  834. //清除直播
  835. this.studyTimer && clearInterval(this.studyTimer);
  836. this.hasStart = false;
  837. this.isPlayRebuild = item.rebuild;
  838. this.photoConfig = false;
  839. this.sectionItem = item;
  840. this.moduleId = item.moduleId || null;
  841. this.chapterId = item.chapterId || null;
  842. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  843. this.playVideo(item);
  844. });
  845. uni.$on("levelId", (item) => {
  846. let arr = item.split("-");
  847. //点击节获取的各层级ID
  848. this.moduleId = arr[0];
  849. this.chapterId = arr[1];
  850. });
  851. uni.$on("getChannel", (item) => {
  852. //清除录播
  853. this.studyTimer && clearInterval(this.studyTimer);
  854. this.hasStart = false;
  855. this.$store.commit("setPlayVID", { playVID: null });
  856. this.moduleId = item.moduleId;
  857. this.chapterId = item.chapterId;
  858. this.$store.commit("setPlaySectionId", {
  859. playSectionId: item.sectionId || item.menuId,
  860. });
  861. this.playChannel(item);
  862. this.channelItem = item;
  863. });
  864. uni.$on("isRebuild", (item) => {
  865. this.isRebuild = item;
  866. });
  867. this.updateChapterOpen(true);
  868. },
  869. clearPauseTimer() {
  870. if (this.pauseTimer) {
  871. this.pauseTime = 0;
  872. clearInterval(this.pauseTimer);
  873. this.pauseTimer = null;
  874. }
  875. },
  876. clearBarTimer() {
  877. if (this.barTimer) {
  878. clearInterval(this.barTimer);
  879. this.barTimer = null;
  880. }
  881. },
  882. // 原来onUnload里面的内容
  883. originUnload() {
  884. if (this.playSectionId > 0 && this.hasStart) {
  885. //退出提交记录
  886. this.postStudyRecord();
  887. }
  888. //清除正在播放的节ID
  889. // this.$store.commit('setPlayObj',null)
  890. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  891. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  892. this.$store.commit("setPlayVID", { playVID: null });
  893. //移除所有的事件监听器
  894. uni.$off();
  895. this.clearTimer && clearTimeout(this.clearTimer);
  896. this.toastTimer && clearTimeout(this.toastTimer);
  897. if (this.studyTimer) {
  898. clearInterval(this.studyTimer);
  899. this.hasStart = false;
  900. }
  901. this.clearPauseTimer();
  902. this.clearBarTimer();
  903. if (this.lockTimer) {
  904. clearInterval(this.lockTimer);
  905. this.$api
  906. .lockDelLock({
  907. action: "jxjy",
  908. uuid: this.$method.getUuid(),
  909. })
  910. .then((res) => {
  911. uni.hideLoading();
  912. });
  913. }
  914. },
  915. changeCourses() {
  916. this.toggleCourseShow = true;
  917. },
  918. closePop() {
  919. this.toggleCourseShow = false;
  920. },
  921. async activeFunc(item, index) {
  922. this.teacherIndex = index;
  923. let findResult = "";
  924. this.goodsTeacher.forEach((citem, index) => {
  925. citem.courseList.forEach((e, e_index) => {
  926. if (e.courseId == item.courseId) {
  927. findResult = e;
  928. }
  929. });
  930. });
  931. this.jump(findResult, 1);
  932. },
  933. // 进入学习
  934. async jump(item, index, type) {
  935. if (this.courseId === item.courseId) {
  936. this.toggleCourseShow = false;
  937. return;
  938. }
  939. if (this.orderNum == 2 && index != 0) {
  940. let prevItem = this.courseList[index - 1];
  941. if (
  942. prevItem.stuAllNum + prevItem.recordNum <
  943. prevItem.secAllNum + prevItem.examNum
  944. ) {
  945. uni.showToast({
  946. icon: "none",
  947. title: "请按顺序学完上一课再学习这一课",
  948. });
  949. return;
  950. }
  951. }
  952. // 打回 需重修
  953. if (item.rebuild === 0) {
  954. this.$navTo.togo("/pages2/learn/details", {
  955. id: item.courseId,
  956. gradeId: item.gradeId,
  957. goodsId: this.goodsId,
  958. orderGoodsId: this.orderGoodsId,
  959. });
  960. return;
  961. }
  962. if (type) {
  963. this.teacherIndex = 0;
  964. this.goodsTeacher.forEach((citem) => {
  965. if (citem.courseList.some((x) => x.courseId == item.courseId)) {
  966. this.teacherList = citem.teaList;
  967. }
  968. });
  969. }
  970. this.sectionItem = {};
  971. this.toggleCourseShow = false;
  972. this.courseId = item.courseId;
  973. this.originOnShow();
  974. },
  975. async nextCourses(item, type) {
  976. this.vid = "";
  977. this.hasStart = true;
  978. await this.originUnload();
  979. this.courseId = item.courseId;
  980. this.gradeId = item.gradeId;
  981. this.toggleCourseShow = false;
  982. },
  983. clickLeft() {
  984. // uni.navigateBack()
  985. uni.switchTab({
  986. url: "/pages/learn/index",
  987. });
  988. },
  989. toBack(delta = 1) {
  990. uni.navigateBack({
  991. delta,
  992. });
  993. },
  994. markConfirm() {
  995. uni.setClipboardData({
  996. data: this.markContent,
  997. success: () => {
  998. setTimeout(this.toBack, 1000);
  999. },
  1000. });
  1001. },
  1002. closeNotice() {
  1003. this.$api
  1004. .baseHandoutTip({
  1005. orderGoodsId: this.orderGoodsId,
  1006. })
  1007. .then((res) => {});
  1008. },
  1009. noticeConfirm() {
  1010. if (this.CountTo < 0) {
  1011. this.noticeShow = false;
  1012. if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
  1013. this.autoplay = true;
  1014. this.refPlv.resumeVideo();
  1015. }
  1016. }
  1017. },
  1018. baseHandoutTipList() {
  1019. this.$api
  1020. .baseHandoutTipList({
  1021. orderGoodsId: this.orderGoodsId,
  1022. })
  1023. .then((res) => {
  1024. this.handoutTipLength = res.data.rows.length;
  1025. if (res.data.rows.length == 0) {
  1026. this.noticeShow = true;
  1027. if (this.CountTo == 30) {
  1028. var timer = setInterval(() => {
  1029. this.CountTo--;
  1030. if (this.CountTo < 0) {
  1031. clearInterval(timer);
  1032. }
  1033. }, 1000);
  1034. }
  1035. } else {
  1036. this.CountTo = -1;
  1037. }
  1038. });
  1039. },
  1040. /**
  1041. * 获取上次观看的直播
  1042. */
  1043. studyRecordGetLastLive() {
  1044. this.$api
  1045. .studyRecordGetLastLive({
  1046. orderGoodsId: this.orderGoodsId,
  1047. courseId: this.courseId,
  1048. })
  1049. .then((res) => {
  1050. this.updateLiveLast(res.data.data);
  1051. });
  1052. },
  1053. async initPlayVideo(sectionItem) {
  1054. this.moduleId = sectionItem.moduleId;
  1055. this.chapterId = sectionItem.chapterId;
  1056. if (sectionItem.sectionType == 1) {
  1057. //录播
  1058. this.playVideo(sectionItem);
  1059. } else if (sectionItem.sectionType == 2) {
  1060. //直播
  1061. this.studyRecordGetLastLive();
  1062. } else if (sectionItem.sectionType == 3) {
  1063. //回放
  1064. this.playVideo(sectionItem);
  1065. } else if (sectionItem.doType == 2) {
  1066. uni.showModal({
  1067. title: "温馨提示",
  1068. content: "当前节视频已学完,是否进入考试?",
  1069. success: (res) => {
  1070. if (res.confirm) {
  1071. this.toQuestionBank(sectionItem);
  1072. }
  1073. },
  1074. });
  1075. return;
  1076. }
  1077. },
  1078. toQuestionBank(sectionItem) {
  1079. uni.navigateTo({
  1080. url:
  1081. "/pages2/class/questionBank?courseId=" +
  1082. this.courseId +
  1083. "&gradeId=" +
  1084. this.gradeId +
  1085. "&isFromVideo=1&id=" +
  1086. sectionItem.id +
  1087. "&goodsid=" +
  1088. this.goodsId +
  1089. "&moduleId=" +
  1090. (sectionItem.moduleId || 0) +
  1091. "&chapterId=" +
  1092. (sectionItem.chapterId || 0) +
  1093. "&orderGoodsId=" +
  1094. this.orderGoodsId +
  1095. "&type=" +
  1096. (sectionItem.type == 4 ? 1 : 3) +
  1097. "&learning=" +
  1098. sectionItem.studyStatus +
  1099. "&isBackVideo=" +
  1100. 1,
  1101. });
  1102. },
  1103. studyRecordQueryLiveLast() {
  1104. // /study/record/queryLiveLast
  1105. this.$api
  1106. .studyRecordQueryLiveLast({
  1107. gradeId: this.gradeId,
  1108. orderGoodsId: this.orderGoodsId,
  1109. courseId: this.courseId,
  1110. })
  1111. .then((res) => {
  1112. let { data } = res.data;
  1113. if (!data.sectionId) {
  1114. data = this.menuAllList[0];
  1115. }
  1116. // if (data.learning == 1 && this.orderNum == 2) {
  1117. // let next = this.menuAllList.find((e) => e.studyStatus != 1);
  1118. // next && (data = next);
  1119. // }
  1120. this.initPlayVideo(data);
  1121. });
  1122. },
  1123. /**
  1124. * 模块大节播放完毕,刷新列表
  1125. */
  1126. sectionPlayEnd(isRebuild, index) {
  1127. if (this.reMenuList.length > 0) {
  1128. //有重修目录
  1129. if (isRebuild.isRebuild) {
  1130. //从重修点击
  1131. this.$api
  1132. .reMenuList({
  1133. orderGoodsId: this.orderGoodsId,
  1134. courseId: this.courseId,
  1135. rebuild: 1,
  1136. gradeId: this.gradeId,
  1137. })
  1138. .then((res) => {
  1139. if (res.data.code == 200) {
  1140. if (res.data.rows.length) {
  1141. res.data.rows[index].name = res.data.rows[index].menuName;
  1142. this.$set(this.reMenuList, index, res.data.rows[index]);
  1143. for (let i = 0; i < res.data.rows.length; i++) {
  1144. let item = res.data.rows[i];
  1145. item.down = true;
  1146. item.id = item.menuId;
  1147. item.name = item.menuName;
  1148. }
  1149. this.reMenuList = [];
  1150. this.$nextTick(() => {
  1151. this.reMenuList = res.data.rows;
  1152. // console.log(this.reMenuList,'this.reMenuList1')
  1153. });
  1154. } else {
  1155. this.reMenuList = [];
  1156. }
  1157. }
  1158. });
  1159. this.$api
  1160. .reMenuList({
  1161. courseId: this.courseId,
  1162. gradeId: this.gradeId,
  1163. orderGoodsId: this.orderGoodsId,
  1164. })
  1165. .then((res) => {
  1166. if (res.data.code == 200) {
  1167. for (let i = 0; i < res.data.rows.length; i++) {
  1168. let item = res.data.rows[i];
  1169. item.down = true;
  1170. item.id = item.menuId;
  1171. item.name = item.menuName;
  1172. item.menuType = item.type;
  1173. }
  1174. this.menuList = [];
  1175. this.$nextTick(() => {
  1176. this.menuList = res.data.rows;
  1177. });
  1178. }
  1179. });
  1180. } else {
  1181. //从普通目录点击
  1182. this.$api
  1183. .reMenuList({
  1184. courseId: this.courseId,
  1185. gradeId: this.gradeId,
  1186. orderGoodsId: this.orderGoodsId,
  1187. })
  1188. .then((res) => {
  1189. if (res.data.code == 200) {
  1190. res.data.rows[index].name = res.data.rows[index].menuName;
  1191. res.data.rows[index].id = res.data.rows[index].menuId;
  1192. this.$set(this.menuList, index, res.data.rows[index]);
  1193. }
  1194. });
  1195. this.$api
  1196. .reMenuList({
  1197. orderGoodsId: this.orderGoodsId,
  1198. courseId: this.courseId,
  1199. rebuild: 1,
  1200. gradeId: this.gradeId,
  1201. })
  1202. .then((res) => {
  1203. if (res.data.code == 200) {
  1204. if (res.data.rows.length) {
  1205. // for (let i = 0; i < res.data.rows.length; i++) {
  1206. // let item = res.data.rows[i];
  1207. // item.down = true;
  1208. // item.id = item.menuId;
  1209. // item.name = item.menuName;
  1210. // }
  1211. // this.reMenuList = res.data.rows;
  1212. } else {
  1213. this.reMenuList = [];
  1214. }
  1215. }
  1216. });
  1217. }
  1218. } else {
  1219. console.log("--模块大节播放完毕,刷新列表-");
  1220. //没有重修目录
  1221. this.$api
  1222. .reMenuList({
  1223. courseId: this.courseId,
  1224. gradeId: this.gradeId,
  1225. orderGoodsId: this.orderGoodsId,
  1226. })
  1227. .then((res) => {
  1228. if (res.data.code == 200) {
  1229. res.data.rows[index].name = res.data.rows[index].menuName;
  1230. res.data.rows[index].id = res.data.rows[index].menuId;
  1231. this.$set(this.menuList, index, res.data.rows[index]);
  1232. }
  1233. });
  1234. }
  1235. },
  1236. goLive(item) {
  1237. let moduleId = item.moduleId || 0;
  1238. let chapterId = item.chapterId || 0;
  1239. let sectionId = item.sectionId || item.menuId;
  1240. let uuid = new Date().valueOf() + "";
  1241. // buyCourse 是否购买课程:1是 0否
  1242. let encode = encodeURIComponent(
  1243. this.config.hostLive +
  1244. "/pages/live/index?token=" +
  1245. uni.getStorageSync("token") +
  1246. "&userInfo=" +
  1247. JSON.stringify(this.userInfo) +
  1248. "&channelId=" +
  1249. item.liveUrl +
  1250. "&gradeId=" +
  1251. this.gradeId +
  1252. "&courseId=" +
  1253. this.courseId +
  1254. "&goodsId=" +
  1255. this.goodsId +
  1256. "&orderGoodsId=" +
  1257. this.orderGoodsId +
  1258. "&sectionId=" +
  1259. sectionId +
  1260. "&chapterId=" +
  1261. chapterId +
  1262. "&moduleId=" +
  1263. moduleId +
  1264. "&buyCourse=1" +
  1265. "&ident=" +
  1266. uuid
  1267. );
  1268. uni.navigateTo({
  1269. url: `../../pages/webview/index?url=` + encode,
  1270. });
  1271. },
  1272. studyRecordMenuAllList() {
  1273. // study/record/menuAllList
  1274. return this.$api
  1275. .studMenuAllList({
  1276. courseId: this.courseId,
  1277. gradeId: this.gradeId,
  1278. goodsId: this.goodsId,
  1279. orderGoodsId: this.orderGoodsId,
  1280. })
  1281. .then((res) => {
  1282. let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1283. if (res.data.data) {
  1284. this.menuAllList = res.data.data.filter(
  1285. (e) => e.doType != 1 || (e.doType == 2 && e.studyStatus == 1)
  1286. );
  1287. this.livingItem = res.data.data.find(
  1288. (item) =>
  1289. item.liveStartTime <= nowTime && item.liveEndTime > nowTime
  1290. );
  1291. }
  1292. return Promise.resolve();
  1293. });
  1294. },
  1295. async getbaseprofiletplists() {
  1296. let {
  1297. data: { code, rows },
  1298. } = await this.$api.getbaseprofiletplists({
  1299. goodsId: this.goodsId,
  1300. orderGoodsId: this.orderGoodsId,
  1301. });
  1302. if (code === 200 && rows.length && rows[0].keyValue) {
  1303. let baseRes = await this.$api.getbaseprofiletpId(this.goodsId);
  1304. if (baseRes.data.code === 200 && baseRes.data.data) {
  1305. let {
  1306. data: { code, data },
  1307. } = await this.$api.getbaseprofiletpgetInfo({
  1308. goodsId: this.goodsId,
  1309. orderGoodsId: this.orderGoodsId,
  1310. });
  1311. if (
  1312. code === 200 &&
  1313. (!data || (data.status === 3 && data.changeStatus === 1))
  1314. ) {
  1315. uni.showModal({
  1316. content: !data
  1317. ? "请前往填写资料"
  1318. : "资料审核不通过,请前往重新填写",
  1319. cancelText: "返回",
  1320. success: (resultst) => {
  1321. if (resultst.confirm) {
  1322. this.$navTo.togo("/pages2/verify/input", {
  1323. id: this.goodsId,
  1324. orderGoodsId: this.orderGoodsId,
  1325. });
  1326. }
  1327. if (resultst.cancel) {
  1328. uni.navigateBack();
  1329. }
  1330. },
  1331. });
  1332. return Promise.reject();
  1333. } else if (data.status === 1 && JSON.parse(rows[0].keyValue2)[0]) {
  1334. let {
  1335. data: { code, data },
  1336. } = await this.$api.getbaseprofileStampgetInfo({
  1337. goodsId: this.goodsId,
  1338. orderGoodsId: this.orderGoodsId,
  1339. });
  1340. if (
  1341. code === 200 &&
  1342. (!data || (data.status === 3 && data.changeStatus === 1))
  1343. ) {
  1344. uni.showModal({
  1345. content: !data
  1346. ? "请前往填写盖章资料"
  1347. : "资料盖章审核不通过,请前往重新填写",
  1348. cancelText: "返回",
  1349. success: (resultst) => {
  1350. if (resultst.confirm) {
  1351. this.$navTo.togo("/pages2/verify/input2", {
  1352. id: this.goodsId,
  1353. orderGoodsId: this.orderGoodsId,
  1354. });
  1355. }
  1356. if (resultst.cancel) {
  1357. uni.navigateBack();
  1358. }
  1359. },
  1360. });
  1361. return Promise.reject();
  1362. }
  1363. }
  1364. }
  1365. }
  1366. return Promise.resolve();
  1367. },
  1368. async isCanLearn() {
  1369. this.option.isQ !== "" && (await this.qCheckIsCanLearn());
  1370. await this.getbaseprofiletplists();
  1371. await this.getGradeInfo();
  1372. await this.getGoodsDetail();
  1373. },
  1374. /**
  1375. * 计算tabs宽度
  1376. */
  1377. itemWidth() {
  1378. return 100 / this.list.length + "%";
  1379. },
  1380. findMenuNextSection(index) {
  1381. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1382. let item = this.reMenuList[i];
  1383. if (item.type == 3) {
  1384. return item;
  1385. }
  1386. }
  1387. return {};
  1388. },
  1389. loadedmetadata(event) {
  1390. this.refPlv = this.$refs.player;
  1391. this.$refs["camera"].openCamera();
  1392. },
  1393. getPhotoLastRecord() {
  1394. // if (this.erJianErZao || !this.playSecIsLearn || this.photoNum <= 0) {
  1395. // return;
  1396. // }
  1397. let self = this;
  1398. let { chapterId, sectionId, moduleId } = this.sectionItem;
  1399. let data = {
  1400. sectionId: sectionId || 0,
  1401. goodsId: this.goodsId,
  1402. courseId: this.courseId,
  1403. gradeId: this.gradeId,
  1404. chapterId: chapterId || 0,
  1405. moduleId: moduleId || 0,
  1406. orderGoodsId: this.orderGoodsId,
  1407. };
  1408. this.$api.getPhotoLastRecord(data).then((res) => {
  1409. if (res.data.code == 200) {
  1410. //清空历史数据
  1411. this.photoHistoryList = [];
  1412. this.photoList = [];
  1413. for (let i = 0; i < res.data.data.length; i++) {
  1414. //-2存储随机拍照数组
  1415. if (res.data.data[i].photoIndex == -2) {
  1416. this.photoList =
  1417. res.data.data[i].timeInterval &&
  1418. res.data.data[i].timeInterval.split(",");
  1419. } else {
  1420. this.photoHistoryList.push(res.data.data[i].photoIndex);
  1421. }
  1422. }
  1423. }
  1424. });
  1425. },
  1426. //postTime 只提交随机时间
  1427. postCoursePhotoRecord() {
  1428. return new Promise((resolve, reject) => {
  1429. let currentTime = 0;
  1430. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1431. if (polyvPlayerContext) {
  1432. // #ifdef MP-WEIXIN
  1433. currentTime = polyvPlayerContext.getCurrentTime();
  1434. // #endif
  1435. // #ifdef H5
  1436. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  1437. // #endif
  1438. }
  1439. let data = {
  1440. photo: this.ossAvatarUrl,
  1441. sectionId: this.playSectionId,
  1442. goodsId: this.goodsId,
  1443. courseId: this.courseId,
  1444. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1445. gradeId: this.gradeId,
  1446. photoIndex: -2, //从0算起,-2只提交随机时间
  1447. photoNum: this.photoNum,
  1448. chapterId: this.chapterId,
  1449. moduleId: this.moduleId,
  1450. timeInterval: this.photoList.join(","),
  1451. orderGoodsId: this.orderGoodsId,
  1452. };
  1453. // console.log("提交接口", data);
  1454. this.$api
  1455. .coursePhotoRecord(data)
  1456. .then((res) => {
  1457. if (res.data.code == 200) {
  1458. resolve();
  1459. } else {
  1460. reject();
  1461. }
  1462. })
  1463. .catch((err) => {
  1464. reject();
  1465. });
  1466. });
  1467. },
  1468. randomNum(minNum, maxNum) {
  1469. switch (arguments.length) {
  1470. case 1:
  1471. return parseInt(Math.random() * minNum + 1, 10);
  1472. break;
  1473. case 2:
  1474. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1475. break;
  1476. default:
  1477. return 0;
  1478. break;
  1479. }
  1480. },
  1481. //配置随机拍照时间
  1482. configPhoto(duration) {
  1483. if (this.photoConfig) {
  1484. return;
  1485. }
  1486. let totalVideoTime = this.refPlv.getDuration()
  1487. this.photoConfig = true;
  1488. if (this.erJianErZao) {
  1489. this.photoList = this.randomConfig(totalVideoTime, duration);
  1490. return;
  1491. }
  1492. //没有历史拍照间隔数据
  1493. if (!this.photoList || this.photoList.length == 0) {
  1494. this.photoList = this.commonConfig(
  1495. totalVideoTime,
  1496. this.jjShiGongYuan ? 46 * 60 : undefined
  1497. );
  1498. this.postCoursePhotoRecord(); //提交随机拍照时间数组
  1499. }
  1500. },
  1501. // 二建随机拍摄时间
  1502. randomConfig(totalVideoTime, duration) {
  1503. this.photoHistoryList = [];
  1504. let photoList = [duration];
  1505. let pre = duration;
  1506. if (totalVideoTime > 300) {
  1507. while (pre <= totalVideoTime) {
  1508. pre += this.randomNum(780, 900);
  1509. pre <= totalVideoTime && photoList.push(pre);
  1510. }
  1511. if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
  1512. photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
  1513. }
  1514. }
  1515. return photoList;
  1516. },
  1517. // 随机前后五分钟
  1518. commonConfig(totalVideoTime, fixS) {
  1519. console.log("🚀 ~ file: detail.vue:2407 ~ commonConfig ~ fixS:", fixS);
  1520. let photoList = [0];
  1521. // 固定间隔时间取
  1522. if (fixS) {
  1523. let num = Math.ceil(totalVideoTime / fixS);
  1524. for (let i = 1; i < num; i++) {
  1525. photoList.push(i * fixS);
  1526. }
  1527. this.photoNum = num;
  1528. } else {
  1529. if (this.photoNum == 3) {
  1530. if (totalVideoTime >= 900) {
  1531. //大于15分钟
  1532. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1533. let centerMinTime = centerTime - 300; //前后5分钟
  1534. let centerMaxTime = centerTime + 300;
  1535. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1536. photoList.push(centerTakeTime); //中间拍一张
  1537. let endMaxTime = totalVideoTime - 60;
  1538. let endMinTime = totalVideoTime - 300;
  1539. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1540. photoList.push(endTakeTime); //最后拍一张
  1541. } else {
  1542. //小于15分钟
  1543. let centerTime = this.randomNum(
  1544. (1 / 3) * totalVideoTime,
  1545. (2 / 3) * totalVideoTime
  1546. );
  1547. photoList.push(centerTime);
  1548. let endTakeTime = this.randomNum(
  1549. (2 / 3) * totalVideoTime,
  1550. totalVideoTime
  1551. );
  1552. photoList.push(endTakeTime);
  1553. }
  1554. }
  1555. }
  1556. return photoList;
  1557. },
  1558. getLiveUid(channelId) {
  1559. let self = this;
  1560. return new Promise((resolve) => {
  1561. let data = {
  1562. channelId: channelId,
  1563. orderGoodsId: this.orderGoodsId,
  1564. };
  1565. self.$api.polyvSign(data).then((res) => {
  1566. resolve(res.data.data);
  1567. });
  1568. });
  1569. },
  1570. studyNotice() {
  1571. this.noticeShow = true;
  1572. },
  1573. //正常播放视频
  1574. async playVideo(item) {
  1575. this.sectionItem = item;
  1576. let { learning, videoCurrentTime, sectionId, recordingUrl } = item;
  1577. console.log(this.sectionItem, "this.sectionItem");
  1578. if (this.timer) {
  1579. clearInterval(this.timer);
  1580. }
  1581. this.recordObj = videoCurrentTime
  1582. ? { videoCurrentTime }
  1583. : await this.getRecordLast(item);
  1584. await this.getPhotoLastRecord();
  1585. // 查找拍照历史
  1586. if ((this.photoNum > 0 || this.jjShiGongYuan) && learning != 1) {
  1587. await this.getPhotoLastRecord();
  1588. }
  1589. this.$store.commit("setPlayVID", {
  1590. playVID: recordingUrl,
  1591. });
  1592. this.$store.commit("setPlaySectionId", {
  1593. playSectionId: sectionId,
  1594. });
  1595. this.startStatus = true;
  1596. if (this.refPlv) {
  1597. this.refPlv.changeVid({
  1598. vid: recordingUrl,
  1599. videoCurrentTime: this.recordObj.videoCurrentTime,
  1600. });
  1601. }
  1602. },
  1603. getRecordLast(sectionItem) {
  1604. let { chapterId, sectionId, courseId, moduleId } = sectionItem;
  1605. return new Promise((resolve) => {
  1606. let data = {
  1607. gradeId:
  1608. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  1609. goodsId:
  1610. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  1611. sectionId: sectionId || 0,
  1612. courseId: courseId || courseId == 0 ? Number(courseId) : null,
  1613. chapterId: chapterId || 0,
  1614. moduleId: moduleId || 0,
  1615. orderGoodsId: this.orderGoodsId,
  1616. };
  1617. this.$api.recordLast(data).then((res) => {
  1618. resolve(res.data.data);
  1619. });
  1620. });
  1621. },
  1622. jumpNote(item) {
  1623. this.$u.toast("即将跳到笔记位置");
  1624. if (this.playSectionId != item.sectionId) {
  1625. this.initPlayVideo({
  1626. sectionType: 1,
  1627. ...item,
  1628. videoCurrentTime: Number(item.noteSecond),
  1629. });
  1630. } else {
  1631. this.refPlv.seekVideo(item.noteSecond);
  1632. }
  1633. },
  1634. getGradeInfo() {
  1635. // 即刻 1 待定2 日期3
  1636. return this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  1637. if (res.data.code == 200) {
  1638. let { data } = res.data;
  1639. if (
  1640. data.learningStatus == 2 ||
  1641. (data.learningStatus == 3 &&
  1642. Number(data.learningTimeStart) > Number(new Date() / 1000))
  1643. ) {
  1644. uni.showModal({
  1645. showCancel: false,
  1646. confirmText: "确定",
  1647. content:
  1648. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1649. success: function (resultst) {
  1650. uni.navigateBack();
  1651. },
  1652. });
  1653. return Promise.reject(123);
  1654. }
  1655. }
  1656. });
  1657. },
  1658. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1659. if (!this.refPlv) {
  1660. return;
  1661. }
  1662. let currentTime = this.refPlv.playCurrentTime();
  1663. let PlayDuration = this.refPlv.playVideoTime();
  1664. if (currentTime < 10 && !this.ossAvatarUrl) {
  1665. return;
  1666. }
  1667. if (this.playChannelId > 0) {
  1668. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1669. }
  1670. let self = this;
  1671. let data = {
  1672. fromPlat: 1, //来源平台 1小程序 2网站
  1673. photo: self.ossAvatarUrl,
  1674. sectionId: sectionId || 0,
  1675. goodsId: parseInt(self.goodsId),
  1676. courseId: parseInt(self.courseId),
  1677. orderGoodsId: this.orderGoodsId,
  1678. studyDuration: parseInt(
  1679. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1680. ),
  1681. gradeId: parseInt(self.gradeId),
  1682. chapterId: this.chapterId || 0,
  1683. moduleId: this.moduleId || 0,
  1684. videoCurrentTime: parseInt(
  1685. currentTime > 0 ? currentTime : self.studyDuration
  1686. ),
  1687. erJianErZao: this.erJianErZao,
  1688. };
  1689. if (this.ossAvatarUrl) {
  1690. data.similarity = this.compareFaceData; // 相似度
  1691. }
  1692. if (status > 0) {
  1693. data.status = status;
  1694. }
  1695. console.log(data, "记录参数");
  1696. return new Promise((resolve, reject) => {
  1697. this.$api
  1698. .studyRecord(data)
  1699. .then((res) => {
  1700. console.log(res, "记录返回");
  1701. let { code, msg } = res.data;
  1702. if (code == 200) {
  1703. if (status > 0) {
  1704. this.studyRecordMenuAllList();
  1705. let moduleId = this.moduleId || 0;
  1706. let chapterId = this.chapterId || 0;
  1707. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1708. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1709. uni.$emit("playNext" + playNextIdisRebuild, {
  1710. fromRebuild: this.isRebuild,
  1711. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1712. uni.$emit("playNext" + playNextId); //通知播放结束
  1713. }
  1714. self.ossAvatarUrl = "";
  1715. } else if (code == 600) {
  1716. uni.showModal({
  1717. showCancel: false,
  1718. title: "提示",
  1719. content: msg,
  1720. success: (resultst) => {
  1721. uni.navigateBack();
  1722. },
  1723. });
  1724. } else if (code == 558) {
  1725. this.CountTo1 = msg.split(",")[1];
  1726. this.noticeShow1 = true;
  1727. var timer = setInterval(() => {
  1728. this.CountTo1--;
  1729. if (this.CountTo1 < 0) {
  1730. this.noticeShow1 = false;
  1731. clearInterval(timer);
  1732. this.postStudyRecord(1);
  1733. }
  1734. }, 1000);
  1735. reject("中断执行");
  1736. } else {
  1737. this.uploadLock = false;
  1738. uni.showToast({
  1739. icon: "none",
  1740. title: res.data.msg,
  1741. duration: 2000,
  1742. });
  1743. if (this.erJianErZao && code == 559) {
  1744. this.isReach = true;
  1745. this.openPhoto();
  1746. }
  1747. if (code == 559 || code == 588) {
  1748. reject("中断执行");
  1749. }
  1750. }
  1751. resolve();
  1752. })
  1753. .catch((err) => {
  1754. this.studyRecordMenuAllList();
  1755. });
  1756. });
  1757. },
  1758. uploadFile(options, int) {
  1759. var self = this;
  1760. return new Promise((resolve, reject) => {
  1761. var data = {
  1762. imageStatus: int,
  1763. gradeId: this.gradeId,
  1764. orderGoodsId: this.orderGoodsId,
  1765. };
  1766. self.$api.aliyunpolicy(data).then((res) => {
  1767. if (res.data.code != 200) {
  1768. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1769. return;
  1770. }
  1771. var ossToken = res.data.data.resultContent;
  1772. if (ossToken.host == null || ossToken.host == undefined) {
  1773. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1774. return;
  1775. }
  1776. let filePath = "";
  1777. // #ifdef H5
  1778. var localData = options; //dataUrl为base64位
  1779. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  1780. let length = base.length;
  1781. let url = new Uint8Array(length);
  1782. while (length--) {
  1783. url[length] = base.charCodeAt(length);
  1784. }
  1785. filePath = new File([url], "a.jpg", {
  1786. type: "image/jpg",
  1787. });
  1788. uni.uploadFile({
  1789. url: ossToken.host,
  1790. name: "file",
  1791. file: filePath,
  1792. fileType: "image",
  1793. header: {
  1794. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1795. },
  1796. formData: {
  1797. key: ossToken.dir,
  1798. OSSAccessKeyId: ossToken.accessid,
  1799. policy: ossToken.policy,
  1800. Signature: ossToken.signature,
  1801. callback: ossToken.callback,
  1802. success_action_status: 200,
  1803. },
  1804. success: (result) => {
  1805. this.$u.toast("上传成功");
  1806. self.ossAvatarUrl = ossToken.dir;
  1807. resolve(ossToken.dir);
  1808. },
  1809. fail: (error) => {
  1810. uni.showToast({
  1811. title: "上传接口报错,请重新拍照上传" + error,
  1812. icon: "none",
  1813. });
  1814. this.openPhoto();
  1815. return;
  1816. },
  1817. });
  1818. // #endif
  1819. // #ifdef MP-WEIXIN
  1820. uni.uploadFile({
  1821. url: ossToken.host,
  1822. name: "file",
  1823. filePath: options,
  1824. fileType: "image",
  1825. header: {
  1826. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1827. },
  1828. formData: {
  1829. key: ossToken.dir,
  1830. OSSAccessKeyId: ossToken.accessid,
  1831. policy: ossToken.policy,
  1832. Signature: ossToken.signature,
  1833. callback: ossToken.callback,
  1834. success_action_status: 200,
  1835. },
  1836. success: (result) => {
  1837. // if (result.statusCode === 200) {
  1838. this.$u.toast("上传成功");
  1839. self.ossAvatarUrl = ossToken.dir;
  1840. resolve(ossToken.dir);
  1841. },
  1842. fail: (error) => {
  1843. uni.showToast({
  1844. title: "上传接口报错,请重新拍照上传" + error,
  1845. icon: "none",
  1846. });
  1847. this.openPhoto();
  1848. return;
  1849. },
  1850. });
  1851. // #endif
  1852. });
  1853. });
  1854. },
  1855. imageInfos() {
  1856. var self = this;
  1857. return new Promise(async (resolve, reject) => {
  1858. let resPath = await myCompressImage(this.avatarUrl || this.faceUrl, 50);
  1859. const waitUpload = await self.uploadFile(resPath, 0);
  1860. resolve(waitUpload);
  1861. });
  1862. },
  1863. timeEvent(time) {
  1864. this.clearPauseTimer();
  1865. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  1866. this.configPhoto(time);
  1867. this.isReach = false;
  1868. const index = this.photoList.findIndex(
  1869. (e) => e.photoTime < time && e.photoTime > time - 8
  1870. );
  1871. if (index != -1 && !this.photoHistoryList[index]) {
  1872. // 拍照
  1873. this.openCamera();
  1874. }
  1875. }
  1876. },
  1877. closeToast() {
  1878. clearTimeout(this.toastTimer);
  1879. this.videoToastShow = false;
  1880. },
  1881. // 新增用户视频学习日志
  1882. studyLog() {
  1883. this.$http({
  1884. url: "/user/study/log",
  1885. method: "post",
  1886. data: {
  1887. goodsId: this.goodsId,
  1888. courseId: this.courseId,
  1889. moduleId: this.moduleId || 0,
  1890. chapterId: this.chapterId || 0,
  1891. sectionId: this.playSectionId || 0,
  1892. fromPlat: 1, //来源平台 1小程序 2PC网站
  1893. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  1894. orderGoodsId: this.orderGoodsId,
  1895. },
  1896. }).then((res) => {});
  1897. },
  1898. timeupdate(time) {
  1899. // console.log("播放中", time);
  1900. this.clearPauseTimer();
  1901. this.timeEvent(time);
  1902. },
  1903. playing() {
  1904. console.log("playing");
  1905. if (this.noticeShow) {
  1906. this.refPlv.playPause();
  1907. return;
  1908. }
  1909. // this.$refs["camera"].openCamera();
  1910. this.studyLog();
  1911. if (!this.recordObj.videoCurrentTime) {
  1912. this.postStudyRecord(0);
  1913. }
  1914. this.studyTimer && clearInterval(this.studyTimer);
  1915. this.studyTimer = setInterval(() => {
  1916. this.postStudyRecord(0);
  1917. }, 15000);
  1918. },
  1919. openCamera() {
  1920. this.$refs["camera"].openCamera();
  1921. },
  1922. pause() {
  1923. this.erJianErZaoPauseTip();
  1924. clearInterval(this.timer);
  1925. clearInterval(this.studyTimer);
  1926. },
  1927. async ended() {
  1928. this.hasStart = false;
  1929. uni.showToast({
  1930. icon: "none",
  1931. title: "播放完毕",
  1932. });
  1933. clearInterval(this.timer);
  1934. clearInterval(this.studyTimer);
  1935. await this.postStudyRecord(1);
  1936. this.nextSection();
  1937. },
  1938. playerError() {
  1939. console.log(46546);
  1940. },
  1941. //播放下一节
  1942. nextSection() {
  1943. console.log("播放下一节");
  1944. if (!this.menuAllList.length) {
  1945. return;
  1946. }
  1947. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  1948. let i_sectionId = item.sectionId || 0;
  1949. let i_chapterId = item.chapterId || 0;
  1950. let i_moduleId = item.moduleId || 0;
  1951. return (
  1952. i_sectionId == this.playSectionId &&
  1953. i_chapterId == this.chapterId &&
  1954. i_moduleId == this.moduleId
  1955. );
  1956. });
  1957. let data = this.menuAllList[this.curPlayIndex + 1];
  1958. if (!data) {
  1959. //第二个弹窗
  1960. uni.showModal({
  1961. title: "温馨提示",
  1962. content:
  1963. "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
  1964. showCancel: !this.erJianErZao,
  1965. success: (res) => {
  1966. if (res.confirm) {
  1967. uni.switchTab({
  1968. url: "/pages/learn/index",
  1969. });
  1970. }
  1971. },
  1972. });
  1973. } else {
  1974. if (data.doType == 2) {
  1975. if (data.studyStatus == 1) {
  1976. uni.showToast({
  1977. title: "试卷已合格!",
  1978. duration: 2000,
  1979. icon: "none",
  1980. });
  1981. return;
  1982. }
  1983. uni.showModal({
  1984. title: "温馨提示",
  1985. content: "当前节视频已学完,是否进入考试?",
  1986. success: (res) => {
  1987. if (res.confirm) {
  1988. this.toQuestionBank(data);
  1989. }
  1990. },
  1991. });
  1992. return;
  1993. }
  1994. uni.showModal({
  1995. title: "温馨提示",
  1996. content: "当前节视频已学完,继续学习下一节?",
  1997. success: async (res) => {
  1998. if (res.confirm) {
  1999. this.moduleId = data.moduleId;
  2000. this.chapterId = data.chapterId;
  2001. this.sectionId = data.sectionId;
  2002. if (data.sectionType == 1) {
  2003. //录播
  2004. this.$store.commit("setPlaySectionId", {
  2005. playSectionId: data.sectionId,
  2006. });
  2007. this.$store.commit("setPlayVID", {
  2008. playVID: data.recordingUrl,
  2009. });
  2010. this.hasStart = false;
  2011. this.photoConfig = false;
  2012. this.sectionItem = data;
  2013. this.playVideo(data);
  2014. } else if (data.sectionType == 2) {
  2015. //直播
  2016. this.studyRecordGetLastLive();
  2017. } else if (data.sectionType == 3) {
  2018. //回放
  2019. this.$store.commit("setPlaySectionId", {
  2020. playSectionId: data.sectionId,
  2021. });
  2022. this.$store.commit("setPlayVID", {
  2023. playVID: data.recordingUrl,
  2024. });
  2025. this.sectionItem = data;
  2026. this.playVideo(data);
  2027. }
  2028. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  2029. this.$store.commit("updatePlayNextId", playNextId);
  2030. this.updateChapterOpen(true);
  2031. }
  2032. },
  2033. });
  2034. }
  2035. },
  2036. playError(e) {
  2037. console.log(e);
  2038. },
  2039. //拍照报错
  2040. error(e) {
  2041. console.log(e.detail);
  2042. },
  2043. //关闭相机
  2044. closePhoto() {
  2045. this.photoPopup = false;
  2046. this.enableAutoRotation = true;
  2047. },
  2048. async userConfirmInfoDetail() {
  2049. let info = await this.$api.userConfirmInfoDetail({
  2050. orderGoodsId: this.orderGoodsId,
  2051. });
  2052. if (!info.data.data || info.data.data.pushInfo !== 1) {
  2053. uni.showModal({
  2054. showCancel: false,
  2055. title: "提示",
  2056. content: "开通信息推送不成功,无法进入学习!",
  2057. success: (resultst) => {
  2058. uni.navigateBack();
  2059. },
  2060. });
  2061. return Promise.reject();
  2062. }
  2063. },
  2064. checkFinishRequiredCourse() {
  2065. return this.$api
  2066. .checkFinishRequiredCourse({
  2067. businessId: this.goodsData.businessId,
  2068. goodsId: this.goodsId,
  2069. })
  2070. .then((res) => {
  2071. if (res.data.data > 0) {
  2072. uni.showModal({
  2073. showCancel: false,
  2074. confirmText: "确定",
  2075. content: "该业务层次下有未学完的商品,无法学习新商品!",
  2076. success: function (resultst) {
  2077. uni.navigateBack();
  2078. },
  2079. });
  2080. return Promise.reject();
  2081. }
  2082. return Promise.resolve();
  2083. });
  2084. },
  2085. async getGoodsDetail() {
  2086. let { data } = await this.$api.goodsDetail(this.goodsId);
  2087. this.goodsData = data.data;
  2088. this.erJianErZao = this.goodsData.erJianErZao;
  2089. this.erJianErZao && (await this.userConfirmInfoDetail());
  2090. this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
  2091. this.goodsData.buyNote && this.baseHandoutTipList();
  2092. this.gradeId = this.goodsData.gradeId;
  2093. if (this.goodsData.goodsPlayConfig) {
  2094. this.goodsPlayConfig = JSON.parse(this.goodsData.goodsPlayConfig);
  2095. if (this.goodsPlayConfig.autoPlay > 0) {
  2096. this.autoplay = true;
  2097. }
  2098. if (this.goodsPlayConfig.drag > 0 && !this.erJianErZao) {
  2099. // #ifdef MP-WEIXIN
  2100. this.isAllowSeek = "yes";
  2101. // #endif
  2102. // #ifdef H5
  2103. this.isAllowSeek = "off";
  2104. // #endif
  2105. }
  2106. if (this.goodsPlayConfig.speed > 0) {
  2107. this.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2108. }
  2109. }
  2110. if (this.goodsData.goodsPhotographConfig) {
  2111. this.goodsPhotographConfig = JSON.parse(
  2112. this.goodsData.goodsPhotographConfig
  2113. );
  2114. if (this.goodsPhotographConfig.photoNum > 0) {
  2115. this.photoNum = this.goodsPhotographConfig.photoNum;
  2116. }
  2117. }
  2118. },
  2119. getReMenuList() {
  2120. let self = this;
  2121. this.$api
  2122. .reMenuList({
  2123. orderGoodsId: this.orderGoodsId,
  2124. courseId: this.courseId,
  2125. rebuild: 1,
  2126. gradeId: this.gradeId,
  2127. })
  2128. .then((res) => {
  2129. if (res.data.code == 200) {
  2130. for (let i = 0; i < res.data.rows.length; i++) {
  2131. let item = res.data.rows[i];
  2132. item.down = true;
  2133. item.id = item.menuId;
  2134. item.name = item.menuName;
  2135. }
  2136. self.reMenuList = res.data.rows;
  2137. this.current = 0;
  2138. if (self.reMenuList.length > 0) {
  2139. this.showNotes = false;
  2140. if (Object.keys(this.sectionItem).length) {
  2141. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  2142. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  2143. }
  2144. } else {
  2145. if (Object.keys(this.sectionItem).length) {
  2146. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  2147. this.$store.commit("updatePlayNextId", playNextId);
  2148. }
  2149. }
  2150. }
  2151. });
  2152. },
  2153. courseDetail() {
  2154. this.$api.courseDetail(this.courseId).then((res) => {
  2155. if (res.data.code == 200) {
  2156. this.detail = res.data.data;
  2157. }
  2158. });
  2159. },
  2160. open(item) {
  2161. item.showChildren = !item.showChildren;
  2162. },
  2163. change(index) {
  2164. this.current = index;
  2165. },
  2166. clears() {
  2167. return new Promise((resolve, reject) => {
  2168. this.vid = "";
  2169. polyvPlayerContext && polyvPlayerContext.destroy();
  2170. polyvPlayerContext = null;
  2171. resolve();
  2172. });
  2173. },
  2174. /**
  2175. * 退出全屏
  2176. */
  2177. exitFullscreen() {
  2178. try {
  2179. var de = document;
  2180. if (de.exitFullscreen) {
  2181. de.exitFullscreen();
  2182. } else if (de.mozCancelFullScreen) {
  2183. de.mozCancelFullScreen();
  2184. } else if (de.webkitCancelFullScreen) {
  2185. de.webkitCancelFullScreen();
  2186. }
  2187. } catch (err) {}
  2188. },
  2189. fullele() {
  2190. return (
  2191. document.fullscreenElement ||
  2192. document.webkitFullscreenElement ||
  2193. document.msFullscreenElement ||
  2194. document.mozFullScreenElement ||
  2195. null
  2196. );
  2197. },
  2198. },
  2199. };
  2200. </script>
  2201. <style lang="scss" scope>
  2202. @import "./css/detail.scss";
  2203. .top {
  2204. &__header {
  2205. position: relative;
  2206. width: 100%;
  2207. height: 150rpx;
  2208. padding: 24rpx 150rpx 24rpx 24rpx;
  2209. .img {
  2210. position: absolute;
  2211. left: 0;
  2212. top: 0;
  2213. width: 100%;
  2214. }
  2215. .note {
  2216. position: relative;
  2217. z-index: 10;
  2218. font-size: 24rpx;
  2219. font-family: PingFang SC;
  2220. font-weight: bold;
  2221. color: #efdbff;
  2222. }
  2223. .title {
  2224. position: relative;
  2225. z-index: 10;
  2226. font-size: 26rpx;
  2227. font-family: PingFang SC;
  2228. font-weight: bold;
  2229. color: #ffffff;
  2230. }
  2231. }
  2232. }
  2233. #top {
  2234. position: relative;
  2235. z-index: 99;
  2236. }
  2237. .polyv_detail {
  2238. display: flex;
  2239. flex-direction: column;
  2240. height: 100vh;
  2241. position: relative;
  2242. top: 0;
  2243. left: 0;
  2244. .pops {
  2245. position: absolute;
  2246. top: 0;
  2247. left: 0;
  2248. background: #ccc;
  2249. opacity: 0.5;
  2250. width: 100%;
  2251. height: 300rpx;
  2252. z-index: 9999;
  2253. }
  2254. .box {
  2255. flex: 1;
  2256. overflow: hidden;
  2257. margin: 16rpx 16rpx 100rpx 16rpx;
  2258. .box_in {
  2259. height: 100%;
  2260. }
  2261. }
  2262. .first_ml {
  2263. margin: 16rpx 16rpx 16rpx 16rpx;
  2264. }
  2265. }
  2266. .btnSet {
  2267. width: 440rpx;
  2268. height: 80rpx;
  2269. background: #007aff;
  2270. border-radius: 40rpx;
  2271. color: #ffffff;
  2272. font-size: 28rpx;
  2273. line-height: 80rpx;
  2274. }
  2275. .lecture-content {
  2276. background: #fff;
  2277. margin-top: 10rpx;
  2278. padding: 10rpx;
  2279. border-radius: 16rpx;
  2280. }
  2281. .tBox {
  2282. display: flex;
  2283. align-items: center;
  2284. padding-top: 10rpx;
  2285. }
  2286. .title {
  2287. font-size: 24rpx;
  2288. color: #999999;
  2289. }
  2290. .t_content1 {
  2291. color: #007aff;
  2292. margin-left: 10rpx;
  2293. }
  2294. .tag1 {
  2295. border: 2rpx solid #007aff;
  2296. border-radius: 8rpx;
  2297. font-size: 20rpx;
  2298. color: #007aff;
  2299. padding: 5rpx;
  2300. }
  2301. .b_title {
  2302. color: #333333;
  2303. font-size: 30rpx;
  2304. font-weight: bold;
  2305. }
  2306. page {
  2307. background: #eaeef1;
  2308. }
  2309. .menuBox {
  2310. width: 100%;
  2311. background: #ffffff;
  2312. border-radius: 16rpx;
  2313. padding: 0rpx 20rpx;
  2314. margin-bottom: 20rpx;
  2315. }
  2316. .btnspric {
  2317. border-top: 1rpx solid #eee;
  2318. display: flex;
  2319. align-items: center;
  2320. justify-content: space-between;
  2321. height: 108rpx;
  2322. padding-left: 43rpx;
  2323. padding-right: 32rpx;
  2324. }
  2325. .btnspric > .lefprL {
  2326. font-size: 36rpx;
  2327. color: #0c141f;
  2328. font-weight: bold;
  2329. }
  2330. .btnspric > .lefprR {
  2331. padding: 0rpx 24rpx;
  2332. height: 60rpx;
  2333. line-height: 60rpx;
  2334. text-align: center;
  2335. color: #fff;
  2336. background: #32467b;
  2337. border-radius: 24rpx;
  2338. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2339. }
  2340. .yhj,
  2341. .hdyhj {
  2342. padding: 24rpx 29rpx 24rpx 34rpx;
  2343. }
  2344. .yhj {
  2345. border-bottom: 16rpx solid #f9f9f9;
  2346. }
  2347. .yhjtit {
  2348. font-size: 30rpx;
  2349. color: #0c141f;
  2350. font-weight: 500;
  2351. margin-bottom: 14rpx;
  2352. }
  2353. .yhjList {
  2354. display: flex;
  2355. align-items: center;
  2356. justify-content: space-between;
  2357. margin-bottom: 14rpx;
  2358. }
  2359. .yhjList > .yhjLefts {
  2360. display: flex;
  2361. align-items: center;
  2362. }
  2363. .yhjLefts > .yhl {
  2364. color: #32467b;
  2365. font-size: 30rpx;
  2366. margin-right: 31rpx;
  2367. }
  2368. .yhjLefts > .yhbq {
  2369. font-size: 24rpx;
  2370. color: #ff9500;
  2371. border-radius: 18rpx;
  2372. background-color: rgba(255, 149, 0, 0.2);
  2373. border: 2rpx solid #ff9500;
  2374. height: 38rpx;
  2375. line-height: 38rpx;
  2376. padding: 0rpx 16rpx;
  2377. }
  2378. .ts {
  2379. font-size: 24rpx;
  2380. color: #999;
  2381. margin: 14rpx 0rpx;
  2382. padding-right: 29rpx;
  2383. padding-left: 34rpx;
  2384. }
  2385. .yh {
  2386. padding-top: 20rpx;
  2387. }
  2388. .yh > .yhtitle {
  2389. display: flex;
  2390. align-items: center;
  2391. justify-content: space-between;
  2392. padding-right: 29rpx;
  2393. padding-left: 34rpx;
  2394. }
  2395. .priceBxs {
  2396. display: flex;
  2397. align-items: center;
  2398. }
  2399. .priceBxs > .pricleft {
  2400. border-radius: 24rpx;
  2401. border: 1rpx solid #e91313;
  2402. background-color: rgba(233, 19, 19, 0.1);
  2403. padding: 0rpx 18rpx;
  2404. height: 49rpx;
  2405. line-height: 49rpx;
  2406. text-align: center;
  2407. font-size: 30rpx;
  2408. font-weight: 500;
  2409. color: #e91313;
  2410. margin-right: 13rpx;
  2411. }
  2412. .topBox {
  2413. padding: 32rpx 32rpx 24rpx;
  2414. border-bottom: 1rpx solid #eeeeee;
  2415. }
  2416. .topBox > .boldFonstType {
  2417. font-weight: 500;
  2418. font-size: 30rpx;
  2419. margin: 16rpx 0rpx 23rpx;
  2420. }
  2421. .topBox > .firstTopL {
  2422. display: flex;
  2423. align-items: center;
  2424. }
  2425. .topBox > .firstTopL > .imageBs {
  2426. width: 331rpx;
  2427. height: 160rpx;
  2428. border-radius: 6rpx;
  2429. overflow: hidden;
  2430. margin-right: 8rpx;
  2431. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2432. }
  2433. .topBox > .firstTopL > .imageBs > image {
  2434. width: 100%;
  2435. height: 100%;
  2436. }
  2437. .topBox > .firstTopL > .textBs {
  2438. font-size: 30rpx;
  2439. font-weight: bold;
  2440. color: #0c141f;
  2441. }
  2442. .content {
  2443. padding: 24rpx;
  2444. text-align: left;
  2445. }
  2446. .catalogBox {
  2447. display: flex;
  2448. align-items: center;
  2449. flex-wrap: nowrap;
  2450. overflow-x: auto;
  2451. padding-left: 38rpx;
  2452. max-height: 305rpx;
  2453. overflow-y: auto;
  2454. transition: all 0.4s;
  2455. }
  2456. .catalogBox > .catalogA {
  2457. min-width: 200rpx;
  2458. height: 48rpx;
  2459. line-height: 48rpx;
  2460. // text-align: center;
  2461. border: 2rpx solid transparent;
  2462. white-space: nowrap;
  2463. text-overflow: ellipsis;
  2464. overflow: hidden;
  2465. word-break: break-all;
  2466. border-radius: 10rpx;
  2467. background: rgba(22, 119, 255, 0.05);
  2468. padding-left: 19rpx;
  2469. box-sizing: border-box;
  2470. padding-right: 15rpx;
  2471. margin-right: 16rpx;
  2472. margin-bottom: 20rpx;
  2473. margin-top: 15rpx;
  2474. font-size: 24rpx;
  2475. color: #666;
  2476. }
  2477. .catalogBox > .activesq {
  2478. border-color: #1677ff;
  2479. }
  2480. .changeCatalogBox {
  2481. display: block;
  2482. }
  2483. .catalogBox::-webkit-scrollbar {
  2484. display: none; /* Chrome Safari */
  2485. }
  2486. .price_t2 {
  2487. font-size: 18rpx;
  2488. font-family: PingFang SC;
  2489. font-weight: 500;
  2490. text-decoration: line-through;
  2491. color: #999999;
  2492. }
  2493. .price_t1 {
  2494. font-size: 33rpx;
  2495. font-family: PingFang SC;
  2496. font-weight: bold;
  2497. color: #e91313;
  2498. }
  2499. .sc_t {
  2500. font-size: 22rpx;
  2501. color: #000000;
  2502. }
  2503. .sc {
  2504. width: 29rpx;
  2505. height: 29rpx;
  2506. }
  2507. .buy {
  2508. width: 138rpx;
  2509. height: 48rpx;
  2510. line-height: 48rpx;
  2511. background: #32467b;
  2512. border-radius: 10rpx;
  2513. color: #ffffff;
  2514. font-size: 28rpx;
  2515. text-align: center;
  2516. vertical-align: middle;
  2517. position: absolute;
  2518. right: 30rpx;
  2519. }
  2520. .video_body {
  2521. padding-bottom: 96rpx;
  2522. }
  2523. .footer_tab {
  2524. position: fixed;
  2525. bottom: 0;
  2526. height: 96rpx;
  2527. width: 100%;
  2528. background-color: #ffffff;
  2529. }
  2530. .tj_box {
  2531. width: 50%;
  2532. display: inline-block;
  2533. text-align: center;
  2534. margin: 10rpx 0;
  2535. }
  2536. .teacher_t {
  2537. font-size: 24rpx;
  2538. font-family: PingFang SC;
  2539. font-weight: 400;
  2540. color: #666666;
  2541. line-height: 36rpx;
  2542. margin-left: 15rpx;
  2543. }
  2544. .teacher_img {
  2545. width: 87rpx;
  2546. height: 129rpx;
  2547. }
  2548. .t2 {
  2549. font-size: 24rpx;
  2550. font-family: PingFang SC;
  2551. color: #666666;
  2552. line-height: 36rpx;
  2553. margin: 15rpx;
  2554. }
  2555. .r_t2 {
  2556. width: 201rpx;
  2557. height: 49rpx;
  2558. background: rgba(22, 119, 255, 0.05);
  2559. border: 1rpx solid #32467b;
  2560. border-radius: 16rpx;
  2561. color: #666666;
  2562. font-size: 23rpx;
  2563. text-align: center;
  2564. display: flex;
  2565. align-items: center;
  2566. padding: 5rpx;
  2567. }
  2568. .scroll_box {
  2569. width: 100%;
  2570. height: 60rpx;
  2571. background: #ffffff;
  2572. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2573. white-space: nowrap;
  2574. overflow: hidden;
  2575. margin: 15rpx 0;
  2576. }
  2577. .r_sliper {
  2578. padding: 0 20rpx;
  2579. }
  2580. .top_line {
  2581. width: 6rpx;
  2582. height: 22rpx;
  2583. background: #32467b;
  2584. margin-right: 10rpx;
  2585. }
  2586. .video_t2 {
  2587. font-size: 24rpx;
  2588. font-family: PingFang SC;
  2589. font-weight: 500;
  2590. color: #666666;
  2591. }
  2592. .video_play {
  2593. position: absolute;
  2594. width: 95rpx;
  2595. height: 95rpx;
  2596. top: 0;
  2597. left: 0;
  2598. right: 0;
  2599. bottom: 0;
  2600. margin: auto;
  2601. }
  2602. .video_box {
  2603. position: relative;
  2604. }
  2605. .rotoct {
  2606. transform: rotate(90deg);
  2607. }
  2608. .slot-content {
  2609. padding: 0 20rpx;
  2610. }
  2611. .notice_modal {
  2612. .content {
  2613. width: 100%;
  2614. height: 100%;
  2615. padding: 56rpx 56rpx 56rpx 64rpx;
  2616. .title {
  2617. color: #222;
  2618. line-height: 40rpx;
  2619. font-size: 36rpx;
  2620. text-align: center;
  2621. font-weight: bold;
  2622. margin-bottom: 24rpx;
  2623. }
  2624. .text {
  2625. height: 340rpx;
  2626. line-height: 40rpx;
  2627. text-indent: 2em;
  2628. font-size: 32rpx;
  2629. color: #222;
  2630. }
  2631. .had_read {
  2632. width: 100%;
  2633. height: 88rpx;
  2634. line-height: 88rpx;
  2635. text-align: center;
  2636. background: #3577e8;
  2637. border-radius: 240rpx;
  2638. font-size: 32rpx;
  2639. font-weight: 500;
  2640. color: #fff;
  2641. margin-top: 20rpx;
  2642. &.gray {
  2643. background: #bbbec5;
  2644. }
  2645. }
  2646. }
  2647. }
  2648. .full_mulu {
  2649. position: absolute;
  2650. top: 100rpx;
  2651. right: 20rpx;
  2652. width: 700rpx;
  2653. height: 515rpx;
  2654. color: #333;
  2655. display: flex;
  2656. align-items: center;
  2657. justify-content: space-between;
  2658. z-index: 99999;
  2659. .mulus {
  2660. width: 623rpx;
  2661. // height: 515rpx;
  2662. height: 400rpx;
  2663. overflow-y: scroll;
  2664. // overflow: scroll;
  2665. }
  2666. .mulu_box_in {
  2667. background-color: #b7b7b7;
  2668. border-radius: 16rpx;
  2669. // transition: all 0.5s;
  2670. &::after {
  2671. content: "";
  2672. width: 0;
  2673. height: 0;
  2674. position: absolute;
  2675. top: 235rpx;
  2676. right: 27px;
  2677. border-top: 16rpx solid transparent;
  2678. border-right: 16rpx solid transparent;
  2679. border-left: 16rpx solid #b7b7b7;
  2680. border-bottom: 16rpx solid transparent;
  2681. }
  2682. }
  2683. .mulu_box_out {
  2684. // visibility: hidden;
  2685. display: none;
  2686. }
  2687. .menuBox_mulu {
  2688. // width: 100%;
  2689. background: #ffffff;
  2690. border-radius: 16rpx;
  2691. padding: 0rpx 20rpx;
  2692. margin-bottom: 20rpx;
  2693. }
  2694. .ml_img {
  2695. position: absolute;
  2696. right: 0;
  2697. top: 100rpx;
  2698. }
  2699. .items {
  2700. width: 620rpx;
  2701. height: 100rpx;
  2702. border: 1rpx solid red;
  2703. }
  2704. }
  2705. </style>