detail.vue 142 KB

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