detail.vue 113 KB

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