vendor.js 608 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function _toPropertyKey(arg) {
  84. var key = toPrimitive(arg, "string");
  85. return _typeof(key) === "symbol" ? key : String(key);
  86. }
  87. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 13:
  90. /*!*******************************************************!*\
  91. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  92. \*******************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports) {
  95. function _typeof(obj) {
  96. "@babel/helpers - typeof";
  97. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  98. return typeof obj;
  99. } : function (obj) {
  100. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  101. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  102. }
  103. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  104. /***/ }),
  105. /***/ 135:
  106. /*!*****************************************!*\
  107. !*** D:/工作/项目2/亲家母/qjm/api/activity.js ***!
  108. \*****************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. "use strict";
  112. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  113. Object.defineProperty(exports, "__esModule", {
  114. value: true
  115. });
  116. exports.add_article = add_article;
  117. exports.article_good = article_good;
  118. exports.article_poster = article_poster;
  119. exports.delete_article = delete_article;
  120. exports.delete_comment = delete_comment;
  121. exports.live = live;
  122. exports.my_article = my_article;
  123. exports.my_detail = my_detail;
  124. exports.my_reply = my_reply;
  125. exports.my_replylist = my_replylist;
  126. exports.reply_detail = reply_detail;
  127. exports.reply_good = reply_good;
  128. exports.reply_poster = reply_poster;
  129. exports.reply_save = reply_save;
  130. exports.reply_savelist = reply_savelist;
  131. exports.save_comment = save_comment;
  132. exports.short_link = short_link;
  133. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request.js */ 72));
  134. // 删除草稿
  135. function delete_comment(data, id) {
  136. return (0, _request.default)({
  137. url: '/api/order/delete_comment/' + id,
  138. method: 'post',
  139. data: data
  140. });
  141. }
  142. // 保存草稿
  143. function save_comment(data) {
  144. return (0, _request.default)({
  145. url: '/api/order/save_comment',
  146. method: 'post',
  147. data: data
  148. });
  149. }
  150. // 我的评价详情
  151. function my_reply(data, id) {
  152. return (0, _request.default)({
  153. url: '/api/reply/my/' + id,
  154. method: 'get',
  155. data: data
  156. });
  157. }
  158. // 我的评价
  159. function my_replylist(data) {
  160. return (0, _request.default)({
  161. url: '/api/reply/my',
  162. method: 'get',
  163. data: data
  164. });
  165. }
  166. // 评价详情
  167. function reply_detail(data, id) {
  168. return (0, _request.default)({
  169. url: '/api/reply/detail/' + id,
  170. method: 'get',
  171. data: data
  172. });
  173. }
  174. // 评价点赞
  175. function reply_good(data, id) {
  176. return (0, _request.default)({
  177. url: '/api/reply/good/' + id,
  178. method: 'post',
  179. data: data
  180. });
  181. }
  182. // 文章点赞
  183. function article_good(data, id) {
  184. return (0, _request.default)({
  185. url: '/api/article/good/' + id,
  186. method: 'post',
  187. data: data
  188. });
  189. }
  190. // 我的草稿详情
  191. function reply_save(data, id) {
  192. return (0, _request.default)({
  193. url: '/api/reply/save/' + id,
  194. method: 'get',
  195. data: data
  196. });
  197. }
  198. // 我的草稿
  199. function reply_savelist(data) {
  200. return (0, _request.default)({
  201. url: '/api/reply/save',
  202. method: 'get',
  203. data: data
  204. });
  205. }
  206. // 直播列表
  207. function live(data) {
  208. return (0, _request.default)({
  209. url: '/api/wechat/live',
  210. method: 'get',
  211. data: data
  212. });
  213. }
  214. // 生成链接
  215. function short_link(data) {
  216. return (0, _request.default)({
  217. url: '/api/wechat/short_link',
  218. method: 'post',
  219. data: data
  220. });
  221. }
  222. // 分享海报
  223. function reply_poster(data, id) {
  224. return (0, _request.default)({
  225. url: '/api/reply/poster/' + id,
  226. method: 'post',
  227. data: data
  228. });
  229. }
  230. // 文章海报
  231. function article_poster(data, id) {
  232. return (0, _request.default)({
  233. url: '/api/article/poster/' + id,
  234. method: 'post',
  235. data: data
  236. });
  237. }
  238. // 我的文章
  239. function my_article(data, id) {
  240. return (0, _request.default)({
  241. url: '/api/article/my/' + id,
  242. method: 'get',
  243. data: data
  244. });
  245. }
  246. // 我的文章详情
  247. function my_detail(data, id) {
  248. return (0, _request.default)({
  249. url: '/api/article/my_detail/' + id,
  250. method: 'get',
  251. data: data
  252. });
  253. }
  254. // 删除文章
  255. function delete_article(data, id) {
  256. return (0, _request.default)({
  257. url: '/api/article/delete/' + id,
  258. method: 'post',
  259. data: data
  260. });
  261. }
  262. // 新增 修改文章
  263. function add_article(data) {
  264. return (0, _request.default)({
  265. url: '/api/article/add',
  266. method: 'post',
  267. data: data
  268. });
  269. }
  270. /***/ }),
  271. /***/ 136:
  272. /*!****************************************************!*\
  273. !*** D:/工作/项目2/亲家母/qjm/js_sdk/xb-copy/uni-copy.js ***!
  274. \****************************************************/
  275. /*! no static exports found */
  276. /***/ (function(module, exports, __webpack_require__) {
  277. "use strict";
  278. /* WEBPACK VAR INJECTION */(function(uni) {
  279. Object.defineProperty(exports, "__esModule", {
  280. value: true
  281. });
  282. exports.default = uniCopy;
  283. function uniCopy(content) {
  284. /**
  285. * 小程序端 和 app端的复制逻辑
  286. */
  287. uni.setClipboardData({
  288. data: content,
  289. success: function success() {
  290. console.log('success');
  291. return true;
  292. }
  293. });
  294. /**
  295. * H5端的复制逻辑
  296. */
  297. }
  298. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  299. /***/ }),
  300. /***/ 14:
  301. /*!************************************************************!*\
  302. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  303. \************************************************************/
  304. /*! no static exports found */
  305. /***/ (function(module, exports, __webpack_require__) {
  306. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  307. function _toPrimitive(input, hint) {
  308. if (_typeof(input) !== "object" || input === null) return input;
  309. var prim = input[Symbol.toPrimitive];
  310. if (prim !== undefined) {
  311. var res = prim.call(input, hint || "default");
  312. if (_typeof(res) !== "object") return res;
  313. throw new TypeError("@@toPrimitive must return a primitive value.");
  314. }
  315. return (hint === "string" ? String : Number)(input);
  316. }
  317. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  318. /***/ }),
  319. /***/ 15:
  320. /*!**********************************************************!*\
  321. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  322. \**********************************************************/
  323. /*! no static exports found */
  324. /***/ (function(module, exports, __webpack_require__) {
  325. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  326. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  327. function _construct(Parent, args, Class) {
  328. if (isNativeReflectConstruct()) {
  329. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  330. } else {
  331. module.exports = _construct = function _construct(Parent, args, Class) {
  332. var a = [null];
  333. a.push.apply(a, args);
  334. var Constructor = Function.bind.apply(Parent, a);
  335. var instance = new Constructor();
  336. if (Class) setPrototypeOf(instance, Class.prototype);
  337. return instance;
  338. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  339. }
  340. return _construct.apply(null, arguments);
  341. }
  342. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  343. /***/ }),
  344. /***/ 16:
  345. /*!***************************************************************!*\
  346. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  347. \***************************************************************/
  348. /*! no static exports found */
  349. /***/ (function(module, exports) {
  350. function _setPrototypeOf(o, p) {
  351. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  352. o.__proto__ = p;
  353. return o;
  354. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  355. return _setPrototypeOf(o, p);
  356. }
  357. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  358. /***/ }),
  359. /***/ 17:
  360. /*!*************************************************************************!*\
  361. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  362. \*************************************************************************/
  363. /*! no static exports found */
  364. /***/ (function(module, exports) {
  365. function _isNativeReflectConstruct() {
  366. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  367. if (Reflect.construct.sham) return false;
  368. if (typeof Proxy === "function") return true;
  369. try {
  370. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  371. return true;
  372. } catch (e) {
  373. return false;
  374. }
  375. }
  376. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  377. /***/ }),
  378. /***/ 177:
  379. /*!**************************************!*\
  380. !*** D:/工作/项目2/亲家母/qjm/api/login.js ***!
  381. \**************************************/
  382. /*! no static exports found */
  383. /***/ (function(module, exports, __webpack_require__) {
  384. "use strict";
  385. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  386. Object.defineProperty(exports, "__esModule", {
  387. value: true
  388. });
  389. exports.bangding = bangding;
  390. exports.getUserInfo = getUserInfo;
  391. exports.login = login;
  392. exports.loginMobile = loginMobile;
  393. exports.register = register;
  394. exports.verify = verify;
  395. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  396. // 登录
  397. function login(data) {
  398. return (0, _request.default)({
  399. url: '/api/login',
  400. method: 'post',
  401. data: data
  402. });
  403. }
  404. // 注册
  405. function register(data) {
  406. return (0, _request.default)({
  407. url: '/api/register',
  408. method: 'post',
  409. data: data
  410. });
  411. }
  412. // 验证码
  413. function verify(data) {
  414. // type=register为注册
  415. // type=login为登录
  416. return (0, _request.default)({
  417. url: '/api/register/verify',
  418. method: 'post',
  419. data: data
  420. });
  421. }
  422. // 获取用户信息
  423. function getUserInfo(data) {
  424. return (0, _request.default)({
  425. url: '/api/userinfo',
  426. method: 'get',
  427. data: data
  428. });
  429. }
  430. // 短信登录
  431. function loginMobile(data) {
  432. return (0, _request.default)({
  433. url: '/api/login/mobile',
  434. method: 'post',
  435. data: data
  436. });
  437. }
  438. //绑定手机号
  439. function bangding(data) {
  440. return (0, _request.default)({
  441. url: '/api/binding',
  442. method: 'POST',
  443. data: data
  444. });
  445. }
  446. /***/ }),
  447. /***/ 178:
  448. /*!************************************!*\
  449. !*** D:/工作/项目2/亲家母/qjm/api/set.js ***!
  450. \************************************/
  451. /*! no static exports found */
  452. /***/ (function(module, exports, __webpack_require__) {
  453. "use strict";
  454. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  455. Object.defineProperty(exports, "__esModule", {
  456. value: true
  457. });
  458. exports.binding = binding;
  459. exports.city_area = city_area;
  460. exports.logout = logout;
  461. exports.registerReset = registerReset;
  462. exports.userEdit = userEdit;
  463. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  464. // 修改用户信息
  465. function userEdit(data) {
  466. return (0, _request.default)({
  467. url: '/api/user/edit',
  468. method: 'post',
  469. data: data
  470. });
  471. }
  472. //退出登录
  473. function logout(data) {
  474. return (0, _request.default)({
  475. url: '/api/logout',
  476. method: 'get',
  477. data: data
  478. });
  479. }
  480. //修改密码
  481. function registerReset(data) {
  482. return (0, _request.default)({
  483. url: '/api/register/reset',
  484. method: 'post',
  485. data: data
  486. });
  487. }
  488. //绑定手机
  489. function binding(data) {
  490. return (0, _request.default)({
  491. url: '/api/binding',
  492. method: 'post',
  493. data: data
  494. });
  495. }
  496. // 获取地址
  497. function city_area(data) {
  498. return (0, _request.default)({
  499. url: '/api/city_area',
  500. method: 'get',
  501. data: data
  502. });
  503. }
  504. /***/ }),
  505. /***/ 179:
  506. /*!***********************************************!*\
  507. !*** D:/工作/项目2/亲家母/qjm/utils/wxMinProgram.js ***!
  508. \***********************************************/
  509. /*! no static exports found */
  510. /***/ (function(module, exports, __webpack_require__) {
  511. "use strict";
  512. /* WEBPACK VAR INJECTION */(function(uni, wx) {
  513. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  514. Object.defineProperty(exports, "__esModule", {
  515. value: true
  516. });
  517. exports.loginWinxinMp = loginWinxinMp;
  518. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  519. //微信登录
  520. /**
  521. * @param {string} 当前页面地址信息
  522. */
  523. function loginWinxinMp() {
  524. var pages = getCurrentPages();
  525. // 获取跳转前页面
  526. var page = pages[pages.length - 2];
  527. var queryUrl = '';
  528. for (var key in page.options) {
  529. queryUrl += key + '=' + page.options[key] + "&";
  530. }
  531. // 获取当页面路由地址
  532. var path = '/' + page.route + '?' + queryUrl;
  533. // 保存跳转前页面
  534. uni.setStorageSync('present', path);
  535. return new Promise(function (resolve, reject) {
  536. wx.login({
  537. success: function success(e) {
  538. // uni.showModal({
  539. // title: 'zhi1',
  540. // content: JSON.stringify(e)
  541. // })
  542. console.log(e);
  543. resolve(e);
  544. },
  545. fill: function fill(e) {
  546. reject(e);
  547. }
  548. });
  549. });
  550. }
  551. ;
  552. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  553. /***/ }),
  554. /***/ 18:
  555. /*!******************************************************************!*\
  556. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  557. \******************************************************************/
  558. /*! no static exports found */
  559. /***/ (function(module, exports, __webpack_require__) {
  560. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  561. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  562. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  563. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  564. function _toConsumableArray(arr) {
  565. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  566. }
  567. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  568. /***/ }),
  569. /***/ 180:
  570. /*!***********************************!*\
  571. !*** D:/工作/项目2/亲家母/qjm/api/wx.js ***!
  572. \***********************************/
  573. /*! no static exports found */
  574. /***/ (function(module, exports, __webpack_require__) {
  575. "use strict";
  576. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  577. Object.defineProperty(exports, "__esModule", {
  578. value: true
  579. });
  580. exports.wechatMpAuth = wechatMpAuth;
  581. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  582. // 微信code地址
  583. function wechatMpAuth(data) {
  584. return (0, _request.default)({
  585. url: '/api/wechat/mp_auth',
  586. method: 'post',
  587. data: data
  588. });
  589. }
  590. /***/ }),
  591. /***/ 19:
  592. /*!******************************************************************!*\
  593. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  594. \******************************************************************/
  595. /*! no static exports found */
  596. /***/ (function(module, exports, __webpack_require__) {
  597. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  598. function _arrayWithoutHoles(arr) {
  599. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  600. }
  601. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  602. /***/ }),
  603. /***/ 2:
  604. /*!************************************************************!*\
  605. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  606. \************************************************************/
  607. /*! no static exports found */
  608. /***/ (function(module, exports, __webpack_require__) {
  609. "use strict";
  610. /* WEBPACK VAR INJECTION */(function(wx, global) {
  611. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  612. Object.defineProperty(exports, "__esModule", {
  613. value: true
  614. });
  615. exports.createApp = createApp;
  616. exports.createComponent = createComponent;
  617. exports.createPage = createPage;
  618. exports.createPlugin = createPlugin;
  619. exports.createSubpackageApp = createSubpackageApp;
  620. exports.default = void 0;
  621. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  622. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  623. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  624. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  625. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  626. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  627. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  628. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  629. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  630. var realAtob;
  631. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  632. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  633. if (typeof atob !== 'function') {
  634. realAtob = function realAtob(str) {
  635. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  636. if (!b64re.test(str)) {
  637. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  638. }
  639. // Adding the padding if missing, for semplicity
  640. str += '=='.slice(2 - (str.length & 3));
  641. var bitmap;
  642. var result = '';
  643. var r1;
  644. var r2;
  645. var i = 0;
  646. for (; i < str.length;) {
  647. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  648. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  649. }
  650. return result;
  651. };
  652. } else {
  653. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  654. realAtob = atob;
  655. }
  656. function b64DecodeUnicode(str) {
  657. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  658. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  659. }).join(''));
  660. }
  661. function getCurrentUserInfo() {
  662. var token = wx.getStorageSync('uni_id_token') || '';
  663. var tokenArr = token.split('.');
  664. if (!token || tokenArr.length !== 3) {
  665. return {
  666. uid: null,
  667. role: [],
  668. permission: [],
  669. tokenExpired: 0
  670. };
  671. }
  672. var userInfo;
  673. try {
  674. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  675. } catch (error) {
  676. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  677. }
  678. userInfo.tokenExpired = userInfo.exp * 1000;
  679. delete userInfo.exp;
  680. delete userInfo.iat;
  681. return userInfo;
  682. }
  683. function uniIdMixin(Vue) {
  684. Vue.prototype.uniIDHasRole = function (roleId) {
  685. var _getCurrentUserInfo = getCurrentUserInfo(),
  686. role = _getCurrentUserInfo.role;
  687. return role.indexOf(roleId) > -1;
  688. };
  689. Vue.prototype.uniIDHasPermission = function (permissionId) {
  690. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  691. permission = _getCurrentUserInfo2.permission;
  692. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  693. };
  694. Vue.prototype.uniIDTokenValid = function () {
  695. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  696. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  697. return tokenExpired > Date.now();
  698. };
  699. }
  700. var _toString = Object.prototype.toString;
  701. var hasOwnProperty = Object.prototype.hasOwnProperty;
  702. function isFn(fn) {
  703. return typeof fn === 'function';
  704. }
  705. function isStr(str) {
  706. return typeof str === 'string';
  707. }
  708. function isObject(obj) {
  709. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  710. }
  711. function isPlainObject(obj) {
  712. return _toString.call(obj) === '[object Object]';
  713. }
  714. function hasOwn(obj, key) {
  715. return hasOwnProperty.call(obj, key);
  716. }
  717. function noop() {}
  718. /**
  719. * Create a cached version of a pure function.
  720. */
  721. function cached(fn) {
  722. var cache = Object.create(null);
  723. return function cachedFn(str) {
  724. var hit = cache[str];
  725. return hit || (cache[str] = fn(str));
  726. };
  727. }
  728. /**
  729. * Camelize a hyphen-delimited string.
  730. */
  731. var camelizeRE = /-(\w)/g;
  732. var camelize = cached(function (str) {
  733. return str.replace(camelizeRE, function (_, c) {
  734. return c ? c.toUpperCase() : '';
  735. });
  736. });
  737. function sortObject(obj) {
  738. var sortObj = {};
  739. if (isPlainObject(obj)) {
  740. Object.keys(obj).sort().forEach(function (key) {
  741. sortObj[key] = obj[key];
  742. });
  743. }
  744. return !Object.keys(sortObj) ? obj : sortObj;
  745. }
  746. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  747. var globalInterceptors = {};
  748. var scopedInterceptors = {};
  749. function mergeHook(parentVal, childVal) {
  750. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  751. return res ? dedupeHooks(res) : res;
  752. }
  753. function dedupeHooks(hooks) {
  754. var res = [];
  755. for (var i = 0; i < hooks.length; i++) {
  756. if (res.indexOf(hooks[i]) === -1) {
  757. res.push(hooks[i]);
  758. }
  759. }
  760. return res;
  761. }
  762. function removeHook(hooks, hook) {
  763. var index = hooks.indexOf(hook);
  764. if (index !== -1) {
  765. hooks.splice(index, 1);
  766. }
  767. }
  768. function mergeInterceptorHook(interceptor, option) {
  769. Object.keys(option).forEach(function (hook) {
  770. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  771. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  772. }
  773. });
  774. }
  775. function removeInterceptorHook(interceptor, option) {
  776. if (!interceptor || !option) {
  777. return;
  778. }
  779. Object.keys(option).forEach(function (hook) {
  780. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  781. removeHook(interceptor[hook], option[hook]);
  782. }
  783. });
  784. }
  785. function addInterceptor(method, option) {
  786. if (typeof method === 'string' && isPlainObject(option)) {
  787. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  788. } else if (isPlainObject(method)) {
  789. mergeInterceptorHook(globalInterceptors, method);
  790. }
  791. }
  792. function removeInterceptor(method, option) {
  793. if (typeof method === 'string') {
  794. if (isPlainObject(option)) {
  795. removeInterceptorHook(scopedInterceptors[method], option);
  796. } else {
  797. delete scopedInterceptors[method];
  798. }
  799. } else if (isPlainObject(method)) {
  800. removeInterceptorHook(globalInterceptors, method);
  801. }
  802. }
  803. function wrapperHook(hook) {
  804. return function (data) {
  805. return hook(data) || data;
  806. };
  807. }
  808. function isPromise(obj) {
  809. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  810. }
  811. function queue(hooks, data) {
  812. var promise = false;
  813. for (var i = 0; i < hooks.length; i++) {
  814. var hook = hooks[i];
  815. if (promise) {
  816. promise = Promise.resolve(wrapperHook(hook));
  817. } else {
  818. var res = hook(data);
  819. if (isPromise(res)) {
  820. promise = Promise.resolve(res);
  821. }
  822. if (res === false) {
  823. return {
  824. then: function then() {}
  825. };
  826. }
  827. }
  828. }
  829. return promise || {
  830. then: function then(callback) {
  831. return callback(data);
  832. }
  833. };
  834. }
  835. function wrapperOptions(interceptor) {
  836. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  837. ['success', 'fail', 'complete'].forEach(function (name) {
  838. if (Array.isArray(interceptor[name])) {
  839. var oldCallback = options[name];
  840. options[name] = function callbackInterceptor(res) {
  841. queue(interceptor[name], res).then(function (res) {
  842. /* eslint-disable no-mixed-operators */
  843. return isFn(oldCallback) && oldCallback(res) || res;
  844. });
  845. };
  846. }
  847. });
  848. return options;
  849. }
  850. function wrapperReturnValue(method, returnValue) {
  851. var returnValueHooks = [];
  852. if (Array.isArray(globalInterceptors.returnValue)) {
  853. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  854. }
  855. var interceptor = scopedInterceptors[method];
  856. if (interceptor && Array.isArray(interceptor.returnValue)) {
  857. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  858. }
  859. returnValueHooks.forEach(function (hook) {
  860. returnValue = hook(returnValue) || returnValue;
  861. });
  862. return returnValue;
  863. }
  864. function getApiInterceptorHooks(method) {
  865. var interceptor = Object.create(null);
  866. Object.keys(globalInterceptors).forEach(function (hook) {
  867. if (hook !== 'returnValue') {
  868. interceptor[hook] = globalInterceptors[hook].slice();
  869. }
  870. });
  871. var scopedInterceptor = scopedInterceptors[method];
  872. if (scopedInterceptor) {
  873. Object.keys(scopedInterceptor).forEach(function (hook) {
  874. if (hook !== 'returnValue') {
  875. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  876. }
  877. });
  878. }
  879. return interceptor;
  880. }
  881. function invokeApi(method, api, options) {
  882. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  883. params[_key - 3] = arguments[_key];
  884. }
  885. var interceptor = getApiInterceptorHooks(method);
  886. if (interceptor && Object.keys(interceptor).length) {
  887. if (Array.isArray(interceptor.invoke)) {
  888. var res = queue(interceptor.invoke, options);
  889. return res.then(function (options) {
  890. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  891. });
  892. } else {
  893. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  894. }
  895. }
  896. return api.apply(void 0, [options].concat(params));
  897. }
  898. var promiseInterceptor = {
  899. returnValue: function returnValue(res) {
  900. if (!isPromise(res)) {
  901. return res;
  902. }
  903. return new Promise(function (resolve, reject) {
  904. res.then(function (res) {
  905. if (res[0]) {
  906. reject(res[0]);
  907. } else {
  908. resolve(res[1]);
  909. }
  910. });
  911. });
  912. }
  913. };
  914. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  915. var CONTEXT_API_RE = /^create|Manager$/;
  916. // Context例外情况
  917. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  918. // 同步例外情况
  919. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  920. var CALLBACK_API_RE = /^on|^off/;
  921. function isContextApi(name) {
  922. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  923. }
  924. function isSyncApi(name) {
  925. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  926. }
  927. function isCallbackApi(name) {
  928. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  929. }
  930. function handlePromise(promise) {
  931. return promise.then(function (data) {
  932. return [null, data];
  933. }).catch(function (err) {
  934. return [err];
  935. });
  936. }
  937. function shouldPromise(name) {
  938. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  939. return false;
  940. }
  941. return true;
  942. }
  943. /* eslint-disable no-extend-native */
  944. if (!Promise.prototype.finally) {
  945. Promise.prototype.finally = function (callback) {
  946. var promise = this.constructor;
  947. return this.then(function (value) {
  948. return promise.resolve(callback()).then(function () {
  949. return value;
  950. });
  951. }, function (reason) {
  952. return promise.resolve(callback()).then(function () {
  953. throw reason;
  954. });
  955. });
  956. };
  957. }
  958. function promisify(name, api) {
  959. if (!shouldPromise(name) || !isFn(api)) {
  960. return api;
  961. }
  962. return function promiseApi() {
  963. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  964. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  965. params[_key2 - 1] = arguments[_key2];
  966. }
  967. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  968. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  969. }
  970. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  971. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  972. success: resolve,
  973. fail: reject
  974. })].concat(params));
  975. })));
  976. };
  977. }
  978. var EPS = 1e-4;
  979. var BASE_DEVICE_WIDTH = 750;
  980. var isIOS = false;
  981. var deviceWidth = 0;
  982. var deviceDPR = 0;
  983. function checkDeviceWidth() {
  984. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  985. platform = _wx$getSystemInfoSync.platform,
  986. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  987. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  988. deviceWidth = windowWidth;
  989. deviceDPR = pixelRatio;
  990. isIOS = platform === 'ios';
  991. }
  992. function upx2px(number, newDeviceWidth) {
  993. if (deviceWidth === 0) {
  994. checkDeviceWidth();
  995. }
  996. number = Number(number);
  997. if (number === 0) {
  998. return 0;
  999. }
  1000. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1001. if (result < 0) {
  1002. result = -result;
  1003. }
  1004. result = Math.floor(result + EPS);
  1005. if (result === 0) {
  1006. if (deviceDPR === 1 || !isIOS) {
  1007. result = 1;
  1008. } else {
  1009. result = 0.5;
  1010. }
  1011. }
  1012. return number < 0 ? -result : result;
  1013. }
  1014. var LOCALE_ZH_HANS = 'zh-Hans';
  1015. var LOCALE_ZH_HANT = 'zh-Hant';
  1016. var LOCALE_EN = 'en';
  1017. var LOCALE_FR = 'fr';
  1018. var LOCALE_ES = 'es';
  1019. var messages = {};
  1020. var locale;
  1021. {
  1022. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1023. }
  1024. function initI18nMessages() {
  1025. if (!isEnableLocale()) {
  1026. return;
  1027. }
  1028. var localeKeys = Object.keys(__uniConfig.locales);
  1029. if (localeKeys.length) {
  1030. localeKeys.forEach(function (locale) {
  1031. var curMessages = messages[locale];
  1032. var userMessages = __uniConfig.locales[locale];
  1033. if (curMessages) {
  1034. Object.assign(curMessages, userMessages);
  1035. } else {
  1036. messages[locale] = userMessages;
  1037. }
  1038. });
  1039. }
  1040. }
  1041. initI18nMessages();
  1042. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1043. var t = i18n.t;
  1044. var i18nMixin = i18n.mixin = {
  1045. beforeCreate: function beforeCreate() {
  1046. var _this = this;
  1047. var unwatch = i18n.i18n.watchLocale(function () {
  1048. _this.$forceUpdate();
  1049. });
  1050. this.$once('hook:beforeDestroy', function () {
  1051. unwatch();
  1052. });
  1053. },
  1054. methods: {
  1055. $$t: function $$t(key, values) {
  1056. return t(key, values);
  1057. }
  1058. }
  1059. };
  1060. var setLocale = i18n.setLocale;
  1061. var getLocale = i18n.getLocale;
  1062. function initAppLocale(Vue, appVm, locale) {
  1063. var state = Vue.observable({
  1064. locale: locale || i18n.getLocale()
  1065. });
  1066. var localeWatchers = [];
  1067. appVm.$watchLocale = function (fn) {
  1068. localeWatchers.push(fn);
  1069. };
  1070. Object.defineProperty(appVm, '$locale', {
  1071. get: function get() {
  1072. return state.locale;
  1073. },
  1074. set: function set(v) {
  1075. state.locale = v;
  1076. localeWatchers.forEach(function (watch) {
  1077. return watch(v);
  1078. });
  1079. }
  1080. });
  1081. }
  1082. function isEnableLocale() {
  1083. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1084. }
  1085. function include(str, parts) {
  1086. return !!parts.find(function (part) {
  1087. return str.indexOf(part) !== -1;
  1088. });
  1089. }
  1090. function startsWith(str, parts) {
  1091. return parts.find(function (part) {
  1092. return str.indexOf(part) === 0;
  1093. });
  1094. }
  1095. function normalizeLocale(locale, messages) {
  1096. if (!locale) {
  1097. return;
  1098. }
  1099. locale = locale.trim().replace(/_/g, '-');
  1100. if (messages && messages[locale]) {
  1101. return locale;
  1102. }
  1103. locale = locale.toLowerCase();
  1104. if (locale === 'chinese') {
  1105. // 支付宝
  1106. return LOCALE_ZH_HANS;
  1107. }
  1108. if (locale.indexOf('zh') === 0) {
  1109. if (locale.indexOf('-hans') > -1) {
  1110. return LOCALE_ZH_HANS;
  1111. }
  1112. if (locale.indexOf('-hant') > -1) {
  1113. return LOCALE_ZH_HANT;
  1114. }
  1115. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1116. return LOCALE_ZH_HANT;
  1117. }
  1118. return LOCALE_ZH_HANS;
  1119. }
  1120. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1121. if (lang) {
  1122. return lang;
  1123. }
  1124. }
  1125. // export function initI18n() {
  1126. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1127. // if (localeKeys.length) {
  1128. // localeKeys.forEach((locale) =>
  1129. // i18n.add(locale, __uniConfig.locales[locale])
  1130. // )
  1131. // }
  1132. // }
  1133. function getLocale$1() {
  1134. // 优先使用 $locale
  1135. if (isFn(getApp)) {
  1136. var app = getApp({
  1137. allowDefault: true
  1138. });
  1139. if (app && app.$vm) {
  1140. return app.$vm.$locale;
  1141. }
  1142. }
  1143. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1144. }
  1145. function setLocale$1(locale) {
  1146. var app = isFn(getApp) ? getApp() : false;
  1147. if (!app) {
  1148. return false;
  1149. }
  1150. var oldLocale = app.$vm.$locale;
  1151. if (oldLocale !== locale) {
  1152. app.$vm.$locale = locale;
  1153. onLocaleChangeCallbacks.forEach(function (fn) {
  1154. return fn({
  1155. locale: locale
  1156. });
  1157. });
  1158. return true;
  1159. }
  1160. return false;
  1161. }
  1162. var onLocaleChangeCallbacks = [];
  1163. function onLocaleChange(fn) {
  1164. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1165. onLocaleChangeCallbacks.push(fn);
  1166. }
  1167. }
  1168. if (typeof global !== 'undefined') {
  1169. global.getLocale = getLocale$1;
  1170. }
  1171. var interceptors = {
  1172. promiseInterceptor: promiseInterceptor
  1173. };
  1174. var baseApi = /*#__PURE__*/Object.freeze({
  1175. __proto__: null,
  1176. upx2px: upx2px,
  1177. getLocale: getLocale$1,
  1178. setLocale: setLocale$1,
  1179. onLocaleChange: onLocaleChange,
  1180. addInterceptor: addInterceptor,
  1181. removeInterceptor: removeInterceptor,
  1182. interceptors: interceptors
  1183. });
  1184. function findExistsPageIndex(url) {
  1185. var pages = getCurrentPages();
  1186. var len = pages.length;
  1187. while (len--) {
  1188. var page = pages[len];
  1189. if (page.$page && page.$page.fullPath === url) {
  1190. return len;
  1191. }
  1192. }
  1193. return -1;
  1194. }
  1195. var redirectTo = {
  1196. name: function name(fromArgs) {
  1197. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1198. return 'navigateBack';
  1199. }
  1200. return 'redirectTo';
  1201. },
  1202. args: function args(fromArgs) {
  1203. if (fromArgs.exists === 'back' && fromArgs.url) {
  1204. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1205. if (existsPageIndex !== -1) {
  1206. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1207. if (delta > 0) {
  1208. fromArgs.delta = delta;
  1209. }
  1210. }
  1211. }
  1212. }
  1213. };
  1214. var previewImage = {
  1215. args: function args(fromArgs) {
  1216. var currentIndex = parseInt(fromArgs.current);
  1217. if (isNaN(currentIndex)) {
  1218. return;
  1219. }
  1220. var urls = fromArgs.urls;
  1221. if (!Array.isArray(urls)) {
  1222. return;
  1223. }
  1224. var len = urls.length;
  1225. if (!len) {
  1226. return;
  1227. }
  1228. if (currentIndex < 0) {
  1229. currentIndex = 0;
  1230. } else if (currentIndex >= len) {
  1231. currentIndex = len - 1;
  1232. }
  1233. if (currentIndex > 0) {
  1234. fromArgs.current = urls[currentIndex];
  1235. fromArgs.urls = urls.filter(function (item, index) {
  1236. return index < currentIndex ? item !== urls[currentIndex] : true;
  1237. });
  1238. } else {
  1239. fromArgs.current = urls[0];
  1240. }
  1241. return {
  1242. indicator: false,
  1243. loop: false
  1244. };
  1245. }
  1246. };
  1247. var UUID_KEY = '__DC_STAT_UUID';
  1248. var deviceId;
  1249. function useDeviceId(result) {
  1250. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1251. if (!deviceId) {
  1252. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1253. wx.setStorage({
  1254. key: UUID_KEY,
  1255. data: deviceId
  1256. });
  1257. }
  1258. result.deviceId = deviceId;
  1259. }
  1260. function addSafeAreaInsets(result) {
  1261. if (result.safeArea) {
  1262. var safeArea = result.safeArea;
  1263. result.safeAreaInsets = {
  1264. top: safeArea.top,
  1265. left: safeArea.left,
  1266. right: result.windowWidth - safeArea.right,
  1267. bottom: result.screenHeight - safeArea.bottom
  1268. };
  1269. }
  1270. }
  1271. function populateParameters(result) {
  1272. var _result$brand = result.brand,
  1273. brand = _result$brand === void 0 ? '' : _result$brand,
  1274. _result$model = result.model,
  1275. model = _result$model === void 0 ? '' : _result$model,
  1276. _result$system = result.system,
  1277. system = _result$system === void 0 ? '' : _result$system,
  1278. _result$language = result.language,
  1279. language = _result$language === void 0 ? '' : _result$language,
  1280. theme = result.theme,
  1281. version = result.version,
  1282. platform = result.platform,
  1283. fontSizeSetting = result.fontSizeSetting,
  1284. SDKVersion = result.SDKVersion,
  1285. pixelRatio = result.pixelRatio,
  1286. deviceOrientation = result.deviceOrientation;
  1287. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1288. var extraParam = {};
  1289. // osName osVersion
  1290. var osName = '';
  1291. var osVersion = '';
  1292. {
  1293. osName = system.split(' ')[0] || '';
  1294. osVersion = system.split(' ')[1] || '';
  1295. }
  1296. var hostVersion = version;
  1297. // deviceType
  1298. var deviceType = getGetDeviceType(result, model);
  1299. // deviceModel
  1300. var deviceBrand = getDeviceBrand(brand);
  1301. // hostName
  1302. var _hostName = getHostName(result);
  1303. // deviceOrientation
  1304. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1305. // devicePixelRatio
  1306. var _devicePixelRatio = pixelRatio;
  1307. // SDKVersion
  1308. var _SDKVersion = SDKVersion;
  1309. // hostLanguage
  1310. var hostLanguage = language.replace(/_/g, '-');
  1311. // wx.getAccountInfoSync
  1312. var parameters = {
  1313. appId: "__UNI__A45549C",
  1314. appName: "亲家母优选",
  1315. appVersion: "1.0.0",
  1316. appVersionCode: "100",
  1317. appLanguage: getAppLanguage(hostLanguage),
  1318. uniCompileVersion: "3.7.9",
  1319. uniRuntimeVersion: "3.7.9",
  1320. uniPlatform: undefined || "mp-weixin",
  1321. deviceBrand: deviceBrand,
  1322. deviceModel: model,
  1323. deviceType: deviceType,
  1324. devicePixelRatio: _devicePixelRatio,
  1325. deviceOrientation: _deviceOrientation,
  1326. osName: osName.toLocaleLowerCase(),
  1327. osVersion: osVersion,
  1328. hostTheme: theme,
  1329. hostVersion: hostVersion,
  1330. hostLanguage: hostLanguage,
  1331. hostName: _hostName,
  1332. hostSDKVersion: _SDKVersion,
  1333. hostFontSizeSetting: fontSizeSetting,
  1334. windowTop: 0,
  1335. windowBottom: 0,
  1336. // TODO
  1337. osLanguage: undefined,
  1338. osTheme: undefined,
  1339. ua: undefined,
  1340. hostPackageName: undefined,
  1341. browserName: undefined,
  1342. browserVersion: undefined
  1343. };
  1344. Object.assign(result, parameters, extraParam);
  1345. }
  1346. function getGetDeviceType(result, model) {
  1347. var deviceType = result.deviceType || 'phone';
  1348. {
  1349. var deviceTypeMaps = {
  1350. ipad: 'pad',
  1351. windows: 'pc',
  1352. mac: 'pc'
  1353. };
  1354. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1355. var _model = model.toLocaleLowerCase();
  1356. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1357. var _m = deviceTypeMapsKeys[index];
  1358. if (_model.indexOf(_m) !== -1) {
  1359. deviceType = deviceTypeMaps[_m];
  1360. break;
  1361. }
  1362. }
  1363. }
  1364. return deviceType;
  1365. }
  1366. function getDeviceBrand(brand) {
  1367. var deviceBrand = brand;
  1368. if (deviceBrand) {
  1369. deviceBrand = brand.toLocaleLowerCase();
  1370. }
  1371. return deviceBrand;
  1372. }
  1373. function getAppLanguage(defaultLanguage) {
  1374. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1375. }
  1376. function getHostName(result) {
  1377. var _platform = 'WeChat';
  1378. var _hostName = result.hostName || _platform; // mp-jd
  1379. {
  1380. if (result.environment) {
  1381. _hostName = result.environment;
  1382. } else if (result.host && result.host.env) {
  1383. _hostName = result.host.env;
  1384. }
  1385. }
  1386. return _hostName;
  1387. }
  1388. var getSystemInfo = {
  1389. returnValue: function returnValue(result) {
  1390. useDeviceId(result);
  1391. addSafeAreaInsets(result);
  1392. populateParameters(result);
  1393. }
  1394. };
  1395. var showActionSheet = {
  1396. args: function args(fromArgs) {
  1397. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1398. fromArgs.alertText = fromArgs.title;
  1399. }
  1400. }
  1401. };
  1402. var getAppBaseInfo = {
  1403. returnValue: function returnValue(result) {
  1404. var _result = result,
  1405. version = _result.version,
  1406. language = _result.language,
  1407. SDKVersion = _result.SDKVersion,
  1408. theme = _result.theme;
  1409. var _hostName = getHostName(result);
  1410. var hostLanguage = language.replace('_', '-');
  1411. result = sortObject(Object.assign(result, {
  1412. appId: "__UNI__A45549C",
  1413. appName: "亲家母优选",
  1414. appVersion: "1.0.0",
  1415. appVersionCode: "100",
  1416. appLanguage: getAppLanguage(hostLanguage),
  1417. hostVersion: version,
  1418. hostLanguage: hostLanguage,
  1419. hostName: _hostName,
  1420. hostSDKVersion: SDKVersion,
  1421. hostTheme: theme
  1422. }));
  1423. }
  1424. };
  1425. var getDeviceInfo = {
  1426. returnValue: function returnValue(result) {
  1427. var _result2 = result,
  1428. brand = _result2.brand,
  1429. model = _result2.model;
  1430. var deviceType = getGetDeviceType(result, model);
  1431. var deviceBrand = getDeviceBrand(brand);
  1432. useDeviceId(result);
  1433. result = sortObject(Object.assign(result, {
  1434. deviceType: deviceType,
  1435. deviceBrand: deviceBrand,
  1436. deviceModel: model
  1437. }));
  1438. }
  1439. };
  1440. var getWindowInfo = {
  1441. returnValue: function returnValue(result) {
  1442. addSafeAreaInsets(result);
  1443. result = sortObject(Object.assign(result, {
  1444. windowTop: 0,
  1445. windowBottom: 0
  1446. }));
  1447. }
  1448. };
  1449. var getAppAuthorizeSetting = {
  1450. returnValue: function returnValue(result) {
  1451. var locationReducedAccuracy = result.locationReducedAccuracy;
  1452. result.locationAccuracy = 'unsupported';
  1453. if (locationReducedAccuracy === true) {
  1454. result.locationAccuracy = 'reduced';
  1455. } else if (locationReducedAccuracy === false) {
  1456. result.locationAccuracy = 'full';
  1457. }
  1458. }
  1459. };
  1460. // import navigateTo from 'uni-helpers/navigate-to'
  1461. var compressImage = {
  1462. args: function args(fromArgs) {
  1463. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1464. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1465. fromArgs.compressHeight = fromArgs.compressedHeight;
  1466. }
  1467. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1468. fromArgs.compressWidth = fromArgs.compressedWidth;
  1469. }
  1470. }
  1471. };
  1472. var protocols = {
  1473. redirectTo: redirectTo,
  1474. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1475. previewImage: previewImage,
  1476. getSystemInfo: getSystemInfo,
  1477. getSystemInfoSync: getSystemInfo,
  1478. showActionSheet: showActionSheet,
  1479. getAppBaseInfo: getAppBaseInfo,
  1480. getDeviceInfo: getDeviceInfo,
  1481. getWindowInfo: getWindowInfo,
  1482. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1483. compressImage: compressImage
  1484. };
  1485. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1486. var canIUses = [];
  1487. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1488. function processCallback(methodName, method, returnValue) {
  1489. return function (res) {
  1490. return method(processReturnValue(methodName, res, returnValue));
  1491. };
  1492. }
  1493. function processArgs(methodName, fromArgs) {
  1494. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1495. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1496. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1497. if (isPlainObject(fromArgs)) {
  1498. // 一般 api 的参数解析
  1499. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1500. if (isFn(argsOption)) {
  1501. argsOption = argsOption(fromArgs, toArgs) || {};
  1502. }
  1503. for (var key in fromArgs) {
  1504. if (hasOwn(argsOption, key)) {
  1505. var keyOption = argsOption[key];
  1506. if (isFn(keyOption)) {
  1507. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1508. }
  1509. if (!keyOption) {
  1510. // 不支持的参数
  1511. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1512. } else if (isStr(keyOption)) {
  1513. // 重写参数 key
  1514. toArgs[keyOption] = fromArgs[key];
  1515. } else if (isPlainObject(keyOption)) {
  1516. // {name:newName,value:value}可重新指定参数 key:value
  1517. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1518. }
  1519. } else if (CALLBACKS.indexOf(key) !== -1) {
  1520. if (isFn(fromArgs[key])) {
  1521. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1522. }
  1523. } else {
  1524. if (!keepFromArgs) {
  1525. toArgs[key] = fromArgs[key];
  1526. }
  1527. }
  1528. }
  1529. return toArgs;
  1530. } else if (isFn(fromArgs)) {
  1531. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1532. }
  1533. return fromArgs;
  1534. }
  1535. function processReturnValue(methodName, res, returnValue) {
  1536. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1537. if (isFn(protocols.returnValue)) {
  1538. // 处理通用 returnValue
  1539. res = protocols.returnValue(methodName, res);
  1540. }
  1541. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1542. }
  1543. function wrapper(methodName, method) {
  1544. if (hasOwn(protocols, methodName)) {
  1545. var protocol = protocols[methodName];
  1546. if (!protocol) {
  1547. // 暂不支持的 api
  1548. return function () {
  1549. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1550. };
  1551. }
  1552. return function (arg1, arg2) {
  1553. // 目前 api 最多两个参数
  1554. var options = protocol;
  1555. if (isFn(protocol)) {
  1556. options = protocol(arg1);
  1557. }
  1558. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1559. var args = [arg1];
  1560. if (typeof arg2 !== 'undefined') {
  1561. args.push(arg2);
  1562. }
  1563. if (isFn(options.name)) {
  1564. methodName = options.name(arg1);
  1565. } else if (isStr(options.name)) {
  1566. methodName = options.name;
  1567. }
  1568. var returnValue = wx[methodName].apply(wx, args);
  1569. if (isSyncApi(methodName)) {
  1570. // 同步 api
  1571. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1572. }
  1573. return returnValue;
  1574. };
  1575. }
  1576. return method;
  1577. }
  1578. var todoApis = Object.create(null);
  1579. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1580. function createTodoApi(name) {
  1581. return function todoApi(_ref) {
  1582. var fail = _ref.fail,
  1583. complete = _ref.complete;
  1584. var res = {
  1585. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1586. };
  1587. isFn(fail) && fail(res);
  1588. isFn(complete) && complete(res);
  1589. };
  1590. }
  1591. TODOS.forEach(function (name) {
  1592. todoApis[name] = createTodoApi(name);
  1593. });
  1594. var providers = {
  1595. oauth: ['weixin'],
  1596. share: ['weixin'],
  1597. payment: ['wxpay'],
  1598. push: ['weixin']
  1599. };
  1600. function getProvider(_ref2) {
  1601. var service = _ref2.service,
  1602. success = _ref2.success,
  1603. fail = _ref2.fail,
  1604. complete = _ref2.complete;
  1605. var res = false;
  1606. if (providers[service]) {
  1607. res = {
  1608. errMsg: 'getProvider:ok',
  1609. service: service,
  1610. provider: providers[service]
  1611. };
  1612. isFn(success) && success(res);
  1613. } else {
  1614. res = {
  1615. errMsg: 'getProvider:fail service not found'
  1616. };
  1617. isFn(fail) && fail(res);
  1618. }
  1619. isFn(complete) && complete(res);
  1620. }
  1621. var extraApi = /*#__PURE__*/Object.freeze({
  1622. __proto__: null,
  1623. getProvider: getProvider
  1624. });
  1625. var getEmitter = function () {
  1626. var Emitter;
  1627. return function getUniEmitter() {
  1628. if (!Emitter) {
  1629. Emitter = new _vue.default();
  1630. }
  1631. return Emitter;
  1632. };
  1633. }();
  1634. function apply(ctx, method, args) {
  1635. return ctx[method].apply(ctx, args);
  1636. }
  1637. function $on() {
  1638. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1639. }
  1640. function $off() {
  1641. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1642. }
  1643. function $once() {
  1644. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1645. }
  1646. function $emit() {
  1647. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1648. }
  1649. var eventApi = /*#__PURE__*/Object.freeze({
  1650. __proto__: null,
  1651. $on: $on,
  1652. $off: $off,
  1653. $once: $once,
  1654. $emit: $emit
  1655. });
  1656. /**
  1657. * 框架内 try-catch
  1658. */
  1659. /**
  1660. * 开发者 try-catch
  1661. */
  1662. function tryCatch(fn) {
  1663. return function () {
  1664. try {
  1665. return fn.apply(fn, arguments);
  1666. } catch (e) {
  1667. // TODO
  1668. console.error(e);
  1669. }
  1670. };
  1671. }
  1672. function getApiCallbacks(params) {
  1673. var apiCallbacks = {};
  1674. for (var name in params) {
  1675. var param = params[name];
  1676. if (isFn(param)) {
  1677. apiCallbacks[name] = tryCatch(param);
  1678. delete params[name];
  1679. }
  1680. }
  1681. return apiCallbacks;
  1682. }
  1683. var cid;
  1684. var cidErrMsg;
  1685. var enabled;
  1686. function normalizePushMessage(message) {
  1687. try {
  1688. return JSON.parse(message);
  1689. } catch (e) {}
  1690. return message;
  1691. }
  1692. function invokePushCallback(args) {
  1693. if (args.type === 'enabled') {
  1694. enabled = true;
  1695. } else if (args.type === 'clientId') {
  1696. cid = args.cid;
  1697. cidErrMsg = args.errMsg;
  1698. invokeGetPushCidCallbacks(cid, args.errMsg);
  1699. } else if (args.type === 'pushMsg') {
  1700. var message = {
  1701. type: 'receive',
  1702. data: normalizePushMessage(args.message)
  1703. };
  1704. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1705. var callback = onPushMessageCallbacks[i];
  1706. callback(message);
  1707. // 该消息已被阻止
  1708. if (message.stopped) {
  1709. break;
  1710. }
  1711. }
  1712. } else if (args.type === 'click') {
  1713. onPushMessageCallbacks.forEach(function (callback) {
  1714. callback({
  1715. type: 'click',
  1716. data: normalizePushMessage(args.message)
  1717. });
  1718. });
  1719. }
  1720. }
  1721. var getPushCidCallbacks = [];
  1722. function invokeGetPushCidCallbacks(cid, errMsg) {
  1723. getPushCidCallbacks.forEach(function (callback) {
  1724. callback(cid, errMsg);
  1725. });
  1726. getPushCidCallbacks.length = 0;
  1727. }
  1728. function getPushClientId(args) {
  1729. if (!isPlainObject(args)) {
  1730. args = {};
  1731. }
  1732. var _getApiCallbacks = getApiCallbacks(args),
  1733. success = _getApiCallbacks.success,
  1734. fail = _getApiCallbacks.fail,
  1735. complete = _getApiCallbacks.complete;
  1736. var hasSuccess = isFn(success);
  1737. var hasFail = isFn(fail);
  1738. var hasComplete = isFn(complete);
  1739. Promise.resolve().then(function () {
  1740. if (typeof enabled === 'undefined') {
  1741. enabled = false;
  1742. cid = '';
  1743. cidErrMsg = 'uniPush is not enabled';
  1744. }
  1745. getPushCidCallbacks.push(function (cid, errMsg) {
  1746. var res;
  1747. if (cid) {
  1748. res = {
  1749. errMsg: 'getPushClientId:ok',
  1750. cid: cid
  1751. };
  1752. hasSuccess && success(res);
  1753. } else {
  1754. res = {
  1755. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1756. };
  1757. hasFail && fail(res);
  1758. }
  1759. hasComplete && complete(res);
  1760. });
  1761. if (typeof cid !== 'undefined') {
  1762. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1763. }
  1764. });
  1765. }
  1766. var onPushMessageCallbacks = [];
  1767. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1768. var onPushMessage = function onPushMessage(fn) {
  1769. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1770. onPushMessageCallbacks.push(fn);
  1771. }
  1772. };
  1773. var offPushMessage = function offPushMessage(fn) {
  1774. if (!fn) {
  1775. onPushMessageCallbacks.length = 0;
  1776. } else {
  1777. var index = onPushMessageCallbacks.indexOf(fn);
  1778. if (index > -1) {
  1779. onPushMessageCallbacks.splice(index, 1);
  1780. }
  1781. }
  1782. };
  1783. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1784. if (!baseInfo) {
  1785. baseInfo = wx.getSystemInfoSync();
  1786. }
  1787. var host = baseInfo ? baseInfo.host : null;
  1788. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1789. var api = /*#__PURE__*/Object.freeze({
  1790. __proto__: null,
  1791. shareVideoMessage: shareVideoMessage,
  1792. getPushClientId: getPushClientId,
  1793. onPushMessage: onPushMessage,
  1794. offPushMessage: offPushMessage,
  1795. invokePushCallback: invokePushCallback
  1796. });
  1797. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1798. function findVmByVueId(vm, vuePid) {
  1799. var $children = vm.$children;
  1800. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1801. for (var i = $children.length - 1; i >= 0; i--) {
  1802. var childVm = $children[i];
  1803. if (childVm.$scope._$vueId === vuePid) {
  1804. return childVm;
  1805. }
  1806. }
  1807. // 反向递归查找
  1808. var parentVm;
  1809. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1810. parentVm = findVmByVueId($children[_i], vuePid);
  1811. if (parentVm) {
  1812. return parentVm;
  1813. }
  1814. }
  1815. }
  1816. function initBehavior(options) {
  1817. return Behavior(options);
  1818. }
  1819. function isPage() {
  1820. return !!this.route;
  1821. }
  1822. function initRelation(detail) {
  1823. this.triggerEvent('__l', detail);
  1824. }
  1825. function selectAllComponents(mpInstance, selector, $refs) {
  1826. var components = mpInstance.selectAllComponents(selector) || [];
  1827. components.forEach(function (component) {
  1828. var ref = component.dataset.ref;
  1829. $refs[ref] = component.$vm || toSkip(component);
  1830. {
  1831. if (component.dataset.vueGeneric === 'scoped') {
  1832. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1833. selectAllComponents(scopedComponent, selector, $refs);
  1834. });
  1835. }
  1836. }
  1837. });
  1838. }
  1839. function syncRefs(refs, newRefs) {
  1840. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1841. var newKeys = Object.keys(newRefs);
  1842. newKeys.forEach(function (key) {
  1843. var oldValue = refs[key];
  1844. var newValue = newRefs[key];
  1845. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1846. return oldValue.includes(value);
  1847. })) {
  1848. return;
  1849. }
  1850. refs[key] = newValue;
  1851. oldKeys.delete(key);
  1852. });
  1853. oldKeys.forEach(function (key) {
  1854. delete refs[key];
  1855. });
  1856. return refs;
  1857. }
  1858. function initRefs(vm) {
  1859. var mpInstance = vm.$scope;
  1860. var refs = {};
  1861. Object.defineProperty(vm, '$refs', {
  1862. get: function get() {
  1863. var $refs = {};
  1864. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1865. // TODO 暂不考虑 for 中的 scoped
  1866. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1867. forComponents.forEach(function (component) {
  1868. var ref = component.dataset.ref;
  1869. if (!$refs[ref]) {
  1870. $refs[ref] = [];
  1871. }
  1872. $refs[ref].push(component.$vm || toSkip(component));
  1873. });
  1874. return syncRefs(refs, $refs);
  1875. }
  1876. });
  1877. }
  1878. function handleLink(event) {
  1879. var _ref3 = event.detail || event.value,
  1880. vuePid = _ref3.vuePid,
  1881. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1882. var parentVm;
  1883. if (vuePid) {
  1884. parentVm = findVmByVueId(this.$vm, vuePid);
  1885. }
  1886. if (!parentVm) {
  1887. parentVm = this.$vm;
  1888. }
  1889. vueOptions.parent = parentVm;
  1890. }
  1891. function markMPComponent(component) {
  1892. // 在 Vue 中标记为小程序组件
  1893. var IS_MP = '__v_isMPComponent';
  1894. Object.defineProperty(component, IS_MP, {
  1895. configurable: true,
  1896. enumerable: false,
  1897. value: true
  1898. });
  1899. return component;
  1900. }
  1901. function toSkip(obj) {
  1902. var OB = '__ob__';
  1903. var SKIP = '__v_skip';
  1904. if (isObject(obj) && Object.isExtensible(obj)) {
  1905. // 避免被 @vue/composition-api 观测
  1906. Object.defineProperty(obj, OB, {
  1907. configurable: true,
  1908. enumerable: false,
  1909. value: (0, _defineProperty2.default)({}, SKIP, true)
  1910. });
  1911. }
  1912. return obj;
  1913. }
  1914. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1915. function initWorkletMethods(mpMethods, vueMethods) {
  1916. if (vueMethods) {
  1917. Object.keys(vueMethods).forEach(function (name) {
  1918. var matches = name.match(WORKLET_RE);
  1919. if (matches) {
  1920. var workletName = matches[1];
  1921. mpMethods[name] = vueMethods[name];
  1922. mpMethods[workletName] = vueMethods[workletName];
  1923. }
  1924. });
  1925. }
  1926. }
  1927. var MPPage = Page;
  1928. var MPComponent = Component;
  1929. var customizeRE = /:/g;
  1930. var customize = cached(function (str) {
  1931. return camelize(str.replace(customizeRE, '-'));
  1932. });
  1933. function initTriggerEvent(mpInstance) {
  1934. var oldTriggerEvent = mpInstance.triggerEvent;
  1935. var newTriggerEvent = function newTriggerEvent(event) {
  1936. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1937. args[_key3 - 1] = arguments[_key3];
  1938. }
  1939. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1940. if (this.$vm || this.dataset && this.dataset.comType) {
  1941. event = customize(event);
  1942. } else {
  1943. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1944. var newEvent = customize(event);
  1945. if (newEvent !== event) {
  1946. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1947. }
  1948. }
  1949. return oldTriggerEvent.apply(this, [event].concat(args));
  1950. };
  1951. try {
  1952. // 京东小程序 triggerEvent 为只读
  1953. mpInstance.triggerEvent = newTriggerEvent;
  1954. } catch (error) {
  1955. mpInstance._triggerEvent = newTriggerEvent;
  1956. }
  1957. }
  1958. function initHook(name, options, isComponent) {
  1959. var oldHook = options[name];
  1960. options[name] = function () {
  1961. markMPComponent(this);
  1962. initTriggerEvent(this);
  1963. if (oldHook) {
  1964. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1965. args[_key4] = arguments[_key4];
  1966. }
  1967. return oldHook.apply(this, args);
  1968. }
  1969. };
  1970. }
  1971. if (!MPPage.__$wrappered) {
  1972. MPPage.__$wrappered = true;
  1973. Page = function Page() {
  1974. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1975. initHook('onLoad', options);
  1976. return MPPage(options);
  1977. };
  1978. Page.after = MPPage.after;
  1979. Component = function Component() {
  1980. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1981. initHook('created', options);
  1982. return MPComponent(options);
  1983. };
  1984. }
  1985. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1986. function initMocks(vm, mocks) {
  1987. var mpInstance = vm.$mp[vm.mpType];
  1988. mocks.forEach(function (mock) {
  1989. if (hasOwn(mpInstance, mock)) {
  1990. vm[mock] = mpInstance[mock];
  1991. }
  1992. });
  1993. }
  1994. function hasHook(hook, vueOptions) {
  1995. if (!vueOptions) {
  1996. return true;
  1997. }
  1998. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1999. return true;
  2000. }
  2001. vueOptions = vueOptions.default || vueOptions;
  2002. if (isFn(vueOptions)) {
  2003. if (isFn(vueOptions.extendOptions[hook])) {
  2004. return true;
  2005. }
  2006. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2007. return true;
  2008. }
  2009. return false;
  2010. }
  2011. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2012. return true;
  2013. }
  2014. var mixins = vueOptions.mixins;
  2015. if (Array.isArray(mixins)) {
  2016. return !!mixins.find(function (mixin) {
  2017. return hasHook(hook, mixin);
  2018. });
  2019. }
  2020. }
  2021. function initHooks(mpOptions, hooks, vueOptions) {
  2022. hooks.forEach(function (hook) {
  2023. if (hasHook(hook, vueOptions)) {
  2024. mpOptions[hook] = function (args) {
  2025. return this.$vm && this.$vm.__call_hook(hook, args);
  2026. };
  2027. }
  2028. });
  2029. }
  2030. function initUnknownHooks(mpOptions, vueOptions) {
  2031. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2032. findHooks(vueOptions).forEach(function (hook) {
  2033. return initHook$1(mpOptions, hook, excludes);
  2034. });
  2035. }
  2036. function findHooks(vueOptions) {
  2037. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2038. if (vueOptions) {
  2039. Object.keys(vueOptions).forEach(function (name) {
  2040. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2041. hooks.push(name);
  2042. }
  2043. });
  2044. }
  2045. return hooks;
  2046. }
  2047. function initHook$1(mpOptions, hook, excludes) {
  2048. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2049. mpOptions[hook] = function (args) {
  2050. return this.$vm && this.$vm.__call_hook(hook, args);
  2051. };
  2052. }
  2053. }
  2054. function initVueComponent(Vue, vueOptions) {
  2055. vueOptions = vueOptions.default || vueOptions;
  2056. var VueComponent;
  2057. if (isFn(vueOptions)) {
  2058. VueComponent = vueOptions;
  2059. } else {
  2060. VueComponent = Vue.extend(vueOptions);
  2061. }
  2062. vueOptions = VueComponent.options;
  2063. return [VueComponent, vueOptions];
  2064. }
  2065. function initSlots(vm, vueSlots) {
  2066. if (Array.isArray(vueSlots) && vueSlots.length) {
  2067. var $slots = Object.create(null);
  2068. vueSlots.forEach(function (slotName) {
  2069. $slots[slotName] = true;
  2070. });
  2071. vm.$scopedSlots = vm.$slots = $slots;
  2072. }
  2073. }
  2074. function initVueIds(vueIds, mpInstance) {
  2075. vueIds = (vueIds || '').split(',');
  2076. var len = vueIds.length;
  2077. if (len === 1) {
  2078. mpInstance._$vueId = vueIds[0];
  2079. } else if (len === 2) {
  2080. mpInstance._$vueId = vueIds[0];
  2081. mpInstance._$vuePid = vueIds[1];
  2082. }
  2083. }
  2084. function initData(vueOptions, context) {
  2085. var data = vueOptions.data || {};
  2086. var methods = vueOptions.methods || {};
  2087. if (typeof data === 'function') {
  2088. try {
  2089. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2090. } catch (e) {
  2091. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2092. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2093. }
  2094. }
  2095. } else {
  2096. try {
  2097. // 对 data 格式化
  2098. data = JSON.parse(JSON.stringify(data));
  2099. } catch (e) {}
  2100. }
  2101. if (!isPlainObject(data)) {
  2102. data = {};
  2103. }
  2104. Object.keys(methods).forEach(function (methodName) {
  2105. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2106. data[methodName] = methods[methodName];
  2107. }
  2108. });
  2109. return data;
  2110. }
  2111. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2112. function createObserver(name) {
  2113. return function observer(newVal, oldVal) {
  2114. if (this.$vm) {
  2115. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2116. }
  2117. };
  2118. }
  2119. function initBehaviors(vueOptions, initBehavior) {
  2120. var vueBehaviors = vueOptions.behaviors;
  2121. var vueExtends = vueOptions.extends;
  2122. var vueMixins = vueOptions.mixins;
  2123. var vueProps = vueOptions.props;
  2124. if (!vueProps) {
  2125. vueOptions.props = vueProps = [];
  2126. }
  2127. var behaviors = [];
  2128. if (Array.isArray(vueBehaviors)) {
  2129. vueBehaviors.forEach(function (behavior) {
  2130. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2131. if (behavior === 'uni://form-field') {
  2132. if (Array.isArray(vueProps)) {
  2133. vueProps.push('name');
  2134. vueProps.push('value');
  2135. } else {
  2136. vueProps.name = {
  2137. type: String,
  2138. default: ''
  2139. };
  2140. vueProps.value = {
  2141. type: [String, Number, Boolean, Array, Object, Date],
  2142. default: ''
  2143. };
  2144. }
  2145. }
  2146. });
  2147. }
  2148. if (isPlainObject(vueExtends) && vueExtends.props) {
  2149. behaviors.push(initBehavior({
  2150. properties: initProperties(vueExtends.props, true)
  2151. }));
  2152. }
  2153. if (Array.isArray(vueMixins)) {
  2154. vueMixins.forEach(function (vueMixin) {
  2155. if (isPlainObject(vueMixin) && vueMixin.props) {
  2156. behaviors.push(initBehavior({
  2157. properties: initProperties(vueMixin.props, true)
  2158. }));
  2159. }
  2160. });
  2161. }
  2162. return behaviors;
  2163. }
  2164. function parsePropType(key, type, defaultValue, file) {
  2165. // [String]=>String
  2166. if (Array.isArray(type) && type.length === 1) {
  2167. return type[0];
  2168. }
  2169. return type;
  2170. }
  2171. function initProperties(props) {
  2172. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2173. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2174. var options = arguments.length > 3 ? arguments[3] : undefined;
  2175. var properties = {};
  2176. if (!isBehavior) {
  2177. properties.vueId = {
  2178. type: String,
  2179. value: ''
  2180. };
  2181. {
  2182. if (options.virtualHost) {
  2183. properties.virtualHostStyle = {
  2184. type: null,
  2185. value: ''
  2186. };
  2187. properties.virtualHostClass = {
  2188. type: null,
  2189. value: ''
  2190. };
  2191. }
  2192. }
  2193. // scopedSlotsCompiler auto
  2194. properties.scopedSlotsCompiler = {
  2195. type: String,
  2196. value: ''
  2197. };
  2198. properties.vueSlots = {
  2199. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2200. type: null,
  2201. value: [],
  2202. observer: function observer(newVal, oldVal) {
  2203. var $slots = Object.create(null);
  2204. newVal.forEach(function (slotName) {
  2205. $slots[slotName] = true;
  2206. });
  2207. this.setData({
  2208. $slots: $slots
  2209. });
  2210. }
  2211. };
  2212. }
  2213. if (Array.isArray(props)) {
  2214. // ['title']
  2215. props.forEach(function (key) {
  2216. properties[key] = {
  2217. type: null,
  2218. observer: createObserver(key)
  2219. };
  2220. });
  2221. } else if (isPlainObject(props)) {
  2222. // {title:{type:String,default:''},content:String}
  2223. Object.keys(props).forEach(function (key) {
  2224. var opts = props[key];
  2225. if (isPlainObject(opts)) {
  2226. // title:{type:String,default:''}
  2227. var value = opts.default;
  2228. if (isFn(value)) {
  2229. value = value();
  2230. }
  2231. opts.type = parsePropType(key, opts.type);
  2232. properties[key] = {
  2233. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2234. value: value,
  2235. observer: createObserver(key)
  2236. };
  2237. } else {
  2238. // content:String
  2239. var type = parsePropType(key, opts);
  2240. properties[key] = {
  2241. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2242. observer: createObserver(key)
  2243. };
  2244. }
  2245. });
  2246. }
  2247. return properties;
  2248. }
  2249. function wrapper$1(event) {
  2250. // TODO 又得兼容 mpvue 的 mp 对象
  2251. try {
  2252. event.mp = JSON.parse(JSON.stringify(event));
  2253. } catch (e) {}
  2254. event.stopPropagation = noop;
  2255. event.preventDefault = noop;
  2256. event.target = event.target || {};
  2257. if (!hasOwn(event, 'detail')) {
  2258. event.detail = {};
  2259. }
  2260. if (hasOwn(event, 'markerId')) {
  2261. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2262. event.detail.markerId = event.markerId;
  2263. }
  2264. if (isPlainObject(event.detail)) {
  2265. event.target = Object.assign({}, event.target, event.detail);
  2266. }
  2267. return event;
  2268. }
  2269. function getExtraValue(vm, dataPathsArray) {
  2270. var context = vm;
  2271. dataPathsArray.forEach(function (dataPathArray) {
  2272. var dataPath = dataPathArray[0];
  2273. var value = dataPathArray[2];
  2274. if (dataPath || typeof value !== 'undefined') {
  2275. // ['','',index,'disable']
  2276. var propPath = dataPathArray[1];
  2277. var valuePath = dataPathArray[3];
  2278. var vFor;
  2279. if (Number.isInteger(dataPath)) {
  2280. vFor = dataPath;
  2281. } else if (!dataPath) {
  2282. vFor = context;
  2283. } else if (typeof dataPath === 'string' && dataPath) {
  2284. if (dataPath.indexOf('#s#') === 0) {
  2285. vFor = dataPath.substr(3);
  2286. } else {
  2287. vFor = vm.__get_value(dataPath, context);
  2288. }
  2289. }
  2290. if (Number.isInteger(vFor)) {
  2291. context = value;
  2292. } else if (!propPath) {
  2293. context = vFor[value];
  2294. } else {
  2295. if (Array.isArray(vFor)) {
  2296. context = vFor.find(function (vForItem) {
  2297. return vm.__get_value(propPath, vForItem) === value;
  2298. });
  2299. } else if (isPlainObject(vFor)) {
  2300. context = Object.keys(vFor).find(function (vForKey) {
  2301. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2302. });
  2303. } else {
  2304. console.error('v-for 暂不支持循环数据:', vFor);
  2305. }
  2306. }
  2307. if (valuePath) {
  2308. context = vm.__get_value(valuePath, context);
  2309. }
  2310. }
  2311. });
  2312. return context;
  2313. }
  2314. function processEventExtra(vm, extra, event, __args__) {
  2315. var extraObj = {};
  2316. if (Array.isArray(extra) && extra.length) {
  2317. /**
  2318. *[
  2319. * ['data.items', 'data.id', item.data.id],
  2320. * ['metas', 'id', meta.id]
  2321. *],
  2322. *[
  2323. * ['data.items', 'data.id', item.data.id],
  2324. * ['metas', 'id', meta.id]
  2325. *],
  2326. *'test'
  2327. */
  2328. extra.forEach(function (dataPath, index) {
  2329. if (typeof dataPath === 'string') {
  2330. if (!dataPath) {
  2331. // model,prop.sync
  2332. extraObj['$' + index] = vm;
  2333. } else {
  2334. if (dataPath === '$event') {
  2335. // $event
  2336. extraObj['$' + index] = event;
  2337. } else if (dataPath === 'arguments') {
  2338. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2339. } else if (dataPath.indexOf('$event.') === 0) {
  2340. // $event.target.value
  2341. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2342. } else {
  2343. extraObj['$' + index] = vm.__get_value(dataPath);
  2344. }
  2345. }
  2346. } else {
  2347. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2348. }
  2349. });
  2350. }
  2351. return extraObj;
  2352. }
  2353. function getObjByArray(arr) {
  2354. var obj = {};
  2355. for (var i = 1; i < arr.length; i++) {
  2356. var element = arr[i];
  2357. obj[element[0]] = element[1];
  2358. }
  2359. return obj;
  2360. }
  2361. function processEventArgs(vm, event) {
  2362. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2363. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2364. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2365. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2366. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2367. // fixed 用户直接触发 mpInstance.triggerEvent
  2368. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2369. if (isCustom) {
  2370. // 自定义事件
  2371. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2372. if (!args.length) {
  2373. // 无参数,直接传入 event 或 detail 数组
  2374. if (isCustomMPEvent) {
  2375. return [event];
  2376. }
  2377. return __args__;
  2378. }
  2379. }
  2380. var extraObj = processEventExtra(vm, extra, event, __args__);
  2381. var ret = [];
  2382. args.forEach(function (arg) {
  2383. if (arg === '$event') {
  2384. if (methodName === '__set_model' && !isCustom) {
  2385. // input v-model value
  2386. ret.push(event.target.value);
  2387. } else {
  2388. if (isCustom && !isCustomMPEvent) {
  2389. ret.push(__args__[0]);
  2390. } else {
  2391. // wxcomponent 组件或内置组件
  2392. ret.push(event);
  2393. }
  2394. }
  2395. } else {
  2396. if (Array.isArray(arg) && arg[0] === 'o') {
  2397. ret.push(getObjByArray(arg));
  2398. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2399. ret.push(extraObj[arg]);
  2400. } else {
  2401. ret.push(arg);
  2402. }
  2403. }
  2404. });
  2405. return ret;
  2406. }
  2407. var ONCE = '~';
  2408. var CUSTOM = '^';
  2409. function isMatchEventType(eventType, optType) {
  2410. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2411. }
  2412. function getContextVm(vm) {
  2413. var $parent = vm.$parent;
  2414. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2415. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2416. $parent = $parent.$parent;
  2417. }
  2418. return $parent && $parent.$parent;
  2419. }
  2420. function handleEvent(event) {
  2421. var _this2 = this;
  2422. event = wrapper$1(event);
  2423. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2424. var dataset = (event.currentTarget || event.target).dataset;
  2425. if (!dataset) {
  2426. return console.warn('事件信息不存在');
  2427. }
  2428. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2429. if (!eventOpts) {
  2430. return console.warn('事件信息不存在');
  2431. }
  2432. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2433. var eventType = event.type;
  2434. var ret = [];
  2435. eventOpts.forEach(function (eventOpt) {
  2436. var type = eventOpt[0];
  2437. var eventsArray = eventOpt[1];
  2438. var isCustom = type.charAt(0) === CUSTOM;
  2439. type = isCustom ? type.slice(1) : type;
  2440. var isOnce = type.charAt(0) === ONCE;
  2441. type = isOnce ? type.slice(1) : type;
  2442. if (eventsArray && isMatchEventType(eventType, type)) {
  2443. eventsArray.forEach(function (eventArray) {
  2444. var methodName = eventArray[0];
  2445. if (methodName) {
  2446. var handlerCtx = _this2.$vm;
  2447. if (handlerCtx.$options.generic) {
  2448. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2449. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2450. }
  2451. if (methodName === '$emit') {
  2452. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2453. return;
  2454. }
  2455. var handler = handlerCtx[methodName];
  2456. if (!isFn(handler)) {
  2457. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2458. var path = _this2.route || _this2.is;
  2459. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2460. }
  2461. if (isOnce) {
  2462. if (handler.once) {
  2463. return;
  2464. }
  2465. handler.once = true;
  2466. }
  2467. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2468. params = Array.isArray(params) ? params : [];
  2469. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2470. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2471. // eslint-disable-next-line no-sparse-arrays
  2472. params = params.concat([,,,,,,,,,, event]);
  2473. }
  2474. ret.push(handler.apply(handlerCtx, params));
  2475. }
  2476. });
  2477. }
  2478. });
  2479. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2480. return ret[0];
  2481. }
  2482. }
  2483. var eventChannels = {};
  2484. var eventChannelStack = [];
  2485. function getEventChannel(id) {
  2486. if (id) {
  2487. var eventChannel = eventChannels[id];
  2488. delete eventChannels[id];
  2489. return eventChannel;
  2490. }
  2491. return eventChannelStack.shift();
  2492. }
  2493. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2494. function initEventChannel() {
  2495. _vue.default.prototype.getOpenerEventChannel = function () {
  2496. // 微信小程序使用自身getOpenerEventChannel
  2497. {
  2498. return this.$scope.getOpenerEventChannel();
  2499. }
  2500. };
  2501. var callHook = _vue.default.prototype.__call_hook;
  2502. _vue.default.prototype.__call_hook = function (hook, args) {
  2503. if (hook === 'onLoad' && args && args.__id__) {
  2504. this.__eventChannel__ = getEventChannel(args.__id__);
  2505. delete args.__id__;
  2506. }
  2507. return callHook.call(this, hook, args);
  2508. };
  2509. }
  2510. function initScopedSlotsParams() {
  2511. var center = {};
  2512. var parents = {};
  2513. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  2514. var has = center[vueId];
  2515. if (!has) {
  2516. parents[vueId] = this;
  2517. this.$on('hook:destroyed', function () {
  2518. delete parents[vueId];
  2519. });
  2520. }
  2521. return has;
  2522. };
  2523. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  2524. var data = center[vueId];
  2525. if (data) {
  2526. var object = data[name] || {};
  2527. return key ? object[key] : object;
  2528. } else {
  2529. parents[vueId] = this;
  2530. this.$on('hook:destroyed', function () {
  2531. delete parents[vueId];
  2532. });
  2533. }
  2534. };
  2535. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  2536. var vueIds = this.$options.propsData.vueId;
  2537. if (vueIds) {
  2538. var vueId = vueIds.split(',')[0];
  2539. var object = center[vueId] = center[vueId] || {};
  2540. object[name] = value;
  2541. if (parents[vueId]) {
  2542. parents[vueId].$forceUpdate();
  2543. }
  2544. }
  2545. };
  2546. _vue.default.mixin({
  2547. destroyed: function destroyed() {
  2548. var propsData = this.$options.propsData;
  2549. var vueId = propsData && propsData.vueId;
  2550. if (vueId) {
  2551. delete center[vueId];
  2552. delete parents[vueId];
  2553. }
  2554. }
  2555. });
  2556. }
  2557. function parseBaseApp(vm, _ref4) {
  2558. var mocks = _ref4.mocks,
  2559. initRefs = _ref4.initRefs;
  2560. initEventChannel();
  2561. {
  2562. initScopedSlotsParams();
  2563. }
  2564. if (vm.$options.store) {
  2565. _vue.default.prototype.$store = vm.$options.store;
  2566. }
  2567. uniIdMixin(_vue.default);
  2568. _vue.default.prototype.mpHost = "mp-weixin";
  2569. _vue.default.mixin({
  2570. beforeCreate: function beforeCreate() {
  2571. if (!this.$options.mpType) {
  2572. return;
  2573. }
  2574. this.mpType = this.$options.mpType;
  2575. this.$mp = (0, _defineProperty2.default)({
  2576. data: {}
  2577. }, this.mpType, this.$options.mpInstance);
  2578. this.$scope = this.$options.mpInstance;
  2579. delete this.$options.mpType;
  2580. delete this.$options.mpInstance;
  2581. if (this.mpType === 'page' && typeof getApp === 'function') {
  2582. // hack vue-i18n
  2583. var app = getApp();
  2584. if (app.$vm && app.$vm.$i18n) {
  2585. this._i18n = app.$vm.$i18n;
  2586. }
  2587. }
  2588. if (this.mpType !== 'app') {
  2589. initRefs(this);
  2590. initMocks(this, mocks);
  2591. }
  2592. }
  2593. });
  2594. var appOptions = {
  2595. onLaunch: function onLaunch(args) {
  2596. if (this.$vm) {
  2597. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2598. return;
  2599. }
  2600. {
  2601. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2602. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2603. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2604. }
  2605. }
  2606. this.$vm = vm;
  2607. this.$vm.$mp = {
  2608. app: this
  2609. };
  2610. this.$vm.$scope = this;
  2611. // vm 上也挂载 globalData
  2612. this.$vm.globalData = this.globalData;
  2613. this.$vm._isMounted = true;
  2614. this.$vm.__call_hook('mounted', args);
  2615. this.$vm.__call_hook('onLaunch', args);
  2616. }
  2617. };
  2618. // 兼容旧版本 globalData
  2619. appOptions.globalData = vm.$options.globalData || {};
  2620. // 将 methods 中的方法挂在 getApp() 中
  2621. var methods = vm.$options.methods;
  2622. if (methods) {
  2623. Object.keys(methods).forEach(function (name) {
  2624. appOptions[name] = methods[name];
  2625. });
  2626. }
  2627. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2628. initHooks(appOptions, hooks);
  2629. initUnknownHooks(appOptions, vm.$options);
  2630. return appOptions;
  2631. }
  2632. function parseApp(vm) {
  2633. return parseBaseApp(vm, {
  2634. mocks: mocks,
  2635. initRefs: initRefs
  2636. });
  2637. }
  2638. function createApp(vm) {
  2639. App(parseApp(vm));
  2640. return vm;
  2641. }
  2642. var encodeReserveRE = /[!'()*]/g;
  2643. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2644. return '%' + c.charCodeAt(0).toString(16);
  2645. };
  2646. var commaRE = /%2C/g;
  2647. // fixed encodeURIComponent which is more conformant to RFC3986:
  2648. // - escapes [!'()*]
  2649. // - preserve commas
  2650. var encode = function encode(str) {
  2651. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2652. };
  2653. function stringifyQuery(obj) {
  2654. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2655. var res = obj ? Object.keys(obj).map(function (key) {
  2656. var val = obj[key];
  2657. if (val === undefined) {
  2658. return '';
  2659. }
  2660. if (val === null) {
  2661. return encodeStr(key);
  2662. }
  2663. if (Array.isArray(val)) {
  2664. var result = [];
  2665. val.forEach(function (val2) {
  2666. if (val2 === undefined) {
  2667. return;
  2668. }
  2669. if (val2 === null) {
  2670. result.push(encodeStr(key));
  2671. } else {
  2672. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2673. }
  2674. });
  2675. return result.join('&');
  2676. }
  2677. return encodeStr(key) + '=' + encodeStr(val);
  2678. }).filter(function (x) {
  2679. return x.length > 0;
  2680. }).join('&') : null;
  2681. return res ? "?".concat(res) : '';
  2682. }
  2683. function parseBaseComponent(vueComponentOptions) {
  2684. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2685. isPage = _ref5.isPage,
  2686. initRelation = _ref5.initRelation;
  2687. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2688. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2689. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2690. VueComponent = _initVueComponent2[0],
  2691. vueOptions = _initVueComponent2[1];
  2692. var options = _objectSpread({
  2693. multipleSlots: true,
  2694. addGlobalClass: true
  2695. }, vueOptions.options || {});
  2696. {
  2697. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2698. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2699. Object.assign(options, vueOptions['mp-weixin'].options);
  2700. }
  2701. }
  2702. var componentOptions = {
  2703. options: options,
  2704. data: initData(vueOptions, _vue.default.prototype),
  2705. behaviors: initBehaviors(vueOptions, initBehavior),
  2706. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2707. lifetimes: {
  2708. attached: function attached() {
  2709. var properties = this.properties;
  2710. var options = {
  2711. mpType: isPage.call(this) ? 'page' : 'component',
  2712. mpInstance: this,
  2713. propsData: properties
  2714. };
  2715. initVueIds(properties.vueId, this);
  2716. // 处理父子关系
  2717. initRelation.call(this, {
  2718. vuePid: this._$vuePid,
  2719. vueOptions: options
  2720. });
  2721. // 初始化 vue 实例
  2722. this.$vm = new VueComponent(options);
  2723. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2724. initSlots(this.$vm, properties.vueSlots);
  2725. // 触发首次 setData
  2726. this.$vm.$mount();
  2727. },
  2728. ready: function ready() {
  2729. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2730. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2731. if (this.$vm) {
  2732. this.$vm._isMounted = true;
  2733. this.$vm.__call_hook('mounted');
  2734. this.$vm.__call_hook('onReady');
  2735. }
  2736. },
  2737. detached: function detached() {
  2738. this.$vm && this.$vm.$destroy();
  2739. }
  2740. },
  2741. pageLifetimes: {
  2742. show: function show(args) {
  2743. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2744. },
  2745. hide: function hide() {
  2746. this.$vm && this.$vm.__call_hook('onPageHide');
  2747. },
  2748. resize: function resize(size) {
  2749. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2750. }
  2751. },
  2752. methods: {
  2753. __l: handleLink,
  2754. __e: handleEvent
  2755. }
  2756. };
  2757. // externalClasses
  2758. if (vueOptions.externalClasses) {
  2759. componentOptions.externalClasses = vueOptions.externalClasses;
  2760. }
  2761. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2762. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2763. componentOptions.methods[callMethod] = function (args) {
  2764. return this.$vm[callMethod](args);
  2765. };
  2766. });
  2767. }
  2768. if (needVueOptions) {
  2769. return [componentOptions, vueOptions, VueComponent];
  2770. }
  2771. if (isPage) {
  2772. return componentOptions;
  2773. }
  2774. return [componentOptions, VueComponent];
  2775. }
  2776. function parseComponent(vueComponentOptions, needVueOptions) {
  2777. return parseBaseComponent(vueComponentOptions, {
  2778. isPage: isPage,
  2779. initRelation: initRelation
  2780. }, needVueOptions);
  2781. }
  2782. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2783. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2784. function parseBasePage(vuePageOptions) {
  2785. var _parseComponent = parseComponent(vuePageOptions, true),
  2786. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2787. pageOptions = _parseComponent2[0],
  2788. vueOptions = _parseComponent2[1];
  2789. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2790. pageOptions.methods.onLoad = function (query) {
  2791. this.options = query;
  2792. var copyQuery = Object.assign({}, query);
  2793. delete copyQuery.__id__;
  2794. this.$page = {
  2795. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2796. };
  2797. this.$vm.$mp.query = query; // 兼容 mpvue
  2798. this.$vm.__call_hook('onLoad', query);
  2799. };
  2800. {
  2801. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2802. }
  2803. {
  2804. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2805. }
  2806. return pageOptions;
  2807. }
  2808. function parsePage(vuePageOptions) {
  2809. return parseBasePage(vuePageOptions);
  2810. }
  2811. function createPage(vuePageOptions) {
  2812. {
  2813. return Component(parsePage(vuePageOptions));
  2814. }
  2815. }
  2816. function createComponent(vueOptions) {
  2817. {
  2818. return Component(parseComponent(vueOptions));
  2819. }
  2820. }
  2821. function createSubpackageApp(vm) {
  2822. var appOptions = parseApp(vm);
  2823. var app = getApp({
  2824. allowDefault: true
  2825. });
  2826. vm.$scope = app;
  2827. var globalData = app.globalData;
  2828. if (globalData) {
  2829. Object.keys(appOptions.globalData).forEach(function (name) {
  2830. if (!hasOwn(globalData, name)) {
  2831. globalData[name] = appOptions.globalData[name];
  2832. }
  2833. });
  2834. }
  2835. Object.keys(appOptions).forEach(function (name) {
  2836. if (!hasOwn(app, name)) {
  2837. app[name] = appOptions[name];
  2838. }
  2839. });
  2840. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2841. wx.onAppShow(function () {
  2842. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2843. args[_key5] = arguments[_key5];
  2844. }
  2845. vm.__call_hook('onShow', args);
  2846. });
  2847. }
  2848. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2849. wx.onAppHide(function () {
  2850. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2851. args[_key6] = arguments[_key6];
  2852. }
  2853. vm.__call_hook('onHide', args);
  2854. });
  2855. }
  2856. if (isFn(appOptions.onLaunch)) {
  2857. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2858. vm.__call_hook('onLaunch', args);
  2859. }
  2860. return vm;
  2861. }
  2862. function createPlugin(vm) {
  2863. var appOptions = parseApp(vm);
  2864. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2865. wx.onAppShow(function () {
  2866. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2867. args[_key7] = arguments[_key7];
  2868. }
  2869. vm.__call_hook('onShow', args);
  2870. });
  2871. }
  2872. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2873. wx.onAppHide(function () {
  2874. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2875. args[_key8] = arguments[_key8];
  2876. }
  2877. vm.__call_hook('onHide', args);
  2878. });
  2879. }
  2880. if (isFn(appOptions.onLaunch)) {
  2881. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2882. vm.__call_hook('onLaunch', args);
  2883. }
  2884. return vm;
  2885. }
  2886. todos.forEach(function (todoApi) {
  2887. protocols[todoApi] = false;
  2888. });
  2889. canIUses.forEach(function (canIUseApi) {
  2890. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2891. if (!wx.canIUse(apiName)) {
  2892. protocols[canIUseApi] = false;
  2893. }
  2894. });
  2895. var uni = {};
  2896. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2897. uni = new Proxy({}, {
  2898. get: function get(target, name) {
  2899. if (hasOwn(target, name)) {
  2900. return target[name];
  2901. }
  2902. if (baseApi[name]) {
  2903. return baseApi[name];
  2904. }
  2905. if (api[name]) {
  2906. return promisify(name, api[name]);
  2907. }
  2908. {
  2909. if (extraApi[name]) {
  2910. return promisify(name, extraApi[name]);
  2911. }
  2912. if (todoApis[name]) {
  2913. return promisify(name, todoApis[name]);
  2914. }
  2915. }
  2916. if (eventApi[name]) {
  2917. return eventApi[name];
  2918. }
  2919. return promisify(name, wrapper(name, wx[name]));
  2920. },
  2921. set: function set(target, name, value) {
  2922. target[name] = value;
  2923. return true;
  2924. }
  2925. });
  2926. } else {
  2927. Object.keys(baseApi).forEach(function (name) {
  2928. uni[name] = baseApi[name];
  2929. });
  2930. {
  2931. Object.keys(todoApis).forEach(function (name) {
  2932. uni[name] = promisify(name, todoApis[name]);
  2933. });
  2934. Object.keys(extraApi).forEach(function (name) {
  2935. uni[name] = promisify(name, todoApis[name]);
  2936. });
  2937. }
  2938. Object.keys(eventApi).forEach(function (name) {
  2939. uni[name] = eventApi[name];
  2940. });
  2941. Object.keys(api).forEach(function (name) {
  2942. uni[name] = promisify(name, api[name]);
  2943. });
  2944. Object.keys(wx).forEach(function (name) {
  2945. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2946. uni[name] = promisify(name, wrapper(name, wx[name]));
  2947. }
  2948. });
  2949. }
  2950. wx.createApp = createApp;
  2951. wx.createPage = createPage;
  2952. wx.createComponent = createComponent;
  2953. wx.createSubpackageApp = createSubpackageApp;
  2954. wx.createPlugin = createPlugin;
  2955. var uni$1 = uni;
  2956. var _default = uni$1;
  2957. exports.default = _default;
  2958. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  2959. /***/ }),
  2960. /***/ 20:
  2961. /*!****************************************************************!*\
  2962. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2963. \****************************************************************/
  2964. /*! no static exports found */
  2965. /***/ (function(module, exports) {
  2966. function _iterableToArray(iter) {
  2967. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2968. }
  2969. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2970. /***/ }),
  2971. /***/ 21:
  2972. /*!******************************************************************!*\
  2973. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2974. \******************************************************************/
  2975. /*! no static exports found */
  2976. /***/ (function(module, exports) {
  2977. function _nonIterableSpread() {
  2978. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2979. }
  2980. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2981. /***/ }),
  2982. /***/ 22:
  2983. /*!*************************************************************!*\
  2984. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2985. \*************************************************************/
  2986. /*! no static exports found */
  2987. /***/ (function(module, exports, __webpack_require__) {
  2988. "use strict";
  2989. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2990. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2991. Object.defineProperty(exports, "__esModule", {
  2992. value: true
  2993. });
  2994. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2995. exports.compileI18nJsonStr = compileI18nJsonStr;
  2996. exports.hasI18nJson = hasI18nJson;
  2997. exports.initVueI18n = initVueI18n;
  2998. exports.isI18nStr = isI18nStr;
  2999. exports.isString = void 0;
  3000. exports.normalizeLocale = normalizeLocale;
  3001. exports.parseI18nJson = parseI18nJson;
  3002. exports.resolveLocale = resolveLocale;
  3003. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3004. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3005. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3006. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3007. var isArray = Array.isArray;
  3008. var isObject = function isObject(val) {
  3009. return val !== null && (0, _typeof2.default)(val) === 'object';
  3010. };
  3011. var defaultDelimiters = ['{', '}'];
  3012. var BaseFormatter = /*#__PURE__*/function () {
  3013. function BaseFormatter() {
  3014. (0, _classCallCheck2.default)(this, BaseFormatter);
  3015. this._caches = Object.create(null);
  3016. }
  3017. (0, _createClass2.default)(BaseFormatter, [{
  3018. key: "interpolate",
  3019. value: function interpolate(message, values) {
  3020. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3021. if (!values) {
  3022. return [message];
  3023. }
  3024. var tokens = this._caches[message];
  3025. if (!tokens) {
  3026. tokens = parse(message, delimiters);
  3027. this._caches[message] = tokens;
  3028. }
  3029. return compile(tokens, values);
  3030. }
  3031. }]);
  3032. return BaseFormatter;
  3033. }();
  3034. exports.Formatter = BaseFormatter;
  3035. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3036. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3037. function parse(format, _ref) {
  3038. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3039. startDelimiter = _ref2[0],
  3040. endDelimiter = _ref2[1];
  3041. var tokens = [];
  3042. var position = 0;
  3043. var text = '';
  3044. while (position < format.length) {
  3045. var char = format[position++];
  3046. if (char === startDelimiter) {
  3047. if (text) {
  3048. tokens.push({
  3049. type: 'text',
  3050. value: text
  3051. });
  3052. }
  3053. text = '';
  3054. var sub = '';
  3055. char = format[position++];
  3056. while (char !== undefined && char !== endDelimiter) {
  3057. sub += char;
  3058. char = format[position++];
  3059. }
  3060. var isClosed = char === endDelimiter;
  3061. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3062. tokens.push({
  3063. value: sub,
  3064. type: type
  3065. });
  3066. }
  3067. // else if (char === '%') {
  3068. // // when found rails i18n syntax, skip text capture
  3069. // if (format[position] !== '{') {
  3070. // text += char
  3071. // }
  3072. // }
  3073. else {
  3074. text += char;
  3075. }
  3076. }
  3077. text && tokens.push({
  3078. type: 'text',
  3079. value: text
  3080. });
  3081. return tokens;
  3082. }
  3083. function compile(tokens, values) {
  3084. var compiled = [];
  3085. var index = 0;
  3086. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3087. if (mode === 'unknown') {
  3088. return compiled;
  3089. }
  3090. while (index < tokens.length) {
  3091. var token = tokens[index];
  3092. switch (token.type) {
  3093. case 'text':
  3094. compiled.push(token.value);
  3095. break;
  3096. case 'list':
  3097. compiled.push(values[parseInt(token.value, 10)]);
  3098. break;
  3099. case 'named':
  3100. if (mode === 'named') {
  3101. compiled.push(values[token.value]);
  3102. } else {
  3103. if (true) {
  3104. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3105. }
  3106. }
  3107. break;
  3108. case 'unknown':
  3109. if (true) {
  3110. console.warn("Detect 'unknown' type of token!");
  3111. }
  3112. break;
  3113. }
  3114. index++;
  3115. }
  3116. return compiled;
  3117. }
  3118. var LOCALE_ZH_HANS = 'zh-Hans';
  3119. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3120. var LOCALE_ZH_HANT = 'zh-Hant';
  3121. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3122. var LOCALE_EN = 'en';
  3123. exports.LOCALE_EN = LOCALE_EN;
  3124. var LOCALE_FR = 'fr';
  3125. exports.LOCALE_FR = LOCALE_FR;
  3126. var LOCALE_ES = 'es';
  3127. exports.LOCALE_ES = LOCALE_ES;
  3128. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3129. var hasOwn = function hasOwn(val, key) {
  3130. return hasOwnProperty.call(val, key);
  3131. };
  3132. var defaultFormatter = new BaseFormatter();
  3133. function include(str, parts) {
  3134. return !!parts.find(function (part) {
  3135. return str.indexOf(part) !== -1;
  3136. });
  3137. }
  3138. function startsWith(str, parts) {
  3139. return parts.find(function (part) {
  3140. return str.indexOf(part) === 0;
  3141. });
  3142. }
  3143. function normalizeLocale(locale, messages) {
  3144. if (!locale) {
  3145. return;
  3146. }
  3147. locale = locale.trim().replace(/_/g, '-');
  3148. if (messages && messages[locale]) {
  3149. return locale;
  3150. }
  3151. locale = locale.toLowerCase();
  3152. if (locale.indexOf('zh') === 0) {
  3153. if (locale.indexOf('-hans') > -1) {
  3154. return LOCALE_ZH_HANS;
  3155. }
  3156. if (locale.indexOf('-hant') > -1) {
  3157. return LOCALE_ZH_HANT;
  3158. }
  3159. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3160. return LOCALE_ZH_HANT;
  3161. }
  3162. return LOCALE_ZH_HANS;
  3163. }
  3164. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  3165. if (lang) {
  3166. return lang;
  3167. }
  3168. }
  3169. var I18n = /*#__PURE__*/function () {
  3170. function I18n(_ref3) {
  3171. var locale = _ref3.locale,
  3172. fallbackLocale = _ref3.fallbackLocale,
  3173. messages = _ref3.messages,
  3174. watcher = _ref3.watcher,
  3175. formater = _ref3.formater;
  3176. (0, _classCallCheck2.default)(this, I18n);
  3177. this.locale = LOCALE_EN;
  3178. this.fallbackLocale = LOCALE_EN;
  3179. this.message = {};
  3180. this.messages = {};
  3181. this.watchers = [];
  3182. if (fallbackLocale) {
  3183. this.fallbackLocale = fallbackLocale;
  3184. }
  3185. this.formater = formater || defaultFormatter;
  3186. this.messages = messages || {};
  3187. this.setLocale(locale || LOCALE_EN);
  3188. if (watcher) {
  3189. this.watchLocale(watcher);
  3190. }
  3191. }
  3192. (0, _createClass2.default)(I18n, [{
  3193. key: "setLocale",
  3194. value: function setLocale(locale) {
  3195. var _this = this;
  3196. var oldLocale = this.locale;
  3197. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3198. if (!this.messages[this.locale]) {
  3199. // 可能初始化时不存在
  3200. this.messages[this.locale] = {};
  3201. }
  3202. this.message = this.messages[this.locale];
  3203. // 仅发生变化时,通知
  3204. if (oldLocale !== this.locale) {
  3205. this.watchers.forEach(function (watcher) {
  3206. watcher(_this.locale, oldLocale);
  3207. });
  3208. }
  3209. }
  3210. }, {
  3211. key: "getLocale",
  3212. value: function getLocale() {
  3213. return this.locale;
  3214. }
  3215. }, {
  3216. key: "watchLocale",
  3217. value: function watchLocale(fn) {
  3218. var _this2 = this;
  3219. var index = this.watchers.push(fn) - 1;
  3220. return function () {
  3221. _this2.watchers.splice(index, 1);
  3222. };
  3223. }
  3224. }, {
  3225. key: "add",
  3226. value: function add(locale, message) {
  3227. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3228. var curMessages = this.messages[locale];
  3229. if (curMessages) {
  3230. if (override) {
  3231. Object.assign(curMessages, message);
  3232. } else {
  3233. Object.keys(message).forEach(function (key) {
  3234. if (!hasOwn(curMessages, key)) {
  3235. curMessages[key] = message[key];
  3236. }
  3237. });
  3238. }
  3239. } else {
  3240. this.messages[locale] = message;
  3241. }
  3242. }
  3243. }, {
  3244. key: "f",
  3245. value: function f(message, values, delimiters) {
  3246. return this.formater.interpolate(message, values, delimiters).join('');
  3247. }
  3248. }, {
  3249. key: "t",
  3250. value: function t(key, locale, values) {
  3251. var message = this.message;
  3252. if (typeof locale === 'string') {
  3253. locale = normalizeLocale(locale, this.messages);
  3254. locale && (message = this.messages[locale]);
  3255. } else {
  3256. values = locale;
  3257. }
  3258. if (!hasOwn(message, key)) {
  3259. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3260. return key;
  3261. }
  3262. return this.formater.interpolate(message[key], values).join('');
  3263. }
  3264. }]);
  3265. return I18n;
  3266. }();
  3267. exports.I18n = I18n;
  3268. function watchAppLocale(appVm, i18n) {
  3269. // 需要保证 watch 的触发在组件渲染之前
  3270. if (appVm.$watchLocale) {
  3271. // vue2
  3272. appVm.$watchLocale(function (newLocale) {
  3273. i18n.setLocale(newLocale);
  3274. });
  3275. } else {
  3276. appVm.$watch(function () {
  3277. return appVm.$locale;
  3278. }, function (newLocale) {
  3279. i18n.setLocale(newLocale);
  3280. });
  3281. }
  3282. }
  3283. function getDefaultLocale() {
  3284. if (typeof uni !== 'undefined' && uni.getLocale) {
  3285. return uni.getLocale();
  3286. }
  3287. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3288. if (typeof global !== 'undefined' && global.getLocale) {
  3289. return global.getLocale();
  3290. }
  3291. return LOCALE_EN;
  3292. }
  3293. function initVueI18n(locale) {
  3294. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3295. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3296. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3297. // 兼容旧版本入参
  3298. if (typeof locale !== 'string') {
  3299. var _ref4 = [messages, locale];
  3300. locale = _ref4[0];
  3301. messages = _ref4[1];
  3302. }
  3303. if (typeof locale !== 'string') {
  3304. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3305. locale = getDefaultLocale();
  3306. }
  3307. if (typeof fallbackLocale !== 'string') {
  3308. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3309. }
  3310. var i18n = new I18n({
  3311. locale: locale,
  3312. fallbackLocale: fallbackLocale,
  3313. messages: messages,
  3314. watcher: watcher
  3315. });
  3316. var _t = function t(key, values) {
  3317. if (typeof getApp !== 'function') {
  3318. // app view
  3319. /* eslint-disable no-func-assign */
  3320. _t = function t(key, values) {
  3321. return i18n.t(key, values);
  3322. };
  3323. } else {
  3324. var isWatchedAppLocale = false;
  3325. _t = function t(key, values) {
  3326. var appVm = getApp().$vm;
  3327. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3328. // options: {
  3329. // type: Array,
  3330. // default () {
  3331. // return [{
  3332. // icon: 'shop',
  3333. // text: t("uni-goods-nav.options.shop"),
  3334. // }, {
  3335. // icon: 'cart',
  3336. // text: t("uni-goods-nav.options.cart")
  3337. // }]
  3338. // }
  3339. // },
  3340. if (appVm) {
  3341. // 触发响应式
  3342. appVm.$locale;
  3343. if (!isWatchedAppLocale) {
  3344. isWatchedAppLocale = true;
  3345. watchAppLocale(appVm, i18n);
  3346. }
  3347. }
  3348. return i18n.t(key, values);
  3349. };
  3350. }
  3351. return _t(key, values);
  3352. };
  3353. return {
  3354. i18n: i18n,
  3355. f: function f(message, values, delimiters) {
  3356. return i18n.f(message, values, delimiters);
  3357. },
  3358. t: function t(key, values) {
  3359. return _t(key, values);
  3360. },
  3361. add: function add(locale, message) {
  3362. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3363. return i18n.add(locale, message, override);
  3364. },
  3365. watch: function watch(fn) {
  3366. return i18n.watchLocale(fn);
  3367. },
  3368. getLocale: function getLocale() {
  3369. return i18n.getLocale();
  3370. },
  3371. setLocale: function setLocale(newLocale) {
  3372. return i18n.setLocale(newLocale);
  3373. }
  3374. };
  3375. }
  3376. var isString = function isString(val) {
  3377. return typeof val === 'string';
  3378. };
  3379. exports.isString = isString;
  3380. var formater;
  3381. function hasI18nJson(jsonObj, delimiters) {
  3382. if (!formater) {
  3383. formater = new BaseFormatter();
  3384. }
  3385. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3386. var value = jsonObj[key];
  3387. if (isString(value)) {
  3388. if (isI18nStr(value, delimiters)) {
  3389. return true;
  3390. }
  3391. } else {
  3392. return hasI18nJson(value, delimiters);
  3393. }
  3394. });
  3395. }
  3396. function parseI18nJson(jsonObj, values, delimiters) {
  3397. if (!formater) {
  3398. formater = new BaseFormatter();
  3399. }
  3400. walkJsonObj(jsonObj, function (jsonObj, key) {
  3401. var value = jsonObj[key];
  3402. if (isString(value)) {
  3403. if (isI18nStr(value, delimiters)) {
  3404. jsonObj[key] = compileStr(value, values, delimiters);
  3405. }
  3406. } else {
  3407. parseI18nJson(value, values, delimiters);
  3408. }
  3409. });
  3410. return jsonObj;
  3411. }
  3412. function compileI18nJsonStr(jsonStr, _ref5) {
  3413. var locale = _ref5.locale,
  3414. locales = _ref5.locales,
  3415. delimiters = _ref5.delimiters;
  3416. if (!isI18nStr(jsonStr, delimiters)) {
  3417. return jsonStr;
  3418. }
  3419. if (!formater) {
  3420. formater = new BaseFormatter();
  3421. }
  3422. var localeValues = [];
  3423. Object.keys(locales).forEach(function (name) {
  3424. if (name !== locale) {
  3425. localeValues.push({
  3426. locale: name,
  3427. values: locales[name]
  3428. });
  3429. }
  3430. });
  3431. localeValues.unshift({
  3432. locale: locale,
  3433. values: locales[locale]
  3434. });
  3435. try {
  3436. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3437. } catch (e) {}
  3438. return jsonStr;
  3439. }
  3440. function isI18nStr(value, delimiters) {
  3441. return value.indexOf(delimiters[0]) > -1;
  3442. }
  3443. function compileStr(value, values, delimiters) {
  3444. return formater.interpolate(value, values, delimiters).join('');
  3445. }
  3446. function compileValue(jsonObj, key, localeValues, delimiters) {
  3447. var value = jsonObj[key];
  3448. if (isString(value)) {
  3449. // 存在国际化
  3450. if (isI18nStr(value, delimiters)) {
  3451. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3452. if (localeValues.length > 1) {
  3453. // 格式化国际化语言
  3454. var valueLocales = jsonObj[key + 'Locales'] = {};
  3455. localeValues.forEach(function (localValue) {
  3456. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3457. });
  3458. }
  3459. }
  3460. } else {
  3461. compileJsonObj(value, localeValues, delimiters);
  3462. }
  3463. }
  3464. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3465. walkJsonObj(jsonObj, function (jsonObj, key) {
  3466. compileValue(jsonObj, key, localeValues, delimiters);
  3467. });
  3468. return jsonObj;
  3469. }
  3470. function walkJsonObj(jsonObj, walk) {
  3471. if (isArray(jsonObj)) {
  3472. for (var i = 0; i < jsonObj.length; i++) {
  3473. if (walk(jsonObj, i)) {
  3474. return true;
  3475. }
  3476. }
  3477. } else if (isObject(jsonObj)) {
  3478. for (var key in jsonObj) {
  3479. if (walk(jsonObj, key)) {
  3480. return true;
  3481. }
  3482. }
  3483. }
  3484. return false;
  3485. }
  3486. function resolveLocale(locales) {
  3487. return function (locale) {
  3488. if (!locale) {
  3489. return locale;
  3490. }
  3491. locale = normalizeLocale(locale) || locale;
  3492. return resolveLocaleChain(locale).find(function (locale) {
  3493. return locales.indexOf(locale) > -1;
  3494. });
  3495. };
  3496. }
  3497. function resolveLocaleChain(locale) {
  3498. var chain = [];
  3499. var tokens = locale.split('-');
  3500. while (tokens.length) {
  3501. chain.push(tokens.join('-'));
  3502. tokens.pop();
  3503. }
  3504. return chain;
  3505. }
  3506. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3507. /***/ }),
  3508. /***/ 23:
  3509. /*!***************************************************************!*\
  3510. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3511. \***************************************************************/
  3512. /*! no static exports found */
  3513. /***/ (function(module, exports) {
  3514. function _classCallCheck(instance, Constructor) {
  3515. if (!(instance instanceof Constructor)) {
  3516. throw new TypeError("Cannot call a class as a function");
  3517. }
  3518. }
  3519. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3520. /***/ }),
  3521. /***/ 24:
  3522. /*!************************************************************!*\
  3523. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3524. \************************************************************/
  3525. /*! no static exports found */
  3526. /***/ (function(module, exports, __webpack_require__) {
  3527. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3528. function _defineProperties(target, props) {
  3529. for (var i = 0; i < props.length; i++) {
  3530. var descriptor = props[i];
  3531. descriptor.enumerable = descriptor.enumerable || false;
  3532. descriptor.configurable = true;
  3533. if ("value" in descriptor) descriptor.writable = true;
  3534. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3535. }
  3536. }
  3537. function _createClass(Constructor, protoProps, staticProps) {
  3538. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3539. if (staticProps) _defineProperties(Constructor, staticProps);
  3540. Object.defineProperty(Constructor, "prototype", {
  3541. writable: false
  3542. });
  3543. return Constructor;
  3544. }
  3545. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3546. /***/ }),
  3547. /***/ 245:
  3548. /*!**************************************!*\
  3549. !*** D:/工作/项目2/亲家母/qjm/api/order.js ***!
  3550. \**************************************/
  3551. /*! no static exports found */
  3552. /***/ (function(module, exports, __webpack_require__) {
  3553. "use strict";
  3554. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  3555. Object.defineProperty(exports, "__esModule", {
  3556. value: true
  3557. });
  3558. exports.computedOrderkey = computedOrderkey;
  3559. exports.confirm = confirm;
  3560. exports.couponsOrder = couponsOrder;
  3561. exports.createOrderkey = createOrderkey;
  3562. exports.express_query = express_query;
  3563. exports.getCouponsList = getCouponsList;
  3564. exports.orderCancel = orderCancel;
  3565. exports.orderDel = orderDel;
  3566. exports.orderDetail = orderDetail;
  3567. exports.orderList = orderList;
  3568. exports.orderPay = orderPay;
  3569. exports.orderTake = orderTake;
  3570. exports.order_comment = order_comment;
  3571. exports.product = product;
  3572. exports.refund = refund;
  3573. exports.refundReason = refundReason;
  3574. exports.upload = upload;
  3575. var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 72));
  3576. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  3577. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  3578. // 订单确认
  3579. function confirm(data) {
  3580. return (0, _request.default)({
  3581. url: '/api/order/confirm',
  3582. method: 'post',
  3583. data: data
  3584. });
  3585. }
  3586. //获取可使用优惠券
  3587. function couponsOrder(data, price, id) {
  3588. return (0, _request.default)({
  3589. url: '/api/coupons/order/' + price + '/' + id,
  3590. method: 'get',
  3591. data: data
  3592. });
  3593. }
  3594. //获取优惠券列表
  3595. function getCouponsList(data, types) {
  3596. //优惠券状态 0全部 1未使用 2已使用
  3597. return (0, _request.default)({
  3598. url: '/api/coupons/user/' + types,
  3599. method: 'get',
  3600. data: data
  3601. });
  3602. }
  3603. //提交评论
  3604. function order_comment(data) {
  3605. return (0, _request.default)({
  3606. url: '/api/order/comment',
  3607. method: 'post',
  3608. data: data
  3609. });
  3610. }
  3611. //订单产品信息
  3612. function product(data) {
  3613. return (0, _request.default)({
  3614. url: '/api/order/product',
  3615. method: 'post',
  3616. data: data
  3617. });
  3618. }
  3619. // 快递查询
  3620. function express_query(data) {
  3621. return (0, _request.default)({
  3622. url: '/api/order/express_query',
  3623. method: 'get',
  3624. data: data
  3625. });
  3626. }
  3627. //上传图片
  3628. function upload(data) {
  3629. return (0, _request.upFilse)({
  3630. url: '/api/upload/image',
  3631. method: 'post',
  3632. data: data
  3633. });
  3634. }
  3635. // 订单列表
  3636. function orderList(data) {
  3637. return (0, _request.default)({
  3638. url: '/api/order/list',
  3639. method: 'get',
  3640. data: data
  3641. });
  3642. }
  3643. // 订单详细
  3644. function orderDetail(data, orderid) {
  3645. return (0, _request.default)({
  3646. url: '/api/order/detail/' + orderid,
  3647. method: 'get',
  3648. data: data
  3649. });
  3650. }
  3651. // 取消订单
  3652. function orderCancel(data) {
  3653. return (0, _request.default)({
  3654. url: '/api/order/cancel',
  3655. method: 'post',
  3656. data: data
  3657. });
  3658. }
  3659. // 删除订单
  3660. function orderDel(data) {
  3661. return (0, _request.default)({
  3662. url: '/api/order/del',
  3663. method: 'get',
  3664. data: data
  3665. });
  3666. }
  3667. // 申请退款
  3668. function refund(data) {
  3669. return (0, _request.default)({
  3670. url: '/api/order/refund/verify',
  3671. method: 'post',
  3672. data: data
  3673. });
  3674. }
  3675. // 退款理由列表
  3676. function refundReason(data) {
  3677. return (0, _request.default)({
  3678. url: '/api/order/refund/reason',
  3679. method: 'get',
  3680. data: data
  3681. });
  3682. }
  3683. // 确认收货
  3684. function orderTake(data) {
  3685. return (0, _request.default)({
  3686. url: '/api/order/take',
  3687. method: 'post',
  3688. data: data
  3689. });
  3690. }
  3691. // 订单支付
  3692. function orderPay(data) {
  3693. return (0, _request.default)({
  3694. url: '/api/order/pay',
  3695. method: 'post',
  3696. data: data
  3697. });
  3698. }
  3699. // 创建订单
  3700. function createOrderkey(data, key) {
  3701. return (0, _request.default)({
  3702. url: '/api/order/create/' + key,
  3703. method: 'post',
  3704. data: data
  3705. });
  3706. }
  3707. // 统计订单金额
  3708. function computedOrderkey(data) {
  3709. return (0, _request.default)({
  3710. url: '/api/order/computed/' + data.orderkey,
  3711. method: 'post',
  3712. data: data
  3713. });
  3714. }
  3715. /***/ }),
  3716. /***/ 25:
  3717. /*!******************************************************************************************!*\
  3718. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3719. \******************************************************************************************/
  3720. /*! exports provided: default */
  3721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3722. "use strict";
  3723. __webpack_require__.r(__webpack_exports__);
  3724. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3725. * Vue.js v2.6.11
  3726. * (c) 2014-2022 Evan You
  3727. * Released under the MIT License.
  3728. */
  3729. /* */
  3730. var emptyObject = Object.freeze({});
  3731. // These helpers produce better VM code in JS engines due to their
  3732. // explicitness and function inlining.
  3733. function isUndef (v) {
  3734. return v === undefined || v === null
  3735. }
  3736. function isDef (v) {
  3737. return v !== undefined && v !== null
  3738. }
  3739. function isTrue (v) {
  3740. return v === true
  3741. }
  3742. function isFalse (v) {
  3743. return v === false
  3744. }
  3745. /**
  3746. * Check if value is primitive.
  3747. */
  3748. function isPrimitive (value) {
  3749. return (
  3750. typeof value === 'string' ||
  3751. typeof value === 'number' ||
  3752. // $flow-disable-line
  3753. typeof value === 'symbol' ||
  3754. typeof value === 'boolean'
  3755. )
  3756. }
  3757. /**
  3758. * Quick object check - this is primarily used to tell
  3759. * Objects from primitive values when we know the value
  3760. * is a JSON-compliant type.
  3761. */
  3762. function isObject (obj) {
  3763. return obj !== null && typeof obj === 'object'
  3764. }
  3765. /**
  3766. * Get the raw type string of a value, e.g., [object Object].
  3767. */
  3768. var _toString = Object.prototype.toString;
  3769. function toRawType (value) {
  3770. return _toString.call(value).slice(8, -1)
  3771. }
  3772. /**
  3773. * Strict object type check. Only returns true
  3774. * for plain JavaScript objects.
  3775. */
  3776. function isPlainObject (obj) {
  3777. return _toString.call(obj) === '[object Object]'
  3778. }
  3779. function isRegExp (v) {
  3780. return _toString.call(v) === '[object RegExp]'
  3781. }
  3782. /**
  3783. * Check if val is a valid array index.
  3784. */
  3785. function isValidArrayIndex (val) {
  3786. var n = parseFloat(String(val));
  3787. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3788. }
  3789. function isPromise (val) {
  3790. return (
  3791. isDef(val) &&
  3792. typeof val.then === 'function' &&
  3793. typeof val.catch === 'function'
  3794. )
  3795. }
  3796. /**
  3797. * Convert a value to a string that is actually rendered.
  3798. */
  3799. function toString (val) {
  3800. return val == null
  3801. ? ''
  3802. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3803. ? JSON.stringify(val, null, 2)
  3804. : String(val)
  3805. }
  3806. /**
  3807. * Convert an input value to a number for persistence.
  3808. * If the conversion fails, return original string.
  3809. */
  3810. function toNumber (val) {
  3811. var n = parseFloat(val);
  3812. return isNaN(n) ? val : n
  3813. }
  3814. /**
  3815. * Make a map and return a function for checking if a key
  3816. * is in that map.
  3817. */
  3818. function makeMap (
  3819. str,
  3820. expectsLowerCase
  3821. ) {
  3822. var map = Object.create(null);
  3823. var list = str.split(',');
  3824. for (var i = 0; i < list.length; i++) {
  3825. map[list[i]] = true;
  3826. }
  3827. return expectsLowerCase
  3828. ? function (val) { return map[val.toLowerCase()]; }
  3829. : function (val) { return map[val]; }
  3830. }
  3831. /**
  3832. * Check if a tag is a built-in tag.
  3833. */
  3834. var isBuiltInTag = makeMap('slot,component', true);
  3835. /**
  3836. * Check if an attribute is a reserved attribute.
  3837. */
  3838. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3839. /**
  3840. * Remove an item from an array.
  3841. */
  3842. function remove (arr, item) {
  3843. if (arr.length) {
  3844. var index = arr.indexOf(item);
  3845. if (index > -1) {
  3846. return arr.splice(index, 1)
  3847. }
  3848. }
  3849. }
  3850. /**
  3851. * Check whether an object has the property.
  3852. */
  3853. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3854. function hasOwn (obj, key) {
  3855. return hasOwnProperty.call(obj, key)
  3856. }
  3857. /**
  3858. * Create a cached version of a pure function.
  3859. */
  3860. function cached (fn) {
  3861. var cache = Object.create(null);
  3862. return (function cachedFn (str) {
  3863. var hit = cache[str];
  3864. return hit || (cache[str] = fn(str))
  3865. })
  3866. }
  3867. /**
  3868. * Camelize a hyphen-delimited string.
  3869. */
  3870. var camelizeRE = /-(\w)/g;
  3871. var camelize = cached(function (str) {
  3872. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3873. });
  3874. /**
  3875. * Capitalize a string.
  3876. */
  3877. var capitalize = cached(function (str) {
  3878. return str.charAt(0).toUpperCase() + str.slice(1)
  3879. });
  3880. /**
  3881. * Hyphenate a camelCase string.
  3882. */
  3883. var hyphenateRE = /\B([A-Z])/g;
  3884. var hyphenate = cached(function (str) {
  3885. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3886. });
  3887. /**
  3888. * Simple bind polyfill for environments that do not support it,
  3889. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3890. * since native bind is now performant enough in most browsers.
  3891. * But removing it would mean breaking code that was able to run in
  3892. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3893. */
  3894. /* istanbul ignore next */
  3895. function polyfillBind (fn, ctx) {
  3896. function boundFn (a) {
  3897. var l = arguments.length;
  3898. return l
  3899. ? l > 1
  3900. ? fn.apply(ctx, arguments)
  3901. : fn.call(ctx, a)
  3902. : fn.call(ctx)
  3903. }
  3904. boundFn._length = fn.length;
  3905. return boundFn
  3906. }
  3907. function nativeBind (fn, ctx) {
  3908. return fn.bind(ctx)
  3909. }
  3910. var bind = Function.prototype.bind
  3911. ? nativeBind
  3912. : polyfillBind;
  3913. /**
  3914. * Convert an Array-like object to a real Array.
  3915. */
  3916. function toArray (list, start) {
  3917. start = start || 0;
  3918. var i = list.length - start;
  3919. var ret = new Array(i);
  3920. while (i--) {
  3921. ret[i] = list[i + start];
  3922. }
  3923. return ret
  3924. }
  3925. /**
  3926. * Mix properties into target object.
  3927. */
  3928. function extend (to, _from) {
  3929. for (var key in _from) {
  3930. to[key] = _from[key];
  3931. }
  3932. return to
  3933. }
  3934. /**
  3935. * Merge an Array of Objects into a single Object.
  3936. */
  3937. function toObject (arr) {
  3938. var res = {};
  3939. for (var i = 0; i < arr.length; i++) {
  3940. if (arr[i]) {
  3941. extend(res, arr[i]);
  3942. }
  3943. }
  3944. return res
  3945. }
  3946. /* eslint-disable no-unused-vars */
  3947. /**
  3948. * Perform no operation.
  3949. * Stubbing args to make Flow happy without leaving useless transpiled code
  3950. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3951. */
  3952. function noop (a, b, c) {}
  3953. /**
  3954. * Always return false.
  3955. */
  3956. var no = function (a, b, c) { return false; };
  3957. /* eslint-enable no-unused-vars */
  3958. /**
  3959. * Return the same value.
  3960. */
  3961. var identity = function (_) { return _; };
  3962. /**
  3963. * Check if two values are loosely equal - that is,
  3964. * if they are plain objects, do they have the same shape?
  3965. */
  3966. function looseEqual (a, b) {
  3967. if (a === b) { return true }
  3968. var isObjectA = isObject(a);
  3969. var isObjectB = isObject(b);
  3970. if (isObjectA && isObjectB) {
  3971. try {
  3972. var isArrayA = Array.isArray(a);
  3973. var isArrayB = Array.isArray(b);
  3974. if (isArrayA && isArrayB) {
  3975. return a.length === b.length && a.every(function (e, i) {
  3976. return looseEqual(e, b[i])
  3977. })
  3978. } else if (a instanceof Date && b instanceof Date) {
  3979. return a.getTime() === b.getTime()
  3980. } else if (!isArrayA && !isArrayB) {
  3981. var keysA = Object.keys(a);
  3982. var keysB = Object.keys(b);
  3983. return keysA.length === keysB.length && keysA.every(function (key) {
  3984. return looseEqual(a[key], b[key])
  3985. })
  3986. } else {
  3987. /* istanbul ignore next */
  3988. return false
  3989. }
  3990. } catch (e) {
  3991. /* istanbul ignore next */
  3992. return false
  3993. }
  3994. } else if (!isObjectA && !isObjectB) {
  3995. return String(a) === String(b)
  3996. } else {
  3997. return false
  3998. }
  3999. }
  4000. /**
  4001. * Return the first index at which a loosely equal value can be
  4002. * found in the array (if value is a plain object, the array must
  4003. * contain an object of the same shape), or -1 if it is not present.
  4004. */
  4005. function looseIndexOf (arr, val) {
  4006. for (var i = 0; i < arr.length; i++) {
  4007. if (looseEqual(arr[i], val)) { return i }
  4008. }
  4009. return -1
  4010. }
  4011. /**
  4012. * Ensure a function is called only once.
  4013. */
  4014. function once (fn) {
  4015. var called = false;
  4016. return function () {
  4017. if (!called) {
  4018. called = true;
  4019. fn.apply(this, arguments);
  4020. }
  4021. }
  4022. }
  4023. var ASSET_TYPES = [
  4024. 'component',
  4025. 'directive',
  4026. 'filter'
  4027. ];
  4028. var LIFECYCLE_HOOKS = [
  4029. 'beforeCreate',
  4030. 'created',
  4031. 'beforeMount',
  4032. 'mounted',
  4033. 'beforeUpdate',
  4034. 'updated',
  4035. 'beforeDestroy',
  4036. 'destroyed',
  4037. 'activated',
  4038. 'deactivated',
  4039. 'errorCaptured',
  4040. 'serverPrefetch'
  4041. ];
  4042. /* */
  4043. var config = ({
  4044. /**
  4045. * Option merge strategies (used in core/util/options)
  4046. */
  4047. // $flow-disable-line
  4048. optionMergeStrategies: Object.create(null),
  4049. /**
  4050. * Whether to suppress warnings.
  4051. */
  4052. silent: false,
  4053. /**
  4054. * Show production mode tip message on boot?
  4055. */
  4056. productionTip: "development" !== 'production',
  4057. /**
  4058. * Whether to enable devtools
  4059. */
  4060. devtools: "development" !== 'production',
  4061. /**
  4062. * Whether to record perf
  4063. */
  4064. performance: false,
  4065. /**
  4066. * Error handler for watcher errors
  4067. */
  4068. errorHandler: null,
  4069. /**
  4070. * Warn handler for watcher warns
  4071. */
  4072. warnHandler: null,
  4073. /**
  4074. * Ignore certain custom elements
  4075. */
  4076. ignoredElements: [],
  4077. /**
  4078. * Custom user key aliases for v-on
  4079. */
  4080. // $flow-disable-line
  4081. keyCodes: Object.create(null),
  4082. /**
  4083. * Check if a tag is reserved so that it cannot be registered as a
  4084. * component. This is platform-dependent and may be overwritten.
  4085. */
  4086. isReservedTag: no,
  4087. /**
  4088. * Check if an attribute is reserved so that it cannot be used as a component
  4089. * prop. This is platform-dependent and may be overwritten.
  4090. */
  4091. isReservedAttr: no,
  4092. /**
  4093. * Check if a tag is an unknown element.
  4094. * Platform-dependent.
  4095. */
  4096. isUnknownElement: no,
  4097. /**
  4098. * Get the namespace of an element
  4099. */
  4100. getTagNamespace: noop,
  4101. /**
  4102. * Parse the real tag name for the specific platform.
  4103. */
  4104. parsePlatformTagName: identity,
  4105. /**
  4106. * Check if an attribute must be bound using property, e.g. value
  4107. * Platform-dependent.
  4108. */
  4109. mustUseProp: no,
  4110. /**
  4111. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4112. * This will significantly reduce performance if set to false.
  4113. */
  4114. async: true,
  4115. /**
  4116. * Exposed for legacy reasons
  4117. */
  4118. _lifecycleHooks: LIFECYCLE_HOOKS
  4119. });
  4120. /* */
  4121. /**
  4122. * unicode letters used for parsing html tags, component names and property paths.
  4123. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4124. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4125. */
  4126. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  4127. /**
  4128. * Check if a string starts with $ or _
  4129. */
  4130. function isReserved (str) {
  4131. var c = (str + '').charCodeAt(0);
  4132. return c === 0x24 || c === 0x5F
  4133. }
  4134. /**
  4135. * Define a property.
  4136. */
  4137. function def (obj, key, val, enumerable) {
  4138. Object.defineProperty(obj, key, {
  4139. value: val,
  4140. enumerable: !!enumerable,
  4141. writable: true,
  4142. configurable: true
  4143. });
  4144. }
  4145. /**
  4146. * Parse simple path.
  4147. */
  4148. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4149. function parsePath (path) {
  4150. if (bailRE.test(path)) {
  4151. return
  4152. }
  4153. var segments = path.split('.');
  4154. return function (obj) {
  4155. for (var i = 0; i < segments.length; i++) {
  4156. if (!obj) { return }
  4157. obj = obj[segments[i]];
  4158. }
  4159. return obj
  4160. }
  4161. }
  4162. /* */
  4163. // can we use __proto__?
  4164. var hasProto = '__proto__' in {};
  4165. // Browser environment sniffing
  4166. var inBrowser = typeof window !== 'undefined';
  4167. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4168. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4169. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4170. var isIE = UA && /msie|trident/.test(UA);
  4171. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4172. var isEdge = UA && UA.indexOf('edge/') > 0;
  4173. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4174. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4175. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4176. var isPhantomJS = UA && /phantomjs/.test(UA);
  4177. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4178. // Firefox has a "watch" function on Object.prototype...
  4179. var nativeWatch = ({}).watch;
  4180. if (inBrowser) {
  4181. try {
  4182. var opts = {};
  4183. Object.defineProperty(opts, 'passive', ({
  4184. get: function get () {
  4185. }
  4186. })); // https://github.com/facebook/flow/issues/285
  4187. window.addEventListener('test-passive', null, opts);
  4188. } catch (e) {}
  4189. }
  4190. // this needs to be lazy-evaled because vue may be required before
  4191. // vue-server-renderer can set VUE_ENV
  4192. var _isServer;
  4193. var isServerRendering = function () {
  4194. if (_isServer === undefined) {
  4195. /* istanbul ignore if */
  4196. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4197. // detect presence of vue-server-renderer and avoid
  4198. // Webpack shimming the process
  4199. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4200. } else {
  4201. _isServer = false;
  4202. }
  4203. }
  4204. return _isServer
  4205. };
  4206. // detect devtools
  4207. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4208. /* istanbul ignore next */
  4209. function isNative (Ctor) {
  4210. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4211. }
  4212. var hasSymbol =
  4213. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4214. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4215. var _Set;
  4216. /* istanbul ignore if */ // $flow-disable-line
  4217. if (typeof Set !== 'undefined' && isNative(Set)) {
  4218. // use native Set when available.
  4219. _Set = Set;
  4220. } else {
  4221. // a non-standard Set polyfill that only works with primitive keys.
  4222. _Set = /*@__PURE__*/(function () {
  4223. function Set () {
  4224. this.set = Object.create(null);
  4225. }
  4226. Set.prototype.has = function has (key) {
  4227. return this.set[key] === true
  4228. };
  4229. Set.prototype.add = function add (key) {
  4230. this.set[key] = true;
  4231. };
  4232. Set.prototype.clear = function clear () {
  4233. this.set = Object.create(null);
  4234. };
  4235. return Set;
  4236. }());
  4237. }
  4238. /* */
  4239. var warn = noop;
  4240. var tip = noop;
  4241. var generateComponentTrace = (noop); // work around flow check
  4242. var formatComponentName = (noop);
  4243. if (true) {
  4244. var hasConsole = typeof console !== 'undefined';
  4245. var classifyRE = /(?:^|[-_])(\w)/g;
  4246. var classify = function (str) { return str
  4247. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4248. .replace(/[-_]/g, ''); };
  4249. warn = function (msg, vm) {
  4250. var trace = vm ? generateComponentTrace(vm) : '';
  4251. if (config.warnHandler) {
  4252. config.warnHandler.call(null, msg, vm, trace);
  4253. } else if (hasConsole && (!config.silent)) {
  4254. console.error(("[Vue warn]: " + msg + trace));
  4255. }
  4256. };
  4257. tip = function (msg, vm) {
  4258. if (hasConsole && (!config.silent)) {
  4259. console.warn("[Vue tip]: " + msg + (
  4260. vm ? generateComponentTrace(vm) : ''
  4261. ));
  4262. }
  4263. };
  4264. formatComponentName = function (vm, includeFile) {
  4265. if (vm.$root === vm) {
  4266. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4267. return ('') + vm.$options.__file
  4268. }
  4269. return '<Root>'
  4270. }
  4271. var options = typeof vm === 'function' && vm.cid != null
  4272. ? vm.options
  4273. : vm._isVue
  4274. ? vm.$options || vm.constructor.options
  4275. : vm;
  4276. var name = options.name || options._componentTag;
  4277. var file = options.__file;
  4278. if (!name && file) {
  4279. var match = file.match(/([^/\\]+)\.vue$/);
  4280. name = match && match[1];
  4281. }
  4282. return (
  4283. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4284. (file && includeFile !== false ? (" at " + file) : '')
  4285. )
  4286. };
  4287. var repeat = function (str, n) {
  4288. var res = '';
  4289. while (n) {
  4290. if (n % 2 === 1) { res += str; }
  4291. if (n > 1) { str += str; }
  4292. n >>= 1;
  4293. }
  4294. return res
  4295. };
  4296. generateComponentTrace = function (vm) {
  4297. if (vm._isVue && vm.$parent) {
  4298. var tree = [];
  4299. var currentRecursiveSequence = 0;
  4300. while (vm && vm.$options.name !== 'PageBody') {
  4301. if (tree.length > 0) {
  4302. var last = tree[tree.length - 1];
  4303. if (last.constructor === vm.constructor) {
  4304. currentRecursiveSequence++;
  4305. vm = vm.$parent;
  4306. continue
  4307. } else if (currentRecursiveSequence > 0) {
  4308. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4309. currentRecursiveSequence = 0;
  4310. }
  4311. }
  4312. !vm.$options.isReserved && tree.push(vm);
  4313. vm = vm.$parent;
  4314. }
  4315. return '\n\nfound in\n\n' + tree
  4316. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4317. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4318. : formatComponentName(vm))); })
  4319. .join('\n')
  4320. } else {
  4321. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4322. }
  4323. };
  4324. }
  4325. /* */
  4326. var uid = 0;
  4327. /**
  4328. * A dep is an observable that can have multiple
  4329. * directives subscribing to it.
  4330. */
  4331. var Dep = function Dep () {
  4332. this.id = uid++;
  4333. this.subs = [];
  4334. };
  4335. Dep.prototype.addSub = function addSub (sub) {
  4336. this.subs.push(sub);
  4337. };
  4338. Dep.prototype.removeSub = function removeSub (sub) {
  4339. remove(this.subs, sub);
  4340. };
  4341. Dep.prototype.depend = function depend () {
  4342. if (Dep.SharedObject.target) {
  4343. Dep.SharedObject.target.addDep(this);
  4344. }
  4345. };
  4346. Dep.prototype.notify = function notify () {
  4347. // stabilize the subscriber list first
  4348. var subs = this.subs.slice();
  4349. if ( true && !config.async) {
  4350. // subs aren't sorted in scheduler if not running async
  4351. // we need to sort them now to make sure they fire in correct
  4352. // order
  4353. subs.sort(function (a, b) { return a.id - b.id; });
  4354. }
  4355. for (var i = 0, l = subs.length; i < l; i++) {
  4356. subs[i].update();
  4357. }
  4358. };
  4359. // The current target watcher being evaluated.
  4360. // This is globally unique because only one watcher
  4361. // can be evaluated at a time.
  4362. // fixed by xxxxxx (nvue shared vuex)
  4363. /* eslint-disable no-undef */
  4364. Dep.SharedObject = {};
  4365. Dep.SharedObject.target = null;
  4366. Dep.SharedObject.targetStack = [];
  4367. function pushTarget (target) {
  4368. Dep.SharedObject.targetStack.push(target);
  4369. Dep.SharedObject.target = target;
  4370. Dep.target = target;
  4371. }
  4372. function popTarget () {
  4373. Dep.SharedObject.targetStack.pop();
  4374. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4375. Dep.target = Dep.SharedObject.target;
  4376. }
  4377. /* */
  4378. var VNode = function VNode (
  4379. tag,
  4380. data,
  4381. children,
  4382. text,
  4383. elm,
  4384. context,
  4385. componentOptions,
  4386. asyncFactory
  4387. ) {
  4388. this.tag = tag;
  4389. this.data = data;
  4390. this.children = children;
  4391. this.text = text;
  4392. this.elm = elm;
  4393. this.ns = undefined;
  4394. this.context = context;
  4395. this.fnContext = undefined;
  4396. this.fnOptions = undefined;
  4397. this.fnScopeId = undefined;
  4398. this.key = data && data.key;
  4399. this.componentOptions = componentOptions;
  4400. this.componentInstance = undefined;
  4401. this.parent = undefined;
  4402. this.raw = false;
  4403. this.isStatic = false;
  4404. this.isRootInsert = true;
  4405. this.isComment = false;
  4406. this.isCloned = false;
  4407. this.isOnce = false;
  4408. this.asyncFactory = asyncFactory;
  4409. this.asyncMeta = undefined;
  4410. this.isAsyncPlaceholder = false;
  4411. };
  4412. var prototypeAccessors = { child: { configurable: true } };
  4413. // DEPRECATED: alias for componentInstance for backwards compat.
  4414. /* istanbul ignore next */
  4415. prototypeAccessors.child.get = function () {
  4416. return this.componentInstance
  4417. };
  4418. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4419. var createEmptyVNode = function (text) {
  4420. if ( text === void 0 ) text = '';
  4421. var node = new VNode();
  4422. node.text = text;
  4423. node.isComment = true;
  4424. return node
  4425. };
  4426. function createTextVNode (val) {
  4427. return new VNode(undefined, undefined, undefined, String(val))
  4428. }
  4429. // optimized shallow clone
  4430. // used for static nodes and slot nodes because they may be reused across
  4431. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4432. // on their elm reference.
  4433. function cloneVNode (vnode) {
  4434. var cloned = new VNode(
  4435. vnode.tag,
  4436. vnode.data,
  4437. // #7975
  4438. // clone children array to avoid mutating original in case of cloning
  4439. // a child.
  4440. vnode.children && vnode.children.slice(),
  4441. vnode.text,
  4442. vnode.elm,
  4443. vnode.context,
  4444. vnode.componentOptions,
  4445. vnode.asyncFactory
  4446. );
  4447. cloned.ns = vnode.ns;
  4448. cloned.isStatic = vnode.isStatic;
  4449. cloned.key = vnode.key;
  4450. cloned.isComment = vnode.isComment;
  4451. cloned.fnContext = vnode.fnContext;
  4452. cloned.fnOptions = vnode.fnOptions;
  4453. cloned.fnScopeId = vnode.fnScopeId;
  4454. cloned.asyncMeta = vnode.asyncMeta;
  4455. cloned.isCloned = true;
  4456. return cloned
  4457. }
  4458. /*
  4459. * not type checking this file because flow doesn't play well with
  4460. * dynamically accessing methods on Array prototype
  4461. */
  4462. var arrayProto = Array.prototype;
  4463. var arrayMethods = Object.create(arrayProto);
  4464. var methodsToPatch = [
  4465. 'push',
  4466. 'pop',
  4467. 'shift',
  4468. 'unshift',
  4469. 'splice',
  4470. 'sort',
  4471. 'reverse'
  4472. ];
  4473. /**
  4474. * Intercept mutating methods and emit events
  4475. */
  4476. methodsToPatch.forEach(function (method) {
  4477. // cache original method
  4478. var original = arrayProto[method];
  4479. def(arrayMethods, method, function mutator () {
  4480. var args = [], len = arguments.length;
  4481. while ( len-- ) args[ len ] = arguments[ len ];
  4482. var result = original.apply(this, args);
  4483. var ob = this.__ob__;
  4484. var inserted;
  4485. switch (method) {
  4486. case 'push':
  4487. case 'unshift':
  4488. inserted = args;
  4489. break
  4490. case 'splice':
  4491. inserted = args.slice(2);
  4492. break
  4493. }
  4494. if (inserted) { ob.observeArray(inserted); }
  4495. // notify change
  4496. ob.dep.notify();
  4497. return result
  4498. });
  4499. });
  4500. /* */
  4501. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4502. /**
  4503. * In some cases we may want to disable observation inside a component's
  4504. * update computation.
  4505. */
  4506. var shouldObserve = true;
  4507. function toggleObserving (value) {
  4508. shouldObserve = value;
  4509. }
  4510. /**
  4511. * Observer class that is attached to each observed
  4512. * object. Once attached, the observer converts the target
  4513. * object's property keys into getter/setters that
  4514. * collect dependencies and dispatch updates.
  4515. */
  4516. var Observer = function Observer (value) {
  4517. this.value = value;
  4518. this.dep = new Dep();
  4519. this.vmCount = 0;
  4520. def(value, '__ob__', this);
  4521. if (Array.isArray(value)) {
  4522. if (hasProto) {
  4523. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4524. if(value.push !== value.__proto__.push){
  4525. copyAugment(value, arrayMethods, arrayKeys);
  4526. } else {
  4527. protoAugment(value, arrayMethods);
  4528. }
  4529. }
  4530. } else {
  4531. copyAugment(value, arrayMethods, arrayKeys);
  4532. }
  4533. this.observeArray(value);
  4534. } else {
  4535. this.walk(value);
  4536. }
  4537. };
  4538. /**
  4539. * Walk through all properties and convert them into
  4540. * getter/setters. This method should only be called when
  4541. * value type is Object.
  4542. */
  4543. Observer.prototype.walk = function walk (obj) {
  4544. var keys = Object.keys(obj);
  4545. for (var i = 0; i < keys.length; i++) {
  4546. defineReactive$$1(obj, keys[i]);
  4547. }
  4548. };
  4549. /**
  4550. * Observe a list of Array items.
  4551. */
  4552. Observer.prototype.observeArray = function observeArray (items) {
  4553. for (var i = 0, l = items.length; i < l; i++) {
  4554. observe(items[i]);
  4555. }
  4556. };
  4557. // helpers
  4558. /**
  4559. * Augment a target Object or Array by intercepting
  4560. * the prototype chain using __proto__
  4561. */
  4562. function protoAugment (target, src) {
  4563. /* eslint-disable no-proto */
  4564. target.__proto__ = src;
  4565. /* eslint-enable no-proto */
  4566. }
  4567. /**
  4568. * Augment a target Object or Array by defining
  4569. * hidden properties.
  4570. */
  4571. /* istanbul ignore next */
  4572. function copyAugment (target, src, keys) {
  4573. for (var i = 0, l = keys.length; i < l; i++) {
  4574. var key = keys[i];
  4575. def(target, key, src[key]);
  4576. }
  4577. }
  4578. /**
  4579. * Attempt to create an observer instance for a value,
  4580. * returns the new observer if successfully observed,
  4581. * or the existing observer if the value already has one.
  4582. */
  4583. function observe (value, asRootData) {
  4584. if (!isObject(value) || value instanceof VNode) {
  4585. return
  4586. }
  4587. var ob;
  4588. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4589. ob = value.__ob__;
  4590. } else if (
  4591. shouldObserve &&
  4592. !isServerRendering() &&
  4593. (Array.isArray(value) || isPlainObject(value)) &&
  4594. Object.isExtensible(value) &&
  4595. !value._isVue &&
  4596. !value.__v_isMPComponent
  4597. ) {
  4598. ob = new Observer(value);
  4599. }
  4600. if (asRootData && ob) {
  4601. ob.vmCount++;
  4602. }
  4603. return ob
  4604. }
  4605. /**
  4606. * Define a reactive property on an Object.
  4607. */
  4608. function defineReactive$$1 (
  4609. obj,
  4610. key,
  4611. val,
  4612. customSetter,
  4613. shallow
  4614. ) {
  4615. var dep = new Dep();
  4616. var property = Object.getOwnPropertyDescriptor(obj, key);
  4617. if (property && property.configurable === false) {
  4618. return
  4619. }
  4620. // cater for pre-defined getter/setters
  4621. var getter = property && property.get;
  4622. var setter = property && property.set;
  4623. if ((!getter || setter) && arguments.length === 2) {
  4624. val = obj[key];
  4625. }
  4626. var childOb = !shallow && observe(val);
  4627. Object.defineProperty(obj, key, {
  4628. enumerable: true,
  4629. configurable: true,
  4630. get: function reactiveGetter () {
  4631. var value = getter ? getter.call(obj) : val;
  4632. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4633. dep.depend();
  4634. if (childOb) {
  4635. childOb.dep.depend();
  4636. if (Array.isArray(value)) {
  4637. dependArray(value);
  4638. }
  4639. }
  4640. }
  4641. return value
  4642. },
  4643. set: function reactiveSetter (newVal) {
  4644. var value = getter ? getter.call(obj) : val;
  4645. /* eslint-disable no-self-compare */
  4646. if (newVal === value || (newVal !== newVal && value !== value)) {
  4647. return
  4648. }
  4649. /* eslint-enable no-self-compare */
  4650. if ( true && customSetter) {
  4651. customSetter();
  4652. }
  4653. // #7981: for accessor properties without setter
  4654. if (getter && !setter) { return }
  4655. if (setter) {
  4656. setter.call(obj, newVal);
  4657. } else {
  4658. val = newVal;
  4659. }
  4660. childOb = !shallow && observe(newVal);
  4661. dep.notify();
  4662. }
  4663. });
  4664. }
  4665. /**
  4666. * Set a property on an object. Adds the new property and
  4667. * triggers change notification if the property doesn't
  4668. * already exist.
  4669. */
  4670. function set (target, key, val) {
  4671. if ( true &&
  4672. (isUndef(target) || isPrimitive(target))
  4673. ) {
  4674. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4675. }
  4676. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4677. target.length = Math.max(target.length, key);
  4678. target.splice(key, 1, val);
  4679. return val
  4680. }
  4681. if (key in target && !(key in Object.prototype)) {
  4682. target[key] = val;
  4683. return val
  4684. }
  4685. var ob = (target).__ob__;
  4686. if (target._isVue || (ob && ob.vmCount)) {
  4687. true && warn(
  4688. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4689. 'at runtime - declare it upfront in the data option.'
  4690. );
  4691. return val
  4692. }
  4693. if (!ob) {
  4694. target[key] = val;
  4695. return val
  4696. }
  4697. defineReactive$$1(ob.value, key, val);
  4698. ob.dep.notify();
  4699. return val
  4700. }
  4701. /**
  4702. * Delete a property and trigger change if necessary.
  4703. */
  4704. function del (target, key) {
  4705. if ( true &&
  4706. (isUndef(target) || isPrimitive(target))
  4707. ) {
  4708. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4709. }
  4710. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4711. target.splice(key, 1);
  4712. return
  4713. }
  4714. var ob = (target).__ob__;
  4715. if (target._isVue || (ob && ob.vmCount)) {
  4716. true && warn(
  4717. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4718. '- just set it to null.'
  4719. );
  4720. return
  4721. }
  4722. if (!hasOwn(target, key)) {
  4723. return
  4724. }
  4725. delete target[key];
  4726. if (!ob) {
  4727. return
  4728. }
  4729. ob.dep.notify();
  4730. }
  4731. /**
  4732. * Collect dependencies on array elements when the array is touched, since
  4733. * we cannot intercept array element access like property getters.
  4734. */
  4735. function dependArray (value) {
  4736. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4737. e = value[i];
  4738. e && e.__ob__ && e.__ob__.dep.depend();
  4739. if (Array.isArray(e)) {
  4740. dependArray(e);
  4741. }
  4742. }
  4743. }
  4744. /* */
  4745. /**
  4746. * Option overwriting strategies are functions that handle
  4747. * how to merge a parent option value and a child option
  4748. * value into the final value.
  4749. */
  4750. var strats = config.optionMergeStrategies;
  4751. /**
  4752. * Options with restrictions
  4753. */
  4754. if (true) {
  4755. strats.el = strats.propsData = function (parent, child, vm, key) {
  4756. if (!vm) {
  4757. warn(
  4758. "option \"" + key + "\" can only be used during instance " +
  4759. 'creation with the `new` keyword.'
  4760. );
  4761. }
  4762. return defaultStrat(parent, child)
  4763. };
  4764. }
  4765. /**
  4766. * Helper that recursively merges two data objects together.
  4767. */
  4768. function mergeData (to, from) {
  4769. if (!from) { return to }
  4770. var key, toVal, fromVal;
  4771. var keys = hasSymbol
  4772. ? Reflect.ownKeys(from)
  4773. : Object.keys(from);
  4774. for (var i = 0; i < keys.length; i++) {
  4775. key = keys[i];
  4776. // in case the object is already observed...
  4777. if (key === '__ob__') { continue }
  4778. toVal = to[key];
  4779. fromVal = from[key];
  4780. if (!hasOwn(to, key)) {
  4781. set(to, key, fromVal);
  4782. } else if (
  4783. toVal !== fromVal &&
  4784. isPlainObject(toVal) &&
  4785. isPlainObject(fromVal)
  4786. ) {
  4787. mergeData(toVal, fromVal);
  4788. }
  4789. }
  4790. return to
  4791. }
  4792. /**
  4793. * Data
  4794. */
  4795. function mergeDataOrFn (
  4796. parentVal,
  4797. childVal,
  4798. vm
  4799. ) {
  4800. if (!vm) {
  4801. // in a Vue.extend merge, both should be functions
  4802. if (!childVal) {
  4803. return parentVal
  4804. }
  4805. if (!parentVal) {
  4806. return childVal
  4807. }
  4808. // when parentVal & childVal are both present,
  4809. // we need to return a function that returns the
  4810. // merged result of both functions... no need to
  4811. // check if parentVal is a function here because
  4812. // it has to be a function to pass previous merges.
  4813. return function mergedDataFn () {
  4814. return mergeData(
  4815. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4816. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4817. )
  4818. }
  4819. } else {
  4820. return function mergedInstanceDataFn () {
  4821. // instance merge
  4822. var instanceData = typeof childVal === 'function'
  4823. ? childVal.call(vm, vm)
  4824. : childVal;
  4825. var defaultData = typeof parentVal === 'function'
  4826. ? parentVal.call(vm, vm)
  4827. : parentVal;
  4828. if (instanceData) {
  4829. return mergeData(instanceData, defaultData)
  4830. } else {
  4831. return defaultData
  4832. }
  4833. }
  4834. }
  4835. }
  4836. strats.data = function (
  4837. parentVal,
  4838. childVal,
  4839. vm
  4840. ) {
  4841. if (!vm) {
  4842. if (childVal && typeof childVal !== 'function') {
  4843. true && warn(
  4844. 'The "data" option should be a function ' +
  4845. 'that returns a per-instance value in component ' +
  4846. 'definitions.',
  4847. vm
  4848. );
  4849. return parentVal
  4850. }
  4851. return mergeDataOrFn(parentVal, childVal)
  4852. }
  4853. return mergeDataOrFn(parentVal, childVal, vm)
  4854. };
  4855. /**
  4856. * Hooks and props are merged as arrays.
  4857. */
  4858. function mergeHook (
  4859. parentVal,
  4860. childVal
  4861. ) {
  4862. var res = childVal
  4863. ? parentVal
  4864. ? parentVal.concat(childVal)
  4865. : Array.isArray(childVal)
  4866. ? childVal
  4867. : [childVal]
  4868. : parentVal;
  4869. return res
  4870. ? dedupeHooks(res)
  4871. : res
  4872. }
  4873. function dedupeHooks (hooks) {
  4874. var res = [];
  4875. for (var i = 0; i < hooks.length; i++) {
  4876. if (res.indexOf(hooks[i]) === -1) {
  4877. res.push(hooks[i]);
  4878. }
  4879. }
  4880. return res
  4881. }
  4882. LIFECYCLE_HOOKS.forEach(function (hook) {
  4883. strats[hook] = mergeHook;
  4884. });
  4885. /**
  4886. * Assets
  4887. *
  4888. * When a vm is present (instance creation), we need to do
  4889. * a three-way merge between constructor options, instance
  4890. * options and parent options.
  4891. */
  4892. function mergeAssets (
  4893. parentVal,
  4894. childVal,
  4895. vm,
  4896. key
  4897. ) {
  4898. var res = Object.create(parentVal || null);
  4899. if (childVal) {
  4900. true && assertObjectType(key, childVal, vm);
  4901. return extend(res, childVal)
  4902. } else {
  4903. return res
  4904. }
  4905. }
  4906. ASSET_TYPES.forEach(function (type) {
  4907. strats[type + 's'] = mergeAssets;
  4908. });
  4909. /**
  4910. * Watchers.
  4911. *
  4912. * Watchers hashes should not overwrite one
  4913. * another, so we merge them as arrays.
  4914. */
  4915. strats.watch = function (
  4916. parentVal,
  4917. childVal,
  4918. vm,
  4919. key
  4920. ) {
  4921. // work around Firefox's Object.prototype.watch...
  4922. if (parentVal === nativeWatch) { parentVal = undefined; }
  4923. if (childVal === nativeWatch) { childVal = undefined; }
  4924. /* istanbul ignore if */
  4925. if (!childVal) { return Object.create(parentVal || null) }
  4926. if (true) {
  4927. assertObjectType(key, childVal, vm);
  4928. }
  4929. if (!parentVal) { return childVal }
  4930. var ret = {};
  4931. extend(ret, parentVal);
  4932. for (var key$1 in childVal) {
  4933. var parent = ret[key$1];
  4934. var child = childVal[key$1];
  4935. if (parent && !Array.isArray(parent)) {
  4936. parent = [parent];
  4937. }
  4938. ret[key$1] = parent
  4939. ? parent.concat(child)
  4940. : Array.isArray(child) ? child : [child];
  4941. }
  4942. return ret
  4943. };
  4944. /**
  4945. * Other object hashes.
  4946. */
  4947. strats.props =
  4948. strats.methods =
  4949. strats.inject =
  4950. strats.computed = function (
  4951. parentVal,
  4952. childVal,
  4953. vm,
  4954. key
  4955. ) {
  4956. if (childVal && "development" !== 'production') {
  4957. assertObjectType(key, childVal, vm);
  4958. }
  4959. if (!parentVal) { return childVal }
  4960. var ret = Object.create(null);
  4961. extend(ret, parentVal);
  4962. if (childVal) { extend(ret, childVal); }
  4963. return ret
  4964. };
  4965. strats.provide = mergeDataOrFn;
  4966. /**
  4967. * Default strategy.
  4968. */
  4969. var defaultStrat = function (parentVal, childVal) {
  4970. return childVal === undefined
  4971. ? parentVal
  4972. : childVal
  4973. };
  4974. /**
  4975. * Validate component names
  4976. */
  4977. function checkComponents (options) {
  4978. for (var key in options.components) {
  4979. validateComponentName(key);
  4980. }
  4981. }
  4982. function validateComponentName (name) {
  4983. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4984. warn(
  4985. 'Invalid component name: "' + name + '". Component names ' +
  4986. 'should conform to valid custom element name in html5 specification.'
  4987. );
  4988. }
  4989. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4990. warn(
  4991. 'Do not use built-in or reserved HTML elements as component ' +
  4992. 'id: ' + name
  4993. );
  4994. }
  4995. }
  4996. /**
  4997. * Ensure all props option syntax are normalized into the
  4998. * Object-based format.
  4999. */
  5000. function normalizeProps (options, vm) {
  5001. var props = options.props;
  5002. if (!props) { return }
  5003. var res = {};
  5004. var i, val, name;
  5005. if (Array.isArray(props)) {
  5006. i = props.length;
  5007. while (i--) {
  5008. val = props[i];
  5009. if (typeof val === 'string') {
  5010. name = camelize(val);
  5011. res[name] = { type: null };
  5012. } else if (true) {
  5013. warn('props must be strings when using array syntax.');
  5014. }
  5015. }
  5016. } else if (isPlainObject(props)) {
  5017. for (var key in props) {
  5018. val = props[key];
  5019. name = camelize(key);
  5020. res[name] = isPlainObject(val)
  5021. ? val
  5022. : { type: val };
  5023. }
  5024. } else if (true) {
  5025. warn(
  5026. "Invalid value for option \"props\": expected an Array or an Object, " +
  5027. "but got " + (toRawType(props)) + ".",
  5028. vm
  5029. );
  5030. }
  5031. options.props = res;
  5032. }
  5033. /**
  5034. * Normalize all injections into Object-based format
  5035. */
  5036. function normalizeInject (options, vm) {
  5037. var inject = options.inject;
  5038. if (!inject) { return }
  5039. var normalized = options.inject = {};
  5040. if (Array.isArray(inject)) {
  5041. for (var i = 0; i < inject.length; i++) {
  5042. normalized[inject[i]] = { from: inject[i] };
  5043. }
  5044. } else if (isPlainObject(inject)) {
  5045. for (var key in inject) {
  5046. var val = inject[key];
  5047. normalized[key] = isPlainObject(val)
  5048. ? extend({ from: key }, val)
  5049. : { from: val };
  5050. }
  5051. } else if (true) {
  5052. warn(
  5053. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5054. "but got " + (toRawType(inject)) + ".",
  5055. vm
  5056. );
  5057. }
  5058. }
  5059. /**
  5060. * Normalize raw function directives into object format.
  5061. */
  5062. function normalizeDirectives (options) {
  5063. var dirs = options.directives;
  5064. if (dirs) {
  5065. for (var key in dirs) {
  5066. var def$$1 = dirs[key];
  5067. if (typeof def$$1 === 'function') {
  5068. dirs[key] = { bind: def$$1, update: def$$1 };
  5069. }
  5070. }
  5071. }
  5072. }
  5073. function assertObjectType (name, value, vm) {
  5074. if (!isPlainObject(value)) {
  5075. warn(
  5076. "Invalid value for option \"" + name + "\": expected an Object, " +
  5077. "but got " + (toRawType(value)) + ".",
  5078. vm
  5079. );
  5080. }
  5081. }
  5082. /**
  5083. * Merge two option objects into a new one.
  5084. * Core utility used in both instantiation and inheritance.
  5085. */
  5086. function mergeOptions (
  5087. parent,
  5088. child,
  5089. vm
  5090. ) {
  5091. if (true) {
  5092. checkComponents(child);
  5093. }
  5094. if (typeof child === 'function') {
  5095. child = child.options;
  5096. }
  5097. normalizeProps(child, vm);
  5098. normalizeInject(child, vm);
  5099. normalizeDirectives(child);
  5100. // Apply extends and mixins on the child options,
  5101. // but only if it is a raw options object that isn't
  5102. // the result of another mergeOptions call.
  5103. // Only merged options has the _base property.
  5104. if (!child._base) {
  5105. if (child.extends) {
  5106. parent = mergeOptions(parent, child.extends, vm);
  5107. }
  5108. if (child.mixins) {
  5109. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5110. parent = mergeOptions(parent, child.mixins[i], vm);
  5111. }
  5112. }
  5113. }
  5114. var options = {};
  5115. var key;
  5116. for (key in parent) {
  5117. mergeField(key);
  5118. }
  5119. for (key in child) {
  5120. if (!hasOwn(parent, key)) {
  5121. mergeField(key);
  5122. }
  5123. }
  5124. function mergeField (key) {
  5125. var strat = strats[key] || defaultStrat;
  5126. options[key] = strat(parent[key], child[key], vm, key);
  5127. }
  5128. return options
  5129. }
  5130. /**
  5131. * Resolve an asset.
  5132. * This function is used because child instances need access
  5133. * to assets defined in its ancestor chain.
  5134. */
  5135. function resolveAsset (
  5136. options,
  5137. type,
  5138. id,
  5139. warnMissing
  5140. ) {
  5141. /* istanbul ignore if */
  5142. if (typeof id !== 'string') {
  5143. return
  5144. }
  5145. var assets = options[type];
  5146. // check local registration variations first
  5147. if (hasOwn(assets, id)) { return assets[id] }
  5148. var camelizedId = camelize(id);
  5149. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5150. var PascalCaseId = capitalize(camelizedId);
  5151. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5152. // fallback to prototype chain
  5153. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5154. if ( true && warnMissing && !res) {
  5155. warn(
  5156. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5157. options
  5158. );
  5159. }
  5160. return res
  5161. }
  5162. /* */
  5163. function validateProp (
  5164. key,
  5165. propOptions,
  5166. propsData,
  5167. vm
  5168. ) {
  5169. var prop = propOptions[key];
  5170. var absent = !hasOwn(propsData, key);
  5171. var value = propsData[key];
  5172. // boolean casting
  5173. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5174. if (booleanIndex > -1) {
  5175. if (absent && !hasOwn(prop, 'default')) {
  5176. value = false;
  5177. } else if (value === '' || value === hyphenate(key)) {
  5178. // only cast empty string / same name to boolean if
  5179. // boolean has higher priority
  5180. var stringIndex = getTypeIndex(String, prop.type);
  5181. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5182. value = true;
  5183. }
  5184. }
  5185. }
  5186. // check default value
  5187. if (value === undefined) {
  5188. value = getPropDefaultValue(vm, prop, key);
  5189. // since the default value is a fresh copy,
  5190. // make sure to observe it.
  5191. var prevShouldObserve = shouldObserve;
  5192. toggleObserving(true);
  5193. observe(value);
  5194. toggleObserving(prevShouldObserve);
  5195. }
  5196. if (
  5197. true
  5198. ) {
  5199. assertProp(prop, key, value, vm, absent);
  5200. }
  5201. return value
  5202. }
  5203. /**
  5204. * Get the default value of a prop.
  5205. */
  5206. function getPropDefaultValue (vm, prop, key) {
  5207. // no default, return undefined
  5208. if (!hasOwn(prop, 'default')) {
  5209. return undefined
  5210. }
  5211. var def = prop.default;
  5212. // warn against non-factory defaults for Object & Array
  5213. if ( true && isObject(def)) {
  5214. warn(
  5215. 'Invalid default value for prop "' + key + '": ' +
  5216. 'Props with type Object/Array must use a factory function ' +
  5217. 'to return the default value.',
  5218. vm
  5219. );
  5220. }
  5221. // the raw prop value was also undefined from previous render,
  5222. // return previous default value to avoid unnecessary watcher trigger
  5223. if (vm && vm.$options.propsData &&
  5224. vm.$options.propsData[key] === undefined &&
  5225. vm._props[key] !== undefined
  5226. ) {
  5227. return vm._props[key]
  5228. }
  5229. // call factory function for non-Function types
  5230. // a value is Function if its prototype is function even across different execution context
  5231. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5232. ? def.call(vm)
  5233. : def
  5234. }
  5235. /**
  5236. * Assert whether a prop is valid.
  5237. */
  5238. function assertProp (
  5239. prop,
  5240. name,
  5241. value,
  5242. vm,
  5243. absent
  5244. ) {
  5245. if (prop.required && absent) {
  5246. warn(
  5247. 'Missing required prop: "' + name + '"',
  5248. vm
  5249. );
  5250. return
  5251. }
  5252. if (value == null && !prop.required) {
  5253. return
  5254. }
  5255. var type = prop.type;
  5256. var valid = !type || type === true;
  5257. var expectedTypes = [];
  5258. if (type) {
  5259. if (!Array.isArray(type)) {
  5260. type = [type];
  5261. }
  5262. for (var i = 0; i < type.length && !valid; i++) {
  5263. var assertedType = assertType(value, type[i]);
  5264. expectedTypes.push(assertedType.expectedType || '');
  5265. valid = assertedType.valid;
  5266. }
  5267. }
  5268. if (!valid) {
  5269. warn(
  5270. getInvalidTypeMessage(name, value, expectedTypes),
  5271. vm
  5272. );
  5273. return
  5274. }
  5275. var validator = prop.validator;
  5276. if (validator) {
  5277. if (!validator(value)) {
  5278. warn(
  5279. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5280. vm
  5281. );
  5282. }
  5283. }
  5284. }
  5285. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5286. function assertType (value, type) {
  5287. var valid;
  5288. var expectedType = getType(type);
  5289. if (simpleCheckRE.test(expectedType)) {
  5290. var t = typeof value;
  5291. valid = t === expectedType.toLowerCase();
  5292. // for primitive wrapper objects
  5293. if (!valid && t === 'object') {
  5294. valid = value instanceof type;
  5295. }
  5296. } else if (expectedType === 'Object') {
  5297. valid = isPlainObject(value);
  5298. } else if (expectedType === 'Array') {
  5299. valid = Array.isArray(value);
  5300. } else {
  5301. valid = value instanceof type;
  5302. }
  5303. return {
  5304. valid: valid,
  5305. expectedType: expectedType
  5306. }
  5307. }
  5308. /**
  5309. * Use function string name to check built-in types,
  5310. * because a simple equality check will fail when running
  5311. * across different vms / iframes.
  5312. */
  5313. function getType (fn) {
  5314. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5315. return match ? match[1] : ''
  5316. }
  5317. function isSameType (a, b) {
  5318. return getType(a) === getType(b)
  5319. }
  5320. function getTypeIndex (type, expectedTypes) {
  5321. if (!Array.isArray(expectedTypes)) {
  5322. return isSameType(expectedTypes, type) ? 0 : -1
  5323. }
  5324. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5325. if (isSameType(expectedTypes[i], type)) {
  5326. return i
  5327. }
  5328. }
  5329. return -1
  5330. }
  5331. function getInvalidTypeMessage (name, value, expectedTypes) {
  5332. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5333. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5334. var expectedType = expectedTypes[0];
  5335. var receivedType = toRawType(value);
  5336. var expectedValue = styleValue(value, expectedType);
  5337. var receivedValue = styleValue(value, receivedType);
  5338. // check if we need to specify expected value
  5339. if (expectedTypes.length === 1 &&
  5340. isExplicable(expectedType) &&
  5341. !isBoolean(expectedType, receivedType)) {
  5342. message += " with value " + expectedValue;
  5343. }
  5344. message += ", got " + receivedType + " ";
  5345. // check if we need to specify received value
  5346. if (isExplicable(receivedType)) {
  5347. message += "with value " + receivedValue + ".";
  5348. }
  5349. return message
  5350. }
  5351. function styleValue (value, type) {
  5352. if (type === 'String') {
  5353. return ("\"" + value + "\"")
  5354. } else if (type === 'Number') {
  5355. return ("" + (Number(value)))
  5356. } else {
  5357. return ("" + value)
  5358. }
  5359. }
  5360. function isExplicable (value) {
  5361. var explicitTypes = ['string', 'number', 'boolean'];
  5362. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5363. }
  5364. function isBoolean () {
  5365. var args = [], len = arguments.length;
  5366. while ( len-- ) args[ len ] = arguments[ len ];
  5367. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5368. }
  5369. /* */
  5370. function handleError (err, vm, info) {
  5371. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5372. // See: https://github.com/vuejs/vuex/issues/1505
  5373. pushTarget();
  5374. try {
  5375. if (vm) {
  5376. var cur = vm;
  5377. while ((cur = cur.$parent)) {
  5378. var hooks = cur.$options.errorCaptured;
  5379. if (hooks) {
  5380. for (var i = 0; i < hooks.length; i++) {
  5381. try {
  5382. var capture = hooks[i].call(cur, err, vm, info) === false;
  5383. if (capture) { return }
  5384. } catch (e) {
  5385. globalHandleError(e, cur, 'errorCaptured hook');
  5386. }
  5387. }
  5388. }
  5389. }
  5390. }
  5391. globalHandleError(err, vm, info);
  5392. } finally {
  5393. popTarget();
  5394. }
  5395. }
  5396. function invokeWithErrorHandling (
  5397. handler,
  5398. context,
  5399. args,
  5400. vm,
  5401. info
  5402. ) {
  5403. var res;
  5404. try {
  5405. res = args ? handler.apply(context, args) : handler.call(context);
  5406. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5407. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5408. // issue #9511
  5409. // avoid catch triggering multiple times when nested calls
  5410. res._handled = true;
  5411. }
  5412. } catch (e) {
  5413. handleError(e, vm, info);
  5414. }
  5415. return res
  5416. }
  5417. function globalHandleError (err, vm, info) {
  5418. if (config.errorHandler) {
  5419. try {
  5420. return config.errorHandler.call(null, err, vm, info)
  5421. } catch (e) {
  5422. // if the user intentionally throws the original error in the handler,
  5423. // do not log it twice
  5424. if (e !== err) {
  5425. logError(e, null, 'config.errorHandler');
  5426. }
  5427. }
  5428. }
  5429. logError(err, vm, info);
  5430. }
  5431. function logError (err, vm, info) {
  5432. if (true) {
  5433. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5434. }
  5435. /* istanbul ignore else */
  5436. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5437. console.error(err);
  5438. } else {
  5439. throw err
  5440. }
  5441. }
  5442. /* */
  5443. var callbacks = [];
  5444. var pending = false;
  5445. function flushCallbacks () {
  5446. pending = false;
  5447. var copies = callbacks.slice(0);
  5448. callbacks.length = 0;
  5449. for (var i = 0; i < copies.length; i++) {
  5450. copies[i]();
  5451. }
  5452. }
  5453. // Here we have async deferring wrappers using microtasks.
  5454. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5455. // However, it has subtle problems when state is changed right before repaint
  5456. // (e.g. #6813, out-in transitions).
  5457. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5458. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5459. // So we now use microtasks everywhere, again.
  5460. // A major drawback of this tradeoff is that there are some scenarios
  5461. // where microtasks have too high a priority and fire in between supposedly
  5462. // sequential events (e.g. #4521, #6690, which have workarounds)
  5463. // or even between bubbling of the same event (#6566).
  5464. var timerFunc;
  5465. // The nextTick behavior leverages the microtask queue, which can be accessed
  5466. // via either native Promise.then or MutationObserver.
  5467. // MutationObserver has wider support, however it is seriously bugged in
  5468. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5469. // completely stops working after triggering a few times... so, if native
  5470. // Promise is available, we will use it:
  5471. /* istanbul ignore next, $flow-disable-line */
  5472. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5473. var p = Promise.resolve();
  5474. timerFunc = function () {
  5475. p.then(flushCallbacks);
  5476. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5477. // it can get stuck in a weird state where callbacks are pushed into the
  5478. // microtask queue but the queue isn't being flushed, until the browser
  5479. // needs to do some other work, e.g. handle a timer. Therefore we can
  5480. // "force" the microtask queue to be flushed by adding an empty timer.
  5481. if (isIOS) { setTimeout(noop); }
  5482. };
  5483. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5484. isNative(MutationObserver) ||
  5485. // PhantomJS and iOS 7.x
  5486. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5487. )) {
  5488. // Use MutationObserver where native Promise is not available,
  5489. // e.g. PhantomJS, iOS7, Android 4.4
  5490. // (#6466 MutationObserver is unreliable in IE11)
  5491. var counter = 1;
  5492. var observer = new MutationObserver(flushCallbacks);
  5493. var textNode = document.createTextNode(String(counter));
  5494. observer.observe(textNode, {
  5495. characterData: true
  5496. });
  5497. timerFunc = function () {
  5498. counter = (counter + 1) % 2;
  5499. textNode.data = String(counter);
  5500. };
  5501. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5502. // Fallback to setImmediate.
  5503. // Technically it leverages the (macro) task queue,
  5504. // but it is still a better choice than setTimeout.
  5505. timerFunc = function () {
  5506. setImmediate(flushCallbacks);
  5507. };
  5508. } else {
  5509. // Fallback to setTimeout.
  5510. timerFunc = function () {
  5511. setTimeout(flushCallbacks, 0);
  5512. };
  5513. }
  5514. function nextTick (cb, ctx) {
  5515. var _resolve;
  5516. callbacks.push(function () {
  5517. if (cb) {
  5518. try {
  5519. cb.call(ctx);
  5520. } catch (e) {
  5521. handleError(e, ctx, 'nextTick');
  5522. }
  5523. } else if (_resolve) {
  5524. _resolve(ctx);
  5525. }
  5526. });
  5527. if (!pending) {
  5528. pending = true;
  5529. timerFunc();
  5530. }
  5531. // $flow-disable-line
  5532. if (!cb && typeof Promise !== 'undefined') {
  5533. return new Promise(function (resolve) {
  5534. _resolve = resolve;
  5535. })
  5536. }
  5537. }
  5538. /* */
  5539. /* not type checking this file because flow doesn't play well with Proxy */
  5540. var initProxy;
  5541. if (true) {
  5542. var allowedGlobals = makeMap(
  5543. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5544. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5545. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5546. 'require' // for Webpack/Browserify
  5547. );
  5548. var warnNonPresent = function (target, key) {
  5549. warn(
  5550. "Property or method \"" + key + "\" is not defined on the instance but " +
  5551. 'referenced during render. Make sure that this property is reactive, ' +
  5552. 'either in the data option, or for class-based components, by ' +
  5553. 'initializing the property. ' +
  5554. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5555. target
  5556. );
  5557. };
  5558. var warnReservedPrefix = function (target, key) {
  5559. warn(
  5560. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5561. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5562. 'prevent conflicts with Vue internals. ' +
  5563. 'See: https://vuejs.org/v2/api/#data',
  5564. target
  5565. );
  5566. };
  5567. var hasProxy =
  5568. typeof Proxy !== 'undefined' && isNative(Proxy);
  5569. if (hasProxy) {
  5570. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5571. config.keyCodes = new Proxy(config.keyCodes, {
  5572. set: function set (target, key, value) {
  5573. if (isBuiltInModifier(key)) {
  5574. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5575. return false
  5576. } else {
  5577. target[key] = value;
  5578. return true
  5579. }
  5580. }
  5581. });
  5582. }
  5583. var hasHandler = {
  5584. has: function has (target, key) {
  5585. var has = key in target;
  5586. var isAllowed = allowedGlobals(key) ||
  5587. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5588. if (!has && !isAllowed) {
  5589. if (key in target.$data) { warnReservedPrefix(target, key); }
  5590. else { warnNonPresent(target, key); }
  5591. }
  5592. return has || !isAllowed
  5593. }
  5594. };
  5595. var getHandler = {
  5596. get: function get (target, key) {
  5597. if (typeof key === 'string' && !(key in target)) {
  5598. if (key in target.$data) { warnReservedPrefix(target, key); }
  5599. else { warnNonPresent(target, key); }
  5600. }
  5601. return target[key]
  5602. }
  5603. };
  5604. initProxy = function initProxy (vm) {
  5605. if (hasProxy) {
  5606. // determine which proxy handler to use
  5607. var options = vm.$options;
  5608. var handlers = options.render && options.render._withStripped
  5609. ? getHandler
  5610. : hasHandler;
  5611. vm._renderProxy = new Proxy(vm, handlers);
  5612. } else {
  5613. vm._renderProxy = vm;
  5614. }
  5615. };
  5616. }
  5617. /* */
  5618. var seenObjects = new _Set();
  5619. /**
  5620. * Recursively traverse an object to evoke all converted
  5621. * getters, so that every nested property inside the object
  5622. * is collected as a "deep" dependency.
  5623. */
  5624. function traverse (val) {
  5625. _traverse(val, seenObjects);
  5626. seenObjects.clear();
  5627. }
  5628. function _traverse (val, seen) {
  5629. var i, keys;
  5630. var isA = Array.isArray(val);
  5631. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5632. return
  5633. }
  5634. if (val.__ob__) {
  5635. var depId = val.__ob__.dep.id;
  5636. if (seen.has(depId)) {
  5637. return
  5638. }
  5639. seen.add(depId);
  5640. }
  5641. if (isA) {
  5642. i = val.length;
  5643. while (i--) { _traverse(val[i], seen); }
  5644. } else {
  5645. keys = Object.keys(val);
  5646. i = keys.length;
  5647. while (i--) { _traverse(val[keys[i]], seen); }
  5648. }
  5649. }
  5650. var mark;
  5651. var measure;
  5652. if (true) {
  5653. var perf = inBrowser && window.performance;
  5654. /* istanbul ignore if */
  5655. if (
  5656. perf &&
  5657. perf.mark &&
  5658. perf.measure &&
  5659. perf.clearMarks &&
  5660. perf.clearMeasures
  5661. ) {
  5662. mark = function (tag) { return perf.mark(tag); };
  5663. measure = function (name, startTag, endTag) {
  5664. perf.measure(name, startTag, endTag);
  5665. perf.clearMarks(startTag);
  5666. perf.clearMarks(endTag);
  5667. // perf.clearMeasures(name)
  5668. };
  5669. }
  5670. }
  5671. /* */
  5672. var normalizeEvent = cached(function (name) {
  5673. var passive = name.charAt(0) === '&';
  5674. name = passive ? name.slice(1) : name;
  5675. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5676. name = once$$1 ? name.slice(1) : name;
  5677. var capture = name.charAt(0) === '!';
  5678. name = capture ? name.slice(1) : name;
  5679. return {
  5680. name: name,
  5681. once: once$$1,
  5682. capture: capture,
  5683. passive: passive
  5684. }
  5685. });
  5686. function createFnInvoker (fns, vm) {
  5687. function invoker () {
  5688. var arguments$1 = arguments;
  5689. var fns = invoker.fns;
  5690. if (Array.isArray(fns)) {
  5691. var cloned = fns.slice();
  5692. for (var i = 0; i < cloned.length; i++) {
  5693. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5694. }
  5695. } else {
  5696. // return handler return value for single handlers
  5697. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5698. }
  5699. }
  5700. invoker.fns = fns;
  5701. return invoker
  5702. }
  5703. function updateListeners (
  5704. on,
  5705. oldOn,
  5706. add,
  5707. remove$$1,
  5708. createOnceHandler,
  5709. vm
  5710. ) {
  5711. var name, def$$1, cur, old, event;
  5712. for (name in on) {
  5713. def$$1 = cur = on[name];
  5714. old = oldOn[name];
  5715. event = normalizeEvent(name);
  5716. if (isUndef(cur)) {
  5717. true && warn(
  5718. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5719. vm
  5720. );
  5721. } else if (isUndef(old)) {
  5722. if (isUndef(cur.fns)) {
  5723. cur = on[name] = createFnInvoker(cur, vm);
  5724. }
  5725. if (isTrue(event.once)) {
  5726. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5727. }
  5728. add(event.name, cur, event.capture, event.passive, event.params);
  5729. } else if (cur !== old) {
  5730. old.fns = cur;
  5731. on[name] = old;
  5732. }
  5733. }
  5734. for (name in oldOn) {
  5735. if (isUndef(on[name])) {
  5736. event = normalizeEvent(name);
  5737. remove$$1(event.name, oldOn[name], event.capture);
  5738. }
  5739. }
  5740. }
  5741. /* */
  5742. /* */
  5743. // fixed by xxxxxx (mp properties)
  5744. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5745. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5746. if (isUndef(propOptions)) {
  5747. return res
  5748. }
  5749. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5750. var attrs = data.attrs;
  5751. var props = data.props;
  5752. if (isDef(attrs) || isDef(props)) {
  5753. for (var key in propOptions) {
  5754. var altKey = hyphenate(key);
  5755. var result = checkProp(res, props, key, altKey, true) ||
  5756. checkProp(res, attrs, key, altKey, false);
  5757. // externalClass
  5758. if (
  5759. result &&
  5760. res[key] &&
  5761. externalClasses.indexOf(altKey) !== -1 &&
  5762. context[camelize(res[key])]
  5763. ) {
  5764. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5765. res[key] = context[camelize(res[key])];
  5766. }
  5767. }
  5768. }
  5769. return res
  5770. }
  5771. function extractPropsFromVNodeData (
  5772. data,
  5773. Ctor,
  5774. tag,
  5775. context// fixed by xxxxxx
  5776. ) {
  5777. // we are only extracting raw values here.
  5778. // validation and default values are handled in the child
  5779. // component itself.
  5780. var propOptions = Ctor.options.props;
  5781. if (isUndef(propOptions)) {
  5782. // fixed by xxxxxx
  5783. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5784. }
  5785. var res = {};
  5786. var attrs = data.attrs;
  5787. var props = data.props;
  5788. if (isDef(attrs) || isDef(props)) {
  5789. for (var key in propOptions) {
  5790. var altKey = hyphenate(key);
  5791. if (true) {
  5792. var keyInLowerCase = key.toLowerCase();
  5793. if (
  5794. key !== keyInLowerCase &&
  5795. attrs && hasOwn(attrs, keyInLowerCase)
  5796. ) {
  5797. tip(
  5798. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5799. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5800. " \"" + key + "\". " +
  5801. "Note that HTML attributes are case-insensitive and camelCased " +
  5802. "props need to use their kebab-case equivalents when using in-DOM " +
  5803. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5804. );
  5805. }
  5806. }
  5807. checkProp(res, props, key, altKey, true) ||
  5808. checkProp(res, attrs, key, altKey, false);
  5809. }
  5810. }
  5811. // fixed by xxxxxx
  5812. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5813. }
  5814. function checkProp (
  5815. res,
  5816. hash,
  5817. key,
  5818. altKey,
  5819. preserve
  5820. ) {
  5821. if (isDef(hash)) {
  5822. if (hasOwn(hash, key)) {
  5823. res[key] = hash[key];
  5824. if (!preserve) {
  5825. delete hash[key];
  5826. }
  5827. return true
  5828. } else if (hasOwn(hash, altKey)) {
  5829. res[key] = hash[altKey];
  5830. if (!preserve) {
  5831. delete hash[altKey];
  5832. }
  5833. return true
  5834. }
  5835. }
  5836. return false
  5837. }
  5838. /* */
  5839. // The template compiler attempts to minimize the need for normalization by
  5840. // statically analyzing the template at compile time.
  5841. //
  5842. // For plain HTML markup, normalization can be completely skipped because the
  5843. // generated render function is guaranteed to return Array<VNode>. There are
  5844. // two cases where extra normalization is needed:
  5845. // 1. When the children contains components - because a functional component
  5846. // may return an Array instead of a single root. In this case, just a simple
  5847. // normalization is needed - if any child is an Array, we flatten the whole
  5848. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5849. // because functional components already normalize their own children.
  5850. function simpleNormalizeChildren (children) {
  5851. for (var i = 0; i < children.length; i++) {
  5852. if (Array.isArray(children[i])) {
  5853. return Array.prototype.concat.apply([], children)
  5854. }
  5855. }
  5856. return children
  5857. }
  5858. // 2. When the children contains constructs that always generated nested Arrays,
  5859. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5860. // with hand-written render functions / JSX. In such cases a full normalization
  5861. // is needed to cater to all possible types of children values.
  5862. function normalizeChildren (children) {
  5863. return isPrimitive(children)
  5864. ? [createTextVNode(children)]
  5865. : Array.isArray(children)
  5866. ? normalizeArrayChildren(children)
  5867. : undefined
  5868. }
  5869. function isTextNode (node) {
  5870. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5871. }
  5872. function normalizeArrayChildren (children, nestedIndex) {
  5873. var res = [];
  5874. var i, c, lastIndex, last;
  5875. for (i = 0; i < children.length; i++) {
  5876. c = children[i];
  5877. if (isUndef(c) || typeof c === 'boolean') { continue }
  5878. lastIndex = res.length - 1;
  5879. last = res[lastIndex];
  5880. // nested
  5881. if (Array.isArray(c)) {
  5882. if (c.length > 0) {
  5883. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5884. // merge adjacent text nodes
  5885. if (isTextNode(c[0]) && isTextNode(last)) {
  5886. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5887. c.shift();
  5888. }
  5889. res.push.apply(res, c);
  5890. }
  5891. } else if (isPrimitive(c)) {
  5892. if (isTextNode(last)) {
  5893. // merge adjacent text nodes
  5894. // this is necessary for SSR hydration because text nodes are
  5895. // essentially merged when rendered to HTML strings
  5896. res[lastIndex] = createTextVNode(last.text + c);
  5897. } else if (c !== '') {
  5898. // convert primitive to vnode
  5899. res.push(createTextVNode(c));
  5900. }
  5901. } else {
  5902. if (isTextNode(c) && isTextNode(last)) {
  5903. // merge adjacent text nodes
  5904. res[lastIndex] = createTextVNode(last.text + c.text);
  5905. } else {
  5906. // default key for nested array children (likely generated by v-for)
  5907. if (isTrue(children._isVList) &&
  5908. isDef(c.tag) &&
  5909. isUndef(c.key) &&
  5910. isDef(nestedIndex)) {
  5911. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5912. }
  5913. res.push(c);
  5914. }
  5915. }
  5916. }
  5917. return res
  5918. }
  5919. /* */
  5920. function initProvide (vm) {
  5921. var provide = vm.$options.provide;
  5922. if (provide) {
  5923. vm._provided = typeof provide === 'function'
  5924. ? provide.call(vm)
  5925. : provide;
  5926. }
  5927. }
  5928. function initInjections (vm) {
  5929. var result = resolveInject(vm.$options.inject, vm);
  5930. if (result) {
  5931. toggleObserving(false);
  5932. Object.keys(result).forEach(function (key) {
  5933. /* istanbul ignore else */
  5934. if (true) {
  5935. defineReactive$$1(vm, key, result[key], function () {
  5936. warn(
  5937. "Avoid mutating an injected value directly since the changes will be " +
  5938. "overwritten whenever the provided component re-renders. " +
  5939. "injection being mutated: \"" + key + "\"",
  5940. vm
  5941. );
  5942. });
  5943. } else {}
  5944. });
  5945. toggleObserving(true);
  5946. }
  5947. }
  5948. function resolveInject (inject, vm) {
  5949. if (inject) {
  5950. // inject is :any because flow is not smart enough to figure out cached
  5951. var result = Object.create(null);
  5952. var keys = hasSymbol
  5953. ? Reflect.ownKeys(inject)
  5954. : Object.keys(inject);
  5955. for (var i = 0; i < keys.length; i++) {
  5956. var key = keys[i];
  5957. // #6574 in case the inject object is observed...
  5958. if (key === '__ob__') { continue }
  5959. var provideKey = inject[key].from;
  5960. var source = vm;
  5961. while (source) {
  5962. if (source._provided && hasOwn(source._provided, provideKey)) {
  5963. result[key] = source._provided[provideKey];
  5964. break
  5965. }
  5966. source = source.$parent;
  5967. }
  5968. if (!source) {
  5969. if ('default' in inject[key]) {
  5970. var provideDefault = inject[key].default;
  5971. result[key] = typeof provideDefault === 'function'
  5972. ? provideDefault.call(vm)
  5973. : provideDefault;
  5974. } else if (true) {
  5975. warn(("Injection \"" + key + "\" not found"), vm);
  5976. }
  5977. }
  5978. }
  5979. return result
  5980. }
  5981. }
  5982. /* */
  5983. /**
  5984. * Runtime helper for resolving raw children VNodes into a slot object.
  5985. */
  5986. function resolveSlots (
  5987. children,
  5988. context
  5989. ) {
  5990. if (!children || !children.length) {
  5991. return {}
  5992. }
  5993. var slots = {};
  5994. for (var i = 0, l = children.length; i < l; i++) {
  5995. var child = children[i];
  5996. var data = child.data;
  5997. // remove slot attribute if the node is resolved as a Vue slot node
  5998. if (data && data.attrs && data.attrs.slot) {
  5999. delete data.attrs.slot;
  6000. }
  6001. // named slots should only be respected if the vnode was rendered in the
  6002. // same context.
  6003. if ((child.context === context || child.fnContext === context) &&
  6004. data && data.slot != null
  6005. ) {
  6006. var name = data.slot;
  6007. var slot = (slots[name] || (slots[name] = []));
  6008. if (child.tag === 'template') {
  6009. slot.push.apply(slot, child.children || []);
  6010. } else {
  6011. slot.push(child);
  6012. }
  6013. } else {
  6014. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6015. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6016. (slots['page'] || (slots['page'] = [])).push(child);
  6017. }else{
  6018. (slots.default || (slots.default = [])).push(child);
  6019. }
  6020. }
  6021. }
  6022. // ignore slots that contains only whitespace
  6023. for (var name$1 in slots) {
  6024. if (slots[name$1].every(isWhitespace)) {
  6025. delete slots[name$1];
  6026. }
  6027. }
  6028. return slots
  6029. }
  6030. function isWhitespace (node) {
  6031. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6032. }
  6033. /* */
  6034. function normalizeScopedSlots (
  6035. slots,
  6036. normalSlots,
  6037. prevSlots
  6038. ) {
  6039. var res;
  6040. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6041. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6042. var key = slots && slots.$key;
  6043. if (!slots) {
  6044. res = {};
  6045. } else if (slots._normalized) {
  6046. // fast path 1: child component re-render only, parent did not change
  6047. return slots._normalized
  6048. } else if (
  6049. isStable &&
  6050. prevSlots &&
  6051. prevSlots !== emptyObject &&
  6052. key === prevSlots.$key &&
  6053. !hasNormalSlots &&
  6054. !prevSlots.$hasNormal
  6055. ) {
  6056. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6057. // only need to normalize once
  6058. return prevSlots
  6059. } else {
  6060. res = {};
  6061. for (var key$1 in slots) {
  6062. if (slots[key$1] && key$1[0] !== '$') {
  6063. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6064. }
  6065. }
  6066. }
  6067. // expose normal slots on scopedSlots
  6068. for (var key$2 in normalSlots) {
  6069. if (!(key$2 in res)) {
  6070. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6071. }
  6072. }
  6073. // avoriaz seems to mock a non-extensible $scopedSlots object
  6074. // and when that is passed down this would cause an error
  6075. if (slots && Object.isExtensible(slots)) {
  6076. (slots)._normalized = res;
  6077. }
  6078. def(res, '$stable', isStable);
  6079. def(res, '$key', key);
  6080. def(res, '$hasNormal', hasNormalSlots);
  6081. return res
  6082. }
  6083. function normalizeScopedSlot(normalSlots, key, fn) {
  6084. var normalized = function () {
  6085. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6086. res = res && typeof res === 'object' && !Array.isArray(res)
  6087. ? [res] // single vnode
  6088. : normalizeChildren(res);
  6089. return res && (
  6090. res.length === 0 ||
  6091. (res.length === 1 && res[0].isComment) // #9658
  6092. ) ? undefined
  6093. : res
  6094. };
  6095. // this is a slot using the new v-slot syntax without scope. although it is
  6096. // compiled as a scoped slot, render fn users would expect it to be present
  6097. // on this.$slots because the usage is semantically a normal slot.
  6098. if (fn.proxy) {
  6099. Object.defineProperty(normalSlots, key, {
  6100. get: normalized,
  6101. enumerable: true,
  6102. configurable: true
  6103. });
  6104. }
  6105. return normalized
  6106. }
  6107. function proxyNormalSlot(slots, key) {
  6108. return function () { return slots[key]; }
  6109. }
  6110. /* */
  6111. /**
  6112. * Runtime helper for rendering v-for lists.
  6113. */
  6114. function renderList (
  6115. val,
  6116. render
  6117. ) {
  6118. var ret, i, l, keys, key;
  6119. if (Array.isArray(val) || typeof val === 'string') {
  6120. ret = new Array(val.length);
  6121. for (i = 0, l = val.length; i < l; i++) {
  6122. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6123. }
  6124. } else if (typeof val === 'number') {
  6125. ret = new Array(val);
  6126. for (i = 0; i < val; i++) {
  6127. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6128. }
  6129. } else if (isObject(val)) {
  6130. if (hasSymbol && val[Symbol.iterator]) {
  6131. ret = [];
  6132. var iterator = val[Symbol.iterator]();
  6133. var result = iterator.next();
  6134. while (!result.done) {
  6135. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6136. result = iterator.next();
  6137. }
  6138. } else {
  6139. keys = Object.keys(val);
  6140. ret = new Array(keys.length);
  6141. for (i = 0, l = keys.length; i < l; i++) {
  6142. key = keys[i];
  6143. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6144. }
  6145. }
  6146. }
  6147. if (!isDef(ret)) {
  6148. ret = [];
  6149. }
  6150. (ret)._isVList = true;
  6151. return ret
  6152. }
  6153. /* */
  6154. /**
  6155. * Runtime helper for rendering <slot>
  6156. */
  6157. function renderSlot (
  6158. name,
  6159. fallback,
  6160. props,
  6161. bindObject
  6162. ) {
  6163. var scopedSlotFn = this.$scopedSlots[name];
  6164. var nodes;
  6165. if (scopedSlotFn) { // scoped slot
  6166. props = props || {};
  6167. if (bindObject) {
  6168. if ( true && !isObject(bindObject)) {
  6169. warn(
  6170. 'slot v-bind without argument expects an Object',
  6171. this
  6172. );
  6173. }
  6174. props = extend(extend({}, bindObject), props);
  6175. }
  6176. // fixed by xxxxxx app-plus scopedSlot
  6177. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6178. } else {
  6179. nodes = this.$slots[name] || fallback;
  6180. }
  6181. var target = props && props.slot;
  6182. if (target) {
  6183. return this.$createElement('template', { slot: target }, nodes)
  6184. } else {
  6185. return nodes
  6186. }
  6187. }
  6188. /* */
  6189. /**
  6190. * Runtime helper for resolving filters
  6191. */
  6192. function resolveFilter (id) {
  6193. return resolveAsset(this.$options, 'filters', id, true) || identity
  6194. }
  6195. /* */
  6196. function isKeyNotMatch (expect, actual) {
  6197. if (Array.isArray(expect)) {
  6198. return expect.indexOf(actual) === -1
  6199. } else {
  6200. return expect !== actual
  6201. }
  6202. }
  6203. /**
  6204. * Runtime helper for checking keyCodes from config.
  6205. * exposed as Vue.prototype._k
  6206. * passing in eventKeyName as last argument separately for backwards compat
  6207. */
  6208. function checkKeyCodes (
  6209. eventKeyCode,
  6210. key,
  6211. builtInKeyCode,
  6212. eventKeyName,
  6213. builtInKeyName
  6214. ) {
  6215. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6216. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6217. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6218. } else if (mappedKeyCode) {
  6219. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6220. } else if (eventKeyName) {
  6221. return hyphenate(eventKeyName) !== key
  6222. }
  6223. }
  6224. /* */
  6225. /**
  6226. * Runtime helper for merging v-bind="object" into a VNode's data.
  6227. */
  6228. function bindObjectProps (
  6229. data,
  6230. tag,
  6231. value,
  6232. asProp,
  6233. isSync
  6234. ) {
  6235. if (value) {
  6236. if (!isObject(value)) {
  6237. true && warn(
  6238. 'v-bind without argument expects an Object or Array value',
  6239. this
  6240. );
  6241. } else {
  6242. if (Array.isArray(value)) {
  6243. value = toObject(value);
  6244. }
  6245. var hash;
  6246. var loop = function ( key ) {
  6247. if (
  6248. key === 'class' ||
  6249. key === 'style' ||
  6250. isReservedAttribute(key)
  6251. ) {
  6252. hash = data;
  6253. } else {
  6254. var type = data.attrs && data.attrs.type;
  6255. hash = asProp || config.mustUseProp(tag, type, key)
  6256. ? data.domProps || (data.domProps = {})
  6257. : data.attrs || (data.attrs = {});
  6258. }
  6259. var camelizedKey = camelize(key);
  6260. var hyphenatedKey = hyphenate(key);
  6261. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6262. hash[key] = value[key];
  6263. if (isSync) {
  6264. var on = data.on || (data.on = {});
  6265. on[("update:" + key)] = function ($event) {
  6266. value[key] = $event;
  6267. };
  6268. }
  6269. }
  6270. };
  6271. for (var key in value) loop( key );
  6272. }
  6273. }
  6274. return data
  6275. }
  6276. /* */
  6277. /**
  6278. * Runtime helper for rendering static trees.
  6279. */
  6280. function renderStatic (
  6281. index,
  6282. isInFor
  6283. ) {
  6284. var cached = this._staticTrees || (this._staticTrees = []);
  6285. var tree = cached[index];
  6286. // if has already-rendered static tree and not inside v-for,
  6287. // we can reuse the same tree.
  6288. if (tree && !isInFor) {
  6289. return tree
  6290. }
  6291. // otherwise, render a fresh tree.
  6292. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6293. this._renderProxy,
  6294. null,
  6295. this // for render fns generated for functional component templates
  6296. );
  6297. markStatic(tree, ("__static__" + index), false);
  6298. return tree
  6299. }
  6300. /**
  6301. * Runtime helper for v-once.
  6302. * Effectively it means marking the node as static with a unique key.
  6303. */
  6304. function markOnce (
  6305. tree,
  6306. index,
  6307. key
  6308. ) {
  6309. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6310. return tree
  6311. }
  6312. function markStatic (
  6313. tree,
  6314. key,
  6315. isOnce
  6316. ) {
  6317. if (Array.isArray(tree)) {
  6318. for (var i = 0; i < tree.length; i++) {
  6319. if (tree[i] && typeof tree[i] !== 'string') {
  6320. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6321. }
  6322. }
  6323. } else {
  6324. markStaticNode(tree, key, isOnce);
  6325. }
  6326. }
  6327. function markStaticNode (node, key, isOnce) {
  6328. node.isStatic = true;
  6329. node.key = key;
  6330. node.isOnce = isOnce;
  6331. }
  6332. /* */
  6333. function bindObjectListeners (data, value) {
  6334. if (value) {
  6335. if (!isPlainObject(value)) {
  6336. true && warn(
  6337. 'v-on without argument expects an Object value',
  6338. this
  6339. );
  6340. } else {
  6341. var on = data.on = data.on ? extend({}, data.on) : {};
  6342. for (var key in value) {
  6343. var existing = on[key];
  6344. var ours = value[key];
  6345. on[key] = existing ? [].concat(existing, ours) : ours;
  6346. }
  6347. }
  6348. }
  6349. return data
  6350. }
  6351. /* */
  6352. function resolveScopedSlots (
  6353. fns, // see flow/vnode
  6354. res,
  6355. // the following are added in 2.6
  6356. hasDynamicKeys,
  6357. contentHashKey
  6358. ) {
  6359. res = res || { $stable: !hasDynamicKeys };
  6360. for (var i = 0; i < fns.length; i++) {
  6361. var slot = fns[i];
  6362. if (Array.isArray(slot)) {
  6363. resolveScopedSlots(slot, res, hasDynamicKeys);
  6364. } else if (slot) {
  6365. // marker for reverse proxying v-slot without scope on this.$slots
  6366. if (slot.proxy) {
  6367. slot.fn.proxy = true;
  6368. }
  6369. res[slot.key] = slot.fn;
  6370. }
  6371. }
  6372. if (contentHashKey) {
  6373. (res).$key = contentHashKey;
  6374. }
  6375. return res
  6376. }
  6377. /* */
  6378. function bindDynamicKeys (baseObj, values) {
  6379. for (var i = 0; i < values.length; i += 2) {
  6380. var key = values[i];
  6381. if (typeof key === 'string' && key) {
  6382. baseObj[values[i]] = values[i + 1];
  6383. } else if ( true && key !== '' && key !== null) {
  6384. // null is a special value for explicitly removing a binding
  6385. warn(
  6386. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6387. this
  6388. );
  6389. }
  6390. }
  6391. return baseObj
  6392. }
  6393. // helper to dynamically append modifier runtime markers to event names.
  6394. // ensure only append when value is already string, otherwise it will be cast
  6395. // to string and cause the type check to miss.
  6396. function prependModifier (value, symbol) {
  6397. return typeof value === 'string' ? symbol + value : value
  6398. }
  6399. /* */
  6400. function installRenderHelpers (target) {
  6401. target._o = markOnce;
  6402. target._n = toNumber;
  6403. target._s = toString;
  6404. target._l = renderList;
  6405. target._t = renderSlot;
  6406. target._q = looseEqual;
  6407. target._i = looseIndexOf;
  6408. target._m = renderStatic;
  6409. target._f = resolveFilter;
  6410. target._k = checkKeyCodes;
  6411. target._b = bindObjectProps;
  6412. target._v = createTextVNode;
  6413. target._e = createEmptyVNode;
  6414. target._u = resolveScopedSlots;
  6415. target._g = bindObjectListeners;
  6416. target._d = bindDynamicKeys;
  6417. target._p = prependModifier;
  6418. }
  6419. /* */
  6420. function FunctionalRenderContext (
  6421. data,
  6422. props,
  6423. children,
  6424. parent,
  6425. Ctor
  6426. ) {
  6427. var this$1 = this;
  6428. var options = Ctor.options;
  6429. // ensure the createElement function in functional components
  6430. // gets a unique context - this is necessary for correct named slot check
  6431. var contextVm;
  6432. if (hasOwn(parent, '_uid')) {
  6433. contextVm = Object.create(parent);
  6434. // $flow-disable-line
  6435. contextVm._original = parent;
  6436. } else {
  6437. // the context vm passed in is a functional context as well.
  6438. // in this case we want to make sure we are able to get a hold to the
  6439. // real context instance.
  6440. contextVm = parent;
  6441. // $flow-disable-line
  6442. parent = parent._original;
  6443. }
  6444. var isCompiled = isTrue(options._compiled);
  6445. var needNormalization = !isCompiled;
  6446. this.data = data;
  6447. this.props = props;
  6448. this.children = children;
  6449. this.parent = parent;
  6450. this.listeners = data.on || emptyObject;
  6451. this.injections = resolveInject(options.inject, parent);
  6452. this.slots = function () {
  6453. if (!this$1.$slots) {
  6454. normalizeScopedSlots(
  6455. data.scopedSlots,
  6456. this$1.$slots = resolveSlots(children, parent)
  6457. );
  6458. }
  6459. return this$1.$slots
  6460. };
  6461. Object.defineProperty(this, 'scopedSlots', ({
  6462. enumerable: true,
  6463. get: function get () {
  6464. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6465. }
  6466. }));
  6467. // support for compiled functional template
  6468. if (isCompiled) {
  6469. // exposing $options for renderStatic()
  6470. this.$options = options;
  6471. // pre-resolve slots for renderSlot()
  6472. this.$slots = this.slots();
  6473. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6474. }
  6475. if (options._scopeId) {
  6476. this._c = function (a, b, c, d) {
  6477. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6478. if (vnode && !Array.isArray(vnode)) {
  6479. vnode.fnScopeId = options._scopeId;
  6480. vnode.fnContext = parent;
  6481. }
  6482. return vnode
  6483. };
  6484. } else {
  6485. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6486. }
  6487. }
  6488. installRenderHelpers(FunctionalRenderContext.prototype);
  6489. function createFunctionalComponent (
  6490. Ctor,
  6491. propsData,
  6492. data,
  6493. contextVm,
  6494. children
  6495. ) {
  6496. var options = Ctor.options;
  6497. var props = {};
  6498. var propOptions = options.props;
  6499. if (isDef(propOptions)) {
  6500. for (var key in propOptions) {
  6501. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6502. }
  6503. } else {
  6504. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6505. if (isDef(data.props)) { mergeProps(props, data.props); }
  6506. }
  6507. var renderContext = new FunctionalRenderContext(
  6508. data,
  6509. props,
  6510. children,
  6511. contextVm,
  6512. Ctor
  6513. );
  6514. var vnode = options.render.call(null, renderContext._c, renderContext);
  6515. if (vnode instanceof VNode) {
  6516. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6517. } else if (Array.isArray(vnode)) {
  6518. var vnodes = normalizeChildren(vnode) || [];
  6519. var res = new Array(vnodes.length);
  6520. for (var i = 0; i < vnodes.length; i++) {
  6521. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6522. }
  6523. return res
  6524. }
  6525. }
  6526. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6527. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6528. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6529. // that should not be matched to match.
  6530. var clone = cloneVNode(vnode);
  6531. clone.fnContext = contextVm;
  6532. clone.fnOptions = options;
  6533. if (true) {
  6534. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6535. }
  6536. if (data.slot) {
  6537. (clone.data || (clone.data = {})).slot = data.slot;
  6538. }
  6539. return clone
  6540. }
  6541. function mergeProps (to, from) {
  6542. for (var key in from) {
  6543. to[camelize(key)] = from[key];
  6544. }
  6545. }
  6546. /* */
  6547. /* */
  6548. /* */
  6549. /* */
  6550. // inline hooks to be invoked on component VNodes during patch
  6551. var componentVNodeHooks = {
  6552. init: function init (vnode, hydrating) {
  6553. if (
  6554. vnode.componentInstance &&
  6555. !vnode.componentInstance._isDestroyed &&
  6556. vnode.data.keepAlive
  6557. ) {
  6558. // kept-alive components, treat as a patch
  6559. var mountedNode = vnode; // work around flow
  6560. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6561. } else {
  6562. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6563. vnode,
  6564. activeInstance
  6565. );
  6566. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6567. }
  6568. },
  6569. prepatch: function prepatch (oldVnode, vnode) {
  6570. var options = vnode.componentOptions;
  6571. var child = vnode.componentInstance = oldVnode.componentInstance;
  6572. updateChildComponent(
  6573. child,
  6574. options.propsData, // updated props
  6575. options.listeners, // updated listeners
  6576. vnode, // new parent vnode
  6577. options.children // new children
  6578. );
  6579. },
  6580. insert: function insert (vnode) {
  6581. var context = vnode.context;
  6582. var componentInstance = vnode.componentInstance;
  6583. if (!componentInstance._isMounted) {
  6584. callHook(componentInstance, 'onServiceCreated');
  6585. callHook(componentInstance, 'onServiceAttached');
  6586. componentInstance._isMounted = true;
  6587. callHook(componentInstance, 'mounted');
  6588. }
  6589. if (vnode.data.keepAlive) {
  6590. if (context._isMounted) {
  6591. // vue-router#1212
  6592. // During updates, a kept-alive component's child components may
  6593. // change, so directly walking the tree here may call activated hooks
  6594. // on incorrect children. Instead we push them into a queue which will
  6595. // be processed after the whole patch process ended.
  6596. queueActivatedComponent(componentInstance);
  6597. } else {
  6598. activateChildComponent(componentInstance, true /* direct */);
  6599. }
  6600. }
  6601. },
  6602. destroy: function destroy (vnode) {
  6603. var componentInstance = vnode.componentInstance;
  6604. if (!componentInstance._isDestroyed) {
  6605. if (!vnode.data.keepAlive) {
  6606. componentInstance.$destroy();
  6607. } else {
  6608. deactivateChildComponent(componentInstance, true /* direct */);
  6609. }
  6610. }
  6611. }
  6612. };
  6613. var hooksToMerge = Object.keys(componentVNodeHooks);
  6614. function createComponent (
  6615. Ctor,
  6616. data,
  6617. context,
  6618. children,
  6619. tag
  6620. ) {
  6621. if (isUndef(Ctor)) {
  6622. return
  6623. }
  6624. var baseCtor = context.$options._base;
  6625. // plain options object: turn it into a constructor
  6626. if (isObject(Ctor)) {
  6627. Ctor = baseCtor.extend(Ctor);
  6628. }
  6629. // if at this stage it's not a constructor or an async component factory,
  6630. // reject.
  6631. if (typeof Ctor !== 'function') {
  6632. if (true) {
  6633. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6634. }
  6635. return
  6636. }
  6637. // async component
  6638. var asyncFactory;
  6639. if (isUndef(Ctor.cid)) {
  6640. asyncFactory = Ctor;
  6641. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6642. if (Ctor === undefined) {
  6643. // return a placeholder node for async component, which is rendered
  6644. // as a comment node but preserves all the raw information for the node.
  6645. // the information will be used for async server-rendering and hydration.
  6646. return createAsyncPlaceholder(
  6647. asyncFactory,
  6648. data,
  6649. context,
  6650. children,
  6651. tag
  6652. )
  6653. }
  6654. }
  6655. data = data || {};
  6656. // resolve constructor options in case global mixins are applied after
  6657. // component constructor creation
  6658. resolveConstructorOptions(Ctor);
  6659. // transform component v-model data into props & events
  6660. if (isDef(data.model)) {
  6661. transformModel(Ctor.options, data);
  6662. }
  6663. // extract props
  6664. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6665. // functional component
  6666. if (isTrue(Ctor.options.functional)) {
  6667. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6668. }
  6669. // extract listeners, since these needs to be treated as
  6670. // child component listeners instead of DOM listeners
  6671. var listeners = data.on;
  6672. // replace with listeners with .native modifier
  6673. // so it gets processed during parent component patch.
  6674. data.on = data.nativeOn;
  6675. if (isTrue(Ctor.options.abstract)) {
  6676. // abstract components do not keep anything
  6677. // other than props & listeners & slot
  6678. // work around flow
  6679. var slot = data.slot;
  6680. data = {};
  6681. if (slot) {
  6682. data.slot = slot;
  6683. }
  6684. }
  6685. // install component management hooks onto the placeholder node
  6686. installComponentHooks(data);
  6687. // return a placeholder vnode
  6688. var name = Ctor.options.name || tag;
  6689. var vnode = new VNode(
  6690. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6691. data, undefined, undefined, undefined, context,
  6692. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6693. asyncFactory
  6694. );
  6695. return vnode
  6696. }
  6697. function createComponentInstanceForVnode (
  6698. vnode, // we know it's MountedComponentVNode but flow doesn't
  6699. parent // activeInstance in lifecycle state
  6700. ) {
  6701. var options = {
  6702. _isComponent: true,
  6703. _parentVnode: vnode,
  6704. parent: parent
  6705. };
  6706. // check inline-template render functions
  6707. var inlineTemplate = vnode.data.inlineTemplate;
  6708. if (isDef(inlineTemplate)) {
  6709. options.render = inlineTemplate.render;
  6710. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6711. }
  6712. return new vnode.componentOptions.Ctor(options)
  6713. }
  6714. function installComponentHooks (data) {
  6715. var hooks = data.hook || (data.hook = {});
  6716. for (var i = 0; i < hooksToMerge.length; i++) {
  6717. var key = hooksToMerge[i];
  6718. var existing = hooks[key];
  6719. var toMerge = componentVNodeHooks[key];
  6720. if (existing !== toMerge && !(existing && existing._merged)) {
  6721. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6722. }
  6723. }
  6724. }
  6725. function mergeHook$1 (f1, f2) {
  6726. var merged = function (a, b) {
  6727. // flow complains about extra args which is why we use any
  6728. f1(a, b);
  6729. f2(a, b);
  6730. };
  6731. merged._merged = true;
  6732. return merged
  6733. }
  6734. // transform component v-model info (value and callback) into
  6735. // prop and event handler respectively.
  6736. function transformModel (options, data) {
  6737. var prop = (options.model && options.model.prop) || 'value';
  6738. var event = (options.model && options.model.event) || 'input'
  6739. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6740. var on = data.on || (data.on = {});
  6741. var existing = on[event];
  6742. var callback = data.model.callback;
  6743. if (isDef(existing)) {
  6744. if (
  6745. Array.isArray(existing)
  6746. ? existing.indexOf(callback) === -1
  6747. : existing !== callback
  6748. ) {
  6749. on[event] = [callback].concat(existing);
  6750. }
  6751. } else {
  6752. on[event] = callback;
  6753. }
  6754. }
  6755. /* */
  6756. var SIMPLE_NORMALIZE = 1;
  6757. var ALWAYS_NORMALIZE = 2;
  6758. // wrapper function for providing a more flexible interface
  6759. // without getting yelled at by flow
  6760. function createElement (
  6761. context,
  6762. tag,
  6763. data,
  6764. children,
  6765. normalizationType,
  6766. alwaysNormalize
  6767. ) {
  6768. if (Array.isArray(data) || isPrimitive(data)) {
  6769. normalizationType = children;
  6770. children = data;
  6771. data = undefined;
  6772. }
  6773. if (isTrue(alwaysNormalize)) {
  6774. normalizationType = ALWAYS_NORMALIZE;
  6775. }
  6776. return _createElement(context, tag, data, children, normalizationType)
  6777. }
  6778. function _createElement (
  6779. context,
  6780. tag,
  6781. data,
  6782. children,
  6783. normalizationType
  6784. ) {
  6785. if (isDef(data) && isDef((data).__ob__)) {
  6786. true && warn(
  6787. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6788. 'Always create fresh vnode data objects in each render!',
  6789. context
  6790. );
  6791. return createEmptyVNode()
  6792. }
  6793. // object syntax in v-bind
  6794. if (isDef(data) && isDef(data.is)) {
  6795. tag = data.is;
  6796. }
  6797. if (!tag) {
  6798. // in case of component :is set to falsy value
  6799. return createEmptyVNode()
  6800. }
  6801. // warn against non-primitive key
  6802. if ( true &&
  6803. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6804. ) {
  6805. {
  6806. warn(
  6807. 'Avoid using non-primitive value as key, ' +
  6808. 'use string/number value instead.',
  6809. context
  6810. );
  6811. }
  6812. }
  6813. // support single function children as default scoped slot
  6814. if (Array.isArray(children) &&
  6815. typeof children[0] === 'function'
  6816. ) {
  6817. data = data || {};
  6818. data.scopedSlots = { default: children[0] };
  6819. children.length = 0;
  6820. }
  6821. if (normalizationType === ALWAYS_NORMALIZE) {
  6822. children = normalizeChildren(children);
  6823. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6824. children = simpleNormalizeChildren(children);
  6825. }
  6826. var vnode, ns;
  6827. if (typeof tag === 'string') {
  6828. var Ctor;
  6829. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6830. if (config.isReservedTag(tag)) {
  6831. // platform built-in elements
  6832. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6833. warn(
  6834. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6835. context
  6836. );
  6837. }
  6838. vnode = new VNode(
  6839. config.parsePlatformTagName(tag), data, children,
  6840. undefined, undefined, context
  6841. );
  6842. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6843. // component
  6844. vnode = createComponent(Ctor, data, context, children, tag);
  6845. } else {
  6846. // unknown or unlisted namespaced elements
  6847. // check at runtime because it may get assigned a namespace when its
  6848. // parent normalizes children
  6849. vnode = new VNode(
  6850. tag, data, children,
  6851. undefined, undefined, context
  6852. );
  6853. }
  6854. } else {
  6855. // direct component options / constructor
  6856. vnode = createComponent(tag, data, context, children);
  6857. }
  6858. if (Array.isArray(vnode)) {
  6859. return vnode
  6860. } else if (isDef(vnode)) {
  6861. if (isDef(ns)) { applyNS(vnode, ns); }
  6862. if (isDef(data)) { registerDeepBindings(data); }
  6863. return vnode
  6864. } else {
  6865. return createEmptyVNode()
  6866. }
  6867. }
  6868. function applyNS (vnode, ns, force) {
  6869. vnode.ns = ns;
  6870. if (vnode.tag === 'foreignObject') {
  6871. // use default namespace inside foreignObject
  6872. ns = undefined;
  6873. force = true;
  6874. }
  6875. if (isDef(vnode.children)) {
  6876. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6877. var child = vnode.children[i];
  6878. if (isDef(child.tag) && (
  6879. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6880. applyNS(child, ns, force);
  6881. }
  6882. }
  6883. }
  6884. }
  6885. // ref #5318
  6886. // necessary to ensure parent re-render when deep bindings like :style and
  6887. // :class are used on slot nodes
  6888. function registerDeepBindings (data) {
  6889. if (isObject(data.style)) {
  6890. traverse(data.style);
  6891. }
  6892. if (isObject(data.class)) {
  6893. traverse(data.class);
  6894. }
  6895. }
  6896. /* */
  6897. function initRender (vm) {
  6898. vm._vnode = null; // the root of the child tree
  6899. vm._staticTrees = null; // v-once cached trees
  6900. var options = vm.$options;
  6901. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6902. var renderContext = parentVnode && parentVnode.context;
  6903. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6904. vm.$scopedSlots = emptyObject;
  6905. // bind the createElement fn to this instance
  6906. // so that we get proper render context inside it.
  6907. // args order: tag, data, children, normalizationType, alwaysNormalize
  6908. // internal version is used by render functions compiled from templates
  6909. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6910. // normalization is always applied for the public version, used in
  6911. // user-written render functions.
  6912. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6913. // $attrs & $listeners are exposed for easier HOC creation.
  6914. // they need to be reactive so that HOCs using them are always updated
  6915. var parentData = parentVnode && parentVnode.data;
  6916. /* istanbul ignore else */
  6917. if (true) {
  6918. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6919. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6920. }, true);
  6921. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6922. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6923. }, true);
  6924. } else {}
  6925. }
  6926. var currentRenderingInstance = null;
  6927. function renderMixin (Vue) {
  6928. // install runtime convenience helpers
  6929. installRenderHelpers(Vue.prototype);
  6930. Vue.prototype.$nextTick = function (fn) {
  6931. return nextTick(fn, this)
  6932. };
  6933. Vue.prototype._render = function () {
  6934. var vm = this;
  6935. var ref = vm.$options;
  6936. var render = ref.render;
  6937. var _parentVnode = ref._parentVnode;
  6938. if (_parentVnode) {
  6939. vm.$scopedSlots = normalizeScopedSlots(
  6940. _parentVnode.data.scopedSlots,
  6941. vm.$slots,
  6942. vm.$scopedSlots
  6943. );
  6944. }
  6945. // set parent vnode. this allows render functions to have access
  6946. // to the data on the placeholder node.
  6947. vm.$vnode = _parentVnode;
  6948. // render self
  6949. var vnode;
  6950. try {
  6951. // There's no need to maintain a stack because all render fns are called
  6952. // separately from one another. Nested component's render fns are called
  6953. // when parent component is patched.
  6954. currentRenderingInstance = vm;
  6955. vnode = render.call(vm._renderProxy, vm.$createElement);
  6956. } catch (e) {
  6957. handleError(e, vm, "render");
  6958. // return error render result,
  6959. // or previous vnode to prevent render error causing blank component
  6960. /* istanbul ignore else */
  6961. if ( true && vm.$options.renderError) {
  6962. try {
  6963. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6964. } catch (e) {
  6965. handleError(e, vm, "renderError");
  6966. vnode = vm._vnode;
  6967. }
  6968. } else {
  6969. vnode = vm._vnode;
  6970. }
  6971. } finally {
  6972. currentRenderingInstance = null;
  6973. }
  6974. // if the returned array contains only a single node, allow it
  6975. if (Array.isArray(vnode) && vnode.length === 1) {
  6976. vnode = vnode[0];
  6977. }
  6978. // return empty vnode in case the render function errored out
  6979. if (!(vnode instanceof VNode)) {
  6980. if ( true && Array.isArray(vnode)) {
  6981. warn(
  6982. 'Multiple root nodes returned from render function. Render function ' +
  6983. 'should return a single root node.',
  6984. vm
  6985. );
  6986. }
  6987. vnode = createEmptyVNode();
  6988. }
  6989. // set parent
  6990. vnode.parent = _parentVnode;
  6991. return vnode
  6992. };
  6993. }
  6994. /* */
  6995. function ensureCtor (comp, base) {
  6996. if (
  6997. comp.__esModule ||
  6998. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6999. ) {
  7000. comp = comp.default;
  7001. }
  7002. return isObject(comp)
  7003. ? base.extend(comp)
  7004. : comp
  7005. }
  7006. function createAsyncPlaceholder (
  7007. factory,
  7008. data,
  7009. context,
  7010. children,
  7011. tag
  7012. ) {
  7013. var node = createEmptyVNode();
  7014. node.asyncFactory = factory;
  7015. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7016. return node
  7017. }
  7018. function resolveAsyncComponent (
  7019. factory,
  7020. baseCtor
  7021. ) {
  7022. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7023. return factory.errorComp
  7024. }
  7025. if (isDef(factory.resolved)) {
  7026. return factory.resolved
  7027. }
  7028. var owner = currentRenderingInstance;
  7029. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7030. // already pending
  7031. factory.owners.push(owner);
  7032. }
  7033. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7034. return factory.loadingComp
  7035. }
  7036. if (owner && !isDef(factory.owners)) {
  7037. var owners = factory.owners = [owner];
  7038. var sync = true;
  7039. var timerLoading = null;
  7040. var timerTimeout = null
  7041. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7042. var forceRender = function (renderCompleted) {
  7043. for (var i = 0, l = owners.length; i < l; i++) {
  7044. (owners[i]).$forceUpdate();
  7045. }
  7046. if (renderCompleted) {
  7047. owners.length = 0;
  7048. if (timerLoading !== null) {
  7049. clearTimeout(timerLoading);
  7050. timerLoading = null;
  7051. }
  7052. if (timerTimeout !== null) {
  7053. clearTimeout(timerTimeout);
  7054. timerTimeout = null;
  7055. }
  7056. }
  7057. };
  7058. var resolve = once(function (res) {
  7059. // cache resolved
  7060. factory.resolved = ensureCtor(res, baseCtor);
  7061. // invoke callbacks only if this is not a synchronous resolve
  7062. // (async resolves are shimmed as synchronous during SSR)
  7063. if (!sync) {
  7064. forceRender(true);
  7065. } else {
  7066. owners.length = 0;
  7067. }
  7068. });
  7069. var reject = once(function (reason) {
  7070. true && warn(
  7071. "Failed to resolve async component: " + (String(factory)) +
  7072. (reason ? ("\nReason: " + reason) : '')
  7073. );
  7074. if (isDef(factory.errorComp)) {
  7075. factory.error = true;
  7076. forceRender(true);
  7077. }
  7078. });
  7079. var res = factory(resolve, reject);
  7080. if (isObject(res)) {
  7081. if (isPromise(res)) {
  7082. // () => Promise
  7083. if (isUndef(factory.resolved)) {
  7084. res.then(resolve, reject);
  7085. }
  7086. } else if (isPromise(res.component)) {
  7087. res.component.then(resolve, reject);
  7088. if (isDef(res.error)) {
  7089. factory.errorComp = ensureCtor(res.error, baseCtor);
  7090. }
  7091. if (isDef(res.loading)) {
  7092. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7093. if (res.delay === 0) {
  7094. factory.loading = true;
  7095. } else {
  7096. timerLoading = setTimeout(function () {
  7097. timerLoading = null;
  7098. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7099. factory.loading = true;
  7100. forceRender(false);
  7101. }
  7102. }, res.delay || 200);
  7103. }
  7104. }
  7105. if (isDef(res.timeout)) {
  7106. timerTimeout = setTimeout(function () {
  7107. timerTimeout = null;
  7108. if (isUndef(factory.resolved)) {
  7109. reject(
  7110. true
  7111. ? ("timeout (" + (res.timeout) + "ms)")
  7112. : undefined
  7113. );
  7114. }
  7115. }, res.timeout);
  7116. }
  7117. }
  7118. }
  7119. sync = false;
  7120. // return in case resolved synchronously
  7121. return factory.loading
  7122. ? factory.loadingComp
  7123. : factory.resolved
  7124. }
  7125. }
  7126. /* */
  7127. function isAsyncPlaceholder (node) {
  7128. return node.isComment && node.asyncFactory
  7129. }
  7130. /* */
  7131. function getFirstComponentChild (children) {
  7132. if (Array.isArray(children)) {
  7133. for (var i = 0; i < children.length; i++) {
  7134. var c = children[i];
  7135. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7136. return c
  7137. }
  7138. }
  7139. }
  7140. }
  7141. /* */
  7142. /* */
  7143. function initEvents (vm) {
  7144. vm._events = Object.create(null);
  7145. vm._hasHookEvent = false;
  7146. // init parent attached events
  7147. var listeners = vm.$options._parentListeners;
  7148. if (listeners) {
  7149. updateComponentListeners(vm, listeners);
  7150. }
  7151. }
  7152. var target;
  7153. function add (event, fn) {
  7154. target.$on(event, fn);
  7155. }
  7156. function remove$1 (event, fn) {
  7157. target.$off(event, fn);
  7158. }
  7159. function createOnceHandler (event, fn) {
  7160. var _target = target;
  7161. return function onceHandler () {
  7162. var res = fn.apply(null, arguments);
  7163. if (res !== null) {
  7164. _target.$off(event, onceHandler);
  7165. }
  7166. }
  7167. }
  7168. function updateComponentListeners (
  7169. vm,
  7170. listeners,
  7171. oldListeners
  7172. ) {
  7173. target = vm;
  7174. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7175. target = undefined;
  7176. }
  7177. function eventsMixin (Vue) {
  7178. var hookRE = /^hook:/;
  7179. Vue.prototype.$on = function (event, fn) {
  7180. var vm = this;
  7181. if (Array.isArray(event)) {
  7182. for (var i = 0, l = event.length; i < l; i++) {
  7183. vm.$on(event[i], fn);
  7184. }
  7185. } else {
  7186. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7187. // optimize hook:event cost by using a boolean flag marked at registration
  7188. // instead of a hash lookup
  7189. if (hookRE.test(event)) {
  7190. vm._hasHookEvent = true;
  7191. }
  7192. }
  7193. return vm
  7194. };
  7195. Vue.prototype.$once = function (event, fn) {
  7196. var vm = this;
  7197. function on () {
  7198. vm.$off(event, on);
  7199. fn.apply(vm, arguments);
  7200. }
  7201. on.fn = fn;
  7202. vm.$on(event, on);
  7203. return vm
  7204. };
  7205. Vue.prototype.$off = function (event, fn) {
  7206. var vm = this;
  7207. // all
  7208. if (!arguments.length) {
  7209. vm._events = Object.create(null);
  7210. return vm
  7211. }
  7212. // array of events
  7213. if (Array.isArray(event)) {
  7214. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7215. vm.$off(event[i$1], fn);
  7216. }
  7217. return vm
  7218. }
  7219. // specific event
  7220. var cbs = vm._events[event];
  7221. if (!cbs) {
  7222. return vm
  7223. }
  7224. if (!fn) {
  7225. vm._events[event] = null;
  7226. return vm
  7227. }
  7228. // specific handler
  7229. var cb;
  7230. var i = cbs.length;
  7231. while (i--) {
  7232. cb = cbs[i];
  7233. if (cb === fn || cb.fn === fn) {
  7234. cbs.splice(i, 1);
  7235. break
  7236. }
  7237. }
  7238. return vm
  7239. };
  7240. Vue.prototype.$emit = function (event) {
  7241. var vm = this;
  7242. if (true) {
  7243. var lowerCaseEvent = event.toLowerCase();
  7244. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7245. tip(
  7246. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7247. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7248. "Note that HTML attributes are case-insensitive and you cannot use " +
  7249. "v-on to listen to camelCase events when using in-DOM templates. " +
  7250. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7251. );
  7252. }
  7253. }
  7254. var cbs = vm._events[event];
  7255. if (cbs) {
  7256. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7257. var args = toArray(arguments, 1);
  7258. var info = "event handler for \"" + event + "\"";
  7259. for (var i = 0, l = cbs.length; i < l; i++) {
  7260. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7261. }
  7262. }
  7263. return vm
  7264. };
  7265. }
  7266. /* */
  7267. var activeInstance = null;
  7268. var isUpdatingChildComponent = false;
  7269. function setActiveInstance(vm) {
  7270. var prevActiveInstance = activeInstance;
  7271. activeInstance = vm;
  7272. return function () {
  7273. activeInstance = prevActiveInstance;
  7274. }
  7275. }
  7276. function initLifecycle (vm) {
  7277. var options = vm.$options;
  7278. // locate first non-abstract parent
  7279. var parent = options.parent;
  7280. if (parent && !options.abstract) {
  7281. while (parent.$options.abstract && parent.$parent) {
  7282. parent = parent.$parent;
  7283. }
  7284. parent.$children.push(vm);
  7285. }
  7286. vm.$parent = parent;
  7287. vm.$root = parent ? parent.$root : vm;
  7288. vm.$children = [];
  7289. vm.$refs = {};
  7290. vm._watcher = null;
  7291. vm._inactive = null;
  7292. vm._directInactive = false;
  7293. vm._isMounted = false;
  7294. vm._isDestroyed = false;
  7295. vm._isBeingDestroyed = false;
  7296. }
  7297. function lifecycleMixin (Vue) {
  7298. Vue.prototype._update = function (vnode, hydrating) {
  7299. var vm = this;
  7300. var prevEl = vm.$el;
  7301. var prevVnode = vm._vnode;
  7302. var restoreActiveInstance = setActiveInstance(vm);
  7303. vm._vnode = vnode;
  7304. // Vue.prototype.__patch__ is injected in entry points
  7305. // based on the rendering backend used.
  7306. if (!prevVnode) {
  7307. // initial render
  7308. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7309. } else {
  7310. // updates
  7311. vm.$el = vm.__patch__(prevVnode, vnode);
  7312. }
  7313. restoreActiveInstance();
  7314. // update __vue__ reference
  7315. if (prevEl) {
  7316. prevEl.__vue__ = null;
  7317. }
  7318. if (vm.$el) {
  7319. vm.$el.__vue__ = vm;
  7320. }
  7321. // if parent is an HOC, update its $el as well
  7322. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7323. vm.$parent.$el = vm.$el;
  7324. }
  7325. // updated hook is called by the scheduler to ensure that children are
  7326. // updated in a parent's updated hook.
  7327. };
  7328. Vue.prototype.$forceUpdate = function () {
  7329. var vm = this;
  7330. if (vm._watcher) {
  7331. vm._watcher.update();
  7332. }
  7333. };
  7334. Vue.prototype.$destroy = function () {
  7335. var vm = this;
  7336. if (vm._isBeingDestroyed) {
  7337. return
  7338. }
  7339. callHook(vm, 'beforeDestroy');
  7340. vm._isBeingDestroyed = true;
  7341. // remove self from parent
  7342. var parent = vm.$parent;
  7343. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7344. remove(parent.$children, vm);
  7345. }
  7346. // teardown watchers
  7347. if (vm._watcher) {
  7348. vm._watcher.teardown();
  7349. }
  7350. var i = vm._watchers.length;
  7351. while (i--) {
  7352. vm._watchers[i].teardown();
  7353. }
  7354. // remove reference from data ob
  7355. // frozen object may not have observer.
  7356. if (vm._data.__ob__) {
  7357. vm._data.__ob__.vmCount--;
  7358. }
  7359. // call the last hook...
  7360. vm._isDestroyed = true;
  7361. // invoke destroy hooks on current rendered tree
  7362. vm.__patch__(vm._vnode, null);
  7363. // fire destroyed hook
  7364. callHook(vm, 'destroyed');
  7365. // turn off all instance listeners.
  7366. vm.$off();
  7367. // remove __vue__ reference
  7368. if (vm.$el) {
  7369. vm.$el.__vue__ = null;
  7370. }
  7371. // release circular reference (#6759)
  7372. if (vm.$vnode) {
  7373. vm.$vnode.parent = null;
  7374. }
  7375. };
  7376. }
  7377. function updateChildComponent (
  7378. vm,
  7379. propsData,
  7380. listeners,
  7381. parentVnode,
  7382. renderChildren
  7383. ) {
  7384. if (true) {
  7385. isUpdatingChildComponent = true;
  7386. }
  7387. // determine whether component has slot children
  7388. // we need to do this before overwriting $options._renderChildren.
  7389. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7390. // dynamic slot names). Static scoped slots compiled from template has the
  7391. // "$stable" marker.
  7392. var newScopedSlots = parentVnode.data.scopedSlots;
  7393. var oldScopedSlots = vm.$scopedSlots;
  7394. var hasDynamicScopedSlot = !!(
  7395. (newScopedSlots && !newScopedSlots.$stable) ||
  7396. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7397. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7398. );
  7399. // Any static slot children from the parent may have changed during parent's
  7400. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7401. // update is necessary to ensure correctness.
  7402. var needsForceUpdate = !!(
  7403. renderChildren || // has new static slots
  7404. vm.$options._renderChildren || // has old static slots
  7405. hasDynamicScopedSlot
  7406. );
  7407. vm.$options._parentVnode = parentVnode;
  7408. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7409. if (vm._vnode) { // update child tree's parent
  7410. vm._vnode.parent = parentVnode;
  7411. }
  7412. vm.$options._renderChildren = renderChildren;
  7413. // update $attrs and $listeners hash
  7414. // these are also reactive so they may trigger child update if the child
  7415. // used them during render
  7416. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7417. vm.$listeners = listeners || emptyObject;
  7418. // update props
  7419. if (propsData && vm.$options.props) {
  7420. toggleObserving(false);
  7421. var props = vm._props;
  7422. var propKeys = vm.$options._propKeys || [];
  7423. for (var i = 0; i < propKeys.length; i++) {
  7424. var key = propKeys[i];
  7425. var propOptions = vm.$options.props; // wtf flow?
  7426. props[key] = validateProp(key, propOptions, propsData, vm);
  7427. }
  7428. toggleObserving(true);
  7429. // keep a copy of raw propsData
  7430. vm.$options.propsData = propsData;
  7431. }
  7432. // fixed by xxxxxx update properties(mp runtime)
  7433. vm._$updateProperties && vm._$updateProperties(vm);
  7434. // update listeners
  7435. listeners = listeners || emptyObject;
  7436. var oldListeners = vm.$options._parentListeners;
  7437. vm.$options._parentListeners = listeners;
  7438. updateComponentListeners(vm, listeners, oldListeners);
  7439. // resolve slots + force update if has children
  7440. if (needsForceUpdate) {
  7441. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7442. vm.$forceUpdate();
  7443. }
  7444. if (true) {
  7445. isUpdatingChildComponent = false;
  7446. }
  7447. }
  7448. function isInInactiveTree (vm) {
  7449. while (vm && (vm = vm.$parent)) {
  7450. if (vm._inactive) { return true }
  7451. }
  7452. return false
  7453. }
  7454. function activateChildComponent (vm, direct) {
  7455. if (direct) {
  7456. vm._directInactive = false;
  7457. if (isInInactiveTree(vm)) {
  7458. return
  7459. }
  7460. } else if (vm._directInactive) {
  7461. return
  7462. }
  7463. if (vm._inactive || vm._inactive === null) {
  7464. vm._inactive = false;
  7465. for (var i = 0; i < vm.$children.length; i++) {
  7466. activateChildComponent(vm.$children[i]);
  7467. }
  7468. callHook(vm, 'activated');
  7469. }
  7470. }
  7471. function deactivateChildComponent (vm, direct) {
  7472. if (direct) {
  7473. vm._directInactive = true;
  7474. if (isInInactiveTree(vm)) {
  7475. return
  7476. }
  7477. }
  7478. if (!vm._inactive) {
  7479. vm._inactive = true;
  7480. for (var i = 0; i < vm.$children.length; i++) {
  7481. deactivateChildComponent(vm.$children[i]);
  7482. }
  7483. callHook(vm, 'deactivated');
  7484. }
  7485. }
  7486. function callHook (vm, hook) {
  7487. // #7573 disable dep collection when invoking lifecycle hooks
  7488. pushTarget();
  7489. var handlers = vm.$options[hook];
  7490. var info = hook + " hook";
  7491. if (handlers) {
  7492. for (var i = 0, j = handlers.length; i < j; i++) {
  7493. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7494. }
  7495. }
  7496. if (vm._hasHookEvent) {
  7497. vm.$emit('hook:' + hook);
  7498. }
  7499. popTarget();
  7500. }
  7501. /* */
  7502. var MAX_UPDATE_COUNT = 100;
  7503. var queue = [];
  7504. var activatedChildren = [];
  7505. var has = {};
  7506. var circular = {};
  7507. var waiting = false;
  7508. var flushing = false;
  7509. var index = 0;
  7510. /**
  7511. * Reset the scheduler's state.
  7512. */
  7513. function resetSchedulerState () {
  7514. index = queue.length = activatedChildren.length = 0;
  7515. has = {};
  7516. if (true) {
  7517. circular = {};
  7518. }
  7519. waiting = flushing = false;
  7520. }
  7521. // Async edge case #6566 requires saving the timestamp when event listeners are
  7522. // attached. However, calling performance.now() has a perf overhead especially
  7523. // if the page has thousands of event listeners. Instead, we take a timestamp
  7524. // every time the scheduler flushes and use that for all event listeners
  7525. // attached during that flush.
  7526. var currentFlushTimestamp = 0;
  7527. // Async edge case fix requires storing an event listener's attach timestamp.
  7528. var getNow = Date.now;
  7529. // Determine what event timestamp the browser is using. Annoyingly, the
  7530. // timestamp can either be hi-res (relative to page load) or low-res
  7531. // (relative to UNIX epoch), so in order to compare time we have to use the
  7532. // same timestamp type when saving the flush timestamp.
  7533. // All IE versions use low-res event timestamps, and have problematic clock
  7534. // implementations (#9632)
  7535. if (inBrowser && !isIE) {
  7536. var performance = window.performance;
  7537. if (
  7538. performance &&
  7539. typeof performance.now === 'function' &&
  7540. getNow() > document.createEvent('Event').timeStamp
  7541. ) {
  7542. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7543. // smaller than it, it means the event is using a hi-res timestamp,
  7544. // and we need to use the hi-res version for event listener timestamps as
  7545. // well.
  7546. getNow = function () { return performance.now(); };
  7547. }
  7548. }
  7549. /**
  7550. * Flush both queues and run the watchers.
  7551. */
  7552. function flushSchedulerQueue () {
  7553. currentFlushTimestamp = getNow();
  7554. flushing = true;
  7555. var watcher, id;
  7556. // Sort queue before flush.
  7557. // This ensures that:
  7558. // 1. Components are updated from parent to child. (because parent is always
  7559. // created before the child)
  7560. // 2. A component's user watchers are run before its render watcher (because
  7561. // user watchers are created before the render watcher)
  7562. // 3. If a component is destroyed during a parent component's watcher run,
  7563. // its watchers can be skipped.
  7564. queue.sort(function (a, b) { return a.id - b.id; });
  7565. // do not cache length because more watchers might be pushed
  7566. // as we run existing watchers
  7567. for (index = 0; index < queue.length; index++) {
  7568. watcher = queue[index];
  7569. if (watcher.before) {
  7570. watcher.before();
  7571. }
  7572. id = watcher.id;
  7573. has[id] = null;
  7574. watcher.run();
  7575. // in dev build, check and stop circular updates.
  7576. if ( true && has[id] != null) {
  7577. circular[id] = (circular[id] || 0) + 1;
  7578. if (circular[id] > MAX_UPDATE_COUNT) {
  7579. warn(
  7580. 'You may have an infinite update loop ' + (
  7581. watcher.user
  7582. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7583. : "in a component render function."
  7584. ),
  7585. watcher.vm
  7586. );
  7587. break
  7588. }
  7589. }
  7590. }
  7591. // keep copies of post queues before resetting state
  7592. var activatedQueue = activatedChildren.slice();
  7593. var updatedQueue = queue.slice();
  7594. resetSchedulerState();
  7595. // call component updated and activated hooks
  7596. callActivatedHooks(activatedQueue);
  7597. callUpdatedHooks(updatedQueue);
  7598. // devtool hook
  7599. /* istanbul ignore if */
  7600. if (devtools && config.devtools) {
  7601. devtools.emit('flush');
  7602. }
  7603. }
  7604. function callUpdatedHooks (queue) {
  7605. var i = queue.length;
  7606. while (i--) {
  7607. var watcher = queue[i];
  7608. var vm = watcher.vm;
  7609. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7610. callHook(vm, 'updated');
  7611. }
  7612. }
  7613. }
  7614. /**
  7615. * Queue a kept-alive component that was activated during patch.
  7616. * The queue will be processed after the entire tree has been patched.
  7617. */
  7618. function queueActivatedComponent (vm) {
  7619. // setting _inactive to false here so that a render function can
  7620. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7621. vm._inactive = false;
  7622. activatedChildren.push(vm);
  7623. }
  7624. function callActivatedHooks (queue) {
  7625. for (var i = 0; i < queue.length; i++) {
  7626. queue[i]._inactive = true;
  7627. activateChildComponent(queue[i], true /* true */);
  7628. }
  7629. }
  7630. /**
  7631. * Push a watcher into the watcher queue.
  7632. * Jobs with duplicate IDs will be skipped unless it's
  7633. * pushed when the queue is being flushed.
  7634. */
  7635. function queueWatcher (watcher) {
  7636. var id = watcher.id;
  7637. if (has[id] == null) {
  7638. has[id] = true;
  7639. if (!flushing) {
  7640. queue.push(watcher);
  7641. } else {
  7642. // if already flushing, splice the watcher based on its id
  7643. // if already past its id, it will be run next immediately.
  7644. var i = queue.length - 1;
  7645. while (i > index && queue[i].id > watcher.id) {
  7646. i--;
  7647. }
  7648. queue.splice(i + 1, 0, watcher);
  7649. }
  7650. // queue the flush
  7651. if (!waiting) {
  7652. waiting = true;
  7653. if ( true && !config.async) {
  7654. flushSchedulerQueue();
  7655. return
  7656. }
  7657. nextTick(flushSchedulerQueue);
  7658. }
  7659. }
  7660. }
  7661. /* */
  7662. var uid$2 = 0;
  7663. /**
  7664. * A watcher parses an expression, collects dependencies,
  7665. * and fires callback when the expression value changes.
  7666. * This is used for both the $watch() api and directives.
  7667. */
  7668. var Watcher = function Watcher (
  7669. vm,
  7670. expOrFn,
  7671. cb,
  7672. options,
  7673. isRenderWatcher
  7674. ) {
  7675. this.vm = vm;
  7676. if (isRenderWatcher) {
  7677. vm._watcher = this;
  7678. }
  7679. vm._watchers.push(this);
  7680. // options
  7681. if (options) {
  7682. this.deep = !!options.deep;
  7683. this.user = !!options.user;
  7684. this.lazy = !!options.lazy;
  7685. this.sync = !!options.sync;
  7686. this.before = options.before;
  7687. } else {
  7688. this.deep = this.user = this.lazy = this.sync = false;
  7689. }
  7690. this.cb = cb;
  7691. this.id = ++uid$2; // uid for batching
  7692. this.active = true;
  7693. this.dirty = this.lazy; // for lazy watchers
  7694. this.deps = [];
  7695. this.newDeps = [];
  7696. this.depIds = new _Set();
  7697. this.newDepIds = new _Set();
  7698. this.expression = true
  7699. ? expOrFn.toString()
  7700. : undefined;
  7701. // parse expression for getter
  7702. if (typeof expOrFn === 'function') {
  7703. this.getter = expOrFn;
  7704. } else {
  7705. this.getter = parsePath(expOrFn);
  7706. if (!this.getter) {
  7707. this.getter = noop;
  7708. true && warn(
  7709. "Failed watching path: \"" + expOrFn + "\" " +
  7710. 'Watcher only accepts simple dot-delimited paths. ' +
  7711. 'For full control, use a function instead.',
  7712. vm
  7713. );
  7714. }
  7715. }
  7716. this.value = this.lazy
  7717. ? undefined
  7718. : this.get();
  7719. };
  7720. /**
  7721. * Evaluate the getter, and re-collect dependencies.
  7722. */
  7723. Watcher.prototype.get = function get () {
  7724. pushTarget(this);
  7725. var value;
  7726. var vm = this.vm;
  7727. try {
  7728. value = this.getter.call(vm, vm);
  7729. } catch (e) {
  7730. if (this.user) {
  7731. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7732. } else {
  7733. throw e
  7734. }
  7735. } finally {
  7736. // "touch" every property so they are all tracked as
  7737. // dependencies for deep watching
  7738. if (this.deep) {
  7739. traverse(value);
  7740. }
  7741. popTarget();
  7742. this.cleanupDeps();
  7743. }
  7744. return value
  7745. };
  7746. /**
  7747. * Add a dependency to this directive.
  7748. */
  7749. Watcher.prototype.addDep = function addDep (dep) {
  7750. var id = dep.id;
  7751. if (!this.newDepIds.has(id)) {
  7752. this.newDepIds.add(id);
  7753. this.newDeps.push(dep);
  7754. if (!this.depIds.has(id)) {
  7755. dep.addSub(this);
  7756. }
  7757. }
  7758. };
  7759. /**
  7760. * Clean up for dependency collection.
  7761. */
  7762. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7763. var i = this.deps.length;
  7764. while (i--) {
  7765. var dep = this.deps[i];
  7766. if (!this.newDepIds.has(dep.id)) {
  7767. dep.removeSub(this);
  7768. }
  7769. }
  7770. var tmp = this.depIds;
  7771. this.depIds = this.newDepIds;
  7772. this.newDepIds = tmp;
  7773. this.newDepIds.clear();
  7774. tmp = this.deps;
  7775. this.deps = this.newDeps;
  7776. this.newDeps = tmp;
  7777. this.newDeps.length = 0;
  7778. };
  7779. /**
  7780. * Subscriber interface.
  7781. * Will be called when a dependency changes.
  7782. */
  7783. Watcher.prototype.update = function update () {
  7784. /* istanbul ignore else */
  7785. if (this.lazy) {
  7786. this.dirty = true;
  7787. } else if (this.sync) {
  7788. this.run();
  7789. } else {
  7790. queueWatcher(this);
  7791. }
  7792. };
  7793. /**
  7794. * Scheduler job interface.
  7795. * Will be called by the scheduler.
  7796. */
  7797. Watcher.prototype.run = function run () {
  7798. if (this.active) {
  7799. var value = this.get();
  7800. if (
  7801. value !== this.value ||
  7802. // Deep watchers and watchers on Object/Arrays should fire even
  7803. // when the value is the same, because the value may
  7804. // have mutated.
  7805. isObject(value) ||
  7806. this.deep
  7807. ) {
  7808. // set new value
  7809. var oldValue = this.value;
  7810. this.value = value;
  7811. if (this.user) {
  7812. try {
  7813. this.cb.call(this.vm, value, oldValue);
  7814. } catch (e) {
  7815. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7816. }
  7817. } else {
  7818. this.cb.call(this.vm, value, oldValue);
  7819. }
  7820. }
  7821. }
  7822. };
  7823. /**
  7824. * Evaluate the value of the watcher.
  7825. * This only gets called for lazy watchers.
  7826. */
  7827. Watcher.prototype.evaluate = function evaluate () {
  7828. this.value = this.get();
  7829. this.dirty = false;
  7830. };
  7831. /**
  7832. * Depend on all deps collected by this watcher.
  7833. */
  7834. Watcher.prototype.depend = function depend () {
  7835. var i = this.deps.length;
  7836. while (i--) {
  7837. this.deps[i].depend();
  7838. }
  7839. };
  7840. /**
  7841. * Remove self from all dependencies' subscriber list.
  7842. */
  7843. Watcher.prototype.teardown = function teardown () {
  7844. if (this.active) {
  7845. // remove self from vm's watcher list
  7846. // this is a somewhat expensive operation so we skip it
  7847. // if the vm is being destroyed.
  7848. if (!this.vm._isBeingDestroyed) {
  7849. remove(this.vm._watchers, this);
  7850. }
  7851. var i = this.deps.length;
  7852. while (i--) {
  7853. this.deps[i].removeSub(this);
  7854. }
  7855. this.active = false;
  7856. }
  7857. };
  7858. /* */
  7859. var sharedPropertyDefinition = {
  7860. enumerable: true,
  7861. configurable: true,
  7862. get: noop,
  7863. set: noop
  7864. };
  7865. function proxy (target, sourceKey, key) {
  7866. sharedPropertyDefinition.get = function proxyGetter () {
  7867. return this[sourceKey][key]
  7868. };
  7869. sharedPropertyDefinition.set = function proxySetter (val) {
  7870. this[sourceKey][key] = val;
  7871. };
  7872. Object.defineProperty(target, key, sharedPropertyDefinition);
  7873. }
  7874. function initState (vm) {
  7875. vm._watchers = [];
  7876. var opts = vm.$options;
  7877. if (opts.props) { initProps(vm, opts.props); }
  7878. if (opts.methods) { initMethods(vm, opts.methods); }
  7879. if (opts.data) {
  7880. initData(vm);
  7881. } else {
  7882. observe(vm._data = {}, true /* asRootData */);
  7883. }
  7884. if (opts.computed) { initComputed(vm, opts.computed); }
  7885. if (opts.watch && opts.watch !== nativeWatch) {
  7886. initWatch(vm, opts.watch);
  7887. }
  7888. }
  7889. function initProps (vm, propsOptions) {
  7890. var propsData = vm.$options.propsData || {};
  7891. var props = vm._props = {};
  7892. // cache prop keys so that future props updates can iterate using Array
  7893. // instead of dynamic object key enumeration.
  7894. var keys = vm.$options._propKeys = [];
  7895. var isRoot = !vm.$parent;
  7896. // root instance props should be converted
  7897. if (!isRoot) {
  7898. toggleObserving(false);
  7899. }
  7900. var loop = function ( key ) {
  7901. keys.push(key);
  7902. var value = validateProp(key, propsOptions, propsData, vm);
  7903. /* istanbul ignore else */
  7904. if (true) {
  7905. var hyphenatedKey = hyphenate(key);
  7906. if (isReservedAttribute(hyphenatedKey) ||
  7907. config.isReservedAttr(hyphenatedKey)) {
  7908. warn(
  7909. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7910. vm
  7911. );
  7912. }
  7913. defineReactive$$1(props, key, value, function () {
  7914. if (!isRoot && !isUpdatingChildComponent) {
  7915. {
  7916. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7917. return
  7918. }
  7919. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7920. if(
  7921. key === 'value' &&
  7922. Array.isArray(vm.$options.behaviors) &&
  7923. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7924. ){
  7925. return
  7926. }
  7927. if(vm._getFormData){
  7928. return
  7929. }
  7930. var $parent = vm.$parent;
  7931. while($parent){
  7932. if($parent.__next_tick_pending){
  7933. return
  7934. }
  7935. $parent = $parent.$parent;
  7936. }
  7937. }
  7938. warn(
  7939. "Avoid mutating a prop directly since the value will be " +
  7940. "overwritten whenever the parent component re-renders. " +
  7941. "Instead, use a data or computed property based on the prop's " +
  7942. "value. Prop being mutated: \"" + key + "\"",
  7943. vm
  7944. );
  7945. }
  7946. });
  7947. } else {}
  7948. // static props are already proxied on the component's prototype
  7949. // during Vue.extend(). We only need to proxy props defined at
  7950. // instantiation here.
  7951. if (!(key in vm)) {
  7952. proxy(vm, "_props", key);
  7953. }
  7954. };
  7955. for (var key in propsOptions) loop( key );
  7956. toggleObserving(true);
  7957. }
  7958. function initData (vm) {
  7959. var data = vm.$options.data;
  7960. data = vm._data = typeof data === 'function'
  7961. ? getData(data, vm)
  7962. : data || {};
  7963. if (!isPlainObject(data)) {
  7964. data = {};
  7965. true && warn(
  7966. 'data functions should return an object:\n' +
  7967. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7968. vm
  7969. );
  7970. }
  7971. // proxy data on instance
  7972. var keys = Object.keys(data);
  7973. var props = vm.$options.props;
  7974. var methods = vm.$options.methods;
  7975. var i = keys.length;
  7976. while (i--) {
  7977. var key = keys[i];
  7978. if (true) {
  7979. if (methods && hasOwn(methods, key)) {
  7980. warn(
  7981. ("Method \"" + key + "\" has already been defined as a data property."),
  7982. vm
  7983. );
  7984. }
  7985. }
  7986. if (props && hasOwn(props, key)) {
  7987. true && warn(
  7988. "The data property \"" + key + "\" is already declared as a prop. " +
  7989. "Use prop default value instead.",
  7990. vm
  7991. );
  7992. } else if (!isReserved(key)) {
  7993. proxy(vm, "_data", key);
  7994. }
  7995. }
  7996. // observe data
  7997. observe(data, true /* asRootData */);
  7998. }
  7999. function getData (data, vm) {
  8000. // #7573 disable dep collection when invoking data getters
  8001. pushTarget();
  8002. try {
  8003. return data.call(vm, vm)
  8004. } catch (e) {
  8005. handleError(e, vm, "data()");
  8006. return {}
  8007. } finally {
  8008. popTarget();
  8009. }
  8010. }
  8011. var computedWatcherOptions = { lazy: true };
  8012. function initComputed (vm, computed) {
  8013. // $flow-disable-line
  8014. var watchers = vm._computedWatchers = Object.create(null);
  8015. // computed properties are just getters during SSR
  8016. var isSSR = isServerRendering();
  8017. for (var key in computed) {
  8018. var userDef = computed[key];
  8019. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8020. if ( true && getter == null) {
  8021. warn(
  8022. ("Getter is missing for computed property \"" + key + "\"."),
  8023. vm
  8024. );
  8025. }
  8026. if (!isSSR) {
  8027. // create internal watcher for the computed property.
  8028. watchers[key] = new Watcher(
  8029. vm,
  8030. getter || noop,
  8031. noop,
  8032. computedWatcherOptions
  8033. );
  8034. }
  8035. // component-defined computed properties are already defined on the
  8036. // component prototype. We only need to define computed properties defined
  8037. // at instantiation here.
  8038. if (!(key in vm)) {
  8039. defineComputed(vm, key, userDef);
  8040. } else if (true) {
  8041. if (key in vm.$data) {
  8042. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8043. } else if (vm.$options.props && key in vm.$options.props) {
  8044. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8045. }
  8046. }
  8047. }
  8048. }
  8049. function defineComputed (
  8050. target,
  8051. key,
  8052. userDef
  8053. ) {
  8054. var shouldCache = !isServerRendering();
  8055. if (typeof userDef === 'function') {
  8056. sharedPropertyDefinition.get = shouldCache
  8057. ? createComputedGetter(key)
  8058. : createGetterInvoker(userDef);
  8059. sharedPropertyDefinition.set = noop;
  8060. } else {
  8061. sharedPropertyDefinition.get = userDef.get
  8062. ? shouldCache && userDef.cache !== false
  8063. ? createComputedGetter(key)
  8064. : createGetterInvoker(userDef.get)
  8065. : noop;
  8066. sharedPropertyDefinition.set = userDef.set || noop;
  8067. }
  8068. if ( true &&
  8069. sharedPropertyDefinition.set === noop) {
  8070. sharedPropertyDefinition.set = function () {
  8071. warn(
  8072. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8073. this
  8074. );
  8075. };
  8076. }
  8077. Object.defineProperty(target, key, sharedPropertyDefinition);
  8078. }
  8079. function createComputedGetter (key) {
  8080. return function computedGetter () {
  8081. var watcher = this._computedWatchers && this._computedWatchers[key];
  8082. if (watcher) {
  8083. if (watcher.dirty) {
  8084. watcher.evaluate();
  8085. }
  8086. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8087. watcher.depend();
  8088. }
  8089. return watcher.value
  8090. }
  8091. }
  8092. }
  8093. function createGetterInvoker(fn) {
  8094. return function computedGetter () {
  8095. return fn.call(this, this)
  8096. }
  8097. }
  8098. function initMethods (vm, methods) {
  8099. var props = vm.$options.props;
  8100. for (var key in methods) {
  8101. if (true) {
  8102. if (typeof methods[key] !== 'function') {
  8103. warn(
  8104. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8105. "Did you reference the function correctly?",
  8106. vm
  8107. );
  8108. }
  8109. if (props && hasOwn(props, key)) {
  8110. warn(
  8111. ("Method \"" + key + "\" has already been defined as a prop."),
  8112. vm
  8113. );
  8114. }
  8115. if ((key in vm) && isReserved(key)) {
  8116. warn(
  8117. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8118. "Avoid defining component methods that start with _ or $."
  8119. );
  8120. }
  8121. }
  8122. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8123. }
  8124. }
  8125. function initWatch (vm, watch) {
  8126. for (var key in watch) {
  8127. var handler = watch[key];
  8128. if (Array.isArray(handler)) {
  8129. for (var i = 0; i < handler.length; i++) {
  8130. createWatcher(vm, key, handler[i]);
  8131. }
  8132. } else {
  8133. createWatcher(vm, key, handler);
  8134. }
  8135. }
  8136. }
  8137. function createWatcher (
  8138. vm,
  8139. expOrFn,
  8140. handler,
  8141. options
  8142. ) {
  8143. if (isPlainObject(handler)) {
  8144. options = handler;
  8145. handler = handler.handler;
  8146. }
  8147. if (typeof handler === 'string') {
  8148. handler = vm[handler];
  8149. }
  8150. return vm.$watch(expOrFn, handler, options)
  8151. }
  8152. function stateMixin (Vue) {
  8153. // flow somehow has problems with directly declared definition object
  8154. // when using Object.defineProperty, so we have to procedurally build up
  8155. // the object here.
  8156. var dataDef = {};
  8157. dataDef.get = function () { return this._data };
  8158. var propsDef = {};
  8159. propsDef.get = function () { return this._props };
  8160. if (true) {
  8161. dataDef.set = function () {
  8162. warn(
  8163. 'Avoid replacing instance root $data. ' +
  8164. 'Use nested data properties instead.',
  8165. this
  8166. );
  8167. };
  8168. propsDef.set = function () {
  8169. warn("$props is readonly.", this);
  8170. };
  8171. }
  8172. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8173. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8174. Vue.prototype.$set = set;
  8175. Vue.prototype.$delete = del;
  8176. Vue.prototype.$watch = function (
  8177. expOrFn,
  8178. cb,
  8179. options
  8180. ) {
  8181. var vm = this;
  8182. if (isPlainObject(cb)) {
  8183. return createWatcher(vm, expOrFn, cb, options)
  8184. }
  8185. options = options || {};
  8186. options.user = true;
  8187. var watcher = new Watcher(vm, expOrFn, cb, options);
  8188. if (options.immediate) {
  8189. try {
  8190. cb.call(vm, watcher.value);
  8191. } catch (error) {
  8192. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8193. }
  8194. }
  8195. return function unwatchFn () {
  8196. watcher.teardown();
  8197. }
  8198. };
  8199. }
  8200. /* */
  8201. var uid$3 = 0;
  8202. function initMixin (Vue) {
  8203. Vue.prototype._init = function (options) {
  8204. var vm = this;
  8205. // a uid
  8206. vm._uid = uid$3++;
  8207. var startTag, endTag;
  8208. /* istanbul ignore if */
  8209. if ( true && config.performance && mark) {
  8210. startTag = "vue-perf-start:" + (vm._uid);
  8211. endTag = "vue-perf-end:" + (vm._uid);
  8212. mark(startTag);
  8213. }
  8214. // a flag to avoid this being observed
  8215. vm._isVue = true;
  8216. // merge options
  8217. if (options && options._isComponent) {
  8218. // optimize internal component instantiation
  8219. // since dynamic options merging is pretty slow, and none of the
  8220. // internal component options needs special treatment.
  8221. initInternalComponent(vm, options);
  8222. } else {
  8223. vm.$options = mergeOptions(
  8224. resolveConstructorOptions(vm.constructor),
  8225. options || {},
  8226. vm
  8227. );
  8228. }
  8229. /* istanbul ignore else */
  8230. if (true) {
  8231. initProxy(vm);
  8232. } else {}
  8233. // expose real self
  8234. vm._self = vm;
  8235. initLifecycle(vm);
  8236. initEvents(vm);
  8237. initRender(vm);
  8238. callHook(vm, 'beforeCreate');
  8239. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8240. initState(vm);
  8241. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8242. !vm._$fallback && callHook(vm, 'created');
  8243. /* istanbul ignore if */
  8244. if ( true && config.performance && mark) {
  8245. vm._name = formatComponentName(vm, false);
  8246. mark(endTag);
  8247. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8248. }
  8249. if (vm.$options.el) {
  8250. vm.$mount(vm.$options.el);
  8251. }
  8252. };
  8253. }
  8254. function initInternalComponent (vm, options) {
  8255. var opts = vm.$options = Object.create(vm.constructor.options);
  8256. // doing this because it's faster than dynamic enumeration.
  8257. var parentVnode = options._parentVnode;
  8258. opts.parent = options.parent;
  8259. opts._parentVnode = parentVnode;
  8260. var vnodeComponentOptions = parentVnode.componentOptions;
  8261. opts.propsData = vnodeComponentOptions.propsData;
  8262. opts._parentListeners = vnodeComponentOptions.listeners;
  8263. opts._renderChildren = vnodeComponentOptions.children;
  8264. opts._componentTag = vnodeComponentOptions.tag;
  8265. if (options.render) {
  8266. opts.render = options.render;
  8267. opts.staticRenderFns = options.staticRenderFns;
  8268. }
  8269. }
  8270. function resolveConstructorOptions (Ctor) {
  8271. var options = Ctor.options;
  8272. if (Ctor.super) {
  8273. var superOptions = resolveConstructorOptions(Ctor.super);
  8274. var cachedSuperOptions = Ctor.superOptions;
  8275. if (superOptions !== cachedSuperOptions) {
  8276. // super option changed,
  8277. // need to resolve new options.
  8278. Ctor.superOptions = superOptions;
  8279. // check if there are any late-modified/attached options (#4976)
  8280. var modifiedOptions = resolveModifiedOptions(Ctor);
  8281. // update base extend options
  8282. if (modifiedOptions) {
  8283. extend(Ctor.extendOptions, modifiedOptions);
  8284. }
  8285. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8286. if (options.name) {
  8287. options.components[options.name] = Ctor;
  8288. }
  8289. }
  8290. }
  8291. return options
  8292. }
  8293. function resolveModifiedOptions (Ctor) {
  8294. var modified;
  8295. var latest = Ctor.options;
  8296. var sealed = Ctor.sealedOptions;
  8297. for (var key in latest) {
  8298. if (latest[key] !== sealed[key]) {
  8299. if (!modified) { modified = {}; }
  8300. modified[key] = latest[key];
  8301. }
  8302. }
  8303. return modified
  8304. }
  8305. function Vue (options) {
  8306. if ( true &&
  8307. !(this instanceof Vue)
  8308. ) {
  8309. warn('Vue is a constructor and should be called with the `new` keyword');
  8310. }
  8311. this._init(options);
  8312. }
  8313. initMixin(Vue);
  8314. stateMixin(Vue);
  8315. eventsMixin(Vue);
  8316. lifecycleMixin(Vue);
  8317. renderMixin(Vue);
  8318. /* */
  8319. function initUse (Vue) {
  8320. Vue.use = function (plugin) {
  8321. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8322. if (installedPlugins.indexOf(plugin) > -1) {
  8323. return this
  8324. }
  8325. // additional parameters
  8326. var args = toArray(arguments, 1);
  8327. args.unshift(this);
  8328. if (typeof plugin.install === 'function') {
  8329. plugin.install.apply(plugin, args);
  8330. } else if (typeof plugin === 'function') {
  8331. plugin.apply(null, args);
  8332. }
  8333. installedPlugins.push(plugin);
  8334. return this
  8335. };
  8336. }
  8337. /* */
  8338. function initMixin$1 (Vue) {
  8339. Vue.mixin = function (mixin) {
  8340. this.options = mergeOptions(this.options, mixin);
  8341. return this
  8342. };
  8343. }
  8344. /* */
  8345. function initExtend (Vue) {
  8346. /**
  8347. * Each instance constructor, including Vue, has a unique
  8348. * cid. This enables us to create wrapped "child
  8349. * constructors" for prototypal inheritance and cache them.
  8350. */
  8351. Vue.cid = 0;
  8352. var cid = 1;
  8353. /**
  8354. * Class inheritance
  8355. */
  8356. Vue.extend = function (extendOptions) {
  8357. extendOptions = extendOptions || {};
  8358. var Super = this;
  8359. var SuperId = Super.cid;
  8360. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8361. if (cachedCtors[SuperId]) {
  8362. return cachedCtors[SuperId]
  8363. }
  8364. var name = extendOptions.name || Super.options.name;
  8365. if ( true && name) {
  8366. validateComponentName(name);
  8367. }
  8368. var Sub = function VueComponent (options) {
  8369. this._init(options);
  8370. };
  8371. Sub.prototype = Object.create(Super.prototype);
  8372. Sub.prototype.constructor = Sub;
  8373. Sub.cid = cid++;
  8374. Sub.options = mergeOptions(
  8375. Super.options,
  8376. extendOptions
  8377. );
  8378. Sub['super'] = Super;
  8379. // For props and computed properties, we define the proxy getters on
  8380. // the Vue instances at extension time, on the extended prototype. This
  8381. // avoids Object.defineProperty calls for each instance created.
  8382. if (Sub.options.props) {
  8383. initProps$1(Sub);
  8384. }
  8385. if (Sub.options.computed) {
  8386. initComputed$1(Sub);
  8387. }
  8388. // allow further extension/mixin/plugin usage
  8389. Sub.extend = Super.extend;
  8390. Sub.mixin = Super.mixin;
  8391. Sub.use = Super.use;
  8392. // create asset registers, so extended classes
  8393. // can have their private assets too.
  8394. ASSET_TYPES.forEach(function (type) {
  8395. Sub[type] = Super[type];
  8396. });
  8397. // enable recursive self-lookup
  8398. if (name) {
  8399. Sub.options.components[name] = Sub;
  8400. }
  8401. // keep a reference to the super options at extension time.
  8402. // later at instantiation we can check if Super's options have
  8403. // been updated.
  8404. Sub.superOptions = Super.options;
  8405. Sub.extendOptions = extendOptions;
  8406. Sub.sealedOptions = extend({}, Sub.options);
  8407. // cache constructor
  8408. cachedCtors[SuperId] = Sub;
  8409. return Sub
  8410. };
  8411. }
  8412. function initProps$1 (Comp) {
  8413. var props = Comp.options.props;
  8414. for (var key in props) {
  8415. proxy(Comp.prototype, "_props", key);
  8416. }
  8417. }
  8418. function initComputed$1 (Comp) {
  8419. var computed = Comp.options.computed;
  8420. for (var key in computed) {
  8421. defineComputed(Comp.prototype, key, computed[key]);
  8422. }
  8423. }
  8424. /* */
  8425. function initAssetRegisters (Vue) {
  8426. /**
  8427. * Create asset registration methods.
  8428. */
  8429. ASSET_TYPES.forEach(function (type) {
  8430. Vue[type] = function (
  8431. id,
  8432. definition
  8433. ) {
  8434. if (!definition) {
  8435. return this.options[type + 's'][id]
  8436. } else {
  8437. /* istanbul ignore if */
  8438. if ( true && type === 'component') {
  8439. validateComponentName(id);
  8440. }
  8441. if (type === 'component' && isPlainObject(definition)) {
  8442. definition.name = definition.name || id;
  8443. definition = this.options._base.extend(definition);
  8444. }
  8445. if (type === 'directive' && typeof definition === 'function') {
  8446. definition = { bind: definition, update: definition };
  8447. }
  8448. this.options[type + 's'][id] = definition;
  8449. return definition
  8450. }
  8451. };
  8452. });
  8453. }
  8454. /* */
  8455. function getComponentName (opts) {
  8456. return opts && (opts.Ctor.options.name || opts.tag)
  8457. }
  8458. function matches (pattern, name) {
  8459. if (Array.isArray(pattern)) {
  8460. return pattern.indexOf(name) > -1
  8461. } else if (typeof pattern === 'string') {
  8462. return pattern.split(',').indexOf(name) > -1
  8463. } else if (isRegExp(pattern)) {
  8464. return pattern.test(name)
  8465. }
  8466. /* istanbul ignore next */
  8467. return false
  8468. }
  8469. function pruneCache (keepAliveInstance, filter) {
  8470. var cache = keepAliveInstance.cache;
  8471. var keys = keepAliveInstance.keys;
  8472. var _vnode = keepAliveInstance._vnode;
  8473. for (var key in cache) {
  8474. var cachedNode = cache[key];
  8475. if (cachedNode) {
  8476. var name = getComponentName(cachedNode.componentOptions);
  8477. if (name && !filter(name)) {
  8478. pruneCacheEntry(cache, key, keys, _vnode);
  8479. }
  8480. }
  8481. }
  8482. }
  8483. function pruneCacheEntry (
  8484. cache,
  8485. key,
  8486. keys,
  8487. current
  8488. ) {
  8489. var cached$$1 = cache[key];
  8490. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8491. cached$$1.componentInstance.$destroy();
  8492. }
  8493. cache[key] = null;
  8494. remove(keys, key);
  8495. }
  8496. var patternTypes = [String, RegExp, Array];
  8497. var KeepAlive = {
  8498. name: 'keep-alive',
  8499. abstract: true,
  8500. props: {
  8501. include: patternTypes,
  8502. exclude: patternTypes,
  8503. max: [String, Number]
  8504. },
  8505. created: function created () {
  8506. this.cache = Object.create(null);
  8507. this.keys = [];
  8508. },
  8509. destroyed: function destroyed () {
  8510. for (var key in this.cache) {
  8511. pruneCacheEntry(this.cache, key, this.keys);
  8512. }
  8513. },
  8514. mounted: function mounted () {
  8515. var this$1 = this;
  8516. this.$watch('include', function (val) {
  8517. pruneCache(this$1, function (name) { return matches(val, name); });
  8518. });
  8519. this.$watch('exclude', function (val) {
  8520. pruneCache(this$1, function (name) { return !matches(val, name); });
  8521. });
  8522. },
  8523. render: function render () {
  8524. var slot = this.$slots.default;
  8525. var vnode = getFirstComponentChild(slot);
  8526. var componentOptions = vnode && vnode.componentOptions;
  8527. if (componentOptions) {
  8528. // check pattern
  8529. var name = getComponentName(componentOptions);
  8530. var ref = this;
  8531. var include = ref.include;
  8532. var exclude = ref.exclude;
  8533. if (
  8534. // not included
  8535. (include && (!name || !matches(include, name))) ||
  8536. // excluded
  8537. (exclude && name && matches(exclude, name))
  8538. ) {
  8539. return vnode
  8540. }
  8541. var ref$1 = this;
  8542. var cache = ref$1.cache;
  8543. var keys = ref$1.keys;
  8544. var key = vnode.key == null
  8545. // same constructor may get registered as different local components
  8546. // so cid alone is not enough (#3269)
  8547. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8548. : vnode.key;
  8549. if (cache[key]) {
  8550. vnode.componentInstance = cache[key].componentInstance;
  8551. // make current key freshest
  8552. remove(keys, key);
  8553. keys.push(key);
  8554. } else {
  8555. cache[key] = vnode;
  8556. keys.push(key);
  8557. // prune oldest entry
  8558. if (this.max && keys.length > parseInt(this.max)) {
  8559. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8560. }
  8561. }
  8562. vnode.data.keepAlive = true;
  8563. }
  8564. return vnode || (slot && slot[0])
  8565. }
  8566. };
  8567. var builtInComponents = {
  8568. KeepAlive: KeepAlive
  8569. };
  8570. /* */
  8571. function initGlobalAPI (Vue) {
  8572. // config
  8573. var configDef = {};
  8574. configDef.get = function () { return config; };
  8575. if (true) {
  8576. configDef.set = function () {
  8577. warn(
  8578. 'Do not replace the Vue.config object, set individual fields instead.'
  8579. );
  8580. };
  8581. }
  8582. Object.defineProperty(Vue, 'config', configDef);
  8583. // exposed util methods.
  8584. // NOTE: these are not considered part of the public API - avoid relying on
  8585. // them unless you are aware of the risk.
  8586. Vue.util = {
  8587. warn: warn,
  8588. extend: extend,
  8589. mergeOptions: mergeOptions,
  8590. defineReactive: defineReactive$$1
  8591. };
  8592. Vue.set = set;
  8593. Vue.delete = del;
  8594. Vue.nextTick = nextTick;
  8595. // 2.6 explicit observable API
  8596. Vue.observable = function (obj) {
  8597. observe(obj);
  8598. return obj
  8599. };
  8600. Vue.options = Object.create(null);
  8601. ASSET_TYPES.forEach(function (type) {
  8602. Vue.options[type + 's'] = Object.create(null);
  8603. });
  8604. // this is used to identify the "base" constructor to extend all plain-object
  8605. // components with in Weex's multi-instance scenarios.
  8606. Vue.options._base = Vue;
  8607. extend(Vue.options.components, builtInComponents);
  8608. initUse(Vue);
  8609. initMixin$1(Vue);
  8610. initExtend(Vue);
  8611. initAssetRegisters(Vue);
  8612. }
  8613. initGlobalAPI(Vue);
  8614. Object.defineProperty(Vue.prototype, '$isServer', {
  8615. get: isServerRendering
  8616. });
  8617. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8618. get: function get () {
  8619. /* istanbul ignore next */
  8620. return this.$vnode && this.$vnode.ssrContext
  8621. }
  8622. });
  8623. // expose FunctionalRenderContext for ssr runtime helper installation
  8624. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8625. value: FunctionalRenderContext
  8626. });
  8627. Vue.version = '2.6.11';
  8628. /**
  8629. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8630. */
  8631. var ARRAYTYPE = '[object Array]';
  8632. var OBJECTTYPE = '[object Object]';
  8633. var NULLTYPE = '[object Null]';
  8634. var UNDEFINEDTYPE = '[object Undefined]';
  8635. // const FUNCTIONTYPE = '[object Function]'
  8636. function diff(current, pre) {
  8637. var result = {};
  8638. syncKeys(current, pre);
  8639. _diff(current, pre, '', result);
  8640. return result
  8641. }
  8642. function syncKeys(current, pre) {
  8643. if (current === pre) { return }
  8644. var rootCurrentType = type(current);
  8645. var rootPreType = type(pre);
  8646. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8647. if(Object.keys(current).length >= Object.keys(pre).length){
  8648. for (var key in pre) {
  8649. var currentValue = current[key];
  8650. if (currentValue === undefined) {
  8651. current[key] = null;
  8652. } else {
  8653. syncKeys(currentValue, pre[key]);
  8654. }
  8655. }
  8656. }
  8657. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8658. if (current.length >= pre.length) {
  8659. pre.forEach(function (item, index) {
  8660. syncKeys(current[index], item);
  8661. });
  8662. }
  8663. }
  8664. }
  8665. function nullOrUndefined(currentType, preType) {
  8666. if(
  8667. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8668. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8669. ) {
  8670. return false
  8671. }
  8672. return true
  8673. }
  8674. function _diff(current, pre, path, result) {
  8675. if (current === pre) { return }
  8676. var rootCurrentType = type(current);
  8677. var rootPreType = type(pre);
  8678. if (rootCurrentType == OBJECTTYPE) {
  8679. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8680. setResult(result, path, current);
  8681. } else {
  8682. var loop = function ( key ) {
  8683. var currentValue = current[key];
  8684. var preValue = pre[key];
  8685. var currentType = type(currentValue);
  8686. var preType = type(preValue);
  8687. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8688. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8689. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8690. }
  8691. } else if (currentType == ARRAYTYPE) {
  8692. if (preType != ARRAYTYPE) {
  8693. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8694. } else {
  8695. if (currentValue.length < preValue.length) {
  8696. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8697. } else {
  8698. currentValue.forEach(function (item, index) {
  8699. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8700. });
  8701. }
  8702. }
  8703. } else if (currentType == OBJECTTYPE) {
  8704. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8705. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8706. } else {
  8707. for (var subKey in currentValue) {
  8708. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8709. }
  8710. }
  8711. }
  8712. };
  8713. for (var key in current) loop( key );
  8714. }
  8715. } else if (rootCurrentType == ARRAYTYPE) {
  8716. if (rootPreType != ARRAYTYPE) {
  8717. setResult(result, path, current);
  8718. } else {
  8719. if (current.length < pre.length) {
  8720. setResult(result, path, current);
  8721. } else {
  8722. current.forEach(function (item, index) {
  8723. _diff(item, pre[index], path + '[' + index + ']', result);
  8724. });
  8725. }
  8726. }
  8727. } else {
  8728. setResult(result, path, current);
  8729. }
  8730. }
  8731. function setResult(result, k, v) {
  8732. // if (type(v) != FUNCTIONTYPE) {
  8733. result[k] = v;
  8734. // }
  8735. }
  8736. function type(obj) {
  8737. return Object.prototype.toString.call(obj)
  8738. }
  8739. /* */
  8740. function flushCallbacks$1(vm) {
  8741. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8742. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8743. var mpInstance = vm.$scope;
  8744. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8745. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8746. }
  8747. var copies = vm.__next_tick_callbacks.slice(0);
  8748. vm.__next_tick_callbacks.length = 0;
  8749. for (var i = 0; i < copies.length; i++) {
  8750. copies[i]();
  8751. }
  8752. }
  8753. }
  8754. function hasRenderWatcher(vm) {
  8755. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8756. }
  8757. function nextTick$1(vm, cb) {
  8758. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8759. //2.nextTick 之前存在 render watcher
  8760. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8761. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8762. var mpInstance = vm.$scope;
  8763. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8764. ']:nextVueTick');
  8765. }
  8766. return nextTick(cb, vm)
  8767. }else{
  8768. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8769. var mpInstance$1 = vm.$scope;
  8770. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8771. ']:nextMPTick');
  8772. }
  8773. }
  8774. var _resolve;
  8775. if (!vm.__next_tick_callbacks) {
  8776. vm.__next_tick_callbacks = [];
  8777. }
  8778. vm.__next_tick_callbacks.push(function () {
  8779. if (cb) {
  8780. try {
  8781. cb.call(vm);
  8782. } catch (e) {
  8783. handleError(e, vm, 'nextTick');
  8784. }
  8785. } else if (_resolve) {
  8786. _resolve(vm);
  8787. }
  8788. });
  8789. // $flow-disable-line
  8790. if (!cb && typeof Promise !== 'undefined') {
  8791. return new Promise(function (resolve) {
  8792. _resolve = resolve;
  8793. })
  8794. }
  8795. }
  8796. /* */
  8797. function clearInstance(key, value) {
  8798. // 简易去除 Vue 和小程序组件实例
  8799. if (value) {
  8800. if (value._isVue || value.__v_isMPComponent) {
  8801. return {}
  8802. }
  8803. }
  8804. return value
  8805. }
  8806. function cloneWithData(vm) {
  8807. // 确保当前 vm 所有数据被同步
  8808. var ret = Object.create(null);
  8809. var dataKeys = [].concat(
  8810. Object.keys(vm._data || {}),
  8811. Object.keys(vm._computedWatchers || {}));
  8812. dataKeys.reduce(function(ret, key) {
  8813. ret[key] = vm[key];
  8814. return ret
  8815. }, ret);
  8816. // vue-composition-api
  8817. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8818. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8819. if (rawBindings) {
  8820. Object.keys(rawBindings).forEach(function (key) {
  8821. ret[key] = vm[key];
  8822. });
  8823. }
  8824. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8825. Object.assign(ret, vm.$mp.data || {});
  8826. if (
  8827. Array.isArray(vm.$options.behaviors) &&
  8828. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8829. ) { //form-field
  8830. ret['name'] = vm.name;
  8831. ret['value'] = vm.value;
  8832. }
  8833. return JSON.parse(JSON.stringify(ret, clearInstance))
  8834. }
  8835. var patch = function(oldVnode, vnode) {
  8836. var this$1 = this;
  8837. if (vnode === null) { //destroy
  8838. return
  8839. }
  8840. if (this.mpType === 'page' || this.mpType === 'component') {
  8841. var mpInstance = this.$scope;
  8842. var data = Object.create(null);
  8843. try {
  8844. data = cloneWithData(this);
  8845. } catch (err) {
  8846. console.error(err);
  8847. }
  8848. data.__webviewId__ = mpInstance.data.__webviewId__;
  8849. var mpData = Object.create(null);
  8850. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8851. mpData[key] = mpInstance.data[key];
  8852. });
  8853. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8854. if (Object.keys(diffData).length) {
  8855. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8856. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8857. ']差量更新',
  8858. JSON.stringify(diffData));
  8859. }
  8860. this.__next_tick_pending = true;
  8861. mpInstance.setData(diffData, function () {
  8862. this$1.__next_tick_pending = false;
  8863. flushCallbacks$1(this$1);
  8864. });
  8865. } else {
  8866. flushCallbacks$1(this);
  8867. }
  8868. }
  8869. };
  8870. /* */
  8871. function createEmptyRender() {
  8872. }
  8873. function mountComponent$1(
  8874. vm,
  8875. el,
  8876. hydrating
  8877. ) {
  8878. if (!vm.mpType) {//main.js 中的 new Vue
  8879. return vm
  8880. }
  8881. if (vm.mpType === 'app') {
  8882. vm.$options.render = createEmptyRender;
  8883. }
  8884. if (!vm.$options.render) {
  8885. vm.$options.render = createEmptyRender;
  8886. if (true) {
  8887. /* istanbul ignore if */
  8888. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8889. vm.$options.el || el) {
  8890. warn(
  8891. 'You are using the runtime-only build of Vue where the template ' +
  8892. 'compiler is not available. Either pre-compile the templates into ' +
  8893. 'render functions, or use the compiler-included build.',
  8894. vm
  8895. );
  8896. } else {
  8897. warn(
  8898. 'Failed to mount component: template or render function not defined.',
  8899. vm
  8900. );
  8901. }
  8902. }
  8903. }
  8904. !vm._$fallback && callHook(vm, 'beforeMount');
  8905. var updateComponent = function () {
  8906. vm._update(vm._render(), hydrating);
  8907. };
  8908. // we set this to vm._watcher inside the watcher's constructor
  8909. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8910. // component's mounted hook), which relies on vm._watcher being already defined
  8911. new Watcher(vm, updateComponent, noop, {
  8912. before: function before() {
  8913. if (vm._isMounted && !vm._isDestroyed) {
  8914. callHook(vm, 'beforeUpdate');
  8915. }
  8916. }
  8917. }, true /* isRenderWatcher */);
  8918. hydrating = false;
  8919. return vm
  8920. }
  8921. /* */
  8922. function renderClass (
  8923. staticClass,
  8924. dynamicClass
  8925. ) {
  8926. if (isDef(staticClass) || isDef(dynamicClass)) {
  8927. return concat(staticClass, stringifyClass(dynamicClass))
  8928. }
  8929. /* istanbul ignore next */
  8930. return ''
  8931. }
  8932. function concat (a, b) {
  8933. return a ? b ? (a + ' ' + b) : a : (b || '')
  8934. }
  8935. function stringifyClass (value) {
  8936. if (Array.isArray(value)) {
  8937. return stringifyArray(value)
  8938. }
  8939. if (isObject(value)) {
  8940. return stringifyObject(value)
  8941. }
  8942. if (typeof value === 'string') {
  8943. return value
  8944. }
  8945. /* istanbul ignore next */
  8946. return ''
  8947. }
  8948. function stringifyArray (value) {
  8949. var res = '';
  8950. var stringified;
  8951. for (var i = 0, l = value.length; i < l; i++) {
  8952. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8953. if (res) { res += ' '; }
  8954. res += stringified;
  8955. }
  8956. }
  8957. return res
  8958. }
  8959. function stringifyObject (value) {
  8960. var res = '';
  8961. for (var key in value) {
  8962. if (value[key]) {
  8963. if (res) { res += ' '; }
  8964. res += key;
  8965. }
  8966. }
  8967. return res
  8968. }
  8969. /* */
  8970. var parseStyleText = cached(function (cssText) {
  8971. var res = {};
  8972. var listDelimiter = /;(?![^(]*\))/g;
  8973. var propertyDelimiter = /:(.+)/;
  8974. cssText.split(listDelimiter).forEach(function (item) {
  8975. if (item) {
  8976. var tmp = item.split(propertyDelimiter);
  8977. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8978. }
  8979. });
  8980. return res
  8981. });
  8982. // normalize possible array / string values into Object
  8983. function normalizeStyleBinding (bindingStyle) {
  8984. if (Array.isArray(bindingStyle)) {
  8985. return toObject(bindingStyle)
  8986. }
  8987. if (typeof bindingStyle === 'string') {
  8988. return parseStyleText(bindingStyle)
  8989. }
  8990. return bindingStyle
  8991. }
  8992. /* */
  8993. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8994. function getTarget(obj, path) {
  8995. var parts = path.split('.');
  8996. var key = parts[0];
  8997. if (key.indexOf('__$n') === 0) { //number index
  8998. key = parseInt(key.replace('__$n', ''));
  8999. }
  9000. if (parts.length === 1) {
  9001. return obj[key]
  9002. }
  9003. return getTarget(obj[key], parts.slice(1).join('.'))
  9004. }
  9005. function internalMixin(Vue) {
  9006. Vue.config.errorHandler = function(err, vm, info) {
  9007. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9008. console.error(err);
  9009. /* eslint-disable no-undef */
  9010. var app = typeof getApp === 'function' && getApp();
  9011. if (app && app.onError) {
  9012. app.onError(err);
  9013. }
  9014. };
  9015. var oldEmit = Vue.prototype.$emit;
  9016. Vue.prototype.$emit = function(event) {
  9017. if (this.$scope && event) {
  9018. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9019. if (triggerEvent) {
  9020. try {
  9021. triggerEvent.call(this.$scope, event, {
  9022. __args__: toArray(arguments, 1)
  9023. });
  9024. } catch (error) {
  9025. }
  9026. }
  9027. }
  9028. return oldEmit.apply(this, arguments)
  9029. };
  9030. Vue.prototype.$nextTick = function(fn) {
  9031. return nextTick$1(this, fn)
  9032. };
  9033. MP_METHODS.forEach(function (method) {
  9034. Vue.prototype[method] = function(args) {
  9035. if (this.$scope && this.$scope[method]) {
  9036. return this.$scope[method](args)
  9037. }
  9038. // mp-alipay
  9039. if (typeof my === 'undefined') {
  9040. return
  9041. }
  9042. if (method === 'createSelectorQuery') {
  9043. /* eslint-disable no-undef */
  9044. return my.createSelectorQuery(args)
  9045. } else if (method === 'createIntersectionObserver') {
  9046. /* eslint-disable no-undef */
  9047. return my.createIntersectionObserver(args)
  9048. }
  9049. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9050. };
  9051. });
  9052. Vue.prototype.__init_provide = initProvide;
  9053. Vue.prototype.__init_injections = initInjections;
  9054. Vue.prototype.__call_hook = function(hook, args) {
  9055. var vm = this;
  9056. // #7573 disable dep collection when invoking lifecycle hooks
  9057. pushTarget();
  9058. var handlers = vm.$options[hook];
  9059. var info = hook + " hook";
  9060. var ret;
  9061. if (handlers) {
  9062. for (var i = 0, j = handlers.length; i < j; i++) {
  9063. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9064. }
  9065. }
  9066. if (vm._hasHookEvent) {
  9067. vm.$emit('hook:' + hook, args);
  9068. }
  9069. popTarget();
  9070. return ret
  9071. };
  9072. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9073. if (Array.isArray(modifiers)) {
  9074. if (modifiers.indexOf('trim') !== -1) {
  9075. value = value.trim();
  9076. }
  9077. if (modifiers.indexOf('number') !== -1) {
  9078. value = this._n(value);
  9079. }
  9080. }
  9081. if (!target) {
  9082. target = this;
  9083. }
  9084. // 解决动态属性添加
  9085. Vue.set(target, key, value);
  9086. };
  9087. Vue.prototype.__set_sync = function(target, key, value) {
  9088. if (!target) {
  9089. target = this;
  9090. }
  9091. // 解决动态属性添加
  9092. Vue.set(target, key, value);
  9093. };
  9094. Vue.prototype.__get_orig = function(item) {
  9095. if (isPlainObject(item)) {
  9096. return item['$orig'] || item
  9097. }
  9098. return item
  9099. };
  9100. Vue.prototype.__get_value = function(dataPath, target) {
  9101. return getTarget(target || this, dataPath)
  9102. };
  9103. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9104. return renderClass(staticClass, dynamicClass)
  9105. };
  9106. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9107. if (!dynamicStyle && !staticStyle) {
  9108. return ''
  9109. }
  9110. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9111. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9112. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9113. };
  9114. Vue.prototype.__map = function(val, iteratee) {
  9115. //TODO 暂不考虑 string
  9116. var ret, i, l, keys, key;
  9117. if (Array.isArray(val)) {
  9118. ret = new Array(val.length);
  9119. for (i = 0, l = val.length; i < l; i++) {
  9120. ret[i] = iteratee(val[i], i);
  9121. }
  9122. return ret
  9123. } else if (isObject(val)) {
  9124. keys = Object.keys(val);
  9125. ret = Object.create(null);
  9126. for (i = 0, l = keys.length; i < l; i++) {
  9127. key = keys[i];
  9128. ret[key] = iteratee(val[key], key, i);
  9129. }
  9130. return ret
  9131. } else if (typeof val === 'number') {
  9132. ret = new Array(val);
  9133. for (i = 0, l = val; i < l; i++) {
  9134. // 第一个参数暂时仍和小程序一致
  9135. ret[i] = iteratee(i, i);
  9136. }
  9137. return ret
  9138. }
  9139. return []
  9140. };
  9141. }
  9142. /* */
  9143. var LIFECYCLE_HOOKS$1 = [
  9144. //App
  9145. 'onLaunch',
  9146. 'onShow',
  9147. 'onHide',
  9148. 'onUniNViewMessage',
  9149. 'onPageNotFound',
  9150. 'onThemeChange',
  9151. 'onError',
  9152. 'onUnhandledRejection',
  9153. //Page
  9154. 'onInit',
  9155. 'onLoad',
  9156. // 'onShow',
  9157. 'onReady',
  9158. // 'onHide',
  9159. 'onUnload',
  9160. 'onPullDownRefresh',
  9161. 'onReachBottom',
  9162. 'onTabItemTap',
  9163. 'onAddToFavorites',
  9164. 'onShareTimeline',
  9165. 'onShareAppMessage',
  9166. 'onResize',
  9167. 'onPageScroll',
  9168. 'onNavigationBarButtonTap',
  9169. 'onBackPress',
  9170. 'onNavigationBarSearchInputChanged',
  9171. 'onNavigationBarSearchInputConfirmed',
  9172. 'onNavigationBarSearchInputClicked',
  9173. //Component
  9174. // 'onReady', // 兼容旧版本,应该移除该事件
  9175. 'onPageShow',
  9176. 'onPageHide',
  9177. 'onPageResize',
  9178. 'onUploadDouyinVideo'
  9179. ];
  9180. function lifecycleMixin$1(Vue) {
  9181. //fixed vue-class-component
  9182. var oldExtend = Vue.extend;
  9183. Vue.extend = function(extendOptions) {
  9184. extendOptions = extendOptions || {};
  9185. var methods = extendOptions.methods;
  9186. if (methods) {
  9187. Object.keys(methods).forEach(function (methodName) {
  9188. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9189. extendOptions[methodName] = methods[methodName];
  9190. delete methods[methodName];
  9191. }
  9192. });
  9193. }
  9194. return oldExtend.call(this, extendOptions)
  9195. };
  9196. var strategies = Vue.config.optionMergeStrategies;
  9197. var mergeHook = strategies.created;
  9198. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9199. strategies[hook] = mergeHook;
  9200. });
  9201. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9202. }
  9203. /* */
  9204. // install platform patch function
  9205. Vue.prototype.__patch__ = patch;
  9206. // public mount method
  9207. Vue.prototype.$mount = function(
  9208. el ,
  9209. hydrating
  9210. ) {
  9211. return mountComponent$1(this, el, hydrating)
  9212. };
  9213. lifecycleMixin$1(Vue);
  9214. internalMixin(Vue);
  9215. /* */
  9216. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9217. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9218. /***/ }),
  9219. /***/ 26:
  9220. /*!************************************!*\
  9221. !*** D:/工作/项目2/亲家母/qjm/pages.json ***!
  9222. \************************************/
  9223. /*! no static exports found */
  9224. /***/ (function(module, exports) {
  9225. /***/ }),
  9226. /***/ 27:
  9227. /*!****************************************!*\
  9228. !*** D:/工作/项目2/亲家母/qjm/store/index.js ***!
  9229. \****************************************/
  9230. /*! no static exports found */
  9231. /***/ (function(module, exports, __webpack_require__) {
  9232. "use strict";
  9233. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9234. Object.defineProperty(exports, "__esModule", {
  9235. value: true
  9236. });
  9237. exports.default = void 0;
  9238. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  9239. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 28));
  9240. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 29));
  9241. _vue.default.use(_vuex.default);
  9242. var store = new _vuex.default.Store({
  9243. namespaced: true,
  9244. state: {
  9245. baseURL: "http://lingjie.frp.liuniu946.com",
  9246. //'http://eb.shuibo.net',//请求地址配置
  9247. // baseURL: 'https://qjm.liuniu946.com', //请求地址配置
  9248. urlFile: '/index',
  9249. //项目部署所在文件夹
  9250. userInfo: {},
  9251. //登录信息
  9252. loginInterceptor: false,
  9253. //是否打开强制登录
  9254. weichatInfo: {},
  9255. //保存微信注册信息
  9256. weichatObj: '' //微信对象
  9257. },
  9258. mutations: {
  9259. //保存微信信息
  9260. setWeiChatInfo: function setWeiChatInfo(state, provider) {
  9261. state.weichatInfo = provider;
  9262. },
  9263. //保存微信对象
  9264. setWeiChatObj: function setWeiChatObj(state, provider) {
  9265. state.weichatObj = provider;
  9266. }
  9267. },
  9268. modules: {
  9269. user: _user.default
  9270. },
  9271. actions: {}
  9272. });
  9273. var _default = store;
  9274. exports.default = _default;
  9275. /***/ }),
  9276. /***/ 28:
  9277. /*!**************************************************************************************!*\
  9278. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  9279. \**************************************************************************************/
  9280. /*! no static exports found */
  9281. /***/ (function(module, exports, __webpack_require__) {
  9282. "use strict";
  9283. /* WEBPACK VAR INJECTION */(function(global) {/*!
  9284. * vuex v3.6.2
  9285. * (c) 2021 Evan You
  9286. * @license MIT
  9287. */
  9288. function applyMixin (Vue) {
  9289. var version = Number(Vue.version.split('.')[0]);
  9290. if (version >= 2) {
  9291. Vue.mixin({ beforeCreate: vuexInit });
  9292. } else {
  9293. // override init and inject vuex init procedure
  9294. // for 1.x backwards compatibility.
  9295. var _init = Vue.prototype._init;
  9296. Vue.prototype._init = function (options) {
  9297. if ( options === void 0 ) options = {};
  9298. options.init = options.init
  9299. ? [vuexInit].concat(options.init)
  9300. : vuexInit;
  9301. _init.call(this, options);
  9302. };
  9303. }
  9304. /**
  9305. * Vuex init hook, injected into each instances init hooks list.
  9306. */
  9307. function vuexInit () {
  9308. var options = this.$options;
  9309. // store injection
  9310. if (options.store) {
  9311. this.$store = typeof options.store === 'function'
  9312. ? options.store()
  9313. : options.store;
  9314. } else if (options.parent && options.parent.$store) {
  9315. this.$store = options.parent.$store;
  9316. }
  9317. }
  9318. }
  9319. var target = typeof window !== 'undefined'
  9320. ? window
  9321. : typeof global !== 'undefined'
  9322. ? global
  9323. : {};
  9324. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  9325. function devtoolPlugin (store) {
  9326. if (!devtoolHook) { return }
  9327. store._devtoolHook = devtoolHook;
  9328. devtoolHook.emit('vuex:init', store);
  9329. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  9330. store.replaceState(targetState);
  9331. });
  9332. store.subscribe(function (mutation, state) {
  9333. devtoolHook.emit('vuex:mutation', mutation, state);
  9334. }, { prepend: true });
  9335. store.subscribeAction(function (action, state) {
  9336. devtoolHook.emit('vuex:action', action, state);
  9337. }, { prepend: true });
  9338. }
  9339. /**
  9340. * Get the first item that pass the test
  9341. * by second argument function
  9342. *
  9343. * @param {Array} list
  9344. * @param {Function} f
  9345. * @return {*}
  9346. */
  9347. function find (list, f) {
  9348. return list.filter(f)[0]
  9349. }
  9350. /**
  9351. * Deep copy the given object considering circular structure.
  9352. * This function caches all nested objects and its copies.
  9353. * If it detects circular structure, use cached copy to avoid infinite loop.
  9354. *
  9355. * @param {*} obj
  9356. * @param {Array<Object>} cache
  9357. * @return {*}
  9358. */
  9359. function deepCopy (obj, cache) {
  9360. if ( cache === void 0 ) cache = [];
  9361. // just return if obj is immutable value
  9362. if (obj === null || typeof obj !== 'object') {
  9363. return obj
  9364. }
  9365. // if obj is hit, it is in circular structure
  9366. var hit = find(cache, function (c) { return c.original === obj; });
  9367. if (hit) {
  9368. return hit.copy
  9369. }
  9370. var copy = Array.isArray(obj) ? [] : {};
  9371. // put the copy into cache at first
  9372. // because we want to refer it in recursive deepCopy
  9373. cache.push({
  9374. original: obj,
  9375. copy: copy
  9376. });
  9377. Object.keys(obj).forEach(function (key) {
  9378. copy[key] = deepCopy(obj[key], cache);
  9379. });
  9380. return copy
  9381. }
  9382. /**
  9383. * forEach for object
  9384. */
  9385. function forEachValue (obj, fn) {
  9386. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  9387. }
  9388. function isObject (obj) {
  9389. return obj !== null && typeof obj === 'object'
  9390. }
  9391. function isPromise (val) {
  9392. return val && typeof val.then === 'function'
  9393. }
  9394. function assert (condition, msg) {
  9395. if (!condition) { throw new Error(("[vuex] " + msg)) }
  9396. }
  9397. function partial (fn, arg) {
  9398. return function () {
  9399. return fn(arg)
  9400. }
  9401. }
  9402. // Base data struct for store's module, package with some attribute and method
  9403. var Module = function Module (rawModule, runtime) {
  9404. this.runtime = runtime;
  9405. // Store some children item
  9406. this._children = Object.create(null);
  9407. // Store the origin module object which passed by programmer
  9408. this._rawModule = rawModule;
  9409. var rawState = rawModule.state;
  9410. // Store the origin module's state
  9411. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  9412. };
  9413. var prototypeAccessors = { namespaced: { configurable: true } };
  9414. prototypeAccessors.namespaced.get = function () {
  9415. return !!this._rawModule.namespaced
  9416. };
  9417. Module.prototype.addChild = function addChild (key, module) {
  9418. this._children[key] = module;
  9419. };
  9420. Module.prototype.removeChild = function removeChild (key) {
  9421. delete this._children[key];
  9422. };
  9423. Module.prototype.getChild = function getChild (key) {
  9424. return this._children[key]
  9425. };
  9426. Module.prototype.hasChild = function hasChild (key) {
  9427. return key in this._children
  9428. };
  9429. Module.prototype.update = function update (rawModule) {
  9430. this._rawModule.namespaced = rawModule.namespaced;
  9431. if (rawModule.actions) {
  9432. this._rawModule.actions = rawModule.actions;
  9433. }
  9434. if (rawModule.mutations) {
  9435. this._rawModule.mutations = rawModule.mutations;
  9436. }
  9437. if (rawModule.getters) {
  9438. this._rawModule.getters = rawModule.getters;
  9439. }
  9440. };
  9441. Module.prototype.forEachChild = function forEachChild (fn) {
  9442. forEachValue(this._children, fn);
  9443. };
  9444. Module.prototype.forEachGetter = function forEachGetter (fn) {
  9445. if (this._rawModule.getters) {
  9446. forEachValue(this._rawModule.getters, fn);
  9447. }
  9448. };
  9449. Module.prototype.forEachAction = function forEachAction (fn) {
  9450. if (this._rawModule.actions) {
  9451. forEachValue(this._rawModule.actions, fn);
  9452. }
  9453. };
  9454. Module.prototype.forEachMutation = function forEachMutation (fn) {
  9455. if (this._rawModule.mutations) {
  9456. forEachValue(this._rawModule.mutations, fn);
  9457. }
  9458. };
  9459. Object.defineProperties( Module.prototype, prototypeAccessors );
  9460. var ModuleCollection = function ModuleCollection (rawRootModule) {
  9461. // register root module (Vuex.Store options)
  9462. this.register([], rawRootModule, false);
  9463. };
  9464. ModuleCollection.prototype.get = function get (path) {
  9465. return path.reduce(function (module, key) {
  9466. return module.getChild(key)
  9467. }, this.root)
  9468. };
  9469. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  9470. var module = this.root;
  9471. return path.reduce(function (namespace, key) {
  9472. module = module.getChild(key);
  9473. return namespace + (module.namespaced ? key + '/' : '')
  9474. }, '')
  9475. };
  9476. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  9477. update([], this.root, rawRootModule);
  9478. };
  9479. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  9480. var this$1 = this;
  9481. if ( runtime === void 0 ) runtime = true;
  9482. if ((true)) {
  9483. assertRawModule(path, rawModule);
  9484. }
  9485. var newModule = new Module(rawModule, runtime);
  9486. if (path.length === 0) {
  9487. this.root = newModule;
  9488. } else {
  9489. var parent = this.get(path.slice(0, -1));
  9490. parent.addChild(path[path.length - 1], newModule);
  9491. }
  9492. // register nested modules
  9493. if (rawModule.modules) {
  9494. forEachValue(rawModule.modules, function (rawChildModule, key) {
  9495. this$1.register(path.concat(key), rawChildModule, runtime);
  9496. });
  9497. }
  9498. };
  9499. ModuleCollection.prototype.unregister = function unregister (path) {
  9500. var parent = this.get(path.slice(0, -1));
  9501. var key = path[path.length - 1];
  9502. var child = parent.getChild(key);
  9503. if (!child) {
  9504. if ((true)) {
  9505. console.warn(
  9506. "[vuex] trying to unregister module '" + key + "', which is " +
  9507. "not registered"
  9508. );
  9509. }
  9510. return
  9511. }
  9512. if (!child.runtime) {
  9513. return
  9514. }
  9515. parent.removeChild(key);
  9516. };
  9517. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  9518. var parent = this.get(path.slice(0, -1));
  9519. var key = path[path.length - 1];
  9520. if (parent) {
  9521. return parent.hasChild(key)
  9522. }
  9523. return false
  9524. };
  9525. function update (path, targetModule, newModule) {
  9526. if ((true)) {
  9527. assertRawModule(path, newModule);
  9528. }
  9529. // update target module
  9530. targetModule.update(newModule);
  9531. // update nested modules
  9532. if (newModule.modules) {
  9533. for (var key in newModule.modules) {
  9534. if (!targetModule.getChild(key)) {
  9535. if ((true)) {
  9536. console.warn(
  9537. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  9538. 'manual reload is needed'
  9539. );
  9540. }
  9541. return
  9542. }
  9543. update(
  9544. path.concat(key),
  9545. targetModule.getChild(key),
  9546. newModule.modules[key]
  9547. );
  9548. }
  9549. }
  9550. }
  9551. var functionAssert = {
  9552. assert: function (value) { return typeof value === 'function'; },
  9553. expected: 'function'
  9554. };
  9555. var objectAssert = {
  9556. assert: function (value) { return typeof value === 'function' ||
  9557. (typeof value === 'object' && typeof value.handler === 'function'); },
  9558. expected: 'function or object with "handler" function'
  9559. };
  9560. var assertTypes = {
  9561. getters: functionAssert,
  9562. mutations: functionAssert,
  9563. actions: objectAssert
  9564. };
  9565. function assertRawModule (path, rawModule) {
  9566. Object.keys(assertTypes).forEach(function (key) {
  9567. if (!rawModule[key]) { return }
  9568. var assertOptions = assertTypes[key];
  9569. forEachValue(rawModule[key], function (value, type) {
  9570. assert(
  9571. assertOptions.assert(value),
  9572. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  9573. );
  9574. });
  9575. });
  9576. }
  9577. function makeAssertionMessage (path, key, type, value, expected) {
  9578. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  9579. if (path.length > 0) {
  9580. buf += " in module \"" + (path.join('.')) + "\"";
  9581. }
  9582. buf += " is " + (JSON.stringify(value)) + ".";
  9583. return buf
  9584. }
  9585. var Vue; // bind on install
  9586. var Store = function Store (options) {
  9587. var this$1 = this;
  9588. if ( options === void 0 ) options = {};
  9589. // Auto install if it is not done yet and `window` has `Vue`.
  9590. // To allow users to avoid auto-installation in some cases,
  9591. // this code should be placed here. See #731
  9592. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  9593. install(window.Vue);
  9594. }
  9595. if ((true)) {
  9596. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  9597. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  9598. assert(this instanceof Store, "store must be called with the new operator.");
  9599. }
  9600. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  9601. var strict = options.strict; if ( strict === void 0 ) strict = false;
  9602. // store internal state
  9603. this._committing = false;
  9604. this._actions = Object.create(null);
  9605. this._actionSubscribers = [];
  9606. this._mutations = Object.create(null);
  9607. this._wrappedGetters = Object.create(null);
  9608. this._modules = new ModuleCollection(options);
  9609. this._modulesNamespaceMap = Object.create(null);
  9610. this._subscribers = [];
  9611. this._watcherVM = new Vue();
  9612. this._makeLocalGettersCache = Object.create(null);
  9613. // bind commit and dispatch to self
  9614. var store = this;
  9615. var ref = this;
  9616. var dispatch = ref.dispatch;
  9617. var commit = ref.commit;
  9618. this.dispatch = function boundDispatch (type, payload) {
  9619. return dispatch.call(store, type, payload)
  9620. };
  9621. this.commit = function boundCommit (type, payload, options) {
  9622. return commit.call(store, type, payload, options)
  9623. };
  9624. // strict mode
  9625. this.strict = strict;
  9626. var state = this._modules.root.state;
  9627. // init root module.
  9628. // this also recursively registers all sub-modules
  9629. // and collects all module getters inside this._wrappedGetters
  9630. installModule(this, state, [], this._modules.root);
  9631. // initialize the store vm, which is responsible for the reactivity
  9632. // (also registers _wrappedGetters as computed properties)
  9633. resetStoreVM(this, state);
  9634. // apply plugins
  9635. plugins.forEach(function (plugin) { return plugin(this$1); });
  9636. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  9637. if (useDevtools) {
  9638. devtoolPlugin(this);
  9639. }
  9640. };
  9641. var prototypeAccessors$1 = { state: { configurable: true } };
  9642. prototypeAccessors$1.state.get = function () {
  9643. return this._vm._data.$$state
  9644. };
  9645. prototypeAccessors$1.state.set = function (v) {
  9646. if ((true)) {
  9647. assert(false, "use store.replaceState() to explicit replace store state.");
  9648. }
  9649. };
  9650. Store.prototype.commit = function commit (_type, _payload, _options) {
  9651. var this$1 = this;
  9652. // check object-style commit
  9653. var ref = unifyObjectStyle(_type, _payload, _options);
  9654. var type = ref.type;
  9655. var payload = ref.payload;
  9656. var options = ref.options;
  9657. var mutation = { type: type, payload: payload };
  9658. var entry = this._mutations[type];
  9659. if (!entry) {
  9660. if ((true)) {
  9661. console.error(("[vuex] unknown mutation type: " + type));
  9662. }
  9663. return
  9664. }
  9665. this._withCommit(function () {
  9666. entry.forEach(function commitIterator (handler) {
  9667. handler(payload);
  9668. });
  9669. });
  9670. this._subscribers
  9671. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9672. .forEach(function (sub) { return sub(mutation, this$1.state); });
  9673. if (
  9674. ( true) &&
  9675. options && options.silent
  9676. ) {
  9677. console.warn(
  9678. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  9679. 'Use the filter functionality in the vue-devtools'
  9680. );
  9681. }
  9682. };
  9683. Store.prototype.dispatch = function dispatch (_type, _payload) {
  9684. var this$1 = this;
  9685. // check object-style dispatch
  9686. var ref = unifyObjectStyle(_type, _payload);
  9687. var type = ref.type;
  9688. var payload = ref.payload;
  9689. var action = { type: type, payload: payload };
  9690. var entry = this._actions[type];
  9691. if (!entry) {
  9692. if ((true)) {
  9693. console.error(("[vuex] unknown action type: " + type));
  9694. }
  9695. return
  9696. }
  9697. try {
  9698. this._actionSubscribers
  9699. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9700. .filter(function (sub) { return sub.before; })
  9701. .forEach(function (sub) { return sub.before(action, this$1.state); });
  9702. } catch (e) {
  9703. if ((true)) {
  9704. console.warn("[vuex] error in before action subscribers: ");
  9705. console.error(e);
  9706. }
  9707. }
  9708. var result = entry.length > 1
  9709. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  9710. : entry[0](payload);
  9711. return new Promise(function (resolve, reject) {
  9712. result.then(function (res) {
  9713. try {
  9714. this$1._actionSubscribers
  9715. .filter(function (sub) { return sub.after; })
  9716. .forEach(function (sub) { return sub.after(action, this$1.state); });
  9717. } catch (e) {
  9718. if ((true)) {
  9719. console.warn("[vuex] error in after action subscribers: ");
  9720. console.error(e);
  9721. }
  9722. }
  9723. resolve(res);
  9724. }, function (error) {
  9725. try {
  9726. this$1._actionSubscribers
  9727. .filter(function (sub) { return sub.error; })
  9728. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  9729. } catch (e) {
  9730. if ((true)) {
  9731. console.warn("[vuex] error in error action subscribers: ");
  9732. console.error(e);
  9733. }
  9734. }
  9735. reject(error);
  9736. });
  9737. })
  9738. };
  9739. Store.prototype.subscribe = function subscribe (fn, options) {
  9740. return genericSubscribe(fn, this._subscribers, options)
  9741. };
  9742. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  9743. var subs = typeof fn === 'function' ? { before: fn } : fn;
  9744. return genericSubscribe(subs, this._actionSubscribers, options)
  9745. };
  9746. Store.prototype.watch = function watch (getter, cb, options) {
  9747. var this$1 = this;
  9748. if ((true)) {
  9749. assert(typeof getter === 'function', "store.watch only accepts a function.");
  9750. }
  9751. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  9752. };
  9753. Store.prototype.replaceState = function replaceState (state) {
  9754. var this$1 = this;
  9755. this._withCommit(function () {
  9756. this$1._vm._data.$$state = state;
  9757. });
  9758. };
  9759. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  9760. if ( options === void 0 ) options = {};
  9761. if (typeof path === 'string') { path = [path]; }
  9762. if ((true)) {
  9763. assert(Array.isArray(path), "module path must be a string or an Array.");
  9764. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  9765. }
  9766. this._modules.register(path, rawModule);
  9767. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  9768. // reset store to update getters...
  9769. resetStoreVM(this, this.state);
  9770. };
  9771. Store.prototype.unregisterModule = function unregisterModule (path) {
  9772. var this$1 = this;
  9773. if (typeof path === 'string') { path = [path]; }
  9774. if ((true)) {
  9775. assert(Array.isArray(path), "module path must be a string or an Array.");
  9776. }
  9777. this._modules.unregister(path);
  9778. this._withCommit(function () {
  9779. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  9780. Vue.delete(parentState, path[path.length - 1]);
  9781. });
  9782. resetStore(this);
  9783. };
  9784. Store.prototype.hasModule = function hasModule (path) {
  9785. if (typeof path === 'string') { path = [path]; }
  9786. if ((true)) {
  9787. assert(Array.isArray(path), "module path must be a string or an Array.");
  9788. }
  9789. return this._modules.isRegistered(path)
  9790. };
  9791. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  9792. this._modules.update(newOptions);
  9793. resetStore(this, true);
  9794. };
  9795. Store.prototype._withCommit = function _withCommit (fn) {
  9796. var committing = this._committing;
  9797. this._committing = true;
  9798. fn();
  9799. this._committing = committing;
  9800. };
  9801. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  9802. function genericSubscribe (fn, subs, options) {
  9803. if (subs.indexOf(fn) < 0) {
  9804. options && options.prepend
  9805. ? subs.unshift(fn)
  9806. : subs.push(fn);
  9807. }
  9808. return function () {
  9809. var i = subs.indexOf(fn);
  9810. if (i > -1) {
  9811. subs.splice(i, 1);
  9812. }
  9813. }
  9814. }
  9815. function resetStore (store, hot) {
  9816. store._actions = Object.create(null);
  9817. store._mutations = Object.create(null);
  9818. store._wrappedGetters = Object.create(null);
  9819. store._modulesNamespaceMap = Object.create(null);
  9820. var state = store.state;
  9821. // init all modules
  9822. installModule(store, state, [], store._modules.root, true);
  9823. // reset vm
  9824. resetStoreVM(store, state, hot);
  9825. }
  9826. function resetStoreVM (store, state, hot) {
  9827. var oldVm = store._vm;
  9828. // bind store public getters
  9829. store.getters = {};
  9830. // reset local getters cache
  9831. store._makeLocalGettersCache = Object.create(null);
  9832. var wrappedGetters = store._wrappedGetters;
  9833. var computed = {};
  9834. forEachValue(wrappedGetters, function (fn, key) {
  9835. // use computed to leverage its lazy-caching mechanism
  9836. // direct inline function use will lead to closure preserving oldVm.
  9837. // using partial to return function with only arguments preserved in closure environment.
  9838. computed[key] = partial(fn, store);
  9839. Object.defineProperty(store.getters, key, {
  9840. get: function () { return store._vm[key]; },
  9841. enumerable: true // for local getters
  9842. });
  9843. });
  9844. // use a Vue instance to store the state tree
  9845. // suppress warnings just in case the user has added
  9846. // some funky global mixins
  9847. var silent = Vue.config.silent;
  9848. Vue.config.silent = true;
  9849. store._vm = new Vue({
  9850. data: {
  9851. $$state: state
  9852. },
  9853. computed: computed
  9854. });
  9855. Vue.config.silent = silent;
  9856. // enable strict mode for new vm
  9857. if (store.strict) {
  9858. enableStrictMode(store);
  9859. }
  9860. if (oldVm) {
  9861. if (hot) {
  9862. // dispatch changes in all subscribed watchers
  9863. // to force getter re-evaluation for hot reloading.
  9864. store._withCommit(function () {
  9865. oldVm._data.$$state = null;
  9866. });
  9867. }
  9868. Vue.nextTick(function () { return oldVm.$destroy(); });
  9869. }
  9870. }
  9871. function installModule (store, rootState, path, module, hot) {
  9872. var isRoot = !path.length;
  9873. var namespace = store._modules.getNamespace(path);
  9874. // register in namespace map
  9875. if (module.namespaced) {
  9876. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  9877. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  9878. }
  9879. store._modulesNamespaceMap[namespace] = module;
  9880. }
  9881. // set state
  9882. if (!isRoot && !hot) {
  9883. var parentState = getNestedState(rootState, path.slice(0, -1));
  9884. var moduleName = path[path.length - 1];
  9885. store._withCommit(function () {
  9886. if ((true)) {
  9887. if (moduleName in parentState) {
  9888. console.warn(
  9889. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  9890. );
  9891. }
  9892. }
  9893. Vue.set(parentState, moduleName, module.state);
  9894. });
  9895. }
  9896. var local = module.context = makeLocalContext(store, namespace, path);
  9897. module.forEachMutation(function (mutation, key) {
  9898. var namespacedType = namespace + key;
  9899. registerMutation(store, namespacedType, mutation, local);
  9900. });
  9901. module.forEachAction(function (action, key) {
  9902. var type = action.root ? key : namespace + key;
  9903. var handler = action.handler || action;
  9904. registerAction(store, type, handler, local);
  9905. });
  9906. module.forEachGetter(function (getter, key) {
  9907. var namespacedType = namespace + key;
  9908. registerGetter(store, namespacedType, getter, local);
  9909. });
  9910. module.forEachChild(function (child, key) {
  9911. installModule(store, rootState, path.concat(key), child, hot);
  9912. });
  9913. }
  9914. /**
  9915. * make localized dispatch, commit, getters and state
  9916. * if there is no namespace, just use root ones
  9917. */
  9918. function makeLocalContext (store, namespace, path) {
  9919. var noNamespace = namespace === '';
  9920. var local = {
  9921. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  9922. var args = unifyObjectStyle(_type, _payload, _options);
  9923. var payload = args.payload;
  9924. var options = args.options;
  9925. var type = args.type;
  9926. if (!options || !options.root) {
  9927. type = namespace + type;
  9928. if (( true) && !store._actions[type]) {
  9929. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  9930. return
  9931. }
  9932. }
  9933. return store.dispatch(type, payload)
  9934. },
  9935. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  9936. var args = unifyObjectStyle(_type, _payload, _options);
  9937. var payload = args.payload;
  9938. var options = args.options;
  9939. var type = args.type;
  9940. if (!options || !options.root) {
  9941. type = namespace + type;
  9942. if (( true) && !store._mutations[type]) {
  9943. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  9944. return
  9945. }
  9946. }
  9947. store.commit(type, payload, options);
  9948. }
  9949. };
  9950. // getters and state object must be gotten lazily
  9951. // because they will be changed by vm update
  9952. Object.defineProperties(local, {
  9953. getters: {
  9954. get: noNamespace
  9955. ? function () { return store.getters; }
  9956. : function () { return makeLocalGetters(store, namespace); }
  9957. },
  9958. state: {
  9959. get: function () { return getNestedState(store.state, path); }
  9960. }
  9961. });
  9962. return local
  9963. }
  9964. function makeLocalGetters (store, namespace) {
  9965. if (!store._makeLocalGettersCache[namespace]) {
  9966. var gettersProxy = {};
  9967. var splitPos = namespace.length;
  9968. Object.keys(store.getters).forEach(function (type) {
  9969. // skip if the target getter is not match this namespace
  9970. if (type.slice(0, splitPos) !== namespace) { return }
  9971. // extract local getter type
  9972. var localType = type.slice(splitPos);
  9973. // Add a port to the getters proxy.
  9974. // Define as getter property because
  9975. // we do not want to evaluate the getters in this time.
  9976. Object.defineProperty(gettersProxy, localType, {
  9977. get: function () { return store.getters[type]; },
  9978. enumerable: true
  9979. });
  9980. });
  9981. store._makeLocalGettersCache[namespace] = gettersProxy;
  9982. }
  9983. return store._makeLocalGettersCache[namespace]
  9984. }
  9985. function registerMutation (store, type, handler, local) {
  9986. var entry = store._mutations[type] || (store._mutations[type] = []);
  9987. entry.push(function wrappedMutationHandler (payload) {
  9988. handler.call(store, local.state, payload);
  9989. });
  9990. }
  9991. function registerAction (store, type, handler, local) {
  9992. var entry = store._actions[type] || (store._actions[type] = []);
  9993. entry.push(function wrappedActionHandler (payload) {
  9994. var res = handler.call(store, {
  9995. dispatch: local.dispatch,
  9996. commit: local.commit,
  9997. getters: local.getters,
  9998. state: local.state,
  9999. rootGetters: store.getters,
  10000. rootState: store.state
  10001. }, payload);
  10002. if (!isPromise(res)) {
  10003. res = Promise.resolve(res);
  10004. }
  10005. if (store._devtoolHook) {
  10006. return res.catch(function (err) {
  10007. store._devtoolHook.emit('vuex:error', err);
  10008. throw err
  10009. })
  10010. } else {
  10011. return res
  10012. }
  10013. });
  10014. }
  10015. function registerGetter (store, type, rawGetter, local) {
  10016. if (store._wrappedGetters[type]) {
  10017. if ((true)) {
  10018. console.error(("[vuex] duplicate getter key: " + type));
  10019. }
  10020. return
  10021. }
  10022. store._wrappedGetters[type] = function wrappedGetter (store) {
  10023. return rawGetter(
  10024. local.state, // local state
  10025. local.getters, // local getters
  10026. store.state, // root state
  10027. store.getters // root getters
  10028. )
  10029. };
  10030. }
  10031. function enableStrictMode (store) {
  10032. store._vm.$watch(function () { return this._data.$$state }, function () {
  10033. if ((true)) {
  10034. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  10035. }
  10036. }, { deep: true, sync: true });
  10037. }
  10038. function getNestedState (state, path) {
  10039. return path.reduce(function (state, key) { return state[key]; }, state)
  10040. }
  10041. function unifyObjectStyle (type, payload, options) {
  10042. if (isObject(type) && type.type) {
  10043. options = payload;
  10044. payload = type;
  10045. type = type.type;
  10046. }
  10047. if ((true)) {
  10048. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  10049. }
  10050. return { type: type, payload: payload, options: options }
  10051. }
  10052. function install (_Vue) {
  10053. if (Vue && _Vue === Vue) {
  10054. if ((true)) {
  10055. console.error(
  10056. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  10057. );
  10058. }
  10059. return
  10060. }
  10061. Vue = _Vue;
  10062. applyMixin(Vue);
  10063. }
  10064. /**
  10065. * Reduce the code which written in Vue.js for getting the state.
  10066. * @param {String} [namespace] - Module's namespace
  10067. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  10068. * @param {Object}
  10069. */
  10070. var mapState = normalizeNamespace(function (namespace, states) {
  10071. var res = {};
  10072. if (( true) && !isValidMap(states)) {
  10073. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  10074. }
  10075. normalizeMap(states).forEach(function (ref) {
  10076. var key = ref.key;
  10077. var val = ref.val;
  10078. res[key] = function mappedState () {
  10079. var state = this.$store.state;
  10080. var getters = this.$store.getters;
  10081. if (namespace) {
  10082. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  10083. if (!module) {
  10084. return
  10085. }
  10086. state = module.context.state;
  10087. getters = module.context.getters;
  10088. }
  10089. return typeof val === 'function'
  10090. ? val.call(this, state, getters)
  10091. : state[val]
  10092. };
  10093. // mark vuex getter for devtools
  10094. res[key].vuex = true;
  10095. });
  10096. return res
  10097. });
  10098. /**
  10099. * Reduce the code which written in Vue.js for committing the mutation
  10100. * @param {String} [namespace] - Module's namespace
  10101. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10102. * @return {Object}
  10103. */
  10104. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  10105. var res = {};
  10106. if (( true) && !isValidMap(mutations)) {
  10107. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  10108. }
  10109. normalizeMap(mutations).forEach(function (ref) {
  10110. var key = ref.key;
  10111. var val = ref.val;
  10112. res[key] = function mappedMutation () {
  10113. var args = [], len = arguments.length;
  10114. while ( len-- ) args[ len ] = arguments[ len ];
  10115. // Get the commit method from store
  10116. var commit = this.$store.commit;
  10117. if (namespace) {
  10118. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  10119. if (!module) {
  10120. return
  10121. }
  10122. commit = module.context.commit;
  10123. }
  10124. return typeof val === 'function'
  10125. ? val.apply(this, [commit].concat(args))
  10126. : commit.apply(this.$store, [val].concat(args))
  10127. };
  10128. });
  10129. return res
  10130. });
  10131. /**
  10132. * Reduce the code which written in Vue.js for getting the getters
  10133. * @param {String} [namespace] - Module's namespace
  10134. * @param {Object|Array} getters
  10135. * @return {Object}
  10136. */
  10137. var mapGetters = normalizeNamespace(function (namespace, getters) {
  10138. var res = {};
  10139. if (( true) && !isValidMap(getters)) {
  10140. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  10141. }
  10142. normalizeMap(getters).forEach(function (ref) {
  10143. var key = ref.key;
  10144. var val = ref.val;
  10145. // The namespace has been mutated by normalizeNamespace
  10146. val = namespace + val;
  10147. res[key] = function mappedGetter () {
  10148. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  10149. return
  10150. }
  10151. if (( true) && !(val in this.$store.getters)) {
  10152. console.error(("[vuex] unknown getter: " + val));
  10153. return
  10154. }
  10155. return this.$store.getters[val]
  10156. };
  10157. // mark vuex getter for devtools
  10158. res[key].vuex = true;
  10159. });
  10160. return res
  10161. });
  10162. /**
  10163. * Reduce the code which written in Vue.js for dispatch the action
  10164. * @param {String} [namespace] - Module's namespace
  10165. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10166. * @return {Object}
  10167. */
  10168. var mapActions = normalizeNamespace(function (namespace, actions) {
  10169. var res = {};
  10170. if (( true) && !isValidMap(actions)) {
  10171. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  10172. }
  10173. normalizeMap(actions).forEach(function (ref) {
  10174. var key = ref.key;
  10175. var val = ref.val;
  10176. res[key] = function mappedAction () {
  10177. var args = [], len = arguments.length;
  10178. while ( len-- ) args[ len ] = arguments[ len ];
  10179. // get dispatch function from store
  10180. var dispatch = this.$store.dispatch;
  10181. if (namespace) {
  10182. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  10183. if (!module) {
  10184. return
  10185. }
  10186. dispatch = module.context.dispatch;
  10187. }
  10188. return typeof val === 'function'
  10189. ? val.apply(this, [dispatch].concat(args))
  10190. : dispatch.apply(this.$store, [val].concat(args))
  10191. };
  10192. });
  10193. return res
  10194. });
  10195. /**
  10196. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  10197. * @param {String} namespace
  10198. * @return {Object}
  10199. */
  10200. var createNamespacedHelpers = function (namespace) { return ({
  10201. mapState: mapState.bind(null, namespace),
  10202. mapGetters: mapGetters.bind(null, namespace),
  10203. mapMutations: mapMutations.bind(null, namespace),
  10204. mapActions: mapActions.bind(null, namespace)
  10205. }); };
  10206. /**
  10207. * Normalize the map
  10208. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  10209. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  10210. * @param {Array|Object} map
  10211. * @return {Object}
  10212. */
  10213. function normalizeMap (map) {
  10214. if (!isValidMap(map)) {
  10215. return []
  10216. }
  10217. return Array.isArray(map)
  10218. ? map.map(function (key) { return ({ key: key, val: key }); })
  10219. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  10220. }
  10221. /**
  10222. * Validate whether given map is valid or not
  10223. * @param {*} map
  10224. * @return {Boolean}
  10225. */
  10226. function isValidMap (map) {
  10227. return Array.isArray(map) || isObject(map)
  10228. }
  10229. /**
  10230. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  10231. * @param {Function} fn
  10232. * @return {Function}
  10233. */
  10234. function normalizeNamespace (fn) {
  10235. return function (namespace, map) {
  10236. if (typeof namespace !== 'string') {
  10237. map = namespace;
  10238. namespace = '';
  10239. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  10240. namespace += '/';
  10241. }
  10242. return fn(namespace, map)
  10243. }
  10244. }
  10245. /**
  10246. * Search a special module from store by namespace. if module not exist, print error message.
  10247. * @param {Object} store
  10248. * @param {String} helper
  10249. * @param {String} namespace
  10250. * @return {Object}
  10251. */
  10252. function getModuleByNamespace (store, helper, namespace) {
  10253. var module = store._modulesNamespaceMap[namespace];
  10254. if (( true) && !module) {
  10255. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  10256. }
  10257. return module
  10258. }
  10259. // Credits: borrowed code from fcomb/redux-logger
  10260. function createLogger (ref) {
  10261. if ( ref === void 0 ) ref = {};
  10262. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  10263. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  10264. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  10265. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  10266. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  10267. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  10268. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  10269. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  10270. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  10271. return function (store) {
  10272. var prevState = deepCopy(store.state);
  10273. if (typeof logger === 'undefined') {
  10274. return
  10275. }
  10276. if (logMutations) {
  10277. store.subscribe(function (mutation, state) {
  10278. var nextState = deepCopy(state);
  10279. if (filter(mutation, prevState, nextState)) {
  10280. var formattedTime = getFormattedTime();
  10281. var formattedMutation = mutationTransformer(mutation);
  10282. var message = "mutation " + (mutation.type) + formattedTime;
  10283. startMessage(logger, message, collapsed);
  10284. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  10285. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  10286. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  10287. endMessage(logger);
  10288. }
  10289. prevState = nextState;
  10290. });
  10291. }
  10292. if (logActions) {
  10293. store.subscribeAction(function (action, state) {
  10294. if (actionFilter(action, state)) {
  10295. var formattedTime = getFormattedTime();
  10296. var formattedAction = actionTransformer(action);
  10297. var message = "action " + (action.type) + formattedTime;
  10298. startMessage(logger, message, collapsed);
  10299. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  10300. endMessage(logger);
  10301. }
  10302. });
  10303. }
  10304. }
  10305. }
  10306. function startMessage (logger, message, collapsed) {
  10307. var startMessage = collapsed
  10308. ? logger.groupCollapsed
  10309. : logger.group;
  10310. // render
  10311. try {
  10312. startMessage.call(logger, message);
  10313. } catch (e) {
  10314. logger.log(message);
  10315. }
  10316. }
  10317. function endMessage (logger) {
  10318. try {
  10319. logger.groupEnd();
  10320. } catch (e) {
  10321. logger.log('—— log end ——');
  10322. }
  10323. }
  10324. function getFormattedTime () {
  10325. var time = new Date();
  10326. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  10327. }
  10328. function repeat (str, times) {
  10329. return (new Array(times + 1)).join(str)
  10330. }
  10331. function pad (num, maxLength) {
  10332. return repeat('0', maxLength - num.toString().length) + num
  10333. }
  10334. var index_cjs = {
  10335. Store: Store,
  10336. install: install,
  10337. version: '3.6.2',
  10338. mapState: mapState,
  10339. mapMutations: mapMutations,
  10340. mapGetters: mapGetters,
  10341. mapActions: mapActions,
  10342. createNamespacedHelpers: createNamespacedHelpers,
  10343. createLogger: createLogger
  10344. };
  10345. module.exports = index_cjs;
  10346. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  10347. /***/ }),
  10348. /***/ 29:
  10349. /*!*********************************************!*\
  10350. !*** D:/工作/项目2/亲家母/qjm/store/model/user.js ***!
  10351. \*********************************************/
  10352. /*! no static exports found */
  10353. /***/ (function(module, exports, __webpack_require__) {
  10354. "use strict";
  10355. /* WEBPACK VAR INJECTION */(function(uni) {
  10356. Object.defineProperty(exports, "__esModule", {
  10357. value: true
  10358. });
  10359. exports.default = void 0;
  10360. var state = {
  10361. userInfo: {},
  10362. //用户信息
  10363. orderInfo: {
  10364. complete_count: 0,
  10365. //完成
  10366. received_count: 0,
  10367. //待收货
  10368. unshipped_count: 0,
  10369. //待发货
  10370. order_count: 0,
  10371. //订单总数
  10372. unpaid_count: 0 //待付款
  10373. },
  10374. //订单信息
  10375. hasLogin: false //是否登录
  10376. };
  10377. var mutations = {
  10378. // 登录
  10379. login: function login(state) {
  10380. state.hasLogin = true;
  10381. },
  10382. // 退出登录
  10383. logout: function logout(state, provider) {
  10384. state.hasLogin = false;
  10385. // 清空基础信息
  10386. state.userInfo = {};
  10387. state.orderInfo = {
  10388. complete_count: 0,
  10389. //完成
  10390. received_count: 0,
  10391. //待收货
  10392. unshipped_count: 0,
  10393. //待发货
  10394. order_count: 0,
  10395. //订单总数
  10396. unpaid_count: 0 //待付款
  10397. };
  10398. // 清除缓存用户信息
  10399. uni.removeStorage({
  10400. key: 'userInfo'
  10401. });
  10402. // 清除缓存token
  10403. uni.removeStorage({
  10404. key: 'token'
  10405. });
  10406. },
  10407. // 保存用户信息
  10408. setUserInfo: function setUserInfo(state, provider) {
  10409. state.userInfo = provider;
  10410. uni.setStorage({
  10411. //缓存用户登陆状态
  10412. key: 'userInfo',
  10413. data: provider
  10414. });
  10415. },
  10416. // 保存订单信息
  10417. setOrderInfo: function setOrderInfo(state, provider) {
  10418. state.orderInfo = provider;
  10419. }
  10420. };
  10421. var getters = {};
  10422. var _default = {
  10423. namespaced: true,
  10424. state: state,
  10425. mutations: mutations,
  10426. getters: getters
  10427. };
  10428. exports.default = _default;
  10429. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10430. /***/ }),
  10431. /***/ 292:
  10432. /*!***************************************!*\
  10433. !*** D:/工作/项目2/亲家母/qjm/api/wallet.js ***!
  10434. \***************************************/
  10435. /*! no static exports found */
  10436. /***/ (function(module, exports, __webpack_require__) {
  10437. "use strict";
  10438. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10439. Object.defineProperty(exports, "__esModule", {
  10440. value: true
  10441. });
  10442. exports.aliInfo = aliInfo;
  10443. exports.balance = balance;
  10444. exports.bankInfo = bankInfo;
  10445. exports.extract = extract;
  10446. exports.extractBank = extractBank;
  10447. exports.extractCash = extractCash;
  10448. exports.rechargeRoutine = rechargeRoutine;
  10449. exports.setAliInfo = setAliInfo;
  10450. exports.setBankInfo = setBankInfo;
  10451. exports.spreadCommission = spreadCommission;
  10452. exports.userBalance = userBalance;
  10453. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  10454. // 获取用户消费记录
  10455. function spreadCommission(data, state) {
  10456. return (0, _request.default)({
  10457. url: '/api/spread/commission/' + state,
  10458. method: 'get',
  10459. data: data
  10460. });
  10461. }
  10462. // 获取账户余额
  10463. function userBalance(data) {
  10464. return (0, _request.default)({
  10465. url: '/api/user/balance',
  10466. method: 'get',
  10467. data: data
  10468. });
  10469. }
  10470. // 提现
  10471. function extractCash(data) {
  10472. return (0, _request.default)({
  10473. url: '/api/extract/cash',
  10474. method: 'post',
  10475. data: data
  10476. });
  10477. }
  10478. // 提现信息
  10479. function extractBank(data) {
  10480. return (0, _request.default)({
  10481. url: '/api/extract/bank',
  10482. method: 'get',
  10483. data: data
  10484. });
  10485. }
  10486. // 小程序充值
  10487. function rechargeRoutine(data) {
  10488. return (0, _request.default)({
  10489. url: '/api/recharge/routine',
  10490. method: 'post',
  10491. data: data
  10492. });
  10493. }
  10494. // 获取提现支付宝账号
  10495. function aliInfo(data) {
  10496. return (0, _request.default)({
  10497. url: '/api/ali/info',
  10498. method: 'get',
  10499. data: data
  10500. });
  10501. }
  10502. //获取默认银行卡账号
  10503. function bankInfo(data) {
  10504. return (0, _request.default)({
  10505. url: '/api/bank/info',
  10506. method: 'get',
  10507. data: data
  10508. });
  10509. }
  10510. // 保存提现支付宝账号
  10511. function setAliInfo(data) {
  10512. return (0, _request.default)({
  10513. url: '/api/ali/edit',
  10514. method: 'post',
  10515. data: data
  10516. });
  10517. }
  10518. //保存默认银行卡账号
  10519. function setBankInfo(data) {
  10520. return (0, _request.default)({
  10521. url: '/api/bank/edit',
  10522. method: 'post',
  10523. data: data
  10524. });
  10525. }
  10526. // 账户余额
  10527. function balance(data) {
  10528. return (0, _request.default)({
  10529. url: '/api/user/balance',
  10530. method: 'get',
  10531. data: data
  10532. });
  10533. }
  10534. // 提现列表
  10535. function extract(data) {
  10536. return (0, _request.default)({
  10537. url: '/api/extract/user',
  10538. method: 'get',
  10539. data: data
  10540. });
  10541. }
  10542. /***/ }),
  10543. /***/ 3:
  10544. /*!***********************************!*\
  10545. !*** (webpack)/buildin/global.js ***!
  10546. \***********************************/
  10547. /*! no static exports found */
  10548. /***/ (function(module, exports) {
  10549. var g;
  10550. // This works in non-strict mode
  10551. g = (function() {
  10552. return this;
  10553. })();
  10554. try {
  10555. // This works if eval is allowed (see CSP)
  10556. g = g || new Function("return this")();
  10557. } catch (e) {
  10558. // This works if the window reference is available
  10559. if (typeof window === "object") g = window;
  10560. }
  10561. // g can still be undefined, but nothing to do about it...
  10562. // We return undefined, instead of nothing here, so it's
  10563. // easier to handle this case. if(!global) { ...}
  10564. module.exports = g;
  10565. /***/ }),
  10566. /***/ 35:
  10567. /*!**********************************************************************************************************!*\
  10568. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  10569. \**********************************************************************************************************/
  10570. /*! exports provided: default */
  10571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10572. "use strict";
  10573. __webpack_require__.r(__webpack_exports__);
  10574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  10575. /* globals __VUE_SSR_CONTEXT__ */
  10576. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  10577. // This module is a runtime utility for cleaner component module output and will
  10578. // be included in the final webpack user bundle.
  10579. function normalizeComponent (
  10580. scriptExports,
  10581. render,
  10582. staticRenderFns,
  10583. functionalTemplate,
  10584. injectStyles,
  10585. scopeId,
  10586. moduleIdentifier, /* server only */
  10587. shadowMode, /* vue-cli only */
  10588. components, // fixed by xxxxxx auto components
  10589. renderjs // fixed by xxxxxx renderjs
  10590. ) {
  10591. // Vue.extend constructor export interop
  10592. var options = typeof scriptExports === 'function'
  10593. ? scriptExports.options
  10594. : scriptExports
  10595. // fixed by xxxxxx auto components
  10596. if (components) {
  10597. if (!options.components) {
  10598. options.components = {}
  10599. }
  10600. var hasOwn = Object.prototype.hasOwnProperty
  10601. for (var name in components) {
  10602. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  10603. options.components[name] = components[name]
  10604. }
  10605. }
  10606. }
  10607. // fixed by xxxxxx renderjs
  10608. if (renderjs) {
  10609. if(typeof renderjs.beforeCreate === 'function'){
  10610. renderjs.beforeCreate = [renderjs.beforeCreate]
  10611. }
  10612. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  10613. this[renderjs.__module] = this
  10614. });
  10615. (options.mixins || (options.mixins = [])).push(renderjs)
  10616. }
  10617. // render functions
  10618. if (render) {
  10619. options.render = render
  10620. options.staticRenderFns = staticRenderFns
  10621. options._compiled = true
  10622. }
  10623. // functional template
  10624. if (functionalTemplate) {
  10625. options.functional = true
  10626. }
  10627. // scopedId
  10628. if (scopeId) {
  10629. options._scopeId = 'data-v-' + scopeId
  10630. }
  10631. var hook
  10632. if (moduleIdentifier) { // server build
  10633. hook = function (context) {
  10634. // 2.3 injection
  10635. context =
  10636. context || // cached call
  10637. (this.$vnode && this.$vnode.ssrContext) || // stateful
  10638. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  10639. // 2.2 with runInNewContext: true
  10640. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  10641. context = __VUE_SSR_CONTEXT__
  10642. }
  10643. // inject component styles
  10644. if (injectStyles) {
  10645. injectStyles.call(this, context)
  10646. }
  10647. // register component module identifier for async chunk inferrence
  10648. if (context && context._registeredComponents) {
  10649. context._registeredComponents.add(moduleIdentifier)
  10650. }
  10651. }
  10652. // used by ssr in case component is cached and beforeCreate
  10653. // never gets called
  10654. options._ssrRegister = hook
  10655. } else if (injectStyles) {
  10656. hook = shadowMode
  10657. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  10658. : injectStyles
  10659. }
  10660. if (hook) {
  10661. if (options.functional) {
  10662. // for template-only hot-reload because in that case the render fn doesn't
  10663. // go through the normalizer
  10664. options._injectStyles = hook
  10665. // register for functioal component in vue file
  10666. var originalRender = options.render
  10667. options.render = function renderWithStyleInjection (h, context) {
  10668. hook.call(context)
  10669. return originalRender(h, context)
  10670. }
  10671. } else {
  10672. // inject component registration as beforeCreate hook
  10673. var existing = options.beforeCreate
  10674. options.beforeCreate = existing
  10675. ? [].concat(existing, hook)
  10676. : [hook]
  10677. }
  10678. }
  10679. return {
  10680. exports: scriptExports,
  10681. options: options
  10682. }
  10683. }
  10684. /***/ }),
  10685. /***/ 36:
  10686. /*!*******************************************!*\
  10687. !*** D:/工作/项目2/亲家母/qjm/uview-ui/index.js ***!
  10688. \*******************************************/
  10689. /*! no static exports found */
  10690. /***/ (function(module, exports, __webpack_require__) {
  10691. "use strict";
  10692. /* WEBPACK VAR INJECTION */(function(uni) {
  10693. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10694. Object.defineProperty(exports, "__esModule", {
  10695. value: true
  10696. });
  10697. exports.default = void 0;
  10698. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 37));
  10699. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 38));
  10700. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 42));
  10701. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 43));
  10702. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 47));
  10703. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 48));
  10704. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 49));
  10705. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 50));
  10706. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 51));
  10707. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 52));
  10708. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 53));
  10709. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 40));
  10710. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 39));
  10711. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 54));
  10712. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 41));
  10713. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 55));
  10714. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 56));
  10715. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 57));
  10716. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 58));
  10717. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 59));
  10718. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 60);
  10719. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 61));
  10720. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 62));
  10721. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 63));
  10722. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 64));
  10723. // 引入全局mixin
  10724. // 引入关于是否mixin集成小程序分享的配置
  10725. // import wxshare from './libs/mixin/mpShare.js'
  10726. // 全局挂载引入http相关请求拦截插件
  10727. function wranning(str) {
  10728. // 开发环境进行信息输出,主要是一些报错信息
  10729. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  10730. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  10731. if (true) {
  10732. console.warn(str);
  10733. }
  10734. }
  10735. // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  10736. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  10737. // let vuexStore = {};
  10738. // try {
  10739. // vuexStore = require("@/store/$u.mixin.js");
  10740. // } catch (e) {
  10741. // //TODO handle the exception
  10742. // }
  10743. // post类型对象参数转为get类型url参数
  10744. var $u = {
  10745. queryParams: _queryParams.default,
  10746. route: _route.default,
  10747. timeFormat: _timeFormat.default,
  10748. date: _timeFormat.default,
  10749. // 另名date
  10750. timeFrom: _timeFrom.default,
  10751. colorGradient: _colorGradient.default.colorGradient,
  10752. colorToRgba: _colorGradient.default.colorToRgba,
  10753. guid: _guid.default,
  10754. color: _color.default,
  10755. sys: _sys.sys,
  10756. os: _sys.os,
  10757. type2icon: _type2icon.default,
  10758. randomArray: _randomArray.default,
  10759. wranning: wranning,
  10760. get: _request.default.get,
  10761. post: _request.default.post,
  10762. put: _request.default.put,
  10763. 'delete': _request.default.delete,
  10764. hexToRgb: _colorGradient.default.hexToRgb,
  10765. rgbToHex: _colorGradient.default.rgbToHex,
  10766. test: _test.default,
  10767. random: _random.default,
  10768. deepClone: _deepClone.default,
  10769. deepMerge: _deepMerge.default,
  10770. getParent: _getParent.default,
  10771. $parent: _$parent.default,
  10772. addUnit: _addUnit.default,
  10773. trim: _trim.default,
  10774. type: ['primary', 'success', 'error', 'warning', 'info'],
  10775. http: _request.default,
  10776. toast: _toast.default,
  10777. config: _config.default,
  10778. // uView配置信息相关,比如版本号
  10779. zIndex: _zIndex.default,
  10780. debounce: _debounce.default,
  10781. throttle: _throttle.default
  10782. };
  10783. // $u挂载到uni对象上
  10784. uni.$u = $u;
  10785. var install = function install(Vue) {
  10786. Vue.mixin(_mixin.default);
  10787. if (Vue.prototype.openShare) {
  10788. Vue.mixin(mpShare);
  10789. }
  10790. // Vue.mixin(vuexStore);
  10791. // 时间格式化,同时两个名称,date和timeFormat
  10792. Vue.filter('timeFormat', function (timestamp, format) {
  10793. return (0, _timeFormat.default)(timestamp, format);
  10794. });
  10795. Vue.filter('date', function (timestamp, format) {
  10796. return (0, _timeFormat.default)(timestamp, format);
  10797. });
  10798. // 将多久以前的方法,注入到全局过滤器
  10799. Vue.filter('timeFrom', function (timestamp, format) {
  10800. return (0, _timeFrom.default)(timestamp, format);
  10801. });
  10802. Vue.prototype.$u = $u;
  10803. };
  10804. var _default = {
  10805. install: install
  10806. };
  10807. exports.default = _default;
  10808. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10809. /***/ }),
  10810. /***/ 37:
  10811. /*!******************************************************!*\
  10812. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/mixin/mixin.js ***!
  10813. \******************************************************/
  10814. /*! no static exports found */
  10815. /***/ (function(module, exports, __webpack_require__) {
  10816. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  10817. data: function data() {
  10818. return {};
  10819. },
  10820. onLoad: function onLoad() {
  10821. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  10822. this.$u.getRect = this.$uGetRect;
  10823. },
  10824. methods: {
  10825. // 查询节点信息
  10826. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  10827. // 解决办法为在组件根部再套一个没有任何作用的view元素
  10828. $uGetRect: function $uGetRect(selector, all) {
  10829. var _this = this;
  10830. return new Promise(function (resolve) {
  10831. uni.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  10832. if (all && Array.isArray(rect) && rect.length) {
  10833. resolve(rect);
  10834. }
  10835. if (!all && rect) {
  10836. resolve(rect);
  10837. }
  10838. }).exec();
  10839. });
  10840. },
  10841. getParentData: function getParentData() {
  10842. var _this2 = this;
  10843. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  10844. // 避免在created中去定义parent变量
  10845. if (!this.parent) this.parent = false;
  10846. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  10847. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  10848. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  10849. this.parent = this.$u.$parent.call(this, parentName);
  10850. if (this.parent) {
  10851. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  10852. Object.keys(this.parentData).map(function (key) {
  10853. _this2.parentData[key] = _this2.parent[key];
  10854. });
  10855. }
  10856. },
  10857. // 阻止事件冒泡
  10858. preventEvent: function preventEvent(e) {
  10859. e && e.stopPropagation && e.stopPropagation();
  10860. }
  10861. },
  10862. onReachBottom: function onReachBottom() {
  10863. uni.$emit('uOnReachBottom');
  10864. },
  10865. beforeDestroy: function beforeDestroy() {
  10866. var _this3 = this;
  10867. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  10868. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  10869. if (this.parent && uni.$u.test.array(this.parent.children)) {
  10870. // 组件销毁时,移除父组件中的children数组中对应的实例
  10871. var childrenList = this.parent.children;
  10872. childrenList.map(function (child, index) {
  10873. // 如果相等,则移除
  10874. if (child === _this3) {
  10875. childrenList.splice(index, 1);
  10876. }
  10877. });
  10878. }
  10879. }
  10880. };
  10881. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10882. /***/ }),
  10883. /***/ 38:
  10884. /*!********************************************************!*\
  10885. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/request/index.js ***!
  10886. \********************************************************/
  10887. /*! no static exports found */
  10888. /***/ (function(module, exports, __webpack_require__) {
  10889. "use strict";
  10890. /* WEBPACK VAR INJECTION */(function(uni) {
  10891. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10892. Object.defineProperty(exports, "__esModule", {
  10893. value: true
  10894. });
  10895. exports.default = void 0;
  10896. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10897. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10898. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 39));
  10899. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 41));
  10900. var Request = /*#__PURE__*/function () {
  10901. function Request() {
  10902. var _this = this;
  10903. (0, _classCallCheck2.default)(this, Request);
  10904. this.config = {
  10905. baseUrl: '',
  10906. // 请求的根域名
  10907. // 默认的请求头
  10908. header: {},
  10909. method: 'POST',
  10910. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  10911. dataType: 'json',
  10912. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  10913. responseType: 'text',
  10914. showLoading: true,
  10915. // 是否显示请求中的loading
  10916. loadingText: '请求中...',
  10917. loadingTime: 800,
  10918. // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  10919. timer: null,
  10920. // 定时器
  10921. originalData: false,
  10922. // 是否在拦截器中返回服务端的原始数据,见文档说明
  10923. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  10924. };
  10925. // 拦截器
  10926. this.interceptor = {
  10927. // 请求前的拦截
  10928. request: null,
  10929. // 请求后的拦截
  10930. response: null
  10931. };
  10932. // get请求
  10933. this.get = function (url) {
  10934. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10935. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10936. return _this.request({
  10937. method: 'GET',
  10938. url: url,
  10939. header: header,
  10940. data: data
  10941. });
  10942. };
  10943. // post请求
  10944. this.post = function (url) {
  10945. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10946. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10947. return _this.request({
  10948. url: url,
  10949. method: 'POST',
  10950. header: header,
  10951. data: data
  10952. });
  10953. };
  10954. // put请求,不支持支付宝小程序(HX2.6.15)
  10955. this.put = function (url) {
  10956. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10957. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10958. return _this.request({
  10959. url: url,
  10960. method: 'PUT',
  10961. header: header,
  10962. data: data
  10963. });
  10964. };
  10965. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  10966. this.delete = function (url) {
  10967. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10968. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10969. return _this.request({
  10970. url: url,
  10971. method: 'DELETE',
  10972. header: header,
  10973. data: data
  10974. });
  10975. };
  10976. }
  10977. (0, _createClass2.default)(Request, [{
  10978. key: "setConfig",
  10979. value:
  10980. // 设置全局默认配置
  10981. function setConfig(customConfig) {
  10982. // 深度合并对象,否则会造成对象深层属性丢失
  10983. this.config = (0, _deepMerge.default)(this.config, customConfig);
  10984. }
  10985. // 主要请求部分
  10986. }, {
  10987. key: "request",
  10988. value: function request() {
  10989. var _this2 = this;
  10990. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10991. // 检查请求拦截
  10992. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  10993. var tmpConfig = {};
  10994. var interceptorRequest = this.interceptor.request(options);
  10995. if (interceptorRequest === false) {
  10996. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  10997. return new Promise(function () {});
  10998. }
  10999. this.options = interceptorRequest;
  11000. }
  11001. options.dataType = options.dataType || this.config.dataType;
  11002. options.responseType = options.responseType || this.config.responseType;
  11003. options.url = options.url || '';
  11004. options.params = options.params || {};
  11005. options.header = Object.assign({}, this.config.header, options.header);
  11006. options.method = options.method || this.config.method;
  11007. return new Promise(function (resolve, reject) {
  11008. options.complete = function (response) {
  11009. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  11010. uni.hideLoading();
  11011. // 清除定时器,如果请求回来了,就无需loading
  11012. clearTimeout(_this2.config.timer);
  11013. _this2.config.timer = null;
  11014. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  11015. if (_this2.config.originalData) {
  11016. // 判断是否存在拦截器
  11017. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  11018. var resInterceptors = _this2.interceptor.response(response);
  11019. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  11020. if (resInterceptors !== false) {
  11021. resolve(resInterceptors);
  11022. } else {
  11023. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  11024. reject(response);
  11025. }
  11026. } else {
  11027. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  11028. resolve(response);
  11029. }
  11030. } else {
  11031. if (response.statusCode == 200) {
  11032. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  11033. var _resInterceptors = _this2.interceptor.response(response.data);
  11034. if (_resInterceptors !== false) {
  11035. resolve(_resInterceptors);
  11036. } else {
  11037. reject(response.data);
  11038. }
  11039. } else {
  11040. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  11041. resolve(response.data);
  11042. }
  11043. } else {
  11044. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  11045. // if(response.errMsg) {
  11046. // uni.showModal({
  11047. // title: response.errMsg
  11048. // });
  11049. // }
  11050. reject(response);
  11051. }
  11052. }
  11053. };
  11054. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  11055. options.url = _test.default.url(options.url) ? options.url : _this2.config.baseUrl + (options.url.indexOf('/') == 0 ? options.url : '/' + options.url);
  11056. // 是否显示loading
  11057. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  11058. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  11059. if (_this2.config.showLoading && !_this2.config.timer) {
  11060. _this2.config.timer = setTimeout(function () {
  11061. uni.showLoading({
  11062. title: _this2.config.loadingText,
  11063. mask: _this2.config.loadingMask
  11064. });
  11065. _this2.config.timer = null;
  11066. }, _this2.config.loadingTime);
  11067. }
  11068. uni.request(options);
  11069. });
  11070. // .catch(res => {
  11071. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  11072. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  11073. // return new Promise(()=>{});
  11074. // })
  11075. }
  11076. }]);
  11077. return Request;
  11078. }();
  11079. var _default = new Request();
  11080. exports.default = _default;
  11081. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11082. /***/ }),
  11083. /***/ 39:
  11084. /*!*************************************************************!*\
  11085. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/deepMerge.js ***!
  11086. \*************************************************************/
  11087. /*! no static exports found */
  11088. /***/ (function(module, exports, __webpack_require__) {
  11089. "use strict";
  11090. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11091. Object.defineProperty(exports, "__esModule", {
  11092. value: true
  11093. });
  11094. exports.default = void 0;
  11095. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11096. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 40));
  11097. // JS对象深度合并
  11098. function deepMerge() {
  11099. var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11100. var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11101. target = (0, _deepClone.default)(target);
  11102. if ((0, _typeof2.default)(target) !== 'object' || (0, _typeof2.default)(source) !== 'object') return false;
  11103. for (var prop in source) {
  11104. if (!source.hasOwnProperty(prop)) continue;
  11105. if (prop in target) {
  11106. if ((0, _typeof2.default)(target[prop]) !== 'object') {
  11107. target[prop] = source[prop];
  11108. } else {
  11109. if ((0, _typeof2.default)(source[prop]) !== 'object') {
  11110. target[prop] = source[prop];
  11111. } else {
  11112. if (target[prop].concat && source[prop].concat) {
  11113. target[prop] = target[prop].concat(source[prop]);
  11114. } else {
  11115. target[prop] = deepMerge(target[prop], source[prop]);
  11116. }
  11117. }
  11118. }
  11119. } else {
  11120. target[prop] = source[prop];
  11121. }
  11122. }
  11123. return target;
  11124. }
  11125. var _default = deepMerge;
  11126. exports.default = _default;
  11127. /***/ }),
  11128. /***/ 4:
  11129. /*!**********************************************************************!*\
  11130. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  11131. \**********************************************************************/
  11132. /*! no static exports found */
  11133. /***/ (function(module, exports) {
  11134. function _interopRequireDefault(obj) {
  11135. return obj && obj.__esModule ? obj : {
  11136. "default": obj
  11137. };
  11138. }
  11139. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11140. /***/ }),
  11141. /***/ 40:
  11142. /*!*************************************************************!*\
  11143. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/deepClone.js ***!
  11144. \*************************************************************/
  11145. /*! no static exports found */
  11146. /***/ (function(module, exports, __webpack_require__) {
  11147. "use strict";
  11148. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11149. Object.defineProperty(exports, "__esModule", {
  11150. value: true
  11151. });
  11152. exports.default = void 0;
  11153. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11154. // 判断arr是否为一个数组,返回一个bool值
  11155. function isArray(arr) {
  11156. return Object.prototype.toString.call(arr) === '[object Array]';
  11157. }
  11158. // 深度克隆
  11159. function deepClone(obj) {
  11160. // 对常见的“非”值,直接返回原来值
  11161. if ([null, undefined, NaN, false].includes(obj)) return obj;
  11162. if ((0, _typeof2.default)(obj) !== "object" && typeof obj !== 'function') {
  11163. //原始类型直接返回
  11164. return obj;
  11165. }
  11166. var o = isArray(obj) ? [] : {};
  11167. for (var i in obj) {
  11168. if (obj.hasOwnProperty(i)) {
  11169. o[i] = (0, _typeof2.default)(obj[i]) === "object" ? deepClone(obj[i]) : obj[i];
  11170. }
  11171. }
  11172. return o;
  11173. }
  11174. var _default = deepClone;
  11175. exports.default = _default;
  11176. /***/ }),
  11177. /***/ 41:
  11178. /*!********************************************************!*\
  11179. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/test.js ***!
  11180. \********************************************************/
  11181. /*! no static exports found */
  11182. /***/ (function(module, exports, __webpack_require__) {
  11183. "use strict";
  11184. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11185. Object.defineProperty(exports, "__esModule", {
  11186. value: true
  11187. });
  11188. exports.default = void 0;
  11189. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11190. /**
  11191. * 验证电子邮箱格式
  11192. */
  11193. function email(value) {
  11194. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  11195. }
  11196. /**
  11197. * 验证手机格式
  11198. */
  11199. function mobile(value) {
  11200. return /^1[3-9]\d{9}$/.test(value);
  11201. }
  11202. /**
  11203. * 验证URL格式
  11204. */
  11205. function url(value) {
  11206. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  11207. }
  11208. /**
  11209. * 验证日期格式
  11210. */
  11211. function date(value) {
  11212. return !/Invalid|NaN/.test(new Date(value).toString());
  11213. }
  11214. /**
  11215. * 验证ISO类型的日期格式
  11216. */
  11217. function dateISO(value) {
  11218. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  11219. }
  11220. /**
  11221. * 验证十进制数字
  11222. */
  11223. function number(value) {
  11224. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  11225. }
  11226. /**
  11227. * 验证整数
  11228. */
  11229. function digits(value) {
  11230. return /^\d+$/.test(value);
  11231. }
  11232. /**
  11233. * 验证身份证号码
  11234. */
  11235. function idCard(value) {
  11236. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value);
  11237. }
  11238. /**
  11239. * 是否车牌号
  11240. */
  11241. function carNo(value) {
  11242. // 新能源车牌
  11243. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  11244. // 旧车牌
  11245. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  11246. if (value.length === 7) {
  11247. return creg.test(value);
  11248. } else if (value.length === 8) {
  11249. return xreg.test(value);
  11250. } else {
  11251. return false;
  11252. }
  11253. }
  11254. /**
  11255. * 金额,只允许2位小数
  11256. */
  11257. function amount(value) {
  11258. //金额,只允许保留两位小数
  11259. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  11260. }
  11261. /**
  11262. * 中文
  11263. */
  11264. function chinese(value) {
  11265. var reg = /^[\u4e00-\u9fa5]+$/gi;
  11266. return reg.test(value);
  11267. }
  11268. /**
  11269. * 只能输入字母
  11270. */
  11271. function letter(value) {
  11272. return /^[a-zA-Z]*$/.test(value);
  11273. }
  11274. /**
  11275. * 只能是字母或者数字
  11276. */
  11277. function enOrNum(value) {
  11278. //英文或者数字
  11279. var reg = /^[0-9a-zA-Z]*$/g;
  11280. return reg.test(value);
  11281. }
  11282. /**
  11283. * 验证是否包含某个值
  11284. */
  11285. function contains(value, param) {
  11286. return value.indexOf(param) >= 0;
  11287. }
  11288. /**
  11289. * 验证一个值范围[min, max]
  11290. */
  11291. function range(value, param) {
  11292. return value >= param[0] && value <= param[1];
  11293. }
  11294. /**
  11295. * 验证一个长度范围[min, max]
  11296. */
  11297. function rangeLength(value, param) {
  11298. return value.length >= param[0] && value.length <= param[1];
  11299. }
  11300. /**
  11301. * 是否固定电话
  11302. */
  11303. function landline(value) {
  11304. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  11305. return reg.test(value);
  11306. }
  11307. /**
  11308. * 判断是否为空
  11309. */
  11310. function empty(value) {
  11311. switch ((0, _typeof2.default)(value)) {
  11312. case 'undefined':
  11313. return true;
  11314. case 'string':
  11315. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  11316. break;
  11317. case 'boolean':
  11318. if (!value) return true;
  11319. break;
  11320. case 'number':
  11321. if (0 === value || isNaN(value)) return true;
  11322. break;
  11323. case 'object':
  11324. if (null === value || value.length === 0) return true;
  11325. for (var i in value) {
  11326. return false;
  11327. }
  11328. return true;
  11329. }
  11330. return false;
  11331. }
  11332. /**
  11333. * 是否json字符串
  11334. */
  11335. function jsonString(value) {
  11336. if (typeof value == 'string') {
  11337. try {
  11338. var obj = JSON.parse(value);
  11339. if ((0, _typeof2.default)(obj) == 'object' && obj) {
  11340. return true;
  11341. } else {
  11342. return false;
  11343. }
  11344. } catch (e) {
  11345. return false;
  11346. }
  11347. }
  11348. return false;
  11349. }
  11350. /**
  11351. * 是否数组
  11352. */
  11353. function array(value) {
  11354. if (typeof Array.isArray === "function") {
  11355. return Array.isArray(value);
  11356. } else {
  11357. return Object.prototype.toString.call(value) === "[object Array]";
  11358. }
  11359. }
  11360. /**
  11361. * 是否对象
  11362. */
  11363. function object(value) {
  11364. return Object.prototype.toString.call(value) === '[object Object]';
  11365. }
  11366. /**
  11367. * 是否短信验证码
  11368. */
  11369. function code(value) {
  11370. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  11371. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  11372. }
  11373. var _default = {
  11374. email: email,
  11375. mobile: mobile,
  11376. url: url,
  11377. date: date,
  11378. dateISO: dateISO,
  11379. number: number,
  11380. digits: digits,
  11381. idCard: idCard,
  11382. carNo: carNo,
  11383. amount: amount,
  11384. chinese: chinese,
  11385. letter: letter,
  11386. enOrNum: enOrNum,
  11387. contains: contains,
  11388. range: range,
  11389. rangeLength: rangeLength,
  11390. empty: empty,
  11391. isEmpty: empty,
  11392. jsonString: jsonString,
  11393. landline: landline,
  11394. object: object,
  11395. array: array,
  11396. code: code
  11397. };
  11398. exports.default = _default;
  11399. /***/ }),
  11400. /***/ 42:
  11401. /*!***************************************************************!*\
  11402. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/queryParams.js ***!
  11403. \***************************************************************/
  11404. /*! no static exports found */
  11405. /***/ (function(module, exports, __webpack_require__) {
  11406. "use strict";
  11407. Object.defineProperty(exports, "__esModule", {
  11408. value: true
  11409. });
  11410. exports.default = void 0;
  11411. /**
  11412. * 对象转url参数
  11413. * @param {*} data,对象
  11414. * @param {*} isPrefix,是否自动加上"?"
  11415. */
  11416. function queryParams() {
  11417. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11418. var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11419. var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  11420. var prefix = isPrefix ? '?' : '';
  11421. var _result = [];
  11422. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
  11423. var _loop = function _loop(key) {
  11424. var value = data[key];
  11425. // 去掉为空的参数
  11426. if (['', undefined, null].indexOf(value) >= 0) {
  11427. return "continue";
  11428. }
  11429. // 如果值为数组,另行处理
  11430. if (value.constructor === Array) {
  11431. // e.g. {ids: [1, 2, 3]}
  11432. switch (arrayFormat) {
  11433. case 'indices':
  11434. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  11435. for (var i = 0; i < value.length; i++) {
  11436. _result.push(key + '[' + i + ']=' + value[i]);
  11437. }
  11438. break;
  11439. case 'brackets':
  11440. // 结果: ids[]=1&ids[]=2&ids[]=3
  11441. value.forEach(function (_value) {
  11442. _result.push(key + '[]=' + _value);
  11443. });
  11444. break;
  11445. case 'repeat':
  11446. // 结果: ids=1&ids=2&ids=3
  11447. value.forEach(function (_value) {
  11448. _result.push(key + '=' + _value);
  11449. });
  11450. break;
  11451. case 'comma':
  11452. // 结果: ids=1,2,3
  11453. var commaStr = "";
  11454. value.forEach(function (_value) {
  11455. commaStr += (commaStr ? "," : "") + _value;
  11456. });
  11457. _result.push(key + '=' + commaStr);
  11458. break;
  11459. default:
  11460. value.forEach(function (_value) {
  11461. _result.push(key + '[]=' + _value);
  11462. });
  11463. }
  11464. } else {
  11465. _result.push(key + '=' + value);
  11466. }
  11467. };
  11468. for (var key in data) {
  11469. var _ret = _loop(key);
  11470. if (_ret === "continue") continue;
  11471. }
  11472. return _result.length ? prefix + _result.join('&') : '';
  11473. }
  11474. var _default = queryParams;
  11475. exports.default = _default;
  11476. /***/ }),
  11477. /***/ 43:
  11478. /*!*********************************************************!*\
  11479. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/route.js ***!
  11480. \*********************************************************/
  11481. /*! no static exports found */
  11482. /***/ (function(module, exports, __webpack_require__) {
  11483. "use strict";
  11484. /* WEBPACK VAR INJECTION */(function(uni) {
  11485. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11486. Object.defineProperty(exports, "__esModule", {
  11487. value: true
  11488. });
  11489. exports.default = void 0;
  11490. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  11491. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  11492. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11493. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11494. /**
  11495. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  11496. * 并且带有路由拦截功能
  11497. */
  11498. var Router = /*#__PURE__*/function () {
  11499. function Router() {
  11500. (0, _classCallCheck2.default)(this, Router);
  11501. // 原始属性定义
  11502. this.config = {
  11503. type: 'navigateTo',
  11504. url: '',
  11505. delta: 1,
  11506. // navigateBack页面后退时,回退的层数
  11507. params: {},
  11508. // 传递的参数
  11509. animationType: 'pop-in',
  11510. // 窗口动画,只在APP有效
  11511. animationDuration: 300,
  11512. // 窗口动画持续时间,单位毫秒,只在APP有效
  11513. intercept: false // 是否需要拦截
  11514. };
  11515. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  11516. // 这里在构造函数中进行this绑定
  11517. this.route = this.route.bind(this);
  11518. }
  11519. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  11520. (0, _createClass2.default)(Router, [{
  11521. key: "addRootPath",
  11522. value: function addRootPath(url) {
  11523. return url[0] === '/' ? url : "/".concat(url);
  11524. }
  11525. // 整合路由参数
  11526. }, {
  11527. key: "mixinParam",
  11528. value: function mixinParam(url, params) {
  11529. url = url && this.addRootPath(url);
  11530. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  11531. // 如果有url中有get参数,转换后无需带上"?"
  11532. var query = '';
  11533. if (/.*\/.*\?.*=.*/.test(url)) {
  11534. // object对象转为get类型的参数
  11535. query = uni.$u.queryParams(params, false);
  11536. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  11537. return url += "&" + query;
  11538. } else {
  11539. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  11540. query = uni.$u.queryParams(params);
  11541. return url += query;
  11542. }
  11543. }
  11544. // 对外的方法名称
  11545. }, {
  11546. key: "route",
  11547. value: function () {
  11548. var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  11549. var options,
  11550. params,
  11551. mergeConfig,
  11552. isNext,
  11553. _args = arguments;
  11554. return _regenerator.default.wrap(function _callee$(_context) {
  11555. while (1) {
  11556. switch (_context.prev = _context.next) {
  11557. case 0:
  11558. options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
  11559. params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  11560. // 合并用户的配置和内部的默认配置
  11561. mergeConfig = {};
  11562. if (typeof options === 'string') {
  11563. // 如果options为字符串,则为route(url, params)的形式
  11564. mergeConfig.url = this.mixinParam(options, params);
  11565. mergeConfig.type = 'navigateTo';
  11566. } else {
  11567. mergeConfig = uni.$u.deepClone(options, this.config);
  11568. // 否则正常使用mergeConfig中的url和params进行拼接
  11569. mergeConfig.url = this.mixinParam(options.url, options.params);
  11570. }
  11571. if (params.intercept) {
  11572. this.config.intercept = params.intercept;
  11573. }
  11574. // params参数也带给拦截器
  11575. mergeConfig.params = params;
  11576. // 合并内外部参数
  11577. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  11578. // 判断用户是否定义了拦截器
  11579. if (!(typeof uni.$u.routeIntercept === 'function')) {
  11580. _context.next = 14;
  11581. break;
  11582. }
  11583. _context.next = 10;
  11584. return new Promise(function (resolve, reject) {
  11585. uni.$u.routeIntercept(mergeConfig, resolve);
  11586. });
  11587. case 10:
  11588. isNext = _context.sent;
  11589. // 如果isNext为true,则执行路由跳转
  11590. isNext && this.openPage(mergeConfig);
  11591. _context.next = 15;
  11592. break;
  11593. case 14:
  11594. this.openPage(mergeConfig);
  11595. case 15:
  11596. case "end":
  11597. return _context.stop();
  11598. }
  11599. }
  11600. }, _callee, this);
  11601. }));
  11602. function route() {
  11603. return _route.apply(this, arguments);
  11604. }
  11605. return route;
  11606. }() // 执行路由跳转
  11607. }, {
  11608. key: "openPage",
  11609. value: function openPage(config) {
  11610. // 解构参数
  11611. var url = config.url,
  11612. type = config.type,
  11613. delta = config.delta,
  11614. animationType = config.animationType,
  11615. animationDuration = config.animationDuration;
  11616. if (config.type == 'navigateTo' || config.type == 'to') {
  11617. uni.navigateTo({
  11618. url: url,
  11619. animationType: animationType,
  11620. animationDuration: animationDuration
  11621. });
  11622. }
  11623. if (config.type == 'redirectTo' || config.type == 'redirect') {
  11624. uni.redirectTo({
  11625. url: url
  11626. });
  11627. }
  11628. if (config.type == 'switchTab' || config.type == 'tab') {
  11629. uni.switchTab({
  11630. url: url
  11631. });
  11632. }
  11633. if (config.type == 'reLaunch' || config.type == 'launch') {
  11634. uni.reLaunch({
  11635. url: url
  11636. });
  11637. }
  11638. if (config.type == 'navigateBack' || config.type == 'back') {
  11639. uni.navigateBack({
  11640. delta: delta
  11641. });
  11642. }
  11643. }
  11644. }]);
  11645. return Router;
  11646. }();
  11647. var _default = new Router().route;
  11648. exports.default = _default;
  11649. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11650. /***/ }),
  11651. /***/ 44:
  11652. /*!************************************************************************************************!*\
  11653. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  11654. \************************************************************************************************/
  11655. /*! no static exports found */
  11656. /***/ (function(module, exports, __webpack_require__) {
  11657. // TODO(Babel 8): Remove this file.
  11658. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 45)();
  11659. module.exports = runtime;
  11660. /***/ }),
  11661. /***/ 45:
  11662. /*!*******************************************************************!*\
  11663. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  11664. \*******************************************************************/
  11665. /*! no static exports found */
  11666. /***/ (function(module, exports, __webpack_require__) {
  11667. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  11668. function _regeneratorRuntime() {
  11669. "use strict";
  11670. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  11671. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  11672. return exports;
  11673. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11674. var exports = {},
  11675. Op = Object.prototype,
  11676. hasOwn = Op.hasOwnProperty,
  11677. defineProperty = Object.defineProperty || function (obj, key, desc) {
  11678. obj[key] = desc.value;
  11679. },
  11680. $Symbol = "function" == typeof Symbol ? Symbol : {},
  11681. iteratorSymbol = $Symbol.iterator || "@@iterator",
  11682. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  11683. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  11684. function define(obj, key, value) {
  11685. return Object.defineProperty(obj, key, {
  11686. value: value,
  11687. enumerable: !0,
  11688. configurable: !0,
  11689. writable: !0
  11690. }), obj[key];
  11691. }
  11692. try {
  11693. define({}, "");
  11694. } catch (err) {
  11695. define = function define(obj, key, value) {
  11696. return obj[key] = value;
  11697. };
  11698. }
  11699. function wrap(innerFn, outerFn, self, tryLocsList) {
  11700. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  11701. generator = Object.create(protoGenerator.prototype),
  11702. context = new Context(tryLocsList || []);
  11703. return defineProperty(generator, "_invoke", {
  11704. value: makeInvokeMethod(innerFn, self, context)
  11705. }), generator;
  11706. }
  11707. function tryCatch(fn, obj, arg) {
  11708. try {
  11709. return {
  11710. type: "normal",
  11711. arg: fn.call(obj, arg)
  11712. };
  11713. } catch (err) {
  11714. return {
  11715. type: "throw",
  11716. arg: err
  11717. };
  11718. }
  11719. }
  11720. exports.wrap = wrap;
  11721. var ContinueSentinel = {};
  11722. function Generator() {}
  11723. function GeneratorFunction() {}
  11724. function GeneratorFunctionPrototype() {}
  11725. var IteratorPrototype = {};
  11726. define(IteratorPrototype, iteratorSymbol, function () {
  11727. return this;
  11728. });
  11729. var getProto = Object.getPrototypeOf,
  11730. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  11731. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  11732. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  11733. function defineIteratorMethods(prototype) {
  11734. ["next", "throw", "return"].forEach(function (method) {
  11735. define(prototype, method, function (arg) {
  11736. return this._invoke(method, arg);
  11737. });
  11738. });
  11739. }
  11740. function AsyncIterator(generator, PromiseImpl) {
  11741. function invoke(method, arg, resolve, reject) {
  11742. var record = tryCatch(generator[method], generator, arg);
  11743. if ("throw" !== record.type) {
  11744. var result = record.arg,
  11745. value = result.value;
  11746. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  11747. invoke("next", value, resolve, reject);
  11748. }, function (err) {
  11749. invoke("throw", err, resolve, reject);
  11750. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  11751. result.value = unwrapped, resolve(result);
  11752. }, function (error) {
  11753. return invoke("throw", error, resolve, reject);
  11754. });
  11755. }
  11756. reject(record.arg);
  11757. }
  11758. var previousPromise;
  11759. defineProperty(this, "_invoke", {
  11760. value: function value(method, arg) {
  11761. function callInvokeWithMethodAndArg() {
  11762. return new PromiseImpl(function (resolve, reject) {
  11763. invoke(method, arg, resolve, reject);
  11764. });
  11765. }
  11766. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  11767. }
  11768. });
  11769. }
  11770. function makeInvokeMethod(innerFn, self, context) {
  11771. var state = "suspendedStart";
  11772. return function (method, arg) {
  11773. if ("executing" === state) throw new Error("Generator is already running");
  11774. if ("completed" === state) {
  11775. if ("throw" === method) throw arg;
  11776. return doneResult();
  11777. }
  11778. for (context.method = method, context.arg = arg;;) {
  11779. var delegate = context.delegate;
  11780. if (delegate) {
  11781. var delegateResult = maybeInvokeDelegate(delegate, context);
  11782. if (delegateResult) {
  11783. if (delegateResult === ContinueSentinel) continue;
  11784. return delegateResult;
  11785. }
  11786. }
  11787. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  11788. if ("suspendedStart" === state) throw state = "completed", context.arg;
  11789. context.dispatchException(context.arg);
  11790. } else "return" === context.method && context.abrupt("return", context.arg);
  11791. state = "executing";
  11792. var record = tryCatch(innerFn, self, context);
  11793. if ("normal" === record.type) {
  11794. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  11795. return {
  11796. value: record.arg,
  11797. done: context.done
  11798. };
  11799. }
  11800. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  11801. }
  11802. };
  11803. }
  11804. function maybeInvokeDelegate(delegate, context) {
  11805. var methodName = context.method,
  11806. method = delegate.iterator[methodName];
  11807. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  11808. var record = tryCatch(method, delegate.iterator, context.arg);
  11809. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  11810. var info = record.arg;
  11811. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  11812. }
  11813. function pushTryEntry(locs) {
  11814. var entry = {
  11815. tryLoc: locs[0]
  11816. };
  11817. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  11818. }
  11819. function resetTryEntry(entry) {
  11820. var record = entry.completion || {};
  11821. record.type = "normal", delete record.arg, entry.completion = record;
  11822. }
  11823. function Context(tryLocsList) {
  11824. this.tryEntries = [{
  11825. tryLoc: "root"
  11826. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  11827. }
  11828. function values(iterable) {
  11829. if (iterable) {
  11830. var iteratorMethod = iterable[iteratorSymbol];
  11831. if (iteratorMethod) return iteratorMethod.call(iterable);
  11832. if ("function" == typeof iterable.next) return iterable;
  11833. if (!isNaN(iterable.length)) {
  11834. var i = -1,
  11835. next = function next() {
  11836. for (; ++i < iterable.length;) {
  11837. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  11838. }
  11839. return next.value = undefined, next.done = !0, next;
  11840. };
  11841. return next.next = next;
  11842. }
  11843. }
  11844. return {
  11845. next: doneResult
  11846. };
  11847. }
  11848. function doneResult() {
  11849. return {
  11850. value: undefined,
  11851. done: !0
  11852. };
  11853. }
  11854. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  11855. value: GeneratorFunctionPrototype,
  11856. configurable: !0
  11857. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  11858. value: GeneratorFunction,
  11859. configurable: !0
  11860. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  11861. var ctor = "function" == typeof genFun && genFun.constructor;
  11862. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  11863. }, exports.mark = function (genFun) {
  11864. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  11865. }, exports.awrap = function (arg) {
  11866. return {
  11867. __await: arg
  11868. };
  11869. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  11870. return this;
  11871. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  11872. void 0 === PromiseImpl && (PromiseImpl = Promise);
  11873. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  11874. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  11875. return result.done ? result.value : iter.next();
  11876. });
  11877. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  11878. return this;
  11879. }), define(Gp, "toString", function () {
  11880. return "[object Generator]";
  11881. }), exports.keys = function (val) {
  11882. var object = Object(val),
  11883. keys = [];
  11884. for (var key in object) {
  11885. keys.push(key);
  11886. }
  11887. return keys.reverse(), function next() {
  11888. for (; keys.length;) {
  11889. var key = keys.pop();
  11890. if (key in object) return next.value = key, next.done = !1, next;
  11891. }
  11892. return next.done = !0, next;
  11893. };
  11894. }, exports.values = values, Context.prototype = {
  11895. constructor: Context,
  11896. reset: function reset(skipTempReset) {
  11897. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  11898. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  11899. }
  11900. },
  11901. stop: function stop() {
  11902. this.done = !0;
  11903. var rootRecord = this.tryEntries[0].completion;
  11904. if ("throw" === rootRecord.type) throw rootRecord.arg;
  11905. return this.rval;
  11906. },
  11907. dispatchException: function dispatchException(exception) {
  11908. if (this.done) throw exception;
  11909. var context = this;
  11910. function handle(loc, caught) {
  11911. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  11912. }
  11913. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11914. var entry = this.tryEntries[i],
  11915. record = entry.completion;
  11916. if ("root" === entry.tryLoc) return handle("end");
  11917. if (entry.tryLoc <= this.prev) {
  11918. var hasCatch = hasOwn.call(entry, "catchLoc"),
  11919. hasFinally = hasOwn.call(entry, "finallyLoc");
  11920. if (hasCatch && hasFinally) {
  11921. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11922. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11923. } else if (hasCatch) {
  11924. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11925. } else {
  11926. if (!hasFinally) throw new Error("try statement without catch or finally");
  11927. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11928. }
  11929. }
  11930. }
  11931. },
  11932. abrupt: function abrupt(type, arg) {
  11933. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11934. var entry = this.tryEntries[i];
  11935. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  11936. var finallyEntry = entry;
  11937. break;
  11938. }
  11939. }
  11940. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  11941. var record = finallyEntry ? finallyEntry.completion : {};
  11942. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  11943. },
  11944. complete: function complete(record, afterLoc) {
  11945. if ("throw" === record.type) throw record.arg;
  11946. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  11947. },
  11948. finish: function finish(finallyLoc) {
  11949. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11950. var entry = this.tryEntries[i];
  11951. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  11952. }
  11953. },
  11954. "catch": function _catch(tryLoc) {
  11955. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11956. var entry = this.tryEntries[i];
  11957. if (entry.tryLoc === tryLoc) {
  11958. var record = entry.completion;
  11959. if ("throw" === record.type) {
  11960. var thrown = record.arg;
  11961. resetTryEntry(entry);
  11962. }
  11963. return thrown;
  11964. }
  11965. }
  11966. throw new Error("illegal catch attempt");
  11967. },
  11968. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  11969. return this.delegate = {
  11970. iterator: values(iterable),
  11971. resultName: resultName,
  11972. nextLoc: nextLoc
  11973. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  11974. }
  11975. }, exports;
  11976. }
  11977. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11978. /***/ }),
  11979. /***/ 46:
  11980. /*!*****************************************************************!*\
  11981. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  11982. \*****************************************************************/
  11983. /*! no static exports found */
  11984. /***/ (function(module, exports) {
  11985. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  11986. try {
  11987. var info = gen[key](arg);
  11988. var value = info.value;
  11989. } catch (error) {
  11990. reject(error);
  11991. return;
  11992. }
  11993. if (info.done) {
  11994. resolve(value);
  11995. } else {
  11996. Promise.resolve(value).then(_next, _throw);
  11997. }
  11998. }
  11999. function _asyncToGenerator(fn) {
  12000. return function () {
  12001. var self = this,
  12002. args = arguments;
  12003. return new Promise(function (resolve, reject) {
  12004. var gen = fn.apply(self, args);
  12005. function _next(value) {
  12006. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  12007. }
  12008. function _throw(err) {
  12009. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  12010. }
  12011. _next(undefined);
  12012. });
  12013. };
  12014. }
  12015. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12016. /***/ }),
  12017. /***/ 47:
  12018. /*!**************************************************************!*\
  12019. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/timeFormat.js ***!
  12020. \**************************************************************/
  12021. /*! no static exports found */
  12022. /***/ (function(module, exports, __webpack_require__) {
  12023. "use strict";
  12024. Object.defineProperty(exports, "__esModule", {
  12025. value: true
  12026. });
  12027. exports.default = void 0;
  12028. // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  12029. // 所以这里做一个兼容polyfill的兼容处理
  12030. if (!String.prototype.padStart) {
  12031. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  12032. String.prototype.padStart = function (maxLength) {
  12033. var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  12034. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError('fillString must be String');
  12035. var str = this;
  12036. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  12037. if (str.length >= maxLength) return String(str);
  12038. var fillLength = maxLength - str.length,
  12039. times = Math.ceil(fillLength / fillString.length);
  12040. while (times >>= 1) {
  12041. fillString += fillString;
  12042. if (times === 1) {
  12043. fillString += fillString;
  12044. }
  12045. }
  12046. return fillString.slice(0, fillLength) + str;
  12047. };
  12048. }
  12049. // 其他更多是格式化有如下:
  12050. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  12051. function timeFormat() {
  12052. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  12053. var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  12054. // 如果为null,则格式化当前时间
  12055. if (!dateTime) dateTime = Number(new Date());
  12056. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  12057. if (dateTime.toString().length == 10) dateTime *= 1000;
  12058. var date = new Date(dateTime);
  12059. var ret;
  12060. var opt = {
  12061. "y+": date.getFullYear().toString(),
  12062. // 年
  12063. "m+": (date.getMonth() + 1).toString(),
  12064. // 月
  12065. "d+": date.getDate().toString(),
  12066. // 日
  12067. "h+": date.getHours().toString(),
  12068. // 时
  12069. "M+": date.getMinutes().toString(),
  12070. // 分
  12071. "s+": date.getSeconds().toString() // 秒
  12072. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  12073. };
  12074. for (var k in opt) {
  12075. ret = new RegExp("(" + k + ")").exec(fmt);
  12076. if (ret) {
  12077. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  12078. }
  12079. ;
  12080. }
  12081. ;
  12082. return fmt;
  12083. }
  12084. var _default = timeFormat;
  12085. exports.default = _default;
  12086. /***/ }),
  12087. /***/ 48:
  12088. /*!************************************************************!*\
  12089. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/timeFrom.js ***!
  12090. \************************************************************/
  12091. /*! no static exports found */
  12092. /***/ (function(module, exports, __webpack_require__) {
  12093. "use strict";
  12094. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12095. Object.defineProperty(exports, "__esModule", {
  12096. value: true
  12097. });
  12098. exports.default = void 0;
  12099. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 47));
  12100. /**
  12101. * 时间戳转为多久之前
  12102. * @param String timestamp 时间戳
  12103. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  12104. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  12105. */
  12106. function timeFrom() {
  12107. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  12108. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  12109. // 如果为null,则格式化当前时间
  12110. if (!dateTime) dateTime = Number(new Date());
  12111. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  12112. if (dateTime.toString().length == 10) dateTime *= 1000;
  12113. var timestamp = +new Date(Number(dateTime));
  12114. var timer = (Number(new Date()) - timestamp) / 1000;
  12115. // 如果小于5分钟,则返回"刚刚",其他以此类推
  12116. var tips = '';
  12117. switch (true) {
  12118. case timer < 300:
  12119. tips = '刚刚';
  12120. break;
  12121. case timer >= 300 && timer < 3600:
  12122. tips = parseInt(timer / 60) + '分钟前';
  12123. break;
  12124. case timer >= 3600 && timer < 86400:
  12125. tips = parseInt(timer / 3600) + '小时前';
  12126. break;
  12127. case timer >= 86400 && timer < 2592000:
  12128. tips = parseInt(timer / 86400) + '天前';
  12129. break;
  12130. default:
  12131. // 如果format为false,则无论什么时间戳,都显示xx之前
  12132. if (format === false) {
  12133. if (timer >= 2592000 && timer < 365 * 86400) {
  12134. tips = parseInt(timer / (86400 * 30)) + '个月前';
  12135. } else {
  12136. tips = parseInt(timer / (86400 * 365)) + '年前';
  12137. }
  12138. } else {
  12139. tips = (0, _timeFormat.default)(timestamp, format);
  12140. }
  12141. }
  12142. return tips;
  12143. }
  12144. var _default = timeFrom;
  12145. exports.default = _default;
  12146. /***/ }),
  12147. /***/ 49:
  12148. /*!*****************************************************************!*\
  12149. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/colorGradient.js ***!
  12150. \*****************************************************************/
  12151. /*! no static exports found */
  12152. /***/ (function(module, exports, __webpack_require__) {
  12153. "use strict";
  12154. Object.defineProperty(exports, "__esModule", {
  12155. value: true
  12156. });
  12157. exports.default = void 0;
  12158. /**
  12159. * 求两个颜色之间的渐变值
  12160. * @param {string} startColor 开始的颜色
  12161. * @param {string} endColor 结束的颜色
  12162. * @param {number} step 颜色等分的份额
  12163. * */
  12164. function colorGradient() {
  12165. var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
  12166. var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
  12167. var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  12168. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  12169. var startR = startRGB[0];
  12170. var startG = startRGB[1];
  12171. var startB = startRGB[2];
  12172. var endRGB = hexToRgb(endColor, false);
  12173. var endR = endRGB[0];
  12174. var endG = endRGB[1];
  12175. var endB = endRGB[2];
  12176. var sR = (endR - startR) / step; //总差值
  12177. var sG = (endG - startG) / step;
  12178. var sB = (endB - startB) / step;
  12179. var colorArr = [];
  12180. for (var i = 0; i < step; i++) {
  12181. //计算每一步的hex值
  12182. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB * i + startB) + ')');
  12183. colorArr.push(hex);
  12184. }
  12185. return colorArr;
  12186. }
  12187. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  12188. function hexToRgb(sColor) {
  12189. var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12190. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  12191. sColor = sColor.toLowerCase();
  12192. if (sColor && reg.test(sColor)) {
  12193. if (sColor.length === 4) {
  12194. var sColorNew = "#";
  12195. for (var i = 1; i < 4; i += 1) {
  12196. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  12197. }
  12198. sColor = sColorNew;
  12199. }
  12200. //处理六位的颜色值
  12201. var sColorChange = [];
  12202. for (var _i = 1; _i < 7; _i += 2) {
  12203. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  12204. }
  12205. if (!str) {
  12206. return sColorChange;
  12207. } else {
  12208. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  12209. }
  12210. } else if (/^(rgb|RGB)/.test(sColor)) {
  12211. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  12212. return arr.map(function (val) {
  12213. return Number(val);
  12214. });
  12215. } else {
  12216. return sColor;
  12217. }
  12218. }
  12219. ;
  12220. // 将rgb表示方式转换为hex表示方式
  12221. function rgbToHex(rgb) {
  12222. var _this = rgb;
  12223. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  12224. if (/^(rgb|RGB)/.test(_this)) {
  12225. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  12226. var strHex = "#";
  12227. for (var i = 0; i < aColor.length; i++) {
  12228. var hex = Number(aColor[i]).toString(16);
  12229. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  12230. if (hex === "0") {
  12231. hex += hex;
  12232. }
  12233. strHex += hex;
  12234. }
  12235. if (strHex.length !== 7) {
  12236. strHex = _this;
  12237. }
  12238. return strHex;
  12239. } else if (reg.test(_this)) {
  12240. var aNum = _this.replace(/#/, "").split("");
  12241. if (aNum.length === 6) {
  12242. return _this;
  12243. } else if (aNum.length === 3) {
  12244. var numHex = "#";
  12245. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  12246. numHex += aNum[_i2] + aNum[_i2];
  12247. }
  12248. return numHex;
  12249. }
  12250. } else {
  12251. return _this;
  12252. }
  12253. }
  12254. /**
  12255. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  12256. * sHex为传入的十六进制的色值
  12257. * alpha为rgba的透明度
  12258. */
  12259. function colorToRgba(color) {
  12260. var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  12261. color = rgbToHex(color);
  12262. // 十六进制颜色值的正则表达式
  12263. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  12264. /* 16进制颜色转为RGB格式 */
  12265. var sColor = color.toLowerCase();
  12266. if (sColor && reg.test(sColor)) {
  12267. if (sColor.length === 4) {
  12268. var sColorNew = '#';
  12269. for (var i = 1; i < 4; i += 1) {
  12270. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  12271. }
  12272. sColor = sColorNew;
  12273. }
  12274. // 处理六位的颜色值
  12275. var sColorChange = [];
  12276. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  12277. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  12278. }
  12279. // return sColorChange.join(',')
  12280. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  12281. } else {
  12282. return sColor;
  12283. }
  12284. }
  12285. var _default = {
  12286. colorGradient: colorGradient,
  12287. hexToRgb: hexToRgb,
  12288. rgbToHex: rgbToHex,
  12289. colorToRgba: colorToRgba
  12290. };
  12291. exports.default = _default;
  12292. /***/ }),
  12293. /***/ 5:
  12294. /*!**************************************************************!*\
  12295. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  12296. \**************************************************************/
  12297. /*! no static exports found */
  12298. /***/ (function(module, exports, __webpack_require__) {
  12299. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  12300. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  12301. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  12302. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  12303. function _slicedToArray(arr, i) {
  12304. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  12305. }
  12306. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12307. /***/ }),
  12308. /***/ 50:
  12309. /*!********************************************************!*\
  12310. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/guid.js ***!
  12311. \********************************************************/
  12312. /*! no static exports found */
  12313. /***/ (function(module, exports, __webpack_require__) {
  12314. "use strict";
  12315. Object.defineProperty(exports, "__esModule", {
  12316. value: true
  12317. });
  12318. exports.default = void 0;
  12319. /**
  12320. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  12321. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  12322. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  12323. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  12324. * v-for的时候,推荐使用后端返回的id而不是循环的index
  12325. * @param {Number} len uuid的长度
  12326. * @param {Boolean} firstU 将返回的首字母置为"u"
  12327. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  12328. */
  12329. function guid() {
  12330. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  12331. var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12332. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  12333. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  12334. var uuid = [];
  12335. radix = radix || chars.length;
  12336. if (len) {
  12337. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  12338. for (var i = 0; i < len; i++) {
  12339. uuid[i] = chars[0 | Math.random() * radix];
  12340. }
  12341. } else {
  12342. var r;
  12343. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  12344. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  12345. uuid[14] = '4';
  12346. for (var _i = 0; _i < 36; _i++) {
  12347. if (!uuid[_i]) {
  12348. r = 0 | Math.random() * 16;
  12349. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  12350. }
  12351. }
  12352. }
  12353. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  12354. if (firstU) {
  12355. uuid.shift();
  12356. return 'u' + uuid.join('');
  12357. } else {
  12358. return uuid.join('');
  12359. }
  12360. }
  12361. var _default = guid;
  12362. exports.default = _default;
  12363. /***/ }),
  12364. /***/ 51:
  12365. /*!*********************************************************!*\
  12366. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/color.js ***!
  12367. \*********************************************************/
  12368. /*! no static exports found */
  12369. /***/ (function(module, exports, __webpack_require__) {
  12370. "use strict";
  12371. Object.defineProperty(exports, "__esModule", {
  12372. value: true
  12373. });
  12374. exports.default = void 0;
  12375. // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  12376. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  12377. var color = {
  12378. primary: "#2979ff",
  12379. primaryDark: "#2b85e4",
  12380. primaryDisabled: "#a0cfff",
  12381. primaryLight: "#ecf5ff",
  12382. bgColor: "#f3f4f6",
  12383. info: "#909399",
  12384. infoDark: "#82848a",
  12385. infoDisabled: "#c8c9cc",
  12386. infoLight: "#f4f4f5",
  12387. warning: "#ff9900",
  12388. warningDark: "#f29100",
  12389. warningDisabled: "#fcbd71",
  12390. warningLight: "#fdf6ec",
  12391. error: "#fa3534",
  12392. errorDark: "#dd6161",
  12393. errorDisabled: "#fab6b6",
  12394. errorLight: "#fef0f0",
  12395. success: "#19be6b",
  12396. successDark: "#18b566",
  12397. successDisabled: "#71d5a1",
  12398. successLight: "#dbf1e1",
  12399. mainColor: "#303133",
  12400. contentColor: "#606266",
  12401. tipsColor: "#909399",
  12402. lightColor: "#c0c4cc",
  12403. borderColor: "#e4e7ed"
  12404. };
  12405. var _default = color;
  12406. exports.default = _default;
  12407. /***/ }),
  12408. /***/ 52:
  12409. /*!*************************************************************!*\
  12410. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/type2icon.js ***!
  12411. \*************************************************************/
  12412. /*! no static exports found */
  12413. /***/ (function(module, exports, __webpack_require__) {
  12414. "use strict";
  12415. Object.defineProperty(exports, "__esModule", {
  12416. value: true
  12417. });
  12418. exports.default = void 0;
  12419. /**
  12420. * 根据主题type值,获取对应的图标
  12421. * @param String type 主题名称,primary|info|error|warning|success
  12422. * @param String fill 是否使用fill填充实体的图标
  12423. */
  12424. function type2icon() {
  12425. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
  12426. var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  12427. // 如果非预置值,默认为success
  12428. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  12429. var iconName = '';
  12430. // 目前(2019-12-12),info和primary使用同一个图标
  12431. switch (type) {
  12432. case 'primary':
  12433. iconName = 'info-circle';
  12434. break;
  12435. case 'info':
  12436. iconName = 'info-circle';
  12437. break;
  12438. case 'error':
  12439. iconName = 'close-circle';
  12440. break;
  12441. case 'warning':
  12442. iconName = 'error-circle';
  12443. break;
  12444. case 'success':
  12445. iconName = 'checkmark-circle';
  12446. break;
  12447. default:
  12448. iconName = 'checkmark-circle';
  12449. }
  12450. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  12451. if (fill) iconName += '-fill';
  12452. return iconName;
  12453. }
  12454. var _default = type2icon;
  12455. exports.default = _default;
  12456. /***/ }),
  12457. /***/ 53:
  12458. /*!***************************************************************!*\
  12459. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/randomArray.js ***!
  12460. \***************************************************************/
  12461. /*! no static exports found */
  12462. /***/ (function(module, exports, __webpack_require__) {
  12463. "use strict";
  12464. Object.defineProperty(exports, "__esModule", {
  12465. value: true
  12466. });
  12467. exports.default = void 0;
  12468. // 打乱数组
  12469. function randomArray() {
  12470. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  12471. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  12472. return array.sort(function () {
  12473. return Math.random() - 0.5;
  12474. });
  12475. }
  12476. var _default = randomArray;
  12477. exports.default = _default;
  12478. /***/ }),
  12479. /***/ 54:
  12480. /*!***********************************************************!*\
  12481. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/addUnit.js ***!
  12482. \***********************************************************/
  12483. /*! no static exports found */
  12484. /***/ (function(module, exports, __webpack_require__) {
  12485. "use strict";
  12486. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12487. Object.defineProperty(exports, "__esModule", {
  12488. value: true
  12489. });
  12490. exports.default = addUnit;
  12491. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 41));
  12492. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  12493. function addUnit() {
  12494. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
  12495. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  12496. value = String(value);
  12497. // 用uView内置验证规则中的number判断是否为数值
  12498. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  12499. }
  12500. /***/ }),
  12501. /***/ 55:
  12502. /*!**********************************************************!*\
  12503. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/random.js ***!
  12504. \**********************************************************/
  12505. /*! no static exports found */
  12506. /***/ (function(module, exports, __webpack_require__) {
  12507. "use strict";
  12508. Object.defineProperty(exports, "__esModule", {
  12509. value: true
  12510. });
  12511. exports.default = void 0;
  12512. function random(min, max) {
  12513. if (min >= 0 && max > 0 && max >= min) {
  12514. var gab = max - min + 1;
  12515. return Math.floor(Math.random() * gab + min);
  12516. } else {
  12517. return 0;
  12518. }
  12519. }
  12520. var _default = random;
  12521. exports.default = _default;
  12522. /***/ }),
  12523. /***/ 551:
  12524. /*!*******************************************************!*\
  12525. !*** D:/工作/项目2/亲家母/qjm/components/uni-icons/icons.js ***!
  12526. \*******************************************************/
  12527. /*! no static exports found */
  12528. /***/ (function(module, exports, __webpack_require__) {
  12529. "use strict";
  12530. Object.defineProperty(exports, "__esModule", {
  12531. value: true
  12532. });
  12533. exports.default = void 0;
  12534. var _default = {
  12535. 'contact': "\uE100",
  12536. 'person': "\uE101",
  12537. 'personadd': "\uE102",
  12538. 'contact-filled': "\uE130",
  12539. 'person-filled': "\uE131",
  12540. 'personadd-filled': "\uE132",
  12541. 'phone': "\uE200",
  12542. 'email': "\uE201",
  12543. 'chatbubble': "\uE202",
  12544. 'chatboxes': "\uE203",
  12545. 'phone-filled': "\uE230",
  12546. 'email-filled': "\uE231",
  12547. 'chatbubble-filled': "\uE232",
  12548. 'chatboxes-filled': "\uE233",
  12549. 'weibo': "\uE260",
  12550. 'weixin': "\uE261",
  12551. 'pengyouquan': "\uE262",
  12552. 'chat': "\uE263",
  12553. 'qq': "\uE264",
  12554. 'videocam': "\uE300",
  12555. 'camera': "\uE301",
  12556. 'mic': "\uE302",
  12557. 'location': "\uE303",
  12558. 'mic-filled': "\uE332",
  12559. 'speech': "\uE332",
  12560. 'location-filled': "\uE333",
  12561. 'micoff': "\uE360",
  12562. 'image': "\uE363",
  12563. 'map': "\uE364",
  12564. 'compose': "\uE400",
  12565. 'trash': "\uE401",
  12566. 'upload': "\uE402",
  12567. 'download': "\uE403",
  12568. 'close': "\uE404",
  12569. 'redo': "\uE405",
  12570. 'undo': "\uE406",
  12571. 'refresh': "\uE407",
  12572. 'star': "\uE408",
  12573. 'plus': "\uE409",
  12574. 'minus': "\uE410",
  12575. 'circle': "\uE411",
  12576. 'checkbox': "\uE411",
  12577. 'close-filled': "\uE434",
  12578. 'clear': "\uE434",
  12579. 'refresh-filled': "\uE437",
  12580. 'star-filled': "\uE438",
  12581. 'plus-filled': "\uE439",
  12582. 'minus-filled': "\uE440",
  12583. 'circle-filled': "\uE441",
  12584. 'checkbox-filled': "\uE442",
  12585. 'closeempty': "\uE460",
  12586. 'refreshempty': "\uE461",
  12587. 'reload': "\uE462",
  12588. 'starhalf': "\uE463",
  12589. 'spinner': "\uE464",
  12590. 'spinner-cycle': "\uE465",
  12591. 'search': "\uE466",
  12592. 'plusempty': "\uE468",
  12593. 'forward': "\uE470",
  12594. 'back': "\uE471",
  12595. 'left-nav': "\uE471",
  12596. 'checkmarkempty': "\uE472",
  12597. 'home': "\uE500",
  12598. 'navigate': "\uE501",
  12599. 'gear': "\uE502",
  12600. 'paperplane': "\uE503",
  12601. 'info': "\uE504",
  12602. 'help': "\uE505",
  12603. 'locked': "\uE506",
  12604. 'more': "\uE507",
  12605. 'flag': "\uE508",
  12606. 'home-filled': "\uE530",
  12607. 'gear-filled': "\uE532",
  12608. 'info-filled': "\uE534",
  12609. 'help-filled': "\uE535",
  12610. 'more-filled': "\uE537",
  12611. 'settings': "\uE560",
  12612. 'list': "\uE562",
  12613. 'bars': "\uE563",
  12614. 'loop': "\uE565",
  12615. 'paperclip': "\uE567",
  12616. 'eye': "\uE568",
  12617. 'arrowup': "\uE580",
  12618. 'arrowdown': "\uE581",
  12619. 'arrowleft': "\uE582",
  12620. 'arrowright': "\uE583",
  12621. 'arrowthinup': "\uE584",
  12622. 'arrowthindown': "\uE585",
  12623. 'arrowthinleft': "\uE586",
  12624. 'arrowthinright': "\uE587",
  12625. 'pulldown': "\uE588",
  12626. 'closefill': "\uE589",
  12627. 'sound': "\uE590",
  12628. 'scan': "\uE612"
  12629. };
  12630. exports.default = _default;
  12631. /***/ }),
  12632. /***/ 56:
  12633. /*!********************************************************!*\
  12634. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/trim.js ***!
  12635. \********************************************************/
  12636. /*! no static exports found */
  12637. /***/ (function(module, exports, __webpack_require__) {
  12638. "use strict";
  12639. Object.defineProperty(exports, "__esModule", {
  12640. value: true
  12641. });
  12642. exports.default = void 0;
  12643. function trim(str) {
  12644. var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  12645. if (pos == 'both') {
  12646. return str.replace(/^\s+|\s+$/g, "");
  12647. } else if (pos == "left") {
  12648. return str.replace(/^\s*/, '');
  12649. } else if (pos == 'right') {
  12650. return str.replace(/(\s*$)/g, "");
  12651. } else if (pos == 'all') {
  12652. return str.replace(/\s+/g, "");
  12653. } else {
  12654. return str;
  12655. }
  12656. }
  12657. var _default = trim;
  12658. exports.default = _default;
  12659. /***/ }),
  12660. /***/ 57:
  12661. /*!*********************************************************!*\
  12662. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/toast.js ***!
  12663. \*********************************************************/
  12664. /*! no static exports found */
  12665. /***/ (function(module, exports, __webpack_require__) {
  12666. "use strict";
  12667. /* WEBPACK VAR INJECTION */(function(uni) {
  12668. Object.defineProperty(exports, "__esModule", {
  12669. value: true
  12670. });
  12671. exports.default = void 0;
  12672. function toast(title) {
  12673. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  12674. uni.showToast({
  12675. title: title,
  12676. icon: 'none',
  12677. duration: duration
  12678. });
  12679. }
  12680. var _default = toast;
  12681. exports.default = _default;
  12682. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12683. /***/ }),
  12684. /***/ 58:
  12685. /*!*************************************************************!*\
  12686. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/getParent.js ***!
  12687. \*************************************************************/
  12688. /*! no static exports found */
  12689. /***/ (function(module, exports, __webpack_require__) {
  12690. "use strict";
  12691. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12692. Object.defineProperty(exports, "__esModule", {
  12693. value: true
  12694. });
  12695. exports.default = getParent;
  12696. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  12697. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  12698. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  12699. function getParent(name, keys) {
  12700. var parent = this.$parent;
  12701. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  12702. while (parent) {
  12703. // 父组件
  12704. if (parent.$options.name !== name) {
  12705. // 如果组件的name不相等,继续上一级寻找
  12706. parent = parent.$parent;
  12707. } else {
  12708. var _ret = function () {
  12709. var data = {};
  12710. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  12711. if (Array.isArray(keys)) {
  12712. keys.map(function (val) {
  12713. data[val] = parent[val] ? parent[val] : '';
  12714. });
  12715. } else {
  12716. // 历遍传过来的对象参数
  12717. for (var i in keys) {
  12718. // 如果子组件有此值则用,无此值则用父组件的值
  12719. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  12720. if (Array.isArray(keys[i])) {
  12721. if (keys[i].length) {
  12722. data[i] = keys[i];
  12723. } else {
  12724. data[i] = parent[i];
  12725. }
  12726. } else if (keys[i].constructor === Object) {
  12727. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  12728. if (Object.keys(keys[i]).length) {
  12729. data[i] = keys[i];
  12730. } else {
  12731. data[i] = parent[i];
  12732. }
  12733. } else {
  12734. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  12735. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  12736. }
  12737. }
  12738. }
  12739. return {
  12740. v: data
  12741. };
  12742. }();
  12743. if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
  12744. }
  12745. }
  12746. return {};
  12747. }
  12748. /***/ }),
  12749. /***/ 59:
  12750. /*!***********************************************************!*\
  12751. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/$parent.js ***!
  12752. \***********************************************************/
  12753. /*! no static exports found */
  12754. /***/ (function(module, exports, __webpack_require__) {
  12755. "use strict";
  12756. Object.defineProperty(exports, "__esModule", {
  12757. value: true
  12758. });
  12759. exports.default = $parent;
  12760. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  12761. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  12762. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  12763. // 值(默认为undefined),就是查找最顶层的$parent
  12764. function $parent() {
  12765. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  12766. var parent = this.$parent;
  12767. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  12768. while (parent) {
  12769. // 父组件
  12770. if (parent.$options && parent.$options.name !== name) {
  12771. // 如果组件的name不相等,继续上一级寻找
  12772. parent = parent.$parent;
  12773. } else {
  12774. return parent;
  12775. }
  12776. }
  12777. return false;
  12778. }
  12779. /***/ }),
  12780. /***/ 6:
  12781. /*!***************************************************************!*\
  12782. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  12783. \***************************************************************/
  12784. /*! no static exports found */
  12785. /***/ (function(module, exports) {
  12786. function _arrayWithHoles(arr) {
  12787. if (Array.isArray(arr)) return arr;
  12788. }
  12789. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12790. /***/ }),
  12791. /***/ 60:
  12792. /*!*******************************************************!*\
  12793. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/sys.js ***!
  12794. \*******************************************************/
  12795. /*! no static exports found */
  12796. /***/ (function(module, exports, __webpack_require__) {
  12797. "use strict";
  12798. /* WEBPACK VAR INJECTION */(function(uni) {
  12799. Object.defineProperty(exports, "__esModule", {
  12800. value: true
  12801. });
  12802. exports.os = os;
  12803. exports.sys = sys;
  12804. function os() {
  12805. return uni.getSystemInfoSync().platform;
  12806. }
  12807. ;
  12808. function sys() {
  12809. return uni.getSystemInfoSync();
  12810. }
  12811. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12812. /***/ }),
  12813. /***/ 61:
  12814. /*!************************************************************!*\
  12815. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/debounce.js ***!
  12816. \************************************************************/
  12817. /*! no static exports found */
  12818. /***/ (function(module, exports, __webpack_require__) {
  12819. "use strict";
  12820. Object.defineProperty(exports, "__esModule", {
  12821. value: true
  12822. });
  12823. exports.default = void 0;
  12824. var timeout = null;
  12825. /**
  12826. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  12827. *
  12828. * @param {Function} func 要执行的回调函数
  12829. * @param {Number} wait 延时的时间
  12830. * @param {Boolean} immediate 是否立即执行
  12831. * @return null
  12832. */
  12833. function debounce(func) {
  12834. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  12835. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  12836. // 清除定时器
  12837. if (timeout !== null) clearTimeout(timeout);
  12838. // 立即执行,此类情况一般用不到
  12839. if (immediate) {
  12840. var callNow = !timeout;
  12841. timeout = setTimeout(function () {
  12842. timeout = null;
  12843. }, wait);
  12844. if (callNow) typeof func === 'function' && func();
  12845. } else {
  12846. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  12847. timeout = setTimeout(function () {
  12848. typeof func === 'function' && func();
  12849. }, wait);
  12850. }
  12851. }
  12852. var _default = debounce;
  12853. exports.default = _default;
  12854. /***/ }),
  12855. /***/ 62:
  12856. /*!************************************************************!*\
  12857. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/throttle.js ***!
  12858. \************************************************************/
  12859. /*! no static exports found */
  12860. /***/ (function(module, exports, __webpack_require__) {
  12861. "use strict";
  12862. Object.defineProperty(exports, "__esModule", {
  12863. value: true
  12864. });
  12865. exports.default = void 0;
  12866. var timer, flag;
  12867. /**
  12868. * 节流原理:在一定时间内,只能触发一次
  12869. *
  12870. * @param {Function} func 要执行的回调函数
  12871. * @param {Number} wait 延时的时间
  12872. * @param {Boolean} immediate 是否立即执行
  12873. * @return null
  12874. */
  12875. function throttle(func) {
  12876. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  12877. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  12878. if (immediate) {
  12879. if (!flag) {
  12880. flag = true;
  12881. // 如果是立即执行,则在wait毫秒内开始时执行
  12882. typeof func === 'function' && func();
  12883. timer = setTimeout(function () {
  12884. flag = false;
  12885. }, wait);
  12886. }
  12887. } else {
  12888. if (!flag) {
  12889. flag = true;
  12890. // 如果是非立即执行,则在wait毫秒内的结束处执行
  12891. timer = setTimeout(function () {
  12892. flag = false;
  12893. typeof func === 'function' && func();
  12894. }, wait);
  12895. }
  12896. }
  12897. }
  12898. ;
  12899. var _default = throttle;
  12900. exports.default = _default;
  12901. /***/ }),
  12902. /***/ 63:
  12903. /*!********************************************************!*\
  12904. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/config/config.js ***!
  12905. \********************************************************/
  12906. /*! no static exports found */
  12907. /***/ (function(module, exports, __webpack_require__) {
  12908. "use strict";
  12909. Object.defineProperty(exports, "__esModule", {
  12910. value: true
  12911. });
  12912. exports.default = void 0;
  12913. // 此版本发布于2020-03-17
  12914. var version = '1.8.4';
  12915. var _default = {
  12916. v: version,
  12917. version: version,
  12918. // 主题名称
  12919. type: ['primary', 'success', 'info', 'error', 'warning']
  12920. };
  12921. exports.default = _default;
  12922. /***/ }),
  12923. /***/ 64:
  12924. /*!********************************************************!*\
  12925. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/config/zIndex.js ***!
  12926. \********************************************************/
  12927. /*! no static exports found */
  12928. /***/ (function(module, exports, __webpack_require__) {
  12929. "use strict";
  12930. Object.defineProperty(exports, "__esModule", {
  12931. value: true
  12932. });
  12933. exports.default = void 0;
  12934. // uniapp在H5中各API的z-index值如下:
  12935. /**
  12936. * actionsheet: 999
  12937. * modal: 999
  12938. * navigate: 998
  12939. * tabbar: 998
  12940. * toast: 999
  12941. */
  12942. var _default = {
  12943. toast: 10090,
  12944. noNetwork: 10080,
  12945. // popup包含popup,actionsheet,keyboard,picker的值
  12946. popup: 10075,
  12947. mask: 10070,
  12948. navbar: 980,
  12949. topTips: 975,
  12950. sticky: 970,
  12951. indexListSticky: 965
  12952. };
  12953. exports.default = _default;
  12954. /***/ }),
  12955. /***/ 7:
  12956. /*!*********************************************************************!*\
  12957. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  12958. \*********************************************************************/
  12959. /*! no static exports found */
  12960. /***/ (function(module, exports) {
  12961. function _iterableToArrayLimit(arr, i) {
  12962. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  12963. if (null != _i) {
  12964. var _s,
  12965. _e,
  12966. _x,
  12967. _r,
  12968. _arr = [],
  12969. _n = !0,
  12970. _d = !1;
  12971. try {
  12972. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  12973. if (Object(_i) !== _i) return;
  12974. _n = !1;
  12975. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  12976. ;
  12977. }
  12978. } catch (err) {
  12979. _d = !0, _e = err;
  12980. } finally {
  12981. try {
  12982. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  12983. } finally {
  12984. if (_d) throw _e;
  12985. }
  12986. }
  12987. return _arr;
  12988. }
  12989. }
  12990. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12991. /***/ }),
  12992. /***/ 71:
  12993. /*!**************************************!*\
  12994. !*** D:/工作/项目2/亲家母/qjm/api/index.js ***!
  12995. \**************************************/
  12996. /*! no static exports found */
  12997. /***/ (function(module, exports, __webpack_require__) {
  12998. "use strict";
  12999. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13000. Object.defineProperty(exports, "__esModule", {
  13001. value: true
  13002. });
  13003. exports.groom1 = groom1;
  13004. exports.groom3 = groom3;
  13005. exports.groom4 = groom4;
  13006. exports.loadIndexs = loadIndexs;
  13007. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  13008. // 促销商品
  13009. function groom4(data) {
  13010. return (0, _request.default)({
  13011. url: '/api/groom/list/4',
  13012. method: 'get',
  13013. data: data
  13014. });
  13015. }
  13016. // 精品推荐
  13017. function groom1(data) {
  13018. return (0, _request.default)({
  13019. url: '/api/groom/list/1',
  13020. method: 'get',
  13021. data: data
  13022. });
  13023. }
  13024. // 新品首发
  13025. function groom3(data) {
  13026. return (0, _request.default)({
  13027. url: '/api/groom/list/3',
  13028. method: 'get',
  13029. data: data
  13030. });
  13031. }
  13032. // 获取首页信息
  13033. function loadIndexs(data) {
  13034. return (0, _request.default)({
  13035. url: '/api/index',
  13036. method: 'get',
  13037. data: data
  13038. });
  13039. }
  13040. /***/ }),
  13041. /***/ 72:
  13042. /*!******************************************!*\
  13043. !*** D:/工作/项目2/亲家母/qjm/utils/request.js ***!
  13044. \******************************************/
  13045. /*! no static exports found */
  13046. /***/ (function(module, exports, __webpack_require__) {
  13047. "use strict";
  13048. /* WEBPACK VAR INJECTION */(function(uni) {
  13049. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13050. Object.defineProperty(exports, "__esModule", {
  13051. value: true
  13052. });
  13053. exports.upFilse = exports.default = void 0;
  13054. var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 73));
  13055. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  13056. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 74);
  13057. // 请求完成后拦截
  13058. _newRequest.default.interceptors.response(function (response) {
  13059. try {
  13060. var res = response.data;
  13061. // 解析字符串为数字
  13062. if (res.status !== 200) {
  13063. console.log(res.status);
  13064. if (res.status == 410000) {
  13065. // 调用退出登录方法清空用户信息
  13066. _store.default.commit('user/logout');
  13067. // 判断是否开启强制登录
  13068. uni.showModal({
  13069. title: "登陆",
  13070. content: '您未登录!是否马上登录?',
  13071. success: function success(e) {
  13072. // 判断是否点击确认按钮
  13073. if (e.confirm) {
  13074. // 保存当前页面地址
  13075. (0, _loginUtils.saveUrl)();
  13076. // 跳转页面
  13077. (0, _loginUtils.interceptor)();
  13078. }
  13079. }
  13080. });
  13081. } else {
  13082. if (res.msg != '系统出现异常') {
  13083. uni.showToast({
  13084. title: res.msg,
  13085. duration: 1500,
  13086. mask: false,
  13087. icon: 'none'
  13088. });
  13089. }
  13090. }
  13091. return Promise.reject(res);
  13092. } else {
  13093. return res;
  13094. }
  13095. } catch (e) {
  13096. console.log(e);
  13097. }
  13098. }, function (error) {
  13099. uni.showToast({
  13100. title: "加载错误请重试",
  13101. duration: 1500,
  13102. mask: false,
  13103. icon: 'none'
  13104. });
  13105. return Promise.reject(error);
  13106. });
  13107. // 请求前拦截器
  13108. _newRequest.default.interceptors.request(function (config) {
  13109. var token = uni.getStorageSync('token') || '';
  13110. // console.log(config);
  13111. if (!config.header) {
  13112. config.header = {
  13113. "Authori-zation": 'Bearer ' + token
  13114. };
  13115. } else {
  13116. // 添加key请求头
  13117. config.header["Authori-zation"] = 'Bearer ' + token;
  13118. }
  13119. return config;
  13120. }, function (error) {
  13121. // 错误处理
  13122. console.log(error);
  13123. return Promise.reject(error);
  13124. });
  13125. var upFilse = _newRequest.default.upFilse;
  13126. exports.upFilse = upFilse;
  13127. var _default = _newRequest.default.open;
  13128. exports.default = _default;
  13129. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  13130. /***/ }),
  13131. /***/ 73:
  13132. /*!*********************************************!*\
  13133. !*** D:/工作/项目2/亲家母/qjm/utils/newRequest.js ***!
  13134. \*********************************************/
  13135. /*! no static exports found */
  13136. /***/ (function(module, exports, __webpack_require__) {
  13137. "use strict";
  13138. /* WEBPACK VAR INJECTION */(function(uni) {
  13139. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13140. Object.defineProperty(exports, "__esModule", {
  13141. value: true
  13142. });
  13143. exports.default = void 0;
  13144. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  13145. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  13146. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  13147. var _upFile = __webpack_require__(/*! @/utils/upFile.js */ 790);
  13148. var service = {
  13149. baseURL: _store.default.state.baseURL,
  13150. // 请求头
  13151. header: {
  13152. 'Content-Type': "application/x-www-form-urlencoded"
  13153. },
  13154. // 请求拦截器
  13155. interceptors: {
  13156. // 安装请求前拦截
  13157. request: function request(success, iserror) {
  13158. service.request.success = success;
  13159. service.request.error = iserror;
  13160. },
  13161. // 安装请求完成后拦截
  13162. response: function response(success, iserror) {
  13163. service.response.success = success;
  13164. service.response.error = iserror;
  13165. }
  13166. },
  13167. // 请求前拦截
  13168. request: {
  13169. // 回调成功执行方法
  13170. success: function success(e) {
  13171. return e;
  13172. },
  13173. // 回调失败
  13174. error: function error(e) {
  13175. return e;
  13176. }
  13177. },
  13178. // 请求完成后拦截
  13179. response: {
  13180. // 回调成功执行方法
  13181. success: function success(e) {
  13182. return e;
  13183. },
  13184. // 回调失败
  13185. error: function error(e) {
  13186. return e;
  13187. }
  13188. },
  13189. // 开始请求
  13190. open: function () {
  13191. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {
  13192. return _regenerator.default.wrap(function _callee$(_context) {
  13193. while (1) {
  13194. switch (_context.prev = _context.next) {
  13195. case 0:
  13196. _context.next = 2;
  13197. return new Promise(function (resolve, reject) {
  13198. var requestData = ''; //保存处理完成后请求数据
  13199. var url = ''; //保存链接地址
  13200. //console.log(data);
  13201. // 请求前数据处理
  13202. requestData = service.request.success(data);
  13203. url = service.baseURL + requestData.url;
  13204. // 数据复制用于请求
  13205. uni.request({
  13206. url: url,
  13207. method: requestData.method || 'GET',
  13208. data: requestData.data,
  13209. header: data.header || service.header,
  13210. success: function success(res) {
  13211. if (res.statusCode == 200) {
  13212. try {
  13213. resolve(service.response.success(res));
  13214. } catch (e) {
  13215. service.response.error(e);
  13216. }
  13217. }
  13218. },
  13219. // 请求失败数据处理
  13220. fail: function fail(err) {
  13221. service.response.error(err);
  13222. }
  13223. });
  13224. });
  13225. case 2:
  13226. return _context.abrupt("return", _context.sent);
  13227. case 3:
  13228. case "end":
  13229. return _context.stop();
  13230. }
  13231. }
  13232. }, _callee);
  13233. }));
  13234. function open(_x) {
  13235. return _open.apply(this, arguments);
  13236. }
  13237. return open;
  13238. }(),
  13239. // 上传文件
  13240. upFilse: function () {
  13241. var _upFilse = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {
  13242. var obj;
  13243. return _regenerator.default.wrap(function _callee4$(_context4) {
  13244. while (1) {
  13245. switch (_context4.prev = _context4.next) {
  13246. case 0:
  13247. obj = this;
  13248. _context4.next = 3;
  13249. return new Promise(function (resolve, reject) {
  13250. var requestData = ''; //保存处理完成后请求数据
  13251. var url = ''; //保存请求地址
  13252. try {
  13253. // 请求前数据处理
  13254. requestData = service.request.success(data);
  13255. } catch (e) {
  13256. // 请求报错拦截
  13257. service.request.error(e);
  13258. }
  13259. url = service.baseURL + requestData.url;
  13260. var config = {
  13261. // 上传图片的API
  13262. upload_img_url: url
  13263. };
  13264. var Uploader = {
  13265. // 选择图片
  13266. choose: function choose(num) {
  13267. return new Promise(function (resolve, reject) {
  13268. uni.chooseImage({
  13269. count: num,
  13270. success: function success(res) {
  13271. console.log(res);
  13272. // 缓存文件路径
  13273. resolve(res.tempFilePaths);
  13274. },
  13275. fail: function fail(err) {
  13276. console.log(err);
  13277. reject(err);
  13278. }
  13279. });
  13280. });
  13281. },
  13282. // 上传图片
  13283. upload_one: function upload_one(path) {
  13284. return new Promise(function (resolve, reject) {
  13285. uni.showLoading({
  13286. title: '上传中'
  13287. });
  13288. uni.uploadFile({
  13289. url: config.upload_img_url,
  13290. //仅为示例,非真实的接口地址
  13291. filePath: path,
  13292. name: 'file',
  13293. header: {
  13294. "Authori-zation": 'Bearer ' + uni.getStorageSync('token')
  13295. },
  13296. success: function success(uploadFileRes) {
  13297. if ("string" === typeof uploadFileRes.data) {
  13298. resolve(JSON.parse(uploadFileRes.data).data);
  13299. } else {
  13300. resolve(uploadFileRes.data.data);
  13301. }
  13302. },
  13303. complete: function complete() {
  13304. uni.hideLoading();
  13305. }
  13306. });
  13307. });
  13308. },
  13309. // 上传多个图片
  13310. upload: function upload(path_arr) {
  13311. var _this = this;
  13312. var num = path_arr.length;
  13313. return new Promise( /*#__PURE__*/function () {
  13314. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
  13315. var img_urls, i, img_url;
  13316. return _regenerator.default.wrap(function _callee2$(_context2) {
  13317. while (1) {
  13318. switch (_context2.prev = _context2.next) {
  13319. case 0:
  13320. img_urls = [];
  13321. i = 0;
  13322. case 2:
  13323. if (!(i < num)) {
  13324. _context2.next = 10;
  13325. break;
  13326. }
  13327. _context2.next = 5;
  13328. return _this.upload_one(path_arr[i]);
  13329. case 5:
  13330. img_url = _context2.sent;
  13331. img_urls.push(img_url);
  13332. case 7:
  13333. i++;
  13334. _context2.next = 2;
  13335. break;
  13336. case 10:
  13337. ;
  13338. resolve(img_urls);
  13339. case 12:
  13340. case "end":
  13341. return _context2.stop();
  13342. }
  13343. }
  13344. }, _callee2);
  13345. }));
  13346. return function (_x3, _x4) {
  13347. return _ref.apply(this, arguments);
  13348. };
  13349. }());
  13350. },
  13351. // 触发上传图片事件
  13352. choose_and_upload: function choose_and_upload(num) {
  13353. var _this2 = this;
  13354. return new Promise( /*#__PURE__*/function () {
  13355. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {
  13356. var path_arr;
  13357. return _regenerator.default.wrap(function _callee3$(_context3) {
  13358. while (1) {
  13359. switch (_context3.prev = _context3.next) {
  13360. case 0:
  13361. _context3.next = 2;
  13362. return _this2.choose(num);
  13363. case 2:
  13364. path_arr = _context3.sent;
  13365. _context3.next = 5;
  13366. return _this2.upload(path_arr).then(function (e) {
  13367. resolve(e);
  13368. }).catch(function (e) {
  13369. reject(e);
  13370. });
  13371. case 5:
  13372. case "end":
  13373. return _context3.stop();
  13374. }
  13375. }
  13376. }, _callee3);
  13377. }));
  13378. return function (_x5, _x6) {
  13379. return _ref2.apply(this, arguments);
  13380. };
  13381. }());
  13382. }
  13383. };
  13384. Uploader.choose_and_upload(1).then(function (e) {
  13385. resolve(e);
  13386. }).catch(function (e) {
  13387. console.log(e);
  13388. });
  13389. });
  13390. case 3:
  13391. return _context4.abrupt("return", _context4.sent);
  13392. case 4:
  13393. case "end":
  13394. return _context4.stop();
  13395. }
  13396. }
  13397. }, _callee4, this);
  13398. }));
  13399. function upFilse(_x2) {
  13400. return _upFilse.apply(this, arguments);
  13401. }
  13402. return upFilse;
  13403. }()
  13404. };
  13405. var _default = service;
  13406. exports.default = _default;
  13407. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  13408. /***/ }),
  13409. /***/ 74:
  13410. /*!*********************************************!*\
  13411. !*** D:/工作/项目2/亲家母/qjm/utils/loginUtils.js ***!
  13412. \*********************************************/
  13413. /*! no static exports found */
  13414. /***/ (function(module, exports, __webpack_require__) {
  13415. "use strict";
  13416. /* WEBPACK VAR INJECTION */(function(uni) {
  13417. Object.defineProperty(exports, "__esModule", {
  13418. value: true
  13419. });
  13420. exports.getActionPage = getActionPage;
  13421. exports.getPageUrl = getPageUrl;
  13422. exports.interceptor = interceptor;
  13423. exports.saveUrl = saveUrl;
  13424. function getActionPage() {
  13425. var pages = getCurrentPages();
  13426. return pages[pages.length - 1];
  13427. }
  13428. //登录拦截
  13429. function interceptor() {
  13430. var pages = getActionPage();
  13431. // 获取当前页面
  13432. var pageUrl = '/' + pages.route;
  13433. var url = '/pages/public/login';
  13434. url = '/pages/public/wxLogin';
  13435. if (pageUrl != url) {
  13436. uni.navigateTo({
  13437. url: url
  13438. });
  13439. }
  13440. }
  13441. // 保存页面
  13442. function saveUrl() {
  13443. var path = getPageUrl(true);
  13444. uni.setStorageSync('present', path);
  13445. }
  13446. // 处理分享链接地址
  13447. function getPageUrl() {
  13448. var showSpeard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  13449. var page = getActionPage();
  13450. var path = '/' + page.route;
  13451. var url = '';
  13452. // 获取对象可枚举键值列表
  13453. var objKeys = Object.keys(page.options);
  13454. // 判断有无传值
  13455. if (objKeys.length > 0) {
  13456. // 循环赋值对象数据
  13457. for (var a in page.options) {
  13458. // 判断有无邀请人
  13459. if (a != 'speard') {
  13460. url += a + "=" + page.options[a] + "&";
  13461. } else {
  13462. // 判断是否需要存储邀请人
  13463. if (showSpeard) {
  13464. url += a + "=" + page.options[a] + "&";
  13465. }
  13466. }
  13467. }
  13468. path += '?' + url.substr(0, url.length - 1);
  13469. }
  13470. // 返回处理邀请人后的邀请地址
  13471. return path;
  13472. }
  13473. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  13474. /***/ }),
  13475. /***/ 742:
  13476. /*!*******************************************************!*\
  13477. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/util/emitter.js ***!
  13478. \*******************************************************/
  13479. /*! no static exports found */
  13480. /***/ (function(module, exports, __webpack_require__) {
  13481. "use strict";
  13482. Object.defineProperty(exports, "__esModule", {
  13483. value: true
  13484. });
  13485. exports.default = void 0;
  13486. /**
  13487. * 递归使用 call 方式this指向
  13488. * @param componentName // 需要找的组件的名称
  13489. * @param eventName // 事件名称
  13490. * @param params // 需要传递的参数
  13491. */
  13492. function _broadcast(componentName, eventName, params) {
  13493. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  13494. this.$children.map(function (child) {
  13495. if (componentName === child.$options.name) {
  13496. child.$emit.apply(child, [eventName].concat(params));
  13497. } else {
  13498. _broadcast.apply(child, [componentName, eventName].concat(params));
  13499. }
  13500. });
  13501. }
  13502. var _default = {
  13503. methods: {
  13504. /**
  13505. * 派发 (向上查找) (一个)
  13506. * @param componentName // 需要找的组件的名称
  13507. * @param eventName // 事件名称
  13508. * @param params // 需要传递的参数
  13509. */
  13510. dispatch: function dispatch(componentName, eventName, params) {
  13511. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  13512. var name = parent.$options.name; // 获取当前组件实例的name
  13513. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  13514. // 循环出当前名称的一样的组件实例
  13515. while (parent && (!name || name !== componentName)) {
  13516. parent = parent.$parent;
  13517. if (parent) {
  13518. name = parent.$options.name;
  13519. }
  13520. }
  13521. // 有节点表示当前找到了name一样的实例
  13522. if (parent) {
  13523. parent.$emit.apply(parent, [eventName].concat(params));
  13524. }
  13525. },
  13526. /**
  13527. * 广播 (向下查找) (广播多个)
  13528. * @param componentName // 需要找的组件的名称
  13529. * @param eventName // 事件名称
  13530. * @param params // 需要传递的参数
  13531. */
  13532. broadcast: function broadcast(componentName, eventName, params) {
  13533. _broadcast.call(this, componentName, eventName, params);
  13534. }
  13535. }
  13536. };
  13537. exports.default = _default;
  13538. /***/ }),
  13539. /***/ 75:
  13540. /*!*************************************!*\
  13541. !*** D:/工作/项目2/亲家母/qjm/api/user.js ***!
  13542. \*************************************/
  13543. /*! no static exports found */
  13544. /***/ (function(module, exports, __webpack_require__) {
  13545. "use strict";
  13546. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13547. Object.defineProperty(exports, "__esModule", {
  13548. value: true
  13549. });
  13550. exports.addressDel = addressDel;
  13551. exports.addressEdit = addressEdit;
  13552. exports.agentLevelList = agentLevelList;
  13553. exports.agentLevelTaskList = agentLevelTaskList;
  13554. exports.articleList = articleList;
  13555. exports.cartDel = cartDel;
  13556. exports.delcollect = delcollect;
  13557. exports.details = details;
  13558. exports.edit = edit;
  13559. exports.getAddressList = getAddressList;
  13560. exports.getCartList = getCartList;
  13561. exports.getCartNum = getCartNum;
  13562. exports.getUserInfo = getUserInfo;
  13563. exports.getcollectList = getcollectList;
  13564. exports.message = message;
  13565. exports.moneyList = moneyList;
  13566. exports.myspread = myspread;
  13567. exports.orderData = orderData;
  13568. exports.setAddressDefault = setAddressDefault;
  13569. exports.spreadBanner = spreadBanner;
  13570. exports.spreadOrder = spreadOrder;
  13571. exports.subscribe = subscribe;
  13572. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  13573. // 订单统计信息
  13574. function orderData(data) {
  13575. return (0, _request.default)({
  13576. url: '/api/order/data',
  13577. method: 'get',
  13578. data: data
  13579. });
  13580. }
  13581. // 获取用户信息
  13582. function getUserInfo(data) {
  13583. return (0, _request.default)({
  13584. url: '/api/user',
  13585. method: 'get',
  13586. data: data
  13587. });
  13588. }
  13589. //用户修改信息
  13590. function edit(data) {
  13591. return (0, _request.default)({
  13592. url: '/api/user/edit',
  13593. method: 'post',
  13594. data: data
  13595. });
  13596. }
  13597. // 用户分享图
  13598. function spreadBanner(data) {
  13599. return (0, _request.default)({
  13600. url: '/api/spread/banner',
  13601. method: 'get',
  13602. data: data
  13603. });
  13604. }
  13605. // 获取地址列表
  13606. function getAddressList(data) {
  13607. return (0, _request.default)({
  13608. url: '/api/address/list',
  13609. method: 'get',
  13610. data: data
  13611. });
  13612. }
  13613. // 修改地址
  13614. function addressEdit(data) {
  13615. return (0, _request.default)({
  13616. url: '/api/address/edit',
  13617. method: 'post',
  13618. data: data
  13619. });
  13620. }
  13621. // 删除地址
  13622. function addressDel(data) {
  13623. return (0, _request.default)({
  13624. url: '/api/address/del',
  13625. method: 'post',
  13626. data: data
  13627. });
  13628. }
  13629. // 设为默认地址
  13630. function setAddressDefault(data) {
  13631. return (0, _request.default)({
  13632. url: '/api/address/default/set',
  13633. method: 'post',
  13634. data: data
  13635. });
  13636. }
  13637. // 购物车列表
  13638. function getCartList(data) {
  13639. return (0, _request.default)({
  13640. url: '/api/cart/list',
  13641. method: 'get',
  13642. data: data
  13643. });
  13644. }
  13645. // 修改购物车数量
  13646. function getCartNum(data) {
  13647. return (0, _request.default)({
  13648. url: '/api/cart/num',
  13649. method: 'post',
  13650. data: data
  13651. });
  13652. }
  13653. //删除购物车
  13654. function cartDel(data) {
  13655. return (0, _request.default)({
  13656. url: '/api/cart/del',
  13657. method: 'post',
  13658. data: data
  13659. });
  13660. }
  13661. //获取收藏夹列表
  13662. function getcollectList(data) {
  13663. return (0, _request.default)({
  13664. url: '/api/collect/user',
  13665. method: 'get',
  13666. data: data
  13667. });
  13668. }
  13669. // 取消收藏
  13670. function delcollect(data) {
  13671. return (0, _request.default)({
  13672. url: '/api/collect/del',
  13673. method: 'post',
  13674. data: data
  13675. });
  13676. }
  13677. //文章详情
  13678. function details(data, id) {
  13679. return (0, _request.default)({
  13680. url: '/api/article/details/' + id,
  13681. method: 'GET',
  13682. data: data
  13683. });
  13684. }
  13685. //文章列表
  13686. function articleList(data, id) {
  13687. return (0, _request.default)({
  13688. url: '/api/article/list/' + id,
  13689. method: 'GET',
  13690. data: data
  13691. });
  13692. }
  13693. // 列表
  13694. function moneyList(data, type) {
  13695. return (0, _request.default)({
  13696. url: '/api/money/list/' + type,
  13697. method: 'get',
  13698. data: data
  13699. });
  13700. }
  13701. //我的推广
  13702. function myspread(data) {
  13703. return (0, _request.default)({
  13704. url: '/api/spread/people',
  13705. method: 'POST',
  13706. data: data
  13707. });
  13708. }
  13709. //推广人订单
  13710. function spreadOrder(data) {
  13711. return (0, _request.default)({
  13712. url: '/api/spread/order',
  13713. method: 'POST',
  13714. data: data
  13715. });
  13716. }
  13717. //订阅消息
  13718. function subscribe(data, id) {
  13719. return (0, _request.default)({
  13720. url: '/api/seckill/subscribe/' + id,
  13721. method: 'POST',
  13722. data: data
  13723. });
  13724. }
  13725. // 系统通知
  13726. function message(data) {
  13727. return (0, _request.default)({
  13728. url: '/api/user/message',
  13729. method: 'GET',
  13730. data: data
  13731. });
  13732. }
  13733. // 会员等级列表
  13734. function agentLevelList(data) {
  13735. return (0, _request.default)({
  13736. url: '/api/user/level/grade',
  13737. method: 'GET',
  13738. data: data
  13739. });
  13740. }
  13741. // 会员列表
  13742. function agentLevelTaskList(data, id) {
  13743. return (0, _request.default)({
  13744. url: '/api/user/level/task/' + id,
  13745. method: 'GET',
  13746. data: data
  13747. });
  13748. }
  13749. /***/ }),
  13750. /***/ 76:
  13751. /*!***********************************************!*\
  13752. !*** D:/工作/项目2/亲家母/qjm/api/functionalUnit.js ***!
  13753. \***********************************************/
  13754. /*! no static exports found */
  13755. /***/ (function(module, exports, __webpack_require__) {
  13756. "use strict";
  13757. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13758. Object.defineProperty(exports, "__esModule", {
  13759. value: true
  13760. });
  13761. exports.couponsOrder = couponsOrder;
  13762. exports.getCouponsList = getCouponsList;
  13763. exports.getwCouponsList = getwCouponsList;
  13764. exports.integral = integral;
  13765. exports.integrallist = integrallist;
  13766. exports.setCoupons = setCoupons;
  13767. exports.signList = signList;
  13768. exports.signUser = signUser;
  13769. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  13770. //获取优惠券列表
  13771. function getCouponsList(data, types) {
  13772. //优惠券状态 0全部 1未使用 2已使用
  13773. return (0, _request.default)({
  13774. url: '/api/coupons/user/' + types,
  13775. method: 'get',
  13776. data: data
  13777. });
  13778. }
  13779. //优惠券列表
  13780. function getwCouponsList(data) {
  13781. return (0, _request.default)({
  13782. url: '/api/coupons',
  13783. method: 'get',
  13784. data: data
  13785. });
  13786. }
  13787. //领取优惠券
  13788. function setCoupons(data) {
  13789. return (0, _request.default)({
  13790. url: '/api/coupon/receive',
  13791. method: 'post',
  13792. data: data
  13793. });
  13794. }
  13795. //获取可使用优惠券
  13796. function couponsOrder(data, price) {
  13797. return (0, _request.default)({
  13798. url: '/api/coupons/order/' + price,
  13799. method: 'get',
  13800. data: data
  13801. });
  13802. }
  13803. // 积分列表
  13804. function integrallist(data) {
  13805. return (0, _request.default)({
  13806. url: '/api/integral/list',
  13807. method: 'get',
  13808. data: data
  13809. });
  13810. }
  13811. // 获取签到列表
  13812. function signList(data) {
  13813. return (0, _request.default)({
  13814. url: '/api/sign/list',
  13815. method: 'get',
  13816. data: data
  13817. });
  13818. }
  13819. // 点击签到
  13820. function integral(data) {
  13821. return (0, _request.default)({
  13822. url: '/api/sign/integral',
  13823. method: 'post',
  13824. data: data
  13825. });
  13826. }
  13827. // 签到信息
  13828. function signUser(data) {
  13829. return (0, _request.default)({
  13830. url: '/api/sign/user',
  13831. method: 'post',
  13832. data: data
  13833. });
  13834. }
  13835. /***/ }),
  13836. /***/ 762:
  13837. /*!***************************************!*\
  13838. !*** D:/工作/项目2/亲家母/qjm/libs/login.js ***!
  13839. \***************************************/
  13840. /*! no static exports found */
  13841. /***/ (function(module, exports, __webpack_require__) {
  13842. "use strict";
  13843. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13844. Object.defineProperty(exports, "__esModule", {
  13845. value: true
  13846. });
  13847. exports.checkLogin = checkLogin;
  13848. exports.toLogin = toLogin;
  13849. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  13850. var _cache = _interopRequireDefault(__webpack_require__(/*! ../utils/cache */ 763));
  13851. var _cache2 = __webpack_require__(/*! ./../config/cache */ 764);
  13852. function prePage() {
  13853. var pages = getCurrentPages();
  13854. var prePage = pages[pages.length - 2];
  13855. return prePage.$vm;
  13856. }
  13857. function toLogin(push, pathLogin) {
  13858. // store.commit("LOGOUT");
  13859. var path = prePage();
  13860. if (path) {
  13861. path = path.router;
  13862. if (path == undefined) {
  13863. path = location.pathname;
  13864. }
  13865. }
  13866. if (!pathLogin) pathLogin = '/page/users/login/index';
  13867. _cache.default.set('login_back_url', path);
  13868. }
  13869. function checkLogin() {
  13870. var token = _cache.default.get(_cache2.LOGIN_STATUS);
  13871. var expiresTime = _cache.default.get(_cache2.EXPIRES_TIME);
  13872. var newTime = Math.round(new Date() / 1000);
  13873. if (expiresTime < newTime || !token) {
  13874. _cache.default.clear(_cache2.LOGIN_STATUS);
  13875. _cache.default.clear(_cache2.EXPIRES_TIME);
  13876. _cache.default.clear(_cache2.USER_INFO);
  13877. _cache.default.clear(_cache2.STATE_R_KEY);
  13878. return false;
  13879. } else {
  13880. _store.default.commit('UPDATE_LOGIN', token);
  13881. var userInfo = _cache.default.get(_cache2.USER_INFO, true);
  13882. if (userInfo) {
  13883. _store.default.commit('UPDATE_USERINFO', userInfo);
  13884. }
  13885. return true;
  13886. }
  13887. }
  13888. /***/ }),
  13889. /***/ 763:
  13890. /*!****************************************!*\
  13891. !*** D:/工作/项目2/亲家母/qjm/utils/cache.js ***!
  13892. \****************************************/
  13893. /*! no static exports found */
  13894. /***/ (function(module, exports, __webpack_require__) {
  13895. "use strict";
  13896. /* WEBPACK VAR INJECTION */(function(uni) {
  13897. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13898. Object.defineProperty(exports, "__esModule", {
  13899. value: true
  13900. });
  13901. exports.default = void 0;
  13902. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  13903. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  13904. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  13905. var Cache = /*#__PURE__*/function () {
  13906. function Cache(handler) {
  13907. (0, _classCallCheck2.default)(this, Cache);
  13908. this.cacheSetHandler = uni.setStorageSync;
  13909. this.cacheGetHandler = uni.getStorageSync;
  13910. this.cacheClearHandler = uni.removeStorageSync;
  13911. this.cacheExpire = '_expire_2019_12_17_18_44';
  13912. }
  13913. /**
  13914. * 获取当前时间戳
  13915. */
  13916. (0, _createClass2.default)(Cache, [{
  13917. key: "time",
  13918. value: function time() {
  13919. return Math.round(new Date() / 1000);
  13920. }
  13921. /**
  13922. * 设置过期时间缓存
  13923. * @param {Object} key
  13924. * @param {Object} expire
  13925. */
  13926. }, {
  13927. key: "setExpireCahe",
  13928. value: function setExpireCahe(key, expire) {
  13929. expire = expire !== undefined ? expire : 0;
  13930. if (expire) {
  13931. this.cacheSetHandler(key + this.cacheExpire, this.time() + expire);
  13932. }
  13933. }
  13934. /**
  13935. * 缓存是否过期,过期自动删除
  13936. * @param {Object} key
  13937. * @param {Object} $bool true = 删除,false = 不删除
  13938. */
  13939. }, {
  13940. key: "getExpireCahe",
  13941. value: function getExpireCahe(key, $bool) {
  13942. try {
  13943. var time = this.cacheGetHandler(key + this.cacheExpire);
  13944. if (time) {
  13945. var newTime = parseInt(time);
  13946. if (time && time < this.time() && !Number.isNaN(newTime)) {
  13947. if ($bool === undefined || $bool === true) {
  13948. this.cacheClearHandler(key);
  13949. this.cacheClearHandler(key + this.cacheExpire);
  13950. }
  13951. return false;
  13952. } else return true;
  13953. } else {
  13954. return !!this.cacheGetHandler(key);
  13955. }
  13956. } catch (e) {
  13957. return false;
  13958. }
  13959. }
  13960. /**
  13961. * 设置缓存
  13962. * @param {Object} key
  13963. * @param {Object} data
  13964. */
  13965. }, {
  13966. key: "set",
  13967. value: function set(key, data, expire) {
  13968. if ((0, _typeof2.default)(data) === 'object') data = JSON.stringify(data);
  13969. try {
  13970. this.setExpireCahe(key, expire);
  13971. return this.cacheSetHandler(key, data);
  13972. } catch (e) {
  13973. return false;
  13974. }
  13975. }
  13976. /**
  13977. * 检测缓存是否存在
  13978. * @param {Object} key
  13979. */
  13980. }, {
  13981. key: "has",
  13982. value: function has(key) {
  13983. return this.getExpireCahe(key);
  13984. }
  13985. /**
  13986. * 获取缓存
  13987. * @param {Object} key
  13988. * @param {Object} $default
  13989. * @param {Object} expire
  13990. */
  13991. }, {
  13992. key: "get",
  13993. value: function get(key, $default, expire) {
  13994. try {
  13995. var isBe = this.getExpireCahe(key);
  13996. var data = this.cacheGetHandler(key);
  13997. if (data && isBe) {
  13998. if (typeof $default === 'boolean') return JSON.parse(data);else return data;
  13999. } else {
  14000. if (typeof $default === 'function') {
  14001. var value = $default();
  14002. this.set(key, value, expire);
  14003. return value;
  14004. } else {
  14005. this.set(key, $default, expire);
  14006. return $default;
  14007. }
  14008. }
  14009. } catch (e) {
  14010. return null;
  14011. }
  14012. }
  14013. /**
  14014. * 删除缓存
  14015. * @param {Object} key
  14016. */
  14017. }, {
  14018. key: "clear",
  14019. value: function clear(key) {
  14020. try {
  14021. var cahceValue = this.cacheGetHandler(key + this.cacheExpire);
  14022. if (cahceValue) this.cacheClearHandler(key + this.cacheExpire);
  14023. return this.cacheClearHandler(key);
  14024. } catch (e) {
  14025. return false;
  14026. }
  14027. }
  14028. /**
  14029. * 清除过期缓存
  14030. */
  14031. }, {
  14032. key: "clearOverdue",
  14033. value: function clearOverdue() {
  14034. // let cacheList = uni.getStorageInfoSync(),that = this;
  14035. // if (typeof cacheList.keys === 'object'){
  14036. // cacheList.keys.forEach(item=>{
  14037. // that.getExpireCahe(item);
  14038. // })
  14039. // }
  14040. }
  14041. }]);
  14042. return Cache;
  14043. }();
  14044. var _default = new Cache();
  14045. exports.default = _default;
  14046. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14047. /***/ }),
  14048. /***/ 764:
  14049. /*!*****************************************!*\
  14050. !*** D:/工作/项目2/亲家母/qjm/config/cache.js ***!
  14051. \*****************************************/
  14052. /*! no static exports found */
  14053. /***/ (function(module, exports) {
  14054. module.exports = {
  14055. //token
  14056. LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
  14057. // uid
  14058. UID: 'UID',
  14059. //�û�
  14060. USER_INFO: 'USER_INFO',
  14061. //token�����¼�
  14062. EXPIRES_TIME: 'EXPIRES_TIME',
  14063. //�Ƿ���Ȩ
  14064. WX_AUTH: 'WX_AUTH',
  14065. //���ں���Ȩcode
  14066. STATE_KEY: 'wx_authorize_state',
  14067. //�û�����
  14068. LOGINTYPE: 'loginType',
  14069. //���ں���ת����
  14070. BACK_URL: 'login_back_url',
  14071. // ����code
  14072. STATE_R_KEY: 'roution_authorize_state',
  14073. //��ȨlogoС����
  14074. LOGO_URL: 'LOGO_URL',
  14075. //模板缓存
  14076. SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
  14077. TIPS_KEY: 'TIPS_KEY',
  14078. SPREAD: 'spread',
  14079. //缓存经度
  14080. CACHE_LONGITUDE: 'LONGITUDE',
  14081. //缓存纬度
  14082. CACHE_LATITUDE: 'LATITUDE'
  14083. };
  14084. /***/ }),
  14085. /***/ 77:
  14086. /*!****************************************!*\
  14087. !*** D:/工作/项目2/亲家母/qjm/api/product.js ***!
  14088. \****************************************/
  14089. /*! no static exports found */
  14090. /***/ (function(module, exports, __webpack_require__) {
  14091. "use strict";
  14092. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14093. Object.defineProperty(exports, "__esModule", {
  14094. value: true
  14095. });
  14096. exports.cartAdd = cartAdd;
  14097. exports.collectAdd = collectAdd;
  14098. exports.collectDel = collectDel;
  14099. exports.getBargainList = getBargainList;
  14100. exports.getCategoryList = getCategoryList;
  14101. exports.getCombinationLisPink = getCombinationLisPink;
  14102. exports.getCombinationLisRemove = getCombinationLisRemove;
  14103. exports.getCombinationList = getCombinationList;
  14104. exports.getCombinationPoster = getCombinationPoster;
  14105. exports.getProducts = getProducts;
  14106. exports.getSeckillClass = getSeckillClass;
  14107. exports.getSeckillList = getSeckillList;
  14108. exports.goodsDetail = goodsDetail;
  14109. exports.groomList = groomList;
  14110. exports.groupGoods = groupGoods;
  14111. exports.poster = poster;
  14112. exports.reply_config = reply_config;
  14113. exports.reply_list = reply_list;
  14114. exports.searchKeyword = searchKeyword;
  14115. exports.seckillGoods = seckillGoods;
  14116. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  14117. // 获取商品列表
  14118. function getProducts(data) {
  14119. // {
  14120. // 参数名称 是否必须 示例 备注
  14121. // sid 否 二级分类编号
  14122. // cid 否 一级分类编号(!)
  14123. // keyword 否 搜索
  14124. // priceOrder 否 价格排序
  14125. // salesOrder 否 销量排序
  14126. // news 否 是否新品
  14127. // page 否 分页参数起始值
  14128. // limit 否 分页数步长值
  14129. // }
  14130. return (0, _request.default)({
  14131. url: '/api/products',
  14132. method: 'get',
  14133. data: data
  14134. });
  14135. }
  14136. // 获取商品详情
  14137. function goodsDetail(data, id) {
  14138. return (0, _request.default)({
  14139. url: '/api/product/detail/' + id,
  14140. method: 'get',
  14141. data: data
  14142. });
  14143. }
  14144. // 砍价列表
  14145. function getBargainList(data) {
  14146. return (0, _request.default)({
  14147. url: '/api/bargain/list',
  14148. method: 'get',
  14149. data: data
  14150. });
  14151. }
  14152. // 加入购物车
  14153. function cartAdd(data) {
  14154. return (0, _request.default)({
  14155. url: '/api/cart/add',
  14156. method: 'post',
  14157. data: data
  14158. });
  14159. }
  14160. // 收藏商品
  14161. function collectAdd(data) {
  14162. return (0, _request.default)({
  14163. url: '/api/collect/add',
  14164. method: 'post',
  14165. data: data
  14166. });
  14167. }
  14168. // 取消收藏商品
  14169. function collectDel(data) {
  14170. return (0, _request.default)({
  14171. url: '/api/collect/del',
  14172. method: 'post',
  14173. data: data
  14174. });
  14175. }
  14176. // 获取搜搜关键字
  14177. function searchKeyword(data) {
  14178. return (0, _request.default)({
  14179. url: '/api/search/keyword',
  14180. method: 'get',
  14181. data: data
  14182. });
  14183. }
  14184. // 获取热门分类信息
  14185. function groomList(data, type) {
  14186. // 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
  14187. return (0, _request.default)({
  14188. url: '/api/groom/list/' + type,
  14189. method: 'get',
  14190. data: data
  14191. });
  14192. }
  14193. // 获取秒杀商品详细
  14194. function seckillGoods(data, id) {
  14195. return (0, _request.default)({
  14196. url: '/api/seckill/detail/' + id,
  14197. method: 'get',
  14198. data: data
  14199. });
  14200. }
  14201. // 获取拼团商品详细
  14202. function groupGoods(data, id) {
  14203. return (0, _request.default)({
  14204. url: '/api/combination/detail/' + id,
  14205. method: 'get',
  14206. data: data
  14207. });
  14208. }
  14209. // 获取商品分类
  14210. function getCategoryList(data) {
  14211. return (0, _request.default)({
  14212. url: '/api/category',
  14213. method: 'get',
  14214. data: data
  14215. });
  14216. }
  14217. // 获取拼团列表
  14218. function getCombinationList(data) {
  14219. return (0, _request.default)({
  14220. url: '/api/combination/list',
  14221. method: 'get',
  14222. data: data
  14223. });
  14224. }
  14225. //取消拼团
  14226. function getCombinationLisRemove(data, id) {
  14227. return (0, _request.default)({
  14228. url: '/api/combination/remove' + id,
  14229. method: 'get',
  14230. data: data
  14231. });
  14232. }
  14233. //拼团开团页面数据
  14234. function getCombinationLisPink(data, id) {
  14235. return (0, _request.default)({
  14236. url: '/api/combination/pink/' + id,
  14237. method: 'get',
  14238. data: data
  14239. });
  14240. }
  14241. // 获取拼团海报
  14242. function getCombinationPoster(data) {
  14243. return (0, _request.default)({
  14244. url: '/api/combination/poster',
  14245. method: 'post',
  14246. data: data
  14247. });
  14248. }
  14249. // 获取秒杀分类
  14250. function getSeckillClass(data) {
  14251. return (0, _request.default)({
  14252. url: '/api/seckill/index',
  14253. method: 'get',
  14254. data: data
  14255. });
  14256. }
  14257. // 获取秒杀列表
  14258. function getSeckillList(data, id) {
  14259. return (0, _request.default)({
  14260. url: '/api/seckill/list/' + id,
  14261. method: 'get',
  14262. data: data
  14263. });
  14264. }
  14265. // 分享海报
  14266. function poster(data) {
  14267. return (0, _request.default)({
  14268. url: '/api/product/poster',
  14269. method: 'post',
  14270. data: data
  14271. });
  14272. }
  14273. // 产品评价数量和好评度
  14274. function reply_config(data, id) {
  14275. return (0, _request.default)({
  14276. url: '/api/reply/config/' + id,
  14277. method: 'get',
  14278. data: data
  14279. });
  14280. }
  14281. // 获取产品评论
  14282. function reply_list(data, id) {
  14283. return (0, _request.default)({
  14284. url: '/api/reply/list/' + id,
  14285. method: 'get',
  14286. data: data
  14287. });
  14288. }
  14289. /***/ }),
  14290. /***/ 78:
  14291. /*!*******************************************!*\
  14292. !*** D:/工作/项目2/亲家母/qjm/utils/rocessor.js ***!
  14293. \*******************************************/
  14294. /*! no static exports found */
  14295. /***/ (function(module, exports, __webpack_require__) {
  14296. "use strict";
  14297. /* WEBPACK VAR INJECTION */(function(wx) {
  14298. Object.defineProperty(exports, "__esModule", {
  14299. value: true
  14300. });
  14301. exports.getMoneyStyle = getMoneyStyle;
  14302. exports.getTime = getTime;
  14303. exports.isCardNo = isCardNo;
  14304. exports.openMap = openMap;
  14305. exports.timeComputed = timeComputed;
  14306. //身份证验证
  14307. function isCardNo(card) {
  14308. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  14309. var reg = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
  14310. if (reg.test(card) === false) {
  14311. console.log(card);
  14312. return false;
  14313. }
  14314. return true;
  14315. }
  14316. // 金额显示变化
  14317. function getMoneyStyle() {
  14318. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  14319. if (typeof value == 'string') {
  14320. value = (+value).toFixed(2);
  14321. }
  14322. if (typeof value == 'number') {
  14323. value = value.toFixed(2);
  14324. }
  14325. // 将字符串转为数组
  14326. var n = value.split("");
  14327. // 反转数组并复制循环处理
  14328. var arr = n.reverse().map(function (e, ind, ar) {
  14329. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  14330. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  14331. return e + ',';
  14332. } else {
  14333. return e;
  14334. }
  14335. });
  14336. // 反转数组回复原来排序并合并回字符串
  14337. arr = arr.reverse().join('');
  14338. return arr;
  14339. }
  14340. // 倒计时计算
  14341. // 计算倒计时时间
  14342. function timeComputed(time) {
  14343. // 获取当前时间
  14344. var actTime = new Date().getTime();
  14345. // 获取到期时间
  14346. var stopTime = time - actTime;
  14347. // 判断是否小于0
  14348. if (stopTime < 0) {
  14349. stopTime = stopTime * -1;
  14350. }
  14351. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余天数
  14352. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  14353. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  14354. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  14355. return {
  14356. hours: hours,
  14357. //倒计时小时数
  14358. minutes: minutes,
  14359. //倒计时分钟数
  14360. seconds: seconds,
  14361. //倒计时秒数
  14362. day: day //倒计时天数
  14363. };
  14364. }
  14365. // 调用打开地图方法
  14366. function openMap(e) {
  14367. var that = this;
  14368. return new Promise(function (resolve, reject) {
  14369. wx.getSetting({
  14370. success: function success(res) {
  14371. //这里判断是否有地位权限
  14372. if (!res.authSetting['scope.userLocation']) {
  14373. wx.showModal({
  14374. title: '提示',
  14375. content: '请求获取位置权限',
  14376. success: function success(res) {
  14377. if (res.confirm == false) {
  14378. // 授权失败
  14379. reject();
  14380. return false;
  14381. }
  14382. wx.openSetting({
  14383. success: function success(res) {
  14384. //如果再次拒绝则返回页面并提示
  14385. if (!res.authSetting['scope.userLocation']) {
  14386. wx.showToast({
  14387. title: '此功能需获取位置信息,请重新设置',
  14388. duration: 3000,
  14389. icon: 'none'
  14390. });
  14391. } else {
  14392. //允许授权,调用地图
  14393. resolve();
  14394. }
  14395. }
  14396. });
  14397. }
  14398. });
  14399. } else {
  14400. //如果有定位权限,调用地图
  14401. resolve();
  14402. }
  14403. }
  14404. });
  14405. });
  14406. }
  14407. //时间戳转换成时间
  14408. function getTime(time) {
  14409. var num = 13 - (time + '').length;
  14410. var l = 1; //倍数
  14411. for (var i = 0; i < num; i++) {
  14412. l += '0';
  14413. }
  14414. // 重新解析为数字
  14415. l = parseInt(l);
  14416. var date = new Date(parseInt(time) * l);
  14417. var year = date.getFullYear();
  14418. var mon = date.getMonth() + 1;
  14419. if (mon * 1 < 10) {
  14420. mon = '0' + mon;
  14421. }
  14422. var day = date.getDate();
  14423. if (day * 1 < 10) {
  14424. day = '0' + day;
  14425. }
  14426. var hours = date.getHours();
  14427. if (hours * 1 < 10) {
  14428. hours = '0' + hours;
  14429. }
  14430. var minu = date.getMinutes();
  14431. if (minu * 1 < 10) {
  14432. minu = '0' + minu;
  14433. }
  14434. var sec = date.getSeconds();
  14435. if (sec * 1 < 10) {
  14436. sec = '0' + sec;
  14437. }
  14438. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  14439. }
  14440. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  14441. /***/ }),
  14442. /***/ 790:
  14443. /*!*****************************************!*\
  14444. !*** D:/工作/项目2/亲家母/qjm/utils/upFile.js ***!
  14445. \*****************************************/
  14446. /*! no static exports found */
  14447. /***/ (function(module, exports, __webpack_require__) {
  14448. "use strict";
  14449. /* WEBPACK VAR INJECTION */(function(uni) {
  14450. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14451. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  14452. Object.defineProperty(exports, "__esModule", {
  14453. value: true
  14454. });
  14455. exports.default = void 0;
  14456. exports.toUpLnImg = toUpLnImg;
  14457. exports.toUpVideo = toUpVideo;
  14458. var qiniu = _interopRequireWildcard(__webpack_require__(/*! qiniu-js */ 791));
  14459. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  14460. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  14461. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  14462. function toUpLnImg(files, fun) {
  14463. var _this = this;
  14464. uni.showLoading({
  14465. title: '上传中...'
  14466. });
  14467. var _loop = function _loop(i) {
  14468. var file = files[i];
  14469. var imageType = /^image\//;
  14470. //判断是否为图片不是则跳过不执行下面语句
  14471. if (!imageType.test(file.type)) {
  14472. uni.hideLoading();
  14473. _this.$api.msg('格式错误');
  14474. return "continue";
  14475. }
  14476. (0, _request.default)({
  14477. url: "/Upload/wxUploudtoken",
  14478. method: 'post',
  14479. data: {}
  14480. }).then(function (_ref) {
  14481. var data = _ref.data;
  14482. console.log(data, 99);
  14483. var observable = qiniu.upload(file, file.name, data.token, {
  14484. fname: "",
  14485. params: {},
  14486. mimeType: null
  14487. }, {
  14488. useCdnDomain: true,
  14489. region: qiniu.region.z0
  14490. });
  14491. var observer = {
  14492. next: function next(res) {
  14493. console.log(res);
  14494. // ...
  14495. },
  14496. error: function error(err) {
  14497. console.log(err);
  14498. // ...
  14499. },
  14500. complete: function complete(res) {
  14501. uni.hideLoading();
  14502. this.$api.msg('上传成功');
  14503. fun('https://limg.liuniu946.com/' + res.key);
  14504. // ...
  14505. }
  14506. };
  14507. var subscription = observable.subscribe(observer); // 上传开始
  14508. });
  14509. };
  14510. for (var i = 0; i < files.length; i++) {
  14511. var _ret = _loop(i);
  14512. if (_ret === "continue") continue;
  14513. }
  14514. }
  14515. /**
  14516. * @param {Object} files 要上传的文件
  14517. * @param {Function} fun 上传成功后的回调
  14518. */
  14519. function toUpVideo(files, fun) {
  14520. var _this2 = this;
  14521. Indicator.open({
  14522. text: '上传中...',
  14523. spinnerType: 'fading-circle'
  14524. });
  14525. var _loop2 = function _loop2(i) {
  14526. var file = files[i];
  14527. var Type = /^video\//;
  14528. //判断是否为图片不是则跳过不执行下面语句
  14529. if (!Type.test(file.type)) {
  14530. uni.hideLoading();
  14531. _this2.$api.msg('格式错误');
  14532. return "continue";
  14533. }
  14534. (0, _request.default)({
  14535. url: "/Upload/wxUploudtoken",
  14536. method: 'post',
  14537. data: {}
  14538. }).then(function (_ref2) {
  14539. var data = _ref2.data;
  14540. // console.log(data);
  14541. var observable = qiniu.upload(file, file.name, data.token, {
  14542. fname: "",
  14543. params: {},
  14544. mimeType: null
  14545. }, {
  14546. useCdnDomain: true,
  14547. region: qiniu.region.z0
  14548. });
  14549. var observer = {
  14550. next: function next(res) {
  14551. console.log(res);
  14552. // ...
  14553. },
  14554. error: function error(err) {
  14555. console.log(err);
  14556. // ...
  14557. },
  14558. complete: function complete(res) {
  14559. uni.hideLoading();
  14560. this.$api.msg('上传成功');
  14561. fun('https://limg.liuniu946.com/' + res.key);
  14562. // ...
  14563. }
  14564. };
  14565. var subscription = observable.subscribe(observer); // 上传开始
  14566. });
  14567. };
  14568. for (var i = 0; i < files.length; i++) {
  14569. var _ret2 = _loop2(i);
  14570. if (_ret2 === "continue") continue;
  14571. }
  14572. }
  14573. var _default = {
  14574. toUpLnImg: toUpLnImg,
  14575. toUpVideo: toUpVideo
  14576. };
  14577. exports.default = _default;
  14578. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14579. /***/ }),
  14580. /***/ 791:
  14581. /*!************************************************************!*\
  14582. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/index.js ***!
  14583. \************************************************************/
  14584. /*! no static exports found */
  14585. /***/ (function(module, exports, __webpack_require__) {
  14586. "use strict";
  14587. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14588. Object.defineProperty(exports, "__esModule", {
  14589. value: true
  14590. });
  14591. Object.defineProperty(exports, "QiniuError", {
  14592. enumerable: true,
  14593. get: function get() {
  14594. return _errors.QiniuError;
  14595. }
  14596. });
  14597. Object.defineProperty(exports, "QiniuErrorName", {
  14598. enumerable: true,
  14599. get: function get() {
  14600. return _errors.QiniuErrorName;
  14601. }
  14602. });
  14603. Object.defineProperty(exports, "QiniuNetworkError", {
  14604. enumerable: true,
  14605. get: function get() {
  14606. return _errors.QiniuNetworkError;
  14607. }
  14608. });
  14609. Object.defineProperty(exports, "QiniuRequestError", {
  14610. enumerable: true,
  14611. get: function get() {
  14612. return _errors.QiniuRequestError;
  14613. }
  14614. });
  14615. Object.defineProperty(exports, "compressImage", {
  14616. enumerable: true,
  14617. get: function get() {
  14618. return _utils.compressImage;
  14619. }
  14620. });
  14621. Object.defineProperty(exports, "deleteUploadedChunks", {
  14622. enumerable: true,
  14623. get: function get() {
  14624. return _api.deleteUploadedChunks;
  14625. }
  14626. });
  14627. Object.defineProperty(exports, "exif", {
  14628. enumerable: true,
  14629. get: function get() {
  14630. return _image.exif;
  14631. }
  14632. });
  14633. Object.defineProperty(exports, "getHeadersForChunkUpload", {
  14634. enumerable: true,
  14635. get: function get() {
  14636. return _utils.getHeadersForChunkUpload;
  14637. }
  14638. });
  14639. Object.defineProperty(exports, "getHeadersForMkFile", {
  14640. enumerable: true,
  14641. get: function get() {
  14642. return _utils.getHeadersForMkFile;
  14643. }
  14644. });
  14645. Object.defineProperty(exports, "getUploadUrl", {
  14646. enumerable: true,
  14647. get: function get() {
  14648. return _api.getUploadUrl;
  14649. }
  14650. });
  14651. Object.defineProperty(exports, "imageInfo", {
  14652. enumerable: true,
  14653. get: function get() {
  14654. return _image.imageInfo;
  14655. }
  14656. });
  14657. Object.defineProperty(exports, "imageMogr2", {
  14658. enumerable: true,
  14659. get: function get() {
  14660. return _image.imageMogr2;
  14661. }
  14662. });
  14663. Object.defineProperty(exports, "pipeline", {
  14664. enumerable: true,
  14665. get: function get() {
  14666. return _image.pipeline;
  14667. }
  14668. });
  14669. Object.defineProperty(exports, "region", {
  14670. enumerable: true,
  14671. get: function get() {
  14672. return _config.region;
  14673. }
  14674. });
  14675. Object.defineProperty(exports, "upload", {
  14676. enumerable: true,
  14677. get: function get() {
  14678. return _upload.default;
  14679. }
  14680. });
  14681. Object.defineProperty(exports, "urlSafeBase64Decode", {
  14682. enumerable: true,
  14683. get: function get() {
  14684. return _utils.urlSafeBase64Decode;
  14685. }
  14686. });
  14687. Object.defineProperty(exports, "urlSafeBase64Encode", {
  14688. enumerable: true,
  14689. get: function get() {
  14690. return _utils.urlSafeBase64Encode;
  14691. }
  14692. });
  14693. Object.defineProperty(exports, "watermark", {
  14694. enumerable: true,
  14695. get: function get() {
  14696. return _image.watermark;
  14697. }
  14698. });
  14699. var _errors = __webpack_require__(/*! ./errors */ 792);
  14700. var _image = __webpack_require__(/*! ./image */ 793);
  14701. var _api = __webpack_require__(/*! ./api */ 805);
  14702. var _upload = _interopRequireDefault(__webpack_require__(/*! ./upload */ 803));
  14703. var _config = __webpack_require__(/*! ./config */ 801);
  14704. var _utils = __webpack_require__(/*! ./utils */ 794);
  14705. /***/ }),
  14706. /***/ 792:
  14707. /*!*******************************************************************!*\
  14708. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/errors/index.js ***!
  14709. \*******************************************************************/
  14710. /*! no static exports found */
  14711. /***/ (function(module, exports, __webpack_require__) {
  14712. "use strict";
  14713. Object.defineProperty(exports, "__esModule", {
  14714. value: true
  14715. });
  14716. exports.QiniuRequestError = exports.QiniuNetworkError = exports.QiniuErrorName = exports.QiniuError = void 0;
  14717. var __extends = void 0 && (void 0).__extends || function () {
  14718. var _extendStatics = function extendStatics(d, b) {
  14719. _extendStatics = Object.setPrototypeOf || {
  14720. __proto__: []
  14721. } instanceof Array && function (d, b) {
  14722. d.__proto__ = b;
  14723. } || function (d, b) {
  14724. for (var p in b) {
  14725. if (b.hasOwnProperty(p)) d[p] = b[p];
  14726. }
  14727. };
  14728. return _extendStatics(d, b);
  14729. };
  14730. return function (d, b) {
  14731. _extendStatics(d, b);
  14732. function __() {
  14733. this.constructor = d;
  14734. }
  14735. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  14736. };
  14737. }();
  14738. var QiniuErrorName;
  14739. exports.QiniuErrorName = QiniuErrorName;
  14740. (function (QiniuErrorName) {
  14741. // 输入错误
  14742. QiniuErrorName["InvalidFile"] = "InvalidFile";
  14743. QiniuErrorName["InvalidToken"] = "InvalidToken";
  14744. QiniuErrorName["InvalidMetadata"] = "InvalidMetadata";
  14745. QiniuErrorName["InvalidChunkSize"] = "InvalidChunkSize";
  14746. QiniuErrorName["InvalidCustomVars"] = "InvalidCustomVars";
  14747. QiniuErrorName["NotAvailableUploadHost"] = "NotAvailableUploadHost";
  14748. // 缓存相关
  14749. QiniuErrorName["ReadCacheFailed"] = "ReadCacheFailed";
  14750. QiniuErrorName["InvalidCacheData"] = "InvalidCacheData";
  14751. QiniuErrorName["WriteCacheFailed"] = "WriteCacheFailed";
  14752. QiniuErrorName["RemoveCacheFailed"] = "RemoveCacheFailed";
  14753. // 图片压缩模块相关
  14754. QiniuErrorName["GetCanvasContextFailed"] = "GetCanvasContextFailed";
  14755. QiniuErrorName["UnsupportedFileType"] = "UnsupportedFileType";
  14756. // 运行环境相关
  14757. QiniuErrorName["FileReaderReadFailed"] = "FileReaderReadFailed";
  14758. QiniuErrorName["NotAvailableXMLHttpRequest"] = "NotAvailableXMLHttpRequest";
  14759. QiniuErrorName["InvalidProgressEventTarget"] = "InvalidProgressEventTarget";
  14760. // 请求错误
  14761. QiniuErrorName["RequestError"] = "RequestError";
  14762. })(QiniuErrorName || (exports.QiniuErrorName = QiniuErrorName = {}));
  14763. var QiniuError = /** @class */function () {
  14764. function QiniuError(name, message) {
  14765. this.name = name;
  14766. this.message = message;
  14767. this.stack = new Error().stack;
  14768. }
  14769. return QiniuError;
  14770. }();
  14771. exports.QiniuError = QiniuError;
  14772. var QiniuRequestError = /** @class */function (_super) {
  14773. __extends(QiniuRequestError, _super);
  14774. function QiniuRequestError(code, reqId, message, data) {
  14775. var _this = _super.call(this, QiniuErrorName.RequestError, message) || this;
  14776. _this.code = code;
  14777. _this.reqId = reqId;
  14778. /**
  14779. * @description 标记当前的 error 类型是一个 QiniuRequestError
  14780. * @deprecated 下一个大版本将会移除,不推荐使用,推荐直接使用 instanceof 进行判断
  14781. */
  14782. _this.isRequestError = true;
  14783. _this.data = data;
  14784. return _this;
  14785. }
  14786. return QiniuRequestError;
  14787. }(QiniuError);
  14788. exports.QiniuRequestError = QiniuRequestError;
  14789. /**
  14790. * @description 由于跨域、证书错误、断网、host 解析失败、系统拦截等原因导致的错误
  14791. */
  14792. var QiniuNetworkError = /** @class */function (_super) {
  14793. __extends(QiniuNetworkError, _super);
  14794. function QiniuNetworkError(message, reqId) {
  14795. if (reqId === void 0) {
  14796. reqId = '';
  14797. }
  14798. return _super.call(this, 0, reqId, message) || this;
  14799. }
  14800. return QiniuNetworkError;
  14801. }(QiniuRequestError);
  14802. exports.QiniuNetworkError = QiniuNetworkError;
  14803. /***/ }),
  14804. /***/ 793:
  14805. /*!******************************************************************!*\
  14806. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/image/index.js ***!
  14807. \******************************************************************/
  14808. /*! no static exports found */
  14809. /***/ (function(module, exports, __webpack_require__) {
  14810. "use strict";
  14811. Object.defineProperty(exports, "__esModule", {
  14812. value: true
  14813. });
  14814. exports.exif = exif;
  14815. exports.imageInfo = imageInfo;
  14816. exports.imageMogr2 = imageMogr2;
  14817. exports.imageView2 = imageView2;
  14818. exports.pipeline = pipeline;
  14819. exports.watermark = watermark;
  14820. var _utils = __webpack_require__(/*! ../utils */ 794);
  14821. function getImageUrl(key, domain) {
  14822. key = encodeURIComponent(key);
  14823. if (domain.slice(domain.length - 1) !== '/') {
  14824. domain += '/';
  14825. }
  14826. return domain + key;
  14827. }
  14828. function imageView2(op, key, domain) {
  14829. if (!/^\d$/.test(String(op.mode))) {
  14830. throw 'mode should be number in imageView2';
  14831. }
  14832. var mode = op.mode,
  14833. w = op.w,
  14834. h = op.h,
  14835. q = op.q,
  14836. format = op.format;
  14837. if (!w && !h) {
  14838. throw 'param w and h is empty in imageView2';
  14839. }
  14840. var imageUrl = 'imageView2/' + encodeURIComponent(mode);
  14841. imageUrl += w ? '/w/' + encodeURIComponent(w) : '';
  14842. imageUrl += h ? '/h/' + encodeURIComponent(h) : '';
  14843. imageUrl += q ? '/q/' + encodeURIComponent(q) : '';
  14844. imageUrl += format ? '/format/' + encodeURIComponent(format) : '';
  14845. if (key && domain) {
  14846. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  14847. }
  14848. return imageUrl;
  14849. }
  14850. // invoke the imageMogr2 api of Qiniu
  14851. function imageMogr2(op, key, domain) {
  14852. var autoOrient = op['auto-orient'];
  14853. var thumbnail = op.thumbnail,
  14854. strip = op.strip,
  14855. gravity = op.gravity,
  14856. crop = op.crop,
  14857. quality = op.quality,
  14858. rotate = op.rotate,
  14859. format = op.format,
  14860. blur = op.blur;
  14861. var imageUrl = 'imageMogr2';
  14862. imageUrl += autoOrient ? '/auto-orient' : '';
  14863. imageUrl += thumbnail ? '/thumbnail/' + encodeURIComponent(thumbnail) : '';
  14864. imageUrl += strip ? '/strip' : '';
  14865. imageUrl += gravity ? '/gravity/' + encodeURIComponent(gravity) : '';
  14866. imageUrl += quality ? '/quality/' + encodeURIComponent(quality) : '';
  14867. imageUrl += crop ? '/crop/' + encodeURIComponent(crop) : '';
  14868. imageUrl += rotate ? '/rotate/' + encodeURIComponent(rotate) : '';
  14869. imageUrl += format ? '/format/' + encodeURIComponent(format) : '';
  14870. imageUrl += blur ? '/blur/' + encodeURIComponent(blur) : '';
  14871. if (key && domain) {
  14872. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  14873. }
  14874. return imageUrl;
  14875. }
  14876. // invoke the watermark api of Qiniu
  14877. function watermark(op, key, domain) {
  14878. var mode = op.mode;
  14879. if (!mode) {
  14880. throw "mode can't be empty in watermark";
  14881. }
  14882. var imageUrl = 'watermark/' + mode;
  14883. if (mode !== 1 && mode !== 2) {
  14884. throw 'mode is wrong';
  14885. }
  14886. if (mode === 1) {
  14887. var image = op.image;
  14888. if (!image) {
  14889. throw "image can't be empty in watermark";
  14890. }
  14891. imageUrl += image ? '/image/' + (0, _utils.urlSafeBase64Encode)(image) : '';
  14892. }
  14893. if (mode === 2) {
  14894. var text = op.text,
  14895. font = op.font,
  14896. fontsize = op.fontsize,
  14897. fill = op.fill;
  14898. if (!text) {
  14899. throw "text can't be empty in watermark";
  14900. }
  14901. imageUrl += text ? '/text/' + (0, _utils.urlSafeBase64Encode)(text) : '';
  14902. imageUrl += font ? '/font/' + (0, _utils.urlSafeBase64Encode)(font) : '';
  14903. imageUrl += fontsize ? '/fontsize/' + fontsize : '';
  14904. imageUrl += fill ? '/fill/' + (0, _utils.urlSafeBase64Encode)(fill) : '';
  14905. }
  14906. var dissolve = op.dissolve,
  14907. gravity = op.gravity,
  14908. dx = op.dx,
  14909. dy = op.dy;
  14910. imageUrl += dissolve ? '/dissolve/' + encodeURIComponent(dissolve) : '';
  14911. imageUrl += gravity ? '/gravity/' + encodeURIComponent(gravity) : '';
  14912. imageUrl += dx ? '/dx/' + encodeURIComponent(dx) : '';
  14913. imageUrl += dy ? '/dy/' + encodeURIComponent(dy) : '';
  14914. if (key && domain) {
  14915. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  14916. }
  14917. return imageUrl;
  14918. }
  14919. // invoke the imageInfo api of Qiniu
  14920. function imageInfo(key, domain) {
  14921. var url = getImageUrl(key, domain) + '?imageInfo';
  14922. return (0, _utils.request)(url, {
  14923. method: 'GET'
  14924. });
  14925. }
  14926. // invoke the exif api of Qiniu
  14927. function exif(key, domain) {
  14928. var url = getImageUrl(key, domain) + '?exif';
  14929. return (0, _utils.request)(url, {
  14930. method: 'GET'
  14931. });
  14932. }
  14933. function pipeline(arr, key, domain) {
  14934. var isArray = Object.prototype.toString.call(arr) === '[object Array]';
  14935. var option;
  14936. var errOp = false;
  14937. var imageUrl = '';
  14938. if (isArray) {
  14939. for (var i = 0, len = arr.length; i < len; i++) {
  14940. option = arr[i];
  14941. if (!option.fop) {
  14942. throw "fop can't be empty in pipeline";
  14943. }
  14944. switch (option.fop) {
  14945. case 'watermark':
  14946. imageUrl += watermark(option) + '|';
  14947. break;
  14948. case 'imageView2':
  14949. imageUrl += imageView2(option) + '|';
  14950. break;
  14951. case 'imageMogr2':
  14952. imageUrl += imageMogr2(option) + '|';
  14953. break;
  14954. default:
  14955. errOp = true;
  14956. break;
  14957. }
  14958. if (errOp) {
  14959. throw 'fop is wrong in pipeline';
  14960. }
  14961. }
  14962. if (key && domain) {
  14963. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  14964. var length_1 = imageUrl.length;
  14965. if (imageUrl.slice(length_1 - 1) === '|') {
  14966. imageUrl = imageUrl.slice(0, length_1 - 1);
  14967. }
  14968. }
  14969. return imageUrl;
  14970. }
  14971. throw "pipeline's first param should be array";
  14972. }
  14973. /***/ }),
  14974. /***/ 794:
  14975. /*!******************************************************************!*\
  14976. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/index.js ***!
  14977. \******************************************************************/
  14978. /*! no static exports found */
  14979. /***/ (function(module, exports, __webpack_require__) {
  14980. "use strict";
  14981. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14982. Object.defineProperty(exports, "__esModule", {
  14983. value: true
  14984. });
  14985. var _exportNames = {
  14986. compressImage: true
  14987. };
  14988. Object.defineProperty(exports, "compressImage", {
  14989. enumerable: true,
  14990. get: function get() {
  14991. return _compress.default;
  14992. }
  14993. });
  14994. var _pool = __webpack_require__(/*! ./pool */ 795);
  14995. Object.keys(_pool).forEach(function (key) {
  14996. if (key === "default" || key === "__esModule") return;
  14997. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  14998. if (key in exports && exports[key] === _pool[key]) return;
  14999. Object.defineProperty(exports, key, {
  15000. enumerable: true,
  15001. get: function get() {
  15002. return _pool[key];
  15003. }
  15004. });
  15005. });
  15006. var _observable = __webpack_require__(/*! ./observable */ 796);
  15007. Object.keys(_observable).forEach(function (key) {
  15008. if (key === "default" || key === "__esModule") return;
  15009. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15010. if (key in exports && exports[key] === _observable[key]) return;
  15011. Object.defineProperty(exports, key, {
  15012. enumerable: true,
  15013. get: function get() {
  15014. return _observable[key];
  15015. }
  15016. });
  15017. });
  15018. var _base = __webpack_require__(/*! ./base64 */ 797);
  15019. Object.keys(_base).forEach(function (key) {
  15020. if (key === "default" || key === "__esModule") return;
  15021. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15022. if (key in exports && exports[key] === _base[key]) return;
  15023. Object.defineProperty(exports, key, {
  15024. enumerable: true,
  15025. get: function get() {
  15026. return _base[key];
  15027. }
  15028. });
  15029. });
  15030. var _helper = __webpack_require__(/*! ./helper */ 798);
  15031. Object.keys(_helper).forEach(function (key) {
  15032. if (key === "default" || key === "__esModule") return;
  15033. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15034. if (key in exports && exports[key] === _helper[key]) return;
  15035. Object.defineProperty(exports, key, {
  15036. enumerable: true,
  15037. get: function get() {
  15038. return _helper[key];
  15039. }
  15040. });
  15041. });
  15042. var _config = __webpack_require__(/*! ./config */ 800);
  15043. Object.keys(_config).forEach(function (key) {
  15044. if (key === "default" || key === "__esModule") return;
  15045. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15046. if (key in exports && exports[key] === _config[key]) return;
  15047. Object.defineProperty(exports, key, {
  15048. enumerable: true,
  15049. get: function get() {
  15050. return _config[key];
  15051. }
  15052. });
  15053. });
  15054. var _compress = _interopRequireDefault(__webpack_require__(/*! ./compress */ 815));
  15055. /***/ }),
  15056. /***/ 795:
  15057. /*!*****************************************************************!*\
  15058. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/pool.js ***!
  15059. \*****************************************************************/
  15060. /*! no static exports found */
  15061. /***/ (function(module, exports, __webpack_require__) {
  15062. "use strict";
  15063. Object.defineProperty(exports, "__esModule", {
  15064. value: true
  15065. });
  15066. exports.Pool = void 0;
  15067. var Pool = /** @class */function () {
  15068. function Pool(runTask, limit) {
  15069. this.runTask = runTask;
  15070. this.limit = limit;
  15071. this.aborted = false;
  15072. this.queue = [];
  15073. this.processing = [];
  15074. }
  15075. Pool.prototype.enqueue = function (task) {
  15076. var _this = this;
  15077. return new Promise(function (resolve, reject) {
  15078. _this.queue.push({
  15079. task: task,
  15080. resolve: resolve,
  15081. reject: reject
  15082. });
  15083. _this.check();
  15084. });
  15085. };
  15086. Pool.prototype.run = function (item) {
  15087. var _this = this;
  15088. this.queue = this.queue.filter(function (v) {
  15089. return v !== item;
  15090. });
  15091. this.processing.push(item);
  15092. this.runTask(item.task).then(function () {
  15093. _this.processing = _this.processing.filter(function (v) {
  15094. return v !== item;
  15095. });
  15096. item.resolve();
  15097. _this.check();
  15098. }, function (err) {
  15099. return item.reject(err);
  15100. });
  15101. };
  15102. Pool.prototype.check = function () {
  15103. var _this = this;
  15104. if (this.aborted) return;
  15105. var processingNum = this.processing.length;
  15106. var availableNum = this.limit - processingNum;
  15107. this.queue.slice(0, availableNum).forEach(function (item) {
  15108. _this.run(item);
  15109. });
  15110. };
  15111. Pool.prototype.abort = function () {
  15112. this.queue = [];
  15113. this.aborted = true;
  15114. };
  15115. return Pool;
  15116. }();
  15117. exports.Pool = Pool;
  15118. /***/ }),
  15119. /***/ 796:
  15120. /*!***********************************************************************!*\
  15121. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/observable.js ***!
  15122. \***********************************************************************/
  15123. /*! no static exports found */
  15124. /***/ (function(module, exports, __webpack_require__) {
  15125. "use strict";
  15126. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15127. Object.defineProperty(exports, "__esModule", {
  15128. value: true
  15129. });
  15130. exports.Subscriber = exports.Observable = void 0;
  15131. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  15132. var __extends = void 0 && (void 0).__extends || function () {
  15133. var _extendStatics = function extendStatics(d, b) {
  15134. _extendStatics = Object.setPrototypeOf || {
  15135. __proto__: []
  15136. } instanceof Array && function (d, b) {
  15137. d.__proto__ = b;
  15138. } || function (d, b) {
  15139. for (var p in b) {
  15140. if (b.hasOwnProperty(p)) d[p] = b[p];
  15141. }
  15142. };
  15143. return _extendStatics(d, b);
  15144. };
  15145. return function (d, b) {
  15146. _extendStatics(d, b);
  15147. function __() {
  15148. this.constructor = d;
  15149. }
  15150. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15151. };
  15152. }();
  15153. var __assign = void 0 && (void 0).__assign || function () {
  15154. __assign = Object.assign || function (t) {
  15155. for (var s, i = 1, n = arguments.length; i < n; i++) {
  15156. s = arguments[i];
  15157. for (var p in s) {
  15158. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  15159. }
  15160. }
  15161. return t;
  15162. };
  15163. return __assign.apply(this, arguments);
  15164. };
  15165. /** 表示可清理的资源,比如 Observable 的执行 */
  15166. var Subscription = /** @class */function () {
  15167. function Subscription() {
  15168. /** 用来标示该 Subscription 是否被取消订阅的标示位 */
  15169. this.closed = false;
  15170. }
  15171. /** 取消 observer 的订阅 */
  15172. Subscription.prototype.unsubscribe = function () {
  15173. if (this.closed) {
  15174. return;
  15175. }
  15176. this.closed = true;
  15177. if (this._unsubscribe) {
  15178. this._unsubscribe();
  15179. }
  15180. };
  15181. /** 添加一个 tear down 在该 Subscription 的 unsubscribe() 期间调用 */
  15182. Subscription.prototype.add = function (teardown) {
  15183. this._unsubscribe = teardown;
  15184. };
  15185. return Subscription;
  15186. }();
  15187. /**
  15188. * 实现 Observer 接口并且继承 Subscription 类,Observer 是消费 Observable 值的公有 API
  15189. * 所有 Observers 都转化成了 Subscriber,以便提供类似 Subscription 的能力,比如 unsubscribe
  15190. */
  15191. var Subscriber = /** @class */function (_super) {
  15192. __extends(Subscriber, _super);
  15193. function Subscriber(observerOrNext, error, complete) {
  15194. var _this = _super.call(this) || this;
  15195. _this.isStopped = false;
  15196. if (observerOrNext && (0, _typeof2.default)(observerOrNext) === 'object') {
  15197. _this.destination = observerOrNext;
  15198. } else {
  15199. _this.destination = __assign(__assign(__assign({}, observerOrNext && {
  15200. next: observerOrNext
  15201. }), error && {
  15202. error: error
  15203. }), complete && {
  15204. complete: complete
  15205. });
  15206. }
  15207. return _this;
  15208. }
  15209. Subscriber.prototype.unsubscribe = function () {
  15210. if (this.closed) {
  15211. return;
  15212. }
  15213. this.isStopped = true;
  15214. _super.prototype.unsubscribe.call(this);
  15215. };
  15216. Subscriber.prototype.next = function (value) {
  15217. if (!this.isStopped && this.destination.next) {
  15218. this.destination.next(value);
  15219. }
  15220. };
  15221. Subscriber.prototype.error = function (err) {
  15222. if (!this.isStopped && this.destination.error) {
  15223. this.isStopped = true;
  15224. this.destination.error(err);
  15225. }
  15226. };
  15227. Subscriber.prototype.complete = function (result) {
  15228. if (!this.isStopped && this.destination.complete) {
  15229. this.isStopped = true;
  15230. this.destination.complete(result);
  15231. }
  15232. };
  15233. return Subscriber;
  15234. }(Subscription);
  15235. exports.Subscriber = Subscriber;
  15236. /** 可观察对象,当前的上传事件的集合 */
  15237. var Observable = /** @class */function () {
  15238. function Observable(_subscribe) {
  15239. this._subscribe = _subscribe;
  15240. }
  15241. Observable.prototype.subscribe = function (observerOrNext, error, complete) {
  15242. var sink = new Subscriber(observerOrNext, error, complete);
  15243. sink.add(this._subscribe(sink));
  15244. return sink;
  15245. };
  15246. return Observable;
  15247. }();
  15248. exports.Observable = Observable;
  15249. /***/ }),
  15250. /***/ 797:
  15251. /*!*******************************************************************!*\
  15252. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/base64.js ***!
  15253. \*******************************************************************/
  15254. /*! no static exports found */
  15255. /***/ (function(module, exports, __webpack_require__) {
  15256. "use strict";
  15257. Object.defineProperty(exports, "__esModule", {
  15258. value: true
  15259. });
  15260. exports.urlSafeBase64Decode = urlSafeBase64Decode;
  15261. exports.urlSafeBase64Encode = urlSafeBase64Encode;
  15262. /* eslint-disable */
  15263. // https://github.com/locutusjs/locutus/blob/master/src/php/xml/utf8_encode.js
  15264. function utf8Encode(argString) {
  15265. // http://kevin.vanzonneveld.net
  15266. // + original by: Webtoolkit.info (http://www.webtoolkit.info/)
  15267. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15268. // + improved by: sowberry
  15269. // + tweaked by: Jack
  15270. // + bugfixed by: Onno Marsman
  15271. // + improved by: Yves Sucaet
  15272. // + bugfixed by: Onno Marsman
  15273. // + bugfixed by: Ulrich
  15274. // + bugfixed by: Rafal Kukawski
  15275. // + improved by: kirilloid
  15276. // + bugfixed by: kirilloid
  15277. // * example 1: this.utf8Encode('Kevin van Zonneveld')
  15278. // * returns 1: 'Kevin van Zonneveld'
  15279. if (argString === null || typeof argString === 'undefined') {
  15280. return '';
  15281. }
  15282. var string = argString + ''; // .replace(/\r\n/g, '\n').replace(/\r/g, '\n')
  15283. var utftext = '',
  15284. start,
  15285. end,
  15286. stringl = 0;
  15287. start = end = 0;
  15288. stringl = string.length;
  15289. for (var n = 0; n < stringl; n++) {
  15290. var c1 = string.charCodeAt(n);
  15291. var enc = null;
  15292. if (c1 < 128) {
  15293. end++;
  15294. } else if (c1 > 127 && c1 < 2048) {
  15295. enc = String.fromCharCode(c1 >> 6 | 192, c1 & 63 | 128);
  15296. } else if ((c1 & 0xf800 ^ 0xd800) > 0) {
  15297. enc = String.fromCharCode(c1 >> 12 | 224, c1 >> 6 & 63 | 128, c1 & 63 | 128);
  15298. } else {
  15299. // surrogate pairs
  15300. if ((c1 & 0xfc00 ^ 0xd800) > 0) {
  15301. throw new RangeError('Unmatched trail surrogate at ' + n);
  15302. }
  15303. var c2 = string.charCodeAt(++n);
  15304. if ((c2 & 0xfc00 ^ 0xdc00) > 0) {
  15305. throw new RangeError('Unmatched lead surrogate at ' + (n - 1));
  15306. }
  15307. c1 = ((c1 & 0x3ff) << 10) + (c2 & 0x3ff) + 0x10000;
  15308. enc = String.fromCharCode(c1 >> 18 | 240, c1 >> 12 & 63 | 128, c1 >> 6 & 63 | 128, c1 & 63 | 128);
  15309. }
  15310. if (enc !== null) {
  15311. if (end > start) {
  15312. utftext += string.slice(start, end);
  15313. }
  15314. utftext += enc;
  15315. start = end = n + 1;
  15316. }
  15317. }
  15318. if (end > start) {
  15319. utftext += string.slice(start, stringl);
  15320. }
  15321. return utftext;
  15322. }
  15323. // https://github.com/locutusjs/locutus/blob/master/src/php/xml/utf8_decode.js
  15324. function utf8Decode(strData) {
  15325. // eslint-disable-line camelcase
  15326. // discuss at: https://locutus.io/php/utf8_decode/
  15327. // original by: Webtoolkit.info (https://www.webtoolkit.info/)
  15328. // input by: Aman Gupta
  15329. // input by: Brett Zamir (https://brett-zamir.me)
  15330. // improved by: Kevin van Zonneveld (https://kvz.io)
  15331. // improved by: Norman "zEh" Fuchs
  15332. // bugfixed by: hitwork
  15333. // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
  15334. // bugfixed by: Kevin van Zonneveld (https://kvz.io)
  15335. // bugfixed by: kirilloid
  15336. // bugfixed by: w35l3y (https://www.wesley.eti.br)
  15337. // example 1: utf8_decode('Kevin van Zonneveld')
  15338. // returns 1: 'Kevin van Zonneveld'
  15339. var tmpArr = [];
  15340. var i = 0;
  15341. var c1 = 0;
  15342. var seqlen = 0;
  15343. strData += '';
  15344. while (i < strData.length) {
  15345. c1 = strData.charCodeAt(i) & 0xFF;
  15346. seqlen = 0;
  15347. // https://en.wikipedia.org/wiki/UTF-8#Codepage_layout
  15348. if (c1 <= 0xBF) {
  15349. c1 = c1 & 0x7F;
  15350. seqlen = 1;
  15351. } else if (c1 <= 0xDF) {
  15352. c1 = c1 & 0x1F;
  15353. seqlen = 2;
  15354. } else if (c1 <= 0xEF) {
  15355. c1 = c1 & 0x0F;
  15356. seqlen = 3;
  15357. } else {
  15358. c1 = c1 & 0x07;
  15359. seqlen = 4;
  15360. }
  15361. for (var ai = 1; ai < seqlen; ++ai) {
  15362. c1 = c1 << 0x06 | strData.charCodeAt(ai + i) & 0x3F;
  15363. }
  15364. if (seqlen === 4) {
  15365. c1 -= 0x10000;
  15366. tmpArr.push(String.fromCharCode(0xD800 | c1 >> 10 & 0x3FF));
  15367. tmpArr.push(String.fromCharCode(0xDC00 | c1 & 0x3FF));
  15368. } else {
  15369. tmpArr.push(String.fromCharCode(c1));
  15370. }
  15371. i += seqlen;
  15372. }
  15373. return tmpArr.join('');
  15374. }
  15375. function base64Encode(data) {
  15376. // http://kevin.vanzonneveld.net
  15377. // + original by: Tyler Akins (http://rumkin.com)
  15378. // + improved by: Bayron Guevara
  15379. // + improved by: Thunder.m
  15380. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15381. // + bugfixed by: Pellentesque Malesuada
  15382. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15383. // - depends on: this.utf8Encode
  15384. // * example 1: this.base64Encode('Kevin van Zonneveld')
  15385. // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
  15386. // mozilla has this native
  15387. // - but breaks in 2.0.0.12!
  15388. // if (typeof this.window['atob'] == 'function') {
  15389. // return atob(data)
  15390. // }
  15391. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  15392. var o1,
  15393. o2,
  15394. o3,
  15395. h1,
  15396. h2,
  15397. h3,
  15398. h4,
  15399. bits,
  15400. i = 0,
  15401. ac = 0,
  15402. enc = '',
  15403. tmp_arr = [];
  15404. if (!data) {
  15405. return data;
  15406. }
  15407. data = utf8Encode(data + '');
  15408. do {
  15409. // pack three octets into four hexets
  15410. o1 = data.charCodeAt(i++);
  15411. o2 = data.charCodeAt(i++);
  15412. o3 = data.charCodeAt(i++);
  15413. bits = o1 << 16 | o2 << 8 | o3;
  15414. h1 = bits >> 18 & 0x3f;
  15415. h2 = bits >> 12 & 0x3f;
  15416. h3 = bits >> 6 & 0x3f;
  15417. h4 = bits & 0x3f;
  15418. // use hexets to index into b64, and append result to encoded string
  15419. tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
  15420. } while (i < data.length);
  15421. enc = tmp_arr.join('');
  15422. switch (data.length % 3) {
  15423. case 1:
  15424. enc = enc.slice(0, -2) + '==';
  15425. break;
  15426. case 2:
  15427. enc = enc.slice(0, -1) + '=';
  15428. break;
  15429. }
  15430. return enc;
  15431. }
  15432. function base64Decode(data) {
  15433. // http://kevin.vanzonneveld.net
  15434. // + original by: Tyler Akins (http://rumkin.com)
  15435. // + improved by: Thunder.m
  15436. // + input by: Aman Gupta
  15437. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15438. // + bugfixed by: Onno Marsman
  15439. // + bugfixed by: Pellentesque Malesuada
  15440. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15441. // + input by: Brett Zamir (http://brett-zamir.me)
  15442. // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15443. // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==')
  15444. // * returns 1: 'Kevin van Zonneveld'
  15445. // mozilla has this native
  15446. // - but breaks in 2.0.0.12!
  15447. // if (typeof this.window['atob'] == 'function') {
  15448. // return atob(data)
  15449. // }
  15450. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  15451. var o1,
  15452. o2,
  15453. o3,
  15454. h1,
  15455. h2,
  15456. h3,
  15457. h4,
  15458. bits,
  15459. i = 0,
  15460. ac = 0,
  15461. dec = '',
  15462. tmp_arr = [];
  15463. if (!data) {
  15464. return data;
  15465. }
  15466. data += '';
  15467. do {
  15468. // unpack four hexets into three octets using index points in b64
  15469. h1 = b64.indexOf(data.charAt(i++));
  15470. h2 = b64.indexOf(data.charAt(i++));
  15471. h3 = b64.indexOf(data.charAt(i++));
  15472. h4 = b64.indexOf(data.charAt(i++));
  15473. bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
  15474. o1 = bits >> 16 & 0xff;
  15475. o2 = bits >> 8 & 0xff;
  15476. o3 = bits & 0xff;
  15477. if (h3 === 64) {
  15478. tmp_arr[ac++] = String.fromCharCode(o1);
  15479. } else if (h4 === 64) {
  15480. tmp_arr[ac++] = String.fromCharCode(o1, o2);
  15481. } else {
  15482. tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
  15483. }
  15484. } while (i < data.length);
  15485. dec = tmp_arr.join('');
  15486. return utf8Decode(dec);
  15487. }
  15488. function urlSafeBase64Encode(v) {
  15489. v = base64Encode(v);
  15490. // 参考 https://tools.ietf.org/html/rfc4648#section-5
  15491. return v.replace(/\//g, '_').replace(/\+/g, '-');
  15492. }
  15493. function urlSafeBase64Decode(v) {
  15494. v = v.replace(/_/g, '/').replace(/-/g, '+');
  15495. return base64Decode(v);
  15496. }
  15497. /***/ }),
  15498. /***/ 798:
  15499. /*!*******************************************************************!*\
  15500. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/helper.js ***!
  15501. \*******************************************************************/
  15502. /*! no static exports found */
  15503. /***/ (function(module, exports, __webpack_require__) {
  15504. "use strict";
  15505. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15506. Object.defineProperty(exports, "__esModule", {
  15507. value: true
  15508. });
  15509. exports.MB = void 0;
  15510. exports.computeMd5 = computeMd5;
  15511. exports.createLocalKey = createLocalKey;
  15512. exports.createObjectURL = createObjectURL;
  15513. exports.createXHR = createXHR;
  15514. exports.getAuthHeaders = getAuthHeaders;
  15515. exports.getChunks = getChunks;
  15516. exports.getDomainFromUrl = getDomainFromUrl;
  15517. exports.getHeadersForChunkUpload = getHeadersForChunkUpload;
  15518. exports.getHeadersForMkFile = getHeadersForMkFile;
  15519. exports.getLocalFileInfo = getLocalFileInfo;
  15520. exports.getPortFromUrl = getPortFromUrl;
  15521. exports.getPutPolicy = getPutPolicy;
  15522. exports.isCustomVarsValid = isCustomVarsValid;
  15523. exports.isMetaDataValid = isMetaDataValid;
  15524. exports.readAsArrayBuffer = readAsArrayBuffer;
  15525. exports.removeLocalFileInfo = removeLocalFileInfo;
  15526. exports.request = request;
  15527. exports.setLocalFileInfo = setLocalFileInfo;
  15528. exports.sum = sum;
  15529. var _sparkMd = _interopRequireDefault(__webpack_require__(/*! spark-md5 */ 799));
  15530. var _errors = __webpack_require__(/*! ../errors */ 792);
  15531. var _base = __webpack_require__(/*! ./base64 */ 797);
  15532. var __assign = void 0 && (void 0).__assign || function () {
  15533. __assign = Object.assign || function (t) {
  15534. for (var s, i = 1, n = arguments.length; i < n; i++) {
  15535. s = arguments[i];
  15536. for (var p in s) {
  15537. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  15538. }
  15539. }
  15540. return t;
  15541. };
  15542. return __assign.apply(this, arguments);
  15543. };
  15544. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  15545. function adopt(value) {
  15546. return value instanceof P ? value : new P(function (resolve) {
  15547. resolve(value);
  15548. });
  15549. }
  15550. return new (P || (P = Promise))(function (resolve, reject) {
  15551. function fulfilled(value) {
  15552. try {
  15553. step(generator.next(value));
  15554. } catch (e) {
  15555. reject(e);
  15556. }
  15557. }
  15558. function rejected(value) {
  15559. try {
  15560. step(generator["throw"](value));
  15561. } catch (e) {
  15562. reject(e);
  15563. }
  15564. }
  15565. function step(result) {
  15566. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  15567. }
  15568. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15569. });
  15570. };
  15571. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  15572. var _ = {
  15573. label: 0,
  15574. sent: function sent() {
  15575. if (t[0] & 1) throw t[1];
  15576. return t[1];
  15577. },
  15578. trys: [],
  15579. ops: []
  15580. },
  15581. f,
  15582. y,
  15583. t,
  15584. g;
  15585. return g = {
  15586. next: verb(0),
  15587. "throw": verb(1),
  15588. "return": verb(2)
  15589. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  15590. return this;
  15591. }), g;
  15592. function verb(n) {
  15593. return function (v) {
  15594. return step([n, v]);
  15595. };
  15596. }
  15597. function step(op) {
  15598. if (f) throw new TypeError("Generator is already executing.");
  15599. while (_) {
  15600. try {
  15601. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  15602. if (y = 0, t) op = [op[0] & 2, t.value];
  15603. switch (op[0]) {
  15604. case 0:
  15605. case 1:
  15606. t = op;
  15607. break;
  15608. case 4:
  15609. _.label++;
  15610. return {
  15611. value: op[1],
  15612. done: false
  15613. };
  15614. case 5:
  15615. _.label++;
  15616. y = op[1];
  15617. op = [0];
  15618. continue;
  15619. case 7:
  15620. op = _.ops.pop();
  15621. _.trys.pop();
  15622. continue;
  15623. default:
  15624. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  15625. _ = 0;
  15626. continue;
  15627. }
  15628. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  15629. _.label = op[1];
  15630. break;
  15631. }
  15632. if (op[0] === 6 && _.label < t[1]) {
  15633. _.label = t[1];
  15634. t = op;
  15635. break;
  15636. }
  15637. if (t && _.label < t[2]) {
  15638. _.label = t[2];
  15639. _.ops.push(op);
  15640. break;
  15641. }
  15642. if (t[2]) _.ops.pop();
  15643. _.trys.pop();
  15644. continue;
  15645. }
  15646. op = body.call(thisArg, _);
  15647. } catch (e) {
  15648. op = [6, e];
  15649. y = 0;
  15650. } finally {
  15651. f = t = 0;
  15652. }
  15653. }
  15654. if (op[0] & 5) throw op[1];
  15655. return {
  15656. value: op[0] ? op[1] : void 0,
  15657. done: true
  15658. };
  15659. }
  15660. };
  15661. var MB = Math.pow(1024, 2);
  15662. // 文件分块
  15663. exports.MB = MB;
  15664. function getChunks(file, blockSize) {
  15665. var chunkByteSize = blockSize * MB; // 转换为字节
  15666. // 如果 chunkByteSize 比文件大,则直接取文件的大小
  15667. if (chunkByteSize > file.size) {
  15668. chunkByteSize = file.size;
  15669. } else {
  15670. // 因为最多 10000 chunk,所以如果 chunkSize 不符合则把每片 chunk 大小扩大两倍
  15671. while (file.size > chunkByteSize * 10000) {
  15672. chunkByteSize *= 2;
  15673. }
  15674. }
  15675. var chunks = [];
  15676. var count = Math.ceil(file.size / chunkByteSize);
  15677. for (var i = 0; i < count; i++) {
  15678. var chunk = file.slice(chunkByteSize * i, i === count - 1 ? file.size : chunkByteSize * (i + 1));
  15679. chunks.push(chunk);
  15680. }
  15681. return chunks;
  15682. }
  15683. function isMetaDataValid(params) {
  15684. return Object.keys(params).every(function (key) {
  15685. return key.indexOf('x-qn-meta-') === 0;
  15686. });
  15687. }
  15688. function isCustomVarsValid(params) {
  15689. return Object.keys(params).every(function (key) {
  15690. return key.indexOf('x:') === 0;
  15691. });
  15692. }
  15693. function sum(list) {
  15694. return list.reduce(function (data, loaded) {
  15695. return data + loaded;
  15696. }, 0);
  15697. }
  15698. function setLocalFileInfo(localKey, info, logger) {
  15699. try {
  15700. localStorage.setItem(localKey, JSON.stringify(info));
  15701. } catch (err) {
  15702. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.WriteCacheFailed, "setLocalFileInfo failed: " + localKey));
  15703. }
  15704. }
  15705. function createLocalKey(name, key, size) {
  15706. var localKey = key == null ? '_' : "_key_" + key + "_";
  15707. return "qiniu_js_sdk_upload_file_name_" + name + localKey + "size_" + size;
  15708. }
  15709. function removeLocalFileInfo(localKey, logger) {
  15710. try {
  15711. localStorage.removeItem(localKey);
  15712. } catch (err) {
  15713. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.RemoveCacheFailed, "removeLocalFileInfo failed. key: " + localKey));
  15714. }
  15715. }
  15716. function getLocalFileInfo(localKey, logger) {
  15717. var localInfoString = null;
  15718. try {
  15719. localInfoString = localStorage.getItem(localKey);
  15720. } catch (_a) {
  15721. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.ReadCacheFailed, "getLocalFileInfo failed. key: " + localKey));
  15722. }
  15723. if (localInfoString == null) {
  15724. return null;
  15725. }
  15726. var localInfo = null;
  15727. try {
  15728. localInfo = JSON.parse(localInfoString);
  15729. } catch (_b) {
  15730. // 本地信息已被破坏,直接删除
  15731. removeLocalFileInfo(localKey, logger);
  15732. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.InvalidCacheData, "getLocalFileInfo failed to parse. key: " + localKey));
  15733. }
  15734. return localInfo;
  15735. }
  15736. function getAuthHeaders(token) {
  15737. var auth = 'UpToken ' + token;
  15738. return {
  15739. Authorization: auth
  15740. };
  15741. }
  15742. function getHeadersForChunkUpload(token) {
  15743. var header = getAuthHeaders(token);
  15744. return __assign({
  15745. 'content-type': 'application/octet-stream'
  15746. }, header);
  15747. }
  15748. function getHeadersForMkFile(token) {
  15749. var header = getAuthHeaders(token);
  15750. return __assign({
  15751. 'content-type': 'application/json'
  15752. }, header);
  15753. }
  15754. function createXHR() {
  15755. if (window.XMLHttpRequest) {
  15756. return new XMLHttpRequest();
  15757. }
  15758. if (window.ActiveXObject) {
  15759. return new window.ActiveXObject('Microsoft.XMLHTTP');
  15760. }
  15761. throw new _errors.QiniuError(_errors.QiniuErrorName.NotAvailableXMLHttpRequest, 'the current environment does not support.');
  15762. }
  15763. function computeMd5(data) {
  15764. return __awaiter(this, void 0, void 0, function () {
  15765. var buffer, spark;
  15766. return __generator(this, function (_a) {
  15767. switch (_a.label) {
  15768. case 0:
  15769. return [4 /*yield*/, readAsArrayBuffer(data)];
  15770. case 1:
  15771. buffer = _a.sent();
  15772. spark = new _sparkMd.default.ArrayBuffer();
  15773. spark.append(buffer);
  15774. return [2 /*return*/, spark.end()];
  15775. }
  15776. });
  15777. });
  15778. }
  15779. function readAsArrayBuffer(data) {
  15780. return new Promise(function (resolve, reject) {
  15781. var reader = new FileReader();
  15782. // evt 类型目前存在问题 https://github.com/Microsoft/TypeScript/issues/4163
  15783. reader.onload = function (evt) {
  15784. if (evt.target) {
  15785. var body = evt.target.result;
  15786. resolve(body);
  15787. } else {
  15788. reject(new _errors.QiniuError(_errors.QiniuErrorName.InvalidProgressEventTarget, 'progress event target is undefined'));
  15789. }
  15790. };
  15791. reader.onerror = function () {
  15792. reject(new _errors.QiniuError(_errors.QiniuErrorName.FileReaderReadFailed, 'fileReader read failed'));
  15793. };
  15794. reader.readAsArrayBuffer(data);
  15795. });
  15796. }
  15797. function request(url, options) {
  15798. return new Promise(function (resolve, reject) {
  15799. var xhr = createXHR();
  15800. xhr.open(options.method, url);
  15801. if (options.onCreate) {
  15802. options.onCreate(xhr);
  15803. }
  15804. if (options.headers) {
  15805. var headers_1 = options.headers;
  15806. Object.keys(headers_1).forEach(function (k) {
  15807. xhr.setRequestHeader(k, headers_1[k]);
  15808. });
  15809. }
  15810. xhr.upload.addEventListener('progress', function (evt) {
  15811. if (evt.lengthComputable && options.onProgress) {
  15812. options.onProgress({
  15813. loaded: evt.loaded,
  15814. total: evt.total
  15815. });
  15816. }
  15817. });
  15818. xhr.onreadystatechange = function () {
  15819. var responseText = xhr.responseText;
  15820. if (xhr.readyState !== 4) {
  15821. return;
  15822. }
  15823. var reqId = xhr.getResponseHeader('x-reqId') || '';
  15824. if (xhr.status === 0) {
  15825. // 发生 0 基本都是网络错误,常见的比如跨域、断网、host 解析失败、系统拦截等等
  15826. reject(new _errors.QiniuNetworkError('network error.', reqId));
  15827. return;
  15828. }
  15829. if (xhr.status !== 200) {
  15830. var message = "xhr request failed, code: " + xhr.status;
  15831. if (responseText) {
  15832. message += " response: " + responseText;
  15833. }
  15834. var data = void 0;
  15835. try {
  15836. data = JSON.parse(responseText);
  15837. } catch (_a) {
  15838. // 无需处理该错误、可能拿到非 json 格式的响应是预期的
  15839. }
  15840. reject(new _errors.QiniuRequestError(xhr.status, reqId, message, data));
  15841. return;
  15842. }
  15843. try {
  15844. resolve({
  15845. data: JSON.parse(responseText),
  15846. reqId: reqId
  15847. });
  15848. } catch (err) {
  15849. reject(err);
  15850. }
  15851. };
  15852. xhr.send(options.body);
  15853. });
  15854. }
  15855. function getPortFromUrl(url) {
  15856. if (url && url.match) {
  15857. var groups = url.match(/(^https?)/);
  15858. if (!groups) {
  15859. return '';
  15860. }
  15861. var type = groups[1];
  15862. groups = url.match(/^https?:\/\/([^:^/]*):(\d*)/);
  15863. if (groups) {
  15864. return groups[2];
  15865. }
  15866. if (type === 'http') {
  15867. return '80';
  15868. }
  15869. return '443';
  15870. }
  15871. return '';
  15872. }
  15873. function getDomainFromUrl(url) {
  15874. if (url && url.match) {
  15875. var groups = url.match(/^https?:\/\/([^:^/]*)/);
  15876. return groups ? groups[1] : '';
  15877. }
  15878. return '';
  15879. }
  15880. function getPutPolicy(token) {
  15881. if (!token) throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'invalid token.');
  15882. var segments = token.split(':');
  15883. if (segments.length === 1) throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'invalid token segments.');
  15884. // token 构造的差异参考:https://github.com/qbox/product/blob/master/kodo/auths/UpToken.md#admin-uptoken-authorization
  15885. var assessKey = segments.length > 3 ? segments[1] : segments[0];
  15886. if (!assessKey) throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'missing assess key field.');
  15887. var putPolicy = null;
  15888. try {
  15889. putPolicy = JSON.parse((0, _base.urlSafeBase64Decode)(segments[segments.length - 1]));
  15890. } catch (error) {
  15891. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'token parse failed.');
  15892. }
  15893. if (putPolicy == null) {
  15894. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'putPolicy is null.');
  15895. }
  15896. if (putPolicy.scope == null) {
  15897. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'scope field is null.');
  15898. }
  15899. var bucketName = putPolicy.scope.split(':')[0];
  15900. if (!bucketName) {
  15901. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'resolve bucketName failed.');
  15902. }
  15903. return {
  15904. assessKey: assessKey,
  15905. bucketName: bucketName,
  15906. scope: putPolicy.scope
  15907. };
  15908. }
  15909. function createObjectURL(file) {
  15910. var URL = window.URL || window.webkitURL || window.mozURL;
  15911. // FIXME: 需要 revokeObjectURL
  15912. return URL.createObjectURL(file);
  15913. }
  15914. /***/ }),
  15915. /***/ 799:
  15916. /*!*************************************************************!*\
  15917. !*** D:/工作/项目2/亲家母/qjm/node_modules/spark-md5/spark-md5.js ***!
  15918. \*************************************************************/
  15919. /*! no static exports found */
  15920. /***/ (function(module, exports, __webpack_require__) {
  15921. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  15922. (function (factory) {
  15923. if (( false ? undefined : _typeof(exports)) === 'object') {
  15924. // Node/CommonJS
  15925. module.exports = factory();
  15926. } else if (true) {
  15927. // AMD
  15928. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  15929. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  15930. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  15931. __WEBPACK_AMD_DEFINE_FACTORY__),
  15932. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  15933. } else { var glob; }
  15934. })(function (undefined) {
  15935. 'use strict';
  15936. /*
  15937. * Fastest md5 implementation around (JKM md5).
  15938. * Credits: Joseph Myers
  15939. *
  15940. * @see http://www.myersdaily.org/joseph/javascript/md5-text.html
  15941. * @see http://jsperf.com/md5-shootout/7
  15942. */
  15943. /* this function is much faster,
  15944. so if possible we use it. Some IEs
  15945. are the only ones I know of that
  15946. need the idiotic second function,
  15947. generated by an if clause. */
  15948. var add32 = function add32(a, b) {
  15949. return a + b & 0xFFFFFFFF;
  15950. },
  15951. hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
  15952. function cmn(q, a, b, x, s, t) {
  15953. a = add32(add32(a, q), add32(x, t));
  15954. return add32(a << s | a >>> 32 - s, b);
  15955. }
  15956. function md5cycle(x, k) {
  15957. var a = x[0],
  15958. b = x[1],
  15959. c = x[2],
  15960. d = x[3];
  15961. a += (b & c | ~b & d) + k[0] - 680876936 | 0;
  15962. a = (a << 7 | a >>> 25) + b | 0;
  15963. d += (a & b | ~a & c) + k[1] - 389564586 | 0;
  15964. d = (d << 12 | d >>> 20) + a | 0;
  15965. c += (d & a | ~d & b) + k[2] + 606105819 | 0;
  15966. c = (c << 17 | c >>> 15) + d | 0;
  15967. b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
  15968. b = (b << 22 | b >>> 10) + c | 0;
  15969. a += (b & c | ~b & d) + k[4] - 176418897 | 0;
  15970. a = (a << 7 | a >>> 25) + b | 0;
  15971. d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
  15972. d = (d << 12 | d >>> 20) + a | 0;
  15973. c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
  15974. c = (c << 17 | c >>> 15) + d | 0;
  15975. b += (c & d | ~c & a) + k[7] - 45705983 | 0;
  15976. b = (b << 22 | b >>> 10) + c | 0;
  15977. a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
  15978. a = (a << 7 | a >>> 25) + b | 0;
  15979. d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
  15980. d = (d << 12 | d >>> 20) + a | 0;
  15981. c += (d & a | ~d & b) + k[10] - 42063 | 0;
  15982. c = (c << 17 | c >>> 15) + d | 0;
  15983. b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
  15984. b = (b << 22 | b >>> 10) + c | 0;
  15985. a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
  15986. a = (a << 7 | a >>> 25) + b | 0;
  15987. d += (a & b | ~a & c) + k[13] - 40341101 | 0;
  15988. d = (d << 12 | d >>> 20) + a | 0;
  15989. c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
  15990. c = (c << 17 | c >>> 15) + d | 0;
  15991. b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
  15992. b = (b << 22 | b >>> 10) + c | 0;
  15993. a += (b & d | c & ~d) + k[1] - 165796510 | 0;
  15994. a = (a << 5 | a >>> 27) + b | 0;
  15995. d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
  15996. d = (d << 9 | d >>> 23) + a | 0;
  15997. c += (d & b | a & ~b) + k[11] + 643717713 | 0;
  15998. c = (c << 14 | c >>> 18) + d | 0;
  15999. b += (c & a | d & ~a) + k[0] - 373897302 | 0;
  16000. b = (b << 20 | b >>> 12) + c | 0;
  16001. a += (b & d | c & ~d) + k[5] - 701558691 | 0;
  16002. a = (a << 5 | a >>> 27) + b | 0;
  16003. d += (a & c | b & ~c) + k[10] + 38016083 | 0;
  16004. d = (d << 9 | d >>> 23) + a | 0;
  16005. c += (d & b | a & ~b) + k[15] - 660478335 | 0;
  16006. c = (c << 14 | c >>> 18) + d | 0;
  16007. b += (c & a | d & ~a) + k[4] - 405537848 | 0;
  16008. b = (b << 20 | b >>> 12) + c | 0;
  16009. a += (b & d | c & ~d) + k[9] + 568446438 | 0;
  16010. a = (a << 5 | a >>> 27) + b | 0;
  16011. d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
  16012. d = (d << 9 | d >>> 23) + a | 0;
  16013. c += (d & b | a & ~b) + k[3] - 187363961 | 0;
  16014. c = (c << 14 | c >>> 18) + d | 0;
  16015. b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
  16016. b = (b << 20 | b >>> 12) + c | 0;
  16017. a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
  16018. a = (a << 5 | a >>> 27) + b | 0;
  16019. d += (a & c | b & ~c) + k[2] - 51403784 | 0;
  16020. d = (d << 9 | d >>> 23) + a | 0;
  16021. c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
  16022. c = (c << 14 | c >>> 18) + d | 0;
  16023. b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
  16024. b = (b << 20 | b >>> 12) + c | 0;
  16025. a += (b ^ c ^ d) + k[5] - 378558 | 0;
  16026. a = (a << 4 | a >>> 28) + b | 0;
  16027. d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
  16028. d = (d << 11 | d >>> 21) + a | 0;
  16029. c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
  16030. c = (c << 16 | c >>> 16) + d | 0;
  16031. b += (c ^ d ^ a) + k[14] - 35309556 | 0;
  16032. b = (b << 23 | b >>> 9) + c | 0;
  16033. a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
  16034. a = (a << 4 | a >>> 28) + b | 0;
  16035. d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
  16036. d = (d << 11 | d >>> 21) + a | 0;
  16037. c += (d ^ a ^ b) + k[7] - 155497632 | 0;
  16038. c = (c << 16 | c >>> 16) + d | 0;
  16039. b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
  16040. b = (b << 23 | b >>> 9) + c | 0;
  16041. a += (b ^ c ^ d) + k[13] + 681279174 | 0;
  16042. a = (a << 4 | a >>> 28) + b | 0;
  16043. d += (a ^ b ^ c) + k[0] - 358537222 | 0;
  16044. d = (d << 11 | d >>> 21) + a | 0;
  16045. c += (d ^ a ^ b) + k[3] - 722521979 | 0;
  16046. c = (c << 16 | c >>> 16) + d | 0;
  16047. b += (c ^ d ^ a) + k[6] + 76029189 | 0;
  16048. b = (b << 23 | b >>> 9) + c | 0;
  16049. a += (b ^ c ^ d) + k[9] - 640364487 | 0;
  16050. a = (a << 4 | a >>> 28) + b | 0;
  16051. d += (a ^ b ^ c) + k[12] - 421815835 | 0;
  16052. d = (d << 11 | d >>> 21) + a | 0;
  16053. c += (d ^ a ^ b) + k[15] + 530742520 | 0;
  16054. c = (c << 16 | c >>> 16) + d | 0;
  16055. b += (c ^ d ^ a) + k[2] - 995338651 | 0;
  16056. b = (b << 23 | b >>> 9) + c | 0;
  16057. a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
  16058. a = (a << 6 | a >>> 26) + b | 0;
  16059. d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
  16060. d = (d << 10 | d >>> 22) + a | 0;
  16061. c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
  16062. c = (c << 15 | c >>> 17) + d | 0;
  16063. b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
  16064. b = (b << 21 | b >>> 11) + c | 0;
  16065. a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
  16066. a = (a << 6 | a >>> 26) + b | 0;
  16067. d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
  16068. d = (d << 10 | d >>> 22) + a | 0;
  16069. c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
  16070. c = (c << 15 | c >>> 17) + d | 0;
  16071. b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
  16072. b = (b << 21 | b >>> 11) + c | 0;
  16073. a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
  16074. a = (a << 6 | a >>> 26) + b | 0;
  16075. d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
  16076. d = (d << 10 | d >>> 22) + a | 0;
  16077. c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
  16078. c = (c << 15 | c >>> 17) + d | 0;
  16079. b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
  16080. b = (b << 21 | b >>> 11) + c | 0;
  16081. a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
  16082. a = (a << 6 | a >>> 26) + b | 0;
  16083. d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
  16084. d = (d << 10 | d >>> 22) + a | 0;
  16085. c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
  16086. c = (c << 15 | c >>> 17) + d | 0;
  16087. b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
  16088. b = (b << 21 | b >>> 11) + c | 0;
  16089. x[0] = a + x[0] | 0;
  16090. x[1] = b + x[1] | 0;
  16091. x[2] = c + x[2] | 0;
  16092. x[3] = d + x[3] | 0;
  16093. }
  16094. function md5blk(s) {
  16095. var md5blks = [],
  16096. i; /* Andy King said do it this way. */
  16097. for (i = 0; i < 64; i += 4) {
  16098. md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
  16099. }
  16100. return md5blks;
  16101. }
  16102. function md5blk_array(a) {
  16103. var md5blks = [],
  16104. i; /* Andy King said do it this way. */
  16105. for (i = 0; i < 64; i += 4) {
  16106. md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
  16107. }
  16108. return md5blks;
  16109. }
  16110. function md51(s) {
  16111. var n = s.length,
  16112. state = [1732584193, -271733879, -1732584194, 271733878],
  16113. i,
  16114. length,
  16115. tail,
  16116. tmp,
  16117. lo,
  16118. hi;
  16119. for (i = 64; i <= n; i += 64) {
  16120. md5cycle(state, md5blk(s.substring(i - 64, i)));
  16121. }
  16122. s = s.substring(i - 64);
  16123. length = s.length;
  16124. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  16125. for (i = 0; i < length; i += 1) {
  16126. tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
  16127. }
  16128. tail[i >> 2] |= 0x80 << (i % 4 << 3);
  16129. if (i > 55) {
  16130. md5cycle(state, tail);
  16131. for (i = 0; i < 16; i += 1) {
  16132. tail[i] = 0;
  16133. }
  16134. }
  16135. // Beware that the final length might not fit in 32 bits so we take care of that
  16136. tmp = n * 8;
  16137. tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
  16138. lo = parseInt(tmp[2], 16);
  16139. hi = parseInt(tmp[1], 16) || 0;
  16140. tail[14] = lo;
  16141. tail[15] = hi;
  16142. md5cycle(state, tail);
  16143. return state;
  16144. }
  16145. function md51_array(a) {
  16146. var n = a.length,
  16147. state = [1732584193, -271733879, -1732584194, 271733878],
  16148. i,
  16149. length,
  16150. tail,
  16151. tmp,
  16152. lo,
  16153. hi;
  16154. for (i = 64; i <= n; i += 64) {
  16155. md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
  16156. }
  16157. // Not sure if it is a bug, however IE10 will always produce a sub array of length 1
  16158. // containing the last element of the parent array if the sub array specified starts
  16159. // beyond the length of the parent array - weird.
  16160. // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
  16161. a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);
  16162. length = a.length;
  16163. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  16164. for (i = 0; i < length; i += 1) {
  16165. tail[i >> 2] |= a[i] << (i % 4 << 3);
  16166. }
  16167. tail[i >> 2] |= 0x80 << (i % 4 << 3);
  16168. if (i > 55) {
  16169. md5cycle(state, tail);
  16170. for (i = 0; i < 16; i += 1) {
  16171. tail[i] = 0;
  16172. }
  16173. }
  16174. // Beware that the final length might not fit in 32 bits so we take care of that
  16175. tmp = n * 8;
  16176. tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
  16177. lo = parseInt(tmp[2], 16);
  16178. hi = parseInt(tmp[1], 16) || 0;
  16179. tail[14] = lo;
  16180. tail[15] = hi;
  16181. md5cycle(state, tail);
  16182. return state;
  16183. }
  16184. function rhex(n) {
  16185. var s = '',
  16186. j;
  16187. for (j = 0; j < 4; j += 1) {
  16188. s += hex_chr[n >> j * 8 + 4 & 0x0F] + hex_chr[n >> j * 8 & 0x0F];
  16189. }
  16190. return s;
  16191. }
  16192. function hex(x) {
  16193. var i;
  16194. for (i = 0; i < x.length; i += 1) {
  16195. x[i] = rhex(x[i]);
  16196. }
  16197. return x.join('');
  16198. }
  16199. // In some cases the fast add32 function cannot be used..
  16200. if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {
  16201. add32 = function add32(x, y) {
  16202. var lsw = (x & 0xFFFF) + (y & 0xFFFF),
  16203. msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  16204. return msw << 16 | lsw & 0xFFFF;
  16205. };
  16206. }
  16207. // ---------------------------------------------------
  16208. /**
  16209. * ArrayBuffer slice polyfill.
  16210. *
  16211. * @see https://github.com/ttaubert/node-arraybuffer-slice
  16212. */
  16213. if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {
  16214. (function () {
  16215. function clamp(val, length) {
  16216. val = val | 0 || 0;
  16217. if (val < 0) {
  16218. return Math.max(val + length, 0);
  16219. }
  16220. return Math.min(val, length);
  16221. }
  16222. ArrayBuffer.prototype.slice = function (from, to) {
  16223. var length = this.byteLength,
  16224. begin = clamp(from, length),
  16225. end = length,
  16226. num,
  16227. target,
  16228. targetArray,
  16229. sourceArray;
  16230. if (to !== undefined) {
  16231. end = clamp(to, length);
  16232. }
  16233. if (begin > end) {
  16234. return new ArrayBuffer(0);
  16235. }
  16236. num = end - begin;
  16237. target = new ArrayBuffer(num);
  16238. targetArray = new Uint8Array(target);
  16239. sourceArray = new Uint8Array(this, begin, num);
  16240. targetArray.set(sourceArray);
  16241. return target;
  16242. };
  16243. })();
  16244. }
  16245. // ---------------------------------------------------
  16246. /**
  16247. * Helpers.
  16248. */
  16249. function toUtf8(str) {
  16250. if (/[\u0080-\uFFFF]/.test(str)) {
  16251. str = unescape(encodeURIComponent(str));
  16252. }
  16253. return str;
  16254. }
  16255. function utf8Str2ArrayBuffer(str, returnUInt8Array) {
  16256. var length = str.length,
  16257. buff = new ArrayBuffer(length),
  16258. arr = new Uint8Array(buff),
  16259. i;
  16260. for (i = 0; i < length; i += 1) {
  16261. arr[i] = str.charCodeAt(i);
  16262. }
  16263. return returnUInt8Array ? arr : buff;
  16264. }
  16265. function arrayBuffer2Utf8Str(buff) {
  16266. return String.fromCharCode.apply(null, new Uint8Array(buff));
  16267. }
  16268. function concatenateArrayBuffers(first, second, returnUInt8Array) {
  16269. var result = new Uint8Array(first.byteLength + second.byteLength);
  16270. result.set(new Uint8Array(first));
  16271. result.set(new Uint8Array(second), first.byteLength);
  16272. return returnUInt8Array ? result : result.buffer;
  16273. }
  16274. function hexToBinaryString(hex) {
  16275. var bytes = [],
  16276. length = hex.length,
  16277. x;
  16278. for (x = 0; x < length - 1; x += 2) {
  16279. bytes.push(parseInt(hex.substr(x, 2), 16));
  16280. }
  16281. return String.fromCharCode.apply(String, bytes);
  16282. }
  16283. // ---------------------------------------------------
  16284. /**
  16285. * SparkMD5 OOP implementation.
  16286. *
  16287. * Use this class to perform an incremental md5, otherwise use the
  16288. * static methods instead.
  16289. */
  16290. function SparkMD5() {
  16291. // call reset to init the instance
  16292. this.reset();
  16293. }
  16294. /**
  16295. * Appends a string.
  16296. * A conversion will be applied if an utf8 string is detected.
  16297. *
  16298. * @param {String} str The string to be appended
  16299. *
  16300. * @return {SparkMD5} The instance itself
  16301. */
  16302. SparkMD5.prototype.append = function (str) {
  16303. // Converts the string to utf8 bytes if necessary
  16304. // Then append as binary
  16305. this.appendBinary(toUtf8(str));
  16306. return this;
  16307. };
  16308. /**
  16309. * Appends a binary string.
  16310. *
  16311. * @param {String} contents The binary string to be appended
  16312. *
  16313. * @return {SparkMD5} The instance itself
  16314. */
  16315. SparkMD5.prototype.appendBinary = function (contents) {
  16316. this._buff += contents;
  16317. this._length += contents.length;
  16318. var length = this._buff.length,
  16319. i;
  16320. for (i = 64; i <= length; i += 64) {
  16321. md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
  16322. }
  16323. this._buff = this._buff.substring(i - 64);
  16324. return this;
  16325. };
  16326. /**
  16327. * Finishes the incremental computation, reseting the internal state and
  16328. * returning the result.
  16329. *
  16330. * @param {Boolean} raw True to get the raw string, false to get the hex string
  16331. *
  16332. * @return {String} The result
  16333. */
  16334. SparkMD5.prototype.end = function (raw) {
  16335. var buff = this._buff,
  16336. length = buff.length,
  16337. i,
  16338. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  16339. ret;
  16340. for (i = 0; i < length; i += 1) {
  16341. tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);
  16342. }
  16343. this._finish(tail, length);
  16344. ret = hex(this._hash);
  16345. if (raw) {
  16346. ret = hexToBinaryString(ret);
  16347. }
  16348. this.reset();
  16349. return ret;
  16350. };
  16351. /**
  16352. * Resets the internal state of the computation.
  16353. *
  16354. * @return {SparkMD5} The instance itself
  16355. */
  16356. SparkMD5.prototype.reset = function () {
  16357. this._buff = '';
  16358. this._length = 0;
  16359. this._hash = [1732584193, -271733879, -1732584194, 271733878];
  16360. return this;
  16361. };
  16362. /**
  16363. * Gets the internal state of the computation.
  16364. *
  16365. * @return {Object} The state
  16366. */
  16367. SparkMD5.prototype.getState = function () {
  16368. return {
  16369. buff: this._buff,
  16370. length: this._length,
  16371. hash: this._hash.slice()
  16372. };
  16373. };
  16374. /**
  16375. * Gets the internal state of the computation.
  16376. *
  16377. * @param {Object} state The state
  16378. *
  16379. * @return {SparkMD5} The instance itself
  16380. */
  16381. SparkMD5.prototype.setState = function (state) {
  16382. this._buff = state.buff;
  16383. this._length = state.length;
  16384. this._hash = state.hash;
  16385. return this;
  16386. };
  16387. /**
  16388. * Releases memory used by the incremental buffer and other additional
  16389. * resources. If you plan to use the instance again, use reset instead.
  16390. */
  16391. SparkMD5.prototype.destroy = function () {
  16392. delete this._hash;
  16393. delete this._buff;
  16394. delete this._length;
  16395. };
  16396. /**
  16397. * Finish the final calculation based on the tail.
  16398. *
  16399. * @param {Array} tail The tail (will be modified)
  16400. * @param {Number} length The length of the remaining buffer
  16401. */
  16402. SparkMD5.prototype._finish = function (tail, length) {
  16403. var i = length,
  16404. tmp,
  16405. lo,
  16406. hi;
  16407. tail[i >> 2] |= 0x80 << (i % 4 << 3);
  16408. if (i > 55) {
  16409. md5cycle(this._hash, tail);
  16410. for (i = 0; i < 16; i += 1) {
  16411. tail[i] = 0;
  16412. }
  16413. }
  16414. // Do the final computation based on the tail and length
  16415. // Beware that the final length may not fit in 32 bits so we take care of that
  16416. tmp = this._length * 8;
  16417. tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
  16418. lo = parseInt(tmp[2], 16);
  16419. hi = parseInt(tmp[1], 16) || 0;
  16420. tail[14] = lo;
  16421. tail[15] = hi;
  16422. md5cycle(this._hash, tail);
  16423. };
  16424. /**
  16425. * Performs the md5 hash on a string.
  16426. * A conversion will be applied if utf8 string is detected.
  16427. *
  16428. * @param {String} str The string
  16429. * @param {Boolean} [raw] True to get the raw string, false to get the hex string
  16430. *
  16431. * @return {String} The result
  16432. */
  16433. SparkMD5.hash = function (str, raw) {
  16434. // Converts the string to utf8 bytes if necessary
  16435. // Then compute it using the binary function
  16436. return SparkMD5.hashBinary(toUtf8(str), raw);
  16437. };
  16438. /**
  16439. * Performs the md5 hash on a binary string.
  16440. *
  16441. * @param {String} content The binary string
  16442. * @param {Boolean} [raw] True to get the raw string, false to get the hex string
  16443. *
  16444. * @return {String} The result
  16445. */
  16446. SparkMD5.hashBinary = function (content, raw) {
  16447. var hash = md51(content),
  16448. ret = hex(hash);
  16449. return raw ? hexToBinaryString(ret) : ret;
  16450. };
  16451. // ---------------------------------------------------
  16452. /**
  16453. * SparkMD5 OOP implementation for array buffers.
  16454. *
  16455. * Use this class to perform an incremental md5 ONLY for array buffers.
  16456. */
  16457. SparkMD5.ArrayBuffer = function () {
  16458. // call reset to init the instance
  16459. this.reset();
  16460. };
  16461. /**
  16462. * Appends an array buffer.
  16463. *
  16464. * @param {ArrayBuffer} arr The array to be appended
  16465. *
  16466. * @return {SparkMD5.ArrayBuffer} The instance itself
  16467. */
  16468. SparkMD5.ArrayBuffer.prototype.append = function (arr) {
  16469. var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),
  16470. length = buff.length,
  16471. i;
  16472. this._length += arr.byteLength;
  16473. for (i = 64; i <= length; i += 64) {
  16474. md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
  16475. }
  16476. this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);
  16477. return this;
  16478. };
  16479. /**
  16480. * Finishes the incremental computation, reseting the internal state and
  16481. * returning the result.
  16482. *
  16483. * @param {Boolean} raw True to get the raw string, false to get the hex string
  16484. *
  16485. * @return {String} The result
  16486. */
  16487. SparkMD5.ArrayBuffer.prototype.end = function (raw) {
  16488. var buff = this._buff,
  16489. length = buff.length,
  16490. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  16491. i,
  16492. ret;
  16493. for (i = 0; i < length; i += 1) {
  16494. tail[i >> 2] |= buff[i] << (i % 4 << 3);
  16495. }
  16496. this._finish(tail, length);
  16497. ret = hex(this._hash);
  16498. if (raw) {
  16499. ret = hexToBinaryString(ret);
  16500. }
  16501. this.reset();
  16502. return ret;
  16503. };
  16504. /**
  16505. * Resets the internal state of the computation.
  16506. *
  16507. * @return {SparkMD5.ArrayBuffer} The instance itself
  16508. */
  16509. SparkMD5.ArrayBuffer.prototype.reset = function () {
  16510. this._buff = new Uint8Array(0);
  16511. this._length = 0;
  16512. this._hash = [1732584193, -271733879, -1732584194, 271733878];
  16513. return this;
  16514. };
  16515. /**
  16516. * Gets the internal state of the computation.
  16517. *
  16518. * @return {Object} The state
  16519. */
  16520. SparkMD5.ArrayBuffer.prototype.getState = function () {
  16521. var state = SparkMD5.prototype.getState.call(this);
  16522. // Convert buffer to a string
  16523. state.buff = arrayBuffer2Utf8Str(state.buff);
  16524. return state;
  16525. };
  16526. /**
  16527. * Gets the internal state of the computation.
  16528. *
  16529. * @param {Object} state The state
  16530. *
  16531. * @return {SparkMD5.ArrayBuffer} The instance itself
  16532. */
  16533. SparkMD5.ArrayBuffer.prototype.setState = function (state) {
  16534. // Convert string to buffer
  16535. state.buff = utf8Str2ArrayBuffer(state.buff, true);
  16536. return SparkMD5.prototype.setState.call(this, state);
  16537. };
  16538. SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
  16539. SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
  16540. /**
  16541. * Performs the md5 hash on an array buffer.
  16542. *
  16543. * @param {ArrayBuffer} arr The array buffer
  16544. * @param {Boolean} [raw] True to get the raw string, false to get the hex one
  16545. *
  16546. * @return {String} The result
  16547. */
  16548. SparkMD5.ArrayBuffer.hash = function (arr, raw) {
  16549. var hash = md51_array(new Uint8Array(arr)),
  16550. ret = hex(hash);
  16551. return raw ? hexToBinaryString(ret) : ret;
  16552. };
  16553. return SparkMD5;
  16554. });
  16555. /***/ }),
  16556. /***/ 8:
  16557. /*!***************************************************************************!*\
  16558. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  16559. \***************************************************************************/
  16560. /*! no static exports found */
  16561. /***/ (function(module, exports, __webpack_require__) {
  16562. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  16563. function _unsupportedIterableToArray(o, minLen) {
  16564. if (!o) return;
  16565. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  16566. var n = Object.prototype.toString.call(o).slice(8, -1);
  16567. if (n === "Object" && o.constructor) n = o.constructor.name;
  16568. if (n === "Map" || n === "Set") return Array.from(o);
  16569. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  16570. }
  16571. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  16572. /***/ }),
  16573. /***/ 800:
  16574. /*!*******************************************************************!*\
  16575. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/config.js ***!
  16576. \*******************************************************************/
  16577. /*! no static exports found */
  16578. /***/ (function(module, exports, __webpack_require__) {
  16579. "use strict";
  16580. Object.defineProperty(exports, "__esModule", {
  16581. value: true
  16582. });
  16583. exports.normalizeUploadConfig = normalizeUploadConfig;
  16584. var _config = __webpack_require__(/*! ../config */ 801);
  16585. var _upload = __webpack_require__(/*! ../upload */ 803);
  16586. var __assign = void 0 && (void 0).__assign || function () {
  16587. __assign = Object.assign || function (t) {
  16588. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16589. s = arguments[i];
  16590. for (var p in s) {
  16591. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16592. }
  16593. }
  16594. return t;
  16595. };
  16596. return __assign.apply(this, arguments);
  16597. };
  16598. var __rest = void 0 && (void 0).__rest || function (s, e) {
  16599. var t = {};
  16600. for (var p in s) {
  16601. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  16602. }
  16603. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  16604. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  16605. }
  16606. return t;
  16607. };
  16608. var __read = void 0 && (void 0).__read || function (o, n) {
  16609. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16610. if (!m) return o;
  16611. var i = m.call(o),
  16612. r,
  16613. ar = [],
  16614. e;
  16615. try {
  16616. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  16617. ar.push(r.value);
  16618. }
  16619. } catch (error) {
  16620. e = {
  16621. error: error
  16622. };
  16623. } finally {
  16624. try {
  16625. if (r && !r.done && (m = i["return"])) m.call(i);
  16626. } finally {
  16627. if (e) throw e.error;
  16628. }
  16629. }
  16630. return ar;
  16631. };
  16632. var __spread = void 0 && (void 0).__spread || function () {
  16633. for (var ar = [], i = 0; i < arguments.length; i++) {
  16634. ar = ar.concat(__read(arguments[i]));
  16635. }
  16636. return ar;
  16637. };
  16638. function normalizeUploadConfig(config, logger) {
  16639. var _a = __assign({}, config),
  16640. upprotocol = _a.upprotocol,
  16641. uphost = _a.uphost,
  16642. otherConfig = __rest(_a, ["upprotocol", "uphost"]);
  16643. var normalizeConfig = __assign({
  16644. uphost: [],
  16645. retryCount: 3,
  16646. checkByMD5: false,
  16647. forceDirect: false,
  16648. useCdnDomain: true,
  16649. checkByServer: false,
  16650. concurrentRequestLimit: 3,
  16651. chunkSize: _upload.DEFAULT_CHUNK_SIZE,
  16652. upprotocol: 'https',
  16653. debugLogLevel: 'OFF',
  16654. disableStatisticsReport: false
  16655. }, otherConfig);
  16656. // 兼容原来的 http: https: 的写法
  16657. if (upprotocol) {
  16658. normalizeConfig.upprotocol = upprotocol.replace(/:$/, '');
  16659. }
  16660. var hostList = [];
  16661. if (logger && (config === null || config === void 0 ? void 0 : config.uphost) != null && (config === null || config === void 0 ? void 0 : config.region) != null) {
  16662. logger.warn('do not use both the uphost and region config.');
  16663. }
  16664. // 如果同时指定了 uphost 参数,添加到可用 host 列表
  16665. if (uphost) {
  16666. if (Array.isArray(uphost)) {
  16667. hostList.push.apply(hostList, __spread(uphost));
  16668. } else {
  16669. hostList.push(uphost);
  16670. }
  16671. // 否则如果用户传了 region,添加指定 region 的 host 到可用 host 列表
  16672. } else if (normalizeConfig === null || normalizeConfig === void 0 ? void 0 : normalizeConfig.region) {
  16673. var hostMap = _config.regionUphostMap[normalizeConfig === null || normalizeConfig === void 0 ? void 0 : normalizeConfig.region];
  16674. if (normalizeConfig.useCdnDomain) {
  16675. hostList.push.apply(hostList, __spread(hostMap.cdnUphost));
  16676. } else {
  16677. hostList.push.apply(hostList, __spread(hostMap.srcUphost));
  16678. }
  16679. }
  16680. return __assign(__assign({}, normalizeConfig), {
  16681. uphost: hostList.filter(Boolean)
  16682. });
  16683. }
  16684. /***/ }),
  16685. /***/ 801:
  16686. /*!*******************************************************************!*\
  16687. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/config/index.js ***!
  16688. \*******************************************************************/
  16689. /*! no static exports found */
  16690. /***/ (function(module, exports, __webpack_require__) {
  16691. "use strict";
  16692. Object.defineProperty(exports, "__esModule", {
  16693. value: true
  16694. });
  16695. var _region = __webpack_require__(/*! ./region */ 802);
  16696. Object.keys(_region).forEach(function (key) {
  16697. if (key === "default" || key === "__esModule") return;
  16698. if (key in exports && exports[key] === _region[key]) return;
  16699. Object.defineProperty(exports, key, {
  16700. enumerable: true,
  16701. get: function get() {
  16702. return _region[key];
  16703. }
  16704. });
  16705. });
  16706. /***/ }),
  16707. /***/ 802:
  16708. /*!********************************************************************!*\
  16709. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/config/region.js ***!
  16710. \********************************************************************/
  16711. /*! no static exports found */
  16712. /***/ (function(module, exports, __webpack_require__) {
  16713. "use strict";
  16714. Object.defineProperty(exports, "__esModule", {
  16715. value: true
  16716. });
  16717. exports.regionUphostMap = exports.region = void 0;
  16718. var _a;
  16719. /** 上传区域 */
  16720. var region = {
  16721. z0: 'z0',
  16722. z1: 'z1',
  16723. z2: 'z2',
  16724. na0: 'na0',
  16725. as0: 'as0',
  16726. cnEast2: 'cn-east-2'
  16727. };
  16728. /** 上传区域对应的 host */
  16729. exports.region = region;
  16730. var regionUphostMap = (_a = {}, _a[region.z0] = {
  16731. srcUphost: ['up.qiniup.com'],
  16732. cdnUphost: ['upload.qiniup.com']
  16733. }, _a[region.z1] = {
  16734. srcUphost: ['up-z1.qiniup.com'],
  16735. cdnUphost: ['upload-z1.qiniup.com']
  16736. }, _a[region.z2] = {
  16737. srcUphost: ['up-z2.qiniup.com'],
  16738. cdnUphost: ['upload-z2.qiniup.com']
  16739. }, _a[region.na0] = {
  16740. srcUphost: ['up-na0.qiniup.com'],
  16741. cdnUphost: ['upload-na0.qiniup.com']
  16742. }, _a[region.as0] = {
  16743. srcUphost: ['up-as0.qiniup.com'],
  16744. cdnUphost: ['upload-as0.qiniup.com']
  16745. }, _a[region.cnEast2] = {
  16746. srcUphost: ['up-cn-east-2.qiniup.com'],
  16747. cdnUphost: ['upload-cn-east-2.qiniup.com']
  16748. }, _a);
  16749. exports.regionUphostMap = regionUphostMap;
  16750. /***/ }),
  16751. /***/ 803:
  16752. /*!*******************************************************************!*\
  16753. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/index.js ***!
  16754. \*******************************************************************/
  16755. /*! no static exports found */
  16756. /***/ (function(module, exports, __webpack_require__) {
  16757. "use strict";
  16758. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16759. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  16760. Object.defineProperty(exports, "__esModule", {
  16761. value: true
  16762. });
  16763. var _exportNames = {
  16764. createUploadManager: true
  16765. };
  16766. exports.createUploadManager = createUploadManager;
  16767. exports.default = upload;
  16768. var _resume = _interopRequireWildcard(__webpack_require__(/*! ./resume */ 804));
  16769. Object.keys(_resume).forEach(function (key) {
  16770. if (key === "default" || key === "__esModule") return;
  16771. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16772. if (key in exports && exports[key] === _resume[key]) return;
  16773. Object.defineProperty(exports, key, {
  16774. enumerable: true,
  16775. get: function get() {
  16776. return _resume[key];
  16777. }
  16778. });
  16779. });
  16780. var _direct = _interopRequireDefault(__webpack_require__(/*! ./direct */ 810));
  16781. var _logger = _interopRequireDefault(__webpack_require__(/*! ../logger */ 812));
  16782. var _utils = __webpack_require__(/*! ../utils */ 794);
  16783. var _hosts = __webpack_require__(/*! ./hosts */ 814);
  16784. var _base = __webpack_require__(/*! ./base */ 809);
  16785. Object.keys(_base).forEach(function (key) {
  16786. if (key === "default" || key === "__esModule") return;
  16787. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16788. if (key in exports && exports[key] === _base[key]) return;
  16789. Object.defineProperty(exports, key, {
  16790. enumerable: true,
  16791. get: function get() {
  16792. return _base[key];
  16793. }
  16794. });
  16795. });
  16796. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  16797. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  16798. function createUploadManager(options, handlers, hostPool, logger) {
  16799. if (options.config && options.config.forceDirect) {
  16800. logger.info('ues forceDirect mode.');
  16801. return new _direct.default(options, handlers, hostPool, logger);
  16802. }
  16803. if (options.file.size > 4 * _utils.MB) {
  16804. logger.info('file size over 4M, use Resume.');
  16805. return new _resume.default(options, handlers, hostPool, logger);
  16806. }
  16807. logger.info('file size less or equal than 4M, use Direct.');
  16808. return new _direct.default(options, handlers, hostPool, logger);
  16809. }
  16810. /**
  16811. * @param file 上传文件
  16812. * @param key 目标文件名
  16813. * @param token 上传凭证
  16814. * @param putExtra 上传文件的相关资源信息配置
  16815. * @param config 上传任务的配置
  16816. * @returns 返回用于上传任务的可观察对象
  16817. */
  16818. function upload(file, key, token, putExtra, config) {
  16819. // 为每个任务创建单独的 Logger
  16820. var logger = new _logger.default(token, config === null || config === void 0 ? void 0 : config.disableStatisticsReport, config === null || config === void 0 ? void 0 : config.debugLogLevel, file.name);
  16821. var options = {
  16822. file: file,
  16823. key: key,
  16824. token: token,
  16825. putExtra: putExtra,
  16826. config: (0, _utils.normalizeUploadConfig)(config, logger)
  16827. };
  16828. // 创建 host 池
  16829. var hostPool = new _hosts.HostPool(options.config.uphost);
  16830. return new _utils.Observable(function (observer) {
  16831. var manager = createUploadManager(options, {
  16832. onData: function onData(data) {
  16833. return observer.next(data);
  16834. },
  16835. onError: function onError(err) {
  16836. return observer.error(err);
  16837. },
  16838. onComplete: function onComplete(res) {
  16839. return observer.complete(res);
  16840. }
  16841. }, hostPool, logger);
  16842. manager.putFile();
  16843. return manager.stop.bind(manager);
  16844. });
  16845. }
  16846. /***/ }),
  16847. /***/ 804:
  16848. /*!********************************************************************!*\
  16849. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/resume.js ***!
  16850. \********************************************************************/
  16851. /*! no static exports found */
  16852. /***/ (function(module, exports, __webpack_require__) {
  16853. "use strict";
  16854. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16855. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  16856. Object.defineProperty(exports, "__esModule", {
  16857. value: true
  16858. });
  16859. exports.default = void 0;
  16860. var _api = __webpack_require__(/*! ../api */ 805);
  16861. var _errors = __webpack_require__(/*! ../errors */ 792);
  16862. var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ 794));
  16863. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 809));
  16864. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  16865. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  16866. var __extends = void 0 && (void 0).__extends || function () {
  16867. var _extendStatics = function extendStatics(d, b) {
  16868. _extendStatics = Object.setPrototypeOf || {
  16869. __proto__: []
  16870. } instanceof Array && function (d, b) {
  16871. d.__proto__ = b;
  16872. } || function (d, b) {
  16873. for (var p in b) {
  16874. if (b.hasOwnProperty(p)) d[p] = b[p];
  16875. }
  16876. };
  16877. return _extendStatics(d, b);
  16878. };
  16879. return function (d, b) {
  16880. _extendStatics(d, b);
  16881. function __() {
  16882. this.constructor = d;
  16883. }
  16884. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16885. };
  16886. }();
  16887. var __assign = void 0 && (void 0).__assign || function () {
  16888. __assign = Object.assign || function (t) {
  16889. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16890. s = arguments[i];
  16891. for (var p in s) {
  16892. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16893. }
  16894. }
  16895. return t;
  16896. };
  16897. return __assign.apply(this, arguments);
  16898. };
  16899. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  16900. function adopt(value) {
  16901. return value instanceof P ? value : new P(function (resolve) {
  16902. resolve(value);
  16903. });
  16904. }
  16905. return new (P || (P = Promise))(function (resolve, reject) {
  16906. function fulfilled(value) {
  16907. try {
  16908. step(generator.next(value));
  16909. } catch (e) {
  16910. reject(e);
  16911. }
  16912. }
  16913. function rejected(value) {
  16914. try {
  16915. step(generator["throw"](value));
  16916. } catch (e) {
  16917. reject(e);
  16918. }
  16919. }
  16920. function step(result) {
  16921. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  16922. }
  16923. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16924. });
  16925. };
  16926. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  16927. var _ = {
  16928. label: 0,
  16929. sent: function sent() {
  16930. if (t[0] & 1) throw t[1];
  16931. return t[1];
  16932. },
  16933. trys: [],
  16934. ops: []
  16935. },
  16936. f,
  16937. y,
  16938. t,
  16939. g;
  16940. return g = {
  16941. next: verb(0),
  16942. "throw": verb(1),
  16943. "return": verb(2)
  16944. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  16945. return this;
  16946. }), g;
  16947. function verb(n) {
  16948. return function (v) {
  16949. return step([n, v]);
  16950. };
  16951. }
  16952. function step(op) {
  16953. if (f) throw new TypeError("Generator is already executing.");
  16954. while (_) {
  16955. try {
  16956. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  16957. if (y = 0, t) op = [op[0] & 2, t.value];
  16958. switch (op[0]) {
  16959. case 0:
  16960. case 1:
  16961. t = op;
  16962. break;
  16963. case 4:
  16964. _.label++;
  16965. return {
  16966. value: op[1],
  16967. done: false
  16968. };
  16969. case 5:
  16970. _.label++;
  16971. y = op[1];
  16972. op = [0];
  16973. continue;
  16974. case 7:
  16975. op = _.ops.pop();
  16976. _.trys.pop();
  16977. continue;
  16978. default:
  16979. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  16980. _ = 0;
  16981. continue;
  16982. }
  16983. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  16984. _.label = op[1];
  16985. break;
  16986. }
  16987. if (op[0] === 6 && _.label < t[1]) {
  16988. _.label = t[1];
  16989. t = op;
  16990. break;
  16991. }
  16992. if (t && _.label < t[2]) {
  16993. _.label = t[2];
  16994. _.ops.push(op);
  16995. break;
  16996. }
  16997. if (t[2]) _.ops.pop();
  16998. _.trys.pop();
  16999. continue;
  17000. }
  17001. op = body.call(thisArg, _);
  17002. } catch (e) {
  17003. op = [6, e];
  17004. y = 0;
  17005. } finally {
  17006. f = t = 0;
  17007. }
  17008. }
  17009. if (op[0] & 5) throw op[1];
  17010. return {
  17011. value: op[0] ? op[1] : void 0,
  17012. done: true
  17013. };
  17014. }
  17015. };
  17016. /** 是否为正整数 */
  17017. function isPositiveInteger(n) {
  17018. var re = /^[1-9]\d*$/;
  17019. return re.test(String(n));
  17020. }
  17021. var Resume = /** @class */function (_super) {
  17022. __extends(Resume, _super);
  17023. function Resume() {
  17024. return _super !== null && _super.apply(this, arguments) || this;
  17025. }
  17026. /**
  17027. * @returns {Promise<ResponseSuccess<any>>}
  17028. * @description 实现了 Base 的 run 接口,处理具体的分片上传事务,并抛出过程中的异常。
  17029. */
  17030. Resume.prototype.run = function () {
  17031. return __awaiter(this, void 0, void 0, function () {
  17032. var pool, mkFileResponse, localKey, uploadChunks, error_1;
  17033. var _this = this;
  17034. return __generator(this, function (_a) {
  17035. switch (_a.label) {
  17036. case 0:
  17037. this.logger.info('start run Resume.');
  17038. if (!this.config.chunkSize || !isPositiveInteger(this.config.chunkSize)) {
  17039. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidChunkSize, 'chunkSize must be a positive integer');
  17040. }
  17041. if (this.config.chunkSize > 1024) {
  17042. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidChunkSize, 'chunkSize maximum value is 1024');
  17043. }
  17044. return [4 /*yield*/, this.initBeforeUploadChunks()];
  17045. case 1:
  17046. _a.sent();
  17047. pool = new utils.Pool(function (chunkInfo) {
  17048. return __awaiter(_this, void 0, void 0, function () {
  17049. return __generator(this, function (_a) {
  17050. switch (_a.label) {
  17051. case 0:
  17052. if (this.aborted) {
  17053. pool.abort();
  17054. throw new Error('pool is aborted');
  17055. }
  17056. return [4 /*yield*/, this.uploadChunk(chunkInfo)];
  17057. case 1:
  17058. _a.sent();
  17059. return [2 /*return*/];
  17060. }
  17061. });
  17062. });
  17063. }, this.config.concurrentRequestLimit);
  17064. mkFileResponse = null;
  17065. localKey = this.getLocalKey();
  17066. uploadChunks = this.chunks.map(function (chunk, index) {
  17067. return pool.enqueue({
  17068. chunk: chunk,
  17069. index: index
  17070. });
  17071. });
  17072. _a.label = 2;
  17073. case 2:
  17074. _a.trys.push([2, 5,, 6]);
  17075. return [4 /*yield*/, Promise.all(uploadChunks)];
  17076. case 3:
  17077. _a.sent();
  17078. return [4 /*yield*/, this.mkFileReq()];
  17079. case 4:
  17080. mkFileResponse = _a.sent();
  17081. return [3 /*break*/, 6];
  17082. case 5:
  17083. error_1 = _a.sent();
  17084. // uploadId 无效,上传参数有误(多由于本地存储信息的 uploadId 失效)
  17085. if (error_1 instanceof _errors.QiniuRequestError && (error_1.code === 612 || error_1.code === 400)) {
  17086. utils.removeLocalFileInfo(localKey, this.logger);
  17087. }
  17088. throw error_1;
  17089. case 6:
  17090. // 上传成功,清理本地缓存数据
  17091. utils.removeLocalFileInfo(localKey, this.logger);
  17092. return [2 /*return*/, mkFileResponse];
  17093. }
  17094. });
  17095. });
  17096. };
  17097. Resume.prototype.uploadChunk = function (chunkInfo) {
  17098. return __awaiter(this, void 0, void 0, function () {
  17099. var index, chunk, cachedInfo, shouldCheckMD5, reuseSaved, md5, onProgress, requestOptions, response;
  17100. var _this = this;
  17101. return __generator(this, function (_a) {
  17102. switch (_a.label) {
  17103. case 0:
  17104. index = chunkInfo.index, chunk = chunkInfo.chunk;
  17105. cachedInfo = this.cachedUploadedList[index];
  17106. this.logger.info("upload part " + index + ", cache:", cachedInfo);
  17107. shouldCheckMD5 = this.config.checkByMD5;
  17108. reuseSaved = function reuseSaved() {
  17109. _this.usedCacheList[index] = true;
  17110. _this.updateChunkProgress(chunk.size, index);
  17111. _this.uploadedList[index] = cachedInfo;
  17112. _this.updateLocalCache();
  17113. };
  17114. // FIXME: 至少判断一下 size
  17115. if (cachedInfo && !shouldCheckMD5) {
  17116. reuseSaved();
  17117. return [2 /*return*/];
  17118. }
  17119. return [4 /*yield*/, utils.computeMd5(chunk)];
  17120. case 1:
  17121. md5 = _a.sent();
  17122. this.logger.info('computed part md5.', md5);
  17123. if (cachedInfo && md5 === cachedInfo.md5) {
  17124. reuseSaved();
  17125. return [2 /*return*/];
  17126. }
  17127. // 没有使用缓存设置标记为 false
  17128. this.usedCacheList[index] = false;
  17129. onProgress = function onProgress(data) {
  17130. _this.updateChunkProgress(data.loaded, index);
  17131. };
  17132. requestOptions = {
  17133. body: chunk,
  17134. md5: this.config.checkByServer ? md5 : undefined,
  17135. onProgress: onProgress,
  17136. onCreate: function onCreate(xhr) {
  17137. return _this.addXhr(xhr);
  17138. }
  17139. };
  17140. this.logger.info("part " + index + " start uploading.");
  17141. return [4 /*yield*/, (0, _api.uploadChunk)(this.token, this.key, chunkInfo.index + 1, this.getUploadInfo(), requestOptions)];
  17142. case 2:
  17143. response = _a.sent();
  17144. this.logger.info("part " + index + " upload completed.");
  17145. // 在某些浏览器环境下,xhr 的 progress 事件无法被触发,progress 为 null,这里在每次分片上传完成后都手动更新下 progress
  17146. onProgress({
  17147. loaded: chunk.size,
  17148. total: chunk.size
  17149. });
  17150. this.uploadedList[index] = {
  17151. etag: response.data.etag,
  17152. md5: response.data.md5,
  17153. size: chunk.size
  17154. };
  17155. this.updateLocalCache();
  17156. return [2 /*return*/];
  17157. }
  17158. });
  17159. });
  17160. };
  17161. Resume.prototype.mkFileReq = function () {
  17162. return __awaiter(this, void 0, void 0, function () {
  17163. var data, result;
  17164. var _this = this;
  17165. return __generator(this, function (_a) {
  17166. switch (_a.label) {
  17167. case 0:
  17168. data = __assign(__assign(__assign({
  17169. parts: this.uploadedList.map(function (value, index) {
  17170. return {
  17171. etag: value.etag,
  17172. // 接口要求 index 需要从 1 开始,所以需要整体 + 1
  17173. partNumber: index + 1
  17174. };
  17175. }),
  17176. fname: this.putExtra.fname
  17177. }, this.putExtra.mimeType && {
  17178. mimeType: this.putExtra.mimeType
  17179. }), this.putExtra.customVars && {
  17180. customVars: this.putExtra.customVars
  17181. }), this.putExtra.metadata && {
  17182. metadata: this.putExtra.metadata
  17183. });
  17184. this.logger.info('parts upload completed, make file.', data);
  17185. return [4 /*yield*/, (0, _api.uploadComplete)(this.token, this.key, this.getUploadInfo(), {
  17186. onCreate: function onCreate(xhr) {
  17187. return _this.addXhr(xhr);
  17188. },
  17189. body: JSON.stringify(data)
  17190. })];
  17191. case 1:
  17192. result = _a.sent();
  17193. this.logger.info('finish Resume Progress.');
  17194. this.updateMkFileProgress(1);
  17195. return [2 /*return*/, result];
  17196. }
  17197. });
  17198. });
  17199. };
  17200. Resume.prototype.initBeforeUploadChunks = function () {
  17201. return __awaiter(this, void 0, void 0, function () {
  17202. var cachedInfo, res, infoMessage;
  17203. return __generator(this, function (_a) {
  17204. switch (_a.label) {
  17205. case 0:
  17206. this.uploadedList = [];
  17207. this.usedCacheList = [];
  17208. cachedInfo = utils.getLocalFileInfo(this.getLocalKey(), this.logger);
  17209. if (!!cachedInfo) return [3 /*break*/, 2];
  17210. this.logger.info('init upload parts from api.');
  17211. return [4 /*yield*/, (0, _api.initUploadParts)(this.token, this.bucketName, this.key, this.uploadHost.getUrl())];
  17212. case 1:
  17213. res = _a.sent();
  17214. this.logger.info("initd upload parts of id: " + res.data.uploadId + ".");
  17215. this.uploadId = res.data.uploadId;
  17216. this.cachedUploadedList = [];
  17217. return [3 /*break*/, 3];
  17218. case 2:
  17219. infoMessage = ['resume upload parts from local cache,', "total " + cachedInfo.data.length + " part,", "id is " + cachedInfo.id + "."];
  17220. this.logger.info(infoMessage.join(' '));
  17221. this.cachedUploadedList = cachedInfo.data;
  17222. this.uploadId = cachedInfo.id;
  17223. _a.label = 3;
  17224. case 3:
  17225. this.chunks = utils.getChunks(this.file, this.config.chunkSize);
  17226. this.loaded = {
  17227. mkFileProgress: 0,
  17228. chunks: this.chunks.map(function (_) {
  17229. return 0;
  17230. })
  17231. };
  17232. this.notifyResumeProgress();
  17233. return [2 /*return*/];
  17234. }
  17235. });
  17236. });
  17237. };
  17238. Resume.prototype.getUploadInfo = function () {
  17239. return {
  17240. id: this.uploadId,
  17241. url: this.uploadHost.getUrl()
  17242. };
  17243. };
  17244. Resume.prototype.getLocalKey = function () {
  17245. return utils.createLocalKey(this.file.name, this.key, this.file.size);
  17246. };
  17247. Resume.prototype.updateLocalCache = function () {
  17248. utils.setLocalFileInfo(this.getLocalKey(), {
  17249. id: this.uploadId,
  17250. data: this.uploadedList
  17251. }, this.logger);
  17252. };
  17253. Resume.prototype.updateChunkProgress = function (loaded, index) {
  17254. this.loaded.chunks[index] = loaded;
  17255. this.notifyResumeProgress();
  17256. };
  17257. Resume.prototype.updateMkFileProgress = function (progress) {
  17258. this.loaded.mkFileProgress = progress;
  17259. this.notifyResumeProgress();
  17260. };
  17261. Resume.prototype.notifyResumeProgress = function () {
  17262. var _this = this;
  17263. this.progress = {
  17264. total: this.getProgressInfoItem(utils.sum(this.loaded.chunks) + this.loaded.mkFileProgress,
  17265. // FIXME: 不准确的 fileSize
  17266. this.file.size + 1 // 防止在 complete 未调用的时候进度显示 100%
  17267. ),
  17268. chunks: this.chunks.map(function (chunk, index) {
  17269. var fromCache = _this.usedCacheList[index];
  17270. return _this.getProgressInfoItem(_this.loaded.chunks[index], chunk.size, fromCache);
  17271. }),
  17272. uploadInfo: {
  17273. id: this.uploadId,
  17274. url: this.uploadHost.getUrl()
  17275. }
  17276. };
  17277. this.onData(this.progress);
  17278. };
  17279. return Resume;
  17280. }(_base.default);
  17281. var _default = Resume;
  17282. exports.default = _default;
  17283. /***/ }),
  17284. /***/ 805:
  17285. /*!****************************************************************!*\
  17286. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/api/index.js ***!
  17287. \****************************************************************/
  17288. /*! no static exports found */
  17289. /***/ (function(module, exports, __webpack_require__) {
  17290. "use strict";
  17291. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  17292. Object.defineProperty(exports, "__esModule", {
  17293. value: true
  17294. });
  17295. exports.deleteUploadedChunks = deleteUploadedChunks;
  17296. exports.direct = direct;
  17297. exports.getUpHosts = getUpHosts;
  17298. exports.getUploadUrl = getUploadUrl;
  17299. exports.initUploadParts = initUploadParts;
  17300. exports.uploadChunk = uploadChunk;
  17301. exports.uploadComplete = uploadComplete;
  17302. var _querystring = __webpack_require__(/*! querystring */ 806);
  17303. var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ 794));
  17304. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  17305. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  17306. var __assign = void 0 && (void 0).__assign || function () {
  17307. __assign = Object.assign || function (t) {
  17308. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17309. s = arguments[i];
  17310. for (var p in s) {
  17311. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17312. }
  17313. }
  17314. return t;
  17315. };
  17316. return __assign.apply(this, arguments);
  17317. };
  17318. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  17319. function adopt(value) {
  17320. return value instanceof P ? value : new P(function (resolve) {
  17321. resolve(value);
  17322. });
  17323. }
  17324. return new (P || (P = Promise))(function (resolve, reject) {
  17325. function fulfilled(value) {
  17326. try {
  17327. step(generator.next(value));
  17328. } catch (e) {
  17329. reject(e);
  17330. }
  17331. }
  17332. function rejected(value) {
  17333. try {
  17334. step(generator["throw"](value));
  17335. } catch (e) {
  17336. reject(e);
  17337. }
  17338. }
  17339. function step(result) {
  17340. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  17341. }
  17342. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17343. });
  17344. };
  17345. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  17346. var _ = {
  17347. label: 0,
  17348. sent: function sent() {
  17349. if (t[0] & 1) throw t[1];
  17350. return t[1];
  17351. },
  17352. trys: [],
  17353. ops: []
  17354. },
  17355. f,
  17356. y,
  17357. t,
  17358. g;
  17359. return g = {
  17360. next: verb(0),
  17361. "throw": verb(1),
  17362. "return": verb(2)
  17363. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  17364. return this;
  17365. }), g;
  17366. function verb(n) {
  17367. return function (v) {
  17368. return step([n, v]);
  17369. };
  17370. }
  17371. function step(op) {
  17372. if (f) throw new TypeError("Generator is already executing.");
  17373. while (_) {
  17374. try {
  17375. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  17376. if (y = 0, t) op = [op[0] & 2, t.value];
  17377. switch (op[0]) {
  17378. case 0:
  17379. case 1:
  17380. t = op;
  17381. break;
  17382. case 4:
  17383. _.label++;
  17384. return {
  17385. value: op[1],
  17386. done: false
  17387. };
  17388. case 5:
  17389. _.label++;
  17390. y = op[1];
  17391. op = [0];
  17392. continue;
  17393. case 7:
  17394. op = _.ops.pop();
  17395. _.trys.pop();
  17396. continue;
  17397. default:
  17398. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  17399. _ = 0;
  17400. continue;
  17401. }
  17402. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  17403. _.label = op[1];
  17404. break;
  17405. }
  17406. if (op[0] === 6 && _.label < t[1]) {
  17407. _.label = t[1];
  17408. t = op;
  17409. break;
  17410. }
  17411. if (t && _.label < t[2]) {
  17412. _.label = t[2];
  17413. _.ops.push(op);
  17414. break;
  17415. }
  17416. if (t[2]) _.ops.pop();
  17417. _.trys.pop();
  17418. continue;
  17419. }
  17420. op = body.call(thisArg, _);
  17421. } catch (e) {
  17422. op = [6, e];
  17423. y = 0;
  17424. } finally {
  17425. f = t = 0;
  17426. }
  17427. }
  17428. if (op[0] & 5) throw op[1];
  17429. return {
  17430. value: op[0] ? op[1] : void 0,
  17431. done: true
  17432. };
  17433. }
  17434. };
  17435. function getUpHosts(accessKey, bucketName, protocol) {
  17436. return __awaiter(this, void 0, void 0, function () {
  17437. var params, url;
  17438. return __generator(this, function (_a) {
  17439. params = (0, _querystring.stringify)({
  17440. ak: accessKey,
  17441. bucket: bucketName
  17442. });
  17443. url = protocol + "://api.qiniu.com/v2/query?" + params;
  17444. return [2 /*return*/, utils.request(url, {
  17445. method: 'GET'
  17446. })];
  17447. });
  17448. });
  17449. }
  17450. /**
  17451. * @param bucket 空间名
  17452. * @param key 目标文件名
  17453. * @param uploadInfo 上传信息
  17454. */
  17455. function getBaseUrl(bucket, key, uploadInfo) {
  17456. var url = uploadInfo.url,
  17457. id = uploadInfo.id;
  17458. return url + "/buckets/" + bucket + "/objects/" + (key != null ? utils.urlSafeBase64Encode(key) : '~') + "/uploads/" + id;
  17459. }
  17460. /**
  17461. * @param token 上传鉴权凭证
  17462. * @param bucket 上传空间
  17463. * @param key 目标文件名
  17464. * @param uploadUrl 上传地址
  17465. */
  17466. function initUploadParts(token, bucket, key, uploadUrl) {
  17467. var url = uploadUrl + "/buckets/" + bucket + "/objects/" + (key != null ? utils.urlSafeBase64Encode(key) : '~') + "/uploads";
  17468. return utils.request(url, {
  17469. method: 'POST',
  17470. headers: utils.getAuthHeaders(token)
  17471. });
  17472. }
  17473. /**
  17474. * @param token 上传鉴权凭证
  17475. * @param index 当前 chunk 的索引
  17476. * @param uploadInfo 上传信息
  17477. * @param options 请求参数
  17478. */
  17479. function uploadChunk(token, key, index, uploadInfo, options) {
  17480. var bucket = utils.getPutPolicy(token).bucketName;
  17481. var url = getBaseUrl(bucket, key, uploadInfo) + ("/" + index);
  17482. var headers = utils.getHeadersForChunkUpload(token);
  17483. if (options.md5) headers['Content-MD5'] = options.md5;
  17484. return utils.request(url, __assign(__assign({}, options), {
  17485. method: 'PUT',
  17486. headers: headers
  17487. }));
  17488. }
  17489. /**
  17490. * @param token 上传鉴权凭证
  17491. * @param key 目标文件名
  17492. * @param uploadInfo 上传信息
  17493. * @param options 请求参数
  17494. */
  17495. function uploadComplete(token, key, uploadInfo, options) {
  17496. var bucket = utils.getPutPolicy(token).bucketName;
  17497. var url = getBaseUrl(bucket, key, uploadInfo);
  17498. return utils.request(url, __assign(__assign({}, options), {
  17499. method: 'POST',
  17500. headers: utils.getHeadersForMkFile(token)
  17501. }));
  17502. }
  17503. /**
  17504. * @param token 上传鉴权凭证
  17505. * @param key 目标文件名
  17506. * @param uploadInfo 上传信息
  17507. */
  17508. function deleteUploadedChunks(token, key, uploadinfo) {
  17509. var bucket = utils.getPutPolicy(token).bucketName;
  17510. var url = getBaseUrl(bucket, key, uploadinfo);
  17511. return utils.request(url, {
  17512. method: 'DELETE',
  17513. headers: utils.getAuthHeaders(token)
  17514. });
  17515. }
  17516. /**
  17517. * @param {string} url
  17518. * @param {FormData} data
  17519. * @param {Partial<utils.RequestOptions>} options
  17520. * @returns Promise
  17521. * @description 直传接口
  17522. */
  17523. function direct(url, data, options) {
  17524. return utils.request(url, __assign({
  17525. method: 'POST',
  17526. body: data
  17527. }, options));
  17528. }
  17529. /**
  17530. * @param {UploadUrlConfig} config
  17531. * @param {string} token
  17532. * @returns Promise
  17533. * @description 获取上传 url
  17534. */
  17535. function getUploadUrl(_config, token) {
  17536. return __awaiter(this, void 0, void 0, function () {
  17537. var config, protocol, putPolicy, res, hosts;
  17538. return __generator(this, function (_a) {
  17539. switch (_a.label) {
  17540. case 0:
  17541. config = (0, utils.normalizeUploadConfig)(_config);
  17542. protocol = config.upprotocol;
  17543. if (config.uphost.length > 0) {
  17544. return [2 /*return*/, protocol + "://" + config.uphost[0]];
  17545. }
  17546. putPolicy = utils.getPutPolicy(token);
  17547. return [4 /*yield*/, getUpHosts(putPolicy.assessKey, putPolicy.bucketName, protocol)];
  17548. case 1:
  17549. res = _a.sent();
  17550. hosts = res.data.up.acc.main;
  17551. return [2 /*return*/, protocol + "://" + hosts[0]];
  17552. }
  17553. });
  17554. });
  17555. }
  17556. /***/ }),
  17557. /***/ 806:
  17558. /*!***********************************************!*\
  17559. !*** ./node_modules/querystring-es3/index.js ***!
  17560. \***********************************************/
  17561. /*! no static exports found */
  17562. /***/ (function(module, exports, __webpack_require__) {
  17563. "use strict";
  17564. exports.decode = exports.parse = __webpack_require__(/*! ./decode */ 807);
  17565. exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ 808);
  17566. /***/ }),
  17567. /***/ 807:
  17568. /*!************************************************!*\
  17569. !*** ./node_modules/querystring-es3/decode.js ***!
  17570. \************************************************/
  17571. /*! no static exports found */
  17572. /***/ (function(module, exports, __webpack_require__) {
  17573. "use strict";
  17574. // Copyright Joyent, Inc. and other Node contributors.
  17575. //
  17576. // Permission is hereby granted, free of charge, to any person obtaining a
  17577. // copy of this software and associated documentation files (the
  17578. // "Software"), to deal in the Software without restriction, including
  17579. // without limitation the rights to use, copy, modify, merge, publish,
  17580. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17581. // persons to whom the Software is furnished to do so, subject to the
  17582. // following conditions:
  17583. //
  17584. // The above copyright notice and this permission notice shall be included
  17585. // in all copies or substantial portions of the Software.
  17586. //
  17587. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17588. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17589. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17590. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17591. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17592. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17593. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17594. // If obj.hasOwnProperty has been overridden, then calling
  17595. // obj.hasOwnProperty(prop) will break.
  17596. // See: https://github.com/joyent/node/issues/1707
  17597. function hasOwnProperty(obj, prop) {
  17598. return Object.prototype.hasOwnProperty.call(obj, prop);
  17599. }
  17600. module.exports = function(qs, sep, eq, options) {
  17601. sep = sep || '&';
  17602. eq = eq || '=';
  17603. var obj = {};
  17604. if (typeof qs !== 'string' || qs.length === 0) {
  17605. return obj;
  17606. }
  17607. var regexp = /\+/g;
  17608. qs = qs.split(sep);
  17609. var maxKeys = 1000;
  17610. if (options && typeof options.maxKeys === 'number') {
  17611. maxKeys = options.maxKeys;
  17612. }
  17613. var len = qs.length;
  17614. // maxKeys <= 0 means that we should not limit keys count
  17615. if (maxKeys > 0 && len > maxKeys) {
  17616. len = maxKeys;
  17617. }
  17618. for (var i = 0; i < len; ++i) {
  17619. var x = qs[i].replace(regexp, '%20'),
  17620. idx = x.indexOf(eq),
  17621. kstr, vstr, k, v;
  17622. if (idx >= 0) {
  17623. kstr = x.substr(0, idx);
  17624. vstr = x.substr(idx + 1);
  17625. } else {
  17626. kstr = x;
  17627. vstr = '';
  17628. }
  17629. k = decodeURIComponent(kstr);
  17630. v = decodeURIComponent(vstr);
  17631. if (!hasOwnProperty(obj, k)) {
  17632. obj[k] = v;
  17633. } else if (isArray(obj[k])) {
  17634. obj[k].push(v);
  17635. } else {
  17636. obj[k] = [obj[k], v];
  17637. }
  17638. }
  17639. return obj;
  17640. };
  17641. var isArray = Array.isArray || function (xs) {
  17642. return Object.prototype.toString.call(xs) === '[object Array]';
  17643. };
  17644. /***/ }),
  17645. /***/ 808:
  17646. /*!************************************************!*\
  17647. !*** ./node_modules/querystring-es3/encode.js ***!
  17648. \************************************************/
  17649. /*! no static exports found */
  17650. /***/ (function(module, exports, __webpack_require__) {
  17651. "use strict";
  17652. // Copyright Joyent, Inc. and other Node contributors.
  17653. //
  17654. // Permission is hereby granted, free of charge, to any person obtaining a
  17655. // copy of this software and associated documentation files (the
  17656. // "Software"), to deal in the Software without restriction, including
  17657. // without limitation the rights to use, copy, modify, merge, publish,
  17658. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17659. // persons to whom the Software is furnished to do so, subject to the
  17660. // following conditions:
  17661. //
  17662. // The above copyright notice and this permission notice shall be included
  17663. // in all copies or substantial portions of the Software.
  17664. //
  17665. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17666. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17667. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17668. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17669. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17670. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17671. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17672. var stringifyPrimitive = function(v) {
  17673. switch (typeof v) {
  17674. case 'string':
  17675. return v;
  17676. case 'boolean':
  17677. return v ? 'true' : 'false';
  17678. case 'number':
  17679. return isFinite(v) ? v : '';
  17680. default:
  17681. return '';
  17682. }
  17683. };
  17684. module.exports = function(obj, sep, eq, name) {
  17685. sep = sep || '&';
  17686. eq = eq || '=';
  17687. if (obj === null) {
  17688. obj = undefined;
  17689. }
  17690. if (typeof obj === 'object') {
  17691. return map(objectKeys(obj), function(k) {
  17692. var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
  17693. if (isArray(obj[k])) {
  17694. return map(obj[k], function(v) {
  17695. return ks + encodeURIComponent(stringifyPrimitive(v));
  17696. }).join(sep);
  17697. } else {
  17698. return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
  17699. }
  17700. }).join(sep);
  17701. }
  17702. if (!name) return '';
  17703. return encodeURIComponent(stringifyPrimitive(name)) + eq +
  17704. encodeURIComponent(stringifyPrimitive(obj));
  17705. };
  17706. var isArray = Array.isArray || function (xs) {
  17707. return Object.prototype.toString.call(xs) === '[object Array]';
  17708. };
  17709. function map (xs, f) {
  17710. if (xs.map) return xs.map(f);
  17711. var res = [];
  17712. for (var i = 0; i < xs.length; i++) {
  17713. res.push(f(xs[i], i));
  17714. }
  17715. return res;
  17716. }
  17717. var objectKeys = Object.keys || function (obj) {
  17718. var res = [];
  17719. for (var key in obj) {
  17720. if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
  17721. }
  17722. return res;
  17723. };
  17724. /***/ }),
  17725. /***/ 809:
  17726. /*!******************************************************************!*\
  17727. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/base.js ***!
  17728. \******************************************************************/
  17729. /*! no static exports found */
  17730. /***/ (function(module, exports, __webpack_require__) {
  17731. "use strict";
  17732. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  17733. Object.defineProperty(exports, "__esModule", {
  17734. value: true
  17735. });
  17736. exports.default = exports.RETRY_CODE_LIST = exports.FREEZE_CODE_LIST = exports.DEFAULT_CHUNK_SIZE = void 0;
  17737. var _errors = __webpack_require__(/*! ../errors */ 792);
  17738. var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ 794));
  17739. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  17740. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  17741. var __assign = void 0 && (void 0).__assign || function () {
  17742. __assign = Object.assign || function (t) {
  17743. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17744. s = arguments[i];
  17745. for (var p in s) {
  17746. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17747. }
  17748. }
  17749. return t;
  17750. };
  17751. return __assign.apply(this, arguments);
  17752. };
  17753. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  17754. function adopt(value) {
  17755. return value instanceof P ? value : new P(function (resolve) {
  17756. resolve(value);
  17757. });
  17758. }
  17759. return new (P || (P = Promise))(function (resolve, reject) {
  17760. function fulfilled(value) {
  17761. try {
  17762. step(generator.next(value));
  17763. } catch (e) {
  17764. reject(e);
  17765. }
  17766. }
  17767. function rejected(value) {
  17768. try {
  17769. step(generator["throw"](value));
  17770. } catch (e) {
  17771. reject(e);
  17772. }
  17773. }
  17774. function step(result) {
  17775. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  17776. }
  17777. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17778. });
  17779. };
  17780. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  17781. var _ = {
  17782. label: 0,
  17783. sent: function sent() {
  17784. if (t[0] & 1) throw t[1];
  17785. return t[1];
  17786. },
  17787. trys: [],
  17788. ops: []
  17789. },
  17790. f,
  17791. y,
  17792. t,
  17793. g;
  17794. return g = {
  17795. next: verb(0),
  17796. "throw": verb(1),
  17797. "return": verb(2)
  17798. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  17799. return this;
  17800. }), g;
  17801. function verb(n) {
  17802. return function (v) {
  17803. return step([n, v]);
  17804. };
  17805. }
  17806. function step(op) {
  17807. if (f) throw new TypeError("Generator is already executing.");
  17808. while (_) {
  17809. try {
  17810. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  17811. if (y = 0, t) op = [op[0] & 2, t.value];
  17812. switch (op[0]) {
  17813. case 0:
  17814. case 1:
  17815. t = op;
  17816. break;
  17817. case 4:
  17818. _.label++;
  17819. return {
  17820. value: op[1],
  17821. done: false
  17822. };
  17823. case 5:
  17824. _.label++;
  17825. y = op[1];
  17826. op = [0];
  17827. continue;
  17828. case 7:
  17829. op = _.ops.pop();
  17830. _.trys.pop();
  17831. continue;
  17832. default:
  17833. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  17834. _ = 0;
  17835. continue;
  17836. }
  17837. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  17838. _.label = op[1];
  17839. break;
  17840. }
  17841. if (op[0] === 6 && _.label < t[1]) {
  17842. _.label = t[1];
  17843. t = op;
  17844. break;
  17845. }
  17846. if (t && _.label < t[2]) {
  17847. _.label = t[2];
  17848. _.ops.push(op);
  17849. break;
  17850. }
  17851. if (t[2]) _.ops.pop();
  17852. _.trys.pop();
  17853. continue;
  17854. }
  17855. op = body.call(thisArg, _);
  17856. } catch (e) {
  17857. op = [6, e];
  17858. y = 0;
  17859. } finally {
  17860. f = t = 0;
  17861. }
  17862. }
  17863. if (op[0] & 5) throw op[1];
  17864. return {
  17865. value: op[0] ? op[1] : void 0,
  17866. done: true
  17867. };
  17868. }
  17869. };
  17870. var __read = void 0 && (void 0).__read || function (o, n) {
  17871. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17872. if (!m) return o;
  17873. var i = m.call(o),
  17874. r,
  17875. ar = [],
  17876. e;
  17877. try {
  17878. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  17879. ar.push(r.value);
  17880. }
  17881. } catch (error) {
  17882. e = {
  17883. error: error
  17884. };
  17885. } finally {
  17886. try {
  17887. if (r && !r.done && (m = i["return"])) m.call(i);
  17888. } finally {
  17889. if (e) throw e.error;
  17890. }
  17891. }
  17892. return ar;
  17893. };
  17894. var __spread = void 0 && (void 0).__spread || function () {
  17895. for (var ar = [], i = 0; i < arguments.length; i++) {
  17896. ar = ar.concat(__read(arguments[i]));
  17897. }
  17898. return ar;
  17899. };
  17900. var DEFAULT_CHUNK_SIZE = 4; // 单位 MB
  17901. // code 信息地址 https://developer.qiniu.com/kodo/3928/error-responses
  17902. exports.DEFAULT_CHUNK_SIZE = DEFAULT_CHUNK_SIZE;
  17903. var FREEZE_CODE_LIST = [0, 502, 503, 504, 599]; // 将会冻结当前 host 的 code
  17904. exports.FREEZE_CODE_LIST = FREEZE_CODE_LIST;
  17905. var RETRY_CODE_LIST = __spread(FREEZE_CODE_LIST, [612]); // 会进行重试的 code
  17906. exports.RETRY_CODE_LIST = RETRY_CODE_LIST;
  17907. var GB = Math.pow(1024, 3);
  17908. var Base = /** @class */function () {
  17909. function Base(options, handlers, hostPool, logger) {
  17910. this.hostPool = hostPool;
  17911. this.logger = logger;
  17912. this.aborted = false;
  17913. this.retryCount = 0;
  17914. this.xhrList = [];
  17915. this.config = options.config;
  17916. logger.info('config inited.', this.config);
  17917. this.putExtra = __assign({
  17918. fname: ''
  17919. }, options.putExtra);
  17920. logger.info('putExtra inited.', this.putExtra);
  17921. this.key = options.key;
  17922. this.file = options.file;
  17923. this.token = options.token;
  17924. this.onData = handlers.onData;
  17925. this.onError = handlers.onError;
  17926. this.onComplete = handlers.onComplete;
  17927. try {
  17928. var putPolicy = utils.getPutPolicy(this.token);
  17929. this.bucketName = putPolicy.bucketName;
  17930. this.assessKey = putPolicy.assessKey;
  17931. } catch (error) {
  17932. logger.error('get putPolicy from token failed.', error);
  17933. this.onError(error);
  17934. }
  17935. }
  17936. // 检查并更新 upload host
  17937. Base.prototype.checkAndUpdateUploadHost = function () {
  17938. return __awaiter(this, void 0, void 0, function () {
  17939. var newHost;
  17940. return __generator(this, function (_a) {
  17941. switch (_a.label) {
  17942. case 0:
  17943. // 从 hostPool 中获取一个可用的 host 挂载在 this
  17944. this.logger.info('get available upload host.');
  17945. return [4 /*yield*/, this.hostPool.getUp(this.assessKey, this.bucketName, this.config.upprotocol)];
  17946. case 1:
  17947. newHost = _a.sent();
  17948. if (newHost == null) {
  17949. throw new _errors.QiniuError(_errors.QiniuErrorName.NotAvailableUploadHost, 'no available upload host.');
  17950. }
  17951. if (this.uploadHost != null && this.uploadHost.host !== newHost.host) {
  17952. this.logger.warn("host switches from " + this.uploadHost.host + " to " + newHost.host + ".");
  17953. } else {
  17954. this.logger.info("use host " + newHost.host + ".");
  17955. }
  17956. this.uploadHost = newHost;
  17957. return [2 /*return*/];
  17958. }
  17959. });
  17960. });
  17961. };
  17962. // 检查并解冻当前的 host
  17963. Base.prototype.checkAndUnfreezeHost = function () {
  17964. this.logger.info('check unfreeze host.');
  17965. if (this.uploadHost != null && this.uploadHost.isFrozen()) {
  17966. this.logger.warn(this.uploadHost.host + " will be unfrozen.");
  17967. this.uploadHost.unfreeze();
  17968. }
  17969. };
  17970. // 检查并更新冻结当前的 host
  17971. Base.prototype.checkAndFreezeHost = function (error) {
  17972. this.logger.info('check freeze host.');
  17973. if (error instanceof _errors.QiniuRequestError && this.uploadHost != null) {
  17974. if (FREEZE_CODE_LIST.includes(error.code)) {
  17975. this.logger.warn(this.uploadHost.host + " will be temporarily frozen.");
  17976. this.uploadHost.freeze();
  17977. }
  17978. }
  17979. };
  17980. Base.prototype.handleError = function (error) {
  17981. this.logger.error(error.message);
  17982. this.onError(error);
  17983. };
  17984. /**
  17985. * @returns Promise 返回结果与上传最终状态无关,状态信息请通过 [Subscriber] 获取。
  17986. * @description 上传文件,状态信息请通过 [Subscriber] 获取。
  17987. */
  17988. Base.prototype.putFile = function () {
  17989. return __awaiter(this, void 0, void 0, function () {
  17990. var result, err_1, notReachRetryCount, needRetry;
  17991. return __generator(this, function (_a) {
  17992. switch (_a.label) {
  17993. case 0:
  17994. this.aborted = false;
  17995. if (!this.putExtra.fname) {
  17996. this.logger.info('use file.name as fname.');
  17997. this.putExtra.fname = this.file.name;
  17998. }
  17999. if (this.file.size > 10000 * GB) {
  18000. this.handleError(new _errors.QiniuError(_errors.QiniuErrorName.InvalidFile, 'file size exceed maximum value 10000G'));
  18001. return [2 /*return*/];
  18002. }
  18003. if (this.putExtra.customVars) {
  18004. if (!utils.isCustomVarsValid(this.putExtra.customVars)) {
  18005. this.handleError(new _errors.QiniuError(_errors.QiniuErrorName.InvalidCustomVars,
  18006. // FIXME: width => with
  18007. 'customVars key should start width x:'));
  18008. return [2 /*return*/];
  18009. }
  18010. }
  18011. if (this.putExtra.metadata) {
  18012. if (!utils.isMetaDataValid(this.putExtra.metadata)) {
  18013. this.handleError(new _errors.QiniuError(_errors.QiniuErrorName.InvalidMetadata, 'metadata key should start with x-qn-meta-'));
  18014. return [2 /*return*/];
  18015. }
  18016. }
  18017. _a.label = 1;
  18018. case 1:
  18019. _a.trys.push([1, 4,, 5]);
  18020. this.uploadAt = new Date().getTime();
  18021. return [4 /*yield*/, this.checkAndUpdateUploadHost()];
  18022. case 2:
  18023. _a.sent();
  18024. return [4 /*yield*/, this.run()];
  18025. case 3:
  18026. result = _a.sent();
  18027. this.onComplete(result.data);
  18028. this.checkAndUnfreezeHost();
  18029. this.sendLog(result.reqId, 200);
  18030. return [2 /*return*/];
  18031. case 4:
  18032. err_1 = _a.sent();
  18033. if (this.aborted) {
  18034. this.logger.warn('upload is aborted.');
  18035. this.sendLog('', -2);
  18036. return [2 /*return*/];
  18037. }
  18038. this.clear();
  18039. this.logger.error(err_1);
  18040. if (err_1 instanceof _errors.QiniuRequestError) {
  18041. this.sendLog(err_1.reqId, err_1.code);
  18042. // 检查并冻结当前的 host
  18043. this.checkAndFreezeHost(err_1);
  18044. notReachRetryCount = ++this.retryCount <= this.config.retryCount;
  18045. needRetry = RETRY_CODE_LIST.includes(err_1.code);
  18046. // 以下条件满足其中之一则会进行重新上传:
  18047. // 1. 满足 needRetry 的条件且 retryCount 不为 0
  18048. // 2. uploadId 无效时在 resume 里会清除本地数据,并且这里触发重新上传
  18049. if (needRetry && notReachRetryCount) {
  18050. this.logger.warn("error auto retry: " + this.retryCount + "/" + this.config.retryCount + ".");
  18051. this.putFile();
  18052. return [2 /*return*/];
  18053. }
  18054. }
  18055. this.onError(err_1);
  18056. return [3 /*break*/, 5];
  18057. case 5:
  18058. return [2 /*return*/];
  18059. }
  18060. });
  18061. });
  18062. };
  18063. Base.prototype.clear = function () {
  18064. this.xhrList.forEach(function (xhr) {
  18065. xhr.onreadystatechange = null;
  18066. xhr.abort();
  18067. });
  18068. this.xhrList = [];
  18069. this.logger.info('cleanup uploading xhr.');
  18070. };
  18071. Base.prototype.stop = function () {
  18072. this.logger.info('aborted.');
  18073. this.clear();
  18074. this.aborted = true;
  18075. };
  18076. Base.prototype.addXhr = function (xhr) {
  18077. this.xhrList.push(xhr);
  18078. };
  18079. Base.prototype.sendLog = function (reqId, code) {
  18080. var _a, _b;
  18081. this.logger.report({
  18082. code: code,
  18083. reqId: reqId,
  18084. remoteIp: '',
  18085. upType: 'jssdk-h5',
  18086. size: this.file.size,
  18087. time: Math.floor(this.uploadAt / 1000),
  18088. port: utils.getPortFromUrl((_a = this.uploadHost) === null || _a === void 0 ? void 0 : _a.getUrl()),
  18089. host: utils.getDomainFromUrl((_b = this.uploadHost) === null || _b === void 0 ? void 0 : _b.getUrl()),
  18090. bytesSent: this.progress ? this.progress.total.loaded : 0,
  18091. duration: Math.floor((new Date().getTime() - this.uploadAt) / 1000)
  18092. });
  18093. };
  18094. Base.prototype.getProgressInfoItem = function (loaded, size, fromCache) {
  18095. return __assign({
  18096. size: size,
  18097. loaded: loaded,
  18098. percent: loaded / size * 100
  18099. }, fromCache == null ? {} : {
  18100. fromCache: fromCache
  18101. });
  18102. };
  18103. return Base;
  18104. }();
  18105. var _default = Base;
  18106. exports.default = _default;
  18107. /***/ }),
  18108. /***/ 810:
  18109. /*!********************************************************************!*\
  18110. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/direct.js ***!
  18111. \********************************************************************/
  18112. /*! no static exports found */
  18113. /***/ (function(module, exports, __webpack_require__) {
  18114. "use strict";
  18115. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18116. Object.defineProperty(exports, "__esModule", {
  18117. value: true
  18118. });
  18119. exports.default = void 0;
  18120. var _crc = __webpack_require__(/*! ../utils/crc32 */ 811);
  18121. var _api = __webpack_require__(/*! ../api */ 805);
  18122. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 809));
  18123. var __extends = void 0 && (void 0).__extends || function () {
  18124. var _extendStatics = function extendStatics(d, b) {
  18125. _extendStatics = Object.setPrototypeOf || {
  18126. __proto__: []
  18127. } instanceof Array && function (d, b) {
  18128. d.__proto__ = b;
  18129. } || function (d, b) {
  18130. for (var p in b) {
  18131. if (b.hasOwnProperty(p)) d[p] = b[p];
  18132. }
  18133. };
  18134. return _extendStatics(d, b);
  18135. };
  18136. return function (d, b) {
  18137. _extendStatics(d, b);
  18138. function __() {
  18139. this.constructor = d;
  18140. }
  18141. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  18142. };
  18143. }();
  18144. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  18145. function adopt(value) {
  18146. return value instanceof P ? value : new P(function (resolve) {
  18147. resolve(value);
  18148. });
  18149. }
  18150. return new (P || (P = Promise))(function (resolve, reject) {
  18151. function fulfilled(value) {
  18152. try {
  18153. step(generator.next(value));
  18154. } catch (e) {
  18155. reject(e);
  18156. }
  18157. }
  18158. function rejected(value) {
  18159. try {
  18160. step(generator["throw"](value));
  18161. } catch (e) {
  18162. reject(e);
  18163. }
  18164. }
  18165. function step(result) {
  18166. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  18167. }
  18168. step((generator = generator.apply(thisArg, _arguments || [])).next());
  18169. });
  18170. };
  18171. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  18172. var _ = {
  18173. label: 0,
  18174. sent: function sent() {
  18175. if (t[0] & 1) throw t[1];
  18176. return t[1];
  18177. },
  18178. trys: [],
  18179. ops: []
  18180. },
  18181. f,
  18182. y,
  18183. t,
  18184. g;
  18185. return g = {
  18186. next: verb(0),
  18187. "throw": verb(1),
  18188. "return": verb(2)
  18189. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  18190. return this;
  18191. }), g;
  18192. function verb(n) {
  18193. return function (v) {
  18194. return step([n, v]);
  18195. };
  18196. }
  18197. function step(op) {
  18198. if (f) throw new TypeError("Generator is already executing.");
  18199. while (_) {
  18200. try {
  18201. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  18202. if (y = 0, t) op = [op[0] & 2, t.value];
  18203. switch (op[0]) {
  18204. case 0:
  18205. case 1:
  18206. t = op;
  18207. break;
  18208. case 4:
  18209. _.label++;
  18210. return {
  18211. value: op[1],
  18212. done: false
  18213. };
  18214. case 5:
  18215. _.label++;
  18216. y = op[1];
  18217. op = [0];
  18218. continue;
  18219. case 7:
  18220. op = _.ops.pop();
  18221. _.trys.pop();
  18222. continue;
  18223. default:
  18224. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  18225. _ = 0;
  18226. continue;
  18227. }
  18228. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  18229. _.label = op[1];
  18230. break;
  18231. }
  18232. if (op[0] === 6 && _.label < t[1]) {
  18233. _.label = t[1];
  18234. t = op;
  18235. break;
  18236. }
  18237. if (t && _.label < t[2]) {
  18238. _.label = t[2];
  18239. _.ops.push(op);
  18240. break;
  18241. }
  18242. if (t[2]) _.ops.pop();
  18243. _.trys.pop();
  18244. continue;
  18245. }
  18246. op = body.call(thisArg, _);
  18247. } catch (e) {
  18248. op = [6, e];
  18249. y = 0;
  18250. } finally {
  18251. f = t = 0;
  18252. }
  18253. }
  18254. if (op[0] & 5) throw op[1];
  18255. return {
  18256. value: op[0] ? op[1] : void 0,
  18257. done: true
  18258. };
  18259. }
  18260. };
  18261. var Direct = /** @class */function (_super) {
  18262. __extends(Direct, _super);
  18263. function Direct() {
  18264. return _super !== null && _super.apply(this, arguments) || this;
  18265. }
  18266. Direct.prototype.run = function () {
  18267. return __awaiter(this, void 0, void 0, function () {
  18268. var formData, crcSign, customVars_1, result;
  18269. var _this = this;
  18270. return __generator(this, function (_a) {
  18271. switch (_a.label) {
  18272. case 0:
  18273. this.logger.info('start run Direct.');
  18274. formData = new FormData();
  18275. formData.append('file', this.file);
  18276. formData.append('token', this.token);
  18277. if (this.key != null) {
  18278. formData.append('key', this.key);
  18279. }
  18280. formData.append('fname', this.putExtra.fname);
  18281. if (!this.config.checkByServer) return [3 /*break*/, 2];
  18282. return [4 /*yield*/, _crc.CRC32.file(this.file)];
  18283. case 1:
  18284. crcSign = _a.sent();
  18285. formData.append('crc32', crcSign.toString());
  18286. _a.label = 2;
  18287. case 2:
  18288. if (this.putExtra.customVars) {
  18289. this.logger.info('init customVars.');
  18290. customVars_1 = this.putExtra.customVars;
  18291. Object.keys(customVars_1).forEach(function (key) {
  18292. return formData.append(key, customVars_1[key].toString());
  18293. });
  18294. this.logger.info('customVars inited.');
  18295. }
  18296. this.logger.info('formData inited.');
  18297. return [4 /*yield*/, (0, _api.direct)(this.uploadHost.getUrl(), formData, {
  18298. onProgress: function onProgress(data) {
  18299. _this.updateDirectProgress(data.loaded, data.total);
  18300. },
  18301. onCreate: function onCreate(xhr) {
  18302. return _this.addXhr(xhr);
  18303. }
  18304. })];
  18305. case 3:
  18306. result = _a.sent();
  18307. this.logger.info('Direct progress finish.');
  18308. this.finishDirectProgress();
  18309. return [2 /*return*/, result];
  18310. }
  18311. });
  18312. });
  18313. };
  18314. Direct.prototype.updateDirectProgress = function (loaded, total) {
  18315. // 当请求未完成时可能进度会达到100,所以total + 1来防止这种情况出现
  18316. this.progress = {
  18317. total: this.getProgressInfoItem(loaded, total + 1)
  18318. };
  18319. this.onData(this.progress);
  18320. };
  18321. Direct.prototype.finishDirectProgress = function () {
  18322. // 在某些浏览器环境下,xhr 的 progress 事件无法被触发,progress 为 null,这里 fake 下
  18323. if (!this.progress) {
  18324. this.logger.warn('progress is null.');
  18325. this.progress = {
  18326. total: this.getProgressInfoItem(this.file.size, this.file.size)
  18327. };
  18328. this.onData(this.progress);
  18329. return;
  18330. }
  18331. var total = this.progress.total;
  18332. this.progress = {
  18333. total: this.getProgressInfoItem(total.loaded + 1, total.size)
  18334. };
  18335. this.onData(this.progress);
  18336. };
  18337. return Direct;
  18338. }(_base.default);
  18339. var _default = Direct;
  18340. exports.default = _default;
  18341. /***/ }),
  18342. /***/ 811:
  18343. /*!******************************************************************!*\
  18344. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/crc32.js ***!
  18345. \******************************************************************/
  18346. /*! no static exports found */
  18347. /***/ (function(module, exports, __webpack_require__) {
  18348. "use strict";
  18349. Object.defineProperty(exports, "__esModule", {
  18350. value: true
  18351. });
  18352. exports.CRC32 = void 0;
  18353. var _helper = __webpack_require__(/*! ./helper */ 798);
  18354. /* eslint-disable no-bitwise */
  18355. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  18356. function adopt(value) {
  18357. return value instanceof P ? value : new P(function (resolve) {
  18358. resolve(value);
  18359. });
  18360. }
  18361. return new (P || (P = Promise))(function (resolve, reject) {
  18362. function fulfilled(value) {
  18363. try {
  18364. step(generator.next(value));
  18365. } catch (e) {
  18366. reject(e);
  18367. }
  18368. }
  18369. function rejected(value) {
  18370. try {
  18371. step(generator["throw"](value));
  18372. } catch (e) {
  18373. reject(e);
  18374. }
  18375. }
  18376. function step(result) {
  18377. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  18378. }
  18379. step((generator = generator.apply(thisArg, _arguments || [])).next());
  18380. });
  18381. };
  18382. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  18383. var _ = {
  18384. label: 0,
  18385. sent: function sent() {
  18386. if (t[0] & 1) throw t[1];
  18387. return t[1];
  18388. },
  18389. trys: [],
  18390. ops: []
  18391. },
  18392. f,
  18393. y,
  18394. t,
  18395. g;
  18396. return g = {
  18397. next: verb(0),
  18398. "throw": verb(1),
  18399. "return": verb(2)
  18400. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  18401. return this;
  18402. }), g;
  18403. function verb(n) {
  18404. return function (v) {
  18405. return step([n, v]);
  18406. };
  18407. }
  18408. function step(op) {
  18409. if (f) throw new TypeError("Generator is already executing.");
  18410. while (_) {
  18411. try {
  18412. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  18413. if (y = 0, t) op = [op[0] & 2, t.value];
  18414. switch (op[0]) {
  18415. case 0:
  18416. case 1:
  18417. t = op;
  18418. break;
  18419. case 4:
  18420. _.label++;
  18421. return {
  18422. value: op[1],
  18423. done: false
  18424. };
  18425. case 5:
  18426. _.label++;
  18427. y = op[1];
  18428. op = [0];
  18429. continue;
  18430. case 7:
  18431. op = _.ops.pop();
  18432. _.trys.pop();
  18433. continue;
  18434. default:
  18435. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  18436. _ = 0;
  18437. continue;
  18438. }
  18439. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  18440. _.label = op[1];
  18441. break;
  18442. }
  18443. if (op[0] === 6 && _.label < t[1]) {
  18444. _.label = t[1];
  18445. t = op;
  18446. break;
  18447. }
  18448. if (t && _.label < t[2]) {
  18449. _.label = t[2];
  18450. _.ops.push(op);
  18451. break;
  18452. }
  18453. if (t[2]) _.ops.pop();
  18454. _.trys.pop();
  18455. continue;
  18456. }
  18457. op = body.call(thisArg, _);
  18458. } catch (e) {
  18459. op = [6, e];
  18460. y = 0;
  18461. } finally {
  18462. f = t = 0;
  18463. }
  18464. }
  18465. if (op[0] & 5) throw op[1];
  18466. return {
  18467. value: op[0] ? op[1] : void 0,
  18468. done: true
  18469. };
  18470. }
  18471. };
  18472. /**
  18473. * 以下 class 实现参考
  18474. * https://github.com/Stuk/jszip/blob/d4702a70834bd953d4c2d0bc155fad795076631a/lib/crc32.js
  18475. * 该实现主要针对大文件优化、对计算的值进行了 `>>> 0` 运算(为与服务端保持一致)
  18476. */
  18477. var CRC32 = /** @class */function () {
  18478. function CRC32() {
  18479. this.crc = -1;
  18480. this.table = this.makeTable();
  18481. }
  18482. CRC32.prototype.makeTable = function () {
  18483. var table = new Array();
  18484. for (var i = 0; i < 256; i++) {
  18485. var t = i;
  18486. for (var j = 0; j < 8; j++) {
  18487. if (t & 1) {
  18488. // IEEE 标准
  18489. t = t >>> 1 ^ 0xEDB88320;
  18490. } else {
  18491. t >>>= 1;
  18492. }
  18493. }
  18494. table[i] = t;
  18495. }
  18496. return table;
  18497. };
  18498. CRC32.prototype.append = function (data) {
  18499. var crc = this.crc;
  18500. for (var offset = 0; offset < data.byteLength; offset++) {
  18501. crc = crc >>> 8 ^ this.table[(crc ^ data[offset]) & 0xFF];
  18502. }
  18503. this.crc = crc;
  18504. };
  18505. CRC32.prototype.compute = function () {
  18506. return (this.crc ^ -1) >>> 0;
  18507. };
  18508. CRC32.prototype.readAsUint8Array = function (file) {
  18509. return __awaiter(this, void 0, void 0, function () {
  18510. var _a;
  18511. return __generator(this, function (_b) {
  18512. switch (_b.label) {
  18513. case 0:
  18514. if (!(typeof file.arrayBuffer === 'function')) return [3 /*break*/, 2];
  18515. _a = Uint8Array.bind;
  18516. return [4 /*yield*/, file.arrayBuffer()];
  18517. case 1:
  18518. return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
  18519. case 2:
  18520. return [2 /*return*/, new Promise(function (resolve, reject) {
  18521. var reader = new FileReader();
  18522. reader.onload = function () {
  18523. if (reader.result == null) {
  18524. reject();
  18525. return;
  18526. }
  18527. if (typeof reader.result === 'string') {
  18528. reject();
  18529. return;
  18530. }
  18531. resolve(new Uint8Array(reader.result));
  18532. };
  18533. reader.readAsArrayBuffer(file);
  18534. })];
  18535. }
  18536. });
  18537. });
  18538. };
  18539. CRC32.prototype.file = function (file) {
  18540. return __awaiter(this, void 0, void 0, function () {
  18541. var _a, count, index, start, end, chuck;
  18542. return __generator(this, function (_b) {
  18543. switch (_b.label) {
  18544. case 0:
  18545. if (!(file.size <= _helper.MB)) return [3 /*break*/, 2];
  18546. _a = this.append;
  18547. return [4 /*yield*/, this.readAsUint8Array(file)];
  18548. case 1:
  18549. _a.apply(this, [_b.sent()]);
  18550. return [2 /*return*/, this.compute()];
  18551. case 2:
  18552. count = Math.ceil(file.size / _helper.MB);
  18553. index = 0;
  18554. _b.label = 3;
  18555. case 3:
  18556. if (!(index < count)) return [3 /*break*/, 6];
  18557. start = index * _helper.MB;
  18558. end = index === count - 1 ? file.size : start + _helper.MB;
  18559. return [4 /*yield*/, this.readAsUint8Array(file.slice(start, end))];
  18560. case 4:
  18561. chuck = _b.sent();
  18562. this.append(new Uint8Array(chuck));
  18563. _b.label = 5;
  18564. case 5:
  18565. index++;
  18566. return [3 /*break*/, 3];
  18567. case 6:
  18568. return [2 /*return*/, this.compute()];
  18569. }
  18570. });
  18571. });
  18572. };
  18573. CRC32.file = function (file) {
  18574. var crc = new CRC32();
  18575. return crc.file(file);
  18576. };
  18577. return CRC32;
  18578. }();
  18579. exports.CRC32 = CRC32;
  18580. /***/ }),
  18581. /***/ 812:
  18582. /*!*******************************************************************!*\
  18583. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/logger/index.js ***!
  18584. \*******************************************************************/
  18585. /*! no static exports found */
  18586. /***/ (function(module, exports, __webpack_require__) {
  18587. "use strict";
  18588. Object.defineProperty(exports, "__esModule", {
  18589. value: true
  18590. });
  18591. exports.default = void 0;
  18592. var _reportV = __webpack_require__(/*! ./report-v3 */ 813);
  18593. var __read = void 0 && (void 0).__read || function (o, n) {
  18594. var m = typeof Symbol === "function" && o[Symbol.iterator];
  18595. if (!m) return o;
  18596. var i = m.call(o),
  18597. r,
  18598. ar = [],
  18599. e;
  18600. try {
  18601. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  18602. ar.push(r.value);
  18603. }
  18604. } catch (error) {
  18605. e = {
  18606. error: error
  18607. };
  18608. } finally {
  18609. try {
  18610. if (r && !r.done && (m = i["return"])) m.call(i);
  18611. } finally {
  18612. if (e) throw e.error;
  18613. }
  18614. }
  18615. return ar;
  18616. };
  18617. var __spread = void 0 && (void 0).__spread || function () {
  18618. for (var ar = [], i = 0; i < arguments.length; i++) {
  18619. ar = ar.concat(__read(arguments[i]));
  18620. }
  18621. return ar;
  18622. };
  18623. var Logger = /** @class */function () {
  18624. function Logger(token, disableReport, level, prefix) {
  18625. if (disableReport === void 0) {
  18626. disableReport = true;
  18627. }
  18628. if (level === void 0) {
  18629. level = 'OFF';
  18630. }
  18631. if (prefix === void 0) {
  18632. prefix = 'UPLOAD';
  18633. }
  18634. this.token = token;
  18635. this.disableReport = disableReport;
  18636. this.level = level;
  18637. this.prefix = prefix;
  18638. // 为每个类分配一个 id
  18639. // 用以区分不同的上传任务
  18640. this.id = ++Logger.id;
  18641. }
  18642. Logger.prototype.getPrintPrefix = function (level) {
  18643. return "Qiniu-JS-SDK [" + level + "][" + this.prefix + "#" + this.id + "]:";
  18644. };
  18645. /**
  18646. * @param {V3LogInfo} data 上报的数据。
  18647. * @param {boolean} retry 重试次数,可选,默认为 3。
  18648. * @description 向服务端上报统计信息。
  18649. */
  18650. Logger.prototype.report = function (data, retry) {
  18651. if (this.disableReport) return;
  18652. try {
  18653. (0, _reportV.reportV3)(this.token, data, retry);
  18654. } catch (error) {
  18655. this.warn(error);
  18656. }
  18657. };
  18658. /**
  18659. * @param {unknown[]} ...args
  18660. * @description 输出 info 级别的调试信息。
  18661. */
  18662. Logger.prototype.info = function () {
  18663. var args = [];
  18664. for (var _i = 0; _i < arguments.length; _i++) {
  18665. args[_i] = arguments[_i];
  18666. }
  18667. var allowLevel = ['INFO'];
  18668. if (allowLevel.includes(this.level)) {
  18669. // eslint-disable-next-line no-console
  18670. console.log.apply(console, __spread([this.getPrintPrefix('INFO')], args));
  18671. }
  18672. };
  18673. /**
  18674. * @param {unknown[]} ...args
  18675. * @description 输出 warn 级别的调试信息。
  18676. */
  18677. Logger.prototype.warn = function () {
  18678. var args = [];
  18679. for (var _i = 0; _i < arguments.length; _i++) {
  18680. args[_i] = arguments[_i];
  18681. }
  18682. var allowLevel = ['INFO', 'WARN'];
  18683. if (allowLevel.includes(this.level)) {
  18684. // eslint-disable-next-line no-console
  18685. console.warn.apply(console, __spread([this.getPrintPrefix('WARN')], args));
  18686. }
  18687. };
  18688. /**
  18689. * @param {unknown[]} ...args
  18690. * @description 输出 error 级别的调试信息。
  18691. */
  18692. Logger.prototype.error = function () {
  18693. var args = [];
  18694. for (var _i = 0; _i < arguments.length; _i++) {
  18695. args[_i] = arguments[_i];
  18696. }
  18697. var allowLevel = ['INFO', 'WARN', 'ERROR'];
  18698. if (allowLevel.includes(this.level)) {
  18699. // eslint-disable-next-line no-console
  18700. console.error.apply(console, __spread([this.getPrintPrefix('ERROR')], args));
  18701. }
  18702. };
  18703. Logger.id = 0;
  18704. return Logger;
  18705. }();
  18706. var _default = Logger;
  18707. exports.default = _default;
  18708. /***/ }),
  18709. /***/ 813:
  18710. /*!***********************************************************************!*\
  18711. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/logger/report-v3.js ***!
  18712. \***********************************************************************/
  18713. /*! no static exports found */
  18714. /***/ (function(module, exports, __webpack_require__) {
  18715. "use strict";
  18716. Object.defineProperty(exports, "__esModule", {
  18717. value: true
  18718. });
  18719. exports.reportV3 = reportV3;
  18720. var _utils = __webpack_require__(/*! ../utils */ 794);
  18721. /**
  18722. * @param {string} token 上传使用的 token
  18723. * @param {V3LogInfo} data 上报的统计数据
  18724. * @param {number} retry 重试的次数,默认值 3
  18725. * @description v3 版本的日志上传接口,参考文档 https://github.com/qbox/product/blob/master/kodo/uplog.md#%E7%89%88%E6%9C%AC-3。
  18726. */
  18727. function reportV3(token, data, retry) {
  18728. if (retry === void 0) {
  18729. retry = 3;
  18730. }
  18731. var xhr = (0, _utils.createXHR)();
  18732. xhr.open('POST', 'https://uplog.qbox.me/log/3');
  18733. xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  18734. xhr.setRequestHeader('Authorization', (0, _utils.getAuthHeaders)(token).Authorization);
  18735. xhr.onreadystatechange = function () {
  18736. if (xhr.readyState === 4 && xhr.status !== 200 && retry > 0) {
  18737. reportV3(token, data, retry - 1);
  18738. }
  18739. };
  18740. // 顺序参考:https://github.com/qbox/product/blob/master/kodo/uplog.md#%E7%89%88%E6%9C%AC-3
  18741. var stringifyData = [data.code || '', data.reqId || '', data.host || '', data.remoteIp || '', data.port || '', data.duration || '', data.time || '', data.bytesSent || '', data.upType || '', data.size || ''].join(',');
  18742. xhr.send(stringifyData);
  18743. }
  18744. /***/ }),
  18745. /***/ 814:
  18746. /*!*******************************************************************!*\
  18747. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/hosts.js ***!
  18748. \*******************************************************************/
  18749. /*! no static exports found */
  18750. /***/ (function(module, exports, __webpack_require__) {
  18751. "use strict";
  18752. Object.defineProperty(exports, "__esModule", {
  18753. value: true
  18754. });
  18755. exports.HostPool = exports.Host = void 0;
  18756. var _api = __webpack_require__(/*! ../api */ 805);
  18757. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  18758. function adopt(value) {
  18759. return value instanceof P ? value : new P(function (resolve) {
  18760. resolve(value);
  18761. });
  18762. }
  18763. return new (P || (P = Promise))(function (resolve, reject) {
  18764. function fulfilled(value) {
  18765. try {
  18766. step(generator.next(value));
  18767. } catch (e) {
  18768. reject(e);
  18769. }
  18770. }
  18771. function rejected(value) {
  18772. try {
  18773. step(generator["throw"](value));
  18774. } catch (e) {
  18775. reject(e);
  18776. }
  18777. }
  18778. function step(result) {
  18779. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  18780. }
  18781. step((generator = generator.apply(thisArg, _arguments || [])).next());
  18782. });
  18783. };
  18784. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  18785. var _ = {
  18786. label: 0,
  18787. sent: function sent() {
  18788. if (t[0] & 1) throw t[1];
  18789. return t[1];
  18790. },
  18791. trys: [],
  18792. ops: []
  18793. },
  18794. f,
  18795. y,
  18796. t,
  18797. g;
  18798. return g = {
  18799. next: verb(0),
  18800. "throw": verb(1),
  18801. "return": verb(2)
  18802. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  18803. return this;
  18804. }), g;
  18805. function verb(n) {
  18806. return function (v) {
  18807. return step([n, v]);
  18808. };
  18809. }
  18810. function step(op) {
  18811. if (f) throw new TypeError("Generator is already executing.");
  18812. while (_) {
  18813. try {
  18814. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  18815. if (y = 0, t) op = [op[0] & 2, t.value];
  18816. switch (op[0]) {
  18817. case 0:
  18818. case 1:
  18819. t = op;
  18820. break;
  18821. case 4:
  18822. _.label++;
  18823. return {
  18824. value: op[1],
  18825. done: false
  18826. };
  18827. case 5:
  18828. _.label++;
  18829. y = op[1];
  18830. op = [0];
  18831. continue;
  18832. case 7:
  18833. op = _.ops.pop();
  18834. _.trys.pop();
  18835. continue;
  18836. default:
  18837. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  18838. _ = 0;
  18839. continue;
  18840. }
  18841. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  18842. _.label = op[1];
  18843. break;
  18844. }
  18845. if (op[0] === 6 && _.label < t[1]) {
  18846. _.label = t[1];
  18847. t = op;
  18848. break;
  18849. }
  18850. if (t && _.label < t[2]) {
  18851. _.label = t[2];
  18852. _.ops.push(op);
  18853. break;
  18854. }
  18855. if (t[2]) _.ops.pop();
  18856. _.trys.pop();
  18857. continue;
  18858. }
  18859. op = body.call(thisArg, _);
  18860. } catch (e) {
  18861. op = [6, e];
  18862. y = 0;
  18863. } finally {
  18864. f = t = 0;
  18865. }
  18866. }
  18867. if (op[0] & 5) throw op[1];
  18868. return {
  18869. value: op[0] ? op[1] : void 0,
  18870. done: true
  18871. };
  18872. }
  18873. };
  18874. var __read = void 0 && (void 0).__read || function (o, n) {
  18875. var m = typeof Symbol === "function" && o[Symbol.iterator];
  18876. if (!m) return o;
  18877. var i = m.call(o),
  18878. r,
  18879. ar = [],
  18880. e;
  18881. try {
  18882. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  18883. ar.push(r.value);
  18884. }
  18885. } catch (error) {
  18886. e = {
  18887. error: error
  18888. };
  18889. } finally {
  18890. try {
  18891. if (r && !r.done && (m = i["return"])) m.call(i);
  18892. } finally {
  18893. if (e) throw e.error;
  18894. }
  18895. }
  18896. return ar;
  18897. };
  18898. var __spread = void 0 && (void 0).__spread || function () {
  18899. for (var ar = [], i = 0; i < arguments.length; i++) {
  18900. ar = ar.concat(__read(arguments[i]));
  18901. }
  18902. return ar;
  18903. };
  18904. /**
  18905. * @description 解冻时间,key 是 host,value 为解冻时间
  18906. */
  18907. var unfreezeTimeMap = new Map();
  18908. var Host = /** @class */function () {
  18909. function Host(host, protocol) {
  18910. this.host = host;
  18911. this.protocol = protocol;
  18912. }
  18913. /**
  18914. * @description 当前 host 是否为冻结状态
  18915. */
  18916. Host.prototype.isFrozen = function () {
  18917. var currentTime = new Date().getTime();
  18918. var unfreezeTime = unfreezeTimeMap.get(this.host);
  18919. return unfreezeTime != null && unfreezeTime >= currentTime;
  18920. };
  18921. /**
  18922. * @param {number} time 单位秒,默认 20s
  18923. * @description 冻结该 host 对象,该 host 将在指定时间内不可用
  18924. */
  18925. Host.prototype.freeze = function (time) {
  18926. if (time === void 0) {
  18927. time = 20;
  18928. }
  18929. var unfreezeTime = new Date().getTime() + time * 1000;
  18930. unfreezeTimeMap.set(this.host, unfreezeTime);
  18931. };
  18932. /**
  18933. * @description 解冻该 host
  18934. */
  18935. Host.prototype.unfreeze = function () {
  18936. unfreezeTimeMap["delete"](this.host);
  18937. };
  18938. /**
  18939. * @description 获取当前 host 的完整 url
  18940. */
  18941. Host.prototype.getUrl = function () {
  18942. return this.protocol + "://" + this.host;
  18943. };
  18944. /**
  18945. * @description 获取解冻时间
  18946. */
  18947. Host.prototype.getUnfreezeTime = function () {
  18948. return unfreezeTimeMap.get(this.host);
  18949. };
  18950. return Host;
  18951. }();
  18952. exports.Host = Host;
  18953. var HostPool = /** @class */function () {
  18954. /**
  18955. * @param {string[]} initHosts
  18956. * @description 如果在构造时传入 initHosts,则该 host 池始终使用传入的 initHosts 做为可用的数据
  18957. */
  18958. function HostPool(initHosts) {
  18959. if (initHosts === void 0) {
  18960. initHosts = [];
  18961. }
  18962. this.initHosts = initHosts;
  18963. /**
  18964. * @description 缓存的 host 表,以 bucket 和 accessKey 作为 key
  18965. */
  18966. this.cachedHostsMap = new Map();
  18967. }
  18968. /**
  18969. * @param {string} accessKey
  18970. * @param {string} bucketName
  18971. * @param {string[]} hosts
  18972. * @param {InternalConfig['upprotocol']} protocol
  18973. * @returns {void}
  18974. * @description 注册可用 host
  18975. */
  18976. HostPool.prototype.register = function (accessKey, bucketName, hosts, protocol) {
  18977. this.cachedHostsMap.set(accessKey + "@" + bucketName, hosts.map(function (host) {
  18978. return new Host(host, protocol);
  18979. }));
  18980. };
  18981. /**
  18982. * @param {string} accessKey
  18983. * @param {string} bucketName
  18984. * @param {InternalConfig['upprotocol']} protocol
  18985. * @returns {Promise<void>}
  18986. * @description 刷新最新的 host 数据,如果用户在构造时该类时传入了 host 或者已经存在缓存则不会发起请求
  18987. */
  18988. HostPool.prototype.refresh = function (accessKey, bucketName, protocol) {
  18989. var _a, _b, _c, _d;
  18990. return __awaiter(this, void 0, void 0, function () {
  18991. var cachedHostList, response, stashHosts;
  18992. return __generator(this, function (_e) {
  18993. switch (_e.label) {
  18994. case 0:
  18995. cachedHostList = this.cachedHostsMap.get(accessKey + "@" + bucketName) || [];
  18996. if (cachedHostList.length > 0) return [2 /*return*/];
  18997. if (this.initHosts.length > 0) {
  18998. this.register(accessKey, bucketName, this.initHosts, protocol);
  18999. return [2 /*return*/];
  19000. }
  19001. return [4 /*yield*/, (0, _api.getUpHosts)(accessKey, bucketName, protocol)];
  19002. case 1:
  19003. response = _e.sent();
  19004. if ((response === null || response === void 0 ? void 0 : response.data) != null) {
  19005. stashHosts = __spread(((_b = (_a = response.data.up) === null || _a === void 0 ? void 0 : _a.acc) === null || _b === void 0 ? void 0 : _b.main) || [], ((_d = (_c = response.data.up) === null || _c === void 0 ? void 0 : _c.acc) === null || _d === void 0 ? void 0 : _d.backup) || []);
  19006. this.register(accessKey, bucketName, stashHosts, protocol);
  19007. }
  19008. return [2 /*return*/];
  19009. }
  19010. });
  19011. });
  19012. };
  19013. /**
  19014. * @param {string} accessKey
  19015. * @param {string} bucketName
  19016. * @param {InternalConfig['upprotocol']} protocol
  19017. * @returns {Promise<Host | null>}
  19018. * @description 获取一个可用的上传 Host,排除已冻结的
  19019. */
  19020. HostPool.prototype.getUp = function (accessKey, bucketName, protocol) {
  19021. return __awaiter(this, void 0, void 0, function () {
  19022. var cachedHostList, availableHostList, priorityQueue;
  19023. return __generator(this, function (_a) {
  19024. switch (_a.label) {
  19025. case 0:
  19026. return [4 /*yield*/, this.refresh(accessKey, bucketName, protocol)];
  19027. case 1:
  19028. _a.sent();
  19029. cachedHostList = this.cachedHostsMap.get(accessKey + "@" + bucketName) || [];
  19030. if (cachedHostList.length === 0) return [2 /*return*/, null];
  19031. availableHostList = cachedHostList.filter(function (host) {
  19032. return !host.isFrozen();
  19033. });
  19034. if (availableHostList.length > 0) return [2 /*return*/, availableHostList[0]
  19035. // 无可用的,去取离解冻最近的 host
  19036. ];
  19037. priorityQueue = cachedHostList.slice().sort(function (hostA, hostB) {
  19038. return (hostA.getUnfreezeTime() || 0) - (hostB.getUnfreezeTime() || 0);
  19039. });
  19040. return [2 /*return*/, priorityQueue[0]];
  19041. }
  19042. });
  19043. });
  19044. };
  19045. return HostPool;
  19046. }();
  19047. exports.HostPool = HostPool;
  19048. /***/ }),
  19049. /***/ 815:
  19050. /*!*********************************************************************!*\
  19051. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/compress.js ***!
  19052. \*********************************************************************/
  19053. /*! no static exports found */
  19054. /***/ (function(module, exports, __webpack_require__) {
  19055. "use strict";
  19056. Object.defineProperty(exports, "__esModule", {
  19057. value: true
  19058. });
  19059. exports.default = void 0;
  19060. var _errors = __webpack_require__(/*! ../errors */ 792);
  19061. var _helper = __webpack_require__(/*! ./helper */ 798);
  19062. var __assign = void 0 && (void 0).__assign || function () {
  19063. __assign = Object.assign || function (t) {
  19064. for (var s, i = 1, n = arguments.length; i < n; i++) {
  19065. s = arguments[i];
  19066. for (var p in s) {
  19067. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  19068. }
  19069. }
  19070. return t;
  19071. };
  19072. return __assign.apply(this, arguments);
  19073. };
  19074. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  19075. function adopt(value) {
  19076. return value instanceof P ? value : new P(function (resolve) {
  19077. resolve(value);
  19078. });
  19079. }
  19080. return new (P || (P = Promise))(function (resolve, reject) {
  19081. function fulfilled(value) {
  19082. try {
  19083. step(generator.next(value));
  19084. } catch (e) {
  19085. reject(e);
  19086. }
  19087. }
  19088. function rejected(value) {
  19089. try {
  19090. step(generator["throw"](value));
  19091. } catch (e) {
  19092. reject(e);
  19093. }
  19094. }
  19095. function step(result) {
  19096. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  19097. }
  19098. step((generator = generator.apply(thisArg, _arguments || [])).next());
  19099. });
  19100. };
  19101. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  19102. var _ = {
  19103. label: 0,
  19104. sent: function sent() {
  19105. if (t[0] & 1) throw t[1];
  19106. return t[1];
  19107. },
  19108. trys: [],
  19109. ops: []
  19110. },
  19111. f,
  19112. y,
  19113. t,
  19114. g;
  19115. return g = {
  19116. next: verb(0),
  19117. "throw": verb(1),
  19118. "return": verb(2)
  19119. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  19120. return this;
  19121. }), g;
  19122. function verb(n) {
  19123. return function (v) {
  19124. return step([n, v]);
  19125. };
  19126. }
  19127. function step(op) {
  19128. if (f) throw new TypeError("Generator is already executing.");
  19129. while (_) {
  19130. try {
  19131. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  19132. if (y = 0, t) op = [op[0] & 2, t.value];
  19133. switch (op[0]) {
  19134. case 0:
  19135. case 1:
  19136. t = op;
  19137. break;
  19138. case 4:
  19139. _.label++;
  19140. return {
  19141. value: op[1],
  19142. done: false
  19143. };
  19144. case 5:
  19145. _.label++;
  19146. y = op[1];
  19147. op = [0];
  19148. continue;
  19149. case 7:
  19150. op = _.ops.pop();
  19151. _.trys.pop();
  19152. continue;
  19153. default:
  19154. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  19155. _ = 0;
  19156. continue;
  19157. }
  19158. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  19159. _.label = op[1];
  19160. break;
  19161. }
  19162. if (op[0] === 6 && _.label < t[1]) {
  19163. _.label = t[1];
  19164. t = op;
  19165. break;
  19166. }
  19167. if (t && _.label < t[2]) {
  19168. _.label = t[2];
  19169. _.ops.push(op);
  19170. break;
  19171. }
  19172. if (t[2]) _.ops.pop();
  19173. _.trys.pop();
  19174. continue;
  19175. }
  19176. op = body.call(thisArg, _);
  19177. } catch (e) {
  19178. op = [6, e];
  19179. y = 0;
  19180. } finally {
  19181. f = t = 0;
  19182. }
  19183. }
  19184. if (op[0] & 5) throw op[1];
  19185. return {
  19186. value: op[0] ? op[1] : void 0,
  19187. done: true
  19188. };
  19189. }
  19190. };
  19191. var mimeTypes = {
  19192. PNG: 'image/png',
  19193. JPEG: 'image/jpeg',
  19194. WEBP: 'image/webp',
  19195. BMP: 'image/bmp'
  19196. };
  19197. var maxSteps = 4;
  19198. var scaleFactor = Math.log(2);
  19199. var supportMimeTypes = Object.keys(mimeTypes).map(function (type) {
  19200. return mimeTypes[type];
  19201. });
  19202. var defaultType = mimeTypes.JPEG;
  19203. function isSupportedType(type) {
  19204. return supportMimeTypes.includes(type);
  19205. }
  19206. var Compress = /** @class */function () {
  19207. function Compress(file, config) {
  19208. this.file = file;
  19209. this.config = config;
  19210. this.config = __assign({
  19211. quality: 0.92,
  19212. noCompressIfLarger: false
  19213. }, this.config);
  19214. }
  19215. Compress.prototype.process = function () {
  19216. return __awaiter(this, void 0, void 0, function () {
  19217. var srcDimension, originImage, canvas, scale, scaleCanvas, distBlob;
  19218. return __generator(this, function (_a) {
  19219. switch (_a.label) {
  19220. case 0:
  19221. this.outputType = this.file.type;
  19222. srcDimension = {};
  19223. if (!isSupportedType(this.file.type)) {
  19224. throw new _errors.QiniuError(_errors.QiniuErrorName.UnsupportedFileType, "unsupported file type: " + this.file.type);
  19225. }
  19226. return [4 /*yield*/, this.getOriginImage()];
  19227. case 1:
  19228. originImage = _a.sent();
  19229. return [4 /*yield*/, this.getCanvas(originImage)];
  19230. case 2:
  19231. canvas = _a.sent();
  19232. scale = 1;
  19233. if (this.config.maxWidth) {
  19234. scale = Math.min(1, this.config.maxWidth / canvas.width);
  19235. }
  19236. if (this.config.maxHeight) {
  19237. scale = Math.min(1, scale, this.config.maxHeight / canvas.height);
  19238. }
  19239. srcDimension.width = canvas.width;
  19240. srcDimension.height = canvas.height;
  19241. return [4 /*yield*/, this.doScale(canvas, scale)];
  19242. case 3:
  19243. scaleCanvas = _a.sent();
  19244. distBlob = this.toBlob(scaleCanvas);
  19245. if (distBlob.size > this.file.size && this.config.noCompressIfLarger) {
  19246. return [2 /*return*/, {
  19247. dist: this.file,
  19248. width: srcDimension.width,
  19249. height: srcDimension.height
  19250. }];
  19251. }
  19252. return [2 /*return*/, {
  19253. dist: distBlob,
  19254. width: scaleCanvas.width,
  19255. height: scaleCanvas.height
  19256. }];
  19257. }
  19258. });
  19259. });
  19260. };
  19261. Compress.prototype.clear = function (ctx, width, height) {
  19262. // jpeg 没有 alpha 通道,透明区间会被填充成黑色,这里把透明区间填充为白色
  19263. if (this.outputType === defaultType) {
  19264. ctx.fillStyle = '#fff';
  19265. ctx.fillRect(0, 0, width, height);
  19266. } else {
  19267. ctx.clearRect(0, 0, width, height);
  19268. }
  19269. };
  19270. /** 通过 file 初始化 image 对象 */
  19271. Compress.prototype.getOriginImage = function () {
  19272. var _this = this;
  19273. return new Promise(function (resolve, reject) {
  19274. var url = (0, _helper.createObjectURL)(_this.file);
  19275. var img = new Image();
  19276. img.onload = function () {
  19277. resolve(img);
  19278. };
  19279. img.onerror = function () {
  19280. reject('image load error');
  19281. };
  19282. img.src = url;
  19283. });
  19284. };
  19285. Compress.prototype.getCanvas = function (img) {
  19286. var _this = this;
  19287. return new Promise(function (resolve, reject) {
  19288. var canvas = document.createElement('canvas');
  19289. var context = canvas.getContext('2d');
  19290. if (!context) {
  19291. reject(new _errors.QiniuError(_errors.QiniuErrorName.GetCanvasContextFailed, 'context is null'));
  19292. return;
  19293. }
  19294. var width = img.width,
  19295. height = img.height;
  19296. canvas.height = height;
  19297. canvas.width = width;
  19298. _this.clear(context, width, height);
  19299. context.drawImage(img, 0, 0);
  19300. resolve(canvas);
  19301. });
  19302. };
  19303. Compress.prototype.doScale = function (source, scale) {
  19304. return __awaiter(this, void 0, void 0, function () {
  19305. var sctx, steps, factor, mirror, mctx, width, height, originWidth, originHeight, src, context, i, dw, dh, canvas, data;
  19306. return __generator(this, function (_a) {
  19307. if (scale === 1) {
  19308. return [2 /*return*/, source];
  19309. }
  19310. sctx = source.getContext('2d');
  19311. steps = Math.min(maxSteps, Math.ceil(1 / scale / scaleFactor));
  19312. factor = Math.pow(scale, 1 / steps);
  19313. mirror = document.createElement('canvas');
  19314. mctx = mirror.getContext('2d');
  19315. width = source.width, height = source.height;
  19316. originWidth = width;
  19317. originHeight = height;
  19318. mirror.width = width;
  19319. mirror.height = height;
  19320. if (!mctx || !sctx) {
  19321. throw new _errors.QiniuError(_errors.QiniuErrorName.GetCanvasContextFailed, "mctx or sctx can't be null");
  19322. }
  19323. for (i = 0; i < steps; i++) {
  19324. dw = width * factor | 0 // eslint-disable-line no-bitwise
  19325. ;
  19326. dh = height * factor | 0 // eslint-disable-line no-bitwise
  19327. ;
  19328. // 到最后一步的时候 dw, dh 用目标缩放尺寸,否则会出现最后尺寸偏小的情况
  19329. if (i === steps - 1) {
  19330. dw = originWidth * scale;
  19331. dh = originHeight * scale;
  19332. }
  19333. if (i % 2 === 0) {
  19334. src = source;
  19335. context = mctx;
  19336. } else {
  19337. src = mirror;
  19338. context = sctx;
  19339. }
  19340. // 每次画前都清空,避免图像重叠
  19341. this.clear(context, width, height);
  19342. context.drawImage(src, 0, 0, width, height, 0, 0, dw, dh);
  19343. width = dw;
  19344. height = dh;
  19345. }
  19346. canvas = src === source ? mirror : source;
  19347. data = context.getImageData(0, 0, width, height);
  19348. // resize
  19349. canvas.width = width;
  19350. canvas.height = height;
  19351. // store image data
  19352. context.putImageData(data, 0, 0);
  19353. return [2 /*return*/, canvas];
  19354. });
  19355. });
  19356. };
  19357. /** 这里把 base64 字符串转为 blob 对象 */
  19358. Compress.prototype.toBlob = function (result) {
  19359. var dataURL = result.toDataURL(this.outputType, this.config.quality);
  19360. var buffer = atob(dataURL.split(',')[1]).split('').map(function (char) {
  19361. return char.charCodeAt(0);
  19362. });
  19363. var blob = new Blob([new Uint8Array(buffer)], {
  19364. type: this.outputType
  19365. });
  19366. return blob;
  19367. };
  19368. return Compress;
  19369. }();
  19370. var compressImage = function compressImage(file, options) {
  19371. return new Compress(file, options).process();
  19372. };
  19373. var _default = compressImage;
  19374. exports.default = _default;
  19375. /***/ }),
  19376. /***/ 824:
  19377. /*!***************************************!*\
  19378. !*** D:/工作/项目2/亲家母/qjm/api/upload.js ***!
  19379. \***************************************/
  19380. /*! no static exports found */
  19381. /***/ (function(module, exports, __webpack_require__) {
  19382. "use strict";
  19383. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19384. Object.defineProperty(exports, "__esModule", {
  19385. value: true
  19386. });
  19387. exports.get_list = get_list;
  19388. exports.get_product_info = get_product_info;
  19389. exports.get_rule = get_rule;
  19390. exports.is_format_attr = is_format_attr;
  19391. exports.save = save;
  19392. exports.set_apply = set_apply;
  19393. exports.temp_list = temp_list;
  19394. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  19395. // 提交审核
  19396. function set_apply(data, id) {
  19397. return (0, _request.default)({
  19398. url: '/api/user_product/set_apply/' + id,
  19399. method: 'post',
  19400. data: data
  19401. });
  19402. }
  19403. //我的商品列表
  19404. function get_list(data) {
  19405. return (0, _request.default)({
  19406. url: '/api/user_product/get_list',
  19407. method: 'get',
  19408. data: data
  19409. });
  19410. }
  19411. //新增修改商品
  19412. function save(data, id) {
  19413. return (0, _request.default)({
  19414. url: '/api/user_product/save/' + id,
  19415. method: 'post',
  19416. data: data
  19417. });
  19418. }
  19419. // 生成规格列表
  19420. function is_format_attr(data) {
  19421. return (0, _request.default)({
  19422. url: '/api/user_product/is_format_attr/0',
  19423. method: 'post',
  19424. data: data
  19425. });
  19426. }
  19427. // 获取运费模板
  19428. function temp_list(data) {
  19429. return (0, _request.default)({
  19430. url: '/api/user_product/temp_list',
  19431. method: 'get',
  19432. data: data
  19433. });
  19434. }
  19435. // 获取商品详情
  19436. function get_product_info(data, id) {
  19437. return (0, _request.default)({
  19438. url: '/api/user_product/get_product_info/' + id,
  19439. method: 'get',
  19440. data: data
  19441. });
  19442. }
  19443. // 获取规格列表
  19444. function get_rule(data) {
  19445. return (0, _request.default)({
  19446. url: '/api/user_product/get_rule',
  19447. method: 'get',
  19448. data: data
  19449. });
  19450. }
  19451. /***/ }),
  19452. /***/ 9:
  19453. /*!*****************************************************************!*\
  19454. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  19455. \*****************************************************************/
  19456. /*! no static exports found */
  19457. /***/ (function(module, exports) {
  19458. function _arrayLikeToArray(arr, len) {
  19459. if (len == null || len > arr.length) len = arr.length;
  19460. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  19461. arr2[i] = arr[i];
  19462. }
  19463. return arr2;
  19464. }
  19465. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19466. /***/ })
  19467. }]);
  19468. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map