detail.vue 104 KB

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