detail.vue 103 KB

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