detail.vue 84 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870
  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. if (res.data.code == 200) {
  1115. resolve();
  1116. } else {
  1117. reject();
  1118. }
  1119. })
  1120. .catch((err) => {
  1121. reject();
  1122. });
  1123. });
  1124. },
  1125. randomNum(minNum, maxNum) {
  1126. switch (arguments.length) {
  1127. case 1:
  1128. return parseInt(Math.random() * minNum + 1, 10);
  1129. break;
  1130. case 2:
  1131. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1132. break;
  1133. default:
  1134. return 0;
  1135. break;
  1136. }
  1137. },
  1138. //配置随机拍照时间
  1139. configPhoto() {
  1140. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1141. let totalVideoTime = polyvPlayerContext.getDuration();
  1142. let duration = polyvPlayerContext.getCurrentTime();
  1143. let photoNum = this.photoNum;
  1144. if (!this.photoConfig) {
  1145. this.photoConfig = true;
  1146. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1147. // if(spaceTime<5){//区间小于5秒
  1148. // photoNum = Math.floor(totalVideoTime/5)
  1149. // spaceTime = 5
  1150. // }
  1151. // if(photoNum<1){
  1152. // photoNum = 1 //只要设置,至少拍一次
  1153. // spaceTime = totalVideoTime
  1154. // }
  1155. // let initSpace = 0
  1156. //没有历史拍照间隔数据
  1157. if (this.photoList.length == 0) {
  1158. if (totalVideoTime >= 900) {
  1159. //大于15分钟
  1160. if (photoNum == 1) {
  1161. //开头拍1张
  1162. this.photoList.push(1);
  1163. } else if (photoNum == 3) {
  1164. //拍3张
  1165. this.photoList.push(1); //开头拍一张
  1166. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1167. let centerMinTime = centerTime - 300; //前后5分钟
  1168. let centerMaxTime = centerTime + 300;
  1169. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1170. this.photoList.push(centerTakeTime); //中间拍一张
  1171. let endMaxTime = totalVideoTime - 60;
  1172. let endMinTime = totalVideoTime - 300;
  1173. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1174. this.photoList.push(endTakeTime); //最后拍一张
  1175. }
  1176. } else {
  1177. //小于15分钟,只拍前后各一张
  1178. if (photoNum == 1) {
  1179. //开头拍1张
  1180. this.photoList.push(1);
  1181. } else if (photoNum == 3) {
  1182. //拍2张
  1183. if (totalVideoTime <= 300) {
  1184. //小于5分钟
  1185. this.photoList.push(1); //开头拍一张
  1186. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1187. this.photoList.push(endTakeTime);
  1188. } else {
  1189. this.photoList.push(1); //开头拍一张
  1190. let endMaxTime = totalVideoTime - 60;
  1191. let endMinTime = totalVideoTime - 300;
  1192. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1193. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1194. }
  1195. }
  1196. }
  1197. // for(let i=0;i<photoNum;i++){
  1198. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1199. // if(s>totalVideoTime){
  1200. // s = totalVideoTime-1
  1201. // }
  1202. // if(s<=5){
  1203. // s =5 //避免出现5秒内拍照时间
  1204. // }
  1205. // this.photoList.push(s)
  1206. // initSpace+=spaceTime
  1207. // }
  1208. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1209. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1210. }
  1211. console.log(this.photoList, "随机拍照时间数组");
  1212. //兼容已有观看历史
  1213. for (let i = 0; i < this.photoList.length - 1; i++) {
  1214. if (
  1215. this.photoList[i] < duration &&
  1216. this.photoList[i + 1] > duration
  1217. ) {
  1218. this.photoIndex = i + 1;
  1219. // console.log("我的修改了photoIndex")
  1220. break;
  1221. }
  1222. if (duration > this.photoList[this.photoList.length - 1]) {
  1223. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1224. // console.log("我的修改了photoIndex")
  1225. break;
  1226. }
  1227. }
  1228. }
  1229. },
  1230. getLiveUid(channelId) {
  1231. let self = this;
  1232. return new Promise((resolve) => {
  1233. let data = {
  1234. channelId: channelId,
  1235. orderGoodsId: this.orderGoodsId,
  1236. };
  1237. self.$api.polyvSign(data).then((res) => {
  1238. resolve(res.data.data);
  1239. });
  1240. });
  1241. },
  1242. timeEventLiving() {
  1243. if (plv != null) {
  1244. if (this.livePlay) {
  1245. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1246. if (this.liveDuration == 2) {
  1247. //直播第2秒拍照
  1248. if (
  1249. this.goodsPhotographConfig.livephotograph == 1 &&
  1250. this.channelItem.learning != 1
  1251. ) {
  1252. //开启直播拍照
  1253. this.openPhoto();
  1254. }
  1255. }
  1256. }
  1257. }
  1258. },
  1259. playerLiveStatusChange(e) {
  1260. const status = e.detail.status;
  1261. console.log("直播状态", status);
  1262. if (status === "live") {
  1263. console.log("开始直播");
  1264. //开始播放
  1265. if (this.timer) {
  1266. clearInterval(this.timer);
  1267. }
  1268. this.livePlay = true;
  1269. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1270. }
  1271. if (status === "end") {
  1272. if (this.livePlay) {
  1273. //只有播放过的结束才提交,避免未开播触发结束
  1274. this.postStudyRecord(1);
  1275. }
  1276. console.log("结束直播");
  1277. this.livePlay = false;
  1278. // 未开始
  1279. }
  1280. },
  1281. closePlv() {
  1282. if (plv) {
  1283. plv.destroy();
  1284. }
  1285. },
  1286. playChannel(item) {
  1287. if (this.timer) {
  1288. clearInterval(this.timer);
  1289. }
  1290. this.startStatus = true;
  1291. this.initLive();
  1292. },
  1293. setLiveOption(status) {
  1294. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  1295. this.detail;
  1296. const playRecordFile =
  1297. playbackEnabled && recordFileSimpleModel && status === "end";
  1298. this.videoOption = {
  1299. mode: "live",
  1300. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1301. cid: this.playChannelId,
  1302. openId: this.userInfo.userAccount,
  1303. isAutoChange: false,
  1304. forceVideo: false,
  1305. };
  1306. },
  1307. async initLive() {
  1308. console.log(this.playChannelId, 7111);
  1309. this.liveObj = await this.getLiveUid(this.playChannelId);
  1310. this.initLiveOk = true;
  1311. let optionsData = {};
  1312. optionsData.mode = "live";
  1313. optionsData.forceVideo = false;
  1314. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  1315. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  1316. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  1317. let self = this;
  1318. this.closePlv();
  1319. plv.init(optionsData).then(({ detail, chat }) => {
  1320. self.liveDetail = detail;
  1321. // 设置mode为live的videoOption
  1322. this.setLiveOption();
  1323. if (detail.isPPT) {
  1324. chat.on(chat.events.SLICESTART, () => {
  1325. // 开始直播
  1326. });
  1327. } else {
  1328. plv.api.getOrdinaryLiveStatus(detail.stream);
  1329. }
  1330. });
  1331. },
  1332. openSetting(res) {
  1333. console.log(res, 98);
  1334. },
  1335. getCameraSetting() {
  1336. const self = this;
  1337. wx.getSetting({
  1338. success: (res) => {
  1339. if (res.authSetting["scope.camera"]) {
  1340. // 用户已经授权
  1341. self.showSet = false;
  1342. } else {
  1343. // 用户还没有授权,向用户发起授权请求
  1344. wx.authorize({
  1345. scope: "scope.camera",
  1346. success() {
  1347. // 用户同意授权
  1348. self.showSet = false;
  1349. },
  1350. fail() {
  1351. // 用户不同意授权
  1352. self.showSet = true;
  1353. /* wx.showToast({
  1354. title: '摄像头授权失败',
  1355. icon: 'none',
  1356. duration: 3000
  1357. }) */
  1358. },
  1359. });
  1360. }
  1361. },
  1362. fail: (res) => {},
  1363. });
  1364. },
  1365. studyNotice() {
  1366. this.noticeShow = true;
  1367. },
  1368. //播放笔记视频
  1369. async playNoteVideo(item) {
  1370. console.log(item, "noteItem");
  1371. if (this.timer) {
  1372. clearInterval(this.timer);
  1373. }
  1374. if (this.vid) {
  1375. //切换视频
  1376. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1377. polyvPlayerContext.changeVid(item.recordingUrl);
  1378. } else {
  1379. this.vid = item.recordingUrl;
  1380. }
  1381. this.recordObj = { videoCurrentTime: item.noteSecond };
  1382. if (this.recordObj.videoCurrentTime) {
  1383. this.needSeek = true; //需要跳转到播放记录
  1384. }
  1385. this.startStatus = true;
  1386. //获取节笔记
  1387. this.getNoteList();
  1388. },
  1389. //正常播放视频
  1390. async playVideo(item) {
  1391. console.log(item);
  1392. if (this.timer) {
  1393. clearInterval(this.timer);
  1394. }
  1395. if (this.vid) {
  1396. //切换视频
  1397. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1398. polyvPlayerContext.changeVid(item.recordingUrl);
  1399. } else {
  1400. this.vid = item.recordingUrl;
  1401. }
  1402. this.recordObj = null;
  1403. this.recordObj = await this.getRecordLast();
  1404. this.needSeek = true; //跳转到播放记录
  1405. this.startStatus = true;
  1406. //获取节笔记
  1407. this.getNoteList();
  1408. },
  1409. getRecordLast() {
  1410. let self = this;
  1411. return new Promise((resolve) => {
  1412. let data = {
  1413. gradeId: Number(self.gradeId),
  1414. goodsId: Number(self.goodsId),
  1415. sectionId: Number(self.playSectionId),
  1416. courseId: Number(self.courseId),
  1417. chapterId: parseInt(self.chapterId),
  1418. moduleId: parseInt(self.moduleId),
  1419. orderGoodsId: this.orderGoodsId,
  1420. };
  1421. self.$api.recordLast(data).then((res) => {
  1422. resolve(res.data.data);
  1423. });
  1424. });
  1425. },
  1426. jumpNote(item) {
  1427. this.noteId = item.noteId;
  1428. //没视频播放
  1429. if (this.playSectionId == 0) {
  1430. console.log("即将跳到笔记位置1");
  1431. this.$u.toast("即将跳到笔记位置");
  1432. this.$store.commit("setPlaySectionId", {
  1433. playSectionId: item.sectionId,
  1434. });
  1435. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1436. this.playNoteVideo(item);
  1437. } else {
  1438. //正在看当前笔记视频
  1439. console.log("即将跳到笔记位置2");
  1440. this.$u.toast("即将跳到笔记位置");
  1441. //跳到笔记时刻
  1442. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1443. polyvPlayerContext.seek(item.noteSecond);
  1444. polyvPlayerContext.play();
  1445. }
  1446. },
  1447. postNote() {
  1448. let self = this;
  1449. if (!(this.playSectionId > 0)) {
  1450. this.$u.toast("目前无播放视频");
  1451. return;
  1452. }
  1453. if (!this.noteValue) {
  1454. this.$u.toast("请输入内容");
  1455. return;
  1456. }
  1457. if (!this.gradeId) {
  1458. this.$u.toast("暂无班级数据");
  1459. return;
  1460. }
  1461. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1462. let noteDate = this.$method.getZeroTime();
  1463. let noteSecond = polyvPlayerContext.getCurrentTime();
  1464. console.log(noteSecond, 698);
  1465. if (!noteSecond) {
  1466. if (noteSecond == 0) {
  1467. //播放结束
  1468. noteSecond = polyvPlayerContext.getDuration();
  1469. console.log(noteSecond, 63398);
  1470. }
  1471. if (!noteSecond) {
  1472. this.$u.toast("视频暂未开始");
  1473. return;
  1474. }
  1475. }
  1476. let data = {
  1477. gradeId: this.gradeId,
  1478. goodsId: this.goodsId,
  1479. sectionId: this.playSectionId,
  1480. courseId: this.courseId,
  1481. noteText: this.noteValue,
  1482. noteDate: noteDate,
  1483. noteSecond: noteSecond,
  1484. orderGoodsId: this.orderGoodsId,
  1485. };
  1486. this.$api.postNote(data).then((res) => {
  1487. if (res.data.code == 200) {
  1488. this.$u.toast("发布成功");
  1489. self.getNoteList();
  1490. this.noteValue = "";
  1491. }
  1492. });
  1493. },
  1494. getGradeInfo() {
  1495. let self = this;
  1496. this.$store.state.allowLoading = false;
  1497. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  1498. if (res.data.code == 200) {
  1499. self.gradeDetail = res.data.data;
  1500. if (self.needProfileModal) {
  1501. return;
  1502. }
  1503. if (self.gradeDetail.learningStatus == 2) {
  1504. uni.showModal({
  1505. showCancel: false,
  1506. confirmText: "确定",
  1507. content:
  1508. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1509. success: function (resultst) {
  1510. uni.navigateBack();
  1511. },
  1512. });
  1513. }
  1514. if (
  1515. self.gradeDetail.learningStatus == 3 &&
  1516. Number(self.gradeDetail.learningTimeStart) >
  1517. Number(new Date() / 1000)
  1518. ) {
  1519. uni.showModal({
  1520. showCancel: false,
  1521. cancelText: "返回",
  1522. content:
  1523. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1524. success: function (resultst) {
  1525. uni.navigateBack();
  1526. },
  1527. });
  1528. }
  1529. }
  1530. });
  1531. this.$store.state.allowLoading = true;
  1532. },
  1533. getNoteList() {
  1534. let self = this;
  1535. self.noteList = [];
  1536. let data = {
  1537. courseId: this.courseId,
  1538. gradeId: this.gradeId,
  1539. goodsId: this.goodsId,
  1540. orderGoodsId: this.orderGoodsId,
  1541. };
  1542. if (this.playSectionId > 0) {
  1543. data.sectionId = this.playSectionId;
  1544. }
  1545. this.$api.noteList(data).then((res) => {
  1546. if (res.data.code == 200) {
  1547. self.noteList = res.data.rows;
  1548. }
  1549. });
  1550. },
  1551. delAnswer(answerId) {
  1552. let self = this;
  1553. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  1554. this.$api.delAnswer(data).then((res) => {
  1555. if (res.data.code == 200) {
  1556. self.getAnswerList();
  1557. }
  1558. });
  1559. },
  1560. clearCtx() {
  1561. console.log(4234);
  1562. this.placeholder = "您可以在这里输入答疑内容";
  1563. this.ctxValue = "";
  1564. this.assignUserId = 0;
  1565. },
  1566. replyContent(item) {
  1567. this.assignUserId = item.userId;
  1568. this.placeholder = "@" + item.realname;
  1569. },
  1570. delContent(item) {
  1571. this.delAnswer(item.answerId);
  1572. },
  1573. postAnswer() {
  1574. let self = this;
  1575. let data = {
  1576. courseId: this.courseId,
  1577. answerText: this.ctxValue,
  1578. goodsId: this.goodsId,
  1579. orderGoodsId: this.orderGoodsId,
  1580. };
  1581. if (this.assignUserId > 0) {
  1582. data.assignUserId = this.assignUserId;
  1583. }
  1584. this.$api.postAnswer(data).then((res) => {
  1585. if (res.data.code == 200) {
  1586. this.$u.toast("发布成功");
  1587. self.getAnswerList();
  1588. this.placeholder = "您可以在这里输入答疑内容";
  1589. this.ctxValue = "";
  1590. this.assignUserId = 0;
  1591. }
  1592. });
  1593. },
  1594. postContent() {
  1595. if (!this.ctxValue || this.ctxValue == "") {
  1596. this.$u.toast("请输入内容");
  1597. return;
  1598. }
  1599. this.postAnswer();
  1600. },
  1601. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1602. console.log("status", status);
  1603. let currentTime = 0;
  1604. let PlayDuration = 0;
  1605. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1606. if (polyvPlayerContext) {
  1607. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  1608. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  1609. }
  1610. if (this.playChannelId > 0) {
  1611. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1612. }
  1613. let self = this;
  1614. let data = {
  1615. photo: self.ossAvatarUrl,
  1616. sectionId: parseInt(sectionId),
  1617. goodsId: parseInt(self.goodsId),
  1618. courseId: parseInt(self.courseId),
  1619. orderGoodsId: this.orderGoodsId,
  1620. studyDuration: parseInt(
  1621. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1622. ),
  1623. gradeId: parseInt(self.gradeId),
  1624. chapterId: parseInt(self.chapterId),
  1625. moduleId: parseInt(self.moduleId),
  1626. videoCurrentTime: parseInt(
  1627. currentTime > 0 ? currentTime : self.studyDuration
  1628. ),
  1629. };
  1630. if (status > 0) {
  1631. console.log(sectionId, "sectionId");
  1632. data.status = status;
  1633. }
  1634. console.log("提交接口", data);
  1635. this.$api.studyRecord(data).then((res) => {
  1636. if (res.data.code == 200) {
  1637. if (status > 0) {
  1638. let moduleId = this.moduleId || 0;
  1639. let chapterId = this.chapterId || 0;
  1640. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1641. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1642. console.log(playNextId, "playNextId");
  1643. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  1644. uni.$emit("playNext" + playNextIdisRebuild, {
  1645. fromRebuild: this.isRebuild,
  1646. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1647. uni.$emit("playNext" + playNextId); //通知播放结束
  1648. }
  1649. self.ossAvatarUrl = "";
  1650. } else {
  1651. this.uploadLock = false;
  1652. uni.showToast({
  1653. icon: "none",
  1654. title: res.data.msg,
  1655. });
  1656. }
  1657. console.log(res, "res");
  1658. });
  1659. },
  1660. uploadFile(options, int) {
  1661. console.log(options)
  1662. var self = this;
  1663. return new Promise((resolve, reject) => {
  1664. var data = {
  1665. imageStatus: int,
  1666. gradeId: this.gradeId,
  1667. orderGoodsId: this.orderGoodsId,
  1668. };
  1669. self.$api.aliyunpolicy(data).then((res) => {
  1670. if (res.data.code != 200) {
  1671. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1672. return;
  1673. }
  1674. var ossToken = res.data.data.resultContent;
  1675. if (ossToken.host == null || ossToken.host == undefined) {
  1676. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1677. return;
  1678. }
  1679. uni.uploadFile({
  1680. url: ossToken.host,
  1681. name: "file",
  1682. filePath: options,
  1683. fileType: "image",
  1684. header: {
  1685. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1686. },
  1687. formData: {
  1688. key: ossToken.dir,
  1689. OSSAccessKeyId: ossToken.accessid,
  1690. policy: ossToken.policy,
  1691. Signature: ossToken.signature,
  1692. callback: ossToken.callback,
  1693. success_action_status: 200,
  1694. },
  1695. success: (result) => {
  1696. if (result.statusCode === 200) {
  1697. self.ossAvatarUrl = ossToken.dir;
  1698. resolve();
  1699. } else {
  1700. uni.showToast({
  1701. title: "上传失败",
  1702. icon: "none",
  1703. });
  1704. this.openPhoto();
  1705. return;
  1706. }
  1707. },
  1708. fail: (error) => {
  1709. uni.showToast({
  1710. title: "上传接口报错,请重新拍照上传" + error,
  1711. icon: "none",
  1712. });
  1713. this.openPhoto();
  1714. return;
  1715. },
  1716. });
  1717. });
  1718. });
  1719. },
  1720. imageInfos() {
  1721. var self = this;
  1722. return new Promise((resolve, reject) => {
  1723. uni.getImageInfo({
  1724. src: self.avatarUrl,
  1725. success: async (res) => {
  1726. let canvasWidth = res.width; //图片原始长宽
  1727. let canvasHeight = res.height;
  1728. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1729. uni.compressImage({
  1730. src: self.avatarUrl,
  1731. quality: 75,
  1732. width: "35%",
  1733. height: "35%",
  1734. success: async (rest) => {
  1735. const waitUpload = await self.uploadFile(
  1736. rest.tempFilePath,
  1737. 0
  1738. );
  1739. resolve(waitUpload);
  1740. },
  1741. });
  1742. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1743. uni.compressImage({
  1744. src: self.avatarUrl,
  1745. quality: 75,
  1746. width: "50%",
  1747. height: "50%",
  1748. success: async (rest) => {
  1749. const waitUpload = await self.uploadFile(
  1750. rest.tempFilePath,
  1751. 0
  1752. );
  1753. resolve(waitUpload);
  1754. },
  1755. });
  1756. } else {
  1757. console.log("无需压缩");
  1758. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  1759. resolve(waitUpload);
  1760. }
  1761. },
  1762. });
  1763. });
  1764. },
  1765. timeEvent() {
  1766. let self = this;
  1767. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1768. if (polyvPlayerContext != null) {
  1769. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  1770. // console.log(this.playTime,789,this.photoHistoryList)
  1771. //判断是否需要拍照
  1772. if (this.photoNum > 0) {
  1773. this.configPhoto();
  1774. let photoTime = 0; //获取拍照秒数
  1775. for (let i = 0; i < this.photoList.length; i++) {
  1776. photoTime = Number(this.photoList[i]); //获取拍照秒数
  1777. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  1778. //3秒区间内才触发拍照,避免拉动滚动条
  1779. if (
  1780. this.photoHistoryList.indexOf(i) < 0 &&
  1781. this.sectionItem.learning != 1
  1782. ) {
  1783. //不存在拍照历史,没有重修过,没有学过,则拍照
  1784. //启动拍照
  1785. //暂停
  1786. polyvPlayerContext.exitFullScreen();
  1787. polyvPlayerContext.pause();
  1788. this.photoIndex = i;
  1789. this.openPhoto();
  1790. }
  1791. }
  1792. }
  1793. }
  1794. }
  1795. },
  1796. closeToast() {
  1797. clearTimeout(this.toastTimer);
  1798. this.videoToastShow = false;
  1799. },
  1800. restart() {
  1801. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1802. polyvPlayerContext.seek(0);
  1803. console.log("seek1");
  1804. clearTimeout(this.toastTimer);
  1805. this.videoToastShow = false;
  1806. },
  1807. onStateChange(newstate, oldstate) {
  1808. if (newstate.detail.newstate == "playing") {
  1809. if (this.needSeek) {
  1810. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1811. if (this.recordObj.videoCurrentTime) {
  1812. console.log("seek2");
  1813. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  1814. this.seekTime = this.$method.secondToDate(
  1815. this.recordObj.videoCurrentTime
  1816. );
  1817. this.videoToastShow = true;
  1818. this.toastTimer = setTimeout(() => {
  1819. this.videoToastShow = false;
  1820. }, 3000);
  1821. } else {
  1822. polyvPlayerContext.seek(1); //避免相同节继续播放
  1823. console.log("seek3");
  1824. }
  1825. polyvPlayerContext.play();
  1826. this.needSeek = false;
  1827. }
  1828. //开始播放
  1829. if (this.timer) {
  1830. clearInterval(this.timer);
  1831. }
  1832. this.timer = setInterval(this.timeEvent, 1000); //定时器
  1833. }
  1834. if (newstate.detail.newstate == "pause") {
  1835. clearInterval(this.timer);
  1836. //暂停提交记录
  1837. /* this.ossAvatarUrl = ""
  1838. this.postStudyRecord() */
  1839. }
  1840. if (newstate.detail.newstate == "ended") {
  1841. clearInterval(this.timer);
  1842. uni.showToast({
  1843. icon: "none",
  1844. title: "播放完毕",
  1845. });
  1846. this.postStudyRecord(1);
  1847. // uni.$emit('playNext') //播放重修下一节
  1848. }
  1849. },
  1850. //拍照
  1851. openPhoto() {
  1852. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1853. if (polyvPlayerContext) {
  1854. polyvPlayerContext.exitFullScreen();
  1855. }
  1856. this.enableAutoRotation = false;
  1857. this.photoPopup = true;
  1858. this.isTaking = true;
  1859. uni.setKeepScreenOn({
  1860. keepScreenOn: true,
  1861. });
  1862. uni.authorize({
  1863. scope: "scope.camera",
  1864. success() {},
  1865. });
  1866. },
  1867. /**
  1868. * 人脸匹配
  1869. */
  1870. faceRecognition() {
  1871. return new Promise((resolve) => {
  1872. let fileSystem = uni.getFileSystemManager();
  1873. fileSystem.readFile({
  1874. filePath: `${this.avatarUrl}`,
  1875. encoding: "base64",
  1876. position: 0,
  1877. success: (res) => {
  1878. console.log(res);
  1879. let base64 = "data:image/jpg;base64," + res.data;
  1880. console.log({
  1881. imageA: base64,
  1882. orderGoodsId: this.orderGoodsId,
  1883. gradeId: this.gradeId,
  1884. },'base64Data')
  1885. this.$api
  1886. .faceCertificationCompareFace({
  1887. imageA: base64,
  1888. orderGoodsId: this.orderGoodsId,
  1889. gradeId: this.gradeId,
  1890. })
  1891. .then((res) => {
  1892. console.log(res, "res");
  1893. resolve(res.data.data);
  1894. });
  1895. },
  1896. fail(err) {
  1897. console.error(err, "err");
  1898. },
  1899. });
  1900. });
  1901. },
  1902. async submit() {
  1903. if (this.uploadLock) {
  1904. return;
  1905. }
  1906. this.uploadLock = true;
  1907. let compareFaceData = await this.faceRecognition();
  1908. if (compareFaceData >= 80) {
  1909. const waitYS = await this.imageInfos();
  1910. this.postCoursePhotoRecord()
  1911. .then((res) => {
  1912. this.photoHistoryList.push(this.photoIndex);
  1913. this.postStudyRecord(); //提交记录
  1914. //恢复播放
  1915. uni.setKeepScreenOn({
  1916. keepScreenOn: false,
  1917. });
  1918. this.photoPopup = false;
  1919. this.uploadLock = false;
  1920. this.enableAutoRotation = true;
  1921. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1922. if (polyvPlayerContext != null) {
  1923. polyvPlayerContext.play();
  1924. }
  1925. })
  1926. .catch((err) => {
  1927. uni.showToast({
  1928. title: "上传接口报错,请重新拍照上传" + err,
  1929. icon: "none",
  1930. });
  1931. this.uploadLock = false;
  1932. this.openPhoto();
  1933. });
  1934. } else {
  1935. uni.showToast({
  1936. title: "人脸匹配不通过,请重新拍照上传",
  1937. icon: "none",
  1938. duration: 2000,
  1939. });
  1940. setTimeout(() => {
  1941. this.uploadLock = false;
  1942. this.openPhoto();
  1943. }, 2000);
  1944. return;
  1945. }
  1946. },
  1947. reTake() {
  1948. this.isTaking = true;
  1949. },
  1950. //确认拍照
  1951. takePhoto() {
  1952. var self = this;
  1953. const ctx = uni.createCameraContext();
  1954. ctx.takePhoto({
  1955. quality: "high",
  1956. success: (res) => {
  1957. console.log(res.tempImagePath);
  1958. self.avatarUrl = res.tempImagePath;
  1959. this.isTaking = false;
  1960. // self.submit();
  1961. // self.photoPopup = false;
  1962. // self.enableAutoRotation = true;
  1963. },
  1964. fail: (err) => {
  1965. console.log(err);
  1966. },
  1967. });
  1968. },
  1969. playError(e) {
  1970. console.log(e);
  1971. },
  1972. //拍照报错
  1973. error(e) {
  1974. console.log(e.detail);
  1975. },
  1976. //关闭相机
  1977. closePhoto() {
  1978. this.photoPopup = false;
  1979. self.enableAutoRotation = true;
  1980. },
  1981. /**
  1982. * 进入全屏
  1983. */
  1984. fullscreenchange(event) {
  1985. console.log(event);
  1986. if (event.detail.direction == "vertical") {
  1987. this.navShow = true;
  1988. } else if (event.detail.direction == "horizontal") {
  1989. this.navShow = false;
  1990. }
  1991. },
  1992. getGoodsDetail() {
  1993. let self = this;
  1994. this.$api.goodsDetail(this.goodsId).then((res) => {
  1995. self.goodsData = res.data.data;
  1996. self.gradeId = self.goodsData.gradeId;
  1997. console.log(self.gradeId, "班级ID");
  1998. this.courseBusiness();
  1999. this.courseHandouts();
  2000. self.getMenuList();
  2001. self.getReMenuList(); //获取重修目录
  2002. setTimeout(function () {
  2003. if (!self.needProfileModal) {
  2004. self.getGradeInfo();
  2005. }
  2006. }, 500);
  2007. //获取节笔记
  2008. this.getNoteList();
  2009. if (self.goodsData.goodsPlayConfig) {
  2010. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2011. if (self.goodsPlayConfig.autoPlay > 0) {
  2012. self.autoplay = true;
  2013. }
  2014. if (self.goodsPlayConfig.drag > 0) {
  2015. self.isAllowSeek = "yes";
  2016. }
  2017. if (self.goodsPlayConfig.speed > 0) {
  2018. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2019. }
  2020. }
  2021. if (self.goodsData.goodsPhotographConfig) {
  2022. self.goodsPhotographConfig = JSON.parse(
  2023. self.goodsData.goodsPhotographConfig
  2024. );
  2025. if (self.goodsPhotographConfig.photoNum > 0) {
  2026. self.photoNum = self.goodsPhotographConfig.photoNum;
  2027. console.log(self.photoNum, 777777);
  2028. }
  2029. }
  2030. });
  2031. },
  2032. startVideo() {
  2033. this.startStatus = true;
  2034. },
  2035. getAnswerList() {
  2036. let self = this;
  2037. this.$api
  2038. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2039. .then((res) => {
  2040. if (res.data.code == 200) {
  2041. self.answerList = res.data.rows;
  2042. }
  2043. });
  2044. },
  2045. getReMenuList() {
  2046. let self = this;
  2047. this.$api
  2048. .reMenuList({
  2049. orderGoodsId: this.orderGoodsId,
  2050. courseId: this.courseId,
  2051. rebuild: 1,
  2052. gradeId: this.gradeId,
  2053. })
  2054. .then((res) => {
  2055. if (res.data.code == 200) {
  2056. for (let i = 0; i < res.data.rows.length; i++) {
  2057. let item = res.data.rows[i];
  2058. item.down = true;
  2059. item.id = item.menuId;
  2060. item.name = item.menuName;
  2061. }
  2062. self.reMenuList = res.data.rows;
  2063. if (self.reMenuList.length > 0) {
  2064. this.showNotes = false;
  2065. self.list = [
  2066. {
  2067. name: "目录",
  2068. },
  2069. {
  2070. name: "讲义",
  2071. },
  2072. {
  2073. name: "笔记",
  2074. },
  2075. {
  2076. name: "答疑",
  2077. },
  2078. { name: "重修目录" },
  2079. ];
  2080. this.current = 0;
  2081. } else {
  2082. self.list = [
  2083. {
  2084. name: "目录",
  2085. },
  2086. {
  2087. name: "讲义",
  2088. },
  2089. {
  2090. name: "笔记",
  2091. },
  2092. {
  2093. name: "答疑",
  2094. },
  2095. ];
  2096. this.current = 0;
  2097. }
  2098. }
  2099. });
  2100. },
  2101. getMenuList() {
  2102. let self = this;
  2103. this.$api
  2104. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2105. .then((res) => {
  2106. if (res.data.code == 200) {
  2107. for (let i = 0; i < res.data.rows.length; i++) {
  2108. let item = res.data.rows[i];
  2109. item.down = true;
  2110. item.id = item.menuId;
  2111. item.name = item.menuName;
  2112. item.menuType = item.type;
  2113. }
  2114. self.menuList = res.data.rows;
  2115. for (let i = 0; i < res.data.rows.length; i++) {
  2116. if (res.data.rows[i].type == 1) {
  2117. this.menuIndex = [i];
  2118. break;
  2119. } else if (res.data.rows[i].type == 2) {
  2120. this.menuIndex = [i];
  2121. break;
  2122. }
  2123. }
  2124. }
  2125. });
  2126. },
  2127. courseDetail() {
  2128. let self = this;
  2129. this.$api.courseDetail(this.courseId).then((res) => {
  2130. if (res.data.code == 200) {
  2131. if (res.data.data.educationName == "继续教育") {
  2132. this.$api
  2133. .lockLockAction({
  2134. action: "jxjy",
  2135. })
  2136. .then((res) => {});
  2137. this.lockTimer = setInterval(() => {
  2138. this.$api
  2139. .lockLockAction({
  2140. action: "jxjy",
  2141. })
  2142. .then((res) => {});
  2143. }, 10000);
  2144. // websocket.sendMsg("doCourse");
  2145. }
  2146. self.detail = res.data.data;
  2147. }
  2148. });
  2149. },
  2150. open(item) {
  2151. item.showChildren = !item.showChildren;
  2152. },
  2153. change(index) {
  2154. this.current = index;
  2155. },
  2156. openDocument() {
  2157. let self = this;
  2158. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2159. console.log(url);
  2160. uni.downloadFile({
  2161. url: url,
  2162. success: function (res) {
  2163. console.log(999);
  2164. var filePath = res.tempFilePath;
  2165. uni.openDocument({
  2166. filePath: filePath,
  2167. showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
  2168. success: function (res) {
  2169. console.log(res, "打开文档成功");
  2170. },
  2171. fail: function (err) {
  2172. console.log(err);
  2173. uni.showToast({
  2174. icon: "none",
  2175. title: "文档地址错误",
  2176. });
  2177. },
  2178. });
  2179. },
  2180. fail: (err) => {
  2181. uni.showModal({
  2182. title: "提示",
  2183. content: "文档错误," + err.errMsg,
  2184. showCancel: false,
  2185. });
  2186. },
  2187. });
  2188. },
  2189. },
  2190. };
  2191. </script>
  2192. <style lang="scss" scope>
  2193. .polyv_detail {
  2194. display: flex;
  2195. flex-direction: column;
  2196. height: 100vh;
  2197. .box {
  2198. flex: 1;
  2199. overflow: hidden;
  2200. margin: 20rpx;
  2201. .box_in {
  2202. height: 100%;
  2203. }
  2204. }
  2205. }
  2206. .btnSet {
  2207. width: 440rpx;
  2208. height: 80rpx;
  2209. background: #007aff;
  2210. border-radius: 40rpx;
  2211. color: #ffffff;
  2212. font-size: 28rpx;
  2213. line-height: 80rpx;
  2214. }
  2215. .btnReply {
  2216. width: 80rpx;
  2217. height: 40rpx;
  2218. background: #e3f0ff;
  2219. border-radius: 16rpx;
  2220. text-align: center;
  2221. color: #007aff;
  2222. }
  2223. .btnDel {
  2224. width: 80rpx;
  2225. height: 40rpx;
  2226. background: #ffedf0;
  2227. border-radius: 16rpx;
  2228. text-align: center;
  2229. color: #ff2d55;
  2230. }
  2231. .btnReply {
  2232. width: 80rpx;
  2233. height: 40rpx;
  2234. background: #e3f0ff;
  2235. border-radius: 16rpx;
  2236. font-size: 24rpx;
  2237. }
  2238. .lecture-box {
  2239. display: flex;
  2240. align-items: center;
  2241. height: 80rpx;
  2242. background: #ffffff;
  2243. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2244. .title {
  2245. padding: 10rpx;
  2246. flex: 1;
  2247. overflow: hidden;
  2248. text-overflow: ellipsis;
  2249. white-space: nowrap;
  2250. color: #333;
  2251. font-weight: bold;
  2252. font-size: 32rpx;
  2253. }
  2254. .btn {
  2255. display: flex;
  2256. align-items: center;
  2257. justify-content: center;
  2258. width: 80rpx;
  2259. height: 80rpx;
  2260. background: #ffffff;
  2261. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2262. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2263. }
  2264. }
  2265. .lecture-content {
  2266. background: #fff;
  2267. margin-top: 10rpx;
  2268. padding: 10rpx;
  2269. border-radius: 16rpx;
  2270. }
  2271. .photoBox {
  2272. background-color: #ffffff;
  2273. border-radius: 32px 32px 0px 0px;
  2274. .photoTop {
  2275. height: 74rpx;
  2276. display: flex;
  2277. align-items: center;
  2278. justify-content: space-between;
  2279. padding: 0rpx 38rpx;
  2280. .sqzz {
  2281. width: 28rpx;
  2282. height: 28rpx;
  2283. display: flex;
  2284. align-items: center;
  2285. justify-content: center;
  2286. }
  2287. .centersq {
  2288. color: #333;
  2289. font-size: 30rpx;
  2290. font-weight: 500;
  2291. }
  2292. }
  2293. .photoCenter {
  2294. width: 750rpx;
  2295. height: 979rpx;
  2296. position: relative;
  2297. .custom {
  2298. width: 750rpx;
  2299. height: 979rpx;
  2300. position: absolute;
  2301. z-index: 1000;
  2302. top: 0;
  2303. left: 0;
  2304. image {
  2305. width: 100%;
  2306. height: 100%;
  2307. }
  2308. }
  2309. }
  2310. .btns {
  2311. display: flex;
  2312. .btnResult {
  2313. height: 100rpx;
  2314. flex: 1;
  2315. background-color: #07c160;
  2316. text-align: center;
  2317. line-height: 100rpx;
  2318. color: #fff;
  2319. font-size: 32rpx;
  2320. font-weight: bold;
  2321. }
  2322. }
  2323. }
  2324. .chat_box {
  2325. display: flex;
  2326. padding: 20rpx;
  2327. justify-content: space-between;
  2328. }
  2329. .chat3 {
  2330. font-size: 30rpx;
  2331. font-family: PingFang SC;
  2332. font-weight: 500;
  2333. color: #666666;
  2334. margin-top: 10rpx;
  2335. }
  2336. .chat2 {
  2337. font-size: 20rpx;
  2338. font-family: PingFang SC;
  2339. font-weight: 500;
  2340. color: #999999;
  2341. margin-top: 10rpx;
  2342. }
  2343. .chat1 {
  2344. font-size: 24rpx;
  2345. font-family: PingFang SC;
  2346. font-weight: 500;
  2347. color: #333333;
  2348. }
  2349. .leftPadding {
  2350. margin-left: 8rpx;
  2351. }
  2352. .t2Content {
  2353. font-size: 28rpx;
  2354. font-family: PingFang SC;
  2355. font-weight: bold;
  2356. color: #999999;
  2357. line-height: 48rpx;
  2358. }
  2359. .tBox2 {
  2360. display: flex;
  2361. padding-top: 10rpx;
  2362. color: #333333;
  2363. font-size: 30rpx;
  2364. }
  2365. .tBox {
  2366. display: flex;
  2367. align-items: center;
  2368. padding-top: 10rpx;
  2369. }
  2370. .title {
  2371. font-size: 24rpx;
  2372. color: #999999;
  2373. }
  2374. page {
  2375. // padding-top: 10px;
  2376. // padding-top: constant(safe-area-inset-top);
  2377. // padding-top: env(safe-area-inset-top);
  2378. }
  2379. .inputBottom {
  2380. position: fixed;
  2381. left: 0;
  2382. bottom: 0;
  2383. background: #ffffff;
  2384. height: 98rpx;
  2385. display: flex;
  2386. align-items: center;
  2387. width: 100%;
  2388. .flex_auto {
  2389. flex: 1;
  2390. margin-left: 10%;
  2391. .input {
  2392. height: 60rpx;
  2393. }
  2394. }
  2395. .btn {
  2396. color: #007aff;
  2397. font-size: 30rpx;
  2398. font-weight: bold;
  2399. width: 15%;
  2400. text-align: center;
  2401. }
  2402. }
  2403. .noteBox {
  2404. width: 100%;
  2405. background: #ffffff;
  2406. padding: 10rpx;
  2407. border-radius: 16rpx;
  2408. }
  2409. .dateBox {
  2410. width: 216rpx;
  2411. height: 48rpx;
  2412. background: #ffffff;
  2413. border-radius: 24rpx;
  2414. font-size: 24rpx;
  2415. color: #666666;
  2416. text-align: center;
  2417. line-height: 48rpx;
  2418. margin: 20rpx 0;
  2419. }
  2420. .t_content1 {
  2421. color: #007aff;
  2422. margin-left: 10rpx;
  2423. }
  2424. .tag1 {
  2425. border: 2rpx solid #007aff;
  2426. border-radius: 8rpx;
  2427. font-size: 20rpx;
  2428. color: #007aff;
  2429. padding: 5rpx;
  2430. }
  2431. .b_title {
  2432. color: #333333;
  2433. font-size: 30rpx;
  2434. font-weight: bold;
  2435. }
  2436. page {
  2437. background: #eaeef1;
  2438. }
  2439. .menuBox {
  2440. width: 100%;
  2441. background: #ffffff;
  2442. border-radius: 16rpx;
  2443. padding: 20rpx;
  2444. margin-bottom: 20rpx;
  2445. }
  2446. .btnspric {
  2447. border-top: 1rpx solid #eee;
  2448. display: flex;
  2449. align-items: center;
  2450. justify-content: space-between;
  2451. height: 108rpx;
  2452. padding-left: 43rpx;
  2453. padding-right: 32rpx;
  2454. }
  2455. .btnspric > .lefprL {
  2456. font-size: 36rpx;
  2457. color: #0c141f;
  2458. font-weight: bold;
  2459. }
  2460. .btnspric > .lefprR {
  2461. padding: 0rpx 24rpx;
  2462. height: 60rpx;
  2463. line-height: 60rpx;
  2464. text-align: center;
  2465. color: #fff;
  2466. background: #32467b;
  2467. border-radius: 24rpx;
  2468. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2469. }
  2470. .yhj,
  2471. .hdyhj {
  2472. padding: 24rpx 29rpx 24rpx 34rpx;
  2473. }
  2474. .yhj {
  2475. border-bottom: 16rpx solid #f9f9f9;
  2476. }
  2477. .yhjtit {
  2478. font-size: 30rpx;
  2479. color: #0c141f;
  2480. font-weight: 500;
  2481. margin-bottom: 14rpx;
  2482. }
  2483. .yhjList {
  2484. display: flex;
  2485. align-items: center;
  2486. justify-content: space-between;
  2487. margin-bottom: 14rpx;
  2488. }
  2489. .yhjList > .yhjLefts {
  2490. display: flex;
  2491. align-items: center;
  2492. }
  2493. .yhjLefts > .yhl {
  2494. color: #32467b;
  2495. font-size: 30rpx;
  2496. margin-right: 31rpx;
  2497. }
  2498. .yhjLefts > .yhbq {
  2499. font-size: 24rpx;
  2500. color: #ff9500;
  2501. border-radius: 18rpx;
  2502. background-color: rgba(255, 149, 0, 0.2);
  2503. border: 2rpx solid #ff9500;
  2504. height: 38rpx;
  2505. line-height: 38rpx;
  2506. padding: 0rpx 16rpx;
  2507. }
  2508. .ts {
  2509. font-size: 24rpx;
  2510. color: #999;
  2511. margin: 14rpx 0rpx;
  2512. padding-right: 29rpx;
  2513. padding-left: 34rpx;
  2514. }
  2515. .yh {
  2516. padding-top: 20rpx;
  2517. }
  2518. .yh > .yhtitle {
  2519. display: flex;
  2520. align-items: center;
  2521. justify-content: space-between;
  2522. padding-right: 29rpx;
  2523. padding-left: 34rpx;
  2524. }
  2525. .priceBxs {
  2526. display: flex;
  2527. align-items: center;
  2528. }
  2529. .priceBxs > .pricleft {
  2530. border-radius: 24rpx;
  2531. border: 1rpx solid #e91313;
  2532. background-color: rgba(233, 19, 19, 0.1);
  2533. padding: 0rpx 18rpx;
  2534. height: 49rpx;
  2535. line-height: 49rpx;
  2536. text-align: center;
  2537. font-size: 30rpx;
  2538. font-weight: 500;
  2539. color: #e91313;
  2540. margin-right: 13rpx;
  2541. }
  2542. .topBox {
  2543. padding: 32rpx 32rpx 24rpx;
  2544. border-bottom: 1rpx solid #eeeeee;
  2545. }
  2546. .topBox > .boldFonstType {
  2547. font-weight: 500;
  2548. font-size: 30rpx;
  2549. margin: 16rpx 0rpx 23rpx;
  2550. }
  2551. .topBox > .firstTopL {
  2552. display: flex;
  2553. align-items: center;
  2554. }
  2555. .topBox > .firstTopL > .imageBs {
  2556. width: 331rpx;
  2557. height: 160rpx;
  2558. border-radius: 6rpx;
  2559. overflow: hidden;
  2560. margin-right: 8rpx;
  2561. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2562. }
  2563. .topBox > .firstTopL > .imageBs > image {
  2564. width: 100%;
  2565. height: 100%;
  2566. }
  2567. .topBox > .firstTopL > .textBs {
  2568. font-size: 30rpx;
  2569. font-weight: bold;
  2570. color: #0c141f;
  2571. }
  2572. .content {
  2573. padding: 24rpx;
  2574. text-align: left;
  2575. }
  2576. .catalogBox {
  2577. display: flex;
  2578. align-items: center;
  2579. flex-wrap: nowrap;
  2580. overflow-x: auto;
  2581. padding-left: 38rpx;
  2582. max-height: 305rpx;
  2583. overflow-y: auto;
  2584. transition: all 0.4s;
  2585. }
  2586. .catalogBox > .catalogA {
  2587. min-width: 200rpx;
  2588. height: 48rpx;
  2589. line-height: 48rpx;
  2590. // text-align: center;
  2591. border: 2rpx solid transparent;
  2592. white-space: nowrap;
  2593. text-overflow: ellipsis;
  2594. overflow: hidden;
  2595. word-break: break-all;
  2596. border-radius: 10rpx;
  2597. background: rgba(22, 119, 255, 0.05);
  2598. padding-left: 19rpx;
  2599. box-sizing: border-box;
  2600. padding-right: 15rpx;
  2601. margin-right: 16rpx;
  2602. margin-bottom: 20rpx;
  2603. margin-top: 15rpx;
  2604. font-size: 24rpx;
  2605. color: #666;
  2606. }
  2607. .catalogBox > .activesq {
  2608. border-color: #1677ff;
  2609. }
  2610. .changeCatalogBox {
  2611. display: block;
  2612. }
  2613. .catalogBox::-webkit-scrollbar {
  2614. display: none; /* Chrome Safari */
  2615. }
  2616. .price_t2 {
  2617. font-size: 18rpx;
  2618. font-family: PingFang SC;
  2619. font-weight: 500;
  2620. text-decoration: line-through;
  2621. color: #999999;
  2622. }
  2623. .price_t1 {
  2624. font-size: 33rpx;
  2625. font-family: PingFang SC;
  2626. font-weight: bold;
  2627. color: #e91313;
  2628. }
  2629. .sc_t {
  2630. font-size: 22rpx;
  2631. color: #000000;
  2632. }
  2633. .sc {
  2634. width: 29rpx;
  2635. height: 29rpx;
  2636. }
  2637. .buy {
  2638. width: 138rpx;
  2639. height: 48rpx;
  2640. line-height: 48rpx;
  2641. background: #32467b;
  2642. border-radius: 10rpx;
  2643. color: #ffffff;
  2644. font-size: 28rpx;
  2645. text-align: center;
  2646. vertical-align: middle;
  2647. position: absolute;
  2648. right: 30rpx;
  2649. }
  2650. .video_body {
  2651. padding-bottom: 96rpx;
  2652. }
  2653. .footer_tab {
  2654. position: fixed;
  2655. bottom: 0;
  2656. height: 96rpx;
  2657. width: 100%;
  2658. background-color: #ffffff;
  2659. }
  2660. .tj_box {
  2661. width: 50%;
  2662. display: inline-block;
  2663. text-align: center;
  2664. margin: 10rpx 0;
  2665. }
  2666. .teacher_t {
  2667. font-size: 24rpx;
  2668. font-family: PingFang SC;
  2669. font-weight: 400;
  2670. color: #666666;
  2671. line-height: 36rpx;
  2672. margin-left: 15rpx;
  2673. }
  2674. .teacher_img {
  2675. width: 87rpx;
  2676. height: 129rpx;
  2677. }
  2678. .t2 {
  2679. font-size: 24rpx;
  2680. font-family: PingFang SC;
  2681. color: #666666;
  2682. line-height: 36rpx;
  2683. margin: 15rpx;
  2684. }
  2685. .r_t2 {
  2686. width: 201rpx;
  2687. height: 49rpx;
  2688. background: rgba(22, 119, 255, 0.05);
  2689. border: 1rpx solid #32467b;
  2690. border-radius: 16rpx;
  2691. color: #666666;
  2692. font-size: 23rpx;
  2693. text-align: center;
  2694. display: flex;
  2695. align-items: center;
  2696. padding: 5rpx;
  2697. }
  2698. .scroll_box {
  2699. width: 100%;
  2700. height: 60rpx;
  2701. background: #ffffff;
  2702. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2703. white-space: nowrap;
  2704. overflow: hidden;
  2705. margin: 15rpx 0;
  2706. }
  2707. .r_sliper {
  2708. padding: 0 20rpx;
  2709. }
  2710. .top_line {
  2711. width: 6rpx;
  2712. height: 22rpx;
  2713. background: #32467b;
  2714. margin-right: 10rpx;
  2715. }
  2716. .video_t2 {
  2717. font-size: 24rpx;
  2718. font-family: PingFang SC;
  2719. font-weight: 500;
  2720. color: #666666;
  2721. }
  2722. .video_t1 {
  2723. height: 80rpx;
  2724. color: #333333;
  2725. line-height: 80rpx;
  2726. font-size: 30rpx;
  2727. font-family: PingFang SC;
  2728. font-weight: bold;
  2729. color: #333333;
  2730. overflow: hidden;
  2731. text-overflow: ellipsis;
  2732. white-space: nowrap;
  2733. }
  2734. .notice_wrap {
  2735. height: 80rpx;
  2736. display: flex;
  2737. align-items: center;
  2738. justify-content: flex-end;
  2739. .video_t1_t {
  2740. width: 100%;
  2741. height: 40rpx;
  2742. line-height: 40rpx;
  2743. text-align: center;
  2744. background: rgba(245, 154, 35, 1);
  2745. color: #333;
  2746. border-radius: 10rpx;
  2747. font-size: 24rpx;
  2748. }
  2749. }
  2750. .video_play {
  2751. position: absolute;
  2752. width: 95rpx;
  2753. height: 95rpx;
  2754. top: 0;
  2755. left: 0;
  2756. right: 0;
  2757. bottom: 0;
  2758. margin: auto;
  2759. }
  2760. .video_box {
  2761. position: relative;
  2762. .video-toast {
  2763. position: absolute;
  2764. width: 686rpx;
  2765. height: 80rpx;
  2766. background: rgba(0, 0, 0, 0.6);
  2767. border-radius: 24rpx;
  2768. bottom: 100rpx;
  2769. left: 50%;
  2770. transform: translateX(-50%);
  2771. color: #fff;
  2772. display: flex;
  2773. font-size: 26rpx;
  2774. align-items: center;
  2775. overflow: visible;
  2776. &__text {
  2777. flex: 1;
  2778. margin-left: 40rpx;
  2779. }
  2780. &__btn {
  2781. width: 180rpx;
  2782. text-align: center;
  2783. border-left: 1rpx solid #fff;
  2784. }
  2785. }
  2786. .video-toast__close {
  2787. position: absolute;
  2788. right: 32rpx;
  2789. bottom: 184rpx;
  2790. width: 40rpx;
  2791. height: 40rpx;
  2792. line-height: 40rpx;
  2793. text-align: center;
  2794. background: rgba(0, 0, 0, 0.6);
  2795. border-radius: 50%;
  2796. color: rgba(255, 255, 255, 0.3);
  2797. }
  2798. }
  2799. .rotoct {
  2800. transform: rotate(90deg);
  2801. }
  2802. .notice_modal {
  2803. .content {
  2804. width: 100%;
  2805. height: 100%;
  2806. padding: 20rpx;
  2807. .title {
  2808. color: #333;
  2809. line-height: 40rpx;
  2810. font-size: 30rpx;
  2811. text-align: center;
  2812. font-weight: bold;
  2813. }
  2814. .text {
  2815. line-height: 40rpx;
  2816. }
  2817. }
  2818. }
  2819. </style>