detail.vue 76 KB

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