detail.vue 109 KB

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