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