detail.vue 121 KB

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