detail.vue 93 KB

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