detail.vue 130 KB

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