detail.vue 84 KB

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