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. v-if="reStart"
  140. :isLive="true"
  141. :orderGoodsId="orderGoodsId"
  142. :sectionMaxNum="goodsData.sectionMaxNum"
  143. :needOpen="menuIndex[0] === index ? true : false"
  144. :courseId="courseId"
  145. :preItem="menuList[index - 1]"
  146. :learningOrder="businessData.goodsLearningOrder"
  147. :goodsId="goodsId"
  148. :gradeId="gradeId"
  149. :isBuy="true"
  150. :menuItem="item"
  151. :levelId="item.menuId"
  152. ></courseModule
  153. ></view>
  154. <!--章 -->
  155. <view v-if="item.type == 2"
  156. ><courseChapter
  157. v-if="reStart"
  158. :isLive="true"
  159. :orderGoodsId="orderGoodsId"
  160. :sectionMaxNum="goodsData.sectionMaxNum"
  161. :needOpen="menuIndex[0] === index ? true : false"
  162. :courseId="courseId"
  163. :preItem="menuList[index - 1]"
  164. @playEnd="sectionPlayEnd($event, index)"
  165. :learningOrder="businessData.goodsLearningOrder"
  166. :goodsId="goodsId"
  167. :gradeId="gradeId"
  168. :isBuy="true"
  169. :menuItem="item"
  170. :levelId="'0-' + item.menuId"
  171. :goodsType='6'
  172. ></courseChapter
  173. ></view>
  174. <!--节 -->
  175. <view v-if="item.type == 3"
  176. ><courseSection
  177. v-if="reStart"
  178. :isLive="true"
  179. :orderGoodsId="orderGoodsId"
  180. :sectionMaxNum="goodsData.sectionMaxNum"
  181. @playEnd="sectionPlayEnd($event, index)"
  182. :courseId="courseId"
  183. :preItem="menuList[index - 1]"
  184. :learningOrder="businessData.goodsLearningOrder"
  185. :goodsId="goodsId"
  186. :gradeId="gradeId"
  187. :isBuy="true"
  188. :menuItem="item"
  189. :levelId="'0-0-' + item.menuId"
  190. ></courseSection
  191. ></view>
  192. </view>
  193. </view>
  194. <!--笔记 -->
  195. <view v-show="current == 1">
  196. <view v-if="noteList.length == 0" style="text-align: center"
  197. >暂无笔记</view
  198. >
  199. <!-- <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0">
  200. <view style="width: 10%"
  201. ><image
  202. src="/static/icon/note3.png"
  203. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  204. ></image
  205. ></view>
  206. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  207. <u-input
  208. class="input"
  209. height="60"
  210. fixed="true"
  211. placeholder="您可以在这里输入笔记内容"
  212. type="input"
  213. :custom-style="inputStyle"
  214. v-model="noteValue"
  215. />
  216. </view>
  217. <view
  218. style="
  219. color: #007aff;
  220. font-size: 30rpx;
  221. font-weight: bold;
  222. width: 15%;
  223. text-align: center;
  224. "
  225. @click="postNote"
  226. >提交</view
  227. >
  228. </view> -->
  229. <view v-for="(item, index) in noteList" :key="index">
  230. <view class="dateBox">{{
  231. $method.timestampToTime(item.dateNote)
  232. }}</view>
  233. <view class="noteBox">
  234. <view
  235. v-for="(item1, index1) in item.userNotes"
  236. :key="index1"
  237. style="margin-top: 30rpx"
  238. @click="jumpNote(item1)"
  239. >
  240. <view style="display: flex">
  241. <view class="left_ti">
  242. <view>
  243. <image
  244. src="/static/icon/note2.png"
  245. v-if="noteId != item1.noteId"
  246. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  247. ></image>
  248. <image
  249. src="/static/icon/note1.png"
  250. v-if="noteId == item1.noteId"
  251. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  252. ></image>
  253. </view>
  254. <view
  255. class="title"
  256. style="width: 39rpx; height: 39rpx;"
  257. >{{ $method.secondToDate(item1.noteSecond) }}</view
  258. >
  259. </view>
  260. <view style="margin-left: 10rpx">
  261. <view class="t2Content leftPadding">{{
  262. item1.sectionName
  263. }}</view>
  264. <view class="tBox2">{{ item1.noteText }}</view>
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </view>
  270. </view>
  271. <!--答疑 -->
  272. <view v-show="current == 2" class="Answering">
  273. <!-- <view class="inputBottom">
  274. <view class="flex_auto">
  275. <u-input
  276. height="60"
  277. fixed="true"
  278. :focus="isFocus"
  279. :placeholder="placeholder"
  280. type="input"
  281. @blur="blur"
  282. :custom-style="inputStyle"
  283. v-model="ctxValue"
  284. />
  285. </view>
  286. <view class="btn" @click="postContent">提交</view>
  287. </view> -->
  288. <view
  289. v-for="(item, index) in answerList"
  290. :key="index"
  291. style="background-color: #ffffff;"
  292. class="answer_item"
  293. >
  294. <view class="chat_box" @click.stop="clearCtx">
  295. <view style="display: flex; flex: 1">
  296. <view
  297. ><image
  298. :src="
  299. item.assignUserId > 0 && !item.realname
  300. ? '/static/logo_xcx.png'
  301. : $method.splitImgHost(item.avatar)
  302. "
  303. style="width: 64rpx; height: 64rpx"
  304. ></image
  305. ></view>
  306. <view style="margin-left: 15rpx">
  307. <view class="chat1">{{
  308. item.assignUserId > 0 && !item.realname
  309. ? "祥粤老师"
  310. : item.realname
  311. }}</view>
  312. <view class="chat2">{{
  313. $method.timestampToTime(item.createTime, false)
  314. }}</view>
  315. <view class="chat3">
  316. <text v-if="item.assignUserId > 0">回复</text>
  317. <text v-if="item.assignUserId > 0" style="color: #007aff"
  318. >@{{ item.assignRealname }}</text
  319. >
  320. <view style="word-break: break-all">{{
  321. item.answerText
  322. }}</view>
  323. </view>
  324. </view>
  325. </view>
  326. <view
  327. class="btnReply"
  328. @click.stop="replyContent(item)"
  329. v-if="item.userId != userInfo.userId"
  330. >回复</view
  331. >
  332. <view v-else class="btnDel" @click.stop="delContent(item)"
  333. >删除</view
  334. >
  335. </view>
  336. <u-line color="#D6D6DB" />
  337. </view>
  338. <view v-if="answerList.length == 0" style="text-align: center"
  339. >暂无记录</view
  340. >
  341. </view>
  342. <!--答疑 -->
  343. <view v-show="current == 3">
  344. <view
  345. v-for="(item, index) in historyChatMsgList"
  346. :key="index"
  347. style="background-color: #ffffff; margin-bottom: 20rpx"
  348. >
  349. <view class="chat_box" @click.stop="clearCtx">
  350. <view style="display: flex; flex: 1">
  351. <view
  352. ><image
  353. :src="
  354. item.user.pic
  355. "
  356. style="width: 64rpx; height: 64rpx"
  357. ></image
  358. ></view>
  359. <view style="margin-left: 15rpx">
  360. <view class="chat1">{{
  361. item.user.nickname
  362. }}</view>
  363. <view class="chat2">{{
  364. item.time | formatDate
  365. }}</view>
  366. <view class="chat3">
  367. <!-- <text v-if="item.assignUserId > 0">回复</text>
  368. <text v-if="item.assignUserId > 0" style="color: #007aff"
  369. >@{{ item.assignRealname }}</text
  370. > -->
  371. <view style="word-break: break-all">{{
  372. item.content
  373. }}</view>
  374. </view>
  375. </view>
  376. </view>
  377. </view>
  378. <u-line color="#D6D6DB" />
  379. </view>
  380. <view v-if="historyChatMsgList.length == 0" style="text-align: center"
  381. >暂无记录</view
  382. >
  383. </view>
  384. </scroll-view>
  385. <!-- 底部固定按钮 -->
  386. <!-- 笔记的输入框 -->
  387. <template v-if="current == 1">
  388. <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0" :style="{ bottom: bottomHeight + 'px' }">
  389. <view style="width: 10%"
  390. ><image
  391. src="/static/icon/note3.png"
  392. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  393. ></image
  394. ></view>
  395. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  396. <input
  397. v-model="noteValue"
  398. class="input"
  399. height="60"
  400. fixed="true"
  401. placeholder="您可以在这里输入笔记内容"
  402. type="text"
  403. :custom-style="inputStyle"
  404. :adjust-position="false"
  405. @focus="focusNote"
  406. @blur="blurNote"
  407. />
  408. </view>
  409. <view
  410. style="
  411. color: #007aff;
  412. font-size: 30rpx;
  413. font-weight: bold;
  414. width: 15%;
  415. text-align: center;
  416. "
  417. @click="postNote"
  418. >提交</view
  419. >
  420. </view>
  421. </template>
  422. <!-- 答疑 -->
  423. <view v-if="current == 2" class="inputBottom" :style="{ bottom: bottomHeight + 'px' }">
  424. <view class="flex_auto">
  425. <input
  426. v-model="ctxValue"
  427. height="60"
  428. fixed="true"
  429. :focus="isFocus"
  430. :placeholder="placeholder"
  431. type="text"
  432. :custom-style="inputStyle"
  433. :adjust-position="false"
  434. class="input"
  435. @focus="focusNote"
  436. @blur="blur"
  437. />
  438. </view>
  439. <view class="btn" @click="postContent">提交</view>
  440. </view>
  441. </view>
  442. <!-- 播放前拍照end -->
  443. <u-popup
  444. v-model="showSet"
  445. :mask-close-able="false"
  446. mode="center"
  447. border-radius="24"
  448. >
  449. <view
  450. style="
  451. align-items: center;
  452. padding: 0 40rpx;
  453. display: flex;
  454. flex-direction: column;
  455. justify-content: center;
  456. "
  457. >
  458. <view
  459. style="
  460. font-weight: bold;
  461. color: #333333;
  462. font-size: 30rpx;
  463. margin-top: 30rpx;
  464. "
  465. >温馨提示</view
  466. >
  467. <view
  468. style="
  469. width: 457rpx;
  470. color: #666666;
  471. font-size: 30rpx;
  472. margin-top: 30rpx;
  473. "
  474. >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
  475. 是否授权使用?</view
  476. >
  477. <view style="margin: 40rpx 0">
  478. <button
  479. open-type="openSetting"
  480. @bindopensetting="openSetting"
  481. class="btnSet"
  482. >
  483. 去授权
  484. </button>
  485. </view>
  486. </view>
  487. </u-popup>
  488. <u-mask :show="photoPopup">
  489. <!-- 播放前拍照start -->
  490. <view
  491. v-if="photoPopup"
  492. :mask-close-able="false"
  493. style="bottom: 0; position: fixed; width: 100%; z-index: 999"
  494. >
  495. <view class="photoBox">
  496. <view class="photoTop">
  497. <view class="sqzz" v-if="false"
  498. ><u-icon
  499. name="close"
  500. color="#333333"
  501. size="30"
  502. @click="closePhoto"
  503. ></u-icon
  504. ></view>
  505. <view class="centersq">请正视手机屏幕</view>
  506. <view class="sqzz"></view>
  507. </view>
  508. <view class="photoCenter">
  509. <view
  510. style="width: 100%; height: 979rpx; position: fixed"
  511. v-if="photoPopup && isTaking"
  512. >
  513. <camera
  514. device-position="front"
  515. flash="off"
  516. @error="error"
  517. style="width: 100%; height: 100%"
  518. ></camera>
  519. </view>
  520. <view class="custom" v-if="!isTaking"
  521. ><image :src="avatarUrl" mode=""></image
  522. ></view>
  523. </view>
  524. <view class="btns">
  525. <view class="btnResult" v-if="isTaking" @click="takePhoto"
  526. >拍照</view
  527. >
  528. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  529. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  530. </view>
  531. </view>
  532. </view>
  533. </u-mask>
  534. <u-popup
  535. v-model="noticeShow"
  536. class="notice_modal"
  537. mode="center"
  538. border-radius="14"
  539. width="700rpx"
  540. height="900rpx"
  541. >
  542. <div class="content">
  543. <scroll-view scroll-y="true" style="height: 100%">
  544. <view class="title">学员须知</view>
  545. <text class="text">
  546. {{ goodsData.buyNote }}
  547. </text>
  548. </scroll-view>
  549. </div>
  550. </u-popup>
  551. <!-- 切换课程弹窗 -->
  552. <u-popup v-model="toggleCourseShow" mode="bottom" border-radius="40" :mask-close-able='false'>
  553. <view class="popup_box">
  554. <view class="check_head">
  555. <view class="headers">
  556. <view class="grade">切换课程</view>
  557. <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
  558. </view>
  559. <view class="coruse_num">共{{ courseTotal }}门</view>
  560. </view>
  561. <view class="check_con">
  562. <scroll-view scroll-y="true" style="height: 700rpx;">
  563. <view class="course_items" v-for="(item, index) in courseList" :key="index">
  564. <view class="course_lefts">
  565. <view class="course_title">{{ item.courseName }}</view>
  566. <!-- <view class="course_pros">
  567. 学习进度
  568. <text> {{ item.stuAllNum + item.recordNum }}/{{ item.secAllNum + item.examNum}}</text>
  569. </view> -->
  570. </view>
  571. <view class="course_rights" @click="jump(item, index)">
  572. <view class="cicles">
  573. <u-icon name="arrow-right" color="#498AFE" size="20"></u-icon>
  574. </view>
  575. <view class="intoStudy">进入学习</view>
  576. </view>
  577. </view>
  578. </scroll-view>
  579. </view>
  580. </view>
  581. </u-popup>
  582. </view>
  583. </template>
  584. <script>
  585. import plv from "@/pages3/static/polyv-sdk/index";
  586. import courseModule from "@/components/course/courseModule.vue";
  587. import courseChapter from "@/components/course/courseChapter.vue";
  588. import courseSection from "@/components/course/courseSection.vue";
  589. import {WEBVIEW_URL} from '@/common/request.js'
  590. // import { websocket } from "@/common/socket.js";
  591. import { mapGetters, mapMutations } from "vuex";
  592. export default {
  593. components: {
  594. courseModule,
  595. courseChapter,
  596. courseSection,
  597. },
  598. filters: {
  599. formatDate(date) {
  600. const nDate = new Date(date)
  601. const nyear = nDate.getFullYear()
  602. const nmonth = (nDate.getMonth()+1).toString().padStart(2,0)
  603. const nday = nDate.getDate().toString().padStart(2,0)
  604. const hour = nDate.getHours()
  605. const mins = nDate.getMinutes()
  606. const seconds = nDate.getSeconds()
  607. return nyear+'-'+nmonth+'-'+nday+' '+hour+':'+(mins>=10 ? mins : '0'+mins)+':'+(seconds>=10 ? seconds : '0'+seconds)
  608. }
  609. },
  610. data() {
  611. return {
  612. hasStart:false,
  613. channelItem:null,
  614. lockTimer: null,
  615. orderGoodsId: 0,
  616. noticeShow: false,
  617. navShow: true,
  618. enableAutoRotation: true,
  619. seekTime: "",
  620. toastTimer: null,
  621. videoToastShow: false,
  622. initLiveOk: false,
  623. livePlay: false, //是否正在播放直播,不含暂停
  624. liveDuration: 0, //直播观看时长
  625. videoOption: {
  626. mode: "live",
  627. uid: "",
  628. cid: "",
  629. openId: "",
  630. isAutoChange: false,
  631. forceVideo: false,
  632. },
  633. courseHandoutsData: "",
  634. liveDetail: {},
  635. showSet: false,
  636. startStatus: false,
  637. detail: {},
  638. courseId: 0,
  639. placeholder:
  640. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  641. inputStyle: {
  642. background: "rgba(244, 244, 244, 0.98)",
  643. borderRadius: "24rpx",
  644. padding: "8rpx",
  645. marginBottom: "10rpx",
  646. },
  647. list: [{
  648. name: "目录",
  649. },
  650. {
  651. name: "笔记",
  652. },
  653. {
  654. name: "答疑",
  655. },
  656. {
  657. name: "聊天",
  658. }],
  659. menuList: [],
  660. current: 0,
  661. vid: "",
  662. goodsId: 0,
  663. goodsData: {},
  664. photoPopup: false,
  665. goodsPlayConfig: null,
  666. autoplay: false,
  667. isAllowSeek: "no",
  668. playbackRate: [1.0],
  669. timer: null,
  670. answerTimer: null,
  671. goodsPhotographConfig: null,
  672. intervalTimeList: [], // 间隔拍照时长
  673. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  674. playTime: 0, //页面播放时长,不含暂停
  675. currentTime: 0,
  676. avatarUrl: "",
  677. ossAvatarUrl: "",
  678. studyDuration: 0, // 当前视频时长
  679. gradeId: 0,
  680. chapterId: 0,
  681. moduleId: 0,
  682. reMenuList: [],
  683. answerList: [],
  684. assignUserId: 0,
  685. placeholder: "您可以在这里输入答疑内容",
  686. ctxValue: "",
  687. noteList: [],
  688. noteValue: "",
  689. noteId: 0,
  690. recordObj: 0,
  691. gradeDetail: {},
  692. isTaking: true, //是否正在拍照
  693. needSeek: false, //第一次播放是否需要跳转
  694. needProfileModal: false, //是否需要资料审核弹框
  695. liveObj: {},
  696. photoNum: 0,
  697. photoList: [], //拍照的时间点
  698. photoConfig: false, //是否配置好拍照次数
  699. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  700. photoHistoryList: [], //已拍照历史的下标点
  701. sectionItem: null,
  702. businessData: {},
  703. showNotes: true,
  704. menuIndex: [],
  705. uploadLock: false, //上传图片
  706. isPlayRebuild: false, //是否正在播放重修视频
  707. isRebuild: false, //视频是否从重修目录点击
  708. isFocus:false,
  709. clearTimer:null,
  710. historyChatMsgList:[],
  711. livingItem:'',
  712. bottomHeight: 0,
  713. toggleCourseShow: false, // 切换课程弹窗
  714. informId: '', //消息id,从公众号消息模板进来的才有
  715. courseList: [], // 课程列表
  716. courseTotal: 0,
  717. options: {},
  718. reStart: false, // 是否显示模块/章/节
  719. };
  720. },
  721. computed: {
  722. ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
  723. },
  724. onLoad(option) {
  725. console.log('====option', option, this.playChannelId)
  726. this.options = option
  727. this.courseId = option.courseId || ''
  728. this.goodsId = Number(option.goodsId);
  729. // this.gradeId = option.gradeId || 0
  730. this.orderGoodsId = Number(option.orderGoodsId) || '';
  731. // 公众号模板消息的数据埋点
  732. if (option.informId) { // 从公众号消息点击进来上报一次,其他地方进来和没登录需要跳到登录页,登录后返回的不需要上报
  733. this.informId = option.informId
  734. this.clickOfficial()
  735. }
  736. this.$store.getters.dictObj;
  737. },
  738. onShow() {
  739. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  740. return;
  741. }
  742. this.courseCourseList();
  743. //相机授权
  744. // this.userConfirmInfoDetail().then(res => {
  745. // })
  746. // this.getbaseprofiletplists();
  747. },
  748. onUnload() {
  749. if (this.playSectionId > 0 && this.hasStart) {
  750. //退出提交记录
  751. this.postStudyRecord();
  752. }
  753. //清除正在播放的节ID
  754. // this.$store.commit('setPlayObj',null)
  755. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  756. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  757. this.$store.commit("setPlayVID", { playVID: null });
  758. this.closePlv();
  759. // console.log("onUnload");
  760. //移除所有的事件监听器
  761. uni.$off();
  762. clearInterval(this.answerTimer);
  763. if (this.timer) {
  764. clearInterval(this.timer);
  765. }
  766. // console.log(this.lockTimer, "this.lockTimer");
  767. if (this.lockTimer) {
  768. clearInterval(this.lockTimer);
  769. this.$api
  770. .lockDelLock({
  771. action: "jxjy",
  772. })
  773. .then((res) => {});
  774. }
  775. // websocket.sendMsg("delAction");
  776. },
  777. mounted() {
  778. },
  779. methods: {
  780. ...mapMutations(["updateChapterOpen","updateLiveLast"]),
  781. // 新增微信公众号模板消息点击数据
  782. clickOfficial() {
  783. this.$http({
  784. url: '/data/click',
  785. method: 'post',
  786. data: { informId: this.informId }
  787. }).then((res) => {
  788. if (res.data.code == 200) {
  789. console.log('埋点')
  790. }
  791. })
  792. },
  793. courseCourseList() {
  794. this.$api.courseCourseList({
  795. pageNum: 1,
  796. pageSize: 100,
  797. goodsId: this.goodsId,
  798. gradeId: this.gradeId,
  799. orderGoodsId: this.orderGoodsId,
  800. }).then((res) => {
  801. if (res.data.code == 200) {
  802. this.courseList.push.apply(this.courseList, res.data.rows)
  803. this.courseTotal = res.data.total || 0
  804. if(res.data.total > 1) {
  805. this.getUserWatchLast()
  806. } else if(res.data.total == 1) {
  807. console.log('111->this.courseId', this.courseId)
  808. this.originOnShow()
  809. this.originOnMount()
  810. }
  811. }
  812. });
  813. },
  814. // 查询用户最后一次看的录播的信息
  815. getUserWatchLast() {
  816. this.$http({
  817. url: '/study/record/getUserWatchLast',
  818. method: 'get',
  819. data: {
  820. goodsId: this.goodsId
  821. }
  822. }).then((res) => {
  823. if (res.data.code == 200) {
  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.reStart = false
  925. this.toggleCourseShow = false
  926. this.originOnShow()
  927. this.originOnMount()
  928. },
  929. clickLeft() {
  930. uni.navigateBack()
  931. },
  932. /**
  933. * 获取上次观看的直播
  934. */
  935. studyRecordGetLastLive() {
  936. this.$api.studyRecordGetLastLive({
  937. orderGoodsId:this.orderGoodsId,
  938. courseId:this.courseId
  939. }).then(res => {
  940. // console.log(res,'liveres')
  941. this.updateLiveLast(res.data.data)
  942. })
  943. },
  944. /**
  945. * 获取最后一次看的节
  946. */
  947. studyRecordQueryLiveLast() {
  948. this.$api.studyRecordQueryLiveLast({
  949. orderGoodsId:this.orderGoodsId,
  950. courseId:this.courseId
  951. }).then(res => {
  952. console.log(res,'couse')
  953. if(res.data.data) {
  954. if(res.data.data.sectionType == 1) { //录播
  955. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  956. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  957. this.sectionItem = res.data.data;
  958. this.playVideo(res.data.data)
  959. } else if(res.data.data.sectionType == 2) { //直播
  960. this.studyRecordGetLastLive();
  961. } else if(res.data.data.sectionType == 3) { //回放
  962. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  963. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  964. this.sectionItem = res.data.data;
  965. this.polyvLiveHistoryChatMsgList();
  966. if(!res.data.data.recordingUrl) {
  967. return;
  968. }
  969. this.playVideo(res.data.data)
  970. }
  971. }
  972. })
  973. },
  974. async goLive(item) {
  975. let data = await this.studyRecordGetChannelBasicInfo(item.liveUrl);
  976. let nowTime = +this.$method.timest();
  977. if (item.liveStartTime > nowTime) {
  978. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  979. uni.showToast({
  980. title: '直播未开始',
  981. icon: 'none'
  982. });
  983. return;
  984. }
  985. } else if (
  986. item.liveStartTime < nowTime &&
  987. item.liveEndTime > nowTime
  988. ) {
  989. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  990. uni.showToast({
  991. title: '暂无直播',
  992. icon: 'none'
  993. });
  994. return;
  995. }
  996. } else if (item.liveEndTime < nowTime) {
  997. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  998. uni.showToast({
  999. title: '直播已结束',
  1000. icon: 'none'
  1001. });
  1002. return;
  1003. }
  1004. }
  1005. let moduleId = item.moduleId || 0;
  1006. let chapterId = item.chapterId || 0;
  1007. let sectionId = item.sectionId || item.menuId;
  1008. let uuid = new Date().valueOf() + ""
  1009. // buyCourse 是否购买课程:1是 0否
  1010. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+
  1011. item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+
  1012. '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
  1013. uni.navigateTo({
  1014. url:`../../pages/webview/index?url=`+encode
  1015. })
  1016. },
  1017. studyRecordMenuAllList() {
  1018. this.$api.studyRecordMenuAllList({
  1019. courseId:this.courseId,
  1020. gradeId:this.gradeId,
  1021. goodsId:this.goodsId
  1022. }).then(res => {
  1023. let nowTime = Number(new Date().getTime()/1000).toFixed(0)
  1024. // this.livingItem = res.data.data[0]
  1025. this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
  1026. })
  1027. },
  1028. studyRecordGetChannelBasicInfo(channelId) {
  1029. return new Promise((resolve) => {
  1030. this.$api
  1031. .studyRecordGetChannelBasicInfo({
  1032. channelId,
  1033. })
  1034. .then((res) => {
  1035. resolve(res.data.data);
  1036. });
  1037. });
  1038. },
  1039. polyvLiveHistoryChatMsgList() {
  1040. this.$api.polyvLiveHistoryChatMsgList({
  1041. sectionId:this.playSectionId,
  1042. channelId:this.sectionItem.liveUrl
  1043. }).then(res => {
  1044. this.historyChatMsgList = res.data.data
  1045. })
  1046. },
  1047. /**
  1048. * 获取业务层次详情
  1049. */
  1050. // courseBusiness() {
  1051. // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1052. // this.businessData = res.data.data;
  1053. // });
  1054. // },
  1055. /**
  1056. * 计算tabs宽度
  1057. */
  1058. itemWidth() {
  1059. return 100 / this.list.length + "%";
  1060. },
  1061. /**
  1062. * 获取讲义权限
  1063. */
  1064. // courseHandouts() {
  1065. // this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1066. // this.courseHandoutsData = res.data.data;
  1067. // });
  1068. // },
  1069. findMenuNextSection(index) {
  1070. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1071. let item = this.reMenuList[i];
  1072. if (item.type == 3) {
  1073. return item;
  1074. }
  1075. }
  1076. return {};
  1077. },
  1078. loadedmetadata(e) {
  1079. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1080. this.hasStart = true;
  1081. uni.$off('playPause')
  1082. uni.$on('playPause',() => {
  1083. polyvPlayerContext.pause()
  1084. })
  1085. if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
  1086. this.postStudyRecord(0)
  1087. }
  1088. },
  1089. getPhotoLastRecord() {
  1090. let self = this;
  1091. let data = {
  1092. sectionId: parseInt(self.playSectionId),
  1093. goodsId: parseInt(self.goodsId),
  1094. courseId: parseInt(self.courseId),
  1095. gradeId: parseInt(self.gradeId),
  1096. chapterId: parseInt(self.chapterId),
  1097. moduleId: parseInt(self.moduleId),
  1098. orderGoodsId: this.orderGoodsId,
  1099. };
  1100. this.$api.getPhotoLastRecord(data).then((res) => {
  1101. if (res.data.code == 200) {
  1102. //清空历史数据
  1103. self.photoHistoryList = [];
  1104. this.photoIndex = 0;
  1105. self.photoList = [];
  1106. for (let i = 0; i < res.data.data.length; i++) {
  1107. //-2存储随机拍照数组
  1108. if (res.data.data[i].photoIndex == -2) {
  1109. self.photoList = res.data.data[i].timeInterval.split(",");
  1110. } else {
  1111. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1112. }
  1113. }
  1114. }
  1115. });
  1116. },
  1117. //postTime 只提交随机时间
  1118. postCoursePhotoRecord(postTime = false) {
  1119. return new Promise((resolve, reject) => {
  1120. let currentTime = 0;
  1121. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1122. if (polyvPlayerContext) {
  1123. currentTime = polyvPlayerContext.getCurrentTime();
  1124. }
  1125. let self = this;
  1126. let photoIndex = self.photoIndex;
  1127. let data = {
  1128. photo: self.ossAvatarUrl,
  1129. sectionId: parseInt(self.playSectionId),
  1130. goodsId: parseInt(self.goodsId),
  1131. courseId: parseInt(self.courseId),
  1132. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1133. gradeId: parseInt(self.gradeId),
  1134. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1135. photoNum: parseInt(self.photoNum),
  1136. chapterId: parseInt(self.chapterId),
  1137. moduleId: parseInt(self.moduleId),
  1138. timeInterval: postTime ? self.photoList.join(",") : "",
  1139. orderGoodsId: this.orderGoodsId,
  1140. };
  1141. // console.log("提交接口", data);
  1142. this.$api
  1143. .coursePhotoRecord(data)
  1144. .then((res) => {
  1145. // console.log(res,'postCoursePhotoRecord')
  1146. if (res.data.code == 200) {
  1147. resolve();
  1148. } else {
  1149. reject();
  1150. }
  1151. })
  1152. .catch((err) => {
  1153. reject();
  1154. });
  1155. });
  1156. },
  1157. randomNum(minNum, maxNum) {
  1158. switch (arguments.length) {
  1159. case 1:
  1160. return parseInt(Math.random() * minNum + 1, 10);
  1161. break;
  1162. case 2:
  1163. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1164. break;
  1165. default:
  1166. return 0;
  1167. break;
  1168. }
  1169. },
  1170. //配置随机拍照时间
  1171. configPhoto() {
  1172. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1173. let totalVideoTime = polyvPlayerContext.getDuration();
  1174. let duration = polyvPlayerContext.getCurrentTime();
  1175. let photoNum = this.photoNum;
  1176. if (!this.photoConfig) {
  1177. this.photoConfig = true;
  1178. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1179. // if(spaceTime<5){//区间小于5秒
  1180. // photoNum = Math.floor(totalVideoTime/5)
  1181. // spaceTime = 5
  1182. // }
  1183. // if(photoNum<1){
  1184. // photoNum = 1 //只要设置,至少拍一次
  1185. // spaceTime = totalVideoTime
  1186. // }
  1187. // let initSpace = 0
  1188. //没有历史拍照间隔数据
  1189. if (this.photoList.length == 0) {
  1190. if (totalVideoTime >= 900) {
  1191. //大于15分钟
  1192. if (photoNum == 1) {
  1193. //开头拍1张
  1194. this.photoList.push(0);
  1195. } else if (photoNum == 3) {
  1196. //拍3张
  1197. this.photoList.push(0); //开头拍一张
  1198. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1199. let centerMinTime = centerTime - 300; //前后5分钟
  1200. let centerMaxTime = centerTime + 300;
  1201. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1202. this.photoList.push(centerTakeTime); //中间拍一张
  1203. let endMaxTime = totalVideoTime - 60;
  1204. let endMinTime = totalVideoTime - 300;
  1205. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1206. this.photoList.push(endTakeTime); //最后拍一张
  1207. }
  1208. } else {
  1209. //小于15分钟,只拍前后各一张
  1210. if (photoNum == 1) {
  1211. //开头拍1张
  1212. this.photoList.push(0);
  1213. } else if (photoNum == 3) {
  1214. //拍2张
  1215. if (totalVideoTime <= 300) {
  1216. //小于5分钟
  1217. this.photoList.push(0); //开头拍一张
  1218. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1219. this.photoList.push(endTakeTime);
  1220. } else {
  1221. this.photoList.push(0); //开头拍一张
  1222. let endMaxTime = totalVideoTime - 60;
  1223. let endMinTime = totalVideoTime - 300;
  1224. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1225. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1226. }
  1227. }
  1228. }
  1229. // for(let i=0;i<photoNum;i++){
  1230. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1231. // if(s>totalVideoTime){
  1232. // s = totalVideoTime-1
  1233. // }
  1234. // if(s<=5){
  1235. // s =5 //避免出现5秒内拍照时间
  1236. // }
  1237. // this.photoList.push(s)
  1238. // initSpace+=spaceTime
  1239. // }
  1240. // console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1241. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1242. }
  1243. // console.log(this.photoList, "随机拍照时间数组");
  1244. //兼容已有观看历史
  1245. for (let i = 0; i < this.photoList.length - 1; i++) {
  1246. if (
  1247. this.photoList[i] < duration &&
  1248. this.photoList[i + 1] > duration
  1249. ) {
  1250. this.photoIndex = i + 1;
  1251. break;
  1252. }
  1253. if (duration > this.photoList[this.photoList.length - 1]) {
  1254. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1255. break;
  1256. }
  1257. }
  1258. }
  1259. },
  1260. getLiveUid(channelId) {
  1261. let self = this;
  1262. return new Promise((resolve) => {
  1263. let data = {
  1264. channelId: channelId,
  1265. orderGoodsId: this.orderGoodsId,
  1266. };
  1267. self.$api.polyvSign(data).then((res) => {
  1268. resolve(res.data.data);
  1269. });
  1270. });
  1271. },
  1272. timeEventLiving() {
  1273. if (plv != null) {
  1274. if (this.livePlay) {
  1275. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1276. if (this.liveDuration == 2) {
  1277. //直播第2秒拍照
  1278. console.log(this.channelItem)
  1279. console.log(this.photoHistoryList,'this.photoHistoryList')
  1280. if (
  1281. this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
  1282. this.channelItem.learning != 1 && this.photoHistoryList.length == 0
  1283. ) {
  1284. //开启直播拍照
  1285. this.openPhoto();
  1286. } else {
  1287. this.postStudyRecord(0);
  1288. }
  1289. }
  1290. }
  1291. }
  1292. },
  1293. playerLiveStatusChange(e) {
  1294. const status = e.detail.status;
  1295. // console.log("直播状态", status);
  1296. if (status === "live") {
  1297. // console.log("开始直播");
  1298. //开始播放
  1299. if (this.timer) {
  1300. clearInterval(this.timer);
  1301. }
  1302. this.livePlay = true;
  1303. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1304. }
  1305. if (status === "end") {
  1306. this.hasStart = false;
  1307. if (this.livePlay) {
  1308. //只有播放过的结束才提交,避免未开播触发结束
  1309. this.postStudyRecord(1);
  1310. }
  1311. // console.log("结束直播");
  1312. this.livePlay = false;
  1313. // 未开始
  1314. }
  1315. },
  1316. closePlv() {
  1317. if (plv) {
  1318. plv.destroy();
  1319. }
  1320. },
  1321. playChannel(item) {
  1322. if (this.timer) {
  1323. clearInterval(this.timer);
  1324. }
  1325. this.startStatus = true;
  1326. console.log('11111111111')
  1327. this.initLive();
  1328. },
  1329. setLiveOption(status) {
  1330. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  1331. this.detail;
  1332. const playRecordFile =
  1333. playbackEnabled && recordFileSimpleModel && status === "end";
  1334. // if(this.channelItem.sectionType == 3) { //回放
  1335. // // this.videoOption = {
  1336. // // mode: "live",
  1337. // // uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1338. // // cid: this.playChannelId,
  1339. // // openId: this.userInfo.userAccount,
  1340. // // isAutoChange: false,
  1341. // // forceVideo: false,
  1342. // // };
  1343. // } else { //直播
  1344. this.videoOption = {
  1345. mode: "live",
  1346. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1347. cid: this.playChannelId,
  1348. openId: this.userInfo.userAccount,
  1349. isAutoChange: false,
  1350. forceVideo: false,
  1351. };
  1352. // }
  1353. },
  1354. async initLive() {
  1355. this.liveObj = await this.getLiveUid(this.playChannelId);
  1356. this.initLiveOk = true;
  1357. let optionsData = {};
  1358. optionsData.mode = "live";
  1359. optionsData.forceVideo = false;
  1360. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  1361. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  1362. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  1363. let self = this;
  1364. this.closePlv();
  1365. plv.init(optionsData).then(({ detail, chat }) => {
  1366. self.liveDetail = detail;
  1367. // 设置mode为live的videoOption
  1368. this.setLiveOption();
  1369. if (detail.isPPT) {
  1370. chat.on(chat.events.SLICESTART, () => {
  1371. // 开始直播
  1372. });
  1373. } else {
  1374. plv.api.getOrdinaryLiveStatus(detail.stream);
  1375. }
  1376. });
  1377. },
  1378. openSetting(res) {
  1379. // console.log(res, 98);
  1380. },
  1381. getCameraSetting() {
  1382. const self = this;
  1383. wx.getSetting({
  1384. success: (res) => {
  1385. if (res.authSetting["scope.camera"]) {
  1386. // 用户已经授权
  1387. self.showSet = false;
  1388. } else {
  1389. // 用户还没有授权,向用户发起授权请求
  1390. wx.authorize({
  1391. scope: "scope.camera",
  1392. success() {
  1393. // 用户同意授权
  1394. self.showSet = false;
  1395. },
  1396. fail() {
  1397. // 用户不同意授权
  1398. self.showSet = true;
  1399. /* wx.showToast({
  1400. title: '摄像头授权失败',
  1401. icon: 'none',
  1402. duration: 3000
  1403. }) */
  1404. },
  1405. });
  1406. }
  1407. },
  1408. fail: (res) => {},
  1409. });
  1410. },
  1411. studyNotice() {
  1412. this.noticeShow = true;
  1413. },
  1414. //播放笔记视频
  1415. async playNoteVideo(item) {
  1416. console.log(item, "noteItem");
  1417. if (this.timer) {
  1418. clearInterval(this.timer);
  1419. }
  1420. if (this.vid) {
  1421. //切换视频
  1422. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1423. polyvPlayerContext.changeVid(item.recordingUrl);
  1424. } else {
  1425. this.vid = item.recordingUrl;
  1426. }
  1427. this.recordObj = { videoCurrentTime: item.noteSecond };
  1428. if (this.recordObj.videoCurrentTime) {
  1429. this.needSeek = true; //需要跳转到播放记录
  1430. }
  1431. this.startStatus = true;
  1432. console.log('222222222222')
  1433. //获取节笔记
  1434. this.getNoteList();
  1435. },
  1436. //正常播放视频
  1437. async playVideo(item) {
  1438. console.log(item);
  1439. if (item.sectionType == 3) { // 回放的不播放
  1440. console.log('回放的不播放')
  1441. return
  1442. }
  1443. if (this.timer) {
  1444. clearInterval(this.timer);
  1445. }
  1446. if (this.vid) {
  1447. //切换视频
  1448. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1449. polyvPlayerContext.changeVid(item.recordingUrl);
  1450. } else {
  1451. console.log(2)
  1452. this.vid = item.recordingUrl;
  1453. }
  1454. this.recordObj = null;
  1455. this.recordObj = await this.getRecordLast();
  1456. this.needSeek = true; //跳转到播放记录
  1457. this.startStatus = true;
  1458. console.log('3333333333333')
  1459. //获取节笔记
  1460. this.getNoteList();
  1461. },
  1462. getRecordLast() {
  1463. let self = this;
  1464. return new Promise((resolve) => {
  1465. let data = {
  1466. gradeId: Number(self.gradeId),
  1467. goodsId: Number(self.goodsId),
  1468. sectionId: Number(self.playSectionId),
  1469. courseId: Number(self.courseId),
  1470. chapterId: parseInt(self.chapterId),
  1471. moduleId: parseInt(self.moduleId),
  1472. orderGoodsId: this.orderGoodsId,
  1473. };
  1474. self.$api.recordLast(data).then((res) => {
  1475. resolve(res.data.data);
  1476. });
  1477. });
  1478. },
  1479. jumpNote(item) {
  1480. this.noteId = item.noteId;
  1481. //没视频播放
  1482. if (this.playSectionId == 0) {
  1483. console.log("即将跳到笔记位置1");
  1484. this.$u.toast("即将跳到笔记位置");
  1485. this.$store.commit("setPlaySectionId", {
  1486. playSectionId: item.sectionId,
  1487. });
  1488. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1489. this.playNoteVideo(item);
  1490. } else {
  1491. //正在看当前笔记视频
  1492. console.log("即将跳到笔记位置2");
  1493. this.$u.toast("即将跳到笔记位置");
  1494. //跳到笔记时刻
  1495. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1496. polyvPlayerContext.seek(item.noteSecond);
  1497. polyvPlayerContext.play();
  1498. }
  1499. },
  1500. postNote() {
  1501. let self = this;
  1502. if (!(this.playSectionId > 0)) {
  1503. this.$u.toast("目前无播放视频");
  1504. return;
  1505. }
  1506. if (!this.noteValue) {
  1507. this.$u.toast("请输入内容");
  1508. return;
  1509. }
  1510. // if (!this.gradeId) { // 直播课程没有班级,去掉判断,默认为0
  1511. // this.$u.toast("暂无班级数据");
  1512. // return;
  1513. // }
  1514. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1515. let noteDate = this.$method.getZeroTime();
  1516. let noteSecond = polyvPlayerContext.getCurrentTime();
  1517. console.log(noteSecond, 698);
  1518. if (!noteSecond) {
  1519. if (noteSecond == 0) {
  1520. //播放结束
  1521. noteSecond = polyvPlayerContext.getDuration();
  1522. console.log(noteSecond, 63398);
  1523. }
  1524. if (!noteSecond) {
  1525. this.$u.toast("视频暂未开始");
  1526. return;
  1527. }
  1528. }
  1529. let data = {
  1530. gradeId: this.gradeId,
  1531. goodsId: this.goodsId,
  1532. sectionId: this.playSectionId,
  1533. courseId: this.courseId,
  1534. noteText: this.noteValue,
  1535. noteDate: noteDate,
  1536. noteSecond: noteSecond,
  1537. orderGoodsId: this.orderGoodsId,
  1538. };
  1539. // /user/note 新增用户笔记
  1540. this.$api.postNote(data).then((res) => {
  1541. if (res.data.code == 200) {
  1542. this.$u.toast("发布成功");
  1543. self.getNoteList();
  1544. this.noteValue = "";
  1545. }
  1546. });
  1547. },
  1548. getNoteList() {
  1549. let self = this;
  1550. self.noteList = [];
  1551. let data = {
  1552. courseId: this.courseId,
  1553. gradeId: this.gradeId,
  1554. goodsId: this.goodsId,
  1555. orderGoodsId: this.orderGoodsId,
  1556. };
  1557. if (this.playSectionId > 0) {
  1558. data.sectionId = this.playSectionId;
  1559. }
  1560. this.$api.noteList(data).then((res) => {
  1561. if (res.data.code == 200) {
  1562. self.noteList = res.data.rows;
  1563. }
  1564. });
  1565. },
  1566. delAnswer(answerId) {
  1567. let self = this;
  1568. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  1569. this.$api.delAnswer(data).then((res) => {
  1570. if (res.data.code == 200) {
  1571. self.getAnswerList();
  1572. }
  1573. });
  1574. },
  1575. clearCtx() {
  1576. console.log(4234);
  1577. this.placeholder = "您可以在这里输入答疑内容";
  1578. this.ctxValue = "";
  1579. this.assignUserId = 0;
  1580. },
  1581. focusNote(event) {
  1582. console.log('event', event.detail.height)
  1583. this.bottomHeight = event.detail.height
  1584. },
  1585. blurNote() {
  1586. this.bottomHeight = 0
  1587. },
  1588. blur() {
  1589. this.bottomHeight = 0
  1590. this.clearTimer = setTimeout(() => {
  1591. this.ctxValue = ""
  1592. this.isFocus = false;
  1593. this.assignUserId = 0;
  1594. this.placeholder = '您可以在这里输入答疑内容';
  1595. },2000)
  1596. },
  1597. replyContent(item) {
  1598. this.isFocus = true;
  1599. this.assignUserId = item.userId;
  1600. this.placeholder = "@" + item.realname;
  1601. },
  1602. delContent(item) {
  1603. this.delAnswer(item.answerId);
  1604. },
  1605. postAnswer() {
  1606. let self = this;
  1607. let data = {
  1608. courseId: this.courseId,
  1609. answerText: this.ctxValue,
  1610. goodsId: this.goodsId,
  1611. orderGoodsId: this.orderGoodsId,
  1612. };
  1613. if (this.assignUserId > 0) {
  1614. data.assignUserId = this.assignUserId;
  1615. }
  1616. this.$api.postAnswer(data).then((res) => {
  1617. if (res.data.code == 200) {
  1618. this.$u.toast("发布成功");
  1619. self.getAnswerList();
  1620. this.isFocus = false;
  1621. this.placeholder = "您可以在这里输入答疑内容";
  1622. this.ctxValue = "";
  1623. this.assignUserId = 0;
  1624. }
  1625. });
  1626. },
  1627. postContent() {
  1628. if (!this.ctxValue || this.ctxValue == "") {
  1629. this.$u.toast("请输入内容");
  1630. return;
  1631. }
  1632. this.postAnswer();
  1633. },
  1634. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1635. console.log("status", status);
  1636. let currentTime = 0;
  1637. let PlayDuration = 0;
  1638. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1639. if (polyvPlayerContext) {
  1640. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  1641. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  1642. }
  1643. if (this.playChannelId > 0) {
  1644. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1645. }
  1646. let self = this;
  1647. let data = {
  1648. fromPlat: 1, //来源平台 1小程序 2网站
  1649. photo: self.ossAvatarUrl,
  1650. sectionId: parseInt(sectionId),
  1651. goodsId: parseInt(self.goodsId),
  1652. courseId: parseInt(self.courseId),
  1653. orderGoodsId: this.orderGoodsId,
  1654. studyDuration: parseInt(
  1655. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1656. ),
  1657. gradeId: parseInt(self.gradeId),
  1658. chapterId: parseInt(self.chapterId),
  1659. moduleId: parseInt(self.moduleId),
  1660. videoCurrentTime: parseInt(
  1661. currentTime > 0 ? currentTime : self.studyDuration
  1662. ),
  1663. };
  1664. if (status > 0) {
  1665. console.log(sectionId, "sectionId");
  1666. data.status = status;
  1667. }
  1668. console.log("提交接口", data);
  1669. this.$api.studyRecord(data).then((res) => {
  1670. if (res.data.code == 200) {
  1671. if (status > 0) {
  1672. let moduleId = this.moduleId || 0;
  1673. let chapterId = this.chapterId || 0;
  1674. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1675. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1676. console.log(playNextId, "playNextId");
  1677. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  1678. uni.$emit("playNext" + playNextIdisRebuild, {
  1679. fromRebuild: this.isRebuild,
  1680. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1681. uni.$emit("playNext" + playNextId); //通知播放结束
  1682. }
  1683. self.ossAvatarUrl = "";
  1684. } else {
  1685. this.uploadLock = false;
  1686. uni.showToast({
  1687. icon: "none",
  1688. title: res.data.msg,
  1689. });
  1690. }
  1691. console.log(res, "res");
  1692. });
  1693. },
  1694. uploadFile(options, int) {
  1695. console.log(options)
  1696. var self = this;
  1697. return new Promise((resolve, reject) => {
  1698. var data = {
  1699. imageStatus: int,
  1700. gradeId: this.gradeId,
  1701. orderGoodsId: this.orderGoodsId,
  1702. };
  1703. self.$api.aliyunpolicy(data).then((res) => {
  1704. if (res.data.code != 200) {
  1705. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1706. return;
  1707. }
  1708. var ossToken = res.data.data.resultContent;
  1709. if (ossToken.host == null || ossToken.host == undefined) {
  1710. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1711. return;
  1712. }
  1713. uni.uploadFile({
  1714. url: ossToken.host,
  1715. name: "file",
  1716. filePath: options,
  1717. fileType: "image",
  1718. header: {
  1719. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1720. },
  1721. formData: {
  1722. key: ossToken.dir,
  1723. OSSAccessKeyId: ossToken.accessid,
  1724. policy: ossToken.policy,
  1725. Signature: ossToken.signature,
  1726. callback: ossToken.callback,
  1727. success_action_status: 200,
  1728. },
  1729. success: (result) => {
  1730. // if (result.statusCode === 200) {
  1731. this.$u.toast('上传成功')
  1732. self.ossAvatarUrl = ossToken.dir;
  1733. resolve();
  1734. // } else {
  1735. // uni.showToast({
  1736. // title: "上传失败",
  1737. // icon: "none",
  1738. // });
  1739. // this.openPhoto();
  1740. // return;
  1741. // }
  1742. },
  1743. fail: (error) => {
  1744. uni.showToast({
  1745. title: "上传接口报错,请重新拍照上传" + error,
  1746. icon: "none",
  1747. });
  1748. this.openPhoto();
  1749. return;
  1750. },
  1751. });
  1752. });
  1753. });
  1754. },
  1755. imageInfos() {
  1756. var self = this;
  1757. return new Promise((resolve, reject) => {
  1758. uni.getImageInfo({
  1759. src: self.avatarUrl,
  1760. success: async (res) => {
  1761. let canvasWidth = res.width; //图片原始长宽
  1762. let canvasHeight = res.height;
  1763. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1764. uni.compressImage({
  1765. src: self.avatarUrl,
  1766. quality: 75,
  1767. width: "35%",
  1768. height: "35%",
  1769. success: async (rest) => {
  1770. const waitUpload = await self.uploadFile(
  1771. rest.tempFilePath,
  1772. 0
  1773. );
  1774. resolve(waitUpload);
  1775. },
  1776. });
  1777. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1778. uni.compressImage({
  1779. src: self.avatarUrl,
  1780. quality: 75,
  1781. width: "50%",
  1782. height: "50%",
  1783. success: async (rest) => {
  1784. const waitUpload = await self.uploadFile(
  1785. rest.tempFilePath,
  1786. 0
  1787. );
  1788. resolve(waitUpload);
  1789. },
  1790. });
  1791. } else {
  1792. console.log("无需压缩");
  1793. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  1794. resolve(waitUpload);
  1795. }
  1796. },
  1797. fail: (err) => {
  1798. this.$u.toast('图片上传失败')
  1799. }
  1800. });
  1801. });
  1802. },
  1803. timeEvent() {
  1804. let self = this;
  1805. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1806. if (polyvPlayerContext != null) {
  1807. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  1808. // console.log(this.playTime,789,this.photoHistoryList)
  1809. //判断是否需要拍照
  1810. if (this.photoNum > 0) {
  1811. this.configPhoto();
  1812. let photoTime = 0; //获取拍照秒数
  1813. for (let i = 0; i < this.photoList.length; i++) {
  1814. photoTime = Number(this.photoList[i]); //获取拍照秒数
  1815. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  1816. //3秒区间内才触发拍照,避免拉动滚动条
  1817. if (
  1818. this.photoHistoryList.indexOf(i) < 0 &&
  1819. this.sectionItem.learning != 1
  1820. ) {
  1821. //不存在拍照历史,没有重修过,没有学过,则拍照
  1822. //启动拍照
  1823. //暂停
  1824. polyvPlayerContext.exitFullScreen();
  1825. polyvPlayerContext.pause();
  1826. this.photoIndex = i;
  1827. this.openPhoto();
  1828. }
  1829. }
  1830. }
  1831. }
  1832. }
  1833. },
  1834. closeToast() {
  1835. clearTimeout(this.toastTimer);
  1836. this.videoToastShow = false;
  1837. },
  1838. restart() {
  1839. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1840. polyvPlayerContext.seek(0);
  1841. console.log("seek1");
  1842. clearTimeout(this.toastTimer);
  1843. this.videoToastShow = false;
  1844. },
  1845. // 新增用户视频学习日志
  1846. studyLog() {
  1847. this.$http({
  1848. url: '/user/study/log',
  1849. method: 'post',
  1850. data: {
  1851. goodsId: this.goodsId,
  1852. courseId: this.courseId,
  1853. moduleId: this.moduleId || 0,
  1854. chapterId: this.chapterId || 0,
  1855. sectionId: this.playSectionId || 0,
  1856. fromPlat: 1, //来源平台 1小程序 2PC网站
  1857. goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  1858. orderGoodsId: this.orderGoodsId,
  1859. }
  1860. }).then((res) => {
  1861. console.log('直播的用户学习日志:', res)
  1862. })
  1863. },
  1864. onStateChange(newstate, oldstate) {
  1865. console.log('直播视频的开始播放事件', newstate.detail.newstate,this.needSeek)
  1866. if (newstate.detail.newstate == "playing") {
  1867. if (this.needSeek) {
  1868. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1869. if (this.recordObj.videoCurrentTime) {
  1870. console.log("seek2");
  1871. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  1872. this.seekTime = this.$method.secondToDate(
  1873. this.recordObj.videoCurrentTime
  1874. );
  1875. this.videoToastShow = true;
  1876. this.toastTimer = setTimeout(() => {
  1877. this.videoToastShow = false;
  1878. }, 3000);
  1879. } else {
  1880. polyvPlayerContext.seek(1); //避免相同节继续播放
  1881. console.log("seek3");
  1882. }
  1883. polyvPlayerContext.play();
  1884. this.needSeek = false;
  1885. // 新增用户视频学习日志
  1886. this.studyLog()
  1887. }
  1888. //开始播放
  1889. if (this.timer) {
  1890. clearInterval(this.timer);
  1891. }
  1892. this.timer = setInterval(this.timeEvent, 1000); //定时器
  1893. }
  1894. if (newstate.detail.newstate == "pause") {
  1895. clearInterval(this.timer);
  1896. //暂停提交记录
  1897. /* this.ossAvatarUrl = ""
  1898. this.postStudyRecord() */
  1899. }
  1900. if (newstate.detail.newstate == "ended") {
  1901. clearInterval(this.timer);
  1902. uni.showToast({
  1903. icon: "none",
  1904. title: "播放完毕",
  1905. });
  1906. this.hasStart = false;
  1907. this.postStudyRecord(1);
  1908. // uni.$emit('playNext') //播放重修下一节
  1909. }
  1910. },
  1911. //拍照
  1912. openPhoto() {
  1913. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1914. if (polyvPlayerContext) {
  1915. polyvPlayerContext.exitFullScreen();
  1916. }
  1917. this.enableAutoRotation = false;
  1918. this.photoPopup = true;
  1919. this.isTaking = true;
  1920. uni.setKeepScreenOn({
  1921. keepScreenOn: true,
  1922. });
  1923. uni.authorize({
  1924. scope: "scope.camera",
  1925. success() {},
  1926. });
  1927. },
  1928. /**
  1929. * 人脸匹配
  1930. */
  1931. faceRecognition() {
  1932. return new Promise((resolve) => {
  1933. let fileSystem = uni.getFileSystemManager();
  1934. fileSystem.readFile({
  1935. filePath: `${this.avatarUrl}`,
  1936. encoding: "base64",
  1937. position: 0,
  1938. success: (res) => {
  1939. console.log(res);
  1940. let base64 = "data:image/jpg;base64," + res.data;
  1941. console.log({
  1942. imageA: base64,
  1943. orderGoodsId: this.orderGoodsId,
  1944. gradeId: this.gradeId,
  1945. },'base64Data')
  1946. this.$api
  1947. .faceCertificationCompareFace({
  1948. imageA: base64,
  1949. orderGoodsId: this.orderGoodsId,
  1950. gradeId: this.gradeId,
  1951. })
  1952. .then((res) => {
  1953. console.log(res, "res");
  1954. resolve(res.data.data);
  1955. });
  1956. },
  1957. fail(err) {
  1958. console.error(err, "err");
  1959. },
  1960. });
  1961. });
  1962. },
  1963. async submit() {
  1964. if (this.uploadLock) {
  1965. return;
  1966. }
  1967. this.uploadLock = true;
  1968. let compareFaceData = await this.faceRecognition();
  1969. console.log(compareFaceData,'compareFaceData')
  1970. if (compareFaceData >= 80) {
  1971. const waitYS = await this.imageInfos();
  1972. this.postCoursePhotoRecord()
  1973. .then((res) => {
  1974. this.photoHistoryList.push(this.photoIndex);
  1975. this.postStudyRecord(); //提交记录
  1976. //恢复播放
  1977. uni.setKeepScreenOn({
  1978. keepScreenOn: false,
  1979. });
  1980. this.photoPopup = false;
  1981. this.uploadLock = false;
  1982. this.enableAutoRotation = true;
  1983. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1984. if (polyvPlayerContext != null) {
  1985. polyvPlayerContext.play();
  1986. }
  1987. })
  1988. .catch((err) => {
  1989. uni.showToast({
  1990. title: "上传接口报错,请重新拍照上传" + err,
  1991. icon: "none",
  1992. });
  1993. this.uploadLock = false;
  1994. this.openPhoto();
  1995. });
  1996. } else {
  1997. uni.showToast({
  1998. title: "人脸匹配不通过,请重新拍照上传",
  1999. icon: "none",
  2000. duration: 2000,
  2001. });
  2002. setTimeout(() => {
  2003. this.uploadLock = false;
  2004. this.openPhoto();
  2005. }, 2000);
  2006. return;
  2007. }
  2008. },
  2009. reTake() {
  2010. this.isTaking = true;
  2011. },
  2012. //确认拍照
  2013. takePhoto() {
  2014. var self = this;
  2015. const ctx = uni.createCameraContext();
  2016. ctx.takePhoto({
  2017. quality: "high",
  2018. success: (res) => {
  2019. console.log(res.tempImagePath);
  2020. self.avatarUrl = res.tempImagePath;
  2021. this.isTaking = false;
  2022. // self.submit();
  2023. // self.photoPopup = false;
  2024. // self.enableAutoRotation = true;
  2025. },
  2026. fail: (err) => {
  2027. console.log(err);
  2028. },
  2029. });
  2030. },
  2031. playError(e) {
  2032. console.log(e);
  2033. },
  2034. //拍照报错
  2035. error(e) {
  2036. console.log(e.detail);
  2037. },
  2038. //关闭相机
  2039. closePhoto() {
  2040. this.photoPopup = false;
  2041. self.enableAutoRotation = true;
  2042. },
  2043. /**
  2044. * 进入全屏
  2045. */
  2046. fullscreenchange(event) {
  2047. console.log('进入全屏',event);
  2048. if (event.detail.direction == "vertical") {
  2049. this.navShow = true;
  2050. } else if (event.detail.direction == "horizontal") {
  2051. this.navShow = false;
  2052. }
  2053. },
  2054. getGoodsDetail() {
  2055. console.log('goodsDetail(------')
  2056. let self = this;
  2057. // goods/'+ data
  2058. this.$api.goodsDetail(this.goodsId).then((res) => {
  2059. self.goodsData = res.data.data;
  2060. console.log(self.gradeId, "班级ID");
  2061. // this.courseBusiness();
  2062. // this.courseHandouts();
  2063. self.getMenuList();
  2064. console.log(self.goodsData,'self.goodsData')
  2065. //获取节笔记
  2066. this.getNoteList();
  2067. if (self.goodsData.goodsPlayConfig) {
  2068. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2069. if (self.goodsPlayConfig.autoPlay > 0) {
  2070. self.autoplay = true;
  2071. }
  2072. if (self.goodsPlayConfig.drag > 0) {
  2073. self.isAllowSeek = "yes";
  2074. }
  2075. if (self.goodsPlayConfig.speed > 0) {
  2076. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2077. }
  2078. }
  2079. if (self.goodsData.goodsPhotographConfig) {
  2080. self.goodsPhotographConfig = JSON.parse(
  2081. self.goodsData.goodsPhotographConfig
  2082. );
  2083. if (self.goodsPhotographConfig.photoNum > 0) {
  2084. self.photoNum = self.goodsPhotographConfig.photoNum;
  2085. console.log(self.photoNum, 777777);
  2086. }
  2087. }
  2088. });
  2089. },
  2090. startVideo() {
  2091. this.startStatus = true;
  2092. console.log('444444444')
  2093. },
  2094. getAnswerList() {
  2095. let self = this;
  2096. this.$api
  2097. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2098. .then((res) => {
  2099. if (res.data.code == 200) {
  2100. self.answerList = res.data.rows;
  2101. }
  2102. });
  2103. },
  2104. getMenuList() {
  2105. // let self = this;
  2106. // /course/menuList
  2107. this.$api
  2108. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2109. .then((res) => {
  2110. if (res.data.code == 200) {
  2111. for (let i = 0; i < res.data.rows.length; i++) {
  2112. let item = res.data.rows[i];
  2113. item.down = true;
  2114. item.id = item.menuId;
  2115. item.name = item.menuName;
  2116. item.menuType = item.type;
  2117. }
  2118. this.menuList = res.data.rows;
  2119. this.reStart = true
  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>