detail.vue 82 KB

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