detail.vue 87 KB

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