detail.vue 107 KB

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