detail.vue 124 KB

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