1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348 |
- <template>
- <div class="course-detail">
- <Header></Header>
- <section class="section">
- <div class="container">
- <div class="section__header">
- <div class="container">
- <el-breadcrumb separator="/">
- <el-breadcrumb-item :to="{ path: '/index' }"
- >首页</el-breadcrumb-item
- >
- <el-breadcrumb-item>课程详情</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- </div>
- <div class="section__body">
- <div class="container">
- <div class="course-info">
- <div class="course-info__header clearfix">
- <div
- class="left-box"
- :style="{
- backgroundImage: `url(${$tools.splitImgHost(
- goodsData.coverUrl,
- false
- )})`,
- }"
- >
- <div v-show="vid" id="player"></div>
- <div v-show="vidzb" id="playerzb"></div>
- <div class="recordStyle" v-if="showRecordStatus">
- 您上次看到{{
- $tools.secondToTime(recordObj.videoCurrentTime)
- }},正在自动续播<span
- style="
- display: inline-block;
- width: 50px;
- text-align: center;
- "
- >|</span
- >
- <span class="btn_sty" @click="backLI">从头播放</span>
- </div>
- </div>
- <div class="right-box">
- <div class="right-box__header">
- <div class="title">
- <el-select
- class="select"
- v-model="courseId"
- @change="courseChange"
- >
- <el-option
- :label="item.courseName"
- :value="item.courseId"
- v-for="(item, index) in courseList"
- :key="index"
- ></el-option>
- </el-select>
- </div>
- <div class="tabs">
- <el-tabs v-model="courseTabIndex">
- <el-tab-pane
- :name="tab.name"
- v-for="(tab, index) in menuTab"
- :key="index"
- >
- <div slot="label">
- <span class="label">{{ tab.label }}</span>
- </div>
- <template v-if="tab.name == '1'">
- <div class="right-box__body">
- <div
- class="item"
- v-for="(menu, index) in menuList"
- :key="index"
- >
- <template v-if="menu.type == 1">
- <div
- class="item__title"
- @click="openModule(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right': !menu.showList,
- 'el-icon-caret-bottom': menu.showList,
- }"
- ></i>
- {{ menu.menuName }}
- </div>
- <div class="item__content">
- <div
- class="bank-chapter"
- v-if="menu.showList"
- >
- <div
- class="bank-chapter__item"
- v-for="(
- chapter, chapterIndex
- ) in menu.list"
- :key="chapterIndex"
- >
- <div
- class="bank-chapter__item__text"
- @click="openChapter(chapter)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !chapter.showList,
- 'el-icon-caret-bottom':
- chapter.showList,
- }"
- ></i
- >{{ chapter.name }}
- </div>
- <div
- class="bank-section"
- v-if="chapter.showList"
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in chapter.list"
- :key="sectionIndex"
- @click="getResource(section)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 录播
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- <div
- class="
- bank-section__item__text
- "
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已看完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType != 3
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 2">
- <div class="item__content">
- <div class="bank-chapter">
- <div class="bank-chapter__item">
- <div
- class="bank-chapter__item__text"
- @click="openChapter(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !menu.showList,
- 'el-icon-caret-bottom':
- menu.showList,
- }"
- ></i
- >{{ menu.menuName }}
- </div>
- <div
- class="bank-section"
- v-if="menu.showList"
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in menu.list"
- :key="sectionIndex"
- @click="getResource(section)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 录播
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已看完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType != 3
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 3">
- <div class="item__content">
- <div class="bank-section">
- <div
- class="bank-section__item"
- :class="{
- active: isActive(menu),
- }"
- @click="getResource(menu)"
- >
- <template>
- <div
- class="note note--blue"
- v-if="menu.sectionType == 1"
- >
- 录播
- </div>
- <div
- class="note"
- v-if="menu.sectionType == 2"
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="menu.sectionType == 3"
- >
- 回放
- </div>
- <div class="bank-section__item__text">
- {{ menu.name }}
- <div
- style="font-size: 12px"
- v-if="
- menu.liveStartTime > nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- menu.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- menu.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <template v-if="menu.durationTime > 0">
- <div class="during">
- {{
- $tools.secondToDate(
- menu.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="menu.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="menu.learning == 1"
- >
- 已看完
- </div>
- </template>
- </template>
- <template
- v-if="
- menu.liveStartTime &&
- menu.sectionType != 3
- "
- >
- <div
- class="live-btn live-btn--blue"
- v-if="menu.liveStartTime > nowTime"
- >
- 待开播
- </div>
- <div
- class="live-btn live-btn--yellow"
- v-if="
- menu.liveStartTime <= nowTime &&
- menu.liveEndTime > nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="menu.liveEndTime < nowTime"
- >
- 已结束
- </div>
- </template>
- </div>
- </div>
- </div>
- </template>
- </div>
- </div>
- </template>
- <template v-if="tab.name == '2'">
- <div class="right-box__body">
- <div
- class="item"
- v-for="(menu, index) in reMenuList"
- :key="index"
- >
- <template v-if="menu.type == 1">
- <div
- class="item__title"
- @click="openModule(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right': !menu.showList,
- 'el-icon-caret-bottom': menu.showList,
- }"
- ></i>
- {{ menu.menuName }}
- </div>
- <div class="item__content">
- <div
- class="bank-chapter"
- v-if="menu.showList"
- >
- <div
- class="bank-chapter__item"
- v-for="(
- chapter, chapterIndex
- ) in menu.list"
- :key="chapterIndex"
- >
- <div
- class="bank-chapter__item__text"
- @click="openChapter(chapter)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !chapter.showList,
- 'el-icon-caret-bottom':
- chapter.showList,
- }"
- ></i
- >{{ chapter.name }}
- </div>
- <div
- class="bank-section"
- v-if="chapter.showList"
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in chapter.list"
- :key="sectionIndex"
- @click="getResource(section)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 录播
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- <div
- class="
- bank-section__item__text
- "
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已看完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType != 3
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 2">
- <div class="item__content">
- <div class="bank-chapter">
- <div class="bank-chapter__item">
- <div
- class="bank-chapter__item__text"
- @click="openChapter(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !menu.showList,
- 'el-icon-caret-bottom':
- menu.showList,
- }"
- ></i
- >{{ menu.menuName }}
- </div>
- <div
- class="bank-section"
- v-if="menu.showList"
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in menu.list"
- :key="sectionIndex"
- @click="getResource(section)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 录播
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已看完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType != 3
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 3">
- <div class="item__content">
- <div class="bank-section">
- <div
- class="bank-section__item"
- :class="{
- active: isActive(menu),
- }"
- @click="getResource(menu)"
- >
- <template>
- <div
- class="note note--blue"
- v-if="menu.sectionType == 1"
- >
- 录播
- </div>
- <div
- class="note"
- v-if="menu.sectionType == 2"
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="menu.sectionType == 3"
- >
- 回放
- </div>
- <div class="bank-section__item__text">
- {{ menu.name }}
- <div
- style="font-size: 12px"
- v-if="
- menu.liveStartTime > nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- menu.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- menu.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <template v-if="menu.durationTime > 0">
- <div class="during">
- {{
- $tools.secondToDate(
- menu.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="menu.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="menu.learning == 1"
- >
- 已看完
- </div>
- </template>
- </template>
- <template
- v-if="
- menu.liveStartTime &&
- menu.sectionType != 3
- "
- >
- <div
- class="live-btn live-btn--blue"
- v-if="menu.liveStartTime > nowTime"
- >
- 待开播
- </div>
- <div
- class="live-btn live-btn--yellow"
- v-if="
- menu.liveStartTime <= nowTime &&
- menu.liveEndTime > nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="menu.liveEndTime < nowTime"
- >
- 已结束
- </div>
- </template>
- </div>
- </div>
- </div>
- </template>
- </div>
- </div>
- </template>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </div>
- </div>
- <div class="course-info__body">
- <el-tabs v-model="activeName">
- <el-tab-pane
- v-for="(item, index) in tabList"
- :key="index"
- :name="item.name"
- :label="item.label"
- >
- <template v-if="item.label == '学员须知'">
- <div class="course-menu clearfix">
- <div class="left-box">
- <div class="left-box__body">
- <div
- class="buy-note"
- v-html="
- goodsData.buyNote &&
- goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
- "
- ></div>
- </div>
- </div>
- <div class="right-box">
- <div class="title">
- 推荐课程
- <a class="more" @click="go('/course-list')"
- >更多></a
- >
- </div>
- <ul class="list">
- <li
- class="course-item"
- v-for="(itemy, index) in compyRecommend(
- recommendList.goodsList
- )"
- :key="index"
- >
- <GoodsItem :item="itemy"></GoodsItem>
- <!-- <div
- class="course-item__img"
- :style="`background-image:url(${$tools.splitImgHost(
- itemy.coverUrl,
- true
- )})`"
- @click="toGoodsDetail(itemy)"
- >
- <div class="note" v-if="itemy.year">
- {{ itemy.year }}
- </div>
- </div>
- <div class="course-item__title">
- {{ itemy.goodsName }}
- </div>
- <div class="course-item__desc">
- <div class="price">
- ¥{{ itemy.standPrice }}
- </div>
- <a
- class="add"
- @click.stop="addCart(true, itemy.goodsId)"
- >加购物车</a
- >
- </div> -->
- </li>
- </ul>
- </div>
- </div>
- </template>
- <template v-if="item.label == '课程答疑'">
- <div class="answer-question">
- <div class="answer-question__header clearfix">
- <div class="textarea-wrap">
- <el-input
- class="textarea"
- v-model="textarea"
- rows="3"
- type="textarea"
- placeholder=""
- ></el-input>
- </div>
- <el-button
- type="primary"
- class="submit"
- @click="addAnswer"
- >提出疑问</el-button
- >
- </div>
- <div class="answer-question__body">
- <div class="question-list">
- <div
- v-if="answerList.length == 0"
- style="text-align: center"
- >
- 暂无记录
- </div>
- <div
- class="question-list__item"
- v-for="(item, index) in answerList"
- :key="index"
- >
- <div class="question-list__item__avatar">
- <img
- v-if="item.assignRealname"
- :src="$tools.splitImgHost(item.assignAvatar)"
- alt=""
- />
- <img
- v-else
- :src="$tools.splitImgHost(item.avatar)"
- alt=""
- />
- </div>
- <div class="question-list__item__content">
- <div class="nickname">
- {{ item.realname }}
- </div>
- <div class="desc">
- {{ item.answerText }}
- </div>
- <div class="time">
- {{
- $tools.timestampToTime(
- item.createTime,
- false
- )
- }}
- <div
- class="del"
- v-if="item.userId !== userInfo.userId"
- @click="answerBack(item)"
- >
- <el-button type="text">回复</el-button>
- </div>
- <div
- class="del"
- @click="del(item)"
- v-if="item.userId === userInfo.userId"
- >
- 删除
- </div>
- </div>
- <div
- class="reply-list"
- v-if="
- item.newArraysAnswerList &&
- item.newArraysAnswerList.length
- "
- >
- <div
- class="reply-list__item"
- v-for="(
- items, indexs
- ) in item.newArraysAnswerList"
- :key="indexs"
- >
- <div class="reply-list__item__avatar">
- <img
- :src="$tools.splitImgHost(items.avatar)"
- alt=""
- />
- </div>
- <div class="reply-list__item__content">
- <div class="nickname">
- {{ items.realname }}
- </div>
- <div class="desc">
- 回复
- <span
- style="
- margin: 0px 4px;
- color: #409eff;
- "
- >@{{ items.assignRealname }}</span
- >
- {{ items.answerText }}
- </div>
- <div class="time">
- {{
- $tools.timestampToTime(
- items.createTime,
- false
- )
- }}
- <div
- class="del"
- @click="del(items)"
- v-if="
- items.userId === userInfo.userId
- "
- >
- 删除
- </div>
- <div
- class="reply"
- v-if="
- items.userId !== userInfo.userId
- "
- @click="answerBack(items)"
- >
- 回复
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="item.label == '笔记讲义'">
- <div class="lecture-notes">
- <div class="lecture-notes__content clearfix">
- <div class="left-box">
- <div
- class="textarea clearfix"
- v-if="!(isPlayRebuild > 0) && !vidzb"
- >
- <el-input
- resize="none"
- rows="3"
- v-model="textareaNote"
- type="textarea"
- placeholder="觉得重要的就记下来吧~"
- ></el-input>
- <el-button
- type="primary"
- class="submit"
- @click="noteSubmit"
- >
- 提交笔记
- </el-button>
- </div>
- <div class="note-list">
- <div
- v-if="noteList.length == 0"
- style="text-align: center"
- >
- 暂无笔记
- </div>
- <div
- class="note-list__content"
- v-for="(item, index) in noteList"
- :key="index"
- >
- <div class="note-list__content__title">
- {{ $tools.timestampToTime(item.dateNote) }}
- </div>
- <div
- class="note-list__item"
- v-for="(note, index) in item.userNotes"
- :key="index"
- >
- <i
- class="el-icon-video-play"
- @click="noteClick(note)"
- ></i>
- <div class="note-list__item__content">
- <div class="title" @click="noteClick(note)">
- {{ $tools.secondToDate(note.noteSecond) }}
- </div>
- <div class="desc">
- {{ note.sectionName }}
- </div>
- <div class="time">{{ note.noteText }}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="pagination">
- <el-pagination
- background
- layout="prev, pager, next"
- :total="noteTotal"
- :page-size="noteParams.pageSize"
- >
- </el-pagination>
- </div>
- </div>
- <div class="right-box" v-if="courseHandoutsData">
- <div class="lecture-list">
- <div class="lecture-list__header">
- 讲义
- <div
- class="slide-btn"
- @click="lectureShow = !lectureShow"
- >
- 收起
- </div>
- </div>
- <div
- class="lecture-list__body"
- v-if="lectureShow"
- >
- <div class="list">
- <div class="list__item">
- <div class="title">
- {{ courseHandoutsData.handoutsName }}
- </div>
- <div class="btns">
- <div
- class="btn"
- @click="
- previvew(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- )
- "
- >
- 预览
- </div>
- <div
- v-if="
- courseHandoutsData.canDownload == 1
- ? true
- : false
- "
- class="btn"
- @click="
- printView(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- )
- "
- >
- 打印
- </div>
- <div
- v-if="
- courseHandoutsData.canDownload == 1
- ? true
- : false
- "
- class="btn"
- @click="
- download(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- ),
- courseHandoutsData.urlName
- )
- "
- >
- 下载
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="lecture-list__footer" v-if="showPdf">
- <div class="lecture-scan">
- <div class="lecture-scan__header">
- {{ courseHandoutsData.urlName }}
- </div>
- <div class="lecture-scan__body">
- <pdf
- class="iframe"
- :src="
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- "
- v-for="i in numPages"
- :key="i"
- :page="i"
- ref="pdf"
- ></pdf>
- <iframe
- id="printIframe"
- :src="
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- "
- frameborder="0"
- style="display: none"
- ></iframe>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- <el-dialog
- width="800px"
- class="take-photo"
- :visible.sync="takePhotoModal"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- >
- <div class="take-photo__content">
- <!-- <div class="take-photo__close" @click="takePhotoModal = false">X</div> -->
- <div class="take-photo__header">人脸验证</div>
- <div class="take-photo__body clearfix">
- <div class="left-box">
- <div class="title">重要提示:</div>
- <div class="content">
- <p>1、请保证摄像头正对自己,避免头像偏左或者偏右。</p>
- <p>
- 2、请保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。
- </p>
- <p>
- 3、请保证整个头像在人脸识别区域内,脸部无遮挡装饰物(佩戴眼镜会降低通过率)。
- </p>
- <p>
- 4、如果下面视频中出现黑屏,摄像头可能被其他进程占用,请关闭其他调用摄像头的程序,重新刷新当前页面重新拍照识别。
- </p>
- </div>
- </div>
- <div class="right-box">
- <img v-show="!isTaking" :src="faceUrl" alt="" />
- <video v-show="isTaking" id="video" :src="stream"></video>
- <div class="mask"></div>
- </div>
- </div>
- <div class="take-photo__footer">
- <el-button
- type="primary"
- v-if="isTaking"
- class="take"
- @click="onPhoto"
- >拍照</el-button
- >
- <el-button
- type="primary"
- v-if="!isTaking"
- class="take"
- :loading="loading"
- @click="reTake"
- >重拍</el-button
- >
- <el-button
- type="primary"
- v-if="!isTaking"
- :loading="loading"
- class="take"
- @click="takeOk"
- >确认</el-button
- >
- </div>
- </div>
- </el-dialog>
- <el-dialog
- width="996px"
- height="600px"
- class="info"
- :visible.sync="showInfoDetailModal"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- title="资料填写"
- >
- <div class="info__content">
- <el-form
- :model="infoForm"
- ref="infoForm"
- :rules="rules"
- :error-type="errorType"
- >
- <template v-for="(item, index) in listData">
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'name'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="true"
- v-model="infoForm.name"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'idcard'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="true"
- v-model="infoForm.idcard"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'telphone'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="true"
- v-model="infoForm.telphone"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'school'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.school"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'work_unit'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.work_unit"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'unit_contact'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.unit_contact"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'unit_tel'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.unit_tel"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'apply_post'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="apply_post_disabled"
- v-model="infoForm.apply_post"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'major'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.major"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.inputType == 2"
- :label="item.fieldName"
- label-width="120px"
- :required="item.required"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-select v-model="infoForm[item.fieldKey]" placeholder="">
- <el-option
- v-for="(option, optionIndex) in getarrays(item.fieldKey)"
- :key="optionIndex"
- :label="option"
- :value="optionIndex + ''"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.inputType == 5"
- :label="item.fieldName"
- label-width="120px"
- :required="item.required"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-date-picker
- v-model="infoForm[item.fieldKey]"
- align="right"
- type="date"
- placeholder="选择日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="
- item.inputType == 3 &&
- item.fieldKey !== 'commitment_electr_signature'
- "
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-upload
- action=""
- :max-size="2097152"
- accept="image/jpeg, image/jpg, image/png"
- :show-file-list="false"
- list-type="picture"
- :auto-upload="false"
- :ref="
- item.fieldKey === 'recent_photos'
- ? 'recent_photos'
- : item.fieldKey === 'idcard_face_photo'
- ? 'idcard_face_photo'
- : item.fieldKey === 'idcard_national_photo'
- ? 'idcard_national_photo'
- : ''
- "
- :on-change="
- item.fieldKey === 'recent_photos'
- ? changePhotoListHeader1
- : item.fieldKey === 'idcard_face_photo'
- ? changePhotoListHeader2
- : item.fieldKey === 'idcard_national_photo'
- ? changePhotoListHeader3
- : ''
- "
- :file-list="
- item.fieldKey === 'recent_photos'
- ? fileList1
- : item.fieldKey === 'idcard_face_photo'
- ? fileList2
- : item.fieldKey === 'idcard_national_photo'
- ? fileList3
- : ''
- "
- >
- <div class="upload-box">
- <div
- :style="
- item.fieldKey === 'recent_photos'
- ? 'width: 120px; height: 169px;background:url(' +
- require('@/assets/info_1.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- : item.fieldKey === 'idcard_face_photo'
- ? 'width: 120px; height: 82px;background:url(' +
- require('@/assets/info_2.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- : item.fieldKey === 'idcard_national_photo'
- ? 'width: 120px; height: 82px;background:url(' +
- require('@/assets/info_3.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- : ''
- "
- >
- <i
- @click="deleteImg(item)"
- class="el-icon-error"
- v-if="
- item.fieldKey === 'recent_photos'
- ? fileList1[0]
- : item.fieldKey === 'idcard_face_photo'
- ? fileList2[0]
- : item.fieldKey === 'idcard_national_photo'
- ? fileList3[0]
- : ''
- "
- ></i>
- <el-image
- style="width: 100%; height: 100%"
- :src="
- item.fieldKey === 'recent_photos'
- ? $tools.splitImgHost(fileList1[0].url)
- : item.fieldKey === 'idcard_face_photo'
- ? $tools.splitImgHost(fileList2[0].url)
- : item.fieldKey === 'idcard_national_photo'
- ? $tools.splitImgHost(fileList3[0].url)
- : ''
- "
- v-if="
- item.fieldKey === 'recent_photos'
- ? fileList1[0]
- : item.fieldKey === 'idcard_face_photo'
- ? fileList2[0]
- : item.fieldKey === 'idcard_national_photo'
- ? fileList3[0]
- : ''
- "
- :preview-src-list="
- item.fieldKey === 'recent_photos'
- ? [$tools.splitImgHost(fileList1[0].url)]
- : item.fieldKey === 'idcard_face_photo'
- ? [$tools.splitImgHost(fileList2[0].url)]
- : item.fieldKey === 'idcard_national_photo'
- ? [$tools.splitImgHost(fileList3[0].url)]
- : ''
- "
- >
- </el-image>
- </div>
- <div>
- <span
- v-if="item.fieldKey === 'recent_photos'"
- style="color: #999999"
- >竖向白底证件照 文件大小≤2M</span
- >
- <span
- v-if="
- item.fieldKey === 'idcard_face_photo' ||
- item.fieldKey === 'idcard_national_photo'
- "
- style="color: #999999"
- >
- 文件大小≤2M
- </span>
- </div>
- </div>
- <div style="display: inline-block" slot="trigger">
- <el-button type="primary" size="small" round
- >浏览文件</el-button
- >
- </div>
- </el-upload>
- </el-form-item>
- <div
- :key="index"
- v-if="
- item.inputType == 3 &&
- item.fieldKey === 'commitment_electr_signature'
- "
- >
- <el-form-item
- v-if="
- item.inputType == 3 &&
- item.fieldKey === 'commitment_electr_signature'
- "
- label="承诺书"
- :required="item.required"
- label-width="120px"
- label-position="top"
- >
- <div style="line-height: 40px; text-indent: 2em">
- <span>
- 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
- 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
- </span>
- <div style="line-height: 40px; text-indent: 2em">
- <span>特此承诺!</span>
- </div>
- </div>
- </el-form-item>
- <el-form-item
- v-if="
- item.inputType == 3 &&
- item.fieldKey === 'commitment_electr_signature'
- "
- label="签名板"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <div class="dis_stys">
- <span style="color: #999999">请在下方签名区进行签名</span>
- <el-button
- type="primary"
- size="small"
- @click="retDraw"
- mode=""
- >清空</el-button
- >
- </div>
- <div class="handCenter">
- <vue-esign
- v-if="!infoForm[item.fieldKey]"
- ref="esign"
- :width="600"
- :height="300"
- :isCrop="false"
- :lineWidth="5"
- :lineColor="'#333'"
- />
- <div
- v-else
- style="width: 100%; height: 100%; position: relative"
- >
- <img
- style="width: 100%; height: 100%"
- :src="$tools.splitImgHost(infoForm[item.fieldKey])"
- mode=""
- />
- </div>
- </div>
- </el-form-item>
- </div>
- <el-form-item
- :key="index"
- v-if="item.inputType == 4"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-button
- type="primary"
- size="small"
- round
- @click="downloadStamp(item)"
- >下载模板</el-button
- >
- <el-upload
- action=""
- :max-size="2097152"
- accept="image/jpeg, image/jpg, image/png"
- :show-file-list="false"
- list-type="picture"
- :auto-upload="false"
- ref="stamp"
- :on-change="changePhotoListStamp"
- :file-list="fileListStamp"
- >
- <div style="display: inline-block; vertical-align: top">
- <div
- :style="
- 'width: 120px; height: 120px;background:url(' +
- require('@/assets/info_4.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- "
- >
- <el-image
- style="width: 100%; height: 100%"
- :src="$tools.splitImgHost(fileListStamp[0].url)"
- v-if="fileListStamp[0]"
- :preview-src-list="[
- $tools.splitImgHost(fileListStamp[0].url),
- ]"
- >
- </el-image>
- </div>
- <div>
- <span style="color: #999999">文件大小≤2M</span>
- </div>
- </div>
- <div style="display: inline-block" slot="trigger">
- <el-button type="primary" size="small" round
- >浏览文件</el-button
- >
- </div>
- </el-upload>
- </el-form-item>
- </template>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- @click="
- showInfoDetailModal = false;
- $router.back(-1);
- "
- >取 消</el-button
- >
- <el-button type="primary" :loading="uploading" @click="submit"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- width="996px"
- height="600px"
- class="info"
- :visible.sync="showStampDetailModail"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- title="资料填写"
- >
- <div class="info__content">
- <el-form
- :model="stampForm"
- ref="stampForm"
- :rules="stampRules"
- :error-type="errorType"
- >
- <template v-for="(item, index) in listDataStamp">
- <el-form-item
- :key="index"
- v-if="item.inputType == 4"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-button
- type="primary"
- size="small"
- round
- @click="downloadStamp(item)"
- >下载模板</el-button
- >
- <el-upload
- action=""
- :max-size="2097152"
- accept="image/jpeg, image/jpg, image/png"
- :show-file-list="false"
- list-type="picture"
- :auto-upload="false"
- ref="stamp"
- :on-change="changePhotoListStamp"
- :file-list="fileListStamp"
- >
- <div style="display: inline-block; vertical-align: top">
- <div
- :style="
- 'width: 120px; height: 120px;background:url(' +
- require('@/assets/info_4.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- "
- >
- <el-image
- style="width: 100%; height: 100%"
- :src="$tools.splitImgHost(fileListStamp[0].url)"
- v-if="fileListStamp[0]"
- :preview-src-list="[
- $tools.splitImgHost(fileListStamp[0].url),
- ]"
- >
- </el-image>
- </div>
- <div>
- <span style="color: #999999">文件大小≤2M</span>
- </div>
- </div>
- <div style="display: inline-block" slot="trigger">
- <el-button type="primary" size="small" round
- >浏览文件</el-button
- >
- </div>
- </el-upload>
- </el-form-item>
- </template>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- @click="
- showStampDetailModail = false;
- $router.back(-1);
- "
- >取 消</el-button
- >
- <el-button type="primary" :loading="uploading" @click="stampSubmit"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- width="996px"
- height="600px"
- class="info"
- :visible.sync="showAgreementModal"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- title="提示"
- >
- <div class="">
- <div>
- 本产品(或服务)提供【{{
- goodsData.goodsName
- }}】课程的在线学习功能,为使用这些功能,我们需要使用您设备上的摄像头,并收集以下个人信息:
- <span v-for="(item, listIndex) in listData" :key="listIndex"
- >{{ item.fieldName }}、</span
- >
- <!-- 姓名、性别、身份证号码、移动电话号码、身份证照片、一寸照、证书名称/岗位、证书编号、有效期、人脸照片(每节课随机拍摄三张)、 -->
- 学习详细记录。
- </div>
- <div>
- 我们会将上述信息提供至广东省建设执业注册管理中心等第三方组织使用,用于继续教育备案等。如果您拒绝,将导致这些功能无法实现,但不影响您使用本产品(或服务)的其他业务功能。
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="$router.back(-1)">取 消</el-button>
- <el-button type="primary" @click="showInfoDetailModal = true"
- >同意并继续</el-button
- >
- </span>
- </el-dialog>
- <div id="printTable"></div>
- <!-- 修改 -->
- <!-- <ToolBar></ToolBar> -->
- <Footer></Footer>
- </div>
- </template>
- <script>
- import Footer from "@/components/footer/index";
- import Header from "@/components/header/index";
- import ToolBar from "@/components/toolbar/index";
- import GoodsItem from "@/components/goodsItem/index";
- import { mapGetters, mapMutations, mapActions } from "vuex";
- import * as baseUrls from "@/axios.js";
- import pdf from "vue-pdf";
- import print from "print-js";
- export default {
- name: "CourseDetail",
- components: {
- Footer,
- Header,
- ToolBar,
- pdf,
- GoodsItem,
- },
- data() {
- return {
- liveDuration: 0,
- numPages: 0,
- showPdf: false,
- // 总页数
- pdfPages: 10,
- // 当前页数
- pageNum: 1,
- // 加载进度
- loadedRatio: 10,
- // 页面加载完成
- curPageNum: 0,
- // 放大系数 默认百分百
- scale: 100,
- // 旋转角度 ‘90’的倍数才有效
- pageRotate: 0,
- // 单击内部链接时触发 (目前我没有遇到使用场景)
- page: 0,
- bgColor: "#ccc",
- answerTimer: null,
- recordObj: {},
- showAgreementModal: false,
- showInfoDetailModal: false,
- showStampDetailModail: false,
- isTaking: true, //是否正在拍照
- photoConfig: false,
- stream: null,
- photoNum: 0,
- playSectionId: 0,
- photoIndex: 0, //当前位于拍照的区间下标 从0开始
- photoHistoryList: [], //已拍照历史的下标点
- moduleId: 0,
- chapterId: 0,
- menuTab: [],
- lectureShow: true,
- textarea: "",
- textareaNote: "",
- takePhotoModal: false,
- activeName: "1",
- courseId: "",
- courseTabIndex: "1",
- goodsId: "",
- gradeId: "",
- livingTimer: null,
- sectionItem: {},
- gradeDetail: {},
- autoplay: false,
- isAllowSeek: "on",
- playbackRate: false,
- goodsPlayConfig: null,
- playTime: 0, //页面播放时长,不含暂停
- param: {
- pageNum: 1,
- pageSize: 100,
- total: 0,
- },
- postTimer: null, //提交视频观看记录定时器
- lockTimer: null,
- courseList: [],
- businessData: {},
- courseHandoutsData: "",
- menuList: [],
- goodsData: {},
- tabList: [],
- historyChatMsgList: [],
- vid: "",
- vidzb: "",
- player: "",
- playerzb: "",
- activeId: "", //当前选中ID
- vodPlayerJs: "https://player.polyv.net/script/player.js",
- playerJs:
- "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
- uidzb: "egsxlptzdq",
- menuList: [],
- reMenuList: [],
- answerList: [{ newArraysAnswerList: [] }],
- noteList: [],
- photoList: [],
- noteTotal: 0,
- duration: 0,
- answerTimer: null,
- noteParams: {
- pageNum: 1,
- // pageSize: 4,
- },
- ossAvatarUrl: "", //照片地址
- nowTime: 0,
- faceUrl: "",
- loading: null,
- listData: [],
- listDataStamp: [],
- remark: "",
- remarkStatus: false,
- remarkStamp: "",
- remarkStatusStamp: false,
- errorType: ["message"],
- stampForm: {
- commitment_seal: "",
- },
- infoForm: {
- name: "",
- sex: "",
- idcard: "",
- telphone: "",
- education: "",
- school: "",
- graduation_time: "",
- work_unit: "",
- unit_contact: "",
- unit_tel: "",
- apply_post: "",
- major: "",
- working_years: "",
- recent_photos: "",
- idcard_face_photo: "",
- idcard_national_photo: "",
- commitment_electr_signature: "",
- commitment_seal: "",
- },
- recommendList: [],
- rules: {
- name: [
- {
- required: true,
- message: "请输入姓名",
- trigger: ["change", "blur"],
- },
- ],
- sex: [
- {
- required: true,
- message: "请选择性别",
- trigger: "change",
- },
- ],
- idcard: [
- {
- required: true,
- message: "请输入身份证号",
- trigger: ["change", "blur"],
- },
- // {
- // validator: (rule, value, callback) => {
- // let IDRe18 =
- // /^([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]$/;
- // let IDre15 =
- // /^([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}$/;
- // if (!IDRe18.test(value) && !IDre15.test(value)) {
- // return callback(new Error("请输入格式正确的身份证号"));
- // } else {
- // return callback();
- // }
- // },
- // message: "请输入格式正确的身份证号",
- // trigger: ["change", "blur"],
- // },
- ],
- telphone: [
- {
- required: true,
- message: "请输入手机号码",
- trigger: ["change", "blur"],
- },
- // {
- // validator: (rule, value, callback) => {
- // var reg_tel =
- // /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- // if (reg_tel.test(value)) {
- // return callback();
- // } else {
- // return callback(new Error("手机号码不正确"));
- // }
- // },
- // trigger: ["change", "blur"],
- // },
- ],
- education: [
- {
- required: true,
- message: "请选择学历",
- trigger: "change",
- },
- ],
- school: [
- {
- required: true,
- message: "请输入毕业院校",
- trigger: ["change", "blur"],
- },
- ],
- graduation_time: [
- {
- required: true,
- message: "请选择毕业时间",
- trigger: "change",
- },
- ],
- work_unit: [
- {
- required: true,
- message: "请输入工作单位",
- trigger: ["change", "blur"],
- },
- ],
- unit_contact: [
- {
- required: true,
- message: "请输入单位联系人",
- trigger: ["change", "blur"],
- },
- ],
- unit_tel: [
- {
- required: true,
- message: "请输入单位联系电话",
- trigger: ["change", "blur"],
- },
- {
- validator: (rule, value, callback) => {
- var reg_tel =
- /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
- var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
- if (
- reg_tel.test(value) ||
- vartest.test(value) ||
- vartest1.test(value)
- ) {
- return callback();
- } else {
- return callback(new Error("单位联系电话不正确"));
- }
- },
- trigger: ["change", "blur"],
- },
- ],
- apply_post: [
- {
- required: true,
- message: "请输入报名岗位",
- trigger: ["change", "blur"],
- },
- ],
- major: [
- {
- required: true,
- message: "请输入所学专业",
- trigger: ["change", "blur"],
- },
- ],
- working_years: [
- {
- required: true,
- message: "请选择工作年限",
- trigger: "change",
- },
- ],
- recent_photos: [
- {
- required: true,
- message: "请上传证件照",
- trigger: ["change", "blur"],
- },
- ],
- idcard_face_photo: [
- {
- required: true,
- message: "请上传身份证人像面",
- trigger: ["change", "blur"],
- },
- ],
- idcard_national_photo: [
- {
- required: true,
- message: "请上传身份证国徽面",
- trigger: ["change", "blur"],
- },
- ],
- commitment_electr_signature: [
- {
- required: true,
- message: "请签写承诺书电子签",
- trigger: ["change", "blur"],
- },
- ],
- commitment_seal: [
- {
- required: true,
- message: "请上传承诺书盖章",
- trigger: ["change", "blur"],
- },
- ],
- },
- stampRules: {
- commitment_seal: [
- {
- required: true,
- message: "请上传承诺书盖章",
- trigger: ["change", "blur"],
- },
- ],
- },
- fileList1: [], //证件照
- fileList2: [], //人像
- fileList3: [], //国徽
- fileListStamp: [], //印章
- dictObj: null,
- isRequired: false,
- uploading: false,
- veryIdCard: "",
- veryIdName: "",
- isPlayRebuild: false,
- showRecordStatus: false,
- hasStart: false,
- needOpen: true, //是否需要展开第一章节
- menuIndex: [],
- clickLock: false,
- liveLast: null,
- apply_post_disabled: false,
- };
- },
- computed: {
- ...mapGetters(["userInfo"]),
- compyRecommend: function () {
- return function (array) {
- let ary = [];
- if (array) {
- for (let i = 0; i < array.length; i++) {
- if (i >= 5) {
- break;
- } else {
- ary.push(array[i]);
- }
- }
- }
- return ary;
- };
- },
- },
- async mounted() {
- this.courseId = +this.$route.query.courseId || "";
- this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
- this.goodsId = this.$route.params.goodsId;
- this.orderGoodsId = this.$route.query.orderGoodsId;
- this.gradeId = this.$route.query.gradeId;
- this.sectionItem = this.$route.query;
- let isOther = this.$route.query.isOther || "";
- if (isOther) {
- const confirmText = [
- "您的学习账号已经开通,请按照步骤操作,进行学习。",
- "1.点击【跳转学习网址】按钮",
- "2.打开学习网址后,选择【个人用户】进行登录",
- "(1)账号:您个人的身份证号码",
- "(2)密码:身份证号码,再加111111",
- ];
- const newDatas = [];
- const h = this.$createElement;
- for (const i in confirmText) {
- newDatas.push(h("p", null, confirmText[i]));
- }
- this.$confirm(h("div", null, newDatas), "温馨提示", {
- beforeClose: (type) => {
- if (type == "confirm") {
- window.open("http://admin.zhujianpeixun.com/", "_blank");
- } else if (type == "cancel") {
- this.$router.back(-1);
- }
- },
- confirmButtonText: "跳转学习网址",
- cancelButtonText: "关闭",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- });
- return;
- }
- if (this.$route.query.rebuild) {
- this.courseTabIndex = "2";
- }
- await this.getGoodsDetail(); //商品详情
- this.dictList();
- // this.userConfirmInfoDetail().then((res) => {
- this.getbaseprofiletplists().then(async (res) => {
- // let allMenuList = await this.studyRecordMenuAllList();
- // let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
- // let liveMenu = allMenuList.filter((item) => {
- // //获取直播中的视频
- // if (
- // item.type == 3 &&
- // item.liveStartTime <= nowTime &&
- // item.liveEndTime > nowTime
- // ) {
- // return true;
- // } else {
- // return false;
- // }
- // });
- // let earlyTime = 0;
- // if (liveMenu && liveMenu.length) {
- // earlyTime = liveMenu[0].liveStartTime;
- // }
-
- await this.courseCourseList();
- if (this.sectionItem.recordingUrl) {
- let noteSecond = this.$route.query.noteSecond;
- if (noteSecond > 0) {
- let item = {
- sectionId: this.$route.query.sectionId,
- recordingUrl: this.$route.query.recordingUrl,
- noteSecond: noteSecond,
- studyDuration: noteSecond,
- moduleId: this.$route.query.moduleId,
- chapterId: this.$route.query.chapterId,
- };
- this.playSectionId = this.$route.query.sectionId;
- setTimeout(() => {
- this.noteClick(item);
- }, 1000);
- }
- } else {
- this.studyRecordQueryLiveLast();
- }
- // let noteSecond = this.$route.query.noteSecond;
- // if (noteSecond > 0) {
- // let item = {
- // sectionId: this.$route.query.sectionId,
- // recordingUrl: this.$route.query.recordingUrl,
- // noteSecond: noteSecond,
- // studyDuration: noteSecond,
- // moduleId: this.$route.query.moduleId,
- // chapterId: this.$route.query.chapterId,
- // };
- // this.sectionItem = item;
- // this.playSectionId = this.$route.query.sectionId;
- // setTimeout(() => {
- // this.noteClick(item);
- // }, 1000);
- // }
- });
- // });
- },
- beforeDestroy() {
- try {
- this.$msgbox.close();
- } catch (err) {}
- if (this.playSectionId && this.hasStart) {
- this.postStudyRecord();
- }
- // if (this.lockTimer) {
- // clearInterval(this.lockTimer);
- // this.$request
- // .lockDelLock({
- // action: "jxjy",
- // })
- // .then((res) => {});
- // }
- this.clears();
- clearInterval(this.answerTimer);
- clearInterval(this.postTimer);
- clearInterval(this.livingTimer);
- },
- methods: {
- ...mapMutations(["getCartCount"]),
- ...mapActions(["getUserInfo"]),
- isLast(item) {
- if (this.liveLast) {
- let sectionASame =
- this.liveLast.sectionId == (item.sectionId || item.menuId);
- let chapterSame = this.liveLast.chapterId == (item.chapterId || 0);
- let moduleSame = this.liveLast.moduleId == (item.moduleId || 0);
- return sectionASame && chapterSame && moduleSame;
- } else {
- return false;
- }
- },
- /**
- * 获取上次观看的直播
- */
- studyRecordGetLastLive() {
- this.$request
- .studyRecordGetLastLive({
- orderGoodsId: this.orderGoodsId,
- courseId: this.courseId,
- })
- .then((res) => {
- this.liveLast = res.data;
- });
- },
- /**
- * 获取观看记录
- */
- studyRecordQueryLiveLast() {
- this.$request
- .studyRecordQueryLiveLast({
- orderGoodsId: this.orderGoodsId,
- courseId: this.courseId,
- })
- .then((res) => {
- console.log(res, "couse");
- if (res.data) {
- if (res.data.sectionType == 1) {
- //录播
- this.chapterId = res.data.chapterId;
- this.moduleId = res.data.moduleId;
- this.playSectionId = res.data.sectionId;
- this.vid = res.data.recordingUrl;
- this.sectionItem = res.data;
- this.playVideo(res.data);
- } else if (res.data.sectionType == 2) {
- //直播
- this.studyRecordGetLastLive();
- } else if (res.data.sectionType == 3) {
- //回放
- this.chapterId = res.data.chapterId;
- this.moduleId = res.data.moduleId;
- this.playSectionId = res.data.sectionId;
- this.vid = res.data.recordingUrl;
- this.sectionItem = res.data;
- this.playVideo(res.data);
- }
- }
- });
- },
- /**
- *
- 获取推荐列表
- */
- getRecommend() {
- this.$request
- .appCommonActivityRecommendList({
- businessId: this.goodsData.businessId,
- type: 1,
- })
- .then((res) => {
- if (res.rows.length) {
- this.recommendList = res.rows[0];
- }
- });
- },
- addCart(status, goodsId) {
- this.$request
- .addCart({ goodsId: status ? goodsId : this.goodsId })
- .then((res) => {
- this.getCartCount();
- this.$message({
- message: "加入购物车成功",
- type: "success",
- });
- })
- .catch((err) => {
- if (err.code == 500) {
- this.$message({
- message: err.msg,
- type: "warning",
- });
- }
- });
- },
- toGoodsDetail(item) {
- this.$router.push({
- path: "/course-detail/" + item.goodsId,
- });
- },
- async takeOk() {
- this.loading = true;
- let compareFaceData = await this.faceRecognition();
- if (compareFaceData >= 80) {
- const waitYS = await this.imageInfos();
- this.postCoursePhotoRecord()
- .then((res) => {
- this.photoHistoryList.push(this.photoIndex);
- this.postStudyRecord(); //提交记录
- //恢复播放
- this.$message({
- type: "success",
- message: "拍照成功",
- });
- this.takePhotoModal = false;
- this.isTaking = false;
- this.loading = false;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- polyvPlayerContext.j2s_resumeVideo();
- }
- var polyvPlayerContext = this.playerzb;
- if (polyvPlayerContext) {
- polyvPlayerContext.j2s_resumeVideo();
- }
- })
- .catch((err) => {
- this.loading = false;
- console.log(err, "err");
- this.$message({
- type: "warning",
- message: "上传接口报错,请重新拍照上传",
- });
- this.reTake();
- });
- } else {
- this.$message({
- type: "warning",
- message: "人脸匹配不通过,请重新拍照上传",
- });
- setTimeout(() => {
- this.loading = false;
- this.reTake();
- }, 2000);
- return;
- }
- },
- changePhotoListStamp(params, fileList) {
- const file = params.raw;
- const fileType = file.type;
- const isImage = fileType.indexOf("image") != -1;
- const isLt2M = file.size / 1024 / 1024 < 2;
- // 这里常规检验,看项目需求而定
- if (!isImage) {
- this.$message.error("只能上传图片格式png、jpg、gif!");
- return;
- }
- if (!isLt2M) {
- this.$message.error("只能上传图片大小小于2M");
- return;
- }
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- this.$refs.stamp[0].clearFiles();
- this.$upload
- .upload(file, 0)
- .then((res) => {
- this.$set(this.infoForm, "commitment_seal", res);
- this.fileListStamp = [
- {
- name: res,
- url: res,
- },
- ];
- this.$refs.stamp[0].clearFiles();
- console.log(res);
- })
- .catch((err) => {
- this.$refs.stamp[0].clearFiles();
- });
- },
- // 页面加载成功 当前页数
- pageLoaded(e) {
- this.$emit("current", e);
- this.curPageNum = e;
- },
- changePhotoListHeader1(params, fileList) {
- console.log(params);
- const file = params.raw;
- const fileType = file.type;
- const isImage = fileType.indexOf("image") != -1;
- const isLt2M = file.size / 1024 / 1024 < 2;
- // 这里常规检验,看项目需求而定
- if (!isImage) {
- this.$message.error("只能上传图片格式png、jpg、gif!");
- return;
- }
- if (!isLt2M) {
- this.$message.error("只能上传图片大小小于2M");
- return;
- }
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- this.$refs.recent_photos[0].clearFiles();
- this.$upload
- .upload(file, 0)
- .then((res) => {
- this.$set(this.infoForm, "recent_photos", res);
- this.fileList1 = [
- {
- name: res,
- url: res,
- },
- ];
- this.$refs.recent_photos[0].clearFiles();
- console.log(res);
- })
- .catch((err) => {
- this.$refs.recent_photos[0].clearFiles();
- });
- },
- async changePhotoListHeader2(params, fileList) {
- const file = params.raw;
- const fileType = file.type;
- const isImage = fileType.indexOf("image") != -1;
- const isLt2M = file.size / 1024 / 1024 < 2;
- // 这里常规检验,看项目需求而定
- if (!isImage) {
- this.$message.error("只能上传图片格式png、jpg、gif!");
- return;
- }
- if (!isLt2M) {
- this.$message.error("只能上传图片大小小于2M");
- return;
- }
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- let res = await this.faceCertificationIDCardOCR(1, file);
- console.log(res.data.IdImgPath, "res.data.IdImgPath");
- if (res.code == 500) {
- this.$message.warning("请上传正确清晰的身份证人像面照片");
- return;
- }
- this.$refs.idcard_face_photo[0].clearFiles();
- this.$set(this.infoForm, "idcard_face_photo", res.data.IdImgPath);
- this.fileList2 = [
- {
- name: res.data.IdImgPath,
- url: res.data.IdImgPath,
- },
- ];
- // this.$upload
- // .upload(file, 0)
- // .then((res) => {
- // console.log(res, "res");
- // this.$set(this.infoForm, "idcard_face_photo", res);
- // this.fileList2 = [
- // {
- // name: res,
- // url: res,
- // },
- // ];
- // this.$refs.idcard_face_photo[0].clearFiles();
- // console.log(res);
- // })
- // .catch((err) => {
- // this.$refs.idcard_face_photo[0].clearFiles();
- // });
- },
- async changePhotoListHeader3(params, fileList) {
- const file = params.raw;
- const fileType = file.type;
- const isImage = fileType.indexOf("image") != -1;
- const isLt2M = file.size / 1024 / 1024 < 2;
- // 这里常规检验,看项目需求而定
- if (!isImage) {
- this.$message.error("只能上传图片格式png、jpg、gif!");
- return;
- }
- if (!isLt2M) {
- this.$message.error("只能上传图片大小小于2M");
- return;
- }
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- let res = await this.faceCertificationIDCardOCR(2, file);
- if (res.code == 500) {
- this.$message.warning("请上传正确清晰的身份证国徽面照片");
- return;
- }
- this.$refs.idcard_national_photo[0].clearFiles();
- this.$set(this.infoForm, "idcard_national_photo", res.data.IdImgPath);
- this.fileList3 = [
- {
- name: res.data.IdImgPath,
- url: res.data.IdImgPath,
- },
- ];
- // this.$upload
- // .upload(file, 0)
- // .then((res) => {
- // this.$set(this.infoForm, "idcard_national_photo", res);
- // this.fileList3 = [
- // {
- // name: res,
- // url: res,
- // },
- // ];
- // this.$refs.idcard_national_photo[0].clearFiles();
- // console.log(res);
- // })
- // .catch((err) => {
- // this.$refs.idcard_national_photo[0].clearFiles();
- // });
- },
- faceCertificationIDCardOCR(cardSide, file) {
- return new Promise((resolve) => {
- var reader = new FileReader();
- // 将文件加载进入
- reader.readAsDataURL(file);
- reader.onload = (e) => {
- // 转换完成输出该文件base64编码
- let base64 = e.target.result;
- this.$request
- .faceCertificationIDCardOCR({
- cardSide: cardSide, //1人像 2 国徽
- cardImageBase64: base64,
- gradeId: this.gradeId,
- })
- .then((res) => {
- resolve(res);
- })
- .catch((err) => {
- resolve(err);
- });
- };
- });
- },
- async submit() {
- if (this.uploading) {
- return;
- }
- this.uploading = true;
- var ast = this.listData.some((item) => {
- return item.fieldKey === "commitment_electr_signature";
- });
- if (ast) {
- await this.subCanvas();
- }
- this.resultForm();
- },
- stampSubmit() {
- if (this.uploading) {
- return;
- }
- this.uploading = true;
- this.stampResultForm();
- },
- backLI() {
- this.player.j2s_seekVideo(0);
- this.showRecordStatus = false;
- },
- //验证表单
- stampResultForm() {
- for (let i = 0; i < this.listDataStamp.length; i++) {
- if (
- this.listDataStamp[i].fieldKey === "commitment_seal" &&
- !this.listDataStamp[i].required
- ) {
- this.submitApi();
- return;
- }
- }
- this.$refs.stampForm.validate((valid) => {
- if (valid) {
- this.submitApiStamp();
- } else {
- this.uploading = false;
- }
- });
- },
- async submitApiStamp() {
- var data = JSON.parse(JSON.stringify(this.stampForm));
- if (data["commitment_seal"]) {
- data.commitment_seal = await this.$upload.upload(
- data.commitment_seal,
- 0
- );
- }
- this.optionChanges(data);
- },
- optionChanges(data) {
- var self = this;
- var objs = {};
- for (let k in data) {
- objs[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listDataStamp.length; i++) {
- if (self.listDataStamp[i].fieldKey == k) {
- return self.listDataStamp[i].fieldName;
- }
- }
- })(),
- status: self.remarkStatusStamp ? 1 : 0,
- };
- }
- var datas = {
- orderGoodsId: this.orderGoodsId,
- goodsId: self.goodsId,
- keyValue: JSON.stringify(objs),
- };
- if (self.remarkStatus) {
- datas.id = self.id;
- self.$request.editbaseprofileStamp(datas).then((res) => {
- this.uploading = false;
- this.getUserInfo();
- this.showStampDetailModail = false;
- this.$message.success("提交成功");
- });
- } else {
- self.$request.addbaseprofileStamp(datas).then((res) => {
- this.uploading = false;
- this.getUserInfo();
- this.showStampDetailModail = false;
- this.$message.success("提交成功");
- });
- }
- },
- resultForm() {
- console.log(1);
- if (this.isRequired) {
- this.submitApi();
- } else {
- console.log(1);
- this.$refs.infoForm.validate((valid) => {
- console.log(1);
- if (valid) {
- this.submitApi();
- } else {
- this.uploading = false;
- }
- });
- // if (int === 1) {
- // this.errorType = ["toast"];
- // } else {
- // this.errorType = ["message"];
- // }
- }
- },
- async submitApi() {
- console.log(this.infoForm, "999");
- var data = JSON.parse(JSON.stringify(this.infoForm));
- if (data["sex"]) {
- data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
- }
- if (data["education"]) {
- data.education = this.dictObj["edu_level"][Number(data.education)];
- }
- if (data["working_years"]) {
- data.working_years =
- this.dictObj["working_years"][Number(data.working_years)];
- }
- if (data["recent_photos"]) {
- data.recent_photos = await this.$upload.upload(data.recent_photos, 0);
- }
- if (data["idcard_face_photo"]) {
- data.idcard_face_photo = await this.$upload.upload(
- data.idcard_face_photo,
- 0
- );
- }
- if (data["idcard_national_photo"]) {
- data.idcard_national_photo = await this.$upload.upload(
- data.idcard_national_photo,
- 0
- );
- }
- if (data["commitment_electr_signature"]) {
- data.commitment_electr_signature = await this.$upload.upload(
- data.commitment_electr_signature,
- 0
- );
- }
- this.uploadDatas(data);
- },
- async downloadStamp(item) {
- let self = this;
- var ast = this.listData.some((item) => {
- return item.fieldKey === "commitment_electr_signature";
- });
- if (ast) {
- await this.subCanvas();
- }
- let data = JSON.parse(JSON.stringify(this.infoForm));
- if (data["sex"]) {
- data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
- }
- if (data["education"]) {
- data.education = this.dictObj["edu_level"][Number(data.education)];
- }
- if (data["working_years"]) {
- data.working_years =
- this.dictObj["working_years"][Number(data.working_years)];
- }
- console.log(data, "data");
- if (this.remarkStatus) {
- var arsty = {};
- for (let k in data) {
- for (let j in self.copyData) {
- if (k === j) {
- if (self.copyData[j].value === data[k]) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- } else {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 1,
- };
- }
- }
- }
- }
- } else {
- var arsty = {};
- for (let k in data) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- }
- }
- console.log(arsty, "arsty");
- this.$request
- .baseProfileStampV2AddWord({
- goodsId: this.goodsId,
- keyValue: JSON.stringify(arsty),
- })
- .then((res) => {
- let url = this.$tools.splitImgHost(res.msg);
- let name = res.msg.substring(res.msg.lastIndexOf("/") + 1);
- let image = new Image();
- // 解决跨域 Canvas 污染问题,
- image.setAttribute("crossorigin", "anonymous");
- image.onload = function () {
- var canvas = document.createElement("canvas");
- canvas.width = image.width;
- canvas.height = image.height;
- var context = canvas.getContext("2d");
- context.drawImage(image, 0, 0, image.width, image.height);
- var base64 = canvas.toDataURL("image/jpg"); //将图片格式转为base64
- var a = document.createElement("a"); // 生成一个a元素
- var event = new MouseEvent("click"); // 创建一个单击事件
- a.download = name; // 设置图片名称
- console.log(base64);
- a.href = base64; // 将生成的URL设置为a.href属性
- a.dispatchEvent(event); // 触发a的单击事件
- };
- image.src = url + "?time=" + Date.now(); //注意,这里是灵魂,否则依旧会产生跨域问题
- });
- },
- convertBase64UrlToBlob(urlData) {
- var localData = urlData; //dataUrl为base64位
- let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
- let length = base.length;
- let url = new Uint8Array(length);
- while (length--) {
- url[length] = base.charCodeAt(length);
- }
- let file = new File([url], "a.jpg", {
- type: "image/jpg",
- });
- //最后将file,通过ajax请求做为参数传给服务器就可以了
- return file;
- },
- async uploadDatas(data) {
- let self = this;
- if (this.infoForm.recent_photos && this.infoForm.idcard_face_photo) {
- let base = await this.$tools.imageToBase64(
- this.$tools.splitImgHost(this.infoForm.idcard_face_photo)
- );
- console.log(base);
- console.log(this.$tools.splitImgHost(this.infoForm.idcard_face_photo));
- let resData = {};
- try {
- resData = await this.$request.faceCertificationIDCardOCR({
- cardSide: 1, //1人像 2 国徽
- cardImageBase64: base,
- gradeId: this.gradeId,
- });
- } catch (err) {
- self.$message.warning("身份证人像面照片异常,请重新上传");
- self.uploading = false;
- return;
- }
- if (!resData.data) {
- this.$message.warning("身份证人像面照片异常,请重新上传");
- this.uploading = false;
- return;
- }
- this.veryIdCard = resData.data.IdNum;
- this.veryIdName = resData.data.IdName;
- // if (this.infoForm.idcard) {
- // if (this.infoForm.idcard != this.veryIdCard) {
- // this.$message.warning(
- // "输入的身份证号和身份证人像面照片身份证号不匹配"
- // );
- // this.uploading = false;
- // return;
- // }
- // }
- let base64 = await this.$tools.imageToBase64(
- this.$tools.splitImgHost(this.infoForm.recent_photos)
- );
- let newData = {
- urlA: this.infoForm.idcard_face_photo,
- oneInchPhotos: base64,
- };
- this.$request
- .faceCertificationIdCardCompareFace(newData)
- .then((res1) => {
- if (res1.data >= 70) {
- var self = this;
- if (self.remarkStatus) {
- var arsty = {};
- for (let k in data) {
- for (let j in self.copyData) {
- if (k === j) {
- if (self.copyData[j].value === data[k]) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- } else {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 1,
- };
- }
- }
- }
- }
- var datas = {
- id: this.id,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(arsty),
- };
- this.$request
- .editbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- } else {
- var objs = {};
- for (let k in data) {
- objs[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- }
- var datas = {
- goodsId: this.goodsId,
- profileTpId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(objs),
- };
- this.$request
- .addbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- }
- } else {
- this.uploading = false;
- this.$message.warning("证件照和身份证人像面照片不匹配");
- }
- })
- .catch((err) => {
- this.uploading = false;
- this.$message.warning(err.msg);
- });
- return;
- }
- if (self.remarkStatus) {
- var arsty = {};
- for (let k in data) {
- for (let j in self.copyData) {
- if (k === j) {
- if (self.copyData[j].value === data[k]) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- } else {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 1,
- };
- }
- }
- }
- }
- var datas = {
- id: this.id,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(arsty),
- };
- this.$request
- .editbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- } else {
- var objs = {};
- for (let k in data) {
- objs[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- }
- var datas = {
- goodsId: this.goodsId,
- profileTpId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(objs),
- };
- this.$request
- .addbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- }
- },
- subCanvas() {
- return new Promise((resolve, reject) => {
- var self = this;
- if (self.infoForm.commitment_electr_signature) {
- resolve();
- return;
- }
- this.$refs.esign[0]
- .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
- .then(async (res) => {
- let url = await this.$upload.upload(
- this.convertBase64UrlToBlob(res),
- 0
- );
- this.$set(this.infoForm, "commitment_electr_signature", url);
- resolve();
- })
- .catch((err) => {
- console.log(err, "err");
- // 画布没有签字时会执行这里提示一下
- // this.uploading = false;
- // this.$message({
- // type: "warning",
- // message: "请签名后再生成签字图片",
- // });
- resolve();
- });
- });
- },
- imageInfos() {
- var self = this;
- return new Promise(async (resolve, reject) => {
- const waitUpload = await self.uploadFile(self.faceUrl, 0);
- resolve(waitUpload);
- });
- },
- getarrays(key) {
- if (key === "sex") {
- return this.dictObj["sys_user_sex"];
- }
- if (key === "education") {
- return this.dictObj["edu_level"];
- }
- if (key === "working_years") {
- return this.dictObj["working_years"];
- }
- },
- dictList() {
- this.$request.dictList().then((res) => {
- if (res.code === 200) {
- let newList = {};
- let list = res.data;
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- if (newList.hasOwnProperty(item.dictType)) {
- newList[item.dictType].push(item.dictLabel);
- } else {
- newList[item.dictType] = [item.dictLabel];
- }
- }
- this.dictObj = newList;
- }
- });
- },
- getbaseprofiletplists() {
- return new Promise((resolve) => {
- let self = this;
- this.$request
- .getbaseprofiletplists({
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId || "",
- })
- .then((res) => {
- if (res.code === 200 && res.rows.length) {
- console.log(1);
- if (res.rows[0].keyValue) {
- console.log(2);
- self.$request
- .getbaseprofiletpId(self.goodsId)
- .then((baseRes) => {
- if (baseRes.code === 200) {
- console.log(3);
- if (baseRes.data) {
- console.log(4);
- self.$request
- .getbaseprofiletpgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((result) => {
- console.log(result, "result");
- if (result.code === 200) {
- if (
- !result.data ||
- (result.data.status === 3 &&
- result.data.changeStatus === 1)
- ) {
- console.log(5);
- if (!result.data) {
- console.log(6);
- self.needProfileModal = true;
- this.$confirm(`请填写资料`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- })
- .then((_) => {
- this.showAgreementModal = true;
- this.getInfo();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- } else {
- this.$confirm(
- `资料审核不通过,请前往重新填写`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.showInfoDetailModal = true;
- this.getInfo();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- }
- } else if (
- result.data.status === 1 &&
- JSON.parse(res.rows[0].keyValue2)[0]
- ) {
- console.log(8);
- self.$request
- .getbaseprofileStampgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((k) => {
- if (k.code === 200) {
- if (
- !k.data ||
- (k.data.status === 3 &&
- k.data.changeStatus === 1)
- ) {
- if (!k.data) {
- console.log(9);
- this.$confirm(
- `请前往填写盖章资料`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.showStampDetailModail = true;
- this.getInfoStamp();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- } else {
- console.log(10);
- self.needProfileModal = true;
- this.$confirm(
- `资料盖章审核不通过,请前往重新填写`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.showStampDetailModail = true;
- this.getInfoStamp();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- }
- } else {
- resolve();
- }
- }
- });
- } else {
- resolve();
- }
- }
- });
- } else {
- resolve();
- }
- }
- });
- } else {
- resolve();
- }
- } else {
- resolve();
- }
- });
- if (this.gradeId > 0) {
- //提交完资料返回判断是否已开班
- this.getGradeInfo();
- }
- });
- },
- getInfoStamp() {
- var self = this;
- this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
- var ast = JSON.parse(res.data.keyValue2);
- self.listDataStamp = ast;
- self.$request
- .getbaseprofileStampgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((result) => {
- if (result.data && result.data.status === 3) {
- self.remarkStamp = result.data.text;
- self.remarkStatusStamp = true;
- self.id = result.data.id;
- } else if (
- result.data &&
- (result.data.status === 1 || result.data.status === 2)
- ) {
- // uni.showModal({
- // showCancel: false,
- // content:
- // result.data.status === 1
- // ? "该商品审核资料已通过,不可重复提交资料"
- // : result.data.status === 2
- // ? "该商品审核资料处于待审核状态,不可重复提交资料"
- // : "请联系管理员",
- // success: function (k) {
- // if (k.confirm) {
- // uni.navigateBack();
- // }
- // },
- // });
- }
- })
- .catch((err) => {});
- });
- },
- getGradeInfo() {
- let self = this;
- this.$request.goodsGradeInfo(this.gradeId).then((res) => {
- if (res.code == 200) {
- self.gradeDetail = res.data;
- if (self.needProfileModal) {
- return;
- }
- if (self.gradeDetail.learningStatus == 2) {
- this.$confirm(
- `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
- "提示",
- {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- }
- if (
- self.gradeDetail.learningStatus == 3 &&
- Number(self.gradeDetail.learningTimeStart) >
- Number(new Date() / 1000)
- ) {
- this.$confirm(
- `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
- "提示",
- {
- confirmButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- }
- }
- });
- this.$store.state.allowLoading = true;
- },
- deleteImg(item) {
- if (item.fieldKey == "recent_photos") {
- this.fileList1 = [];
- this.infoForm["recent_photos"] = "";
- } else if (item.fieldKey == "idcard_face_photo") {
- this.fileList2 = [];
- this.infoForm["idcard_face_photo"] = "";
- } else if (item.fieldKey == "idcard_national_photo") {
- this.fileList3 = [];
- this.infoForm["idcard_national_photo"] = "";
- }
- },
- /**
- * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
- */
- getInfo() {
- var self = this;
- this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
- console.log(res, "res");
- var listData = JSON.parse(res.data.keyValue);
- var ast = JSON.parse(res.data.keyValue2);
- self.listData = [...listData, ...ast];
- console.log(self.listData, "self.listData");
- self.listData.forEach((item) => {
- if (item.fieldKey == "idcard") {
- this.infoForm.idcard = this.userInfo.idCard;
- }
- if (item.fieldKey == "telphone") {
- this.infoForm.telphone = this.userInfo.telphone;
- }
- if (item.fieldKey == "name") {
- this.infoForm.name = this.userInfo.realname || "";
- }
- });
- self.isRequired = self.listData.every((ims) => {
- return ims.required === false;
- });
- this.$nextTick(() => {
- this.agreementModal = true;
- });
- self.$request
- .getbaseprofiletpgetInfo({
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- })
- .then((result) => {
- if (result.code === 200) {
- if (!result.data) {
- self.$request
- .getbaseprofiletplistProfile({
- pageNum: 1,
- pageSize: 1,
- })
- .then((kit) => {
- if (kit.rows.length) {
- var ajson = JSON.parse(kit.rows[0].keyValue);
- self.listData.forEach((zyitem, zyindex) => {
- for (let k in ajson) {
- if (zyitem.fieldKey == k && ajson[k].value) {
- if (k === "sex") {
- const sexIndex =
- self.dictObj["sys_user_sex"].indexOf(
- ajson[k].value
- ) + "";
- self.$set(self.infoForm, k, sexIndex);
- } else if (k === "education") {
- const sexIndex =
- self.dictObj["edu_level"].indexOf(
- ajson[k].value
- ) + "";
- self.$set(self.infoForm, k, sexIndex);
- } else if (k === "working_years") {
- const sexIndex =
- self.dictObj["working_years"].indexOf(
- ajson[k].value
- ) + "";
- self.$set(self.infoForm, k, sexIndex);
- } else if (k === "recent_photos") {
- self.$set(self.infoForm, k, ajson[k].value);
- if (ajson[k].value) {
- self.fileList1 = [
- {
- url: ajson[k].value,
- },
- ];
- }
- } else if (k === "idcard_face_photo") {
- self.$set(self.infoForm, k, ajson[k].value);
- if (ajson[k].value) {
- self.fileList2 = [
- {
- url: ajson[k].value,
- },
- ];
- }
- } else if (k === "idcard_national_photo") {
- self.$set(self.infoForm, k, ajson[k].value);
- if (ajson[k].value) {
- self.fileList3 = [
- {
- url: ajson[k].value,
- },
- ];
- }
- } else {
- if (k === "name") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.realname
- );
- } else if (k === "idcard") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.idCard
- );
- } else if (k === "telphone") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.telphone
- );
- } else if (k !== "commitment_electr_signature") {
- self.$set(self.infoForm, k, ajson[k].value);
- }
- }
- }
- }
- });
- }
- });
- }
- if (result.data && result.data.status === 3) {
- self.remark = result.data.text;
- self.remarkStatus = true;
- self.id = result.data.id;
- var arrays = JSON.parse(result.data.keyValue);
- self.copyData = JSON.parse(JSON.stringify(arrays));
- for (let k in arrays) {
- if (k === "sex") {
- if (arrays[k].value) {
- const sexIndex =
- self.dictObj["sys_user_sex"].indexOf(arrays[k].value) +
- "";
- self.$set(self.infoForm, k, sexIndex);
- }
- } else if (k === "education") {
- if (arrays[k].value) {
- const sexIndex =
- self.dictObj["edu_level"].indexOf(arrays[k].value) + "";
- self.$set(self.infoForm, k, sexIndex);
- }
- } else if (k === "working_years") {
- if (arrays[k].value) {
- const sexIndex =
- self.dictObj["working_years"].indexOf(arrays[k].value) +
- "";
- self.$set(self.infoForm, k, sexIndex);
- }
- } else if (k === "recent_photos") {
- self.$set(self.infoForm, k, arrays[k].value);
- if (arrays[k].value) {
- self.fileList1 = [{ url: arrays[k].value }];
- }
- } else if (k === "idcard_face_photo") {
- self.$set(self.infoForm, k, arrays[k].value);
- if (arrays[k].value) {
- self.fileList2 = [{ url: arrays[k].value }];
- }
- } else if (k === "idcard_national_photo") {
- self.$set(self.infoForm, k, arrays[k].value);
- if (arrays[k].value) {
- self.fileList3 = [{ url: arrays[k].value }];
- }
- } else if (k === "name") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.realname
- );
- } else if (k === "idcard") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.idCard
- );
- } else if (k === "telphone") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.telphone
- );
- } else {
- self.$set(self.infoForm, k, arrays[k].value);
- }
- }
- } else if (
- result.data &&
- (result.data.status === 1 || result.data.status === 2)
- ) {
- this.$confirm(
- result.data.status === 1
- ? "该商品审核资料已通过,不可重复提交资料"
- : result.data.status === 2
- ? "该商品审核资料处于待审核状态,不可重复提交资料"
- : "请联系管理员",
- "提示",
- {
- confirmButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- }
- }
- });
- });
- },
- returnName(key) {
- if (key === "sex") {
- if (this.infoForm[key]) {
- return this.dictObj["sys_user_sex"][Number(this.infoForm[key])];
- } else {
- return "请选择性别";
- }
- }
- if (key === "education") {
- if (this.infoForm[key]) {
- return this.dictObj["edu_level"][Number(this.infoForm[key])];
- } else {
- return "请选择学历";
- }
- }
- if (key === "working_years") {
- if (this.infoForm[key]) {
- return this.dictObj["working_years"][Number(this.infoForm[key])];
- } else {
- return "请选择工作年限";
- }
- }
- },
- retDraw() {
- this.$set(this.infoForm, "commitment_electr_signature", "");
- this.$nextTick(() => {
- this.$refs.esign[0].reset();
- });
- },
- uploadFile(options, int) {
- var self = this;
- return new Promise((resolve, reject) => {
- var data = {
- imageStatus: int,
- gradeId: this.gradeId,
- orderGoodsId: this.orderGoodsId,
- };
- self.$request
- .getPolicy(data)
- .then((res) => {
- var ossToken = res.data.resultContent;
- if (ossToken.host == null || ossToken.host == undefined) {
- this.$message({
- type: "warning",
- message: "上传路径报错" + JSON.stringify(res.data),
- });
- return;
- }
- let data = this.$tools.convertBase64UrlToBlob(this.faceUrl);
- this.$upload
- .upload(data, 0)
- .then((res) => {
- this.ossAvatarUrl = res;
- resolve(res);
- })
- .catch((err) => {
- this.$message({
- type: "warning",
- message: "上传接口报错,请重新拍照上传",
- });
- this.reTake();
- });
- })
- .catch((err) => {
- this.$message({
- type: "warning",
- message: "签名错误" + JSON.stringify(err),
- });
- return;
- });
- });
- },
- faceRecognition() {
- return new Promise((resolve) => {
- this.$request
- .faceCertificationCompareFace({
- imageA: this.faceUrl,
- orderGoodsId: this.orderGoodsId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- resolve(res.data);
- })
- .catch((err) => {
- this.loading = false;
- this.$message({
- type: "warning",
- message: err.msg,
- });
- });
- });
- },
- /**
- * 点击重拍
- */
- reTake() {
- this.faceUrl = "";
- this.isTaking = true;
- this.getUserMedia({
- video: {
- width: 400,
- height: 300,
- },
- });
- },
- // 点击拍照按钮
- onPhoto() {
- // if (this.isIE) {
- // window.webcam.capture();
- // } else {
- const canvas = document.createElement("canvas");
- canvas.width = 400;
- canvas.height = 300;
- const context = canvas.getContext("2d");
- const video = document.getElementById("video");
- context.drawImage(video, 0, 0, 400, 300);
- this.faceUrl = canvas.toDataURL("image/png");
- this.isTaking = false;
- // }
- },
- getUserMedia(constraints, success, error) {
- if (window.navigator.mediaDevices.getUserMedia) {
- // 最新的标准API
- window.navigator.mediaDevices
- .getUserMedia(constraints)
- .then(success)
- .catch(error);
- } else if (window.navigator.webkitGetUserMedia) {
- // webkit核心浏览器
- window.navigator.webkitGetUserMedia(constraints, success, error);
- } else if (window.navigator.mozGetUserMedia) {
- // firfox浏览器
- window.navigator.mozGetUserMedia(constraints, success, error);
- } else if (window.navigator.getUserMedia) {
- // 旧版API
- window.navigator.getUserMedia(constraints, success, error);
- }
- },
- photographSuccess(stream) {
- // 兼容webkit核心浏览器
- this.isTaking = true;
- this.takePhotoModal = true;
- this.$nextTick(() => {
- const video = document.getElementById("video");
- // 将视频流设置为video元素的源
- console.dir(video);
- video.srcObject = stream;
- this.mediaStreamTrack =
- typeof stream.stop === "function" ? stream : stream.getTracks()[0];
- video.play();
- });
- },
- photographError(err) {
- this.$confirm(
- "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
- "提示",
- {
- showConfirmButton: false,
- closeOnClickModal: false,
- showCancelButton: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- );
- },
- /**
- * 切换科目
- */
- courseChange() {
- return new Promise((resolve) => {
- this.noteParams = {
- pageNum: 1,
- // pageSize: 4,
- };
- this.duration = 0;
- this.playSectionId = 0;
- this.vid = "";
- if (this.player) {
- this.player.destroy();
- }
- this.player = "";
- if (this.playerzb) {
- this.playerzb.destroy();
- }
- this.playerzb = "";
- this.vidzb = "";
- this.historyChatMsgList = [];
- this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
- this.courseDetail(); //课程详情
- this.getAnswerList(); //答疑列表
- this.answerTimer = setInterval(() => {
- this.getAnswerList();
- }, 5000);
- this.getMenuList(); //学习目录
- this.getReMenuList(); //获取重修目录
- this.getNoteList(); //获取节笔记
- resolve();
- });
- },
- polyvLiveHistoryChatMsgList() {
- this.$request
- .polyvLiveHistoryChatMsgList({
- sectionId: this.playSectionId,
- channelId: this.sectionItem.liveUrl,
- })
- .then((res) => {
- this.historyChatMsgList = res.data;
- });
- },
- courseDetail() {
- let self = this;
- this.$request.courseDetail(this.courseId).then((res) => {
- // if (res.data.educationName == "继续教育") {
- // this.$request
- // .lockLockAction({
- // action: "jxjy",
- // })
- // .then((res) => {});
- // this.lockTimer = setInterval(() => {
- // this.$request
- // .lockLockAction({
- // action: "jxjy",
- // })
- // .then((res) => {});
- // }, 10000);
- // }
- self.detail = res.data;
- });
- },
- openModule(menuItem) {
- //重修目录点击
- console.log(menuItem.list);
- menuItem.showList = !menuItem.showList;
- if (!menuItem.list.length) {
- if (menuItem.isRebuild) {
- this.getReChapterList(menuItem.id, menuItem.courseId, menuItem);
- } else {
- this.getBuyChapterList(menuItem.id, menuItem.courseId, menuItem);
- }
- }
- },
- getReChapterList(moduleId, courseId, menuItem) {
- this.$request
- .reChapterList({
- moduleId: moduleId,
- gradeId: this.gradeId,
- courseId: courseId,
- rebuild: 1,
- })
- .then((res) => {
- for (let i = 0; i < res.data.length; i++) {
- let item = res.data[i];
- item.id = item.chapterId;
- item.showList = false;
- item.list = [];
- item.parent = menuItem;
- item.isRebuild = 1;
- }
- menuItem.list = res.data;
- });
- },
- getBuyChapterList(moduleId, courseId, menuItem) {
- this.$request
- .reChapterList({
- moduleId: moduleId,
- gradeId: this.gradeId,
- courseId: courseId,
- })
- .then((res) => {
- for (let i = 0; i < res.data.length; i++) {
- let item = res.data[i];
- item.id = item.chapterId;
- item.menuType = 2;
- item.showList = false;
- item.list = [];
- item.parent = menuItem;
- }
- menuItem.list = res.data;
- if (this.needOpen) {
- // this.needOpen = false;
- this.openChapter(menuItem.list[0]);
- }
- });
- },
- openChapter(chapter) {
- console.log(chapter, "chapter");
- chapter.showList = !chapter.showList;
- if (!chapter.list.length) {
- if (chapter.isRebuild) {
- this.getReSectionList(
- chapter.id,
- chapter.courseId,
- chapter.moduleId || 0,
- chapter
- );
- } else {
- this.getBuySectionList(
- chapter.id,
- chapter.courseId,
- chapter.moduleId || 0,
- chapter
- );
- }
- }
- },
- getReSectionList(chapterId, courseId, moduleId, chapter) {
- this.$request
- .reSectionList({
- chapterId: chapterId,
- gradeId: this.gradeId,
- courseId: courseId,
- rebuild: 1,
- moduleId: moduleId,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- chapter.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = chapter;
- });
- chapter.list = res.data;
- });
- },
- getBuySectionList(chapterId, courseId, moduleId = 0, chapter) {
- this.$request
- .reSectionList({
- chapterId: chapterId,
- gradeId: this.gradeId,
- courseId: courseId,
- moduleId: moduleId,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- chapter.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = chapter;
- });
- chapter.list = res.data;
- if (this.needOpen) {
- this.needOpen = false;
- if (
- chapter.list &&
- !this.sectionItem.recordingUrl &&
- this.sectionItem.sectionType != 2
- ) {
- // this.getResource(chapter.list[0]);
- }
- }
- });
- },
- getGoodsDetail() {
- return new Promise((resolve) => {
- let self = this;
- this.$request.goodsDetail(this.goodsId).then((res) => {
- self.goodsData = res.data;
- self.gradeId = self.goodsData.gradeId;
- if (this.goodsData.categoryName) {
- this.infoForm.apply_post = this.goodsData.categoryName;
- if (this.goodsData.categoryName) {
- this.apply_post_disabled = true;
- }
- if (this.userInfo.companyName) {
- this.infoForm.work_unit = this.userInfo.companyName;
- }
- }
- if (this.goodsData.buyNote) {
- this.tabList = [
- { name: "1", label: "学员须知" },
- { name: "2", label: "课程答疑" },
- { name: "3", label: "笔记讲义" },
- ];
- console.log(res, "res111");
- this.getRecommend();
- } else {
- this.tabList = [
- { name: "1", label: "课程答疑" },
- { name: "2", label: "笔记讲义" },
- ];
- }
- this.courseBusiness();
- this.courseHandouts();
- if (self.goodsData.goodsPlayConfig) {
- self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
- if (self.goodsPlayConfig.autoPlay > 0) {
- self.autoplay = true;
- }
- if (self.goodsPlayConfig.drag > 0) {
- self.isAllowSeek = "off";
- }
- if (self.goodsPlayConfig.speed > 0) {
- self.playbackRate = true;
- }
- }
- if (self.goodsData.goodsPhotographConfig) {
- self.goodsPhotographConfig = JSON.parse(
- self.goodsData.goodsPhotographConfig
- );
- if (self.goodsPhotographConfig.photoNum > 0) {
- self.photoNum = self.goodsPhotographConfig.photoNum;
- }
- }
- });
- resolve();
- });
- },
- /**
- * 点击节
- */
- async getResource(section) {
- //逻辑
- if (section.type == 2) {
- //试卷
- console.log("试卷");
- console.log(section);
- let learnNum = await this.goodsTodayStudySectionNum();
- let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
- if (this.goodsData.sectionMaxNum > 0) {
- if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
- this.$message({
- type: "warning",
- message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
- });
- return;
- }
- }
- if (this.businessData.goodsLearningOrder == 1) {
- if (section.parent.canLearn) {
- let num = await this.bankRecordDoNum(section);
- //有次数限制
- if (section.answerNum - num > 0 && section.answerNum > 0) {
- // this.$set(this.list[index],'doNum',(item.doNum+1))
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- examId: section.typeId,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- //没有答题次数限制
- } else if (section.answerNum == 0) {
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- examId: section.typeId,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- } else {
- this.$message({
- type: "warning",
- message: "该试卷只能答题" + section.answerNum + "次",
- });
- return;
- }
- } else {
- this.$message({
- type: "warning",
- message: "请按顺序学完视频课程再进行练习和测试",
- });
- }
- } else if (
- this.businessData.goodsLearningOrder == 2 &&
- !section.rebuild
- ) {
- let rows = await this.studyRecordMenuAllList();
- let isStop = false;
- let newRows = [];
- for (let i = 0; i < rows.length; i++) {
- let moduleTrue = rows[i].moduleId == section.moduleId;
- let chapterTrue = rows[i].chapterId == section.chapterId;
- if (moduleTrue && chapterTrue) {
- isStop = true;
- if (rows[i].sectionType != 2) {
- //忽略直播
- newRows.push(rows[i]);
- }
- } else {
- if (!isStop) {
- if (rows[i].sectionType != 2) {
- //忽略直播
- newRows.push(rows[i]);
- }
- } else {
- break;
- }
- }
- }
- console.log(newRows);
- let isAllLearn = newRows.every((item) => {
- return item.studyStatus == 1;
- });
- if (isAllLearn) {
- //之前的都学完了
- // if(canLearn) { //视频的上一节学完
- let num = await this.bankRecordDoNum(section.typeId);
- //有次数限制
- if (section.answerNum - num > 0 && section.answerNum > 0) {
- console.log(this.list[index]);
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- examId: section.typeId,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- //没有答题次数限制
- } else if (section.answerNum == 0) {
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- examId: section.typeId,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- } else {
- this.$message({
- type: "warning",
- message: "该试卷只能答题" + section.answerNum + "次",
- });
- return;
- }
- } else {
- this.$message({
- type: "warning",
- message: "请学完视频课程再进行练习和测试",
- });
- }
- } else {
- let num = await this.bankRecordDoNum(section.typeId);
- //有次数限制
- if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
- // this.$set(this.list[index],'doNum',(item.doNum+1))
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- examId: section.typeId,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- //没有答题次数限制
- } else if (section.answerNum == 0) {
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- examId: section.typeId,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- } else {
- this.$message({
- type: "warning",
- message: "该试卷只能答题" + section.answerNum + "次",
- });
- return;
- }
- }
- return;
- }
- if (section.type != 2) {
- if (this.clickLock) {
- return;
- }
- this.clickLock = true;
- if (
- this.playSectionId &&
- (this.playSectionId == section.sectionId ||
- this.playSectionId == section.menuId) &&
- this.moduleId == (section.moduleId || 0) &&
- this.chapterId == (section.chapterId || 0)
- ) {
- //切换为同一频道不作为
- this.clickLock = false;
- return;
- }
- if (this.businessData.goodsLearningOrder == 2 && !section.isRebuild) {
- //要按从头到尾顺序学习, 且不是重修课程
- let rows = await this.studyRecordMenuAllList();
- if (!this.hasPreItem(rows, section)) {
- //判断是否有上一节
- let newRows = [];
- for (let i = 0; i < rows.length; i++) {
- let moduleTrue =
- rows[i].moduleId == section.moduleId || rows[i].moduleId == 0;
- let chapterTrue =
- rows[i].chapterId == section.chapterId ||
- rows[i].chapterId == 0;
- let sectionTrue =
- rows[i].sectionId == section.sectionId ||
- rows[i].sectionId == section.menuId;
- if (moduleTrue && chapterTrue && sectionTrue) {
- break;
- } else {
- if (rows[i].sectionType != 2) {
- newRows.push(rows[i]);
- }
- }
- }
- let isAllLearn = newRows.every((item) => {
- return item.studyStatus == 1;
- });
- if (isAllLearn) {
- this.initVideo(section);
- } else {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: "请按顺序学习视频课程",
- });
- }
- } else {
- //第一章第一节
- this.initVideo(section);
- }
- } else {
- this.initVideo(section);
- }
- }
- },
- bankRecordDoNum(section) {
- return new Promise((resolve) => {
- this.$request
- .bankRecordDoNum({
- goodsId: this.goodsId,
- gradeId: this.gradeId,
- chapterId: section.chapterId,
- courseId: this.courseId,
- moduleId: 0,
- examId: section.typeId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- /**
- * 是否有上一章节
- */
- hasPreItem(rows, option) {
- let moduleId = option.moduleId;
- let chapterId = option.chapterId;
- let sectionId = option.sectionId;
- let index = 0;
- for (let i = 0; i < rows.length; i++) {
- if (
- rows[i].moduleId == moduleId &&
- rows[i].chapterId == chapterId &&
- rows[i].sectionId == sectionId
- ) {
- index = i;
- break;
- }
- }
- if (index == 0) {
- return false;
- } else {
- return true;
- }
- },
- async initVideo(option) {
- if (option.sectionType == 1 || option.sectionType == 3) {
- //录播
- let learnNum = await this.goodsTodayStudySectionNum(option);
- let hasLearn = await this.gradeCheckGoodsStudy(option);
- console.log(hasLearn, "hasLearn");
- console.log(learnNum, "learnNum");
- console.log(
- this.goodsData.sectionMaxNum,
- "this.goodsData.sectionMaxNum"
- );
- if (this.goodsData.sectionMaxNum > 0) {
- if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
- });
- return;
- }
- }
- if (!option.recordingUrl) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `暂无播放地址数据`,
- });
- return;
- }
- if (this.playSectionId > 0) {
- //切换视频
- // let oldSectionId = this.playSectionId;
- // uni.$emit("changeSection", oldSectionId);
- }
- this.playVideo(option);
- }
- if (option.sectionType == 2) {
- //直播
- let learnNum = await this.goodsTodayStudySectionNum(option);
- let hasLearn = await this.gradeCheckGoodsStudy(option);
- if (this.goodsData.sectionMaxNum > 0) {
- if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
- });
- return;
- }
- }
- if (!option.liveUrl) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `暂无直播地址数据`,
- });
- }
- let data = await this.studyRecordGetChannelBasicInfo(option.liveUrl);
- if (data.watchStatus == "end" || data.watchStatus == "playback") {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `直播已结束`,
- });
- return;
- }
- if (data.watchStatus == "waiting") {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `直播未开始`,
- });
- return;
- }
- this.playVideo(option);
- }
- return;
- },
- studyRecordGetChannelBasicInfo(channelId) {
- return new Promise((resolve) => {
- this.$request
- .studyRecordGetChannelBasicInfo({
- channelId,
- })
- .then((res) => {
- console.log(res, "channel");
- resolve(res.data);
- });
- });
- },
- /**
- * 判断是否是当前播放的节
- */
- isActive(section) {
- let moduleId = section.moduleId || 0;
- let chapterId = section.chapterId || 0;
- let sectionId = section.sectionId || section.menuId;
- if (
- moduleId == this.moduleId &&
- chapterId == this.chapterId &&
- sectionId == this.playSectionId
- ) {
- return true;
- } else {
- return false;
- }
- },
- async playVideo(option) {
- if (option.sectionType == 1 || option.sectionType == 3) {
- //录播
- //设置播放的节ID
- //提交保存观看历史
- if (this.playSectionId) {
- this.postStudyRecord(0, this.playSectionId);
- }
- this.player &&
- this.player.HTML5.video.removeEventListener(
- "timeupdate",
- this.timeEvent
- );
- //播放视频
- this.showRecordStatus = false; //隐藏播放记录提示
- this.sectionItem = option;
- console.log(option, "option");
- this.isPlayRebuild = option.rebuild;
- this.moduleId = option.moduleId || 0;
- this.chapterId = option.chapterId || 0;
- this.playSectionId = option.sectionId || option.menuId;
- // console.log(this.moduleId, this.chapterId, this.playSectionId);
- await this.getPhotoLastRecord();
- this.recordObj = await this.getRecordLast();
- this.getNoteList();
- await this.clears();
- this.vid = option.recordingUrl;
- this.historyChatMsgList = [];
- if (option.sectionType == 3) {
- this.polyvLiveHistoryChatMsgList();
- }
- this.loadPlayerScript(this.loadPlayer);
- setTimeout(() => {
- this.clickLock = false;
- }, 3000);
- // uni.$emit("levelId", this.levelId);
- // uni.$emit("getSection", this.menuItem);
- // uni.$emit("isRebuild", this.isRebuild);
- }
- if (option.sectionType == 2) {
- //直播
- //提交保存观看历史
- if (this.playSectionId) {
- this.postStudyRecord(0, this.playSectionId);
- }
- this.player &&
- this.player.HTML5.video.removeEventListener(
- "timeupdate",
- this.timeEvent
- );
- //播放视频
- this.showRecordStatus = false; //隐藏播放记录提示
- this.sectionItem = option;
- console.log(option, "option");
- this.isPlayRebuild = option.rebuild;
- this.moduleId = option.moduleId || 0;
- this.chapterId = option.chapterId || 0;
- this.playSectionId = option.sectionId || option.menuId;
- // console.log(this.moduleId, this.chapterId, this.playSectionId);
- await this.getPhotoLastRecord();
- this.recordObj = await this.getRecordLast();
- this.getNoteList();
- //设置播放的节ID
- await this.clears();
- this.vidzb = option.liveUrl;
- this.$router.push({
- path: "/living-room/" + option.liveUrl,
- query: {
- goodsId: this.goodsId,
- courseId: this.courseId,
- gradeId: this.gradeId,
- orderGoodsId: this.orderGoodsId,
- sectionId: option.sectionId || option.menuId,
- chapterId: option.chapterId || 0,
- moduleId: option.moduleId || 0,
- sectionType: 2,
- },
- });
- // this.loadPlayerScriptzb(this.loadPlayerzb);
- // setTimeout(() => {
- // this.clickLock = false;
- // }, 3000);
- }
- },
- gradeCheckGoodsStudy(option) {
- return new Promise((resolve) => {
- this.$request
- .gradeCheckGoodsStudy({
- goodsId: this.goodsId,
- gradeId: this.gradeId,
- moduleId: option.moduleId || 0,
- chapterId: option.chapterId || 0,
- sectionId: option.sectionId || option.menuId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- goodsTodayStudySectionNum(option) {
- return new Promise((resolve) => {
- this.$request
- .goodsTodayStudySectionNum({
- goodsId: this.goodsId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- studyRecordMenuAllList() {
- return new Promise((resolve) => {
- this.$request
- .studyRecordMenuAllList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- loadPlayerzb() {
- var self = this;
- const polyvLivePlayer = window.polyvLivePlayer;
- this.playerzb = polyvLivePlayer({
- wrap: "#playerzb",
- width: 810,
- height: 455,
- showLine: "off",
- uid: this.uidzb,
- vid: this.vidzb,
- });
- this.playerzb.on("s2j_onStartPlay", () => {
- console.log("s2j_onStartPlay");
- this.hasStart = true;
- this.livingTimer = setInterval(self.timeEventLiving, 1000);
- });
- this.playerzb.on("s2j_onOver", () => {
- console.log("s2j_onOver");
- clearInterval(this.livingTimer);
- this.hasStart = false;
- this.$message({
- type: "success",
- message: "播放完毕",
- });
- this.postStudyRecord(1);
- });
- },
- loadPlayer() {
- var self = this;
- const polyvPlayer = window.polyvPlayer;
- console.log(polyvPlayer);
- self.$request.obtainpolyvvideosign(self.vid).then((res) => {
- console.log(res, "res2");
- self.player = polyvPlayer({
- wrap: "#player",
- width: 810,
- showLine: "off",
- height: 455,
- ban_history_time: "on",
- vid: self.vid,
- autoplay: this.autoplay,
- ban_seek: this.isAllowSeek,
- speed: this.playbackRate,
- teaser_show: 1,
- tail_show: 1,
- hideSwitchPlayer: true,
- watchStartTime: this.recordObj.videoCurrentTime,
- ts: res.data.ts,
- sign: res.data.sign,
- // adMatter: [
- // {
- // // 广告参数详细配置
- // location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
- // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
- // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
- // timesize: 5, //广告时长,单位:秒
- // skipenabled: false, //是否显示跳过按钮
- // },
- // {
- // // 广告参数详细配置
- // location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
- // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
- // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
- // timesize: 5, //广告时长,单位:秒
- // skipenabled: false, //是否显示跳过按钮
- // },
- // ],
- playsafe: function (vid, next) {
- next();
- },
- });
- this.player.HTML5.video.addEventListener("timeupdate", self.timeEvent);
- this.player.on("s2j_onPlayStart", () => {
- //开始播放每5秒提交一次观看时间
- this.hasStart = true;
- clearInterval(this.postTimer);
- this.postTimer = setInterval(() => {
- this.postStudyRecord(0, this.playSectionId, 5);
- }, 30000);
- if (this.recordObj.videoCurrentTime) {
- this.showRecordStatus = true;
- setTimeout(() => {
- this.showRecordStatus = false;
- }, 5000);
- } else {
- //新视频直接提交一条观看记录
- // this.postStudyRecord(0);
- this.showRecordStatus = false;
- }
- });
- this.player.on("s2j_onVideoPause", () => {
- clearInterval(this.postTimer);
- });
- this.player.on("s2j_onVideoPlay", () => {
- if (this.postTimer) {
- this.postTimer = setInterval(() => {
- this.postStudyRecord(0, this.playSectionId, 5);
- }, 30000);
- }
- });
- this.player.on("s2j_onPlayOver", () => {
- this.hasStart = false;
- clearInterval(this.postTimer);
- this.$message({
- type: "success",
- message: "播放完毕",
- });
- this.postStudyRecord(1);
- });
- });
- },
- timeEventLiving() {
- var polyvPlayerContext = this.playerzb;
- if (polyvPlayerContext) {
- this.liveDuration = this.liveDuration + 1; //每隔1秒
- console.log(this.liveDuration);
- if (this.liveDuration == 2) {
- //直播第2秒拍照
- if (
- this.goodsPhotographConfig &&
- this.goodsPhotographConfig.livephotograph == 1 &&
- this.sectionItem.learning != 1 &&
- this.photoHistoryList.length == 0
- ) {
- //开启直播拍照
- polyvPlayerContext.j2s_pauseVideo();
- this.openPhoto();
- } else {
- this.postStudyRecord();
- }
- }
- }
- },
- timeEvent() {
- let self = this;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
- // console.log(this.playTime,789,this.photoHistoryList)
- //判断是否需要拍照
- if (this.photoNum > 0) {
- this.configPhoto();
- let photoTime = 0; //获取拍照秒数
- for (let i = 0; i < this.photoList.length; i++) {
- photoTime = Number(this.photoList[i]); //获取拍照秒数
- if (photoTime < this.playTime && photoTime > this.playTime - 8) {
- //3秒区间内才触发拍照,避免拉动滚动条
- if (
- this.photoHistoryList.indexOf(i) < 0 &&
- this.sectionItem.learning != 1
- ) {
- //不存在拍照历史,没有重修过,没有学过,则拍照
- //启动拍照
- //暂停
- polyvPlayerContext.j2s_pauseVideo();
- this.photoIndex = i;
- this.openPhoto();
- } else {
- }
- }
- }
- }
- }
- },
- getPhotoLastRecord() {
- return new Promise((resolve) => {
- let self = this;
- let data = {
- sectionId: parseInt(self.playSectionId),
- goodsId: parseInt(self.goodsId),
- courseId: parseInt(self.courseId),
- gradeId: parseInt(self.gradeId),
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- };
- this.$request.getPhotoLastRecord(data).then((res) => {
- //清空历史数据
- self.photoHistoryList = [];
- this.photoIndex = 0;
- self.photoList = [];
- for (let i = 0; i < res.data.length; i++) {
- //-2存储随机拍照数组
- if (res.data[i].photoIndex == -2) {
- self.photoList = res.data[i].timeInterval.split(",");
- } else {
- self.photoHistoryList.push(res.data[i].photoIndex);
- }
- }
- resolve();
- });
- });
- },
- //拍照
- openPhoto() {
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- if (this.isFullScreen()) {
- this.exitFullscreen();
- }
- }
- var polyvPlayerContext = this.playerzb;
- if (polyvPlayerContext) {
- if (this.isFullScreen()) {
- this.exitFullscreen();
- }
- }
- this.$nextTick(() => {
- if (
- (window.navigator.mediaDevices &&
- window.navigator.mediaDevices.getUserMedia) ||
- window.navigator.getUserMedia ||
- window.navigator.webkitGetUserMedia ||
- window.navigator.mozGetUserMedia
- ) {
- console.log(this.getUserMedia, "getUserMedia");
- // 调用用户媒体设备, 访问摄像头
- this.getUserMedia(
- {
- video: {
- width: 400,
- height: 300,
- },
- },
- this.photographSuccess,
- this.photographError
- );
- } else {
- this.photographError();
- }
- });
- },
- /**
- * 退出全屏
- */
- exitFullscreen() {
- try {
- var de = document;
- console.log(de);
- if (de.exitFullscreen) {
- de.exitFullscreen();
- } else if (de.mozCancelFullScreen) {
- de.mozCancelFullScreen();
- } else if (de.webkitCancelFullScreen) {
- de.webkitCancelFullScreen();
- }
- } catch (err) {}
- },
- fullele() {
- return (
- document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.msFullscreenElement ||
- document.mozFullScreenElement ||
- null
- );
- },
- //判断是否全屏
- isFullScreen() {
- return !!(document.webkitIsFullScreen || this.fullele());
- },
- //配置随机拍照时间
- configPhoto() {
- var polyvPlayerContext = this.player;
- let totalVideoTime = polyvPlayerContext.j2s_getDuration();
- let duration = polyvPlayerContext.j2s_getCurrentTime();
- let photoNum = this.photoNum;
- if (!this.photoConfig) {
- this.photoConfig = true;
- //没有历史拍照间隔数据
- if (this.photoList.length == 0) {
- if (totalVideoTime >= 900) {
- //大于15分钟
- if (photoNum == 1) {
- //开头拍1张
- this.photoList.push(1);
- } else if (photoNum == 3) {
- //拍3张
- this.photoList.push(0); //开头拍一张
- let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
- let centerMinTime = centerTime - 300; //前后5分钟
- let centerMaxTime = centerTime + 300;
- let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
- this.photoList.push(centerTakeTime); //中间拍一张
- let endMaxTime = totalVideoTime - 60;
- let endMinTime = totalVideoTime - 300;
- let endTakeTime = this.randomNum(endMinTime, endMaxTime);
- this.photoList.push(endTakeTime); //最后拍一张
- }
- } else {
- //小于15分钟,只拍前后各一张
- if (photoNum == 1) {
- //开头拍1张
- this.photoList.push(1);
- } else if (photoNum == 3) {
- //拍2张
- if (totalVideoTime <= 300) {
- //小于5分钟
- this.photoList.push(1); //开头拍一张
- let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
- this.photoList.push(endTakeTime);
- } else {
- this.photoList.push(1); //开头拍一张
- let endMaxTime = totalVideoTime - 60;
- let endMinTime = totalVideoTime - 300;
- let endTakeTime = this.randomNum(endMinTime, endMaxTime);
- this.photoList.push(endTakeTime); //最后1-5分钟拍一张
- }
- }
- }
- console.log(this.photoList, "随机拍照时间数组11", photoNum);
- this.postCoursePhotoRecord(true); //提交随机拍照时间数组
- }
- console.log(this.photoList, "随机拍照时间数组");
- //兼容已有观看历史
- for (let i = 0; i < this.photoList.length - 1; i++) {
- if (
- this.photoList[i] < duration &&
- this.photoList[i + 1] > duration
- ) {
- this.photoIndex = i + 1;
- // console.log("我的修改了photoIndex")
- break;
- }
- if (duration > this.photoList[this.photoList.length - 1]) {
- this.photoIndex = this.photoList.length - 1; //取最后一个下标
- // console.log("我的修改了photoIndex")
- break;
- }
- }
- }
- },
- randomNum(minNum, maxNum) {
- switch (arguments.length) {
- case 1:
- return parseInt(Math.random() * minNum + 1, 10);
- break;
- case 2:
- return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
- break;
- default:
- return 0;
- break;
- }
- },
- //postTime 只提交随机时间
- postCoursePhotoRecord(postTime = false) {
- return new Promise((resolve, reject) => {
- let currentTime = 0;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- currentTime = polyvPlayerContext.j2s_getCurrentTime();
- }
- let self = this;
- let photoIndex = self.photoIndex;
- let data = {
- photo: self.ossAvatarUrl,
- sectionId: parseInt(self.playSectionId),
- goodsId: parseInt(self.goodsId),
- courseId: parseInt(self.courseId),
- photoTime: parseInt(currentTime > 0 ? currentTime : 0),
- gradeId: parseInt(self.gradeId),
- photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
- photoNum: parseInt(self.photoNum),
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- timeInterval: postTime ? self.photoList.join(",") : "",
- };
- console.log("提交接口", data);
- this.$request
- .coursePhotoRecord(data)
- .then((res) => {
- console.log(res, "res");
- resolve();
- })
- .catch((err) => {
- console.log(err, "err");
- reject();
- });
- });
- },
- /**
- * @param {String} 直播预览
- */
- loadPlayerScriptzb(callback) {
- if (!window.polyvLivePlayer) {
- const myScript = document.createElement("script");
- myScript.setAttribute("src", this.playerJs);
- myScript.onload = callback;
- document.body.appendChild(myScript);
- } else {
- callback();
- }
- },
- loadPlayerScript(callback) {
- if (!window.polyvPlayer) {
- const myScript = document.createElement("script");
- myScript.setAttribute("src", this.vodPlayerJs);
- myScript.onload = callback;
- document.body.appendChild(myScript);
- } else {
- callback();
- }
- },
- clears() {
- return new Promise((resolve, reject) => {
- this.vid = "";
- this.vidzb = "";
- if (this.player) {
- this.player.destroy();
- }
- if (this.playerzb) {
- this.playerzb.destroy();
- }
- resolve();
- });
- },
- /**
- * 提交观看记录
- */
- postStudyRecord(status = 0, sectionId = this.playSectionId) {
- let currentTime = 0;
- let PlayDuration = 0;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
- PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
- }
- if (this.vidzb) {
- currentTime = 2; //直播无法获取,无论开始结束都传2秒
- }
- let self = this;
- console.log(this);
- console.log(PlayDuration, "PlayDuration");
- let data = {
- fromPlat: 2, //来源平台 1小程序 2网站
- photo: self.ossAvatarUrl,
- sectionId: parseInt(this.playSectionId),
- goodsId: parseInt(this.goodsId),
- courseId: parseInt(this.courseId),
- studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
- gradeId: parseInt(this.gradeId),
- chapterId: parseInt(this.chapterId),
- moduleId: parseInt(this.moduleId),
- videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
- orderGoodsId: parseInt(this.orderGoodsId),
- };
- console.log(data, "data");
- if (status > 0) {
- data.status = status;
- }
- this.$request
- .studyRecord(data)
- .then((res) => {
- if (status > 0) {
- //看完视频刷新父级列表
- let rebuildObj = this.getSameObj(this.sectionItem);
- this.refreshParentList(this.sectionItem, rebuildObj);
- }
- self.ossAvatarUrl = "";
- })
- .catch((err) => {
- console.log(err);
- this.$message({
- type: "warning",
- message: err.msg,
- });
- });
- },
- /**
- * 获取重修列表中是否有相同对象
- */
- getSameObj(metaObj) {
- let newObj = false;
- if (this.reMenuList.length) {
- console.log(this.reMenuList, "this.reMenuList");
- this.reMenuList.forEach((menu) => {
- if (menu.type == 3) {
- let isSame = this.contrast(metaObj, menu);
- if (isSame) {
- newObj = isSame;
- }
- } else {
- if (menu.list && menu.list.length) {
- menu.list.forEach((menuItem) => {
- if (menuItem.type == 1) {
- console.log(menuItem, metaObj);
- let isSame = this.contrast(metaObj, menuItem);
- if (isSame) {
- newObj = isSame;
- }
- } else {
- if (menuItem.list && menuItem.list.length) {
- menuItem.list.forEach((menuChild) => {
- if (menuChild.type == 1) {
- let isSame = this.contrast(metaObj, menuChild);
- if (isSame) {
- newObj = isSame;
- }
- }
- });
- }
- }
- });
- }
- }
- });
- return newObj;
- } else {
- return false;
- }
- },
- contrast(obj1, obj2) {
- let moduleId1 = obj1.moduleId || 0;
- let chapterId1 = obj1.chapterId || 0;
- let sectionId1 = obj1.sectionId || obj1.menuId;
- let moduleId2 = obj2.moduleId || 0;
- let chapterId2 = obj2.chapterId || 0;
- let sectionId2 = obj2.sectionId || obj2.menuId;
- //转字符串后对比是否一致
- return moduleId1 == moduleId2 &&
- chapterId1 == chapterId2 &&
- sectionId1 == sectionId2
- ? obj2
- : false;
- },
- /**
- * 刷新父级列表
- */
- refreshParentList(sectionItem, rebuildObj) {
- console.log(sectionItem, "sectionItem");
- console.log(rebuildObj, "rebuildObj");
- let self = this;
- if (sectionItem.menuId) {
- //最外层节有menuid
- //普通章节目录
- this.$request
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
- .then((res) => {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- if (item.type == 3) {
- self.menuList[i].learning = item.learning;
- self.menuList[i].rebuild = item.rebuild;
- }
- }
- });
- if (this.menuTab.length > 1) {
- //有重修目录
- this.$request
- .reMenuList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- rebuild: 1,
- })
- .then((res) => {
- if (res.rows.length > 0) {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.isRebuild = 1;
- }
- self.reMenuList = self.reMenuList.filter((reMenu) => {
- //筛选剩下的选项
- return res.rows.find((row) => row.menuId == reMenu.menuId);
- });
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- ];
- this.courseTabIndex = "1";
- self.reMenuList = [];
- }
- });
- }
- } else if (!sectionItem.moduleId) {
- //第二层节没有moduleid
- this.$request
- .reSectionList({
- chapterId: sectionItem.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: 0,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- sectionItem.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.isRebuild = 1;
- section.parent = sectionItem.parent;
- });
- this.menuList.forEach((menu) => {
- if (menu.menuId == sectionItem.chapterId) {
- menu.list = res.data;
- }
- });
- });
- if (this.menuTab.length > 1 && rebuildObj) {
- this.$request
- .reSectionList({
- chapterId: rebuildObj.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: 0,
- rebuild: 1,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- rebuildObj.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = rebuildObj.parent;
- });
- this.reMenuList.forEach((menu) => {
- if (menu.menuId == rebuildObj.chapterId) {
- menu.list = res.data;
- }
- });
- });
- this.$request
- .reMenuList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- rebuild: 1,
- })
- .then((res) => {
- if (res.rows.length > 0) {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.isRebuild = 1;
- }
- self.reMenuList = self.reMenuList.filter((reMenu) => {
- //筛选剩下的选项
- return res.rows.find((row) => row.menuId == reMenu.menuId);
- });
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- ];
- this.courseTabIndex = "1";
- self.reMenuList = [];
- }
- });
- }
- } else {
- //第三层节有moduleid和chapterid都有
- this.$request
- .reSectionList({
- chapterId: sectionItem.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: sectionItem.moduleId,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- sectionItem.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = sectionItem.parent;
- });
- this.menuList.forEach((menu) => {
- if (menu.list && menu.list.length) {
- menu.list.forEach((chapter) => {
- if (
- chapter.moduleId == sectionItem.moduleId &&
- chapter.chapterId == sectionItem.chapterId
- ) {
- console.log(res.data, "res.data");
- console.log(chapter.list, "chapter.list");
- chapter.list = res.data;
- }
- });
- }
- });
- });
- if (this.menuTab.length > 1 && rebuildObj) {
- this.$request
- .reSectionList({
- chapterId: rebuildObj.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: rebuildObj.moduleId,
- rebuild: 1,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- rebuildObj.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = rebuildObj.parent;
- });
- this.reMenuList.forEach((menu) => {
- if (menu.list && menu.list.length) {
- menu.list.forEach((chapter) => {
- if (
- chapter.moduleId == rebuildObj.moduleId &&
- chapter.chapterId == rebuildObj.chapterId
- ) {
- chapter.list = res.data;
- }
- });
- }
- });
- });
- this.$request
- .reMenuList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- rebuild: 1,
- })
- .then((res) => {
- if (res.rows.length > 0) {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.isRebuild = 1;
- }
- self.reMenuList = self.reMenuList.filter((reMenu) => {
- //筛选剩下的选项
- return res.rows.find((row) => row.menuId == reMenu.menuId);
- });
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- ];
- this.courseTabIndex = "1";
- self.reMenuList = [];
- }
- });
- }
- }
- },
- getRecordLast() {
- let self = this;
- return new Promise((resolve) => {
- let data = {
- gradeId: Number(self.gradeId),
- goodsId: Number(self.goodsId),
- sectionId: Number(self.playSectionId),
- courseId: Number(self.courseId),
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- };
- self.$request.recordLast(data).then((res) => {
- resolve(res.data);
- });
- });
- },
- /**
- * 获取笔记列表
- */
- getNoteList() {
- let self = this;
- self.noteList = [];
- let data = {
- courseId: this.courseId,
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- pageNum: this.noteParams.pageNum,
- pageSize: this.noteParams.pageSize,
- };
- if (this.playSectionId > 0) {
- data.sectionId = this.playSectionId;
- }
- this.$request.noteList(data).then((res) => {
- self.noteList = res.rows;
- self.noteTotal = res.total;
- });
- },
- noteClick(note) {
- if (this.vid) {
- //切换视频
- if (this.vid == note.recordingUrl) {
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- polyvPlayerContext.j2s_seekVideo(note.noteSecond);
- }
- } else {
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- polyvPlayerContext.changeVid(note.recordingUrl);
- }
- }
- } else {
- var polyvPlayerContext = this.player;
- console.log(polyvPlayerContext);
- if (polyvPlayerContext) {
- polyvPlayerContext.changeVid(note.recordingUrl);
- } else {
- this.vid = note.recordingUrl;
- console.log(note.recordingUrl);
- this.moduleId = note.moduleId;
- this.chapterId = note.chapterId;
- this.playSectionId = note.sectionId;
- note.sectionType = 3;
- this.loadPlayerScript(this.loadPlayer);
- }
- }
- this.recordObj = { videoCurrentTime: note.noteSecond };
- },
- /**
- * 展开列表
- */
- getMenuList() {
- let self = this;
- this.$request
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
- .then((res) => {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.parent = this.menuList;
- }
- self.menuList = res.rows;
- //展开第一个
- if (this.needOpen) {
- for (let i = 0; i < res.rows.length; i++) {
- if (res.rows[i].type == 1) {
- this.menuIndex = [i];
- this.openModule(this.menuList[i]);
- break;
- } else if (res.rows[i].type == 2) {
- this.menuIndex = [i];
- // this.needOpen = false;
- this.openChapter(this.menuList[i]);
- break;
- }
- }
- //第一个是节,直接播放
- if (self.menuList.length) {
- if (
- self.menuList[0].type == 3 &&
- !this.sectionItem.recordingUrl &&
- self.menuList[0].sectionType != 2
- ) {
- // this.getResource(self.menuList[0]);
- }
- }
- }
- });
- },
- getReMenuList() {
- let self = this;
- this.$request
- .reMenuList({
- courseId: this.courseId,
- rebuild: 1,
- gradeId: this.gradeId,
- })
- .then((res) => {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.parent = this.reMenuList;
- item.isRebuild = 1;
- }
- self.reMenuList = res.rows;
- if (self.reMenuList.length > 0) {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- {
- name: "2",
- label: "重修目录",
- },
- ];
- if (this.courseTabIndex == "2") {
- return;
- }
- this.courseTabIndex = "1";
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- ];
- this.courseTabIndex = "1";
- }
- });
- },
- /**
- * 获取讲义权限
- */
- courseHandouts() {
- if (this.goodsData.handoutsId) {
- this.$request
- .courseHandouts(this.goodsData.handoutsId)
- .then((res) => {
- this.courseHandoutsData = res.data;
- const loadingTask = pdf.createLoadingTask(
- this.$tools.splitImgHost(this.courseHandoutsData.handoutsUrl)
- );
- loadingTask.promise
- .then((pdf) => {
- this.numPages = pdf.numPages;
- })
- .catch((err) => {});
- })
- .catch((err) => {});
- }
- },
- /**
- * 获取培训项目详情
- */
- courseBusiness() {
- this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
- this.businessData = res.data;
- });
- },
- /**提出答疑 */
- addAnswer() {
- if (!this.textarea) {
- this.$message.warning("请输入疑问内容");
- return;
- }
- let data = {
- courseId: this.courseId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- answerText: this.textarea,
- };
- this.$request.addAnswer(data).then((res) => {
- this.textarea = "";
- this.getAnswerList();
- });
- },
- /**回复 */
- answerBack(row) {
- this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- inputErrorMessage: "输入不能为空",
- inputValidator: (value) => {
- let str = value.replace(/^ +| +$/g, "");
- // 点击按钮时,对文本框里面的值进行验证
- if (!str) {
- return "输入不能为空";
- }
- },
- })
- .then(({ value }) => {
- let data = {
- assignUserId: row.userId,
- assignAnswerId: row.answerId,
- courseId: this.courseId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- answerText: value,
- assignAnswerText: row.assignAnswerText,
- };
- this.$request.addAnswer(data).then((res) => {
- this.getAnswerList();
- });
- })
- .catch(() => {});
- },
- getAnswerList() {
- let self = this;
- this.$request
- .answerList({ courseId: this.courseId, goodsId: this.goodsId })
- .then((res) => {
- let data1 = [];
- let data2 = [];
- let copydata2 = [];
- res.rows.forEach((item) => {
- if (!item.assignAnswerId) {
- data1.push(item);
- } else {
- data2.push(item);
- copydata2.push(item);
- }
- });
- data2.forEach((item, index) => {
- //回复层
- data1.forEach((items) => {
- //提问层
- if (items.answerId === item.assignAnswerId) {
- if (
- items.newArraysAnswerList &&
- items.newArraysAnswerList.length
- ) {
- items.newArraysAnswerList.push(item);
- } else {
- items.newArraysAnswerList = [item];
- }
- let indexInd = copydata2.findIndex((itemsxs) => {
- return itemsxs.answerId === item.answerId;
- });
- if (indexInd !== -1) {
- copydata2.splice(indexInd, 1);
- }
- }
- });
- });
- copydata2.forEach((it) => {
- for (let i = 0; i < data1.length; i++) {
- let STATUS = null;
- if (data1[i].newArraysAnswerList) {
- STATUS = data1[i].newArraysAnswerList.some((items) => {
- return items.answerId === it.assignAnswerId;
- });
- }
- if (STATUS) {
- data1[i].newArraysAnswerList.push(it);
- break;
- }
- }
- });
- self.answerList = data1.reverse();
- });
- },
- courseCourseList() {
- return new Promise((resolve) => {
- this.param.goodsId = this.goodsId;
- this.param.gradeId = this.gradeId;
- this.$request.courseCourseList(this.param).then(async (res) => {
- this.courseList.push(...res.rows);
- if (!this.courseId) {
- this.courseId = this.courseList[0].courseId;
- }
- this.param.total = res.total;
- await this.courseChange();
- resolve();
- });
- });
- },
- download(url, fileName) {
- let xhr = new XMLHttpRequest();
- xhr.open("get", url, true);
- xhr.setRequestHeader("Content-Type", `application/pdf`);
- xhr.responseType = "blob";
- let that = this;
- xhr.onload = function () {
- if (this.status == 200) {
- //接受二进制文件流
- var blob = this.response;
- that.downloadExportFile(blob, fileName);
- }
- };
- xhr.send();
- },
- downloadExportFile(blob, tagFileName) {
- let downloadElement = document.createElement("a");
- let href = "";
- if (typeof blob == "string") {
- downloadElement.target = "_blank";
- } else {
- href = window.URL.createObjectURL(blob); //创建下载的链接
- }
- downloadElement.href = href;
- downloadElement.download = tagFileName;
- //下载后文件名
- document.body.appendChild(downloadElement);
- downloadElement.click(); //点击下载
- document.body.removeChild(downloadElement); //下载完成移除元素
- if (typeof blob != "string") {
- window.URL.revokeObjectURL(href); //释放掉blob对象
- }
- },
- print() {
- document.getElementById("printIframe").contentWindow.print();
- },
- previvew(url) {
- this.showPdf = true;
- },
- noteSubmit() {
- let self = this;
- if (!(this.playSectionId > 0)) {
- this.$message({
- message: "目前无播放视频",
- type: "warning",
- });
- return;
- }
- if (!this.textareaNote) {
- this.$message({
- message: "请输入内容",
- type: "warning",
- });
- return;
- }
- if (!this.gradeId) {
- this.$message({
- message: "暂无班级数据",
- type: "warning",
- });
- return;
- }
- var polyvPlayerContext = this.player;
- let noteDate = this.$tools.getZeroTime();
- let noteSecond = polyvPlayerContext.j2s_getCurrentTime();
- console.log(noteSecond, "noteSecond");
- if (!noteSecond) {
- if (noteSecond == 0) {
- //播放结束
- noteSecond = polyvPlayerContext.j2s_getCurrentTime();
- }
- if (!noteSecond) {
- this.$message({
- message: "视频暂未开始",
- type: "warning",
- });
- return;
- }
- }
- let data = {
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- sectionId: this.playSectionId,
- courseId: this.courseId,
- noteText: this.textareaNote,
- noteDate: noteDate,
- noteSecond: noteSecond,
- moduleId: this.moduleId,
- chapterId: this.chapterId,
- };
- this.$request.postNote(data).then((res) => {
- this.$message({
- message: "发布成功",
- type: "success",
- });
- self.getNoteList();
- this.textareaNote = "";
- });
- },
- del(item) {
- console.log(item);
- let data = { answerId: item.answerId, status: -1 };
- this.$request.delAnswer(data).then((res) => {
- this.$message({
- message: "删除成功",
- type: "success",
- });
- this.getAnswerList();
- });
- },
- /**
- * 打印
- */
- printView(url) {
- console.log("触发打印", url);
- printJS({
- printable: url,
- type: "pdf",
- header: null,
- targetStyles: ["*"],
- style: "@page {margin:0 10mm}",
- });
- // this.print(url);
- },
- // 打印方法
- print(filePath) {
- console.log("执行打印");
- let iframe = document.createElement("iframe");
- iframe.style.border = "0px";
- iframe.style.position = "absolute";
- iframe.style.width = "0px";
- iframe.style.height = "0px";
- iframe.style.right = "0px";
- iframe.style.top = "0px";
- iframe.setAttribute("src", filePath);
- iframe.onload = () => {
- iframe.contentWindow.print();
- // setTimeout(() => {
- // document.body.removeChild(iframe);
- // });
- };
- document.body.append(iframe);
- },
- },
- };
- </script>
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style scoped lang="scss">
- .course-detail {
- .section {
- padding-bottom: 30px;
- &__header {
- height: 40px;
- display: flex;
- align-items: center;
- padding: 0 20px;
- }
- &__body {
- .course-info {
- &__header {
- .left-box {
- width: 810px;
- height: 455px;
- float: left;
- background-size: cover;
- background-position: center center;
- background-repeat: no-repeat;
- position: relative;
- .video {
- width: 100%;
- height: 100%;
- }
- }
- .recordStyle {
- position: absolute;
- bottom: 90px;
- padding: 6px 12px;
- left: 8px;
- background-color: rgba(0, 0, 0, 0.4);
- color: #fff;
- border-radius: 24px;
- user-select: none;
- .btn_sty {
- cursor: pointer;
- }
- }
- .right-box {
- width: 462px;
- height: 455px;
- background: #060e1a;
- border-radius: 0px;
- float: right;
- &__header {
- .tabs {
- /deep/.el-tabs__nav-wrap::after {
- background-color: #999;
- }
- /deep/ .el-tabs__header {
- margin: 0;
- }
- .label {
- color: #fff;
- height: 40px;
- line-height: 40px;
- padding: 0 20px;
- }
- .item {
- &__title {
- padding-left: 12px;
- height: 40px;
- line-height: 40px;
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #fff;
- .el-icon-caret-right,
- .el-icon-caret-bottom {
- color: #999;
- }
- }
- &__content {
- .bank-chapter {
- &__item {
- color: #fff;
- font-size: 14px;
- &__text {
- padding: 8px 8px 8px 24px;
- cursor: pointer;
- flex: 1;
- .el-icon-caret-right,
- .el-icon-caret-bottom {
- color: #999;
- }
- }
- }
- }
- .bank-section {
- &__item {
- color: #fff;
- font-size: 14px;
- display: flex;
- align-items: center;
- &.active {
- background: #132b4d;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #3f8dfd;
- }
- &__text {
- flex: 1;
- padding: 8px 8px 8px 12px;
- height: 40px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- cursor: pointer;
- .el-icon-caret-right,
- .el-icon-caret-bottom {
- color: #999;
- }
- }
- .test-btn {
- margin-left: 10px;
- width: 32px;
- height: 20px;
- background: #007aff;
- border-radius: 4px;
- line-height: 18px;
- color: #fff;
- text-align: center;
- }
- .note {
- margin-left: 10px;
- width: 32px;
- height: 20px;
- border: 1px solid #ff3b30;
- border-radius: 4px;
- line-height: 18px;
- color: #ff3b30;
- text-align: center;
- &--yellow {
- border-color: #ff9500;
- color: #ff9500;
- }
- &--blue {
- border-color: #3f8dfd;
- color: #3f8dfd;
- }
- }
- .during {
- color: #999;
- margin-right: 10px;
- }
- .btn {
- margin-right: 12px;
- width: 48px;
- height: 20px;
- border: 1px solid #ff3b30;
- background: #ff3b30;
- border-radius: 4px;
- line-height: 18px;
- color: #fff;
- text-align: center;
- &--green {
- border: 1px solid #34c759;
- background: #34c759;
- }
- }
- .live-btn {
- margin-left: 20px;
- width: 60px;
- height: 20px;
- border-radius: 4px;
- background: #eeeeee;
- line-height: 18px;
- color: #666666;
- text-align: center;
- &--yellow {
- background: #fff7eb;
- color: #ff9500;
- }
- &--blue {
- border-color: #ebf4ff;
- color: #007aff;
- }
- }
- }
- }
- }
- }
- }
- .title {
- height: 40px;
- border-bottom: 1px solid #999;
- color: #fff;
- .select {
- width: 100%;
- }
- /deep/ .el-input__icon {
- width: 20px;
- height: 20px;
- border: 1px solid #fff;
- border-radius: 4px;
- margin-top: 10px;
- line-height: 20px;
- }
- /deep/ .el-input__inner {
- color: #fff;
- font-size: 16px;
- background: none;
- border: 0;
- }
- }
- }
- &__body {
- height: 374px;
- overflow-y: scroll;
- &::-webkit-scrollbar {
- width: 6px;
- }
- &::-webkit-scrollbar-track {
- background-color: #060e1a;
- -webkit-border-radius: 2em;
- -moz-border-radius: 2em;
- border-radius: 2em;
- }
- &::-webkit-scrollbar-thumb {
- background-color: #eeeeee;
- -webkit-border-radius: 2em;
- -moz-border-radius: 2em;
- border-radius: 2em;
- }
- }
- }
- }
- &__body {
- /deep/ .el-tabs__item {
- padding: 0 20px !important;
- height: 80px;
- line-height: 80px;
- }
- .course-img {
- width: 100%;
- }
- .course-menu {
- margin-top: 25px;
- .left-box {
- width: 948px;
- float: left;
- &__header {
- padding-right: 50px;
- position: relative;
- .item {
- width: auto;
- margin-right: 24px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- background: #eeeeee;
- border-radius: 8px;
- padding: 12px;
- position: relative;
- &.canlearn {
- background: #3f8dfd;
- color: #fff;
- }
- }
- }
- &__body {
- .buy-note {
- margin-right: 50px;
- }
- .item {
- margin-top: 24px;
- padding: 16px;
- background: #eee;
- border-radius: 10px;
- &__title {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- .note {
- display: inline-block;
- margin-left: 20px;
- width: 40px;
- height: 24px;
- border: 1px solid #ff3b30;
- border-radius: 8px;
- line-height: 22px;
- color: #ff3b30;
- text-align: center;
- }
- }
- &__content {
- margin-top: 12px;
- background: #f5f7fa;
- }
- }
- }
- }
- .right-box {
- width: 255px;
- float: right;
- .title {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
- position: relative;
- .more {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- position: absolute;
- right: 0;
- }
- }
- .list {
- .course-item {
- }
- }
- }
- }
- .answer-question {
- &__header {
- border-bottom: 1px solid #eee;
- .textarea-wrap {
- background: #f9f9f9;
- border: 1px solid #eeeeee;
- border-radius: 8px;
- .textarea {
- height: 100%;
- }
- }
- .submit {
- padding: 10px 20px;
- border-radius: 20px;
- text-align: center;
- font-size: 16px;
- margin: 10px 0;
- float: right;
- }
- }
- &__body {
- .question-list {
- &__item {
- padding: 20px 0;
- display: flex;
- &__avatar {
- width: 40px;
- height: 40px;
- display: table-cell;
- border-radius: 50%;
- text-align: center;
- img {
- display: inline-block;
- vertical-align: middle;
- max-width: 100%;
- max-height: 100%;
- }
- }
- &__content {
- flex: 1;
- border-bottom: 1px solid #ccc;
- margin-left: 10px;
- .nickname {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- .replay {
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #3f8dfd;
- line-height: 24px;
- margin-right: 20px;
- }
- .del {
- float: right;
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ff3b30;
- line-height: 24px;
- margin-right: 20px;
- }
- }
- .reply-list {
- margin: 20px 0;
- width: 100%;
- background: #f9f9f9;
- border-radius: 8px;
- padding: 0 0 0 20px;
- &__item {
- padding: 20px 0;
- display: flex;
- border-bottom: 1px solid #ccc;
- &:nth-last-of-type(1) {
- border: 0;
- }
- &__avatar {
- width: 40px;
- height: 40px;
- display: table-cell;
- border-radius: 50%;
- text-align: center;
- img {
- display: inline-block;
- vertical-align: middle;
- max-width: 100%;
- max-height: 100%;
- }
- }
- &__content {
- border-radius: 8px;
- flex: 1;
- margin-left: 10px;
- .nickname {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- .reply {
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #3f8dfd;
- line-height: 24px;
- margin-right: 20px;
- cursor: pointer;
- user-select: none;
- }
- .del {
- cursor: pointer;
- margin-right: 20px;
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ff3b30;
- line-height: 24px;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .lecture-notes {
- &__content {
- .left-box {
- float: left;
- width: 462px;
- .textarea {
- border-bottom: 1px solid #eee;
- .submit {
- float: right;
- width: 138px;
- padding: 10px 0;
- margin: 10px 0 25px 0;
- border-radius: 20px;
- text-align: center;
- font-size: 16px;
- }
- }
- .note-list {
- &__content {
- border-bottom: 1px solid #eee;
- &__title {
- width: 216px;
- height: 24px;
- background: #ccc;
- border-radius: 24px;
- font-size: 14px;
- color: #666666;
- text-align: center;
- line-height: 24px;
- margin: 20px 0;
- }
- }
- &__item {
- display: flex;
- padding: 15px;
- .el-icon-video-play {
- cursor: pointer;
- font-size: 20px;
- color: #3f8dfd;
- }
- &__content {
- flex: 1;
- margin-left: 10px;
- .title {
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #3f8dfd;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- }
- }
- }
- }
- .pagination {
- margin-top: 30px;
- text-align: center;
- }
- }
- .right-box {
- width: 786px;
- float: right;
- .lecture-list {
- background: #f5f7fa;
- border-radius: 8px;
- &__header {
- padding: 0 16px;
- height: 40px;
- line-height: 40px;
- font-size: 18px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- .slide-btn {
- cursor: pointer;
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- }
- }
- &__body {
- .list {
- &__item {
- border-top: 1px solid #fff;
- padding: 0 8px 0 16px;
- height: 56px;
- line-height: 55px;
- display: flex;
- align-items: center;
- .title {
- flex: 1;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- }
- .btns {
- .btn {
- cursor: pointer;
- display: inline-block;
- vertical-align: middle;
- width: 80px;
- height: 32px;
- background: #ffffff;
- border: 1px solid #3f8dfd;
- border-radius: 16px;
- text-align: center;
- line-height: 30px;
- color: #3f8dfd;
- margin: 0 8px;
- }
- }
- }
- }
- }
- &__footer {
- margin-top: 24px;
- .lecture-scan {
- background: #f5f7fa;
- border-radius: 8px;
- overflow: hidden;
- &__header {
- height: 40px;
- line-height: 40px;
- padding: 0 16px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- }
- &__body {
- height: 800px;
- text-align: center;
- overflow-y: scroll;
- .iframe {
- width: 100%;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .take-photo {
- /deep/ .el-dialog__header {
- display: none;
- }
- /deep/ .el-dialog__body {
- padding: 0;
- overflow: unset;
- }
- &__close {
- cursor: pointer;
- position: absolute;
- right: 0;
- top: -28px;
- width: 24px;
- height: 24px;
- line-height: 24px;
- text-align: center;
- color: #eee;
- border: 1px solid #eee;
- border-radius: 50%;
- }
- &__header {
- height: 40px;
- border-bottom: 1px solid #eee;
- line-height: 40px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- padding-left: 24px;
- }
- &__body {
- height: 400px;
- padding: 40px 24px;
- .left-box {
- width: 336px;
- float: left;
- .title {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #ff3b30;
- line-height: 24px;
- }
- .content {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- line-height: 28px;
- margin-top: 32px;
- }
- }
- .right-box {
- float: right;
- width: 400px;
- height: 300px;
- video {
- width: 100%;
- height: 100%;
- }
- .mask {
- width: 55%;
- height: 200px;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: 30px auto 0;
- box-shadow: 0 0 0 2000px rgba(0,0,0,0.4);
- }
- }
- }
- &__footer {
- height: 90px;
- border-top: 1px solid #eee;
- text-align: center;
- .take {
- display: inline-block;
- width: 200px;
- height: 40px;
- padding: 0;
- border-radius: 20px;
- text-align: center;
- line-height: 40px;
- margin: 24px auto;
- }
- }
- }
- .info {
- &__content {
- height: 500px;
- overflow-y: scroll;
- .handCenter {
- width: 600px;
- height: 300px;
- background: #ccc;
- }
- .upload-box {
- display: inline-block;
- vertical-align: top;
- .el-icon-error {
- cursor: pointer;
- z-index: 99;
- position: absolute;
- left: 100%;
- bottom: 100%;
- font-size: 20px;
- color: red;
- }
- }
- }
- }
- .showconfirm {
- &__content {
- .text {
- padding-bottom: 20px;
- color: red;
- }
- }
- }
- }
- </style>
|