detail.vue 113 KB

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