detail.vue 89 KB

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