detail.vue 85 KB

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