index.vue 276 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546
  1. <template>
  2. <div class="course-detail">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <div class="container">
  8. <el-breadcrumb separator="/">
  9. <el-breadcrumb-item :to="{ path: '/index' }"
  10. >首页</el-breadcrumb-item
  11. >
  12. <el-breadcrumb-item>课程详情</el-breadcrumb-item>
  13. </el-breadcrumb>
  14. </div>
  15. </div>
  16. <div class="section__body">
  17. <div class="container">
  18. <div class="course-info">
  19. <div class="course-info__header clearfix">
  20. <div
  21. class="left-box"
  22. :style="{
  23. backgroundImage: `url(${$tools.splitImgHost(
  24. goodsData.coverUrl,
  25. false
  26. )})`,
  27. }"
  28. >
  29. <div
  30. v-if="liveLast && liveLast.watchStatus == 'live'"
  31. class="live-btn"
  32. >
  33. <el-button
  34. type="primary"
  35. class="btn"
  36. @click="playVideo(liveLast)"
  37. >
  38. 进入直播
  39. </el-button>
  40. </div>
  41. <div v-show="vid" id="player"></div>
  42. <div v-show="vidzb" id="playerzb"></div>
  43. <div class="recordStyle" v-if="showRecordStatus">
  44. 您上次看到{{
  45. $tools.secondToTime(recordObj.videoCurrentTime)
  46. }},正在自动续播<span
  47. style="
  48. display: inline-block;
  49. width: 50px;
  50. text-align: center;
  51. "
  52. >|</span
  53. >
  54. <span class="btn_sty" @click="backLI">从头播放</span>
  55. </div>
  56. </div>
  57. <div class="right-box">
  58. <div class="right-box__header">
  59. <div class="title">
  60. <el-select
  61. class="select"
  62. v-model="courseId"
  63. @change="courseChange"
  64. >
  65. <el-option
  66. :label="item.courseName"
  67. :value="item.courseId"
  68. v-for="(item, index) in courseList"
  69. :key="index"
  70. ></el-option>
  71. </el-select>
  72. </div>
  73. <div class="tabs">
  74. <el-tabs v-model="courseTabIndex">
  75. <el-tab-pane
  76. :name="tab.name"
  77. v-for="(tab, index) in menuTab"
  78. :key="index"
  79. >
  80. <div slot="label">
  81. <span class="label">{{ tab.label }}</span>
  82. </div>
  83. <template v-if="tab.name == '1'">
  84. <div class="right-box__body">
  85. <div
  86. class="item"
  87. v-for="(menu, index) in menuList"
  88. :key="index"
  89. >
  90. <template v-if="menu.type == 1">
  91. <div
  92. class="item__title"
  93. @click="openModule(menu)"
  94. >
  95. <i
  96. :class="{
  97. 'el-icon-caret-right': !menu.showList,
  98. 'el-icon-caret-bottom': menu.showList,
  99. }"
  100. ></i>
  101. {{ menu.menuName }}
  102. </div>
  103. <div class="item__content">
  104. <div
  105. class="bank-chapter"
  106. v-if="menu.showList"
  107. >
  108. <div
  109. class="bank-chapter__item"
  110. v-for="(
  111. chapter, chapterIndex
  112. ) in menu.list"
  113. :key="chapterIndex"
  114. >
  115. <div
  116. class="bank-chapter__item__text"
  117. @click="openChapter(chapter)"
  118. >
  119. <i
  120. :class="{
  121. 'el-icon-caret-right':
  122. !chapter.showList,
  123. 'el-icon-caret-bottom':
  124. chapter.showList,
  125. }"
  126. ></i
  127. >{{ chapter.name }}
  128. </div>
  129. <div
  130. class="bank-section"
  131. v-if="chapter.showList"
  132. >
  133. <div
  134. class="bank-section__item"
  135. :class="{
  136. active: isActive(section),
  137. }"
  138. v-for="(
  139. section, sectionIndex
  140. ) in chapter.list"
  141. :key="sectionIndex"
  142. @click="getResource(section)"
  143. >
  144. <template v-if="section.type != 2">
  145. <template>
  146. <div
  147. class="note note--blue"
  148. v-if="
  149. section.sectionType == 1
  150. "
  151. >
  152. 录播
  153. </div>
  154. <div
  155. class="note"
  156. v-if="
  157. section.sectionType == 2
  158. "
  159. >
  160. 直播
  161. </div>
  162. <div
  163. class="note note--yellow"
  164. v-if="
  165. section.sectionType == 3
  166. "
  167. >
  168. 回放
  169. </div>
  170. <div
  171. class="
  172. bank-section__item__text
  173. "
  174. >
  175. {{ section.name }}
  176. <div
  177. style="font-size: 12px"
  178. v-if="
  179. section.liveStartTime >
  180. nowTime
  181. "
  182. >
  183. <span>{{
  184. $tools.timestampToTime(
  185. section.liveStartTime,
  186. (isDay = false)
  187. )
  188. }}</span
  189. >-
  190. <span>{{
  191. $tools.timestampToTime(
  192. section.liveEndTime,
  193. (isDay = false)
  194. )
  195. }}</span>
  196. </div>
  197. <div
  198. v-if="isLast(section)"
  199. style="
  200. font-size: 12px;
  201. color: red;
  202. "
  203. >
  204. <div
  205. v-if="
  206. liveLast.watchStatus ==
  207. 'live'
  208. "
  209. >
  210. <span>直播中</span>
  211. </div>
  212. <div
  213. v-if="
  214. liveLast.watchStatus ==
  215. 'end'
  216. "
  217. >
  218. <span
  219. >当前直播回放视频请稍后再查看</span
  220. >
  221. </div>
  222. </div>
  223. <div
  224. v-if="
  225. section.sectionType == 3
  226. "
  227. style="
  228. font-size: 12px;
  229. color: red;
  230. "
  231. >
  232. <span
  233. v-if="
  234. !section.recordingUrl
  235. "
  236. >当前直播回放视频请稍后再查看</span
  237. >
  238. <span v-else> 回放中 </span>
  239. </div>
  240. </div>
  241. </template>
  242. <!-- <template
  243. v-if="section.durationTime > 0"
  244. >
  245. <div class="during">
  246. {{
  247. $tools.secondToDate(
  248. section.durationTime
  249. )
  250. }}
  251. </div>
  252. </template> -->
  253. <!-- <template>
  254. <div
  255. class="btn"
  256. v-if="section.rebuild > 0"
  257. >
  258. 待重修
  259. </div>
  260. <template v-else>
  261. <div
  262. class="btn btn--green"
  263. v-if="section.learning == 1"
  264. >
  265. 已看完
  266. </div>
  267. </template>
  268. </template> -->
  269. <!-- <template
  270. v-if="
  271. section.liveStartTime &&
  272. section.sectionType != 3
  273. "
  274. >
  275. <div
  276. class="
  277. live-btn live-btn--blue
  278. "
  279. v-if="
  280. section.liveStartTime >
  281. nowTime
  282. "
  283. >
  284. 待开播
  285. </div>
  286. <div
  287. class="
  288. live-btn live-btn--yellow
  289. "
  290. v-if="
  291. section.liveStartTime <=
  292. nowTime &&
  293. section.liveEndTime >
  294. nowTime
  295. "
  296. >
  297. <img
  298. class="living-img"
  299. src="@/assets/living.gif"
  300. />
  301. 直播中
  302. </div>
  303. <div
  304. class="live-btn"
  305. v-if="
  306. section.liveEndTime <
  307. nowTime
  308. "
  309. >
  310. 已结束
  311. </div>
  312. </template> -->
  313. </template>
  314. <template v-if="section.type == 2">
  315. <template>
  316. <div
  317. class="test-btn"
  318. v-if="section.doType == 1"
  319. >
  320. 练习
  321. </div>
  322. <div
  323. class="test-btn"
  324. v-if="section.doType != 1"
  325. >
  326. 考试
  327. </div>
  328. </template>
  329. <div
  330. class="bank-section__item__text"
  331. >
  332. {{ section.name }}
  333. </div>
  334. <!-- <template>
  335. <div
  336. class="btn"
  337. v-if="section.rebuild > 0"
  338. >
  339. 待重修
  340. </div>
  341. <template v-else>
  342. <div
  343. class="btn btn--green"
  344. v-if="section.learning == 1"
  345. >
  346. 合格
  347. </div>
  348. <div
  349. class="btn btn--red"
  350. v-if="section.learning == 0"
  351. >
  352. 不合格
  353. </div>
  354. <div
  355. class="btn btn--green"
  356. v-if="section.rebuild > 0"
  357. >
  358. 待重测
  359. </div>
  360. </template>
  361. </template> -->
  362. </template>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. </template>
  369. <template v-if="menu.type == 2">
  370. <div class="item__content">
  371. <div class="bank-chapter">
  372. <div class="bank-chapter__item">
  373. <div
  374. class="bank-chapter__item__text"
  375. @click="openChapter(menu)"
  376. >
  377. <i
  378. :class="{
  379. 'el-icon-caret-right':
  380. !menu.showList,
  381. 'el-icon-caret-bottom':
  382. menu.showList,
  383. }"
  384. ></i
  385. >{{ menu.menuName }}
  386. </div>
  387. <div
  388. class="bank-section"
  389. v-if="menu.showList"
  390. >
  391. <div
  392. class="bank-section__item"
  393. :class="{
  394. active: isActive(section),
  395. }"
  396. v-for="(
  397. section, sectionIndex
  398. ) in menu.list"
  399. :key="sectionIndex"
  400. @click="getResource(section)"
  401. >
  402. <template v-if="section.type != 2">
  403. <template>
  404. <div
  405. class="note note--blue"
  406. v-if="
  407. section.sectionType == 1
  408. "
  409. >
  410. 录播
  411. </div>
  412. <div
  413. class="note"
  414. v-if="
  415. section.sectionType == 2
  416. "
  417. >
  418. 直播
  419. </div>
  420. <div
  421. class="note note--yellow"
  422. v-if="
  423. section.sectionType == 3
  424. "
  425. >
  426. 回放
  427. </div>
  428. </template>
  429. <div
  430. class="bank-section__item__text"
  431. >
  432. {{ section.name }}
  433. <div
  434. style="font-size: 12px"
  435. v-if="
  436. section.liveStartTime >
  437. nowTime
  438. "
  439. >
  440. <span>{{
  441. $tools.timestampToTime(
  442. section.liveStartTime,
  443. (isDay = false)
  444. )
  445. }}</span
  446. >-
  447. <span>{{
  448. $tools.timestampToTime(
  449. section.liveEndTime,
  450. (isDay = false)
  451. )
  452. }}</span>
  453. </div>
  454. <div
  455. v-if="isLast(section)"
  456. style="
  457. font-size: 12px;
  458. color: red;
  459. "
  460. >
  461. <div
  462. v-if="
  463. liveLast.watchStatus ==
  464. 'live'
  465. "
  466. >
  467. <span>直播中</span>
  468. </div>
  469. <div
  470. v-if="
  471. liveLast.watchStatus ==
  472. 'end'
  473. "
  474. >
  475. <span
  476. >当前直播回放视频请稍后再查看</span
  477. >
  478. </div>
  479. </div>
  480. <div
  481. v-if="
  482. section.sectionType == 3
  483. "
  484. style="
  485. font-size: 12px;
  486. color: red;
  487. "
  488. >
  489. <span
  490. v-if="!section.recordingUrl"
  491. >当前直播回放视频请稍后再查看</span
  492. >
  493. <span v-else>回放中</span>
  494. </div>
  495. </div>
  496. <!-- <template
  497. v-if="section.durationTime > 0"
  498. >
  499. <div class="during">
  500. {{
  501. $tools.secondToDate(
  502. section.durationTime
  503. )
  504. }}
  505. </div>
  506. </template> -->
  507. <!-- <template>
  508. <div
  509. class="btn"
  510. v-if="section.rebuild > 0"
  511. >
  512. 待重修
  513. </div>
  514. <template v-else>
  515. <div
  516. class="btn btn--green"
  517. v-if="section.learning == 1"
  518. >
  519. 已看完
  520. </div>
  521. </template>
  522. </template> -->
  523. <!-- <template
  524. v-if="
  525. section.liveStartTime &&
  526. section.sectionType != 3
  527. "
  528. >
  529. <div
  530. class="
  531. live-btn live-btn--blue
  532. "
  533. v-if="
  534. section.liveStartTime >
  535. nowTime
  536. "
  537. >
  538. 待开播
  539. </div>
  540. <div
  541. class="
  542. live-btn live-btn--yellow
  543. "
  544. v-if="
  545. section.liveStartTime <=
  546. nowTime &&
  547. section.liveEndTime >
  548. nowTime
  549. "
  550. >
  551. <img
  552. class="living-img"
  553. src="@/assets/living.gif"
  554. />
  555. 直播中
  556. </div>
  557. <div
  558. class="live-btn"
  559. v-if="
  560. section.liveEndTime <
  561. nowTime
  562. "
  563. >
  564. 已结束
  565. </div>
  566. </template> -->
  567. </template>
  568. <template v-if="section.type == 2">
  569. <template>
  570. <div
  571. class="test-btn"
  572. v-if="section.doType == 1"
  573. >
  574. 练习
  575. </div>
  576. <div
  577. class="test-btn"
  578. v-if="section.doType != 1"
  579. >
  580. 考试
  581. </div>
  582. </template>
  583. <div
  584. class="bank-section__item__text"
  585. >
  586. {{ section.name }}
  587. </div>
  588. <!-- <template>
  589. <div
  590. class="btn"
  591. v-if="section.rebuild > 0"
  592. >
  593. 待重修
  594. </div>
  595. <template v-else>
  596. <div
  597. class="btn btn--green"
  598. v-if="section.learning == 1"
  599. >
  600. 合格
  601. </div>
  602. <div
  603. class="btn btn--red"
  604. v-if="section.learning == 0"
  605. >
  606. 不合格
  607. </div>
  608. <div
  609. class="btn btn--green"
  610. v-if="section.rebuild > 0"
  611. >
  612. 待重测
  613. </div>
  614. </template>
  615. </template> -->
  616. </template>
  617. </div>
  618. </div>
  619. </div>
  620. </div>
  621. </div>
  622. </template>
  623. <template v-if="menu.type == 3">
  624. <div class="item__content">
  625. <div class="bank-section">
  626. <div
  627. class="bank-section__item"
  628. :class="{
  629. active: isActive(menu),
  630. }"
  631. @click="getResource(menu)"
  632. >
  633. <template>
  634. <div
  635. class="note note--blue"
  636. v-if="menu.sectionType == 1"
  637. >
  638. 录播
  639. </div>
  640. <div
  641. class="note"
  642. v-if="menu.sectionType == 2"
  643. >
  644. 直播
  645. </div>
  646. <div
  647. class="note note--yellow"
  648. v-if="menu.sectionType == 3"
  649. >
  650. 回放
  651. </div>
  652. <div class="bank-section__item__text">
  653. {{ menu.name }}
  654. <div
  655. style="font-size: 12px"
  656. v-if="
  657. menu.liveStartTime > nowTime
  658. "
  659. >
  660. <span>{{
  661. $tools.timestampToTime(
  662. menu.liveStartTime,
  663. (isDay = false)
  664. )
  665. }}</span
  666. >-
  667. <span>{{
  668. $tools.timestampToTime(
  669. menu.liveEndTime,
  670. (isDay = false)
  671. )
  672. }}</span>
  673. </div>
  674. <div
  675. v-if="isLast(menu)"
  676. style="
  677. font-size: 12px;
  678. color: red;
  679. "
  680. >
  681. <div
  682. v-if="
  683. liveLast.watchStatus == 'live'
  684. "
  685. >
  686. <span>直播中</span>
  687. </div>
  688. <div
  689. v-if="
  690. liveLast.watchStatus == 'end'
  691. "
  692. >
  693. <span
  694. >当前直播回放视频请稍后再查看</span
  695. >
  696. </div>
  697. </div>
  698. <div
  699. v-if="menu.sectionType == 3"
  700. style="
  701. font-size: 12px;
  702. color: red;
  703. "
  704. >
  705. <span v-if="!menu.recordingUrl"
  706. >当前直播回放视频请稍后再查看</span
  707. >
  708. <span v-else>回放中</span>
  709. </div>
  710. </div>
  711. </template>
  712. <template v-if="menu.durationTime > 0">
  713. <!-- <div class="during">
  714. {{
  715. $tools.secondToDate(
  716. menu.durationTime
  717. )
  718. }}
  719. </div> -->
  720. </template>
  721. <template>
  722. <!-- <div
  723. class="btn"
  724. v-if="menu.rebuild > 0"
  725. >
  726. 待重修
  727. </div>
  728. <template v-else>
  729. <div
  730. class="btn btn--green"
  731. v-if="menu.learning == 1"
  732. >
  733. 已看完
  734. </div>
  735. </template> -->
  736. </template>
  737. <!-- <template
  738. v-if="
  739. menu.liveStartTime &&
  740. menu.sectionType != 3
  741. "
  742. >
  743. <div
  744. class="live-btn live-btn--blue"
  745. v-if="menu.liveStartTime > nowTime"
  746. >
  747. 待开播
  748. </div>
  749. <div
  750. class="live-btn live-btn--yellow"
  751. v-if="
  752. menu.liveStartTime <= nowTime &&
  753. menu.liveEndTime > nowTime
  754. "
  755. >
  756. <img
  757. class="living-img"
  758. src="@/assets/living.gif"
  759. />
  760. 直播中
  761. </div>
  762. <div
  763. class="live-btn"
  764. v-if="menu.liveEndTime < nowTime"
  765. >
  766. 已结束
  767. </div>
  768. </template> -->
  769. </div>
  770. </div>
  771. </div>
  772. </template>
  773. </div>
  774. </div>
  775. </template>
  776. <template v-if="tab.name == '2'">
  777. <div class="right-box__body">
  778. <div
  779. class="item"
  780. v-for="(menu, index) in reMenuList"
  781. :key="index"
  782. >
  783. <template v-if="menu.type == 1">
  784. <div
  785. class="item__title"
  786. @click="openModule(menu)"
  787. >
  788. <i
  789. :class="{
  790. 'el-icon-caret-right': !menu.showList,
  791. 'el-icon-caret-bottom': menu.showList,
  792. }"
  793. ></i>
  794. {{ menu.menuName }}
  795. </div>
  796. <div class="item__content">
  797. <div
  798. class="bank-chapter"
  799. v-if="menu.showList"
  800. >
  801. <div
  802. class="bank-chapter__item"
  803. v-for="(
  804. chapter, chapterIndex
  805. ) in menu.list"
  806. :key="chapterIndex"
  807. >
  808. <div
  809. class="bank-chapter__item__text"
  810. @click="openChapter(chapter)"
  811. >
  812. <i
  813. :class="{
  814. 'el-icon-caret-right':
  815. !chapter.showList,
  816. 'el-icon-caret-bottom':
  817. chapter.showList,
  818. }"
  819. ></i
  820. >{{ chapter.name }}
  821. </div>
  822. <div
  823. class="bank-section"
  824. v-if="chapter.showList"
  825. >
  826. <div
  827. class="bank-section__item"
  828. :class="{
  829. active: isActive(section),
  830. }"
  831. v-for="(
  832. section, sectionIndex
  833. ) in chapter.list"
  834. :key="sectionIndex"
  835. @click="getResource(section)"
  836. >
  837. <template v-if="section.type != 2">
  838. <template>
  839. <div
  840. class="note note--blue"
  841. v-if="
  842. section.sectionType == 1
  843. "
  844. >
  845. 录播
  846. </div>
  847. <div
  848. class="note"
  849. v-if="
  850. section.sectionType == 2
  851. "
  852. >
  853. 直播
  854. </div>
  855. <div
  856. class="note note--yellow"
  857. v-if="
  858. section.sectionType == 3
  859. "
  860. >
  861. 回放
  862. </div>
  863. <div
  864. class="
  865. bank-section__item__text
  866. "
  867. >
  868. {{ section.name }}
  869. <div
  870. style="font-size: 12px"
  871. v-if="
  872. section.liveStartTime >
  873. nowTime
  874. "
  875. >
  876. <span>{{
  877. $tools.timestampToTime(
  878. section.liveStartTime,
  879. (isDay = false)
  880. )
  881. }}</span
  882. >-
  883. <span>{{
  884. $tools.timestampToTime(
  885. section.liveEndTime,
  886. (isDay = false)
  887. )
  888. }}</span>
  889. </div>
  890. </div>
  891. </template>
  892. <!-- <template
  893. v-if="section.durationTime > 0"
  894. >
  895. <div class="during">
  896. {{
  897. $tools.secondToDate(
  898. section.durationTime
  899. )
  900. }}
  901. </div>
  902. </template> -->
  903. <!-- <template>
  904. <div
  905. class="btn"
  906. v-if="section.rebuild > 0"
  907. >
  908. 待重修
  909. </div>
  910. <template v-else>
  911. <div
  912. class="btn btn--green"
  913. v-if="section.learning == 1"
  914. >
  915. 已看完
  916. </div>
  917. </template>
  918. </template> -->
  919. <!-- <template
  920. v-if="
  921. section.liveStartTime &&
  922. section.sectionType != 3
  923. "
  924. >
  925. <div
  926. class="
  927. live-btn live-btn--blue
  928. "
  929. v-if="
  930. section.liveStartTime >
  931. nowTime
  932. "
  933. >
  934. 待开播
  935. </div>
  936. <div
  937. class="
  938. live-btn live-btn--yellow
  939. "
  940. v-if="
  941. section.liveStartTime <=
  942. nowTime &&
  943. section.liveEndTime >
  944. nowTime
  945. "
  946. >
  947. 直播中
  948. </div>
  949. <div
  950. class="live-btn"
  951. v-if="
  952. section.liveEndTime <
  953. nowTime
  954. "
  955. >
  956. 已结束
  957. </div>
  958. </template> -->
  959. </template>
  960. <template v-if="section.type == 2">
  961. <template>
  962. <div
  963. class="test-btn"
  964. v-if="section.doType == 1"
  965. >
  966. 练习
  967. </div>
  968. <div
  969. class="test-btn"
  970. v-if="section.doType != 1"
  971. >
  972. 考试
  973. </div>
  974. </template>
  975. <div
  976. class="bank-section__item__text"
  977. >
  978. {{ section.name }}
  979. </div>
  980. <!-- <template>
  981. <div
  982. class="btn"
  983. v-if="section.rebuild > 0"
  984. >
  985. 待重修
  986. </div>
  987. <template v-else>
  988. <div
  989. class="btn btn--green"
  990. v-if="section.learning == 1"
  991. >
  992. 合格
  993. </div>
  994. <div
  995. class="btn btn--red"
  996. v-if="section.learning == 0"
  997. >
  998. 不合格
  999. </div>
  1000. <div
  1001. class="btn btn--green"
  1002. v-if="section.rebuild > 0"
  1003. >
  1004. 待重测
  1005. </div>
  1006. </template>
  1007. </template> -->
  1008. </template>
  1009. </div>
  1010. </div>
  1011. </div>
  1012. </div>
  1013. </div>
  1014. </template>
  1015. <template v-if="menu.type == 2">
  1016. <div class="item__content">
  1017. <div class="bank-chapter">
  1018. <div class="bank-chapter__item">
  1019. <div
  1020. class="bank-chapter__item__text"
  1021. @click="openChapter(menu)"
  1022. >
  1023. <i
  1024. :class="{
  1025. 'el-icon-caret-right':
  1026. !menu.showList,
  1027. 'el-icon-caret-bottom':
  1028. menu.showList,
  1029. }"
  1030. ></i
  1031. >{{ menu.menuName }}
  1032. </div>
  1033. <div
  1034. class="bank-section"
  1035. v-if="menu.showList"
  1036. >
  1037. <div
  1038. class="bank-section__item"
  1039. :class="{
  1040. active: isActive(section),
  1041. }"
  1042. v-for="(
  1043. section, sectionIndex
  1044. ) in menu.list"
  1045. :key="sectionIndex"
  1046. @click="getResource(section)"
  1047. >
  1048. <template v-if="section.type != 2">
  1049. <template>
  1050. <div
  1051. class="note note--blue"
  1052. v-if="
  1053. section.sectionType == 1
  1054. "
  1055. >
  1056. 录播
  1057. </div>
  1058. <div
  1059. class="note"
  1060. v-if="
  1061. section.sectionType == 2
  1062. "
  1063. >
  1064. 直播
  1065. </div>
  1066. <div
  1067. class="note note--yellow"
  1068. v-if="
  1069. section.sectionType == 3
  1070. "
  1071. >
  1072. 回放
  1073. </div>
  1074. </template>
  1075. <div
  1076. class="bank-section__item__text"
  1077. >
  1078. {{ section.name }}
  1079. <div
  1080. style="font-size: 12px"
  1081. v-if="
  1082. section.liveStartTime >
  1083. nowTime
  1084. "
  1085. >
  1086. <span>{{
  1087. $tools.timestampToTime(
  1088. section.liveStartTime,
  1089. (isDay = false)
  1090. )
  1091. }}</span
  1092. >-
  1093. <span>{{
  1094. $tools.timestampToTime(
  1095. section.liveEndTime,
  1096. (isDay = false)
  1097. )
  1098. }}</span>
  1099. </div>
  1100. </div>
  1101. <!-- <template
  1102. v-if="section.durationTime > 0"
  1103. >
  1104. <div class="during">
  1105. {{
  1106. $tools.secondToDate(
  1107. section.durationTime
  1108. )
  1109. }}
  1110. </div>
  1111. </template> -->
  1112. <!-- <template>
  1113. <div
  1114. class="btn"
  1115. v-if="section.rebuild > 0"
  1116. >
  1117. 待重修
  1118. </div>
  1119. <template v-else>
  1120. <div
  1121. class="btn btn--green"
  1122. v-if="section.learning == 1"
  1123. >
  1124. 已看完
  1125. </div>
  1126. </template>
  1127. </template> -->
  1128. <!-- <template
  1129. v-if="
  1130. section.liveStartTime &&
  1131. section.sectionType != 3
  1132. "
  1133. >
  1134. <div
  1135. class="
  1136. live-btn live-btn--blue
  1137. "
  1138. v-if="
  1139. section.liveStartTime >
  1140. nowTime
  1141. "
  1142. >
  1143. 待开播
  1144. </div>
  1145. <div
  1146. class="
  1147. live-btn live-btn--yellow
  1148. "
  1149. v-if="
  1150. section.liveStartTime <=
  1151. nowTime &&
  1152. section.liveEndTime >
  1153. nowTime
  1154. "
  1155. >
  1156. 直播中
  1157. </div>
  1158. <div
  1159. class="live-btn"
  1160. v-if="
  1161. section.liveEndTime <
  1162. nowTime
  1163. "
  1164. >
  1165. 已结束
  1166. </div>
  1167. </template> -->
  1168. </template>
  1169. <template v-if="section.type == 2">
  1170. <template>
  1171. <div
  1172. class="test-btn"
  1173. v-if="section.doType == 1"
  1174. >
  1175. 练习
  1176. </div>
  1177. <div
  1178. class="test-btn"
  1179. v-if="section.doType != 1"
  1180. >
  1181. 考试
  1182. </div>
  1183. </template>
  1184. <div
  1185. class="bank-section__item__text"
  1186. >
  1187. {{ section.name }}
  1188. </div>
  1189. <!-- <template>
  1190. <div
  1191. class="btn"
  1192. v-if="section.rebuild > 0"
  1193. >
  1194. 待重修
  1195. </div>
  1196. <template v-else>
  1197. <div
  1198. class="btn btn--green"
  1199. v-if="section.learning == 1"
  1200. >
  1201. 合格
  1202. </div>
  1203. <div
  1204. class="btn btn--red"
  1205. v-if="section.learning == 0"
  1206. >
  1207. 不合格
  1208. </div>
  1209. <div
  1210. class="btn btn--green"
  1211. v-if="section.rebuild > 0"
  1212. >
  1213. 待重测
  1214. </div>
  1215. </template>
  1216. </template> -->
  1217. </template>
  1218. </div>
  1219. </div>
  1220. </div>
  1221. </div>
  1222. </div>
  1223. </template>
  1224. <template v-if="menu.type == 3">
  1225. <div class="item__content">
  1226. <div class="bank-section">
  1227. <div
  1228. class="bank-section__item"
  1229. :class="{
  1230. active: isActive(menu),
  1231. }"
  1232. @click="getResource(menu)"
  1233. >
  1234. <template>
  1235. <div
  1236. class="note note--blue"
  1237. v-if="menu.sectionType == 1"
  1238. >
  1239. 录播
  1240. </div>
  1241. <div
  1242. class="note"
  1243. v-if="menu.sectionType == 2"
  1244. >
  1245. 直播
  1246. </div>
  1247. <div
  1248. class="note note--yellow"
  1249. v-if="menu.sectionType == 3"
  1250. >
  1251. 回放
  1252. </div>
  1253. <div class="bank-section__item__text">
  1254. {{ menu.name }}
  1255. <div
  1256. style="font-size: 12px"
  1257. v-if="
  1258. menu.liveStartTime > nowTime
  1259. "
  1260. >
  1261. <span>{{
  1262. $tools.timestampToTime(
  1263. menu.liveStartTime,
  1264. (isDay = false)
  1265. )
  1266. }}</span
  1267. >-
  1268. <span>{{
  1269. $tools.timestampToTime(
  1270. menu.liveEndTime,
  1271. (isDay = false)
  1272. )
  1273. }}</span>
  1274. </div>
  1275. </div>
  1276. </template>
  1277. <template v-if="menu.durationTime > 0">
  1278. <!-- <div class="during">
  1279. {{
  1280. $tools.secondToDate(
  1281. menu.durationTime
  1282. )
  1283. }}
  1284. </div> -->
  1285. </template>
  1286. <template>
  1287. <!-- <div
  1288. class="btn"
  1289. v-if="menu.rebuild > 0"
  1290. >
  1291. 待重修
  1292. </div>
  1293. <template v-else>
  1294. <div
  1295. class="btn btn--green"
  1296. v-if="menu.learning == 1"
  1297. >
  1298. 已看完
  1299. </div>
  1300. </template> -->
  1301. </template>
  1302. <!-- <template
  1303. v-if="
  1304. menu.liveStartTime &&
  1305. menu.sectionType != 3
  1306. "
  1307. >
  1308. <div
  1309. class="live-btn live-btn--blue"
  1310. v-if="menu.liveStartTime > nowTime"
  1311. >
  1312. 待开播
  1313. </div>
  1314. <div
  1315. class="live-btn live-btn--yellow"
  1316. v-if="
  1317. menu.liveStartTime <= nowTime &&
  1318. menu.liveEndTime > nowTime
  1319. "
  1320. >
  1321. 直播中
  1322. </div>
  1323. <div
  1324. class="live-btn"
  1325. v-if="menu.liveEndTime < nowTime"
  1326. >
  1327. 已结束
  1328. </div>
  1329. </template> -->
  1330. </div>
  1331. </div>
  1332. </div>
  1333. </template>
  1334. </div>
  1335. </div>
  1336. </template>
  1337. </el-tab-pane>
  1338. </el-tabs>
  1339. </div>
  1340. </div>
  1341. </div>
  1342. </div>
  1343. <div class="course-info__body">
  1344. <el-tabs v-model="activeName">
  1345. <el-tab-pane
  1346. v-for="(item, index) in tabList"
  1347. :key="index"
  1348. :name="item.name"
  1349. :label="item.label"
  1350. >
  1351. <template v-if="item.label == '学员须知'">
  1352. <div class="course-menu clearfix">
  1353. <div class="left-box">
  1354. <div class="left-box__body">
  1355. <div
  1356. class="buy-note"
  1357. v-html="
  1358. goodsData.buyNote &&
  1359. goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
  1360. "
  1361. ></div>
  1362. </div>
  1363. </div>
  1364. <div class="right-box">
  1365. <div class="title">
  1366. 推荐课程
  1367. <a class="more" @click="go('/course-list')"
  1368. >更多></a
  1369. >
  1370. </div>
  1371. <ul class="list">
  1372. <li
  1373. class="course-item"
  1374. v-for="(itemy, index) in compyRecommend(
  1375. recommendList.goodsList
  1376. )"
  1377. :key="index"
  1378. >
  1379. <GoodsItem :item="itemy"></GoodsItem>
  1380. <!-- <div
  1381. class="course-item__img"
  1382. :style="`background-image:url(${$tools.splitImgHost(
  1383. itemy.coverUrl,
  1384. true
  1385. )})`"
  1386. @click="toGoodsDetail(itemy)"
  1387. >
  1388. <div class="note" v-if="itemy.year">
  1389. {{ itemy.year }}
  1390. </div>
  1391. </div>
  1392. <div class="course-item__title">
  1393. {{ itemy.goodsName }}
  1394. </div>
  1395. <div class="course-item__desc">
  1396. <div class="price">
  1397. ¥{{ itemy.standPrice }}
  1398. </div>
  1399. <a
  1400. class="add"
  1401. @click.stop="addCart(true, itemy.goodsId)"
  1402. >加购物车</a
  1403. >
  1404. </div> -->
  1405. </li>
  1406. </ul>
  1407. </div>
  1408. </div>
  1409. </template>
  1410. <template v-if="item.label == '课程答疑'">
  1411. <div class="answer-question">
  1412. <div class="answer-question__header clearfix">
  1413. <div class="textarea-wrap">
  1414. <el-input
  1415. class="textarea"
  1416. v-model="textarea"
  1417. rows="3"
  1418. type="textarea"
  1419. placeholder=""
  1420. ></el-input>
  1421. </div>
  1422. <el-button
  1423. type="primary"
  1424. class="submit"
  1425. @click="addAnswer"
  1426. >提出疑问</el-button
  1427. >
  1428. </div>
  1429. <div class="answer-question__body">
  1430. <div class="question-list">
  1431. <div
  1432. v-if="answerList.length == 0"
  1433. style="text-align: center"
  1434. >
  1435. 暂无记录
  1436. </div>
  1437. <div
  1438. class="question-list__item"
  1439. v-for="(item, index) in answerList"
  1440. :key="index"
  1441. >
  1442. <div class="question-list__item__avatar">
  1443. <img
  1444. v-if="item.assignRealname"
  1445. :src="$tools.splitImgHost(item.assignAvatar)"
  1446. alt=""
  1447. />
  1448. <img
  1449. v-else
  1450. :src="$tools.splitImgHost(item.avatar)"
  1451. alt=""
  1452. />
  1453. </div>
  1454. <div class="question-list__item__content">
  1455. <div class="nickname">
  1456. {{ item.realname }}
  1457. </div>
  1458. <div class="desc">
  1459. {{ item.answerText }}
  1460. </div>
  1461. <div class="time">
  1462. {{
  1463. $tools.timestampToTime(
  1464. item.createTime,
  1465. false
  1466. )
  1467. }}
  1468. <div
  1469. class="del"
  1470. v-if="item.userId !== userInfo.userId"
  1471. @click="answerBack(item)"
  1472. >
  1473. <el-button type="text">回复</el-button>
  1474. </div>
  1475. <div
  1476. class="del"
  1477. @click="del(item)"
  1478. v-if="item.userId === userInfo.userId"
  1479. >
  1480. 删除
  1481. </div>
  1482. </div>
  1483. <div
  1484. class="reply-list"
  1485. v-if="
  1486. item.newArraysAnswerList &&
  1487. item.newArraysAnswerList.length
  1488. "
  1489. >
  1490. <div
  1491. class="reply-list__item"
  1492. v-for="(
  1493. items, indexs
  1494. ) in item.newArraysAnswerList"
  1495. :key="indexs"
  1496. >
  1497. <div class="reply-list__item__avatar">
  1498. <img
  1499. :src="$tools.splitImgHost(items.avatar)"
  1500. alt=""
  1501. />
  1502. </div>
  1503. <div class="reply-list__item__content">
  1504. <div class="nickname">
  1505. {{ items.realname }}
  1506. </div>
  1507. <div class="desc">
  1508. 回复
  1509. <span
  1510. style="
  1511. margin: 0px 4px;
  1512. color: #409eff;
  1513. "
  1514. >@{{ items.assignRealname }}</span
  1515. >
  1516. {{ items.answerText }}
  1517. </div>
  1518. <div class="time">
  1519. {{
  1520. $tools.timestampToTime(
  1521. items.createTime,
  1522. false
  1523. )
  1524. }}
  1525. <div
  1526. class="del"
  1527. @click="del(items)"
  1528. v-if="
  1529. items.userId === userInfo.userId
  1530. "
  1531. >
  1532. 删除
  1533. </div>
  1534. <div
  1535. class="reply"
  1536. v-if="
  1537. items.userId !== userInfo.userId
  1538. "
  1539. @click="answerBack(items)"
  1540. >
  1541. 回复
  1542. </div>
  1543. </div>
  1544. </div>
  1545. </div>
  1546. </div>
  1547. </div>
  1548. </div>
  1549. </div>
  1550. </div>
  1551. </div>
  1552. </template>
  1553. <template v-if="item.label == '笔记讲义'">
  1554. <div class="lecture-notes">
  1555. <div class="lecture-notes__content clearfix">
  1556. <div class="left-box">
  1557. <div
  1558. class="textarea clearfix"
  1559. v-if="!(isPlayRebuild > 0) && !vidzb"
  1560. >
  1561. <el-input
  1562. resize="none"
  1563. rows="3"
  1564. v-model="textareaNote"
  1565. type="textarea"
  1566. placeholder="觉得重要的就记下来吧~"
  1567. ></el-input>
  1568. <el-button
  1569. type="primary"
  1570. class="submit"
  1571. @click="noteSubmit"
  1572. >
  1573. 提交笔记
  1574. </el-button>
  1575. </div>
  1576. <div class="note-list">
  1577. <div
  1578. v-if="noteList.length == 0"
  1579. style="text-align: center"
  1580. >
  1581. 暂无笔记
  1582. </div>
  1583. <div
  1584. class="note-list__content"
  1585. v-for="(item, index) in noteList"
  1586. :key="index"
  1587. >
  1588. <div class="note-list__content__title">
  1589. {{ $tools.timestampToTime(item.dateNote) }}
  1590. </div>
  1591. <div
  1592. class="note-list__item"
  1593. v-for="(note, index) in item.userNotes"
  1594. :key="index"
  1595. >
  1596. <i
  1597. class="el-icon-video-play"
  1598. @click="noteClick(note)"
  1599. ></i>
  1600. <div class="note-list__item__content">
  1601. <div class="title" @click="noteClick(note)">
  1602. {{ $tools.secondToDate(note.noteSecond) }}
  1603. </div>
  1604. <div class="desc">
  1605. {{ note.sectionName }}
  1606. </div>
  1607. <div class="time">{{ note.noteText }}</div>
  1608. </div>
  1609. </div>
  1610. </div>
  1611. </div>
  1612. <div class="pagination">
  1613. <el-pagination
  1614. background
  1615. layout="prev, pager, next"
  1616. :total="noteTotal"
  1617. :page-size="noteParams.pageSize"
  1618. >
  1619. </el-pagination>
  1620. </div>
  1621. </div>
  1622. <div class="right-box" v-if="courseHandoutsData">
  1623. <div class="lecture-list">
  1624. <div class="lecture-list__header">
  1625. 讲义
  1626. <div
  1627. class="slide-btn"
  1628. @click="lectureShow = !lectureShow"
  1629. >
  1630. 收起
  1631. </div>
  1632. </div>
  1633. <div
  1634. class="lecture-list__body"
  1635. v-if="lectureShow"
  1636. >
  1637. <div class="list">
  1638. <div class="list__item">
  1639. <div class="title">
  1640. {{ courseHandoutsData.handoutsName }}
  1641. </div>
  1642. <div class="btns">
  1643. <div
  1644. class="btn"
  1645. @click="
  1646. previvew(
  1647. $tools.splitImgHost(
  1648. courseHandoutsData.handoutsUrl
  1649. )
  1650. )
  1651. "
  1652. >
  1653. 预览
  1654. </div>
  1655. <div
  1656. v-if="
  1657. courseHandoutsData.canDownload == 1
  1658. ? true
  1659. : false
  1660. "
  1661. class="btn"
  1662. @click="
  1663. printView(
  1664. $tools.splitImgHost(
  1665. courseHandoutsData.handoutsUrl
  1666. )
  1667. )
  1668. "
  1669. >
  1670. 打印
  1671. </div>
  1672. <div
  1673. v-if="
  1674. courseHandoutsData.canDownload == 1
  1675. ? true
  1676. : false
  1677. "
  1678. class="btn"
  1679. @click="
  1680. download(
  1681. $tools.splitImgHost(
  1682. courseHandoutsData.handoutsUrl
  1683. ),
  1684. courseHandoutsData.urlName
  1685. )
  1686. "
  1687. >
  1688. 下载
  1689. </div>
  1690. </div>
  1691. </div>
  1692. </div>
  1693. </div>
  1694. </div>
  1695. <div class="lecture-list__footer" v-if="showPdf">
  1696. <div class="lecture-scan">
  1697. <div class="lecture-scan__header">
  1698. {{ courseHandoutsData.urlName }}
  1699. </div>
  1700. <div class="lecture-scan__body">
  1701. <pdf
  1702. class="iframe"
  1703. :src="
  1704. $tools.splitImgHost(
  1705. courseHandoutsData.handoutsUrl
  1706. )
  1707. "
  1708. v-for="i in numPages"
  1709. :key="i"
  1710. :page="i"
  1711. ref="pdf"
  1712. ></pdf>
  1713. <iframe
  1714. id="printIframe"
  1715. :src="
  1716. $tools.splitImgHost(
  1717. courseHandoutsData.handoutsUrl
  1718. )
  1719. "
  1720. frameborder="0"
  1721. style="display: none"
  1722. ></iframe>
  1723. </div>
  1724. </div>
  1725. </div>
  1726. </div>
  1727. </div>
  1728. </div>
  1729. </template>
  1730. <template v-if="item.label == '聊天'">
  1731. <div class="answer-question">
  1732. <div class="answer-question__body">
  1733. <div class="question-list">
  1734. <div
  1735. v-if="historyChatMsgList.length == 0"
  1736. style="text-align: center"
  1737. >
  1738. 暂无记录
  1739. </div>
  1740. <div
  1741. class="question-list__item"
  1742. v-for="(item, index) in historyChatMsgList"
  1743. :key="index"
  1744. >
  1745. <div class="question-list__item__avatar">
  1746. <img :src="item.user.pic" alt="" />
  1747. </div>
  1748. <div class="question-list__item__content">
  1749. <div class="nickname">
  1750. {{ item.user.nickname }}
  1751. </div>
  1752. <div class="desc">
  1753. {{ item.content }}
  1754. </div>
  1755. <div class="time">
  1756. {{ item.time | formatDate }}
  1757. </div>
  1758. </div>
  1759. </div>
  1760. </div>
  1761. </div>
  1762. </div>
  1763. </template>
  1764. </el-tab-pane>
  1765. </el-tabs>
  1766. </div>
  1767. </div>
  1768. </div>
  1769. </div>
  1770. </div>
  1771. </section>
  1772. <el-dialog
  1773. width="800px"
  1774. class="take-photo"
  1775. :visible.sync="takePhotoModal"
  1776. :close-on-click-modal="false"
  1777. :close-on-press-escape="false"
  1778. :show-close="false"
  1779. >
  1780. <div class="take-photo__content">
  1781. <!-- <div class="take-photo__close" @click="takePhotoModal = false">X</div> -->
  1782. <div class="take-photo__header">人脸验证</div>
  1783. <div class="take-photo__body clearfix">
  1784. <div class="left-box">
  1785. <div class="title">重要提示:</div>
  1786. <div class="content">
  1787. <p>1、请保证摄像头正对自己,避免头像偏左或者偏右。</p>
  1788. <p>
  1789. 2、请保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。
  1790. </p>
  1791. <p>
  1792. 3、请保证整个头像在人脸识别区域内,脸部无遮挡装饰物(佩戴眼镜会降低通过率)。
  1793. </p>
  1794. <p>
  1795. 4、如果下面视频中出现黑屏,摄像头可能被其他进程占用,请关闭其他调用摄像头的程序,重新刷新当前页面重新拍照识别。
  1796. </p>
  1797. </div>
  1798. </div>
  1799. <div class="right-box">
  1800. <img v-show="!isTaking" :src="faceUrl" alt="" />
  1801. <video v-show="isTaking" id="video" :src="stream"></video>
  1802. <div v-show="isTaking" class="mask"></div>
  1803. </div>
  1804. </div>
  1805. <div class="take-photo__footer">
  1806. <el-button
  1807. type="primary"
  1808. v-if="isTaking"
  1809. class="take"
  1810. @click="onPhoto"
  1811. >拍照</el-button
  1812. >
  1813. <el-button
  1814. type="primary"
  1815. v-if="!isTaking"
  1816. class="take"
  1817. :loading="loading"
  1818. @click="reTake"
  1819. >重拍</el-button
  1820. >
  1821. <el-button
  1822. type="primary"
  1823. v-if="!isTaking"
  1824. :loading="loading"
  1825. class="take"
  1826. @click="takeOk"
  1827. >确认</el-button
  1828. >
  1829. </div>
  1830. </div>
  1831. </el-dialog>
  1832. <el-dialog
  1833. width="996px"
  1834. height="600px"
  1835. class="info"
  1836. :visible.sync="showInfoDetailModal"
  1837. :close-on-click-modal="false"
  1838. :close-on-press-escape="false"
  1839. :show-close="false"
  1840. title="资料填写"
  1841. >
  1842. <div class="info__content">
  1843. <el-form
  1844. :model="infoForm"
  1845. ref="infoForm"
  1846. :rules="rules"
  1847. :error-type="errorType"
  1848. >
  1849. <template v-for="(item, index) in listData">
  1850. <el-form-item
  1851. :key="index"
  1852. v-if="item.fieldKey == 'name'"
  1853. :label="item.fieldName"
  1854. :required="item.required"
  1855. label-width="120px"
  1856. :disabled="true"
  1857. :prop="item.required ? item.fieldKey : ''"
  1858. >
  1859. <el-input
  1860. v-model="infoForm.name"
  1861. :disabled="disName"
  1862. :placeholder="`请输入${item.fieldName}`"
  1863. />
  1864. </el-form-item>
  1865. <el-form-item
  1866. :key="index"
  1867. v-if="item.fieldKey == 'idcard'"
  1868. :label="item.fieldName"
  1869. :required="item.required"
  1870. :disabled="true"
  1871. label-width="120px"
  1872. :prop="item.required ? item.fieldKey : ''"
  1873. >
  1874. <el-input
  1875. v-model="infoForm.idcard"
  1876. :disabled="disCard"
  1877. :placeholder="`请输入${item.fieldName}`"
  1878. />
  1879. </el-form-item>
  1880. <el-form-item
  1881. :key="index"
  1882. v-if="item.fieldKey == 'telphone'"
  1883. :disabled="true"
  1884. :label="item.fieldName"
  1885. :required="item.required"
  1886. label-width="120px"
  1887. :prop="item.required ? item.fieldKey : ''"
  1888. >
  1889. <el-input
  1890. v-model="infoForm.telphone"
  1891. :placeholder="`请输入${item.fieldName}`"
  1892. />
  1893. </el-form-item>
  1894. <el-form-item
  1895. :key="index"
  1896. v-if="item.fieldKey == 'school'"
  1897. :label="item.fieldName"
  1898. :required="item.required"
  1899. label-width="120px"
  1900. :prop="item.required ? item.fieldKey : ''"
  1901. >
  1902. <el-input
  1903. v-model="infoForm.school"
  1904. :placeholder="`请输入${item.fieldName}`"
  1905. />
  1906. </el-form-item>
  1907. <el-form-item
  1908. :key="index"
  1909. v-if="item.fieldKey == 'work_unit'"
  1910. :label="item.fieldName"
  1911. :required="item.required"
  1912. label-width="120px"
  1913. :prop="item.required ? item.fieldKey : ''"
  1914. >
  1915. <el-input
  1916. v-model="infoForm.work_unit"
  1917. :placeholder="`请输入${item.fieldName}`"
  1918. />
  1919. </el-form-item>
  1920. <el-form-item
  1921. :key="index"
  1922. v-if="item.fieldKey == 'unit_contact'"
  1923. :label="item.fieldName"
  1924. :required="item.required"
  1925. label-width="120px"
  1926. :prop="item.required ? item.fieldKey : ''"
  1927. >
  1928. <el-input
  1929. v-model="infoForm.unit_contact"
  1930. :placeholder="`请输入${item.fieldName}`"
  1931. />
  1932. </el-form-item>
  1933. <el-form-item
  1934. :key="index"
  1935. v-if="item.fieldKey == 'unit_tel'"
  1936. :label="item.fieldName"
  1937. :required="item.required"
  1938. label-width="120px"
  1939. :prop="item.required ? item.fieldKey : ''"
  1940. >
  1941. <el-input
  1942. v-model="infoForm.unit_tel"
  1943. :placeholder="`请输入${item.fieldName}`"
  1944. />
  1945. </el-form-item>
  1946. <el-form-item
  1947. :key="index"
  1948. v-if="item.fieldKey == 'apply_post'"
  1949. :label="item.fieldName"
  1950. :required="item.required"
  1951. label-width="120px"
  1952. :prop="item.required ? item.fieldKey : ''"
  1953. >
  1954. <el-input
  1955. v-model="infoForm.apply_post"
  1956. :placeholder="`请输入${item.fieldName}`"
  1957. />
  1958. </el-form-item>
  1959. <el-form-item
  1960. :key="index"
  1961. v-if="item.fieldKey == 'major'"
  1962. :label="item.fieldName"
  1963. :required="item.required"
  1964. label-width="120px"
  1965. :prop="item.required ? item.fieldKey : ''"
  1966. >
  1967. <el-input
  1968. v-model="infoForm.major"
  1969. :placeholder="`请输入${item.fieldName}`"
  1970. />
  1971. </el-form-item>
  1972. <el-form-item
  1973. :key="index"
  1974. v-if="item.inputType == 2"
  1975. :label="item.fieldName"
  1976. label-width="120px"
  1977. :required="item.required"
  1978. :prop="item.required ? item.fieldKey : ''"
  1979. >
  1980. <el-select v-model="infoForm[item.fieldKey]" placeholder="">
  1981. <el-option
  1982. v-for="(option, optionIndex) in getarrays(item.fieldKey)"
  1983. :key="optionIndex"
  1984. :label="option"
  1985. :value="optionIndex + ''"
  1986. ></el-option>
  1987. </el-select>
  1988. </el-form-item>
  1989. <el-form-item
  1990. :key="index"
  1991. v-if="item.inputType == 5"
  1992. :label="item.fieldName"
  1993. label-width="120px"
  1994. :required="item.required"
  1995. :prop="item.required ? item.fieldKey : ''"
  1996. >
  1997. <el-date-picker
  1998. v-model="infoForm[item.fieldKey]"
  1999. align="right"
  2000. type="date"
  2001. placeholder="选择日期"
  2002. >
  2003. </el-date-picker>
  2004. </el-form-item>
  2005. <el-form-item
  2006. :key="index"
  2007. v-if="
  2008. item.inputType == 3 &&
  2009. item.fieldKey !== 'commitment_electr_signature'
  2010. "
  2011. :label="item.fieldName"
  2012. :required="item.required"
  2013. label-width="120px"
  2014. label-position="top"
  2015. :prop="item.required ? item.fieldKey : ''"
  2016. >
  2017. <el-upload
  2018. action=""
  2019. :max-size="2097152"
  2020. accept="image/jpeg, image/jpg, image/png"
  2021. :show-file-list="false"
  2022. list-type="picture"
  2023. :auto-upload="false"
  2024. :ref="
  2025. item.fieldKey === 'recent_photos'
  2026. ? 'recent_photos'
  2027. : item.fieldKey === 'idcard_face_photo'
  2028. ? 'idcard_face_photo'
  2029. : item.fieldKey === 'idcard_national_photo'
  2030. ? 'idcard_national_photo'
  2031. : ''
  2032. "
  2033. :on-change="
  2034. item.fieldKey === 'recent_photos'
  2035. ? changePhotoListHeader1
  2036. : item.fieldKey === 'idcard_face_photo'
  2037. ? changePhotoListHeader2
  2038. : item.fieldKey === 'idcard_national_photo'
  2039. ? changePhotoListHeader3
  2040. : ''
  2041. "
  2042. :file-list="
  2043. item.fieldKey === 'recent_photos'
  2044. ? fileList1
  2045. : item.fieldKey === 'idcard_face_photo'
  2046. ? fileList2
  2047. : item.fieldKey === 'idcard_national_photo'
  2048. ? fileList3
  2049. : ''
  2050. "
  2051. >
  2052. <div class="upload-box">
  2053. <div
  2054. :style="
  2055. item.fieldKey === 'recent_photos'
  2056. ? 'width: 120px; height: 169px;background:url(' +
  2057. require('@/assets/info_1.png') +
  2058. ') no-repeat center;background-size:cover;position:relative;'
  2059. : item.fieldKey === 'idcard_face_photo'
  2060. ? 'width: 120px; height: 82px;background:url(' +
  2061. require('@/assets/info_2.png') +
  2062. ') no-repeat center;background-size:cover;position:relative;'
  2063. : item.fieldKey === 'idcard_national_photo'
  2064. ? 'width: 120px; height: 82px;background:url(' +
  2065. require('@/assets/info_3.png') +
  2066. ') no-repeat center;background-size:cover;position:relative;'
  2067. : ''
  2068. "
  2069. >
  2070. <i
  2071. @click="deleteImg(item)"
  2072. class="el-icon-error"
  2073. v-if="
  2074. item.fieldKey === 'recent_photos'
  2075. ? fileList1[0]
  2076. : item.fieldKey === 'idcard_face_photo'
  2077. ? fileList2[0]
  2078. : item.fieldKey === 'idcard_national_photo'
  2079. ? fileList3[0]
  2080. : ''
  2081. "
  2082. ></i>
  2083. <el-image
  2084. style="width: 100%; height: 100%"
  2085. :src="
  2086. item.fieldKey === 'recent_photos'
  2087. ? $tools.splitImgHost(fileList1[0].url)
  2088. : item.fieldKey === 'idcard_face_photo'
  2089. ? $tools.splitImgHost(fileList2[0].url)
  2090. : item.fieldKey === 'idcard_national_photo'
  2091. ? $tools.splitImgHost(fileList3[0].url)
  2092. : ''
  2093. "
  2094. v-if="
  2095. item.fieldKey === 'recent_photos'
  2096. ? fileList1[0]
  2097. : item.fieldKey === 'idcard_face_photo'
  2098. ? fileList2[0]
  2099. : item.fieldKey === 'idcard_national_photo'
  2100. ? fileList3[0]
  2101. : ''
  2102. "
  2103. :preview-src-list="
  2104. item.fieldKey === 'recent_photos'
  2105. ? [$tools.splitImgHost(fileList1[0].url)]
  2106. : item.fieldKey === 'idcard_face_photo'
  2107. ? [$tools.splitImgHost(fileList2[0].url)]
  2108. : item.fieldKey === 'idcard_national_photo'
  2109. ? [$tools.splitImgHost(fileList3[0].url)]
  2110. : ''
  2111. "
  2112. >
  2113. </el-image>
  2114. </div>
  2115. <div>
  2116. <span
  2117. v-if="item.fieldKey === 'recent_photos'"
  2118. style="color: #999999"
  2119. >竖向白底证件照 文件大小≤2M</span
  2120. >
  2121. <span
  2122. v-if="
  2123. item.fieldKey === 'idcard_face_photo' ||
  2124. item.fieldKey === 'idcard_national_photo'
  2125. "
  2126. style="color: #999999"
  2127. >
  2128. 文件大小≤2M
  2129. </span>
  2130. </div>
  2131. </div>
  2132. <div style="display: inline-block" slot="trigger">
  2133. <el-button type="primary" size="small" round
  2134. >浏览文件</el-button
  2135. >
  2136. </div>
  2137. </el-upload>
  2138. </el-form-item>
  2139. <div
  2140. :key="index"
  2141. v-if="
  2142. item.inputType == 3 &&
  2143. item.fieldKey === 'commitment_electr_signature'
  2144. "
  2145. >
  2146. <el-form-item
  2147. v-if="
  2148. item.inputType == 3 &&
  2149. item.fieldKey === 'commitment_electr_signature'
  2150. "
  2151. label="承诺书"
  2152. :required="item.required"
  2153. label-width="120px"
  2154. label-position="top"
  2155. >
  2156. <div style="line-height: 40px; text-indent: 2em">
  2157. <span>
  2158. 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
  2159. 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
  2160. </span>
  2161. <div style="line-height: 40px; text-indent: 2em">
  2162. <span>特此承诺!</span>
  2163. </div>
  2164. </div>
  2165. </el-form-item>
  2166. <el-form-item
  2167. v-if="
  2168. item.inputType == 3 &&
  2169. item.fieldKey === 'commitment_electr_signature'
  2170. "
  2171. label="签名板"
  2172. :required="item.required"
  2173. label-width="120px"
  2174. label-position="top"
  2175. :prop="item.required ? item.fieldKey : ''"
  2176. >
  2177. <div class="dis_stys">
  2178. <span style="color: #999999">请在下方签名区进行签名</span>
  2179. <el-button
  2180. type="primary"
  2181. size="small"
  2182. @click="retDraw"
  2183. mode=""
  2184. >清空</el-button
  2185. >
  2186. </div>
  2187. <div class="handCenter">
  2188. <vue-esign
  2189. v-if="!infoForm[item.fieldKey]"
  2190. ref="esign"
  2191. :width="600"
  2192. :height="300"
  2193. :isCrop="false"
  2194. :lineWidth="5"
  2195. :lineColor="'#333'"
  2196. />
  2197. <div
  2198. v-else
  2199. style="width: 100%; height: 100%; position: relative"
  2200. >
  2201. <img
  2202. style="width: 100%; height: 100%"
  2203. :src="$tools.splitImgHost(infoForm[item.fieldKey])"
  2204. mode=""
  2205. />
  2206. </div>
  2207. </div>
  2208. </el-form-item>
  2209. </div>
  2210. <el-form-item
  2211. :key="index"
  2212. v-if="item.inputType == 4"
  2213. :label="item.fieldName"
  2214. :required="item.required"
  2215. label-width="120px"
  2216. label-position="top"
  2217. :prop="item.required ? item.fieldKey : ''"
  2218. >
  2219. <el-button
  2220. type="primary"
  2221. size="small"
  2222. round
  2223. @click="downloadStamp(item)"
  2224. >下载模板</el-button
  2225. >
  2226. <el-upload
  2227. action=""
  2228. :max-size="2097152"
  2229. accept="image/jpeg, image/jpg, image/png"
  2230. :show-file-list="false"
  2231. list-type="picture"
  2232. :auto-upload="false"
  2233. ref="stamp"
  2234. :on-change="changePhotoListStamp"
  2235. :file-list="fileListStamp"
  2236. >
  2237. <div style="display: inline-block; vertical-align: top">
  2238. <div
  2239. :style="
  2240. 'width: 120px; height: 120px;background:url(' +
  2241. require('@/assets/info_4.png') +
  2242. ') no-repeat center;background-size:cover;position:relative;'
  2243. "
  2244. >
  2245. <el-image
  2246. style="width: 100%; height: 100%"
  2247. :src="$tools.splitImgHost(fileListStamp[0].url)"
  2248. v-if="fileListStamp[0]"
  2249. :preview-src-list="[
  2250. $tools.splitImgHost(fileListStamp[0].url),
  2251. ]"
  2252. >
  2253. </el-image>
  2254. </div>
  2255. <div>
  2256. <span style="color: #999999">文件大小≤2M</span>
  2257. </div>
  2258. </div>
  2259. <div style="display: inline-block" slot="trigger">
  2260. <el-button type="primary" size="small" round
  2261. >浏览文件</el-button
  2262. >
  2263. </div>
  2264. </el-upload>
  2265. </el-form-item>
  2266. </template>
  2267. </el-form>
  2268. </div>
  2269. <span slot="footer" class="dialog-footer">
  2270. <el-button
  2271. @click="
  2272. showInfoDetailModal = false;
  2273. $router.back(-1);
  2274. "
  2275. >取 消</el-button
  2276. >
  2277. <el-button type="primary" :loading="uploading" @click="submit"
  2278. >确 定</el-button
  2279. >
  2280. </span>
  2281. </el-dialog>
  2282. <el-dialog
  2283. width="996px"
  2284. height="600px"
  2285. class="info"
  2286. :visible.sync="showStampDetailModail"
  2287. :close-on-click-modal="false"
  2288. :close-on-press-escape="false"
  2289. :show-close="false"
  2290. title="资料填写"
  2291. >
  2292. <div class="info__content">
  2293. <el-form
  2294. :model="stampForm"
  2295. ref="stampForm"
  2296. :rules="stampRules"
  2297. :error-type="errorType"
  2298. >
  2299. <template v-for="(item, index) in listDataStamp">
  2300. <el-form-item
  2301. :key="index"
  2302. v-if="item.inputType == 4"
  2303. :label="item.fieldName"
  2304. :required="item.required"
  2305. label-width="120px"
  2306. label-position="top"
  2307. :prop="item.required ? item.fieldKey : ''"
  2308. >
  2309. <el-button
  2310. type="primary"
  2311. size="small"
  2312. round
  2313. @click="downloadStamp(item)"
  2314. >下载模板</el-button
  2315. >
  2316. <el-upload
  2317. action=""
  2318. :max-size="2097152"
  2319. accept="image/jpeg, image/jpg, image/png"
  2320. :show-file-list="false"
  2321. list-type="picture"
  2322. :auto-upload="false"
  2323. ref="stamp"
  2324. :on-change="changePhotoListStamp"
  2325. :file-list="fileListStamp"
  2326. >
  2327. <div style="display: inline-block; vertical-align: top">
  2328. <div
  2329. :style="
  2330. 'width: 120px; height: 120px;background:url(' +
  2331. require('@/assets/info_4.png') +
  2332. ') no-repeat center;background-size:cover;position:relative;'
  2333. "
  2334. >
  2335. <el-image
  2336. style="width: 100%; height: 100%"
  2337. :src="$tools.splitImgHost(fileListStamp[0].url)"
  2338. v-if="fileListStamp[0]"
  2339. :preview-src-list="[
  2340. $tools.splitImgHost(fileListStamp[0].url),
  2341. ]"
  2342. >
  2343. </el-image>
  2344. </div>
  2345. <div>
  2346. <span style="color: #999999">文件大小≤2M</span>
  2347. </div>
  2348. </div>
  2349. <div style="display: inline-block" slot="trigger">
  2350. <el-button type="primary" size="small" round
  2351. >浏览文件</el-button
  2352. >
  2353. </div>
  2354. </el-upload>
  2355. </el-form-item>
  2356. </template>
  2357. </el-form>
  2358. </div>
  2359. <span slot="footer" class="dialog-footer">
  2360. <el-button
  2361. @click="
  2362. showStampDetailModail = false;
  2363. $router.back(-1);
  2364. "
  2365. >取 消</el-button
  2366. >
  2367. <el-button type="primary" :loading="uploading" @click="stampSubmit"
  2368. >确 定</el-button
  2369. >
  2370. </span>
  2371. </el-dialog>
  2372. <div id="printTable"></div>
  2373. <!-- <ToolBar></ToolBar> -->
  2374. <Footer></Footer>
  2375. </div>
  2376. </template>
  2377. <script>
  2378. import Footer from "@/components/footer/index";
  2379. import Header from "@/components/header/index";
  2380. import ToolBar from "@/components/toolbar/index";
  2381. import GoodsItem from "@/components/goodsItem/index";
  2382. import * as imageConversion from "image-conversion";
  2383. import { mapGetters, mapMutations } from "vuex";
  2384. import * as baseUrls from "@/axios.js";
  2385. import pdf from "vue-pdf";
  2386. import print from "print-js";
  2387. export default {
  2388. name: "CourseDetail",
  2389. components: {
  2390. Footer,
  2391. Header,
  2392. ToolBar,
  2393. pdf,
  2394. GoodsItem,
  2395. },
  2396. filters: {
  2397. formatDate(date) {
  2398. const nDate = new Date(date);
  2399. const nyear = nDate.getFullYear();
  2400. const nmonth = (nDate.getMonth() + 1).toString().padStart(2, 0);
  2401. const nday = nDate.getDate().toString().padStart(2, 0);
  2402. const hour = nDate.getHours();
  2403. const mins = nDate.getMinutes();
  2404. const seconds = nDate.getSeconds();
  2405. return (
  2406. nyear +
  2407. "-" +
  2408. nmonth +
  2409. "-" +
  2410. nday +
  2411. " " +
  2412. hour +
  2413. ":" +
  2414. (mins >= 10 ? mins : "0" + mins) +
  2415. ":" +
  2416. (seconds >= 10 ? seconds : "0" + seconds)
  2417. );
  2418. },
  2419. },
  2420. data() {
  2421. return {
  2422. liveDuration: 0,
  2423. numPages: 0,
  2424. showPdf: false,
  2425. // 总页数
  2426. pdfPages: 10,
  2427. // 当前页数
  2428. pageNum: 1,
  2429. // 加载进度
  2430. loadedRatio: 10,
  2431. // 页面加载完成
  2432. curPageNum: 0,
  2433. // 放大系数 默认百分百
  2434. scale: 100,
  2435. // 旋转角度 ‘90’的倍数才有效
  2436. pageRotate: 0,
  2437. // 单击内部链接时触发 (目前我没有遇到使用场景)
  2438. page: 0,
  2439. bgColor: "#ccc",
  2440. answerTimer: null,
  2441. recordObj: {},
  2442. showInfoDetailModal: false,
  2443. showStampDetailModail: false,
  2444. isTaking: true, //是否正在拍照
  2445. photoConfig: false,
  2446. stream: null,
  2447. photoNum: 0,
  2448. playSectionId: 0,
  2449. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  2450. photoHistoryList: [], //已拍照历史的下标点
  2451. moduleId: 0,
  2452. chapterId: 0,
  2453. menuTab: [
  2454. {
  2455. name: "1",
  2456. label: "章节目录",
  2457. },
  2458. ],
  2459. lectureShow: true,
  2460. textarea: "",
  2461. textareaNote: "",
  2462. takePhotoModal: false,
  2463. activeName: "1",
  2464. courseId: "",
  2465. courseTabIndex: "1",
  2466. goodsId: "",
  2467. gradeId: 0,
  2468. livingTimer: null,
  2469. sectionItem: {},
  2470. gradeDetail: {},
  2471. autoplay: false,
  2472. isAllowSeek: "on",
  2473. playbackRate: false,
  2474. goodsPlayConfig: null,
  2475. playTime: 0, //页面播放时长,不含暂停
  2476. param: {
  2477. pageNum: 1,
  2478. pageSize: 100,
  2479. total: 0,
  2480. },
  2481. postTimer: null, //提交视频观看记录定时器
  2482. lockTimer: null,
  2483. courseList: [],
  2484. businessData: {},
  2485. courseHandoutsData: "",
  2486. menuList: [],
  2487. goodsData: {},
  2488. tabList: [],
  2489. historyChatMsgList: [],
  2490. vid: "",
  2491. vidzb: "",
  2492. player: "",
  2493. playerzb: "",
  2494. activeId: "", //当前选中ID
  2495. vodPlayerJs: "https://player.polyv.net/script/player.js",
  2496. playerJs:
  2497. "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
  2498. uidzb: "egsxlptzdq",
  2499. menuList: [],
  2500. reMenuList: [],
  2501. answerList: [{ newArraysAnswerList: [] }],
  2502. noteList: [],
  2503. photoList: [],
  2504. noteTotal: 0,
  2505. duration: 0,
  2506. answerTimer: null,
  2507. noteParams: {
  2508. pageNum: 1,
  2509. // pageSize: 4,
  2510. },
  2511. ossAvatarUrl: "", //照片地址
  2512. nowTime: 0,
  2513. faceUrl: "",
  2514. loading: null,
  2515. listData: [],
  2516. listDataStamp: [],
  2517. remark: "",
  2518. remarkStatus: false,
  2519. remarkStamp: "",
  2520. remarkStatusStamp: false,
  2521. errorType: ["message"],
  2522. stampForm: {
  2523. commitment_seal: "",
  2524. },
  2525. infoForm: {
  2526. name: "",
  2527. sex: "",
  2528. idcard: "",
  2529. telphone: "",
  2530. education: "",
  2531. school: "",
  2532. graduation_time: "",
  2533. work_unit: "",
  2534. unit_contact: "",
  2535. unit_tel: "",
  2536. apply_post: "",
  2537. major: "",
  2538. working_years: "",
  2539. recent_photos: "",
  2540. idcard_face_photo: "",
  2541. idcard_national_photo: "",
  2542. commitment_electr_signature: "",
  2543. commitment_seal: "",
  2544. },
  2545. recommendList: [],
  2546. rules: {
  2547. name: [
  2548. {
  2549. required: true,
  2550. message: "请输入姓名",
  2551. trigger: ["change", "blur"],
  2552. },
  2553. ],
  2554. sex: [
  2555. {
  2556. required: true,
  2557. message: "请选择性别",
  2558. trigger: "change",
  2559. },
  2560. ],
  2561. idcard: [
  2562. {
  2563. required: true,
  2564. message: "请输入身份证号",
  2565. trigger: ["change", "blur"],
  2566. },
  2567. {
  2568. validator: (rule, value, callback) => {
  2569. let IDRe18 =
  2570. /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
  2571. let IDre15 =
  2572. /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
  2573. if (!IDRe18.test(value) && !IDre15.test(value)) {
  2574. return callback(new Error("请输入格式正确的身份证号"));
  2575. } else {
  2576. return callback();
  2577. }
  2578. },
  2579. message: "请输入格式正确的身份证号",
  2580. trigger: ["change", "blur"],
  2581. },
  2582. ],
  2583. telphone: [
  2584. {
  2585. required: true,
  2586. message: "请输入手机号码",
  2587. trigger: ["change", "blur"],
  2588. },
  2589. {
  2590. validator: (rule, value, callback) => {
  2591. var reg_tel =
  2592. /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  2593. if (reg_tel.test(value)) {
  2594. return callback();
  2595. } else {
  2596. return callback(new Error("手机号码不正确"));
  2597. }
  2598. },
  2599. trigger: ["change", "blur"],
  2600. },
  2601. ],
  2602. education: [
  2603. {
  2604. required: true,
  2605. message: "请选择学历",
  2606. trigger: "change",
  2607. },
  2608. ],
  2609. school: [
  2610. {
  2611. required: true,
  2612. message: "请输入毕业院校",
  2613. trigger: ["change", "blur"],
  2614. },
  2615. ],
  2616. graduation_time: [
  2617. {
  2618. required: true,
  2619. message: "请选择毕业时间",
  2620. trigger: "change",
  2621. },
  2622. ],
  2623. work_unit: [
  2624. {
  2625. required: true,
  2626. message: "请输入工作单位",
  2627. trigger: ["change", "blur"],
  2628. },
  2629. ],
  2630. unit_contact: [
  2631. {
  2632. required: true,
  2633. message: "请输入单位联系人",
  2634. trigger: ["change", "blur"],
  2635. },
  2636. ],
  2637. unit_tel: [
  2638. {
  2639. required: true,
  2640. message: "请输入单位联系电话",
  2641. trigger: ["change", "blur"],
  2642. },
  2643. {
  2644. validator: (rule, value, callback) => {
  2645. var reg_tel =
  2646. /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  2647. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  2648. var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
  2649. if (
  2650. reg_tel.test(value) ||
  2651. vartest.test(value) ||
  2652. vartest1.test(value)
  2653. ) {
  2654. return callback();
  2655. } else {
  2656. return callback(new Error("单位联系电话不正确"));
  2657. }
  2658. },
  2659. trigger: ["change", "blur"],
  2660. },
  2661. ],
  2662. apply_post: [
  2663. {
  2664. required: true,
  2665. message: "请输入报名岗位",
  2666. trigger: ["change", "blur"],
  2667. },
  2668. ],
  2669. major: [
  2670. {
  2671. required: true,
  2672. message: "请输入所学专业",
  2673. trigger: ["change", "blur"],
  2674. },
  2675. ],
  2676. working_years: [
  2677. {
  2678. required: true,
  2679. message: "请选择工作年限",
  2680. trigger: "change",
  2681. },
  2682. ],
  2683. recent_photos: [
  2684. {
  2685. required: true,
  2686. message: "请上传证件照",
  2687. trigger: ["change", "blur"],
  2688. },
  2689. ],
  2690. idcard_face_photo: [
  2691. {
  2692. required: true,
  2693. message: "请上传身份证人像面",
  2694. trigger: ["change", "blur"],
  2695. },
  2696. ],
  2697. idcard_national_photo: [
  2698. {
  2699. required: true,
  2700. message: "请上传身份证国徽面",
  2701. trigger: ["change", "blur"],
  2702. },
  2703. ],
  2704. commitment_electr_signature: [
  2705. {
  2706. required: true,
  2707. message: "请签写承诺书电子签",
  2708. trigger: ["change", "blur"],
  2709. },
  2710. ],
  2711. commitment_seal: [
  2712. {
  2713. required: true,
  2714. message: "请上传承诺书盖章",
  2715. trigger: ["change", "blur"],
  2716. },
  2717. ],
  2718. },
  2719. stampRules: {
  2720. commitment_seal: [
  2721. {
  2722. required: true,
  2723. message: "请上传承诺书盖章",
  2724. trigger: ["change", "blur"],
  2725. },
  2726. ],
  2727. },
  2728. fileList1: [], //证件照
  2729. fileList2: [], //人像
  2730. fileList3: [], //国徽
  2731. fileListStamp: [], //印章
  2732. dictObj: null,
  2733. isRequired: false,
  2734. uploading: false,
  2735. veryIdCard: "",
  2736. veryIdName: "",
  2737. isPlayRebuild: false,
  2738. showRecordStatus: false,
  2739. hasStart: false,
  2740. needOpen: true, //是否需要展开第一章节
  2741. menuIndex: [],
  2742. clickLock: false,
  2743. liveLast: null,
  2744. disName: false, // 姓名是否禁止输入
  2745. disCard: false, // 身份证是否禁止输入
  2746. clickSectionItem: {}, // 点击节的内容
  2747. compareFaceData: 0, // 拍照匹配相似度
  2748. };
  2749. },
  2750. computed: {
  2751. ...mapGetters(["userInfo"]),
  2752. compyRecommend: function () {
  2753. return function (array) {
  2754. let ary = [];
  2755. if (array) {
  2756. for (let i = 0; i < array.length; i++) {
  2757. if (i >= 5) {
  2758. break;
  2759. } else {
  2760. ary.push(array[i]);
  2761. }
  2762. }
  2763. }
  2764. return ary;
  2765. };
  2766. },
  2767. },
  2768. // beforeDestroy() {
  2769. // this.player.destroy();
  2770. // },
  2771. async mounted() {
  2772. this.courseId = +this.$route.query.courseId || "";
  2773. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  2774. this.goodsId = this.$route.params.goodsId;
  2775. this.orderGoodsId = this.$route.query.orderGoodsId;
  2776. this.gradeId = this.$route.query.gradeId || 0;
  2777. this.sectionItem = this.$route.query;
  2778. this.dictList();
  2779. // this.userConfirmInfoDetail().then((res) => {
  2780. // this.getbaseprofiletplists().then(async (res) => {
  2781. // let allMenuList = await this.studyRecordMenuAllList();
  2782. // let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  2783. // let liveMenu = allMenuList.filter((item) => {
  2784. // //获取直播中的视频
  2785. // if (
  2786. // item.type == 3 &&
  2787. // item.liveStartTime <= nowTime &&
  2788. // item.liveEndTime > nowTime
  2789. // ) {
  2790. // return true;
  2791. // } else {
  2792. // return false;
  2793. // }
  2794. // });
  2795. // let earlyTime = 0;
  2796. // if (liveMenu && liveMenu.length) {
  2797. // earlyTime = liveMenu[0].liveStartTime;
  2798. // }
  2799. await this.courseCourseList();
  2800. if (this.sectionItem.recordingUrl) {
  2801. let noteSecond = this.$route.query.noteSecond;
  2802. if (noteSecond > 0) {
  2803. let item = {
  2804. sectionId: this.$route.query.sectionId,
  2805. recordingUrl: this.$route.query.recordingUrl,
  2806. noteSecond: noteSecond,
  2807. studyDuration: noteSecond,
  2808. moduleId: this.$route.query.moduleId,
  2809. chapterId: this.$route.query.chapterId,
  2810. };
  2811. this.playSectionId = this.$route.query.sectionId;
  2812. setTimeout(() => {
  2813. this.noteClick(item);
  2814. }, 1000);
  2815. }
  2816. } else {
  2817. console.log("------");
  2818. this.studyRecordQueryLiveLast();
  2819. }
  2820. // let noteSecond = this.$route.query.noteSecond;
  2821. // if (noteSecond > 0) {
  2822. // let item = {
  2823. // sectionId: this.$route.query.sectionId,
  2824. // recordingUrl: this.$route.query.recordingUrl,
  2825. // noteSecond: noteSecond,
  2826. // studyDuration: noteSecond,
  2827. // moduleId: this.$route.query.moduleId,
  2828. // chapterId: this.$route.query.chapterId,
  2829. // };
  2830. // this.sectionItem = item;
  2831. // this.playSectionId = this.$route.query.sectionId;
  2832. // setTimeout(() => {
  2833. // this.noteClick(item);
  2834. // }, 1000);
  2835. // }
  2836. // });
  2837. // });
  2838. },
  2839. beforeDestroy() {
  2840. clearInterval(this.answerTimer);
  2841. clearInterval(this.postTimer);
  2842. clearInterval(this.livingTimer);
  2843. try {
  2844. this.$msgbox.close();
  2845. } catch (err) {}
  2846. if (this.playSectionId && this.hasStart) {
  2847. this.postStudyRecord();
  2848. }
  2849. // if (this.lockTimer) {
  2850. // clearInterval(this.lockTimer);
  2851. // this.$request
  2852. // .lockDelLock({
  2853. // action: "jxjy",
  2854. // })
  2855. // .then((res) => {});
  2856. // }
  2857. this.clears();
  2858. this.player.destroy();
  2859. // clearInterval(this.answerTimer);
  2860. // clearInterval(this.postTimer);
  2861. // clearInterval(this.livingTimer);
  2862. },
  2863. methods: {
  2864. ...mapMutations(["getCartCount"]),
  2865. isLast(item) {
  2866. if (this.liveLast) {
  2867. let sectionASame =
  2868. this.liveLast.sectionId == (item.sectionId || item.menuId);
  2869. let chapterSame = this.liveLast.chapterId == (item.chapterId || 0);
  2870. let moduleSame = this.liveLast.moduleId == (item.moduleId || 0);
  2871. return sectionASame && chapterSame && moduleSame;
  2872. } else {
  2873. return false;
  2874. }
  2875. },
  2876. /**
  2877. * 获取上次观看的直播
  2878. */
  2879. studyRecordGetLastLive() {
  2880. this.$request
  2881. .studyRecordGetLastLive({
  2882. orderGoodsId: this.orderGoodsId,
  2883. courseId: this.courseId,
  2884. })
  2885. .then((res) => {
  2886. if (res.data) {
  2887. res.data.sectionType = 2;
  2888. this.liveLast = res.data;
  2889. }
  2890. });
  2891. },
  2892. studyRecordQueryLiveLast() {
  2893. this.$request
  2894. .studyRecordQueryLiveLast({
  2895. orderGoodsId: this.orderGoodsId,
  2896. courseId: this.courseId,
  2897. })
  2898. .then((res) => {
  2899. console.log(res, "couse");
  2900. if (res.data) {
  2901. if (res.data.sectionType == 1) {
  2902. //录播
  2903. this.chapterId = res.data.chapterId;
  2904. this.moduleId = res.data.moduleId;
  2905. this.playSectionId = res.data.sectionId;
  2906. this.vid = res.data.recordingUrl;
  2907. this.sectionItem = res.data;
  2908. this.playVideo(res.data);
  2909. } else if (res.data.sectionType == 2) {
  2910. //直播
  2911. this.studyRecordGetLastLive();
  2912. } else if (res.data.sectionType == 3) {
  2913. //回放
  2914. this.chapterId = res.data.chapterId;
  2915. this.moduleId = res.data.moduleId;
  2916. this.playSectionId = res.data.sectionId;
  2917. this.vid = res.data.recordingUrl;
  2918. this.sectionItem = res.data;
  2919. console.log("回放啊");
  2920. this.playVideo(res.data);
  2921. }
  2922. }
  2923. });
  2924. },
  2925. /**
  2926. *
  2927. 获取推荐列表
  2928. */
  2929. getRecommend() {
  2930. this.$request
  2931. .appCommonActivityRecommendList({
  2932. businessId: this.goodsData.businessId,
  2933. type: 1,
  2934. })
  2935. .then((res) => {
  2936. if (res.rows.length) {
  2937. this.recommendList = res.rows[0];
  2938. }
  2939. });
  2940. },
  2941. addCart(status, goodsId) {
  2942. this.$request
  2943. .addCart({ goodsId: status ? goodsId : this.goodsId })
  2944. .then((res) => {
  2945. this.getCartCount();
  2946. this.$message({
  2947. message: "加入购物车成功",
  2948. type: "success",
  2949. });
  2950. })
  2951. .catch((err) => {
  2952. if (err.code == 500) {
  2953. this.$message({
  2954. message: err.msg,
  2955. type: "warning",
  2956. });
  2957. }
  2958. });
  2959. },
  2960. toGoodsDetail(item) {
  2961. this.$router.push({
  2962. path: "/course-detail/" + item.goodsId,
  2963. });
  2964. },
  2965. async takeOk() {
  2966. this.loading = true;
  2967. let compareFaceData = await this.faceRecognition();
  2968. this.compareFaceData = compareFaceData;
  2969. if (compareFaceData >= 80) {
  2970. const waitYS = await this.imageInfos();
  2971. this.postCoursePhotoRecord()
  2972. .then((res) => {
  2973. this.photoHistoryList.push(this.photoIndex);
  2974. this.postStudyRecord(); //提交记录
  2975. //恢复播放
  2976. this.$message({
  2977. type: "success",
  2978. message: "拍照成功",
  2979. });
  2980. this.takePhotoModal = false;
  2981. this.isTaking = false;
  2982. this.loading = false;
  2983. var polyvPlayerContext = this.player;
  2984. if (polyvPlayerContext) {
  2985. polyvPlayerContext.j2s_resumeVideo();
  2986. }
  2987. var polyvPlayerContext = this.playerzb;
  2988. if (polyvPlayerContext) {
  2989. polyvPlayerContext.j2s_resumeVideo();
  2990. }
  2991. })
  2992. .catch((err) => {
  2993. this.loading = false;
  2994. console.log(err, "err");
  2995. this.$message({
  2996. type: "warning",
  2997. message: "上传接口报错,请重新拍照上传",
  2998. });
  2999. this.reTake();
  3000. });
  3001. } else {
  3002. this.$message({
  3003. type: "warning",
  3004. message: "人脸匹配不通过,请重新拍照上传",
  3005. });
  3006. setTimeout(() => {
  3007. this.loading = false;
  3008. this.reTake();
  3009. }, 2000);
  3010. return;
  3011. }
  3012. },
  3013. async changePhotoListStamp(params, fileList) {
  3014. let file = await this.uploadRules(params);
  3015. if (fileList.length == 1) {
  3016. fileList.splice(0, 1);
  3017. }
  3018. this.$refs.stamp[0].clearFiles();
  3019. this.$upload
  3020. .upload(file, 0)
  3021. .then((res) => {
  3022. this.$set(this.stampForm, "commitment_seal", res);
  3023. this.fileListStamp = [
  3024. {
  3025. name: res,
  3026. url: res,
  3027. },
  3028. ];
  3029. this.$refs.stamp[0].clearFiles();
  3030. console.log(res);
  3031. })
  3032. .catch((err) => {
  3033. this.$refs.stamp[0].clearFiles();
  3034. });
  3035. },
  3036. // 页面加载成功 当前页数
  3037. pageLoaded(e) {
  3038. this.$emit("current", e);
  3039. this.curPageNum = e;
  3040. },
  3041. uploadRules(params) {
  3042. return new Promise((resolve, reject) => {
  3043. const file = params.raw;
  3044. const fileType = file.type;
  3045. const isImage = fileType.indexOf("image") != -1;
  3046. const sizeToM = file.size / 1024 / 1024;
  3047. if (!isImage) {
  3048. this.$message.error("只能上传图片格式png、jpg、gif!");
  3049. reject(false);
  3050. }
  3051. if (sizeToM > 2) {
  3052. imageConversion
  3053. .compressAccurately(file, {
  3054. size: 1024 * 2,
  3055. width: 1000,
  3056. height: 1000,
  3057. })
  3058. .then((res) => {
  3059. res = new File([res], file.name, { type: res.type });
  3060. resolve(res);
  3061. });
  3062. } else {
  3063. resolve(file);
  3064. }
  3065. });
  3066. },
  3067. async changePhotoListHeader1(params, fileList) {
  3068. let file = await this.uploadRules(params);
  3069. if (fileList.length == 1) {
  3070. fileList.splice(0, 1);
  3071. }
  3072. this.$refs.recent_photos[0].clearFiles();
  3073. this.$upload
  3074. .upload(file, 0)
  3075. .then((res) => {
  3076. this.$set(this.infoForm, "recent_photos", res);
  3077. this.fileList1 = [
  3078. {
  3079. name: res,
  3080. url: res,
  3081. },
  3082. ];
  3083. this.$refs.recent_photos[0].clearFiles();
  3084. console.log(res);
  3085. })
  3086. .catch((err) => {
  3087. this.$refs.recent_photos[0].clearFiles();
  3088. });
  3089. },
  3090. async changePhotoListHeader2(params, fileList) {
  3091. let file = await this.uploadRules(params);
  3092. if (fileList.length == 1) {
  3093. fileList.splice(0, 1);
  3094. }
  3095. let res = await this.faceCertificationIDCardOCR(1, file);
  3096. console.log(res.data.IdImgPath, "res.data.IdImgPath");
  3097. if (res.code == 500) {
  3098. this.$message.warning("请上传正确清晰的身份证人像面照片");
  3099. return;
  3100. }
  3101. this.$refs.idcard_face_photo[0].clearFiles();
  3102. this.$set(this.infoForm, "idcard_face_photo", res.data.IdImgPath);
  3103. this.fileList2 = [
  3104. {
  3105. name: res.data.IdImgPath,
  3106. url: res.data.IdImgPath,
  3107. },
  3108. ];
  3109. // this.$upload
  3110. // .upload(file, 0)
  3111. // .then((res) => {
  3112. // console.log(res, "res");
  3113. // this.$set(this.infoForm, "idcard_face_photo", res);
  3114. // this.fileList2 = [
  3115. // {
  3116. // name: res,
  3117. // url: res,
  3118. // },
  3119. // ];
  3120. // this.$refs.idcard_face_photo[0].clearFiles();
  3121. // console.log(res);
  3122. // })
  3123. // .catch((err) => {
  3124. // this.$refs.idcard_face_photo[0].clearFiles();
  3125. // });
  3126. },
  3127. async changePhotoListHeader3(params, fileList) {
  3128. let file = await this.uploadRules(params);
  3129. if (fileList.length == 1) {
  3130. fileList.splice(0, 1);
  3131. }
  3132. let res = await this.faceCertificationIDCardOCR(2, file);
  3133. if (res.code == 500) {
  3134. this.$message.warning("请上传正确清晰的身份证国徽面照片");
  3135. return;
  3136. }
  3137. this.$refs.idcard_national_photo[0].clearFiles();
  3138. this.$set(this.infoForm, "idcard_national_photo", res.data.IdImgPath);
  3139. this.fileList3 = [
  3140. {
  3141. name: res.data.IdImgPath,
  3142. url: res.data.IdImgPath,
  3143. },
  3144. ];
  3145. // this.$upload
  3146. // .upload(file, 0)
  3147. // .then((res) => {
  3148. // this.$set(this.infoForm, "idcard_national_photo", res);
  3149. // this.fileList3 = [
  3150. // {
  3151. // name: res,
  3152. // url: res,
  3153. // },
  3154. // ];
  3155. // this.$refs.idcard_national_photo[0].clearFiles();
  3156. // console.log(res);
  3157. // })
  3158. // .catch((err) => {
  3159. // this.$refs.idcard_national_photo[0].clearFiles();
  3160. // });
  3161. },
  3162. faceCertificationIDCardOCR(cardSide, file) {
  3163. return new Promise((resolve) => {
  3164. var reader = new FileReader();
  3165. // 将文件加载进入
  3166. reader.readAsDataURL(file);
  3167. reader.onload = (e) => {
  3168. // 转换完成输出该文件base64编码
  3169. let base64 = e.target.result;
  3170. this.$request
  3171. .faceCertificationIDCardOCR({
  3172. cardSide: cardSide, //1人像 2 国徽
  3173. cardImageBase64: base64,
  3174. gradeId: this.gradeId,
  3175. })
  3176. .then((res) => {
  3177. resolve(res);
  3178. })
  3179. .catch((err) => {
  3180. resolve(err);
  3181. });
  3182. };
  3183. });
  3184. },
  3185. async submit() {
  3186. if (this.uploading) {
  3187. return;
  3188. }
  3189. this.uploading = true;
  3190. var ast = this.listData.some((item) => {
  3191. return item.fieldKey === "commitment_electr_signature";
  3192. });
  3193. if (ast) {
  3194. await this.subCanvas();
  3195. }
  3196. this.resultForm();
  3197. },
  3198. stampSubmit() {
  3199. if (this.uploading) {
  3200. return;
  3201. }
  3202. this.uploading = true;
  3203. this.stampResultForm();
  3204. },
  3205. backLI() {
  3206. this.player.j2s_seekVideo(0);
  3207. this.showRecordStatus = false;
  3208. },
  3209. //验证表单
  3210. stampResultForm() {
  3211. for (let i = 0; i < this.listDataStamp.length; i++) {
  3212. if (
  3213. this.listDataStamp[i].fieldKey === "commitment_seal" &&
  3214. !this.listDataStamp[i].required
  3215. ) {
  3216. this.submitApi();
  3217. return;
  3218. }
  3219. }
  3220. this.$refs.stampForm.validate((valid) => {
  3221. if (valid) {
  3222. this.submitApiStamp();
  3223. } else {
  3224. this.uploading = false;
  3225. }
  3226. });
  3227. },
  3228. async submitApiStamp() {
  3229. var data = JSON.parse(JSON.stringify(this.stampForm));
  3230. if (data["commitment_seal"]) {
  3231. data.commitment_seal = await this.$upload.upload(
  3232. data.commitment_seal,
  3233. 0
  3234. );
  3235. }
  3236. this.optionChanges(data);
  3237. },
  3238. optionChanges(data) {
  3239. var self = this;
  3240. var objs = {};
  3241. for (let k in data) {
  3242. objs[k] = {
  3243. fieldKey: k,
  3244. value: data[k],
  3245. fieldName: (function () {
  3246. for (let i = 0; i < self.listDataStamp.length; i++) {
  3247. if (self.listDataStamp[i].fieldKey == k) {
  3248. return self.listDataStamp[i].fieldName;
  3249. }
  3250. }
  3251. })(),
  3252. status: self.remarkStatusStamp ? 1 : 0,
  3253. };
  3254. }
  3255. var datas = {
  3256. orderGoodsId: this.orderGoodsId,
  3257. goodsId: self.goodsId,
  3258. keyValue: JSON.stringify(objs),
  3259. };
  3260. if (self.remarkStatus) {
  3261. datas.id = self.id;
  3262. self.$request.editbaseprofileStamp(datas).then((res) => {
  3263. this.uploading = false;
  3264. this.showStampDetailModail = false;
  3265. this.$message.success("提交成功");
  3266. });
  3267. } else {
  3268. self.$request.addbaseprofileStamp(datas).then((res) => {
  3269. this.uploading = false;
  3270. this.showStampDetailModail = false;
  3271. this.$message.success("提交成功");
  3272. });
  3273. }
  3274. },
  3275. resultForm() {
  3276. console.log(1);
  3277. if (this.isRequired) {
  3278. this.submitApi();
  3279. } else {
  3280. console.log(1);
  3281. this.$refs.infoForm.validate((valid) => {
  3282. console.log(1);
  3283. if (valid) {
  3284. this.submitApi();
  3285. } else {
  3286. this.uploading = false;
  3287. }
  3288. });
  3289. // if (int === 1) {
  3290. // this.errorType = ["toast"];
  3291. // } else {
  3292. // this.errorType = ["message"];
  3293. // }
  3294. }
  3295. },
  3296. async submitApi() {
  3297. console.log(this.infoForm, "999");
  3298. var data = JSON.parse(JSON.stringify(this.infoForm));
  3299. if (data["sex"]) {
  3300. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  3301. }
  3302. if (data["education"]) {
  3303. data.education = this.dictObj["edu_level"][Number(data.education)];
  3304. }
  3305. if (data["working_years"]) {
  3306. data.working_years =
  3307. this.dictObj["working_years"][Number(data.working_years)];
  3308. }
  3309. if (data["recent_photos"]) {
  3310. data.recent_photos = await this.$upload.upload(data.recent_photos, 0);
  3311. }
  3312. if (data["idcard_face_photo"]) {
  3313. data.idcard_face_photo = await this.$upload.upload(
  3314. data.idcard_face_photo,
  3315. 0
  3316. );
  3317. }
  3318. if (data["idcard_national_photo"]) {
  3319. data.idcard_national_photo = await this.$upload.upload(
  3320. data.idcard_national_photo,
  3321. 0
  3322. );
  3323. }
  3324. if (data["commitment_electr_signature"]) {
  3325. data.commitment_electr_signature = await this.$upload.upload(
  3326. data.commitment_electr_signature,
  3327. 0
  3328. );
  3329. }
  3330. this.uploadDatas(data);
  3331. },
  3332. async downloadStamp(item) {
  3333. let self = this;
  3334. var ast = this.listData.some((item) => {
  3335. return item.fieldKey === "commitment_electr_signature";
  3336. });
  3337. if (ast) {
  3338. await this.subCanvas();
  3339. }
  3340. let data = JSON.parse(JSON.stringify(this.infoForm));
  3341. if (data["sex"]) {
  3342. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  3343. }
  3344. if (data["education"]) {
  3345. data.education = this.dictObj["edu_level"][Number(data.education)];
  3346. }
  3347. if (data["working_years"]) {
  3348. data.working_years =
  3349. this.dictObj["working_years"][Number(data.working_years)];
  3350. }
  3351. console.log(data, "data");
  3352. if (this.remarkStatus) {
  3353. var arsty = {};
  3354. for (let k in data) {
  3355. for (let j in self.copyData) {
  3356. if (k === j) {
  3357. if (self.copyData[j].value === data[k]) {
  3358. arsty[k] = {
  3359. fieldKey: k,
  3360. value: data[k],
  3361. fieldName: (function () {
  3362. for (let i = 0; i < self.listData.length; i++) {
  3363. if (self.listData[i].fieldKey == k) {
  3364. return self.listData[i].fieldName;
  3365. }
  3366. }
  3367. })(),
  3368. status: 0,
  3369. };
  3370. } else {
  3371. arsty[k] = {
  3372. fieldKey: k,
  3373. value: data[k],
  3374. fieldName: (function () {
  3375. for (let i = 0; i < self.listData.length; i++) {
  3376. if (self.listData[i].fieldKey == k) {
  3377. return self.listData[i].fieldName;
  3378. }
  3379. }
  3380. })(),
  3381. status: 1,
  3382. };
  3383. }
  3384. }
  3385. }
  3386. }
  3387. } else {
  3388. var arsty = {};
  3389. for (let k in data) {
  3390. arsty[k] = {
  3391. fieldKey: k,
  3392. value: data[k],
  3393. fieldName: (function () {
  3394. for (let i = 0; i < self.listData.length; i++) {
  3395. if (self.listData[i].fieldKey == k) {
  3396. return self.listData[i].fieldName;
  3397. }
  3398. }
  3399. })(),
  3400. status: 0,
  3401. };
  3402. }
  3403. }
  3404. console.log(arsty, "arsty");
  3405. this.$request
  3406. .baseProfileStampV2AddWord({
  3407. goodsId: this.goodsId,
  3408. keyValue: JSON.stringify(arsty),
  3409. })
  3410. .then((res) => {
  3411. let url = this.$tools.splitImgHost(res.msg);
  3412. let name = res.msg.substring(res.msg.lastIndexOf("/") + 1);
  3413. let image = new Image();
  3414. // 解决跨域 Canvas 污染问题,
  3415. image.setAttribute("crossorigin", "anonymous");
  3416. image.onload = function () {
  3417. var canvas = document.createElement("canvas");
  3418. canvas.width = image.width;
  3419. canvas.height = image.height;
  3420. var context = canvas.getContext("2d");
  3421. context.drawImage(image, 0, 0, image.width, image.height);
  3422. var base64 = canvas.toDataURL("image/jpg"); //将图片格式转为base64
  3423. var a = document.createElement("a"); // 生成一个a元素
  3424. var event = new MouseEvent("click"); // 创建一个单击事件
  3425. a.download = name; // 设置图片名称
  3426. console.log(base64);
  3427. a.href = base64; // 将生成的URL设置为a.href属性
  3428. a.dispatchEvent(event); // 触发a的单击事件
  3429. };
  3430. image.src = url + "?time=" + Date.now(); //注意,这里是灵魂,否则依旧会产生跨域问题
  3431. });
  3432. },
  3433. convertBase64UrlToBlob(urlData) {
  3434. var localData = urlData; //dataUrl为base64位
  3435. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  3436. let length = base.length;
  3437. let url = new Uint8Array(length);
  3438. while (length--) {
  3439. url[length] = base.charCodeAt(length);
  3440. }
  3441. let file = new File([url], "a.jpg", {
  3442. type: "image/jpg",
  3443. });
  3444. //最后将file,通过ajax请求做为参数传给服务器就可以了
  3445. return file;
  3446. },
  3447. async uploadDatas(data) {
  3448. if (this.infoForm.recent_photos && this.infoForm.idcard_face_photo) {
  3449. let base = await this.$tools.imageToBase64(
  3450. this.$tools.splitImgHost(this.infoForm.idcard_face_photo)
  3451. );
  3452. console.log(base);
  3453. console.log(this.$tools.splitImgHost(this.infoForm.idcard_face_photo));
  3454. let resData = await this.$request.faceCertificationIDCardOCR({
  3455. cardSide: 1, //1人像 2 国徽
  3456. cardImageBase64: base,
  3457. gradeId: this.gradeId,
  3458. });
  3459. if (!resData.data) {
  3460. this.$message.warning("身份证人像面照片异常,请重新上传");
  3461. this.uploading = false;
  3462. return;
  3463. }
  3464. this.veryIdCard = resData.data.IdNum;
  3465. this.veryIdName = resData.data.IdName;
  3466. // if (this.infoForm.idcard) {
  3467. // if (this.infoForm.idcard != this.veryIdCard) {
  3468. // this.$message.warning(
  3469. // "输入的身份证号和身份证人像面照片身份证号不匹配"
  3470. // );
  3471. // this.uploading = false;
  3472. // return;
  3473. // }
  3474. // }
  3475. let base64 = await this.$tools.imageToBase64(
  3476. this.$tools.splitImgHost(this.infoForm.recent_photos)
  3477. );
  3478. let newData = {
  3479. urlA: this.infoForm.idcard_face_photo,
  3480. oneInchPhotos: base64,
  3481. };
  3482. this.$request
  3483. .faceCertificationIdCardCompareFace(newData)
  3484. .then((res1) => {
  3485. if (res1.data >= 70) {
  3486. var self = this;
  3487. if (self.remarkStatus) {
  3488. var arsty = {};
  3489. for (let k in data) {
  3490. for (let j in self.copyData) {
  3491. if (k === j) {
  3492. if (self.copyData[j].value === data[k]) {
  3493. arsty[k] = {
  3494. fieldKey: k,
  3495. value: data[k],
  3496. fieldName: (function () {
  3497. for (let i = 0; i < self.listData.length; i++) {
  3498. if (self.listData[i].fieldKey == k) {
  3499. return self.listData[i].fieldName;
  3500. }
  3501. }
  3502. })(),
  3503. status: 0,
  3504. };
  3505. } else {
  3506. arsty[k] = {
  3507. fieldKey: k,
  3508. value: data[k],
  3509. fieldName: (function () {
  3510. for (let i = 0; i < self.listData.length; i++) {
  3511. if (self.listData[i].fieldKey == k) {
  3512. return self.listData[i].fieldName;
  3513. }
  3514. }
  3515. })(),
  3516. status: 1,
  3517. };
  3518. }
  3519. }
  3520. }
  3521. }
  3522. var datas = {
  3523. id: this.id,
  3524. goodsId: this.goodsId,
  3525. orderGoodsId: this.orderGoodsId,
  3526. keyValue: JSON.stringify(arsty),
  3527. };
  3528. this.$request
  3529. .editbaseprofiletp(datas)
  3530. .then((res) => {
  3531. this.uploading = false;
  3532. this.courseCourseList();
  3533. this.$message.success("提交成功");
  3534. this.showInfoDetailModal = false;
  3535. })
  3536. .catch((err) => {
  3537. this.$message.warning(err.msg);
  3538. this.uploading = false;
  3539. });
  3540. } else {
  3541. var objs = {};
  3542. for (let k in data) {
  3543. objs[k] = {
  3544. fieldKey: k,
  3545. value: data[k],
  3546. fieldName: (function () {
  3547. for (let i = 0; i < self.listData.length; i++) {
  3548. if (self.listData[i].fieldKey == k) {
  3549. return self.listData[i].fieldName;
  3550. }
  3551. }
  3552. })(),
  3553. status: 0,
  3554. };
  3555. }
  3556. var datas = {
  3557. goodsId: this.goodsId,
  3558. profileTpId: this.goodsId,
  3559. orderGoodsId: this.orderGoodsId,
  3560. keyValue: JSON.stringify(objs),
  3561. };
  3562. this.$request
  3563. .addbaseprofiletp(datas)
  3564. .then((res) => {
  3565. this.uploading = false;
  3566. this.courseCourseList();
  3567. this.$message.success("提交成功");
  3568. this.showInfoDetailModal = false;
  3569. })
  3570. .catch((err) => {
  3571. this.$message.warning(err.msg);
  3572. this.uploading = false;
  3573. });
  3574. }
  3575. } else {
  3576. this.uploading = false;
  3577. this.$message.warning("证件照和身份证人像面照片不匹配");
  3578. }
  3579. })
  3580. .catch((err) => {
  3581. this.uploading = false;
  3582. this.$message.warning(err.msg);
  3583. });
  3584. return;
  3585. }
  3586. var self = this;
  3587. if (self.remarkStatus) {
  3588. var arsty = {};
  3589. for (let k in data) {
  3590. for (let j in self.copyData) {
  3591. if (k === j) {
  3592. if (self.copyData[j].value === data[k]) {
  3593. arsty[k] = {
  3594. fieldKey: k,
  3595. value: data[k],
  3596. fieldName: (function () {
  3597. for (let i = 0; i < self.listData.length; i++) {
  3598. if (self.listData[i].fieldKey == k) {
  3599. return self.listData[i].fieldName;
  3600. }
  3601. }
  3602. })(),
  3603. status: 0,
  3604. };
  3605. } else {
  3606. arsty[k] = {
  3607. fieldKey: k,
  3608. value: data[k],
  3609. fieldName: (function () {
  3610. for (let i = 0; i < self.listData.length; i++) {
  3611. if (self.listData[i].fieldKey == k) {
  3612. return self.listData[i].fieldName;
  3613. }
  3614. }
  3615. })(),
  3616. status: 1,
  3617. };
  3618. }
  3619. }
  3620. }
  3621. }
  3622. var datas = {
  3623. id: this.id,
  3624. goodsId: this.goodsId,
  3625. orderGoodsId: this.orderGoodsId,
  3626. keyValue: JSON.stringify(arsty),
  3627. };
  3628. this.$request
  3629. .editbaseprofiletp(datas)
  3630. .then((res) => {
  3631. this.uploading = false;
  3632. this.courseCourseList();
  3633. this.$message.success("提交成功");
  3634. this.showInfoDetailModal = false;
  3635. })
  3636. .catch((err) => {
  3637. this.$message.warning(err.msg);
  3638. this.uploading = false;
  3639. });
  3640. } else {
  3641. var objs = {};
  3642. for (let k in data) {
  3643. objs[k] = {
  3644. fieldKey: k,
  3645. value: data[k],
  3646. fieldName: (function () {
  3647. for (let i = 0; i < self.listData.length; i++) {
  3648. if (self.listData[i].fieldKey == k) {
  3649. return self.listData[i].fieldName;
  3650. }
  3651. }
  3652. })(),
  3653. status: 0,
  3654. };
  3655. }
  3656. var datas = {
  3657. goodsId: this.goodsId,
  3658. profileTpId: this.goodsId,
  3659. orderGoodsId: this.orderGoodsId,
  3660. keyValue: JSON.stringify(objs),
  3661. };
  3662. this.$request
  3663. .addbaseprofiletp(datas)
  3664. .then((res) => {
  3665. this.uploading = false;
  3666. this.courseCourseList();
  3667. this.$message.success("提交成功");
  3668. this.showInfoDetailModal = false;
  3669. })
  3670. .catch((err) => {
  3671. this.$message.warning(err.msg);
  3672. this.uploading = false;
  3673. });
  3674. }
  3675. },
  3676. subCanvas() {
  3677. return new Promise((resolve, reject) => {
  3678. var self = this;
  3679. if (self.infoForm.commitment_electr_signature) {
  3680. resolve();
  3681. return;
  3682. }
  3683. this.$refs.esign[0]
  3684. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  3685. .then(async (res) => {
  3686. let url = await this.$upload.upload(
  3687. this.convertBase64UrlToBlob(res),
  3688. 0
  3689. );
  3690. this.$set(this.infoForm, "commitment_electr_signature", url);
  3691. resolve();
  3692. })
  3693. .catch((err) => {
  3694. console.log(err, "err");
  3695. // 画布没有签字时会执行这里提示一下
  3696. // this.uploading = false;
  3697. // this.$message({
  3698. // type: "warning",
  3699. // message: "请签名后再生成签字图片",
  3700. // });
  3701. resolve();
  3702. });
  3703. });
  3704. },
  3705. imageInfos() {
  3706. var self = this;
  3707. return new Promise(async (resolve, reject) => {
  3708. const waitUpload = await self.uploadFile(self.faceUrl, 0);
  3709. resolve(waitUpload);
  3710. });
  3711. },
  3712. getarrays(key) {
  3713. if (key === "sex") {
  3714. return this.dictObj["sys_user_sex"];
  3715. }
  3716. if (key === "education") {
  3717. return this.dictObj["edu_level"];
  3718. }
  3719. if (key === "working_years") {
  3720. return this.dictObj["working_years"];
  3721. }
  3722. },
  3723. dictList() {
  3724. this.$request.dictList().then((res) => {
  3725. if (res.code === 200) {
  3726. let newList = {};
  3727. let list = res.data;
  3728. for (let i = 0; i < list.length; i++) {
  3729. let item = list[i];
  3730. if (newList.hasOwnProperty(item.dictType)) {
  3731. newList[item.dictType].push(item.dictLabel);
  3732. } else {
  3733. newList[item.dictType] = [item.dictLabel];
  3734. }
  3735. }
  3736. this.dictObj = newList;
  3737. }
  3738. });
  3739. },
  3740. getbaseprofiletplists() {
  3741. return new Promise((resolve) => {
  3742. let self = this;
  3743. this.$request
  3744. .getbaseprofiletplists({
  3745. goodsId: this.goodsId,
  3746. orderGoodsId: this.orderGoodsId || "",
  3747. })
  3748. .then((res) => {
  3749. if (res.code === 200 && res.rows.length) {
  3750. console.log(1);
  3751. if (res.rows[0].keyValue) {
  3752. console.log(2);
  3753. self.$request
  3754. .getbaseprofiletpId(self.goodsId)
  3755. .then((baseRes) => {
  3756. if (baseRes.code === 200) {
  3757. console.log(3);
  3758. if (baseRes.data) {
  3759. console.log(4);
  3760. self.$request
  3761. .getbaseprofiletpgetInfo({
  3762. goodsId: self.goodsId,
  3763. orderGoodsId: self.orderGoodsId,
  3764. })
  3765. .then((result) => {
  3766. console.log(result, "result");
  3767. if (result.code === 200) {
  3768. if (
  3769. !result.data ||
  3770. (result.data.status === 3 &&
  3771. result.data.changeStatus === 1)
  3772. ) {
  3773. console.log(5);
  3774. if (!result.data) {
  3775. console.log(6);
  3776. self.needProfileModal = true;
  3777. this.$confirm(`请填写资料`, "提示", {
  3778. confirmButtonText: "确定",
  3779. cancelButtonText: "返回",
  3780. closeOnClickModal: false,
  3781. closeOnPressEscape: false,
  3782. distinguishCancelAndClose: false,
  3783. showClose: false,
  3784. })
  3785. .then((_) => {
  3786. this.showInfoDetailModal = true;
  3787. this.getInfo();
  3788. })
  3789. .catch((_) => {
  3790. this.$router.back(-1);
  3791. });
  3792. } else {
  3793. this.$confirm(
  3794. `资料审核不通过,请前往重新填写`,
  3795. "提示",
  3796. {
  3797. confirmButtonText: "确定",
  3798. cancelButtonText: "返回",
  3799. closeOnClickModal: false,
  3800. closeOnPressEscape: false,
  3801. distinguishCancelAndClose: false,
  3802. showClose: false,
  3803. }
  3804. )
  3805. .then((_) => {
  3806. this.showInfoDetailModal = true;
  3807. this.getInfo();
  3808. })
  3809. .catch((_) => {
  3810. this.$router.back(-1);
  3811. });
  3812. }
  3813. } else if (
  3814. result.data.status === 1 &&
  3815. JSON.parse(res.rows[0].keyValue2)[0]
  3816. ) {
  3817. console.log(8);
  3818. self.$request
  3819. .getbaseprofileStampgetInfo({
  3820. goodsId: self.goodsId,
  3821. orderGoodsId: self.orderGoodsId,
  3822. })
  3823. .then((k) => {
  3824. if (k.code === 200) {
  3825. if (
  3826. !k.data ||
  3827. (k.data.status === 3 &&
  3828. k.data.changeStatus === 1)
  3829. ) {
  3830. if (!k.data) {
  3831. console.log(9);
  3832. this.$confirm(
  3833. `请前往填写盖章资料`,
  3834. "提示",
  3835. {
  3836. confirmButtonText: "确定",
  3837. cancelButtonText: "返回",
  3838. closeOnClickModal: false,
  3839. closeOnPressEscape: false,
  3840. distinguishCancelAndClose: false,
  3841. showClose: false,
  3842. }
  3843. )
  3844. .then((_) => {
  3845. this.showStampDetailModail = true;
  3846. this.getInfoStamp();
  3847. })
  3848. .catch((_) => {
  3849. this.$router.back(-1);
  3850. });
  3851. } else {
  3852. console.log(10);
  3853. self.needProfileModal = true;
  3854. this.$confirm(
  3855. `资料盖章审核不通过,请前往重新填写`,
  3856. "提示",
  3857. {
  3858. confirmButtonText: "确定",
  3859. cancelButtonText: "返回",
  3860. closeOnClickModal: false,
  3861. closeOnPressEscape: false,
  3862. distinguishCancelAndClose: false,
  3863. showClose: false,
  3864. }
  3865. )
  3866. .then((_) => {
  3867. this.showStampDetailModail = true;
  3868. this.getInfoStamp();
  3869. })
  3870. .catch((_) => {
  3871. this.$router.back(-1);
  3872. });
  3873. }
  3874. } else {
  3875. resolve();
  3876. }
  3877. }
  3878. });
  3879. } else {
  3880. resolve();
  3881. }
  3882. }
  3883. });
  3884. } else {
  3885. resolve();
  3886. }
  3887. }
  3888. });
  3889. } else {
  3890. resolve();
  3891. }
  3892. } else {
  3893. resolve();
  3894. }
  3895. });
  3896. if (this.gradeId > 0) {
  3897. //提交完资料返回判断是否已开班
  3898. this.getGradeInfo();
  3899. }
  3900. });
  3901. },
  3902. getInfoStamp() {
  3903. var self = this;
  3904. this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
  3905. var ast = JSON.parse(res.data.keyValue2);
  3906. self.listDataStamp = ast;
  3907. self.$request
  3908. .getbaseprofileStampgetInfo({
  3909. goodsId: self.goodsId,
  3910. orderGoodsId: self.orderGoodsId,
  3911. })
  3912. .then((result) => {
  3913. if (result.data && result.data.status === 3) {
  3914. self.remarkStamp = result.data.text;
  3915. self.remarkStatusStamp = true;
  3916. self.id = result.data.id;
  3917. } else if (
  3918. result.data &&
  3919. (result.data.status === 1 || result.data.status === 2)
  3920. ) {
  3921. // uni.showModal({
  3922. // showCancel: false,
  3923. // content:
  3924. // result.data.status === 1
  3925. // ? "该商品审核资料已通过,不可重复提交资料"
  3926. // : result.data.status === 2
  3927. // ? "该商品审核资料处于待审核状态,不可重复提交资料"
  3928. // : "请联系管理员",
  3929. // success: function (k) {
  3930. // if (k.confirm) {
  3931. // uni.navigateBack();
  3932. // }
  3933. // },
  3934. // });
  3935. }
  3936. })
  3937. .catch((err) => {});
  3938. });
  3939. },
  3940. getGradeInfo() {
  3941. let self = this;
  3942. this.$request.goodsGradeInfo(this.gradeId).then((res) => {
  3943. if (res.code == 200) {
  3944. self.gradeDetail = res.data;
  3945. if (self.needProfileModal) {
  3946. return;
  3947. }
  3948. if (self.gradeDetail.learningStatus == 2) {
  3949. this.$confirm(
  3950. `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
  3951. "提示",
  3952. {
  3953. confirmButtonText: "确定",
  3954. closeOnClickModal: false,
  3955. closeOnPressEscape: false,
  3956. showCancelButton: false,
  3957. distinguishCancelAndClose: false,
  3958. showClose: false,
  3959. }
  3960. )
  3961. .then((_) => {
  3962. this.$router.back(-1);
  3963. })
  3964. .catch((_) => {});
  3965. }
  3966. if (
  3967. self.gradeDetail.learningStatus == 3 &&
  3968. Number(self.gradeDetail.learningTimeStart) >
  3969. Number(new Date() / 1000)
  3970. ) {
  3971. this.$confirm(
  3972. `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
  3973. "提示",
  3974. {
  3975. confirmButtonText: "返回",
  3976. closeOnClickModal: false,
  3977. closeOnPressEscape: false,
  3978. showCancelButton: false,
  3979. distinguishCancelAndClose: false,
  3980. showClose: false,
  3981. }
  3982. )
  3983. .then((_) => {
  3984. this.$router.back(-1);
  3985. })
  3986. .catch((_) => {});
  3987. }
  3988. }
  3989. });
  3990. this.$store.state.allowLoading = true;
  3991. },
  3992. deleteImg(item) {
  3993. if (item.fieldKey == "recent_photos") {
  3994. this.fileList1 = [];
  3995. this.infoForm["recent_photos"] = "";
  3996. } else if (item.fieldKey == "idcard_face_photo") {
  3997. this.fileList2 = [];
  3998. this.infoForm["idcard_face_photo"] = "";
  3999. } else if (item.fieldKey == "idcard_national_photo") {
  4000. this.fileList3 = [];
  4001. this.infoForm["idcard_national_photo"] = "";
  4002. }
  4003. },
  4004. /**
  4005. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  4006. */
  4007. getInfo() {
  4008. var self = this;
  4009. this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
  4010. console.log(res, "res");
  4011. var listData = JSON.parse(res.data.keyValue);
  4012. var ast = JSON.parse(res.data.keyValue2);
  4013. self.listData = [...listData, ...ast];
  4014. console.log(self.listData, "self.listData");
  4015. self.listData.forEach((item) => {
  4016. if (item.fieldKey == "idcard") {
  4017. this.infoForm.idcard = this.userInfo.idCard;
  4018. this.disCard = this.infoForm.idcard ? true : false;
  4019. }
  4020. if (item.fieldKey == "telphone") {
  4021. this.infoForm.telphone = this.userInfo.telphone;
  4022. }
  4023. if (item.fieldKey == "name") {
  4024. this.infoForm.name = this.userInfo.realname || "";
  4025. this.disName = this.infoForm.name ? true : false;
  4026. }
  4027. });
  4028. self.isRequired = self.listData.every((ims) => {
  4029. return ims.required === false;
  4030. });
  4031. this.$nextTick(() => {
  4032. this.agreementModal = true;
  4033. });
  4034. self.$request
  4035. .getbaseprofiletpgetInfo({
  4036. goodsId: this.goodsId,
  4037. orderGoodsId: this.orderGoodsId,
  4038. })
  4039. .then((result) => {
  4040. if (result.code === 200) {
  4041. if (!result.data) {
  4042. self.$request
  4043. .getbaseprofiletplistProfile({
  4044. pageNum: 1,
  4045. pageSize: 1,
  4046. status: 1,
  4047. })
  4048. .then((kit) => {
  4049. if (kit.rows.length) {
  4050. var ajson = JSON.parse(kit.rows[0].keyValue);
  4051. self.listData.forEach((zyitem, zyindex) => {
  4052. for (let k in ajson) {
  4053. if (zyitem.fieldKey == k && ajson[k].value) {
  4054. if (k === "sex") {
  4055. const sexIndex =
  4056. self.dictObj["sys_user_sex"].indexOf(
  4057. ajson[k].value
  4058. ) + "";
  4059. self.$set(self.infoForm, k, sexIndex);
  4060. } else if (k === "education") {
  4061. const sexIndex =
  4062. self.dictObj["edu_level"].indexOf(
  4063. ajson[k].value
  4064. ) + "";
  4065. self.$set(self.infoForm, k, sexIndex);
  4066. } else if (k === "working_years") {
  4067. const sexIndex =
  4068. self.dictObj["working_years"].indexOf(
  4069. ajson[k].value
  4070. ) + "";
  4071. self.$set(self.infoForm, k, sexIndex);
  4072. } else if (k === "recent_photos") {
  4073. self.$set(self.infoForm, k, ajson[k].value);
  4074. if (ajson[k].value) {
  4075. self.fileList1 = [
  4076. {
  4077. url: ajson[k].value,
  4078. },
  4079. ];
  4080. }
  4081. } else if (k === "idcard_face_photo") {
  4082. self.$set(self.infoForm, k, ajson[k].value);
  4083. if (ajson[k].value) {
  4084. self.fileList2 = [
  4085. {
  4086. url: ajson[k].value,
  4087. },
  4088. ];
  4089. }
  4090. } else if (k === "idcard_national_photo") {
  4091. self.$set(self.infoForm, k, ajson[k].value);
  4092. if (ajson[k].value) {
  4093. self.fileList3 = [
  4094. {
  4095. url: ajson[k].value,
  4096. },
  4097. ];
  4098. }
  4099. } else {
  4100. if (k === "name") {
  4101. self.$set(
  4102. self.infoForm,
  4103. k,
  4104. this.$store.state.userInfo.realname
  4105. );
  4106. } else if (k === "idcard") {
  4107. self.$set(
  4108. self.infoForm,
  4109. k,
  4110. this.$store.state.userInfo.idCard
  4111. );
  4112. } else if (k === "telphone") {
  4113. self.$set(
  4114. self.infoForm,
  4115. k,
  4116. this.$store.state.userInfo.telphone
  4117. );
  4118. } else if (k !== "commitment_electr_signature") {
  4119. self.$set(self.infoForm, k, ajson[k].value);
  4120. }
  4121. }
  4122. }
  4123. }
  4124. });
  4125. }
  4126. });
  4127. }
  4128. if (result.data && result.data.status === 3) {
  4129. self.remark = result.data.text;
  4130. self.remarkStatus = true;
  4131. self.id = result.data.id;
  4132. var arrays = JSON.parse(result.data.keyValue);
  4133. self.copyData = JSON.parse(JSON.stringify(arrays));
  4134. for (let k in arrays) {
  4135. if (k === "sex") {
  4136. if (arrays[k].value) {
  4137. const sexIndex =
  4138. self.dictObj["sys_user_sex"].indexOf(arrays[k].value) +
  4139. "";
  4140. self.$set(self.infoForm, k, sexIndex);
  4141. }
  4142. } else if (k === "education") {
  4143. if (arrays[k].value) {
  4144. const sexIndex =
  4145. self.dictObj["edu_level"].indexOf(arrays[k].value) + "";
  4146. self.$set(self.infoForm, k, sexIndex);
  4147. }
  4148. } else if (k === "working_years") {
  4149. if (arrays[k].value) {
  4150. const sexIndex =
  4151. self.dictObj["working_years"].indexOf(arrays[k].value) +
  4152. "";
  4153. self.$set(self.infoForm, k, sexIndex);
  4154. }
  4155. } else if (k === "recent_photos") {
  4156. self.$set(self.infoForm, k, arrays[k].value);
  4157. if (arrays[k].value) {
  4158. self.fileList1 = [{ url: arrays[k].value }];
  4159. }
  4160. } else if (k === "idcard_face_photo") {
  4161. self.$set(self.infoForm, k, arrays[k].value);
  4162. if (arrays[k].value) {
  4163. self.fileList2 = [{ url: arrays[k].value }];
  4164. }
  4165. } else if (k === "idcard_national_photo") {
  4166. self.$set(self.infoForm, k, arrays[k].value);
  4167. if (arrays[k].value) {
  4168. self.fileList3 = [{ url: arrays[k].value }];
  4169. }
  4170. } else {
  4171. self.$set(self.infoForm, k, arrays[k].value);
  4172. }
  4173. }
  4174. } else if (
  4175. result.data &&
  4176. (result.data.status === 1 || result.data.status === 2)
  4177. ) {
  4178. this.$confirm(
  4179. result.data.status === 1
  4180. ? "该商品审核资料已通过,不可重复提交资料"
  4181. : result.data.status === 2
  4182. ? "该商品审核资料处于待审核状态,不可重复提交资料"
  4183. : "请联系管理员",
  4184. "提示",
  4185. {
  4186. confirmButtonText: "返回",
  4187. closeOnClickModal: false,
  4188. closeOnPressEscape: false,
  4189. showCancelButton: false,
  4190. distinguishCancelAndClose: false,
  4191. showClose: false,
  4192. }
  4193. )
  4194. .then((_) => {
  4195. this.$router.back(-1);
  4196. })
  4197. .catch((_) => {});
  4198. }
  4199. }
  4200. });
  4201. });
  4202. },
  4203. returnName(key) {
  4204. if (key === "sex") {
  4205. if (this.infoForm[key]) {
  4206. return this.dictObj["sys_user_sex"][Number(this.infoForm[key])];
  4207. } else {
  4208. return "请选择性别";
  4209. }
  4210. }
  4211. if (key === "education") {
  4212. if (this.infoForm[key]) {
  4213. return this.dictObj["edu_level"][Number(this.infoForm[key])];
  4214. } else {
  4215. return "请选择学历";
  4216. }
  4217. }
  4218. if (key === "working_years") {
  4219. if (this.infoForm[key]) {
  4220. return this.dictObj["working_years"][Number(this.infoForm[key])];
  4221. } else {
  4222. return "请选择工作年限";
  4223. }
  4224. }
  4225. },
  4226. retDraw() {
  4227. this.$set(this.infoForm, "commitment_electr_signature", "");
  4228. this.$nextTick(() => {
  4229. this.$refs.esign[0].reset();
  4230. });
  4231. },
  4232. uploadFile(options, int) {
  4233. var self = this;
  4234. return new Promise((resolve, reject) => {
  4235. var data = {
  4236. imageStatus: int,
  4237. gradeId: this.gradeId,
  4238. orderGoodsId: this.orderGoodsId,
  4239. };
  4240. self.$request
  4241. .getPolicy(data)
  4242. .then((res) => {
  4243. var ossToken = res.data.resultContent;
  4244. if (ossToken.host == null || ossToken.host == undefined) {
  4245. this.$message({
  4246. type: "warning",
  4247. message: "上传路径报错" + JSON.stringify(res.data),
  4248. });
  4249. return;
  4250. }
  4251. let data = this.$tools.convertBase64UrlToBlob(this.faceUrl);
  4252. this.$upload
  4253. .upload(data, 0)
  4254. .then((res) => {
  4255. this.ossAvatarUrl = res;
  4256. resolve(res);
  4257. })
  4258. .catch((err) => {
  4259. this.$message({
  4260. type: "warning",
  4261. message: "上传接口报错,请重新拍照上传",
  4262. });
  4263. this.reTake();
  4264. });
  4265. })
  4266. .catch((err) => {
  4267. this.$message({
  4268. type: "warning",
  4269. message: "签名错误" + JSON.stringify(err),
  4270. });
  4271. return;
  4272. });
  4273. });
  4274. },
  4275. faceRecognition() {
  4276. return new Promise((resolve) => {
  4277. this.$request
  4278. .faceCertificationCompareFace({
  4279. imageA: this.faceUrl,
  4280. orderGoodsId: this.orderGoodsId,
  4281. gradeId: this.gradeId,
  4282. })
  4283. .then((res) => {
  4284. resolve(res.data);
  4285. })
  4286. .catch((err) => {
  4287. this.loading = false;
  4288. if(err.toString().indexOf('timeout')!=-1){
  4289. err = {
  4290. msg:'拍照超时,请重新拍照'
  4291. }
  4292. }
  4293. this.$message({
  4294. type: "warning",
  4295. message: err.msg,
  4296. });
  4297. });
  4298. });
  4299. },
  4300. /**
  4301. * 点击重拍
  4302. */
  4303. reTake() {
  4304. this.faceUrl = "";
  4305. this.isTaking = true;
  4306. this.getUserMedia({
  4307. video: {
  4308. width: 400,
  4309. height: 400,
  4310. },
  4311. });
  4312. },
  4313. // 点击拍照按钮
  4314. onPhoto() {
  4315. // if (this.isIE) {
  4316. // window.webcam.capture();
  4317. // } else {
  4318. const canvas = document.createElement("canvas");
  4319. canvas.width = 400;
  4320. canvas.height = 400;
  4321. const context = canvas.getContext("2d");
  4322. const video = document.getElementById("video");
  4323. context.drawImage(video, 0, 0, 400, 400);
  4324. this.faceUrl = canvas.toDataURL("image/png");
  4325. this.isTaking = false;
  4326. // }
  4327. },
  4328. getUserMedia(constraints, success, error) {
  4329. if (window.navigator.mediaDevices.getUserMedia) {
  4330. // 最新的标准API
  4331. window.navigator.mediaDevices
  4332. .getUserMedia(constraints)
  4333. .then(success)
  4334. .catch(error);
  4335. } else if (window.navigator.webkitGetUserMedia) {
  4336. // webkit核心浏览器
  4337. window.navigator.webkitGetUserMedia(constraints, success, error);
  4338. } else if (window.navigator.mozGetUserMedia) {
  4339. // firfox浏览器
  4340. window.navigator.mozGetUserMedia(constraints, success, error);
  4341. } else if (window.navigator.getUserMedia) {
  4342. // 旧版API
  4343. window.navigator.getUserMedia(constraints, success, error);
  4344. }
  4345. },
  4346. photographSuccess(stream) {
  4347. // 兼容webkit核心浏览器
  4348. this.isTaking = true;
  4349. this.takePhotoModal = true;
  4350. this.$nextTick(() => {
  4351. const video = document.getElementById("video");
  4352. // 将视频流设置为video元素的源
  4353. console.dir(video);
  4354. video.srcObject = stream;
  4355. this.mediaStreamTrack =
  4356. typeof stream.stop === "function" ? stream : stream.getTracks()[0];
  4357. video.play();
  4358. });
  4359. },
  4360. photographError(err) {
  4361. this.$confirm(
  4362. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  4363. "提示",
  4364. {
  4365. confirmButtonText: "返回",
  4366. showConfirmButton: true,
  4367. closeOnClickModal: false,
  4368. showCancelButton: false,
  4369. closeOnPressEscape: false,
  4370. distinguishCancelAndClose: false,
  4371. showClose: false,
  4372. }
  4373. ).then(() => {
  4374. this.$router.go(-1);
  4375. });
  4376. },
  4377. /**
  4378. * 切换科目
  4379. */
  4380. courseChange() {
  4381. return new Promise((resolve) => {
  4382. this.noteParams = {
  4383. pageNum: 1,
  4384. // pageSize: 4,
  4385. };
  4386. this.duration = 0;
  4387. this.playSectionId = 0;
  4388. this.vid = "";
  4389. if (this.player) {
  4390. this.player.destroy();
  4391. }
  4392. this.player = "";
  4393. if (this.playerzb) {
  4394. this.playerzb.destroy();
  4395. }
  4396. this.playerzb = "";
  4397. this.vidzb = "";
  4398. this.historyChatMsgList = [];
  4399. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  4400. this.courseDetail(); //课程详情
  4401. this.getGoodsDetail(); //商品详情
  4402. this.getAnswerList(); //答疑列表
  4403. // this.answerTimer = setInterval(() => {
  4404. // this.getAnswerList();
  4405. // }, 5000);
  4406. this.getMenuList(); //学习目录
  4407. // this.getReMenuList(); //获取重修目录
  4408. this.getNoteList(); //获取节笔记
  4409. resolve();
  4410. });
  4411. },
  4412. polyvLiveHistoryChatMsgList() {
  4413. // /polyv/live/historyChatMsgList-查询保利威节聊天历史
  4414. this.$request
  4415. .polyvLiveHistoryChatMsgList({
  4416. sectionId: this.playSectionId,
  4417. channelId: this.sectionItem.liveUrl,
  4418. })
  4419. .then((res) => {
  4420. this.historyChatMsgList = res.data;
  4421. });
  4422. },
  4423. courseDetail() {
  4424. let self = this;
  4425. this.$request.courseDetail(this.courseId).then((res) => {
  4426. // if (res.data.educationName == "继续教育") {
  4427. // this.$request
  4428. // .lockLockAction({
  4429. // action: "jxjy",
  4430. // })
  4431. // .then((res) => {});
  4432. // this.lockTimer = setInterval(() => {
  4433. // this.$request
  4434. // .lockLockAction({
  4435. // action: "jxjy",
  4436. // })
  4437. // .then((res) => {});
  4438. // }, 10000);
  4439. // }
  4440. self.detail = res.data;
  4441. });
  4442. },
  4443. openModule(menuItem) {
  4444. //重修目录点击
  4445. console.log(menuItem.list);
  4446. menuItem.showList = !menuItem.showList;
  4447. if (!menuItem.list.length) {
  4448. if (menuItem.isRebuild) {
  4449. this.getReChapterList(menuItem.id, menuItem.courseId, menuItem);
  4450. } else {
  4451. this.getBuyChapterList(menuItem.id, menuItem.courseId, menuItem);
  4452. }
  4453. }
  4454. },
  4455. getReChapterList(moduleId, courseId, menuItem) {
  4456. this.$request
  4457. .reChapterList({
  4458. moduleId: moduleId,
  4459. gradeId: this.gradeId,
  4460. courseId: courseId,
  4461. rebuild: 1,
  4462. })
  4463. .then((res) => {
  4464. for (let i = 0; i < res.data.length; i++) {
  4465. let item = res.data[i];
  4466. item.id = item.chapterId;
  4467. item.showList = false;
  4468. item.list = [];
  4469. item.parent = menuItem;
  4470. item.isRebuild = 1;
  4471. }
  4472. menuItem.list = res.data;
  4473. });
  4474. },
  4475. getBuyChapterList(moduleId, courseId, menuItem) {
  4476. this.$request
  4477. .reChapterList({
  4478. moduleId: moduleId,
  4479. gradeId: this.gradeId,
  4480. courseId: courseId,
  4481. })
  4482. .then((res) => {
  4483. for (let i = 0; i < res.data.length; i++) {
  4484. let item = res.data[i];
  4485. item.id = item.chapterId;
  4486. item.menuType = 2;
  4487. item.showList = false;
  4488. item.list = [];
  4489. item.parent = menuItem;
  4490. }
  4491. menuItem.list = res.data;
  4492. if (this.needOpen) {
  4493. // this.needOpen = false;
  4494. this.openChapter(menuItem.list[0]);
  4495. }
  4496. });
  4497. },
  4498. openChapter(chapter) {
  4499. console.log(chapter, "chapter");
  4500. chapter.showList = !chapter.showList;
  4501. if (!chapter.list.length) {
  4502. if (chapter.isRebuild) {
  4503. this.getReSectionList(
  4504. chapter.id,
  4505. chapter.courseId,
  4506. chapter.moduleId || 0,
  4507. chapter
  4508. );
  4509. } else {
  4510. this.getBuySectionList(
  4511. chapter.id,
  4512. chapter.courseId,
  4513. chapter.moduleId || 0,
  4514. chapter
  4515. );
  4516. }
  4517. }
  4518. },
  4519. getReSectionList(chapterId, courseId, moduleId, chapter) {
  4520. this.$request
  4521. .reSectionList({
  4522. chapterId: chapterId,
  4523. gradeId: this.gradeId,
  4524. courseId: courseId,
  4525. rebuild: 1,
  4526. moduleId: moduleId,
  4527. })
  4528. .then((res) => {
  4529. let newArr = res.data.filter((item) => {
  4530. return item.type != 2;
  4531. });
  4532. chapter.canLearn = newArr.every((item) => {
  4533. if (item.learning == 1) {
  4534. return true;
  4535. } else {
  4536. return false;
  4537. }
  4538. });
  4539. res.data.forEach((section) => {
  4540. section.parent = chapter;
  4541. });
  4542. chapter.list = res.data;
  4543. });
  4544. },
  4545. getBuySectionList(chapterId, courseId, moduleId = 0, chapter) {
  4546. this.$request
  4547. .reSectionList({
  4548. chapterId: chapterId,
  4549. gradeId: this.gradeId,
  4550. courseId: courseId,
  4551. moduleId: moduleId,
  4552. })
  4553. .then((res) => {
  4554. let newArr = res.data.filter((item) => {
  4555. return item.type != 2;
  4556. });
  4557. chapter.canLearn = newArr.every((item) => {
  4558. if (item.learning == 1) {
  4559. return true;
  4560. } else {
  4561. return false;
  4562. }
  4563. });
  4564. res.data.forEach((section) => {
  4565. section.parent = chapter;
  4566. });
  4567. chapter.list = res.data;
  4568. if (this.needOpen) {
  4569. this.needOpen = false;
  4570. if (chapter.list && !this.sectionItem.recordingUrl) {
  4571. // this.getResource(chapter.list[0]);
  4572. }
  4573. }
  4574. });
  4575. },
  4576. getGoodsDetail() {
  4577. let self = this;
  4578. this.$request.goodsDetail(this.goodsId).then((res) => {
  4579. self.goodsData = res.data;
  4580. self.gradeId = self.goodsData.gradeId;
  4581. if (this.goodsData.buyNote) {
  4582. this.tabList = [
  4583. { name: "1", label: "学员须知" },
  4584. { name: "2", label: "课程答疑" },
  4585. { name: "3", label: "笔记讲义" },
  4586. { name: "4", label: "聊天" },
  4587. ];
  4588. console.log(res, "res111");
  4589. this.getRecommend();
  4590. } else {
  4591. this.tabList = [
  4592. { name: "1", label: "课程答疑" },
  4593. { name: "2", label: "笔记讲义" },
  4594. { name: "3", label: "聊天" },
  4595. ];
  4596. }
  4597. this.courseBusiness();
  4598. // this.courseHandouts();
  4599. if (self.goodsData.goodsPlayConfig) {
  4600. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  4601. if (self.goodsPlayConfig.autoPlay > 0) {
  4602. self.autoplay = true;
  4603. }
  4604. if (self.goodsPlayConfig.drag > 0) {
  4605. self.isAllowSeek = "off";
  4606. }
  4607. if (self.goodsPlayConfig.speed > 0) {
  4608. self.playbackRate = true;
  4609. }
  4610. }
  4611. if (self.goodsData.goodsPhotographConfig) {
  4612. self.goodsPhotographConfig = JSON.parse(
  4613. self.goodsData.goodsPhotographConfig
  4614. );
  4615. if (self.goodsPhotographConfig.photoNum > 0) {
  4616. self.photoNum = self.goodsPhotographConfig.photoNum;
  4617. }
  4618. }
  4619. });
  4620. },
  4621. // 新增用户视频学习日志
  4622. studyLog(moduleId, chapterId, sectionId) {
  4623. this.$axios({
  4624. url: "/user/study/log",
  4625. method: "post",
  4626. data: {
  4627. goodsId: this.goodsId,
  4628. courseId: this.courseId,
  4629. moduleId: moduleId || 0,
  4630. chapterId: chapterId || 0,
  4631. sectionId: sectionId || 0,
  4632. fromPlat: 2, //来源平台 1小程序 2PC网站
  4633. goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  4634. orderGoodsId: this.orderGoodsId,
  4635. },
  4636. }).then((res) => {
  4637. console.log("直播的用户学习日志:", res);
  4638. });
  4639. },
  4640. /**
  4641. * 点击节
  4642. */
  4643. async getResource(section) {
  4644. console.log("回放回放", section);
  4645. this.clickSectionItem = section;
  4646. //逻辑
  4647. if (section.type == 2) {
  4648. //试卷
  4649. console.log("试卷");
  4650. console.log(section);
  4651. let learnNum = await this.goodsTodayStudySectionNum();
  4652. let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
  4653. if (this.goodsData.sectionMaxNum > 0) {
  4654. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4655. this.$message({
  4656. type: "warning",
  4657. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4658. });
  4659. return;
  4660. }
  4661. }
  4662. if (this.businessData.goodsLearningOrder == 1) {
  4663. if (section.parent.canLearn) {
  4664. let num = await this.bankRecordDoNum(section);
  4665. //有次数限制
  4666. if (section.answerNum - num > 0 && section.answerNum > 0) {
  4667. // this.$set(this.list[index],'doNum',(item.doNum+1))
  4668. this.$router.push({
  4669. path: "/course-exam/" + this.goodsId,
  4670. query: {
  4671. courseId: this.courseId,
  4672. gradeId: this.gradeId,
  4673. moduleId: section.moduleId || 0,
  4674. examId: section.typeId,
  4675. chapterId: section.chapterId || 0,
  4676. orderGoodsId: this.orderGoodsId,
  4677. },
  4678. });
  4679. //没有答题次数限制
  4680. } else if (section.answerNum == 0) {
  4681. this.$router.push({
  4682. path: "/course-exam/" + this.goodsId,
  4683. query: {
  4684. courseId: this.courseId,
  4685. gradeId: this.gradeId,
  4686. moduleId: section.moduleId || 0,
  4687. examId: section.typeId,
  4688. chapterId: section.chapterId || 0,
  4689. orderGoodsId: this.orderGoodsId,
  4690. },
  4691. });
  4692. } else {
  4693. this.$message({
  4694. type: "warning",
  4695. message: "该试卷只能答题" + section.answerNum + "次",
  4696. });
  4697. return;
  4698. }
  4699. this.studyLog(
  4700. (section.moduleId = 0),
  4701. (section.chapterId = 0),
  4702. section.typeId
  4703. );
  4704. } else {
  4705. this.$message({
  4706. type: "warning",
  4707. message: "请按顺序学完视频课程再进行练习和测试",
  4708. });
  4709. }
  4710. } else if (
  4711. this.businessData.goodsLearningOrder == 2 &&
  4712. !section.rebuild
  4713. ) {
  4714. let rows = await this.studyRecordMenuAllList();
  4715. let isStop = false;
  4716. let newRows = [];
  4717. for (let i = 0; i < rows.length; i++) {
  4718. let moduleTrue = rows[i].moduleId == section.moduleId;
  4719. let chapterTrue = rows[i].chapterId == section.chapterId;
  4720. if (moduleTrue && chapterTrue) {
  4721. isStop = true;
  4722. if (rows[i].sectionType != 2) {
  4723. //忽略直播
  4724. newRows.push(rows[i]);
  4725. }
  4726. } else {
  4727. if (!isStop) {
  4728. if (rows[i].sectionType != 2) {
  4729. //忽略直播
  4730. newRows.push(rows[i]);
  4731. }
  4732. } else {
  4733. break;
  4734. }
  4735. }
  4736. }
  4737. console.log(newRows);
  4738. let isAllLearn = newRows.every((item) => {
  4739. return item.studyStatus == 1;
  4740. });
  4741. if (isAllLearn) {
  4742. //之前的都学完了
  4743. // if(canLearn) { //视频的上一节学完
  4744. let num = await this.bankRecordDoNum(section.typeId);
  4745. //有次数限制
  4746. if (section.answerNum - num > 0 && section.answerNum > 0) {
  4747. console.log(this.list[index]);
  4748. this.$router.push({
  4749. path: "/course-exam/" + this.goodsId,
  4750. query: {
  4751. courseId: this.courseId,
  4752. gradeId: this.gradeId,
  4753. moduleId: section.moduleId || 0,
  4754. examId: section.typeId,
  4755. chapterId: section.chapterId || 0,
  4756. orderGoodsId: this.orderGoodsId,
  4757. },
  4758. });
  4759. //没有答题次数限制
  4760. } else if (section.answerNum == 0) {
  4761. this.$router.push({
  4762. path: "/course-exam/" + this.goodsId,
  4763. query: {
  4764. courseId: this.courseId,
  4765. gradeId: this.gradeId,
  4766. moduleId: section.moduleId || 0,
  4767. examId: section.typeId,
  4768. chapterId: section.chapterId || 0,
  4769. orderGoodsId: this.orderGoodsId,
  4770. },
  4771. });
  4772. } else {
  4773. this.$message({
  4774. type: "warning",
  4775. message: "该试卷只能答题" + section.answerNum + "次",
  4776. });
  4777. return;
  4778. }
  4779. this.studyLog(
  4780. (section.moduleId = 0),
  4781. (section.chapterId = 0),
  4782. section.typeId
  4783. );
  4784. } else {
  4785. this.$message({
  4786. type: "warning",
  4787. message: "请学完视频课程再进行练习和测试",
  4788. });
  4789. }
  4790. } else {
  4791. let num = await this.bankRecordDoNum(section.typeId);
  4792. //有次数限制
  4793. if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
  4794. // this.$set(this.list[index],'doNum',(item.doNum+1))
  4795. this.$router.push({
  4796. path: "/course-exam/" + this.goodsId,
  4797. query: {
  4798. courseId: this.courseId,
  4799. gradeId: this.gradeId,
  4800. moduleId: section.moduleId || 0,
  4801. examId: section.typeId,
  4802. chapterId: section.chapterId || 0,
  4803. orderGoodsId: this.orderGoodsId,
  4804. },
  4805. });
  4806. //没有答题次数限制
  4807. } else if (section.answerNum == 0) {
  4808. this.$router.push({
  4809. path: "/course-exam/" + this.goodsId,
  4810. query: {
  4811. courseId: this.courseId,
  4812. gradeId: this.gradeId,
  4813. moduleId: section.moduleId || 0,
  4814. examId: section.typeId,
  4815. chapterId: section.chapterId || 0,
  4816. orderGoodsId: this.orderGoodsId,
  4817. },
  4818. });
  4819. } else {
  4820. this.$message({
  4821. type: "warning",
  4822. message: "该试卷只能答题" + section.answerNum + "次",
  4823. });
  4824. return;
  4825. }
  4826. this.studyLog(
  4827. (section.moduleId = 0),
  4828. (section.chapterId = 0),
  4829. section.typeId
  4830. );
  4831. }
  4832. return;
  4833. }
  4834. if (section.type != 2) {
  4835. if (this.clickLock) {
  4836. return;
  4837. }
  4838. this.clickLock = true;
  4839. if (
  4840. section.sectionType != 3 &&
  4841. this.playSectionId &&
  4842. (this.playSectionId == section.sectionId ||
  4843. this.playSectionId == section.menuId) &&
  4844. this.moduleId == (section.moduleId || 0) &&
  4845. this.chapterId == (section.chapterId || 0)
  4846. ) {
  4847. //切换为同一频道不作为
  4848. console.log("---====", this.moduleId, this.chapterId);
  4849. this.clickLock = false;
  4850. return;
  4851. }
  4852. // if (this.businessData.goodsLearningOrder == 2 && !section.isRebuild) {
  4853. // //要按从头到尾顺序学习, 且不是重修课程
  4854. // let rows = await this.studyRecordMenuAllList();
  4855. // if (!this.hasPreItem(rows, section)) {
  4856. // //判断是否有上一节
  4857. // let newRows = [];
  4858. // for (let i = 0; i < rows.length; i++) {
  4859. // let moduleTrue =
  4860. // rows[i].moduleId == section.moduleId || rows[i].moduleId == 0;
  4861. // let chapterTrue =
  4862. // rows[i].chapterId == section.chapterId ||
  4863. // rows[i].chapterId == 0;
  4864. // let sectionTrue =
  4865. // rows[i].sectionId == section.sectionId ||
  4866. // rows[i].sectionId == section.menuId;
  4867. // if (moduleTrue && chapterTrue && sectionTrue) {
  4868. // break;
  4869. // } else {
  4870. // if (rows[i].sectionType != 2) {
  4871. // newRows.push(rows[i]);
  4872. // }
  4873. // }
  4874. // }
  4875. // let isAllLearn = newRows.every((item) => {
  4876. // return item.studyStatus == 1;
  4877. // });
  4878. // if (isAllLearn) {
  4879. // this.initVideo(section);
  4880. // } else {
  4881. // this.clickLock = false;
  4882. // this.$message({
  4883. // type: "warning",
  4884. // message: "请按顺序学习视频课程",
  4885. // });
  4886. // }
  4887. // } else {
  4888. // //第一章第一节
  4889. // this.initVideo(section);
  4890. // }
  4891. // } else {
  4892. this.initVideo(section);
  4893. // }
  4894. }
  4895. },
  4896. bankRecordDoNum(section) {
  4897. return new Promise((resolve) => {
  4898. this.$request
  4899. .bankRecordDoNum({
  4900. goodsId: this.goodsId,
  4901. gradeId: this.gradeId,
  4902. chapterId: section.chapterId,
  4903. courseId: this.courseId,
  4904. moduleId: 0,
  4905. examId: section.typeId,
  4906. })
  4907. .then((res) => {
  4908. resolve(res.data);
  4909. });
  4910. });
  4911. },
  4912. /**
  4913. * 是否有上一章节
  4914. */
  4915. hasPreItem(rows, option) {
  4916. let moduleId = option.moduleId;
  4917. let chapterId = option.chapterId;
  4918. let sectionId = option.sectionId;
  4919. let index = 0;
  4920. for (let i = 0; i < rows.length; i++) {
  4921. if (
  4922. rows[i].moduleId == moduleId &&
  4923. rows[i].chapterId == chapterId &&
  4924. rows[i].sectionId == sectionId
  4925. ) {
  4926. index = i;
  4927. break;
  4928. }
  4929. }
  4930. if (index == 0) {
  4931. return false;
  4932. } else {
  4933. return true;
  4934. }
  4935. },
  4936. async initVideo(option) {
  4937. console.log("initVideo", option);
  4938. if (option.sectionType == 1 || option.sectionType == 3) {
  4939. //录播
  4940. // let learnNum = await this.goodsTodayStudySectionNum(option);
  4941. // let hasLearn = await this.gradeCheckGoodsStudy(option);
  4942. // console.log(hasLearn, "hasLearn");
  4943. // console.log(learnNum, "learnNum");
  4944. // console.log(
  4945. // this.goodsData.sectionMaxNum,
  4946. // "this.goodsData.sectionMaxNum"
  4947. // );
  4948. // if (this.goodsData.sectionMaxNum > 0) {
  4949. // if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4950. // this.clickLock = false;
  4951. // this.$message({
  4952. // type: "warning",
  4953. // message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4954. // });
  4955. // return;
  4956. // }
  4957. // }
  4958. if (!option.recordingUrl) {
  4959. this.clickLock = false;
  4960. this.$message({
  4961. type: "warning",
  4962. message: `暂无播放地址数据`,
  4963. });
  4964. return;
  4965. }
  4966. if (this.playSectionId > 0) {
  4967. //切换视频
  4968. // let oldSectionId = this.playSectionId;
  4969. // uni.$emit("changeSection", oldSectionId);
  4970. }
  4971. this.playVideo(option);
  4972. }
  4973. if (option.sectionType == 2) {
  4974. //直播
  4975. // let learnNum = await this.goodsTodayStudySectionNum(option);
  4976. // let hasLearn = await this.gradeCheckGoodsStudy(option);
  4977. // if (this.goodsData.sectionMaxNum > 0) {
  4978. // if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4979. // this.clickLock = false;
  4980. // this.$message({
  4981. // type: "warning",
  4982. // message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4983. // });
  4984. // return;
  4985. // }
  4986. // }
  4987. if (!option.liveUrl) {
  4988. this.clickLock = false;
  4989. this.$message({
  4990. type: "warning",
  4991. message: `暂无直播地址数据`,
  4992. });
  4993. return;
  4994. }
  4995. let data = await this.studyRecordGetChannelBasicInfo(option.liveUrl);
  4996. let nowTime = +this.$tools.timest();
  4997. if (option.liveStartTime > nowTime) {
  4998. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  4999. this.clickLock = false;
  5000. this.$message({
  5001. type: "warning",
  5002. message: `直播未开始`,
  5003. });
  5004. return;
  5005. }
  5006. } else if (
  5007. option.liveStartTime < nowTime &&
  5008. option.liveEndTime > nowTime
  5009. ) {
  5010. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  5011. this.clickLock = false;
  5012. this.$message({
  5013. type: "warning",
  5014. message: `暂无直播`,
  5015. });
  5016. return;
  5017. }
  5018. } else if (option.liveEndTime < nowTime) {
  5019. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  5020. this.clickLock = false;
  5021. this.$message({
  5022. type: "warning",
  5023. message: `直播已结束`,
  5024. });
  5025. return;
  5026. }
  5027. }
  5028. this.playVideo(option);
  5029. }
  5030. return;
  5031. },
  5032. studyRecordGetChannelBasicInfo(channelId) {
  5033. return new Promise((resolve) => {
  5034. this.$request
  5035. .studyRecordGetChannelBasicInfo({
  5036. channelId,
  5037. })
  5038. .then((res) => {
  5039. console.log(res, "channel");
  5040. resolve(res.data);
  5041. });
  5042. });
  5043. },
  5044. /**
  5045. * 判断是否是当前播放的节
  5046. */
  5047. isActive(section) {
  5048. let moduleId = section.moduleId || 0;
  5049. let chapterId = section.chapterId || 0;
  5050. let sectionId = section.sectionId || section.menuId;
  5051. if (
  5052. moduleId == this.moduleId &&
  5053. chapterId == this.chapterId &&
  5054. sectionId == this.playSectionId
  5055. ) {
  5056. return true;
  5057. } else {
  5058. return false;
  5059. }
  5060. },
  5061. async playVideo(option) {
  5062. console.log(option, "<-----option", this.clickSectionItem);
  5063. if (option.sectionType == 3) {
  5064. console.log("huifang");
  5065. // 回放
  5066. if (Object.keys(this.clickSectionItem).length) {
  5067. //this.clickSectionItem 判断点击节才跳转, 不判断的话一进来页面到这里就直接跳转了
  5068. this.$router.push({
  5069. path: "/living-room/" + option.liveUrl,
  5070. query: {
  5071. goodsId: this.goodsId,
  5072. courseId: this.courseId,
  5073. gradeId: this.gradeId,
  5074. orderGoodsId: this.orderGoodsId,
  5075. sectionId: option.sectionId || option.menuId,
  5076. chapterId: option.chapterId || 0,
  5077. moduleId: option.moduleId || 0,
  5078. sectionType: 3,
  5079. goodsName: option.name,
  5080. vid: option.recordingUrl, // 回放vid
  5081. },
  5082. });
  5083. this.clickSectionItem = {};
  5084. return;
  5085. }
  5086. }
  5087. if (option.sectionType == 1) {
  5088. //录播
  5089. //设置播放的节ID
  5090. //提交保存观看历史
  5091. if (this.playSectionId) {
  5092. this.postStudyRecord(0, this.playSectionId);
  5093. }
  5094. this.player &&
  5095. this.player.HTML5.video.removeEventListener(
  5096. "timeupdate",
  5097. this.timeEvent
  5098. );
  5099. //播放视频
  5100. this.showRecordStatus = false; //隐藏播放记录提示
  5101. this.sectionItem = option;
  5102. this.isPlayRebuild = option.rebuild;
  5103. this.moduleId = option.moduleId || 0;
  5104. this.chapterId = option.chapterId || 0;
  5105. this.playSectionId = option.sectionId || option.menuId;
  5106. // console.log(this.moduleId, this.chapterId, this.playSectionId);
  5107. // await this.getPhotoLastRecord();
  5108. this.recordObj = await this.getRecordLast();
  5109. this.getNoteList();
  5110. await this.clears();
  5111. this.vid = option.recordingUrl;
  5112. this.historyChatMsgList = [];
  5113. if (option.sectionType == 3) {
  5114. this.polyvLiveHistoryChatMsgList();
  5115. }
  5116. this.liveLast = null;
  5117. if (!this.vid) {
  5118. return;
  5119. }
  5120. this.loadPlayerScript(this.loadPlayer);
  5121. setTimeout(() => {
  5122. this.clickLock = false;
  5123. }, 3000);
  5124. this.studyLog(this.moduleId, this.chapterId, this.playSectionId);
  5125. // uni.$emit("levelId", this.levelId);
  5126. // uni.$emit("getSection", this.menuItem);
  5127. // uni.$emit("isRebuild", this.isRebuild);
  5128. }
  5129. if (option.sectionType == 2) {
  5130. //直播
  5131. // 直播下面不需要调用 this.studyLog(),因为跳到直播页面有调用
  5132. //提交保存观看历史
  5133. if (this.playSectionId) {
  5134. this.postStudyRecord(0, this.playSectionId);
  5135. }
  5136. this.player &&
  5137. this.player.HTML5.video.removeEventListener(
  5138. "timeupdate",
  5139. this.timeEvent
  5140. );
  5141. //播放视频
  5142. this.showRecordStatus = false; //隐藏播放记录提示
  5143. this.sectionItem = option;
  5144. console.log(option, "option");
  5145. this.isPlayRebuild = option.rebuild;
  5146. this.moduleId = option.moduleId || 0;
  5147. this.chapterId = option.chapterId || 0;
  5148. this.playSectionId = option.sectionId || option.menuId;
  5149. // console.log(this.moduleId, this.chapterId, this.playSectionId);
  5150. // await this.getPhotoLastRecord();
  5151. this.recordObj = await this.getRecordLast();
  5152. this.getNoteList();
  5153. //设置播放的节ID
  5154. await this.clears();
  5155. this.vidzb = option.liveUrl;
  5156. this.$router.push({
  5157. path: "/living-room/" + option.liveUrl,
  5158. query: {
  5159. goodsId: this.goodsId,
  5160. courseId: this.courseId,
  5161. gradeId: this.gradeId,
  5162. orderGoodsId: this.orderGoodsId,
  5163. sectionId: option.sectionId || option.menuId,
  5164. chapterId: option.chapterId || 0,
  5165. moduleId: option.moduleId || 0,
  5166. sectionType: 2,
  5167. goodsName: option.name,
  5168. },
  5169. });
  5170. // this.loadPlayerScriptzb(this.loadPlayerzb);
  5171. // setTimeout(() => {
  5172. // this.clickLock = false;
  5173. // }, 3000);
  5174. // uni.$emit("levelId", this.levelId);
  5175. // uni.$emit("getChannel", this.menuItem);
  5176. // uni.$emit("isRebuild", this.isRebuild);
  5177. // console.log(this.menuItem, "menuItem");
  5178. }
  5179. },
  5180. gradeCheckGoodsStudy(option) {
  5181. return new Promise((resolve) => {
  5182. this.$request
  5183. .gradeCheckGoodsStudy({
  5184. goodsId: this.goodsId,
  5185. gradeId: this.gradeId,
  5186. moduleId: option.moduleId || 0,
  5187. chapterId: option.chapterId || 0,
  5188. sectionId: option.sectionId || option.menuId,
  5189. })
  5190. .then((res) => {
  5191. resolve(res.data);
  5192. });
  5193. });
  5194. },
  5195. goodsTodayStudySectionNum(option) {
  5196. return new Promise((resolve) => {
  5197. this.$request
  5198. .goodsTodayStudySectionNum({
  5199. goodsId: this.goodsId,
  5200. gradeId: this.gradeId,
  5201. })
  5202. .then((res) => {
  5203. resolve(res.data);
  5204. });
  5205. });
  5206. },
  5207. studyRecordMenuAllList() {
  5208. return new Promise((resolve) => {
  5209. this.$request
  5210. .studyRecordMenuAllList({
  5211. courseId: this.courseId,
  5212. gradeId: this.gradeId,
  5213. goodsId: this.goodsId,
  5214. })
  5215. .then((res) => {
  5216. resolve(res.data);
  5217. });
  5218. });
  5219. },
  5220. loadPlayerzb() {
  5221. var self = this;
  5222. const polyvLivePlayer = window.polyvLivePlayer;
  5223. this.playerzb = polyvLivePlayer({
  5224. wrap: "#playerzb",
  5225. width: 810,
  5226. height: 455,
  5227. showLine: "off",
  5228. uid: this.uidzb,
  5229. vid: this.vidzb,
  5230. });
  5231. this.playerzb.on("s2j_onStartPlay", () => {
  5232. console.log("s2j_onStartPlay");
  5233. this.hasStart = true;
  5234. this.livingTimer = setInterval(self.timeEventLiving, 1000);
  5235. });
  5236. this.playerzb.on("s2j_onOver", () => {
  5237. console.log("s2j_onOver");
  5238. clearInterval(this.livingTimer);
  5239. this.hasStart = false;
  5240. this.$message({
  5241. type: "success",
  5242. message: "播放完毕",
  5243. });
  5244. this.postStudyRecord(1);
  5245. });
  5246. },
  5247. loadPlayer() {
  5248. var self = this;
  5249. const polyvPlayer = window.polyvPlayer;
  5250. console.log(polyvPlayer);
  5251. self.$request.obtainpolyvvideosign(self.vid).then((res) => {
  5252. console.log(res, "res2");
  5253. self.player = polyvPlayer({
  5254. wrap: "#player",
  5255. width: 810,
  5256. showLine: "off",
  5257. height: 455,
  5258. ban_history_time: "on",
  5259. vid: self.vid,
  5260. autoplay: this.autoplay,
  5261. ban_seek: this.isAllowSeek,
  5262. speed: this.playbackRate,
  5263. teaser_show: 1,
  5264. tail_show: 1,
  5265. hideSwitchPlayer: true,
  5266. watchStartTime: this.recordObj.videoCurrentTime,
  5267. ts: res.data.ts,
  5268. sign: res.data.sign,
  5269. // adMatter: [
  5270. // {
  5271. // // 广告参数详细配置
  5272. // location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  5273. // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  5274. // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  5275. // timesize: 5, //广告时长,单位:秒
  5276. // skipenabled: false, //是否显示跳过按钮
  5277. // },
  5278. // {
  5279. // // 广告参数详细配置
  5280. // location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  5281. // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  5282. // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  5283. // timesize: 5, //广告时长,单位:秒
  5284. // skipenabled: false, //是否显示跳过按钮
  5285. // },
  5286. // ],
  5287. playsafe: function (vid, next) {
  5288. next();
  5289. },
  5290. });
  5291. this.player.HTML5.video.addEventListener("timeupdate", self.timeEvent);
  5292. this.player.on("s2j_onPlayStart", () => {
  5293. //开始播放每30秒提交一次观看时间
  5294. this.hasStart = true;
  5295. clearInterval(this.postTimer);
  5296. this.postTimer = setInterval(() => {
  5297. this.postStudyRecord(0, this.playSectionId, 5);
  5298. }, 30000);
  5299. if (this.recordObj.videoCurrentTime) {
  5300. this.showRecordStatus = true;
  5301. setTimeout(() => {
  5302. this.showRecordStatus = false;
  5303. }, 5000);
  5304. } else {
  5305. //新视频直接提交一条观看记录
  5306. // this.postStudyRecord(0);
  5307. this.showRecordStatus = false;
  5308. }
  5309. });
  5310. this.player.on("s2j_onVideoPause", () => {
  5311. clearInterval(this.postTimer);
  5312. });
  5313. this.player.on("s2j_onVideoPlay", () => {
  5314. if (this.postTimer) {
  5315. this.postTimer = setInterval(() => {
  5316. this.postStudyRecord(0, this.playSectionId, 5);
  5317. }, 30000);
  5318. }
  5319. });
  5320. this.player.on("s2j_onPlayOver", () => {
  5321. this.hasStart = false;
  5322. clearInterval(this.postTimer);
  5323. this.$message({
  5324. type: "success",
  5325. message: "播放完毕",
  5326. });
  5327. this.postStudyRecord(1);
  5328. });
  5329. });
  5330. },
  5331. timeEventLiving() {
  5332. var polyvPlayerContext = this.playerzb;
  5333. if (polyvPlayerContext) {
  5334. this.liveDuration = this.liveDuration + 1; //每隔1秒
  5335. console.log(this.liveDuration);
  5336. if (this.liveDuration == 2) {
  5337. //直播第2秒拍照
  5338. if (
  5339. this.goodsPhotographConfig &&
  5340. this.goodsPhotographConfig.livephotograph == 1 &&
  5341. this.sectionItem.learning != 1 &&
  5342. this.photoHistoryList.length == 0
  5343. ) {
  5344. //开启直播拍照
  5345. polyvPlayerContext.j2s_pauseVideo();
  5346. this.openPhoto();
  5347. } else {
  5348. this.postStudyRecord();
  5349. }
  5350. }
  5351. }
  5352. },
  5353. timeEvent() {
  5354. let self = this;
  5355. var polyvPlayerContext = this.player;
  5356. if (polyvPlayerContext) {
  5357. this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
  5358. // console.log(this.playTime,789,this.photoHistoryList)
  5359. //判断是否需要拍照
  5360. if (this.photoNum > 0) {
  5361. this.configPhoto();
  5362. let photoTime = 0; //获取拍照秒数
  5363. for (let i = 0; i < this.photoList.length; i++) {
  5364. photoTime = Number(this.photoList[i]); //获取拍照秒数
  5365. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  5366. //3秒区间内才触发拍照,避免拉动滚动条
  5367. if (
  5368. this.photoHistoryList.indexOf(i) < 0 &&
  5369. this.sectionItem.learning != 1
  5370. ) {
  5371. //不存在拍照历史,没有重修过,没有学过,则拍照
  5372. //启动拍照
  5373. //暂停
  5374. polyvPlayerContext.j2s_pauseVideo();
  5375. this.photoIndex = i;
  5376. this.openPhoto();
  5377. } else {
  5378. }
  5379. }
  5380. }
  5381. }
  5382. }
  5383. },
  5384. getPhotoLastRecord() {
  5385. return new Promise((resolve) => {
  5386. let self = this;
  5387. let data = {
  5388. sectionId: parseInt(self.playSectionId),
  5389. goodsId: parseInt(self.goodsId),
  5390. courseId: parseInt(self.courseId),
  5391. gradeId: parseInt(self.gradeId),
  5392. chapterId: parseInt(self.chapterId),
  5393. moduleId: parseInt(self.moduleId),
  5394. };
  5395. this.$request.getPhotoLastRecord(data).then((res) => {
  5396. //清空历史数据
  5397. self.photoHistoryList = [];
  5398. this.photoIndex = 0;
  5399. self.photoList = [];
  5400. for (let i = 0; i < res.data.length; i++) {
  5401. //-2存储随机拍照数组
  5402. if (res.data[i].photoIndex == -2) {
  5403. self.photoList = res.data[i].timeInterval.split(",");
  5404. } else {
  5405. self.photoHistoryList.push(res.data[i].photoIndex);
  5406. }
  5407. }
  5408. resolve();
  5409. });
  5410. });
  5411. },
  5412. //拍照
  5413. openPhoto() {
  5414. var polyvPlayerContext = this.player;
  5415. if (polyvPlayerContext) {
  5416. if (this.isFullScreen()) {
  5417. this.exitFullscreen();
  5418. }
  5419. }
  5420. var polyvPlayerContext = this.playerzb;
  5421. if (polyvPlayerContext) {
  5422. if (this.isFullScreen()) {
  5423. this.exitFullscreen();
  5424. }
  5425. }
  5426. this.$nextTick(() => {
  5427. if (
  5428. (window.navigator.mediaDevices &&
  5429. window.navigator.mediaDevices.getUserMedia) ||
  5430. window.navigator.getUserMedia ||
  5431. window.navigator.webkitGetUserMedia ||
  5432. window.navigator.mozGetUserMedia
  5433. ) {
  5434. // 调用用户媒体设备, 访问摄像头
  5435. this.getUserMedia(
  5436. {
  5437. video: {
  5438. width: 400,
  5439. height: 400,
  5440. },
  5441. },
  5442. this.photographSuccess,
  5443. this.photographError
  5444. );
  5445. } else {
  5446. this.photographError();
  5447. }
  5448. });
  5449. },
  5450. /**
  5451. * 退出全屏
  5452. */
  5453. exitFullscreen() {
  5454. try {
  5455. var de = document;
  5456. console.log(de);
  5457. if (de.exitFullscreen) {
  5458. de.exitFullscreen();
  5459. } else if (de.mozCancelFullScreen) {
  5460. de.mozCancelFullScreen();
  5461. } else if (de.webkitCancelFullScreen) {
  5462. de.webkitCancelFullScreen();
  5463. }
  5464. } catch (err) {}
  5465. },
  5466. fullele() {
  5467. return (
  5468. document.fullscreenElement ||
  5469. document.webkitFullscreenElement ||
  5470. document.msFullscreenElement ||
  5471. document.mozFullScreenElement ||
  5472. null
  5473. );
  5474. },
  5475. //判断是否全屏
  5476. isFullScreen() {
  5477. return !!(document.webkitIsFullScreen || this.fullele());
  5478. },
  5479. //配置随机拍照时间
  5480. configPhoto() {
  5481. var polyvPlayerContext = this.player;
  5482. let totalVideoTime = polyvPlayerContext.j2s_getDuration();
  5483. let duration = polyvPlayerContext.j2s_getCurrentTime();
  5484. let photoNum = this.photoNum;
  5485. if (!this.photoConfig) {
  5486. this.photoConfig = true;
  5487. //没有历史拍照间隔数据
  5488. if (this.photoList.length == 0) {
  5489. if (totalVideoTime >= 900) {
  5490. //大于15分钟
  5491. if (photoNum == 1) {
  5492. //开头拍1张
  5493. this.photoList.push(1);
  5494. } else if (photoNum == 3) {
  5495. //拍3张
  5496. this.photoList.push(0); //开头拍一张
  5497. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  5498. let centerMinTime = centerTime - 300; //前后5分钟
  5499. let centerMaxTime = centerTime + 300;
  5500. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  5501. this.photoList.push(centerTakeTime); //中间拍一张
  5502. let endMaxTime = totalVideoTime - 60;
  5503. let endMinTime = totalVideoTime - 300;
  5504. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  5505. this.photoList.push(endTakeTime); //最后拍一张
  5506. }
  5507. } else {
  5508. //小于15分钟,只拍前后各一张
  5509. if (photoNum == 1) {
  5510. //开头拍1张
  5511. this.photoList.push(1);
  5512. } else if (photoNum == 3) {
  5513. //拍2张
  5514. if (totalVideoTime <= 300) {
  5515. //小于5分钟
  5516. this.photoList.push(1); //开头拍一张
  5517. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  5518. this.photoList.push(endTakeTime);
  5519. } else {
  5520. this.photoList.push(1); //开头拍一张
  5521. let endMaxTime = totalVideoTime - 60;
  5522. let endMinTime = totalVideoTime - 300;
  5523. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  5524. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  5525. }
  5526. }
  5527. }
  5528. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  5529. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  5530. }
  5531. console.log(this.photoList, "随机拍照时间数组");
  5532. //兼容已有观看历史
  5533. for (let i = 0; i < this.photoList.length - 1; i++) {
  5534. if (
  5535. this.photoList[i] < duration &&
  5536. this.photoList[i + 1] > duration
  5537. ) {
  5538. this.photoIndex = i + 1;
  5539. // console.log("我的修改了photoIndex")
  5540. break;
  5541. }
  5542. if (duration > this.photoList[this.photoList.length - 1]) {
  5543. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  5544. // console.log("我的修改了photoIndex")
  5545. break;
  5546. }
  5547. }
  5548. }
  5549. },
  5550. randomNum(minNum, maxNum) {
  5551. switch (arguments.length) {
  5552. case 1:
  5553. return parseInt(Math.random() * minNum + 1, 10);
  5554. break;
  5555. case 2:
  5556. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  5557. break;
  5558. default:
  5559. return 0;
  5560. break;
  5561. }
  5562. },
  5563. //postTime 只提交随机时间
  5564. postCoursePhotoRecord(postTime = false) {
  5565. return new Promise((resolve, reject) => {
  5566. let currentTime = 0;
  5567. var polyvPlayerContext = this.player;
  5568. if (polyvPlayerContext) {
  5569. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  5570. }
  5571. let self = this;
  5572. let photoIndex = self.photoIndex;
  5573. let data = {
  5574. photo: self.ossAvatarUrl,
  5575. sectionId: parseInt(self.playSectionId),
  5576. goodsId: parseInt(self.goodsId),
  5577. courseId: parseInt(self.courseId),
  5578. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  5579. gradeId: parseInt(self.gradeId),
  5580. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  5581. photoNum: parseInt(self.photoNum),
  5582. chapterId: parseInt(self.chapterId),
  5583. moduleId: parseInt(self.moduleId),
  5584. timeInterval: postTime ? self.photoList.join(",") : "",
  5585. };
  5586. console.log("提交接口", data);
  5587. this.$request
  5588. .coursePhotoRecord(data)
  5589. .then((res) => {
  5590. console.log(res, "res");
  5591. resolve();
  5592. })
  5593. .catch((err) => {
  5594. console.log(err, "err");
  5595. reject();
  5596. });
  5597. });
  5598. },
  5599. /**
  5600. * @param {String} 直播预览
  5601. */
  5602. loadPlayerScriptzb(callback) {
  5603. if (!window.polyvLivePlayer) {
  5604. const myScript = document.createElement("script");
  5605. myScript.setAttribute("src", this.playerJs);
  5606. myScript.onload = callback;
  5607. document.body.appendChild(myScript);
  5608. } else {
  5609. callback();
  5610. }
  5611. },
  5612. loadPlayerScript(callback) {
  5613. if (!window.polyvPlayer) {
  5614. const myScript = document.createElement("script");
  5615. myScript.setAttribute("src", this.vodPlayerJs);
  5616. myScript.onload = callback;
  5617. document.body.appendChild(myScript);
  5618. } else {
  5619. callback();
  5620. }
  5621. },
  5622. clears() {
  5623. return new Promise((resolve, reject) => {
  5624. this.vid = "";
  5625. this.vidzb = "";
  5626. if (this.player) {
  5627. this.player.destroy();
  5628. }
  5629. if (this.playerzb) {
  5630. this.playerzb.destroy();
  5631. }
  5632. resolve();
  5633. });
  5634. },
  5635. /**
  5636. * 提交观看记录
  5637. */
  5638. postStudyRecord(
  5639. status = 0,
  5640. sectionId = this.playSectionId,
  5641. PlayDuration = 0
  5642. ) {
  5643. let currentTime = 0;
  5644. var polyvPlayerContext = this.player;
  5645. if (polyvPlayerContext) {
  5646. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  5647. }
  5648. if (this.vidzb) {
  5649. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  5650. }
  5651. let self = this;
  5652. console.log(this);
  5653. console.log(PlayDuration, "PlayDuration");
  5654. let data = {
  5655. fromPlat: 2, //来源平台 1小程序 2网站
  5656. photo: self.ossAvatarUrl,
  5657. sectionId: parseInt(this.playSectionId),
  5658. goodsId: parseInt(this.goodsId),
  5659. courseId: parseInt(this.courseId),
  5660. studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
  5661. gradeId: parseInt(this.gradeId),
  5662. chapterId: parseInt(this.chapterId),
  5663. moduleId: parseInt(this.moduleId),
  5664. videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
  5665. orderGoodsId: this.orderGoodsId,
  5666. };
  5667. if (this.ossAvatarUrl) {
  5668. data.similarity = this.compareFaceData; // 相似度
  5669. }
  5670. if (status > 0) {
  5671. data.status = status;
  5672. }
  5673. this.$request
  5674. .studyRecord(data)
  5675. .then((res) => {
  5676. if (status > 0) {
  5677. //看完视频刷新父级列表
  5678. let rebuildObj = this.getSameObj(this.sectionItem);
  5679. this.refreshParentList(this.sectionItem, rebuildObj);
  5680. }
  5681. self.ossAvatarUrl = "";
  5682. })
  5683. .catch((err) => {
  5684. console.log(err);
  5685. this.$message({
  5686. type: "warning",
  5687. message: err.msg,
  5688. });
  5689. });
  5690. },
  5691. /**
  5692. * 获取重修列表中是否有相同对象
  5693. */
  5694. getSameObj(metaObj) {
  5695. let newObj = false;
  5696. if (this.reMenuList.length) {
  5697. console.log(this.reMenuList, "this.reMenuList");
  5698. this.reMenuList.forEach((menu) => {
  5699. if (menu.type == 3) {
  5700. let isSame = this.contrast(metaObj, menu);
  5701. if (isSame) {
  5702. newObj = isSame;
  5703. }
  5704. } else {
  5705. if (menu.list && menu.list.length) {
  5706. menu.list.forEach((menuItem) => {
  5707. if (menuItem.type == 1) {
  5708. console.log(menuItem, metaObj);
  5709. let isSame = this.contrast(metaObj, menuItem);
  5710. if (isSame) {
  5711. newObj = isSame;
  5712. }
  5713. } else {
  5714. if (menuItem.list && menuItem.list.length) {
  5715. menuItem.list.forEach((menuChild) => {
  5716. if (menuChild.type == 1) {
  5717. let isSame = this.contrast(metaObj, menuChild);
  5718. if (isSame) {
  5719. newObj = isSame;
  5720. }
  5721. }
  5722. });
  5723. }
  5724. }
  5725. });
  5726. }
  5727. }
  5728. });
  5729. return newObj;
  5730. } else {
  5731. return false;
  5732. }
  5733. },
  5734. contrast(obj1, obj2) {
  5735. let moduleId1 = obj1.moduleId || 0;
  5736. let chapterId1 = obj1.chapterId || 0;
  5737. let sectionId1 = obj1.sectionId || obj1.menuId;
  5738. let moduleId2 = obj2.moduleId || 0;
  5739. let chapterId2 = obj2.chapterId || 0;
  5740. let sectionId2 = obj2.sectionId || obj2.menuId;
  5741. //转字符串后对比是否一致
  5742. return moduleId1 == moduleId2 &&
  5743. chapterId1 == chapterId2 &&
  5744. sectionId1 == sectionId2
  5745. ? obj2
  5746. : false;
  5747. },
  5748. /**
  5749. * 刷新父级列表
  5750. */
  5751. refreshParentList(sectionItem, rebuildObj) {
  5752. console.log(sectionItem, "sectionItem");
  5753. console.log(rebuildObj, "rebuildObj");
  5754. let self = this;
  5755. if (sectionItem.menuId) {
  5756. //最外层节有menuid
  5757. //普通章节目录
  5758. this.$request
  5759. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  5760. .then((res) => {
  5761. for (let i = 0; i < res.rows.length; i++) {
  5762. let item = res.rows[i];
  5763. if (item.type == 3) {
  5764. self.menuList[i].learning = item.learning;
  5765. self.menuList[i].rebuild = item.rebuild;
  5766. }
  5767. }
  5768. });
  5769. if (this.menuTab.length > 1) {
  5770. //有重修目录
  5771. this.$request
  5772. .reMenuList({
  5773. courseId: this.courseId,
  5774. gradeId: this.gradeId,
  5775. rebuild: 1,
  5776. })
  5777. .then((res) => {
  5778. if (res.rows.length > 0) {
  5779. for (let i = 0; i < res.rows.length; i++) {
  5780. let item = res.rows[i];
  5781. item.id = item.menuId;
  5782. item.name = item.menuName;
  5783. item.menuType = item.type;
  5784. item.showList = false;
  5785. item.list = [];
  5786. item.isRebuild = 1;
  5787. }
  5788. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5789. //筛选剩下的选项
  5790. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5791. });
  5792. } else {
  5793. this.menuTab = [
  5794. {
  5795. name: "1",
  5796. label: "章节目录",
  5797. },
  5798. ];
  5799. this.courseTabIndex = "1";
  5800. self.reMenuList = [];
  5801. }
  5802. });
  5803. }
  5804. } else if (!sectionItem.moduleId) {
  5805. //第二层节没有moduleid
  5806. this.$request
  5807. .reSectionList({
  5808. chapterId: sectionItem.chapterId,
  5809. gradeId: this.gradeId,
  5810. courseId: this.courseId,
  5811. moduleId: 0,
  5812. })
  5813. .then((res) => {
  5814. let newArr = res.data.filter((item) => {
  5815. return item.type != 2;
  5816. });
  5817. sectionItem.parent.canLearn = newArr.every((item) => {
  5818. if (item.learning == 1) {
  5819. return true;
  5820. } else {
  5821. return false;
  5822. }
  5823. });
  5824. res.data.forEach((section) => {
  5825. section.isRebuild = 1;
  5826. section.parent = sectionItem.parent;
  5827. });
  5828. this.menuList.forEach((menu) => {
  5829. if (menu.menuId == sectionItem.chapterId) {
  5830. menu.list = res.data;
  5831. }
  5832. });
  5833. });
  5834. if (this.menuTab.length > 1 && rebuildObj) {
  5835. this.$request
  5836. .reSectionList({
  5837. chapterId: rebuildObj.chapterId,
  5838. gradeId: this.gradeId,
  5839. courseId: this.courseId,
  5840. moduleId: 0,
  5841. rebuild: 1,
  5842. })
  5843. .then((res) => {
  5844. let newArr = res.data.filter((item) => {
  5845. return item.type != 2;
  5846. });
  5847. rebuildObj.parent.canLearn = newArr.every((item) => {
  5848. if (item.learning == 1) {
  5849. return true;
  5850. } else {
  5851. return false;
  5852. }
  5853. });
  5854. res.data.forEach((section) => {
  5855. section.parent = rebuildObj.parent;
  5856. });
  5857. this.reMenuList.forEach((menu) => {
  5858. if (menu.menuId == rebuildObj.chapterId) {
  5859. menu.list = res.data;
  5860. }
  5861. });
  5862. });
  5863. this.$request
  5864. .reMenuList({
  5865. courseId: this.courseId,
  5866. gradeId: this.gradeId,
  5867. rebuild: 1,
  5868. })
  5869. .then((res) => {
  5870. if (res.rows.length > 0) {
  5871. for (let i = 0; i < res.rows.length; i++) {
  5872. let item = res.rows[i];
  5873. item.id = item.menuId;
  5874. item.name = item.menuName;
  5875. item.menuType = item.type;
  5876. item.showList = false;
  5877. item.list = [];
  5878. item.isRebuild = 1;
  5879. }
  5880. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5881. //筛选剩下的选项
  5882. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5883. });
  5884. } else {
  5885. this.menuTab = [
  5886. {
  5887. name: "1",
  5888. label: "章节目录",
  5889. },
  5890. ];
  5891. this.courseTabIndex = "1";
  5892. self.reMenuList = [];
  5893. }
  5894. });
  5895. }
  5896. } else {
  5897. //第三层节有moduleid和chapterid都有
  5898. this.$request
  5899. .reSectionList({
  5900. chapterId: sectionItem.chapterId,
  5901. gradeId: this.gradeId,
  5902. courseId: this.courseId,
  5903. moduleId: sectionItem.moduleId,
  5904. })
  5905. .then((res) => {
  5906. let newArr = res.data.filter((item) => {
  5907. return item.type != 2;
  5908. });
  5909. sectionItem.parent.canLearn = newArr.every((item) => {
  5910. if (item.learning == 1) {
  5911. return true;
  5912. } else {
  5913. return false;
  5914. }
  5915. });
  5916. res.data.forEach((section) => {
  5917. section.parent = sectionItem.parent;
  5918. });
  5919. this.menuList.forEach((menu) => {
  5920. if (menu.list && menu.list.length) {
  5921. menu.list.forEach((chapter) => {
  5922. if (
  5923. chapter.moduleId == sectionItem.moduleId &&
  5924. chapter.chapterId == sectionItem.chapterId
  5925. ) {
  5926. console.log(res.data, "res.data");
  5927. console.log(chapter.list, "chapter.list");
  5928. chapter.list = res.data;
  5929. }
  5930. });
  5931. }
  5932. });
  5933. });
  5934. if (this.menuTab.length > 1 && rebuildObj) {
  5935. this.$request
  5936. .reSectionList({
  5937. chapterId: rebuildObj.chapterId,
  5938. gradeId: this.gradeId,
  5939. courseId: this.courseId,
  5940. moduleId: rebuildObj.moduleId,
  5941. rebuild: 1,
  5942. })
  5943. .then((res) => {
  5944. let newArr = res.data.filter((item) => {
  5945. return item.type != 2;
  5946. });
  5947. rebuildObj.parent.canLearn = newArr.every((item) => {
  5948. if (item.learning == 1) {
  5949. return true;
  5950. } else {
  5951. return false;
  5952. }
  5953. });
  5954. res.data.forEach((section) => {
  5955. section.parent = rebuildObj.parent;
  5956. });
  5957. this.reMenuList.forEach((menu) => {
  5958. if (menu.list && menu.list.length) {
  5959. menu.list.forEach((chapter) => {
  5960. if (
  5961. chapter.moduleId == rebuildObj.moduleId &&
  5962. chapter.chapterId == rebuildObj.chapterId
  5963. ) {
  5964. chapter.list = res.data;
  5965. }
  5966. });
  5967. }
  5968. });
  5969. });
  5970. this.$request
  5971. .reMenuList({
  5972. courseId: this.courseId,
  5973. gradeId: this.gradeId,
  5974. rebuild: 1,
  5975. })
  5976. .then((res) => {
  5977. if (res.rows.length > 0) {
  5978. for (let i = 0; i < res.rows.length; i++) {
  5979. let item = res.rows[i];
  5980. item.id = item.menuId;
  5981. item.name = item.menuName;
  5982. item.menuType = item.type;
  5983. item.showList = false;
  5984. item.list = [];
  5985. item.isRebuild = 1;
  5986. }
  5987. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5988. //筛选剩下的选项
  5989. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5990. });
  5991. } else {
  5992. this.menuTab = [
  5993. {
  5994. name: "1",
  5995. label: "章节目录",
  5996. },
  5997. ];
  5998. this.courseTabIndex = "1";
  5999. self.reMenuList = [];
  6000. }
  6001. });
  6002. }
  6003. }
  6004. },
  6005. getRecordLast() {
  6006. let self = this;
  6007. return new Promise((resolve) => {
  6008. let data = {
  6009. gradeId: Number(self.gradeId),
  6010. goodsId: Number(self.goodsId),
  6011. sectionId: Number(self.playSectionId),
  6012. courseId: Number(self.courseId),
  6013. chapterId: parseInt(self.chapterId),
  6014. moduleId: parseInt(self.moduleId),
  6015. };
  6016. self.$request.recordLast(data).then((res) => {
  6017. resolve(res.data);
  6018. });
  6019. });
  6020. },
  6021. /**
  6022. * 获取笔记列表
  6023. */
  6024. getNoteList() {
  6025. let self = this;
  6026. self.noteList = [];
  6027. let data = {
  6028. courseId: this.courseId,
  6029. gradeId: this.gradeId,
  6030. goodsId: this.goodsId,
  6031. pageNum: this.noteParams.pageNum,
  6032. pageSize: this.noteParams.pageSize,
  6033. };
  6034. if (this.playSectionId > 0) {
  6035. data.sectionId = this.playSectionId;
  6036. }
  6037. this.$request.noteList(data).then((res) => {
  6038. self.noteList = res.rows;
  6039. self.noteTotal = res.total;
  6040. });
  6041. },
  6042. noteClick(note) {
  6043. if (this.vid) {
  6044. //切换视频
  6045. if (this.vid == note.recordingUrl) {
  6046. var polyvPlayerContext = this.player;
  6047. if (polyvPlayerContext) {
  6048. polyvPlayerContext.j2s_seekVideo(note.noteSecond);
  6049. }
  6050. } else {
  6051. var polyvPlayerContext = this.player;
  6052. if (polyvPlayerContext) {
  6053. polyvPlayerContext.changeVid(note.recordingUrl);
  6054. }
  6055. }
  6056. } else {
  6057. var polyvPlayerContext = this.player;
  6058. console.log(polyvPlayerContext);
  6059. if (polyvPlayerContext) {
  6060. polyvPlayerContext.changeVid(note.recordingUrl);
  6061. } else {
  6062. this.vid = note.recordingUrl;
  6063. console.log(note.recordingUrl);
  6064. this.moduleId = note.moduleId;
  6065. this.chapterId = note.chapterId;
  6066. this.playSectionId = note.sectionId;
  6067. note.sectionType = 3;
  6068. this.loadPlayerScript(this.loadPlayer);
  6069. }
  6070. }
  6071. this.recordObj = { videoCurrentTime: note.noteSecond };
  6072. },
  6073. getMenuList() {
  6074. let self = this;
  6075. this.$request
  6076. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  6077. .then((res) => {
  6078. for (let i = 0; i < res.rows.length; i++) {
  6079. let item = res.rows[i];
  6080. item.id = item.menuId;
  6081. item.name = item.menuName;
  6082. item.menuType = item.type;
  6083. item.showList = false;
  6084. item.list = [];
  6085. item.parent = this.menuList;
  6086. }
  6087. self.menuList = res.rows;
  6088. console.log(this.menuList, "menuList");
  6089. //展开第一个
  6090. if (this.needOpen) {
  6091. for (let i = 0; i < res.rows.length; i++) {
  6092. if (res.rows[i].type == 1) {
  6093. this.menuIndex = [i];
  6094. this.openModule(this.menuList[i]);
  6095. break;
  6096. } else if (res.rows[i].type == 2) {
  6097. this.menuIndex = [i];
  6098. // this.needOpen = false;
  6099. this.openChapter(this.menuList[i]);
  6100. break;
  6101. }
  6102. }
  6103. //第一个是节,直接播放
  6104. if (self.menuList.length) {
  6105. if (
  6106. self.menuList[0].type == 3 &&
  6107. !this.sectionItem.recordingUrl &&
  6108. self.menuList[0].sectionType != 2
  6109. ) {
  6110. // this.getResource(self.menuList[0]);
  6111. }
  6112. }
  6113. }
  6114. });
  6115. },
  6116. getReMenuList() {
  6117. let self = this;
  6118. this.$request
  6119. .reMenuList({
  6120. courseId: this.courseId,
  6121. rebuild: 1,
  6122. gradeId: this.gradeId,
  6123. })
  6124. .then((res) => {
  6125. for (let i = 0; i < res.rows.length; i++) {
  6126. let item = res.rows[i];
  6127. item.id = item.menuId;
  6128. item.name = item.menuName;
  6129. item.menuType = item.type;
  6130. item.showList = false;
  6131. item.list = [];
  6132. item.parent = this.reMenuList;
  6133. item.isRebuild = 1;
  6134. }
  6135. self.reMenuList = res.rows;
  6136. if (self.reMenuList.length > 0) {
  6137. this.menuTab = [
  6138. {
  6139. name: "1",
  6140. label: "章节目录",
  6141. },
  6142. {
  6143. name: "2",
  6144. label: "重修目录",
  6145. },
  6146. ];
  6147. if (this.courseTabIndex == "2") {
  6148. return;
  6149. }
  6150. this.courseTabIndex = "1";
  6151. } else {
  6152. this.menuTab = [
  6153. {
  6154. name: "1",
  6155. label: "章节目录",
  6156. },
  6157. ];
  6158. this.courseTabIndex = "1";
  6159. }
  6160. });
  6161. },
  6162. /**
  6163. * 获取讲义权限
  6164. */
  6165. courseHandouts() {
  6166. this.$request
  6167. .courseHandouts(this.goodsData.handoutsId)
  6168. .then((res) => {
  6169. this.courseHandoutsData = res.data;
  6170. const loadingTask = pdf.createLoadingTask(
  6171. this.$tools.splitImgHost(this.courseHandoutsData.handoutsUrl)
  6172. );
  6173. loadingTask.promise
  6174. .then((pdf) => {
  6175. this.numPages = pdf.numPages;
  6176. })
  6177. .catch((err) => {});
  6178. })
  6179. .catch((err) => {});
  6180. },
  6181. /**
  6182. * 获取培训项目详情
  6183. */
  6184. courseBusiness() {
  6185. this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
  6186. this.businessData = res.data;
  6187. });
  6188. },
  6189. /**提出答疑 */
  6190. addAnswer() {
  6191. if (!this.textarea) {
  6192. this.$message.warning("请输入疑问内容");
  6193. return;
  6194. }
  6195. let data = {
  6196. courseId: this.courseId,
  6197. goodsId: this.goodsId,
  6198. orderGoodsId: this.orderGoodsId,
  6199. answerText: this.textarea,
  6200. };
  6201. this.$request.addAnswer(data).then((res) => {
  6202. this.textarea = "";
  6203. this.getAnswerList();
  6204. });
  6205. },
  6206. /**回复 */
  6207. answerBack(row) {
  6208. this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
  6209. confirmButtonText: "确定",
  6210. cancelButtonText: "取消",
  6211. inputErrorMessage: "输入不能为空",
  6212. inputValidator: (value) => {
  6213. let str = value.replace(/^ +| +$/g, "");
  6214. // 点击按钮时,对文本框里面的值进行验证
  6215. if (!str) {
  6216. return "输入不能为空";
  6217. }
  6218. },
  6219. })
  6220. .then(({ value }) => {
  6221. let data = {
  6222. assignUserId: row.userId,
  6223. assignAnswerId: row.answerId,
  6224. courseId: this.courseId,
  6225. goodsId: this.goodsId,
  6226. orderGoodsId: this.orderGoodsId,
  6227. answerText: value,
  6228. assignAnswerText: row.assignAnswerText,
  6229. };
  6230. this.$request.addAnswer(data).then((res) => {
  6231. this.getAnswerList();
  6232. });
  6233. })
  6234. .catch(() => {});
  6235. },
  6236. getAnswerList() {
  6237. let self = this;
  6238. this.$request
  6239. .answerList({ courseId: this.courseId, goodsId: this.goodsId })
  6240. .then((res) => {
  6241. let data1 = [];
  6242. let data2 = [];
  6243. let copydata2 = [];
  6244. res.rows.forEach((item) => {
  6245. if (!item.assignAnswerId) {
  6246. data1.push(item);
  6247. } else {
  6248. data2.push(item);
  6249. copydata2.push(item);
  6250. }
  6251. });
  6252. data2.forEach((item, index) => {
  6253. //回复层
  6254. data1.forEach((items) => {
  6255. //提问层
  6256. if (items.answerId === item.assignAnswerId) {
  6257. if (
  6258. items.newArraysAnswerList &&
  6259. items.newArraysAnswerList.length
  6260. ) {
  6261. items.newArraysAnswerList.push(item);
  6262. } else {
  6263. items.newArraysAnswerList = [item];
  6264. }
  6265. let indexInd = copydata2.findIndex((itemsxs) => {
  6266. return itemsxs.answerId === item.answerId;
  6267. });
  6268. if (indexInd !== -1) {
  6269. copydata2.splice(indexInd, 1);
  6270. }
  6271. }
  6272. });
  6273. });
  6274. copydata2.forEach((it) => {
  6275. for (let i = 0; i < data1.length; i++) {
  6276. let STATUS = null;
  6277. if (data1[i].newArraysAnswerList) {
  6278. STATUS = data1[i].newArraysAnswerList.some((items) => {
  6279. return items.answerId === it.assignAnswerId;
  6280. });
  6281. }
  6282. if (STATUS) {
  6283. data1[i].newArraysAnswerList.push(it);
  6284. break;
  6285. }
  6286. }
  6287. });
  6288. self.answerList = data1.reverse();
  6289. });
  6290. },
  6291. async courseCourseList() {
  6292. return new Promise((resolve) => {
  6293. this.param.goodsId = this.goodsId;
  6294. this.param.gradeId = this.gradeId;
  6295. this.$request.courseCourseList(this.param).then(async (res) => {
  6296. this.courseList.push(...res.rows);
  6297. if (!this.courseId) {
  6298. this.courseId = this.courseList[0].courseId;
  6299. }
  6300. this.param.total = res.total;
  6301. await this.courseChange();
  6302. resolve();
  6303. });
  6304. });
  6305. },
  6306. download(url, fileName) {
  6307. let xhr = new XMLHttpRequest();
  6308. xhr.open("get", url, true);
  6309. xhr.setRequestHeader("Content-Type", `application/pdf`);
  6310. xhr.responseType = "blob";
  6311. let that = this;
  6312. xhr.onload = function () {
  6313. if (this.status == 200) {
  6314. //接受二进制文件流
  6315. var blob = this.response;
  6316. that.downloadExportFile(blob, fileName);
  6317. }
  6318. };
  6319. xhr.send();
  6320. },
  6321. downloadExportFile(blob, tagFileName) {
  6322. let downloadElement = document.createElement("a");
  6323. let href = "";
  6324. if (typeof blob == "string") {
  6325. downloadElement.target = "_blank";
  6326. } else {
  6327. href = window.URL.createObjectURL(blob); //创建下载的链接
  6328. }
  6329. downloadElement.href = href;
  6330. downloadElement.download = tagFileName;
  6331. //下载后文件名
  6332. document.body.appendChild(downloadElement);
  6333. downloadElement.click(); //点击下载
  6334. document.body.removeChild(downloadElement); //下载完成移除元素
  6335. if (typeof blob != "string") {
  6336. window.URL.revokeObjectURL(href); //释放掉blob对象
  6337. }
  6338. },
  6339. print() {
  6340. document.getElementById("printIframe").contentWindow.print();
  6341. },
  6342. previvew(url) {
  6343. this.showPdf = true;
  6344. },
  6345. noteSubmit() {
  6346. let self = this;
  6347. if (!(this.playSectionId > 0)) {
  6348. this.$message({
  6349. message: "目前无播放视频",
  6350. type: "warning",
  6351. });
  6352. return;
  6353. }
  6354. if (!this.textareaNote) {
  6355. this.$message({
  6356. message: "请输入内容",
  6357. type: "warning",
  6358. });
  6359. return;
  6360. }
  6361. // if (!this.gradeId) {
  6362. // this.$message({
  6363. // message: "暂无班级数据",
  6364. // type: "warning",
  6365. // });
  6366. // return;
  6367. // }
  6368. var polyvPlayerContext = this.player;
  6369. let noteDate = this.$tools.getZeroTime();
  6370. let noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  6371. console.log(noteSecond, "noteSecond");
  6372. if (!noteSecond) {
  6373. if (noteSecond == 0) {
  6374. //播放结束
  6375. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  6376. }
  6377. if (!noteSecond) {
  6378. this.$message({
  6379. message: "视频暂未开始",
  6380. type: "warning",
  6381. });
  6382. return;
  6383. }
  6384. }
  6385. let data = {
  6386. gradeId: this.gradeId,
  6387. goodsId: this.goodsId,
  6388. sectionId: this.playSectionId,
  6389. courseId: this.courseId,
  6390. noteText: this.textareaNote,
  6391. noteDate: noteDate,
  6392. noteSecond: noteSecond,
  6393. moduleId: this.moduleId,
  6394. chapterId: this.chapterId,
  6395. };
  6396. this.$request.postNote(data).then((res) => {
  6397. this.$message({
  6398. message: "发布成功",
  6399. type: "success",
  6400. });
  6401. self.getNoteList();
  6402. this.textareaNote = "";
  6403. });
  6404. },
  6405. del(item) {
  6406. console.log(item);
  6407. let data = { answerId: item.answerId, status: -1 };
  6408. this.$request.delAnswer(data).then((res) => {
  6409. this.$message({
  6410. message: "删除成功",
  6411. type: "success",
  6412. });
  6413. this.getAnswerList();
  6414. });
  6415. },
  6416. /**
  6417. * 打印
  6418. */
  6419. printView(url) {
  6420. console.log("触发打印", url);
  6421. printJS({
  6422. printable: url,
  6423. type: "pdf",
  6424. header: null,
  6425. targetStyles: ["*"],
  6426. style: "@page {margin:0 10mm}",
  6427. });
  6428. // this.print(url);
  6429. },
  6430. // 打印方法
  6431. print(filePath) {
  6432. console.log("执行打印");
  6433. let iframe = document.createElement("iframe");
  6434. iframe.style.border = "0px";
  6435. iframe.style.position = "absolute";
  6436. iframe.style.width = "0px";
  6437. iframe.style.height = "0px";
  6438. iframe.style.right = "0px";
  6439. iframe.style.top = "0px";
  6440. iframe.setAttribute("src", filePath);
  6441. iframe.onload = () => {
  6442. iframe.contentWindow.print();
  6443. // setTimeout(() => {
  6444. // document.body.removeChild(iframe);
  6445. // });
  6446. };
  6447. document.body.append(iframe);
  6448. },
  6449. },
  6450. };
  6451. </script>
  6452. <!-- Add "scoped" attribute to limit CSS to this component only -->
  6453. <style scoped lang="scss">
  6454. .course-detail {
  6455. .living-img {
  6456. width: 17px;
  6457. vertical-align: middle;
  6458. }
  6459. .section {
  6460. padding-bottom: 30px;
  6461. &__header {
  6462. height: 40px;
  6463. display: flex;
  6464. align-items: center;
  6465. padding: 0 20px;
  6466. }
  6467. &__body {
  6468. .course-info {
  6469. &__header {
  6470. .left-box {
  6471. width: 810px;
  6472. height: 455px;
  6473. float: left;
  6474. background-size: cover;
  6475. background-position: center center;
  6476. background-repeat: no-repeat;
  6477. position: relative;
  6478. .video {
  6479. width: 100%;
  6480. height: 100%;
  6481. }
  6482. .live-btn {
  6483. position: absolute;
  6484. left: 0;
  6485. top: 0;
  6486. z-index: 999;
  6487. overflow: hidden;
  6488. width: 100%;
  6489. height: 100%;
  6490. background: url("~@/assets/live-bg.png") no-repeat center;
  6491. background-size: cover;
  6492. .btn {
  6493. display: block;
  6494. margin: 280px auto 0;
  6495. width: 160px;
  6496. height: 40px;
  6497. line-height: 40px;
  6498. padding: 0;
  6499. text-align: center;
  6500. border-radius: 20px;
  6501. }
  6502. }
  6503. }
  6504. .recordStyle {
  6505. position: absolute;
  6506. bottom: 90px;
  6507. padding: 6px 12px;
  6508. left: 8px;
  6509. background-color: rgba(0, 0, 0, 0.4);
  6510. color: #fff;
  6511. border-radius: 24px;
  6512. user-select: none;
  6513. .btn_sty {
  6514. cursor: pointer;
  6515. }
  6516. }
  6517. .right-box {
  6518. width: 462px;
  6519. height: 455px;
  6520. background: #060e1a;
  6521. border-radius: 0px;
  6522. float: right;
  6523. &__header {
  6524. .tabs {
  6525. /deep/.el-tabs__nav-wrap::after {
  6526. background-color: #999;
  6527. }
  6528. /deep/ .el-tabs__header {
  6529. margin: 0;
  6530. }
  6531. .label {
  6532. color: #fff;
  6533. height: 40px;
  6534. line-height: 40px;
  6535. padding: 0 20px;
  6536. }
  6537. .item {
  6538. &__title {
  6539. padding-left: 12px;
  6540. height: 40px;
  6541. line-height: 40px;
  6542. cursor: pointer;
  6543. font-size: 14px;
  6544. font-family: Microsoft YaHei;
  6545. font-weight: bold;
  6546. color: #fff;
  6547. .el-icon-caret-right,
  6548. .el-icon-caret-bottom {
  6549. color: #999;
  6550. }
  6551. }
  6552. &__content {
  6553. .bank-chapter {
  6554. &__item {
  6555. color: #fff;
  6556. font-size: 14px;
  6557. &__text {
  6558. padding: 8px 8px 8px 24px;
  6559. cursor: pointer;
  6560. flex: 1;
  6561. .el-icon-caret-right,
  6562. .el-icon-caret-bottom {
  6563. color: #999;
  6564. }
  6565. }
  6566. }
  6567. }
  6568. .bank-section {
  6569. &__item {
  6570. color: #fff;
  6571. font-size: 14px;
  6572. display: flex;
  6573. align-items: center;
  6574. &.active {
  6575. background: #132b4d;
  6576. font-size: 14px;
  6577. font-family: Microsoft YaHei;
  6578. font-weight: bold;
  6579. color: #3f8dfd;
  6580. }
  6581. &__text {
  6582. flex: 1;
  6583. padding: 8px 8px 8px 12px;
  6584. display: flex;
  6585. flex-direction: column;
  6586. justify-content: center;
  6587. cursor: pointer;
  6588. .el-icon-caret-right,
  6589. .el-icon-caret-bottom {
  6590. color: #999;
  6591. }
  6592. }
  6593. .test-btn {
  6594. margin-left: 10px;
  6595. width: 32px;
  6596. height: 20px;
  6597. background: #007aff;
  6598. border-radius: 4px;
  6599. line-height: 18px;
  6600. color: #fff;
  6601. text-align: center;
  6602. }
  6603. .note {
  6604. margin-left: 10px;
  6605. width: 32px;
  6606. height: 20px;
  6607. border: 1px solid #ff3b30;
  6608. border-radius: 4px;
  6609. line-height: 18px;
  6610. color: #ff3b30;
  6611. text-align: center;
  6612. &--yellow {
  6613. border-color: #ff9500;
  6614. color: #ff9500;
  6615. }
  6616. &--blue {
  6617. border-color: #3f8dfd;
  6618. color: #3f8dfd;
  6619. }
  6620. }
  6621. .during {
  6622. color: #999;
  6623. margin-right: 10px;
  6624. }
  6625. .btn {
  6626. margin-right: 12px;
  6627. width: 48px;
  6628. height: 20px;
  6629. border: 1px solid #ff3b30;
  6630. background: #ff3b30;
  6631. border-radius: 4px;
  6632. line-height: 18px;
  6633. color: #fff;
  6634. text-align: center;
  6635. &--green {
  6636. border: 1px solid #34c759;
  6637. background: #34c759;
  6638. }
  6639. }
  6640. .live-btn {
  6641. margin-left: 20px;
  6642. padding: 2px 5px;
  6643. border-radius: 4px;
  6644. background: #eeeeee;
  6645. line-height: 18px;
  6646. color: #666666;
  6647. text-align: center;
  6648. &--yellow {
  6649. background: #fff7eb;
  6650. color: #ff9500;
  6651. }
  6652. &--blue {
  6653. border-color: #ebf4ff;
  6654. color: #007aff;
  6655. }
  6656. }
  6657. }
  6658. }
  6659. }
  6660. }
  6661. }
  6662. .title {
  6663. height: 40px;
  6664. border-bottom: 1px solid #999;
  6665. color: #fff;
  6666. .select {
  6667. width: 100%;
  6668. }
  6669. /deep/ .el-input__icon {
  6670. width: 20px;
  6671. height: 20px;
  6672. border: 1px solid #fff;
  6673. border-radius: 4px;
  6674. margin-top: 10px;
  6675. line-height: 20px;
  6676. }
  6677. /deep/ .el-input__inner {
  6678. color: #fff;
  6679. font-size: 16px;
  6680. background: none;
  6681. border: 0;
  6682. }
  6683. }
  6684. }
  6685. &__body {
  6686. height: 374px;
  6687. overflow-y: scroll;
  6688. &::-webkit-scrollbar {
  6689. width: 6px;
  6690. }
  6691. &::-webkit-scrollbar-track {
  6692. background-color: #060e1a;
  6693. -webkit-border-radius: 2em;
  6694. -moz-border-radius: 2em;
  6695. border-radius: 2em;
  6696. }
  6697. &::-webkit-scrollbar-thumb {
  6698. background-color: #eeeeee;
  6699. -webkit-border-radius: 2em;
  6700. -moz-border-radius: 2em;
  6701. border-radius: 2em;
  6702. }
  6703. }
  6704. }
  6705. }
  6706. &__body {
  6707. /deep/ .el-tabs__item {
  6708. padding: 0 20px !important;
  6709. height: 80px;
  6710. line-height: 80px;
  6711. }
  6712. .course-img {
  6713. width: 100%;
  6714. }
  6715. .course-menu {
  6716. margin-top: 25px;
  6717. .left-box {
  6718. width: 948px;
  6719. float: left;
  6720. &__header {
  6721. padding-right: 50px;
  6722. position: relative;
  6723. .item {
  6724. width: auto;
  6725. margin-right: 24px;
  6726. font-size: 16px;
  6727. font-family: Microsoft YaHei;
  6728. font-weight: 400;
  6729. color: #333333;
  6730. background: #eeeeee;
  6731. border-radius: 8px;
  6732. padding: 12px;
  6733. position: relative;
  6734. &.canlearn {
  6735. background: #3f8dfd;
  6736. color: #fff;
  6737. }
  6738. }
  6739. }
  6740. &__body {
  6741. .buy-note {
  6742. margin-right: 50px;
  6743. }
  6744. .item {
  6745. margin-top: 24px;
  6746. padding: 16px;
  6747. background: #eee;
  6748. border-radius: 10px;
  6749. &__title {
  6750. font-size: 16px;
  6751. font-family: Microsoft YaHei;
  6752. font-weight: bold;
  6753. color: #333333;
  6754. .note {
  6755. display: inline-block;
  6756. margin-left: 20px;
  6757. width: 40px;
  6758. height: 24px;
  6759. border: 1px solid #ff3b30;
  6760. border-radius: 8px;
  6761. line-height: 22px;
  6762. color: #ff3b30;
  6763. text-align: center;
  6764. }
  6765. }
  6766. &__content {
  6767. margin-top: 12px;
  6768. background: #f5f7fa;
  6769. }
  6770. }
  6771. }
  6772. }
  6773. .right-box {
  6774. width: 255px;
  6775. float: right;
  6776. .title {
  6777. font-size: 16px;
  6778. font-family: Microsoft YaHei;
  6779. font-weight: 400;
  6780. color: #333333;
  6781. text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
  6782. position: relative;
  6783. .more {
  6784. font-size: 16px;
  6785. font-family: Microsoft YaHei;
  6786. font-weight: 400;
  6787. color: #999999;
  6788. position: absolute;
  6789. right: 0;
  6790. }
  6791. }
  6792. .list {
  6793. .course-item {
  6794. }
  6795. }
  6796. }
  6797. }
  6798. .answer-question {
  6799. &__header {
  6800. border-bottom: 1px solid #eee;
  6801. .textarea-wrap {
  6802. background: #f9f9f9;
  6803. border: 1px solid #eeeeee;
  6804. border-radius: 8px;
  6805. .textarea {
  6806. height: 100%;
  6807. }
  6808. }
  6809. .submit {
  6810. padding: 10px 20px;
  6811. border-radius: 20px;
  6812. text-align: center;
  6813. font-size: 16px;
  6814. margin: 10px 0;
  6815. float: right;
  6816. }
  6817. }
  6818. &__body {
  6819. .question-list {
  6820. &__item {
  6821. padding: 20px 0;
  6822. display: flex;
  6823. &__avatar {
  6824. width: 40px;
  6825. height: 40px;
  6826. display: table-cell;
  6827. border-radius: 50%;
  6828. text-align: center;
  6829. img {
  6830. display: inline-block;
  6831. vertical-align: middle;
  6832. max-width: 100%;
  6833. max-height: 100%;
  6834. }
  6835. }
  6836. &__content {
  6837. flex: 1;
  6838. border-bottom: 1px solid #ccc;
  6839. margin-left: 10px;
  6840. .nickname {
  6841. font-size: 14px;
  6842. font-family: Microsoft YaHei;
  6843. font-weight: bold;
  6844. color: #333333;
  6845. line-height: 24px;
  6846. }
  6847. .desc {
  6848. font-size: 14px;
  6849. font-family: Microsoft YaHei;
  6850. font-weight: 400;
  6851. color: #666666;
  6852. line-height: 24px;
  6853. }
  6854. .time {
  6855. font-size: 14px;
  6856. font-family: Microsoft YaHei;
  6857. font-weight: 400;
  6858. color: #999999;
  6859. line-height: 24px;
  6860. .replay {
  6861. float: right;
  6862. font-size: 14px;
  6863. font-family: Microsoft YaHei;
  6864. font-weight: 400;
  6865. color: #3f8dfd;
  6866. line-height: 24px;
  6867. margin-right: 20px;
  6868. }
  6869. .del {
  6870. float: right;
  6871. cursor: pointer;
  6872. font-size: 14px;
  6873. font-family: Microsoft YaHei;
  6874. font-weight: 400;
  6875. color: #ff3b30;
  6876. line-height: 24px;
  6877. margin-right: 20px;
  6878. }
  6879. }
  6880. .reply-list {
  6881. margin: 20px 0;
  6882. width: 100%;
  6883. background: #f9f9f9;
  6884. border-radius: 8px;
  6885. padding: 0 0 0 20px;
  6886. &__item {
  6887. padding: 20px 0;
  6888. display: flex;
  6889. border-bottom: 1px solid #ccc;
  6890. &:nth-last-of-type(1) {
  6891. border: 0;
  6892. }
  6893. &__avatar {
  6894. width: 40px;
  6895. height: 40px;
  6896. display: table-cell;
  6897. border-radius: 50%;
  6898. text-align: center;
  6899. img {
  6900. display: inline-block;
  6901. vertical-align: middle;
  6902. max-width: 100%;
  6903. max-height: 100%;
  6904. }
  6905. }
  6906. &__content {
  6907. border-radius: 8px;
  6908. flex: 1;
  6909. margin-left: 10px;
  6910. .nickname {
  6911. font-size: 14px;
  6912. font-family: Microsoft YaHei;
  6913. font-weight: bold;
  6914. color: #333333;
  6915. line-height: 24px;
  6916. }
  6917. .desc {
  6918. font-size: 14px;
  6919. font-family: Microsoft YaHei;
  6920. font-weight: 400;
  6921. color: #666666;
  6922. line-height: 24px;
  6923. }
  6924. .time {
  6925. font-size: 14px;
  6926. font-family: Microsoft YaHei;
  6927. font-weight: 400;
  6928. color: #999999;
  6929. line-height: 24px;
  6930. .reply {
  6931. float: right;
  6932. font-size: 14px;
  6933. font-family: Microsoft YaHei;
  6934. font-weight: 400;
  6935. color: #3f8dfd;
  6936. line-height: 24px;
  6937. margin-right: 20px;
  6938. cursor: pointer;
  6939. user-select: none;
  6940. }
  6941. .del {
  6942. cursor: pointer;
  6943. margin-right: 20px;
  6944. float: right;
  6945. font-size: 14px;
  6946. font-family: Microsoft YaHei;
  6947. font-weight: 400;
  6948. color: #ff3b30;
  6949. line-height: 24px;
  6950. }
  6951. }
  6952. }
  6953. }
  6954. }
  6955. }
  6956. }
  6957. }
  6958. }
  6959. }
  6960. .lecture-notes {
  6961. &__content {
  6962. .left-box {
  6963. float: left;
  6964. width: 462px;
  6965. .textarea {
  6966. border-bottom: 1px solid #eee;
  6967. .submit {
  6968. float: right;
  6969. width: 138px;
  6970. padding: 10px 0;
  6971. margin: 10px 0 25px 0;
  6972. border-radius: 20px;
  6973. text-align: center;
  6974. font-size: 16px;
  6975. }
  6976. }
  6977. .note-list {
  6978. &__content {
  6979. border-bottom: 1px solid #eee;
  6980. &__title {
  6981. width: 216px;
  6982. height: 24px;
  6983. background: #ccc;
  6984. border-radius: 24px;
  6985. font-size: 14px;
  6986. color: #666666;
  6987. text-align: center;
  6988. line-height: 24px;
  6989. margin: 20px 0;
  6990. }
  6991. }
  6992. &__item {
  6993. display: flex;
  6994. padding: 15px;
  6995. .el-icon-video-play {
  6996. cursor: pointer;
  6997. font-size: 20px;
  6998. color: #3f8dfd;
  6999. }
  7000. &__content {
  7001. flex: 1;
  7002. margin-left: 10px;
  7003. .title {
  7004. cursor: pointer;
  7005. font-size: 14px;
  7006. font-family: Microsoft YaHei;
  7007. font-weight: bold;
  7008. color: #3f8dfd;
  7009. line-height: 24px;
  7010. }
  7011. .desc {
  7012. font-size: 14px;
  7013. font-family: Microsoft YaHei;
  7014. font-weight: 400;
  7015. color: #666666;
  7016. line-height: 24px;
  7017. }
  7018. .time {
  7019. font-size: 14px;
  7020. font-family: Microsoft YaHei;
  7021. font-weight: 400;
  7022. color: #999999;
  7023. line-height: 24px;
  7024. }
  7025. }
  7026. }
  7027. }
  7028. .pagination {
  7029. margin-top: 30px;
  7030. text-align: center;
  7031. }
  7032. }
  7033. .right-box {
  7034. width: 786px;
  7035. float: right;
  7036. .lecture-list {
  7037. background: #f5f7fa;
  7038. border-radius: 8px;
  7039. &__header {
  7040. padding: 0 16px;
  7041. height: 40px;
  7042. line-height: 40px;
  7043. font-size: 18px;
  7044. font-family: Microsoft YaHei;
  7045. font-weight: bold;
  7046. color: #333333;
  7047. .slide-btn {
  7048. cursor: pointer;
  7049. float: right;
  7050. font-size: 14px;
  7051. font-family: Microsoft YaHei;
  7052. font-weight: 400;
  7053. color: #999999;
  7054. }
  7055. }
  7056. &__body {
  7057. .list {
  7058. &__item {
  7059. border-top: 1px solid #fff;
  7060. padding: 0 8px 0 16px;
  7061. height: 56px;
  7062. line-height: 55px;
  7063. display: flex;
  7064. align-items: center;
  7065. .title {
  7066. flex: 1;
  7067. font-size: 16px;
  7068. font-family: Microsoft YaHei;
  7069. font-weight: 400;
  7070. color: #333333;
  7071. }
  7072. .btns {
  7073. .btn {
  7074. cursor: pointer;
  7075. display: inline-block;
  7076. vertical-align: middle;
  7077. width: 80px;
  7078. height: 32px;
  7079. background: #ffffff;
  7080. border: 1px solid #3f8dfd;
  7081. border-radius: 16px;
  7082. text-align: center;
  7083. line-height: 30px;
  7084. color: #3f8dfd;
  7085. margin: 0 8px;
  7086. }
  7087. }
  7088. }
  7089. }
  7090. }
  7091. &__footer {
  7092. margin-top: 24px;
  7093. .lecture-scan {
  7094. background: #f5f7fa;
  7095. border-radius: 8px;
  7096. overflow: hidden;
  7097. &__header {
  7098. height: 40px;
  7099. line-height: 40px;
  7100. padding: 0 16px;
  7101. font-size: 16px;
  7102. font-family: Microsoft YaHei;
  7103. font-weight: bold;
  7104. color: #333333;
  7105. }
  7106. &__body {
  7107. height: 800px;
  7108. text-align: center;
  7109. overflow-y: scroll;
  7110. .iframe {
  7111. width: 100%;
  7112. }
  7113. }
  7114. }
  7115. }
  7116. }
  7117. }
  7118. }
  7119. }
  7120. }
  7121. }
  7122. }
  7123. }
  7124. .take-photo {
  7125. /deep/ .el-dialog__header {
  7126. display: none;
  7127. }
  7128. /deep/ .el-dialog__body {
  7129. padding: 0;
  7130. overflow: unset;
  7131. }
  7132. &__close {
  7133. cursor: pointer;
  7134. position: absolute;
  7135. right: 0;
  7136. top: -28px;
  7137. width: 24px;
  7138. height: 24px;
  7139. line-height: 24px;
  7140. text-align: center;
  7141. color: #eee;
  7142. border: 1px solid #eee;
  7143. border-radius: 50%;
  7144. }
  7145. &__header {
  7146. height: 40px;
  7147. border-bottom: 1px solid #eee;
  7148. line-height: 40px;
  7149. font-size: 16px;
  7150. font-family: Microsoft YaHei;
  7151. font-weight: bold;
  7152. color: #333333;
  7153. padding-left: 24px;
  7154. }
  7155. &__body {
  7156. // height: 400px;
  7157. padding: 40px 24px;
  7158. .left-box {
  7159. width: 336px;
  7160. float: left;
  7161. .title {
  7162. font-size: 16px;
  7163. font-family: Microsoft YaHei;
  7164. font-weight: bold;
  7165. color: #ff3b30;
  7166. line-height: 24px;
  7167. }
  7168. .content {
  7169. font-size: 14px;
  7170. font-family: Microsoft YaHei;
  7171. font-weight: 400;
  7172. color: #333333;
  7173. line-height: 28px;
  7174. margin-top: 32px;
  7175. }
  7176. }
  7177. .right-box {
  7178. float: right;
  7179. width: 400px;
  7180. height: 400px;
  7181. position: relative;
  7182. overflow: hidden;
  7183. video {
  7184. width: 100%;
  7185. height: 100%;
  7186. }
  7187. .mask {
  7188. width: 55%;
  7189. height: 200px;
  7190. position: absolute;
  7191. top: 0;
  7192. left: 0;
  7193. right: 0;
  7194. bottom: 0;
  7195. margin: 30px auto 0;
  7196. box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
  7197. }
  7198. }
  7199. }
  7200. &__footer {
  7201. height: 90px;
  7202. border-top: 1px solid #eee;
  7203. text-align: center;
  7204. .take {
  7205. display: inline-block;
  7206. width: 200px;
  7207. height: 40px;
  7208. padding: 0;
  7209. border-radius: 20px;
  7210. text-align: center;
  7211. line-height: 40px;
  7212. margin: 24px auto;
  7213. }
  7214. }
  7215. }
  7216. .info {
  7217. &__content {
  7218. height: 500px;
  7219. overflow-y: scroll;
  7220. .handCenter {
  7221. width: 600px;
  7222. height: 300px;
  7223. background: #ccc;
  7224. }
  7225. .upload-box {
  7226. display: inline-block;
  7227. vertical-align: top;
  7228. .el-icon-error {
  7229. cursor: pointer;
  7230. z-index: 99;
  7231. position: absolute;
  7232. left: 100%;
  7233. bottom: 100%;
  7234. font-size: 20px;
  7235. color: red;
  7236. }
  7237. }
  7238. }
  7239. }
  7240. .showconfirm {
  7241. &__content {
  7242. .text {
  7243. padding-bottom: 20px;
  7244. color: red;
  7245. }
  7246. }
  7247. }
  7248. }
  7249. </style>