detail.vue 84 KB

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