index.vue 235 KB

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