detail.vue 107 KB

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