1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021 |
- <template>
- <view class="polyv_detail">
- <!-- <nav-bar
- :title="detail.courseName || '课程详情'"
- v-show="navShow"
- ></nav-bar> -->
- <uni-nav-bar
- left-icon="back"
- :statusBar="true"
- fixed='true'
- :title="detail.courseName || '课程详情'"
- @clickLeft="clickLeft"
- ></uni-nav-bar>
- <view id="top">
- <view class="video_box" v-if="!startStatus">
- <image
- :src="$method.splitImgHost(goodsData.coverUrl)"
- mode="widthFix"
- style="width: 100%; height: 421rpx"
- ></image>
- <image
- v-if="false"
- class="video_play"
- src="/static/play.png"
- @click="startVideo"
- ></image>
- </view>
- <view v-else>
- <!-- v-if="playVID" -->
- <view
- class="video_box"
- style="width: 100%; height: 421rpx"
-
- >
- <polyv-player
- v-if="playVID"
- id="playerVideo"
- playerId="playerVideo"
- height="421rpx"
- :vid="vid"
- :showSettingBtn="true"
- :enablePlayGesture="true"
- :custom-cache="false"
- :object-fit="'contain'"
- @statechange="onStateChange"
- @fullscreenchange="fullscreenchange"
- @error="playError"
- :autoplay="autoplay"
- :page-gesture="true"
- :vslide-gesture="true"
- :vslide-gesture-in-fullscreen="true"
- :isAllowSeek="isAllowSeek"
- :playbackRate="playbackRate"
- :startTime="startTime"
- :enableAutoRotation="enableAutoRotation"
- @loadedmetadata="loadedmetadata"
- ></polyv-player>
- <cover-view
- class="video-toast__close"
- v-if="videoToastShow"
- @click="closeToast()"
- >X</cover-view
- >
- <cover-view class="video-toast" v-if="videoToastShow">
- <cover-view class="video-toast__text"
- >您上次看到 {{ seekTime }},正在自动续播</cover-view
- >
- <cover-view class="video-toast__btn" @click="restart()"
- >从头播放</cover-view
- >
- </cover-view>
- <!-- 全屏时的目录 -->
-
- </view>
- <view
- class="video_box"
- style="width: 100%; height: 421rpx"
- v-if="playChannelId > 0"
- >
- <player
- class="plv-mp-demo-player"
- :videoOption="videoOption"
- :page-gesture="true"
- :vslide-gesture="true"
- :vslide-gesture-in-fullscreen="true"
- @onLiveStatusChange="playerLiveStatusChange"
- />
- </view>
- </view>
- <view class="course_name">
- <view class="course_titles">
- <view class="video_t1" :class="{'one': !goodsData.buyNote}">{{ detail.courseName }}</view>
- <view class="notice_wrap" v-if="goodsData.buyNote">
- <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
- </view>
- <view class="toggle_course" v-if="goodsTeacher.length > 1" @click="changeCourses()">
- <image class="img" src="/pages3/static/imgs/toggle.png" mode="widthFix"></image>
- <view class="toggle_name">切换课程</view>
- <!-- courseTotal -->
- <view class="numbers">共{{ goodsTeacher.length }}门</view>
- </view>
-
- </view>
- </view>
- <u-line color="#D6D6DB" />
- <view>
- <view>
- <u-tabs
- :item-width="itemWidth()"
- :list="list"
- font-size="32"
- bar-width="24"
- :current="current"
- @change="change"
- active-color="#007AFF"
- ></u-tabs>
- </view>
- </view>
- <u-line color="#D6D6DB" />
- </view>
- <view class="box" :class="{'first_ml': current == 0}">
- <scroll-view class="box_in" scroll-y="true">
- <!--目录 -->
- <view v-show="current == 0">
- <view class="top__header" v-if="livingItem" @click="goLive(livingItem)">
- <image class="img" src="/pages3/static/imgs/live.png" mode="widthFix"></image>
- <view class="note">正在直播中</view>
- <view class="title">{{livingItem.sectionName}}</view>
- </view>
- <view v-if="teacherList && teacherList.length > 0" class='teacher_names'>
- <view v-for="(tea, index) in teacherList" :key="index" class="names"
- :class="{nactive: teacherIndex == index}" @click="activeFunc(tea, index)">
- {{ tea.aliasName }}
- </view>
- </view>
- <view class="menuBox onessss" v-for="(item, index) in menuList" :key="index">
- <!--模块 -->
- <view v-if="item.type == 1"
- ><courseModule
- v-if="reStart"
- :orderGoodsId="orderGoodsId"
- :sectionMaxNum="goodsData.sectionMaxNum"
- :needOpen="menuIndex[0] === index ? true : false"
- :courseId="courseId"
- :preItem="menuList[index - 1]"
- :learningOrder="businessData.goodsLearningOrder"
- :goodsId="goodsId"
- :gradeId="gradeId"
- :isBuy="true"
- :menuItem="item"
- :levelId="item.menuId"
- :goodsType='1'
- :menuAllList="menuAllList"
- :sectionItem="sectionItem"
- ></courseModule
- ></view>
- <!--章 -->
- <view v-if="item.type == 2"
- ><courseChapter
- v-if="reStart"
- :orderGoodsId="orderGoodsId"
- :sectionMaxNum="goodsData.sectionMaxNum"
- :needOpen="menuIndex[0] === index ? true : false"
- :courseId="courseId"
- :preItem="menuList[index - 1]"
- @playEnd="sectionPlayEnd($event, index)"
- :learningOrder="businessData.goodsLearningOrder"
- :goodsId="goodsId"
- :gradeId="gradeId"
- :isBuy="true"
- :menuItem="item"
- :levelId="'0-' + item.menuId"
- :goodsType='1'
- :menuAllList="menuAllList"
- ></courseChapter
- ></view>
- <!--节 -->
- <view v-if="item.type == 3"
- ><courseSection
- ref="MoudleSection"
- v-if="reStart"
- :orderGoodsId="orderGoodsId"
- :sectionMaxNum="goodsData.sectionMaxNum"
- @playEnd="sectionPlayEnd($event, index)"
- :courseId="courseId"
- :preItem="menuList[index - 1]"
- :learningOrder="businessData.goodsLearningOrder"
- :goodsId="goodsId"
- :gradeId="gradeId"
- :isBuy="true"
- :menuItem="item"
- :levelId="'0-0-' + item.menuId"
- :goodsType='1'
- :testType="3"
- :menuAllList="menuAllList"
- ></courseSection
- ></view>
- <!-- @togoBack="togoBack($event)" -->
- </view>
- </view>
- <!--讲义 -->
- <view v-show="current == 1">
- <view class="lecture-box" v-if="courseHandoutsData">
- <view class="title">
- {{ courseHandoutsData.handoutsName }}
- <!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
- </view>
- <view class="btn" @click="openDocument">
- <image v-if="!downLoading" src="/pages3/static/imgs/downLoad.png" style="width: 40rpx;height: 40rpx;"></image>
- <image v-else src="/pages3/static/imgs/downLoading.png" class="loading_down" style="width: 40rpx;height: 40rpx;"></image>
- </view>
- </view>
- </view>
- <!--笔记 -->
- <view v-show="current == 2">
- <view v-if="noteList.length == 0" style="text-align: center"
- >暂无笔记</view
- >
- <view v-for="(item, index) in noteList" :key="index">
- <view class="dateBox">{{
- $method.timestampToTime(item.dateNote)
- }}</view>
- <view class="noteBox">
- <view
- v-for="(item1, index1) in item.userNotes"
- :key="index1"
- style="margin-top: 30rpx"
- @click="jumpNote(item1)"
- >
- <view style="display: flex">
- <view class="left_ti">
- <view>
- <image
- src="/static/icon/note2.png"
- v-if="noteId != item1.noteId"
- style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
- ></image>
- <image
- src="/static/icon/note1.png"
- v-if="noteId == item1.noteId"
- style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
- ></image>
- </view>
- <view
- class="title"
- style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
- >{{ $method.secondToDate(item1.noteSecond) }}</view
- >
- </view>
- <view style="margin-left: 10rpx">
- <view class="t2Content leftPadding">{{
- item1.sectionName
- }}</view>
- <view class="tBox2">{{ item1.noteText }}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!--答疑 -->
- <view v-show="current == 3" class="Answering">
- <view
- v-for="(item, index) in answerList"
- :key="index"
- style="background-color: #ffffff;"
- class="answer_item"
- >
- <view class="chat_box" @click.stop="clearCtx">
- <view style="display: flex; flex: 1">
- <view
- ><image
- :src="
- item.assignUserId > 0 && !item.realname
- ? '/static/logo_xcx.png'
- : $method.splitImgHost(item.avatar)
- "
- style="width: 64rpx; height: 64rpx"
- ></image
- ></view>
- <view style="margin-left: 15rpx">
- <view class="chat1">{{
- item.assignUserId > 0 && !item.realname
- ? "祥粤老师"
- : item.realname
- }}</view>
- <view class="chat2">{{
- $method.timestampToTime(item.createTime, false)
- }}</view>
- <view class="chat3">
- <text v-if="item.assignUserId > 0">回复</text>
- <text v-if="item.assignUserId > 0" style="color: #007aff"
- >@{{ item.assignRealname }}</text
- >
- <view style="word-break: break-all">{{
- item.answerText
- }}</view>
- </view>
- </view>
- </view>
- <view
- class="btnReply"
- @click.stop="replyContent(item)"
- v-if="item.userId != userInfo.userId"
- >回复</view
- >
- <view v-else class="btnDel" @click.stop="delContent(item)"
- >删除</view
- >
- </view>
- <u-line color="#D6D6DB" />
- </view>
- <view v-if="answerList.length == 0" style="text-align: center"
- >暂无记录</view
- >
- </view>
- <!--目录 -->
- <view v-show="current == 4">
- <view
- class="menuBox"
- v-for="(item, index) in reMenuList"
- :key="index"
- >
- <!--模块 -->
- <view v-if="item.type == 1"
- ><courseModule
- :orderGoodsId="orderGoodsId"
- :sectionMaxNum="goodsData.sectionMaxNum"
- :courseId="courseId"
- :goodsId="goodsId"
- :gradeId="gradeId"
- :isRebuild="true"
- :isBuy="true"
- :menuItem="item"
- :levelId="item.menuId"
- :goodsType='1'
- :menuAllList="menuAllList"
- :sectionItem="sectionItem"
- ></courseModule
- ></view>
- <!--章 -->
- <view v-if="item.type == 2">
- <courseChapter
- :orderGoodsId="orderGoodsId"
- :courseId="courseId"
- :sectionMaxNum="goodsData.sectionMaxNum"
- @playEnd="sectionPlayEnd($event, index)"
- :gradeId="gradeId"
- :goodsId="goodsId"
- :isRebuild="true"
- :isBuy="true"
- :menuItem="item"
- :levelId="'0-' + item.menuId"
- :goodsType='1'
- :menuAllList="menuAllList"
- ></courseChapter>
- </view>
- <!--节 -->
- <view v-if="item.type == 3">
- <courseSection
- :orderGoodsId="orderGoodsId"
- :courseId="courseId"
- :sectionMaxNum="goodsData.sectionMaxNum"
- @playEnd="sectionPlayEnd($event, index)"
- :gradeId="gradeId"
- :goodsId="goodsId"
- :isRebuild="true"
- :isBuy="true"
- :nextMenuItem="findMenuNextSection(index)"
- :menuItem="item"
- :levelId="'0-0-' + item.menuId"
- :goodsType='1'
- :testType="3"
- :menuAllList="menuAllList"
- ></courseSection>
- </view>
- </view>
- </view>
- </scroll-view>
- <!-- 底部固定按钮 -->
- <!-- 笔记的输入框 -->
- <template v-if="current == 2">
- <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0" :style="{ bottom: bottomHeight + 'px' }">
- <view style="width: 10%"
- ><image
- src="/static/icon/note3.png"
- style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
- ></image
- ></view>
- <view style="width: 73%; height: 100%; padding: 10rpx 0">
- <input
- v-model="noteValue"
- height="60"
- fixed="true"
- placeholder="您可以在这里输入笔记内容"
- type="text"
- :custom-style="inputStyle"
- :adjust-position="false"
- class="input"
- @focus="focusNote"
- @blur="blurNote"
- />
- </view>
- <view
- style="
- color: #007aff;
- font-size: 30rpx;
- font-weight: bold;
- width: 15%;
- text-align: center;
- "
- @click="postNote"
- >提交</view
- >
- </view>
- </template>
- <!-- 答疑的输入框 -->
- <view v-if="current == 3" class="inputBottom" :style="{ bottom: bottomHeight + 'px' }">
- <view class="flex_auto">
- <input
- v-model="ctxValue"
- height="60"
- fixed="true"
- :focus="isFocus"
- :placeholder="placeholder"
- type="text"
- :custom-style="inputStyle"
- :adjust-position="false"
- class="input"
- @focus="focusNote"
- @blur="blur"
- />
- </view>
- <view class="btn" @click="postContent">提交</view>
- </view>
- </view>
- <!-- 播放前拍照end -->
- <u-popup
- v-model="showSet"
- :mask-close-able="false"
- mode="center"
- border-radius="24"
- >
- <view
- style="
- align-items: center;
- padding: 0 40rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- "
- >
- <view
- style="
- font-weight: bold;
- color: #333333;
- font-size: 30rpx;
- margin-top: 30rpx;
- "
- >温馨提示</view
- >
- <view
- style="
- width: 457rpx;
- color: #666666;
- font-size: 30rpx;
- margin-top: 30rpx;
- "
- >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
- 是否授权使用?</view
- >
- <view style="margin: 40rpx 0">
- <button
- open-type="openSetting"
- @bindopensetting="openSetting"
- class="btnSet"
- >
- 去授权
- </button>
- </view>
- </view>
- </u-popup>
- <u-mask :show="photoPopup">
- <!-- 播放前拍照start -->
- <view
- v-if="photoPopup"
- :mask-close-able="false"
- style="bottom: 0; position: fixed; width: 100%; z-index: 999"
- >
- <view class="photoBox">
- <view class="photoTop">
- <view class="sqzz" v-if="false"
- ><u-icon
- name="close"
- color="#333333"
- size="30"
- @click="closePhoto"
- ></u-icon
- ></view>
- <view class="centersq">请正视手机屏幕</view>
- <view class="sqzz"></view>
- </view>
- <view class="photoCenter">
- <view
- class="center_camera"
- v-if="photoPopup && isTaking"
- >
- <camera
- device-position="front"
- flash="off"
- @error="error"
- style="width: 100%; height: 100%"
- >
- <!-- 加人脸框 -->
- <cover-view class="head_take">
- <cover-view class="headTake_up color"></cover-view>
- <cover-view class="headTake_minddle">
- <cover-view class="min_left color"></cover-view>
- <cover-view class="min_img"></cover-view>
- <cover-view class="min_right color"></cover-view>
- </cover-view>
- <cover-view class="headTake_down color"></cover-view>
- </cover-view>
- </camera>
- </view>
- <view class="custom" v-if="!isTaking"
- ><image :src="avatarUrl" mode=""></image
- ></view>
- </view>
- <view class="btns">
- <!-- <view class="btnResult" v-if="isTaking" @click="takePhoto"
- >拍照</view
- > -->
- <view v-if="isTaking" class="takePhoto_btn">
- <view style='width: 100rpx;height: 2rpx;'></view>
- <view class="middle_btn" @click="takePhoto">
- <view class="square"></view>
- </view>
- <view class="rights" @click="takePhTips()">
- <text>拍照提示</text>
- <u-icon name="arrow-right" color="#FFFFFF" size="30"></u-icon>
- </view>
- </view>
- <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
- <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
- </view>
- </view>
- </view>
- </u-mask>
- <u-popup
- v-model="noticeShow"
- class="notice_modal"
- mode="center"
- border-radius="28"
- width="650rpx"
- height="622rpx"
- :mask-close-able="false"
- @close="closeNotice"
- >
- <div class="content">
- <view class="title">学员须知</view>
- <scroll-view scroll-y="true">
- <view class="text" v-html="goodsData.buyNote && goodsData.buyNote.replace(/\n|\r\n/g, '<br>')">
- </view>
- </scroll-view>
- <view class="had_read" :class="{'gray': CountTo >= 0}" @click="noticeConfirm()">
- <text v-if="CountTo >= 0">请阅读学员须知,30s后可关闭</text>
- <text v-else>我已阅读学员须知</text>
- <text v-if="CountTo >= 0">{{ ' ' + CountTo + 's' }}</text>
- </view>
- </div>
- </u-popup>
-
- <u-modal v-model="showMark" title="提示" @confirm="markConfirm" @cancel="markCancel" confirm-text="复制学习网址" :show-cancel-button="true"
- cancel-text="关闭">
- <view class="slot-content">
- <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
- <view>1.复制学习地址:{{markContent}}</view>
- <view>2.在【浏览器中】打开复制的学习网址</view>
- <view>3.打开学习网址后,选择【个人用户】进行登录</view>
- <view>(1)账号:您个人的身份证号码</view>
- <view>(2)密码:身份证号码,再加111111</view>
- </view>
-
- </u-modal>
- <!-- 切换课程弹窗 -->
- <u-popup v-model="toggleCourseShow" mode="bottom" border-radius="40" :mask-close-able='false'>
- <view class="popup_box">
- <view class="check_head">
- <view class="headers">
- <view class="grade">切换课程</view>
- <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
- </view>
- <view class="coruse_num">共{{ goodsTeacher.length }}门</view>
- <view class="menuSel">
- <scroll-view class="sub_sliper" scroll-x="true" >
- <view v-for="(item,index) in subList" :key="index" style="margin-right: 50rpx;display:inline-block">
- <view class="r_t1" :class="{'nactive': subIndex == index}" @click="cMenu(item, index)">
- {{item.subjectName}}
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
-
- <view class="check_con">
- <scroll-view scroll-y="true" style="height: 700rpx;">
- <view v-for="(courseItem, gTindex) in goodsTeacher" :key="gTindex">
- <view v-for="(item, index) in courseItem.courseList" :key="index" v-show="item.subjectId === newActiveSubjectId || !newActiveSubjectId">
- <view class="course_items" v-if="item.show && item.show == 1">
- <view class="course_lefts">
- <view class="course_title">
- {{ item.courseName }}
- </view>
- <view v-if="courseItem.teaList && courseItem.teaList.length > 0" class='teacher_names' >
- <view v-for="(tea, tindex) in courseItem.teaList" :key="tindex" class="names"
- >{{tea.aliasName}}</view>
- </view>
- <view class="course_pros">
- 学习进度
- <text> {{ item.stuAllNum + item.recordNum }}/{{ item.secAllNum + item.examNum}}</text>
- </view>
- </view>
- <view class="course_rights" @click="jump(item, gTindex, 'jump')">
- <view class="cicles">
- <u-icon name="arrow-right" color="#498AFE" size="20"></u-icon>
- </view>
- <view class="intoStudy">进入学习</view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </u-popup>
- <!-- 拍照提示 -->
- <popup-photo :popupPhotoShow.sync="popupPhotoShow" @takePhoto='toTakePhoto()'></popup-photo>
-
- </view>
- </template>
- <script>
- import plv from "../static/polyv-sdk/index";
- import courseModule from "@/components/course/courseModule.vue";
- import courseChapter from "@/components/course/courseChapter.vue";
- import courseSection from "@/components/course/courseSection.vue";
- import PopupPhoto from '@/components/popup/index.vue'
- import {WEBVIEW_URL} from '@/common/request.js'
- // import { websocket } from "@/common/socket.js";
- import { mapGetters, mapMutations } from "vuex";
- export default {
- components: {
- courseModule,
- courseChapter,
- courseSection,
- PopupPhoto,
- },
- data() {
- return {
- markContent: 'http://admin.zhujianpeixun.com/',
- showMark: false,
- hasStart:false,
- channelItem:null,
- lockTimer: null,
- orderGoodsId: 0,
- noticeShow: false,
- navShow: true,
- enableAutoRotation: true,
- seekTime: "",
- toastTimer: null,
- videoToastShow: false,
- initLiveOk: false,
- livePlay: false, //是否正在播放直播,不含暂停
- liveDuration: 0, //直播观看时长
- videoOption: {
- mode: "live",
- uid: "",
- cid: "",
- openId: "",
- isAutoChange: false,
- forceVideo: false,
- },
- courseHandoutsData: "",
- liveDetail: {},
- showSet: false,
- startStatus: false,
- detail: {},
- courseId: 0,
- placeholder:
- "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
- inputStyle: {
- background: "rgba(244, 244, 244, 0.98)",
- borderRadius: "24rpx",
- padding: "8rpx",
- marginBottom: "10rpx",
- },
- list: [],
- menuList: [],
- current: 0,
- vid: "",
- goodsId: 0,
- goodsData: {},
- photoPopup: false,
- goodsPlayConfig: null,
- autoplay: false,
- isAllowSeek: "no",
- playbackRate: [1.0],
- timer: null,
- // answerTimer: null,
- goodsPhotographConfig: null,
- intervalTimeList: [], // 间隔拍照时长
- intervalTimeIndex: 0, //当前处于哪个时间段拍照
- playTime: 0, //页面播放时长,不含暂停
- currentTime: 0,
- avatarUrl: "",
- ossAvatarUrl: "",
- studyDuration: 0, // 当前视频时长
- gradeId: 0,
- chapterId: 0,
- moduleId: 0,
- reMenuList: [],
- answerList: [],
- assignUserId: 0,
- placeholder: "您可以在这里输入答疑内容",
- ctxValue: "",
- noteList: [],
- noteValue: "",
- noteId: 0,
- recordObj: 0,
- gradeDetail: {},
- isTaking: true, //是否正在拍照
- needSeek: false, //第一次播放是否需要跳转
- needProfileModal: false, //是否需要资料审核弹框
- liveObj: {},
- photoNum: 0,
- photoList: [], //拍照的时间点
- photoConfig: false, //是否配置好拍照次数
- photoIndex: 0, //当前位于拍照的区间下标 从0开始
- photoHistoryList: [], //已拍照历史的下标点
- sectionItem: {},
- businessData: {},
- showNotes: true,
- menuIndex: [],
- uploadLock: false, //上传图片
- isPlayRebuild: false, //是否正在播放重修视频
- isRebuild: false, //视频是否从重修目录点击
- isFocus:false,
- clearTimer:null,
- livingItem:'',
- option:null,
- isOther:'',
- downLoading: false, //下载讲义加载
- muluStyle: false, //显示和隐藏目录样式
- bottomHeight: 0,
- toggleCourseShow: false, // 切换课程弹窗
- informId: '', //消息id,从公众号消息模板进来的才有
- courseList: [], // 课程列表
- // courseTotal: 0,
- reStart: false, // 是否显示模块/章/节
- subList: [],
- subIndex: 0,
- goodsTeacher: [],
- teacherList: [],
- // teaIndex: 0,
- teacherIndex: 0,
- newActiveSubjectId: "", //当前选中ID
- compareFaceData: 0, // 拍照匹配相似度
- prendreAutoCarme: false, // 是否发起授权相机
- studyTimer: null, // 学习记录定时器
- CountTo: 30, // 倒计时
- menuAllList: [],
- popupPhotoShow: false,
- curPlayIndex: 0, // 正在播放的节的下标
- };
- },
- computed: {
- ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
- },
- watch: {
- showSet(n) {
- if (n) {
- var polyvPlayerContext = this.selectComponent("#playerVideo")
- if (polyvPlayerContext) {
- polyvPlayerContext.pause()
- }
- }
- },
- photoPopup(n) {
- if (n) {
- if (this.prendreAutoCarme ) {
- this.photoPopup = false
- }
- this.showSet && (this.photoPopup = false)
- }
- }
- },
- onLoad(option) {
- console.log('--option--', option);
- this.courseId = Number(option.id) || '';
- this.goodsId = Number(option.goodsId);
- this.orderGoodsId = Number(option.orderGoodsId) || '';
- this.gradeId = option.gradeId
- this.isOther = option.isOther
- this.option = option
- // 公众号模板消息的数据埋点
- if (option.informId) {
- this.informId = option.informId
- // this.clickOfficial()
- }
-
- },
- onShow() {
- console.log('this.option:', this.option);
- if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
- return;
- }
- console.log('onshow返回之后');
- this.courseCourseList();
- this.informId && this.clickOfficial() // 从公众号消息点击进来上报一次
- this.$store.getters.dictObj;
- },
- onUnload() {
- this.originUnload()
- },
- onHide() {
- this.originUnload()
- },
- mounted() {
- },
- methods: {
- ...mapMutations(["updateChapterOpen","updateLiveLast"]),
- // 新增微信公众号模板消息点击数据
- clickOfficial() {
- this.$http({
- url: '/data/click',
- method: 'post',
- data: { informId: this.informId }
- }).then((res) => {
- if (res.data.code == 200) {
- console.log('上报埋点');
- }
- })
- },
- // 点击课程目录
- cMenu(item, index) {
- this.subIndex = index
- this.newActiveSubjectId = item.subjectId
- },
- courseCourseList() {
- // /course/courseList查询商品下的课程列表
- this.courseList = []
- this.menuList = []
- this.$api.courseCourseList({
- pageNum: 1,
- pageSize: 200,
- goodsId: this.goodsId,
- gradeId: this.gradeId,
- orderGoodsId: this.orderGoodsId,
- }).then((res) => {
- if (res.data.code == 200) {
- this.courseList.push.apply(this.courseList, res.data.rows)
- // 科目
- let allItem = [{ subjectId: 0, subjectName: '所有'}]
- let ids = []
- const newArr = []
- this.courseList.forEach(item => {
- if (ids.indexOf(item.subjectId) == -1) {
- ids.push(item.subjectId)
- newArr.push(item)
- }
- })
- this.subList = [...allItem, ...newArr]
- console.log('this.courseList:', this.courseList, 'length:',res.data.rows.length);
- if (res.data.rows.length) {
- this.courseBusiness(res.data.rows[0].businessId)
- }
- if(res.data.total > 1) {
- this.getUserWatchLast()
- // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
- } else if(res.data.total == 1) {
- this.originOnShow()
- this.originMounted()
- }
- }
- });
- },
- /**
- * 获取业务层次详情
- */
- courseBusiness(businessId) {
- // '/app/common/course/business/'+data,
- this.$api.courseBusiness(businessId).then((res) => {
- this.businessData = res.data.data
- });
- },
- // 查询用户最后一次看的录播的信息
- getUserWatchLast() {
- this.$http({
- url: '/study/record/getUserWatchLast',
- method: 'get',
- data: {
- orderGoodsId: this.orderGoodsId,
- }
- }).then((res) => {
- if (res.data.code == 200) {
- this.sectionItem = res.data.data || {}
- if (res.data.data && Object.keys(res.data.data).length) { //有最后一次看的录播的信息
- this.courseId = res.data.data.courseId
- // console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
- } else {
- this.courseId = this.courseList[0].courseId // 没有观看记录默认一个课程
- // this.toggleCourseShow = true
- }
- } else {
- this.courseId = this.courseList[0].courseId // 没有观看记录默认一个课程
- }
- this.originOnShow()
- this.originMounted()
- //获取商品双师资模板
- this.getCourseTeacher(this.courseList)
- })
- },
- getCourseTeacher(rows) {
- this.goodsTeacher = []
- //获取商品双师资模板
- this.$api.courseTeacherList({
- goodsId: this.goodsId
- }).then((res1) => {
- if(res1.data.data && res1.data.data.length > 0){
- //课程老师模板
- let teacherTel = res1.data.data;
- //商品课程
- let courses = rows;
- teacherTel.forEach((tea) => {
- let dataList = []
- let teacherList = []
- courses.forEach((item) => {
- let data = tea.courseList.filter(x => x.courseId == item.courseId)
- if(data && data.length > 0){
- dataList.push(item)
- teacherList = tea.courseList
- }
- })
- let result = {
- teaList:teacherList,
- courseList:dataList
- }
- this.goodsTeacher.push(result)
- })
- if(this.goodsTeacher && this.goodsTeacher.length > 0){
- let courseIds = []
- this.goodsTeacher.forEach((item) => {
- item.courseList.forEach((course) => {
- courseIds.push(course.courseId)
- })
- })
- if(courseIds.length > 0){
- courses.forEach((item) => {
- if(!courseIds.includes(item.courseId)){
- let data = {
- teaList:[],
- courseList: []
- }
- data.courseList.push(item)
- this.goodsTeacher.push(data)
- }
- })
- }
- this.goodsTeacher.forEach((item) => {
- if(item.courseList && item.courseList.length > 0){
- item.courseList[0].show = 1
- }
- })
- }
- } else {
- //没有双师资模板
- rows.forEach((item) => {
- item.show = 1
- let data = {
- teaList:[],
- courseList: []
- }
- data.courseList.push(item)
- this.goodsTeacher.push(data)
- })
- }
- console.log(this.goodsTeacher,'this.goodsTeacher', this.courseId);
- this.goodsTeacher.forEach((item) => {
- if(item.courseList.some(x => x.courseId == this.courseId)){
- this.teacherList = item.teaList
- }
- })
- })
- },
-
- // 原来onshow里面的内容
- originOnShow() {
- console.log('原来onshow里面的originOnShow')
- if(this.isOther) {
- this.showMark = true;
- return;
- }
- this.getbaseprofiletplists().then(res => {
- this.courseDetail();
- this.getGoodsDetail();
- this.getAnswerList();
- this.studyRecordMenuAllList();
- // this.answerTimer = setInterval(() => {
- // this.getAnswerList();
- // }, 5000);
- let noteSecond = Number(this.option.noteSecond);
- // console.log('noteSecondnoteSecond:', noteSecond, this.option)
- if (noteSecond > 0) {
- //我的消息跳过来,播放节
- let item = {
- sectionId: Number(this.option.sectionId),
- recordingUrl: this.option.recordingUrl,
- noteSecond: noteSecond,
- studyDuration: noteSecond,
- };
- let playNextId = `moduleId${this.option.moduleId}chapterId${
- this.option.chapterId
- }sectionId${this.option.sectionId}${this.option.isRebuild ? "isRebuild" : ""}`;
- this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
- this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
- this.$store.commit("updatePlayNextId", playNextId);
-
- this.playNoteVideo(item)
- } else {
- this.studyRecordQueryLiveLast();
- }
- });
- this.current = uni.getStorageSync('current') || 0
- },
- // 原来的mouted内容
- originMounted() {
- uni.$on("changeSection", (oldSectionId) => {
- console.log('切换课程-originMounted->playVID:', this.playVID, oldSectionId);
- this.studyTimer && clearInterval(this.studyTimer) // 清除定时器
- this.hasStart = false;
- this.photoConfig = false;
- this.photoIndex = 0;
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- if (polyvPlayerContext) {
- //解决同个节视频切换问题
- polyvPlayerContext.seek(0);
- polyvPlayerContext.pause();
- }
- //清除直播
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
- this.postStudyRecord(0, oldSectionId);
- });
- uni.$on("getSection", (item) => {
- //清除直播
- this.studyTimer && clearInterval(this.studyTimer)
- this.hasStart = false;
- this.isPlayRebuild = item.rebuild;
- this.photoConfig = false;
- this.photoIndex = 0;
- this.sectionItem = item;
- this.moduleId = item.moduleId || null
- this.chapterId = item.chapterId || null
-
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
- this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
- console.log('清除直播节点胡:', this.moduleId, this.chapterId, this.playSectionId, this.hasStart )
- //获取拍照历史
- this.getPhotoLastRecord();
- this.playVideo(item);
- });
- uni.$on("levelId", (item) => {
- console.log('点击节获取的各层级ID', item);
- let arr = item.split("-");
- //点击节获取的各层级ID
- this.moduleId = arr[0];
- this.chapterId = arr[1];
- });
- uni.$on("getChannel", (item) => {
- //清除录播
- this.studyTimer && clearInterval(this.studyTimer)
- this.hasStart = false;
- this.$store.commit("setPlayVID", { playVID: null });
- this.moduleId = item.moduleId
- this.chapterId = item.chapterId
- this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
- this.getPhotoLastRecord();
- this.playChannel(item);
- this.channelItem = item;
- });
- uni.$on("isRebuild", (item) => {
- this.isRebuild = item;
- });
- this.updateChapterOpen(true);
- },
- // 原来onUnload里面的内容
- originUnload() {
- if (this.playSectionId > 0 && this.hasStart) {
- //退出提交记录
- this.postStudyRecord();
- }
- //清除正在播放的节ID
- // this.$store.commit('setPlayObj',null)
- this.$store.commit("setPlaySectionId", { playSectionId: 0 });
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
- this.$store.commit("setPlayVID", { playVID: null });
- this.closePlv();
- //移除所有的事件监听器
- uni.$off();
- this.clearTimer && clearTimeout(this.clearTimer)
- this.toastTimer && clearTimeout(this.toastTimer)
- if (this.studyTimer) {
- clearInterval(this.studyTimer)
- this.hasStart = false
- }
-
- this.timer && clearInterval(this.timer)
- if (this.lockTimer) {
- clearInterval(this.lockTimer);
- this.$api
- .lockDelLock({
- action: "jxjy",
- uuid:this.$method.getUuid()
- })
- .then((res) => {
- uni.hideLoading()
- });
- }
- uni.removeStorageSync('current')
- },
- changeCourses() {
- this.toggleCourseShow = true
- },
- closePop() {
- this.toggleCourseShow = false
- },
- async activeFunc(item, index) {
- this.teacherIndex = index
- let findResult = ''
- this.goodsTeacher.forEach((citem,index) => {
- citem.courseList.forEach((e, e_index) => {
- if (e.courseId == item.courseId) {
- findResult = e
- }
- })
- })
-
- this.jump(findResult, 1)
- },
- // 进入学习
- async jump(item, index, type) {
- // console.log('item------>', index,item,this.goodsTeacher)
- if (index == 0) {
- await this.nextCourses(item, type)
- if (item.rebuild === 0) {
- //未重修
- this.$navTo.togo("/pages2/learn/details", {
- id: item.courseId,
- gradeId: item.gradeId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- });
- return;
- }
- this.$api.courseDetail(item.courseId).then((res) => {
- if (res.data.code == 200) {
- // if (res.data.data.educationName == "继续教育") {
- this.$api
- .lockLockStatus({
- action: "jxjy",
- uuid: this.$method.getUuid(),
- })
- .then((res) => {
- if (res.data.code == 200) {
- //有其他端在操作,不能学习
- uni.showToast({
- icon: "none",
- title: res.data.msg,
- mask: true,
- duration: 3000,
- });
- } else if (res.data.code == 500) {
- //可以学习
- // this.$navTo.togo("/pages3/polyv/detail", {
- // id: item.courseId,
- // goodsId: this.goodsId,
- // orderGoodsId: this.orderGoodsId,
- // });
- this.courseId = item.courseId
- this.originOnShow()
- this.originMounted()
- }
- });
- }
- });
- } else {
- if (this.businessData.goodsLearningOrder == 2) {
- //学习顺序是从头到尾学习,没学完上一课不能学习下一课
- let prevItem = this.courseList[index - 1]; //上一课
- if (
- prevItem.stuAllNum == prevItem.secAllNum
- ) {
- await this.nextCourses(item, type)
- if (item.rebuild === 0) {
- //未重修
- this.$navTo.togo("/pages2/learn/details", {
- id: item.courseId,
- gradeId: item.gradeId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- });
- return;
- }
- this.$api.courseDetail(item.courseId).then((res) => {
- if (res.data.code == 200) {
- // if (res.data.data.educationName == "继续教育") {
- this.$api
- .lockLockStatus({
- action: "jxjy",
- uuid: this.$method.getUuid(),
- })
- .then((res) => {
- if (res.data.code == 200) {
- //有其他端在操作,不能学习
- uni.showToast({
- icon: "none",
- title: res.data.msg,
- duration: 2000,
- });
- } else if (res.data.code == 500) {
- //可以学习
- // this.$navTo.togo("/pages3/polyv/detail", {
- // id: item.courseId,
- // goodsId: this.goodsId,
- // orderGoodsId: this.orderGoodsId,
- // });
- this.courseId = item.courseId
- this.originOnShow()
- this.originMounted()
- }
- });
- }
- });
- } else {
- uni.showToast({
- icon: "none",
- title: "请按顺序学完上一课再学习这一课",
- });
- }
- } else {
- await this.nextCourses(item, type)
- if (item.rebuild === 0) {
- //未重修
- this.$navTo.togo("/pages2/learn/details", {
- id: item.courseId,
- gradeId: item.gradeId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- });
- return;
- }
- this.$api.courseDetail(item.courseId).then((res) => {
- if (res.data.code == 200) {
- // if (res.data.data.educationName == "继续教育") {
- this.$api
- .lockLockStatus({
- action: "jxjy",
- uuid: this.$method.getUuid(),
- })
- .then((res) => {
- if (res.data.code == 200) {
- //有其他端在操作,不能学习
- uni.showToast({
- icon: "none",
- title: res.data.msg,
- duration: 2000,
- });
- } else if (res.data.code == 500) {
- //可以学习
- // this.$navTo.togo("/pages3/polyv/detail", {
- // id: item.courseId,
- // goodsId: this.goodsId,
- // orderGoodsId: this.orderGoodsId,
- // });
- this.courseId = item.courseId
- this.originOnShow()
- this.originMounted()
- }
- });
- }
- });
- }
- }
- },
- async nextCourses(item, type) {
- this.vid = ''
- this.hasStart = true
- await this.originUnload()
- if (type) {
- this.teacherIndex = 0
- this.goodsTeacher.forEach((citem) => {
- if(citem.courseList.some(x => x.courseId == item.courseId)){
- this.teacherList = citem.teaList
- }
- })
- }
- this.reStart = false
- this.courseId = item.courseId
- this.gradeId = item.gradeId
- this.toggleCourseShow = false
- },
- clickLeft() {
- // uni.navigateBack()
- uni.switchTab({
- url:'/pages/learn/index'
- })
- },
- markCancel() {
- uni.navigateBack({
- delta:1
- })
- },
- markConfirm() {
- uni.setClipboardData({
- data: this.markContent,
- success: function() {
- setTimeout(() => {
- uni.navigateBack({
- delta:1
- })
- },1000)
-
- }
- });
- },
- closeNotice() {
- this.$api.baseHandoutTip({
- orderGoodsId:this.orderGoodsId
- }).then(res => {
-
- })
- },
- noticeConfirm() {
- if (this.CountTo < 0) {
- this.noticeShow = false
- }
- },
- baseHandoutTipList() {
- this.$api.baseHandoutTipList({
- orderGoodsId:this.orderGoodsId
- }).then(res => {
- if(res.data.rows.length == 0) {
- this.noticeShow = true;
- if (this.CountTo == 30) {
- var timer = setInterval(() => {
- this.CountTo--
- if( this.CountTo < 0 ) {
- clearInterval(timer)
- }
- }, 1000)
- }
- } else {
- this.CountTo = -1
- }
- })
- },
- /**
- * 获取上次观看的直播
- */
- studyRecordGetLastLive() {
- this.$api.studyRecordGetLastLive({
- orderGoodsId:this.orderGoodsId,
- courseId:this.courseId
- }).then(res => {
- this.updateLiveLast(res.data.data)
- })
- },
- studyRecordQueryLiveLast() {
- // /study/record/queryLiveLast
- this.$api.studyRecordQueryLiveLast({
- orderGoodsId:this.orderGoodsId,
- courseId:this.courseId
- }).then(async res => {
- if(res.data.data) {
- this.moduleId = res.data.data.moduleId
- this.chapterId = res.data.data.chapterId
- if(res.data.data.sectionType == 1) { //录播
- this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
- this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
- this.sectionItem = res.data.data;
- await this.getPhotoLastRecord() // 获取拍照历史
- this.playVideo(res.data.data)
- } else if(res.data.data.sectionType == 2) { //直播
- this.studyRecordGetLastLive();
- } else if(res.data.data.sectionType == 3) { //回放
- this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
- this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
- this.sectionItem = res.data.data;
- this.playVideo(res.data.data)
- }
-
- // 查询用户最后一次看的录播的信息
- this.$http({
- url: '/study/record/getUserWatchLast',
- method: 'get',
- data: {
- orderGoodsId: this.orderGoodsId,
- }
- }).then((res) => {
- if (res.data.code == 200) {
- this.sectionItem = res.data.data || {}
- }
- })
- }
- })
- },
- /**
- * 模块大节播放完毕,刷新列表
- */
- sectionPlayEnd(isRebuild, index) {
- if (this.reMenuList.length > 0) {
- //有重修目录
- if (isRebuild.isRebuild) {
- //从重修点击
- this.$api
- .reMenuList({
- orderGoodsId: this.orderGoodsId,
- courseId: this.courseId,
- rebuild: 1,
- gradeId: this.gradeId,
- })
- .then((res) => {
- if (res.data.code == 200) {
- if (res.data.rows.length) {
- res.data.rows[index].name = res.data.rows[index].menuName;
- this.$set(this.reMenuList,index,res.data.rows[index])
- for (let i = 0; i < res.data.rows.length; i++) {
- let item = res.data.rows[i];
- item.down = true;
- item.id = item.menuId;
- item.name = item.menuName;
- }
- this.reMenuList = []
- this.$nextTick(() => {
- this.reMenuList = res.data.rows;
- // console.log(this.reMenuList,'this.reMenuList1')
- })
- } else {
- this.reMenuList = [];
- }
- this.$nextTick(() => {
- if (this.reMenuList.length > 0) {
- this.list = [
- {
- name: "目录",
- },
- {
- name: "讲义",
- },
- {
- name: "笔记",
- },
- {
- name: "答疑",
- },
- { name: "重修目录" },
- ];
- } else {
- this.list = [
- {
- name: "目录",
- },
- {
- name: "讲义",
- },
- {
- name: "笔记",
- },
- {
- name: "答疑",
- },
- ];
- if (this.current == 4) {
- this.current = 0;
- }
- }
- });
- }
- });
- this.$api
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
- .then((res) => {
- if (res.data.code == 200) {
- for (let i = 0; i < res.data.rows.length; i++) {
- let item = res.data.rows[i];
- item.down = true;
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- }
- this.menuList = [];
- this.$nextTick(() => {
- this.menuList = res.data.rows;
- });
- }
- });
- } else {
- //从普通目录点击
- this.$api
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
- .then((res) => {
- if (res.data.code == 200) {
- res.data.rows[index].name = res.data.rows[index].menuName;
- res.data.rows[index].id = res.data.rows[index].menuId;
- this.$set(this.menuList, index, res.data.rows[index]);
- }
- });
- this.$api
- .reMenuList({
- orderGoodsId: this.orderGoodsId,
- courseId: this.courseId,
- rebuild: 1,
- gradeId: this.gradeId,
- })
- .then((res) => {
- if (res.data.code == 200) {
- if (res.data.rows.length) {
- // for (let i = 0; i < res.data.rows.length; i++) {
- // let item = res.data.rows[i];
- // item.down = true;
- // item.id = item.menuId;
- // item.name = item.menuName;
- // }
- // this.reMenuList = res.data.rows;
- } else {
- this.reMenuList = [];
- }
- this.$nextTick(() => {
- if (this.reMenuList.length > 0) {
- this.list = [
- {
- name: "目录",
- },
- {
- name: "讲义",
- },
- {
- name: "笔记",
- },
- {
- name: "答疑",
- },
- { name: "重修目录" },
- ];
- } else {
- this.list = [
- {
- name: "目录",
- },
- {
- name: "讲义",
- },
- {
- name: "笔记",
- },
- {
- name: "答疑",
- },
- ];
- if (this.current == 4) {
- this.current = 0;
- }
- }
- });
- }
- });
- }
- } else {
- console.log('--模块大节播放完毕,刷新列表-');
- //没有重修目录
- this.$api
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId ,orderGoodsId: this.orderGoodsId,})
- .then((res) => {
- if (res.data.code == 200) {
- res.data.rows[index].name = res.data.rows[index].menuName;
- res.data.rows[index].id = res.data.rows[index].menuId;
- this.$set(this.menuList, index, res.data.rows[index]);
- }
- });
- }
- },
- goLive(item) {
- let moduleId = item.moduleId || 0;
- let chapterId = item.chapterId || 0;
- let sectionId = item.sectionId || item.menuId;
- let uuid = new Date().valueOf() + ""
- // buyCourse 是否购买课程:1是 0否
- let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
- +item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'§ionId='+sectionId+
- '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
- uni.navigateTo({
- url:`../../pages/webview/index?url=`+encode
- })
- },
- studyRecordMenuAllList() {
- // study/record/menuAllList
- this.$api.studyRecordMenuAllList({
- courseId:this.courseId,
- gradeId:this.gradeId,
- goodsId:this.goodsId
- }).then(res => {
- let nowTime = Number(new Date().getTime()/1000).toFixed(0)
- if (res.data.data) {
- this.menuAllList = res.data.data
- // console.log('======0', this.sectionItem);
- this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
- }
- })
- },
- getbaseprofiletplists() {
- return new Promise(resolve => {
- let self = this;
- this.getCameraSetting();
- this.$api.getbaseprofiletplists({ goodsId: self.goodsId,orderGoodsId: this.orderGoodsId, }).then((res) => {
- if (res.data.code === 200 && res.data.rows.length) {
- if (res.data.rows[0].keyValue) {
- self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
- if (baseRes.data.code === 200) {
- if (baseRes.data.data) {
- // base/profile/tp/getInfo
- self.$api
- .getbaseprofiletpgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((result) => {
- if (result.data.code === 200) {
- if (
- !result.data.data ||
- (result.data.data.status === 3 &&
- result.data.data.changeStatus === 1)
- ) {
- if (!result.data.data) {
- self.needProfileModal = true;
- uni.showModal({
- content: "请前往填写资料",
- cancelText: "返回",
- success: function (resultst) {
- if (resultst.confirm) {
- self.$navTo.togo("/pages2/verify/input", {
- id: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- });
- }
- if (resultst.cancel) {
- uni.navigateBack();
- }
- },
- });
- } else {
- self.needProfileModal = true;
- uni.showModal({
- content: "资料审核不通过,请前往重新填写",
- cancelText: "返回",
- success: function (resultst) {
- if (resultst.confirm) {
- self.$navTo.togo("/pages2/verify/input", {
- id: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- });
- }
- if (resultst.cancel) {
- uni.navigateBack();
- }
- },
- });
- }
- }
-
- else if (
- result.data.data.status === 1 &&
- JSON.parse(res.data.rows[0].keyValue2)[0]
- ) {
- self.$api
- .getbaseprofileStampgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((k) => {
- if (k.data.code === 200) {
- if (
- !k.data.data ||
- (k.data.data.status === 3 &&
- k.data.data.changeStatus === 1)
- ) {
- if (!k.data.data) {
- self.needProfileModal = true;
- uni.showModal({
- cancelText: "返回",
- content: "请前往填写盖章资料",
- success: function (resultst) {
- if (resultst.confirm) {
- self.$navTo.togo(
- "/pages2/verify/input2",
- {
- id: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- }
- );
- }
- if (resultst.cancel) {
- uni.navigateBack();
- }
- },
- });
- } else {
- self.needProfileModal = true;
- uni.showModal({
- cancelText: "返回",
- content:
- "资料盖章审核不通过,请前往重新填写",
- success: function (resultst) {
- if (resultst.confirm) {
- self.$navTo.togo(
- "/pages2/verify/input2",
- {
- id: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- }
- );
- }
- if (resultst.cancel) {
- uni.navigateBack();
- }
- },
- });
- }
- } else {
-
- resolve();
- }
- }
- });
- } else {
-
- resolve();
- }
- }
- });
- } else {
-
- resolve();
- }
- }
- });
- } else {
-
- resolve();
- }
- } else {
- resolve();
- }
- });
-
- if (this.gradeId > 0) {
- //提交完资料返回判断是否已开班
-
- this.getGradeInfo();
- }
- })
-
- },
-
- // /**
- // * 获取业务层次详情
- // */
- // courseBusiness() {
- // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
- // this.businessData = res.data.data;
- // });
- // },
- /**
- * 计算tabs宽度
- */
- itemWidth() {
- return 100 / this.list.length + "%";
- },
- /**
- * 获取讲义权限
- */
- courseHandouts() {
- this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
- this.courseHandoutsData = res.data.data;
- });
- },
- findMenuNextSection(index) {
- for (let i = index + 1; i < this.reMenuList.length; i++) {
- let item = this.reMenuList[i];
- if (item.type == 3) {
- return item;
- }
- }
- return {};
- },
- loadedmetadata(event) {
- console.log('------: loadedmetadata', this.hasStart);
- if (this.hasStart) { // 防止loadedmetadata事件第二次触发
- return
- }
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- this.hasStart = true;
- uni.$off('playPause')
- uni.$on('playPause',() => {
- polyvPlayerContext.pause()
- })
- if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
- this.postStudyRecord(0)
- }
- this.studyTimer = setInterval(() => {
- this.postStudyRecord(0)
- }, 15 * 1000)
- },
- getPhotoLastRecord() {
- let self = this;
- let data = {
- sectionId: parseInt(self.playSectionId),
- goodsId: parseInt(self.goodsId),
- courseId: parseInt(self.courseId),
- gradeId: parseInt(self.gradeId),
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- orderGoodsId: this.orderGoodsId,
- };
- // /course/photo/log/getLastInfo'
- this.$api.getPhotoLastRecord(data).then((res) => {
- if (res.data.code == 200) {
- //清空历史数据
- self.photoHistoryList = [];
- this.photoIndex = 0;
- self.photoList = [];
- for (let i = 0; i < res.data.data.length; i++) {
- //-2存储随机拍照数组
- if (res.data.data[i].photoIndex == -2) {
- self.photoList = res.data.data[i].timeInterval.split(",");
- } else {
- self.photoHistoryList.push(res.data.data[i].photoIndex);
- }
- }
- }
- });
- },
- //postTime 只提交随机时间
- postCoursePhotoRecord(postTime = false) {
- return new Promise((resolve, reject) => {
- let currentTime = 0;
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- if (polyvPlayerContext) {
- currentTime = polyvPlayerContext.getCurrentTime();
- }
- let self = this;
- let photoIndex = self.photoIndex;
- let data = {
- photo: self.ossAvatarUrl,
- sectionId: parseInt(self.playSectionId),
- goodsId: parseInt(self.goodsId),
- courseId: parseInt(self.courseId),
- photoTime: parseInt(currentTime > 0 ? currentTime : 0),
- gradeId: parseInt(self.gradeId),
- photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
- photoNum: parseInt(self.photoNum),
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- timeInterval: postTime ? self.photoList.join(",") : "",
- orderGoodsId: this.orderGoodsId,
- };
- // console.log("提交接口", data);
- this.$api
- .coursePhotoRecord(data)
- .then((res) => {
- if (res.data.code == 200) {
- resolve();
- } else {
- reject();
- }
- })
- .catch((err) => {
- reject();
- });
- });
- },
- randomNum(minNum, maxNum) {
- switch (arguments.length) {
- case 1:
- return parseInt(Math.random() * minNum + 1, 10);
- break;
- case 2:
- return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
- break;
- default:
- return 0;
- break;
- }
- },
- //配置随机拍照时间
- configPhoto() {
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- let totalVideoTime = polyvPlayerContext.getDuration();
- let duration = polyvPlayerContext.getCurrentTime();
- let photoNum = this.photoNum;
- if (!this.photoConfig) {
- this.photoConfig = true;
- // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
- // if(spaceTime<5){//区间小于5秒
- // photoNum = Math.floor(totalVideoTime/5)
- // spaceTime = 5
- // }
- // if(photoNum<1){
- // photoNum = 1 //只要设置,至少拍一次
- // spaceTime = totalVideoTime
- // }
- // let initSpace = 0
- //没有历史拍照间隔数据
- if (this.photoList.length == 0) {
- if (totalVideoTime >= 900) {
- //大于15分钟
- if (photoNum == 1) {
- //开头拍1张
- this.photoList.push(0);
- } else if (photoNum == 3) {
- //拍3张
- this.photoList.push(0); //开头拍一张
- let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
- let centerMinTime = centerTime - 300; //前后5分钟
- let centerMaxTime = centerTime + 300;
- let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
- this.photoList.push(centerTakeTime); //中间拍一张
- let endMaxTime = totalVideoTime - 60;
- let endMinTime = totalVideoTime - 300;
- let endTakeTime = this.randomNum(endMinTime, endMaxTime);
- this.photoList.push(endTakeTime); //最后拍一张
- }
- } else {
- //小于15分钟,只拍前后各一张
- if (photoNum == 1) {
- //开头拍1张
- this.photoList.push(0);
- } else if (photoNum == 3) {
- //拍2张
- if (totalVideoTime <= 300) {
- //小于5分钟
- this.photoList.push(0); //开头拍一张
- let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
- this.photoList.push(endTakeTime);
- } else {
- this.photoList.push(0); //开头拍一张
- let endMaxTime = totalVideoTime - 60;
- let endMinTime = totalVideoTime - 300;
- let endTakeTime = this.randomNum(endMinTime, endMaxTime);
- this.photoList.push(endTakeTime); //最后1-5分钟拍一张
- }
- }
- }
- // for(let i=0;i<photoNum;i++){
- // let s = this.randomNum(initSpace,initSpace+spaceTime)
- // if(s>totalVideoTime){
- // s = totalVideoTime-1
- // }
- // if(s<=5){
- // s =5 //避免出现5秒内拍照时间
- // }
- // this.photoList.push(s)
- // initSpace+=spaceTime
- // }
- // console.log(this.photoList, "随机拍照时间数组11", photoNum);
- this.postCoursePhotoRecord(true); //提交随机拍照时间数组
- }
- // console.log(this.photoList, "随机拍照时间数组");
- //兼容已有观看历史
- for (let i = 0; i < this.photoList.length - 1; i++) {
- if (
- this.photoList[i] < duration &&
- this.photoList[i + 1] > duration
- ) {
- this.photoIndex = i + 1;
- break;
- }
- if (duration > this.photoList[this.photoList.length - 1]) {
- this.photoIndex = this.photoList.length - 1; //取最后一个下标
- break;
- }
- }
- }
- },
- getLiveUid(channelId) {
- let self = this;
- return new Promise((resolve) => {
- let data = {
- channelId: channelId,
- orderGoodsId: this.orderGoodsId,
- };
- self.$api.polyvSign(data).then((res) => {
- resolve(res.data.data);
- });
- });
- },
- timeEventLiving() {
- if (plv != null) {
- if (this.livePlay) {
- this.liveDuration = this.liveDuration + 1; //每隔1秒
- if (this.liveDuration == 2) {
- //直播第2秒拍照
- if (
- this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
- this.channelItem.learning != 1 && this.photoHistoryList.length == 0
- ) {
- //开启直播拍照
- this.openPhoto();
- } else {
- this.postStudyRecord(0);
- }
- }
- }
- }
- },
- playerLiveStatusChange(e) {
- const status = e.detail.status;
- if (status === "live") {
- //开始播放
- if (this.timer) {
- clearInterval(this.timer);
- }
- this.livePlay = true;
- this.timer = setInterval(this.timeEventLiving, 1000); //定时器
- }
- if (status === "end") {
- this.hasStart = false;
- if (this.livePlay) {
- //只有播放过的结束才提交,避免未开播触发结束
- this.postStudyRecord(1);
- }
- this.livePlay = false;
- // 未开始
- }
- },
- closePlv() {
- if (plv) {
- plv.destroy();
- }
- },
- playChannel(item) {
- if (this.timer) {
- clearInterval(this.timer);
- }
- this.startStatus = true;
- this.initLive();
- },
- setLiveOption(status) {
- const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
- this.detail;
- const playRecordFile =
- playbackEnabled && recordFileSimpleModel && status === "end";
- this.videoOption = {
- mode: "live",
- uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
- cid: this.playChannelId,
- openId: this.userInfo.userAccount,
- isAutoChange: false,
- forceVideo: false,
- };
- },
- async initLive() {
- this.liveObj = await this.getLiveUid(this.playChannelId);
- this.initLiveOk = true;
- let optionsData = {};
- optionsData.mode = "live";
- optionsData.forceVideo = false;
- optionsData.channelId = this.playChannelId; // 频道ID '2553128'
- optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
- optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
- let self = this;
- this.closePlv();
- plv.init(optionsData).then(({ detail, chat }) => {
- self.liveDetail = detail;
- // 设置mode为live的videoOption
- this.setLiveOption();
- if (detail.isPPT) {
- chat.on(chat.events.SLICESTART, () => {
- // 开始直播
- });
- } else {
- plv.api.getOrdinaryLiveStatus(detail.stream);
- }
- });
- },
- openSetting(res) {
- console.log(res, 98);
- },
- getCameraSetting() {
- const self = this;
- wx.getSetting({
- success: (res) => {
- if (res.authSetting["scope.camera"]) {
- // 用户已经授权
- self.showSet = false;
- this.prendreAutoCarme = false
- } else {
- this.prendreAutoCarme = true
- // 用户还没有授权,向用户发起授权请求
- wx.authorize({
- scope: "scope.camera",
- success:() =>{
- // 用户同意授权
- self.showSet = false;
- this.prendreAutoCarme = false
- },
- fail:() => {
- // 用户不同意授权
- self.showSet = true;
- },
- });
- }
- },
- fail: (res) => {},
- });
- },
- studyNotice() {
- this.noticeShow = true;
- },
- //播放笔记视频
- async playNoteVideo(item) {
- if (this.timer) {
- clearInterval(this.timer);
- }
- if (this.vid) {
- //切换视频
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- polyvPlayerContext.changeVid(item.recordingUrl);
- } else {
-
- this.vid = item.recordingUrl;
- }
- this.recordObj = { videoCurrentTime: item.noteSecond };
- if (this.recordObj.videoCurrentTime) {
- this.needSeek = true; //需要跳转到播放记录
- }
- this.startStatus = true;
- //获取节笔记
- this.getNoteList();
- },
- //正常播放视频
- async playVideo(item) {
- console.log(item.recordingUrl,'22222222', this.vid);
- if (this.timer) {
- clearInterval(this.timer);
- }
- if (this.vid) {
- //切换视频
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
- } else {
- this.vid = item.recordingUrl;
- }
- this.recordObj = null;
- this.recordObj = await this.getRecordLast();
- // console.log('this.recordObj:', this.recordObj)
- this.needSeek = true; //跳转到播放记录
- this.startStatus = true;
- // 提交学习记录
- this.postStudyRecord(0)
- //获取节笔记
- this.getNoteList();
- },
- getRecordLast() {
- return new Promise((resolve) => {
- let data = {
- gradeId: this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
- goodsId: this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
- sectionId: this.playSectionId || 0,
- courseId: this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
- chapterId: this.chapterId || 0,
- moduleId: this.moduleId || 0,
- orderGoodsId: this.orderGoodsId,
- };
- this.$api.recordLast(data).then((res) => {
- resolve(res.data.data);
- });
- });
- },
- jumpNote(item) {
- this.noteId = item.noteId;
- //没视频播放
- if (this.playSectionId == 0) {
- this.$u.toast("即将跳到笔记位置");
- this.$store.commit("setPlaySectionId", {
- playSectionId: item.sectionId || item.menuId,
- });
- this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
- this.playNoteVideo(item);
- } else {
- //正在看当前笔记视频
- this.$u.toast("即将跳到笔记位置");
- //跳到笔记时刻
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- polyvPlayerContext.seek(item.noteSecond);
- polyvPlayerContext.play();
- }
- },
- postNote() {
- let self = this;
- if (!(this.playSectionId > 0)) {
- this.$u.toast("目前无播放视频");
- return;
- }
- if (!this.noteValue) {
- this.$u.toast("请输入内容");
- return;
- }
- if (!this.gradeId) {
- this.$u.toast("暂无班级数据");
- return;
- }
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- let noteDate = this.$method.getZeroTime();
- let noteSecond = polyvPlayerContext.getCurrentTime();
- if (!noteSecond) {
- if (noteSecond == 0) {
- //播放结束
- noteSecond = polyvPlayerContext.getDuration();
- }
- if (!noteSecond) {
- this.$u.toast("视频暂未开始");
- return;
- }
- }
- let data = {
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- sectionId: this.playSectionId,
- courseId: this.courseId,
- noteText: this.noteValue,
- noteDate: noteDate,
- noteSecond: noteSecond,
- orderGoodsId: this.orderGoodsId,
- };
- this.$api.postNote(data).then((res) => {
- if (res.data.code == 200) {
- this.$u.toast("发布成功");
- self.getNoteList();
- this.noteValue = "";
- }
- });
- },
- getGradeInfo() {
- let self = this;
- this.$store.state.allowLoading = false;
- this.$api.goodsGradeInfo(this.gradeId).then((res) => {
- if (res.data.code == 200) {
- self.gradeDetail = res.data.data;
- if (self.needProfileModal) {
- return;
- }
- if (self.gradeDetail.learningStatus == 2) {
- uni.showModal({
- showCancel: false,
- confirmText: "确定",
- content:
- "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
- success: function (resultst) {
- uni.navigateBack();
- },
- });
- }
- if (
- self.gradeDetail.learningStatus == 3 &&
- Number(self.gradeDetail.learningTimeStart) >
- Number(new Date() / 1000)
- ) {
- uni.showModal({
- showCancel: false,
- cancelText: "返回",
- content:
- "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
- success: function (resultst) {
- uni.navigateBack();
- },
- });
- }
- }
- });
- this.$store.state.allowLoading = true;
- },
- getNoteList() {
- let self = this;
- self.noteList = [];
- let data = {
- courseId: this.courseId,
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- };
- if (this.playSectionId > 0) {
- data.sectionId = this.playSectionId;
- }
- this.$api.noteList(data).then((res) => {
- if (res.data.code == 200) {
- self.noteList = res.data.rows;
- }
- });
- },
- delAnswer(answerId) {
- let self = this;
- let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
- this.$api.delAnswer(data).then((res) => {
- if (res.data.code == 200) {
- self.getAnswerList();
- }
- });
- },
- clearCtx() {
- this.placeholder = "您可以在这里输入答疑内容";
- this.ctxValue = "";
- this.assignUserId = 0;
- },
- focusNote(event) {
- this.bottomHeight = event.detail.height
- },
- blurNote() {
- this.bottomHeight = 0
- },
- blur() {
- this.bottomHeight = 0
- this.clearTimer = setTimeout(() => {
- this.ctxValue = ""
- this.isFocus = false;
- this.assignUserId = 0;
- this.placeholder = '您可以在这里输入答疑内容';
- },2000)
- },
- replyContent(item) {
- this.isFocus = true;
- this.assignUserId = item.userId;
- this.placeholder = "@" + item.realname;
- },
- delContent(item) {
- this.delAnswer(item.answerId);
- },
- postAnswer() {
- let self = this;
- let data = {
- courseId: this.courseId,
- answerText: this.ctxValue,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- };
- if (this.assignUserId > 0) {
- data.assignUserId = this.assignUserId;
- }
- this.$api.postAnswer(data).then((res) => {
- if (res.data.code == 200) {
- this.$u.toast("发布成功");
- self.getAnswerList();
- this.isFocus = false;
- this.placeholder = "您可以在这里输入答疑内容";
- this.ctxValue = "";
- this.assignUserId = 0;
- }
- });
- },
- postContent() {
- if (!this.ctxValue || this.ctxValue == "") {
- this.$u.toast("请输入内容");
- return;
- }
- this.postAnswer();
- },
- postStudyRecord(status = 0, sectionId = this.playSectionId) {
- // console.log('学习记录接口的playSectionId', sectionId);
- let currentTime = 0;
- let PlayDuration = 0;
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- if (polyvPlayerContext) {
- currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
- PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
- }
- if (this.playChannelId > 0) {
- currentTime = 2; //直播无法获取,无论开始结束都传2秒
- }
- let self = this;
- let data = {
- fromPlat: 1, //来源平台 1小程序 2网站
- photo: self.ossAvatarUrl,
- sectionId: sectionId || 0,
- goodsId: parseInt(self.goodsId),
- courseId: parseInt(self.courseId),
- orderGoodsId: this.orderGoodsId,
- studyDuration: parseInt(
- PlayDuration > 0 ? PlayDuration : self.studyDuration
- ),
- gradeId: parseInt(self.gradeId),
- chapterId: this.chapterId || 0,
- moduleId: this.moduleId || 0,
- videoCurrentTime: parseInt(
- currentTime > 0 ? currentTime : self.studyDuration
- ),
- };
- if (this.ossAvatarUrl) {
- data.similarity = this.compareFaceData // 相似度
- }
- if (status > 0) {
- data.status = status;
- }
- // console.log("提交接口:", data,'sectionId:', sectionId,'chapterId:', self.chapterId,'moduleId:', self.moduleId, 'courseId:', this.courseId);
- this.$api.studyRecord(data).then((res) => {
- if (res.data.code == 200) {
- if (status > 0) {
- this.studyRecordMenuAllList()
- let moduleId = this.moduleId || 0;
- let chapterId = this.chapterId || 0;
- let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
- let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
- uni.$emit("playNext" + playNextIdisRebuild, {
- fromRebuild: this.isRebuild,
- }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
- uni.$emit("playNext" + playNextId); //通知播放结束
- }
- self.ossAvatarUrl = "";
- } else {
- this.uploadLock = false;
- uni.showToast({
- icon: "none",
- title: res.data.msg,
- });
- }
- }).catch(err => {
- this.studyRecordMenuAllList()
- })
- },
- uploadFile(options, int) {
- var self = this;
- return new Promise((resolve, reject) => {
- var data = {
- imageStatus: int,
- gradeId: this.gradeId,
- orderGoodsId: this.orderGoodsId,
- };
- self.$api.aliyunpolicy(data).then((res) => {
- if (res.data.code != 200) {
- self.$method.showToast("签名错误" + JSON.stringify(res.data));
- return;
- }
- var ossToken = res.data.data.resultContent;
- if (ossToken.host == null || ossToken.host == undefined) {
- self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
- return;
- }
- uni.uploadFile({
- url: ossToken.host,
- name: "file",
- filePath: options,
- fileType: "image",
- header: {
- AuthorizationToken: "WX " + uni.getStorageSync("token"),
- },
- formData: {
- key: ossToken.dir,
- OSSAccessKeyId: ossToken.accessid,
- policy: ossToken.policy,
- Signature: ossToken.signature,
- callback: ossToken.callback,
- success_action_status: 200,
- },
- success: (result) => {
- // if (result.statusCode === 200) {
- this.$u.toast('上传成功')
- self.ossAvatarUrl = ossToken.dir;
- resolve();
- // } else {
- // uni.showToast({
- // title: "上传失败",
- // icon: "none",
- // });
- // this.openPhoto();
- // return;
- // }
- },
- fail: (error) => {
- uni.showToast({
- title: "上传接口报错,请重新拍照上传" + error,
- icon: "none",
- });
- this.openPhoto();
- return;
- },
- });
- });
- });
- },
- imageInfos() {
- var self = this;
- return new Promise((resolve, reject) => {
- uni.getImageInfo({
- src: self.avatarUrl,
- success: async (res) => {
- let canvasWidth = res.width; //图片原始长宽
- let canvasHeight = res.height;
- if (canvasWidth > 2000 || canvasHeight > 2000) {
- uni.compressImage({
- src: self.avatarUrl,
- quality: 75,
- width: "35%",
- height: "35%",
- success: async (rest) => {
- const waitUpload = await self.uploadFile(
- rest.tempFilePath,
- 0
- );
- resolve(waitUpload);
- },
- });
- } else if (canvasWidth > 1000 || canvasHeight > 1000) {
- uni.compressImage({
- src: self.avatarUrl,
- quality: 75,
- width: "50%",
- height: "50%",
- success: async (rest) => {
- const waitUpload = await self.uploadFile(
- rest.tempFilePath,
- 0
- );
- resolve(waitUpload);
- },
- });
- } else {
- const waitUpload = await self.uploadFile(self.avatarUrl, 0);
- resolve(waitUpload);
- }
- },
- fail: (err) => {
- this.$u.toast('图片上传失败')
- }
- });
- });
- },
- timeEvent() {
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- if (polyvPlayerContext != null) {
- this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
- // console.log('拍照啊', 789, this.photoHistoryList, 'this.photoList:', this.photoList)
- //判断是否需要拍照
- if (this.photoNum > 0) {
- this.configPhoto();
- let photoTime = 0; //获取拍照秒数
- for (let i = 0; i < this.photoList.length; i++) {
- photoTime = Number(this.photoList[i]); //获取拍照秒数
- if (photoTime < this.playTime && photoTime > this.playTime - 8) {
- //3秒区间内才触发拍照,避免拉动滚动条
- if (
- this.photoHistoryList.indexOf(i) < 0 &&
- this.sectionItem.learning != 1
- ) {
- //不存在拍照历史,没有重修过,没有学过,则拍照
- //启动拍照
- //暂停
- polyvPlayerContext.exitFullScreen();
- polyvPlayerContext.pause();
- if (uni.getStorageSync('tabkePhotoShow')) {
- this.photoIndex = i;
- this.openPhoto();
- } else {
- this.popupPhotoShow = true
- uni.setStorageSync('tabkePhotoShow', 1) // 本地缓存用来判断是否已经弹出过弹窗
- }
-
- }
- }
- }
- }
- }
- },
- closeToast() {
- clearTimeout(this.toastTimer);
- this.videoToastShow = false;
- },
- restart() {
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- polyvPlayerContext.seek(0);
- clearTimeout(this.toastTimer);
- this.videoToastShow = false;
- },
- // 新增用户视频学习日志
- studyLog() {
- this.$http({
- url: '/user/study/log',
- method: 'post',
- data: {
- goodsId: this.goodsId,
- courseId: this.courseId,
- moduleId: this.moduleId || 0,
- chapterId: this.chapterId || 0,
- sectionId: this.playSectionId || 0,
- fromPlat: 1, //来源平台 1小程序 2PC网站
- goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
- orderGoodsId: this.orderGoodsId,
- }
- }).then((res) => {
- })
- },
- onStateChange(newstate, oldstate) {
- console.log('视频的开始播放事件', newstate.detail.newstate, this.needSeek)
- if (newstate.detail.newstate == "playing") {
- if (this.needSeek) {
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- if (this.recordObj.videoCurrentTime) {
- polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
- this.seekTime = this.$method.secondToDate(
- this.recordObj.videoCurrentTime
- );
- this.videoToastShow = true;
- this.toastTimer = setTimeout(() => {
- this.videoToastShow = false;
- }, 3000);
- } else {
- polyvPlayerContext.seek(1); //避免相同节继续播放
- }
- polyvPlayerContext.play();
- this.needSeek = false;
- // 新增用户视频学习日志
- this.studyLog()
- // 提交学习记录
- }
- //开始播放
- if (this.timer) {
- clearInterval(this.timer);
- }
- this.timer = setInterval(this.timeEvent, 1000); //定时器
- }
- if (newstate.detail.newstate == "pause") {
- clearInterval(this.timer);
- //暂停提交记录
- /* this.ossAvatarUrl = ""
- this.postStudyRecord() */
- }
- if (newstate.detail.newstate == "ended") {
- clearInterval(this.timer);
- uni.showToast({
- icon: "none",
- title: "播放完毕",
- });
- this.hasStart = false;
- this.postStudyRecord(1);
- this.nextSection()
- // uni.$emit('playNext') //播放重修下一节
-
- }
- },
- //播放下一节
- nextSection(){
- // console.log("放完了",this.menuAllList)
- if(!this.menuAllList.length){
- return
- }
- // console.log('this.sectionId:', this.sectionId, 'this.chapterId:', this.chapterId, 'this.moduleId:', this.moduleId);
- this.curPlayIndex = this.menuAllList.findIndex((item) => {
- let i_sectionId = item.sectionId || 0
- let i_chapterId = item.chapterId || 0
- let i_moduleId = item.moduleId || 0
- return i_sectionId == this.playSectionId && i_chapterId == this.chapterId && i_moduleId == this.moduleId
- })
- // console.log('查找到的curItem:', this.curPlayIndex);
- let data = this.menuAllList[this.curPlayIndex+1];
- if (!data) {
- //第二个弹窗
- uni.showModal({
- title: '温馨提示',
- content: '当前最后一节视频已学完 请检查所有章节是否学习完成?',
- showCancel: false,
- success: (res) => {
- if (res.confirm) {
- }
- }
- })
- } else {
- uni.showModal({
- title: '温馨提示',
- content: '当前节视频已学完,继续学习下一节?',
- success: async (res) => {
- if (res.confirm) {
- console.log("放下一个", data)
- this.moduleId = data.moduleId
- this.chapterId = data.chapterId
- this.sectionId = data.sectionId
- if(data.sectionType == 1) { //录播
- this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
- this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
- this.sectionItem = data;
- await this.getPhotoLastRecord() // 获取拍照历史
- this.playVideo(data)
- } else if(data.sectionType == 2) { //直播
- this.studyRecordGetLastLive();
- } else if(data.sectionType == 3) { //回放
- this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
- this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
- this.sectionItem = data
- this.playVideo(data)
- }
- let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
- this.$store.commit("updatePlayNextId", playNextId);
- this.updateChapterOpen(true)
- this.reStart = false
- this.getMenuList()
- }
- }
- })
- }
- },
- //拍照
- openPhoto() {
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- if (polyvPlayerContext) {
- polyvPlayerContext.exitFullScreen();
- }
- this.enableAutoRotation = false;
- this.photoPopup = true;
- this.isTaking = true;
- uni.setKeepScreenOn({
- keepScreenOn: true,
- });
- uni.authorize({
- scope: "scope.camera",
- success() {},
- });
- },
- /**
- * 人脸匹配
- */
- faceRecognition() {
- return new Promise((resolve) => {
- let fileSystem = uni.getFileSystemManager();
- fileSystem.readFile({
- filePath: `${this.avatarUrl}`,
- encoding: "base64",
- position: 0,
- success: (res) => {
- let base64 = "data:image/jpg;base64," + res.data;
- console.log('base64Data人脸识别参数:', {
- imageA: base64,
- orderGoodsId: this.orderGoodsId,
- gradeId: this.gradeId,
- })
-
- let timer = setTimeout(() => {
- uni.showToast({
- icon: "none",
- title: '拍照超时,请重新拍照',
- duration: 2000,
- success: () => {
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- }
- })
- }, 10 * 1000)
- this.$api
- .faceCertificationCompareFace({
- imageA: base64,
- orderGoodsId: this.orderGoodsId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- clearTimeout(timer)
- console.log(res, "人脸识别成功res");
- resolve(res.data.data);
- }).catch((err) => {
- clearTimeout(timer)
- // 当前网络延迟,
- console.log('人脸识别错误:', err)
- uni.showModal({
- content: "当前网络延迟",
- showCancel: false,
- success: (resultst) => {
- if (resultst.confirm) {
- uni.navigateBack()
- }
- },
- })
- })
- },
- fail(err) {
- // this.$u.toast('人脸识别错误!')
- console.error(err, "err-----人脸识别错误");
- },
- });
- });
- },
- // 确定拍照
- async submit() {
- console.log('this.uploadLock的值:', this.uploadLock)
- if (this.uploadLock) {
- return;
- }
- this.uploadLock = true;
- let compareFaceData = await this.faceRecognition();
- console.log(compareFaceData,'compareFaceData')
- this.compareFaceData = compareFaceData
- if (compareFaceData >= 80) {
- const waitYS = await this.imageInfos();
- this.postCoursePhotoRecord()
- .then((res) => {
- this.photoHistoryList.push(this.photoIndex);
- this.postStudyRecord(); //提交记录
- //恢复播放
- uni.setKeepScreenOn({
- keepScreenOn: false,
- });
- this.photoPopup = false;
- this.uploadLock = false;
- this.enableAutoRotation = true;
- var polyvPlayerContext = this.selectComponent("#playerVideo");
- if (polyvPlayerContext != null) {
- polyvPlayerContext.play();
- }
- })
- .catch((err) => {
- uni.showToast({
- title: "上传接口报错,请重新拍照上传" + err,
- icon: "none",
- });
- this.uploadLock = false;
- this.openPhoto();
- });
- } else {
- uni.showToast({
- title: "人脸匹配不通过,请重新拍照上传",
- icon: "none",
- duration: 2000,
- });
-
- setTimeout(() => {
- this.uploadLock = false;
- this.openPhoto();
- }, 2000);
- }
- },
- reTake() {
- this.isTaking = true;
- },
- toTakePhoto() {
- this.popupPhotoShow = false
- this.openPhoto()
- },
- takePhTips() {
- this.popupPhotoShow = true
- this.isTaking = false
- this.photoPopup = false
- this.enableAutoRotation = false
- },
- //确认拍照
- takePhoto() {
- var self = this;
- const ctx = uni.createCameraContext();
- ctx.takePhoto({
- quality: "high",
- success: (res) => {
- self.avatarUrl = res.tempImagePath;
- this.isTaking = false;
- },
- fail: (err) => {
- },
- });
- },
- playError(e) {
- console.log(e);
- },
- //拍照报错
- error(e) {
- console.log(e.detail);
- },
- //关闭相机
- closePhoto() {
- this.photoPopup = false;
- self.enableAutoRotation = true;
- },
- /**
- * 进入全屏
- */
- fullscreenchange(event) {
- if (event.detail.direction == "vertical") {
- this.navShow = true;
- } else if (event.detail.direction == "horizontal") {
- this.navShow = false;
- }
- },
- getGoodsDetail() {
- let self = this;
- // '/goods/'+ data,
- this.$api.goodsDetail(this.goodsId).then((res) => {
- this.goodsData = res.data.data;
- if(self.goodsData.buyNote) {
- this.baseHandoutTipList()
- }
- self.gradeId = self.goodsData.gradeId;
- this.courseBusiness(this.goodsData.businessId);
- this.courseHandouts();
- self.getMenuList();
- self.getReMenuList(); //获取重修目录
- setTimeout(function () {
- if (!self.needProfileModal) {
- self.getGradeInfo();
- }
- }, 500);
- //获取节笔记
- this.getNoteList();
- if (self.goodsData.goodsPlayConfig) {
- self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
- if (self.goodsPlayConfig.autoPlay > 0) {
- self.autoplay = true;
- }
- if (self.goodsPlayConfig.drag > 0) {
- self.isAllowSeek = "yes";
- }
- if (self.goodsPlayConfig.speed > 0) {
- self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
- }
- }
- if (self.goodsData.goodsPhotographConfig) {
- self.goodsPhotographConfig = JSON.parse(
- self.goodsData.goodsPhotographConfig
- );
- if (self.goodsPhotographConfig.photoNum > 0) {
- self.photoNum = self.goodsPhotographConfig.photoNum;
- // console.log(self.photoNum, 777777);
- }
- }
- });
- },
- startVideo() {
- this.startStatus = true;
- },
- getAnswerList() {
- let self = this;
- this.$api
- .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
- .then((res) => {
- if (res.data.code == 200) {
- self.answerList = res.data.rows;
- }
- });
- },
- getReMenuList() {
- // console.log('重修的目录');
- let self = this;
- this.$api
- .reMenuList({
- orderGoodsId: this.orderGoodsId,
- courseId: this.courseId,
- rebuild: 1,
- gradeId: this.gradeId,
- })
- .then((res) => {
- if (res.data.code == 200) {
- for (let i = 0; i < res.data.rows.length; i++) {
- let item = res.data.rows[i];
- item.down = true;
- item.id = item.menuId;
- item.name = item.menuName;
- }
- self.reMenuList = res.data.rows;
- if (self.reMenuList.length > 0) {
- this.showNotes = false;
- self.list = [
- {
- name: "目录",
- },
- {
- name: "讲义",
- },
- {
- name: "笔记",
- },
- {
- name: "答疑",
- },
- { name: "重修目录" },
- ];
- this.current = 0;
- if (Object.keys(this.sectionItem).length) {
- let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
- this.$store.commit("updatePlayNextId", playNextIdisRebuild);
- }
- } else {
- if (Object.keys(this.sectionItem).length) {
- let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
- this.$store.commit("updatePlayNextId", playNextId);
- }
-
- self.list = [
- {
- name: "目录",
- },
- {
- name: "讲义",
- },
- {
- name: "笔记",
- },
- {
- name: "答疑",
- },
- ];
- this.current = 0;
- }
- }
- });
- },
- getMenuList() {
- // console.log('menuList的目录');
- let self = this;
- // /course/menuList 查询课程目录结构列表
- this.$api
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
- .then((res) => {
- if (res.data.code == 200) {
- for (let i = 0; i < res.data.rows.length; i++) {
- let item = res.data.rows[i];
- item.down = true;
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- }
- self.menuList = res.data.rows;
- this.reStart = true
- for (let i = 0; i < res.data.rows.length; i++) {
- if (res.data.rows[i].type == 1) {
- // 模块
- if (Object.keys(this.sectionItem).length) {
- if (res.data.rows[i].menuId == this.sectionItem.moduleId) {
- this.menuIndex = [i];
- break;
- }
- } else {
- this.menuIndex = [i];
- break;
- }
-
- } else if (res.data.rows[i].type == 2) {
- // 章
- if (Object.keys(this.sectionItem).length) {
- if (res.data.rows[i].menuId == this.sectionItem.chapterId && (!this.sectionItem.moduleId || this.sectionItem.moduleId == 0)) {
- this.menuIndex = [i];
- break;
- }
- } else {
- this.menuIndex = [i];
- break;
- }
-
- }
- }
- console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
- }
- });
- },
- courseDetail() {
- let self = this;
- // '/course/'+data,
- this.$api.courseDetail(this.courseId).then((res) => {
- if (res.data.code == 200) {
- // if (res.data.data.educationName == "继续教育") {
- this.$api
- .lockLockAction({
- action: "jxjy",
- uuid:this.$method.getUuid()
- })
- .then((res) => {});
- this.lockTimer = setInterval(() => {
- this.$api
- .lockLockAction({
- action: "jxjy",
- uuid:this.$method.getUuid()
- })
- .then((res) => {});
- }, 10000);
- // websocket.sendMsg("doCourse");
- // }
- self.detail = res.data.data;
- }
- });
- },
- open(item) {
- item.showChildren = !item.showChildren;
- },
- change(index) {
- this.current = index;
- },
- openDocument() {
- this.downLoading = true
- let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
- uni.downloadFile({
- url: url,
- success: (res) => {
- var filePath = res.tempFilePath;
- uni.openDocument({
- filePath: filePath,
- showMenu: this.courseHandoutsData.canDownload == 1 ? true : false,
- success: (res) => {
- this.downLoading = false
- uni.setStorageSync('current', this.current)
- },
- fail: (err) => {
- this.downLoading = false
- uni.showToast({
- icon: "none",
- title: "文档地址错误",
- });
- },
- });
- },
- fail: (err) => {
- this.downLoading = false
- uni.showModal({
- title: "提示",
- content: "文档错误," + err.errMsg,
- showCancel: false,
- });
- },
- });
- },
- clickMulu() {
- this.muluStyle = !this.muluStyle
- }
- },
- };
- </script>
- <style lang="scss" scope>
- @import './css/detail.scss';
- .top {
- &__header {
- position:relative;
- width:100%;
- height:150rpx;
- padding:24rpx 150rpx 24rpx 24rpx;
-
- .img {
- position:absolute;
- left:0;
- top:0;
- width:100%;
- }
-
- .note {
- position:relative;
- z-index: 10;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #EFDBFF;
- }
-
- .title {
- position:relative;
- z-index: 10;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- }
-
- }
- }
- #top {
- position: relative;
- z-index: 99;
- }
- .polyv_detail {
- display: flex;
- flex-direction: column;
- height: 100vh;
- position: relative;
- top: 0;
- left: 0;
- .pops {
- position: absolute;
- top: 0;
- left: 0;
- background: #ccc;
- opacity: 0.5;
- width: 100%;
- height: 300rpx;
- z-index: 9999;
- }
- .box {
- flex: 1;
- overflow: hidden;
- margin: 16rpx 16rpx 100rpx 16rpx;
- .box_in {
- height: 100%;
- }
- }
- .first_ml {
- margin: 16rpx 16rpx 16rpx 16rpx;
- }
- }
- .btnSet {
- width: 440rpx;
- height: 80rpx;
- background: #007aff;
- border-radius: 40rpx;
- color: #ffffff;
- font-size: 28rpx;
- line-height: 80rpx;
- }
- .btnReply {
- width: 80rpx;
- height: 40rpx;
- background: #e3f0ff;
- border-radius: 16rpx;
- text-align: center;
- color: #007aff;
- }
- .btnDel {
- width: 80rpx;
- height: 40rpx;
- background: #ffedf0;
- border-radius: 16rpx;
- text-align: center;
- color: #ff2d55;
- }
- .btnReply {
- width: 80rpx;
- height: 40rpx;
- background: #e3f0ff;
- border-radius: 16rpx;
- font-size: 24rpx;
- }
- .lecture-box {
- display: flex;
- align-items: center;
- height: 80rpx;
- background: #ffffff;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- .title {
- padding: 10rpx;
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- color: #333;
- font-weight: bold;
- font-size: 32rpx;
- }
- .btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 80rpx;
- height: 80rpx;
- background: #ffffff;
- box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- }
- @keyframes rotation{
- from {-webkit-transform: rotate(0deg);}
- to {-webkit-transform: rotate(360deg);}
- }
- .loading_down {
- transform: rotate(360deg);
- animation: rotation 3s linear infinite;
- }
-
- }
- .lecture-content {
- background: #fff;
- margin-top: 10rpx;
- padding: 10rpx;
- border-radius: 16rpx;
- }
- .photoBox {
- width: 100%;
- // background-color: #ffffff;
- // border-radius: 24px 24px 0px 0px;
- .photoTop {
- width: 100%;
- height: 74rpx;
- border-radius: 20px 20px 0px 0px;
- background-color: #ffffff;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0rpx 38rpx;
- .sqzz {
- width: 28rpx;
- height: 28rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .centersq {
- color: #333;
- font-size: 30rpx;
- font-weight: 500;
- }
- }
- .photoCenter {
- width: 750rpx;
- height: 75vh;
- position: relative;
- .center_camera {
- width: 100%;
- height: 75vh;
- position: fixed;
- .head_take {
- width: 100%;
- height: 75vh;
- display: flex;
- flex-direction: column;
- }
- .headTake_up {
- width: 100%;
- height: 100rpx;
- }
- .headTake_minddle {
- display: flex;
- .min_img {
- width: 500rpx;
- height: 550rpx;
- }
- .min_left, .min_right {
- flex: 1;
- height: 550rpx;
- }
- }
- .headTake_down {
- width: 100%;
- flex: 1;
- }
- .color {
- background-color: #333;
- opacity: 0.5;
- }
- }
- .custom {
- width: 750rpx;
- height: 75vh;
- position: absolute;
- z-index: 1000;
- top: 0;
- left: 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .btns {
- display: flex;
- .takePhoto_btn {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- background: #A9A7A9;
- padding: 40rpx 26rpx;
- .middle_btn {
- width: 120rpx;
- height: 120rpx;
- border-radius: 40rpx;
- border: 4rpx solid #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .square {
- width: 96rpx;
- height: 96rpx;
- background: #FFFFFF;
- border-radius: 28rpx;
- }
- .rights {
- font-size: 32rpx;
- font-weight: 500;
- color: #FFFFFF;
- }
- }
- .btnResult {
- height: 100rpx;
- flex: 1;
- background-color: #07c160;
- text-align: center;
- line-height: 100rpx;
- color: #fff;
- font-size: 32rpx;
- font-weight: bold;
- }
- }
- }
- .chat_box {
- display: flex;
- padding: 20rpx;
- justify-content: space-between;
- }
- .chat3 {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- margin-top: 10rpx;
- }
- .chat2 {
- font-size: 20rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- margin-top: 10rpx;
- }
- .chat1 {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .leftPadding {
- margin-left: 8rpx;
- }
- .t2Content {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #999999;
- line-height: 48rpx;
- }
- .tBox2 {
- display: flex;
- padding-top: 10rpx;
- color: #333333;
- font-size: 30rpx;
- font-weight: 400;
- }
- .tBox {
- display: flex;
- align-items: center;
- padding-top: 10rpx;
- }
- .title {
- font-size: 24rpx;
- color: #999999;
- }
- .Answering {
- .answer_item {
- &:nth-child(2) {
- border-radius: 16rpx 16rpx 0rpx 0rpx;
- }
- &:nth-last-child(1) {
- border-radius: 0rpx 0rpx 16rpx 16rpx;
- }
- }
- }
- .inputBottom {
- position: fixed;
- left: 0;
- bottom: 0;
- background: #ffffff;
- height: 98rpx;
- display: flex;
- align-items: center;
- width: 100%;
- .flex_auto {
- flex: 1;
- margin-left: 10%;
- // .input {
- // height: 60rpx;
- // }
- }
- .btn {
- color: #007aff;
- font-size: 30rpx;
- font-weight: bold;
- width: 15%;
- text-align: center;
- }
- .input {
- background: rgba(244, 244, 244, 0.98);
- height: 60rpx;
- border-radius: 24rpx;
- margin-top: 12rpx;
- }
- }
- .noteBox {
- width: 100%;
- background: #ffffff;
- padding: 0rpx 10rpx 20rpx;
- border-radius: 16rpx;
- overflow: hidden;
- .left_ti {
- padding-top: 14rpx;
- }
- }
- .dateBox {
- width: 216rpx;
- height: 48rpx;
- background: #ffffff;
- border-radius: 24rpx;
- font-size: 24rpx;
- color: #666666;
- text-align: center;
- line-height: 48rpx;
- margin: 16rpx 0rpx 8rpx;
- }
- .t_content1 {
- color: #007aff;
- margin-left: 10rpx;
- }
- .tag1 {
- border: 2rpx solid #007aff;
- border-radius: 8rpx;
- font-size: 20rpx;
- color: #007aff;
- padding: 5rpx;
- }
- .b_title {
- color: #333333;
- font-size: 30rpx;
- font-weight: bold;
- }
- page {
- background: #eaeef1;
- }
- .menuBox {
- width: 100%;
- background: #ffffff;
- border-radius: 16rpx;
- padding: 0rpx 20rpx;
- margin-bottom: 20rpx;
- }
- .btnspric {
- border-top: 1rpx solid #eee;
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 108rpx;
- padding-left: 43rpx;
- padding-right: 32rpx;
- }
- .btnspric > .lefprL {
- font-size: 36rpx;
- color: #0c141f;
- font-weight: bold;
- }
- .btnspric > .lefprR {
- padding: 0rpx 24rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- color: #fff;
- background: #32467b;
- border-radius: 24rpx;
- box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
- }
- .yhj,
- .hdyhj {
- padding: 24rpx 29rpx 24rpx 34rpx;
- }
- .yhj {
- border-bottom: 16rpx solid #f9f9f9;
- }
- .yhjtit {
- font-size: 30rpx;
- color: #0c141f;
- font-weight: 500;
- margin-bottom: 14rpx;
- }
- .yhjList {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 14rpx;
- }
- .yhjList > .yhjLefts {
- display: flex;
- align-items: center;
- }
- .yhjLefts > .yhl {
- color: #32467b;
- font-size: 30rpx;
- margin-right: 31rpx;
- }
- .yhjLefts > .yhbq {
- font-size: 24rpx;
- color: #ff9500;
- border-radius: 18rpx;
- background-color: rgba(255, 149, 0, 0.2);
- border: 2rpx solid #ff9500;
- height: 38rpx;
- line-height: 38rpx;
- padding: 0rpx 16rpx;
- }
- .ts {
- font-size: 24rpx;
- color: #999;
- margin: 14rpx 0rpx;
- padding-right: 29rpx;
- padding-left: 34rpx;
- }
- .yh {
- padding-top: 20rpx;
- }
- .yh > .yhtitle {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-right: 29rpx;
- padding-left: 34rpx;
- }
- .priceBxs {
- display: flex;
- align-items: center;
- }
- .priceBxs > .pricleft {
- border-radius: 24rpx;
- border: 1rpx solid #e91313;
- background-color: rgba(233, 19, 19, 0.1);
- padding: 0rpx 18rpx;
- height: 49rpx;
- line-height: 49rpx;
- text-align: center;
- font-size: 30rpx;
- font-weight: 500;
- color: #e91313;
- margin-right: 13rpx;
- }
- .topBox {
- padding: 32rpx 32rpx 24rpx;
- border-bottom: 1rpx solid #eeeeee;
- }
- .topBox > .boldFonstType {
- font-weight: 500;
- font-size: 30rpx;
- margin: 16rpx 0rpx 23rpx;
- }
- .topBox > .firstTopL {
- display: flex;
- align-items: center;
- }
- .topBox > .firstTopL > .imageBs {
- width: 331rpx;
- height: 160rpx;
- border-radius: 6rpx;
- overflow: hidden;
- margin-right: 8rpx;
- box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
- }
- .topBox > .firstTopL > .imageBs > image {
- width: 100%;
- height: 100%;
- }
- .topBox > .firstTopL > .textBs {
- font-size: 30rpx;
- font-weight: bold;
- color: #0c141f;
- }
- .content {
- padding: 24rpx;
- text-align: left;
- }
- .catalogBox {
- display: flex;
- align-items: center;
- flex-wrap: nowrap;
- overflow-x: auto;
- padding-left: 38rpx;
- max-height: 305rpx;
- overflow-y: auto;
- transition: all 0.4s;
- }
- .catalogBox > .catalogA {
- min-width: 200rpx;
- height: 48rpx;
- line-height: 48rpx;
- // text-align: center;
- border: 2rpx solid transparent;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- word-break: break-all;
- border-radius: 10rpx;
- background: rgba(22, 119, 255, 0.05);
- padding-left: 19rpx;
- box-sizing: border-box;
- padding-right: 15rpx;
- margin-right: 16rpx;
- margin-bottom: 20rpx;
- margin-top: 15rpx;
- font-size: 24rpx;
- color: #666;
- }
- .catalogBox > .activesq {
- border-color: #1677ff;
- }
- .changeCatalogBox {
- display: block;
- }
- .catalogBox::-webkit-scrollbar {
- display: none; /* Chrome Safari */
- }
- .price_t2 {
- font-size: 18rpx;
- font-family: PingFang SC;
- font-weight: 500;
- text-decoration: line-through;
- color: #999999;
- }
- .price_t1 {
- font-size: 33rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #e91313;
- }
- .sc_t {
- font-size: 22rpx;
- color: #000000;
- }
- .sc {
- width: 29rpx;
- height: 29rpx;
- }
- .buy {
- width: 138rpx;
- height: 48rpx;
- line-height: 48rpx;
- background: #32467b;
- border-radius: 10rpx;
- color: #ffffff;
- font-size: 28rpx;
- text-align: center;
- vertical-align: middle;
- position: absolute;
- right: 30rpx;
- }
- .video_body {
- padding-bottom: 96rpx;
- }
- .footer_tab {
- position: fixed;
- bottom: 0;
- height: 96rpx;
- width: 100%;
- background-color: #ffffff;
- }
- .tj_box {
- width: 50%;
- display: inline-block;
- text-align: center;
- margin: 10rpx 0;
- }
- .teacher_t {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #666666;
- line-height: 36rpx;
- margin-left: 15rpx;
- }
- .teacher_img {
- width: 87rpx;
- height: 129rpx;
- }
- .t2 {
- font-size: 24rpx;
- font-family: PingFang SC;
- color: #666666;
- line-height: 36rpx;
- margin: 15rpx;
- }
- .r_t2 {
- width: 201rpx;
- height: 49rpx;
- background: rgba(22, 119, 255, 0.05);
- border: 1rpx solid #32467b;
- border-radius: 16rpx;
- color: #666666;
- font-size: 23rpx;
- text-align: center;
- display: flex;
- align-items: center;
- padding: 5rpx;
- }
- .scroll_box {
- width: 100%;
- height: 60rpx;
- background: #ffffff;
- box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
- white-space: nowrap;
- overflow: hidden;
- margin: 15rpx 0;
- }
- .r_sliper {
- padding: 0 20rpx;
- }
- .top_line {
- width: 6rpx;
- height: 22rpx;
- background: #32467b;
- margin-right: 10rpx;
- }
- .video_t2 {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- .video_play {
- position: absolute;
- width: 95rpx;
- height: 95rpx;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- }
- .video_box {
- position: relative;
- #playerVideo {
- position: relative;
- z-index: 99;
- }
- .video-toast {
- position: absolute;
- width: 686rpx;
- height: 80rpx;
- background: rgba(0, 0, 0, 0.6);
- border-radius: 24rpx;
- bottom: 100rpx;
- left: 50%;
- transform: translateX(-50%);
- color: #fff;
- display: flex;
- font-size: 26rpx;
- align-items: center;
- overflow: visible;
- &__text {
- flex: 1;
- margin-left: 40rpx;
- }
- &__btn {
- width: 180rpx;
- text-align: center;
- border-left: 1rpx solid #fff;
- }
- }
- .video-toast__close {
- position: absolute;
- right: 32rpx;
- bottom: 184rpx;
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- text-align: center;
- background: rgba(0, 0, 0, 0.6);
- border-radius: 50%;
- color: rgba(255, 255, 255, 0.3);
- }
-
- }
- .rotoct {
- transform: rotate(90deg);
- }
- .slot-content {
- padding: 0 20rpx;
- }
- .notice_modal {
- .content {
- width: 100%;
- height: 100%;
- padding: 56rpx 56rpx 56rpx 64rpx;
- .title {
- color: #222;
- line-height: 40rpx;
- font-size: 36rpx;
- text-align: center;
- font-weight: bold;
- margin-bottom: 24rpx;
- }
- .text {
- height: 340rpx;
- line-height: 40rpx;
- text-indent: 2em;
- font-size: 32rpx;
- color: #222;
- }
- .had_read {
- width: 100%;
- height: 88rpx;
- line-height: 88rpx;
- text-align: center;
- background: #3577E8;
- border-radius: 240rpx;
- font-size: 32rpx;
- font-weight: 500;
- color: #fff;
- margin-top: 20rpx;
- &.gray {
- background: #BBBEC5;
- }
- }
- }
- }
- .full_mulu {
- position: absolute;
- top: 100rpx;
- right: 20rpx;
- width: 700rpx;
- height: 515rpx;
- color: #333;
- display: flex;
- align-items: center;
- justify-content: space-between;
- z-index: 99999;
- .mulus {
- width: 623rpx;
- // height: 515rpx;
- height: 400rpx;
- overflow-y: scroll;
- // overflow: scroll;
- }
- .mulu_box_in {
- background-color: #b7b7b7;
- border-radius: 16rpx;
- // transition: all 0.5s;
- &::after {
- content: "";
- width: 0;
- height: 0;
- position: absolute;
- top: 235rpx;
- right: 27px;
- border-top: 16rpx solid transparent;
- border-right: 16rpx solid transparent;
- border-left: 16rpx solid #b7b7b7;
- border-bottom: 16rpx solid transparent;
- }
- }
- .mulu_box_out {
- // visibility: hidden;
- display: none;
- }
- .menuBox_mulu {
- // width: 100%;
- background: #ffffff;
- border-radius: 16rpx;
- padding: 0rpx 20rpx;
- margin-bottom: 20rpx;
- }
- .ml_img {
- position: absolute;
- right: 0;
- top: 100rpx;
- }
- .items {
- width: 620rpx;
- height: 100rpx;
- border: 1rpx solid red;
- }
- }
-
- </style>
|