detail.vue 113 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959
  1. <template>
  2. <view class="polyv_detail">
  3. <uni-nav-bar
  4. left-icon="back"
  5. :statusBar="true"
  6. fixed="true"
  7. :title="detail.courseName || '课程详情'"
  8. @clickLeft="clickLeft"
  9. ></uni-nav-bar>
  10. <view id="top">
  11. <view class="video_box" v-if="!startStatus">
  12. <image
  13. :src="$method.splitImgHost(goodsData.coverUrl)"
  14. mode="widthFix"
  15. style="width: 100%; height: 421rpx"
  16. ></image>
  17. </view>
  18. <view v-else>
  19. <my-player
  20. ref="player"
  21. :playVid="playVID"
  22. :autoplay="autoplay"
  23. :allowSeek="isAllowSeek"
  24. :playbackRate="playbackRate"
  25. :videoCurrentTime="recordObj.videoCurrentTime || 0"
  26. @playing="playing"
  27. @pause="pause"
  28. @ended="ended"
  29. @loadedmetadata="loadedmetadata"
  30. @timeupdate="timeupdate"
  31. ></my-player>
  32. </view>
  33. <view class="course_name">
  34. <view class="course_titles">
  35. <view class="video_t1" :class="{ one: !goodsData.buyNote }">{{
  36. detail.courseName
  37. }}</view>
  38. <view class="notice_wrap" v-if="goodsData.buyNote">
  39. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  40. </view>
  41. <view
  42. class="toggle_course"
  43. v-if="goodsTeacher.length > 1"
  44. @click="changeCourses()"
  45. >
  46. <image
  47. class="img"
  48. src="/pages3/static/imgs/toggle.png"
  49. mode="widthFix"
  50. ></image>
  51. <view class="toggle_name">切换课程</view>
  52. <!-- courseTotal -->
  53. <view class="numbers">共{{ goodsTeacher.length }}门</view>
  54. </view>
  55. </view>
  56. </view>
  57. <u-line color="#D6D6DB" />
  58. <view>
  59. <view>
  60. <u-tabs
  61. :item-width="itemWidth()"
  62. :list="list"
  63. font-size="32"
  64. bar-width="24"
  65. :current="current"
  66. @change="change"
  67. active-color="#007AFF"
  68. ></u-tabs>
  69. </view>
  70. </view>
  71. <u-line color="#D6D6DB" />
  72. </view>
  73. <view class="box" :class="{ first_ml: current == 0 }">
  74. <scroll-view class="box_in" scroll-y="true">
  75. <!--目录 -->
  76. <view v-show="current == 0">
  77. <view
  78. class="top__header"
  79. v-if="livingItem"
  80. @click="goLive(livingItem)"
  81. >
  82. <image
  83. class="img"
  84. src="/pages3/static/imgs/live.png"
  85. mode="widthFix"
  86. ></image>
  87. <view class="note">正在直播中</view>
  88. <view class="title">{{ livingItem.sectionName }}</view>
  89. </view>
  90. <view
  91. v-if="teacherList && teacherList.length > 0"
  92. class="teacher_names"
  93. >
  94. <view
  95. v-for="(tea, index) in teacherList"
  96. :key="index"
  97. class="names"
  98. :class="{ nactive: teacherIndex == index }"
  99. @click="activeFunc(tea, index)"
  100. >
  101. {{ tea.aliasName }}
  102. </view>
  103. </view>
  104. <view
  105. class="menuBox onessss"
  106. v-for="(item, index) in menuList"
  107. :key="index"
  108. >
  109. <template v-if="!$method.isEmptyObject(sectionItem)">
  110. <!--模块 -->
  111. <view v-if="item.type == 1"
  112. ><courseModule
  113. v-if="reStart"
  114. :orderGoodsId="orderGoodsId"
  115. :sectionMaxNum="goodsData.sectionMaxNum"
  116. :needOpen="sectionItem.moduleId == item.menuId"
  117. :courseId="courseId"
  118. :preItem="menuList[index - 1]"
  119. :learningOrder="orderNum"
  120. :goodsId="goodsId"
  121. :gradeId="gradeId"
  122. :isBuy="true"
  123. :menuItem="item"
  124. :levelId="item.menuId"
  125. :goodsType="1"
  126. :menuAllList="menuAllList"
  127. :sectionItem="sectionItem"
  128. ></courseModule
  129. ></view>
  130. <!--章 -->
  131. <view v-if="item.type == 2"
  132. ><courseChapter
  133. v-if="reStart"
  134. :orderGoodsId="orderGoodsId"
  135. :sectionMaxNum="goodsData.sectionMaxNum"
  136. :needOpen="
  137. !sectionItem.moduleId &&
  138. sectionItem.chapterId == item.menuId
  139. "
  140. :courseId="courseId"
  141. :preItem="menuList[index - 1]"
  142. @playEnd="sectionPlayEnd($event, index)"
  143. :learningOrder="orderNum"
  144. :goodsId="goodsId"
  145. :gradeId="gradeId"
  146. :isBuy="true"
  147. :menuItem="item"
  148. :levelId="'0-' + item.menuId"
  149. :goodsType="1"
  150. :menuAllList="menuAllList"
  151. :sectionItem="sectionItem"
  152. ></courseChapter
  153. ></view>
  154. <!--节 -->
  155. <view v-if="item.type == 3"
  156. ><courseSection
  157. ref="MoudleSection"
  158. v-if="reStart"
  159. :orderGoodsId="orderGoodsId"
  160. :sectionMaxNum="goodsData.sectionMaxNum"
  161. @playEnd="sectionPlayEnd($event, index)"
  162. :courseId="courseId"
  163. :preItem="menuList[index - 1]"
  164. :learningOrder="orderNum"
  165. :goodsId="goodsId"
  166. :gradeId="gradeId"
  167. :isBuy="true"
  168. :menuItem="item"
  169. :levelId="'0-0-' + item.menuId"
  170. :goodsType="1"
  171. :testType="3"
  172. :menuAllList="menuAllList"
  173. ></courseSection
  174. ></view>
  175. </template>
  176. <!-- @togoBack="togoBack($event)" -->
  177. </view>
  178. </view>
  179. <!--讲义 -->
  180. <view v-show="current == 1">
  181. <handouts-box
  182. :handoutsId="goodsData.handoutsId"
  183. v-if="goodsData.handoutsId"
  184. ></handouts-box>
  185. </view>
  186. <!--笔记 -->
  187. <view v-show="current == 2">
  188. <view v-if="noteList.length == 0" style="text-align: center"
  189. >暂无笔记</view
  190. >
  191. <view v-for="(item, index) in noteList" :key="index">
  192. <view class="dateBox">{{
  193. $method.timestampToTime(item.dateNote)
  194. }}</view>
  195. <view class="noteBox">
  196. <view
  197. v-for="(item1, index1) in item.userNotes"
  198. :key="index1"
  199. style="margin-top: 30rpx"
  200. @click="jumpNote(item1)"
  201. >
  202. <view style="display: flex">
  203. <view class="left_ti">
  204. <view>
  205. <image
  206. src="/static/icon/note2.png"
  207. v-if="noteId != item1.noteId"
  208. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  209. ></image>
  210. <image
  211. src="/static/icon/note1.png"
  212. v-if="noteId == item1.noteId"
  213. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  214. ></image>
  215. </view>
  216. <view
  217. class="title"
  218. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  219. >{{ $method.secondToDate(item1.noteSecond) }}</view
  220. >
  221. </view>
  222. <view style="margin-left: 10rpx">
  223. <view class="t2Content leftPadding">{{
  224. item1.sectionName
  225. }}</view>
  226. <view class="tBox2">{{ item1.noteText }}</view>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. </view>
  233. <!--答疑 -->
  234. <view v-show="current == 3" class="Answering">
  235. <view
  236. v-for="(item, index) in answerList"
  237. :key="index"
  238. style="background-color: #ffffff"
  239. class="answer_item"
  240. >
  241. <view class="chat_box" @click.stop="clearCtx">
  242. <view style="display: flex; flex: 1">
  243. <view
  244. ><image
  245. :src="
  246. item.assignUserId > 0 && !item.realname
  247. ? '/static/logo_xcx.png'
  248. : $method.splitImgHost(item.avatar)
  249. "
  250. style="width: 64rpx; height: 64rpx"
  251. ></image
  252. ></view>
  253. <view style="margin-left: 15rpx">
  254. <view class="chat1">{{
  255. item.assignUserId > 0 && !item.realname
  256. ? "祥粤老师"
  257. : item.realname
  258. }}</view>
  259. <view class="chat2">{{
  260. $method.timestampToTime(item.createTime, false)
  261. }}</view>
  262. <view class="chat3">
  263. <text v-if="item.assignUserId > 0">回复</text>
  264. <text v-if="item.assignUserId > 0" style="color: #007aff"
  265. >@{{ item.assignRealname }}</text
  266. >
  267. <view style="word-break: break-all">{{
  268. item.answerText
  269. }}</view>
  270. </view>
  271. </view>
  272. </view>
  273. <view
  274. class="btnReply"
  275. @click.stop="replyContent(item)"
  276. v-if="item.userId != userInfo.userId"
  277. >回复</view
  278. >
  279. <view v-else class="btnDel" @click.stop="delContent(item)"
  280. >删除</view
  281. >
  282. </view>
  283. <u-line color="#D6D6DB" />
  284. </view>
  285. <view v-if="answerList.length == 0" style="text-align: center"
  286. >暂无记录</view
  287. >
  288. </view>
  289. <!--目录 -->
  290. <view v-show="current == 4">
  291. <view
  292. class="menuBox"
  293. v-for="(item, index) in reMenuList"
  294. :key="index"
  295. >
  296. <!--模块 -->
  297. <view v-if="item.type == 1"
  298. ><courseModule
  299. :orderGoodsId="orderGoodsId"
  300. :sectionMaxNum="goodsData.sectionMaxNum"
  301. :courseId="courseId"
  302. :learningOrder="orderNum"
  303. :goodsId="goodsId"
  304. :gradeId="gradeId"
  305. :isRebuild="true"
  306. :isBuy="true"
  307. :menuItem="item"
  308. :levelId="item.menuId"
  309. :goodsType="1"
  310. :menuAllList="menuAllList"
  311. :sectionItem="sectionItem"
  312. ></courseModule
  313. ></view>
  314. <!--章 -->
  315. <view v-if="item.type == 2">
  316. <courseChapter
  317. :orderGoodsId="orderGoodsId"
  318. :courseId="courseId"
  319. :learningOrder="orderNum"
  320. :sectionMaxNum="goodsData.sectionMaxNum"
  321. @playEnd="sectionPlayEnd($event, index)"
  322. :gradeId="gradeId"
  323. :goodsId="goodsId"
  324. :isRebuild="true"
  325. :isBuy="true"
  326. :menuItem="item"
  327. :levelId="'0-' + item.menuId"
  328. :goodsType="1"
  329. :menuAllList="menuAllList"
  330. ></courseChapter>
  331. </view>
  332. <!--节 -->
  333. <view v-if="item.type == 3">
  334. <courseSection
  335. :orderGoodsId="orderGoodsId"
  336. :courseId="courseId"
  337. :learningOrder="orderNum"
  338. :sectionMaxNum="goodsData.sectionMaxNum"
  339. @playEnd="sectionPlayEnd($event, index)"
  340. :gradeId="gradeId"
  341. :goodsId="goodsId"
  342. :isRebuild="true"
  343. :isBuy="true"
  344. :nextMenuItem="findMenuNextSection(index)"
  345. :menuItem="item"
  346. :levelId="'0-0-' + item.menuId"
  347. :goodsType="1"
  348. :testType="3"
  349. :menuAllList="menuAllList"
  350. ></courseSection>
  351. </view>
  352. </view>
  353. </view>
  354. </scroll-view>
  355. <!-- 底部固定按钮 -->
  356. <!-- 笔记的输入框 -->
  357. <template v-if="current == 2">
  358. <view
  359. class="inputBottom"
  360. v-if="!(isPlayRebuild > 0) && playChannelId == 0"
  361. :style="{ bottom: bottomHeight + 'px' }"
  362. >
  363. <view style="width: 10%"
  364. ><image
  365. src="/static/icon/note3.png"
  366. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  367. ></image
  368. ></view>
  369. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  370. <input
  371. v-model="noteValue"
  372. height="60"
  373. fixed="true"
  374. placeholder="您可以在这里输入笔记内容"
  375. type="text"
  376. :custom-style="inputStyle"
  377. :adjust-position="false"
  378. class="input"
  379. @focus="focusNote"
  380. @blur="blurNote"
  381. />
  382. </view>
  383. <view
  384. style="
  385. color: #007aff;
  386. font-size: 30rpx;
  387. font-weight: bold;
  388. width: 15%;
  389. text-align: center;
  390. "
  391. @click="postNote"
  392. >提交</view
  393. >
  394. </view>
  395. </template>
  396. <!-- 答疑的输入框 -->
  397. <view
  398. v-if="current == 3"
  399. class="inputBottom"
  400. :style="{ bottom: bottomHeight + 'px' }"
  401. >
  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-popup
  467. v-model="photoPopup"
  468. mode="bottom"
  469. border-radius="40"
  470. :mask-close-able="false"
  471. >
  472. <!-- 播放前拍照start -->
  473. <!-- :mask-close-able="false" -->
  474. <!-- style="bottom: 0; position: fixed; width: 100%; z-index: 999" -->
  475. <view v-if="photoPopup">
  476. <view class="photoBox">
  477. <view class="photoTop">
  478. <view class="sqzz" v-if="false"
  479. ><u-icon
  480. name="close"
  481. color="#333333"
  482. size="30"
  483. @click="closePhoto"
  484. ></u-icon
  485. ></view>
  486. <view class="centersq">请正视手机屏幕</view>
  487. <view class="sqzz"></view>
  488. </view>
  489. <view class="photoCenter">
  490. <view class="center_camera" v-if="photoPopup && isTaking">
  491. <!-- #ifdef MP-WEIXIN -->
  492. <camera
  493. device-position="front"
  494. flash="off"
  495. @error="error"
  496. style="width: 100%; height: 100%"
  497. >
  498. <!-- 加人脸框 -->
  499. <cover-view class="head_take">
  500. <cover-view class="headTake_up color"></cover-view>
  501. <cover-view class="headTake_minddle">
  502. <cover-view class="min_left color"></cover-view>
  503. <cover-view class="min_img"></cover-view>
  504. <cover-view class="min_right color"></cover-view>
  505. </cover-view>
  506. <cover-view class="headTake_down color"></cover-view>
  507. </cover-view>
  508. </camera>
  509. <!-- #endif -->
  510. <!-- #ifdef H5 -->
  511. <video
  512. :controls="false"
  513. id="video"
  514. width="400"
  515. height="300"
  516. class="photo_v"
  517. ></video>
  518. <view class="mask"></view>
  519. <!-- #endif -->
  520. </view>
  521. <view class="custom" v-if="!isTaking">
  522. <!-- #ifdef MP-WEIXIN -->
  523. <image :src="avatarUrl" mode=""></image>
  524. <!-- #endif -->
  525. <!-- #ifdef H5 -->
  526. <image :src="faceUrl" mode=""></image>
  527. <!-- #endif -->
  528. </view>
  529. </view>
  530. <view class="btns">
  531. <!-- <view class="btnResult" v-if="isTaking" @click="takePhoto"
  532. >拍照</view
  533. > -->
  534. <view v-if="isTaking" class="takePhoto_btn">
  535. <view style="width: 100rpx; height: 2rpx"></view>
  536. <view class="middle_btn" @click="takePhoto">
  537. <view class="square"></view>
  538. </view>
  539. <view class="rights" @click="takePhTips()">
  540. <text>拍照提示</text>
  541. <u-icon name="arrow-right" color="#FFFFFF" size="30"></u-icon>
  542. </view>
  543. </view>
  544. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  545. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  546. </view>
  547. </view>
  548. </view>
  549. </u-popup>
  550. <u-popup
  551. v-model="noticeShow"
  552. class="notice_modal"
  553. mode="center"
  554. border-radius="28"
  555. width="650rpx"
  556. height="622rpx"
  557. :mask-close-able="false"
  558. @close="closeNotice"
  559. >
  560. <view class="content">
  561. <view class="title">学员须知</view>
  562. <scroll-view scroll-y="true">
  563. <view
  564. class="text"
  565. v-html="
  566. goodsData.buyNote && goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
  567. "
  568. >
  569. </view>
  570. </scroll-view>
  571. <view
  572. class="had_read"
  573. :class="{ gray: CountTo >= 0 }"
  574. @click="noticeConfirm()"
  575. >
  576. <text v-if="CountTo >= 0">请阅读学员须知,30s后可关闭</text>
  577. <text v-else>我已阅读学员须知</text>
  578. <text v-if="CountTo >= 0">{{ " " + CountTo + "s" }}</text>
  579. </view>
  580. </view>
  581. </u-popup>
  582. <!-- 倒计时提交 -->
  583. <u-popup
  584. v-model="noticeShow1"
  585. class="notice_modal"
  586. mode="center"
  587. border-radius="28"
  588. width="650rpx"
  589. height="262rpx"
  590. :mask-close-able="false"
  591. >
  592. <view class="content">
  593. <view class="title">提示</view>
  594. <view class="had_read">
  595. <text v-if="CountTo1 >= 0">视频学习时长不达标,请等待</text>
  596. <text v-if="CountTo1 >= 0">{{ " " + CountTo1 + "s" }}</text>
  597. </view>
  598. </view>
  599. </u-popup>
  600. <u-modal
  601. v-model="showMark"
  602. title="提示"
  603. @confirm="markConfirm"
  604. @cancel="toBack"
  605. confirm-text="复制学习网址"
  606. :show-cancel-button="true"
  607. cancel-text="关闭"
  608. >
  609. <view class="slot-content">
  610. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  611. <view>1.复制学习地址:{{ markContent }}</view>
  612. <view>2.在【浏览器中】打开复制的学习网址</view>
  613. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  614. <view>(1)账号:您个人的身份证号码</view>
  615. <view>(2)密码:身份证号码,再加111111</view>
  616. </view>
  617. </u-modal>
  618. <!-- 切换课程弹窗 -->
  619. <u-popup
  620. v-model="toggleCourseShow"
  621. mode="bottom"
  622. border-radius="40"
  623. :mask-close-able="false"
  624. >
  625. <view class="popup_box">
  626. <view class="check_head">
  627. <view class="headers">
  628. <view class="grade">切换课程</view>
  629. <u-icon
  630. name="close"
  631. color="#9C9C9C"
  632. size="40"
  633. @click="closePop()"
  634. ></u-icon>
  635. </view>
  636. <view class="coruse_num">共{{ goodsTeacher.length }}门</view>
  637. <view class="menuSel">
  638. <scroll-view class="sub_sliper" scroll-x="true">
  639. <view
  640. v-for="(item, index) in subList"
  641. :key="index"
  642. style="margin-right: 50rpx; display: inline-block"
  643. >
  644. <view
  645. class="r_t1"
  646. :class="{ nactive: subIndex == index }"
  647. @click="cMenu(item, index)"
  648. >
  649. {{ item.subjectName }}
  650. </view>
  651. </view>
  652. </scroll-view>
  653. </view>
  654. </view>
  655. <view class="check_con">
  656. <scroll-view scroll-y="true" style="height: 700rpx">
  657. <view v-for="(courseItem, gTindex) in goodsTeacher" :key="gTindex">
  658. <view
  659. v-for="(item, index) in courseItem.courseList"
  660. :key="index"
  661. v-show="
  662. item.subjectId === newActiveSubjectId || !newActiveSubjectId
  663. "
  664. >
  665. <view class="course_items" v-if="item.show && item.show == 1">
  666. <view class="course_lefts">
  667. <view class="course_title">
  668. {{ item.courseName }}
  669. </view>
  670. <view
  671. v-if="courseItem.teaList && courseItem.teaList.length > 0"
  672. class="teacher_names"
  673. >
  674. <view
  675. v-for="(tea, tindex) in courseItem.teaList"
  676. :key="tindex"
  677. class="names"
  678. >{{ tea.aliasName }}</view
  679. >
  680. </view>
  681. <view class="course_pros">
  682. 学习进度
  683. <text>
  684. {{ item.stuAllNum + item.recordNum }}/{{
  685. item.secAllNum + item.examNum
  686. }}</text
  687. >
  688. </view>
  689. </view>
  690. <view
  691. class="course_rights"
  692. @click="jump(item, gTindex, 'jump')"
  693. >
  694. <view class="cicles">
  695. <u-icon
  696. name="arrow-right"
  697. color="#498AFE"
  698. size="20"
  699. ></u-icon>
  700. </view>
  701. <view class="intoStudy">进入学习</view>
  702. </view>
  703. </view>
  704. </view>
  705. </view>
  706. </scroll-view>
  707. </view>
  708. </view>
  709. </u-popup>
  710. <!-- 拍照提示 -->
  711. <popup-photo
  712. :popupPhotoShow.sync="popupPhotoShow"
  713. @takePhoto="toTakePhoto()"
  714. ></popup-photo>
  715. </view>
  716. </template>
  717. <script>
  718. import plv from "../static/polyv-sdk/index";
  719. import courseModule from "@/components/course/courseModule.vue";
  720. import courseChapter from "@/components/course/courseChapter.vue";
  721. import courseSection from "@/components/course/courseSection.vue";
  722. import handoutsBox from "@/components/course/handoutsBox.vue";
  723. import PopupPhoto from "@/components/popup/index.vue";
  724. import myCompressImage from "@/common/compressPhoto.js";
  725. import myPlayer from "../../components/myPlayer/polyvPlayer.vue";
  726. import { mapGetters, mapMutations } from "vuex";
  727. import { lockAction } from "../../utils/lock";
  728. export default {
  729. components: {
  730. courseModule,
  731. courseChapter,
  732. courseSection,
  733. PopupPhoto,
  734. handoutsBox,
  735. myPlayer,
  736. },
  737. data() {
  738. return {
  739. markContent: "http://admin.zhujianpeixun.com/",
  740. showMark: false,
  741. hasStart: false,
  742. channelItem: null,
  743. lockTimer: null,
  744. orderGoodsId: 0,
  745. noticeShow: false,
  746. enableAutoRotation: true,
  747. seekTime: "",
  748. toastTimer: null,
  749. videoToastShow: false,
  750. showSet: false,
  751. startStatus: false,
  752. detail: {},
  753. courseId: 0,
  754. placeholder:
  755. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  756. inputStyle: {
  757. background: "rgba(244, 244, 244, 0.98)",
  758. borderRadius: "24rpx",
  759. padding: "8rpx",
  760. marginBottom: "10rpx",
  761. },
  762. menuList: [],
  763. current: 0,
  764. vid: "",
  765. goodsId: 0,
  766. goodsData: {},
  767. photoPopup: false,
  768. goodsPlayConfig: null,
  769. autoplay: false,
  770. isAllowSeek: "no",
  771. playbackRate: [1.0],
  772. timer: null,
  773. goodsPhotographConfig: null,
  774. intervalTimeList: [], // 间隔拍照时长
  775. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  776. playTime: 0, //页面播放时长,不含暂停
  777. currentTime: 0,
  778. avatarUrl: "",
  779. ossAvatarUrl: "",
  780. studyDuration: 0, // 当前视频时长
  781. gradeId: 0,
  782. chapterId: 0,
  783. moduleId: 0,
  784. reMenuList: [],
  785. answerList: [],
  786. assignUserId: 0,
  787. placeholder: "您可以在这里输入答疑内容",
  788. ctxValue: "",
  789. noteList: [],
  790. noteValue: "",
  791. noteId: 0,
  792. recordObj: {},
  793. gradeDetail: {},
  794. isTaking: true, //是否正在拍照
  795. needSeek: false, //第一次播放是否需要跳转
  796. needProfileModal: false, //是否需要资料审核弹框
  797. photoNum: 0,
  798. photoList: [], //拍照的时间点
  799. photoConfig: false, //是否配置好拍照次数
  800. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  801. photoHistoryList: [], //已拍照历史的下标点
  802. sectionItem: {},
  803. showNotes: true,
  804. uploadLock: false, //上传图片
  805. isPlayRebuild: false, //是否正在播放重修视频needOpen
  806. isRebuild: false, //视频是否从重修目录点击
  807. isFocus: false,
  808. clearTimer: null,
  809. livingItem: "",
  810. option: null,
  811. muluStyle: false, //显示和隐藏目录样式
  812. bottomHeight: 0,
  813. toggleCourseShow: false, // 切换课程弹窗
  814. courseList: [], // 课程列表
  815. reStart: false, // 是否显示模块/章/节
  816. subList: [],
  817. subIndex: 0,
  818. goodsTeacher: [],
  819. teacherList: [],
  820. teacherIndex: 0,
  821. newActiveSubjectId: "", //当前选中ID
  822. compareFaceData: 0, // 拍照匹配相似度
  823. prendreAutoCarme: false, // 是否发起授权相机
  824. studyTimer: null, // 学习记录定时器
  825. CountTo: 30, // 倒计时
  826. CountTo1: 0,
  827. handoutTipLength: 0,
  828. menuAllList: [],
  829. popupPhotoShow: false,
  830. curPlayIndex: 0, // 正在播放的节的下标
  831. H5isAllowSeek: "on",
  832. faceUrl: "",
  833. erJianErZao: false,
  834. pauseTime: 0,
  835. pauseTimer: null,
  836. barTimer: null,
  837. isReach: false,
  838. noticeShow1: false,
  839. refPlv: null,
  840. };
  841. },
  842. computed: {
  843. ...mapGetters([
  844. "userInfo",
  845. "playSectionId",
  846. "playChannelId",
  847. "playVID",
  848. "config",
  849. ]),
  850. playSecIsLearn() {
  851. return this.sectionItem.learning != 1;
  852. },
  853. orderNum() {
  854. return 0;
  855. return this.goodsData.goodsLearningOrder;
  856. },
  857. list() {
  858. let list = [
  859. {
  860. name: "目录",
  861. },
  862. {
  863. name: "讲义",
  864. },
  865. {
  866. name: "笔记",
  867. },
  868. {
  869. name: "答疑",
  870. },
  871. ];
  872. if (this.reMenuList.length > 0) {
  873. list.push({ name: "重修目录" });
  874. }
  875. return list;
  876. },
  877. },
  878. watch: {
  879. showSet(n) {
  880. if (n) {
  881. if (polyvPlayerContext) {
  882. // #ifdef MP-WEIXIN
  883. polyvPlayerContext.pause();
  884. // #endif
  885. // #ifdef H5
  886. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  887. // #endif
  888. }
  889. }
  890. },
  891. photoPopup(n) {
  892. if (n) {
  893. if (this.prendreAutoCarme) {
  894. this.photoPopup = false;
  895. }
  896. this.showSet && (this.photoPopup = false);
  897. }
  898. },
  899. },
  900. async onLoad(option) {
  901. if (option.isOther) {
  902. this.showMark = true;
  903. return;
  904. }
  905. this.option = option;
  906. let { skipPort, id, goodsId, orderGoodsId, gradeId, informId } = option;
  907. console.log("🚀 ~ file: detail.vue:928 ~ onLoad ~ id:", option);
  908. if (skipPort) {
  909. await this.$method.skipLogin(skipPort);
  910. }
  911. if (this.$method.isGoLogin()) {
  912. return;
  913. }
  914. // 公众号模板消息的数据埋点
  915. informId && this.clickOfficial(informId);
  916. !this.userInfo && this.$api.refreshUserInfo();
  917. this.courseId = Number(id) || "";
  918. this.goodsId = Number(goodsId);
  919. this.orderGoodsId = Number(orderGoodsId) || "";
  920. this.gradeId = gradeId;
  921. // 锁
  922. lockAction();
  923. this.lockTimer = setInterval(lockAction, 10000);
  924. // 看是否需要填写资料
  925. await this.getbaseprofiletplists();
  926. this.courseCourseList();
  927. },
  928. async onShow() {
  929. // this.closePhoto();
  930. },
  931. onUnload() {
  932. console.log("onUnloadonUnloadonUnloadonUnload");
  933. this.originUnload();
  934. this.clears();
  935. clearInterval(this.lockTimer);
  936. },
  937. onHide() {
  938. this.originUnload();
  939. },
  940. mounted() {},
  941. methods: {
  942. ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
  943. // 新增微信公众号模板消息点击数据
  944. clickOfficial(informId) {
  945. this.$http({
  946. url: "/data/click",
  947. method: "post",
  948. data: { informId },
  949. });
  950. },
  951. // 点击课程目录
  952. cMenu(item, index) {
  953. this.subIndex = index;
  954. this.newActiveSubjectId = item.subjectId;
  955. },
  956. courseCourseList() {
  957. this.courseList = [];
  958. this.menuList = [];
  959. this.photoConfig = false;
  960. this.$api
  961. .courseCourseList({
  962. pageNum: 1,
  963. pageSize: 200,
  964. goodsId: this.goodsId,
  965. gradeId: this.gradeId,
  966. orderGoodsId: this.orderGoodsId,
  967. })
  968. .then((res) => {
  969. if (res.data.code == 200) {
  970. this.courseList = res.data.rows;
  971. // 科目
  972. let allItem = [{ subjectId: 0, subjectName: "所有" }];
  973. let ids = [];
  974. const newArr = [];
  975. this.courseList.forEach((item) => {
  976. if (ids.indexOf(item.subjectId) == -1) {
  977. ids.push(item.subjectId);
  978. newArr.push(item);
  979. }
  980. });
  981. this.subList = [...allItem, ...newArr];
  982. this.originOnShow();
  983. this.originMounted();
  984. }
  985. });
  986. },
  987. // 查询用户最后一次看的录播的信息
  988. getUserWatchLast() {
  989. this.$http({
  990. url: "/study/record/getUserWatchLast",
  991. method: "get",
  992. data: {
  993. orderGoodsId: this.orderGoodsId,
  994. },
  995. }).then((res) => {
  996. if (res.data.code == 200) {
  997. this.sectionItem = res.data.data || {};
  998. if (res.data.data && Object.keys(res.data.data).length) {
  999. //有最后一次看的录播的信息
  1000. this.courseId = res.data.data.courseId;
  1001. // console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
  1002. } else {
  1003. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1004. // this.toggleCourseShow = true
  1005. }
  1006. } else {
  1007. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1008. }
  1009. this.originOnShow();
  1010. this.originMounted();
  1011. //获取商品双师资模板
  1012. this.getCourseTeacher(this.courseList);
  1013. });
  1014. },
  1015. getCourseTeacher(rows) {
  1016. this.goodsTeacher = [];
  1017. //获取商品双师资模板
  1018. this.$api
  1019. .courseTeacherList({
  1020. goodsId: this.goodsId,
  1021. })
  1022. .then((res1) => {
  1023. if (res1.data.data && res1.data.data.length > 0) {
  1024. //课程老师模板
  1025. let teacherTel = res1.data.data;
  1026. //商品课程
  1027. let courses = rows;
  1028. teacherTel.forEach((tea) => {
  1029. let dataList = [];
  1030. let teacherList = [];
  1031. courses.forEach((item) => {
  1032. let data = tea.courseList.filter(
  1033. (x) => x.courseId == item.courseId
  1034. );
  1035. if (data && data.length > 0) {
  1036. dataList.push(item);
  1037. teacherList = tea.courseList;
  1038. }
  1039. });
  1040. let result = {
  1041. teaList: teacherList,
  1042. courseList: dataList,
  1043. };
  1044. this.goodsTeacher.push(result);
  1045. });
  1046. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  1047. let courseIds = [];
  1048. this.goodsTeacher.forEach((item) => {
  1049. item.courseList.forEach((course) => {
  1050. courseIds.push(course.courseId);
  1051. });
  1052. });
  1053. if (courseIds.length > 0) {
  1054. courses.forEach((item) => {
  1055. if (!courseIds.includes(item.courseId)) {
  1056. let data = {
  1057. teaList: [],
  1058. courseList: [],
  1059. };
  1060. data.courseList.push(item);
  1061. this.goodsTeacher.push(data);
  1062. }
  1063. });
  1064. }
  1065. this.goodsTeacher.forEach((item) => {
  1066. if (item.courseList && item.courseList.length > 0) {
  1067. item.courseList[0].show = 1;
  1068. }
  1069. });
  1070. }
  1071. } else {
  1072. //没有双师资模板
  1073. rows.forEach((item) => {
  1074. item.show = 1;
  1075. let data = {
  1076. teaList: [],
  1077. courseList: [],
  1078. };
  1079. data.courseList.push(item);
  1080. this.goodsTeacher.push(data);
  1081. });
  1082. }
  1083. // console.log(this.goodsTeacher,'this.goodsTeacher', this.courseId);
  1084. this.goodsTeacher.forEach((item) => {
  1085. if (item.courseList.some((x) => x.courseId == this.courseId)) {
  1086. this.teacherList = item.teaList;
  1087. }
  1088. });
  1089. });
  1090. },
  1091. erJianErZaoPauseTip() {
  1092. if (this.playSecIsLearn && this.erJianErZao) {
  1093. if (this.pauseTimer) {
  1094. return;
  1095. }
  1096. this.pauseTime = Date.now();
  1097. console.log("开启定时器");
  1098. this.pauseTimer = setInterval(() => {
  1099. console.log("暂停时间", Date.now() - this.pauseTime, this.pauseTime);
  1100. if (Date.now() - this.pauseTime > 5 * 60 * 1000) {
  1101. // 5 * 60 * 1000
  1102. let text = this.photoPopup ? "拍照停留" : "暂停";
  1103. this.photoPopup = false;
  1104. uni.showModal({
  1105. title: "提示",
  1106. showCancel: false,
  1107. content: `检测${text}时间过长,刷新当前页面`,
  1108. cancelText: "取消",
  1109. confirmText: "确定",
  1110. success: (res) => {
  1111. if (res.confirm) {
  1112. // #ifdef H5
  1113. location.reload();
  1114. // #endif
  1115. // #ifdef MP-WEIXIN
  1116. this.courseCourseList();
  1117. // #endif
  1118. }
  1119. },
  1120. });
  1121. this.clearPauseTimer();
  1122. }
  1123. }, 5000);
  1124. }
  1125. },
  1126. // 原来onshow里面的内容
  1127. async originOnShow() {
  1128. this.courseDetail();
  1129. this.getGoodsDetail();
  1130. await this.studyRecordMenuAllList();
  1131. // 消息过来 定位某个节
  1132. if (this.option.noteSecond) {
  1133. this.jumpNote({
  1134. sectionType: 1,
  1135. ...this.option,
  1136. })
  1137. return;
  1138. }
  1139. this.studyRecordQueryLiveLast();
  1140. },
  1141. // 原来的mouted内容
  1142. originMounted() {
  1143. uni.$on("changeSection", (oldSectionId) => {
  1144. console.log(
  1145. "切换课程-originMounted->playVID:",
  1146. this.playVID,
  1147. oldSectionId
  1148. );
  1149. this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
  1150. this.clearPauseTimer();
  1151. this.hasStart = false;
  1152. this.photoConfig = false;
  1153. this.photoIndex = 0;
  1154. //清除直播
  1155. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1156. this.postStudyRecord(0, oldSectionId);
  1157. });
  1158. uni.$on("getSection", (item) => {
  1159. //清除直播
  1160. this.studyTimer && clearInterval(this.studyTimer);
  1161. this.hasStart = false;
  1162. this.isPlayRebuild = item.rebuild;
  1163. this.photoConfig = false;
  1164. this.photoIndex = 0;
  1165. this.sectionItem = item;
  1166. this.moduleId = item.moduleId || null;
  1167. this.chapterId = item.chapterId || null;
  1168. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1169. //获取拍照历史
  1170. this.getPhotoLastRecord();
  1171. this.playVideo(item);
  1172. });
  1173. uni.$on("levelId", (item) => {
  1174. let arr = item.split("-");
  1175. //点击节获取的各层级ID
  1176. this.moduleId = arr[0];
  1177. this.chapterId = arr[1];
  1178. });
  1179. uni.$on("getChannel", (item) => {
  1180. //清除录播
  1181. this.studyTimer && clearInterval(this.studyTimer);
  1182. this.hasStart = false;
  1183. this.$store.commit("setPlayVID", { playVID: null });
  1184. this.moduleId = item.moduleId;
  1185. this.chapterId = item.chapterId;
  1186. this.$store.commit("setPlaySectionId", {
  1187. playSectionId: item.sectionId || item.menuId,
  1188. });
  1189. this.getPhotoLastRecord();
  1190. this.playChannel(item);
  1191. this.channelItem = item;
  1192. });
  1193. uni.$on("isRebuild", (item) => {
  1194. this.isRebuild = item;
  1195. });
  1196. this.updateChapterOpen(true);
  1197. },
  1198. clearPauseTimer() {
  1199. if (this.pauseTimer) {
  1200. this.pauseTime = 0;
  1201. clearInterval(this.pauseTimer);
  1202. this.pauseTimer = null;
  1203. }
  1204. },
  1205. clearBarTimer() {
  1206. if (this.barTimer) {
  1207. clearInterval(this.barTimer);
  1208. this.barTimer = null;
  1209. }
  1210. },
  1211. // 原来onUnload里面的内容
  1212. originUnload() {
  1213. if (this.playSectionId > 0 && this.hasStart) {
  1214. //退出提交记录
  1215. this.postStudyRecord();
  1216. }
  1217. //清除正在播放的节ID
  1218. // this.$store.commit('setPlayObj',null)
  1219. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  1220. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1221. this.$store.commit("setPlayVID", { playVID: null });
  1222. this.closePlv();
  1223. //移除所有的事件监听器
  1224. uni.$off();
  1225. this.clearTimer && clearTimeout(this.clearTimer);
  1226. this.toastTimer && clearTimeout(this.toastTimer);
  1227. if (this.studyTimer) {
  1228. clearInterval(this.studyTimer);
  1229. this.hasStart = false;
  1230. }
  1231. this.clearPauseTimer();
  1232. this.clearBarTimer();
  1233. if (this.lockTimer) {
  1234. clearInterval(this.lockTimer);
  1235. this.$api
  1236. .lockDelLock({
  1237. action: "jxjy",
  1238. uuid: this.$method.getUuid(),
  1239. })
  1240. .then((res) => {
  1241. uni.hideLoading();
  1242. });
  1243. }
  1244. },
  1245. changeCourses() {
  1246. this.toggleCourseShow = true;
  1247. },
  1248. closePop() {
  1249. this.toggleCourseShow = false;
  1250. },
  1251. async activeFunc(item, index) {
  1252. this.teacherIndex = index;
  1253. let findResult = "";
  1254. this.goodsTeacher.forEach((citem, index) => {
  1255. citem.courseList.forEach((e, e_index) => {
  1256. if (e.courseId == item.courseId) {
  1257. findResult = e;
  1258. }
  1259. });
  1260. });
  1261. this.jump(findResult, 1);
  1262. },
  1263. // 进入学习
  1264. async jump(item, index, type) {
  1265. // console.log('item------>', index,item,this.goodsTeacher)
  1266. if (index == 0) {
  1267. await this.nextCourses(item, type);
  1268. if (item.rebuild === 0) {
  1269. //未重修
  1270. this.$navTo.togo("/pages2/learn/details", {
  1271. id: item.courseId,
  1272. gradeId: item.gradeId,
  1273. goodsId: this.goodsId,
  1274. orderGoodsId: this.orderGoodsId,
  1275. });
  1276. return;
  1277. }
  1278. this.$api.courseDetail(item.courseId).then((res) => {
  1279. if (res.data.code == 200) {
  1280. // if (res.data.data.educationName == "继续教育") {
  1281. this.$method.checkLock().then((res) => {
  1282. this.courseId = item.courseId;
  1283. this.originOnShow();
  1284. this.originMounted();
  1285. });
  1286. }
  1287. });
  1288. } else {
  1289. if (this.orderNum == 2) {
  1290. //学习顺序是从头到尾学习,没学完上一课不能学习下一课
  1291. let prevItem = this.courseList[index - 1]; //上一课
  1292. if (prevItem.stuAllNum == prevItem.secAllNum) {
  1293. await this.nextCourses(item, type);
  1294. if (item.rebuild === 0) {
  1295. //未重修
  1296. this.$navTo.togo("/pages2/learn/details", {
  1297. id: item.courseId,
  1298. gradeId: item.gradeId,
  1299. goodsId: this.goodsId,
  1300. orderGoodsId: this.orderGoodsId,
  1301. });
  1302. return;
  1303. }
  1304. this.$api.courseDetail(item.courseId).then((res) => {
  1305. if (res.data.code == 200) {
  1306. // if (res.data.data.educationName == "继续教育") {
  1307. this.$method.checkLock().then((res) => {
  1308. this.courseId = item.courseId;
  1309. this.originOnShow();
  1310. this.originMounted();
  1311. });
  1312. }
  1313. });
  1314. } else {
  1315. uni.showToast({
  1316. icon: "none",
  1317. title: "请按顺序学完上一课再学习这一课",
  1318. });
  1319. }
  1320. } else {
  1321. await this.nextCourses(item, type);
  1322. if (item.rebuild === 0) {
  1323. //未重修
  1324. this.$navTo.togo("/pages2/learn/details", {
  1325. id: item.courseId,
  1326. gradeId: item.gradeId,
  1327. goodsId: this.goodsId,
  1328. orderGoodsId: this.orderGoodsId,
  1329. });
  1330. return;
  1331. }
  1332. this.$api.courseDetail(item.courseId).then((res) => {
  1333. if (res.data.code == 200) {
  1334. // if (res.data.data.educationName == "继续教育") {
  1335. this.$method.checkLock().then((res) => {
  1336. this.courseId = item.courseId;
  1337. this.originOnShow();
  1338. this.originMounted();
  1339. });
  1340. }
  1341. });
  1342. }
  1343. }
  1344. },
  1345. async nextCourses(item, type) {
  1346. this.vid = "";
  1347. this.hasStart = true;
  1348. await this.originUnload();
  1349. if (type) {
  1350. this.teacherIndex = 0;
  1351. this.goodsTeacher.forEach((citem) => {
  1352. if (citem.courseList.some((x) => x.courseId == item.courseId)) {
  1353. this.teacherList = citem.teaList;
  1354. }
  1355. });
  1356. }
  1357. this.reStart = false;
  1358. this.courseId = item.courseId;
  1359. this.gradeId = item.gradeId;
  1360. this.toggleCourseShow = false;
  1361. },
  1362. clickLeft() {
  1363. // uni.navigateBack()
  1364. uni.switchTab({
  1365. url: "/pages/learn/index",
  1366. });
  1367. },
  1368. toBack(delta = 1) {
  1369. uni.navigateBack({
  1370. delta,
  1371. });
  1372. },
  1373. markConfirm() {
  1374. uni.setClipboardData({
  1375. data: this.markContent,
  1376. success: () => {
  1377. setTimeout(this.toBack, 1000);
  1378. },
  1379. });
  1380. },
  1381. closeNotice() {
  1382. this.$api
  1383. .baseHandoutTip({
  1384. orderGoodsId: this.orderGoodsId,
  1385. })
  1386. .then((res) => {});
  1387. },
  1388. noticeConfirm() {
  1389. if (this.CountTo < 0) {
  1390. this.noticeShow = false;
  1391. if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
  1392. this.autoplay = true;
  1393. this.refPlv.resumeVideo();
  1394. }
  1395. }
  1396. },
  1397. baseHandoutTipList() {
  1398. this.$api
  1399. .baseHandoutTipList({
  1400. orderGoodsId: this.orderGoodsId,
  1401. })
  1402. .then((res) => {
  1403. this.handoutTipLength = res.data.rows.length;
  1404. if (res.data.rows.length == 0) {
  1405. this.noticeShow = true;
  1406. if (this.CountTo == 30) {
  1407. var timer = setInterval(() => {
  1408. this.CountTo--;
  1409. if (this.CountTo < 0) {
  1410. clearInterval(timer);
  1411. }
  1412. }, 1000);
  1413. }
  1414. } else {
  1415. this.CountTo = -1;
  1416. if (this.goodsPlayConfig && this.goodsPlayConfig.autoPlay > 0) {
  1417. // #ifdef MP-WEIXIN
  1418. this.autoplay = true;
  1419. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1420. // polyvPlayerContext.play();
  1421. // #endif
  1422. // #ifdef H5
  1423. // polyvPlayerContext.j2s_resumeVideo()
  1424. // #endif
  1425. }
  1426. }
  1427. });
  1428. },
  1429. /**
  1430. * 获取上次观看的直播
  1431. */
  1432. studyRecordGetLastLive() {
  1433. this.$api
  1434. .studyRecordGetLastLive({
  1435. orderGoodsId: this.orderGoodsId,
  1436. courseId: this.courseId,
  1437. })
  1438. .then((res) => {
  1439. this.updateLiveLast(res.data.data);
  1440. });
  1441. },
  1442. async initPlayVideo(sectionItem) {
  1443. this.moduleId = sectionItem.moduleId;
  1444. this.chapterId = sectionItem.chapterId;
  1445. this.sectionItem = sectionItem;
  1446. if (sectionItem.sectionType == 1) {
  1447. //录播
  1448. await this.getPhotoLastRecord(); // 获取拍照历史
  1449. this.playVideo(sectionItem);
  1450. } else if (sectionItem.sectionType == 2) {
  1451. //直播
  1452. this.studyRecordGetLastLive();
  1453. } else if (sectionItem.sectionType == 3) {
  1454. //回放
  1455. this.playVideo(sectionItem);
  1456. } else if (sectionItem.doType == 2) {
  1457. uni.showModal({
  1458. title: "温馨提示",
  1459. content: "当前节视频已学完,是否进入考试?",
  1460. success: (res) => {
  1461. if (res.confirm) {
  1462. this.toQuestionBank(sectionItem);
  1463. }
  1464. },
  1465. });
  1466. return;
  1467. }
  1468. },
  1469. toQuestionBank(sectionItem) {
  1470. uni.navigateTo({
  1471. url:
  1472. "/pages2/class/questionBank?courseId=" +
  1473. this.courseId +
  1474. "&gradeId=" +
  1475. this.gradeId +
  1476. "&isFromVideo=1&id=" +
  1477. sectionItem.id +
  1478. "&goodsid=" +
  1479. this.goodsId +
  1480. "&moduleId=" +
  1481. (sectionItem.moduleId || 0) +
  1482. "&chapterId=" +
  1483. (sectionItem.chapterId || 0) +
  1484. "&orderGoodsId=" +
  1485. this.orderGoodsId +
  1486. "&type=" +
  1487. (sectionItem.type == 4 ? 1 : 3) +
  1488. "&learning=" +
  1489. sectionItem.studyStatus +
  1490. "&isBackVideo=" +
  1491. 1,
  1492. });
  1493. },
  1494. studyRecordQueryLiveLast() {
  1495. // /study/record/queryLiveLast
  1496. this.$api
  1497. .studyRecordQueryLiveLast({
  1498. gradeId: this.gradeId,
  1499. orderGoodsId: this.orderGoodsId,
  1500. courseId: this.courseId,
  1501. })
  1502. .then((res) => {
  1503. console.log("🚀 ~ file: detail.vue:1575 ~ .then ~ res:", res);
  1504. let { data } = res.data;
  1505. if (!data.sectionId) {
  1506. data = this.menuAllList[0];
  1507. } else {
  1508. // if (data.learning == 1 && this.orderNum == 2) {
  1509. // let next = this.menuAllList.find((e) => e.studyStatus != 1);
  1510. // next && (data = next);
  1511. // }
  1512. }
  1513. this.initPlayVideo(data);
  1514. });
  1515. },
  1516. /**
  1517. * 模块大节播放完毕,刷新列表
  1518. */
  1519. sectionPlayEnd(isRebuild, index) {
  1520. if (this.reMenuList.length > 0) {
  1521. //有重修目录
  1522. if (isRebuild.isRebuild) {
  1523. //从重修点击
  1524. this.$api
  1525. .reMenuList({
  1526. orderGoodsId: this.orderGoodsId,
  1527. courseId: this.courseId,
  1528. rebuild: 1,
  1529. gradeId: this.gradeId,
  1530. })
  1531. .then((res) => {
  1532. if (res.data.code == 200) {
  1533. if (res.data.rows.length) {
  1534. res.data.rows[index].name = res.data.rows[index].menuName;
  1535. this.$set(this.reMenuList, index, res.data.rows[index]);
  1536. for (let i = 0; i < res.data.rows.length; i++) {
  1537. let item = res.data.rows[i];
  1538. item.down = true;
  1539. item.id = item.menuId;
  1540. item.name = item.menuName;
  1541. }
  1542. this.reMenuList = [];
  1543. this.$nextTick(() => {
  1544. this.reMenuList = res.data.rows;
  1545. // console.log(this.reMenuList,'this.reMenuList1')
  1546. });
  1547. } else {
  1548. this.reMenuList = [];
  1549. }
  1550. }
  1551. });
  1552. this.$api
  1553. .reMenuList({
  1554. courseId: this.courseId,
  1555. gradeId: this.gradeId,
  1556. orderGoodsId: this.orderGoodsId,
  1557. })
  1558. .then((res) => {
  1559. if (res.data.code == 200) {
  1560. for (let i = 0; i < res.data.rows.length; i++) {
  1561. let item = res.data.rows[i];
  1562. item.down = true;
  1563. item.id = item.menuId;
  1564. item.name = item.menuName;
  1565. item.menuType = item.type;
  1566. }
  1567. this.menuList = [];
  1568. this.$nextTick(() => {
  1569. this.menuList = res.data.rows;
  1570. });
  1571. }
  1572. });
  1573. } else {
  1574. //从普通目录点击
  1575. this.$api
  1576. .reMenuList({
  1577. courseId: this.courseId,
  1578. gradeId: this.gradeId,
  1579. orderGoodsId: this.orderGoodsId,
  1580. })
  1581. .then((res) => {
  1582. if (res.data.code == 200) {
  1583. res.data.rows[index].name = res.data.rows[index].menuName;
  1584. res.data.rows[index].id = res.data.rows[index].menuId;
  1585. this.$set(this.menuList, index, res.data.rows[index]);
  1586. }
  1587. });
  1588. this.$api
  1589. .reMenuList({
  1590. orderGoodsId: this.orderGoodsId,
  1591. courseId: this.courseId,
  1592. rebuild: 1,
  1593. gradeId: this.gradeId,
  1594. })
  1595. .then((res) => {
  1596. if (res.data.code == 200) {
  1597. if (res.data.rows.length) {
  1598. // for (let i = 0; i < res.data.rows.length; i++) {
  1599. // let item = res.data.rows[i];
  1600. // item.down = true;
  1601. // item.id = item.menuId;
  1602. // item.name = item.menuName;
  1603. // }
  1604. // this.reMenuList = res.data.rows;
  1605. } else {
  1606. this.reMenuList = [];
  1607. }
  1608. }
  1609. });
  1610. }
  1611. } else {
  1612. console.log("--模块大节播放完毕,刷新列表-");
  1613. //没有重修目录
  1614. this.$api
  1615. .reMenuList({
  1616. courseId: this.courseId,
  1617. gradeId: this.gradeId,
  1618. orderGoodsId: this.orderGoodsId,
  1619. })
  1620. .then((res) => {
  1621. if (res.data.code == 200) {
  1622. res.data.rows[index].name = res.data.rows[index].menuName;
  1623. res.data.rows[index].id = res.data.rows[index].menuId;
  1624. this.$set(this.menuList, index, res.data.rows[index]);
  1625. }
  1626. });
  1627. }
  1628. },
  1629. goLive(item) {
  1630. let moduleId = item.moduleId || 0;
  1631. let chapterId = item.chapterId || 0;
  1632. let sectionId = item.sectionId || item.menuId;
  1633. let uuid = new Date().valueOf() + "";
  1634. // buyCourse 是否购买课程:1是 0否
  1635. let encode = encodeURIComponent(
  1636. this.config.hostLive +
  1637. "/pages/live/index?token=" +
  1638. uni.getStorageSync("token") +
  1639. "&userInfo=" +
  1640. JSON.stringify(this.userInfo) +
  1641. "&channelId=" +
  1642. item.liveUrl +
  1643. "&gradeId=" +
  1644. this.gradeId +
  1645. "&courseId=" +
  1646. this.courseId +
  1647. "&goodsId=" +
  1648. this.goodsId +
  1649. "&orderGoodsId=" +
  1650. this.orderGoodsId +
  1651. "&sectionId=" +
  1652. sectionId +
  1653. "&chapterId=" +
  1654. chapterId +
  1655. "&moduleId=" +
  1656. moduleId +
  1657. "&buyCourse=1" +
  1658. "&ident=" +
  1659. uuid
  1660. );
  1661. uni.navigateTo({
  1662. url: `../../pages/webview/index?url=` + encode,
  1663. });
  1664. },
  1665. studyRecordMenuAllList() {
  1666. // study/record/menuAllList
  1667. return this.$api
  1668. .studMenuAllList({
  1669. courseId: this.courseId,
  1670. gradeId: this.gradeId,
  1671. goodsId: this.goodsId,
  1672. })
  1673. .then((res) => {
  1674. let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1675. if (res.data.data) {
  1676. this.menuAllList = res.data.data.filter(
  1677. (e) => e.doType != 1 || (e.doType == 2 && e.studyStatus == 1)
  1678. );
  1679. this.livingItem = res.data.data.find(
  1680. (item) =>
  1681. item.liveStartTime <= nowTime && item.liveEndTime > nowTime
  1682. );
  1683. }
  1684. return Promise.resolve();
  1685. });
  1686. },
  1687. async getbaseprofiletplists() {
  1688. // #ifdef MP-WEIXIN
  1689. this.getCameraSetting();
  1690. // #endif
  1691. let {
  1692. data: { code, rows },
  1693. } = await this.$api.getbaseprofiletplists({
  1694. goodsId: this.goodsId,
  1695. orderGoodsId: this.orderGoodsId,
  1696. });
  1697. if (code === 200 && rows.length && rows[0].keyValue) {
  1698. let baseRes = await this.$api.getbaseprofiletpId(this.goodsId);
  1699. if (baseRes.data.code === 200 && baseRes.data.data) {
  1700. let {
  1701. data: { code, data },
  1702. } = await this.$api.getbaseprofiletpgetInfo({
  1703. goodsId: this.goodsId,
  1704. orderGoodsId: this.orderGoodsId,
  1705. });
  1706. if (
  1707. code === 200 &&
  1708. (!data || (data.status === 3 && data.changeStatus === 1))
  1709. ) {
  1710. this.needProfileModal = true;
  1711. uni.showModal({
  1712. content: !data
  1713. ? "请前往填写资料"
  1714. : "资料审核不通过,请前往重新填写",
  1715. cancelText: "返回",
  1716. success: (resultst) => {
  1717. if (resultst.confirm) {
  1718. this.$navTo.togo("/pages2/verify/input", {
  1719. id: this.goodsId,
  1720. orderGoodsId: this.orderGoodsId,
  1721. });
  1722. }
  1723. if (resultst.cancel) {
  1724. uni.navigateBack();
  1725. }
  1726. },
  1727. });
  1728. return Promise.reject();
  1729. } else if (data.status === 1 && JSON.parse(rows[0].keyValue2)[0]) {
  1730. let {
  1731. data: { code, data },
  1732. } = await this.$api.getbaseprofileStampgetInfo({
  1733. goodsId: this.goodsId,
  1734. orderGoodsId: this.orderGoodsId,
  1735. });
  1736. if (
  1737. code === 200 &&
  1738. (!data || (data.status === 3 && data.changeStatus === 1))
  1739. ) {
  1740. this.needProfileModal = true;
  1741. uni.showModal({
  1742. content: !data
  1743. ? "请前往填写盖章资料"
  1744. : "资料盖章审核不通过,请前往重新填写",
  1745. cancelText: "返回",
  1746. success: (resultst) => {
  1747. if (resultst.confirm) {
  1748. this.$navTo.togo("/pages2/verify/input2", {
  1749. id: this.goodsId,
  1750. orderGoodsId: this.orderGoodsId,
  1751. });
  1752. }
  1753. if (resultst.cancel) {
  1754. uni.navigateBack();
  1755. }
  1756. },
  1757. });
  1758. return Promise.reject();
  1759. }
  1760. }
  1761. }
  1762. }
  1763. let detail = await this.$api.goodsDetail(this.goodsId);
  1764. if (detail.data.data.erJianErZao) {
  1765. let info = await this.$api.userConfirmInfoDetail({
  1766. orderGoodsId: this.orderGoodsId,
  1767. });
  1768. return Promise.resolve();
  1769. if (!info.data.data || info.data.data.pushInfo !== 1) {
  1770. uni.showModal({
  1771. showCancel: false,
  1772. title: "提示",
  1773. content: "开通信息推送不成功,无法进入学习!",
  1774. success: (resultst) => {
  1775. uni.navigateBack();
  1776. },
  1777. });
  1778. return Promise.reject();
  1779. }
  1780. }
  1781. return Promise.resolve();
  1782. },
  1783. /**
  1784. * 计算tabs宽度
  1785. */
  1786. itemWidth() {
  1787. return 100 / this.list.length + "%";
  1788. },
  1789. findMenuNextSection(index) {
  1790. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1791. let item = this.reMenuList[i];
  1792. if (item.type == 3) {
  1793. return item;
  1794. }
  1795. }
  1796. return {};
  1797. },
  1798. loadedmetadata(event) {
  1799. this.refPlv = this.$refs.player;
  1800. },
  1801. getPhotoLastRecord() {
  1802. if (this.erJianErZao || !this.playSecIsLearn || this.photoNum <= 0) {
  1803. return;
  1804. }
  1805. let self = this;
  1806. let data = {
  1807. sectionId: parseInt(self.playSectionId),
  1808. goodsId: parseInt(self.goodsId),
  1809. courseId: parseInt(self.courseId),
  1810. gradeId: parseInt(self.gradeId),
  1811. chapterId: parseInt(self.chapterId),
  1812. moduleId: parseInt(self.moduleId),
  1813. orderGoodsId: this.orderGoodsId,
  1814. };
  1815. // /course/photo/log/getLastInfo'
  1816. this.$api.getPhotoLastRecord(data).then((res) => {
  1817. if (res.data.code == 200) {
  1818. //清空历史数据
  1819. self.photoHistoryList = [];
  1820. this.photoIndex = 0;
  1821. self.photoList = [];
  1822. for (let i = 0; i < res.data.data.length; i++) {
  1823. //-2存储随机拍照数组
  1824. if (res.data.data[i].photoIndex == -2) {
  1825. self.photoList =
  1826. res.data.data[i].timeInterval &&
  1827. res.data.data[i].timeInterval.split(",");
  1828. } else {
  1829. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1830. }
  1831. }
  1832. // console.log('7777', this.photoHistoryList, this.photoList);
  1833. }
  1834. });
  1835. },
  1836. //postTime 只提交随机时间
  1837. postCoursePhotoRecord(postTime = false) {
  1838. return new Promise((resolve, reject) => {
  1839. let currentTime = 0;
  1840. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1841. if (polyvPlayerContext) {
  1842. // #ifdef MP-WEIXIN
  1843. currentTime = polyvPlayerContext.getCurrentTime();
  1844. // #endif
  1845. // #ifdef H5
  1846. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  1847. // #endif
  1848. }
  1849. let self = this;
  1850. let photoIndex = self.photoIndex;
  1851. let data = {
  1852. photo: self.ossAvatarUrl,
  1853. sectionId: parseInt(self.playSectionId),
  1854. goodsId: parseInt(self.goodsId),
  1855. courseId: parseInt(self.courseId),
  1856. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1857. gradeId: parseInt(self.gradeId),
  1858. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1859. photoNum: parseInt(self.photoNum),
  1860. chapterId: parseInt(self.chapterId),
  1861. moduleId: parseInt(self.moduleId),
  1862. timeInterval: postTime ? self.photoList.join(",") : "",
  1863. orderGoodsId: this.orderGoodsId,
  1864. };
  1865. // console.log("提交接口", data);
  1866. this.$api
  1867. .coursePhotoRecord(data)
  1868. .then((res) => {
  1869. if (res.data.code == 200) {
  1870. resolve();
  1871. } else {
  1872. reject();
  1873. }
  1874. })
  1875. .catch((err) => {
  1876. reject();
  1877. });
  1878. });
  1879. },
  1880. randomNum(minNum, maxNum) {
  1881. switch (arguments.length) {
  1882. case 1:
  1883. return parseInt(Math.random() * minNum + 1, 10);
  1884. break;
  1885. case 2:
  1886. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1887. break;
  1888. default:
  1889. return 0;
  1890. break;
  1891. }
  1892. },
  1893. //配置随机拍照时间
  1894. configPhoto() {
  1895. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1896. let totalVideoTime = 0;
  1897. let duration = 0;
  1898. // #ifdef MP-WEIXIN
  1899. totalVideoTime = polyvPlayerContext.getDuration();
  1900. duration = polyvPlayerContext.getCurrentTime();
  1901. // #endif
  1902. // #ifdef H5
  1903. totalVideoTime = polyvPlayerContext.j2s_getDuration();
  1904. duration = polyvPlayerContext.j2s_getCurrentTime();
  1905. // #endif
  1906. let photoNum = this.photoNum;
  1907. if (!this.photoConfig) {
  1908. this.photoConfig = true;
  1909. if (this.erJianErZao) {
  1910. this.photoList = this.randomConfig(totalVideoTime, duration);
  1911. return;
  1912. }
  1913. //没有历史拍照间隔数据
  1914. if (this.photoList.length == 0) {
  1915. if (totalVideoTime >= 900) {
  1916. //大于15分钟
  1917. if (photoNum == 1) {
  1918. //开头拍1张
  1919. this.photoList.push(0);
  1920. } else if (photoNum == 3) {
  1921. //拍3张
  1922. this.photoList.push(0); //开头拍一张
  1923. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1924. let centerMinTime = centerTime - 300; //前后5分钟
  1925. let centerMaxTime = centerTime + 300;
  1926. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1927. this.photoList.push(centerTakeTime); //中间拍一张
  1928. let endMaxTime = totalVideoTime - 60;
  1929. let endMinTime = totalVideoTime - 300;
  1930. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1931. this.photoList.push(endTakeTime); //最后拍一张
  1932. }
  1933. } else {
  1934. //小于15分钟,只拍前后各一张
  1935. if (photoNum == 1) {
  1936. //开头拍1张
  1937. this.photoList.push(0);
  1938. } else if (photoNum == 3) {
  1939. this.photoList.push(1);
  1940. let centerTime = this.randomNum(
  1941. (1 / 3) * totalVideoTime,
  1942. (2 / 3) * totalVideoTime
  1943. );
  1944. this.photoList.push(centerTime);
  1945. let endTakeTime = this.randomNum(
  1946. (2 / 3) * totalVideoTime,
  1947. totalVideoTime
  1948. );
  1949. this.photoList.push(endTakeTime);
  1950. }
  1951. }
  1952. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1953. }
  1954. //兼容已有观看历史
  1955. for (let i = 0; i < this.photoList.length - 1; i++) {
  1956. if (
  1957. this.photoList[i] < duration &&
  1958. this.photoList[i + 1] > duration
  1959. ) {
  1960. this.photoIndex = i + 1;
  1961. break;
  1962. }
  1963. if (duration > this.photoList[this.photoList.length - 1]) {
  1964. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1965. break;
  1966. }
  1967. }
  1968. }
  1969. },
  1970. // 随机拍摄时间
  1971. randomConfig(totalVideoTime, duration) {
  1972. this.photoHistoryList = [];
  1973. let photoList = [duration];
  1974. let pre = duration;
  1975. if (totalVideoTime > 300) {
  1976. while (pre <= totalVideoTime) {
  1977. pre += this.randomNum(780, 900);
  1978. pre <= totalVideoTime && photoList.push(pre);
  1979. }
  1980. if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
  1981. photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
  1982. }
  1983. }
  1984. return photoList;
  1985. },
  1986. closePlv() {
  1987. if (plv) {
  1988. plv.destroy();
  1989. }
  1990. },
  1991. openSetting(res) {
  1992. console.log(res, 98);
  1993. },
  1994. getCameraSetting() {
  1995. const self = this;
  1996. // 不支持h5
  1997. wx.getSetting({
  1998. success: (res) => {
  1999. if (res.authSetting["scope.camera"]) {
  2000. // 用户已经授权
  2001. self.showSet = false;
  2002. this.prendreAutoCarme = false;
  2003. } else {
  2004. this.prendreAutoCarme = true;
  2005. // 用户还没有授权,向用户发起授权请求
  2006. wx.authorize({
  2007. scope: "scope.camera",
  2008. success: () => {
  2009. // 用户同意授权
  2010. self.showSet = false;
  2011. this.prendreAutoCarme = false;
  2012. },
  2013. fail: () => {
  2014. // 用户不同意授权
  2015. self.showSet = true;
  2016. },
  2017. });
  2018. }
  2019. },
  2020. fail: (res) => {},
  2021. });
  2022. },
  2023. studyNotice() {
  2024. this.noticeShow = true;
  2025. },
  2026. //播放笔记视频
  2027. async playNoteVideo(item) {
  2028. if (this.timer) {
  2029. clearInterval(this.timer);
  2030. }
  2031. this.vid = item.recordingUrl;
  2032. // #ifdef MP-WEIXIN
  2033. if (this.vid) {
  2034. polyvPlayerContext.changeVid(this.vid);
  2035. }
  2036. // #endif
  2037. this.recordObj = { videoCurrentTime: item.noteSecond };
  2038. if (this.recordObj.videoCurrentTime) {
  2039. this.needSeek = true; //需要跳转到播放记录
  2040. }
  2041. this.startStatus = true;
  2042. //获取节笔记
  2043. this.getNoteList();
  2044. },
  2045. //正常播放视频
  2046. async playVideo(item) {
  2047. if (this.timer) {
  2048. clearInterval(this.timer);
  2049. }
  2050. this.recordObj = item.videoCurrentTime
  2051. ? { videoCurrentTime: item.videoCurrentTime }
  2052. : await this.getRecordLast(item);
  2053. this.$store.commit("setPlayVID", {
  2054. playVID: item.recordingUrl,
  2055. });
  2056. this.$store.commit("setPlaySectionId", {
  2057. playSectionId: item.sectionId,
  2058. });
  2059. if (this.refPlv) {
  2060. this.refPlv.changeVid({
  2061. vid: item.recordingUrl,
  2062. videoCurrentTime: this.recordObj.videoCurrentTime,
  2063. });
  2064. }
  2065. this.startStatus = true;
  2066. },
  2067. getRecordLast(sectionItem) {
  2068. let { chapterId, sectionId, courseId, moduleId } = sectionItem;
  2069. return new Promise((resolve) => {
  2070. let data = {
  2071. gradeId:
  2072. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2073. goodsId:
  2074. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2075. sectionId: sectionId || 0,
  2076. courseId: courseId || courseId == 0 ? Number(courseId) : null,
  2077. chapterId: chapterId || 0,
  2078. moduleId: moduleId || 0,
  2079. orderGoodsId: this.orderGoodsId,
  2080. };
  2081. this.$api.recordLast(data).then((res) => {
  2082. resolve(res.data.data);
  2083. });
  2084. });
  2085. },
  2086. jumpNote(item) {
  2087. this.$u.toast("即将跳到笔记位置");
  2088. this.noteId = item.noteId;
  2089. if (this.playSectionId != item.sectionId) {
  2090. this.initPlayVideo({
  2091. sectionType: 1,
  2092. ...item,
  2093. videoCurrentTime: Number(item.noteSecond),
  2094. });
  2095. } else {
  2096. this.refPlv.seekVideo(item.noteSecond)
  2097. }
  2098. },
  2099. postNote() {
  2100. let self = this;
  2101. if (!(this.playSectionId > 0)) {
  2102. this.$u.toast("目前无播放视频");
  2103. return;
  2104. }
  2105. if (!this.noteValue) {
  2106. this.$u.toast("请输入内容");
  2107. return;
  2108. }
  2109. if (!this.gradeId) {
  2110. this.$u.toast("暂无班级数据");
  2111. return;
  2112. }
  2113. let noteSecond = this.refPlv.playCurrentTime();
  2114. if (!noteSecond) {
  2115. this.$u.toast("视频暂未开始");
  2116. return;
  2117. }
  2118. let data = {
  2119. gradeId: this.gradeId,
  2120. goodsId: this.goodsId,
  2121. sectionId: this.playSectionId,
  2122. courseId: this.courseId,
  2123. noteText: this.noteValue,
  2124. noteDate: this.$method.getZeroTime(),
  2125. noteSecond: noteSecond,
  2126. orderGoodsId: this.orderGoodsId,
  2127. };
  2128. this.$api.postNote(data).then((res) => {
  2129. if (res.data.code == 200) {
  2130. this.$u.toast("发布成功");
  2131. self.getNoteList();
  2132. this.noteValue = "";
  2133. }
  2134. });
  2135. },
  2136. getGradeInfo() {
  2137. // 即刻 1 待定2 日期3
  2138. let self = this;
  2139. this.$store.state.allowLoading = false;
  2140. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2141. if (res.data.code == 200) {
  2142. self.gradeDetail = res.data.data;
  2143. if (self.needProfileModal) {
  2144. return;
  2145. }
  2146. if (self.gradeDetail.learningStatus == 2) {
  2147. uni.showModal({
  2148. showCancel: false,
  2149. confirmText: "确定",
  2150. content:
  2151. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2152. success: function (resultst) {
  2153. uni.navigateBack();
  2154. },
  2155. });
  2156. }
  2157. if (
  2158. self.gradeDetail.learningStatus == 3 &&
  2159. Number(self.gradeDetail.learningTimeStart) >
  2160. Number(new Date() / 1000)
  2161. ) {
  2162. uni.showModal({
  2163. showCancel: false,
  2164. cancelText: "返回",
  2165. content:
  2166. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2167. success: function (resultst) {
  2168. uni.navigateBack();
  2169. },
  2170. });
  2171. }
  2172. }
  2173. });
  2174. this.$store.state.allowLoading = true;
  2175. },
  2176. getNoteList() {
  2177. if (this.current != 2) {
  2178. return;
  2179. }
  2180. this.noteList = [];
  2181. let data = {
  2182. courseId: this.courseId,
  2183. gradeId: this.gradeId,
  2184. goodsId: this.goodsId,
  2185. orderGoodsId: this.orderGoodsId,
  2186. };
  2187. if (this.playSectionId > 0) {
  2188. data.sectionId = this.playSectionId;
  2189. }
  2190. this.$api.noteList(data).then((res) => {
  2191. if (res.data.code == 200) {
  2192. this.noteList = res.data.rows;
  2193. }
  2194. });
  2195. },
  2196. delAnswer(answerId) {
  2197. let self = this;
  2198. let data = {
  2199. answerId: answerId,
  2200. status: -1,
  2201. orderGoodsId: this.orderGoodsId,
  2202. };
  2203. this.$api.delAnswer(data).then((res) => {
  2204. if (res.data.code == 200) {
  2205. self.getAnswerList();
  2206. }
  2207. });
  2208. },
  2209. clearCtx() {
  2210. this.placeholder = "您可以在这里输入答疑内容";
  2211. this.ctxValue = "";
  2212. this.assignUserId = 0;
  2213. },
  2214. focusNote(event) {
  2215. this.bottomHeight = event.detail.height;
  2216. },
  2217. blurNote() {
  2218. this.bottomHeight = 0;
  2219. },
  2220. blur() {
  2221. this.bottomHeight = 0;
  2222. this.clearTimer = setTimeout(() => {
  2223. this.ctxValue = "";
  2224. this.isFocus = false;
  2225. this.assignUserId = 0;
  2226. this.placeholder = "您可以在这里输入答疑内容";
  2227. }, 2000);
  2228. },
  2229. replyContent(item) {
  2230. this.isFocus = true;
  2231. this.assignUserId = item.userId;
  2232. this.placeholder = "@" + item.realname;
  2233. },
  2234. delContent(item) {
  2235. this.delAnswer(item.answerId);
  2236. },
  2237. postAnswer() {
  2238. let self = this;
  2239. let data = {
  2240. courseId: this.courseId,
  2241. answerText: this.ctxValue,
  2242. goodsId: this.goodsId,
  2243. orderGoodsId: this.orderGoodsId,
  2244. };
  2245. if (this.assignUserId > 0) {
  2246. data.assignUserId = this.assignUserId;
  2247. }
  2248. this.$api.postAnswer(data).then((res) => {
  2249. if (res.data.code == 200) {
  2250. this.$u.toast("发布成功");
  2251. self.getAnswerList();
  2252. this.isFocus = false;
  2253. this.placeholder = "您可以在这里输入答疑内容";
  2254. this.ctxValue = "";
  2255. this.assignUserId = 0;
  2256. }
  2257. });
  2258. },
  2259. postContent() {
  2260. if (!this.ctxValue || this.ctxValue == "") {
  2261. this.$u.toast("请输入内容");
  2262. return;
  2263. }
  2264. this.postAnswer();
  2265. },
  2266. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2267. console.log(this.refPlv, "this.refPlv");
  2268. let currentTime = this.refPlv.playCurrentTime();
  2269. let PlayDuration = this.refPlv.playVideoTime();
  2270. if (currentTime < 10 && !this.ossAvatarUrl) {
  2271. return;
  2272. }
  2273. if (this.playChannelId > 0) {
  2274. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2275. }
  2276. let self = this;
  2277. let data = {
  2278. fromPlat: 1, //来源平台 1小程序 2网站
  2279. photo: self.ossAvatarUrl,
  2280. sectionId: sectionId || 0,
  2281. goodsId: parseInt(self.goodsId),
  2282. courseId: parseInt(self.courseId),
  2283. orderGoodsId: this.orderGoodsId,
  2284. studyDuration: parseInt(
  2285. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2286. ),
  2287. gradeId: parseInt(self.gradeId),
  2288. chapterId: this.chapterId || 0,
  2289. moduleId: this.moduleId || 0,
  2290. videoCurrentTime: parseInt(
  2291. currentTime > 0 ? currentTime : self.studyDuration
  2292. ),
  2293. erJianErZao: this.erJianErZao,
  2294. };
  2295. if (this.ossAvatarUrl) {
  2296. data.similarity = this.compareFaceData; // 相似度
  2297. }
  2298. if (status > 0) {
  2299. data.status = status;
  2300. }
  2301. console.log(data, "记录参数");
  2302. return new Promise((resolve, reject) => {
  2303. this.$api
  2304. .studyRecord(data)
  2305. .then((res) => {
  2306. console.log(res, "记录返回");
  2307. let { code, msg } = res.data;
  2308. if (code == 200) {
  2309. if (status > 0) {
  2310. this.studyRecordMenuAllList();
  2311. let moduleId = this.moduleId || 0;
  2312. let chapterId = this.chapterId || 0;
  2313. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2314. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2315. uni.$emit("playNext" + playNextIdisRebuild, {
  2316. fromRebuild: this.isRebuild,
  2317. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2318. uni.$emit("playNext" + playNextId); //通知播放结束
  2319. }
  2320. self.ossAvatarUrl = "";
  2321. } else if (code == 600) {
  2322. uni.showModal({
  2323. showCancel: false,
  2324. title: "提示",
  2325. content: msg,
  2326. success: (resultst) => {
  2327. uni.navigateBack();
  2328. },
  2329. });
  2330. } else if (code == 558) {
  2331. this.CountTo1 = msg.split(",")[1];
  2332. this.noticeShow1 = true;
  2333. var timer = setInterval(() => {
  2334. this.CountTo1--;
  2335. if (this.CountTo1 < 0) {
  2336. this.noticeShow1 = false;
  2337. clearInterval(timer);
  2338. this.postStudyRecord(1);
  2339. }
  2340. }, 1000);
  2341. reject("中断执行");
  2342. } else {
  2343. this.uploadLock = false;
  2344. uni.showToast({
  2345. icon: "none",
  2346. title: res.data.msg,
  2347. duration: 2000,
  2348. });
  2349. if (this.erJianErZao && code == 559) {
  2350. this.isReach = true;
  2351. this.openPhoto();
  2352. }
  2353. if (code == 559 || code == 588) {
  2354. reject("中断执行");
  2355. }
  2356. }
  2357. resolve();
  2358. })
  2359. .catch((err) => {
  2360. this.studyRecordMenuAllList();
  2361. });
  2362. });
  2363. },
  2364. uploadFile(options, int) {
  2365. var self = this;
  2366. return new Promise((resolve, reject) => {
  2367. var data = {
  2368. imageStatus: int,
  2369. gradeId: this.gradeId,
  2370. orderGoodsId: this.orderGoodsId,
  2371. };
  2372. self.$api.aliyunpolicy(data).then((res) => {
  2373. if (res.data.code != 200) {
  2374. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2375. return;
  2376. }
  2377. var ossToken = res.data.data.resultContent;
  2378. if (ossToken.host == null || ossToken.host == undefined) {
  2379. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2380. return;
  2381. }
  2382. let filePath = "";
  2383. // #ifdef H5
  2384. var localData = options; //dataUrl为base64位
  2385. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  2386. let length = base.length;
  2387. let url = new Uint8Array(length);
  2388. while (length--) {
  2389. url[length] = base.charCodeAt(length);
  2390. }
  2391. filePath = new File([url], "a.jpg", {
  2392. type: "image/jpg",
  2393. });
  2394. uni.uploadFile({
  2395. url: ossToken.host,
  2396. name: "file",
  2397. file: filePath,
  2398. fileType: "image",
  2399. header: {
  2400. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2401. },
  2402. formData: {
  2403. key: ossToken.dir,
  2404. OSSAccessKeyId: ossToken.accessid,
  2405. policy: ossToken.policy,
  2406. Signature: ossToken.signature,
  2407. callback: ossToken.callback,
  2408. success_action_status: 200,
  2409. },
  2410. success: (result) => {
  2411. this.$u.toast("上传成功");
  2412. self.ossAvatarUrl = ossToken.dir;
  2413. resolve(ossToken.dir);
  2414. },
  2415. fail: (error) => {
  2416. uni.showToast({
  2417. title: "上传接口报错,请重新拍照上传" + error,
  2418. icon: "none",
  2419. });
  2420. this.openPhoto();
  2421. return;
  2422. },
  2423. });
  2424. // #endif
  2425. // #ifdef MP-WEIXIN
  2426. uni.uploadFile({
  2427. url: ossToken.host,
  2428. name: "file",
  2429. filePath: options,
  2430. fileType: "image",
  2431. header: {
  2432. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2433. },
  2434. formData: {
  2435. key: ossToken.dir,
  2436. OSSAccessKeyId: ossToken.accessid,
  2437. policy: ossToken.policy,
  2438. Signature: ossToken.signature,
  2439. callback: ossToken.callback,
  2440. success_action_status: 200,
  2441. },
  2442. success: (result) => {
  2443. // if (result.statusCode === 200) {
  2444. this.$u.toast("上传成功");
  2445. self.ossAvatarUrl = ossToken.dir;
  2446. resolve(ossToken.dir);
  2447. },
  2448. fail: (error) => {
  2449. uni.showToast({
  2450. title: "上传接口报错,请重新拍照上传" + error,
  2451. icon: "none",
  2452. });
  2453. this.openPhoto();
  2454. return;
  2455. },
  2456. });
  2457. // #endif
  2458. });
  2459. });
  2460. },
  2461. imageInfos() {
  2462. var self = this;
  2463. return new Promise(async (resolve, reject) => {
  2464. let resPath = await myCompressImage(this.avatarUrl || this.faceUrl, 50);
  2465. const waitUpload = await self.uploadFile(resPath, 0);
  2466. resolve(waitUpload);
  2467. });
  2468. },
  2469. timeEvent(playTime) {
  2470. this.configPhoto();
  2471. console.info(this.photoList, "photoList");
  2472. let photoTime = 0; //获取拍照秒数
  2473. for (let i = 0; i < this.photoList.length; i++) {
  2474. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2475. if (
  2476. (this.erJianErZao && !this.photoHistoryList.length) ||
  2477. (photoTime < playTime && photoTime > playTime - 8)
  2478. ) {
  2479. //3秒区间内才触发拍照,避免拉动滚动条
  2480. if (this.photoHistoryList.indexOf(i) < 0) {
  2481. //不存在拍照历史,没有重修过,没有学过,则拍照
  2482. //启动拍照
  2483. //暂停
  2484. console.log("去拍照");
  2485. this.refPlv.playPause();
  2486. this.refPlv.exitFullScreen();
  2487. this.photoIndex = i;
  2488. if (
  2489. uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
  2490. this.goodsId
  2491. ) {
  2492. return this.openPhoto();
  2493. } else {
  2494. this.popupPhotoShow = true;
  2495. uni.setStorageSync(`tabkePhotoShow${this.goodsId}`, this.goodsId); // 本地缓存用来判断是否已经弹出过弹窗
  2496. }
  2497. }
  2498. }
  2499. }
  2500. },
  2501. closeToast() {
  2502. clearTimeout(this.toastTimer);
  2503. this.videoToastShow = false;
  2504. },
  2505. // 新增用户视频学习日志
  2506. studyLog() {
  2507. this.$http({
  2508. url: "/user/study/log",
  2509. method: "post",
  2510. data: {
  2511. goodsId: this.goodsId,
  2512. courseId: this.courseId,
  2513. moduleId: this.moduleId || 0,
  2514. chapterId: this.chapterId || 0,
  2515. sectionId: this.playSectionId || 0,
  2516. fromPlat: 1, //来源平台 1小程序 2PC网站
  2517. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  2518. orderGoodsId: this.orderGoodsId,
  2519. },
  2520. }).then((res) => {});
  2521. },
  2522. timeupdate(time) {
  2523. console.log("播放中", time);
  2524. this.clearPauseTimer();
  2525. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  2526. this.isReach = false;
  2527. this.timeEvent();
  2528. }
  2529. },
  2530. playing() {
  2531. console.log("playing");
  2532. if (this.noticeShow) {
  2533. this.refPlv.playPause();
  2534. return;
  2535. }
  2536. this.studyLog();
  2537. if (!this.recordObj.videoCurrentTime) {
  2538. this.postStudyRecord(0);
  2539. }
  2540. this.studyTimer && clearInterval(this.studyTimer);
  2541. this.studyTimer = setInterval(() => {
  2542. this.postStudyRecord(0);
  2543. }, 15000);
  2544. },
  2545. pause() {
  2546. this.erJianErZaoPauseTip();
  2547. clearInterval(this.timer);
  2548. clearInterval(this.studyTimer);
  2549. },
  2550. async ended() {
  2551. this.hasStart = false;
  2552. uni.showToast({
  2553. icon: "none",
  2554. title: "播放完毕",
  2555. });
  2556. clearInterval(this.timer);
  2557. clearInterval(this.studyTimer);
  2558. await this.postStudyRecord(1);
  2559. this.nextSection();
  2560. },
  2561. playerError() {},
  2562. //播放下一节
  2563. nextSection() {
  2564. console.log("播放下一节");
  2565. if (!this.menuAllList.length) {
  2566. return;
  2567. }
  2568. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  2569. let i_sectionId = item.sectionId || 0;
  2570. let i_chapterId = item.chapterId || 0;
  2571. let i_moduleId = item.moduleId || 0;
  2572. return (
  2573. i_sectionId == this.playSectionId &&
  2574. i_chapterId == this.chapterId &&
  2575. i_moduleId == this.moduleId
  2576. );
  2577. });
  2578. let data = this.menuAllList[this.curPlayIndex + 1];
  2579. if (!data) {
  2580. //第二个弹窗
  2581. uni.showModal({
  2582. title: "温馨提示",
  2583. content:
  2584. "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
  2585. showCancel: !this.erJianErZao,
  2586. success: (res) => {
  2587. if (res.confirm) {
  2588. uni.switchTab({
  2589. url: "/pages/learn/index",
  2590. });
  2591. }
  2592. },
  2593. });
  2594. } else {
  2595. if (data.doType == 2) {
  2596. if (data.studyStatus == 1) {
  2597. uni.showToast({
  2598. title: "试卷已合格!",
  2599. duration: 2000,
  2600. icon: "none",
  2601. });
  2602. return;
  2603. }
  2604. uni.showModal({
  2605. title: "温馨提示",
  2606. content: "当前节视频已学完,是否进入考试?",
  2607. success: (res) => {
  2608. if (res.confirm) {
  2609. this.toQuestionBank(data);
  2610. }
  2611. },
  2612. });
  2613. return;
  2614. }
  2615. uni.showModal({
  2616. title: "温馨提示",
  2617. content: "当前节视频已学完,继续学习下一节?",
  2618. success: async (res) => {
  2619. if (res.confirm) {
  2620. this.moduleId = data.moduleId;
  2621. this.chapterId = data.chapterId;
  2622. this.sectionId = data.sectionId;
  2623. if (data.sectionType == 1) {
  2624. //录播
  2625. this.$store.commit("setPlaySectionId", {
  2626. playSectionId: data.sectionId,
  2627. });
  2628. this.$store.commit("setPlayVID", {
  2629. playVID: data.recordingUrl,
  2630. });
  2631. this.hasStart = false;
  2632. this.photoConfig = false;
  2633. this.photoIndex = 0;
  2634. this.sectionItem = data;
  2635. await this.getPhotoLastRecord(); // 获取拍照历史
  2636. this.playVideo(data);
  2637. } else if (data.sectionType == 2) {
  2638. //直播
  2639. this.studyRecordGetLastLive();
  2640. } else if (data.sectionType == 3) {
  2641. //回放
  2642. this.$store.commit("setPlaySectionId", {
  2643. playSectionId: data.sectionId,
  2644. });
  2645. this.$store.commit("setPlayVID", {
  2646. playVID: data.recordingUrl,
  2647. });
  2648. this.sectionItem = data;
  2649. this.playVideo(data);
  2650. }
  2651. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  2652. this.$store.commit("updatePlayNextId", playNextId);
  2653. this.updateChapterOpen(true);
  2654. this.reStart = false;
  2655. this.getMenuList();
  2656. }
  2657. },
  2658. });
  2659. }
  2660. },
  2661. //拍照
  2662. openPhoto() {
  2663. if (polyvPlayerContext) {
  2664. // #ifdef MP-WEIXIN
  2665. polyvPlayerContext.exitFullScreen();
  2666. // #endif
  2667. // #ifdef H5
  2668. if (this.isFullScreen()) {
  2669. this.exitFullscreen();
  2670. }
  2671. // #endif
  2672. }
  2673. // #ifdef MP-WEIXIN
  2674. this.enableAutoRotation = false;
  2675. this.photoPopup = true;
  2676. this.isTaking = true;
  2677. uni.setKeepScreenOn({
  2678. keepScreenOn: true,
  2679. });
  2680. uni.authorize({
  2681. scope: "scope.camera",
  2682. success() {},
  2683. });
  2684. // #endif
  2685. // #ifdef H5
  2686. if (
  2687. (window.navigator.mediaDevices &&
  2688. window.navigator.mediaDevices.getUserMedia) ||
  2689. window.navigator.getUserMedia ||
  2690. window.navigator.webkitGetUserMedia ||
  2691. window.navigator.mozGetUserMedia
  2692. ) {
  2693. console.log("getUserMedia----");
  2694. // 调用用户媒体设备, 访问摄像头
  2695. this.getUserMedia(
  2696. {
  2697. video: {
  2698. width: 400,
  2699. height: 300,
  2700. facingMode: "user",
  2701. },
  2702. },
  2703. this.photographSuccess,
  2704. this.photographError
  2705. );
  2706. } else {
  2707. console.log("1111没有摄像");
  2708. this.photographError();
  2709. }
  2710. // #endif
  2711. },
  2712. /**
  2713. * 人脸匹配
  2714. */
  2715. faceRecognition() {
  2716. return new Promise((resolve) => {
  2717. // #ifdef MP-WEIXIN
  2718. let fileSystem = uni.getFileSystemManager();
  2719. fileSystem.readFile({
  2720. filePath: `${this.avatarUrl}`,
  2721. encoding: "base64",
  2722. position: 0,
  2723. success: (res) => {
  2724. let base64 = "data:image/jpg;base64," + res.data;
  2725. // console.log('base64Data人脸识别参数:', {
  2726. // imageA: base64,
  2727. // orderGoodsId: this.orderGoodsId,
  2728. // gradeId: this.gradeId,
  2729. // })
  2730. this.CompareFace(base64, resolve);
  2731. },
  2732. fail(err) {
  2733. // this.$u.toast('人脸识别错误!')
  2734. console.error(err, "err-----人脸识别错误");
  2735. },
  2736. });
  2737. // #endif
  2738. // #ifdef H5
  2739. this.CompareFace(this.faceUrl, resolve);
  2740. // #endif
  2741. });
  2742. },
  2743. CompareFace(url, resolve) {
  2744. let timer = setTimeout(() => {
  2745. uni.showToast({
  2746. icon: "none",
  2747. title: "拍照超时,请重新拍照",
  2748. duration: 2000,
  2749. success: () => {
  2750. setTimeout(() => {
  2751. uni.navigateBack();
  2752. }, 1000);
  2753. },
  2754. });
  2755. }, 10 * 1000);
  2756. this.$api
  2757. .faceCertificationCompareFace({
  2758. imageA: url,
  2759. orderGoodsId: this.orderGoodsId,
  2760. gradeId: this.gradeId,
  2761. })
  2762. .then((res) => {
  2763. clearTimeout(timer);
  2764. console.log(res, "人脸识别成功res");
  2765. resolve(res.data.data);
  2766. })
  2767. .catch((err) => {
  2768. clearTimeout(timer);
  2769. // 当前网络延迟,
  2770. console.log("人脸识别错误:", err);
  2771. uni.showModal({
  2772. content: "当前网络延迟",
  2773. showCancel: false,
  2774. success: (resultst) => {
  2775. if (resultst.confirm) {
  2776. uni.navigateBack();
  2777. }
  2778. },
  2779. });
  2780. });
  2781. },
  2782. // 确定拍照
  2783. async submit() {
  2784. if (this.uploadLock) {
  2785. return;
  2786. }
  2787. this.uploadLock = true;
  2788. let compareFaceData = await this.faceRecognition();
  2789. this.compareFaceData = compareFaceData;
  2790. if (compareFaceData >= 80) {
  2791. await this.imageInfos();
  2792. this.postCoursePhotoRecord()
  2793. .then(async (res) => {
  2794. this.photoHistoryList.push(this.photoIndex);
  2795. // console.log('拍照确定提交', this.photoHistoryList);
  2796. this.postStudyRecord(); //提交记录
  2797. if (this.erJianErZao && this.isReach) {
  2798. console.log("1校验");
  2799. await this.postStudyRecord(1);
  2800. this.photoPopup = false;
  2801. this.uploadLock = false;
  2802. this.enableAutoRotation = true;
  2803. this.nextSection();
  2804. return;
  2805. }
  2806. //恢复播放
  2807. // #ifdef MP-WEIXIN
  2808. uni.setKeepScreenOn({
  2809. keepScreenOn: false,
  2810. });
  2811. // #endif
  2812. this.photoPopup = false;
  2813. this.uploadLock = false;
  2814. this.enableAutoRotation = true;
  2815. this.refPlv.resumeVideo();
  2816. })
  2817. .catch((err) => {
  2818. console.log("拍照记录接口的err", err);
  2819. uni.showToast({
  2820. title: "上传接口报错,请重新拍照上传" + err,
  2821. icon: "none",
  2822. });
  2823. this.uploadLock = false;
  2824. this.openPhoto();
  2825. });
  2826. } else {
  2827. uni.showToast({
  2828. title: "人脸匹配不通过,请重新拍照上传",
  2829. icon: "none",
  2830. duration: 2000,
  2831. });
  2832. setTimeout(() => {
  2833. this.uploadLock = false;
  2834. this.openPhoto();
  2835. }, 2000);
  2836. }
  2837. },
  2838. reTake() {
  2839. this.isTaking = true;
  2840. // #ifdef H5
  2841. this.faceUrl = "";
  2842. this.getUserMedia(
  2843. {
  2844. video: {
  2845. width: 400,
  2846. height: 300,
  2847. facingMode: "user",
  2848. },
  2849. },
  2850. this.photographSuccess,
  2851. this.photographError
  2852. );
  2853. // #endif
  2854. },
  2855. toTakePhoto() {
  2856. this.popupPhotoShow = false;
  2857. this.openPhoto();
  2858. },
  2859. takePhTips() {
  2860. this.popupPhotoShow = true;
  2861. this.isTaking = false;
  2862. this.photoPopup = false;
  2863. this.enableAutoRotation = false;
  2864. },
  2865. //确认拍照
  2866. takePhoto() {
  2867. // #ifdef MP-WEIXIN
  2868. const ctx = uni.createCameraContext();
  2869. ctx.takePhoto({
  2870. quality: "high",
  2871. success: (res) => {
  2872. this.avatarUrl = res.tempImagePath;
  2873. console.log("开始拍照this.avatarUrl:", this.avatarUrl);
  2874. this.isTaking = false;
  2875. },
  2876. fail: (err) => {},
  2877. });
  2878. // #endif
  2879. // #ifdef H5
  2880. const canvas = document.createElement("canvas");
  2881. canvas.width = 400;
  2882. canvas.height = 400;
  2883. const context = canvas.getContext("2d");
  2884. const box = document.querySelector(".photo_v");
  2885. const video = box.querySelector("video");
  2886. context.drawImage(video, 0, 0, 400, 400);
  2887. this.faceUrl = canvas.toDataURL("image/png");
  2888. this.isTaking = false;
  2889. // #endif
  2890. },
  2891. playError(e) {
  2892. console.log(e);
  2893. },
  2894. //拍照报错
  2895. error(e) {
  2896. console.log(e.detail);
  2897. },
  2898. //关闭相机
  2899. closePhoto() {
  2900. this.photoPopup = false;
  2901. this.enableAutoRotation = true;
  2902. },
  2903. checkFinishRequiredCourse() {
  2904. return this.$api
  2905. .checkFinishRequiredCourse({
  2906. businessId: this.goodsData.businessId,
  2907. goodsId: this.goodsId,
  2908. })
  2909. .then((res) => {
  2910. if (res.data.data > 0) {
  2911. uni.showModal({
  2912. showCancel: false,
  2913. confirmText: "确定",
  2914. content: "该业务层次下有未学完的商品,无法学习新商品!",
  2915. success: function (resultst) {
  2916. uni.navigateBack();
  2917. },
  2918. });
  2919. return Promise.reject();
  2920. }
  2921. return Promise.resolve();
  2922. });
  2923. },
  2924. getGoodsDetail() {
  2925. let self = this;
  2926. this.$api.goodsDetail(this.goodsId).then(async (res) => {
  2927. this.goodsData = res.data.data;
  2928. this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
  2929. if (this.goodsData.buyNote) {
  2930. this.baseHandoutTipList();
  2931. }
  2932. self.gradeId = self.goodsData.gradeId;
  2933. self.erJianErZao = self.goodsData.erJianErZao;
  2934. self.getMenuList();
  2935. self.getReMenuList(); //获取重修目录
  2936. setTimeout(function () {
  2937. if (!self.needProfileModal) {
  2938. self.getGradeInfo();
  2939. }
  2940. }, 500);
  2941. //获取节笔记
  2942. this.getNoteList();
  2943. if (self.goodsData.goodsPlayConfig) {
  2944. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2945. if (self.goodsPlayConfig.autoPlay > 0) {
  2946. self.autoplay = true;
  2947. }
  2948. if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
  2949. // #ifdef MP-WEIXIN
  2950. self.isAllowSeek = "yes";
  2951. // #endif
  2952. // #ifdef H5
  2953. self.H5isAllowSeek = "off";
  2954. // #endif
  2955. }
  2956. if (self.goodsPlayConfig.speed > 0) {
  2957. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2958. }
  2959. }
  2960. if (self.goodsData.goodsPhotographConfig) {
  2961. self.goodsPhotographConfig = JSON.parse(
  2962. self.goodsData.goodsPhotographConfig
  2963. );
  2964. if (self.goodsPhotographConfig.photoNum > 0) {
  2965. self.photoNum = self.goodsPhotographConfig.photoNum;
  2966. }
  2967. }
  2968. });
  2969. },
  2970. getAnswerList() {
  2971. this.$api
  2972. .answerList({
  2973. courseId: this.courseId,
  2974. goodsId: this.goodsId,
  2975. orderGoodsId: this.orderGoodsId,
  2976. })
  2977. .then((res) => {
  2978. if (res.data.code == 200) {
  2979. this.answerList = res.data.rows;
  2980. }
  2981. });
  2982. },
  2983. getReMenuList() {
  2984. let self = this;
  2985. this.$api
  2986. .reMenuList({
  2987. orderGoodsId: this.orderGoodsId,
  2988. courseId: this.courseId,
  2989. rebuild: 1,
  2990. gradeId: this.gradeId,
  2991. })
  2992. .then((res) => {
  2993. if (res.data.code == 200) {
  2994. for (let i = 0; i < res.data.rows.length; i++) {
  2995. let item = res.data.rows[i];
  2996. item.down = true;
  2997. item.id = item.menuId;
  2998. item.name = item.menuName;
  2999. }
  3000. self.reMenuList = res.data.rows;
  3001. this.current = 0;
  3002. if (self.reMenuList.length > 0) {
  3003. this.showNotes = false;
  3004. if (Object.keys(this.sectionItem).length) {
  3005. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  3006. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  3007. }
  3008. } else {
  3009. if (Object.keys(this.sectionItem).length) {
  3010. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  3011. this.$store.commit("updatePlayNextId", playNextId);
  3012. }
  3013. }
  3014. }
  3015. });
  3016. },
  3017. getMenuList() {
  3018. let self = this;
  3019. this.$api
  3020. .reMenuList({
  3021. courseId: this.courseId,
  3022. gradeId: this.gradeId,
  3023. orderGoodsId: this.orderGoodsId,
  3024. })
  3025. .then((res) => {
  3026. if (res.data.code == 200) {
  3027. for (let i = 0; i < res.data.rows.length; i++) {
  3028. let item = res.data.rows[i];
  3029. item.down = true;
  3030. item.id = item.menuId;
  3031. item.name = item.menuName;
  3032. item.menuType = item.type;
  3033. }
  3034. this.menuList = res.data.rows;
  3035. this.reStart = true;
  3036. }
  3037. });
  3038. },
  3039. courseDetail() {
  3040. this.$api.courseDetail(this.courseId).then((res) => {
  3041. if (res.data.code == 200) {
  3042. this.detail = res.data.data;
  3043. }
  3044. });
  3045. },
  3046. open(item) {
  3047. item.showChildren = !item.showChildren;
  3048. },
  3049. change(index) {
  3050. this.current = index;
  3051. if (index == 3) {
  3052. this.getAnswerList();
  3053. } else if (index == 2) {
  3054. this.getNoteList();
  3055. }
  3056. },
  3057. clickMulu() {
  3058. this.muluStyle = !this.muluStyle;
  3059. },
  3060. clears() {
  3061. return new Promise((resolve, reject) => {
  3062. this.vid = "";
  3063. polyvPlayerContext && polyvPlayerContext.destroy();
  3064. polyvPlayerContext = null;
  3065. resolve();
  3066. });
  3067. },
  3068. /**
  3069. * 退出全屏
  3070. */
  3071. exitFullscreen() {
  3072. try {
  3073. var de = document;
  3074. if (de.exitFullscreen) {
  3075. de.exitFullscreen();
  3076. } else if (de.mozCancelFullScreen) {
  3077. de.mozCancelFullScreen();
  3078. } else if (de.webkitCancelFullScreen) {
  3079. de.webkitCancelFullScreen();
  3080. }
  3081. } catch (err) {}
  3082. },
  3083. fullele() {
  3084. return (
  3085. document.fullscreenElement ||
  3086. document.webkitFullscreenElement ||
  3087. document.msFullscreenElement ||
  3088. document.mozFullScreenElement ||
  3089. null
  3090. );
  3091. },
  3092. //判断是否全屏
  3093. isFullScreen() {
  3094. return !!(document.webkitIsFullScreen || this.fullele());
  3095. },
  3096. getUserMedia(constraints, success, error) {
  3097. console.log("getUserMedia===", constraints, "success:", success);
  3098. if (window.navigator.mediaDevices.getUserMedia) {
  3099. // 最新的标准API
  3100. window.navigator.mediaDevices
  3101. .getUserMedia(constraints)
  3102. .then(success)
  3103. .catch(error);
  3104. } else if (window.navigator.webkitGetUserMedia) {
  3105. // webkit核心浏览器
  3106. window.navigator.webkitGetUserMedia(constraints, success, error);
  3107. } else if (window.navigator.mozGetUserMedia) {
  3108. // firfox浏览器
  3109. window.navigator.mozGetUserMedia(constraints, success, error);
  3110. } else if (window.navigator.getUserMedia) {
  3111. // 旧版API
  3112. window.navigator.getUserMedia(constraints, success, error);
  3113. }
  3114. },
  3115. photographSuccess(stream) {
  3116. console.log("有摄像头---", stream);
  3117. this.photoPopup = true;
  3118. this.isTaking = true;
  3119. this.enableAutoRotation = false;
  3120. this.$nextTick(() => {
  3121. const box = document.querySelector(".photo_v");
  3122. const video = box.querySelector("video");
  3123. console.log("video:", video);
  3124. video.srcObject = stream;
  3125. video.play();
  3126. });
  3127. },
  3128. photographError(err) {
  3129. console.log("没有摄像头:", err);
  3130. uni.showModal({
  3131. title: "提示",
  3132. content:
  3133. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  3134. cancelText: "取消",
  3135. confirmText: "确定",
  3136. success: (res) => {
  3137. if (res.confirm) {
  3138. uni.navigateBack();
  3139. } else if (res.cancel) {
  3140. }
  3141. },
  3142. });
  3143. },
  3144. },
  3145. };
  3146. </script>
  3147. <style lang="scss" scope>
  3148. @import "./css/detail.scss";
  3149. .top {
  3150. &__header {
  3151. position: relative;
  3152. width: 100%;
  3153. height: 150rpx;
  3154. padding: 24rpx 150rpx 24rpx 24rpx;
  3155. .img {
  3156. position: absolute;
  3157. left: 0;
  3158. top: 0;
  3159. width: 100%;
  3160. }
  3161. .note {
  3162. position: relative;
  3163. z-index: 10;
  3164. font-size: 24rpx;
  3165. font-family: PingFang SC;
  3166. font-weight: bold;
  3167. color: #efdbff;
  3168. }
  3169. .title {
  3170. position: relative;
  3171. z-index: 10;
  3172. font-size: 26rpx;
  3173. font-family: PingFang SC;
  3174. font-weight: bold;
  3175. color: #ffffff;
  3176. }
  3177. }
  3178. }
  3179. #top {
  3180. position: relative;
  3181. z-index: 99;
  3182. }
  3183. .polyv_detail {
  3184. display: flex;
  3185. flex-direction: column;
  3186. height: 100vh;
  3187. position: relative;
  3188. top: 0;
  3189. left: 0;
  3190. .pops {
  3191. position: absolute;
  3192. top: 0;
  3193. left: 0;
  3194. background: #ccc;
  3195. opacity: 0.5;
  3196. width: 100%;
  3197. height: 300rpx;
  3198. z-index: 9999;
  3199. }
  3200. .box {
  3201. flex: 1;
  3202. overflow: hidden;
  3203. margin: 16rpx 16rpx 100rpx 16rpx;
  3204. .box_in {
  3205. height: 100%;
  3206. }
  3207. }
  3208. .first_ml {
  3209. margin: 16rpx 16rpx 16rpx 16rpx;
  3210. }
  3211. }
  3212. .btnSet {
  3213. width: 440rpx;
  3214. height: 80rpx;
  3215. background: #007aff;
  3216. border-radius: 40rpx;
  3217. color: #ffffff;
  3218. font-size: 28rpx;
  3219. line-height: 80rpx;
  3220. }
  3221. .btnReply {
  3222. width: 80rpx;
  3223. height: 40rpx;
  3224. background: #e3f0ff;
  3225. border-radius: 16rpx;
  3226. text-align: center;
  3227. color: #007aff;
  3228. }
  3229. .btnDel {
  3230. width: 80rpx;
  3231. height: 40rpx;
  3232. background: #ffedf0;
  3233. border-radius: 16rpx;
  3234. text-align: center;
  3235. color: #ff2d55;
  3236. }
  3237. .btnReply {
  3238. width: 80rpx;
  3239. height: 40rpx;
  3240. background: #e3f0ff;
  3241. border-radius: 16rpx;
  3242. font-size: 24rpx;
  3243. }
  3244. .lecture-content {
  3245. background: #fff;
  3246. margin-top: 10rpx;
  3247. padding: 10rpx;
  3248. border-radius: 16rpx;
  3249. }
  3250. .photoBox {
  3251. width: 100%;
  3252. // background-color: #ffffff;
  3253. // border-radius: 24px 24px 0px 0px;
  3254. .photoTop {
  3255. width: 100%;
  3256. height: 74rpx;
  3257. border-radius: 20px 20px 0px 0px;
  3258. background-color: #ffffff;
  3259. display: flex;
  3260. align-items: center;
  3261. justify-content: center;
  3262. padding: 0rpx 38rpx;
  3263. .sqzz {
  3264. width: 28rpx;
  3265. height: 28rpx;
  3266. display: flex;
  3267. align-items: center;
  3268. justify-content: center;
  3269. }
  3270. .centersq {
  3271. color: #333;
  3272. font-size: 30rpx;
  3273. font-weight: 500;
  3274. }
  3275. }
  3276. .photoCenter {
  3277. width: 750rpx;
  3278. height: 75vh;
  3279. position: relative;
  3280. .center_camera {
  3281. width: 100%;
  3282. height: 75vh;
  3283. position: fixed;
  3284. .head_take {
  3285. width: 100%;
  3286. height: 75vh;
  3287. display: flex;
  3288. flex-direction: column;
  3289. }
  3290. .headTake_up {
  3291. width: 100%;
  3292. height: 100rpx;
  3293. }
  3294. .headTake_minddle {
  3295. display: flex;
  3296. .min_img {
  3297. width: 500rpx;
  3298. height: 550rpx;
  3299. }
  3300. .min_left,
  3301. .min_right {
  3302. flex: 1;
  3303. height: 550rpx;
  3304. }
  3305. }
  3306. .headTake_down {
  3307. width: 100%;
  3308. flex: 1;
  3309. }
  3310. .color {
  3311. background-color: #333;
  3312. opacity: 0.5;
  3313. }
  3314. .photo_v {
  3315. width: 100%;
  3316. height: 100%;
  3317. }
  3318. .mask {
  3319. width: 500rpx;
  3320. height: 550rpx;
  3321. position: absolute;
  3322. top: 100rpx;
  3323. left: 0;
  3324. right: 0;
  3325. bottom: 0;
  3326. margin: 0 auto;
  3327. box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
  3328. }
  3329. }
  3330. .custom {
  3331. width: 750rpx;
  3332. height: 75vh;
  3333. position: absolute;
  3334. z-index: 1000;
  3335. top: 0;
  3336. left: 0;
  3337. image {
  3338. width: 100%;
  3339. height: 100%;
  3340. }
  3341. }
  3342. }
  3343. .btns {
  3344. display: flex;
  3345. .takePhoto_btn {
  3346. width: 100%;
  3347. display: flex;
  3348. align-items: center;
  3349. justify-content: space-between;
  3350. background: #a9a7a9;
  3351. padding: 40rpx 26rpx;
  3352. .middle_btn {
  3353. width: 120rpx;
  3354. height: 120rpx;
  3355. border-radius: 40rpx;
  3356. border: 4rpx solid #ffffff;
  3357. display: flex;
  3358. align-items: center;
  3359. justify-content: center;
  3360. }
  3361. .square {
  3362. width: 96rpx;
  3363. height: 96rpx;
  3364. background: #ffffff;
  3365. border-radius: 28rpx;
  3366. }
  3367. .rights {
  3368. font-size: 32rpx;
  3369. font-weight: 500;
  3370. color: #ffffff;
  3371. }
  3372. }
  3373. .btnResult {
  3374. height: 100rpx;
  3375. flex: 1;
  3376. background-color: #07c160;
  3377. text-align: center;
  3378. line-height: 100rpx;
  3379. color: #fff;
  3380. font-size: 32rpx;
  3381. font-weight: bold;
  3382. }
  3383. }
  3384. }
  3385. .chat_box {
  3386. display: flex;
  3387. padding: 20rpx;
  3388. justify-content: space-between;
  3389. }
  3390. .chat3 {
  3391. font-size: 30rpx;
  3392. font-family: PingFang SC;
  3393. font-weight: 500;
  3394. color: #666666;
  3395. margin-top: 10rpx;
  3396. }
  3397. .chat2 {
  3398. font-size: 20rpx;
  3399. font-family: PingFang SC;
  3400. font-weight: 500;
  3401. color: #999999;
  3402. margin-top: 10rpx;
  3403. }
  3404. .chat1 {
  3405. font-size: 24rpx;
  3406. font-family: PingFang SC;
  3407. font-weight: 500;
  3408. color: #333333;
  3409. }
  3410. .leftPadding {
  3411. margin-left: 8rpx;
  3412. }
  3413. .t2Content {
  3414. font-size: 24rpx;
  3415. font-family: PingFang SC;
  3416. font-weight: bold;
  3417. color: #999999;
  3418. line-height: 48rpx;
  3419. }
  3420. .tBox2 {
  3421. display: flex;
  3422. padding-top: 10rpx;
  3423. color: #333333;
  3424. font-size: 30rpx;
  3425. font-weight: 400;
  3426. }
  3427. .tBox {
  3428. display: flex;
  3429. align-items: center;
  3430. padding-top: 10rpx;
  3431. }
  3432. .title {
  3433. font-size: 24rpx;
  3434. color: #999999;
  3435. }
  3436. .Answering {
  3437. .answer_item {
  3438. &:nth-child(2) {
  3439. border-radius: 16rpx 16rpx 0rpx 0rpx;
  3440. }
  3441. &:nth-last-child(1) {
  3442. border-radius: 0rpx 0rpx 16rpx 16rpx;
  3443. }
  3444. }
  3445. }
  3446. .inputBottom {
  3447. position: fixed;
  3448. left: 0;
  3449. bottom: 0;
  3450. background: #ffffff;
  3451. height: 98rpx;
  3452. display: flex;
  3453. align-items: center;
  3454. width: 100%;
  3455. .flex_auto {
  3456. flex: 1;
  3457. margin-left: 10%;
  3458. word-break: break-all;
  3459. // .input {
  3460. // height: 60rpx;
  3461. // }
  3462. }
  3463. .btn {
  3464. color: #007aff;
  3465. font-size: 30rpx;
  3466. font-weight: bold;
  3467. width: 15%;
  3468. text-align: center;
  3469. }
  3470. .input {
  3471. background: rgba(244, 244, 244, 0.98);
  3472. height: 60rpx;
  3473. border-radius: 24rpx;
  3474. margin-top: 12rpx;
  3475. }
  3476. }
  3477. .noteBox {
  3478. width: 100%;
  3479. background: #ffffff;
  3480. padding: 0rpx 10rpx 20rpx;
  3481. border-radius: 16rpx;
  3482. overflow: hidden;
  3483. .left_ti {
  3484. padding-top: 14rpx;
  3485. }
  3486. }
  3487. .dateBox {
  3488. width: 216rpx;
  3489. height: 48rpx;
  3490. background: #ffffff;
  3491. border-radius: 24rpx;
  3492. font-size: 24rpx;
  3493. color: #666666;
  3494. text-align: center;
  3495. line-height: 48rpx;
  3496. margin: 16rpx 0rpx 8rpx;
  3497. }
  3498. .t_content1 {
  3499. color: #007aff;
  3500. margin-left: 10rpx;
  3501. }
  3502. .tag1 {
  3503. border: 2rpx solid #007aff;
  3504. border-radius: 8rpx;
  3505. font-size: 20rpx;
  3506. color: #007aff;
  3507. padding: 5rpx;
  3508. }
  3509. .b_title {
  3510. color: #333333;
  3511. font-size: 30rpx;
  3512. font-weight: bold;
  3513. }
  3514. page {
  3515. background: #eaeef1;
  3516. }
  3517. .menuBox {
  3518. width: 100%;
  3519. background: #ffffff;
  3520. border-radius: 16rpx;
  3521. padding: 0rpx 20rpx;
  3522. margin-bottom: 20rpx;
  3523. }
  3524. .btnspric {
  3525. border-top: 1rpx solid #eee;
  3526. display: flex;
  3527. align-items: center;
  3528. justify-content: space-between;
  3529. height: 108rpx;
  3530. padding-left: 43rpx;
  3531. padding-right: 32rpx;
  3532. }
  3533. .btnspric > .lefprL {
  3534. font-size: 36rpx;
  3535. color: #0c141f;
  3536. font-weight: bold;
  3537. }
  3538. .btnspric > .lefprR {
  3539. padding: 0rpx 24rpx;
  3540. height: 60rpx;
  3541. line-height: 60rpx;
  3542. text-align: center;
  3543. color: #fff;
  3544. background: #32467b;
  3545. border-radius: 24rpx;
  3546. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3547. }
  3548. .yhj,
  3549. .hdyhj {
  3550. padding: 24rpx 29rpx 24rpx 34rpx;
  3551. }
  3552. .yhj {
  3553. border-bottom: 16rpx solid #f9f9f9;
  3554. }
  3555. .yhjtit {
  3556. font-size: 30rpx;
  3557. color: #0c141f;
  3558. font-weight: 500;
  3559. margin-bottom: 14rpx;
  3560. }
  3561. .yhjList {
  3562. display: flex;
  3563. align-items: center;
  3564. justify-content: space-between;
  3565. margin-bottom: 14rpx;
  3566. }
  3567. .yhjList > .yhjLefts {
  3568. display: flex;
  3569. align-items: center;
  3570. }
  3571. .yhjLefts > .yhl {
  3572. color: #32467b;
  3573. font-size: 30rpx;
  3574. margin-right: 31rpx;
  3575. }
  3576. .yhjLefts > .yhbq {
  3577. font-size: 24rpx;
  3578. color: #ff9500;
  3579. border-radius: 18rpx;
  3580. background-color: rgba(255, 149, 0, 0.2);
  3581. border: 2rpx solid #ff9500;
  3582. height: 38rpx;
  3583. line-height: 38rpx;
  3584. padding: 0rpx 16rpx;
  3585. }
  3586. .ts {
  3587. font-size: 24rpx;
  3588. color: #999;
  3589. margin: 14rpx 0rpx;
  3590. padding-right: 29rpx;
  3591. padding-left: 34rpx;
  3592. }
  3593. .yh {
  3594. padding-top: 20rpx;
  3595. }
  3596. .yh > .yhtitle {
  3597. display: flex;
  3598. align-items: center;
  3599. justify-content: space-between;
  3600. padding-right: 29rpx;
  3601. padding-left: 34rpx;
  3602. }
  3603. .priceBxs {
  3604. display: flex;
  3605. align-items: center;
  3606. }
  3607. .priceBxs > .pricleft {
  3608. border-radius: 24rpx;
  3609. border: 1rpx solid #e91313;
  3610. background-color: rgba(233, 19, 19, 0.1);
  3611. padding: 0rpx 18rpx;
  3612. height: 49rpx;
  3613. line-height: 49rpx;
  3614. text-align: center;
  3615. font-size: 30rpx;
  3616. font-weight: 500;
  3617. color: #e91313;
  3618. margin-right: 13rpx;
  3619. }
  3620. .topBox {
  3621. padding: 32rpx 32rpx 24rpx;
  3622. border-bottom: 1rpx solid #eeeeee;
  3623. }
  3624. .topBox > .boldFonstType {
  3625. font-weight: 500;
  3626. font-size: 30rpx;
  3627. margin: 16rpx 0rpx 23rpx;
  3628. }
  3629. .topBox > .firstTopL {
  3630. display: flex;
  3631. align-items: center;
  3632. }
  3633. .topBox > .firstTopL > .imageBs {
  3634. width: 331rpx;
  3635. height: 160rpx;
  3636. border-radius: 6rpx;
  3637. overflow: hidden;
  3638. margin-right: 8rpx;
  3639. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  3640. }
  3641. .topBox > .firstTopL > .imageBs > image {
  3642. width: 100%;
  3643. height: 100%;
  3644. }
  3645. .topBox > .firstTopL > .textBs {
  3646. font-size: 30rpx;
  3647. font-weight: bold;
  3648. color: #0c141f;
  3649. }
  3650. .content {
  3651. padding: 24rpx;
  3652. text-align: left;
  3653. }
  3654. .catalogBox {
  3655. display: flex;
  3656. align-items: center;
  3657. flex-wrap: nowrap;
  3658. overflow-x: auto;
  3659. padding-left: 38rpx;
  3660. max-height: 305rpx;
  3661. overflow-y: auto;
  3662. transition: all 0.4s;
  3663. }
  3664. .catalogBox > .catalogA {
  3665. min-width: 200rpx;
  3666. height: 48rpx;
  3667. line-height: 48rpx;
  3668. // text-align: center;
  3669. border: 2rpx solid transparent;
  3670. white-space: nowrap;
  3671. text-overflow: ellipsis;
  3672. overflow: hidden;
  3673. word-break: break-all;
  3674. border-radius: 10rpx;
  3675. background: rgba(22, 119, 255, 0.05);
  3676. padding-left: 19rpx;
  3677. box-sizing: border-box;
  3678. padding-right: 15rpx;
  3679. margin-right: 16rpx;
  3680. margin-bottom: 20rpx;
  3681. margin-top: 15rpx;
  3682. font-size: 24rpx;
  3683. color: #666;
  3684. }
  3685. .catalogBox > .activesq {
  3686. border-color: #1677ff;
  3687. }
  3688. .changeCatalogBox {
  3689. display: block;
  3690. }
  3691. .catalogBox::-webkit-scrollbar {
  3692. display: none; /* Chrome Safari */
  3693. }
  3694. .price_t2 {
  3695. font-size: 18rpx;
  3696. font-family: PingFang SC;
  3697. font-weight: 500;
  3698. text-decoration: line-through;
  3699. color: #999999;
  3700. }
  3701. .price_t1 {
  3702. font-size: 33rpx;
  3703. font-family: PingFang SC;
  3704. font-weight: bold;
  3705. color: #e91313;
  3706. }
  3707. .sc_t {
  3708. font-size: 22rpx;
  3709. color: #000000;
  3710. }
  3711. .sc {
  3712. width: 29rpx;
  3713. height: 29rpx;
  3714. }
  3715. .buy {
  3716. width: 138rpx;
  3717. height: 48rpx;
  3718. line-height: 48rpx;
  3719. background: #32467b;
  3720. border-radius: 10rpx;
  3721. color: #ffffff;
  3722. font-size: 28rpx;
  3723. text-align: center;
  3724. vertical-align: middle;
  3725. position: absolute;
  3726. right: 30rpx;
  3727. }
  3728. .video_body {
  3729. padding-bottom: 96rpx;
  3730. }
  3731. .footer_tab {
  3732. position: fixed;
  3733. bottom: 0;
  3734. height: 96rpx;
  3735. width: 100%;
  3736. background-color: #ffffff;
  3737. }
  3738. .tj_box {
  3739. width: 50%;
  3740. display: inline-block;
  3741. text-align: center;
  3742. margin: 10rpx 0;
  3743. }
  3744. .teacher_t {
  3745. font-size: 24rpx;
  3746. font-family: PingFang SC;
  3747. font-weight: 400;
  3748. color: #666666;
  3749. line-height: 36rpx;
  3750. margin-left: 15rpx;
  3751. }
  3752. .teacher_img {
  3753. width: 87rpx;
  3754. height: 129rpx;
  3755. }
  3756. .t2 {
  3757. font-size: 24rpx;
  3758. font-family: PingFang SC;
  3759. color: #666666;
  3760. line-height: 36rpx;
  3761. margin: 15rpx;
  3762. }
  3763. .r_t2 {
  3764. width: 201rpx;
  3765. height: 49rpx;
  3766. background: rgba(22, 119, 255, 0.05);
  3767. border: 1rpx solid #32467b;
  3768. border-radius: 16rpx;
  3769. color: #666666;
  3770. font-size: 23rpx;
  3771. text-align: center;
  3772. display: flex;
  3773. align-items: center;
  3774. padding: 5rpx;
  3775. }
  3776. .scroll_box {
  3777. width: 100%;
  3778. height: 60rpx;
  3779. background: #ffffff;
  3780. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3781. white-space: nowrap;
  3782. overflow: hidden;
  3783. margin: 15rpx 0;
  3784. }
  3785. .r_sliper {
  3786. padding: 0 20rpx;
  3787. }
  3788. .top_line {
  3789. width: 6rpx;
  3790. height: 22rpx;
  3791. background: #32467b;
  3792. margin-right: 10rpx;
  3793. }
  3794. .video_t2 {
  3795. font-size: 24rpx;
  3796. font-family: PingFang SC;
  3797. font-weight: 500;
  3798. color: #666666;
  3799. }
  3800. .video_play {
  3801. position: absolute;
  3802. width: 95rpx;
  3803. height: 95rpx;
  3804. top: 0;
  3805. left: 0;
  3806. right: 0;
  3807. bottom: 0;
  3808. margin: auto;
  3809. }
  3810. .video_box {
  3811. position: relative;
  3812. }
  3813. .rotoct {
  3814. transform: rotate(90deg);
  3815. }
  3816. .slot-content {
  3817. padding: 0 20rpx;
  3818. }
  3819. .notice_modal {
  3820. .content {
  3821. width: 100%;
  3822. height: 100%;
  3823. padding: 56rpx 56rpx 56rpx 64rpx;
  3824. .title {
  3825. color: #222;
  3826. line-height: 40rpx;
  3827. font-size: 36rpx;
  3828. text-align: center;
  3829. font-weight: bold;
  3830. margin-bottom: 24rpx;
  3831. }
  3832. .text {
  3833. height: 340rpx;
  3834. line-height: 40rpx;
  3835. text-indent: 2em;
  3836. font-size: 32rpx;
  3837. color: #222;
  3838. }
  3839. .had_read {
  3840. width: 100%;
  3841. height: 88rpx;
  3842. line-height: 88rpx;
  3843. text-align: center;
  3844. background: #3577e8;
  3845. border-radius: 240rpx;
  3846. font-size: 32rpx;
  3847. font-weight: 500;
  3848. color: #fff;
  3849. margin-top: 20rpx;
  3850. &.gray {
  3851. background: #bbbec5;
  3852. }
  3853. }
  3854. }
  3855. }
  3856. .full_mulu {
  3857. position: absolute;
  3858. top: 100rpx;
  3859. right: 20rpx;
  3860. width: 700rpx;
  3861. height: 515rpx;
  3862. color: #333;
  3863. display: flex;
  3864. align-items: center;
  3865. justify-content: space-between;
  3866. z-index: 99999;
  3867. .mulus {
  3868. width: 623rpx;
  3869. // height: 515rpx;
  3870. height: 400rpx;
  3871. overflow-y: scroll;
  3872. // overflow: scroll;
  3873. }
  3874. .mulu_box_in {
  3875. background-color: #b7b7b7;
  3876. border-radius: 16rpx;
  3877. // transition: all 0.5s;
  3878. &::after {
  3879. content: "";
  3880. width: 0;
  3881. height: 0;
  3882. position: absolute;
  3883. top: 235rpx;
  3884. right: 27px;
  3885. border-top: 16rpx solid transparent;
  3886. border-right: 16rpx solid transparent;
  3887. border-left: 16rpx solid #b7b7b7;
  3888. border-bottom: 16rpx solid transparent;
  3889. }
  3890. }
  3891. .mulu_box_out {
  3892. // visibility: hidden;
  3893. display: none;
  3894. }
  3895. .menuBox_mulu {
  3896. // width: 100%;
  3897. background: #ffffff;
  3898. border-radius: 16rpx;
  3899. padding: 0rpx 20rpx;
  3900. margin-bottom: 20rpx;
  3901. }
  3902. .ml_img {
  3903. position: absolute;
  3904. right: 0;
  3905. top: 100rpx;
  3906. }
  3907. .items {
  3908. width: 620rpx;
  3909. height: 100rpx;
  3910. border: 1rpx solid red;
  3911. }
  3912. }
  3913. </style>