videovip.vue 181 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347
  1. <template>
  2. <view class="content ">
  3. <!-- <view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}"> -->
  4. <!-- <u-icon name="arrow-left" size="28" @click="tosales" v-if="appToken"></u-icon> -->
  5. <!-- <view class="header-title" :style="{width:menuButtonLeft + 'px',height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">{{courseInfo.title}}</view>
  6. </view> -->
  7. <view class="notice-box" v-if="isLogin&&isAddKf==1">
  8. <view class="notice-marquee-wrap">
  9. <view class="notice-marquee-track">
  10. <view class="notice-text"><image src="/static/images/notice.png"></image>{{notice || '央广网独家溯源&nbsp;&nbsp;全品类100%经过国标检测'}}</view>
  11. <view class="notice-text"><image src="/static/images/notice.png"></image>{{notice || '央广网独家溯源&nbsp;&nbsp;全品类100%经过国标检测'}}</view>
  12. <!-- <view class="notice-text"><image src="/static/images/notice.png"></image>央广网独家溯源&nbsp;&nbsp;全品类100%经过国标检测</view> -->
  13. </view>
  14. </view>
  15. </view>
  16. <view class="video-box" :style="{'height':isShu?'calc(100vh - 264rpx)':'420rpx'}" >
  17. <image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
  18. </image>
  19. <video @timeupdate="onTimeUpdate" @progress="progressChange" @error="videoErrorCallback" @play="getPlay"
  20. @pause="getPause" @ended="getEnded" @fullscreenchange="fullscreenchange" :title="courseInfo.title"
  21. style="width: 100%;" :style="{'height':isShu?'100%':'420rpx'}" :poster="poster" id="video-content-box" controls
  22. :auto-pause-if-open-native="false" :auto-pause-if-navigate="true" :enable-progress-gesture="false"
  23. :show-progress="true" :picture-in-picture-mode="[]" :show-background-playback-button="false"
  24. :src="videoUrl">
  25. <cover-view v-if="remainTime > 0" class="progress-countdown">
  26. <!-- <cover-view class="progress-title">完课积分</cover-view> -->
  27. <cover-image class="progress-img" src="/static/images/wk.png"></cover-image>
  28. <!-- <cover-view class="progress-bar-bg">
  29. <cover-view class="progress-bar-fill" :style="{ width: countdownPercentage + '%' }"></cover-view>
  30. </cover-view> -->
  31. <cover-view class="progress-text">
  32. <cover-view class="progress-text-label">倒计时</cover-view>
  33. <cover-view style="font-size: 13px;">{{ formattedCountdown.hours||'00' }}:{{ formattedCountdown.minutes||'00' }}:{{ formattedCountdown.seconds||"00" }}</cover-view>
  34. </cover-view>
  35. </cover-view>
  36. <!-- 虚拟下单跑马灯:视频顶层覆盖,向上滚动淡出切换 -->
  37. <cover-view class="vip-order-cover-wrap vip-order-cover-wrap--triple" v-if="showFakeMarqueeOnVideoCover && isTripleMarqueeMode && marqueeTriplePayloads.length">
  38. <cover-view class="vip-order-cover-triple-panel vip-order-cover-triple-current" :class="[marqueeTripleSwitching ? 'vip-order-triple-leave' : '']">
  39. <cover-view
  40. class="vip-order-cover-item vip-order-cover-triple-item"
  41. v-for="(row, idx) in marqueeTriplePayloads"
  42. :key="'triple-current-' + idx + '-' + row.nickname + row.timeOffset"
  43. :class="[row.type === 'self' ? 'vip-order-cover-self' : '']"
  44. >
  45. <cover-view class="vip-order-cover-content" v-if="row.type === 'virtual' || row.type === 'self'">
  46. <cover-view class="vip-order-seg vip-order-seg-user">{{ row.nickname }}{{ row.maskedId }}</cover-view>
  47. <cover-view class="vip-order-seg vip-order-seg-time">{{ row.timeOffset }}{{ row.suffix }}</cover-view>
  48. <!-- <cover-view class="vip-order-seg vip-order-seg-suffix"></cover-view> -->
  49. </cover-view>
  50. <cover-view class="vip-order-cover-content" v-else>
  51. {{ row.fullText }}
  52. </cover-view>
  53. </cover-view>
  54. </cover-view>
  55. <cover-view v-if="marqueeTripleSwitching && marqueeTripleIncomingPayloads.length" class="vip-order-cover-triple-panel vip-order-cover-triple-incoming vip-order-triple-enter">
  56. <cover-view
  57. class="vip-order-cover-item vip-order-cover-triple-item"
  58. v-for="(row, idx) in marqueeTripleIncomingPayloads"
  59. :key="'triple-incoming-' + idx + '-' + row.nickname + row.timeOffset"
  60. :class="[row.type === 'self' ? 'vip-order-cover-self' : '']"
  61. >
  62. <cover-view class="vip-order-cover-content" v-if="row.type === 'virtual' || row.type === 'self'">
  63. <cover-view class="vip-order-seg vip-order-seg-user">{{ row.nickname }}{{ row.maskedId }}</cover-view>
  64. <cover-view class="vip-order-seg vip-order-seg-time">{{ row.timeOffset }}{{ row.suffix }}</cover-view>
  65. <!-- <cover-view class="vip-order-seg vip-order-seg-suffix"></cover-view> -->
  66. </cover-view>
  67. <cover-view class="vip-order-cover-content" v-else>
  68. {{ row.fullText }}
  69. </cover-view>
  70. </cover-view>
  71. </cover-view>
  72. </cover-view>
  73. <cover-view class="vip-order-cover-wrap" v-else-if="showFakeMarqueeOnVideoCover && marqueeDisplayPayload">
  74. <cover-view
  75. class="vip-order-cover-item vip-order-cover-current"
  76. :class="[
  77. marqueeSwitching ? 'vip-order-leave' : '',
  78. marqueeDisplaySelf ? 'vip-order-cover-self' : ''
  79. ]"
  80. >
  81. <cover-view class="vip-order-cover-content" v-if="marqueeDisplayPayload.type === 'virtual' || marqueeDisplayPayload.type === 'self'">
  82. <cover-view class="vip-order-seg vip-order-seg-user">{{ marqueeDisplayPayload.nickname }}{{ marqueeDisplayPayload.maskedId }}</cover-view>
  83. <cover-view class="vip-order-seg vip-order-seg-time">{{ marqueeDisplayPayload.timeOffset }}{{ marqueeDisplayPayload.suffix }}</cover-view>
  84. <!-- <cover-view class="vip-order-seg vip-order-seg-suffix"></cover-view> -->
  85. </cover-view>
  86. <cover-view class="vip-order-cover-content" v-else>
  87. {{ marqueeDisplayPayload.fullText }}
  88. </cover-view>
  89. </cover-view>
  90. <cover-view
  91. v-if="marqueeSwitching && marqueeIncomingPayload"
  92. class="vip-order-cover-item vip-order-cover-incoming"
  93. :class="[
  94. 'vip-order-enter',
  95. marqueeIncomingSelf ? 'vip-order-cover-self' : ''
  96. ]"
  97. >
  98. <cover-view class="vip-order-cover-content" v-if="marqueeIncomingPayload.type === 'virtual' || marqueeIncomingPayload.type === 'self'">
  99. <cover-view class="vip-order-seg vip-order-seg-user">{{ marqueeIncomingPayload.nickname }}{{ marqueeIncomingPayload.maskedId }}</cover-view>
  100. <cover-view class="vip-order-seg vip-order-seg-time">{{ marqueeIncomingPayload.timeOffset }}{{ marqueeIncomingPayload.suffix }}</cover-view>
  101. <!-- <cover-view class="vip-order-seg vip-order-seg-suffix"></cover-view> -->
  102. </cover-view>
  103. <cover-view class="vip-order-cover-content" v-else>
  104. {{ marqueeIncomingPayload.fullText }}
  105. </cover-view>
  106. </cover-view>
  107. </cover-view>
  108. <cover-view
  109. class="goods-cover"
  110. :style="{ display:isFull&&cardPopup && currentCardItem ? 'block' : 'none'}"
  111. @click.stop="goBuy(currentCardItem)"
  112. >
  113. <cover-view class="goods-cover-hot" v-if="hasHotSaleTag(currentCardItem) && getProductHotCount(currentCardItem) > 0">
  114. <cover-image style="height: 30px;" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/remai.png" mode="heightFix"></cover-image>
  115. <cover-view class="goods-cover-hot-text">{{ getProductHotCount(currentCardItem) }}</cover-view>
  116. </cover-view>
  117. <cover-view class="goods-cover-inner">
  118. <!-- 关闭按钮 -->
  119. <cover-view class="close-box" @click.stop="closeCardPopup">
  120. <cover-image src="/static/images/close.png"></cover-image>
  121. </cover-view>
  122. <!-- 商品主图 -->
  123. <cover-view class="goods-cover-img">
  124. <cover-image
  125. style="width:150px;height:150px;object-fit:cover;"
  126. :src="currentCardItem.images"
  127. mode="aspectFit"
  128. ></cover-image>
  129. </cover-view>
  130. <cover-view class="goods-cover-info">
  131. <cover-view class="goods-cover-title">{{ currentCardItem.productName || '-' }}</cover-view>
  132. <cover-view class="goods-cover-bottom">
  133. <cover-view class="goods-cover-tag">
  134. <cover-image class="goods-cover-tag-bg" src="/static/images/pbg.png" mode="widthFix"></cover-image>
  135. <cover-view class="goods-cover-tag-text">惊喜价</cover-view>
  136. </cover-view>
  137. <cover-view class="goods-cover-price">
  138. <cover-view class="unit">¥</cover-view>
  139. <cover-view class="price">
  140. {{ currentCardItem.price || '0.00' }}
  141. </cover-view>
  142. </cover-view>
  143. </cover-view>
  144. </cover-view>
  145. </cover-view>
  146. </cover-view>
  147. </video>
  148. </view>
  149. <!-- 商品卡片弹窗 -->
  150. <view class="goods-card" :style="{'bottom':isShu?'280rpx':'220rpx'}" v-if="!isFull&&cardPopup && currentCardItem" @click.stop="goBuy(currentCardItem)">
  151. <view class="close-box" @click.stop="closeCardPopup">
  152. <image src="/static/images/close.png"></image>
  153. </view>
  154. <view class="goods-card-hot" v-if="hasHotSaleTag(currentCardItem) && getProductHotCount(currentCardItem) > 0">
  155. <image style="height: 56rpx;" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/remai.png" mode="heightFix"></image>
  156. <text class="goods-card-hot-count">{{ getProductHotCount(currentCardItem) }}</text>
  157. </view>
  158. <view class="goods-card-inner">
  159. <image class="goods-card-img" :src="currentCardItem.images" mode="aspectFill"></image>
  160. <view class="goods-card-info">
  161. <view class="goods-card-title">{{ currentCardItem.productName || '-' }}</view>
  162. <view class="goods-card-bottom">
  163. <view class="goods-card-tag">
  164. <image class="goods-card-tag-bg" src="/static/images/pbg.png" mode="widthFix"></image>
  165. <view class="goods-card-tag-text">惊喜价</view>
  166. </view>
  167. <view class="goods-card-price">
  168. <view class="unit">¥</view>
  169. <text class="price">
  170. {{ currentCardItem.price || '0.00' }}
  171. </text>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. <!-- <view v-if="remainTime > 0" class="progress-countdown end">
  178. <view class="progress-title">完课积分</view>
  179. <view class="progress-bar-bg">
  180. <view class="progress-bar-fill" :style="{ width: countdownPercentage + '%' }"></view>
  181. </view>
  182. <view class="progress-text">
  183. <text style="font-size: 24rpx;line-height: 40rpx;">倒计时</text>{{ formattedCountdown.hours||'00' }}:{{ formattedCountdown.minutes||'00' }}:{{ formattedCountdown.seconds||"00" }}
  184. </view>
  185. </view> -->
  186. <!-- <view class="justify-start align-center fs24 base-color-9" v-if="userInfo.userId">
  187. <view>{{nameuser?nameuser:'暂未授权昵称'}}#</view>
  188. <view>{{userInfo.userId}}</view>
  189. </view> -->
  190. <!-- <view class="title-content" id="title-content"> -->
  191. <!-- 答题时展示小节课程名,其他展示课程名 -->
  192. <!-- 小节课程名 -->
  193. <!-- <view class="subtitlebox " v-if="isLogin&&isAddKf==1">
  194. {{courseInfo.title}}
  195. </view> -->
  196. <!-- 课程名字 -->
  197. <!-- <view class="miantitlebox" v-else>
  198. {{courseInfo.courseName}}
  199. </view> -->
  200. <!-- </view> -->
  201. <!-- <scroll-view style="display:none;" v-show="!isShu" class="scroll-view" :style="{height: height}" :scroll-top="scrollTop" scroll-y="true"> -->
  202. <!-- 无效或者已过期 -->
  203. <!-- <view class="nocourse" v-if="msg">
  204. <image :src="imgPath+'/app/image/course_expiration_img.png'" mode="widthFix"></image>
  205. <view>{{msg}}</view>
  206. </view> -->
  207. <!-- 问题 -->
  208. <!-- <view class="ques-content" v-if="isLogin&&isAddKf==1&&!isquestion">
  209. <view v-if="isLogin">
  210. <view class="ques-content-tit" v-if="!isquestion"
  211. @click="tabChange(0)">问答题</view> -->
  212. <!-- <view class="ques-content-tit" v-if="showTreatment==0"
  213. :style="{ color: currentId==1? '#FF5C03':'#222'}" @click="tabChange(1)">商品</view> -->
  214. <!-- </view> -->
  215. <!-- <view v-for="(item,index) in quesList" :key="index">
  216. <view class="ques-title">
  217. <text>{{index + 1}}.</text> -->
  218. <!-- <view class="ques-type" v-show="item.type == 1 || item.type == 2">
  219. {{item.type == 1 ? '单选' : item.type == 2 ? '多选' : ''}}
  220. </view> -->
  221. <!-- <text class="fs40">{{item.title}}</text>
  222. </view>
  223. <view :class="isAnswer(item,option.name) ?'ques-option ques-option-active':'ques-option'"
  224. v-for="(option,idx) in item.questionOption" :key="idx" @click="handleAnswer(item,option)">
  225. <view class="fs40">
  226. {{numberToLetter(idx)}}.
  227. </view>
  228. <view class="fs40">{{option.name}}</view>
  229. </view>
  230. </view>
  231. </view>
  232. </scroll-view> -->
  233. <!-- 评价 -->
  234. <view class="rating-box" :style="{paddingTop:visibleRatingTabCount == 1?'30rpx':'24rpx'}" v-if="isLogin&&isAddKf==1&&!isShu&&hasVisibleRatingTab">
  235. <image class="bg" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/bg-back.png" mode="widthFix"></image>
  236. <view class="tab-Box" v-if="visibleRatingTabCount > 1">
  237. <view
  238. v-for="tab in ratingTabList"
  239. :key="tab.key"
  240. class="tab-item"
  241. :class="{ 'tab-item--active': tabIndex == tab.index }"
  242. @click="selecTab(tab.index)"
  243. >
  244. <view class="tab-item__surface">
  245. <image :src="tabIndex == tab.index ? tab.iconActive : tab.icon" mode="aspectFit"></image>
  246. <text class="tab-item__text">{{ tab.label }}</text>
  247. </view>
  248. </view>
  249. </view>
  250. <!-- 仅一个 Tab:单行左对齐标题,无选中态(顺序:精选留言 / 亮点介绍 / 评价得积分) -->
  251. <view class="tab-Box tab-Box--single" v-else-if="visibleRatingTabCount === 1">
  252. <view v-for="tab in ratingTabList" :key="tab.key" class="tab-item tab-item--single">
  253. <view class="tab-item__surface tab-item__surface--single">
  254. <image :src="tab.iconActive" mode="aspectFit"></image>
  255. <text class="tab-item__text tab-item__text--single">{{ tab.label }}</text>
  256. </view>
  257. </view>
  258. </view>
  259. <view class="rating-body" v-if="tabIndex == 2 && showTabReviewPoints">
  260. <view class="rating-ques-block" v-for="(item,index) in quesList" :key="index">
  261. <view class="title">{{item.title}}</view>
  262. <view class="sat-box">
  263. <view class="sat" v-for="(option,idx) in item.questionOption" :key="idx" :class="aindex==option.indexId?'sat--active':''" @click="handleAnswer(item,option)">
  264. <view class="sat-img-wrap" :class="rateBounceIndex==option.indexId?'sat-img-bounce':''">
  265. <image :src="aindex==option.indexId?rateList[option.indexId].selIcon:rateList[option.indexId].icon" mode="aspectFit"></image>
  266. </view>
  267. <text :class="aindex==option.indexId?'active':''">{{option.name}}</text>
  268. </view>
  269. </view>
  270. </view>
  271. </view>
  272. <view class="rating-body rating-body--plain" :style="{padding:courseInfo.courseIntroImg?'0rpx':'30rpx'}" v-if="tabIndex === 1 && showTabColumnIntro">
  273. <!-- <view class="title">{{ (courseInfo && courseInfo.title) || '亮点介绍' }}</view> -->
  274. <image
  275. class="rating-intro-cover-img"
  276. :src="courseInfo.courseIntroImg"
  277. mode="widthFix"
  278. ></image>
  279. </view>
  280. <view class="rating-body rating-body--featured" v-if="tabIndex == 0 && showTabFeaturedComments">
  281. <scroll-view
  282. scroll-y
  283. class="rating-msg-scroll"
  284. :show-scrollbar="false"
  285. lower-threshold="100"
  286. @scrolltolower="onFeaturedCommentScrollToLower"
  287. >
  288. <view v-if="featuredCommentLoading" class="rating-msg-empty">加载中...</view>
  289. <template v-else>
  290. <view
  291. class="rating-msg-item"
  292. v-for="(it, idx) in featuredCommentDisplayList"
  293. :key="it.commentId"
  294. >
  295. <view class="rating-msg-avatar-wrap">
  296. <image
  297. class="rating-msg-avatar"
  298. src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/head.png"
  299. mode="aspectFill"
  300. />
  301. </view>
  302. <view class="rating-msg-main">
  303. <text class="rating-msg-name">{{ getCommentDisplayName(it) }}</text>
  304. <view class="rating-msg-text">{{ getCommentTextOnly(it) }}</view>
  305. <view v-if="getCommentVideoUrl(it)" class="rating-msg-media rating-msg-media--video">
  306. <view class="rating-msg-video-wrap">
  307. <video
  308. :id="getFeaturedCommentVideoId(it, idx)"
  309. class="rating-msg-video"
  310. :src="getCommentVideoUrl(it)"
  311. :poster="getCommentVideoPoster(it)"
  312. :controls="false"
  313. object-fit="fill"
  314. :show-play-btn="false"
  315. :show-center-play-btn="false"
  316. :enable-progress-gesture="false"
  317. ></video>
  318. <view
  319. class="rating-msg-video-play-cover"
  320. @tap.stop="openFeaturedCommentMediaPreview(it, idx, 'video')"
  321. >
  322. <image
  323. class="rating-msg-video-play-icon"
  324. src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/bofang.png"
  325. mode="aspectFit"
  326. />
  327. </view>
  328. </view>
  329. </view>
  330. <view
  331. v-else-if="commentImageUrls(it).length"
  332. class="rating-msg-media rating-msg-media--imgs"
  333. >
  334. <image
  335. v-for="(img, mi) in commentImageUrls(it)"
  336. :key="mi"
  337. :src="img"
  338. mode="widthFix"
  339. class="rating-msg-img"
  340. @click="openFeaturedCommentMediaPreview(it, idx, 'image', mi)"
  341. />
  342. </view>
  343. </view>
  344. </view>
  345. <view v-if="!featuredCommentDisplayList.length" class="rating-msg-empty">暂无精选留言</view>
  346. <view v-if="featuredCommentLoadingMore" class="rating-msg-load-more">加载中...</view>
  347. <view
  348. v-else-if="showFeaturedCommentNoMoreFooter"
  349. class="rating-msg-load-more rating-msg-load-more--done"
  350. >没有更多了</view>
  351. <!-- 底部锚点:发布成功后 scroll-into-view 定位到最新消息一侧,避免留在顶部 -->
  352. <view id="fc-scroll-anchor" class="rating-msg-scroll-anchor"></view>
  353. </template>
  354. </scroll-view>
  355. </view>
  356. </view>
  357. <!-- 线路 -->
  358. <!-- <view class="video-line" @click="openPop" v-if="isLogin&&isAddKf==1">
  359. <image :src="imgPath+'/app/image/changePlayer-icon.png'"></image>
  360. <text>线路{{lineIndex + 1 | numberToChinese}}</text>
  361. </view> -->
  362. <!-- 线路弹窗 -->
  363. <!-- <uni-popup ref="popup" type="bottom" class="full-width-popup">
  364. <view class="popupbox">
  365. <view class="popupbox-head">
  366. <text>线路选择</text>
  367. <image class="close-icon" :src="imgPath+'/app/image/tc_close_icon.png'" mode="aspectFill" @click="close">
  368. </image>
  369. </view>
  370. <view class="popupbox-content">
  371. <view :class="lineIndex == index ? 'line-item line-active': 'line-item'"
  372. v-for="(it,index) in lineList" :key="index" @click="handleLine(index)">
  373. 线路{{index + 1 | numberToChinese}}</view>
  374. </view>
  375. </view>
  376. </uni-popup> -->
  377. <!-- 温馨提示弹窗 -->
  378. <u-popup :show="tipsPopup" mode="center" :closeOnClickOverlay='true' @close='tipsPopup=!tipsPopup'
  379. :safeAreaInsetBottom='false' round='12'>
  380. <view class="tipsPopup-mask">
  381. <image class="red_envelope_top" :src="imgPath+'/app/image/red_envelope_img.png'" mode="aspectFill">
  382. </image>
  383. <view class="tipsPopup">
  384. <image class="tipsPopup-close" :src="imgPath+'/app/image/course_close_white_icon.png'"
  385. mode="aspectFill" @click="closeTipsPop"></image>
  386. <view class="tipsPopup-line">
  387. <view class="tipsPopup-box">
  388. <view class="tipsPopup-head">
  389. <image class="tipsPopup-head-title" :src="imgPath+'/app/image/tips_title_img.png'"
  390. mode="widthFix"></image>
  391. </view>
  392. <view class="tipsPopup-content">
  393. <view class="tipsPopup-content-title">亲爱的用户,</view>
  394. <view>您已经观看课程{{timepath}}的时间了,请注意休息并保持专注。</view>
  395. </view>
  396. <view class="tipsPopup-btn-box">
  397. <view class="tipsPopup-btn" @click="closeTipsPop">继续观看领奖励</view>
  398. </view>
  399. </view>
  400. </view>
  401. </view>
  402. </view>
  403. </u-popup>
  404. <!-- 答题弹窗 -->
  405. <u-popup :show="answerPopup" mode="center" @close="closepop()" @open="open" closeOnClickOverlay
  406. :safeAreaInsetBottom='false' round='12'>
  407. <view :class="errTitle == '恭喜你,回答正确' ? 'answerPopup-box bg':'answerPopup-box'">
  408. <!-- 正确 -->
  409. <image class="tipimg" v-if="errTitle == '恭喜你,回答正确'" :src="imgPath+'/app/image/course_answer_img.png'"
  410. mode="aspectFill"></image>
  411. <!-- 错误 -->
  412. <image class="tipimg" v-else :src="imgPath+'/app/image/course_answer_incorrectly_img.png'"
  413. mode="aspectFill">
  414. </image>
  415. <view class="answerPopup-title">{{errTitle}}</view>
  416. <view class="answerPopup-desc" v-html="errDesc"></view>
  417. <!-- 选择奖励 -->
  418. <!-- 错误题目 -->
  419. <view class="errQuesbox" v-if="errQues&&errQues.length>0">
  420. <view class="errQuesbox-item textOne" v-for="(it,index) in errQues" :key="index">{{it.title}}</view>
  421. </view>
  422. <view class="answerPopup-btn" v-if="errTitle == '恭喜你,回答正确'" @click="closeAnswerPopup">点击领取红包</view>
  423. <view class="tipsPopup-btn-box" v-else
  424. :style="{marginTop: errQues&&errQues.length>0 ? '40rpx':'54rpx'}">
  425. <view class="tipsPopup-btn" @click="closeAnswerPopup">{{remain > 0 ? '重新答题': '确认'}}</view>
  426. </view>
  427. </view>
  428. </u-popup>
  429. <!-- 客服二维码弹窗 -->
  430. <u-popup :show="kfPopup" mode="center" :mask-click="false" round='12' @close="kefpop">
  431. <view class="kfqrcode-box">
  432. <view class="justify-start align-center fs24 base-color-9">
  433. <view>{{nameuser}}#</view>
  434. <view>{{userInfo.userId}}</view>
  435. </view>
  436. <view>请添加客服</view>
  437. <image class="kfqrcode" :src="qrcode" show-menu-by-longpress="true" mode="aspectFit"></image>
  438. <!-- <view v-show="qrcodeMsg" style="margin-top: 30rpx;" v-html="qrcodeMsg"></view> -->
  439. <!-- <image class="kfqrcode-close" :src="imgPath+'/app/image/course_close_white_icon.png'" mode="aspectFill"
  440. @click="closeKFPop"></image> -->
  441. </view>
  442. </u-popup>
  443. <u-popup :show="timepop" mode="center" round='12'>
  444. <view class="timepopbox center column">
  445. <view class="fs40 bold ">不在看课时间范围内</view>
  446. <view class="mtb20">看课时间</view>
  447. <view>{{videocont.startDateTime}}</view>
  448. <view>至</view>
  449. <view>{{videocont.endDateTime}}</view>
  450. <view class="base-bg-orange colorf p20 radius50 mt20" @click="getH5CourseVideoDetails">刷新时间</view>
  451. </view>
  452. </u-popup>
  453. <u-popup :show="userlogo" mode="bottom" round='12'>
  454. <view class="userlogo column">
  455. <view class="mtb30 justify-start align-center ml20">
  456. <u-avatar :src="imgPath+'/app/image/logo.jpg'" size="50"></u-avatar>
  457. <view class="bold mlr20">{{imgname}}</view>
  458. <view>申请</view>
  459. </view>
  460. <view class="bold fs36 ml20">授权你的昵称头像信息</view>
  461. <view class="mtb20 justify-between align-center plr20">
  462. <view class="justify-start align-center">
  463. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  464. <view v-if="userinfos.nickname">√</view>
  465. </view>
  466. <view class="ml20">
  467. <view class="base-color-3 bold">第一步</view>
  468. <view class="fs32 base-color-9">请点击授权微信昵称</view>
  469. </view>
  470. </view>
  471. <view class="button-container">
  472. <input type="nickname" class="hidden-input" @blur="onNickNameInput" @input="onNickNameInput" />
  473. <button class="custom-button"
  474. :class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button>
  475. </view>
  476. </view>
  477. <view class="mtb20 justify-between align-center plr20 mt40">
  478. <view class="justify-start align-center">
  479. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  480. <view v-if="userinfos.avatar">√</view>
  481. </view>
  482. <view class="ml20">
  483. <view class="base-color-3 bold">第二步</view>
  484. <view class="fs32 base-color-9">请点击授权微信头像</view>
  485. </view>
  486. </view>
  487. <view class="button-container">
  488. <button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="hidden-input"
  489. v-if="nameuser">
  490. 允许授权
  491. </button>
  492. <button class="custom-button sub" @click="shouquan" v-if="nameuser==''">允许授权</button>
  493. <button class="custom-button " :class="avataruser==''?'subname':'subavt'"
  494. v-else>{{avataruser?"已授权":'允许授权'}}</button>
  495. </view>
  496. </view>
  497. <view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
  498. </view>
  499. </u-popup>
  500. <u-popup :show="isCart" @close="closeShop" round="20rpx" bgColor="#fff">
  501. <scroll-view class="scroll-view" style="height:500rpx;box-sizing: border-box;padding: 24rpx;" scroll-y="true" enable-flex>
  502. <goodsList ref="goodsList" :treatmentPackage="displayProductList" :hotCountMap="productHotCountMap" :urlOption="urlOption"></goodsList>
  503. </scroll-view>
  504. </u-popup>
  505. <u-popup :show="isMore" @close="closeMore" round="20rpx" bgColor="#fff">
  506. <view class="more-actions-popup">
  507. <view class="more-action-item"
  508. @click="navgetTo('/pages_user/user/storeOrder?status=')">
  509. <u-icon name="shopping-cart" color="#FF233C" size="40"></u-icon>
  510. <view class="action-label">我的订单</view>
  511. </view>
  512. <view class="more-action-item"
  513. @click="navgetTo('/pages_user/user/integralLogsList')">
  514. <u-icon name="calendar" color="#FF233C" size="40"></u-icon>
  515. <view class="action-label">积分记录</view>
  516. </view>
  517. <view class="more-action-item" @click="navgetTo('/pages_user/user/integralGoodsList')">
  518. <u-icon name="gift" color="#FF233C" size="40"></u-icon>
  519. <view class="action-label">兑换好礼</view>
  520. </view>
  521. </view>
  522. </u-popup>
  523. <u-popup
  524. :show="featuredMediaActionSheetShow"
  525. mode="bottom"
  526. round="20rpx"
  527. bgColor="#fff"
  528. :duration="300"
  529. @close="closeFeaturedMediaActionSheet"
  530. >
  531. <view class="fc-media-actions-sheet">
  532. <view class="fc-media-actions-sheet-item" @tap.stop="onFeaturedMediaSheetPick(0)">相册图片</view>
  533. <view class="fc-media-actions-sheet-item" @tap.stop="onFeaturedMediaSheetPick(1)">相册视频</view>
  534. <!-- <view class="fc-media-actions-sheet-gap"></view> -->
  535. <view
  536. class="fc-media-actions-sheet-item fc-media-actions-sheet-cancel"
  537. @tap.stop="closeFeaturedMediaActionSheet"
  538. >取消</view>
  539. </view>
  540. </u-popup>
  541. <!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
  542. <!-- footer -->
  543. <view class="footer" v-if="videoId">
  544. <view class="btns" :style="{'justify-content':isLogin&&isAddKf==1&&remainTime==0&&hasVisibleRatingTab&&!showTabColumnIntro?'space-between':'flex-end'}">
  545. <!-- <button
  546. class="author-btn"
  547. open-type="getPhoneNumber"
  548. @getphonenumber="phoneLogin" v-if="!isquestion&&authType==1">{{isLogin&&isAddKf==1 ? '提交答案领取奖励' : '立即观看'}}</button> -->
  549. <!-- <button
  550. class="author-btn"
  551. open-type="getUserInfo" :disabled="userdisabled"
  552. @getuserinfo="userInfologin" v-if="authType==0&&!isquestion">{{isLogin&&isAddKf==1 ? '提交答案领取奖励' : '立即观看'}}</button> -->
  553. <template>
  554. <button class="author-btn" @click="openList" v-if="isLogin&&isAddKf==1&&isShu&&(showTabFeaturedComments || showTabColumnIntro || showTabReviewPoints)">{{ showTabFeaturedComments ? '去留言' : showTabColumnIntro ? '亮点介绍' : '评价得积分' }}
  555. <image v-if="showTabReviewPoints&&!showTabFeaturedComments&&!showTabColumnIntro" src="/static/images/jifen.png"></image></button>
  556. <button class="author-btn" @click="submit" v-if="isLogin&&isAddKf==1&&remainTime==0&&!isShu&&tabIndex==2">评价得积分
  557. <image src="/static/images/jifen.png"></image>
  558. </button>
  559. </template>
  560. <button class="author-btn" @click="submit" v-if="!isLogin&&isAddKf!==1">立即观看</button>
  561. <!-- <button
  562. class="author-btn"
  563. open-type="getUserInfo" :disabled="userdisabled"
  564. @getuserinfo="userInfologin" v-if="authType==0&&!isLogin&&isAddKf!==1">立即观看</button> -->
  565. <!-- 竖屏 isShu 下 rating 区隐藏;若仍停留在精选留言 tab,勿在 footer 展示留言框,只保留「评价得积分」按钮(与 _expandLayoutIfPortraitFeaturedCommentsOnly 竖屏体验一致) -->
  566. <view v-if="tabIndex==0 && showTabFeaturedComments&&!isShu" class="rating-msg-input-shell">
  567. <view
  568. v-if="featuredCommentMedia"
  569. class="rating-msg-media-pill"
  570. @click.stop="clearFeaturedCommentMedia"
  571. >
  572. <image
  573. v-if="featuredCommentMedia.type === 'image'"
  574. class="rating-msg-media-thumb"
  575. :src="featuredCommentMedia.path"
  576. mode="aspectFill"
  577. />
  578. <image
  579. v-else
  580. class="rating-msg-media-thumb"
  581. :src="featuredCommentMedia.thumbTempPath || featuredCommentMedia.path"
  582. mode="aspectFill"
  583. />
  584. <view v-if="featuredCommentMedia.type === 'video'" class="rating-msg-media-badge">视频</view>
  585. <text class="rating-msg-media-x">×</text>
  586. </view>
  587. <view class="rating-msg-input rating-msg-input-trigger" @tap.stop="openFeaturedCommentComposer">
  588. <text
  589. class="rating-msg-input-trigger-text"
  590. :class="{ 'is-ph': !featuredCommentInput }"
  591. >{{ featuredCommentInput || '善言善语结善缘~' }}</text>
  592. </view>
  593. <view class="rating-msg-input-icon" @tap.stop="openFeaturedCommentComposer">
  594. <image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/upimg.png"></image>
  595. </view>
  596. </view>
  597. <view class="author-cart" v-show="!(tabIndex === 0 && showTabFeaturedComments && isLogin && isAddKf == 1 && !isquestion && !isShu)">
  598. <view class="more-box">
  599. <image src="/static/images/more24.png" @click="showMore"></image>
  600. <view class="tips">更多</view>
  601. </view>
  602. <view class="more-box" style="margin-left: 30rpx;position: relative;">
  603. <image src="/static/images/kefu.png" @click="showMore"></image>
  604. <view class="tips">客服</view>
  605. <button class="contact-btn" open-type="contact"></button>
  606. </view>
  607. <image class="xianshi" v-if="showTreatment==0&&displayProductList.length>0&&!cardPopup" src="/static/images/xg.png"></image>
  608. <view class="more-box" v-if="showTreatment==0">
  609. <image @click="showCart" src="/static/images/cart.png"></image>
  610. <view class="tips">去下单</view>
  611. </view>
  612. </view>
  613. </view>
  614. </view>
  615. <!-- 更多操作弹窗 -->
  616. <view>
  617. <u-modal :show="showfalse" title="提示" :content='contentmsg' @confirm='showfalse=false'></u-modal>
  618. </view>
  619. <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="24"
  620. :loading-text="loadingtext"></u-loading-page>
  621. <ykscreenRecord></ykscreenRecord>
  622. <template v-if="tabIndex==0 && showTabFeaturedComments && !(showTabReviewPoints && isShu)">
  623. <view
  624. v-if="featuredCommentComposerActive"
  625. class="featured-comment-composer-mask"
  626. @tap="onFeaturedCommentComposerMaskTap"
  627. ></view>
  628. <view
  629. v-if="featuredCommentComposerActive"
  630. class="featured-comment-composer-wrap"
  631. :style="{ bottom: featuredCommentKeyboardBottomPx + 'px' }"
  632. >
  633. <view class="featured-comment-composer-inner">
  634. <view
  635. v-if="featuredCommentMedia"
  636. class="fc-composer-media-pill"
  637. @click.stop="clearFeaturedCommentMedia"
  638. >
  639. <image
  640. v-if="featuredCommentMedia.type === 'image'"
  641. class="fc-composer-media-thumb"
  642. :src="featuredCommentMedia.path"
  643. mode="aspectFill"
  644. />
  645. <image
  646. v-else
  647. class="fc-composer-media-thumb"
  648. :src="featuredCommentMedia.thumbTempPath || featuredCommentMedia.path"
  649. mode="aspectFill"
  650. />
  651. <view v-if="featuredCommentMedia.type === 'video'" class="fc-composer-media-badge">视频</view>
  652. <text class="fc-composer-media-x">×</text>
  653. </view>
  654. <view class="featured-comment-composer-input-row">
  655. <textarea
  656. class="fc-composer-input"
  657. v-model="featuredCommentInput"
  658. type="text"
  659. confirm-type="done"
  660. :show-confirm-bar="false"
  661. placeholder="善言善语结善缘~"
  662. placeholder-class="fc-composer-ph"
  663. :focus="featuredCommentInputFocused"
  664. :adjust-position="false"
  665. @blur="onFeaturedCommentComposerInputBlur"
  666. />
  667. <view class="fc-composer-input-icon" @click.stop="onFeaturedPickMedia">
  668. <image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/upimg.png"></image>
  669. </view>
  670. </view>
  671. <view class="featured-comment-composer-publish" @tap.stop="submitFeaturedComment">发布</view>
  672. </view>
  673. </view>
  674. </template>
  675. <!-- 精选留言:图片/视频放大查看(自定义弹窗,替代系统预览) -->
  676. <view
  677. v-if="featuredCommentMediaPreviewShow"
  678. class="fc-media-preview-mask"
  679. @tap="closeFeaturedCommentMediaPreview"
  680. >
  681. <view class="fc-media-preview-card" @tap.stop="featuredCommentPreviewCardTap">
  682. <view
  683. v-if="featuredCommentMediaPreviewMode === 'image' && featuredCommentMediaPreviewUrls.length"
  684. class="fc-media-preview-img-box"
  685. >
  686. <view class="fc-media-preview-slide">
  687. <image
  688. class="fc-media-preview-main-img"
  689. :src="featuredCommentMediaPreviewUrls[featuredCommentMediaPreviewIndex]"
  690. mode="aspectFit"
  691. />
  692. </view>
  693. </view>
  694. <view
  695. v-else-if="featuredCommentMediaPreviewMode === 'video' && featuredCommentMediaPreviewVideoUrl"
  696. class="fc-media-preview-video-box"
  697. >
  698. <video
  699. id="fc-media-preview-video"
  700. class="fc-media-preview-video"
  701. :src="featuredCommentMediaPreviewVideoUrl"
  702. :poster="featuredCommentMediaPreviewPoster"
  703. controls
  704. :show-center-play-btn="true"
  705. :show-play-btn="true"
  706. :show-fullscreen-btn="false"
  707. :auto-pause-if-open-native="false"
  708. :auto-pause-if-navigate="true"
  709. :enable-progress-gesture="true"
  710. :show-background-playback-button="false"
  711. @play="onFeaturedMediaPreviewModalVideoPlay"
  712. />
  713. </view>
  714. <view class="fc-media-preview-footer">
  715. <scroll-view
  716. v-if="featuredCommentMediaPreviewMode === 'image' && featuredCommentMediaPreviewUrls.length > 1"
  717. scroll-x
  718. class="fc-media-preview-thumbs"
  719. :show-scrollbar="false"
  720. >
  721. <view class="fc-media-preview-thumbs-inner">
  722. <image
  723. v-for="(tu, ti) in featuredCommentMediaPreviewUrls"
  724. :key="'t-' + ti"
  725. class="fc-media-preview-thumb"
  726. :class="{ 'fc-media-preview-thumb--active': ti === featuredCommentMediaPreviewIndex }"
  727. :src="tu"
  728. mode="aspectFill"
  729. @tap.stop="setFeaturedMediaPreviewIndex(ti)"
  730. />
  731. </view>
  732. </scroll-view>
  733. <view v-else class="fc-media-preview-thumbs-spacer" />
  734. <view class="fc-media-preview-close" @tap.stop="closeFeaturedCommentMediaPreview">
  735. <!-- <text class="fc-media-preview-close-x">×</text> -->
  736. <u-icon name="close-circle" color="#fff" size="30"></u-icon>
  737. </view>
  738. </view>
  739. </view>
  740. </view>
  741. <courseExpiration v-if="showExpiration" :code="resCode" :msg="resMsg" :qrcode="qrcode"
  742. :userId="user && userInfo.userId ? userInfo.userId : ''"></courseExpiration>
  743. </view>
  744. </template>
  745. <script>
  746. import goodsList from "./components/goodsList.vue"
  747. import { hasHotSaleTag, getProductHotKey, clampHotSaleCount } from './utils/productHotSale.js'
  748. import {
  749. generateRandomString
  750. } from "@/utils/common.js"
  751. import {
  752. buildFakeOrderPool
  753. } from '@/utils/videovipFakeMarquee.js'
  754. import dayjs from 'dayjs';
  755. import {
  756. mapGetters
  757. } from 'vuex';
  758. import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
  759. import courseExpiration from './components/courseExpiration.vue'
  760. import {
  761. getErrMsg,
  762. getH5CourseByVideoId,
  763. getH5CourseVideoDetails,
  764. courseAnswer,
  765. getFinishCourseVideo,
  766. getIsAddKf,
  767. getInternetTraffic,
  768. getIntegralByH5Video,
  769. sendReward,
  770. getRealLink,
  771. loginByMiniApp,
  772. handleFsUserWx,
  773. getRemainTime,
  774. getCommentList,
  775. addCommentWithMedia
  776. } from "@/api/courseLook.js"
  777. import {
  778. loginByMp,
  779. getComments,
  780. saveMsg
  781. } from "@/api/courseAuto.js"
  782. import {
  783. getConfigByKey
  784. } from "@/api/user.js"
  785. export default {
  786. components: {
  787. ykscreenRecord,
  788. courseExpiration,
  789. goodsList
  790. },
  791. data() {
  792. return {
  793. displayType:'',
  794. isMore:false,//更多
  795. isCart:false,//购物车
  796. isShu:false,//竖屏默认
  797. aindex:null,
  798. rateBounceIndex: null,
  799. _rateBounceTimer: null,
  800. rateList:[{
  801. id:0,
  802. icon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/hsat.png',
  803. name:'非常满意',
  804. selIcon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/hsat_sel.png'
  805. },
  806. {
  807. id:1,
  808. icon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/sat.png',
  809. name:'满意',
  810. selIcon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/sat_sel.png'
  811. },
  812. {
  813. id:2,
  814. icon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/fari.png',
  815. name:'一般',
  816. selIcon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/fari_sel.png'
  817. },
  818. {
  819. id:3,
  820. icon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/unsat.png',
  821. name:'不满意',
  822. selIcon:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/unsat_sel.png'
  823. }
  824. ],
  825. resMsg: "",
  826. resCode: '',
  827. showExpiration: false,
  828. videoItem: {},
  829. viewload: true,
  830. loadingtext: "数据加载中...",
  831. baseUrl: uni.getStorageSync('requestPath'),
  832. // 1 红包 2 积分
  833. rewardType: [{
  834. name: '红包奖励',
  835. value: 1
  836. }, {
  837. name: '积分奖励',
  838. value: 2
  839. }],
  840. currentReward: 1,
  841. player: null,
  842. loading: true,
  843. progress: 0,
  844. code: null,
  845. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  846. scrollTop: 0,
  847. height: '0px',
  848. isLogin: false,
  849. videoUrl: "",
  850. videoId: "",
  851. /** 恢复前台 / seek 后短时间内跳过「快进」判定,避免 iOS、鸿蒙息屏后首帧 currentTime 抖动误报 */
  852. _antiSeekSuppressExpireAt: 0,
  853. _videoPageHadShownOnce: false,
  854. //现在的时长
  855. playTime: 0,
  856. //总时长
  857. duration: 0,
  858. playDuration: 0,
  859. // 用于续播
  860. playDurationSeek: 0,
  861. // 温馨提醒时间节点,
  862. tipsTime: 0,
  863. tipsOpen: false,
  864. config: {},
  865. courseInfo: {},
  866. quesList: [],
  867. lineList: [],
  868. // 错题
  869. errQues: [],
  870. // 答题机会
  871. remain: 0,
  872. errTitle: "",
  873. errDesc: "",
  874. showPlay: true,
  875. showControls: false,
  876. playStatus: "",
  877. isFull: false,
  878. fullscreenToggleLock: false,
  879. fullscreenToggleTimer: null,
  880. isAddKf: 0,
  881. lineIndex: 0,
  882. // 是否展开
  883. isExpand: true,
  884. textHeight: 0, //文本高度
  885. qwUserId: "",
  886. qrcode: "",
  887. corpId: "",
  888. periodId: "", //营期id
  889. companyUserId: "", //销售id
  890. companyId: "", //公司id
  891. courseId: "", //课程id
  892. qrcodeMsg: "",
  893. urlOption: {},
  894. bufferRate: 0, // 缓冲时间
  895. uuId: "",
  896. isEnded: false,
  897. /** 当前是否处于播放中 */
  898. videoPlaying: false,
  899. // 是否允许拖动进度条
  900. linkType: 0,
  901. ip: null,
  902. checked: true,
  903. isFinish: 0, // 是否完课
  904. interval: null,
  905. intervalIntegral: null, // 积分定时
  906. options: {
  907. sources: [{
  908. src: ""
  909. }],
  910. poster: "",
  911. live: false /* 是否直播 */ ,
  912. controls: true,
  913. autoplay: false,
  914. licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323137866_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl,
  915. LicenseKey: 'bcc5bd9a14b798b48c52ff005a21d926',
  916. controlBar: {
  917. volumePanel: false,
  918. playbackRateMenuButton: false,
  919. QualitySwitcherMenuButton: false,
  920. // progressControl: false
  921. },
  922. plugins: {
  923. // ProgressMarker: false,
  924. ContextMenu: {
  925. statistic: false
  926. }
  927. },
  928. },
  929. // 错误请求次数
  930. errorCount: 0,
  931. answerPopup: false,
  932. sortLink: "",
  933. // 课程是否过期
  934. isExpire: false,
  935. menuButtonLeft: 281,
  936. menuButtonH: 45,
  937. timer: null,
  938. flag: false,
  939. msg: '',
  940. poster: '',
  941. userInfo: {},
  942. timeid: '',
  943. videocont: {},
  944. timepop: false,
  945. appToken: '',
  946. kfPopup: false,
  947. iskftype: 0,
  948. courseLogo: '',
  949. isquestion: false,
  950. tipsPopup: false,
  951. timepath: '3分之1',
  952. tipsTime2: 0,
  953. userlogo: false,
  954. userinfos: {
  955. nickname: "",
  956. avatar: ""
  957. },
  958. headImg: '',
  959. authType: 0, //0微信登录 1手机号登录
  960. userdisabled: false,
  961. projectId: '',
  962. showfalse: false,
  963. contentmsg: null,
  964. currentId: 0,
  965. showTreatment: 1,
  966. treatmentPackage: [],
  967. // 商品栏展示列表(根据上架/下架时间过滤)
  968. displayProductList: [],
  969. // 商品卡片弹窗
  970. cardPopup: false,
  971. currentCardItem: null,
  972. // 热卖标签数量(小黄车与弹窗卡片共用,按 productId)
  973. productHotCountMap: {},
  974. productHotTimer: null,
  975. // 手动关闭后,当前卡片在其有效时段内不再重复弹出
  976. dismissedCardKey: '',
  977. // 完课积分倒计时(秒)
  978. remainTime: 0,
  979. // 完课积分总倒计时时长(秒),用于计算百分比
  980. totalRemainTime: 0,
  981. // 完课积分倒计时定时器
  982. countdownTimer: null,
  983. // 是否已从接口拉取到倒计时数据(避免 remainTime 初始为 0 时提前放开答题)
  984. remainTimeReady: false,
  985. // 倒计时结束后是否已补发过一次看课记录
  986. hasReportedAfterCountdown: false,
  987. notice:'',//跑马灯,
  988. isHeight:false,
  989. // 跑马灯数据就绪门禁:避免首次进入时使用旧状态导致闪现
  990. marqueeDataReady: false,
  991. // 虚拟下单跑马灯
  992. fakeOrderPool: [],
  993. marqueeTriplePayloads: [],
  994. marqueeTripleIncomingPayloads: [],
  995. marqueeTripleSwitching: false,
  996. marqueeCurrentText: '',
  997. marqueeSelfHighlight: false,
  998. marqueeDisplayPayload: null,
  999. marqueeDisplaySelf: false,
  1000. marqueeIncomingPayload: null,
  1001. marqueeIncomingSelf: false,
  1002. marqueeSwitching: false,
  1003. pendingSelfMarqueeFirst: false,
  1004. _fakeMarqueeStarted: false,
  1005. /** 与 computed fakeMarqueeEligible 上次值比较,避免无 watch 时在 updateProductAndCardDisplay 高频调用中反复重置防抖 */
  1006. _fakeMarqueeEligiblePrev: undefined,
  1007. _marqueeStartDebounceTimer: null,
  1008. _fakeMarqueeTimer: null,
  1009. _marqueeSwitchTimer: null,
  1010. _marqueeTripleSwitchTimer: null,
  1011. /** 本人下单条按缓存 ts 与当前时间差定时回显刷新 */
  1012. _selfMarqueeClockTimer: null,
  1013. tabIndex:0,
  1014. /** 与 quesList 同源:接口 questionBankList,用于 Tab「评价得积分」是否展示 */
  1015. questionBankList: [],
  1016. /** getCommentList 的 defaultPageInfo.list:控制精选留言 Tab;与用户 featuredCommentList 在 featuredCommentDisplayList 中合并展示 */
  1017. defaultPageInfoList: [],
  1018. featuredCommentList: [],
  1019. featuredCommentInput: '',
  1020. featuredCommentLoading: false,
  1021. featuredCommentLoadingMore: false,
  1022. /** 下一页页码,与 getCommentList pageNum 一致 */
  1023. featuredCommentPageNum: 1,
  1024. featuredCommentPageSize: 10,
  1025. featuredCommentHasMore: true,
  1026. /** getCommentList 最近一次返回:用户评论总条数(与运营 defaultPageInfo.total 分离) */
  1027. featuredCommentUserTotal: NaN,
  1028. /** getCommentList 最近一次返回:运营精选总条数 */
  1029. featuredCommentDefaultTotal: NaN,
  1030. featuredCommentSending: false,
  1031. /** 精选留言待发送的本地媒体:type image|video,path 临时路径,thumbTempPath 视频封面 */
  1032. featuredCommentMedia: null,
  1033. /**
  1034. * 从相册/相机选图或选视频返回时小程序会触发 onShow,否则会误跑 getH5CourseByVideo / getH5CourseVideoDetails。
  1035. * 与 uni.uploadFile 发布评论无直接关系;选媒体前置 true,onShow 消费一次或 complete 兜底清除。
  1036. */
  1037. videovipSuppressOnShowCourseFetchOnce: false,
  1038. /** 从相册选留言图/视频前主课若在播,上传(含压缩)结束后恢复播放 */
  1039. _shouldResumeCourseVideoAfterFeaturedUpload: false,
  1040. /**
  1041. * 打开精选留言输入前主课是否在播(快照)。
  1042. * 键盘/选图页返回时常先触发 @pause,videoPlaying 已为 false,仅靠选媒体瞬间的 videoPlaying 会漏标,导致发布后不调 play。
  1043. */
  1044. _courseWasPlayingBeforeFeaturedCommentOpen: false,
  1045. /** 精选留言选图/选视频:用底部 u-popup 替代 uni.showActionSheet,避免鸿蒙等机型原生弹层未贴底 */
  1046. featuredMediaActionSheetShow: false,
  1047. /** 精选留言:自定义大图/视频预览弹窗 */
  1048. featuredCommentMediaPreviewShow: false,
  1049. featuredCommentMediaPreviewMode: 'image',
  1050. featuredCommentMediaPreviewUrls: [],
  1051. featuredCommentMediaPreviewIndex: 0,
  1052. featuredCommentMediaPreviewVideoUrl: '',
  1053. featuredCommentMediaPreviewPoster: '',
  1054. /** 精选留言 scroll-view 滚到底部(与 id=fc-scroll-anchor 配合) */
  1055. featuredCommentScrollIntoView: '',
  1056. /** 精选留言:键盘上方白底输入条 */
  1057. featuredCommentComposerActive: false,
  1058. featuredCommentInputFocused: false,
  1059. featuredCommentKeyboardBottomPx: 0,
  1060. }
  1061. },
  1062. filters: {
  1063. numberToChinese(number) {
  1064. if (number) {
  1065. const chineseNumber = ['一', '二', '三', '四', '五', '六', '七', '八', '九'];
  1066. return chineseNumber[number - 1];
  1067. } else {
  1068. return ''
  1069. }
  1070. },
  1071. },
  1072. computed: {
  1073. isAnswer() {
  1074. return (item, name) => {
  1075. if (item.type == 1) {
  1076. return item.answer == name
  1077. } else if (item.type == 2) {
  1078. const array = item.answer.split(',')
  1079. return array.some(i => i == name)
  1080. } else {
  1081. return false
  1082. }
  1083. }
  1084. },
  1085. imgPath() {
  1086. return this.$store.state.imgpath
  1087. },
  1088. imgname() {
  1089. return this.$store.state.logoname
  1090. },
  1091. appid() {
  1092. return this.$store.state.appid
  1093. },
  1094. nameuser() {
  1095. return this.userinfos.nickname
  1096. },
  1097. avataruser() {
  1098. return this.userinfos.avatar
  1099. },
  1100. // 格式化后的倒计时
  1101. formattedCountdown() {
  1102. return this.formatCountdown(this.remainTime);
  1103. },
  1104. // 倒计时百分比
  1105. countdownPercentage() {
  1106. return this.getCountdownPercentage();
  1107. },
  1108. /** 评价得积分:questionBankList 有题 */
  1109. showTabReviewPoints() {
  1110. return Array.isArray(this.questionBankList) && this.questionBankList.length > 0
  1111. },
  1112. /** 亮点介绍:已配置 courseIntroImg */
  1113. showTabColumnIntro() {
  1114. const img = this.courseInfo && this.courseInfo.courseIntroImg
  1115. return typeof img === 'string' && img.trim() !== ''
  1116. },
  1117. /** 精选留言:仅当运营配置的 defaultPageInfo.list 有数据时展示 Tab */
  1118. showTabFeaturedComments() {
  1119. return Array.isArray(this.defaultPageInfoList) && this.defaultPageInfoList.length > 0
  1120. },
  1121. /** 精选留言列表:有运营 defaultPageInfo 时先展示用户新评论 featuredCommentList,再拼接运营配置项(同 id 去重) */
  1122. featuredCommentDisplayList() {
  1123. const def = Array.isArray(this.defaultPageInfoList) ? this.defaultPageInfoList : []
  1124. if (!def.length) return []
  1125. const user = Array.isArray(this.featuredCommentList) ? this.featuredCommentList : []
  1126. return this._mergeFeaturedUserComments(user.slice(), def)
  1127. },
  1128. /** 用户评论已加载完且无加载中时展示 */
  1129. showFeaturedCommentNoMoreFooter() {
  1130. if (this.featuredCommentLoading || this.featuredCommentLoadingMore) return false
  1131. const list = this.featuredCommentDisplayList
  1132. if (!Array.isArray(list) || !list.length) return false
  1133. return !this.featuredCommentHasMore
  1134. },
  1135. visibleRatingTabCount() {
  1136. return this.ratingTabList.length
  1137. },
  1138. /** 评价区 Tab 展示顺序:精选留言 → 亮点介绍 → 评价得积分(仅渲染有数据的项) */
  1139. ratingTabList() {
  1140. const tabs = []
  1141. if (this.showTabFeaturedComments) {
  1142. tabs.push({
  1143. key: 'featured',
  1144. index: 0,
  1145. label: '精选留言',
  1146. icon: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/pl.png',
  1147. iconActive: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/pl-sel.png'
  1148. })
  1149. }
  1150. if (this.showTabColumnIntro) {
  1151. tabs.push({
  1152. key: 'column',
  1153. index: 1,
  1154. label: '亮点介绍',
  1155. icon: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/des.png',
  1156. iconActive: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/des-sel.png'
  1157. })
  1158. }
  1159. if (this.showTabReviewPoints) {
  1160. tabs.push({
  1161. key: 'review',
  1162. index: 2,
  1163. label: '评价得积分',
  1164. icon: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/sel.png',
  1165. iconActive: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/zan-sel.png'
  1166. })
  1167. }
  1168. return tabs
  1169. },
  1170. hasVisibleRatingTab() {
  1171. return this.visibleRatingTabCount > 0
  1172. },
  1173. ...mapGetters(['coureLogin']),
  1174. /** 小黄车商品中「最早上架」时间点(秒),用于跑马灯起始展示 */
  1175. firstShelfSecondsAmongProducts() {
  1176. const list = this.treatmentPackage || []
  1177. if (!list.length) return Infinity
  1178. let minSec = Infinity
  1179. for (let i = 0; i < list.length; i++) {
  1180. const t = list[i].onShelfTime
  1181. if (!this._vipShelfTimeValid(t)) continue
  1182. const sec = this._vipTimeStrToSec(t)
  1183. if (sec > 0 && sec < minSec) minSec = sec
  1184. }
  1185. return minSec === Infinity ? Infinity : minSec
  1186. },
  1187. fakeMarqueeEligible() {
  1188. // 商品/回放数据未完成刷新前,不允许启动展示,避免首次闪现
  1189. if (!this.marqueeDataReady) return false
  1190. if (this.showTreatment !== 0) return false
  1191. // 以“当前应展示的商品列表非空”作为跑马灯出现条件
  1192. // 这样能对齐你说的“商品上架才出现”,避免只用最早上架秒点导致的一帧差异
  1193. return Array.isArray(this.displayProductList) && this.displayProductList.length > 0
  1194. },
  1195. // 竖屏课打开小黄车 goodsList 弹窗,或打开精选留言大图/视频预览 fc-media-preview-mask 时,先藏住视频上的虚拟下单条,关闭后再显(不影响底层跑马灯计时)
  1196. showFakeMarqueeOnVideoCover() {
  1197. if (!this.fakeMarqueeEligible) return false
  1198. if (this.displayType === 'portrait' && (this.isCart || this.featuredCommentMediaPreviewShow)) return false
  1199. return true
  1200. },
  1201. isTripleMarqueeMode() {
  1202. return !!(this.isShu || this.isFull)
  1203. },
  1204. },
  1205. watch: {
  1206. coureLogin: {
  1207. immediate: true, // 页面一进入就检查一次
  1208. handler(val) {
  1209. console.log(val, '----')
  1210. if (val == 2 && this.isLogin) {
  1211. console.log("看课AppToken失效,请重新登录")
  1212. this.isLogin = false
  1213. this.isAddKf = 0
  1214. this.goLogin()
  1215. }
  1216. }
  1217. },
  1218. isTripleMarqueeMode(now, was) {
  1219. if (!now || was) return
  1220. if (!this.fakeMarqueeEligible || !this._fakeMarqueeStarted) return
  1221. this.syncTripleMarqueeImmediate()
  1222. },
  1223. /** 精选留言 Tab 出现后默认高亮 */
  1224. showTabFeaturedComments(now, was) {
  1225. if (now && was !== true) {
  1226. this._selectDefaultRatingTab()
  1227. }
  1228. },
  1229. /**
  1230. * 评价 Tab 晚于亮点介绍返回时,_syncRatingTabIndex 可能暂落在 tab=1;
  1231. * 若有精选留言则仍默认高亮 tab=0,否则仅校正到当前第一个可见 Tab。
  1232. */
  1233. showTabReviewPoints(now, was) {
  1234. if (now && was !== true) {
  1235. this._selectDefaultRatingTab()
  1236. }
  1237. },
  1238. /** Tab 数量增加且含精选留言时,默认高亮精选留言 */
  1239. visibleRatingTabCount(n, o) {
  1240. if (n <= 0 || !this.showTabFeaturedComments) return
  1241. if (o != null && n <= o) return
  1242. this._selectDefaultRatingTab()
  1243. },
  1244. // tabIndex(n) {
  1245. // if (n !== 2) {
  1246. // this._closeFeaturedCommentComposerUi()
  1247. // this.closeFeaturedMediaActionSheet()
  1248. // }
  1249. // }
  1250. displayProductList: {
  1251. handler() {
  1252. this.syncProductHotCounts()
  1253. },
  1254. deep: true,
  1255. },
  1256. cardPopup() {
  1257. this.syncProductHotCounts()
  1258. },
  1259. currentCardItem() {
  1260. this.syncProductHotCounts()
  1261. },
  1262. },
  1263. onLoad(option) {
  1264. this.getWebviewUrl()
  1265. uni.$on('usercode', (data) => {
  1266. console.log('huoqu ', data)
  1267. this.goLogin(data)
  1268. })
  1269. uni.$on('vipMsg', (data) => {
  1270. console.log(4444, data)
  1271. this.contentmsg = data
  1272. this.showfalse = true
  1273. uni.showToast({
  1274. icon: 'none',
  1275. title: data,
  1276. duration: 5000
  1277. });
  1278. })
  1279. this.videoContext = uni.createVideoContext('video-content-box', this)
  1280. this.getVideoContainerHeight()
  1281. this.code = option.code
  1282. if (uni.getStorageSync('userInfo') && JSON.stringify(uni.getStorageSync('userInfo')) != '{}') {
  1283. this.userInfo = uni.getStorageSync('userInfo')
  1284. } else {
  1285. this.userInfo = {}
  1286. }
  1287. this.appToken = uni.getStorageSync('companyUserInfo')
  1288. console.log('option', option)
  1289. if (!option.course) {
  1290. const keys = decodeURIComponent(Object.keys(option)[0]);
  1291. this.urlOption = JSON.parse(keys.split('course=')[1])
  1292. } else {
  1293. this.urlOption = option.course ? JSON.parse(decodeURIComponent(option.course)) : {}
  1294. }
  1295. console.log(this.urlOption)
  1296. uni.setStorageSync('H5course', this.urlOption)
  1297. this.videoId = this.urlOption.videoId
  1298. this.courseId = this.urlOption.courseId
  1299. this.periodId = this.urlOption.periodId
  1300. this.companyId = this.urlOption.companyId
  1301. this.companyUserId = this.urlOption.companyUserId
  1302. this.projectId = this.urlOption.projectId
  1303. this.timeid = this.urlOption.id
  1304. console.log(this.urlOption)
  1305. console.log(decodeURIComponent(option.course))
  1306. // this.sortLink = this.urlOption.link || ''
  1307. this.getMenuButton()
  1308. // #ifdef MP-WEIXIN
  1309. // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
  1310. // this.userlogo=true
  1311. // }
  1312. console.log(uni.getStorageSync('userInfos'))
  1313. // if(!uni.getStorageSync('userInfos')&&this.$store.state.logoname=='岚财良品'){
  1314. // uni.navigateTo({
  1315. // url:'/pages_course/webview'
  1316. // })
  1317. // return
  1318. // }
  1319. // #endif
  1320. // #ifndef H5
  1321. this._featuredCommentKbHandler = (res) => {
  1322. const h = res && res.height != null ? res.height : 0
  1323. const prev = this.featuredCommentKeyboardBottomPx
  1324. this.featuredCommentKeyboardBottomPx = h
  1325. if (
  1326. this.featuredCommentComposerActive &&
  1327. prev > 0 &&
  1328. h === 0
  1329. ) {
  1330. this.featuredCommentComposerActive = false
  1331. this.featuredCommentInputFocused = false
  1332. }
  1333. }
  1334. uni.onKeyboardHeightChange(this._featuredCommentKbHandler)
  1335. // #endif
  1336. },
  1337. onShow() {
  1338. this.userinfos = uni.getStorageSync('userinfos')
  1339. this.userInfo = uni.getStorageSync('userInfo')
  1340. this.tipsOpen = false
  1341. this.isExpand = true
  1342. this.uuId = generateRandomString(16)
  1343. this.refreshVipPurchaseMarqueeFlag()
  1344. if (this._videoPageHadShownOnce) {
  1345. this._touchAntiSeekSuppress(2000)
  1346. } else {
  1347. this._videoPageHadShownOnce = true
  1348. }
  1349. if (this.videovipSuppressOnShowCourseFetchOnce) {
  1350. this.videovipSuppressOnShowCourseFetchOnce = false
  1351. return
  1352. }
  1353. // 每次进入页面先关闭门禁,并清空旧跑马灯状态,等 getH5CourseVideoDetails 拉完数据再开启
  1354. this.stopFakeMarqueeLoop()
  1355. this.marqueeDataReady = false
  1356. this._fakeMarqueeEligiblePrev = undefined
  1357. if (this.videoId) {
  1358. this.getH5CourseByVideo()
  1359. }
  1360. const AppToken = uni.getStorageSync('TOKEN_WEXIN')
  1361. console.log(AppToken)
  1362. if (AppToken) {
  1363. // this.isLogin=true
  1364. if (this.isAddKf == 1 && this.userInfo.userId) {
  1365. console.log(1233)
  1366. this.getH5CourseVideoDetails()
  1367. } else {
  1368. // this.checkUserInfoA()
  1369. this.getIsAddKf()
  1370. }
  1371. }
  1372. // if(this.sortLink){
  1373. // this.getLink()
  1374. // } else {
  1375. // uni.showToast({
  1376. // title: 'sortLink is not found',
  1377. // icon: 'none'
  1378. // });
  1379. // }
  1380. },
  1381. mounted() {
  1382. // this.getIP()
  1383. this.getHeight()
  1384. },
  1385. onHide() {
  1386. this.closeFeaturedCommentMediaPreview()
  1387. this._closeFeaturedCommentComposerUi()
  1388. // this.player = uni.createVideoContext('video-content-box');
  1389. if (this.player) {
  1390. this.player.pause()
  1391. }
  1392. // 精选留言调起相册/相机时也会触发 onHide,勿停虚拟跑马灯(与 onShow 抑制拉课共用同一标志)
  1393. if (!this.videovipSuppressOnShowCourseFetchOnce) {
  1394. this.stopFakeMarqueeLoop()
  1395. }
  1396. // 页面隐藏时停止完课积分倒计时
  1397. this.stopCountdown()
  1398. this.stopProductHotTimer()
  1399. // if (this.interval != null) {
  1400. // clearInterval(this.interval)
  1401. // this.interval = null
  1402. // }
  1403. },
  1404. onPageResize(){
  1405. this.getVideoContainerHeight();
  1406. },
  1407. onUnload() {
  1408. this.closeFeaturedCommentMediaPreview()
  1409. this._videoPageHadShownOnce = false
  1410. if (this.interval != null) {
  1411. clearInterval(this.interval)
  1412. this.interval = null
  1413. }
  1414. if (this.fullscreenToggleTimer) {
  1415. clearTimeout(this.fullscreenToggleTimer)
  1416. this.fullscreenToggleTimer = null
  1417. }
  1418. if (this._rateBounceTimer) {
  1419. clearTimeout(this._rateBounceTimer)
  1420. this._rateBounceTimer = null
  1421. }
  1422. this.fullscreenToggleLock = false
  1423. // 页面卸载时清理完课积分倒计时
  1424. this.stopCountdown()
  1425. this.stopProductHotTimer()
  1426. this.clearIntegral()
  1427. this.stopFakeMarqueeLoop()
  1428. this.fakeOrderPool = []
  1429. uni.$off('usercode')
  1430. // #ifndef H5
  1431. if (this._featuredCommentKbHandler) {
  1432. uni.offKeyboardHeightChange(this._featuredCommentKbHandler)
  1433. this._featuredCommentKbHandler = null
  1434. }
  1435. // #endif
  1436. },
  1437. beforeDestroy() {
  1438. this.closeFeaturedCommentMediaPreview()
  1439. this.player = uni.createVideoContext('video-content-box');
  1440. if (this.player) {
  1441. this.player.stop()
  1442. this.player = null
  1443. }
  1444. if (this.interval != null) {
  1445. clearInterval(this.interval)
  1446. this.interval = null
  1447. }
  1448. if (this.fullscreenToggleTimer) {
  1449. clearTimeout(this.fullscreenToggleTimer)
  1450. this.fullscreenToggleTimer = null
  1451. }
  1452. if (this._rateBounceTimer) {
  1453. clearTimeout(this._rateBounceTimer)
  1454. this._rateBounceTimer = null
  1455. }
  1456. this.fullscreenToggleLock = false
  1457. // 组件销毁前清理完课积分倒计时
  1458. this.stopCountdown()
  1459. this.stopProductHotTimer()
  1460. this.clearIntegral()
  1461. this.stopFakeMarqueeLoop()
  1462. // #ifndef H5
  1463. if (this._featuredCommentKbHandler) {
  1464. uni.offKeyboardHeightChange(this._featuredCommentKbHandler)
  1465. this._featuredCommentKbHandler = null
  1466. }
  1467. // #endif
  1468. },
  1469. methods: {
  1470. _closeFeaturedCommentComposerUi() {
  1471. this.featuredCommentComposerActive = false
  1472. this.featuredCommentInputFocused = false
  1473. this.featuredCommentKeyboardBottomPx = 0
  1474. },
  1475. openFeaturedCommentComposer() {
  1476. this._expandLayoutIfPortraitFeaturedCommentsOnly()
  1477. this._courseWasPlayingBeforeFeaturedCommentOpen = this.videoPlaying && !this.isEnded
  1478. this.featuredCommentComposerActive = true
  1479. this.$nextTick(() => {
  1480. this.featuredCommentInputFocused = true
  1481. })
  1482. },
  1483. onFeaturedCommentComposerMaskTap() {
  1484. this._closeFeaturedCommentComposerUi()
  1485. },
  1486. onFeaturedCommentComposerInputFocus() {
  1487. this._expandLayoutIfPortraitFeaturedCommentsOnly()
  1488. },
  1489. onFeaturedCommentComposerInputBlur() {
  1490. this.featuredCommentInputFocused = false
  1491. },
  1492. /** 有精选留言时默认 tabIndex=0,否则落到第一个可见 Tab */
  1493. _selectDefaultRatingTab() {
  1494. if (this.showTabFeaturedComments) {
  1495. this.tabIndex = 0
  1496. this.loadFeaturedComments()
  1497. return
  1498. }
  1499. this._syncRatingTabIndex()
  1500. },
  1501. _syncRatingTabIndex() {
  1502. const tabs = [
  1503. this.showTabFeaturedComments,
  1504. this.showTabColumnIntro,
  1505. this.showTabReviewPoints
  1506. ]
  1507. if (!tabs.some(Boolean)) return
  1508. if (tabs[this.tabIndex]) return
  1509. const idx = tabs.findIndex(Boolean)
  1510. if (idx < 0) return
  1511. this.tabIndex = idx
  1512. if (idx === 0) {
  1513. this.loadFeaturedComments()
  1514. }
  1515. },
  1516. selecTab(idx){
  1517. if (idx === 0 && !this.showTabFeaturedComments) return
  1518. if (idx === 1 && !this.showTabColumnIntro) return
  1519. if (idx === 2 && !this.showTabReviewPoints) return
  1520. this.tabIndex = idx
  1521. if (idx === 0) {
  1522. this.loadFeaturedComments()
  1523. }
  1524. },
  1525. _resolveUserInfoObj() {
  1526. let u = this.userInfo
  1527. if (!u) return {}
  1528. if (typeof u === 'string') {
  1529. try {
  1530. return JSON.parse(u) || {}
  1531. } catch (e) {
  1532. return {}
  1533. }
  1534. }
  1535. return u
  1536. },
  1537. /** 从 getCommentList 结果中取出用户评论列表(兼容 data 为数组或 data.list / list 等),顺序与接口一致 */
  1538. _pickUserCommentListFromCommentListRes(res) {
  1539. if (!res || res.code != 200) return []
  1540. const d = res.data
  1541. if (d && Array.isArray(d.list)) return d.list.slice()
  1542. if (Array.isArray(d)) return d.slice()
  1543. if (Array.isArray(res.list)) return res.list.slice()
  1544. if (d && Array.isArray(d.records)) return d.records.slice()
  1545. return []
  1546. },
  1547. _pickDefaultPageInfoListFromCommentListRes(res) {
  1548. if (!res || res.code != 200) return []
  1549. const dpi = res.defaultPageInfo || (res.data && res.data.defaultPageInfo)
  1550. if (dpi && Array.isArray(dpi.list)) return dpi.list.slice()
  1551. return []
  1552. },
  1553. /** 用户新评论分页 total(与运营列表 total 分离;兼容 userTotal / listTotal / data.total) */
  1554. _pickFeaturedUserCommentTotalFromRes(res) {
  1555. if (!res || res.code != 200) return NaN
  1556. const d = res.data
  1557. const tryNum = (v) => {
  1558. const t = Number(v)
  1559. return Number.isFinite(t) && t >= 0 ? t : NaN
  1560. }
  1561. if (d && typeof d === 'object' && !Array.isArray(d)) {
  1562. if (typeof d.userTotal !== 'undefined') {
  1563. const t = tryNum(d.userTotal)
  1564. if (Number.isFinite(t)) return t
  1565. }
  1566. if (typeof d.commentTotal !== 'undefined') {
  1567. const t = tryNum(d.commentTotal)
  1568. if (Number.isFinite(t)) return t
  1569. }
  1570. if (typeof d.listTotal !== 'undefined') {
  1571. const t = tryNum(d.listTotal)
  1572. if (Number.isFinite(t)) return t
  1573. }
  1574. if (typeof d.total !== 'undefined') {
  1575. const t = tryNum(d.total)
  1576. if (Number.isFinite(t)) return t
  1577. }
  1578. }
  1579. if (typeof res.userTotal !== 'undefined') {
  1580. const t = tryNum(res.userTotal)
  1581. if (Number.isFinite(t)) return t
  1582. }
  1583. if (typeof res.total !== 'undefined') {
  1584. const t = tryNum(res.total)
  1585. if (Number.isFinite(t)) return t
  1586. }
  1587. return NaN
  1588. },
  1589. /** 运营 defaultPageInfo 条数 total(不参与用户分页 hasMore,仅缓存/排查) */
  1590. _pickFeaturedDefaultTotalFromRes(res) {
  1591. if (!res || res.code != 200) return NaN
  1592. const dpi = res.defaultPageInfo || (res.data && res.data.defaultPageInfo)
  1593. if (dpi && typeof dpi.total !== 'undefined') {
  1594. const t = Number(dpi.total)
  1595. return Number.isFinite(t) && t >= 0 ? t : NaN
  1596. }
  1597. return NaN
  1598. },
  1599. _syncFeaturedCommentTotalsFromRes(res) {
  1600. const u = this._pickFeaturedUserCommentTotalFromRes(res)
  1601. const dt = this._pickFeaturedDefaultTotalFromRes(res)
  1602. this.featuredCommentUserTotal = Number.isFinite(u) ? u : NaN
  1603. this.featuredCommentDefaultTotal = Number.isFinite(dt) ? dt : NaN
  1604. },
  1605. _mergeFeaturedUserComments(prev, incoming) {
  1606. const a = Array.isArray(prev) ? prev : []
  1607. const b = Array.isArray(incoming) ? incoming : []
  1608. const keyOf = (it) => {
  1609. if (!it) return ''
  1610. if (it.commentId != null && it.commentId !== '') return 'c:' + it.commentId
  1611. if (it.id != null && it.id !== '') return 'i:' + it.id
  1612. return ''
  1613. }
  1614. const seen = new Set()
  1615. const out = []
  1616. for (let i = 0; i < a.length; i++) {
  1617. const k = keyOf(a[i])
  1618. if (k) seen.add(k)
  1619. out.push(a[i])
  1620. }
  1621. for (let j = 0; j < b.length; j++) {
  1622. const it = b[j]
  1623. const k = keyOf(it)
  1624. if (k) {
  1625. if (seen.has(k)) continue
  1626. seen.add(k)
  1627. }
  1628. out.push(it)
  1629. }
  1630. return out
  1631. },
  1632. /**
  1633. * 是否还有下一页用户评论(仅按用户 total 与已合并的 featuredCommentList 长度比较;
  1634. * 运营 defaultPageInfo 另有 total,不参与此处 hasMore)。
  1635. */
  1636. _applyFeaturedCommentHasMore(res, pageUserList, mergedUserList) {
  1637. const pageLen = Array.isArray(pageUserList) ? pageUserList.length : 0
  1638. const mergedLen = Array.isArray(mergedUserList) ? mergedUserList.length : 0
  1639. const userTotal = this._pickFeaturedUserCommentTotalFromRes(res)
  1640. if (Number.isFinite(userTotal)) {
  1641. this.featuredCommentHasMore = mergedLen < userTotal
  1642. } else {
  1643. this.featuredCommentHasMore = pageLen >= this.featuredCommentPageSize
  1644. }
  1645. if (pageLen === 0) this.featuredCommentHasMore = false
  1646. },
  1647. onFeaturedCommentScrollToLower() {
  1648. if (this.tabIndex !== 0 || !this.showTabFeaturedComments) return
  1649. this.loadFeaturedComments({ append: true })
  1650. },
  1651. loadFeaturedComments(opts) {
  1652. if (!this.videoId || !this.courseId) {
  1653. return Promise.resolve()
  1654. }
  1655. const o = opts || {}
  1656. const scrollToBottom = !!o.scrollToBottom
  1657. const append = !!o.append
  1658. if (append) {
  1659. if (!this.featuredCommentHasMore) return Promise.resolve()
  1660. if (this.featuredCommentLoading || this.featuredCommentLoadingMore) return Promise.resolve()
  1661. this.featuredCommentLoadingMore = true
  1662. } else {
  1663. if (this.featuredCommentLoading) return Promise.resolve()
  1664. this.featuredCommentPageNum = 1
  1665. this.featuredCommentHasMore = true
  1666. this.featuredCommentLoading = true
  1667. }
  1668. const pageNum = this.featuredCommentPageNum
  1669. return getCommentList({
  1670. pageNum,
  1671. pageSize: this.featuredCommentPageSize,
  1672. courseId: this.courseId,
  1673. videoId:this.videoId,
  1674. }).then(res => {
  1675. if (append) {
  1676. this.featuredCommentLoadingMore = false
  1677. } else {
  1678. this.featuredCommentLoading = false
  1679. }
  1680. if (res.code == 200) {
  1681. const pageUser = this._pickUserCommentListFromCommentListRes(res)
  1682. this._syncFeaturedCommentTotalsFromRes(res)
  1683. if (!append) {
  1684. this.featuredCommentList = pageUser
  1685. this.defaultPageInfoList = this._pickDefaultPageInfoListFromCommentListRes(res)
  1686. this._applyFeaturedCommentHasMore(res, pageUser, this.featuredCommentList)
  1687. if (pageUser.length > 0) this.featuredCommentPageNum = pageNum + 1
  1688. } else {
  1689. this.featuredCommentList = this._mergeFeaturedUserComments(
  1690. this.featuredCommentList,
  1691. pageUser
  1692. )
  1693. this._applyFeaturedCommentHasMore(res, pageUser, this.featuredCommentList)
  1694. if (pageUser.length > 0) this.featuredCommentPageNum = pageNum + 1
  1695. }
  1696. } else {
  1697. if (!append) {
  1698. this.defaultPageInfoList = []
  1699. this.featuredCommentList = []
  1700. this.featuredCommentHasMore = false
  1701. this.featuredCommentUserTotal = NaN
  1702. this.featuredCommentDefaultTotal = NaN
  1703. }
  1704. }
  1705. this._syncRatingTabIndex()
  1706. if (scrollToBottom) {
  1707. this.$nextTick(() => {
  1708. this._scrollFeaturedCommentsToBottom()
  1709. setTimeout(() => this._scrollFeaturedCommentsToBottom(), 280)
  1710. })
  1711. }
  1712. }).catch(() => {
  1713. if (append) {
  1714. this.featuredCommentLoadingMore = false
  1715. } else {
  1716. this.featuredCommentLoading = false
  1717. this.featuredCommentList = []
  1718. this.defaultPageInfoList = []
  1719. this.featuredCommentHasMore = false
  1720. this.featuredCommentUserTotal = NaN
  1721. this.featuredCommentDefaultTotal = NaN
  1722. }
  1723. this._syncRatingTabIndex()
  1724. })
  1725. },
  1726. _scrollFeaturedCommentsToBottom() {
  1727. this.featuredCommentScrollIntoView = ''
  1728. this.$nextTick(() => {
  1729. this.featuredCommentScrollIntoView = 'fc-scroll-anchor'
  1730. setTimeout(() => {
  1731. this.featuredCommentScrollIntoView = ''
  1732. }, 400)
  1733. })
  1734. },
  1735. getCommentAvatar(it) {
  1736. if (!it) return ''
  1737. return it.avatar || it.headImg || it.headimg || it.userAvatar || ''
  1738. },
  1739. getCommentDisplayName(it) {
  1740. if (!it) return '用户'
  1741. if (it.nickName) return it.nickName
  1742. if (it.userId != null && it.userId !== '') {
  1743. return it.toNickName
  1744. }
  1745. },
  1746. _urlsEmbeddedInCommentContent(it) {
  1747. const c = it && it.content
  1748. if (c == null || typeof c !== 'string') return []
  1749. const text = String(c).replace(/\u21b5/g, '\n')
  1750. const m = text.match(/https?:\/\/[^\s]+/gi) || []
  1751. const cleaned = m.map(u => u.replace(/[),.;!?]+$/g, ''))
  1752. return [...new Set(cleaned)]
  1753. },
  1754. _isEmbeddedCommentVideoUrl(u) {
  1755. if (!u) return false
  1756. return /\/comment\/video\//i.test(u) || /\.(mp4|m3u8|mov|webm|avi|mkv)(\?|#|$)/i.test(u)
  1757. },
  1758. _isEmbeddedCommentImageUrl(u) {
  1759. if (!u) return false
  1760. return /\/comment\/image\//i.test(u) || /\.(jpg|jpeg|png|gif|webp|bmp)(\?|#|$)/i.test(u)
  1761. },
  1762. _videoUrlFromCommentContent(it) {
  1763. const urls = this._urlsEmbeddedInCommentContent(it)
  1764. for (let i = 0; i < urls.length; i++) {
  1765. if (this._isEmbeddedCommentVideoUrl(urls[i])) return urls[i]
  1766. }
  1767. return ''
  1768. },
  1769. getCommentTextOnly(it) {
  1770. if (!it || it.content == null) return ''
  1771. let text = String(it.content).replace(/\u21b5/g, '\n')
  1772. const strip = new Set()
  1773. const v = this.getCommentVideoUrl(it)
  1774. if (v) strip.add(v)
  1775. const urls = this._urlsEmbeddedInCommentContent(it)
  1776. for (let i = 0; i < urls.length; i++) {
  1777. const u = urls[i]
  1778. if (this._isEmbeddedCommentVideoUrl(u)) strip.add(u)
  1779. else if (this._isEmbeddedCommentImageUrl(u) && u !== v) strip.add(u)
  1780. }
  1781. strip.forEach(u => {
  1782. text = text.split(u).join('')
  1783. })
  1784. return text.replace(/(\r?\n\s*){2,}/g, '\n').replace(/^\s+|\s+$/g, '').trim()
  1785. },
  1786. getCommentVideoUrl(it) {
  1787. if (!it) return ''
  1788. if (it.videoUrl) return it.videoUrl
  1789. if (it.video) return it.video
  1790. if (it.mediaType === 'video' && it.mediaUrl) return it.mediaUrl
  1791. return this._videoUrlFromCommentContent(it)
  1792. },
  1793. getCommentVideoPoster(it) {
  1794. if (!it) return ''
  1795. const raw =
  1796. it.videoCover || it.coverUrl || it.poster || it.thumbnail || ''
  1797. return typeof raw === 'string' ? raw.trim() : String(raw || '').trim()
  1798. },
  1799. commentImageUrls(it) {
  1800. if (!it) return []
  1801. const raw = it.images || it.imageUrl || it.imgUrl || it.picUrl || it.pic
  1802. let fromFields = []
  1803. if (raw) {
  1804. if (Array.isArray(raw)) fromFields = raw.filter(Boolean)
  1805. else fromFields = String(raw).split(',').map(s => s.trim()).filter(Boolean)
  1806. }
  1807. const videoUrl = this.getCommentVideoUrl(it)
  1808. const fromContent = this._urlsEmbeddedInCommentContent(it).filter(u =>
  1809. this._isEmbeddedCommentImageUrl(u) && !this._isEmbeddedCommentVideoUrl(u) && u !== videoUrl
  1810. )
  1811. return [...new Set([...fromFields, ...fromContent])]
  1812. },
  1813. /** 精选留言预览图 / 选图 / 留言内嵌视频播放前:暂停主课视频,避免与原生页或第二条音轨叠放 */
  1814. _pauseCourseVideo() {
  1815. try {
  1816. const ctx =
  1817. this.videoContext ||
  1818. uni.createVideoContext('video-content-box', this)
  1819. this.videoContext = ctx
  1820. if (ctx && ctx.pause) ctx.pause()
  1821. } catch (e) {}
  1822. try {
  1823. if (this.player && this.player.pause) this.player.pause()
  1824. } catch (e2) {}
  1825. },
  1826. /** 精选留言带图/视频上传结束后:若选媒体前主课在播则恢复 */
  1827. _resumeCourseVideoAfterFeaturedJob() {
  1828. if (!this._shouldResumeCourseVideoAfterFeaturedUpload) return
  1829. this._shouldResumeCourseVideoAfterFeaturedUpload = false
  1830. this._courseWasPlayingBeforeFeaturedCommentOpen = false
  1831. if (this.isEnded || !this.videoUrl || !this.videoId) return
  1832. const ctx =
  1833. this.videoContext ||
  1834. uni.createVideoContext('video-content-box', this)
  1835. this.videoContext = ctx
  1836. const tryPlay = () => {
  1837. try {
  1838. if (ctx && ctx.play) ctx.play()
  1839. } catch (e) {}
  1840. }
  1841. this.$nextTick(() => {
  1842. tryPlay()
  1843. setTimeout(tryPlay, 80)
  1844. setTimeout(tryPlay, 260)
  1845. })
  1846. },
  1847. getFeaturedCommentRowKey(it, idx) {
  1848. const id =
  1849. it && it.commentId != null && it.commentId !== ''
  1850. ? String(it.commentId)
  1851. : it && it.id != null
  1852. ? String(it.id)
  1853. : ''
  1854. return 'fc-' + idx + '-' + (id || 'n')
  1855. },
  1856. getFeaturedCommentVideoId(it, idx) {
  1857. return 'feat-comment-video-' + this.getFeaturedCommentRowKey(it, idx)
  1858. },
  1859. openFeaturedCommentMediaPreview(it, listIdx, mode, imageIndex) {
  1860. const m = mode === 'video' ? 'video' : 'image'
  1861. if (m === 'image') {
  1862. const urls = this.commentImageUrls(it).filter(u => u && !/^blob:/i.test(u))
  1863. if (!urls.length) return
  1864. const i = Math.min(
  1865. Math.max(0, Number(imageIndex) || 0),
  1866. urls.length - 1
  1867. )
  1868. this._pauseCourseVideo()
  1869. try {
  1870. if (this.getCommentVideoUrl(it)) {
  1871. const id = this.getFeaturedCommentVideoId(it, listIdx)
  1872. const c = uni.createVideoContext(id, this)
  1873. if (c && c.pause) c.pause()
  1874. }
  1875. } catch (e) {}
  1876. this.featuredCommentMediaPreviewMode = 'image'
  1877. this.featuredCommentMediaPreviewUrls = urls
  1878. this.featuredCommentMediaPreviewIndex = i
  1879. this.featuredCommentMediaPreviewVideoUrl = ''
  1880. this.featuredCommentMediaPreviewPoster = ''
  1881. this.featuredCommentMediaPreviewShow = true
  1882. return
  1883. }
  1884. const vurl = this.getCommentVideoUrl(it)
  1885. if (!vurl) return
  1886. this._pauseCourseVideo()
  1887. try {
  1888. const id = this.getFeaturedCommentVideoId(it, listIdx)
  1889. const c = uni.createVideoContext(id, this)
  1890. if (c && c.pause) c.pause()
  1891. } catch (e) {}
  1892. this.featuredCommentMediaPreviewMode = 'video'
  1893. this.featuredCommentMediaPreviewUrls = []
  1894. this.featuredCommentMediaPreviewIndex = 0
  1895. this.featuredCommentMediaPreviewVideoUrl = vurl
  1896. this.featuredCommentMediaPreviewPoster = this.getCommentVideoPoster(it) || ''
  1897. this.featuredCommentMediaPreviewShow = true
  1898. this._tryPlayFeaturedModalVideo()
  1899. },
  1900. _tryPlayFeaturedModalVideo() {
  1901. if (this.featuredCommentMediaPreviewMode !== 'video' || !this.featuredCommentMediaPreviewVideoUrl) {
  1902. return
  1903. }
  1904. const run = () => {
  1905. try {
  1906. const c = uni.createVideoContext('fc-media-preview-video', this)
  1907. if (c && c.play) c.play()
  1908. } catch (e) {}
  1909. }
  1910. this.$nextTick(() => {
  1911. run()
  1912. setTimeout(run, 100)
  1913. setTimeout(run, 280)
  1914. })
  1915. },
  1916. /** 微信小程序编译不接受 @tap.stop="",需绑定空实现以阻止冒泡到遮罩 */
  1917. featuredCommentPreviewCardTap() {},
  1918. closeFeaturedCommentMediaPreview() {
  1919. if (!this.featuredCommentMediaPreviewShow) return
  1920. try {
  1921. const c = uni.createVideoContext('fc-media-preview-video', this)
  1922. if (c && c.pause) c.pause()
  1923. } catch (e) {}
  1924. this.featuredCommentMediaPreviewShow = false
  1925. this.featuredCommentMediaPreviewUrls = []
  1926. this.featuredCommentMediaPreviewVideoUrl = ''
  1927. this.featuredCommentMediaPreviewPoster = ''
  1928. },
  1929. setFeaturedMediaPreviewIndex(ti) {
  1930. const n = Number(ti)
  1931. if (
  1932. !Number.isFinite(n) ||
  1933. n < 0 ||
  1934. n >= (this.featuredCommentMediaPreviewUrls || []).length
  1935. ) {
  1936. return
  1937. }
  1938. this.featuredCommentMediaPreviewIndex = n
  1939. },
  1940. onFeaturedMediaPreviewModalVideoPlay() {
  1941. this._pauseCourseVideo()
  1942. const list = this.featuredCommentDisplayList || []
  1943. for (let i = 0; i < list.length; i++) {
  1944. const row = list[i]
  1945. if (!this.getCommentVideoUrl(row)) continue
  1946. const vid = this.getFeaturedCommentVideoId(row, i)
  1947. try {
  1948. const c = uni.createVideoContext(vid, this)
  1949. if (c && c.pause) c.pause()
  1950. } catch (e) {}
  1951. }
  1952. },
  1953. _featuredMediaMaxBytes() {
  1954. return 100 * 1024 * 1024
  1955. },
  1956. /** 相册/选中返回的本地路径大小:安卓上 chooseMedia 常给 size=0,getFileInfo 也可能失真,改用 statSync 兜底 */
  1957. _readFeaturedLocalFileSizeBytes(filePath) {
  1958. return new Promise((resolve) => {
  1959. const tryFsStat = () => {
  1960. let n = 0
  1961. // #ifdef MP-WEIXIN
  1962. try {
  1963. const fs = wx.getFileSystemManager && wx.getFileSystemManager()
  1964. if (fs && fs.statSync) {
  1965. const st = fs.statSync(filePath)
  1966. if (st && typeof st.size === 'number' && st.size > 0) n = st.size
  1967. }
  1968. } catch (e) {}
  1969. // #endif
  1970. return n
  1971. }
  1972. if (!filePath || typeof filePath !== 'string') {
  1973. resolve(0)
  1974. return
  1975. }
  1976. uni.getFileInfo({
  1977. filePath,
  1978. success: (fi) => {
  1979. let sz =
  1980. fi && fi.size != null ? Math.floor(Number(fi.size)) : 0
  1981. if (!Number.isFinite(sz) || sz <= 0) sz = tryFsStat()
  1982. resolve(sz)
  1983. },
  1984. fail: () => resolve(tryFsStat())
  1985. })
  1986. })
  1987. },
  1988. _alertFeaturedMediaLimit(content) {
  1989. uni.showModal({
  1990. title: '提示',
  1991. content:
  1992. content ||
  1993. '图片或视频大小不能超过100MB,请压缩或更换后再试。',
  1994. showCancel: false,
  1995. confirmText: '知道了'
  1996. })
  1997. },
  1998. _assertFeaturedLocalMediaUnderMaxBytes(filePath) {
  1999. const max = this._featuredMediaMaxBytes()
  2000. return new Promise((resolve) => {
  2001. if (!filePath || typeof filePath !== 'string') {
  2002. this._alertFeaturedMediaLimit('文件路径无效,请重新选择。')
  2003. resolve(false)
  2004. return
  2005. }
  2006. this._readFeaturedLocalFileSizeBytes(filePath).then((sz) => {
  2007. if (sz <= 0) {
  2008. uni.showToast({
  2009. title: '本地暂无法读取大小,请勿超过100MB',
  2010. icon: 'none',
  2011. duration: 2600
  2012. })
  2013. resolve(true)
  2014. return
  2015. }
  2016. if (sz > max) {
  2017. this._alertFeaturedMediaLimit()
  2018. resolve(false)
  2019. return
  2020. }
  2021. resolve(true)
  2022. })
  2023. })
  2024. },
  2025. _applyFeaturedMediaIfSizeOk(type, path, size, thumbTempPath) {
  2026. const max = this._featuredMediaMaxBytes()
  2027. const applyAccepted = () => {
  2028. this.featuredCommentMedia = {
  2029. type,
  2030. path,
  2031. thumbTempPath: thumbTempPath || ''
  2032. }
  2033. }
  2034. let bytes =
  2035. size != null && Number(size) > 0
  2036. ? Math.floor(Number(size))
  2037. : 0
  2038. if (!Number.isFinite(bytes)) bytes = 0
  2039. const finalize = (n) => {
  2040. if (n > max) {
  2041. this._alertFeaturedMediaLimit()
  2042. return
  2043. }
  2044. applyAccepted()
  2045. }
  2046. if (bytes > 0) {
  2047. finalize(bytes)
  2048. return
  2049. }
  2050. this._readFeaturedLocalFileSizeBytes(path).then(finalize)
  2051. },
  2052. clearFeaturedCommentMedia() {
  2053. this.featuredCommentMedia = null
  2054. this._resumeCourseVideoAfterFeaturedJob()
  2055. },
  2056. /**
  2057. * 竖屏课且仅「精选留言」一个 Tab 时,竖版布局下留言区被隐藏;
  2058. * 切到横版布局(isShu=false),与全屏按钮切换布局一致。
  2059. */
  2060. _expandLayoutIfPortraitFeaturedCommentsOnly() {
  2061. if (this.displayType !== 'portrait') return
  2062. if (!this.isShu) return
  2063. if (!(this.visibleRatingTabCount === 1 && this.showTabFeaturedComments)) return
  2064. this.isShu = false
  2065. this.tabIndex = 0
  2066. },
  2067. /** 避免选图/选视频从原生页返回时 onShow 重复拉课程详情;若未触发 onShow 则在 complete 后兜底清除标志 */
  2068. _armFeaturedMediaPickerOnShowSuppress() {
  2069. this.videovipSuppressOnShowCourseFetchOnce = true
  2070. const clearIfStillArmed = () => {
  2071. setTimeout(() => {
  2072. if (this.videovipSuppressOnShowCourseFetchOnce) {
  2073. this.videovipSuppressOnShowCourseFetchOnce = false
  2074. }
  2075. }, 600)
  2076. }
  2077. return clearIfStillArmed
  2078. },
  2079. onFeaturedPickMedia() {
  2080. this._expandLayoutIfPortraitFeaturedCommentsOnly()
  2081. this.featuredMediaActionSheetShow = true
  2082. },
  2083. closeFeaturedMediaActionSheet() {
  2084. this.featuredMediaActionSheetShow = false
  2085. },
  2086. onFeaturedMediaSheetPick(tapIndex) {
  2087. this.closeFeaturedMediaActionSheet()
  2088. // 立即调起相册/视频会与 u-popup 遮罩关闭叠加,小程序端易残留半透明层;对齐关闭动画后再打开系统选择器
  2089. const afterSheetCloseMs = 350
  2090. setTimeout(() => {
  2091. if (tapIndex === 0) {
  2092. this._shouldResumeCourseVideoAfterFeaturedUpload =
  2093. !this.isEnded &&
  2094. (this.videoPlaying || this._courseWasPlayingBeforeFeaturedCommentOpen)
  2095. this._pauseCourseVideo()
  2096. const clearIfStillArmed = this._armFeaturedMediaPickerOnShowSuppress()
  2097. uni.chooseImage({
  2098. count: 1,
  2099. sizeType: ['compressed', 'original'],
  2100. sourceType: ['album', 'camera'],
  2101. success: (res) => {
  2102. const f0 = res.tempFiles && res.tempFiles[0]
  2103. const path =
  2104. (res.tempFilePaths && res.tempFilePaths[0]) ||
  2105. (f0 && f0.path) ||
  2106. ''
  2107. if (!path) return
  2108. const size = f0 && f0.size != null ? f0.size : 0
  2109. this._applyFeaturedMediaIfSizeOk('image', path, size, '')
  2110. },
  2111. fail: () => {
  2112. // 勿在此处清 suppress:须由 onShow 消费,避免先于 onShow 清标志导致停跑马灯
  2113. this._resumeCourseVideoAfterFeaturedJob()
  2114. },
  2115. complete: clearIfStillArmed
  2116. })
  2117. } else if (tapIndex === 1) {
  2118. this._shouldResumeCourseVideoAfterFeaturedUpload =
  2119. !this.isEnded &&
  2120. (this.videoPlaying || this._courseWasPlayingBeforeFeaturedCommentOpen)
  2121. this._pauseCourseVideo()
  2122. const clearIfStillArmed = this._armFeaturedMediaPickerOnShowSuppress()
  2123. wx.chooseMedia({
  2124. count: 1,
  2125. mediaType: ['video'],
  2126. sourceType: ['album'],
  2127. maxDuration: 30,
  2128. success: (res) => {
  2129. const path = res.tempFiles[0].tempFilePath
  2130. if (!path) return
  2131. const size = res.tempFiles[0].size != null ? res.tempFiles[0].size : 0
  2132. this._applyFeaturedMediaIfSizeOk('video', path, size, res.tempFiles[0].thumbTempFilePath || '')
  2133. },
  2134. fail: (err) => {
  2135. //console.log('huoqu122221212122222222', err)
  2136. // 勿在此处清 suppress:须由 onShow 消费,避免先于 onShow 清标志导致停跑马灯
  2137. this._resumeCourseVideoAfterFeaturedJob()
  2138. },
  2139. complete: clearIfStillArmed
  2140. })
  2141. }
  2142. }, afterSheetCloseMs)
  2143. },
  2144. async submitFeaturedComment() {
  2145. const raw = this.featuredCommentInput || ''
  2146. const text = raw.trim()
  2147. if (raw.length > 50) {
  2148. uni.showToast({
  2149. title: '留言不能超过50个字',
  2150. icon: 'none'
  2151. })
  2152. this._resumeCourseVideoAfterFeaturedJob()
  2153. return
  2154. }
  2155. const media = this.featuredCommentMedia
  2156. const hasMedia = !!(media && media.path)
  2157. if (!text && !hasMedia) {
  2158. uni.showToast({
  2159. title: '请输入留言或选择图片/视频',
  2160. icon: 'none'
  2161. })
  2162. return
  2163. }
  2164. const u = this._resolveUserInfoObj()
  2165. const userId = u.userId || ''
  2166. if (!userId) {
  2167. uni.showToast({
  2168. title: '请先登录',
  2169. icon: 'none'
  2170. })
  2171. this._resumeCourseVideoAfterFeaturedJob()
  2172. return
  2173. }
  2174. if (this.featuredCommentSending) return
  2175. if (hasMedia && media.path) {
  2176. const ok = await this._assertFeaturedLocalMediaUnderMaxBytes(media.path)
  2177. if (!ok) {
  2178. this._resumeCourseVideoAfterFeaturedJob()
  2179. return
  2180. }
  2181. }
  2182. this.featuredCommentSending = true
  2183. const done = (res) => {
  2184. this.featuredCommentSending = false
  2185. if (res.code == 200) {
  2186. this.featuredCommentInput = ''
  2187. this.featuredCommentMedia = null
  2188. this._closeFeaturedCommentComposerUi()
  2189. uni.showToast({
  2190. title: '发送成功',
  2191. icon: 'none'
  2192. })
  2193. this.loadFeaturedComments({
  2194. scrollToBottom: true
  2195. })
  2196. } else {
  2197. uni.showToast({
  2198. title: res.msg || '发送失败',
  2199. icon: 'none'
  2200. })
  2201. }
  2202. }
  2203. const fail = (err) => {
  2204. this.featuredCommentSending = false
  2205. const msg = err && err.message ? err.message : '网络异常,请重试'
  2206. uni.showToast({
  2207. title: msg,
  2208. icon: 'none'
  2209. })
  2210. }
  2211. const payload = {
  2212. toUserId: userId,
  2213. courseId: this.courseId,
  2214. videoId: this.videoId,
  2215. type: 1,
  2216. content: text
  2217. }
  2218. if (hasMedia) {
  2219. if (media.type === 'video') {
  2220. payload.videoFiles = media.path
  2221. } else {
  2222. payload.imageFiles = media.path
  2223. }
  2224. }
  2225. uni.showLoading({
  2226. title: '发布中',
  2227. mask: true
  2228. })
  2229. addCommentWithMedia(payload)
  2230. .then((res) => {
  2231. uni.hideLoading()
  2232. done(res)
  2233. })
  2234. .catch((err) => {
  2235. uni.hideLoading()
  2236. fail(err)
  2237. })
  2238. .finally(() => {
  2239. // 与 hideLoading、列表刷新错开一帧,避免部分机型上 play 被吞
  2240. this.$nextTick(() => {
  2241. setTimeout(() => {
  2242. this._resumeCourseVideoAfterFeaturedJob()
  2243. }, 60)
  2244. })
  2245. })
  2246. },
  2247. _vipTimeStrToSec(timeStr) {
  2248. if (!timeStr || typeof timeStr !== 'string') return 0
  2249. const parts = timeStr.split(':')
  2250. if (parts.length !== 3) return 0
  2251. const h = parseInt(parts[0], 10) || 0
  2252. const m = parseInt(parts[1], 10) || 0
  2253. const s = parseInt(parts[2], 10) || 0
  2254. return h * 3600 + m * 60 + s
  2255. },
  2256. _vipShelfTimeValid(timeStr) {
  2257. if (!timeStr || typeof timeStr !== 'string') return false
  2258. if (timeStr === '00:00:00') return false
  2259. return this._vipTimeStrToSec(timeStr) > 0
  2260. },
  2261. /** 缓存下单时间戳(videovip_myPurchase_*)序列化后可能为字符串,统一为毫秒数 */
  2262. _normalizePurchaseTs(ts) {
  2263. if (ts == null || ts === '') return 0
  2264. const n = typeof ts === 'number' ? ts : Number(ts)
  2265. return Number.isFinite(n) && n > 0 ? n : 0
  2266. },
  2267. _readVipSelfPurchaseTsMs() {
  2268. const row = uni.getStorageSync('videovip_myPurchase_' + this.videoId)
  2269. return this._normalizePurchaseTs(row && row.ts)
  2270. },
  2271. refreshVipPurchaseMarqueeFlag() {
  2272. const key = 'videovip_myPurchase_' + this.videoId
  2273. const consumedKey = 'videovip_myPurchaseMarqueeConsumed_' + this.videoId
  2274. const row = uni.getStorageSync(key)
  2275. const consumed = uni.getStorageSync(consumedKey)
  2276. const tsMs = this._normalizePurchaseTs(row && row.ts)
  2277. if (tsMs && Date.now() - tsMs <= 10 * 60 * 1000) {
  2278. // 同一笔下单 ts 仅允许跑马灯展示一次;中途退出再进不再展示(新下单 ts 变化后会再展示一次)
  2279. const consumedTs = this._normalizePurchaseTs(consumed && consumed.ts)
  2280. this.pendingSelfMarqueeFirst = !(consumedTs > 0 && consumedTs === tsMs)
  2281. } else {
  2282. this.pendingSelfMarqueeFirst = false
  2283. if (row && row.ts != null && row.ts !== '') {
  2284. uni.removeStorageSync(key)
  2285. const consumedTs = this._normalizePurchaseTs(consumed && consumed.ts)
  2286. if (consumedTs > 0 && consumedTs === tsMs) uni.removeStorageSync(consumedKey)
  2287. }
  2288. }
  2289. },
  2290. _markSelfPurchaseMarqueeConsumed() {
  2291. const tsMs = this._readVipSelfPurchaseTsMs()
  2292. if (!tsMs) return
  2293. try {
  2294. uni.setStorageSync('videovip_myPurchaseMarqueeConsumed_' + this.videoId, { ts: tsMs })
  2295. } catch (e) {}
  2296. },
  2297. formatSelfPurchaseMarqueePayload() {
  2298. const tsMs = this._readVipSelfPurchaseTsMs()
  2299. if (!tsMs) {
  2300. return {
  2301. type: 'self',
  2302. nickname: '您本人',
  2303. maskedId: '',
  2304. timeOffset: '刚刚',
  2305. suffix: '已下单',
  2306. fullText: '您本人刚刚已下单'
  2307. }
  2308. }
  2309. const secTotal = Math.floor((Date.now() - tsMs) / 1000)
  2310. if (secTotal < 60) {
  2311. const text = `${Math.max(1, secTotal)}秒前`
  2312. return {
  2313. type: 'self',
  2314. nickname: '您本人',
  2315. maskedId: '',
  2316. timeOffset: text,
  2317. suffix: '已下单',
  2318. fullText: `您本人${text}已下单`
  2319. }
  2320. }
  2321. const min = Math.min(10, Math.floor(secTotal / 60))
  2322. const text = `${Math.max(1, min)}分钟前`
  2323. return {
  2324. type: 'self',
  2325. nickname: '您本人',
  2326. maskedId: '',
  2327. timeOffset: text,
  2328. suffix: '已下单',
  2329. fullText: `您本人${text}已下单`
  2330. }
  2331. },
  2332. _syncFakeMarqueeIfEligibleChanged() {
  2333. const val = this.fakeMarqueeEligible
  2334. if (val === this._fakeMarqueeEligiblePrev) return
  2335. this._fakeMarqueeEligiblePrev = val
  2336. if (val) {
  2337. if (this._marqueeStartDebounceTimer) {
  2338. clearTimeout(this._marqueeStartDebounceTimer)
  2339. this._marqueeStartDebounceTimer = null
  2340. }
  2341. this._marqueeStartDebounceTimer = setTimeout(() => {
  2342. this._marqueeStartDebounceTimer = null
  2343. if (this.fakeMarqueeEligible && !this._fakeMarqueeStarted) {
  2344. this.ensureFakeMarqueeStarted()
  2345. }
  2346. }, 300)
  2347. } else {
  2348. if (this._marqueeStartDebounceTimer) {
  2349. clearTimeout(this._marqueeStartDebounceTimer)
  2350. this._marqueeStartDebounceTimer = null
  2351. }
  2352. this.stopFakeMarqueeLoop()
  2353. }
  2354. },
  2355. ensureFakeMarqueeStarted() {
  2356. if (!this.fakeMarqueeEligible || this._fakeMarqueeStarted) return
  2357. this._fakeMarqueeStarted = true
  2358. if (!this.fakeOrderPool.length) {
  2359. this.fakeOrderPool = buildFakeOrderPool()
  2360. }
  2361. this.applyFakeMarqueeTick()
  2362. this.scheduleFakeMarqueeNext()
  2363. this._startSelfMarqueeClockIfNeeded()
  2364. },
  2365. applyFakeMarqueeTick() {
  2366. if (this.isTripleMarqueeMode) {
  2367. const rows = this.buildTripleMarqueePayloads()
  2368. this.setTripleMarqueeDisplayWithAnim(rows)
  2369. // 本人下单在三联模式也只展示一轮,下一轮起恢复纯虚拟随机
  2370. if (rows.some(item => item && item.type === 'self')) {
  2371. this.pendingSelfMarqueeFirst = false
  2372. this._markSelfPurchaseMarqueeConsumed()
  2373. }
  2374. if (rows.length) {
  2375. this.marqueeDisplayPayload = rows[0]
  2376. this.marqueeDisplaySelf = this.marqueeDisplayPayload.type === 'self'
  2377. }
  2378. return
  2379. }
  2380. this.marqueeTriplePayloads = []
  2381. this.marqueeTripleIncomingPayloads = []
  2382. this.marqueeTripleSwitching = false
  2383. const tsMs = this._readVipSelfPurchaseTsMs()
  2384. const purchaseOk = !!(tsMs && Date.now() - tsMs <= 10 * 60 * 1000)
  2385. if (purchaseOk && this.pendingSelfMarqueeFirst) {
  2386. const selfPayload = this.formatSelfPurchaseMarqueePayload()
  2387. this.marqueeCurrentText = selfPayload.fullText
  2388. this.marqueeSelfHighlight = true
  2389. this.pendingSelfMarqueeFirst = false
  2390. this._markSelfPurchaseMarqueeConsumed()
  2391. this.setMarqueeDisplayWithAnim(selfPayload, true)
  2392. return
  2393. }
  2394. this.marqueeSelfHighlight = false
  2395. if (!this.fakeOrderPool.length) {
  2396. this.fakeOrderPool = buildFakeOrderPool()
  2397. }
  2398. const line = this.fakeOrderPool.shift()
  2399. if (line) {
  2400. this.fakeOrderPool.push(line)
  2401. this.marqueeCurrentText = `${line.nickname}${line.maskedId}${line.timeOffset}${line.suffix}`
  2402. this.setMarqueeDisplayWithAnim({
  2403. type: 'virtual',
  2404. nickname: line.nickname,
  2405. maskedId: line.maskedId,
  2406. timeOffset: line.timeOffset,
  2407. suffix: line.suffix
  2408. }, false)
  2409. }
  2410. },
  2411. buildTripleMarqueePayloads() {
  2412. const rows = []
  2413. const hasSelf = this.hasRecentSelfPurchase() && this.pendingSelfMarqueeFirst
  2414. if (!this.fakeOrderPool.length) {
  2415. this.fakeOrderPool = buildFakeOrderPool()
  2416. }
  2417. let guard = 0
  2418. // 有本人记录时,把本人下单放第一条,其它再补足虚拟数据
  2419. if (hasSelf) {
  2420. rows.push(this.formatSelfPurchaseMarqueePayload())
  2421. }
  2422. const targetVirtualCount = hasSelf ? 2 : 3
  2423. let virtualCount = 0
  2424. while (virtualCount < targetVirtualCount && this.fakeOrderPool.length && guard < 10) {
  2425. const line = this.fakeOrderPool.shift()
  2426. guard += 1
  2427. if (!line) break
  2428. this.fakeOrderPool.push(line)
  2429. rows.push({
  2430. type: 'virtual',
  2431. nickname: line.nickname,
  2432. maskedId: line.maskedId,
  2433. timeOffset: line.timeOffset,
  2434. suffix: line.suffix
  2435. })
  2436. virtualCount += 1
  2437. }
  2438. return rows.slice(0, 3)
  2439. },
  2440. hasRecentSelfPurchase() {
  2441. const tsMs = this._readVipSelfPurchaseTsMs()
  2442. return !!(tsMs && Date.now() - tsMs <= 10 * 60 * 1000)
  2443. },
  2444. /** 按缓存 ts 与当前时间重新计算本人下单文案(停留同一轮跑马灯时也能更新相对时间) */
  2445. refreshSelfPurchaseMarqueeDisplayedTiming() {
  2446. const fresh = this.formatSelfPurchaseMarqueePayload()
  2447. if (this.isTripleMarqueeMode && this.marqueeTriplePayloads.length) {
  2448. const upd = (arr) =>
  2449. arr.map((r) => (r && r.type === 'self' ? Object.assign({}, fresh) : r))
  2450. this.marqueeTriplePayloads = upd(this.marqueeTriplePayloads)
  2451. if (this.marqueeTripleIncomingPayloads.length) {
  2452. this.marqueeTripleIncomingPayloads = upd(this.marqueeTripleIncomingPayloads)
  2453. }
  2454. }
  2455. if (this.marqueeDisplayPayload && this.marqueeDisplayPayload.type === 'self') {
  2456. this.marqueeDisplayPayload = Object.assign({}, fresh)
  2457. }
  2458. if (this.marqueeIncomingPayload && this.marqueeIncomingPayload.type === 'self') {
  2459. this.marqueeIncomingPayload = Object.assign({}, fresh)
  2460. }
  2461. },
  2462. _startSelfMarqueeClockIfNeeded() {
  2463. if (this._selfMarqueeClockTimer != null) return
  2464. if (!this.hasRecentSelfPurchase()) return
  2465. this._selfMarqueeClockTimer = setInterval(() => {
  2466. if (!this._fakeMarqueeStarted || !this.hasRecentSelfPurchase()) {
  2467. this._stopSelfMarqueeClock()
  2468. return
  2469. }
  2470. this.refreshSelfPurchaseMarqueeDisplayedTiming()
  2471. }, 10000)
  2472. },
  2473. _stopSelfMarqueeClock() {
  2474. if (this._selfMarqueeClockTimer != null) {
  2475. clearInterval(this._selfMarqueeClockTimer)
  2476. this._selfMarqueeClockTimer = null
  2477. }
  2478. },
  2479. /** 进入三联布局时立即补足 marqueeTriplePayloads,否则 v-if 会因 length 为 0 仍走单条分支直到下一轮定时 tick */
  2480. syncTripleMarqueeImmediate() {
  2481. if (!this.fakeMarqueeEligible || !this._fakeMarqueeStarted || !this.isTripleMarqueeMode) return
  2482. const rows = this.buildTripleMarqueePayloads()
  2483. if (!rows.length) return
  2484. this.setTripleMarqueeDisplayWithAnim(rows)
  2485. if (rows.some(item => item && item.type === 'self')) {
  2486. this.pendingSelfMarqueeFirst = false
  2487. this._markSelfPurchaseMarqueeConsumed()
  2488. }
  2489. if (rows[0]) {
  2490. this.marqueeDisplayPayload = rows[0]
  2491. this.marqueeDisplaySelf = rows[0].type === 'self'
  2492. }
  2493. },
  2494. setTripleMarqueeDisplayWithAnim(rows) {
  2495. if (!rows || !rows.length) return
  2496. if (!this.marqueeTriplePayloads.length) {
  2497. this.marqueeTriplePayloads = rows
  2498. this.marqueeTripleIncomingPayloads = []
  2499. this.marqueeTripleSwitching = false
  2500. return
  2501. }
  2502. if (this._marqueeTripleSwitchTimer) {
  2503. clearTimeout(this._marqueeTripleSwitchTimer)
  2504. this._marqueeTripleSwitchTimer = null
  2505. }
  2506. this.marqueeTripleIncomingPayloads = rows
  2507. this.marqueeTripleSwitching = true
  2508. this._marqueeTripleSwitchTimer = setTimeout(() => {
  2509. this.marqueeTriplePayloads = this.marqueeTripleIncomingPayloads
  2510. this.marqueeTripleIncomingPayloads = []
  2511. this.marqueeTripleSwitching = false
  2512. this._marqueeTripleSwitchTimer = null
  2513. }, 460)
  2514. },
  2515. setMarqueeDisplayWithAnim(payload, isSelf) {
  2516. if (!payload) return
  2517. if (!this.marqueeDisplayPayload) {
  2518. this.marqueeDisplayPayload = payload
  2519. this.marqueeDisplaySelf = !!isSelf
  2520. this.marqueeSwitching = false
  2521. this.marqueeIncomingPayload = null
  2522. this.marqueeIncomingSelf = false
  2523. return
  2524. }
  2525. if (this._marqueeSwitchTimer) {
  2526. clearTimeout(this._marqueeSwitchTimer)
  2527. this._marqueeSwitchTimer = null
  2528. }
  2529. this.marqueeIncomingPayload = payload
  2530. this.marqueeIncomingSelf = !!isSelf
  2531. this.marqueeSwitching = true
  2532. this._marqueeSwitchTimer = setTimeout(() => {
  2533. this.marqueeDisplayPayload = this.marqueeIncomingPayload
  2534. this.marqueeDisplaySelf = this.marqueeIncomingSelf
  2535. this.marqueeIncomingPayload = null
  2536. this.marqueeIncomingSelf = false
  2537. this.marqueeSwitching = false
  2538. this._marqueeSwitchTimer = null
  2539. }, 460)
  2540. },
  2541. scheduleFakeMarqueeNext() {
  2542. if (this._fakeMarqueeTimer) {
  2543. clearTimeout(this._fakeMarqueeTimer)
  2544. this._fakeMarqueeTimer = null
  2545. }
  2546. const delay = 4000 + Math.floor(Math.random() * 3001)
  2547. this._fakeMarqueeTimer = setTimeout(() => {
  2548. this._fakeMarqueeTimer = null
  2549. if (!this.fakeMarqueeEligible || !this._fakeMarqueeStarted) return
  2550. this.applyFakeMarqueeTick()
  2551. this.scheduleFakeMarqueeNext()
  2552. }, delay)
  2553. },
  2554. stopFakeMarqueeLoop() {
  2555. if (this._marqueeStartDebounceTimer) {
  2556. clearTimeout(this._marqueeStartDebounceTimer)
  2557. this._marqueeStartDebounceTimer = null
  2558. }
  2559. if (this._fakeMarqueeTimer) {
  2560. clearTimeout(this._fakeMarqueeTimer)
  2561. this._fakeMarqueeTimer = null
  2562. }
  2563. if (this._marqueeSwitchTimer) {
  2564. clearTimeout(this._marqueeSwitchTimer)
  2565. this._marqueeSwitchTimer = null
  2566. }
  2567. if (this._marqueeTripleSwitchTimer) {
  2568. clearTimeout(this._marqueeTripleSwitchTimer)
  2569. this._marqueeTripleSwitchTimer = null
  2570. }
  2571. this._fakeMarqueeStarted = false
  2572. this.marqueeSwitching = false
  2573. // 重要:清空非三联跑马灯展示 payload,避免下一次门禁打开前渲染旧内容
  2574. this.marqueeDisplayPayload = null
  2575. this.marqueeDisplaySelf = false
  2576. this.marqueeCurrentText = ''
  2577. this.marqueeSelfHighlight = false
  2578. this.marqueeIncomingPayload = null
  2579. this.marqueeIncomingSelf = false
  2580. this.marqueeTriplePayloads = []
  2581. this.marqueeTripleIncomingPayloads = []
  2582. this.marqueeTripleSwitching = false
  2583. this._stopSelfMarqueeClock()
  2584. },
  2585. goRate(index){
  2586. this.aindex = index
  2587. if (this._rateBounceTimer) {
  2588. clearTimeout(this._rateBounceTimer)
  2589. this._rateBounceTimer = null
  2590. }
  2591. this.rateBounceIndex = null
  2592. this.$nextTick(() => {
  2593. this.rateBounceIndex = index
  2594. this._rateBounceTimer = setTimeout(() => {
  2595. this.rateBounceIndex = null
  2596. this._rateBounceTimer = null
  2597. }, 480)
  2598. })
  2599. },
  2600. onVideoMetaLoaded(e) {
  2601. // const width = e.detail.width;
  2602. // const height = e.detail.height;
  2603. // const res = uni.getSystemInfoSync();
  2604. // const winH = res.windowHeight;
  2605. // const winW = res.windowWidth;
  2606. // //横屏
  2607. // const wW = (winW / winH) * 100;
  2608. // console.log(winH,winW,'高度')
  2609. // console.log(winH,winW,'高度')
  2610. // //竖屏
  2611. // if (height < width) {
  2612. // this.isHeight = true
  2613. // }
  2614. },
  2615. // 获取视频容器高度
  2616. getVideoContainerHeight() {
  2617. const { windowWidth, windowHeight } = uni.getSystemInfoSync();
  2618. this.isHeight = windowWidth > windowHeight;
  2619. console.log('当前是否横屏:', this.isHeight);
  2620. },
  2621. fullscreenchange(event){
  2622. const isFullScreen = !!(event && event.detail && event.detail.fullScreen);
  2623. this.isFull = event.detail.fullScreen;
  2624. //this.getVideoContainerHeight();
  2625. //console.log(this.isFull,'this.isFull ')
  2626. // 竖屏课程下:把全屏按钮当作布局切换按钮,禁止原生全屏停留
  2627. if (this.displayType === 'portrait') {
  2628. if (event && event.stopPropagation) event.stopPropagation();
  2629. if (event && event.preventDefault) event.preventDefault();
  2630. // 只在“进入全屏”时切换,避免 exitFullScreen 触发的 false 事件二次反转
  2631. if (!isFullScreen || this.fullscreenToggleLock) return;
  2632. this.fullscreenToggleLock = true;
  2633. // const wasShu = this.isShu
  2634. this.isShu = !this.isShu
  2635. // if (wasShu && this.showTabReviewPoints) this.tabIndex = 0
  2636. // 先让布局切换完成,再退出原生全屏,减少抖动闪频
  2637. setTimeout(() => {
  2638. if (this.videoContext && this.videoContext.exitFullScreen) {
  2639. this.videoContext.exitFullScreen();
  2640. }
  2641. this.isFull = false;
  2642. this.fullscreenToggleTimer = setTimeout(() => {
  2643. this.fullscreenToggleLock = false;
  2644. this.fullscreenToggleTimer = null;
  2645. }, 220);
  2646. }, 40);
  2647. //console.log(this.isFull,'this.isFull111 ')
  2648. }
  2649. },
  2650. //购物车
  2651. showCart(){
  2652. ///console.log("[---]")
  2653. this.isCart=true
  2654. },
  2655. showMore(){
  2656. ///console.log("[---]")
  2657. this.isMore=true
  2658. },
  2659. closeShop() {
  2660. this.isCart = false;
  2661. },
  2662. closeMore() {
  2663. this.isMore = false;
  2664. },
  2665. navgetTo(url){
  2666. uni.navigateTo({
  2667. url: url
  2668. });
  2669. },
  2670. openList(){
  2671. const wasShu = this.isShu
  2672. this.isShu = !this.isShu
  2673. if (wasShu && this.showTabFeaturedComments) this.tabIndex = 0
  2674. },
  2675. // 倒计时格式化函数
  2676. formatCountdown(seconds) {
  2677. const totalSeconds = Math.max(0, Math.floor(Number(seconds) || 0));
  2678. const hours = Math.floor(totalSeconds / 3600);
  2679. const remainingAfterHours = totalSeconds % 3600;
  2680. const minutes = Math.floor(remainingAfterHours / 60);
  2681. const secs = remainingAfterHours % 60;
  2682. return {
  2683. hours: this.padZero(hours),
  2684. minutes: this.padZero(minutes),
  2685. seconds: this.padZero(secs),
  2686. total: totalSeconds
  2687. };
  2688. },
  2689. getCountdownPercentage() {
  2690. const total = Number(this.totalRemainTime) || 0;
  2691. if (!total) return 0;
  2692. const remain = Math.max(0, Number(this.remainTime) || 0);
  2693. const watched = Math.max(0, total - remain);
  2694. const percentage = (watched / total) * 100;
  2695. return Math.min(100, Math.max(0, Number(percentage.toFixed(2))));
  2696. },
  2697. // 补零函数
  2698. padZero(num) {
  2699. return num < 10 ? `0${num}` : num.toString();
  2700. },
  2701. // 启动完课积分倒计时(仅在播放时递减)
  2702. startCountdown() {
  2703. if (this.remainTime <= 0 || this.countdownTimer) return;
  2704. this.countdownTimer = setInterval(() => {
  2705. if (this.remainTime > 0) {
  2706. this.remainTime--;
  2707. }
  2708. if (this.remainTime <= 0 && this.countdownTimer) {
  2709. clearInterval(this.countdownTimer);
  2710. this.countdownTimer = null;
  2711. if (!this.hasReportedAfterCountdown) {
  2712. this.hasReportedAfterCountdown = true;
  2713. this.getFinishCourseVideo();
  2714. this.getInternetTraffic();
  2715. }
  2716. }
  2717. }, 1000);
  2718. },
  2719. // 停止完课积分倒计时(暂停/离开页面时调用)
  2720. stopCountdown() {
  2721. if (this.countdownTimer) {
  2722. clearInterval(this.countdownTimer);
  2723. this.countdownTimer = null;
  2724. }
  2725. },
  2726. //剩余时间
  2727. getRemainTime(userId) {
  2728. var data = {
  2729. "videoId": this.videoId,
  2730. "fsUserId": userId,
  2731. "courseId": this.courseId,
  2732. "projectId":this.projectId,
  2733. "periodId":this.periodId,
  2734. "companyUserId": this.companyUserId
  2735. }
  2736. getRemainTime(data).then(res => {
  2737. if (res.code == 200) {
  2738. const remain = Number(res.remainTime) || 0; // 积分看课剩余时间(秒)
  2739. this.remainTime = remain;
  2740. this.remainTimeReady = true;
  2741. this.hasReportedAfterCountdown = remain <= 0;
  2742. // 初始化或刷新总时长,用于进度条百分比
  2743. if (!this.totalRemainTime || remain > this.totalRemainTime) {
  2744. this.totalRemainTime = remain;
  2745. }
  2746. } else {
  2747. this.remainTimeReady = false
  2748. uni.showToast({
  2749. icon: 'none',
  2750. title: res.msg,
  2751. });
  2752. }
  2753. })
  2754. },
  2755. getWebviewUrl() {
  2756. var data = {
  2757. key: 'course.config'
  2758. }
  2759. getConfigByKey(data).then(res => {
  2760. if (res.code == 200) {
  2761. console.log("getConfigByKey====", JSON.parse(res.data))
  2762. let data = JSON.parse(res.data)
  2763. this.notice = data.camelCase
  2764. uni.setStorageSync('setWebviewUrl', data.userCourseAuthDomain)
  2765. } else {
  2766. uni.showToast({
  2767. icon: 'none',
  2768. title: res.msg,
  2769. });
  2770. }
  2771. })
  2772. },
  2773. tabChange(type) {
  2774. this.currentId = type
  2775. },
  2776. goLogin(data) {
  2777. if (data) {
  2778. console.log('huoqu1222', data)
  2779. uni.showLoading({
  2780. title: '加载中'
  2781. })
  2782. uni.login({
  2783. provider: "weixin",
  2784. success: async loginRes => {
  2785. //uni.setStorageSync('loginRes',loginRes)
  2786. let code = loginRes.code // 获取开发code
  2787. handleFsUserWx({
  2788. code: code,
  2789. appId: this.appid,
  2790. userId: data.userId
  2791. })
  2792. .then(res => {
  2793. if (res.code == 200) {
  2794. console.log(res)
  2795. uni.hideLoading();
  2796. uni.showToast({
  2797. icon: 'none',
  2798. title: "登录成功",
  2799. });
  2800. this.userinfos = uni.getStorageSync('userinfos')
  2801. uni.getStorageSync('TOKEN_WEXIN');
  2802. this.userInfo = uni.getStorageSync('userInfo');
  2803. this.isLogin = true
  2804. setTimeout(() => {
  2805. this.getIsAddKf()
  2806. //this.getMp()
  2807. }, 200)
  2808. } else if (res.code == 406) {
  2809. uni.hideLoading();
  2810. uni.showToast({
  2811. icon: 'none',
  2812. title: '该用户已成为其他销售会员',
  2813. });
  2814. } else {
  2815. uni.hideLoading();
  2816. uni.showToast({
  2817. icon: 'none',
  2818. title: res.msg,
  2819. });
  2820. }
  2821. })
  2822. },
  2823. })
  2824. } else {
  2825. uni.navigateTo({
  2826. url: '/pages_course/webview?H5course=' + uni.getStorageSync('H5course')
  2827. })
  2828. }
  2829. },
  2830. shouquan() {
  2831. if (this.userinfos.nickname == '') {
  2832. uni.showToast({
  2833. icon: 'none',
  2834. title: "请先授权微信昵称",
  2835. });
  2836. }
  2837. },
  2838. confimrname() {
  2839. if (this.userinfos.nickname == '') {
  2840. uni.showToast({
  2841. icon: 'none',
  2842. title: "请授权微信昵称",
  2843. });
  2844. return
  2845. }
  2846. if (this.userinfos.avatar == '') {
  2847. uni.showToast({
  2848. icon: 'none',
  2849. title: "请授权微信头像",
  2850. });
  2851. return
  2852. }
  2853. uni.setStorageSync('userInfos', this.userinfos)
  2854. this.editUserA()
  2855. this.userlogo = false
  2856. },
  2857. onChooseAvatar(e) {
  2858. this.userinfos.avatar = e.detail.avatarUrl
  2859. uni.uploadFile({
  2860. url: uni.getStorageSync('requestPath') + '/app/common/uploadOSS', //仅为示例,非真实的接口地址
  2861. filePath: e.detail.avatarUrl,
  2862. name: 'file',
  2863. formData: {
  2864. 'user': 'test' // 上传附带参数
  2865. },
  2866. success: (uploadFileRes) => {
  2867. console.log(uploadFileRes)
  2868. // 根据接口具体返回格式 赋值具体对应url
  2869. var data = JSON.parse(uploadFileRes.data)
  2870. this.headImg = uni.getStorageSync('requestPath') + data.fileName
  2871. this.userinfos.avatar = data.url
  2872. }
  2873. });
  2874. },
  2875. onNickNameInput(e) {
  2876. console.log(e)
  2877. this.userinfos.nickname = e.detail.value
  2878. },
  2879. kefpop() {
  2880. if (this.appToken) {
  2881. this.kfPopup == false
  2882. }
  2883. },
  2884. tosales() {
  2885. uni.switchTab({
  2886. url: "/pages/index/index"
  2887. })
  2888. },
  2889. closepop() {
  2890. this.answerPopup = false
  2891. },
  2892. open() {
  2893. },
  2894. userInfologin(e) {
  2895. console.log(e)
  2896. this.userdisabled = true
  2897. uni.showLoading({
  2898. title: "处理中..."
  2899. });
  2900. if (e.mp.detail.errMsg == 'getUserInfo:ok') {
  2901. this.utils.getProvider()
  2902. .then(provider => {
  2903. if (!provider) {
  2904. this.userdisabled = false
  2905. reject()
  2906. }
  2907. // uni登录
  2908. uni.login({
  2909. provider: provider,
  2910. success: async loginRes => {
  2911. console.log(loginRes)
  2912. console.log(e)
  2913. let code = loginRes.code // 获取开发code
  2914. this.userinfos = uni.getStorageSync('userInfos') ? uni.getStorageSync(
  2915. 'userInfos') : this.userinfos
  2916. loginByMiniApp({
  2917. encryptedData: e.mp.detail.encryptedData,
  2918. iv: e.mp.detail.iv,
  2919. code: code,
  2920. companyId: this.companyId || '',
  2921. companyUserId: this.companyUserId || 0,
  2922. nickname: this.userinfos.nickname || '',
  2923. avatar: this.userinfos.avatar || '',
  2924. authType: this.authType,
  2925. appId: this.appid,
  2926. projectId: this.projectId
  2927. })
  2928. .then(res => {
  2929. this.userdisabled = false
  2930. if (res.code == 200) {
  2931. console.log(res)
  2932. uni.hideLoading();
  2933. uni.showToast({
  2934. icon: 'none',
  2935. title: "登录成功",
  2936. });
  2937. uni.setStorageSync('TOKEN_WEXIN', res.token);
  2938. uni.setStorageSync('userInfo', JSON.stringify(res
  2939. .user));
  2940. this.userInfo = res.user;
  2941. uni.hideLoading()
  2942. // this.checkUserInfoA()
  2943. this.isLogin = true
  2944. setTimeout(() => {
  2945. this.getIsAddKf()
  2946. }, 200)
  2947. } else if (res.code == 406) {
  2948. uni.hideLoading();
  2949. uni.showToast({
  2950. icon: 'none',
  2951. title: '该用户已成为其他销售会员',
  2952. });
  2953. } else {
  2954. uni.hideLoading();
  2955. uni.showToast({
  2956. icon: 'none',
  2957. title: res.msg,
  2958. });
  2959. }
  2960. })
  2961. .catch(res => {
  2962. this.userdisabled = false
  2963. })
  2964. },
  2965. fail() {
  2966. this.userdisabled = false
  2967. }
  2968. })
  2969. })
  2970. .catch(err => {
  2971. this.userdisabled = false
  2972. uni.showToast({
  2973. icon: 'none',
  2974. title: err,
  2975. });
  2976. })
  2977. } else {
  2978. this.userdisabled = false
  2979. uni.showToast({
  2980. title: '已拒绝授权',
  2981. icon: 'none',
  2982. duration: 2000,
  2983. })
  2984. }
  2985. },
  2986. phoneLogin(e) {
  2987. console.log(e)
  2988. this.userdisabled = false
  2989. uni.showLoading({
  2990. title: "处理中..."
  2991. });
  2992. if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
  2993. this.utils.getProvider()
  2994. .then(provider => {
  2995. if (!provider) {
  2996. this.userdisabled = false
  2997. reject()
  2998. }
  2999. // uni登录
  3000. uni.login({
  3001. provider: provider,
  3002. success: async loginRes => {
  3003. this.userdisabled = false
  3004. console.log(loginRes)
  3005. console.log(e)
  3006. let code = loginRes.code // 获取开发code
  3007. this.userinfos = uni.getStorageSync('userInfos') ? uni.getStorageSync(
  3008. 'userInfos') : this.userinfos
  3009. loginByMiniApp({
  3010. encryptedData: e.mp.detail.encryptedData,
  3011. iv: e.mp.detail.iv,
  3012. code: code,
  3013. companyId: this.companyId || '',
  3014. companyUserId: this.companyUserId || 0,
  3015. nickname: this.userinfos.nickname || '',
  3016. avatar: this.userinfos.avatar || "",
  3017. authType: this.authType,
  3018. appId: this.appid,
  3019. projectId: this.projectId
  3020. })
  3021. .then(res => {
  3022. this.userdisabled = false
  3023. if (res.code == 200) {
  3024. console.log(res)
  3025. uni.hideLoading();
  3026. uni.showToast({
  3027. icon: 'none',
  3028. title: "登录成功",
  3029. });
  3030. uni.setStorageSync('TOKEN_WEXIN', res.token);
  3031. uni.setStorageSync('userInfo', JSON.stringify(res
  3032. .user));
  3033. this.userInfo = res.user;
  3034. uni.hideLoading()
  3035. this.checkUserInfoA()
  3036. // this.isLogin = true
  3037. // setTimeout(()=>{
  3038. // this.getIsAddKf()
  3039. // },200)
  3040. } else if (res.code == 406) {
  3041. uni.hideLoading();
  3042. uni.showToast({
  3043. icon: 'none',
  3044. title: '该用户已成为其他销售会员',
  3045. });
  3046. } else {
  3047. uni.hideLoading();
  3048. uni.showToast({
  3049. icon: 'none',
  3050. title: res.msg,
  3051. });
  3052. }
  3053. })
  3054. .catch(res => {
  3055. this.userdisabled = false
  3056. })
  3057. },
  3058. fail() {
  3059. this.userdisabled = false
  3060. }
  3061. })
  3062. })
  3063. .catch(err => {
  3064. this.userdisabled = false
  3065. uni.showToast({
  3066. icon: 'none',
  3067. title: err,
  3068. });
  3069. })
  3070. } else {
  3071. this.userdisabled = false
  3072. uni.showToast({
  3073. title: '已拒绝授权',
  3074. icon: 'none',
  3075. duration: 2000,
  3076. })
  3077. }
  3078. },
  3079. getMenuButton() {
  3080. const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  3081. this.menuButtonLeft = menuButtonInfo.left
  3082. this.menuButtonH = menuButtonInfo.height
  3083. },
  3084. _touchAntiSeekSuppress(ms = 2000) {
  3085. const until = Date.now() + ms
  3086. if (until > (this._antiSeekSuppressExpireAt || 0)) this._antiSeekSuppressExpireAt = until
  3087. },
  3088. //播放时间更新事件方法
  3089. onTimeUpdate(e) {
  3090. let currentTime = Math.round(e.detail.currentTime)
  3091. if (this.playDurationSeek > 0) {
  3092. this.playTime = this.playDurationSeek
  3093. this.throttle(() => this.changeTime(this), 1000, false)
  3094. } else {
  3095. // console.log(this.isFinish)
  3096. const suppressAntiSeek = Date.now() < (this._antiSeekSuppressExpireAt || 0)
  3097. if (!suppressAntiSeek && this.linkType != 1 && (currentTime - this.playTime > 3 || currentTime - this
  3098. .playTime < -3) && this
  3099. .isFinish != 1) {
  3100. uni.showToast({
  3101. title: '不能快进哦',
  3102. icon: 'none',
  3103. });
  3104. currentTime = this.playTime
  3105. this.player.seek(this.playTime);
  3106. }
  3107. if (Math.floor(e.detail.currentTime) != this.flagTime) {
  3108. this.flagTime = Math.floor(e.detail.currentTime)
  3109. // 中途弹窗逻辑
  3110. if (!this.tipsOpen && this.tipsTime && this.playTime == this.tipsTime) {
  3111. this.timepath = '33%'
  3112. this.openTipsPop()
  3113. }
  3114. if (!this.tipsOpen && this.tipsTime2 && this.playTime == this.tipsTime2) {
  3115. this.timepath = '66%'
  3116. this.openTipsPop()
  3117. }
  3118. }
  3119. this.playTime = currentTime
  3120. this.updateProductAndCardDisplay(currentTime)
  3121. }
  3122. },
  3123. // 根据当前播放时间:1)扫描商品栏展示(上架/下架时间)2)控制商品卡片弹窗(弹出/关闭时间)
  3124. updateProductAndCardDisplay(currentSec) {
  3125. const toSeconds = (timeStr) => {
  3126. if (!timeStr || typeof timeStr !== 'string') return 0
  3127. const parts = timeStr.split(':')
  3128. if (parts.length !== 3) return 0
  3129. const h = parseInt(parts[0], 10) || 0
  3130. const m = parseInt(parts[1], 10) || 0
  3131. const s = parseInt(parts[2], 10) || 0
  3132. return h * 3600 + m * 60 + s
  3133. }
  3134. const hasValidShelfTime = (timeStr) => {
  3135. if (!timeStr || typeof timeStr !== 'string') return false
  3136. if (timeStr === '00:00:00') return false
  3137. return !!toSeconds(timeStr)
  3138. }
  3139. if (this.treatmentPackage.length === 0) {
  3140. this.displayProductList = []
  3141. this.cardPopup = false
  3142. this.currentCardItem = null
  3143. this._syncFakeMarqueeIfEligibleChanged()
  3144. return
  3145. }
  3146. // 按“上架时间”倒序排序,保证后上架商品展示在列表最前
  3147. const sortedTreatmentPackage = this.treatmentPackage.slice().sort((a, b) => {
  3148. const aOn = hasValidShelfTime(a.onShelfTime) ? toSeconds(a.onShelfTime) : 0
  3149. const bOn = hasValidShelfTime(b.onShelfTime) ? toSeconds(b.onShelfTime) : 0
  3150. if (bOn !== aOn) return bOn - aOn
  3151. // 上架时间相同则按下架时间倒序,进一步保证新近优先
  3152. const aOff = hasValidShelfTime(a.offShelfTime) ? toSeconds(a.offShelfTime) : 0
  3153. const bOff = hasValidShelfTime(b.offShelfTime) ? toSeconds(b.offShelfTime) : 0
  3154. return bOff - aOff
  3155. })
  3156. const videoDuration = this.duration || 0
  3157. // 1. 商品栏展示:按上架/下架时间过滤
  3158. this.displayProductList = sortedTreatmentPackage.filter(item => {
  3159. // 上架时间必填;下架时间可为空(为空表示一直展示到视频结束)
  3160. if (!hasValidShelfTime(item.onShelfTime)) return false
  3161. const onShelfSec = toSeconds(item.onShelfTime)
  3162. if (currentSec < onShelfSec) return false
  3163. const hasOffShelfTime = hasValidShelfTime(item.offShelfTime)
  3164. if (!hasOffShelfTime) return true
  3165. const offShelfSec = toSeconds(item.offShelfTime)
  3166. if (videoDuration > 0 && offShelfSec > videoDuration) return true
  3167. return currentSec < offShelfSec
  3168. })
  3169. //console.log('this.displayProductList',this.displayProductList)
  3170. // 2. 商品卡片弹窗:按弹出/关闭时间查找当前应展示的卡片
  3171. let activeCard = null
  3172. let activePopupSec = -1
  3173. for (let i = 0; i < sortedTreatmentPackage.length; i++) {
  3174. const item = sortedTreatmentPackage[i]
  3175. const popupStr = item.cardPopupTime
  3176. const closeStr = item.cardCloseTime
  3177. if (!popupStr || popupStr === '00:00:00') continue
  3178. const popupSec = toSeconds(popupStr)
  3179. if (!popupSec) continue
  3180. const closeSec = (closeStr && closeStr !== '00:00:00') ? toSeconds(closeStr) : null
  3181. if (currentSec >= popupSec && (closeSec == null || currentSec < closeSec)) {
  3182. // 同时命中多个弹窗时:优先展示“启动时间更晚”的后续弹窗
  3183. if (popupSec > activePopupSec) {
  3184. activePopupSec = popupSec
  3185. activeCard = item
  3186. } else if (popupSec === activePopupSec && activeCard) {
  3187. // 上架时间更晚优先(兜底)
  3188. const activeOn = hasValidShelfTime(activeCard.onShelfTime) ? toSeconds(activeCard.onShelfTime) : 0
  3189. const itemOn = hasValidShelfTime(item.onShelfTime) ? toSeconds(item.onShelfTime) : 0
  3190. if (itemOn > activeOn) activeCard = item
  3191. }
  3192. }
  3193. }
  3194. const activeCardKey = activeCard ?
  3195. `${activeCard.productId || ''}_${activeCard.cardPopupTime || ''}_${activeCard.cardCloseTime || ''}` :
  3196. ''
  3197. if (!activeCardKey) {
  3198. this.dismissedCardKey = ''
  3199. }
  3200. this.cardPopup = !!activeCard && this.dismissedCardKey !== activeCardKey
  3201. //this.getVideoContainerHeight()
  3202. this.currentCardItem = activeCard
  3203. this.syncProductHotCounts()
  3204. this._syncFakeMarqueeIfEligibleChanged()
  3205. },
  3206. closeCardPopup() {
  3207. if (this.currentCardItem) {
  3208. this.dismissedCardKey =
  3209. `${this.currentCardItem.productId || ''}_${this.currentCardItem.cardPopupTime || ''}_${this.currentCardItem.cardCloseTime || ''}`
  3210. }
  3211. this.cardPopup = false
  3212. },
  3213. hasHotSaleTag(item) {
  3214. return hasHotSaleTag(item)
  3215. },
  3216. getProductHotCount(item) {
  3217. if (!hasHotSaleTag(item)) return 0
  3218. const key = getProductHotKey(item)
  3219. return key ? clampHotSaleCount(this.productHotCountMap[key]) : 0
  3220. },
  3221. _collectHotSaleProducts() {
  3222. const seen = new Set()
  3223. const list = []
  3224. const add = (item) => {
  3225. if (!hasHotSaleTag(item)) return
  3226. const key = getProductHotKey(item)
  3227. if (!key || seen.has(key)) return
  3228. seen.add(key)
  3229. list.push(item)
  3230. }
  3231. ;(this.displayProductList || []).forEach(add)
  3232. if (this.cardPopup && this.currentCardItem) add(this.currentCardItem)
  3233. return list
  3234. },
  3235. _randomInt(min, max) {
  3236. return Math.floor(Math.random() * (max - min + 1)) + min
  3237. },
  3238. syncProductHotCounts() {
  3239. const products = this._collectHotSaleProducts()
  3240. const next = { ...this.productHotCountMap }
  3241. const activeKeys = new Set()
  3242. products.forEach((item) => {
  3243. const key = getProductHotKey(item)
  3244. if (!key) return
  3245. activeKeys.add(key)
  3246. if (!next[key]) {
  3247. next[key] = clampHotSaleCount(this._randomInt(100, 800))
  3248. }
  3249. })
  3250. Object.keys(next).forEach((key) => {
  3251. if (!activeKeys.has(key)) delete next[key]
  3252. })
  3253. this.productHotCountMap = next
  3254. if (activeKeys.size) {
  3255. this.startProductHotTimer()
  3256. } else {
  3257. this.stopProductHotTimer()
  3258. }
  3259. },
  3260. startProductHotTimer() {
  3261. if (this.productHotTimer) return
  3262. this.productHotTimer = setInterval(() => {
  3263. const products = this._collectHotSaleProducts()
  3264. if (!products.length) return
  3265. const next = { ...this.productHotCountMap }
  3266. products.forEach((item) => {
  3267. const key = getProductHotKey(item)
  3268. if (key && next[key]) {
  3269. next[key] = clampHotSaleCount(next[key] + this._randomInt(10, 20))
  3270. }
  3271. })
  3272. this.productHotCountMap = next
  3273. }, 30000)
  3274. },
  3275. stopProductHotTimer() {
  3276. if (this.productHotTimer) {
  3277. clearInterval(this.productHotTimer)
  3278. this.productHotTimer = null
  3279. }
  3280. },
  3281. changeTime(that, e) {
  3282. that.playDurationSeek = 0
  3283. },
  3284. videoErrorCallback(e) {
  3285. this.clearIntegral()
  3286. this.errorCount++
  3287. if (this.errorCount > 3) return
  3288. console.log(e)
  3289. this.getErrMsg(e.target.errMsg)
  3290. this.getH5CourseVideoDetails('error')
  3291. },
  3292. // 商品卡片跳转
  3293. goBuy(item) {
  3294. if (!item || !item.productId) return
  3295. uni.navigateTo({
  3296. url: '/pages/shopping/productDetails?productId=' + item.productId +
  3297. '&companyId=' + (this.urlOption.companyId || '') +
  3298. '&companyUserId=' + (this.urlOption.companyUserId || '') +
  3299. '&courseId=' + (this.urlOption.courseId || '') +
  3300. '&videoId=' + (this.urlOption.videoId || '') +
  3301. '&projectId=' + (this.urlOption.projectId || '') +
  3302. '&periodId=' + (this.urlOption.periodId || '')
  3303. })
  3304. },
  3305. // 当开始/继续播放时触发play事件
  3306. getPlay() {
  3307. this.errorCount = 0
  3308. this.videoPlaying = true
  3309. // this.judgeDuration()
  3310. // 开始播放时启动完课积分倒计时
  3311. this.startCountdown()
  3312. },
  3313. getPause() {
  3314. this.videoPlaying = false
  3315. this.clearIntegral()
  3316. // 暂停时停止完课积分倒计时
  3317. this.stopCountdown()
  3318. },
  3319. getEnded() {
  3320. this.videoPlaying = false
  3321. this.clearIntegral()
  3322. // 播放结束时停止完课积分倒计时
  3323. this.stopCountdown()
  3324. this.isEnded = true
  3325. this.isFinish = 1
  3326. this.getFinishCourseVideo()
  3327. },
  3328. getIP() {
  3329. uni.request({
  3330. url: 'https://ipinfo.io/json', //仅为示例,并非真实接口地址。
  3331. method: 'GET',
  3332. success: (res) => {
  3333. this.ip = res.data.ip
  3334. }
  3335. });
  3336. },
  3337. getHeight() {
  3338. this.height =
  3339. `calc(100vh - 420rpx - 160rpx)`
  3340. // this.$nextTick(() => {
  3341. // const query = uni.createSelectorQuery().in(this);
  3342. // query
  3343. // .select("#title-content")
  3344. // .boundingClientRect((data) => {
  3345. // this.height =
  3346. // `calc(100vh - ${data.height}px - 420rpx)`
  3347. // })
  3348. // .exec();
  3349. // })
  3350. },
  3351. getDescHeight() {
  3352. // this.$nextTick(() => {
  3353. // const query = uni.createSelectorQuery().in(this);
  3354. // query
  3355. // .select("#descbox-desc")
  3356. // .boundingClientRect((data) => {
  3357. // this.textHeight = data.height
  3358. // })
  3359. // .exec();
  3360. // })
  3361. },
  3362. numberToLetter(num) {
  3363. // 将数字转换为字母的 ASCII 码
  3364. let letterCode = num + 65;
  3365. // 将 ASCII 码转换为大写字母
  3366. let letter = String.fromCharCode(letterCode);
  3367. return letter;
  3368. },
  3369. updateTime() {
  3370. var that = this;
  3371. if (this.interval != null) {
  3372. clearInterval(this.interval)
  3373. }
  3374. this.interval = setInterval(function() {
  3375. that.getFinishCourseVideo()
  3376. that.getInternetTraffic()
  3377. }, 60000);
  3378. },
  3379. judgeDuration() {
  3380. var that = this;
  3381. if (this.intervalIntegral != null) {
  3382. clearInterval(this.intervalIntegral)
  3383. this.intervalIntegral = null
  3384. }
  3385. // 观看10分钟获得积分
  3386. this.intervalIntegral = setInterval(function() {
  3387. that.getIntegralByH5Video()
  3388. }, 600000);
  3389. },
  3390. clearIntegral() {
  3391. if (this.intervalIntegral != null) {
  3392. clearInterval(this.intervalIntegral)
  3393. this.intervalIntegral = null
  3394. }
  3395. },
  3396. // 展开简介
  3397. handleExpand() {
  3398. this.isExpand = !this.isExpand
  3399. },
  3400. getH5CourseByVideo() {
  3401. this.loading = true
  3402. getH5CourseByVideoId({
  3403. videoId: this.videoId
  3404. }).then(res => {
  3405. this.loading = false
  3406. if (res.code == 200) {
  3407. this.viewload = false
  3408. this.courseInfo = res.data
  3409. uni.setNavigationBarTitle({
  3410. title: this.courseInfo && this.courseInfo.title ? this.courseInfo.title : ''
  3411. });
  3412. this.$nextTick(() => {
  3413. this._syncRatingTabIndex()
  3414. })
  3415. }
  3416. this.getHeight()
  3417. this.getDescHeight()
  3418. },
  3419. rej => {
  3420. this.loading = false
  3421. }
  3422. ).catch(() => {
  3423. this.loading = false
  3424. })
  3425. },
  3426. getH5CourseVideoDetails(type) {
  3427. uni.showLoading({
  3428. title: '加载中'
  3429. })
  3430. //var user = uni.getStorageSync('userInfo');
  3431. const data = {
  3432. videoId: this.videoId,
  3433. fsUserId: this.userInfo.userId,
  3434. courseId: this.courseId,
  3435. companyUserId: this.companyUserId,
  3436. periodId: this.periodId,
  3437. id: this.timeid
  3438. }
  3439. getH5CourseVideoDetails(data).then(res => {
  3440. if (res.code == 200) {
  3441. this.config = res.data.courseConfig || {}
  3442. this.isFinish = res.data.isFinish || 0
  3443. this.duration = res.data.courseVideoDetails &&
  3444. res.data.courseVideoDetails.duration ? res.data.courseVideoDetails.duration : 0
  3445. this.courseLogo = this.config && JSON.stringify(this.config) != '{}' ? this.config
  3446. .courseLogo : ''
  3447. this.playDuration = res.data.playDuration || 0
  3448. this.playDurationSeek = res.data.playDuration || 0
  3449. // this.tipsTime = 38
  3450. this.tipsTime = res.data.tipsTime || 0
  3451. this.tipsTime2 = res.data.tipsTime2 || 0
  3452. this.displayType = res.data.courseVideoDetails && res.data.courseVideoDetails
  3453. .displayType != '' ? res.data.courseVideoDetails.displayType :'landscape'
  3454. this.isShu = this.displayType=='landscape'?false:true
  3455. const showTreatmentFlag = res.data.courseVideoDetails && res.data.courseVideoDetails
  3456. .showProduct != null ? res.data.courseVideoDetails.showProduct : 1
  3457. this.treatmentPackage = res.data.courseVideoDetails && res.data.courseVideoDetails
  3458. .fsStoreProductScrms ? res.data.courseVideoDetails.fsStoreProductScrms : []
  3459. this.showTreatment = showTreatmentFlag == 0 && this.treatmentPackage.length > 0 ? 0 : 1;
  3460. //console.log('this.showTreatment',this.showTreatment)
  3461. let lineList = []
  3462. // if (res.course && res.course.lineOne) {
  3463. // lineList.push(res.course.lineOne)
  3464. // }
  3465. // if (res.course && res.course.lineTwo) {
  3466. // lineList.push(res.course.lineTwo)
  3467. // }
  3468. // if (res.course && res.course.lineThree) {
  3469. // lineList.push(res.course.lineThree)
  3470. // }
  3471. this.lineList = lineList
  3472. if (!this.player || type == 'error') {
  3473. uni.hideLoading();
  3474. this.lineIndex = this.config.defaultLine
  3475. this.videoUrl = res.data.courseVideoDetails.videoUrl
  3476. this.poster = res.data.courseVideoDetails &&
  3477. res.data.courseVideoDetails.thumbnail ? res.data.courseVideoDetails.thumbnail : ''
  3478. this.videocont = res.data
  3479. // this.options.sources = [{
  3480. // src: this.videoUrl
  3481. // }]
  3482. // this.options.poster = res.course && res.course.imgUrl ? res.course.imgUrl : ''
  3483. // this.initVideo()
  3484. this.playTime = this.playDuration >= this.duration ? 0 : this.playDuration
  3485. if (this.videocont.rang) {
  3486. setTimeout(() => {
  3487. this.player = uni.createVideoContext('video-content-box');
  3488. this.player.seek(this.playTime)
  3489. this.player.play();
  3490. this._touchAntiSeekSuppress(2000)
  3491. }, 500);
  3492. this.timepop = false
  3493. } else {
  3494. this.timepop = true
  3495. }
  3496. } else {
  3497. // let div = document.querySelector(".vjs-progress-control");
  3498. // if(div) {
  3499. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  3500. // div.style.pointerEvents = "auto";
  3501. // } else {
  3502. // div.style.pointerEvents = "none"; //禁止所有事件
  3503. // }
  3504. // }
  3505. this.playTime = this.playTime > this.playDuration ? this.playTime : this
  3506. .playDuration >= this.duration ? 0 : this.playDuration
  3507. this.player.seek(this.playTime)
  3508. this.player.play();
  3509. this._touchAntiSeekSuppress(2000)
  3510. }
  3511. this.updateTime();
  3512. // 初始扫描商品栏展示(根据上架/下架时间)
  3513. this.updateProductAndCardDisplay(this.playTime ?? this.playDuration ?? 0);
  3514. // 商品栏扫描完成后再允许虚拟跑马灯启动(延后到下一轮渲染,避免一帧闪现)
  3515. this.$nextTick(() => {
  3516. this.marqueeDataReady = true
  3517. this._syncFakeMarqueeIfEligibleChanged()
  3518. })
  3519. const qbl =
  3520. (res.data.courseVideoDetails && res.data.courseVideoDetails.questionBankList) || []
  3521. this.questionBankList = qbl
  3522. if (qbl.length === 0) {
  3523. this.isquestion = true
  3524. this.quesList = []
  3525. } else {
  3526. this.isquestion = false
  3527. this.quesList = qbl.map(item => ({
  3528. ...item,
  3529. questionOption: JSON.parse(item.question),
  3530. answer: ''
  3531. }))
  3532. }
  3533. this.$nextTick(() => {
  3534. this._syncRatingTabIndex()
  3535. })
  3536. }
  3537. this.getHeight()
  3538. this.getDescHeight()
  3539. },
  3540. rej => {}
  3541. )
  3542. },
  3543. handleAnswer(item, option, idx) {
  3544. // 以“完课积分倒计时”结束作为答题资格
  3545. // if (!this.remainTimeReady) {
  3546. // uni.showToast({
  3547. // title: "倒计时加载中,请稍后再答题哦~",
  3548. // icon: "none"
  3549. // })
  3550. // return
  3551. // }
  3552. this.goRate(option.indexId)
  3553. if (Number(this.remainTime || 0) > 0) {
  3554. uni.showToast({
  3555. title: "完课倒计时结束再评分",
  3556. icon: "none"
  3557. })
  3558. return
  3559. }
  3560. if (item.type == 1) {
  3561. // 单选option
  3562. item.answer = option.name
  3563. } else if (item.type == 2) {
  3564. // 多选
  3565. let answer = item.answer ? item.answer.split(',') : []
  3566. if (answer.indexOf(option.name) === -1) {
  3567. answer.push(option.name)
  3568. item.answer = answer.join(',')
  3569. } else {
  3570. answer.splice(answer.indexOf(option.name), 1)
  3571. item.answer = answer.join(',')
  3572. }
  3573. }
  3574. },
  3575. submit() {
  3576. if (this.isExpire) {
  3577. uni.showToast({
  3578. title: '课程已过期或链接无效',
  3579. icon: 'none'
  3580. });
  3581. return
  3582. }
  3583. // 登录
  3584. this.$isLoginCourse().then(
  3585. res => {
  3586. console.log(res)
  3587. if (res) {
  3588. console.log(res)
  3589. if (this.isAddKf == 1) {
  3590. // 答题
  3591. // 您已提交过答案,请领取红包
  3592. console.log(1223)
  3593. this.courseAnswer()
  3594. } else {
  3595. // 添加客服
  3596. if (this.videoId && this.isLogin) {
  3597. console.log(12223131)
  3598. this.getIsAddKf()
  3599. } else if (this.iskftype == 1) {
  3600. uni.showToast({
  3601. title: '已看过其他销售分享的此课程,不能重复观看',
  3602. icon: 'none'
  3603. })
  3604. } else {
  3605. // this.kfPopup=true
  3606. uni.removeStorageSync('TOKEN_WEXIN')
  3607. uni.showToast({
  3608. title: '已清除缓存,请重新进入页面!',
  3609. icon: 'none'
  3610. })
  3611. }
  3612. }
  3613. } else {
  3614. this.goLogin()
  3615. }
  3616. },
  3617. rej => {}
  3618. );
  3619. },
  3620. // 答题
  3621. courseAnswer() {
  3622. // 以“完课积分倒计时”结束作为答题资格
  3623. // if (!this.remainTimeReady) {
  3624. // uni.showToast({
  3625. // title: "倒计时加载中,请稍后再答题哦~",
  3626. // icon: "none"
  3627. // })
  3628. // return
  3629. // }
  3630. if (Number(this.remainTime || 0) > 0) {
  3631. uni.showToast({
  3632. title: "完课倒计时结束再评分",
  3633. icon: "none"
  3634. })
  3635. return
  3636. }
  3637. if (this.quesList.some(item => !item.answer)) {
  3638. uni.showToast({
  3639. title: "请选择评分",
  3640. icon: "none"
  3641. })
  3642. return
  3643. }
  3644. const questions = this.quesList.map(obj => {
  3645. const {
  3646. questionOption,
  3647. ...rest
  3648. } = obj;
  3649. return rest;
  3650. });
  3651. const param = {
  3652. ...this.urlOption,
  3653. userId: this.userInfo.userId,
  3654. questions: questions,
  3655. videoId: this.videoId,
  3656. duration: this.playTime,
  3657. }
  3658. this.errTitle = ""
  3659. this.errDesc = ""
  3660. this.errQues = []
  3661. courseAnswer(param).then(res => {
  3662. if (res.code == 200) {
  3663. if (res.incorrectQuestions) {
  3664. // 答题失败
  3665. if (res.incorrectQuestions.length > 0) {
  3666. this.errQues = res.incorrectQuestions
  3667. }
  3668. this.remain = res.remain || 0
  3669. if (res.remain > 0) {
  3670. this.answerPopup = true
  3671. this.errTitle = "很遗憾答错了"
  3672. this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
  3673. // this.$refs.answerPopup.open("center")
  3674. this.answerPopup = true
  3675. }
  3676. } else {
  3677. // 答题成功
  3678. this.errTitle = "完课积分已到账"
  3679. //this.errDesc = `请选择奖励`
  3680. // this.$refs.answerPopup.open("center")
  3681. // this.answerPopup=true
  3682. if (res.msg == '答题成功') {
  3683. this.closeAnswerPopup()
  3684. // uni.login({
  3685. // provider: 'weixin',
  3686. // success: async loginRes => {
  3687. // console.log(loginRes)
  3688. // var code=loginRes
  3689. // this.closeAnswerPopup(loginRes.code)
  3690. // }
  3691. // })
  3692. }
  3693. }
  3694. } else {
  3695. if (res.msg == "该课题到达答错次数限制") {
  3696. this.errTitle = "答题次数超过限制"
  3697. this.errDesc = "以后的课程要认真学习哦"
  3698. // this.$refs.answerPopup.open("center")
  3699. this.answerPopup = true
  3700. } else {
  3701. if (res.msg.length > 14) {
  3702. if (res.msg == "该课程已答题完成,不可重复答题") {
  3703. uni.showToast({
  3704. title: '已评价请勿重复提交',
  3705. icon: 'none'
  3706. })
  3707. }else{
  3708. uni.showModal({
  3709. title: '提示',
  3710. content: res.msg,
  3711. showCancel: false,
  3712. confirmText: '我知道了'
  3713. })
  3714. }
  3715. } else {
  3716. uni.showToast({
  3717. title: res.msg,
  3718. icon: 'none'
  3719. })
  3720. }
  3721. }
  3722. }
  3723. },
  3724. rej => {}
  3725. )
  3726. },
  3727. // 选择
  3728. rewardChange(e) {
  3729. this.currentReward = e.detail.value
  3730. },
  3731. closeAnswerPopup() {
  3732. // this.$refs.answerPopup.close()
  3733. uni.showLoading({
  3734. title: "加载中..."
  3735. })
  3736. if (this.errTitle == '完课积分已到账') {
  3737. const param = {
  3738. ...this.urlOption,
  3739. userId: this.userInfo.userId,
  3740. // rewardType: Number(this.currentReward),
  3741. source: 2, // 小程序
  3742. appId: this.appid
  3743. }
  3744. sendReward(param).then(res => {
  3745. if (res.code == 200) {
  3746. uni.hideLoading()
  3747. this.answerPopup = false
  3748. console.log('红包', res)
  3749. if (res.isNew && res.isNew == 1) {
  3750. console.log('红包配置', res)
  3751. const packageInfo = res.data.packageInfo || ''
  3752. if (packageInfo) {
  3753. uni.setStorageSync('receive_package', packageInfo)
  3754. uni.setStorageSync('mchId', res.mchId)
  3755. uni.navigateTo({
  3756. url: '/pages_course/reward'
  3757. })
  3758. }
  3759. } else {
  3760. if (res.msg.length > 14) {
  3761. uni.showModal({
  3762. title: '提示',
  3763. content: res.msg,
  3764. showCancel: false,
  3765. confirmText: '我知道了'
  3766. })
  3767. } else {
  3768. uni.showToast({
  3769. title: res.msg,
  3770. icon: 'none'
  3771. })
  3772. }
  3773. }
  3774. } else {
  3775. uni.hideLoading()
  3776. if (res.msg.length > 14) {
  3777. uni.showModal({
  3778. title: '提示',
  3779. content: res.msg,
  3780. showCancel: false,
  3781. confirmText: '我知道了'
  3782. })
  3783. } else {
  3784. uni.showToast({
  3785. title: res.msg,
  3786. icon: 'none'
  3787. })
  3788. }
  3789. }
  3790. // if(res.code == 200) {
  3791. // //重构 发红包,后台通过OPENID发零钱到 账
  3792. // //this.initWXConfig(res.package)
  3793. // }else {
  3794. // uni.showToast({
  3795. // title: res.msg,
  3796. // icon: 'none'
  3797. // })
  3798. // }
  3799. })
  3800. } else {
  3801. uni.hideLoading()
  3802. this.answerPopup = !this.answerPopup
  3803. }
  3804. },
  3805. // 线路
  3806. openPop() {
  3807. this.$refs.popup.open('bottom')
  3808. },
  3809. close() {
  3810. this.$refs.popup.close()
  3811. },
  3812. handleLine(index) {
  3813. var that = this;
  3814. if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
  3815. this.close()
  3816. return
  3817. } else {
  3818. // let div = document.querySelector(".vjs-progress-control");
  3819. // if(div) {
  3820. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  3821. // div.style.pointerEvents = "auto";
  3822. // } else {
  3823. // div.style.pointerEvents = "none"; //禁止所有事件
  3824. // }
  3825. // }
  3826. this.lineIndex = index
  3827. this.videoUrl = this.lineList[index]
  3828. this.tipsOpen = false
  3829. this.playDurationSeek = this.playTime || 0
  3830. this.player = uni.createVideoContext('video-content-box');
  3831. setTimeout(function() {
  3832. that.player.seek(that.playDurationSeek)
  3833. that.player.play();
  3834. }, 500);
  3835. // this.player.src(this.lineList[index])
  3836. // this.player.one('loadedmetadata', () => {
  3837. // this.player.currentTime(this.playDurationSeek);
  3838. // this.player.play();
  3839. // });
  3840. this.close()
  3841. }
  3842. },
  3843. // 温馨提示
  3844. openTipsPop() {
  3845. // this.$refs.tipsPopup.open()
  3846. this.tipsPopup = true
  3847. // 暂停视频
  3848. this.videoContext.pause()
  3849. // this.tipsOpen = true
  3850. // this.pause()
  3851. },
  3852. closeTipsPop() {
  3853. // this.$refs.tipsPopup.close()
  3854. this.videoContext.play()
  3855. this.tipsPopup = !this.tipsPopup
  3856. },
  3857. // 客服
  3858. getIsAddKf() {
  3859. this.qrcode = ''
  3860. this.qrcodeMsg = ''
  3861. this.isAddKf = 0
  3862. //console.log('this.userInfo',this.userInfo)
  3863. this.userInfo = uni.getStorageSync('userInfo')
  3864. const data = {
  3865. videoId: this.videoId,
  3866. userId: this.userInfo.userId,
  3867. companyUserId: this.companyUserId,
  3868. companyId: this.companyId,
  3869. courseId: this.courseId,
  3870. periodId: this.periodId,
  3871. projectId: this.projectId,
  3872. appId: wx.getAccountInfoSync().miniProgram.appId,
  3873. }
  3874. // {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
  3875. getIsAddKf(data).then(res => {
  3876. if (res.code == 200) {
  3877. this.isLogin = true
  3878. if (res.data) {
  3879. this.isAddKf = 1
  3880. if (this.userInfo) {
  3881. if (typeof this.userInfo === 'string') {
  3882. try {
  3883. this.userInfo = JSON.parse(this.userInfo);
  3884. } catch (e) {
  3885. this.userInfo = {};
  3886. }
  3887. }
  3888. if (this.userInfo.userId) {
  3889. this.getH5CourseVideoDetails();
  3890. this.getRemainTime(this.userInfo.userId);
  3891. this.getMp();
  3892. this.loadFeaturedComments()
  3893. }
  3894. }
  3895. }
  3896. // else{
  3897. // uni.showToast({
  3898. // title: '请联系管理员,注册为会员!',
  3899. // icon: 'none'
  3900. // });
  3901. // }
  3902. } else if (res.code == 1002) {
  3903. this.isAddKf = 0
  3904. this.qrcode = res.ext
  3905. this.kfPopup = true
  3906. uni.showToast({
  3907. title: "请添加管理员微信,成为会员!",
  3908. icon: 'none'
  3909. });
  3910. this.initExpiration(res.msg, res.code)
  3911. } else if (res.code == 505) {
  3912. this.isAddKf = 0
  3913. this.qrcode = res.ext
  3914. this.kfPopup = true
  3915. uni.showToast({
  3916. title: "管理员开启了会员审核,请等待审核!",
  3917. icon: 'none'
  3918. });
  3919. this.initExpiration(res.msg, res.code)
  3920. } else if (res.code == 406) {
  3921. uni.hideLoading();
  3922. uni.showToast({
  3923. icon: 'none',
  3924. title: '该用户已成为其他销售会员',
  3925. });
  3926. this.initExpiration(res.msg, res.code)
  3927. } else if (res.code == 504) {
  3928. this.isAddKf = 0
  3929. this.iskftype = 1
  3930. uni.showToast({
  3931. title: res.msg,
  3932. icon: 'none'
  3933. });
  3934. this.initExpiration(res.msg, res.code)
  3935. } else {
  3936. this.isAddKf = 0
  3937. uni.showToast({
  3938. title: res.msg,
  3939. icon: 'none'
  3940. });
  3941. this.initExpiration(res.msg, res.code)
  3942. }
  3943. },
  3944. err => {}
  3945. );
  3946. },
  3947. getMp(){
  3948. let provider = 'weixin'
  3949. uni.login({
  3950. provider: provider,
  3951. success: async loginRes => {
  3952. console.log(loginRes)
  3953. uni.getUserInfo({
  3954. provider: provider,
  3955. success: (infoRes)=> {
  3956. // uni.showToast({
  3957. // title: '处理中...',
  3958. // icon: 'loading'
  3959. // });
  3960. //console.log(infoRes,'infoRes')
  3961. loginByMiniApp({
  3962. code: loginRes.code,
  3963. encryptedData:infoRes.encryptedData,
  3964. iv:infoRes.iv,
  3965. appId:wx.getAccountInfoSync().miniProgram.appId,
  3966. }).then(res=>{
  3967. //uni.hideLoading();
  3968. if (res.code == 200) {
  3969. uni.setStorageSync('userInfo',JSON.stringify(res.user));
  3970. } else {
  3971. uni.showToast({
  3972. title: res.msg,
  3973. icon: 'none'
  3974. });
  3975. }
  3976. }).catch(err=>{
  3977. //uni.hideLoading();
  3978. uni.showToast({
  3979. icon:'none',
  3980. title: "登录失败,请重新登录",
  3981. });
  3982. });
  3983. }
  3984. });
  3985. }
  3986. })
  3987. },
  3988. initExpiration(resMsg, resCode) {
  3989. if (resCode == 401) return;
  3990. this.resMsg = resMsg
  3991. this.resCode = resCode
  3992. this.showExpiration = true
  3993. },
  3994. closeKFPop() {
  3995. // this.$refs.kfPopup.close()
  3996. // this.kfPopup=!this.kfPopup
  3997. },
  3998. getFinishCourseVideo() {
  3999. if (!this.playTime) return
  4000. // {videoId: this.videoId,duration:this.playTime}
  4001. const param = {
  4002. duration: this.playTime,
  4003. videoId: this.videoId,
  4004. userId: this.userInfo.userId,
  4005. companyUserId: this.companyUserId
  4006. }
  4007. getFinishCourseVideo(param)
  4008. },
  4009. // 每十分钟获得积分
  4010. getIntegralByH5Video() {
  4011. const param = {
  4012. duration: this.playTime,
  4013. ...this.urlOption
  4014. }
  4015. getIntegralByH5Video(param).then(res => {
  4016. if (res.code == 200) {
  4017. uni.showToast({
  4018. title: "积分+10",
  4019. icon: "none"
  4020. })
  4021. }
  4022. })
  4023. },
  4024. progressChange(e) {
  4025. this.bufferRate = Math.ceil(e.detail.buffered)
  4026. // console.log('缓冲结果',this.bufferRate)
  4027. // console.log('缓冲',this.playTime,this.duration)
  4028. },
  4029. // 缓冲
  4030. getInternetTraffic() {
  4031. const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
  4032. // console.log('播放百分比',playVideoTime)
  4033. if (this.bufferRate == 0 || this.bufferRate < playVideoTime) {
  4034. this.bufferRate = playVideoTime
  4035. console.log(this.bufferRate)
  4036. }
  4037. if (this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
  4038. const param = {
  4039. uuId: dayjs().format('YYYYMMDD') + this.uuId,
  4040. duration: this.playTime,
  4041. bufferRate: Number(this.bufferRate.toFixed(2)),
  4042. userId: this.userId,
  4043. periodId: this.periodId,
  4044. ...this.urlOption
  4045. }
  4046. getInternetTraffic(param)
  4047. },
  4048. getErrMsg(err) {
  4049. let msgerr = {
  4050. videoUrl: this.videoUrl,
  4051. lineIndex: this.lineIndex,
  4052. errTime: new Date(),
  4053. // ip: this.ip,
  4054. errMsg: err
  4055. }
  4056. getErrMsg({
  4057. msg: JSON.stringify(msgerr)
  4058. })
  4059. },
  4060. getLink() {
  4061. this.goLogin()
  4062. return
  4063. let that = this;
  4064. this.msg = ''
  4065. getRealLink({
  4066. sortLink: this.sortLink
  4067. }).then(res => {
  4068. if (res.code == 200) {
  4069. this.isExpire = false
  4070. // 如果响应中包含真实链接,则跳转到真实链接
  4071. // window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
  4072. if (this.isLogin && this.isAddKf == 1) {
  4073. this.getH5CourseVideoDetails()
  4074. }
  4075. if (this.videoId && this.isAddKf != 1) {
  4076. this.$isLoginCourse().then(
  4077. isLogin => {
  4078. this.isLogin = isLogin
  4079. if (isLogin) {
  4080. this.getIsAddKf()
  4081. } else {
  4082. this.goLogin()
  4083. }
  4084. },
  4085. rej => {}
  4086. );
  4087. }
  4088. } else {
  4089. this.isExpire = true
  4090. this.msg = '课程已过期或链接无效'
  4091. uni.showToast({
  4092. title: '课程已过期或链接无效',
  4093. icon: 'none'
  4094. });
  4095. }
  4096. }).catch(err => {
  4097. this.isExpire = true
  4098. this.msg = '发生错误,请稍后再试'
  4099. uni.showToast({
  4100. title: '发生错误,请稍后再试',
  4101. icon: 'none'
  4102. });
  4103. })
  4104. },
  4105. /**
  4106. * 节流原理:在一定时间内,只能触发一次
  4107. *
  4108. * @param {Function} func 要执行的回调函数
  4109. * @param {Number} wait 延时的时间
  4110. * @param {Boolean} immediate 是否立即执行
  4111. * @return null
  4112. */
  4113. throttle(func, wait = 500, immediate = true) {
  4114. if (immediate) {
  4115. if (!this.flag) {
  4116. this.flag = true
  4117. // 如果是立即执行,则在wait毫秒内开始时执行
  4118. typeof func === 'function' && func()
  4119. this.timer = setTimeout(() => {
  4120. this.flag = false
  4121. }, wait)
  4122. }
  4123. } else if (!this.flag) {
  4124. this.flag = true
  4125. // 如果是非立即执行,则在wait毫秒内的结束处执行
  4126. this.timer = setTimeout(() => {
  4127. this.flag = false
  4128. typeof func === 'function' && func()
  4129. }, wait)
  4130. }
  4131. }
  4132. }
  4133. }
  4134. </script>
  4135. <style scoped>
  4136. .full-width-popup {
  4137. width: 100%;
  4138. }
  4139. </style>
  4140. <style lang="scss" scoped>
  4141. .contact-btn {
  4142. display: inline-block;
  4143. position: absolute;
  4144. top: 0;
  4145. left: 0;
  4146. width: 100%;
  4147. height: 100%;
  4148. opacity: 0;
  4149. }
  4150. .notice-box{
  4151. padding: 12rpx 18rpx;
  4152. background: #FFF8F8;
  4153. display: flex;
  4154. align-items: center;
  4155. image{
  4156. width:40rpx;
  4157. height:40rpx;
  4158. margin-right: 10rpx;
  4159. flex-shrink: 0;
  4160. }
  4161. .notice-marquee-wrap{
  4162. flex: 1;
  4163. min-width: 0;
  4164. overflow: hidden;
  4165. display: flex;
  4166. align-items: center;
  4167. }
  4168. .notice-marquee-track{
  4169. display: inline-flex;
  4170. white-space: nowrap;
  4171. animation: notice-marquee-scroll 20s linear infinite;
  4172. }
  4173. .notice-text{
  4174. flex-shrink: 0;
  4175. padding-right: 60rpx;
  4176. font-family: PingFangSC, PingFang SC;
  4177. font-weight: 600;
  4178. font-size: 32rpx;
  4179. line-height: 44rpx;
  4180. color: #FF0C4D;
  4181. display: flex;
  4182. }
  4183. }
  4184. @keyframes notice-marquee-scroll{
  4185. 0%{ transform: translateX(0); }
  4186. 100%{ transform: translateX(-50%); }
  4187. }
  4188. .vip-order-cover-wrap {
  4189. position: fixed;
  4190. left: 10px;
  4191. bottom:40px;
  4192. height: 26px;
  4193. z-index: 999;
  4194. /* 容器按内容宽度自适应 */
  4195. display: inline-block;
  4196. overflow: visible;
  4197. pointer-events: none;
  4198. width: 200px;
  4199. }
  4200. .vip-order-cover-wrap--triple {
  4201. height: 110px;
  4202. //width: 240px;
  4203. }
  4204. .vip-order-cover-triple-panel {
  4205. display: flex;
  4206. align-items: flex-start;
  4207. flex-direction: column;
  4208. position: absolute;
  4209. left: 0;
  4210. right: auto;
  4211. top: 0;
  4212. }
  4213. .vip-order-cover-triple-current {
  4214. z-index: 1;
  4215. }
  4216. .vip-order-cover-triple-incoming {
  4217. z-index: 2;
  4218. }
  4219. .vip-order-cover-item {
  4220. position: absolute;
  4221. left: 0;
  4222. /* 不再撑满整块固定宽度,让背景宽度随内容变化 */
  4223. right: auto;
  4224. top: 0;
  4225. display: inline-flex;
  4226. align-items: center;
  4227. background: rgba(0,0,0,0.35);
  4228. border-radius: 26rpx;
  4229. text-align: center;
  4230. //border: 1px solid rgba(255, 12, 77, 0.2);
  4231. font-family: PingFangSC, PingFang SC;
  4232. font-size: 16px;
  4233. height: 26px;
  4234. line-height: 26px;
  4235. color: #fff;
  4236. font-weight: 400;
  4237. box-sizing: border-box;
  4238. }
  4239. .vip-order-cover-triple-item {
  4240. position: relative;
  4241. top: auto;
  4242. margin-bottom: 8px;
  4243. }
  4244. .vip-order-cover-triple-item:last-child {
  4245. margin-bottom: 0;
  4246. }
  4247. .vip-order-triple-enter {
  4248. animation: vip-order-triple-enter-up 0.46s ease-out forwards;
  4249. }
  4250. .vip-order-triple-leave {
  4251. animation: vip-order-triple-leave-up 0.46s ease-in forwards;
  4252. }
  4253. @keyframes vip-order-triple-enter-up {
  4254. 0% {
  4255. opacity: 0;
  4256. transform: translateY(38px);
  4257. }
  4258. 100% {
  4259. opacity: 1;
  4260. transform: translateY(0);
  4261. }
  4262. }
  4263. @keyframes vip-order-triple-leave-up {
  4264. 0% {
  4265. opacity: 1;
  4266. transform: translateY(0);
  4267. }
  4268. 78% {
  4269. opacity: 1;
  4270. transform: translateY(-34px);
  4271. }
  4272. 100% {
  4273. opacity: 0;
  4274. transform: translateY(-38px);
  4275. }
  4276. }
  4277. .vip-order-cover-content {
  4278. display: flex;
  4279. align-items: center;
  4280. flex-wrap: nowrap;
  4281. white-space: nowrap;
  4282. overflow: visible;
  4283. justify-content: flex-start;
  4284. height: 26px;
  4285. line-height: 26px;
  4286. padding:0 8px;
  4287. }
  4288. .vip-order-seg {
  4289. display: inline-block;
  4290. }
  4291. .vip-order-seg-user {
  4292. color: #fff;
  4293. //font-weight: 600;
  4294. }
  4295. .vip-order-seg-time {
  4296. // font-size: 14px;
  4297. margin-left: 6px;
  4298. }
  4299. .vip-order-seg-suffix {
  4300. color: #fff;
  4301. // margin-left: 2px;
  4302. }
  4303. .vip-order-cover-self {
  4304. // width: 180px !important;
  4305. background: rgba(230,0,26,0.5);
  4306. // border: 1px solid #FFB020;
  4307. color: #fff;
  4308. }
  4309. .vip-order-cover-self .vip-order-seg-user {
  4310. color: #fff;
  4311. }
  4312. .vip-order-cover-self .vip-order-seg-time {
  4313. color: #fff;
  4314. margin-left: 6px;
  4315. }
  4316. .vip-order-cover-self .vip-order-seg-suffix {
  4317. color: #fff;
  4318. }
  4319. .vip-order-enter {
  4320. animation: vip-order-enter-up 0.46s ease-out forwards;
  4321. }
  4322. .vip-order-leave {
  4323. animation: vip-order-leave-up 0.46s ease-in forwards;
  4324. }
  4325. @keyframes vip-order-enter-up {
  4326. 0% {
  4327. opacity: 0;
  4328. transform: translateY(24px);
  4329. }
  4330. 100% {
  4331. opacity: 1;
  4332. transform: translateY(0);
  4333. }
  4334. }
  4335. @keyframes vip-order-leave-up {
  4336. 0% {
  4337. opacity: 1;
  4338. transform: translateY(0);
  4339. }
  4340. 100% {
  4341. opacity: 0;
  4342. transform: translateY(-24px);
  4343. }
  4344. }
  4345. .rating-box{
  4346. position: relative;
  4347. padding:24rpx 0rpx 24rpx;
  4348. z-index:0;
  4349. height: calc(100vh - 488rpx);
  4350. .bg {
  4351. width: 100%;
  4352. // height: 500rpx;
  4353. position: absolute;
  4354. top: 0;
  4355. left: 0;
  4356. z-index: -1;
  4357. }
  4358. .tab-Box {
  4359. display: flex;
  4360. align-items: flex-end;
  4361. justify-content: space-around;
  4362. padding: 0 8rpx;
  4363. margin-bottom: -2rpx;
  4364. position: relative;
  4365. z-index: 3;
  4366. }
  4367. .tab-Box--single {
  4368. align-items: center;
  4369. justify-content: flex-start;
  4370. padding: 0 24rpx 0 16rpx;
  4371. margin-bottom: 30rpx;
  4372. }
  4373. .tab-item--single {
  4374. flex: 0 1 auto;
  4375. justify-content: flex-start;
  4376. // width: 100%;
  4377. padding: 0;
  4378. }
  4379. .tab-item__surface--single {
  4380. flex-direction: row;
  4381. align-items: center;
  4382. flex-direction: row !important;
  4383. justify-content: flex-start;
  4384. width: auto;
  4385. max-width: 100%;
  4386. border-radius: 0;
  4387. image {
  4388. margin-top: 0!important;
  4389. margin-right: 16rpx;
  4390. flex-shrink: 0;
  4391. }
  4392. }
  4393. .tab-item__text--single {
  4394. padding-top: 0!important;
  4395. padding-bottom: 0!important;
  4396. text-align: left;
  4397. font-weight: 600 !important;
  4398. font-size: 40rpx !important;
  4399. line-height: 56rpx !important;
  4400. }
  4401. .tab-item {
  4402. // flex: 1;
  4403. display: flex;
  4404. justify-content: center;
  4405. min-width: 0;
  4406. padding: 0 6rpx;
  4407. }
  4408. .tab-item__surface {
  4409. width: 100%;
  4410. display: flex;
  4411. flex-direction: column;
  4412. align-items: center;
  4413. justify-content: flex-end;
  4414. box-sizing: border-box;
  4415. border-radius: 28rpx 28rpx 0 0;
  4416. transition: background-color 0.28s ease, box-shadow 0.28s ease, transform 0.22s ease;
  4417. image{
  4418. margin-top: 12rpx;
  4419. width: 40rpx;
  4420. height: 40rpx;
  4421. }
  4422. }
  4423. .tab-item--active .tab-item__surface {
  4424. background:url('https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/active-bg.png') no-repeat center;
  4425. background-size: 100% 100%;
  4426. padding: 0 70rpx;
  4427. transform: translateY(-2rpx);
  4428. }
  4429. .tab-item__text {
  4430. padding-top: 10rpx;
  4431. padding-bottom: 12rpx;
  4432. font-family: PingFangSC, PingFang SC;
  4433. font-weight: 400;
  4434. font-size: 36rpx;
  4435. line-height: 50rpx;
  4436. color: #ff233c;
  4437. text-align: center;
  4438. }
  4439. .tab-item--active .tab-item__text{
  4440. font-weight: 600;
  4441. font-size: 40rpx;
  4442. }
  4443. .rating-ques-block + .rating-ques-block {
  4444. margin-top: 40rpx;
  4445. }
  4446. .rating-body--plain {
  4447. // padding-top: 36rpx;
  4448. // padding-bottom: 40rpx;
  4449. image {
  4450. width: 100%;
  4451. }
  4452. }
  4453. .rating-intro-cover-img {
  4454. width: 100%;
  4455. height: auto;
  4456. display: block;
  4457. }
  4458. .rating-intro-text {
  4459. margin-top: 24rpx;
  4460. font-size: 28rpx;
  4461. line-height: 44rpx;
  4462. color: rgba(0, 0, 0, 0.65);
  4463. white-space: pre-wrap;
  4464. word-break: break-word;
  4465. }
  4466. .rating-msg-empty {
  4467. padding: 80rpx 24rpx;
  4468. text-align: center;
  4469. font-size: 28rpx;
  4470. color: rgba(0, 0, 0, 0.35);
  4471. }
  4472. .rating-body.rating-body--featured {
  4473. display: flex;
  4474. flex-direction: column;
  4475. overflow: hidden;
  4476. padding: 30rpx 24rpx 20rpx;
  4477. }
  4478. .rating-msg-scroll {
  4479. height:100%;
  4480. width: 100%;
  4481. box-sizing: border-box;
  4482. }
  4483. .rating-msg-scroll-anchor {
  4484. width: 100%;
  4485. height: 1px;
  4486. }
  4487. .rating-msg-load-more {
  4488. padding: 24rpx 0 32rpx;
  4489. text-align: center;
  4490. font-size: 26rpx;
  4491. color: rgba(0, 0, 0, 0.4);
  4492. }
  4493. .rating-msg-load-more--done {
  4494. color: rgba(0, 0, 0, 0.28);
  4495. }
  4496. .rating-msg-item {
  4497. display: flex;
  4498. flex-direction: row;
  4499. align-items: flex-start;
  4500. gap: 20rpx;
  4501. padding-bottom: 40rpx;
  4502. &:not(:first-child) {
  4503. padding-top: 8rpx;
  4504. }
  4505. }
  4506. .rating-msg-avatar-wrap {
  4507. flex-shrink: 0;
  4508. width: 64rpx;
  4509. }
  4510. .rating-msg-main {
  4511. flex: 1;
  4512. min-width: 0;
  4513. display: flex;
  4514. flex-direction: column;
  4515. align-items: stretch;
  4516. }
  4517. .rating-msg-avatar {
  4518. width: 64rpx;
  4519. height: 64rpx;
  4520. border-radius: 50%;
  4521. flex-shrink: 0;
  4522. background: #ffe4ec;
  4523. display: block;
  4524. }
  4525. .rating-msg-avatar--ph {
  4526. display: flex;
  4527. align-items: center;
  4528. justify-content: center;
  4529. background: linear-gradient(145deg, #ffd6e8 0%, #ffc8df 100%);
  4530. }
  4531. .rating-msg-name {
  4532. font-size: 32rpx;
  4533. color: rgba(0,0,0,0.65);
  4534. font-family: PingFangSC, PingFang SC;
  4535. font-weight: 400;
  4536. line-height: 44rpx;
  4537. }
  4538. .rating-msg-text {
  4539. margin-top: 12rpx;
  4540. font-size: 28rpx;
  4541. line-height: 44rpx;
  4542. color: rgba(0, 0, 0, 0.85);
  4543. word-break: break-word;
  4544. }
  4545. .rating-msg-media {
  4546. margin-top: 12rpx;
  4547. //border-radius: 16rpx;
  4548. overflow: hidden;
  4549. }
  4550. .rating-msg-media--video {
  4551. overflow: visible;
  4552. }
  4553. .rating-msg-video-wrap {
  4554. position: relative;
  4555. max-width: 320rpx;
  4556. // background: #000;
  4557. }
  4558. .rating-msg-video {
  4559. width: 100%;
  4560. display: block;
  4561. max-height: 240rpx;
  4562. // background: #000;
  4563. }
  4564. /* 小程序列表内用封面图代替 video,固定比例避免布局抖动 */
  4565. .rating-msg-video--poster {
  4566. width: 320rpx;
  4567. max-width: 100%;
  4568. height: 180rpx;
  4569. vertical-align: top;
  4570. }
  4571. /* 仅有视频地址无封面时:不能用视频 URL 当 image.src */
  4572. .rating-msg-video--no-poster {
  4573. box-sizing: border-box;
  4574. width: 320rpx;
  4575. max-width: 100%;
  4576. height: 180rpx;
  4577. background: linear-gradient(160deg, #2a2a2e 0%, #121214 100%);
  4578. }
  4579. .rating-msg-video-play-cover {
  4580. position: absolute;
  4581. left: 0;
  4582. top: 0;
  4583. right: 0;
  4584. bottom: 0;
  4585. z-index: 2;
  4586. display: flex;
  4587. align-items: center;
  4588. justify-content: center;
  4589. background: rgba(0, 0, 0, 0.18);
  4590. }
  4591. .rating-msg-video-play-icon {
  4592. width: 88rpx;
  4593. height: 88rpx;
  4594. flex-shrink: 0;
  4595. }
  4596. .rating-msg-media--imgs {
  4597. display: flex;
  4598. flex-wrap: wrap;
  4599. justify-content: flex-start;
  4600. gap: 12rpx; /* 图片之间间距,跟朋友圈一致 */
  4601. }
  4602. .rating-msg-media--cols-1 {
  4603. grid-template-columns: 1fr;
  4604. }
  4605. .rating-msg-media--cols-2 {
  4606. grid-template-columns: repeat(2, 1fr);
  4607. }
  4608. .rating-msg-media--cols-3 {
  4609. grid-template-columns: repeat(3, 1fr);
  4610. }
  4611. .rating-msg-img {
  4612. flex-shrink: 0;
  4613. /* 关键:不设固定宽高,只限制最大宽度,和朋友圈一致 */
  4614. max-width: 320rpx;
  4615. height: auto;
  4616. }
  4617. .rating-msg-media--cols-1 .rating-msg-img {
  4618. }
  4619. .rating-msg-toolbar {
  4620. flex-shrink: 0;
  4621. padding-top: 20rpx;
  4622. margin-top: 8rpx;
  4623. border-top: 1rpx solid rgba(0, 0, 0, 0.06);
  4624. }
  4625. .rating-msg-toolbar-row {
  4626. display: flex;
  4627. align-items: flex-end;
  4628. justify-content: space-between;
  4629. gap: 16rpx;
  4630. }
  4631. .rating-msg-side-actions {
  4632. display: flex;
  4633. align-items: flex-end;
  4634. flex-shrink: 0;
  4635. gap: 20rpx;
  4636. }
  4637. .rating-msg-dash-btn {
  4638. display: flex;
  4639. flex-direction: column;
  4640. align-items: center;
  4641. width: 100rpx;
  4642. }
  4643. .rating-msg-dash-inner {
  4644. width: 80rpx;
  4645. height: 80rpx;
  4646. border: 2rpx dashed #c8c8c8;
  4647. border-radius: 16rpx;
  4648. display: flex;
  4649. align-items: center;
  4650. justify-content: center;
  4651. box-sizing: border-box;
  4652. background: #fafafa;
  4653. }
  4654. .rating-msg-dash-img {
  4655. width: 44rpx;
  4656. height: 44rpx;
  4657. }
  4658. .rating-msg-dash-label {
  4659. margin-top: 8rpx;
  4660. font-size: 24rpx;
  4661. color: #222222;
  4662. font-weight: 600;
  4663. line-height: 34rpx;
  4664. }
  4665. .rating-msg-cart-slot {
  4666. position: relative;
  4667. display: flex;
  4668. flex-direction: column;
  4669. align-items: center;
  4670. }
  4671. .rating-msg-badge {
  4672. position: absolute;
  4673. right: -28rpx;
  4674. top: -72rpx;
  4675. width: 180rpx;
  4676. height: 76rpx;
  4677. z-index: 2;
  4678. pointer-events: none;
  4679. }
  4680. .rating-body{
  4681. //margin-top: 40rpx;
  4682. position: relative;
  4683. z-index: 1;
  4684. padding:30rpx;
  4685. box-sizing: border-box;
  4686. background: #FFFFFF;
  4687. border-radius: 30rpx 30rpx;
  4688. height: calc(100% - 300rpx);
  4689. overflow-y: auto;
  4690. -webkit-overflow-scrolling: touch;
  4691. margin-top: 0;
  4692. .title{
  4693. font-family: PingFangSC, PingFang SC;
  4694. font-weight: 600;
  4695. font-size: 40rpx;
  4696. color: rgba(0,0,0,0.85);
  4697. line-height: 56rpx;
  4698. }
  4699. }
  4700. .sat-box{
  4701. display: grid;
  4702. grid-template-columns: repeat(2, 1fr);
  4703. gap: 28rpx 24rpx;
  4704. margin-top: 32rpx;
  4705. }
  4706. .sat{
  4707. display: flex;
  4708. flex-direction: column;
  4709. align-items: center;
  4710. justify-content: center;
  4711. text-align: center;
  4712. background: #F5F7FA;
  4713. padding: 20rpx;
  4714. border-radius: 20rpx;
  4715. transition: background 0.3s ease, box-shadow 0.3s ease;
  4716. .sat-img-wrap{
  4717. width: 100rpx;
  4718. height: 100rpx;
  4719. display: flex;
  4720. align-items: center;
  4721. justify-content: center;
  4722. will-change: transform;
  4723. image{
  4724. width: 100rpx;
  4725. height: 100rpx;
  4726. transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  4727. }
  4728. }
  4729. .sat-img-bounce{
  4730. animation: sat-rate-pop 0.48s cubic-bezier(0.34, 1.45, 0.64, 1);
  4731. }
  4732. text{
  4733. margin-top: 10rpx;
  4734. font-family: PingFangSC, PingFang SC;
  4735. font-weight: 400;
  4736. font-size: 36rpx;
  4737. line-height: 50rpx;
  4738. transition: color 0.32s ease, font-weight 0.28s ease, transform 0.28s ease;
  4739. color: rgba(0,0,0,0.42);
  4740. }
  4741. .active{
  4742. font-weight: 600;
  4743. color: #FF233C;
  4744. }
  4745. }
  4746. .sat.sat--active{
  4747. background: #FFEEF0;
  4748. //box-shadow: 0 4rpx 16rpx rgba(255, 92, 3, 0.12);
  4749. .sat-img-wrap image{
  4750. transform: scale(1.06);
  4751. }
  4752. }
  4753. }
  4754. @keyframes sat-rate-pop{
  4755. 0%{ transform: scale(1); }
  4756. 28%{ transform: scale(1.2); }
  4757. 52%{ transform: scale(0.94); }
  4758. 76%{ transform: scale(1.06); }
  4759. 100%{ transform: scale(1); }
  4760. }
  4761. /* 精选留言:相册图片/视频(替代系统 ActionSheet,底部贴齐含安全区) */
  4762. .fc-media-actions-sheet {
  4763. display: flex;
  4764. flex-direction: column;
  4765. width: 100%;
  4766. box-sizing: border-box;
  4767. padding-bottom:68rpx;
  4768. }
  4769. .fc-media-actions-sheet-item {
  4770. padding: 30rpx 32rpx;
  4771. font-size: 32rpx;
  4772. color: #1e1e1e;
  4773. text-align: center;
  4774. border-bottom: 1rpx solid #f0f0f0;
  4775. }
  4776. .fc-media-actions-sheet-gap {
  4777. height: 16rpx;
  4778. background: #f3f5f9;
  4779. border-bottom: none;
  4780. }
  4781. .fc-media-actions-sheet-cancel {
  4782. border-bottom: none;
  4783. color: #666;
  4784. }
  4785. // 更多操作弹窗
  4786. .more-actions-popup {
  4787. border-radius: 20rpx 0 0 20rpx;
  4788. padding: 30rpx;
  4789. display: flex;
  4790. justify-content: space-between;
  4791. .more-action-item {
  4792. display: flex;
  4793. flex-direction: column;
  4794. align-items: center;
  4795. .action-icon {
  4796. width: 48rpx;
  4797. height: 48rpx;
  4798. }
  4799. .action-label {
  4800. color: #1e1e1e;
  4801. text-align: center;
  4802. margin-top: 10rpx;
  4803. }
  4804. }
  4805. }
  4806. .progress-countdown {
  4807. position: fixed;
  4808. right: 6px;
  4809. top: 6px;
  4810. z-index: 99999999;
  4811. // width: 112px;
  4812. height: 50px;
  4813. background: rgba(0,0,0,0.45);
  4814. display: flex;
  4815. align-items: center;
  4816. justify-content: space-around;
  4817. padding:2px 8px;
  4818. flex-direction: column;
  4819. border-radius: 6px;
  4820. box-sizing: border-box; /* 避免padding撑大容器 */
  4821. }
  4822. .progress-title {
  4823. font-size: 16px;
  4824. color: #FF233C;
  4825. font-weight: 600;
  4826. }
  4827. .progress-img{
  4828. width: 63px;
  4829. height: 15px;
  4830. }
  4831. .progress-bar-bg {
  4832. width: 86px;
  4833. height: 6px;
  4834. //margin-top: 16rpx;
  4835. background: rgba(255,255,255,0.8);
  4836. border-radius: 3px;
  4837. overflow: hidden;
  4838. // margin-bottom: 16rpx;
  4839. }
  4840. .progress-bar-fill {
  4841. height: 100%;
  4842. background: #FF233C;
  4843. border-radius: 3px;
  4844. transition: width 1s linear;
  4845. }
  4846. .progress-text {
  4847. white-space: nowrap; /* 强制不换行 */
  4848. color: #fff;
  4849. font-size: 13px;
  4850. display: flex;
  4851. align-items: flex-start; /* 垂直居中 */
  4852. justify-content: center; /* 水平居中 */
  4853. }
  4854. .progress-text-label {
  4855. font-size: 12px;
  4856. margin-right: 2px;
  4857. }
  4858. .ques-flex {
  4859. display: flex;
  4860. align-items: center;
  4861. flex-direction: row;
  4862. justify-content: space-around;
  4863. }
  4864. .subname {
  4865. background-color: #00aa00;
  4866. color: #fff;
  4867. }
  4868. .subavt {
  4869. background-color: #fff;
  4870. border: 2rpx #0a0 solid;
  4871. color: #00aa00;
  4872. }
  4873. .boxweixin {
  4874. width: 44rpx;
  4875. height: 44rpx;
  4876. border-radius: 50%;
  4877. text-align: center;
  4878. line-height: 34rpx;
  4879. color: #0a0;
  4880. }
  4881. .boxnosel {
  4882. border: #757575 4rpx solid;
  4883. }
  4884. .boxsel {
  4885. border: #0a0 4rpx solid;
  4886. }
  4887. .button-container {
  4888. position: relative;
  4889. width: 240rpx;
  4890. }
  4891. .hidden-input {
  4892. position: absolute;
  4893. top: 0;
  4894. left: 0;
  4895. width: 100%;
  4896. height: 100%;
  4897. opacity: 0;
  4898. z-index: 2;
  4899. }
  4900. .custom-button {
  4901. position: relative;
  4902. z-index: 1;
  4903. /* 其他样式 */
  4904. width: 100%;
  4905. margin: 0 auto;
  4906. height: 80rpx;
  4907. line-height: 60rpx;
  4908. font-size: 28rpx;
  4909. padding: 10rpx 20rpx;
  4910. }
  4911. .submitname {
  4912. width: 90%;
  4913. margin: 0 auto;
  4914. text-align: center;
  4915. padding: 30rpx;
  4916. margin-top: 40rpx;
  4917. }
  4918. .sub {
  4919. background-color: #f0f0f0;
  4920. color: #0a0;
  4921. }
  4922. .subact {
  4923. background-color: #0a0;
  4924. color: #fff;
  4925. }
  4926. .userlogo {
  4927. height: 760rpx;
  4928. }
  4929. .getlogo {
  4930. width: 240rpx;
  4931. background-color: #fff;
  4932. // padding: 10rpx 20rpx;
  4933. }
  4934. @mixin u-flex($flexD, $alignI, $justifyC) {
  4935. display: flex;
  4936. flex-direction: $flexD;
  4937. align-items: $alignI;
  4938. justify-content: $justifyC;
  4939. }
  4940. .footer-tips {
  4941. position: fixed;
  4942. width: 100%;
  4943. bottom: 144rpx;
  4944. text-align: center;
  4945. font-family: PingFang SC, PingFang SC;
  4946. font-weight: 500;
  4947. font-size: 12px;
  4948. color: #bbb;
  4949. transform: scale(0.8);
  4950. }
  4951. .btns {
  4952. //position: relative;
  4953. width: 100%;
  4954. height: 96rpx;
  4955. display: flex;
  4956. align-items: center;
  4957. justify-content: space-between;
  4958. .rating-msg-input-shell {
  4959. flex: 1;
  4960. min-width: 0;
  4961. display: flex;
  4962. align-items: center;
  4963. background: #f5f5f5;
  4964. border-radius: 48rpx;
  4965. padding: 24rpx 30rpx;
  4966. box-sizing: border-box;
  4967. }
  4968. .rating-msg-media-pill {
  4969. position: relative;
  4970. flex-shrink: 0;
  4971. width: 64rpx;
  4972. height: 64rpx;
  4973. margin-right: 16rpx;
  4974. border-radius: 12rpx;
  4975. overflow: hidden;
  4976. }
  4977. .rating-msg-media-thumb {
  4978. width: 100%;
  4979. height: 100%;
  4980. display: block;
  4981. }
  4982. .rating-msg-media-badge {
  4983. position: absolute;
  4984. left: 0;
  4985. right: 0;
  4986. bottom: 0;
  4987. font-size: 18rpx;
  4988. color: #fff;
  4989. text-align: center;
  4990. line-height: 1.4;
  4991. background: rgba(0, 0, 0, 0.45);
  4992. }
  4993. .rating-msg-media-x {
  4994. position: absolute;
  4995. top: -4rpx;
  4996. right: -4rpx;
  4997. width: 32rpx;
  4998. height: 32rpx;
  4999. line-height: 32rpx;
  5000. text-align: center;
  5001. font-size: 28rpx;
  5002. color: #fff;
  5003. background: rgba(0, 0, 0, 0.5);
  5004. border-radius: 50%;
  5005. }
  5006. .rating-msg-send {
  5007. flex-shrink: 0;
  5008. padding: 0 12rpx 0 8rpx;
  5009. font-size: 28rpx;
  5010. color: #FF233C;
  5011. }
  5012. .rating-msg-input {
  5013. flex: 1;
  5014. min-width: 0;
  5015. font-size: 32rpx;
  5016. color: rgba(0, 0, 0, 0.85);
  5017. height: 48rpx;
  5018. line-height: 48rpx;
  5019. }
  5020. .rating-msg-input-trigger {
  5021. overflow: hidden;
  5022. }
  5023. .rating-msg-input-trigger-text {
  5024. display: block;
  5025. font-size: 32rpx;
  5026. overflow: hidden;
  5027. text-overflow: ellipsis;
  5028. white-space: nowrap;
  5029. color: rgba(0, 0, 0, 0.85);
  5030. &.is-ph {
  5031. color: rgba(0, 0, 0, 0.28);
  5032. }
  5033. }
  5034. .rating-msg-ph {
  5035. color: rgba(0, 0, 0, 0.28);
  5036. font-size: 32rpx;
  5037. }
  5038. .rating-msg-input-icon {
  5039. // width:40rpx;
  5040. // height:40rpx;
  5041. flex-shrink: 0;
  5042. padding-left:24rpx;
  5043. display:flex;
  5044. image{
  5045. width:40rpx;
  5046. height:40rpx
  5047. }
  5048. }
  5049. .author-btn {
  5050. // z-index: 100;
  5051. // position: absolute;
  5052. // width: 100%;
  5053. flex:1;
  5054. height: 96rpx;
  5055. background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
  5056. border-radius: 48rpx;
  5057. font-family: PingFangSC, PingFang SC;
  5058. font-weight: 600;
  5059. font-style: normal;
  5060. font-size: 40rpx;
  5061. color: #FFFFFF;
  5062. text-align: center;
  5063. line-height: 96rpx;
  5064. display: flex;
  5065. align-items: center;
  5066. justify-content: center;
  5067. image{
  5068. margin-left: 4rpx;
  5069. width: 40rpx;
  5070. height: 40rpx;
  5071. }
  5072. }
  5073. .author-cart{
  5074. padding-left: 40rpx;
  5075. display: flex;
  5076. align-items: center;
  5077. .more-box{
  5078. display: flex;
  5079. align-items: center;
  5080. flex-direction: column;
  5081. .tips{
  5082. font-family: PingFangSC, PingFang SC;
  5083. font-weight: 600;
  5084. font-size: 32rpx;
  5085. color: #222222;
  5086. line-height: 44rpx;
  5087. text-align: center;
  5088. margin-top: 12rpx;
  5089. }
  5090. image{
  5091. width: 80rpx;
  5092. height: 80rpx;
  5093. }
  5094. &:last-child{
  5095. margin-left: 40rpx;
  5096. }
  5097. }
  5098. .xianshi{
  5099. position: absolute;
  5100. z-index: 10;
  5101. right:20rpx;
  5102. bottom: 180rpx;
  5103. width: 214rpx;
  5104. height:90rpx;
  5105. }
  5106. }
  5107. }
  5108. .textOne {
  5109. overflow: hidden;
  5110. white-space: nowrap;
  5111. text-overflow: ellipsis;
  5112. }
  5113. .textTwo {
  5114. overflow: hidden;
  5115. text-overflow: ellipsis;
  5116. display: -webkit-box;
  5117. -webkit-line-clamp: 2;
  5118. -webkit-box-orient: vertical;
  5119. }
  5120. .header-nav {
  5121. height: 88rpx;
  5122. @include u-flex(row, center, flex-start);
  5123. overflow: hidden;
  5124. background-color: #fff;
  5125. box-sizing: border-box;
  5126. .header-title {
  5127. text-align: center;
  5128. overflow: hidden;
  5129. white-space: nowrap;
  5130. text-overflow: ellipsis;
  5131. padding: 0 10rpx 0 100rpx;
  5132. font-family: PingFang SC, PingFang SC;
  5133. font-weight: 500;
  5134. font-size: 15px;
  5135. color: #000;
  5136. box-sizing: border-box;
  5137. }
  5138. }
  5139. .reward-list {
  5140. width: 100%;
  5141. margin-top: 20rpx;
  5142. margin-bottom: -40rpx;
  5143. &-group {
  5144. font-family: PingFang SC, PingFang SC;
  5145. font-weight: 400;
  5146. font-size: 14px;
  5147. color: #222222;
  5148. @include u-flex(row, center, center);
  5149. }
  5150. &-option {
  5151. @include u-flex(row, center, flex-start);
  5152. &:first-child {
  5153. margin-right: 40rpx;
  5154. }
  5155. }
  5156. }
  5157. .err {
  5158. color: #f56c6c !important;
  5159. }
  5160. .kfqrcode-box {
  5161. background-color: #fff;
  5162. border-radius: 16rpx;
  5163. max-width: 560rpx;
  5164. padding: 60rpx 40rpx;
  5165. margin-top: -100rpx;
  5166. box-sizing: border-box;
  5167. @include u-flex(column, center, flex-start);
  5168. font-family: PingFang SC, PingFang SC;
  5169. font-weight: 400;
  5170. font-size: 34rpx;
  5171. color: #222;
  5172. position: relative;
  5173. text-align: center;
  5174. .kfqrcode {
  5175. // height: 460rpx;
  5176. width: 460rpx;
  5177. }
  5178. }
  5179. .kfqrcode-close {
  5180. width: 64rpx;
  5181. height: 64rpx;
  5182. position: absolute;
  5183. bottom: -100rpx;
  5184. left: 50%;
  5185. transform: translateX(-50%);
  5186. }
  5187. .tipsPopup-mask {
  5188. position: relative;
  5189. width: 560rpx;
  5190. background-color: transparent;
  5191. .red_envelope_top {
  5192. width: 480rpx;
  5193. height: 360rpx;
  5194. margin: 0 auto;
  5195. display: inherit;
  5196. }
  5197. }
  5198. .tipsPopup-btn-box {
  5199. width: 456rpx;
  5200. height: 104rpx;
  5201. padding: 4rpx;
  5202. box-sizing: border-box;
  5203. background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
  5204. border-radius: 52rpx;
  5205. }
  5206. .tipsPopup-btn {
  5207. width: 100%;
  5208. height: 100%;
  5209. background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
  5210. border-radius: 52rpx 52rpx 52rpx 52rpx;
  5211. font-family: PingFang SC, PingFang SC;
  5212. font-weight: 500;
  5213. font-size: 36rpx;
  5214. color: #FFFFFF;
  5215. line-height: 96rpx;
  5216. text-align: center;
  5217. }
  5218. .tipsPopup {
  5219. width: 560rpx;
  5220. padding: 12rpx;
  5221. margin-top: -72rpx;
  5222. box-sizing: border-box;
  5223. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  5224. border-radius: 32rpx 32rpx 32rpx 32rpx;
  5225. position: relative;
  5226. &-close {
  5227. width: 64rpx;
  5228. height: 64rpx;
  5229. position: absolute;
  5230. right: 0;
  5231. top: -188rpx;
  5232. }
  5233. &-line {
  5234. padding: 3rpx;
  5235. box-sizing: border-box;
  5236. background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
  5237. border-radius: 24rpx;
  5238. }
  5239. &-box {
  5240. padding: 0 40rpx 40rpx 40rpx;
  5241. box-sizing: border-box;
  5242. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  5243. border-radius: 24rpx;
  5244. @include u-flex(column, center, flex-start);
  5245. }
  5246. &-head {
  5247. @include u-flex(row, center, center);
  5248. &-title {
  5249. width: 364rpx;
  5250. height: auto;
  5251. margin-top: -22rpx;
  5252. }
  5253. }
  5254. &-content {
  5255. margin: 48rpx 0;
  5256. font-family: PingFang SC, PingFang SC;
  5257. font-weight: 500;
  5258. font-size: 32rpx;
  5259. color: #222222;
  5260. text-align: center;
  5261. &-title {
  5262. margin-bottom: 26rpx;
  5263. font-weight: 600;
  5264. font-size: 40rpx;
  5265. color: #FF5C03;
  5266. }
  5267. }
  5268. }
  5269. // 商品卡片样式
  5270. .goods-card {
  5271. position: absolute;
  5272. right: 24rpx;
  5273. bottom: 280rpx;
  5274. z-index: 9999;
  5275. width: 300rpx;
  5276. background: #FFFFFF;
  5277. border-radius: 20rpx;
  5278. overflow: visible;
  5279. &-hot {
  5280. position: absolute;
  5281. top: -66rpx;
  5282. left: 30rpx;
  5283. z-index: 11;
  5284. display: flex;
  5285. flex-direction: row;
  5286. align-items: center;
  5287. }
  5288. &-hot-flame {
  5289. font-size: 24rpx;
  5290. line-height: 1;
  5291. margin-right: 4rpx;
  5292. }
  5293. &-hot-label {
  5294. font-size: 24rpx;
  5295. font-weight: 600;
  5296. color: #FFFFFF;
  5297. line-height: 44rpx;
  5298. }
  5299. &-hot-count {
  5300. position: absolute;
  5301. left:130rpx;
  5302. font-family: PingFangSC, PingFang SC;
  5303. font-weight: 600;
  5304. font-size: 40rpx;
  5305. color: #FFFFFF;
  5306. line-height: 56rpx;
  5307. text-align: justify;
  5308. }
  5309. &-inner {
  5310. display: flex;
  5311. flex-direction:column;
  5312. border-radius: 20rpx;
  5313. overflow: hidden;
  5314. }
  5315. &-img {
  5316. width:300rpx;
  5317. height:300rpx;
  5318. flex-shrink: 0;
  5319. }
  5320. &-info {
  5321. flex: 1;
  5322. padding: 12rpx;
  5323. display: flex;
  5324. flex-direction: column;
  5325. justify-content: space-between;
  5326. }
  5327. &-title {
  5328. font-family: PingFangSC, PingFang SC;
  5329. font-weight: 600;
  5330. font-size: 32rpx;
  5331. color: rgba(0,0,0,0.85);
  5332. line-height: 44rpx;
  5333. overflow: hidden;
  5334. text-overflow: ellipsis;
  5335. display: -webkit-box;
  5336. -webkit-line-clamp: 2;
  5337. -webkit-box-orient: vertical;
  5338. }
  5339. &-bottom {
  5340. margin-top: 12rpx;
  5341. display: flex;
  5342. flex-direction: row;
  5343. align-items: center;
  5344. //justify-content: space-between;
  5345. }
  5346. &-tag {
  5347. position: relative;
  5348. width: 120rpx;
  5349. height: 44rpx;
  5350. }
  5351. &-tag-bg {
  5352. width: 100%;
  5353. height: 100%;
  5354. }
  5355. &-tag-text {
  5356. position: absolute;
  5357. left: 0;
  5358. top: 0;
  5359. width: 100%;
  5360. height: 100%;
  5361. text-align: center;
  5362. line-height: 44rpx;
  5363. font-size: 24rpx;
  5364. color: #FFFFFF;
  5365. font-weight: 500;
  5366. }
  5367. &-price{
  5368. margin-left: 14rpx;
  5369. display: flex;
  5370. align-items:baseline;
  5371. .unit{
  5372. font-family: PingFangSC, PingFang SC;
  5373. font-weight: 600;
  5374. font-size: 32rpx;
  5375. color: #FF233C;
  5376. }
  5377. .price{
  5378. font-family: PingFangSC, PingFang SC;
  5379. font-weight: 600;
  5380. font-size: 48rpx;
  5381. color: #FF233C;
  5382. }
  5383. }
  5384. .close-box{
  5385. position: absolute;
  5386. top:20rpx;
  5387. right:20rpx;
  5388. image{
  5389. width: 30rpx;
  5390. height: 30rpx;
  5391. }
  5392. }
  5393. }
  5394. /* 商品卡片样式 */
  5395. .goods-cover {
  5396. /* cover-view 在 video 内使用 absolute 比 fixed 更稳定 */
  5397. position: absolute;
  5398. right: 12px;
  5399. width: 150px;
  5400. z-index: 99999;
  5401. border-radius: 10px;
  5402. overflow: visible;
  5403. bottom: 40px;
  5404. &-hot {
  5405. // margin-left: 15px;
  5406. margin-bottom: 15px;
  5407. display: flex;
  5408. flex-direction: row;
  5409. align-items: center;
  5410. position: relative;
  5411. }
  5412. &-hot-text {
  5413. position: absolute;
  5414. left:85px;
  5415. font-family: PingFangSC, PingFang SC;
  5416. font-weight: 600;
  5417. font-size: 20px;
  5418. color: #FFFFFF;
  5419. line-height: 28px;
  5420. text-align: justify;
  5421. }
  5422. &-inner {
  5423. display: flex;
  5424. flex-direction:column;
  5425. border-radius: 10px;
  5426. overflow: hidden;
  5427. background: #FFFFFF;
  5428. position: relative;
  5429. }
  5430. &-img {
  5431. width:150px;
  5432. height:150px;
  5433. flex-shrink: 0;
  5434. }
  5435. &-info {
  5436. flex: 1;
  5437. padding: 6px;
  5438. display: flex;
  5439. flex-direction: column;
  5440. justify-content: space-between;
  5441. }
  5442. &-title {
  5443. font-family: PingFangSC, PingFang SC;
  5444. font-weight: 600;
  5445. font-size: 16px;
  5446. color: #000000D9;
  5447. line-height: 22px;
  5448. overflow: hidden;
  5449. width: 150px; /* 必须给宽度 */
  5450. white-space: nowrap; /* 关键 */
  5451. text-overflow: ellipsis;
  5452. }
  5453. &-bottom {
  5454. margin-top: 6px;
  5455. display: flex;
  5456. flex-direction: row;
  5457. align-items: center;
  5458. }
  5459. &-tag {
  5460. position: relative;
  5461. width: 60px;
  5462. height: 22px;
  5463. }
  5464. &-tag-bg {
  5465. width: 100%;
  5466. height: 100%;
  5467. }
  5468. &-tag-text {
  5469. position: absolute;
  5470. left: 0;
  5471. top: 0;
  5472. width: 100%;
  5473. height: 100%;
  5474. text-align: center;
  5475. line-height: 22px;
  5476. font-size: 12px;
  5477. color: #FFFFFF;
  5478. font-weight: 500;
  5479. }
  5480. &-price{
  5481. margin-left: 7px;
  5482. display: flex;
  5483. align-items:baseline;
  5484. .unit{
  5485. font-family: PingFangSC, PingFang SC;
  5486. font-weight: 600;
  5487. font-size: 16px;
  5488. color: #FF233C;
  5489. }
  5490. .price{
  5491. font-family: PingFangSC, PingFang SC;
  5492. font-weight: 600;
  5493. font-size: 24px;
  5494. color: #FF233C;
  5495. }
  5496. }
  5497. .close-box{
  5498. position: absolute;
  5499. top:10px;
  5500. right:10px;
  5501. z-index:9;
  5502. cover-image{
  5503. width: 15px;
  5504. height: 15px;
  5505. }
  5506. }
  5507. }
  5508. .video-controls-box {
  5509. width: 100%;
  5510. height: 300rpx;
  5511. overflow: hidden;
  5512. position: absolute;
  5513. bottom: 0;
  5514. left: 0;
  5515. z-index: 2;
  5516. background: rgba(0, 0, 0, 0.2);
  5517. .video-play {
  5518. height: 72rpx;
  5519. width: 72rpx;
  5520. position: absolute;
  5521. top: 50%;
  5522. left: 50%;
  5523. transform: translate(-50%, -50%);
  5524. }
  5525. }
  5526. .video-controls {
  5527. width: 100%;
  5528. height: 80rpx;
  5529. padding: 0 28rpx;
  5530. box-sizing: border-box;
  5531. position: absolute;
  5532. bottom: 0;
  5533. left: 0;
  5534. display: flex;
  5535. align-items: center;
  5536. justify-content: space-between;
  5537. background: linear-gradient(to top, #222 0%, transparent 80%);
  5538. .video-icon {
  5539. height: 44rpx;
  5540. width: 44rpx;
  5541. }
  5542. }
  5543. .errQuesbox {
  5544. width: 100%;
  5545. max-height: 260rpx;
  5546. overflow-y: auto;
  5547. margin-top: 24rpx;
  5548. font-family: PingFang SC, PingFang SC;
  5549. font-weight: 500;
  5550. font-size: 30rpx;
  5551. color: #222222;
  5552. &-item {
  5553. width: 100%;
  5554. height: 128rpx;
  5555. line-height: 128rpx;
  5556. margin-bottom: 24rpx;
  5557. padding: 0 30rpx;
  5558. box-sizing: border-box;
  5559. overflow: hidden;
  5560. background: #fff;
  5561. border-radius: 16rpx 16rpx 16rpx 16rpx;
  5562. position: relative;
  5563. &::after {
  5564. content: "题目";
  5565. min-width: 64rpx;
  5566. height: 36rpx;
  5567. padding: 0 12rpx;
  5568. line-height: 36rpx;
  5569. background: #FF5C03;
  5570. box-sizing: border-box;
  5571. border-radius: 0rpx 0rpx 16rpx 0rpx;
  5572. text-align: center;
  5573. font-family: PingFang SC, PingFang SC;
  5574. font-weight: 500;
  5575. font-size: 20rpx;
  5576. color: #fff;
  5577. position: absolute;
  5578. left: 0;
  5579. top: 0;
  5580. }
  5581. }
  5582. }
  5583. .bg {
  5584. background: #fff !important;
  5585. }
  5586. .timepopbox {
  5587. width: 560rpx;
  5588. padding: 32rpx;
  5589. box-sizing: border-box;
  5590. }
  5591. .answerPopup {
  5592. &-box {
  5593. width: 560rpx;
  5594. background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
  5595. border-radius: 32rpx 32rpx 32rpx 32rpx;
  5596. background-color: #fff;
  5597. font-weight: 400;
  5598. padding: 32rpx;
  5599. box-sizing: border-box;
  5600. position: relative;
  5601. @include u-flex(column, center, flex-start);
  5602. font-family: PingFang SC, PingFang SC;
  5603. font-weight: 400;
  5604. .tipimg {
  5605. width: 206rpx;
  5606. height: 206rpx;
  5607. margin-bottom: 16rpx;
  5608. }
  5609. }
  5610. &-title {
  5611. font-weight: 600;
  5612. font-size: 36rpx;
  5613. color: #222222;
  5614. }
  5615. &-desc {
  5616. margin-top: 10rpx;
  5617. font-size: 28rpx;
  5618. color: #757575;
  5619. }
  5620. &-btn {
  5621. width: 464rpx;
  5622. height: 84rpx;
  5623. margin-top: 54rpx;
  5624. margin-bottom: 16rpx;
  5625. background: #FF5C03;
  5626. border-radius: 42rpx;
  5627. font-weight: 500;
  5628. font-size: 32rpx;
  5629. color: #FFFFFF;
  5630. text-align: center;
  5631. line-height: 84rpx;
  5632. }
  5633. }
  5634. .popupbox {
  5635. width: 100%;
  5636. background-color: #fff;
  5637. border-radius: 16rpx 16rpx 0 0;
  5638. padding: 24rpx 32rpx;
  5639. position: relative;
  5640. &-head {
  5641. height: 60rpx;
  5642. margin-bottom: 30rpx;
  5643. text-align: center;
  5644. overflow-y: auto;
  5645. color: #414858;
  5646. font-size: 32rpx;
  5647. font-weight: bold;
  5648. position: relative;
  5649. .close-icon {
  5650. position: absolute;
  5651. right: 0;
  5652. top: 0;
  5653. height: 40rpx;
  5654. width: 40rpx;
  5655. }
  5656. }
  5657. &-content {
  5658. height: 20vh;
  5659. overflow-y: auto;
  5660. display: flex;
  5661. align-items: flex-start;
  5662. flex-wrap: wrap;
  5663. gap: 32rpx;
  5664. .line-item {
  5665. display: inline-block;
  5666. min-width: 200rpx;
  5667. min-height: 60rpx;
  5668. padding: 0 20rpx;
  5669. box-sizing: border-box;
  5670. border-radius: 50rpx;
  5671. overflow: hidden;
  5672. background-color: #f7f7f7;
  5673. text-align: center;
  5674. color: #414858;
  5675. font-size: 28rpx;
  5676. line-height: 60rpx;
  5677. }
  5678. .line-active {
  5679. color: #f56c6c !important;
  5680. background-color: #fef0f0 !important;
  5681. }
  5682. }
  5683. }
  5684. .content {
  5685. //padding-bottom: calc(var(--window-bottom) + 100rpx);
  5686. .video-box {
  5687. width: 100%;
  5688. height: 420rpx;
  5689. overflow: hidden;
  5690. position: relative;
  5691. #myVideo {
  5692. width: 100%;
  5693. height: 100%;
  5694. }
  5695. }
  5696. .video-poster {
  5697. width: 100%;
  5698. height: 420rpx;
  5699. }
  5700. .miantitlebox {
  5701. padding: 30rpx 0;
  5702. border-bottom: 2rpx solid #F5F7FA;
  5703. font-family: PingFang SC, PingFang SC;
  5704. font-weight: 500;
  5705. font-size: 40rpx;
  5706. color: #222222;
  5707. }
  5708. .subtitlebox {
  5709. padding: 30rpx 0;
  5710. border-bottom: 2rpx solid #F5F7FA;
  5711. font-family: PingFang SC, PingFang SC;
  5712. font-weight: 500;
  5713. font-size: 40rpx;
  5714. color: #222222;
  5715. }
  5716. .title-content {
  5717. padding: 0 32rpx;
  5718. background-color: #fff;
  5719. font-size: 28rpx;
  5720. line-height: 1.6;
  5721. .title {
  5722. font-size: 36rpx;
  5723. font-weight: 500;
  5724. color: #414858;
  5725. }
  5726. .time-or-subtitle {
  5727. margin-top: 12rpx;
  5728. color: #666666;
  5729. }
  5730. }
  5731. .descbox {
  5732. padding: 36rpx 32rpx;
  5733. margin-bottom: 20rpx;
  5734. background-color: #fff;
  5735. font-family: PingFang SC, PingFang SC;
  5736. font-weight: 400;
  5737. font-size: 28rpx;
  5738. color: #222222;
  5739. line-height: 42rpx;
  5740. word-break: break-word;
  5741. &-title {
  5742. margin-bottom: 24rpx;
  5743. font-weight: 500;
  5744. font-size: 32rpx;
  5745. }
  5746. &-info {
  5747. margin-bottom: 24rpx;
  5748. @include u-flex(row, center, space-between);
  5749. font-size: 26rpx;
  5750. color: #757575;
  5751. &-l {
  5752. flex: 1;
  5753. @include u-flex(row, center, flex-start);
  5754. }
  5755. &-time {
  5756. margin-left: 18rpx;
  5757. padding-left: 18rpx;
  5758. position: relative;
  5759. &::after {
  5760. content: "";
  5761. width: 4rpx;
  5762. height: 4rpx;
  5763. background: #999999;
  5764. border-radius: 50%;
  5765. position: absolute;
  5766. left: 0;
  5767. top: 50%;
  5768. transform: translateY(-50%);
  5769. }
  5770. }
  5771. &-r {
  5772. background: transparent;
  5773. }
  5774. }
  5775. &-desc {
  5776. overflow: hidden;
  5777. position: relative;
  5778. }
  5779. }
  5780. .expand {
  5781. flex-shrink: 0;
  5782. @include u-flex(row, center, flex-end);
  5783. color: #FF5C03;
  5784. font-weight: 400;
  5785. font-size: 24rpx;
  5786. image {
  5787. width: 32rpx;
  5788. height: 32rpx;
  5789. }
  5790. }
  5791. .expand-ab {
  5792. position: absolute;
  5793. top: 0;
  5794. right: 0;
  5795. box-shadow: -50rpx 0 20rpx 8rpx #FFFFFF;
  5796. background-color: #fff;
  5797. }
  5798. .ques-content {
  5799. background-color: #fff;
  5800. padding: 40rpx 32rpx;
  5801. box-sizing: border-box;
  5802. font-family: PingFang SC, PingFang SC;
  5803. font-weight: 400;
  5804. font-size: 28rpx;
  5805. color: #222222;
  5806. }
  5807. .ques-content-tit {
  5808. font-family: PingFangSC, PingFang SC;
  5809. font-weight: 600;
  5810. font-size: 48rpx;
  5811. color: rgba(0,0,0,0.85);
  5812. line-height: 66rpx;
  5813. }
  5814. .ques-title {
  5815. margin: 48rpx 0 34rpx 0;
  5816. font-weight: 600;
  5817. font-size: 40rpx;
  5818. white-space: normal;
  5819. }
  5820. .ques-type {
  5821. flex-shrink: 0;
  5822. min-width: 72rpx;
  5823. min-height: 40rpx;
  5824. padding: 0 12rpx;
  5825. margin: 0 12rpx;
  5826. box-sizing: border-box;
  5827. background: #FF5C03;
  5828. border-radius: 8rpx 8rpx 8rpx 8rpx;
  5829. line-height: 40rpx;
  5830. text-align: center;
  5831. font-family: PingFang SC, PingFang SC;
  5832. font-weight: 400;
  5833. font-size: 24rpx;
  5834. color: #FFFFFF;
  5835. display: inline-block;
  5836. }
  5837. .ques-option {
  5838. min-height: 88rpx;
  5839. padding: 24rpx 32rpx;
  5840. box-sizing: border-box;
  5841. margin-bottom: 24rpx;
  5842. background: #F5F7FA;
  5843. border-radius: 16rpx 16rpx 16rpx 16rpx;
  5844. display: flex;
  5845. align-items: center;
  5846. &-active {
  5847. color: #FF5C03 !important;
  5848. background: #FCF0E7 !important;
  5849. }
  5850. }
  5851. .video-line {
  5852. min-width: 140rpx;
  5853. max-width: 200rpx;
  5854. height: 60rpx;
  5855. padding: 0 20rpx;
  5856. box-sizing: border-box;
  5857. border-radius: 50rpx 0 0 50rpx;
  5858. overflow: hidden;
  5859. background-color: #fff;
  5860. text-align: center;
  5861. color: #888;
  5862. font-size: 28rpx;
  5863. line-height: 60rpx;
  5864. display: inline-flex;
  5865. align-items: center;
  5866. justify-content: center;
  5867. position: fixed;
  5868. right: 0;
  5869. z-index: 9;
  5870. bottom: calc(var(--window-bottom) + 280rpx);
  5871. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
  5872. image {
  5873. flex-shrink: 0;
  5874. height: 30rpx;
  5875. width: 30rpx;
  5876. margin-right: 6rpx;
  5877. }
  5878. }
  5879. /* 精选留言:图片/视频自定义预览(设计稿弹窗) */
  5880. .fc-media-preview-mask {
  5881. position: fixed;
  5882. left: 0;
  5883. right: 0;
  5884. top: 0;
  5885. bottom: 0;
  5886. z-index: 10050;
  5887. background: rgba(0, 0, 0, 0.72);
  5888. display: flex;
  5889. align-items: center;
  5890. justify-content: center;
  5891. padding: 32rpx 24rpx calc(32rpx + env(safe-area-inset-bottom));
  5892. box-sizing: border-box;
  5893. }
  5894. .fc-media-preview-card {
  5895. width: 100%;
  5896. max-width: 630rpx;
  5897. overflow: hidden;
  5898. display: flex;
  5899. flex-direction: column;
  5900. align-items: center;
  5901. }
  5902. .fc-media-preview-img-box {
  5903. width: 100%;
  5904. height: 62vh;
  5905. max-height: 820rpx;
  5906. }
  5907. .fc-media-preview-slide {
  5908. width: 100%;
  5909. height: 100%;
  5910. display: flex;
  5911. align-items: center;
  5912. justify-content: center;
  5913. padding: 16rpx;
  5914. box-sizing: border-box;
  5915. }
  5916. .fc-media-preview-main-img {
  5917. width: 100%;
  5918. height: 100%;
  5919. max-height: 100%;
  5920. }
  5921. .fc-media-preview-video-box {
  5922. width: 100%;
  5923. height: 62vh;
  5924. max-height: 820rpx;
  5925. background: #000;
  5926. display: flex;
  5927. align-items: center;
  5928. justify-content: center;
  5929. }
  5930. .fc-media-preview-video {
  5931. width: 100%;
  5932. height: 100%;
  5933. }
  5934. .fc-media-preview-footer {
  5935. display: flex;
  5936. flex-direction: row;
  5937. align-items: center;
  5938. padding:30rpx;
  5939. // gap: 20rpx;
  5940. }
  5941. .fc-media-preview-thumbs {
  5942. flex: 1;
  5943. min-width: 0;
  5944. height: 112rpx;
  5945. white-space: nowrap;
  5946. }
  5947. .fc-media-preview-thumbs-inner {
  5948. display: inline-flex;
  5949. flex-direction: row;
  5950. align-items: center;
  5951. gap: 16rpx;
  5952. padding-right: 8rpx;
  5953. }
  5954. .fc-media-preview-thumb {
  5955. width: 96rpx;
  5956. height: 96rpx;
  5957. flex-shrink: 0;
  5958. border-radius: 12rpx;
  5959. border: 3rpx solid transparent;
  5960. box-sizing: border-box;
  5961. background: #333;
  5962. }
  5963. .fc-media-preview-thumb--active {
  5964. border-color: #ff5c03;
  5965. }
  5966. .fc-media-preview-thumbs-spacer {
  5967. flex: 1;
  5968. min-height: 1rpx;
  5969. }
  5970. .fc-media-preview-close {
  5971. flex-shrink: 0;
  5972. display: flex;
  5973. align-items: center;
  5974. justify-content: center;
  5975. }
  5976. .fc-media-preview-close-x {
  5977. font-size: 44rpx;
  5978. line-height: 1;
  5979. color: #333;
  5980. font-weight: 300;
  5981. margin-top: -4rpx;
  5982. }
  5983. .featured-comment-composer-mask {
  5984. position: fixed;
  5985. left: 0;
  5986. right: 0;
  5987. top: 0;
  5988. bottom: 0;
  5989. background: rgba(0, 0, 0, 0.35);
  5990. z-index: 9998;
  5991. }
  5992. .featured-comment-composer-wrap {
  5993. position: fixed;
  5994. left: 0;
  5995. right: 0;
  5996. z-index: 9999;
  5997. background: #fff;
  5998. border-radius: 24rpx 24rpx 0 0;
  5999. padding: 20rpx 24rpx;
  6000. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  6001. box-sizing: border-box;
  6002. box-shadow: 0 -4rpx 24rpx rgba(0, 0, 0, 0.06);
  6003. }
  6004. .featured-comment-composer-inner {
  6005. display: flex;
  6006. align-items: center;
  6007. gap: 24rpx;
  6008. }
  6009. .featured-comment-composer-input-row {
  6010. flex: 1;
  6011. min-width: 0;
  6012. display: flex;
  6013. align-items: flex-start;
  6014. background: #f5f5f5;
  6015. border-radius: 24rpx;
  6016. padding:20rpx;
  6017. box-sizing: border-box;
  6018. }
  6019. .fc-composer-input {
  6020. flex: 1;
  6021. min-width: 0;
  6022. font-size: 32rpx;
  6023. color: rgba(0, 0, 0, 0.85);
  6024. height:88rpx;
  6025. line-height: 44rpx;
  6026. }
  6027. .fc-composer-ph {
  6028. color: rgba(0, 0, 0, 0.28);
  6029. font-size: 32rpx;
  6030. }
  6031. .fc-composer-input-icon {
  6032. flex-shrink: 0;
  6033. margin-left: 12rpx;
  6034. display: flex;
  6035. align-items: center;
  6036. justify-content: center;
  6037. image {
  6038. width: 40rpx;
  6039. height: 40rpx;
  6040. }
  6041. }
  6042. .fc-composer-media-pill {
  6043. position: relative;
  6044. flex-shrink: 0;
  6045. width: 64rpx;
  6046. height: 64rpx;
  6047. border-radius: 12rpx;
  6048. overflow: hidden;
  6049. }
  6050. .fc-composer-media-thumb {
  6051. width: 100%;
  6052. height: 100%;
  6053. display: block;
  6054. }
  6055. .fc-composer-media-badge {
  6056. position: absolute;
  6057. left: 0;
  6058. right: 0;
  6059. bottom: 0;
  6060. font-size: 18rpx;
  6061. color: #fff;
  6062. text-align: center;
  6063. line-height: 1.4;
  6064. background: rgba(0, 0, 0, 0.45);
  6065. }
  6066. .fc-composer-media-x {
  6067. position: absolute;
  6068. top: -4rpx;
  6069. right: -4rpx;
  6070. width: 32rpx;
  6071. height: 32rpx;
  6072. line-height: 32rpx;
  6073. text-align: center;
  6074. font-size: 28rpx;
  6075. color: #fff;
  6076. background: rgba(0, 0, 0, 0.5);
  6077. border-radius: 50%;
  6078. }
  6079. .featured-comment-composer-publish {
  6080. flex-shrink: 0;
  6081. padding: 20rpx 40rpx;
  6082. background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
  6083. font-family: PingFangSC, PingFang SC;
  6084. font-weight: 600;
  6085. font-size: 40rpx;
  6086. color: #FFFFFF;
  6087. line-height: 56rpx;
  6088. text-align: center;
  6089. border-radius: 48rpx;
  6090. }
  6091. .footer {
  6092. //border-top: 1rpx solid #ededef;
  6093. background: #fff;
  6094. width: 100%;
  6095. position: fixed;
  6096. bottom: 0;
  6097. padding: 32rpx;
  6098. padding-bottom:68rpx;
  6099. box-sizing: border-box;
  6100. z-index: 0;
  6101. &-btn {
  6102. width: 100%;
  6103. height: 98rpx;
  6104. background: #FF5C03;
  6105. border-radius: 49rpx 49rpx 49rpx 49rpx;
  6106. line-height: 98rpx;
  6107. text-align: center;
  6108. font-family: PingFang SC, PingFang SC;
  6109. font-weight: 600;
  6110. font-size: 32rpx;
  6111. color: #FFFFFF;
  6112. @include u-flex(row, center, center);
  6113. &-img {
  6114. flex-shrink: 0;
  6115. width: 144rpx;
  6116. height: 144rpx;
  6117. margin-right: 8rpx;
  6118. margin-top: -24rpx;
  6119. }
  6120. }
  6121. &-btn-border {
  6122. position: relative;
  6123. &::after {
  6124. content: "";
  6125. background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  6126. position: absolute;
  6127. top: -2rpx;
  6128. left: 0;
  6129. height: 103rpx;
  6130. width: 100%;
  6131. z-index: -1;
  6132. border-radius: 49rpx 49rpx 49rpx 49rpx;
  6133. box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
  6134. overflow: hidden;
  6135. }
  6136. }
  6137. }
  6138. }
  6139. .agreement {
  6140. display: inline-flex;
  6141. margin-top: 16rpx;
  6142. font-size: 24rpx;
  6143. color: #525252;
  6144. align-items: center;
  6145. justify-content: center;
  6146. }
  6147. .nocourse {
  6148. display: flex;
  6149. flex-direction: column;
  6150. align-items: center;
  6151. padding-bottom: 88rpx;
  6152. justify-content: center;
  6153. font-family: PingFang SC, PingFang SC;
  6154. font-weight: 400;
  6155. font-size: 32rpx;
  6156. color: #757575;
  6157. line-height: 48rpx;
  6158. text-align: center;
  6159. image {
  6160. width: 328rpx;
  6161. height: auto;
  6162. margin-bottom: 30rpx;
  6163. }
  6164. }
  6165. .logo {
  6166. display: inline-block;
  6167. width: 30px;
  6168. height: auto;
  6169. margin: 20px 0 0 10px;
  6170. pointer-events: none;
  6171. object-fit: cover;
  6172. }
  6173. .logo-full {
  6174. display: inline-block;
  6175. width: 40px;
  6176. height: auto;
  6177. margin: 50px 0 0 30px;
  6178. pointer-events: none;
  6179. object-fit: cover;
  6180. }
  6181. </style>