detail.vue 87 KB

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