index.vue 300 KB

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