detail.vue 84 KB

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