detail.vue 94 KB

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