detail.vue 85 KB

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