detail.vue 140 KB

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