detail.vue 82 KB

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