detail.vue 141 KB

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