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 in courseHandoutsData"
  251. :key="item.handoutsId"
  252. >
  253. <view class="title">
  254. {{ item.handoutsName }}
  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 config from "@/common/config";
  790. import { mapGetters, mapMutations } from "vuex";
  791. var polyvPlayerContext = null;
  792. export default {
  793. components: {
  794. courseModule,
  795. courseChapter,
  796. courseSection,
  797. PopupPhoto,
  798. },
  799. data() {
  800. return {
  801. markContent: "http://admin.zhujianpeixun.com/",
  802. showMark: false,
  803. hasStart: false,
  804. channelItem: null,
  805. lockTimer: null,
  806. orderGoodsId: 0,
  807. noticeShow: false,
  808. navShow: true,
  809. enableAutoRotation: true,
  810. seekTime: "",
  811. toastTimer: null,
  812. videoToastShow: false,
  813. initLiveOk: false,
  814. livePlay: false, //是否正在播放直播,不含暂停
  815. liveDuration: 0, //直播观看时长
  816. videoOption: {
  817. mode: "live",
  818. uid: "",
  819. cid: "",
  820. openId: "",
  821. isAutoChange: false,
  822. forceVideo: false,
  823. },
  824. courseHandoutsData: [],
  825. liveDetail: {},
  826. showSet: false,
  827. startStatus: false,
  828. detail: {},
  829. courseId: 0,
  830. placeholder:
  831. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  832. inputStyle: {
  833. background: "rgba(244, 244, 244, 0.98)",
  834. borderRadius: "24rpx",
  835. padding: "8rpx",
  836. marginBottom: "10rpx",
  837. },
  838. list: [],
  839. menuList: [],
  840. current: 0,
  841. vid: "",
  842. goodsId: 0,
  843. goodsData: {},
  844. photoPopup: false,
  845. goodsPlayConfig: null,
  846. autoplay: false,
  847. isAllowSeek: "no",
  848. playbackRate: [1.0],
  849. timer: null,
  850. goodsPhotographConfig: null,
  851. intervalTimeList: [], // 间隔拍照时长
  852. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  853. playTime: 0, //页面播放时长,不含暂停
  854. currentTime: 0,
  855. avatarUrl: "",
  856. ossAvatarUrl: "",
  857. studyDuration: 0, // 当前视频时长
  858. gradeId: 0,
  859. chapterId: 0,
  860. moduleId: 0,
  861. reMenuList: [],
  862. answerList: [],
  863. assignUserId: 0,
  864. placeholder: "您可以在这里输入答疑内容",
  865. ctxValue: "",
  866. noteList: [],
  867. noteValue: "",
  868. noteId: 0,
  869. recordObj: 0,
  870. gradeDetail: {},
  871. isTaking: true, //是否正在拍照
  872. needSeek: false, //第一次播放是否需要跳转
  873. needProfileModal: false, //是否需要资料审核弹框
  874. liveObj: {},
  875. photoNum: 0,
  876. photoList: [], //拍照的时间点
  877. photoConfig: false, //是否配置好拍照次数
  878. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  879. photoHistoryList: [], //已拍照历史的下标点
  880. sectionItem: {},
  881. businessData: {},
  882. showNotes: true,
  883. menuIndex: [],
  884. uploadLock: false, //上传图片
  885. isPlayRebuild: false, //是否正在播放重修视频
  886. isRebuild: false, //视频是否从重修目录点击
  887. isFocus: false,
  888. clearTimer: null,
  889. livingItem: "",
  890. option: null,
  891. isOther: "",
  892. downLoading: false, //下载讲义加载
  893. muluStyle: false, //显示和隐藏目录样式
  894. bottomHeight: 0,
  895. toggleCourseShow: false, // 切换课程弹窗
  896. informId: "", //消息id,从公众号消息模板进来的才有
  897. courseList: [], // 课程列表
  898. reStart: false, // 是否显示模块/章/节
  899. subList: [],
  900. subIndex: 0,
  901. goodsTeacher: [],
  902. teacherList: [],
  903. teacherIndex: 0,
  904. newActiveSubjectId: "", //当前选中ID
  905. compareFaceData: 0, // 拍照匹配相似度
  906. prendreAutoCarme: false, // 是否发起授权相机
  907. studyTimer: null, // 学习记录定时器
  908. CountTo: 30, // 倒计时
  909. handoutTipLength: 0,
  910. menuAllList: [],
  911. popupPhotoShow: false,
  912. curPlayIndex: 0, // 正在播放的节的下标
  913. // h5
  914. vodPlayerJs: "https://player.polyv.net/script/player.js",
  915. player: "",
  916. H5isAllowSeek: "off",
  917. // stream: null,
  918. faceUrl: "",
  919. };
  920. },
  921. computed: {
  922. ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
  923. },
  924. watch: {
  925. showSet(n) {
  926. if (n) {
  927. // var polyvPlayerContext = this.selectComponent("#playerVideo")
  928. if (polyvPlayerContext) {
  929. // #ifdef MP-WEIXIN
  930. polyvPlayerContext.pause();
  931. // #endif
  932. // #ifdef H5
  933. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  934. // #endif
  935. }
  936. }
  937. },
  938. photoPopup(n) {
  939. if (n) {
  940. if (this.prendreAutoCarme) {
  941. this.photoPopup = false;
  942. }
  943. this.showSet && (this.photoPopup = false);
  944. }
  945. },
  946. },
  947. onLoad(option) {
  948. console.log("--option--", option);
  949. this.courseId = Number(option.id) || "";
  950. this.goodsId = Number(option.goodsId);
  951. this.orderGoodsId = Number(option.orderGoodsId) || "";
  952. this.gradeId = option.gradeId;
  953. this.isOther = option.isOther;
  954. if (this.isOther) {
  955. this.showMark = true;
  956. return;
  957. }
  958. this.option = option;
  959. // 公众号模板消息的数据埋点
  960. if (option.informId) {
  961. this.informId = option.informId;
  962. }
  963. },
  964. async onShow() {
  965. if (this.option.skipPort) {
  966. await this.$method.skipLogin(this.option.skipPort);
  967. }
  968. if (this.$method.isGoLogin()) {
  969. // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  970. return;
  971. }
  972. console.log("onshow返回之后");
  973. this.courseCourseList();
  974. this.informId && this.clickOfficial(); // 从公众号消息点击进来上报一次
  975. !this.userInfo && this.$api.refreshUserInfo();
  976. this.$store.getters.dictObj;
  977. },
  978. onUnload() {
  979. console.log("onUnloadonUnloadonUnloadonUnload");
  980. this.originUnload();
  981. this.clears();
  982. },
  983. onHide() {
  984. this.originUnload();
  985. },
  986. mounted() {},
  987. methods: {
  988. ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
  989. // 新增微信公众号模板消息点击数据
  990. clickOfficial() {
  991. this.$http({
  992. url: "/data/click",
  993. method: "post",
  994. data: { informId: this.informId },
  995. }).then((res) => {
  996. if (res.data.code == 200) {
  997. console.log("上报埋点");
  998. }
  999. });
  1000. },
  1001. // 点击课程目录
  1002. cMenu(item, index) {
  1003. this.subIndex = index;
  1004. this.newActiveSubjectId = item.subjectId;
  1005. },
  1006. courseCourseList() {
  1007. // /course/courseList查询商品下的课程列表
  1008. this.courseList = [];
  1009. this.menuList = [];
  1010. this.$api
  1011. .courseCourseList({
  1012. pageNum: 1,
  1013. pageSize: 200,
  1014. goodsId: this.goodsId,
  1015. gradeId: this.gradeId,
  1016. orderGoodsId: this.orderGoodsId,
  1017. })
  1018. .then((res) => {
  1019. if (res.data.code == 200) {
  1020. this.courseList.push.apply(this.courseList, res.data.rows);
  1021. // 科目
  1022. let allItem = [{ subjectId: 0, subjectName: "所有" }];
  1023. let ids = [];
  1024. const newArr = [];
  1025. this.courseList.forEach((item) => {
  1026. if (ids.indexOf(item.subjectId) == -1) {
  1027. ids.push(item.subjectId);
  1028. newArr.push(item);
  1029. }
  1030. });
  1031. this.subList = [...allItem, ...newArr];
  1032. console.log(
  1033. "this.courseList:",
  1034. this.courseList,
  1035. "length:",
  1036. res.data.rows.length
  1037. );
  1038. if (res.data.rows.length) {
  1039. this.courseBusiness(res.data.rows[0].businessId);
  1040. }
  1041. if (res.data.total > 1) {
  1042. this.getUserWatchLast();
  1043. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1044. } else if (res.data.total == 1) {
  1045. this.originOnShow();
  1046. this.originMounted();
  1047. }
  1048. }
  1049. });
  1050. },
  1051. /**
  1052. * 获取业务层次详情
  1053. */
  1054. courseBusiness(businessId) {
  1055. // '/app/common/course/business/'+data,
  1056. this.$api.courseBusiness(businessId).then((res) => {
  1057. this.businessData = res.data.data;
  1058. });
  1059. },
  1060. // 查询用户最后一次看的录播的信息
  1061. getUserWatchLast() {
  1062. this.$http({
  1063. url: "/study/record/getUserWatchLast",
  1064. method: "get",
  1065. data: {
  1066. orderGoodsId: this.orderGoodsId,
  1067. },
  1068. }).then((res) => {
  1069. if (res.data.code == 200) {
  1070. this.sectionItem = res.data.data || {};
  1071. if (res.data.data && Object.keys(res.data.data).length) {
  1072. //有最后一次看的录播的信息
  1073. this.courseId = res.data.data.courseId;
  1074. // console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
  1075. } else {
  1076. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1077. // this.toggleCourseShow = true
  1078. }
  1079. } else {
  1080. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1081. }
  1082. this.originOnShow();
  1083. this.originMounted();
  1084. //获取商品双师资模板
  1085. this.getCourseTeacher(this.courseList);
  1086. });
  1087. },
  1088. getCourseTeacher(rows) {
  1089. this.goodsTeacher = [];
  1090. //获取商品双师资模板
  1091. this.$api
  1092. .courseTeacherList({
  1093. goodsId: this.goodsId,
  1094. })
  1095. .then((res1) => {
  1096. if (res1.data.data && res1.data.data.length > 0) {
  1097. //课程老师模板
  1098. let teacherTel = res1.data.data;
  1099. //商品课程
  1100. let courses = rows;
  1101. teacherTel.forEach((tea) => {
  1102. let dataList = [];
  1103. let teacherList = [];
  1104. courses.forEach((item) => {
  1105. let data = tea.courseList.filter(
  1106. (x) => x.courseId == item.courseId
  1107. );
  1108. if (data && data.length > 0) {
  1109. dataList.push(item);
  1110. teacherList = tea.courseList;
  1111. }
  1112. });
  1113. let result = {
  1114. teaList: teacherList,
  1115. courseList: dataList,
  1116. };
  1117. this.goodsTeacher.push(result);
  1118. });
  1119. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  1120. let courseIds = [];
  1121. this.goodsTeacher.forEach((item) => {
  1122. item.courseList.forEach((course) => {
  1123. courseIds.push(course.courseId);
  1124. });
  1125. });
  1126. if (courseIds.length > 0) {
  1127. courses.forEach((item) => {
  1128. if (!courseIds.includes(item.courseId)) {
  1129. let data = {
  1130. teaList: [],
  1131. courseList: [],
  1132. };
  1133. data.courseList.push(item);
  1134. this.goodsTeacher.push(data);
  1135. }
  1136. });
  1137. }
  1138. this.goodsTeacher.forEach((item) => {
  1139. if (item.courseList && item.courseList.length > 0) {
  1140. item.courseList[0].show = 1;
  1141. }
  1142. });
  1143. }
  1144. } else {
  1145. //没有双师资模板
  1146. rows.forEach((item) => {
  1147. item.show = 1;
  1148. let data = {
  1149. teaList: [],
  1150. courseList: [],
  1151. };
  1152. data.courseList.push(item);
  1153. this.goodsTeacher.push(data);
  1154. });
  1155. }
  1156. // console.log(this.goodsTeacher,'this.goodsTeacher', this.courseId);
  1157. this.goodsTeacher.forEach((item) => {
  1158. if (item.courseList.some((x) => x.courseId == this.courseId)) {
  1159. this.teacherList = item.teaList;
  1160. }
  1161. });
  1162. });
  1163. },
  1164. // 原来onshow里面的内容
  1165. originOnShow() {
  1166. if (this.isOther) {
  1167. this.showMark = true;
  1168. return;
  1169. }
  1170. this.getbaseprofiletplists().then((res) => {
  1171. this.courseDetail();
  1172. this.getGoodsDetail();
  1173. this.getAnswerList();
  1174. this.studyRecordMenuAllList();
  1175. // this.answerTimer = setInterval(() => {
  1176. // this.getAnswerList();
  1177. // }, 5000);
  1178. let noteSecond = Number(this.option.noteSecond);
  1179. // console.log('noteSecondnoteSecond:', noteSecond, this.option)
  1180. if (noteSecond > 0) {
  1181. //我的消息跳过来,播放节
  1182. let item = {
  1183. sectionId: Number(this.option.sectionId),
  1184. recordingUrl: this.option.recordingUrl,
  1185. noteSecond: noteSecond,
  1186. studyDuration: noteSecond,
  1187. };
  1188. let playNextId = `moduleId${this.option.moduleId}chapterId${
  1189. this.option.chapterId
  1190. }sectionId${this.option.sectionId}${
  1191. this.option.isRebuild ? "isRebuild" : ""
  1192. }`;
  1193. this.$store.commit("setPlaySectionId", {
  1194. playSectionId: item.sectionId || item.menuId,
  1195. });
  1196. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1197. this.$store.commit("updatePlayNextId", playNextId);
  1198. this.playNoteVideo(item);
  1199. } else {
  1200. this.studyRecordQueryLiveLast();
  1201. }
  1202. });
  1203. this.current = uni.getStorageSync("current") || 0;
  1204. },
  1205. // 原来的mouted内容
  1206. originMounted() {
  1207. uni.$on("changeSection", (oldSectionId) => {
  1208. console.log(
  1209. "切换课程-originMounted->playVID:",
  1210. this.playVID,
  1211. oldSectionId
  1212. );
  1213. this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
  1214. this.hasStart = false;
  1215. this.photoConfig = false;
  1216. this.photoIndex = 0;
  1217. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1218. if (polyvPlayerContext) {
  1219. //解决同个节视频切换问题
  1220. // #ifdef MP-WEIXIN
  1221. polyvPlayerContext.seek(0);
  1222. polyvPlayerContext.pause();
  1223. // #endif
  1224. // #ifdef H5
  1225. polyvPlayerContext.j2s_seekVideo(0);
  1226. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  1227. // #endif
  1228. }
  1229. //清除直播
  1230. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1231. this.postStudyRecord(0, oldSectionId);
  1232. });
  1233. uni.$on("getSection", (item) => {
  1234. //清除直播
  1235. this.studyTimer && clearInterval(this.studyTimer);
  1236. this.hasStart = false;
  1237. this.isPlayRebuild = item.rebuild;
  1238. this.photoConfig = false;
  1239. this.photoIndex = 0;
  1240. this.sectionItem = item;
  1241. this.moduleId = item.moduleId || null;
  1242. this.chapterId = item.chapterId || null;
  1243. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1244. this.$store.commit("setPlaySectionId", {
  1245. playSectionId: item.sectionId || item.menuId,
  1246. });
  1247. console.log(
  1248. "清除直播节点胡:",
  1249. this.moduleId,
  1250. this.chapterId,
  1251. this.playSectionId,
  1252. this.hasStart
  1253. );
  1254. //获取拍照历史
  1255. this.getPhotoLastRecord();
  1256. this.playVideo(item);
  1257. });
  1258. uni.$on("levelId", (item) => {
  1259. console.log("点击节获取的各层级ID", item);
  1260. let arr = item.split("-");
  1261. //点击节获取的各层级ID
  1262. this.moduleId = arr[0];
  1263. this.chapterId = arr[1];
  1264. });
  1265. uni.$on("getChannel", (item) => {
  1266. //清除录播
  1267. this.studyTimer && clearInterval(this.studyTimer);
  1268. this.hasStart = false;
  1269. this.$store.commit("setPlayVID", { playVID: null });
  1270. this.moduleId = item.moduleId;
  1271. this.chapterId = item.chapterId;
  1272. this.$store.commit("setPlaySectionId", {
  1273. playSectionId: item.sectionId || item.menuId,
  1274. });
  1275. this.getPhotoLastRecord();
  1276. this.playChannel(item);
  1277. this.channelItem = item;
  1278. });
  1279. uni.$on("isRebuild", (item) => {
  1280. this.isRebuild = item;
  1281. });
  1282. this.updateChapterOpen(true);
  1283. },
  1284. // 原来onUnload里面的内容
  1285. originUnload() {
  1286. if (this.playSectionId > 0 && this.hasStart) {
  1287. //退出提交记录
  1288. this.postStudyRecord();
  1289. }
  1290. //清除正在播放的节ID
  1291. // this.$store.commit('setPlayObj',null)
  1292. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  1293. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1294. this.$store.commit("setPlayVID", { playVID: null });
  1295. this.closePlv();
  1296. //移除所有的事件监听器
  1297. uni.$off();
  1298. this.clearTimer && clearTimeout(this.clearTimer);
  1299. this.toastTimer && clearTimeout(this.toastTimer);
  1300. if (this.studyTimer) {
  1301. clearInterval(this.studyTimer);
  1302. this.hasStart = false;
  1303. }
  1304. this.timer && clearInterval(this.timer);
  1305. if (this.lockTimer) {
  1306. clearInterval(this.lockTimer);
  1307. this.$api
  1308. .lockDelLock({
  1309. action: "jxjy",
  1310. uuid: this.$method.getUuid(),
  1311. })
  1312. .then((res) => {
  1313. uni.hideLoading();
  1314. });
  1315. }
  1316. uni.removeStorageSync("current");
  1317. },
  1318. changeCourses() {
  1319. this.toggleCourseShow = true;
  1320. },
  1321. closePop() {
  1322. this.toggleCourseShow = false;
  1323. },
  1324. async activeFunc(item, index) {
  1325. this.teacherIndex = index;
  1326. let findResult = "";
  1327. this.goodsTeacher.forEach((citem, index) => {
  1328. citem.courseList.forEach((e, e_index) => {
  1329. if (e.courseId == item.courseId) {
  1330. findResult = e;
  1331. }
  1332. });
  1333. });
  1334. this.jump(findResult, 1);
  1335. },
  1336. // 进入学习
  1337. async jump(item, index, type) {
  1338. // console.log('item------>', index,item,this.goodsTeacher)
  1339. if (index == 0) {
  1340. await this.nextCourses(item, type);
  1341. if (item.rebuild === 0) {
  1342. //未重修
  1343. this.$navTo.togo("/pages2/learn/details", {
  1344. id: item.courseId,
  1345. gradeId: item.gradeId,
  1346. goodsId: this.goodsId,
  1347. orderGoodsId: this.orderGoodsId,
  1348. });
  1349. return;
  1350. }
  1351. this.$api.courseDetail(item.courseId).then((res) => {
  1352. if (res.data.code == 200) {
  1353. // if (res.data.data.educationName == "继续教育") {
  1354. this.$api
  1355. .lockLockStatus({
  1356. action: "jxjy",
  1357. uuid: this.$method.getUuid(),
  1358. })
  1359. .then((res) => {
  1360. if (res.data.code == 200) {
  1361. //有其他端在操作,不能学习
  1362. uni.showToast({
  1363. icon: "none",
  1364. title: res.data.msg,
  1365. mask: true,
  1366. duration: 3000,
  1367. });
  1368. } else if (res.data.code == 500) {
  1369. //可以学习
  1370. // this.$navTo.togo("/pages3/polyv/detail", {
  1371. // id: item.courseId,
  1372. // goodsId: this.goodsId,
  1373. // orderGoodsId: this.orderGoodsId,
  1374. // });
  1375. this.courseId = item.courseId;
  1376. this.originOnShow();
  1377. this.originMounted();
  1378. }
  1379. });
  1380. }
  1381. });
  1382. } else {
  1383. if (this.businessData.goodsLearningOrder == 2) {
  1384. //学习顺序是从头到尾学习,没学完上一课不能学习下一课
  1385. let prevItem = this.courseList[index - 1]; //上一课
  1386. if (prevItem.stuAllNum == prevItem.secAllNum) {
  1387. await this.nextCourses(item, type);
  1388. if (item.rebuild === 0) {
  1389. //未重修
  1390. this.$navTo.togo("/pages2/learn/details", {
  1391. id: item.courseId,
  1392. gradeId: item.gradeId,
  1393. goodsId: this.goodsId,
  1394. orderGoodsId: this.orderGoodsId,
  1395. });
  1396. return;
  1397. }
  1398. this.$api.courseDetail(item.courseId).then((res) => {
  1399. if (res.data.code == 200) {
  1400. // if (res.data.data.educationName == "继续教育") {
  1401. this.$api
  1402. .lockLockStatus({
  1403. action: "jxjy",
  1404. uuid: this.$method.getUuid(),
  1405. })
  1406. .then((res) => {
  1407. if (res.data.code == 200) {
  1408. //有其他端在操作,不能学习
  1409. uni.showToast({
  1410. icon: "none",
  1411. title: res.data.msg,
  1412. duration: 2000,
  1413. });
  1414. } else if (res.data.code == 500) {
  1415. //可以学习
  1416. // this.$navTo.togo("/pages3/polyv/detail", {
  1417. // id: item.courseId,
  1418. // goodsId: this.goodsId,
  1419. // orderGoodsId: this.orderGoodsId,
  1420. // });
  1421. this.courseId = item.courseId;
  1422. this.originOnShow();
  1423. this.originMounted();
  1424. }
  1425. });
  1426. }
  1427. });
  1428. } else {
  1429. uni.showToast({
  1430. icon: "none",
  1431. title: "请按顺序学完上一课再学习这一课",
  1432. });
  1433. }
  1434. } else {
  1435. await this.nextCourses(item, type);
  1436. if (item.rebuild === 0) {
  1437. //未重修
  1438. this.$navTo.togo("/pages2/learn/details", {
  1439. id: item.courseId,
  1440. gradeId: item.gradeId,
  1441. goodsId: this.goodsId,
  1442. orderGoodsId: this.orderGoodsId,
  1443. });
  1444. return;
  1445. }
  1446. this.$api.courseDetail(item.courseId).then((res) => {
  1447. if (res.data.code == 200) {
  1448. // if (res.data.data.educationName == "继续教育") {
  1449. this.$api
  1450. .lockLockStatus({
  1451. action: "jxjy",
  1452. uuid: this.$method.getUuid(),
  1453. })
  1454. .then((res) => {
  1455. if (res.data.code == 200) {
  1456. //有其他端在操作,不能学习
  1457. uni.showToast({
  1458. icon: "none",
  1459. title: res.data.msg,
  1460. duration: 2000,
  1461. });
  1462. } else if (res.data.code == 500) {
  1463. //可以学习
  1464. // this.$navTo.togo("/pages3/polyv/detail", {
  1465. // id: item.courseId,
  1466. // goodsId: this.goodsId,
  1467. // orderGoodsId: this.orderGoodsId,
  1468. // });
  1469. this.courseId = item.courseId;
  1470. this.originOnShow();
  1471. this.originMounted();
  1472. }
  1473. });
  1474. }
  1475. });
  1476. }
  1477. }
  1478. },
  1479. async nextCourses(item, type) {
  1480. this.vid = "";
  1481. this.hasStart = true;
  1482. await this.originUnload();
  1483. if (type) {
  1484. this.teacherIndex = 0;
  1485. this.goodsTeacher.forEach((citem) => {
  1486. if (citem.courseList.some((x) => x.courseId == item.courseId)) {
  1487. this.teacherList = citem.teaList;
  1488. }
  1489. });
  1490. }
  1491. this.reStart = false;
  1492. this.courseId = item.courseId;
  1493. this.gradeId = item.gradeId;
  1494. this.toggleCourseShow = false;
  1495. },
  1496. clickLeft() {
  1497. // uni.navigateBack()
  1498. uni.switchTab({
  1499. url: "/pages/learn/index",
  1500. });
  1501. },
  1502. markCancel() {
  1503. uni.navigateBack({
  1504. delta: 1,
  1505. });
  1506. },
  1507. markConfirm() {
  1508. uni.setClipboardData({
  1509. data: this.markContent,
  1510. success: function () {
  1511. setTimeout(() => {
  1512. uni.navigateBack({
  1513. delta: 1,
  1514. });
  1515. }, 1000);
  1516. },
  1517. });
  1518. },
  1519. closeNotice() {
  1520. this.$api
  1521. .baseHandoutTip({
  1522. orderGoodsId: this.orderGoodsId,
  1523. })
  1524. .then((res) => {});
  1525. },
  1526. noticeConfirm() {
  1527. if (this.CountTo < 0) {
  1528. this.noticeShow = false;
  1529. if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
  1530. this.autoplay = true;
  1531. // var polyvPlayerContext = this.selectComponent("#playerVideo")
  1532. // #ifdef MP-WEIXIN
  1533. polyvPlayerContext.play();
  1534. // #endif
  1535. // #ifdef H5
  1536. polyvPlayerContext.j2s_resumeVideo();
  1537. // #endif
  1538. }
  1539. }
  1540. },
  1541. baseHandoutTipList() {
  1542. this.$api
  1543. .baseHandoutTipList({
  1544. orderGoodsId: this.orderGoodsId,
  1545. })
  1546. .then((res) => {
  1547. this.handoutTipLength = res.data.rows.length;
  1548. if (res.data.rows.length == 0) {
  1549. this.noticeShow = true;
  1550. if (this.CountTo == 30) {
  1551. var timer = setInterval(() => {
  1552. this.CountTo--;
  1553. if (this.CountTo < 0) {
  1554. clearInterval(timer);
  1555. }
  1556. }, 1000);
  1557. }
  1558. } else {
  1559. this.CountTo = -1;
  1560. if (this.goodsPlayConfig && this.goodsPlayConfig.autoPlay > 0) {
  1561. // #ifdef MP-WEIXIN
  1562. this.autoplay = true;
  1563. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1564. polyvPlayerContext.play();
  1565. // #endif
  1566. // #ifdef H5
  1567. // polyvPlayerContext.j2s_resumeVideo()
  1568. // #endif
  1569. }
  1570. }
  1571. });
  1572. },
  1573. /**
  1574. * 获取上次观看的直播
  1575. */
  1576. studyRecordGetLastLive() {
  1577. this.$api
  1578. .studyRecordGetLastLive({
  1579. orderGoodsId: this.orderGoodsId,
  1580. courseId: this.courseId,
  1581. })
  1582. .then((res) => {
  1583. this.updateLiveLast(res.data.data);
  1584. });
  1585. },
  1586. studyRecordQueryLiveLast() {
  1587. // /study/record/queryLiveLast
  1588. this.$api
  1589. .studyRecordQueryLiveLast({
  1590. gradeId: this.gradeId,
  1591. orderGoodsId: this.orderGoodsId,
  1592. courseId: this.courseId,
  1593. })
  1594. .then(async (res) => {
  1595. if (res.data.data) {
  1596. this.moduleId = res.data.data.moduleId;
  1597. this.chapterId = res.data.data.chapterId;
  1598. if (res.data.data.sectionType == 1) {
  1599. //录播
  1600. this.$store.commit("setPlaySectionId", {
  1601. playSectionId: res.data.data.sectionId,
  1602. });
  1603. this.$store.commit("setPlayVID", {
  1604. playVID: res.data.data.recordingUrl,
  1605. });
  1606. this.sectionItem = res.data.data;
  1607. await this.getPhotoLastRecord(); // 获取拍照历史
  1608. this.playVideo(res.data.data);
  1609. } else if (res.data.data.sectionType == 2) {
  1610. //直播
  1611. this.studyRecordGetLastLive();
  1612. } else if (res.data.data.sectionType == 3) {
  1613. //回放
  1614. this.$store.commit("setPlaySectionId", {
  1615. playSectionId: res.data.data.sectionId,
  1616. });
  1617. this.$store.commit("setPlayVID", {
  1618. playVID: res.data.data.recordingUrl,
  1619. });
  1620. this.sectionItem = res.data.data;
  1621. this.playVideo(res.data.data);
  1622. }
  1623. // 查询用户最后一次看的录播的信息
  1624. this.$http({
  1625. url: "/study/record/getUserWatchLast",
  1626. method: "get",
  1627. data: {
  1628. orderGoodsId: this.orderGoodsId,
  1629. },
  1630. }).then((res) => {
  1631. if (res.data.code == 200) {
  1632. this.sectionItem = res.data.data || {};
  1633. }
  1634. });
  1635. }
  1636. });
  1637. },
  1638. /**
  1639. * 模块大节播放完毕,刷新列表
  1640. */
  1641. sectionPlayEnd(isRebuild, index) {
  1642. if (this.reMenuList.length > 0) {
  1643. //有重修目录
  1644. if (isRebuild.isRebuild) {
  1645. //从重修点击
  1646. this.$api
  1647. .reMenuList({
  1648. orderGoodsId: this.orderGoodsId,
  1649. courseId: this.courseId,
  1650. rebuild: 1,
  1651. gradeId: this.gradeId,
  1652. })
  1653. .then((res) => {
  1654. if (res.data.code == 200) {
  1655. if (res.data.rows.length) {
  1656. res.data.rows[index].name = res.data.rows[index].menuName;
  1657. this.$set(this.reMenuList, index, res.data.rows[index]);
  1658. for (let i = 0; i < res.data.rows.length; i++) {
  1659. let item = res.data.rows[i];
  1660. item.down = true;
  1661. item.id = item.menuId;
  1662. item.name = item.menuName;
  1663. }
  1664. this.reMenuList = [];
  1665. this.$nextTick(() => {
  1666. this.reMenuList = res.data.rows;
  1667. // console.log(this.reMenuList,'this.reMenuList1')
  1668. });
  1669. } else {
  1670. this.reMenuList = [];
  1671. }
  1672. this.$nextTick(() => {
  1673. if (this.reMenuList.length > 0) {
  1674. this.list = [
  1675. {
  1676. name: "目录",
  1677. },
  1678. {
  1679. name: "讲义",
  1680. },
  1681. {
  1682. name: "笔记",
  1683. },
  1684. {
  1685. name: "答疑",
  1686. },
  1687. { name: "重修目录" },
  1688. ];
  1689. } else {
  1690. this.list = [
  1691. {
  1692. name: "目录",
  1693. },
  1694. {
  1695. name: "讲义",
  1696. },
  1697. {
  1698. name: "笔记",
  1699. },
  1700. {
  1701. name: "答疑",
  1702. },
  1703. ];
  1704. if (this.current == 4) {
  1705. this.current = 0;
  1706. }
  1707. }
  1708. });
  1709. }
  1710. });
  1711. this.$api
  1712. .reMenuList({
  1713. courseId: this.courseId,
  1714. gradeId: this.gradeId,
  1715. orderGoodsId: this.orderGoodsId,
  1716. })
  1717. .then((res) => {
  1718. if (res.data.code == 200) {
  1719. for (let i = 0; i < res.data.rows.length; i++) {
  1720. let item = res.data.rows[i];
  1721. item.down = true;
  1722. item.id = item.menuId;
  1723. item.name = item.menuName;
  1724. item.menuType = item.type;
  1725. }
  1726. this.menuList = [];
  1727. this.$nextTick(() => {
  1728. this.menuList = res.data.rows;
  1729. });
  1730. }
  1731. });
  1732. } else {
  1733. //从普通目录点击
  1734. this.$api
  1735. .reMenuList({
  1736. courseId: this.courseId,
  1737. gradeId: this.gradeId,
  1738. orderGoodsId: this.orderGoodsId,
  1739. })
  1740. .then((res) => {
  1741. if (res.data.code == 200) {
  1742. res.data.rows[index].name = res.data.rows[index].menuName;
  1743. res.data.rows[index].id = res.data.rows[index].menuId;
  1744. this.$set(this.menuList, index, res.data.rows[index]);
  1745. }
  1746. });
  1747. this.$api
  1748. .reMenuList({
  1749. orderGoodsId: this.orderGoodsId,
  1750. courseId: this.courseId,
  1751. rebuild: 1,
  1752. gradeId: this.gradeId,
  1753. })
  1754. .then((res) => {
  1755. if (res.data.code == 200) {
  1756. if (res.data.rows.length) {
  1757. // for (let i = 0; i < res.data.rows.length; i++) {
  1758. // let item = res.data.rows[i];
  1759. // item.down = true;
  1760. // item.id = item.menuId;
  1761. // item.name = item.menuName;
  1762. // }
  1763. // this.reMenuList = res.data.rows;
  1764. } else {
  1765. this.reMenuList = [];
  1766. }
  1767. this.$nextTick(() => {
  1768. if (this.reMenuList.length > 0) {
  1769. this.list = [
  1770. {
  1771. name: "目录",
  1772. },
  1773. {
  1774. name: "讲义",
  1775. },
  1776. {
  1777. name: "笔记",
  1778. },
  1779. {
  1780. name: "答疑",
  1781. },
  1782. { name: "重修目录" },
  1783. ];
  1784. } else {
  1785. this.list = [
  1786. {
  1787. name: "目录",
  1788. },
  1789. {
  1790. name: "讲义",
  1791. },
  1792. {
  1793. name: "笔记",
  1794. },
  1795. {
  1796. name: "答疑",
  1797. },
  1798. ];
  1799. if (this.current == 4) {
  1800. this.current = 0;
  1801. }
  1802. }
  1803. });
  1804. }
  1805. });
  1806. }
  1807. } else {
  1808. console.log("--模块大节播放完毕,刷新列表-");
  1809. //没有重修目录
  1810. this.$api
  1811. .reMenuList({
  1812. courseId: this.courseId,
  1813. gradeId: this.gradeId,
  1814. orderGoodsId: this.orderGoodsId,
  1815. })
  1816. .then((res) => {
  1817. if (res.data.code == 200) {
  1818. res.data.rows[index].name = res.data.rows[index].menuName;
  1819. res.data.rows[index].id = res.data.rows[index].menuId;
  1820. this.$set(this.menuList, index, res.data.rows[index]);
  1821. }
  1822. });
  1823. }
  1824. },
  1825. goLive(item) {
  1826. let moduleId = item.moduleId || 0;
  1827. let chapterId = item.chapterId || 0;
  1828. let sectionId = item.sectionId || item.menuId;
  1829. let uuid = new Date().valueOf() + "";
  1830. // buyCourse 是否购买课程:1是 0否
  1831. let encode = encodeURIComponent(
  1832. config.WEBVIEW_URL +
  1833. "pages/live/index?token=" +
  1834. uni.getStorageSync("token") +
  1835. "&userInfo=" +
  1836. JSON.stringify(this.userInfo) +
  1837. "&channelId=" +
  1838. item.liveUrl +
  1839. "&gradeId=" +
  1840. this.gradeId +
  1841. "&courseId=" +
  1842. this.courseId +
  1843. "&goodsId=" +
  1844. this.goodsId +
  1845. "&orderGoodsId=" +
  1846. this.orderGoodsId +
  1847. "&sectionId=" +
  1848. sectionId +
  1849. "&chapterId=" +
  1850. chapterId +
  1851. "&moduleId=" +
  1852. moduleId +
  1853. "&buyCourse=1" +
  1854. "&ident=" +
  1855. uuid
  1856. );
  1857. uni.navigateTo({
  1858. url: `../../pages/webview/index?url=` + encode,
  1859. });
  1860. },
  1861. studyRecordMenuAllList() {
  1862. // study/record/menuAllList
  1863. this.$api
  1864. .studyRecordMenuAllList({
  1865. courseId: this.courseId,
  1866. gradeId: this.gradeId,
  1867. goodsId: this.goodsId,
  1868. })
  1869. .then((res) => {
  1870. let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1871. if (res.data.data) {
  1872. this.menuAllList = res.data.data;
  1873. // console.log('======0', this.sectionItem);
  1874. this.livingItem = res.data.data.find(
  1875. (item) =>
  1876. item.liveStartTime <= nowTime && item.liveEndTime > nowTime
  1877. );
  1878. }
  1879. });
  1880. },
  1881. getbaseprofiletplists() {
  1882. return new Promise((resolve) => {
  1883. let self = this;
  1884. // #ifdef MP-WEIXIN
  1885. this.getCameraSetting();
  1886. // #endif
  1887. this.$api
  1888. .getbaseprofiletplists({
  1889. goodsId: self.goodsId,
  1890. orderGoodsId: this.orderGoodsId,
  1891. })
  1892. .then((res) => {
  1893. if (res.data.code === 200 && res.data.rows.length) {
  1894. if (res.data.rows[0].keyValue) {
  1895. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  1896. if (baseRes.data.code === 200) {
  1897. if (baseRes.data.data) {
  1898. // base/profile/tp/getInfo
  1899. self.$api
  1900. .getbaseprofiletpgetInfo({
  1901. goodsId: self.goodsId,
  1902. orderGoodsId: self.orderGoodsId,
  1903. })
  1904. .then((result) => {
  1905. if (result.data.code === 200) {
  1906. if (
  1907. !result.data.data ||
  1908. (result.data.data.status === 3 &&
  1909. result.data.data.changeStatus === 1)
  1910. ) {
  1911. if (!result.data.data) {
  1912. self.needProfileModal = true;
  1913. uni.showModal({
  1914. content: "请前往填写资料",
  1915. cancelText: "返回",
  1916. success: function (resultst) {
  1917. if (resultst.confirm) {
  1918. self.$navTo.togo("/pages2/verify/input", {
  1919. id: self.goodsId,
  1920. orderGoodsId: self.orderGoodsId,
  1921. });
  1922. }
  1923. if (resultst.cancel) {
  1924. uni.navigateBack();
  1925. }
  1926. },
  1927. });
  1928. } else {
  1929. self.needProfileModal = true;
  1930. uni.showModal({
  1931. content: "资料审核不通过,请前往重新填写",
  1932. cancelText: "返回",
  1933. success: function (resultst) {
  1934. if (resultst.confirm) {
  1935. self.$navTo.togo("/pages2/verify/input", {
  1936. id: self.goodsId,
  1937. orderGoodsId: self.orderGoodsId,
  1938. });
  1939. }
  1940. if (resultst.cancel) {
  1941. uni.navigateBack();
  1942. }
  1943. },
  1944. });
  1945. }
  1946. } else if (
  1947. result.data.data.status === 1 &&
  1948. JSON.parse(res.data.rows[0].keyValue2)[0]
  1949. ) {
  1950. self.$api
  1951. .getbaseprofileStampgetInfo({
  1952. goodsId: self.goodsId,
  1953. orderGoodsId: self.orderGoodsId,
  1954. })
  1955. .then((k) => {
  1956. if (k.data.code === 200) {
  1957. if (
  1958. !k.data.data ||
  1959. (k.data.data.status === 3 &&
  1960. k.data.data.changeStatus === 1)
  1961. ) {
  1962. if (!k.data.data) {
  1963. self.needProfileModal = true;
  1964. uni.showModal({
  1965. cancelText: "返回",
  1966. content: "请前往填写盖章资料",
  1967. success: function (resultst) {
  1968. if (resultst.confirm) {
  1969. self.$navTo.togo(
  1970. "/pages2/verify/input2",
  1971. {
  1972. id: self.goodsId,
  1973. orderGoodsId:
  1974. self.orderGoodsId,
  1975. }
  1976. );
  1977. }
  1978. if (resultst.cancel) {
  1979. uni.navigateBack();
  1980. }
  1981. },
  1982. });
  1983. } else {
  1984. self.needProfileModal = true;
  1985. uni.showModal({
  1986. cancelText: "返回",
  1987. content:
  1988. "资料盖章审核不通过,请前往重新填写",
  1989. success: function (resultst) {
  1990. if (resultst.confirm) {
  1991. self.$navTo.togo(
  1992. "/pages2/verify/input2",
  1993. {
  1994. id: self.goodsId,
  1995. orderGoodsId:
  1996. self.orderGoodsId,
  1997. }
  1998. );
  1999. }
  2000. if (resultst.cancel) {
  2001. uni.navigateBack();
  2002. }
  2003. },
  2004. });
  2005. }
  2006. } else {
  2007. resolve();
  2008. }
  2009. }
  2010. });
  2011. } else {
  2012. resolve();
  2013. }
  2014. }
  2015. });
  2016. } else {
  2017. resolve();
  2018. }
  2019. }
  2020. });
  2021. } else {
  2022. resolve();
  2023. }
  2024. } else {
  2025. resolve();
  2026. }
  2027. });
  2028. if (this.gradeId > 0) {
  2029. //提交完资料返回判断是否已开班
  2030. this.getGradeInfo();
  2031. }
  2032. });
  2033. },
  2034. // /**
  2035. // * 获取业务层次详情
  2036. // */
  2037. // courseBusiness() {
  2038. // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  2039. // this.businessData = res.data.data;
  2040. // });
  2041. // },
  2042. /**
  2043. * 计算tabs宽度
  2044. */
  2045. itemWidth() {
  2046. return 100 / this.list.length + "%";
  2047. },
  2048. /**
  2049. * 获取讲义权限
  2050. */
  2051. courseHandouts() {
  2052. this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  2053. this.courseHandoutsData = [res.data.data];
  2054. });
  2055. // this.$api
  2056. // .getHandoutList({ handoutsId: this.goodsData.handoutsId })
  2057. // .then((res) => {
  2058. // this.courseHandoutsData = res.data.rows;
  2059. // });
  2060. },
  2061. findMenuNextSection(index) {
  2062. for (let i = index + 1; i < this.reMenuList.length; i++) {
  2063. let item = this.reMenuList[i];
  2064. if (item.type == 3) {
  2065. return item;
  2066. }
  2067. }
  2068. return {};
  2069. },
  2070. loadedmetadata(event) {
  2071. console.log("------: loadedmetadata", this.hasStart, polyvPlayerContext);
  2072. if (this.hasStart) {
  2073. // 防止loadedmetadata事件第二次触发
  2074. return;
  2075. }
  2076. // #ifdef MP-WEIXIN
  2077. polyvPlayerContext = this.selectComponent("#playerVideo");
  2078. // #endif
  2079. this.hasStart = true;
  2080. uni.$off("playPause");
  2081. uni.$on("playPause", () => {
  2082. // #ifdef MP-WEIXIN
  2083. polyvPlayerContext.pause();
  2084. // #endif
  2085. // #ifdef H5
  2086. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  2087. // #endif
  2088. });
  2089. if (!this.recordObj.videoCurrentTime) {
  2090. //新视频直接提交一条观看记录
  2091. this.postStudyRecord(0);
  2092. }
  2093. this.studyTimer && clearInterval(this.studyTimer);
  2094. this.studyTimer = setInterval(() => {
  2095. this.postStudyRecord(0);
  2096. }, 15000);
  2097. },
  2098. getPhotoLastRecord() {
  2099. let self = this;
  2100. let data = {
  2101. sectionId: parseInt(self.playSectionId),
  2102. goodsId: parseInt(self.goodsId),
  2103. courseId: parseInt(self.courseId),
  2104. gradeId: parseInt(self.gradeId),
  2105. chapterId: parseInt(self.chapterId),
  2106. moduleId: parseInt(self.moduleId),
  2107. orderGoodsId: this.orderGoodsId,
  2108. };
  2109. // /course/photo/log/getLastInfo'
  2110. this.$api.getPhotoLastRecord(data).then((res) => {
  2111. if (res.data.code == 200) {
  2112. //清空历史数据
  2113. self.photoHistoryList = [];
  2114. this.photoIndex = 0;
  2115. self.photoList = [];
  2116. for (let i = 0; i < res.data.data.length; i++) {
  2117. //-2存储随机拍照数组
  2118. if (res.data.data[i].photoIndex == -2) {
  2119. self.photoList = res.data.data[i].timeInterval.split(",");
  2120. } else {
  2121. self.photoHistoryList.push(res.data.data[i].photoIndex);
  2122. }
  2123. }
  2124. // console.log('7777', this.photoHistoryList, this.photoList);
  2125. }
  2126. });
  2127. },
  2128. //postTime 只提交随机时间
  2129. postCoursePhotoRecord(postTime = false) {
  2130. return new Promise((resolve, reject) => {
  2131. let currentTime = 0;
  2132. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2133. if (polyvPlayerContext) {
  2134. // #ifdef MP-WEIXIN
  2135. currentTime = polyvPlayerContext.getCurrentTime();
  2136. // #endif
  2137. // #ifdef H5
  2138. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  2139. // #endif
  2140. }
  2141. let self = this;
  2142. let photoIndex = self.photoIndex;
  2143. let data = {
  2144. photo: self.ossAvatarUrl,
  2145. sectionId: parseInt(self.playSectionId),
  2146. goodsId: parseInt(self.goodsId),
  2147. courseId: parseInt(self.courseId),
  2148. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  2149. gradeId: parseInt(self.gradeId),
  2150. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  2151. photoNum: parseInt(self.photoNum),
  2152. chapterId: parseInt(self.chapterId),
  2153. moduleId: parseInt(self.moduleId),
  2154. timeInterval: postTime ? self.photoList.join(",") : "",
  2155. orderGoodsId: this.orderGoodsId,
  2156. };
  2157. // console.log("提交接口", data);
  2158. this.$api
  2159. .coursePhotoRecord(data)
  2160. .then((res) => {
  2161. if (res.data.code == 200) {
  2162. resolve();
  2163. } else {
  2164. reject();
  2165. }
  2166. })
  2167. .catch((err) => {
  2168. reject();
  2169. });
  2170. });
  2171. },
  2172. randomNum(minNum, maxNum) {
  2173. switch (arguments.length) {
  2174. case 1:
  2175. return parseInt(Math.random() * minNum + 1, 10);
  2176. break;
  2177. case 2:
  2178. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  2179. break;
  2180. default:
  2181. return 0;
  2182. break;
  2183. }
  2184. },
  2185. //配置随机拍照时间
  2186. configPhoto() {
  2187. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2188. let totalVideoTime = 0;
  2189. let duration = 0;
  2190. // #ifdef MP-WEIXIN
  2191. totalVideoTime = polyvPlayerContext.getDuration();
  2192. duration = polyvPlayerContext.getCurrentTime();
  2193. // #endif
  2194. // #ifdef H5
  2195. totalVideoTime = polyvPlayerContext.j2s_getDuration();
  2196. duration = polyvPlayerContext.j2s_getCurrentTime();
  2197. // #endif
  2198. let photoNum = this.photoNum;
  2199. if (!this.photoConfig) {
  2200. this.photoConfig = true;
  2201. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  2202. // if(spaceTime<5){//区间小于5秒
  2203. // photoNum = Math.floor(totalVideoTime/5)
  2204. // spaceTime = 5
  2205. // }
  2206. // if(photoNum<1){
  2207. // photoNum = 1 //只要设置,至少拍一次
  2208. // spaceTime = totalVideoTime
  2209. // }
  2210. // let initSpace = 0
  2211. //没有历史拍照间隔数据
  2212. if (this.photoList.length == 0) {
  2213. if (totalVideoTime >= 900) {
  2214. //大于15分钟
  2215. if (photoNum == 1) {
  2216. //开头拍1张
  2217. this.photoList.push(0);
  2218. } else if (photoNum == 3) {
  2219. //拍3张
  2220. this.photoList.push(0); //开头拍一张
  2221. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  2222. let centerMinTime = centerTime - 300; //前后5分钟
  2223. let centerMaxTime = centerTime + 300;
  2224. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  2225. this.photoList.push(centerTakeTime); //中间拍一张
  2226. let endMaxTime = totalVideoTime - 60;
  2227. let endMinTime = totalVideoTime - 300;
  2228. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  2229. this.photoList.push(endTakeTime); //最后拍一张
  2230. }
  2231. } else {
  2232. //小于15分钟,只拍前后各一张
  2233. if (photoNum == 1) {
  2234. //开头拍1张
  2235. this.photoList.push(0);
  2236. } else if (photoNum == 3) {
  2237. this.photoList.push(1);
  2238. let centerTime = this.randomNum(
  2239. (1 / 3) * totalVideoTime,
  2240. (2 / 3) * totalVideoTime
  2241. );
  2242. this.photoList.push(centerTime);
  2243. let endTakeTime = this.randomNum(
  2244. (2 / 3) * totalVideoTime,
  2245. totalVideoTime
  2246. );
  2247. this.photoList.push(endTakeTime);
  2248. }
  2249. }
  2250. // for(let i=0;i<photoNum;i++){
  2251. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  2252. // if(s>totalVideoTime){
  2253. // s = totalVideoTime-1
  2254. // }
  2255. // if(s<=5){
  2256. // s =5 //避免出现5秒内拍照时间
  2257. // }
  2258. // this.photoList.push(s)
  2259. // initSpace+=spaceTime
  2260. // }
  2261. // console.log(this.photoList, "随机拍照时间数组11", photoNum);
  2262. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  2263. }
  2264. //兼容已有观看历史
  2265. for (let i = 0; i < this.photoList.length - 1; i++) {
  2266. if (
  2267. this.photoList[i] < duration &&
  2268. this.photoList[i + 1] > duration
  2269. ) {
  2270. this.photoIndex = i + 1;
  2271. break;
  2272. }
  2273. if (duration > this.photoList[this.photoList.length - 1]) {
  2274. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  2275. break;
  2276. }
  2277. }
  2278. // console.log(this.photoList, "随机拍照时间数组11", photoNum);
  2279. }
  2280. },
  2281. getLiveUid(channelId) {
  2282. let self = this;
  2283. return new Promise((resolve) => {
  2284. let data = {
  2285. channelId: channelId,
  2286. orderGoodsId: this.orderGoodsId,
  2287. };
  2288. self.$api.polyvSign(data).then((res) => {
  2289. resolve(res.data.data);
  2290. });
  2291. });
  2292. },
  2293. timeEventLiving() {
  2294. if (plv != null) {
  2295. if (this.livePlay) {
  2296. this.liveDuration = this.liveDuration + 1; //每隔1秒
  2297. if (this.liveDuration == 2) {
  2298. //直播第2秒拍照
  2299. if (
  2300. this.goodsPhotographConfig &&
  2301. this.goodsPhotographConfig.livephotograph == 1 &&
  2302. this.channelItem.learning != 1 &&
  2303. this.photoHistoryList.length == 0
  2304. ) {
  2305. //开启直播拍照
  2306. this.openPhoto();
  2307. } else {
  2308. this.postStudyRecord(0);
  2309. }
  2310. }
  2311. }
  2312. }
  2313. },
  2314. playerLiveStatusChange(e) {
  2315. const status = e.detail.status;
  2316. if (status === "live") {
  2317. //开始播放
  2318. if (this.timer) {
  2319. clearInterval(this.timer);
  2320. }
  2321. this.livePlay = true;
  2322. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  2323. }
  2324. if (status === "end") {
  2325. this.hasStart = false;
  2326. if (this.livePlay) {
  2327. //只有播放过的结束才提交,避免未开播触发结束
  2328. this.postStudyRecord(1);
  2329. }
  2330. this.livePlay = false;
  2331. // 未开始
  2332. }
  2333. },
  2334. closePlv() {
  2335. if (plv) {
  2336. plv.destroy();
  2337. }
  2338. },
  2339. playChannel(item) {
  2340. if (this.timer) {
  2341. clearInterval(this.timer);
  2342. }
  2343. this.startStatus = true;
  2344. this.initLive();
  2345. },
  2346. setLiveOption(status) {
  2347. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  2348. this.detail;
  2349. const playRecordFile =
  2350. playbackEnabled && recordFileSimpleModel && status === "end";
  2351. this.videoOption = {
  2352. mode: "live",
  2353. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  2354. cid: this.playChannelId,
  2355. openId: this.userInfo.userAccount,
  2356. isAutoChange: false,
  2357. forceVideo: false,
  2358. };
  2359. },
  2360. async initLive() {
  2361. this.liveObj = await this.getLiveUid(this.playChannelId);
  2362. this.initLiveOk = true;
  2363. let optionsData = {};
  2364. optionsData.mode = "live";
  2365. optionsData.forceVideo = false;
  2366. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  2367. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  2368. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  2369. let self = this;
  2370. this.closePlv();
  2371. plv.init(optionsData).then(({ detail, chat }) => {
  2372. self.liveDetail = detail;
  2373. // 设置mode为live的videoOption
  2374. this.setLiveOption();
  2375. if (detail.isPPT) {
  2376. chat.on(chat.events.SLICESTART, () => {
  2377. // 开始直播
  2378. });
  2379. } else {
  2380. plv.api.getOrdinaryLiveStatus(detail.stream);
  2381. }
  2382. });
  2383. },
  2384. openSetting(res) {
  2385. console.log(res, 98);
  2386. },
  2387. getCameraSetting() {
  2388. const self = this;
  2389. // 不支持h5
  2390. wx.getSetting({
  2391. success: (res) => {
  2392. if (res.authSetting["scope.camera"]) {
  2393. // 用户已经授权
  2394. self.showSet = false;
  2395. this.prendreAutoCarme = false;
  2396. } else {
  2397. this.prendreAutoCarme = true;
  2398. // 用户还没有授权,向用户发起授权请求
  2399. wx.authorize({
  2400. scope: "scope.camera",
  2401. success: () => {
  2402. // 用户同意授权
  2403. self.showSet = false;
  2404. this.prendreAutoCarme = false;
  2405. },
  2406. fail: () => {
  2407. // 用户不同意授权
  2408. self.showSet = true;
  2409. },
  2410. });
  2411. }
  2412. },
  2413. fail: (res) => {},
  2414. });
  2415. },
  2416. studyNotice() {
  2417. this.noticeShow = true;
  2418. },
  2419. //播放笔记视频
  2420. async playNoteVideo(item) {
  2421. if (this.timer) {
  2422. clearInterval(this.timer);
  2423. }
  2424. if (this.vid) {
  2425. //切换视频
  2426. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2427. polyvPlayerContext.changeVid(item.recordingUrl);
  2428. } else {
  2429. this.vid = item.recordingUrl;
  2430. }
  2431. this.recordObj = { videoCurrentTime: item.noteSecond };
  2432. if (this.recordObj.videoCurrentTime) {
  2433. this.needSeek = true; //需要跳转到播放记录
  2434. }
  2435. this.startStatus = true;
  2436. //获取节笔记
  2437. this.getNoteList();
  2438. },
  2439. //正常播放视频
  2440. async playVideo(item) {
  2441. console.log(item.recordingUrl, "22222222", this.vid);
  2442. if (this.timer) {
  2443. clearInterval(this.timer);
  2444. }
  2445. // #ifdef H5
  2446. await this.clears();
  2447. // #endif
  2448. if (this.vid) {
  2449. //切换视频
  2450. polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
  2451. } else {
  2452. this.vid = item.recordingUrl;
  2453. }
  2454. this.recordObj = null;
  2455. this.recordObj = await this.getRecordLast();
  2456. this.needSeek = true; //跳转到播放记录
  2457. this.startStatus = true;
  2458. // #ifdef H5
  2459. await this.loadPlayerScript(this.loadPlayer);
  2460. // #endif
  2461. // 提交学习记录
  2462. // #ifdef MP-WEIXIN
  2463. this.postStudyRecord(0);
  2464. // #endif
  2465. //获取节笔记
  2466. this.getNoteList();
  2467. },
  2468. getRecordLast() {
  2469. return new Promise((resolve) => {
  2470. let data = {
  2471. gradeId:
  2472. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2473. goodsId:
  2474. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2475. sectionId: this.playSectionId || 0,
  2476. courseId:
  2477. this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  2478. chapterId: this.chapterId || 0,
  2479. moduleId: this.moduleId || 0,
  2480. orderGoodsId: this.orderGoodsId,
  2481. };
  2482. this.$api.recordLast(data).then((res) => {
  2483. resolve(res.data.data);
  2484. });
  2485. });
  2486. },
  2487. jumpNote(item) {
  2488. this.noteId = item.noteId;
  2489. //没视频播放
  2490. if (this.playSectionId == 0) {
  2491. this.$u.toast("即将跳到笔记位置");
  2492. this.$store.commit("setPlaySectionId", {
  2493. playSectionId: item.sectionId || item.menuId,
  2494. });
  2495. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  2496. this.playNoteVideo(item);
  2497. } else {
  2498. //正在看当前笔记视频
  2499. this.$u.toast("即将跳到笔记位置");
  2500. //跳到笔记时刻
  2501. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2502. // #ifdef MP-WEIXIN
  2503. polyvPlayerContext.seek(item.noteSecond);
  2504. polyvPlayerContext.play();
  2505. // #endif
  2506. // #ifdef H5
  2507. polyvPlayerContext.j2s_seekVideo(0);
  2508. polyvPlayerContext.j2s_resumeVideo();
  2509. // #endif
  2510. }
  2511. },
  2512. postNote() {
  2513. let self = this;
  2514. if (!(this.playSectionId > 0)) {
  2515. this.$u.toast("目前无播放视频");
  2516. return;
  2517. }
  2518. if (!this.noteValue) {
  2519. this.$u.toast("请输入内容");
  2520. return;
  2521. }
  2522. if (!this.gradeId) {
  2523. this.$u.toast("暂无班级数据");
  2524. return;
  2525. }
  2526. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2527. let noteDate = this.$method.getZeroTime();
  2528. let noteSecond = 0;
  2529. // #ifdef MP-WEIXIN
  2530. noteSecond = polyvPlayerContext.getCurrentTime();
  2531. // #endif
  2532. // #ifdef H5
  2533. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2534. // #endif
  2535. if (!noteSecond) {
  2536. if (noteSecond == 0) {
  2537. //播放结束
  2538. // #ifdef MP-WEIXIN
  2539. noteSecond = polyvPlayerContext.getDuration();
  2540. // #endif
  2541. // #ifdef H5
  2542. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2543. // #endif
  2544. }
  2545. if (!noteSecond) {
  2546. this.$u.toast("视频暂未开始");
  2547. return;
  2548. }
  2549. }
  2550. let data = {
  2551. gradeId: this.gradeId,
  2552. goodsId: this.goodsId,
  2553. sectionId: this.playSectionId,
  2554. courseId: this.courseId,
  2555. noteText: this.noteValue,
  2556. noteDate: noteDate,
  2557. noteSecond: noteSecond,
  2558. orderGoodsId: this.orderGoodsId,
  2559. };
  2560. this.$api.postNote(data).then((res) => {
  2561. if (res.data.code == 200) {
  2562. this.$u.toast("发布成功");
  2563. self.getNoteList();
  2564. this.noteValue = "";
  2565. }
  2566. });
  2567. },
  2568. getGradeInfo() {
  2569. let self = this;
  2570. this.$store.state.allowLoading = false;
  2571. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2572. if (res.data.code == 200) {
  2573. self.gradeDetail = res.data.data;
  2574. if (self.needProfileModal) {
  2575. return;
  2576. }
  2577. if (self.gradeDetail.learningStatus == 2) {
  2578. uni.showModal({
  2579. showCancel: false,
  2580. confirmText: "确定",
  2581. content:
  2582. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2583. success: function (resultst) {
  2584. uni.navigateBack();
  2585. },
  2586. });
  2587. }
  2588. if (
  2589. self.gradeDetail.learningStatus == 3 &&
  2590. Number(self.gradeDetail.learningTimeStart) >
  2591. Number(new Date() / 1000)
  2592. ) {
  2593. uni.showModal({
  2594. showCancel: false,
  2595. cancelText: "返回",
  2596. content:
  2597. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2598. success: function (resultst) {
  2599. uni.navigateBack();
  2600. },
  2601. });
  2602. }
  2603. }
  2604. });
  2605. this.$store.state.allowLoading = true;
  2606. },
  2607. getNoteList() {
  2608. let self = this;
  2609. self.noteList = [];
  2610. let data = {
  2611. courseId: this.courseId,
  2612. gradeId: this.gradeId,
  2613. goodsId: this.goodsId,
  2614. orderGoodsId: this.orderGoodsId,
  2615. };
  2616. if (this.playSectionId > 0) {
  2617. data.sectionId = this.playSectionId;
  2618. }
  2619. this.$api.noteList(data).then((res) => {
  2620. if (res.data.code == 200) {
  2621. self.noteList = res.data.rows;
  2622. }
  2623. });
  2624. },
  2625. delAnswer(answerId) {
  2626. let self = this;
  2627. let data = {
  2628. answerId: answerId,
  2629. status: -1,
  2630. orderGoodsId: this.orderGoodsId,
  2631. };
  2632. this.$api.delAnswer(data).then((res) => {
  2633. if (res.data.code == 200) {
  2634. self.getAnswerList();
  2635. }
  2636. });
  2637. },
  2638. clearCtx() {
  2639. this.placeholder = "您可以在这里输入答疑内容";
  2640. this.ctxValue = "";
  2641. this.assignUserId = 0;
  2642. },
  2643. focusNote(event) {
  2644. this.bottomHeight = event.detail.height;
  2645. },
  2646. blurNote() {
  2647. this.bottomHeight = 0;
  2648. },
  2649. blur() {
  2650. this.bottomHeight = 0;
  2651. this.clearTimer = setTimeout(() => {
  2652. this.ctxValue = "";
  2653. this.isFocus = false;
  2654. this.assignUserId = 0;
  2655. this.placeholder = "您可以在这里输入答疑内容";
  2656. }, 2000);
  2657. },
  2658. replyContent(item) {
  2659. this.isFocus = true;
  2660. this.assignUserId = item.userId;
  2661. this.placeholder = "@" + item.realname;
  2662. },
  2663. delContent(item) {
  2664. this.delAnswer(item.answerId);
  2665. },
  2666. postAnswer() {
  2667. let self = this;
  2668. let data = {
  2669. courseId: this.courseId,
  2670. answerText: this.ctxValue,
  2671. goodsId: this.goodsId,
  2672. orderGoodsId: this.orderGoodsId,
  2673. };
  2674. if (this.assignUserId > 0) {
  2675. data.assignUserId = this.assignUserId;
  2676. }
  2677. this.$api.postAnswer(data).then((res) => {
  2678. if (res.data.code == 200) {
  2679. this.$u.toast("发布成功");
  2680. self.getAnswerList();
  2681. this.isFocus = false;
  2682. this.placeholder = "您可以在这里输入答疑内容";
  2683. this.ctxValue = "";
  2684. this.assignUserId = 0;
  2685. }
  2686. });
  2687. },
  2688. postContent() {
  2689. if (!this.ctxValue || this.ctxValue == "") {
  2690. this.$u.toast("请输入内容");
  2691. return;
  2692. }
  2693. this.postAnswer();
  2694. },
  2695. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2696. console.log("学习记录接口的playSectionId", sectionId, polyvPlayerContext);
  2697. let currentTime = 0;
  2698. let PlayDuration = 0;
  2699. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2700. if (polyvPlayerContext) {
  2701. // #ifdef MP-WEIXIN
  2702. currentTime = polyvPlayerContext.getCurrentTime(); //获取视频当前的播放时刻
  2703. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2704. // #endif
  2705. // #ifdef H5
  2706. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  2707. PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
  2708. // #endif
  2709. }
  2710. console.log("---学习记录:currentTime", currentTime);
  2711. if (this.playChannelId > 0) {
  2712. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2713. }
  2714. let self = this;
  2715. let data = {
  2716. fromPlat: 1, //来源平台 1小程序 2网站
  2717. photo: self.ossAvatarUrl,
  2718. sectionId: sectionId || 0,
  2719. goodsId: parseInt(self.goodsId),
  2720. courseId: parseInt(self.courseId),
  2721. orderGoodsId: this.orderGoodsId,
  2722. studyDuration: parseInt(
  2723. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2724. ),
  2725. gradeId: parseInt(self.gradeId),
  2726. chapterId: this.chapterId || 0,
  2727. moduleId: this.moduleId || 0,
  2728. videoCurrentTime: parseInt(
  2729. currentTime > 0 ? currentTime : self.studyDuration
  2730. ),
  2731. };
  2732. if (this.ossAvatarUrl) {
  2733. data.similarity = this.compareFaceData; // 相似度
  2734. }
  2735. if (status > 0) {
  2736. data.status = status;
  2737. }
  2738. // console.log("提交接口:", data,'sectionId:', sectionId,'chapterId:', self.chapterId,'moduleId:', self.moduleId, 'courseId:', this.courseId);
  2739. this.$api
  2740. .studyRecord(data)
  2741. .then((res) => {
  2742. if (res.data.code == 200) {
  2743. if (status > 0) {
  2744. this.studyRecordMenuAllList();
  2745. let moduleId = this.moduleId || 0;
  2746. let chapterId = this.chapterId || 0;
  2747. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2748. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2749. uni.$emit("playNext" + playNextIdisRebuild, {
  2750. fromRebuild: this.isRebuild,
  2751. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2752. uni.$emit("playNext" + playNextId); //通知播放结束
  2753. }
  2754. self.ossAvatarUrl = "";
  2755. } else {
  2756. this.uploadLock = false;
  2757. uni.showToast({
  2758. icon: "none",
  2759. title: res.data.msg,
  2760. });
  2761. }
  2762. })
  2763. .catch((err) => {
  2764. this.studyRecordMenuAllList();
  2765. });
  2766. },
  2767. uploadFile(options, int) {
  2768. console.log("options:", options);
  2769. var self = this;
  2770. return new Promise((resolve, reject) => {
  2771. var data = {
  2772. imageStatus: int,
  2773. gradeId: this.gradeId,
  2774. orderGoodsId: this.orderGoodsId,
  2775. };
  2776. self.$api.aliyunpolicy(data).then((res) => {
  2777. if (res.data.code != 200) {
  2778. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2779. return;
  2780. }
  2781. var ossToken = res.data.data.resultContent;
  2782. if (ossToken.host == null || ossToken.host == undefined) {
  2783. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2784. return;
  2785. }
  2786. let filePath = "";
  2787. // #ifdef H5
  2788. var localData = options; //dataUrl为base64位
  2789. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  2790. let length = base.length;
  2791. let url = new Uint8Array(length);
  2792. while (length--) {
  2793. url[length] = base.charCodeAt(length);
  2794. }
  2795. filePath = new File([url], "a.jpg", {
  2796. type: "image/jpg",
  2797. });
  2798. console.log("filePath:", filePath);
  2799. uni.uploadFile({
  2800. url: ossToken.host,
  2801. name: "file",
  2802. file: filePath,
  2803. fileType: "image",
  2804. header: {
  2805. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2806. },
  2807. formData: {
  2808. key: ossToken.dir,
  2809. OSSAccessKeyId: ossToken.accessid,
  2810. policy: ossToken.policy,
  2811. Signature: ossToken.signature,
  2812. callback: ossToken.callback,
  2813. success_action_status: 200,
  2814. },
  2815. success: (result) => {
  2816. this.$u.toast("上传成功");
  2817. self.ossAvatarUrl = ossToken.dir;
  2818. console.log("h5上传成功--:", this.ossAvatarUrl);
  2819. resolve();
  2820. },
  2821. fail: (error) => {
  2822. console.log("h5上传失败:", error);
  2823. uni.showToast({
  2824. title: "上传接口报错,请重新拍照上传" + error,
  2825. icon: "none",
  2826. });
  2827. this.openPhoto();
  2828. return;
  2829. },
  2830. });
  2831. // #endif
  2832. // #ifdef MP-WEIXIN
  2833. uni.uploadFile({
  2834. url: ossToken.host,
  2835. name: "file",
  2836. filePath: options,
  2837. fileType: "image",
  2838. header: {
  2839. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2840. },
  2841. formData: {
  2842. key: ossToken.dir,
  2843. OSSAccessKeyId: ossToken.accessid,
  2844. policy: ossToken.policy,
  2845. Signature: ossToken.signature,
  2846. callback: ossToken.callback,
  2847. success_action_status: 200,
  2848. },
  2849. success: (result) => {
  2850. // if (result.statusCode === 200) {
  2851. this.$u.toast("上传成功");
  2852. self.ossAvatarUrl = ossToken.dir;
  2853. console.log("statusCode:", this.ossAvatarUrl);
  2854. resolve();
  2855. // } else {
  2856. // uni.showToast({
  2857. // title: "上传失败",
  2858. // icon: "none",
  2859. // });
  2860. // this.openPhoto();
  2861. // return;
  2862. // }
  2863. },
  2864. fail: (error) => {
  2865. uni.showToast({
  2866. title: "上传接口报错,请重新拍照上传" + error,
  2867. icon: "none",
  2868. });
  2869. this.openPhoto();
  2870. return;
  2871. },
  2872. });
  2873. // #endif
  2874. });
  2875. });
  2876. },
  2877. imageInfos() {
  2878. console.log("avatarUrl:", this.avatarUrl);
  2879. var self = this;
  2880. return new Promise(async (resolve, reject) => {
  2881. // #ifdef MP-WEIXIN
  2882. uni.getImageInfo({
  2883. src: self.avatarUrl,
  2884. success: async (res) => {
  2885. let canvasWidth = res.width; //图片原始长宽
  2886. let canvasHeight = res.height;
  2887. if (canvasWidth > 2000 || canvasHeight > 2000) {
  2888. // h5不支持
  2889. uni.compressImage({
  2890. src: self.avatarUrl,
  2891. quality: 75,
  2892. width: "35%",
  2893. height: "35%",
  2894. success: async (rest) => {
  2895. const waitUpload = await self.uploadFile(
  2896. rest.tempFilePath,
  2897. 0
  2898. );
  2899. resolve(waitUpload);
  2900. },
  2901. });
  2902. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  2903. uni.compressImage({
  2904. src: self.avatarUrl,
  2905. quality: 75,
  2906. width: "50%",
  2907. height: "50%",
  2908. success: async (rest) => {
  2909. const waitUpload = await self.uploadFile(
  2910. rest.tempFilePath,
  2911. 0
  2912. );
  2913. resolve(waitUpload);
  2914. },
  2915. });
  2916. } else {
  2917. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2918. resolve(waitUpload);
  2919. }
  2920. },
  2921. fail: (err) => {
  2922. this.$u.toast("图片上传失败");
  2923. },
  2924. });
  2925. // #endif
  2926. // #ifdef H5
  2927. const waitUpload = await this.uploadFile(this.faceUrl, 0);
  2928. resolve(waitUpload);
  2929. // #endif
  2930. });
  2931. },
  2932. timeEvent() {
  2933. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2934. if (polyvPlayerContext != null) {
  2935. // #ifdef MP-WEIXIN
  2936. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2937. // #endif
  2938. // #ifdef H5
  2939. this.playTime = polyvPlayerContext.j2s_getCurrentTime();
  2940. // #endif
  2941. console.log(
  2942. 789,
  2943. this.photoHistoryList,
  2944. "this.photoList:",
  2945. this.photoList,
  2946. "photoNum:",
  2947. this.photoNum,
  2948. "playTime:",
  2949. this.playTime
  2950. );
  2951. //判断是否需要拍照
  2952. if (this.photoNum > 0) {
  2953. this.configPhoto();
  2954. let photoTime = 0; //获取拍照秒数
  2955. for (let i = 0; i < this.photoList.length; i++) {
  2956. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2957. console.log(
  2958. "photoTime:",
  2959. photoTime,
  2960. "this.sectionItem.learning",
  2961. this.sectionItem.learning
  2962. );
  2963. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2964. //3秒区间内才触发拍照,避免拉动滚动条
  2965. if (
  2966. this.photoHistoryList.indexOf(i) < 0 &&
  2967. this.sectionItem.learning != 1
  2968. ) {
  2969. //不存在拍照历史,没有重修过,没有学过,则拍照
  2970. //启动拍照
  2971. //暂停
  2972. // #ifdef MP-WEIXIN
  2973. polyvPlayerContext.exitFullScreen();
  2974. polyvPlayerContext.pause();
  2975. // #endif
  2976. // #ifdef H5
  2977. polyvPlayerContext.j2s_pauseVideo();
  2978. polyvPlayerContext.toggleFullscreen();
  2979. // #endif
  2980. this.photoIndex = i;
  2981. console.log("i:i", i);
  2982. if (
  2983. uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
  2984. this.goodsId
  2985. ) {
  2986. console.log("2222");
  2987. this.openPhoto();
  2988. } else {
  2989. console.log("1111");
  2990. this.popupPhotoShow = true;
  2991. uni.setStorageSync(
  2992. `tabkePhotoShow${this.goodsId}`,
  2993. this.goodsId
  2994. ); // 本地缓存用来判断是否已经弹出过弹窗
  2995. }
  2996. }
  2997. }
  2998. }
  2999. }
  3000. }
  3001. },
  3002. closeToast() {
  3003. clearTimeout(this.toastTimer);
  3004. this.videoToastShow = false;
  3005. },
  3006. restart() {
  3007. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3008. // #ifdef MP-WEIXIN
  3009. polyvPlayerContext.seek(0);
  3010. // #endif
  3011. // #ifdef H5
  3012. polyvPlayerContext.j2s_seekVideo(0);
  3013. // #endif
  3014. clearTimeout(this.toastTimer);
  3015. this.videoToastShow = false;
  3016. },
  3017. // 新增用户视频学习日志
  3018. studyLog() {
  3019. this.$http({
  3020. url: "/user/study/log",
  3021. method: "post",
  3022. data: {
  3023. goodsId: this.goodsId,
  3024. courseId: this.courseId,
  3025. moduleId: this.moduleId || 0,
  3026. chapterId: this.chapterId || 0,
  3027. sectionId: this.playSectionId || 0,
  3028. fromPlat: 1, //来源平台 1小程序 2PC网站
  3029. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  3030. orderGoodsId: this.orderGoodsId,
  3031. },
  3032. }).then((res) => {});
  3033. },
  3034. onStateChange(newstate, oldstate) {
  3035. polyvPlayerContext = this.selectComponent("#playerVideo");
  3036. console.log(
  3037. "视频的开始播放事件",
  3038. newstate.detail.newstate,
  3039. this.needSeek
  3040. );
  3041. if (newstate.detail.newstate == "playing") {
  3042. if (this.needSeek) {
  3043. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3044. if (this.recordObj.videoCurrentTime) {
  3045. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  3046. this.seekTime = this.$method.secondToDate(
  3047. this.recordObj.videoCurrentTime
  3048. );
  3049. this.videoToastShow = true;
  3050. this.toastTimer = setTimeout(() => {
  3051. this.videoToastShow = false;
  3052. }, 3000);
  3053. } else {
  3054. polyvPlayerContext.seek(1); //避免相同节继续播放
  3055. }
  3056. polyvPlayerContext.play();
  3057. this.needSeek = false;
  3058. // 新增用户视频学习日志
  3059. this.studyLog();
  3060. // 提交学习记录
  3061. }
  3062. //开始播放
  3063. if (this.timer) {
  3064. clearInterval(this.timer);
  3065. }
  3066. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3067. }
  3068. if (newstate.detail.newstate == "pause") {
  3069. clearInterval(this.timer);
  3070. //暂停提交记录
  3071. /* this.ossAvatarUrl = ""
  3072. this.postStudyRecord() */
  3073. }
  3074. if (newstate.detail.newstate == "ended") {
  3075. clearInterval(this.timer);
  3076. uni.showToast({
  3077. icon: "none",
  3078. title: "播放完毕",
  3079. });
  3080. this.hasStart = false;
  3081. this.postStudyRecord(1);
  3082. this.nextSection();
  3083. // uni.$emit('playNext') //播放重修下一节
  3084. }
  3085. },
  3086. //播放下一节
  3087. nextSection() {
  3088. if (!this.menuAllList.length) {
  3089. return;
  3090. }
  3091. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  3092. let i_sectionId = item.sectionId || 0;
  3093. let i_chapterId = item.chapterId || 0;
  3094. let i_moduleId = item.moduleId || 0;
  3095. return (
  3096. i_sectionId == this.playSectionId &&
  3097. i_chapterId == this.chapterId &&
  3098. i_moduleId == this.moduleId
  3099. );
  3100. });
  3101. let data = this.menuAllList[this.curPlayIndex + 1];
  3102. if (!data) {
  3103. //第二个弹窗
  3104. uni.showModal({
  3105. title: "温馨提示",
  3106. content: "当前最后一节视频已学完 请检查所有章节是否学习完成?",
  3107. showCancel: false,
  3108. success: (res) => {
  3109. if (res.confirm) {
  3110. }
  3111. },
  3112. });
  3113. } else {
  3114. uni.showModal({
  3115. title: "温馨提示",
  3116. content: "当前节视频已学完,继续学习下一节?",
  3117. success: async (res) => {
  3118. if (res.confirm) {
  3119. this.moduleId = data.moduleId;
  3120. this.chapterId = data.chapterId;
  3121. this.sectionId = data.sectionId;
  3122. if (data.sectionType == 1) {
  3123. //录播
  3124. this.$store.commit("setPlaySectionId", {
  3125. playSectionId: data.sectionId,
  3126. });
  3127. this.$store.commit("setPlayVID", {
  3128. playVID: data.recordingUrl,
  3129. });
  3130. this.hasStart = false;
  3131. this.photoConfig = false;
  3132. this.photoIndex = 0;
  3133. this.sectionItem = data;
  3134. await this.getPhotoLastRecord(); // 获取拍照历史
  3135. this.playVideo(data);
  3136. } else if (data.sectionType == 2) {
  3137. //直播
  3138. this.studyRecordGetLastLive();
  3139. } else if (data.sectionType == 3) {
  3140. //回放
  3141. this.$store.commit("setPlaySectionId", {
  3142. playSectionId: data.sectionId,
  3143. });
  3144. this.$store.commit("setPlayVID", {
  3145. playVID: data.recordingUrl,
  3146. });
  3147. this.sectionItem = data;
  3148. this.playVideo(data);
  3149. }
  3150. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  3151. this.$store.commit("updatePlayNextId", playNextId);
  3152. this.updateChapterOpen(true);
  3153. this.reStart = false;
  3154. this.getMenuList();
  3155. }
  3156. },
  3157. });
  3158. }
  3159. },
  3160. //拍照
  3161. openPhoto() {
  3162. console.log("开始拍照");
  3163. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3164. if (polyvPlayerContext) {
  3165. // #ifdef MP-WEIXIN
  3166. polyvPlayerContext.exitFullScreen();
  3167. // #endif
  3168. // #ifdef H5
  3169. if (this.isFullScreen()) {
  3170. this.exitFullscreen();
  3171. }
  3172. // #endif
  3173. }
  3174. // #ifdef MP-WEIXIN
  3175. this.enableAutoRotation = false;
  3176. this.photoPopup = true;
  3177. this.isTaking = true;
  3178. uni.setKeepScreenOn({
  3179. keepScreenOn: true,
  3180. });
  3181. uni.authorize({
  3182. scope: "scope.camera",
  3183. success() {},
  3184. });
  3185. // #endif
  3186. // #ifdef H5
  3187. if (
  3188. (window.navigator.mediaDevices &&
  3189. window.navigator.mediaDevices.getUserMedia) ||
  3190. window.navigator.getUserMedia ||
  3191. window.navigator.webkitGetUserMedia ||
  3192. window.navigator.mozGetUserMedia
  3193. ) {
  3194. console.log("getUserMedia----");
  3195. // 调用用户媒体设备, 访问摄像头
  3196. this.getUserMedia(
  3197. {
  3198. video: {
  3199. width: 400,
  3200. height: 300,
  3201. },
  3202. },
  3203. this.photographSuccess,
  3204. this.photographError
  3205. );
  3206. } else {
  3207. console.log("1111没有摄像");
  3208. this.photographError();
  3209. }
  3210. // #endif
  3211. },
  3212. /**
  3213. * 人脸匹配
  3214. */
  3215. faceRecognition() {
  3216. return new Promise((resolve) => {
  3217. // #ifdef MP-WEIXIN
  3218. let fileSystem = uni.getFileSystemManager();
  3219. fileSystem.readFile({
  3220. filePath: `${this.avatarUrl}`,
  3221. encoding: "base64",
  3222. position: 0,
  3223. success: (res) => {
  3224. let base64 = "data:image/jpg;base64," + res.data;
  3225. // console.log('base64Data人脸识别参数:', {
  3226. // imageA: base64,
  3227. // orderGoodsId: this.orderGoodsId,
  3228. // gradeId: this.gradeId,
  3229. // })
  3230. this.CompareFace(base64, resolve);
  3231. },
  3232. fail(err) {
  3233. // this.$u.toast('人脸识别错误!')
  3234. console.error(err, "err-----人脸识别错误");
  3235. },
  3236. });
  3237. // #endif
  3238. // #ifdef H5
  3239. this.CompareFace(this.faceUrl, resolve);
  3240. // #endif
  3241. });
  3242. },
  3243. CompareFace(url, resolve) {
  3244. let timer = setTimeout(() => {
  3245. uni.showToast({
  3246. icon: "none",
  3247. title: "拍照超时,请重新拍照",
  3248. duration: 2000,
  3249. success: () => {
  3250. setTimeout(() => {
  3251. uni.navigateBack();
  3252. }, 1000);
  3253. },
  3254. });
  3255. }, 10 * 1000);
  3256. this.$api
  3257. .faceCertificationCompareFace({
  3258. imageA: url,
  3259. orderGoodsId: this.orderGoodsId,
  3260. gradeId: this.gradeId,
  3261. })
  3262. .then((res) => {
  3263. clearTimeout(timer);
  3264. console.log(res, "人脸识别成功res");
  3265. resolve(res.data.data);
  3266. })
  3267. .catch((err) => {
  3268. clearTimeout(timer);
  3269. // 当前网络延迟,
  3270. console.log("人脸识别错误:", err);
  3271. uni.showModal({
  3272. content: "当前网络延迟",
  3273. showCancel: false,
  3274. success: (resultst) => {
  3275. if (resultst.confirm) {
  3276. uni.navigateBack();
  3277. }
  3278. },
  3279. });
  3280. });
  3281. },
  3282. // 确定拍照
  3283. async submit() {
  3284. if (this.uploadLock) {
  3285. return;
  3286. }
  3287. this.uploadLock = true;
  3288. let compareFaceData = await this.faceRecognition();
  3289. console.log(compareFaceData, "compareFaceData");
  3290. this.compareFaceData = compareFaceData;
  3291. if (compareFaceData >= 80) {
  3292. const waitYS = await this.imageInfos();
  3293. this.postCoursePhotoRecord()
  3294. .then((res) => {
  3295. this.photoHistoryList.push(this.photoIndex);
  3296. // console.log('拍照确定提交', this.photoHistoryList);
  3297. this.postStudyRecord(); //提交记录
  3298. //恢复播放
  3299. // #ifdef MP-WEIXIN
  3300. uni.setKeepScreenOn({
  3301. keepScreenOn: false,
  3302. });
  3303. // #endif
  3304. this.photoPopup = false;
  3305. this.uploadLock = false;
  3306. this.enableAutoRotation = true;
  3307. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3308. if (polyvPlayerContext != null) {
  3309. // #ifdef MP-WEIXIN
  3310. polyvPlayerContext.play();
  3311. // #endif
  3312. // #ifdef H5
  3313. polyvPlayerContext.j2s_resumeVideo();
  3314. // #endif
  3315. }
  3316. })
  3317. .catch((err) => {
  3318. console.log("拍照记录接口的err", err);
  3319. uni.showToast({
  3320. title: "上传接口报错,请重新拍照上传" + err,
  3321. icon: "none",
  3322. });
  3323. this.uploadLock = false;
  3324. this.openPhoto();
  3325. });
  3326. } else {
  3327. uni.showToast({
  3328. title: "人脸匹配不通过,请重新拍照上传",
  3329. icon: "none",
  3330. duration: 2000,
  3331. });
  3332. setTimeout(() => {
  3333. this.uploadLock = false;
  3334. this.openPhoto();
  3335. }, 2000);
  3336. }
  3337. },
  3338. reTake() {
  3339. this.isTaking = true;
  3340. // #ifdef H5
  3341. this.faceUrl = "";
  3342. this.getUserMedia({
  3343. video: {
  3344. width: 400,
  3345. height: 300,
  3346. },
  3347. });
  3348. // #endif
  3349. },
  3350. toTakePhoto() {
  3351. this.popupPhotoShow = false;
  3352. this.openPhoto();
  3353. },
  3354. takePhTips() {
  3355. this.popupPhotoShow = true;
  3356. this.isTaking = false;
  3357. this.photoPopup = false;
  3358. this.enableAutoRotation = false;
  3359. },
  3360. //确认拍照
  3361. takePhoto() {
  3362. // #ifdef MP-WEIXIN
  3363. const ctx = uni.createCameraContext();
  3364. ctx.takePhoto({
  3365. quality: "high",
  3366. success: (res) => {
  3367. this.avatarUrl = res.tempImagePath;
  3368. console.log("开始拍照this.avatarUrl:", this.avatarUrl);
  3369. this.isTaking = false;
  3370. },
  3371. fail: (err) => {},
  3372. });
  3373. // #endif
  3374. // #ifdef H5
  3375. const canvas = document.createElement("canvas");
  3376. canvas.width = 400;
  3377. canvas.height = 400;
  3378. const context = canvas.getContext("2d");
  3379. const video = document.querySelector("video");
  3380. context.drawImage(video, 0, 0, 400, 400);
  3381. this.faceUrl = canvas.toDataURL("image/png");
  3382. this.isTaking = false;
  3383. // #endif
  3384. },
  3385. playError(e) {
  3386. console.log(e);
  3387. },
  3388. //拍照报错
  3389. error(e) {
  3390. console.log(e.detail);
  3391. },
  3392. //关闭相机
  3393. closePhoto() {
  3394. this.photoPopup = false;
  3395. self.enableAutoRotation = true;
  3396. },
  3397. /**
  3398. * 进入全屏
  3399. */
  3400. fullscreenchange(event) {
  3401. if (event.detail.direction == "vertical") {
  3402. this.navShow = true;
  3403. } else if (event.detail.direction == "horizontal") {
  3404. this.navShow = false;
  3405. }
  3406. },
  3407. getGoodsDetail() {
  3408. let self = this;
  3409. // '/goods/'+ data,
  3410. this.$api.goodsDetail(this.goodsId).then((res) => {
  3411. this.goodsData = res.data.data;
  3412. if (self.goodsData.buyNote) {
  3413. this.baseHandoutTipList();
  3414. }
  3415. self.gradeId = self.goodsData.gradeId;
  3416. this.courseBusiness(this.goodsData.businessId);
  3417. this.courseHandouts();
  3418. self.getMenuList();
  3419. self.getReMenuList(); //获取重修目录
  3420. setTimeout(function () {
  3421. if (!self.needProfileModal) {
  3422. self.getGradeInfo();
  3423. }
  3424. }, 500);
  3425. //获取节笔记
  3426. this.getNoteList();
  3427. if (self.goodsData.goodsPlayConfig) {
  3428. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  3429. if (self.goodsPlayConfig.autoPlay > 0) {
  3430. // #ifdef H5
  3431. self.autoplay = true;
  3432. console.log("是否自动播放:", self.autoplay);
  3433. // #endif
  3434. }
  3435. if (self.goodsPlayConfig.drag > 0) {
  3436. // #ifdef MP-WEIXIN
  3437. self.isAllowSeek = "yes";
  3438. // #endif
  3439. // #ifdef H5
  3440. this.H5isAllowSeek = "off";
  3441. // #endif
  3442. }
  3443. if (self.goodsPlayConfig.speed > 0) {
  3444. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  3445. }
  3446. }
  3447. if (self.goodsData.goodsPhotographConfig) {
  3448. self.goodsPhotographConfig = JSON.parse(
  3449. self.goodsData.goodsPhotographConfig
  3450. );
  3451. if (self.goodsPhotographConfig.photoNum > 0) {
  3452. self.photoNum = self.goodsPhotographConfig.photoNum;
  3453. console.log(self.photoNum, 777777);
  3454. }
  3455. }
  3456. });
  3457. },
  3458. startVideo() {
  3459. this.startStatus = true;
  3460. },
  3461. getAnswerList() {
  3462. let self = this;
  3463. this.$api
  3464. .answerList({
  3465. courseId: this.courseId,
  3466. goodsId: this.goodsId,
  3467. orderGoodsId: this.orderGoodsId,
  3468. })
  3469. .then((res) => {
  3470. if (res.data.code == 200) {
  3471. self.answerList = res.data.rows;
  3472. }
  3473. });
  3474. },
  3475. getReMenuList() {
  3476. // console.log('重修的目录');
  3477. let self = this;
  3478. this.$api
  3479. .reMenuList({
  3480. orderGoodsId: this.orderGoodsId,
  3481. courseId: this.courseId,
  3482. rebuild: 1,
  3483. gradeId: this.gradeId,
  3484. })
  3485. .then((res) => {
  3486. if (res.data.code == 200) {
  3487. for (let i = 0; i < res.data.rows.length; i++) {
  3488. let item = res.data.rows[i];
  3489. item.down = true;
  3490. item.id = item.menuId;
  3491. item.name = item.menuName;
  3492. }
  3493. self.reMenuList = res.data.rows;
  3494. if (self.reMenuList.length > 0) {
  3495. this.showNotes = false;
  3496. self.list = [
  3497. {
  3498. name: "目录",
  3499. },
  3500. {
  3501. name: "讲义",
  3502. },
  3503. {
  3504. name: "笔记",
  3505. },
  3506. {
  3507. name: "答疑",
  3508. },
  3509. { name: "重修目录" },
  3510. ];
  3511. this.current = 0;
  3512. if (Object.keys(this.sectionItem).length) {
  3513. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  3514. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  3515. }
  3516. } else {
  3517. if (Object.keys(this.sectionItem).length) {
  3518. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  3519. this.$store.commit("updatePlayNextId", playNextId);
  3520. }
  3521. self.list = [
  3522. {
  3523. name: "目录",
  3524. },
  3525. {
  3526. name: "讲义",
  3527. },
  3528. {
  3529. name: "笔记",
  3530. },
  3531. {
  3532. name: "答疑",
  3533. },
  3534. ];
  3535. this.current = 0;
  3536. }
  3537. }
  3538. });
  3539. },
  3540. getMenuList() {
  3541. // console.log('menuList的目录');
  3542. let self = this;
  3543. // /course/menuList 查询课程目录结构列表
  3544. this.$api
  3545. .reMenuList({
  3546. courseId: this.courseId,
  3547. gradeId: this.gradeId,
  3548. orderGoodsId: this.orderGoodsId,
  3549. })
  3550. .then((res) => {
  3551. if (res.data.code == 200) {
  3552. for (let i = 0; i < res.data.rows.length; i++) {
  3553. let item = res.data.rows[i];
  3554. item.down = true;
  3555. item.id = item.menuId;
  3556. item.name = item.menuName;
  3557. item.menuType = item.type;
  3558. }
  3559. self.menuList = res.data.rows;
  3560. this.reStart = true;
  3561. for (let i = 0; i < res.data.rows.length; i++) {
  3562. if (res.data.rows[i].type == 1) {
  3563. // 模块
  3564. if (Object.keys(this.sectionItem).length) {
  3565. if (res.data.rows[i].menuId == this.sectionItem.moduleId) {
  3566. this.menuIndex = [i];
  3567. break;
  3568. }
  3569. } else {
  3570. this.menuIndex = [i];
  3571. break;
  3572. }
  3573. } else if (res.data.rows[i].type == 2) {
  3574. // 章
  3575. if (Object.keys(this.sectionItem).length) {
  3576. if (
  3577. res.data.rows[i].menuId == this.sectionItem.chapterId &&
  3578. (!this.sectionItem.moduleId ||
  3579. this.sectionItem.moduleId == 0)
  3580. ) {
  3581. this.menuIndex = [i];
  3582. break;
  3583. }
  3584. } else {
  3585. this.menuIndex = [i];
  3586. break;
  3587. }
  3588. }
  3589. }
  3590. // console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
  3591. }
  3592. });
  3593. },
  3594. courseDetail() {
  3595. let self = this;
  3596. // '/course/'+data,
  3597. this.$api.courseDetail(this.courseId).then((res) => {
  3598. if (res.data.code == 200) {
  3599. // if (res.data.data.educationName == "继续教育") {
  3600. this.$api
  3601. .lockLockAction({
  3602. action: "jxjy",
  3603. uuid: this.$method.getUuid(),
  3604. })
  3605. .then((res) => {});
  3606. this.lockTimer = setInterval(() => {
  3607. this.$api
  3608. .lockLockAction({
  3609. action: "jxjy",
  3610. uuid: this.$method.getUuid(),
  3611. })
  3612. .then((res) => {});
  3613. }, 10000);
  3614. // websocket.sendMsg("doCourse");
  3615. // }
  3616. self.detail = res.data.data;
  3617. }
  3618. });
  3619. },
  3620. open(item) {
  3621. item.showChildren = !item.showChildren;
  3622. },
  3623. change(index) {
  3624. this.current = index;
  3625. },
  3626. openDocument(item) {
  3627. this.downLoading = true;
  3628. let url = this.$method.splitImgHost(item.handoutsUrl);
  3629. // #ifdef H5
  3630. window.location.href = url;
  3631. // #endif
  3632. // #ifdef MP-WEIXIN
  3633. uni.downloadFile({
  3634. url: url,
  3635. success: (res) => {
  3636. var filePath = res.tempFilePath;
  3637. // h5不支持
  3638. uni.openDocument({
  3639. filePath: filePath,
  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. // .input {
  4207. // height: 60rpx;
  4208. // }
  4209. }
  4210. .btn {
  4211. color: #007aff;
  4212. font-size: 30rpx;
  4213. font-weight: bold;
  4214. width: 15%;
  4215. text-align: center;
  4216. }
  4217. .input {
  4218. background: rgba(244, 244, 244, 0.98);
  4219. height: 60rpx;
  4220. border-radius: 24rpx;
  4221. margin-top: 12rpx;
  4222. }
  4223. }
  4224. .noteBox {
  4225. width: 100%;
  4226. background: #ffffff;
  4227. padding: 0rpx 10rpx 20rpx;
  4228. border-radius: 16rpx;
  4229. overflow: hidden;
  4230. .left_ti {
  4231. padding-top: 14rpx;
  4232. }
  4233. }
  4234. .dateBox {
  4235. width: 216rpx;
  4236. height: 48rpx;
  4237. background: #ffffff;
  4238. border-radius: 24rpx;
  4239. font-size: 24rpx;
  4240. color: #666666;
  4241. text-align: center;
  4242. line-height: 48rpx;
  4243. margin: 16rpx 0rpx 8rpx;
  4244. }
  4245. .t_content1 {
  4246. color: #007aff;
  4247. margin-left: 10rpx;
  4248. }
  4249. .tag1 {
  4250. border: 2rpx solid #007aff;
  4251. border-radius: 8rpx;
  4252. font-size: 20rpx;
  4253. color: #007aff;
  4254. padding: 5rpx;
  4255. }
  4256. .b_title {
  4257. color: #333333;
  4258. font-size: 30rpx;
  4259. font-weight: bold;
  4260. }
  4261. page {
  4262. background: #eaeef1;
  4263. }
  4264. .menuBox {
  4265. width: 100%;
  4266. background: #ffffff;
  4267. border-radius: 16rpx;
  4268. padding: 0rpx 20rpx;
  4269. margin-bottom: 20rpx;
  4270. }
  4271. .btnspric {
  4272. border-top: 1rpx solid #eee;
  4273. display: flex;
  4274. align-items: center;
  4275. justify-content: space-between;
  4276. height: 108rpx;
  4277. padding-left: 43rpx;
  4278. padding-right: 32rpx;
  4279. }
  4280. .btnspric > .lefprL {
  4281. font-size: 36rpx;
  4282. color: #0c141f;
  4283. font-weight: bold;
  4284. }
  4285. .btnspric > .lefprR {
  4286. padding: 0rpx 24rpx;
  4287. height: 60rpx;
  4288. line-height: 60rpx;
  4289. text-align: center;
  4290. color: #fff;
  4291. background: #32467b;
  4292. border-radius: 24rpx;
  4293. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4294. }
  4295. .yhj,
  4296. .hdyhj {
  4297. padding: 24rpx 29rpx 24rpx 34rpx;
  4298. }
  4299. .yhj {
  4300. border-bottom: 16rpx solid #f9f9f9;
  4301. }
  4302. .yhjtit {
  4303. font-size: 30rpx;
  4304. color: #0c141f;
  4305. font-weight: 500;
  4306. margin-bottom: 14rpx;
  4307. }
  4308. .yhjList {
  4309. display: flex;
  4310. align-items: center;
  4311. justify-content: space-between;
  4312. margin-bottom: 14rpx;
  4313. }
  4314. .yhjList > .yhjLefts {
  4315. display: flex;
  4316. align-items: center;
  4317. }
  4318. .yhjLefts > .yhl {
  4319. color: #32467b;
  4320. font-size: 30rpx;
  4321. margin-right: 31rpx;
  4322. }
  4323. .yhjLefts > .yhbq {
  4324. font-size: 24rpx;
  4325. color: #ff9500;
  4326. border-radius: 18rpx;
  4327. background-color: rgba(255, 149, 0, 0.2);
  4328. border: 2rpx solid #ff9500;
  4329. height: 38rpx;
  4330. line-height: 38rpx;
  4331. padding: 0rpx 16rpx;
  4332. }
  4333. .ts {
  4334. font-size: 24rpx;
  4335. color: #999;
  4336. margin: 14rpx 0rpx;
  4337. padding-right: 29rpx;
  4338. padding-left: 34rpx;
  4339. }
  4340. .yh {
  4341. padding-top: 20rpx;
  4342. }
  4343. .yh > .yhtitle {
  4344. display: flex;
  4345. align-items: center;
  4346. justify-content: space-between;
  4347. padding-right: 29rpx;
  4348. padding-left: 34rpx;
  4349. }
  4350. .priceBxs {
  4351. display: flex;
  4352. align-items: center;
  4353. }
  4354. .priceBxs > .pricleft {
  4355. border-radius: 24rpx;
  4356. border: 1rpx solid #e91313;
  4357. background-color: rgba(233, 19, 19, 0.1);
  4358. padding: 0rpx 18rpx;
  4359. height: 49rpx;
  4360. line-height: 49rpx;
  4361. text-align: center;
  4362. font-size: 30rpx;
  4363. font-weight: 500;
  4364. color: #e91313;
  4365. margin-right: 13rpx;
  4366. }
  4367. .topBox {
  4368. padding: 32rpx 32rpx 24rpx;
  4369. border-bottom: 1rpx solid #eeeeee;
  4370. }
  4371. .topBox > .boldFonstType {
  4372. font-weight: 500;
  4373. font-size: 30rpx;
  4374. margin: 16rpx 0rpx 23rpx;
  4375. }
  4376. .topBox > .firstTopL {
  4377. display: flex;
  4378. align-items: center;
  4379. }
  4380. .topBox > .firstTopL > .imageBs {
  4381. width: 331rpx;
  4382. height: 160rpx;
  4383. border-radius: 6rpx;
  4384. overflow: hidden;
  4385. margin-right: 8rpx;
  4386. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  4387. }
  4388. .topBox > .firstTopL > .imageBs > image {
  4389. width: 100%;
  4390. height: 100%;
  4391. }
  4392. .topBox > .firstTopL > .textBs {
  4393. font-size: 30rpx;
  4394. font-weight: bold;
  4395. color: #0c141f;
  4396. }
  4397. .content {
  4398. padding: 24rpx;
  4399. text-align: left;
  4400. }
  4401. .catalogBox {
  4402. display: flex;
  4403. align-items: center;
  4404. flex-wrap: nowrap;
  4405. overflow-x: auto;
  4406. padding-left: 38rpx;
  4407. max-height: 305rpx;
  4408. overflow-y: auto;
  4409. transition: all 0.4s;
  4410. }
  4411. .catalogBox > .catalogA {
  4412. min-width: 200rpx;
  4413. height: 48rpx;
  4414. line-height: 48rpx;
  4415. // text-align: center;
  4416. border: 2rpx solid transparent;
  4417. white-space: nowrap;
  4418. text-overflow: ellipsis;
  4419. overflow: hidden;
  4420. word-break: break-all;
  4421. border-radius: 10rpx;
  4422. background: rgba(22, 119, 255, 0.05);
  4423. padding-left: 19rpx;
  4424. box-sizing: border-box;
  4425. padding-right: 15rpx;
  4426. margin-right: 16rpx;
  4427. margin-bottom: 20rpx;
  4428. margin-top: 15rpx;
  4429. font-size: 24rpx;
  4430. color: #666;
  4431. }
  4432. .catalogBox > .activesq {
  4433. border-color: #1677ff;
  4434. }
  4435. .changeCatalogBox {
  4436. display: block;
  4437. }
  4438. .catalogBox::-webkit-scrollbar {
  4439. display: none; /* Chrome Safari */
  4440. }
  4441. .price_t2 {
  4442. font-size: 18rpx;
  4443. font-family: PingFang SC;
  4444. font-weight: 500;
  4445. text-decoration: line-through;
  4446. color: #999999;
  4447. }
  4448. .price_t1 {
  4449. font-size: 33rpx;
  4450. font-family: PingFang SC;
  4451. font-weight: bold;
  4452. color: #e91313;
  4453. }
  4454. .sc_t {
  4455. font-size: 22rpx;
  4456. color: #000000;
  4457. }
  4458. .sc {
  4459. width: 29rpx;
  4460. height: 29rpx;
  4461. }
  4462. .buy {
  4463. width: 138rpx;
  4464. height: 48rpx;
  4465. line-height: 48rpx;
  4466. background: #32467b;
  4467. border-radius: 10rpx;
  4468. color: #ffffff;
  4469. font-size: 28rpx;
  4470. text-align: center;
  4471. vertical-align: middle;
  4472. position: absolute;
  4473. right: 30rpx;
  4474. }
  4475. .video_body {
  4476. padding-bottom: 96rpx;
  4477. }
  4478. .footer_tab {
  4479. position: fixed;
  4480. bottom: 0;
  4481. height: 96rpx;
  4482. width: 100%;
  4483. background-color: #ffffff;
  4484. }
  4485. .tj_box {
  4486. width: 50%;
  4487. display: inline-block;
  4488. text-align: center;
  4489. margin: 10rpx 0;
  4490. }
  4491. .teacher_t {
  4492. font-size: 24rpx;
  4493. font-family: PingFang SC;
  4494. font-weight: 400;
  4495. color: #666666;
  4496. line-height: 36rpx;
  4497. margin-left: 15rpx;
  4498. }
  4499. .teacher_img {
  4500. width: 87rpx;
  4501. height: 129rpx;
  4502. }
  4503. .t2 {
  4504. font-size: 24rpx;
  4505. font-family: PingFang SC;
  4506. color: #666666;
  4507. line-height: 36rpx;
  4508. margin: 15rpx;
  4509. }
  4510. .r_t2 {
  4511. width: 201rpx;
  4512. height: 49rpx;
  4513. background: rgba(22, 119, 255, 0.05);
  4514. border: 1rpx solid #32467b;
  4515. border-radius: 16rpx;
  4516. color: #666666;
  4517. font-size: 23rpx;
  4518. text-align: center;
  4519. display: flex;
  4520. align-items: center;
  4521. padding: 5rpx;
  4522. }
  4523. .scroll_box {
  4524. width: 100%;
  4525. height: 60rpx;
  4526. background: #ffffff;
  4527. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4528. white-space: nowrap;
  4529. overflow: hidden;
  4530. margin: 15rpx 0;
  4531. }
  4532. .r_sliper {
  4533. padding: 0 20rpx;
  4534. }
  4535. .top_line {
  4536. width: 6rpx;
  4537. height: 22rpx;
  4538. background: #32467b;
  4539. margin-right: 10rpx;
  4540. }
  4541. .video_t2 {
  4542. font-size: 24rpx;
  4543. font-family: PingFang SC;
  4544. font-weight: 500;
  4545. color: #666666;
  4546. }
  4547. .video_play {
  4548. position: absolute;
  4549. width: 95rpx;
  4550. height: 95rpx;
  4551. top: 0;
  4552. left: 0;
  4553. right: 0;
  4554. bottom: 0;
  4555. margin: auto;
  4556. }
  4557. .video_box {
  4558. position: relative;
  4559. #playerVideo {
  4560. position: relative;
  4561. z-index: 99;
  4562. }
  4563. .video-toast {
  4564. position: absolute;
  4565. width: 686rpx;
  4566. height: 80rpx;
  4567. background: rgba(0, 0, 0, 0.6);
  4568. border-radius: 24rpx;
  4569. bottom: 100rpx;
  4570. left: 50%;
  4571. transform: translateX(-50%);
  4572. color: #fff;
  4573. display: flex;
  4574. font-size: 26rpx;
  4575. align-items: center;
  4576. overflow: visible;
  4577. z-index: 999;
  4578. &__text {
  4579. flex: 1;
  4580. margin-left: 40rpx;
  4581. }
  4582. &__btn {
  4583. width: 180rpx;
  4584. text-align: center;
  4585. border-left: 1rpx solid #fff;
  4586. }
  4587. }
  4588. .video-toast__close {
  4589. position: absolute;
  4590. right: 32rpx;
  4591. bottom: 184rpx;
  4592. width: 40rpx;
  4593. height: 40rpx;
  4594. line-height: 40rpx;
  4595. text-align: center;
  4596. background: rgba(0, 0, 0, 0.6);
  4597. border-radius: 50%;
  4598. color: rgba(255, 255, 255, 0.3);
  4599. }
  4600. }
  4601. .rotoct {
  4602. transform: rotate(90deg);
  4603. }
  4604. .slot-content {
  4605. padding: 0 20rpx;
  4606. }
  4607. .notice_modal {
  4608. .content {
  4609. width: 100%;
  4610. height: 100%;
  4611. padding: 56rpx 56rpx 56rpx 64rpx;
  4612. .title {
  4613. color: #222;
  4614. line-height: 40rpx;
  4615. font-size: 36rpx;
  4616. text-align: center;
  4617. font-weight: bold;
  4618. margin-bottom: 24rpx;
  4619. }
  4620. .text {
  4621. height: 340rpx;
  4622. line-height: 40rpx;
  4623. text-indent: 2em;
  4624. font-size: 32rpx;
  4625. color: #222;
  4626. }
  4627. .had_read {
  4628. width: 100%;
  4629. height: 88rpx;
  4630. line-height: 88rpx;
  4631. text-align: center;
  4632. background: #3577e8;
  4633. border-radius: 240rpx;
  4634. font-size: 32rpx;
  4635. font-weight: 500;
  4636. color: #fff;
  4637. margin-top: 20rpx;
  4638. &.gray {
  4639. background: #bbbec5;
  4640. }
  4641. }
  4642. }
  4643. }
  4644. .full_mulu {
  4645. position: absolute;
  4646. top: 100rpx;
  4647. right: 20rpx;
  4648. width: 700rpx;
  4649. height: 515rpx;
  4650. color: #333;
  4651. display: flex;
  4652. align-items: center;
  4653. justify-content: space-between;
  4654. z-index: 99999;
  4655. .mulus {
  4656. width: 623rpx;
  4657. // height: 515rpx;
  4658. height: 400rpx;
  4659. overflow-y: scroll;
  4660. // overflow: scroll;
  4661. }
  4662. .mulu_box_in {
  4663. background-color: #b7b7b7;
  4664. border-radius: 16rpx;
  4665. // transition: all 0.5s;
  4666. &::after {
  4667. content: "";
  4668. width: 0;
  4669. height: 0;
  4670. position: absolute;
  4671. top: 235rpx;
  4672. right: 27px;
  4673. border-top: 16rpx solid transparent;
  4674. border-right: 16rpx solid transparent;
  4675. border-left: 16rpx solid #b7b7b7;
  4676. border-bottom: 16rpx solid transparent;
  4677. }
  4678. }
  4679. .mulu_box_out {
  4680. // visibility: hidden;
  4681. display: none;
  4682. }
  4683. .menuBox_mulu {
  4684. // width: 100%;
  4685. background: #ffffff;
  4686. border-radius: 16rpx;
  4687. padding: 0rpx 20rpx;
  4688. margin-bottom: 20rpx;
  4689. }
  4690. .ml_img {
  4691. position: absolute;
  4692. right: 0;
  4693. top: 100rpx;
  4694. }
  4695. .items {
  4696. width: 620rpx;
  4697. height: 100rpx;
  4698. border: 1rpx solid red;
  4699. }
  4700. }
  4701. </style>