detail.vue 113 KB

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