detail.vue 87 KB

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