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. /***/ 100:
  53. /*!*********************************************!*\
  54. !*** D:/工作/项目2/亲家母/qjm/utils/loginUtils.js ***!
  55. \*********************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. "use strict";
  59. /* WEBPACK VAR INJECTION */(function(uni) {
  60. Object.defineProperty(exports, "__esModule", {
  61. value: true
  62. });
  63. exports.getActionPage = getActionPage;
  64. exports.getPageUrl = getPageUrl;
  65. exports.interceptor = interceptor;
  66. exports.saveUrl = saveUrl;
  67. function getActionPage() {
  68. var pages = getCurrentPages();
  69. return pages[pages.length - 1];
  70. }
  71. //登录拦截
  72. function interceptor() {
  73. var pages = getActionPage();
  74. // 获取当前页面
  75. var pageUrl = '/' + pages.route;
  76. var url = '/pages/public/login';
  77. url = '/pages/public/wxLogin';
  78. if (pageUrl != url) {
  79. uni.navigateTo({
  80. url: url
  81. });
  82. }
  83. }
  84. // 保存页面
  85. function saveUrl() {
  86. var path = getPageUrl(true);
  87. uni.setStorageSync('present', path);
  88. }
  89. // 处理分享链接地址
  90. function getPageUrl() {
  91. var showSpeard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  92. var page = getActionPage();
  93. var path = '/' + page.route;
  94. var url = '';
  95. // 获取对象可枚举键值列表
  96. var objKeys = Object.keys(page.options);
  97. // 判断有无传值
  98. if (objKeys.length > 0) {
  99. // 循环赋值对象数据
  100. for (var a in page.options) {
  101. // 判断有无邀请人
  102. if (a != 'speard') {
  103. url += a + "=" + page.options[a] + "&";
  104. } else {
  105. // 判断是否需要存储邀请人
  106. if (showSpeard) {
  107. url += a + "=" + page.options[a] + "&";
  108. }
  109. }
  110. }
  111. path += '?' + url.substr(0, url.length - 1);
  112. }
  113. // 返回处理邀请人后的邀请地址
  114. return path;
  115. }
  116. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  117. /***/ }),
  118. /***/ 101:
  119. /*!*************************************!*\
  120. !*** D:/工作/项目2/亲家母/qjm/api/user.js ***!
  121. \*************************************/
  122. /*! no static exports found */
  123. /***/ (function(module, exports, __webpack_require__) {
  124. "use strict";
  125. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  126. Object.defineProperty(exports, "__esModule", {
  127. value: true
  128. });
  129. exports.addressDel = addressDel;
  130. exports.addressEdit = addressEdit;
  131. exports.agentLevelList = agentLevelList;
  132. exports.agentLevelTaskList = agentLevelTaskList;
  133. exports.articleList = articleList;
  134. exports.cartDel = cartDel;
  135. exports.delcollect = delcollect;
  136. exports.details = details;
  137. exports.edit = edit;
  138. exports.getAddressList = getAddressList;
  139. exports.getCartList = getCartList;
  140. exports.getCartNum = getCartNum;
  141. exports.getUserInfo = getUserInfo;
  142. exports.getcollectList = getcollectList;
  143. exports.message = message;
  144. exports.moneyList = moneyList;
  145. exports.myspread = myspread;
  146. exports.orderData = orderData;
  147. exports.setAddressDefault = setAddressDefault;
  148. exports.spreadBanner = spreadBanner;
  149. exports.spreadOrder = spreadOrder;
  150. exports.subscribe = subscribe;
  151. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  152. // 订单统计信息
  153. function orderData(data) {
  154. return (0, _request.default)({
  155. url: '/api/order/data',
  156. method: 'get',
  157. data: data
  158. });
  159. }
  160. // 获取用户信息
  161. function getUserInfo(data) {
  162. return (0, _request.default)({
  163. url: '/api/user',
  164. method: 'get',
  165. data: data
  166. });
  167. }
  168. //用户修改信息
  169. function edit(data) {
  170. return (0, _request.default)({
  171. url: '/api/user/edit',
  172. method: 'post',
  173. data: data
  174. });
  175. }
  176. // 用户分享图
  177. function spreadBanner(data) {
  178. return (0, _request.default)({
  179. url: '/api/spread/banner',
  180. method: 'get',
  181. data: data
  182. });
  183. }
  184. // 获取地址列表
  185. function getAddressList(data) {
  186. return (0, _request.default)({
  187. url: '/api/address/list',
  188. method: 'get',
  189. data: data
  190. });
  191. }
  192. // 修改地址
  193. function addressEdit(data) {
  194. return (0, _request.default)({
  195. url: '/api/address/edit',
  196. method: 'post',
  197. data: data
  198. });
  199. }
  200. // 删除地址
  201. function addressDel(data) {
  202. return (0, _request.default)({
  203. url: '/api/address/del',
  204. method: 'post',
  205. data: data
  206. });
  207. }
  208. // 设为默认地址
  209. function setAddressDefault(data) {
  210. return (0, _request.default)({
  211. url: '/api/address/default/set',
  212. method: 'post',
  213. data: data
  214. });
  215. }
  216. // 购物车列表
  217. function getCartList(data) {
  218. return (0, _request.default)({
  219. url: '/api/cart/list',
  220. method: 'get',
  221. data: data
  222. });
  223. }
  224. // 修改购物车数量
  225. function getCartNum(data) {
  226. return (0, _request.default)({
  227. url: '/api/cart/num',
  228. method: 'post',
  229. data: data
  230. });
  231. }
  232. //删除购物车
  233. function cartDel(data) {
  234. return (0, _request.default)({
  235. url: '/api/cart/del',
  236. method: 'post',
  237. data: data
  238. });
  239. }
  240. //获取收藏夹列表
  241. function getcollectList(data) {
  242. return (0, _request.default)({
  243. url: '/api/collect/user',
  244. method: 'get',
  245. data: data
  246. });
  247. }
  248. // 取消收藏
  249. function delcollect(data) {
  250. return (0, _request.default)({
  251. url: '/api/collect/del',
  252. method: 'post',
  253. data: data
  254. });
  255. }
  256. //文章详情
  257. function details(data, id) {
  258. return (0, _request.default)({
  259. url: '/api/article/details/' + id,
  260. method: 'GET',
  261. data: data
  262. });
  263. }
  264. //文章列表
  265. function articleList(data, id) {
  266. return (0, _request.default)({
  267. url: '/api/article/list/' + id,
  268. method: 'GET',
  269. data: data
  270. });
  271. }
  272. // 列表
  273. function moneyList(data, type) {
  274. return (0, _request.default)({
  275. url: '/api/money/list/' + type,
  276. method: 'get',
  277. data: data
  278. });
  279. }
  280. //我的推广
  281. function myspread(data) {
  282. return (0, _request.default)({
  283. url: '/api/spread/people',
  284. method: 'POST',
  285. data: data
  286. });
  287. }
  288. //推广人订单
  289. function spreadOrder(data) {
  290. return (0, _request.default)({
  291. url: '/api/spread/order',
  292. method: 'POST',
  293. data: data
  294. });
  295. }
  296. //订阅消息
  297. function subscribe(data, id) {
  298. return (0, _request.default)({
  299. url: '/api/seckill/subscribe/' + id,
  300. method: 'POST',
  301. data: data
  302. });
  303. }
  304. // 系统通知
  305. function message(data) {
  306. return (0, _request.default)({
  307. url: '/api/user/message',
  308. method: 'GET',
  309. data: data
  310. });
  311. }
  312. // 会员等级列表
  313. function agentLevelList(data) {
  314. return (0, _request.default)({
  315. url: '/api/user/level/grade',
  316. method: 'GET',
  317. data: data
  318. });
  319. }
  320. // 会员列表
  321. function agentLevelTaskList(data, id) {
  322. return (0, _request.default)({
  323. url: '/api/user/level/task/' + id,
  324. method: 'GET',
  325. data: data
  326. });
  327. }
  328. /***/ }),
  329. /***/ 102:
  330. /*!***********************************************!*\
  331. !*** D:/工作/项目2/亲家母/qjm/api/functionalUnit.js ***!
  332. \***********************************************/
  333. /*! no static exports found */
  334. /***/ (function(module, exports, __webpack_require__) {
  335. "use strict";
  336. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  337. Object.defineProperty(exports, "__esModule", {
  338. value: true
  339. });
  340. exports.couponsOrder = couponsOrder;
  341. exports.getCouponsList = getCouponsList;
  342. exports.getwCouponsList = getwCouponsList;
  343. exports.integral = integral;
  344. exports.integrallist = integrallist;
  345. exports.setCoupons = setCoupons;
  346. exports.signList = signList;
  347. exports.signUser = signUser;
  348. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  349. //获取优惠券列表
  350. function getCouponsList(data, types) {
  351. //优惠券状态 0全部 1未使用 2已使用
  352. return (0, _request.default)({
  353. url: '/api/coupons/user/' + types,
  354. method: 'get',
  355. data: data
  356. });
  357. }
  358. //优惠券列表
  359. function getwCouponsList(data) {
  360. return (0, _request.default)({
  361. url: '/api/coupons',
  362. method: 'get',
  363. data: data
  364. });
  365. }
  366. //领取优惠券
  367. function setCoupons(data) {
  368. return (0, _request.default)({
  369. url: '/api/coupon/receive',
  370. method: 'post',
  371. data: data
  372. });
  373. }
  374. //获取可使用优惠券
  375. function couponsOrder(data, price) {
  376. return (0, _request.default)({
  377. url: '/api/coupons/order/' + price,
  378. method: 'get',
  379. data: data
  380. });
  381. }
  382. // 积分列表
  383. function integrallist(data) {
  384. return (0, _request.default)({
  385. url: '/api/integral/list',
  386. method: 'get',
  387. data: data
  388. });
  389. }
  390. // 获取签到列表
  391. function signList(data) {
  392. return (0, _request.default)({
  393. url: '/api/sign/list',
  394. method: 'get',
  395. data: data
  396. });
  397. }
  398. // 点击签到
  399. function integral(data) {
  400. return (0, _request.default)({
  401. url: '/api/sign/integral',
  402. method: 'post',
  403. data: data
  404. });
  405. }
  406. // 签到信息
  407. function signUser(data) {
  408. return (0, _request.default)({
  409. url: '/api/sign/user',
  410. method: 'post',
  411. data: data
  412. });
  413. }
  414. /***/ }),
  415. /***/ 103:
  416. /*!****************************************!*\
  417. !*** D:/工作/项目2/亲家母/qjm/api/product.js ***!
  418. \****************************************/
  419. /*! no static exports found */
  420. /***/ (function(module, exports, __webpack_require__) {
  421. "use strict";
  422. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  423. Object.defineProperty(exports, "__esModule", {
  424. value: true
  425. });
  426. exports.cartAdd = cartAdd;
  427. exports.collectAdd = collectAdd;
  428. exports.collectDel = collectDel;
  429. exports.getBargainList = getBargainList;
  430. exports.getCategoryList = getCategoryList;
  431. exports.getCombinationLisPink = getCombinationLisPink;
  432. exports.getCombinationLisRemove = getCombinationLisRemove;
  433. exports.getCombinationList = getCombinationList;
  434. exports.getCombinationPoster = getCombinationPoster;
  435. exports.getProducts = getProducts;
  436. exports.getSeckillClass = getSeckillClass;
  437. exports.getSeckillList = getSeckillList;
  438. exports.goodsDetail = goodsDetail;
  439. exports.groomList = groomList;
  440. exports.groupGoods = groupGoods;
  441. exports.poster = poster;
  442. exports.reply_config = reply_config;
  443. exports.reply_list = reply_list;
  444. exports.searchKeyword = searchKeyword;
  445. exports.seckillGoods = seckillGoods;
  446. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  447. // 获取商品列表
  448. function getProducts(data) {
  449. // {
  450. // 参数名称 是否必须 示例 备注
  451. // sid 否 二级分类编号
  452. // cid 否 一级分类编号(!)
  453. // keyword 否 搜索
  454. // priceOrder 否 价格排序
  455. // salesOrder 否 销量排序
  456. // news 否 是否新品
  457. // page 否 分页参数起始值
  458. // limit 否 分页数步长值
  459. // }
  460. return (0, _request.default)({
  461. url: '/api/products',
  462. method: 'get',
  463. data: data
  464. });
  465. }
  466. // 获取商品详情
  467. function goodsDetail(data, id) {
  468. return (0, _request.default)({
  469. url: '/api/product/detail/' + id,
  470. method: 'get',
  471. data: data
  472. });
  473. }
  474. // 砍价列表
  475. function getBargainList(data) {
  476. return (0, _request.default)({
  477. url: '/api/bargain/list',
  478. method: 'get',
  479. data: data
  480. });
  481. }
  482. // 加入购物车
  483. function cartAdd(data) {
  484. return (0, _request.default)({
  485. url: '/api/cart/add',
  486. method: 'post',
  487. data: data
  488. });
  489. }
  490. // 收藏商品
  491. function collectAdd(data) {
  492. return (0, _request.default)({
  493. url: '/api/collect/add',
  494. method: 'post',
  495. data: data
  496. });
  497. }
  498. // 取消收藏商品
  499. function collectDel(data) {
  500. return (0, _request.default)({
  501. url: '/api/collect/del',
  502. method: 'post',
  503. data: data
  504. });
  505. }
  506. // 获取搜搜关键字
  507. function searchKeyword(data) {
  508. return (0, _request.default)({
  509. url: '/api/search/keyword',
  510. method: 'get',
  511. data: data
  512. });
  513. }
  514. // 获取热门分类信息
  515. function groomList(data, type) {
  516. // 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
  517. return (0, _request.default)({
  518. url: '/api/groom/list/' + type,
  519. method: 'get',
  520. data: data
  521. });
  522. }
  523. // 获取秒杀商品详细
  524. function seckillGoods(data, id) {
  525. return (0, _request.default)({
  526. url: '/api/seckill/detail/' + id,
  527. method: 'get',
  528. data: data
  529. });
  530. }
  531. // 获取拼团商品详细
  532. function groupGoods(data, id) {
  533. return (0, _request.default)({
  534. url: '/api/combination/detail/' + id,
  535. method: 'get',
  536. data: data
  537. });
  538. }
  539. // 获取商品分类
  540. function getCategoryList(data) {
  541. return (0, _request.default)({
  542. url: '/api/category',
  543. method: 'get',
  544. data: data
  545. });
  546. }
  547. // 获取拼团列表
  548. function getCombinationList(data) {
  549. return (0, _request.default)({
  550. url: '/api/combination/list',
  551. method: 'get',
  552. data: data
  553. });
  554. }
  555. //取消拼团
  556. function getCombinationLisRemove(data, id) {
  557. return (0, _request.default)({
  558. url: '/api/combination/remove' + id,
  559. method: 'get',
  560. data: data
  561. });
  562. }
  563. //拼团开团页面数据
  564. function getCombinationLisPink(data, id) {
  565. return (0, _request.default)({
  566. url: '/api/combination/pink/' + id,
  567. method: 'get',
  568. data: data
  569. });
  570. }
  571. // 获取拼团海报
  572. function getCombinationPoster(data) {
  573. return (0, _request.default)({
  574. url: '/api/combination/poster',
  575. method: 'post',
  576. data: data
  577. });
  578. }
  579. // 获取秒杀分类
  580. function getSeckillClass(data) {
  581. return (0, _request.default)({
  582. url: '/api/seckill/index',
  583. method: 'get',
  584. data: data
  585. });
  586. }
  587. // 获取秒杀列表
  588. function getSeckillList(data, id) {
  589. return (0, _request.default)({
  590. url: '/api/seckill/list/' + id,
  591. method: 'get',
  592. data: data
  593. });
  594. }
  595. // 分享海报
  596. function poster(data) {
  597. return (0, _request.default)({
  598. url: '/api/product/poster',
  599. method: 'post',
  600. data: data
  601. });
  602. }
  603. // 产品评价数量和好评度
  604. function reply_config(data, id) {
  605. return (0, _request.default)({
  606. url: '/api/reply/config/' + id,
  607. method: 'get',
  608. data: data
  609. });
  610. }
  611. // 获取产品评论
  612. function reply_list(data, id) {
  613. return (0, _request.default)({
  614. url: '/api/reply/list/' + id,
  615. method: 'get',
  616. data: data
  617. });
  618. }
  619. /***/ }),
  620. /***/ 104:
  621. /*!*******************************************!*\
  622. !*** D:/工作/项目2/亲家母/qjm/utils/rocessor.js ***!
  623. \*******************************************/
  624. /*! no static exports found */
  625. /***/ (function(module, exports, __webpack_require__) {
  626. "use strict";
  627. /* WEBPACK VAR INJECTION */(function(wx) {
  628. Object.defineProperty(exports, "__esModule", {
  629. value: true
  630. });
  631. exports.getMoneyStyle = getMoneyStyle;
  632. exports.getTime = getTime;
  633. exports.isCardNo = isCardNo;
  634. exports.openMap = openMap;
  635. exports.timeComputed = timeComputed;
  636. //身份证验证
  637. function isCardNo(card) {
  638. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  639. 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}$)/;
  640. if (reg.test(card) === false) {
  641. console.log(card);
  642. return false;
  643. }
  644. return true;
  645. }
  646. // 金额显示变化
  647. function getMoneyStyle() {
  648. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  649. if (typeof value == 'string') {
  650. value = (+value).toFixed(2);
  651. }
  652. if (typeof value == 'number') {
  653. value = value.toFixed(2);
  654. }
  655. // 将字符串转为数组
  656. var n = value.split("");
  657. // 反转数组并复制循环处理
  658. var arr = n.reverse().map(function (e, ind, ar) {
  659. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  660. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  661. return e + ',';
  662. } else {
  663. return e;
  664. }
  665. });
  666. // 反转数组回复原来排序并合并回字符串
  667. arr = arr.reverse().join('');
  668. return arr;
  669. }
  670. // 倒计时计算
  671. // 计算倒计时时间
  672. function timeComputed(time) {
  673. // 获取当前时间
  674. var actTime = new Date().getTime();
  675. // 获取到期时间
  676. var stopTime = time - actTime;
  677. // 判断是否小于0
  678. if (stopTime < 0) {
  679. stopTime = stopTime * -1;
  680. }
  681. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余天数
  682. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  683. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  684. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  685. return {
  686. hours: hours,
  687. //倒计时小时数
  688. minutes: minutes,
  689. //倒计时分钟数
  690. seconds: seconds,
  691. //倒计时秒数
  692. day: day //倒计时天数
  693. };
  694. }
  695. // 调用打开地图方法
  696. function openMap(e) {
  697. var that = this;
  698. return new Promise(function (resolve, reject) {
  699. wx.getSetting({
  700. success: function success(res) {
  701. //这里判断是否有地位权限
  702. if (!res.authSetting['scope.userLocation']) {
  703. wx.showModal({
  704. title: '提示',
  705. content: '请求获取位置权限',
  706. success: function success(res) {
  707. if (res.confirm == false) {
  708. // 授权失败
  709. reject();
  710. return false;
  711. }
  712. wx.openSetting({
  713. success: function success(res) {
  714. //如果再次拒绝则返回页面并提示
  715. if (!res.authSetting['scope.userLocation']) {
  716. wx.showToast({
  717. title: '此功能需获取位置信息,请重新设置',
  718. duration: 3000,
  719. icon: 'none'
  720. });
  721. } else {
  722. //允许授权,调用地图
  723. resolve();
  724. }
  725. }
  726. });
  727. }
  728. });
  729. } else {
  730. //如果有定位权限,调用地图
  731. resolve();
  732. }
  733. }
  734. });
  735. });
  736. }
  737. //时间戳转换成时间
  738. function getTime(time) {
  739. var num = 13 - (time + '').length;
  740. var l = 1; //倍数
  741. for (var i = 0; i < num; i++) {
  742. l += '0';
  743. }
  744. // 重新解析为数字
  745. l = parseInt(l);
  746. var date = new Date(parseInt(time) * l);
  747. var year = date.getFullYear();
  748. var mon = date.getMonth() + 1;
  749. if (mon * 1 < 10) {
  750. mon = '0' + mon;
  751. }
  752. var day = date.getDate();
  753. if (day * 1 < 10) {
  754. day = '0' + day;
  755. }
  756. var hours = date.getHours();
  757. if (hours * 1 < 10) {
  758. hours = '0' + hours;
  759. }
  760. var minu = date.getMinutes();
  761. if (minu * 1 < 10) {
  762. minu = '0' + minu;
  763. }
  764. var sec = date.getSeconds();
  765. if (sec * 1 < 10) {
  766. sec = '0' + sec;
  767. }
  768. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  769. }
  770. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  771. /***/ }),
  772. /***/ 11:
  773. /*!***************************************************************!*\
  774. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  775. \***************************************************************/
  776. /*! no static exports found */
  777. /***/ (function(module, exports, __webpack_require__) {
  778. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  779. function _defineProperty(obj, key, value) {
  780. key = toPropertyKey(key);
  781. if (key in obj) {
  782. Object.defineProperty(obj, key, {
  783. value: value,
  784. enumerable: true,
  785. configurable: true,
  786. writable: true
  787. });
  788. } else {
  789. obj[key] = value;
  790. }
  791. return obj;
  792. }
  793. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  794. /***/ }),
  795. /***/ 12:
  796. /*!**************************************************************!*\
  797. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  798. \**************************************************************/
  799. /*! no static exports found */
  800. /***/ (function(module, exports, __webpack_require__) {
  801. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  802. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  803. function _toPropertyKey(arg) {
  804. var key = toPrimitive(arg, "string");
  805. return _typeof(key) === "symbol" ? key : String(key);
  806. }
  807. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  808. /***/ }),
  809. /***/ 13:
  810. /*!*******************************************************!*\
  811. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  812. \*******************************************************/
  813. /*! no static exports found */
  814. /***/ (function(module, exports) {
  815. function _typeof(obj) {
  816. "@babel/helpers - typeof";
  817. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  818. return typeof obj;
  819. } : function (obj) {
  820. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  821. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  822. }
  823. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  824. /***/ }),
  825. /***/ 14:
  826. /*!************************************************************!*\
  827. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  828. \************************************************************/
  829. /*! no static exports found */
  830. /***/ (function(module, exports, __webpack_require__) {
  831. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  832. function _toPrimitive(input, hint) {
  833. if (_typeof(input) !== "object" || input === null) return input;
  834. var prim = input[Symbol.toPrimitive];
  835. if (prim !== undefined) {
  836. var res = prim.call(input, hint || "default");
  837. if (_typeof(res) !== "object") return res;
  838. throw new TypeError("@@toPrimitive must return a primitive value.");
  839. }
  840. return (hint === "string" ? String : Number)(input);
  841. }
  842. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  843. /***/ }),
  844. /***/ 145:
  845. /*!**************************************!*\
  846. !*** D:/工作/项目2/亲家母/qjm/api/order.js ***!
  847. \**************************************/
  848. /*! no static exports found */
  849. /***/ (function(module, exports, __webpack_require__) {
  850. "use strict";
  851. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  852. Object.defineProperty(exports, "__esModule", {
  853. value: true
  854. });
  855. exports.computedOrderkey = computedOrderkey;
  856. exports.confirm = confirm;
  857. exports.couponsOrder = couponsOrder;
  858. exports.createOrderkey = createOrderkey;
  859. exports.express_query = express_query;
  860. exports.getCouponsList = getCouponsList;
  861. exports.orderCancel = orderCancel;
  862. exports.orderDel = orderDel;
  863. exports.orderDetail = orderDetail;
  864. exports.orderList = orderList;
  865. exports.orderPay = orderPay;
  866. exports.orderTake = orderTake;
  867. exports.order_comment = order_comment;
  868. exports.product = product;
  869. exports.refund = refund;
  870. exports.refundReason = refundReason;
  871. exports.upload = upload;
  872. var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 72));
  873. 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); }
  874. 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; }
  875. // 订单确认
  876. function confirm(data) {
  877. return (0, _request.default)({
  878. url: '/api/order/confirm',
  879. method: 'post',
  880. data: data
  881. });
  882. }
  883. //获取可使用优惠券
  884. function couponsOrder(data, price, id) {
  885. return (0, _request.default)({
  886. url: '/api/coupons/order/' + price + '/' + id,
  887. method: 'get',
  888. data: data
  889. });
  890. }
  891. //获取优惠券列表
  892. function getCouponsList(data, types) {
  893. //优惠券状态 0全部 1未使用 2已使用
  894. return (0, _request.default)({
  895. url: '/api/coupons/user/' + types,
  896. method: 'get',
  897. data: data
  898. });
  899. }
  900. //提交评论
  901. function order_comment(data) {
  902. return (0, _request.default)({
  903. url: '/api/order/comment',
  904. method: 'post',
  905. data: data
  906. });
  907. }
  908. //订单产品信息
  909. function product(data) {
  910. return (0, _request.default)({
  911. url: '/api/order/product',
  912. method: 'post',
  913. data: data
  914. });
  915. }
  916. // 快递查询
  917. function express_query(data) {
  918. return (0, _request.default)({
  919. url: '/api/order/express_query',
  920. method: 'get',
  921. data: data
  922. });
  923. }
  924. //上传图片
  925. function upload(data) {
  926. return (0, _request.upFilse)({
  927. url: '/api/upload/image',
  928. method: 'post',
  929. data: data
  930. });
  931. }
  932. // 订单列表
  933. function orderList(data) {
  934. return (0, _request.default)({
  935. url: '/api/order/list',
  936. method: 'get',
  937. data: data
  938. });
  939. }
  940. // 订单详细
  941. function orderDetail(data, orderid) {
  942. return (0, _request.default)({
  943. url: '/api/order/detail/' + orderid,
  944. method: 'get',
  945. data: data
  946. });
  947. }
  948. // 取消订单
  949. function orderCancel(data) {
  950. return (0, _request.default)({
  951. url: '/api/order/cancel',
  952. method: 'post',
  953. data: data
  954. });
  955. }
  956. // 删除订单
  957. function orderDel(data) {
  958. return (0, _request.default)({
  959. url: '/api/order/del',
  960. method: 'get',
  961. data: data
  962. });
  963. }
  964. // 申请退款
  965. function refund(data) {
  966. return (0, _request.default)({
  967. url: '/api/order/refund/verify',
  968. method: 'post',
  969. data: data
  970. });
  971. }
  972. // 退款理由列表
  973. function refundReason(data) {
  974. return (0, _request.default)({
  975. url: '/api/order/refund/reason',
  976. method: 'get',
  977. data: data
  978. });
  979. }
  980. // 确认收货
  981. function orderTake(data) {
  982. return (0, _request.default)({
  983. url: '/api/order/take',
  984. method: 'post',
  985. data: data
  986. });
  987. }
  988. // 订单支付
  989. function orderPay(data) {
  990. return (0, _request.default)({
  991. url: '/api/order/pay',
  992. method: 'post',
  993. data: data
  994. });
  995. }
  996. // 创建订单
  997. function createOrderkey(data, key) {
  998. return (0, _request.default)({
  999. url: '/api/order/create/' + key,
  1000. method: 'post',
  1001. data: data
  1002. });
  1003. }
  1004. // 统计订单金额
  1005. function computedOrderkey(data) {
  1006. return (0, _request.default)({
  1007. url: '/api/order/computed/' + data.orderkey,
  1008. method: 'post',
  1009. data: data
  1010. });
  1011. }
  1012. /***/ }),
  1013. /***/ 146:
  1014. /*!*****************************************!*\
  1015. !*** D:/工作/项目2/亲家母/qjm/api/activity.js ***!
  1016. \*****************************************/
  1017. /*! no static exports found */
  1018. /***/ (function(module, exports, __webpack_require__) {
  1019. "use strict";
  1020. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1021. Object.defineProperty(exports, "__esModule", {
  1022. value: true
  1023. });
  1024. exports.add_article = add_article;
  1025. exports.article_good = article_good;
  1026. exports.article_poster = article_poster;
  1027. exports.delete_article = delete_article;
  1028. exports.delete_comment = delete_comment;
  1029. exports.live = live;
  1030. exports.my_article = my_article;
  1031. exports.my_detail = my_detail;
  1032. exports.my_reply = my_reply;
  1033. exports.my_replylist = my_replylist;
  1034. exports.reply_detail = reply_detail;
  1035. exports.reply_good = reply_good;
  1036. exports.reply_poster = reply_poster;
  1037. exports.reply_save = reply_save;
  1038. exports.reply_savelist = reply_savelist;
  1039. exports.save_comment = save_comment;
  1040. exports.short_link = short_link;
  1041. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request.js */ 72));
  1042. // 删除草稿
  1043. function delete_comment(data, id) {
  1044. return (0, _request.default)({
  1045. url: '/api/order/delete_comment/' + id,
  1046. method: 'post',
  1047. data: data
  1048. });
  1049. }
  1050. // 保存草稿
  1051. function save_comment(data) {
  1052. return (0, _request.default)({
  1053. url: '/api/order/save_comment',
  1054. method: 'post',
  1055. data: data
  1056. });
  1057. }
  1058. // 我的评价详情
  1059. function my_reply(data, id) {
  1060. return (0, _request.default)({
  1061. url: '/api/reply/my/' + id,
  1062. method: 'get',
  1063. data: data
  1064. });
  1065. }
  1066. // 我的评价
  1067. function my_replylist(data) {
  1068. return (0, _request.default)({
  1069. url: '/api/reply/my',
  1070. method: 'get',
  1071. data: data
  1072. });
  1073. }
  1074. // 评价详情
  1075. function reply_detail(data, id) {
  1076. return (0, _request.default)({
  1077. url: '/api/reply/detail/' + id,
  1078. method: 'get',
  1079. data: data
  1080. });
  1081. }
  1082. // 评价点赞
  1083. function reply_good(data, id) {
  1084. return (0, _request.default)({
  1085. url: '/api/reply/good/' + id,
  1086. method: 'post',
  1087. data: data
  1088. });
  1089. }
  1090. // 文章点赞
  1091. function article_good(data, id) {
  1092. return (0, _request.default)({
  1093. url: '/api/article/good/' + id,
  1094. method: 'post',
  1095. data: data
  1096. });
  1097. }
  1098. // 我的草稿详情
  1099. function reply_save(data, id) {
  1100. return (0, _request.default)({
  1101. url: '/api/reply/save/' + id,
  1102. method: 'get',
  1103. data: data
  1104. });
  1105. }
  1106. // 我的草稿
  1107. function reply_savelist(data) {
  1108. return (0, _request.default)({
  1109. url: '/api/reply/save',
  1110. method: 'get',
  1111. data: data
  1112. });
  1113. }
  1114. // 直播列表
  1115. function live(data) {
  1116. return (0, _request.default)({
  1117. url: '/api/wechat/live',
  1118. method: 'get',
  1119. data: data
  1120. });
  1121. }
  1122. // 生成链接
  1123. function short_link(data) {
  1124. return (0, _request.default)({
  1125. url: '/api/wechat/short_link',
  1126. method: 'post',
  1127. data: data
  1128. });
  1129. }
  1130. // 分享海报
  1131. function reply_poster(data, id) {
  1132. return (0, _request.default)({
  1133. url: '/api/reply/poster/' + id,
  1134. method: 'post',
  1135. data: data
  1136. });
  1137. }
  1138. // 文章海报
  1139. function article_poster(data, id) {
  1140. return (0, _request.default)({
  1141. url: '/api/article/poster/' + id,
  1142. method: 'post',
  1143. data: data
  1144. });
  1145. }
  1146. // 我的文章
  1147. function my_article(data, id) {
  1148. return (0, _request.default)({
  1149. url: '/api/article/my/' + id,
  1150. method: 'get',
  1151. data: data
  1152. });
  1153. }
  1154. // 我的文章详情
  1155. function my_detail(data, id) {
  1156. return (0, _request.default)({
  1157. url: '/api/article/my_detail/' + id,
  1158. method: 'get',
  1159. data: data
  1160. });
  1161. }
  1162. // 删除文章
  1163. function delete_article(data, id) {
  1164. return (0, _request.default)({
  1165. url: '/api/article/delete/' + id,
  1166. method: 'post',
  1167. data: data
  1168. });
  1169. }
  1170. // 新增 修改文章
  1171. function add_article(data) {
  1172. return (0, _request.default)({
  1173. url: '/api/article/add',
  1174. method: 'post',
  1175. data: data
  1176. });
  1177. }
  1178. /***/ }),
  1179. /***/ 15:
  1180. /*!**********************************************************!*\
  1181. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  1182. \**********************************************************/
  1183. /*! no static exports found */
  1184. /***/ (function(module, exports, __webpack_require__) {
  1185. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1186. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  1187. function _construct(Parent, args, Class) {
  1188. if (isNativeReflectConstruct()) {
  1189. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  1190. } else {
  1191. module.exports = _construct = function _construct(Parent, args, Class) {
  1192. var a = [null];
  1193. a.push.apply(a, args);
  1194. var Constructor = Function.bind.apply(Parent, a);
  1195. var instance = new Constructor();
  1196. if (Class) setPrototypeOf(instance, Class.prototype);
  1197. return instance;
  1198. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1199. }
  1200. return _construct.apply(null, arguments);
  1201. }
  1202. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1203. /***/ }),
  1204. /***/ 16:
  1205. /*!***************************************************************!*\
  1206. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  1207. \***************************************************************/
  1208. /*! no static exports found */
  1209. /***/ (function(module, exports) {
  1210. function _setPrototypeOf(o, p) {
  1211. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  1212. o.__proto__ = p;
  1213. return o;
  1214. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1215. return _setPrototypeOf(o, p);
  1216. }
  1217. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1218. /***/ }),
  1219. /***/ 17:
  1220. /*!*************************************************************************!*\
  1221. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  1222. \*************************************************************************/
  1223. /*! no static exports found */
  1224. /***/ (function(module, exports) {
  1225. function _isNativeReflectConstruct() {
  1226. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  1227. if (Reflect.construct.sham) return false;
  1228. if (typeof Proxy === "function") return true;
  1229. try {
  1230. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  1231. return true;
  1232. } catch (e) {
  1233. return false;
  1234. }
  1235. }
  1236. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1237. /***/ }),
  1238. /***/ 171:
  1239. /*!****************************************************!*\
  1240. !*** D:/工作/项目2/亲家母/qjm/js_sdk/xb-copy/uni-copy.js ***!
  1241. \****************************************************/
  1242. /*! no static exports found */
  1243. /***/ (function(module, exports, __webpack_require__) {
  1244. "use strict";
  1245. /* WEBPACK VAR INJECTION */(function(uni) {
  1246. Object.defineProperty(exports, "__esModule", {
  1247. value: true
  1248. });
  1249. exports.default = uniCopy;
  1250. function uniCopy(content) {
  1251. /**
  1252. * 小程序端 和 app端的复制逻辑
  1253. */
  1254. uni.setClipboardData({
  1255. data: content,
  1256. success: function success() {
  1257. console.log('success');
  1258. return true;
  1259. }
  1260. });
  1261. /**
  1262. * H5端的复制逻辑
  1263. */
  1264. }
  1265. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  1266. /***/ }),
  1267. /***/ 18:
  1268. /*!******************************************************************!*\
  1269. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  1270. \******************************************************************/
  1271. /*! no static exports found */
  1272. /***/ (function(module, exports, __webpack_require__) {
  1273. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  1274. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  1275. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  1276. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  1277. function _toConsumableArray(arr) {
  1278. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  1279. }
  1280. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1281. /***/ }),
  1282. /***/ 19:
  1283. /*!******************************************************************!*\
  1284. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1285. \******************************************************************/
  1286. /*! no static exports found */
  1287. /***/ (function(module, exports, __webpack_require__) {
  1288. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1289. function _arrayWithoutHoles(arr) {
  1290. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1291. }
  1292. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1293. /***/ }),
  1294. /***/ 2:
  1295. /*!************************************************************!*\
  1296. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  1297. \************************************************************/
  1298. /*! no static exports found */
  1299. /***/ (function(module, exports, __webpack_require__) {
  1300. "use strict";
  1301. /* WEBPACK VAR INJECTION */(function(wx, global) {
  1302. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1303. Object.defineProperty(exports, "__esModule", {
  1304. value: true
  1305. });
  1306. exports.createApp = createApp;
  1307. exports.createComponent = createComponent;
  1308. exports.createPage = createPage;
  1309. exports.createPlugin = createPlugin;
  1310. exports.createSubpackageApp = createSubpackageApp;
  1311. exports.default = void 0;
  1312. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  1313. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  1314. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  1315. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  1316. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1317. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  1318. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  1319. 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; }
  1320. 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; }
  1321. var realAtob;
  1322. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  1323. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  1324. if (typeof atob !== 'function') {
  1325. realAtob = function realAtob(str) {
  1326. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  1327. if (!b64re.test(str)) {
  1328. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  1329. }
  1330. // Adding the padding if missing, for semplicity
  1331. str += '=='.slice(2 - (str.length & 3));
  1332. var bitmap;
  1333. var result = '';
  1334. var r1;
  1335. var r2;
  1336. var i = 0;
  1337. for (; i < str.length;) {
  1338. 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++)));
  1339. 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);
  1340. }
  1341. return result;
  1342. };
  1343. } else {
  1344. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  1345. realAtob = atob;
  1346. }
  1347. function b64DecodeUnicode(str) {
  1348. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  1349. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  1350. }).join(''));
  1351. }
  1352. function getCurrentUserInfo() {
  1353. var token = wx.getStorageSync('uni_id_token') || '';
  1354. var tokenArr = token.split('.');
  1355. if (!token || tokenArr.length !== 3) {
  1356. return {
  1357. uid: null,
  1358. role: [],
  1359. permission: [],
  1360. tokenExpired: 0
  1361. };
  1362. }
  1363. var userInfo;
  1364. try {
  1365. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  1366. } catch (error) {
  1367. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  1368. }
  1369. userInfo.tokenExpired = userInfo.exp * 1000;
  1370. delete userInfo.exp;
  1371. delete userInfo.iat;
  1372. return userInfo;
  1373. }
  1374. function uniIdMixin(Vue) {
  1375. Vue.prototype.uniIDHasRole = function (roleId) {
  1376. var _getCurrentUserInfo = getCurrentUserInfo(),
  1377. role = _getCurrentUserInfo.role;
  1378. return role.indexOf(roleId) > -1;
  1379. };
  1380. Vue.prototype.uniIDHasPermission = function (permissionId) {
  1381. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  1382. permission = _getCurrentUserInfo2.permission;
  1383. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  1384. };
  1385. Vue.prototype.uniIDTokenValid = function () {
  1386. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  1387. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  1388. return tokenExpired > Date.now();
  1389. };
  1390. }
  1391. var _toString = Object.prototype.toString;
  1392. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1393. function isFn(fn) {
  1394. return typeof fn === 'function';
  1395. }
  1396. function isStr(str) {
  1397. return typeof str === 'string';
  1398. }
  1399. function isObject(obj) {
  1400. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  1401. }
  1402. function isPlainObject(obj) {
  1403. return _toString.call(obj) === '[object Object]';
  1404. }
  1405. function hasOwn(obj, key) {
  1406. return hasOwnProperty.call(obj, key);
  1407. }
  1408. function noop() {}
  1409. /**
  1410. * Create a cached version of a pure function.
  1411. */
  1412. function cached(fn) {
  1413. var cache = Object.create(null);
  1414. return function cachedFn(str) {
  1415. var hit = cache[str];
  1416. return hit || (cache[str] = fn(str));
  1417. };
  1418. }
  1419. /**
  1420. * Camelize a hyphen-delimited string.
  1421. */
  1422. var camelizeRE = /-(\w)/g;
  1423. var camelize = cached(function (str) {
  1424. return str.replace(camelizeRE, function (_, c) {
  1425. return c ? c.toUpperCase() : '';
  1426. });
  1427. });
  1428. function sortObject(obj) {
  1429. var sortObj = {};
  1430. if (isPlainObject(obj)) {
  1431. Object.keys(obj).sort().forEach(function (key) {
  1432. sortObj[key] = obj[key];
  1433. });
  1434. }
  1435. return !Object.keys(sortObj) ? obj : sortObj;
  1436. }
  1437. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  1438. var globalInterceptors = {};
  1439. var scopedInterceptors = {};
  1440. function mergeHook(parentVal, childVal) {
  1441. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  1442. return res ? dedupeHooks(res) : res;
  1443. }
  1444. function dedupeHooks(hooks) {
  1445. var res = [];
  1446. for (var i = 0; i < hooks.length; i++) {
  1447. if (res.indexOf(hooks[i]) === -1) {
  1448. res.push(hooks[i]);
  1449. }
  1450. }
  1451. return res;
  1452. }
  1453. function removeHook(hooks, hook) {
  1454. var index = hooks.indexOf(hook);
  1455. if (index !== -1) {
  1456. hooks.splice(index, 1);
  1457. }
  1458. }
  1459. function mergeInterceptorHook(interceptor, option) {
  1460. Object.keys(option).forEach(function (hook) {
  1461. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1462. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  1463. }
  1464. });
  1465. }
  1466. function removeInterceptorHook(interceptor, option) {
  1467. if (!interceptor || !option) {
  1468. return;
  1469. }
  1470. Object.keys(option).forEach(function (hook) {
  1471. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1472. removeHook(interceptor[hook], option[hook]);
  1473. }
  1474. });
  1475. }
  1476. function addInterceptor(method, option) {
  1477. if (typeof method === 'string' && isPlainObject(option)) {
  1478. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  1479. } else if (isPlainObject(method)) {
  1480. mergeInterceptorHook(globalInterceptors, method);
  1481. }
  1482. }
  1483. function removeInterceptor(method, option) {
  1484. if (typeof method === 'string') {
  1485. if (isPlainObject(option)) {
  1486. removeInterceptorHook(scopedInterceptors[method], option);
  1487. } else {
  1488. delete scopedInterceptors[method];
  1489. }
  1490. } else if (isPlainObject(method)) {
  1491. removeInterceptorHook(globalInterceptors, method);
  1492. }
  1493. }
  1494. function wrapperHook(hook) {
  1495. return function (data) {
  1496. return hook(data) || data;
  1497. };
  1498. }
  1499. function isPromise(obj) {
  1500. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  1501. }
  1502. function queue(hooks, data) {
  1503. var promise = false;
  1504. for (var i = 0; i < hooks.length; i++) {
  1505. var hook = hooks[i];
  1506. if (promise) {
  1507. promise = Promise.resolve(wrapperHook(hook));
  1508. } else {
  1509. var res = hook(data);
  1510. if (isPromise(res)) {
  1511. promise = Promise.resolve(res);
  1512. }
  1513. if (res === false) {
  1514. return {
  1515. then: function then() {}
  1516. };
  1517. }
  1518. }
  1519. }
  1520. return promise || {
  1521. then: function then(callback) {
  1522. return callback(data);
  1523. }
  1524. };
  1525. }
  1526. function wrapperOptions(interceptor) {
  1527. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1528. ['success', 'fail', 'complete'].forEach(function (name) {
  1529. if (Array.isArray(interceptor[name])) {
  1530. var oldCallback = options[name];
  1531. options[name] = function callbackInterceptor(res) {
  1532. queue(interceptor[name], res).then(function (res) {
  1533. /* eslint-disable no-mixed-operators */
  1534. return isFn(oldCallback) && oldCallback(res) || res;
  1535. });
  1536. };
  1537. }
  1538. });
  1539. return options;
  1540. }
  1541. function wrapperReturnValue(method, returnValue) {
  1542. var returnValueHooks = [];
  1543. if (Array.isArray(globalInterceptors.returnValue)) {
  1544. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1545. }
  1546. var interceptor = scopedInterceptors[method];
  1547. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1548. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1549. }
  1550. returnValueHooks.forEach(function (hook) {
  1551. returnValue = hook(returnValue) || returnValue;
  1552. });
  1553. return returnValue;
  1554. }
  1555. function getApiInterceptorHooks(method) {
  1556. var interceptor = Object.create(null);
  1557. Object.keys(globalInterceptors).forEach(function (hook) {
  1558. if (hook !== 'returnValue') {
  1559. interceptor[hook] = globalInterceptors[hook].slice();
  1560. }
  1561. });
  1562. var scopedInterceptor = scopedInterceptors[method];
  1563. if (scopedInterceptor) {
  1564. Object.keys(scopedInterceptor).forEach(function (hook) {
  1565. if (hook !== 'returnValue') {
  1566. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1567. }
  1568. });
  1569. }
  1570. return interceptor;
  1571. }
  1572. function invokeApi(method, api, options) {
  1573. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1574. params[_key - 3] = arguments[_key];
  1575. }
  1576. var interceptor = getApiInterceptorHooks(method);
  1577. if (interceptor && Object.keys(interceptor).length) {
  1578. if (Array.isArray(interceptor.invoke)) {
  1579. var res = queue(interceptor.invoke, options);
  1580. return res.then(function (options) {
  1581. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1582. });
  1583. } else {
  1584. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1585. }
  1586. }
  1587. return api.apply(void 0, [options].concat(params));
  1588. }
  1589. var promiseInterceptor = {
  1590. returnValue: function returnValue(res) {
  1591. if (!isPromise(res)) {
  1592. return res;
  1593. }
  1594. return new Promise(function (resolve, reject) {
  1595. res.then(function (res) {
  1596. if (res[0]) {
  1597. reject(res[0]);
  1598. } else {
  1599. resolve(res[1]);
  1600. }
  1601. });
  1602. });
  1603. }
  1604. };
  1605. 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/;
  1606. var CONTEXT_API_RE = /^create|Manager$/;
  1607. // Context例外情况
  1608. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1609. // 同步例外情况
  1610. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1611. var CALLBACK_API_RE = /^on|^off/;
  1612. function isContextApi(name) {
  1613. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1614. }
  1615. function isSyncApi(name) {
  1616. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1617. }
  1618. function isCallbackApi(name) {
  1619. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1620. }
  1621. function handlePromise(promise) {
  1622. return promise.then(function (data) {
  1623. return [null, data];
  1624. }).catch(function (err) {
  1625. return [err];
  1626. });
  1627. }
  1628. function shouldPromise(name) {
  1629. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1630. return false;
  1631. }
  1632. return true;
  1633. }
  1634. /* eslint-disable no-extend-native */
  1635. if (!Promise.prototype.finally) {
  1636. Promise.prototype.finally = function (callback) {
  1637. var promise = this.constructor;
  1638. return this.then(function (value) {
  1639. return promise.resolve(callback()).then(function () {
  1640. return value;
  1641. });
  1642. }, function (reason) {
  1643. return promise.resolve(callback()).then(function () {
  1644. throw reason;
  1645. });
  1646. });
  1647. };
  1648. }
  1649. function promisify(name, api) {
  1650. if (!shouldPromise(name) || !isFn(api)) {
  1651. return api;
  1652. }
  1653. return function promiseApi() {
  1654. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1655. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1656. params[_key2 - 1] = arguments[_key2];
  1657. }
  1658. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1659. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1660. }
  1661. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1662. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1663. success: resolve,
  1664. fail: reject
  1665. })].concat(params));
  1666. })));
  1667. };
  1668. }
  1669. var EPS = 1e-4;
  1670. var BASE_DEVICE_WIDTH = 750;
  1671. var isIOS = false;
  1672. var deviceWidth = 0;
  1673. var deviceDPR = 0;
  1674. function checkDeviceWidth() {
  1675. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1676. platform = _wx$getSystemInfoSync.platform,
  1677. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1678. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1679. deviceWidth = windowWidth;
  1680. deviceDPR = pixelRatio;
  1681. isIOS = platform === 'ios';
  1682. }
  1683. function upx2px(number, newDeviceWidth) {
  1684. if (deviceWidth === 0) {
  1685. checkDeviceWidth();
  1686. }
  1687. number = Number(number);
  1688. if (number === 0) {
  1689. return 0;
  1690. }
  1691. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1692. if (result < 0) {
  1693. result = -result;
  1694. }
  1695. result = Math.floor(result + EPS);
  1696. if (result === 0) {
  1697. if (deviceDPR === 1 || !isIOS) {
  1698. result = 1;
  1699. } else {
  1700. result = 0.5;
  1701. }
  1702. }
  1703. return number < 0 ? -result : result;
  1704. }
  1705. var LOCALE_ZH_HANS = 'zh-Hans';
  1706. var LOCALE_ZH_HANT = 'zh-Hant';
  1707. var LOCALE_EN = 'en';
  1708. var LOCALE_FR = 'fr';
  1709. var LOCALE_ES = 'es';
  1710. var messages = {};
  1711. var locale;
  1712. {
  1713. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1714. }
  1715. function initI18nMessages() {
  1716. if (!isEnableLocale()) {
  1717. return;
  1718. }
  1719. var localeKeys = Object.keys(__uniConfig.locales);
  1720. if (localeKeys.length) {
  1721. localeKeys.forEach(function (locale) {
  1722. var curMessages = messages[locale];
  1723. var userMessages = __uniConfig.locales[locale];
  1724. if (curMessages) {
  1725. Object.assign(curMessages, userMessages);
  1726. } else {
  1727. messages[locale] = userMessages;
  1728. }
  1729. });
  1730. }
  1731. }
  1732. initI18nMessages();
  1733. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1734. var t = i18n.t;
  1735. var i18nMixin = i18n.mixin = {
  1736. beforeCreate: function beforeCreate() {
  1737. var _this = this;
  1738. var unwatch = i18n.i18n.watchLocale(function () {
  1739. _this.$forceUpdate();
  1740. });
  1741. this.$once('hook:beforeDestroy', function () {
  1742. unwatch();
  1743. });
  1744. },
  1745. methods: {
  1746. $$t: function $$t(key, values) {
  1747. return t(key, values);
  1748. }
  1749. }
  1750. };
  1751. var setLocale = i18n.setLocale;
  1752. var getLocale = i18n.getLocale;
  1753. function initAppLocale(Vue, appVm, locale) {
  1754. var state = Vue.observable({
  1755. locale: locale || i18n.getLocale()
  1756. });
  1757. var localeWatchers = [];
  1758. appVm.$watchLocale = function (fn) {
  1759. localeWatchers.push(fn);
  1760. };
  1761. Object.defineProperty(appVm, '$locale', {
  1762. get: function get() {
  1763. return state.locale;
  1764. },
  1765. set: function set(v) {
  1766. state.locale = v;
  1767. localeWatchers.forEach(function (watch) {
  1768. return watch(v);
  1769. });
  1770. }
  1771. });
  1772. }
  1773. function isEnableLocale() {
  1774. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1775. }
  1776. function include(str, parts) {
  1777. return !!parts.find(function (part) {
  1778. return str.indexOf(part) !== -1;
  1779. });
  1780. }
  1781. function startsWith(str, parts) {
  1782. return parts.find(function (part) {
  1783. return str.indexOf(part) === 0;
  1784. });
  1785. }
  1786. function normalizeLocale(locale, messages) {
  1787. if (!locale) {
  1788. return;
  1789. }
  1790. locale = locale.trim().replace(/_/g, '-');
  1791. if (messages && messages[locale]) {
  1792. return locale;
  1793. }
  1794. locale = locale.toLowerCase();
  1795. if (locale === 'chinese') {
  1796. // 支付宝
  1797. return LOCALE_ZH_HANS;
  1798. }
  1799. if (locale.indexOf('zh') === 0) {
  1800. if (locale.indexOf('-hans') > -1) {
  1801. return LOCALE_ZH_HANS;
  1802. }
  1803. if (locale.indexOf('-hant') > -1) {
  1804. return LOCALE_ZH_HANT;
  1805. }
  1806. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1807. return LOCALE_ZH_HANT;
  1808. }
  1809. return LOCALE_ZH_HANS;
  1810. }
  1811. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1812. if (lang) {
  1813. return lang;
  1814. }
  1815. }
  1816. // export function initI18n() {
  1817. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1818. // if (localeKeys.length) {
  1819. // localeKeys.forEach((locale) =>
  1820. // i18n.add(locale, __uniConfig.locales[locale])
  1821. // )
  1822. // }
  1823. // }
  1824. function getLocale$1() {
  1825. // 优先使用 $locale
  1826. if (isFn(getApp)) {
  1827. var app = getApp({
  1828. allowDefault: true
  1829. });
  1830. if (app && app.$vm) {
  1831. return app.$vm.$locale;
  1832. }
  1833. }
  1834. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1835. }
  1836. function setLocale$1(locale) {
  1837. var app = isFn(getApp) ? getApp() : false;
  1838. if (!app) {
  1839. return false;
  1840. }
  1841. var oldLocale = app.$vm.$locale;
  1842. if (oldLocale !== locale) {
  1843. app.$vm.$locale = locale;
  1844. onLocaleChangeCallbacks.forEach(function (fn) {
  1845. return fn({
  1846. locale: locale
  1847. });
  1848. });
  1849. return true;
  1850. }
  1851. return false;
  1852. }
  1853. var onLocaleChangeCallbacks = [];
  1854. function onLocaleChange(fn) {
  1855. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1856. onLocaleChangeCallbacks.push(fn);
  1857. }
  1858. }
  1859. if (typeof global !== 'undefined') {
  1860. global.getLocale = getLocale$1;
  1861. }
  1862. var interceptors = {
  1863. promiseInterceptor: promiseInterceptor
  1864. };
  1865. var baseApi = /*#__PURE__*/Object.freeze({
  1866. __proto__: null,
  1867. upx2px: upx2px,
  1868. getLocale: getLocale$1,
  1869. setLocale: setLocale$1,
  1870. onLocaleChange: onLocaleChange,
  1871. addInterceptor: addInterceptor,
  1872. removeInterceptor: removeInterceptor,
  1873. interceptors: interceptors
  1874. });
  1875. function findExistsPageIndex(url) {
  1876. var pages = getCurrentPages();
  1877. var len = pages.length;
  1878. while (len--) {
  1879. var page = pages[len];
  1880. if (page.$page && page.$page.fullPath === url) {
  1881. return len;
  1882. }
  1883. }
  1884. return -1;
  1885. }
  1886. var redirectTo = {
  1887. name: function name(fromArgs) {
  1888. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1889. return 'navigateBack';
  1890. }
  1891. return 'redirectTo';
  1892. },
  1893. args: function args(fromArgs) {
  1894. if (fromArgs.exists === 'back' && fromArgs.url) {
  1895. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1896. if (existsPageIndex !== -1) {
  1897. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1898. if (delta > 0) {
  1899. fromArgs.delta = delta;
  1900. }
  1901. }
  1902. }
  1903. }
  1904. };
  1905. var previewImage = {
  1906. args: function args(fromArgs) {
  1907. var currentIndex = parseInt(fromArgs.current);
  1908. if (isNaN(currentIndex)) {
  1909. return;
  1910. }
  1911. var urls = fromArgs.urls;
  1912. if (!Array.isArray(urls)) {
  1913. return;
  1914. }
  1915. var len = urls.length;
  1916. if (!len) {
  1917. return;
  1918. }
  1919. if (currentIndex < 0) {
  1920. currentIndex = 0;
  1921. } else if (currentIndex >= len) {
  1922. currentIndex = len - 1;
  1923. }
  1924. if (currentIndex > 0) {
  1925. fromArgs.current = urls[currentIndex];
  1926. fromArgs.urls = urls.filter(function (item, index) {
  1927. return index < currentIndex ? item !== urls[currentIndex] : true;
  1928. });
  1929. } else {
  1930. fromArgs.current = urls[0];
  1931. }
  1932. return {
  1933. indicator: false,
  1934. loop: false
  1935. };
  1936. }
  1937. };
  1938. var UUID_KEY = '__DC_STAT_UUID';
  1939. var deviceId;
  1940. function useDeviceId(result) {
  1941. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1942. if (!deviceId) {
  1943. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1944. wx.setStorage({
  1945. key: UUID_KEY,
  1946. data: deviceId
  1947. });
  1948. }
  1949. result.deviceId = deviceId;
  1950. }
  1951. function addSafeAreaInsets(result) {
  1952. if (result.safeArea) {
  1953. var safeArea = result.safeArea;
  1954. result.safeAreaInsets = {
  1955. top: safeArea.top,
  1956. left: safeArea.left,
  1957. right: result.windowWidth - safeArea.right,
  1958. bottom: result.screenHeight - safeArea.bottom
  1959. };
  1960. }
  1961. }
  1962. function populateParameters(result) {
  1963. var _result$brand = result.brand,
  1964. brand = _result$brand === void 0 ? '' : _result$brand,
  1965. _result$model = result.model,
  1966. model = _result$model === void 0 ? '' : _result$model,
  1967. _result$system = result.system,
  1968. system = _result$system === void 0 ? '' : _result$system,
  1969. _result$language = result.language,
  1970. language = _result$language === void 0 ? '' : _result$language,
  1971. theme = result.theme,
  1972. version = result.version,
  1973. platform = result.platform,
  1974. fontSizeSetting = result.fontSizeSetting,
  1975. SDKVersion = result.SDKVersion,
  1976. pixelRatio = result.pixelRatio,
  1977. deviceOrientation = result.deviceOrientation;
  1978. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1979. var extraParam = {};
  1980. // osName osVersion
  1981. var osName = '';
  1982. var osVersion = '';
  1983. {
  1984. osName = system.split(' ')[0] || '';
  1985. osVersion = system.split(' ')[1] || '';
  1986. }
  1987. var hostVersion = version;
  1988. // deviceType
  1989. var deviceType = getGetDeviceType(result, model);
  1990. // deviceModel
  1991. var deviceBrand = getDeviceBrand(brand);
  1992. // hostName
  1993. var _hostName = getHostName(result);
  1994. // deviceOrientation
  1995. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1996. // devicePixelRatio
  1997. var _devicePixelRatio = pixelRatio;
  1998. // SDKVersion
  1999. var _SDKVersion = SDKVersion;
  2000. // hostLanguage
  2001. var hostLanguage = language.replace(/_/g, '-');
  2002. // wx.getAccountInfoSync
  2003. var parameters = {
  2004. appId: "__UNI__A45549C",
  2005. appName: "亲家母优选",
  2006. appVersion: "1.0.0",
  2007. appVersionCode: "100",
  2008. appLanguage: getAppLanguage(hostLanguage),
  2009. uniCompileVersion: "3.7.11",
  2010. uniRuntimeVersion: "3.7.11",
  2011. uniPlatform: undefined || "mp-weixin",
  2012. deviceBrand: deviceBrand,
  2013. deviceModel: model,
  2014. deviceType: deviceType,
  2015. devicePixelRatio: _devicePixelRatio,
  2016. deviceOrientation: _deviceOrientation,
  2017. osName: osName.toLocaleLowerCase(),
  2018. osVersion: osVersion,
  2019. hostTheme: theme,
  2020. hostVersion: hostVersion,
  2021. hostLanguage: hostLanguage,
  2022. hostName: _hostName,
  2023. hostSDKVersion: _SDKVersion,
  2024. hostFontSizeSetting: fontSizeSetting,
  2025. windowTop: 0,
  2026. windowBottom: 0,
  2027. // TODO
  2028. osLanguage: undefined,
  2029. osTheme: undefined,
  2030. ua: undefined,
  2031. hostPackageName: undefined,
  2032. browserName: undefined,
  2033. browserVersion: undefined
  2034. };
  2035. Object.assign(result, parameters, extraParam);
  2036. }
  2037. function getGetDeviceType(result, model) {
  2038. var deviceType = result.deviceType || 'phone';
  2039. {
  2040. var deviceTypeMaps = {
  2041. ipad: 'pad',
  2042. windows: 'pc',
  2043. mac: 'pc'
  2044. };
  2045. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  2046. var _model = model.toLocaleLowerCase();
  2047. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  2048. var _m = deviceTypeMapsKeys[index];
  2049. if (_model.indexOf(_m) !== -1) {
  2050. deviceType = deviceTypeMaps[_m];
  2051. break;
  2052. }
  2053. }
  2054. }
  2055. return deviceType;
  2056. }
  2057. function getDeviceBrand(brand) {
  2058. var deviceBrand = brand;
  2059. if (deviceBrand) {
  2060. deviceBrand = brand.toLocaleLowerCase();
  2061. }
  2062. return deviceBrand;
  2063. }
  2064. function getAppLanguage(defaultLanguage) {
  2065. return getLocale$1 ? getLocale$1() : defaultLanguage;
  2066. }
  2067. function getHostName(result) {
  2068. var _platform = 'WeChat';
  2069. var _hostName = result.hostName || _platform; // mp-jd
  2070. {
  2071. if (result.environment) {
  2072. _hostName = result.environment;
  2073. } else if (result.host && result.host.env) {
  2074. _hostName = result.host.env;
  2075. }
  2076. }
  2077. return _hostName;
  2078. }
  2079. var getSystemInfo = {
  2080. returnValue: function returnValue(result) {
  2081. useDeviceId(result);
  2082. addSafeAreaInsets(result);
  2083. populateParameters(result);
  2084. }
  2085. };
  2086. var showActionSheet = {
  2087. args: function args(fromArgs) {
  2088. if ((0, _typeof2.default)(fromArgs) === 'object') {
  2089. fromArgs.alertText = fromArgs.title;
  2090. }
  2091. }
  2092. };
  2093. var getAppBaseInfo = {
  2094. returnValue: function returnValue(result) {
  2095. var _result = result,
  2096. version = _result.version,
  2097. language = _result.language,
  2098. SDKVersion = _result.SDKVersion,
  2099. theme = _result.theme;
  2100. var _hostName = getHostName(result);
  2101. var hostLanguage = language.replace('_', '-');
  2102. result = sortObject(Object.assign(result, {
  2103. appId: "__UNI__A45549C",
  2104. appName: "亲家母优选",
  2105. appVersion: "1.0.0",
  2106. appVersionCode: "100",
  2107. appLanguage: getAppLanguage(hostLanguage),
  2108. hostVersion: version,
  2109. hostLanguage: hostLanguage,
  2110. hostName: _hostName,
  2111. hostSDKVersion: SDKVersion,
  2112. hostTheme: theme
  2113. }));
  2114. }
  2115. };
  2116. var getDeviceInfo = {
  2117. returnValue: function returnValue(result) {
  2118. var _result2 = result,
  2119. brand = _result2.brand,
  2120. model = _result2.model;
  2121. var deviceType = getGetDeviceType(result, model);
  2122. var deviceBrand = getDeviceBrand(brand);
  2123. useDeviceId(result);
  2124. result = sortObject(Object.assign(result, {
  2125. deviceType: deviceType,
  2126. deviceBrand: deviceBrand,
  2127. deviceModel: model
  2128. }));
  2129. }
  2130. };
  2131. var getWindowInfo = {
  2132. returnValue: function returnValue(result) {
  2133. addSafeAreaInsets(result);
  2134. result = sortObject(Object.assign(result, {
  2135. windowTop: 0,
  2136. windowBottom: 0
  2137. }));
  2138. }
  2139. };
  2140. var getAppAuthorizeSetting = {
  2141. returnValue: function returnValue(result) {
  2142. var locationReducedAccuracy = result.locationReducedAccuracy;
  2143. result.locationAccuracy = 'unsupported';
  2144. if (locationReducedAccuracy === true) {
  2145. result.locationAccuracy = 'reduced';
  2146. } else if (locationReducedAccuracy === false) {
  2147. result.locationAccuracy = 'full';
  2148. }
  2149. }
  2150. };
  2151. // import navigateTo from 'uni-helpers/navigate-to'
  2152. var compressImage = {
  2153. args: function args(fromArgs) {
  2154. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  2155. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  2156. fromArgs.compressHeight = fromArgs.compressedHeight;
  2157. }
  2158. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  2159. fromArgs.compressWidth = fromArgs.compressedWidth;
  2160. }
  2161. }
  2162. };
  2163. var protocols = {
  2164. redirectTo: redirectTo,
  2165. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  2166. previewImage: previewImage,
  2167. getSystemInfo: getSystemInfo,
  2168. getSystemInfoSync: getSystemInfo,
  2169. showActionSheet: showActionSheet,
  2170. getAppBaseInfo: getAppBaseInfo,
  2171. getDeviceInfo: getDeviceInfo,
  2172. getWindowInfo: getWindowInfo,
  2173. getAppAuthorizeSetting: getAppAuthorizeSetting,
  2174. compressImage: compressImage
  2175. };
  2176. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  2177. var canIUses = [];
  2178. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  2179. function processCallback(methodName, method, returnValue) {
  2180. return function (res) {
  2181. return method(processReturnValue(methodName, res, returnValue));
  2182. };
  2183. }
  2184. function processArgs(methodName, fromArgs) {
  2185. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2186. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  2187. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  2188. if (isPlainObject(fromArgs)) {
  2189. // 一般 api 的参数解析
  2190. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  2191. if (isFn(argsOption)) {
  2192. argsOption = argsOption(fromArgs, toArgs) || {};
  2193. }
  2194. for (var key in fromArgs) {
  2195. if (hasOwn(argsOption, key)) {
  2196. var keyOption = argsOption[key];
  2197. if (isFn(keyOption)) {
  2198. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  2199. }
  2200. if (!keyOption) {
  2201. // 不支持的参数
  2202. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  2203. } else if (isStr(keyOption)) {
  2204. // 重写参数 key
  2205. toArgs[keyOption] = fromArgs[key];
  2206. } else if (isPlainObject(keyOption)) {
  2207. // {name:newName,value:value}可重新指定参数 key:value
  2208. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  2209. }
  2210. } else if (CALLBACKS.indexOf(key) !== -1) {
  2211. if (isFn(fromArgs[key])) {
  2212. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  2213. }
  2214. } else {
  2215. if (!keepFromArgs) {
  2216. toArgs[key] = fromArgs[key];
  2217. }
  2218. }
  2219. }
  2220. return toArgs;
  2221. } else if (isFn(fromArgs)) {
  2222. fromArgs = processCallback(methodName, fromArgs, returnValue);
  2223. }
  2224. return fromArgs;
  2225. }
  2226. function processReturnValue(methodName, res, returnValue) {
  2227. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2228. if (isFn(protocols.returnValue)) {
  2229. // 处理通用 returnValue
  2230. res = protocols.returnValue(methodName, res);
  2231. }
  2232. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  2233. }
  2234. function wrapper(methodName, method) {
  2235. if (hasOwn(protocols, methodName)) {
  2236. var protocol = protocols[methodName];
  2237. if (!protocol) {
  2238. // 暂不支持的 api
  2239. return function () {
  2240. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  2241. };
  2242. }
  2243. return function (arg1, arg2) {
  2244. // 目前 api 最多两个参数
  2245. var options = protocol;
  2246. if (isFn(protocol)) {
  2247. options = protocol(arg1);
  2248. }
  2249. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  2250. var args = [arg1];
  2251. if (typeof arg2 !== 'undefined') {
  2252. args.push(arg2);
  2253. }
  2254. if (isFn(options.name)) {
  2255. methodName = options.name(arg1);
  2256. } else if (isStr(options.name)) {
  2257. methodName = options.name;
  2258. }
  2259. var returnValue = wx[methodName].apply(wx, args);
  2260. if (isSyncApi(methodName)) {
  2261. // 同步 api
  2262. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  2263. }
  2264. return returnValue;
  2265. };
  2266. }
  2267. return method;
  2268. }
  2269. var todoApis = Object.create(null);
  2270. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  2271. function createTodoApi(name) {
  2272. return function todoApi(_ref) {
  2273. var fail = _ref.fail,
  2274. complete = _ref.complete;
  2275. var res = {
  2276. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  2277. };
  2278. isFn(fail) && fail(res);
  2279. isFn(complete) && complete(res);
  2280. };
  2281. }
  2282. TODOS.forEach(function (name) {
  2283. todoApis[name] = createTodoApi(name);
  2284. });
  2285. var providers = {
  2286. oauth: ['weixin'],
  2287. share: ['weixin'],
  2288. payment: ['wxpay'],
  2289. push: ['weixin']
  2290. };
  2291. function getProvider(_ref2) {
  2292. var service = _ref2.service,
  2293. success = _ref2.success,
  2294. fail = _ref2.fail,
  2295. complete = _ref2.complete;
  2296. var res = false;
  2297. if (providers[service]) {
  2298. res = {
  2299. errMsg: 'getProvider:ok',
  2300. service: service,
  2301. provider: providers[service]
  2302. };
  2303. isFn(success) && success(res);
  2304. } else {
  2305. res = {
  2306. errMsg: 'getProvider:fail service not found'
  2307. };
  2308. isFn(fail) && fail(res);
  2309. }
  2310. isFn(complete) && complete(res);
  2311. }
  2312. var extraApi = /*#__PURE__*/Object.freeze({
  2313. __proto__: null,
  2314. getProvider: getProvider
  2315. });
  2316. var getEmitter = function () {
  2317. var Emitter;
  2318. return function getUniEmitter() {
  2319. if (!Emitter) {
  2320. Emitter = new _vue.default();
  2321. }
  2322. return Emitter;
  2323. };
  2324. }();
  2325. function apply(ctx, method, args) {
  2326. return ctx[method].apply(ctx, args);
  2327. }
  2328. function $on() {
  2329. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  2330. }
  2331. function $off() {
  2332. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  2333. }
  2334. function $once() {
  2335. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  2336. }
  2337. function $emit() {
  2338. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  2339. }
  2340. var eventApi = /*#__PURE__*/Object.freeze({
  2341. __proto__: null,
  2342. $on: $on,
  2343. $off: $off,
  2344. $once: $once,
  2345. $emit: $emit
  2346. });
  2347. /**
  2348. * 框架内 try-catch
  2349. */
  2350. /**
  2351. * 开发者 try-catch
  2352. */
  2353. function tryCatch(fn) {
  2354. return function () {
  2355. try {
  2356. return fn.apply(fn, arguments);
  2357. } catch (e) {
  2358. // TODO
  2359. console.error(e);
  2360. }
  2361. };
  2362. }
  2363. function getApiCallbacks(params) {
  2364. var apiCallbacks = {};
  2365. for (var name in params) {
  2366. var param = params[name];
  2367. if (isFn(param)) {
  2368. apiCallbacks[name] = tryCatch(param);
  2369. delete params[name];
  2370. }
  2371. }
  2372. return apiCallbacks;
  2373. }
  2374. var cid;
  2375. var cidErrMsg;
  2376. var enabled;
  2377. function normalizePushMessage(message) {
  2378. try {
  2379. return JSON.parse(message);
  2380. } catch (e) {}
  2381. return message;
  2382. }
  2383. function invokePushCallback(args) {
  2384. if (args.type === 'enabled') {
  2385. enabled = true;
  2386. } else if (args.type === 'clientId') {
  2387. cid = args.cid;
  2388. cidErrMsg = args.errMsg;
  2389. invokeGetPushCidCallbacks(cid, args.errMsg);
  2390. } else if (args.type === 'pushMsg') {
  2391. var message = {
  2392. type: 'receive',
  2393. data: normalizePushMessage(args.message)
  2394. };
  2395. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  2396. var callback = onPushMessageCallbacks[i];
  2397. callback(message);
  2398. // 该消息已被阻止
  2399. if (message.stopped) {
  2400. break;
  2401. }
  2402. }
  2403. } else if (args.type === 'click') {
  2404. onPushMessageCallbacks.forEach(function (callback) {
  2405. callback({
  2406. type: 'click',
  2407. data: normalizePushMessage(args.message)
  2408. });
  2409. });
  2410. }
  2411. }
  2412. var getPushCidCallbacks = [];
  2413. function invokeGetPushCidCallbacks(cid, errMsg) {
  2414. getPushCidCallbacks.forEach(function (callback) {
  2415. callback(cid, errMsg);
  2416. });
  2417. getPushCidCallbacks.length = 0;
  2418. }
  2419. function getPushClientId(args) {
  2420. if (!isPlainObject(args)) {
  2421. args = {};
  2422. }
  2423. var _getApiCallbacks = getApiCallbacks(args),
  2424. success = _getApiCallbacks.success,
  2425. fail = _getApiCallbacks.fail,
  2426. complete = _getApiCallbacks.complete;
  2427. var hasSuccess = isFn(success);
  2428. var hasFail = isFn(fail);
  2429. var hasComplete = isFn(complete);
  2430. Promise.resolve().then(function () {
  2431. if (typeof enabled === 'undefined') {
  2432. enabled = false;
  2433. cid = '';
  2434. cidErrMsg = 'uniPush is not enabled';
  2435. }
  2436. getPushCidCallbacks.push(function (cid, errMsg) {
  2437. var res;
  2438. if (cid) {
  2439. res = {
  2440. errMsg: 'getPushClientId:ok',
  2441. cid: cid
  2442. };
  2443. hasSuccess && success(res);
  2444. } else {
  2445. res = {
  2446. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  2447. };
  2448. hasFail && fail(res);
  2449. }
  2450. hasComplete && complete(res);
  2451. });
  2452. if (typeof cid !== 'undefined') {
  2453. invokeGetPushCidCallbacks(cid, cidErrMsg);
  2454. }
  2455. });
  2456. }
  2457. var onPushMessageCallbacks = [];
  2458. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  2459. var onPushMessage = function onPushMessage(fn) {
  2460. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  2461. onPushMessageCallbacks.push(fn);
  2462. }
  2463. };
  2464. var offPushMessage = function offPushMessage(fn) {
  2465. if (!fn) {
  2466. onPushMessageCallbacks.length = 0;
  2467. } else {
  2468. var index = onPushMessageCallbacks.indexOf(fn);
  2469. if (index > -1) {
  2470. onPushMessageCallbacks.splice(index, 1);
  2471. }
  2472. }
  2473. };
  2474. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  2475. if (!baseInfo) {
  2476. baseInfo = wx.getSystemInfoSync();
  2477. }
  2478. var host = baseInfo ? baseInfo.host : null;
  2479. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  2480. var api = /*#__PURE__*/Object.freeze({
  2481. __proto__: null,
  2482. shareVideoMessage: shareVideoMessage,
  2483. getPushClientId: getPushClientId,
  2484. onPushMessage: onPushMessage,
  2485. offPushMessage: offPushMessage,
  2486. invokePushCallback: invokePushCallback
  2487. });
  2488. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  2489. function findVmByVueId(vm, vuePid) {
  2490. var $children = vm.$children;
  2491. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  2492. for (var i = $children.length - 1; i >= 0; i--) {
  2493. var childVm = $children[i];
  2494. if (childVm.$scope._$vueId === vuePid) {
  2495. return childVm;
  2496. }
  2497. }
  2498. // 反向递归查找
  2499. var parentVm;
  2500. for (var _i = $children.length - 1; _i >= 0; _i--) {
  2501. parentVm = findVmByVueId($children[_i], vuePid);
  2502. if (parentVm) {
  2503. return parentVm;
  2504. }
  2505. }
  2506. }
  2507. function initBehavior(options) {
  2508. return Behavior(options);
  2509. }
  2510. function isPage() {
  2511. return !!this.route;
  2512. }
  2513. function initRelation(detail) {
  2514. this.triggerEvent('__l', detail);
  2515. }
  2516. function selectAllComponents(mpInstance, selector, $refs) {
  2517. var components = mpInstance.selectAllComponents(selector) || [];
  2518. components.forEach(function (component) {
  2519. var ref = component.dataset.ref;
  2520. $refs[ref] = component.$vm || toSkip(component);
  2521. {
  2522. if (component.dataset.vueGeneric === 'scoped') {
  2523. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2524. selectAllComponents(scopedComponent, selector, $refs);
  2525. });
  2526. }
  2527. }
  2528. });
  2529. }
  2530. function syncRefs(refs, newRefs) {
  2531. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2532. var newKeys = Object.keys(newRefs);
  2533. newKeys.forEach(function (key) {
  2534. var oldValue = refs[key];
  2535. var newValue = newRefs[key];
  2536. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2537. return oldValue.includes(value);
  2538. })) {
  2539. return;
  2540. }
  2541. refs[key] = newValue;
  2542. oldKeys.delete(key);
  2543. });
  2544. oldKeys.forEach(function (key) {
  2545. delete refs[key];
  2546. });
  2547. return refs;
  2548. }
  2549. function initRefs(vm) {
  2550. var mpInstance = vm.$scope;
  2551. var refs = {};
  2552. Object.defineProperty(vm, '$refs', {
  2553. get: function get() {
  2554. var $refs = {};
  2555. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2556. // TODO 暂不考虑 for 中的 scoped
  2557. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2558. forComponents.forEach(function (component) {
  2559. var ref = component.dataset.ref;
  2560. if (!$refs[ref]) {
  2561. $refs[ref] = [];
  2562. }
  2563. $refs[ref].push(component.$vm || toSkip(component));
  2564. });
  2565. return syncRefs(refs, $refs);
  2566. }
  2567. });
  2568. }
  2569. function handleLink(event) {
  2570. var _ref3 = event.detail || event.value,
  2571. vuePid = _ref3.vuePid,
  2572. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2573. var parentVm;
  2574. if (vuePid) {
  2575. parentVm = findVmByVueId(this.$vm, vuePid);
  2576. }
  2577. if (!parentVm) {
  2578. parentVm = this.$vm;
  2579. }
  2580. vueOptions.parent = parentVm;
  2581. }
  2582. function markMPComponent(component) {
  2583. // 在 Vue 中标记为小程序组件
  2584. var IS_MP = '__v_isMPComponent';
  2585. Object.defineProperty(component, IS_MP, {
  2586. configurable: true,
  2587. enumerable: false,
  2588. value: true
  2589. });
  2590. return component;
  2591. }
  2592. function toSkip(obj) {
  2593. var OB = '__ob__';
  2594. var SKIP = '__v_skip';
  2595. if (isObject(obj) && Object.isExtensible(obj)) {
  2596. // 避免被 @vue/composition-api 观测
  2597. Object.defineProperty(obj, OB, {
  2598. configurable: true,
  2599. enumerable: false,
  2600. value: (0, _defineProperty2.default)({}, SKIP, true)
  2601. });
  2602. }
  2603. return obj;
  2604. }
  2605. var WORKLET_RE = /_(.*)_worklet_factory_/;
  2606. function initWorkletMethods(mpMethods, vueMethods) {
  2607. if (vueMethods) {
  2608. Object.keys(vueMethods).forEach(function (name) {
  2609. var matches = name.match(WORKLET_RE);
  2610. if (matches) {
  2611. var workletName = matches[1];
  2612. mpMethods[name] = vueMethods[name];
  2613. mpMethods[workletName] = vueMethods[workletName];
  2614. }
  2615. });
  2616. }
  2617. }
  2618. var MPPage = Page;
  2619. var MPComponent = Component;
  2620. var customizeRE = /:/g;
  2621. var customize = cached(function (str) {
  2622. return camelize(str.replace(customizeRE, '-'));
  2623. });
  2624. function initTriggerEvent(mpInstance) {
  2625. var oldTriggerEvent = mpInstance.triggerEvent;
  2626. var newTriggerEvent = function newTriggerEvent(event) {
  2627. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2628. args[_key3 - 1] = arguments[_key3];
  2629. }
  2630. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2631. if (this.$vm || this.dataset && this.dataset.comType) {
  2632. event = customize(event);
  2633. } else {
  2634. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2635. var newEvent = customize(event);
  2636. if (newEvent !== event) {
  2637. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2638. }
  2639. }
  2640. return oldTriggerEvent.apply(this, [event].concat(args));
  2641. };
  2642. try {
  2643. // 京东小程序 triggerEvent 为只读
  2644. mpInstance.triggerEvent = newTriggerEvent;
  2645. } catch (error) {
  2646. mpInstance._triggerEvent = newTriggerEvent;
  2647. }
  2648. }
  2649. function initHook(name, options, isComponent) {
  2650. var oldHook = options[name];
  2651. options[name] = function () {
  2652. markMPComponent(this);
  2653. initTriggerEvent(this);
  2654. if (oldHook) {
  2655. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2656. args[_key4] = arguments[_key4];
  2657. }
  2658. return oldHook.apply(this, args);
  2659. }
  2660. };
  2661. }
  2662. if (!MPPage.__$wrappered) {
  2663. MPPage.__$wrappered = true;
  2664. Page = function Page() {
  2665. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2666. initHook('onLoad', options);
  2667. return MPPage(options);
  2668. };
  2669. Page.after = MPPage.after;
  2670. Component = function Component() {
  2671. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2672. initHook('created', options);
  2673. return MPComponent(options);
  2674. };
  2675. }
  2676. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2677. function initMocks(vm, mocks) {
  2678. var mpInstance = vm.$mp[vm.mpType];
  2679. mocks.forEach(function (mock) {
  2680. if (hasOwn(mpInstance, mock)) {
  2681. vm[mock] = mpInstance[mock];
  2682. }
  2683. });
  2684. }
  2685. function hasHook(hook, vueOptions) {
  2686. if (!vueOptions) {
  2687. return true;
  2688. }
  2689. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2690. return true;
  2691. }
  2692. vueOptions = vueOptions.default || vueOptions;
  2693. if (isFn(vueOptions)) {
  2694. if (isFn(vueOptions.extendOptions[hook])) {
  2695. return true;
  2696. }
  2697. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2698. return true;
  2699. }
  2700. return false;
  2701. }
  2702. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2703. return true;
  2704. }
  2705. var mixins = vueOptions.mixins;
  2706. if (Array.isArray(mixins)) {
  2707. return !!mixins.find(function (mixin) {
  2708. return hasHook(hook, mixin);
  2709. });
  2710. }
  2711. }
  2712. function initHooks(mpOptions, hooks, vueOptions) {
  2713. hooks.forEach(function (hook) {
  2714. if (hasHook(hook, vueOptions)) {
  2715. mpOptions[hook] = function (args) {
  2716. return this.$vm && this.$vm.__call_hook(hook, args);
  2717. };
  2718. }
  2719. });
  2720. }
  2721. function initUnknownHooks(mpOptions, vueOptions) {
  2722. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2723. findHooks(vueOptions).forEach(function (hook) {
  2724. return initHook$1(mpOptions, hook, excludes);
  2725. });
  2726. }
  2727. function findHooks(vueOptions) {
  2728. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2729. if (vueOptions) {
  2730. Object.keys(vueOptions).forEach(function (name) {
  2731. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2732. hooks.push(name);
  2733. }
  2734. });
  2735. }
  2736. return hooks;
  2737. }
  2738. function initHook$1(mpOptions, hook, excludes) {
  2739. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2740. mpOptions[hook] = function (args) {
  2741. return this.$vm && this.$vm.__call_hook(hook, args);
  2742. };
  2743. }
  2744. }
  2745. function initVueComponent(Vue, vueOptions) {
  2746. vueOptions = vueOptions.default || vueOptions;
  2747. var VueComponent;
  2748. if (isFn(vueOptions)) {
  2749. VueComponent = vueOptions;
  2750. } else {
  2751. VueComponent = Vue.extend(vueOptions);
  2752. }
  2753. vueOptions = VueComponent.options;
  2754. return [VueComponent, vueOptions];
  2755. }
  2756. function initSlots(vm, vueSlots) {
  2757. if (Array.isArray(vueSlots) && vueSlots.length) {
  2758. var $slots = Object.create(null);
  2759. vueSlots.forEach(function (slotName) {
  2760. $slots[slotName] = true;
  2761. });
  2762. vm.$scopedSlots = vm.$slots = $slots;
  2763. }
  2764. }
  2765. function initVueIds(vueIds, mpInstance) {
  2766. vueIds = (vueIds || '').split(',');
  2767. var len = vueIds.length;
  2768. if (len === 1) {
  2769. mpInstance._$vueId = vueIds[0];
  2770. } else if (len === 2) {
  2771. mpInstance._$vueId = vueIds[0];
  2772. mpInstance._$vuePid = vueIds[1];
  2773. }
  2774. }
  2775. function initData(vueOptions, context) {
  2776. var data = vueOptions.data || {};
  2777. var methods = vueOptions.methods || {};
  2778. if (typeof data === 'function') {
  2779. try {
  2780. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2781. } catch (e) {
  2782. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2783. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2784. }
  2785. }
  2786. } else {
  2787. try {
  2788. // 对 data 格式化
  2789. data = JSON.parse(JSON.stringify(data));
  2790. } catch (e) {}
  2791. }
  2792. if (!isPlainObject(data)) {
  2793. data = {};
  2794. }
  2795. Object.keys(methods).forEach(function (methodName) {
  2796. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2797. data[methodName] = methods[methodName];
  2798. }
  2799. });
  2800. return data;
  2801. }
  2802. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2803. function createObserver(name) {
  2804. return function observer(newVal, oldVal) {
  2805. if (this.$vm) {
  2806. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2807. }
  2808. };
  2809. }
  2810. function initBehaviors(vueOptions, initBehavior) {
  2811. var vueBehaviors = vueOptions.behaviors;
  2812. var vueExtends = vueOptions.extends;
  2813. var vueMixins = vueOptions.mixins;
  2814. var vueProps = vueOptions.props;
  2815. if (!vueProps) {
  2816. vueOptions.props = vueProps = [];
  2817. }
  2818. var behaviors = [];
  2819. if (Array.isArray(vueBehaviors)) {
  2820. vueBehaviors.forEach(function (behavior) {
  2821. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2822. if (behavior === 'uni://form-field') {
  2823. if (Array.isArray(vueProps)) {
  2824. vueProps.push('name');
  2825. vueProps.push('value');
  2826. } else {
  2827. vueProps.name = {
  2828. type: String,
  2829. default: ''
  2830. };
  2831. vueProps.value = {
  2832. type: [String, Number, Boolean, Array, Object, Date],
  2833. default: ''
  2834. };
  2835. }
  2836. }
  2837. });
  2838. }
  2839. if (isPlainObject(vueExtends) && vueExtends.props) {
  2840. behaviors.push(initBehavior({
  2841. properties: initProperties(vueExtends.props, true)
  2842. }));
  2843. }
  2844. if (Array.isArray(vueMixins)) {
  2845. vueMixins.forEach(function (vueMixin) {
  2846. if (isPlainObject(vueMixin) && vueMixin.props) {
  2847. behaviors.push(initBehavior({
  2848. properties: initProperties(vueMixin.props, true)
  2849. }));
  2850. }
  2851. });
  2852. }
  2853. return behaviors;
  2854. }
  2855. function parsePropType(key, type, defaultValue, file) {
  2856. // [String]=>String
  2857. if (Array.isArray(type) && type.length === 1) {
  2858. return type[0];
  2859. }
  2860. return type;
  2861. }
  2862. function initProperties(props) {
  2863. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2864. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2865. var options = arguments.length > 3 ? arguments[3] : undefined;
  2866. var properties = {};
  2867. if (!isBehavior) {
  2868. properties.vueId = {
  2869. type: String,
  2870. value: ''
  2871. };
  2872. {
  2873. if (options.virtualHost) {
  2874. properties.virtualHostStyle = {
  2875. type: null,
  2876. value: ''
  2877. };
  2878. properties.virtualHostClass = {
  2879. type: null,
  2880. value: ''
  2881. };
  2882. }
  2883. }
  2884. // scopedSlotsCompiler auto
  2885. properties.scopedSlotsCompiler = {
  2886. type: String,
  2887. value: ''
  2888. };
  2889. properties.vueSlots = {
  2890. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2891. type: null,
  2892. value: [],
  2893. observer: function observer(newVal, oldVal) {
  2894. var $slots = Object.create(null);
  2895. newVal.forEach(function (slotName) {
  2896. $slots[slotName] = true;
  2897. });
  2898. this.setData({
  2899. $slots: $slots
  2900. });
  2901. }
  2902. };
  2903. }
  2904. if (Array.isArray(props)) {
  2905. // ['title']
  2906. props.forEach(function (key) {
  2907. properties[key] = {
  2908. type: null,
  2909. observer: createObserver(key)
  2910. };
  2911. });
  2912. } else if (isPlainObject(props)) {
  2913. // {title:{type:String,default:''},content:String}
  2914. Object.keys(props).forEach(function (key) {
  2915. var opts = props[key];
  2916. if (isPlainObject(opts)) {
  2917. // title:{type:String,default:''}
  2918. var value = opts.default;
  2919. if (isFn(value)) {
  2920. value = value();
  2921. }
  2922. opts.type = parsePropType(key, opts.type);
  2923. properties[key] = {
  2924. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2925. value: value,
  2926. observer: createObserver(key)
  2927. };
  2928. } else {
  2929. // content:String
  2930. var type = parsePropType(key, opts);
  2931. properties[key] = {
  2932. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2933. observer: createObserver(key)
  2934. };
  2935. }
  2936. });
  2937. }
  2938. return properties;
  2939. }
  2940. function wrapper$1(event) {
  2941. // TODO 又得兼容 mpvue 的 mp 对象
  2942. try {
  2943. event.mp = JSON.parse(JSON.stringify(event));
  2944. } catch (e) {}
  2945. event.stopPropagation = noop;
  2946. event.preventDefault = noop;
  2947. event.target = event.target || {};
  2948. if (!hasOwn(event, 'detail')) {
  2949. event.detail = {};
  2950. }
  2951. if (hasOwn(event, 'markerId')) {
  2952. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2953. event.detail.markerId = event.markerId;
  2954. }
  2955. if (isPlainObject(event.detail)) {
  2956. event.target = Object.assign({}, event.target, event.detail);
  2957. }
  2958. return event;
  2959. }
  2960. function getExtraValue(vm, dataPathsArray) {
  2961. var context = vm;
  2962. dataPathsArray.forEach(function (dataPathArray) {
  2963. var dataPath = dataPathArray[0];
  2964. var value = dataPathArray[2];
  2965. if (dataPath || typeof value !== 'undefined') {
  2966. // ['','',index,'disable']
  2967. var propPath = dataPathArray[1];
  2968. var valuePath = dataPathArray[3];
  2969. var vFor;
  2970. if (Number.isInteger(dataPath)) {
  2971. vFor = dataPath;
  2972. } else if (!dataPath) {
  2973. vFor = context;
  2974. } else if (typeof dataPath === 'string' && dataPath) {
  2975. if (dataPath.indexOf('#s#') === 0) {
  2976. vFor = dataPath.substr(3);
  2977. } else {
  2978. vFor = vm.__get_value(dataPath, context);
  2979. }
  2980. }
  2981. if (Number.isInteger(vFor)) {
  2982. context = value;
  2983. } else if (!propPath) {
  2984. context = vFor[value];
  2985. } else {
  2986. if (Array.isArray(vFor)) {
  2987. context = vFor.find(function (vForItem) {
  2988. return vm.__get_value(propPath, vForItem) === value;
  2989. });
  2990. } else if (isPlainObject(vFor)) {
  2991. context = Object.keys(vFor).find(function (vForKey) {
  2992. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2993. });
  2994. } else {
  2995. console.error('v-for 暂不支持循环数据:', vFor);
  2996. }
  2997. }
  2998. if (valuePath) {
  2999. context = vm.__get_value(valuePath, context);
  3000. }
  3001. }
  3002. });
  3003. return context;
  3004. }
  3005. function processEventExtra(vm, extra, event, __args__) {
  3006. var extraObj = {};
  3007. if (Array.isArray(extra) && extra.length) {
  3008. /**
  3009. *[
  3010. * ['data.items', 'data.id', item.data.id],
  3011. * ['metas', 'id', meta.id]
  3012. *],
  3013. *[
  3014. * ['data.items', 'data.id', item.data.id],
  3015. * ['metas', 'id', meta.id]
  3016. *],
  3017. *'test'
  3018. */
  3019. extra.forEach(function (dataPath, index) {
  3020. if (typeof dataPath === 'string') {
  3021. if (!dataPath) {
  3022. // model,prop.sync
  3023. extraObj['$' + index] = vm;
  3024. } else {
  3025. if (dataPath === '$event') {
  3026. // $event
  3027. extraObj['$' + index] = event;
  3028. } else if (dataPath === 'arguments') {
  3029. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  3030. } else if (dataPath.indexOf('$event.') === 0) {
  3031. // $event.target.value
  3032. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  3033. } else {
  3034. extraObj['$' + index] = vm.__get_value(dataPath);
  3035. }
  3036. }
  3037. } else {
  3038. extraObj['$' + index] = getExtraValue(vm, dataPath);
  3039. }
  3040. });
  3041. }
  3042. return extraObj;
  3043. }
  3044. function getObjByArray(arr) {
  3045. var obj = {};
  3046. for (var i = 1; i < arr.length; i++) {
  3047. var element = arr[i];
  3048. obj[element[0]] = element[1];
  3049. }
  3050. return obj;
  3051. }
  3052. function processEventArgs(vm, event) {
  3053. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  3054. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  3055. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  3056. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  3057. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  3058. // fixed 用户直接触发 mpInstance.triggerEvent
  3059. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  3060. if (isCustom) {
  3061. // 自定义事件
  3062. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  3063. if (!args.length) {
  3064. // 无参数,直接传入 event 或 detail 数组
  3065. if (isCustomMPEvent) {
  3066. return [event];
  3067. }
  3068. return __args__;
  3069. }
  3070. }
  3071. var extraObj = processEventExtra(vm, extra, event, __args__);
  3072. var ret = [];
  3073. args.forEach(function (arg) {
  3074. if (arg === '$event') {
  3075. if (methodName === '__set_model' && !isCustom) {
  3076. // input v-model value
  3077. ret.push(event.target.value);
  3078. } else {
  3079. if (isCustom && !isCustomMPEvent) {
  3080. ret.push(__args__[0]);
  3081. } else {
  3082. // wxcomponent 组件或内置组件
  3083. ret.push(event);
  3084. }
  3085. }
  3086. } else {
  3087. if (Array.isArray(arg) && arg[0] === 'o') {
  3088. ret.push(getObjByArray(arg));
  3089. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  3090. ret.push(extraObj[arg]);
  3091. } else {
  3092. ret.push(arg);
  3093. }
  3094. }
  3095. });
  3096. return ret;
  3097. }
  3098. var ONCE = '~';
  3099. var CUSTOM = '^';
  3100. function isMatchEventType(eventType, optType) {
  3101. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  3102. }
  3103. function getContextVm(vm) {
  3104. var $parent = vm.$parent;
  3105. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  3106. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  3107. $parent = $parent.$parent;
  3108. }
  3109. return $parent && $parent.$parent;
  3110. }
  3111. function handleEvent(event) {
  3112. var _this2 = this;
  3113. event = wrapper$1(event);
  3114. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  3115. var dataset = (event.currentTarget || event.target).dataset;
  3116. if (!dataset) {
  3117. return console.warn('事件信息不存在');
  3118. }
  3119. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  3120. if (!eventOpts) {
  3121. return console.warn('事件信息不存在');
  3122. }
  3123. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  3124. var eventType = event.type;
  3125. var ret = [];
  3126. eventOpts.forEach(function (eventOpt) {
  3127. var type = eventOpt[0];
  3128. var eventsArray = eventOpt[1];
  3129. var isCustom = type.charAt(0) === CUSTOM;
  3130. type = isCustom ? type.slice(1) : type;
  3131. var isOnce = type.charAt(0) === ONCE;
  3132. type = isOnce ? type.slice(1) : type;
  3133. if (eventsArray && isMatchEventType(eventType, type)) {
  3134. eventsArray.forEach(function (eventArray) {
  3135. var methodName = eventArray[0];
  3136. if (methodName) {
  3137. var handlerCtx = _this2.$vm;
  3138. if (handlerCtx.$options.generic) {
  3139. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  3140. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  3141. }
  3142. if (methodName === '$emit') {
  3143. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  3144. return;
  3145. }
  3146. var handler = handlerCtx[methodName];
  3147. if (!isFn(handler)) {
  3148. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  3149. var path = _this2.route || _this2.is;
  3150. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  3151. }
  3152. if (isOnce) {
  3153. if (handler.once) {
  3154. return;
  3155. }
  3156. handler.once = true;
  3157. }
  3158. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  3159. params = Array.isArray(params) ? params : [];
  3160. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  3161. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  3162. // eslint-disable-next-line no-sparse-arrays
  3163. params = params.concat([,,,,,,,,,, event]);
  3164. }
  3165. ret.push(handler.apply(handlerCtx, params));
  3166. }
  3167. });
  3168. }
  3169. });
  3170. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  3171. return ret[0];
  3172. }
  3173. }
  3174. var eventChannels = {};
  3175. var eventChannelStack = [];
  3176. function getEventChannel(id) {
  3177. if (id) {
  3178. var eventChannel = eventChannels[id];
  3179. delete eventChannels[id];
  3180. return eventChannel;
  3181. }
  3182. return eventChannelStack.shift();
  3183. }
  3184. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  3185. function initEventChannel() {
  3186. _vue.default.prototype.getOpenerEventChannel = function () {
  3187. // 微信小程序使用自身getOpenerEventChannel
  3188. {
  3189. return this.$scope.getOpenerEventChannel();
  3190. }
  3191. };
  3192. var callHook = _vue.default.prototype.__call_hook;
  3193. _vue.default.prototype.__call_hook = function (hook, args) {
  3194. if (hook === 'onLoad' && args && args.__id__) {
  3195. this.__eventChannel__ = getEventChannel(args.__id__);
  3196. delete args.__id__;
  3197. }
  3198. return callHook.call(this, hook, args);
  3199. };
  3200. }
  3201. function initScopedSlotsParams() {
  3202. var center = {};
  3203. var parents = {};
  3204. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  3205. var has = center[vueId];
  3206. if (!has) {
  3207. parents[vueId] = this;
  3208. this.$on('hook:destroyed', function () {
  3209. delete parents[vueId];
  3210. });
  3211. }
  3212. return has;
  3213. };
  3214. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  3215. var data = center[vueId];
  3216. if (data) {
  3217. var object = data[name] || {};
  3218. return key ? object[key] : object;
  3219. } else {
  3220. parents[vueId] = this;
  3221. this.$on('hook:destroyed', function () {
  3222. delete parents[vueId];
  3223. });
  3224. }
  3225. };
  3226. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  3227. var vueIds = this.$options.propsData.vueId;
  3228. if (vueIds) {
  3229. var vueId = vueIds.split(',')[0];
  3230. var object = center[vueId] = center[vueId] || {};
  3231. object[name] = value;
  3232. if (parents[vueId]) {
  3233. parents[vueId].$forceUpdate();
  3234. }
  3235. }
  3236. };
  3237. _vue.default.mixin({
  3238. destroyed: function destroyed() {
  3239. var propsData = this.$options.propsData;
  3240. var vueId = propsData && propsData.vueId;
  3241. if (vueId) {
  3242. delete center[vueId];
  3243. delete parents[vueId];
  3244. }
  3245. }
  3246. });
  3247. }
  3248. function parseBaseApp(vm, _ref4) {
  3249. var mocks = _ref4.mocks,
  3250. initRefs = _ref4.initRefs;
  3251. initEventChannel();
  3252. {
  3253. initScopedSlotsParams();
  3254. }
  3255. if (vm.$options.store) {
  3256. _vue.default.prototype.$store = vm.$options.store;
  3257. }
  3258. uniIdMixin(_vue.default);
  3259. _vue.default.prototype.mpHost = "mp-weixin";
  3260. _vue.default.mixin({
  3261. beforeCreate: function beforeCreate() {
  3262. if (!this.$options.mpType) {
  3263. return;
  3264. }
  3265. this.mpType = this.$options.mpType;
  3266. this.$mp = (0, _defineProperty2.default)({
  3267. data: {}
  3268. }, this.mpType, this.$options.mpInstance);
  3269. this.$scope = this.$options.mpInstance;
  3270. delete this.$options.mpType;
  3271. delete this.$options.mpInstance;
  3272. if (this.mpType === 'page' && typeof getApp === 'function') {
  3273. // hack vue-i18n
  3274. var app = getApp();
  3275. if (app.$vm && app.$vm.$i18n) {
  3276. this._i18n = app.$vm.$i18n;
  3277. }
  3278. }
  3279. if (this.mpType !== 'app') {
  3280. initRefs(this);
  3281. initMocks(this, mocks);
  3282. }
  3283. }
  3284. });
  3285. var appOptions = {
  3286. onLaunch: function onLaunch(args) {
  3287. if (this.$vm) {
  3288. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  3289. return;
  3290. }
  3291. {
  3292. if (wx.canIUse && !wx.canIUse('nextTick')) {
  3293. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  3294. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  3295. }
  3296. }
  3297. this.$vm = vm;
  3298. this.$vm.$mp = {
  3299. app: this
  3300. };
  3301. this.$vm.$scope = this;
  3302. // vm 上也挂载 globalData
  3303. this.$vm.globalData = this.globalData;
  3304. this.$vm._isMounted = true;
  3305. this.$vm.__call_hook('mounted', args);
  3306. this.$vm.__call_hook('onLaunch', args);
  3307. }
  3308. };
  3309. // 兼容旧版本 globalData
  3310. appOptions.globalData = vm.$options.globalData || {};
  3311. // 将 methods 中的方法挂在 getApp() 中
  3312. var methods = vm.$options.methods;
  3313. if (methods) {
  3314. Object.keys(methods).forEach(function (name) {
  3315. appOptions[name] = methods[name];
  3316. });
  3317. }
  3318. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  3319. initHooks(appOptions, hooks);
  3320. initUnknownHooks(appOptions, vm.$options);
  3321. return appOptions;
  3322. }
  3323. function parseApp(vm) {
  3324. return parseBaseApp(vm, {
  3325. mocks: mocks,
  3326. initRefs: initRefs
  3327. });
  3328. }
  3329. function createApp(vm) {
  3330. App(parseApp(vm));
  3331. return vm;
  3332. }
  3333. var encodeReserveRE = /[!'()*]/g;
  3334. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  3335. return '%' + c.charCodeAt(0).toString(16);
  3336. };
  3337. var commaRE = /%2C/g;
  3338. // fixed encodeURIComponent which is more conformant to RFC3986:
  3339. // - escapes [!'()*]
  3340. // - preserve commas
  3341. var encode = function encode(str) {
  3342. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  3343. };
  3344. function stringifyQuery(obj) {
  3345. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  3346. var res = obj ? Object.keys(obj).map(function (key) {
  3347. var val = obj[key];
  3348. if (val === undefined) {
  3349. return '';
  3350. }
  3351. if (val === null) {
  3352. return encodeStr(key);
  3353. }
  3354. if (Array.isArray(val)) {
  3355. var result = [];
  3356. val.forEach(function (val2) {
  3357. if (val2 === undefined) {
  3358. return;
  3359. }
  3360. if (val2 === null) {
  3361. result.push(encodeStr(key));
  3362. } else {
  3363. result.push(encodeStr(key) + '=' + encodeStr(val2));
  3364. }
  3365. });
  3366. return result.join('&');
  3367. }
  3368. return encodeStr(key) + '=' + encodeStr(val);
  3369. }).filter(function (x) {
  3370. return x.length > 0;
  3371. }).join('&') : null;
  3372. return res ? "?".concat(res) : '';
  3373. }
  3374. function parseBaseComponent(vueComponentOptions) {
  3375. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  3376. isPage = _ref5.isPage,
  3377. initRelation = _ref5.initRelation;
  3378. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  3379. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  3380. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  3381. VueComponent = _initVueComponent2[0],
  3382. vueOptions = _initVueComponent2[1];
  3383. var options = _objectSpread({
  3384. multipleSlots: true,
  3385. addGlobalClass: true
  3386. }, vueOptions.options || {});
  3387. {
  3388. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  3389. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  3390. Object.assign(options, vueOptions['mp-weixin'].options);
  3391. }
  3392. }
  3393. var componentOptions = {
  3394. options: options,
  3395. data: initData(vueOptions, _vue.default.prototype),
  3396. behaviors: initBehaviors(vueOptions, initBehavior),
  3397. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  3398. lifetimes: {
  3399. attached: function attached() {
  3400. var properties = this.properties;
  3401. var options = {
  3402. mpType: isPage.call(this) ? 'page' : 'component',
  3403. mpInstance: this,
  3404. propsData: properties
  3405. };
  3406. initVueIds(properties.vueId, this);
  3407. // 处理父子关系
  3408. initRelation.call(this, {
  3409. vuePid: this._$vuePid,
  3410. vueOptions: options
  3411. });
  3412. // 初始化 vue 实例
  3413. this.$vm = new VueComponent(options);
  3414. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  3415. initSlots(this.$vm, properties.vueSlots);
  3416. // 触发首次 setData
  3417. this.$vm.$mount();
  3418. },
  3419. ready: function ready() {
  3420. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  3421. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  3422. if (this.$vm) {
  3423. this.$vm._isMounted = true;
  3424. this.$vm.__call_hook('mounted');
  3425. this.$vm.__call_hook('onReady');
  3426. }
  3427. },
  3428. detached: function detached() {
  3429. this.$vm && this.$vm.$destroy();
  3430. }
  3431. },
  3432. pageLifetimes: {
  3433. show: function show(args) {
  3434. this.$vm && this.$vm.__call_hook('onPageShow', args);
  3435. },
  3436. hide: function hide() {
  3437. this.$vm && this.$vm.__call_hook('onPageHide');
  3438. },
  3439. resize: function resize(size) {
  3440. this.$vm && this.$vm.__call_hook('onPageResize', size);
  3441. }
  3442. },
  3443. methods: {
  3444. __l: handleLink,
  3445. __e: handleEvent
  3446. }
  3447. };
  3448. // externalClasses
  3449. if (vueOptions.externalClasses) {
  3450. componentOptions.externalClasses = vueOptions.externalClasses;
  3451. }
  3452. if (Array.isArray(vueOptions.wxsCallMethods)) {
  3453. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  3454. componentOptions.methods[callMethod] = function (args) {
  3455. return this.$vm[callMethod](args);
  3456. };
  3457. });
  3458. }
  3459. if (needVueOptions) {
  3460. return [componentOptions, vueOptions, VueComponent];
  3461. }
  3462. if (isPage) {
  3463. return componentOptions;
  3464. }
  3465. return [componentOptions, VueComponent];
  3466. }
  3467. function parseComponent(vueComponentOptions, needVueOptions) {
  3468. return parseBaseComponent(vueComponentOptions, {
  3469. isPage: isPage,
  3470. initRelation: initRelation
  3471. }, needVueOptions);
  3472. }
  3473. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  3474. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  3475. function parseBasePage(vuePageOptions) {
  3476. var _parseComponent = parseComponent(vuePageOptions, true),
  3477. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  3478. pageOptions = _parseComponent2[0],
  3479. vueOptions = _parseComponent2[1];
  3480. initHooks(pageOptions.methods, hooks$1, vueOptions);
  3481. pageOptions.methods.onLoad = function (query) {
  3482. this.options = query;
  3483. var copyQuery = Object.assign({}, query);
  3484. delete copyQuery.__id__;
  3485. this.$page = {
  3486. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  3487. };
  3488. this.$vm.$mp.query = query; // 兼容 mpvue
  3489. this.$vm.__call_hook('onLoad', query);
  3490. };
  3491. {
  3492. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  3493. }
  3494. {
  3495. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  3496. }
  3497. return pageOptions;
  3498. }
  3499. function parsePage(vuePageOptions) {
  3500. return parseBasePage(vuePageOptions);
  3501. }
  3502. function createPage(vuePageOptions) {
  3503. {
  3504. return Component(parsePage(vuePageOptions));
  3505. }
  3506. }
  3507. function createComponent(vueOptions) {
  3508. {
  3509. return Component(parseComponent(vueOptions));
  3510. }
  3511. }
  3512. function createSubpackageApp(vm) {
  3513. var appOptions = parseApp(vm);
  3514. var app = getApp({
  3515. allowDefault: true
  3516. });
  3517. vm.$scope = app;
  3518. var globalData = app.globalData;
  3519. if (globalData) {
  3520. Object.keys(appOptions.globalData).forEach(function (name) {
  3521. if (!hasOwn(globalData, name)) {
  3522. globalData[name] = appOptions.globalData[name];
  3523. }
  3524. });
  3525. }
  3526. Object.keys(appOptions).forEach(function (name) {
  3527. if (!hasOwn(app, name)) {
  3528. app[name] = appOptions[name];
  3529. }
  3530. });
  3531. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3532. wx.onAppShow(function () {
  3533. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3534. args[_key5] = arguments[_key5];
  3535. }
  3536. vm.__call_hook('onShow', args);
  3537. });
  3538. }
  3539. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3540. wx.onAppHide(function () {
  3541. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3542. args[_key6] = arguments[_key6];
  3543. }
  3544. vm.__call_hook('onHide', args);
  3545. });
  3546. }
  3547. if (isFn(appOptions.onLaunch)) {
  3548. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3549. vm.__call_hook('onLaunch', args);
  3550. }
  3551. return vm;
  3552. }
  3553. function createPlugin(vm) {
  3554. var appOptions = parseApp(vm);
  3555. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3556. wx.onAppShow(function () {
  3557. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3558. args[_key7] = arguments[_key7];
  3559. }
  3560. vm.__call_hook('onShow', args);
  3561. });
  3562. }
  3563. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3564. wx.onAppHide(function () {
  3565. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3566. args[_key8] = arguments[_key8];
  3567. }
  3568. vm.__call_hook('onHide', args);
  3569. });
  3570. }
  3571. if (isFn(appOptions.onLaunch)) {
  3572. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3573. vm.__call_hook('onLaunch', args);
  3574. }
  3575. return vm;
  3576. }
  3577. todos.forEach(function (todoApi) {
  3578. protocols[todoApi] = false;
  3579. });
  3580. canIUses.forEach(function (canIUseApi) {
  3581. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3582. if (!wx.canIUse(apiName)) {
  3583. protocols[canIUseApi] = false;
  3584. }
  3585. });
  3586. var uni = {};
  3587. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3588. uni = new Proxy({}, {
  3589. get: function get(target, name) {
  3590. if (hasOwn(target, name)) {
  3591. return target[name];
  3592. }
  3593. if (baseApi[name]) {
  3594. return baseApi[name];
  3595. }
  3596. if (api[name]) {
  3597. return promisify(name, api[name]);
  3598. }
  3599. {
  3600. if (extraApi[name]) {
  3601. return promisify(name, extraApi[name]);
  3602. }
  3603. if (todoApis[name]) {
  3604. return promisify(name, todoApis[name]);
  3605. }
  3606. }
  3607. if (eventApi[name]) {
  3608. return eventApi[name];
  3609. }
  3610. return promisify(name, wrapper(name, wx[name]));
  3611. },
  3612. set: function set(target, name, value) {
  3613. target[name] = value;
  3614. return true;
  3615. }
  3616. });
  3617. } else {
  3618. Object.keys(baseApi).forEach(function (name) {
  3619. uni[name] = baseApi[name];
  3620. });
  3621. {
  3622. Object.keys(todoApis).forEach(function (name) {
  3623. uni[name] = promisify(name, todoApis[name]);
  3624. });
  3625. Object.keys(extraApi).forEach(function (name) {
  3626. uni[name] = promisify(name, todoApis[name]);
  3627. });
  3628. }
  3629. Object.keys(eventApi).forEach(function (name) {
  3630. uni[name] = eventApi[name];
  3631. });
  3632. Object.keys(api).forEach(function (name) {
  3633. uni[name] = promisify(name, api[name]);
  3634. });
  3635. Object.keys(wx).forEach(function (name) {
  3636. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3637. uni[name] = promisify(name, wrapper(name, wx[name]));
  3638. }
  3639. });
  3640. }
  3641. wx.createApp = createApp;
  3642. wx.createPage = createPage;
  3643. wx.createComponent = createComponent;
  3644. wx.createSubpackageApp = createSubpackageApp;
  3645. wx.createPlugin = createPlugin;
  3646. var uni$1 = uni;
  3647. var _default = uni$1;
  3648. exports.default = _default;
  3649. /* 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)))
  3650. /***/ }),
  3651. /***/ 20:
  3652. /*!****************************************************************!*\
  3653. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3654. \****************************************************************/
  3655. /*! no static exports found */
  3656. /***/ (function(module, exports) {
  3657. function _iterableToArray(iter) {
  3658. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3659. }
  3660. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3661. /***/ }),
  3662. /***/ 21:
  3663. /*!******************************************************************!*\
  3664. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3665. \******************************************************************/
  3666. /*! no static exports found */
  3667. /***/ (function(module, exports) {
  3668. function _nonIterableSpread() {
  3669. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3670. }
  3671. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3672. /***/ }),
  3673. /***/ 212:
  3674. /*!**************************************!*\
  3675. !*** D:/工作/项目2/亲家母/qjm/api/login.js ***!
  3676. \**************************************/
  3677. /*! no static exports found */
  3678. /***/ (function(module, exports, __webpack_require__) {
  3679. "use strict";
  3680. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3681. Object.defineProperty(exports, "__esModule", {
  3682. value: true
  3683. });
  3684. exports.bangding = bangding;
  3685. exports.getUserInfo = getUserInfo;
  3686. exports.login = login;
  3687. exports.loginMobile = loginMobile;
  3688. exports.register = register;
  3689. exports.verify = verify;
  3690. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  3691. // 登录
  3692. function login(data) {
  3693. return (0, _request.default)({
  3694. url: '/api/login',
  3695. method: 'post',
  3696. data: data
  3697. });
  3698. }
  3699. // 注册
  3700. function register(data) {
  3701. return (0, _request.default)({
  3702. url: '/api/register',
  3703. method: 'post',
  3704. data: data
  3705. });
  3706. }
  3707. // 验证码
  3708. function verify(data) {
  3709. // type=register为注册
  3710. // type=login为登录
  3711. return (0, _request.default)({
  3712. url: '/api/register/verify',
  3713. method: 'post',
  3714. data: data
  3715. });
  3716. }
  3717. // 获取用户信息
  3718. function getUserInfo(data) {
  3719. return (0, _request.default)({
  3720. url: '/api/userinfo',
  3721. method: 'get',
  3722. data: data
  3723. });
  3724. }
  3725. // 短信登录
  3726. function loginMobile(data) {
  3727. return (0, _request.default)({
  3728. url: '/api/login/mobile',
  3729. method: 'post',
  3730. data: data
  3731. });
  3732. }
  3733. //绑定手机号
  3734. function bangding(data) {
  3735. return (0, _request.default)({
  3736. url: '/api/binding',
  3737. method: 'POST',
  3738. data: data
  3739. });
  3740. }
  3741. /***/ }),
  3742. /***/ 213:
  3743. /*!************************************!*\
  3744. !*** D:/工作/项目2/亲家母/qjm/api/set.js ***!
  3745. \************************************/
  3746. /*! no static exports found */
  3747. /***/ (function(module, exports, __webpack_require__) {
  3748. "use strict";
  3749. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3750. Object.defineProperty(exports, "__esModule", {
  3751. value: true
  3752. });
  3753. exports.binding = binding;
  3754. exports.city_area = city_area;
  3755. exports.logout = logout;
  3756. exports.registerReset = registerReset;
  3757. exports.userEdit = userEdit;
  3758. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  3759. // 修改用户信息
  3760. function userEdit(data) {
  3761. return (0, _request.default)({
  3762. url: '/api/user/edit',
  3763. method: 'post',
  3764. data: data
  3765. });
  3766. }
  3767. //退出登录
  3768. function logout(data) {
  3769. return (0, _request.default)({
  3770. url: '/api/logout',
  3771. method: 'get',
  3772. data: data
  3773. });
  3774. }
  3775. //修改密码
  3776. function registerReset(data) {
  3777. return (0, _request.default)({
  3778. url: '/api/register/reset',
  3779. method: 'post',
  3780. data: data
  3781. });
  3782. }
  3783. //绑定手机
  3784. function binding(data) {
  3785. return (0, _request.default)({
  3786. url: '/api/binding',
  3787. method: 'post',
  3788. data: data
  3789. });
  3790. }
  3791. // 获取地址
  3792. function city_area(data) {
  3793. return (0, _request.default)({
  3794. url: '/api/city_area',
  3795. method: 'get',
  3796. data: data
  3797. });
  3798. }
  3799. /***/ }),
  3800. /***/ 214:
  3801. /*!***********************************************!*\
  3802. !*** D:/工作/项目2/亲家母/qjm/utils/wxMinProgram.js ***!
  3803. \***********************************************/
  3804. /*! no static exports found */
  3805. /***/ (function(module, exports, __webpack_require__) {
  3806. "use strict";
  3807. /* WEBPACK VAR INJECTION */(function(uni, wx) {
  3808. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3809. Object.defineProperty(exports, "__esModule", {
  3810. value: true
  3811. });
  3812. exports.loginWinxinMp = loginWinxinMp;
  3813. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  3814. //微信登录
  3815. /**
  3816. * @param {string} 当前页面地址信息
  3817. */
  3818. function loginWinxinMp() {
  3819. var pages = getCurrentPages();
  3820. // 获取跳转前页面
  3821. var page = pages[pages.length - 2];
  3822. var queryUrl = '';
  3823. for (var key in page.options) {
  3824. queryUrl += key + '=' + page.options[key] + "&";
  3825. }
  3826. // 获取当页面路由地址
  3827. var path = '/' + page.route + '?' + queryUrl;
  3828. // 保存跳转前页面
  3829. uni.setStorageSync('present', path);
  3830. return new Promise(function (resolve, reject) {
  3831. wx.login({
  3832. success: function success(e) {
  3833. // uni.showModal({
  3834. // title: 'zhi1',
  3835. // content: JSON.stringify(e)
  3836. // })
  3837. console.log(e);
  3838. resolve(e);
  3839. },
  3840. fill: function fill(e) {
  3841. reject(e);
  3842. }
  3843. });
  3844. });
  3845. }
  3846. ;
  3847. /* 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"]))
  3848. /***/ }),
  3849. /***/ 215:
  3850. /*!***********************************!*\
  3851. !*** D:/工作/项目2/亲家母/qjm/api/wx.js ***!
  3852. \***********************************/
  3853. /*! no static exports found */
  3854. /***/ (function(module, exports, __webpack_require__) {
  3855. "use strict";
  3856. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3857. Object.defineProperty(exports, "__esModule", {
  3858. value: true
  3859. });
  3860. exports.wechatMpAuth = wechatMpAuth;
  3861. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  3862. // 微信code地址
  3863. function wechatMpAuth(data) {
  3864. return (0, _request.default)({
  3865. url: '/api/wechat/mp_auth',
  3866. method: 'post',
  3867. data: data
  3868. });
  3869. }
  3870. /***/ }),
  3871. /***/ 22:
  3872. /*!*************************************************************!*\
  3873. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3874. \*************************************************************/
  3875. /*! no static exports found */
  3876. /***/ (function(module, exports, __webpack_require__) {
  3877. "use strict";
  3878. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3879. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3880. Object.defineProperty(exports, "__esModule", {
  3881. value: true
  3882. });
  3883. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3884. exports.compileI18nJsonStr = compileI18nJsonStr;
  3885. exports.hasI18nJson = hasI18nJson;
  3886. exports.initVueI18n = initVueI18n;
  3887. exports.isI18nStr = isI18nStr;
  3888. exports.isString = void 0;
  3889. exports.normalizeLocale = normalizeLocale;
  3890. exports.parseI18nJson = parseI18nJson;
  3891. exports.resolveLocale = resolveLocale;
  3892. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3893. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3894. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3895. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3896. var isArray = Array.isArray;
  3897. var isObject = function isObject(val) {
  3898. return val !== null && (0, _typeof2.default)(val) === 'object';
  3899. };
  3900. var defaultDelimiters = ['{', '}'];
  3901. var BaseFormatter = /*#__PURE__*/function () {
  3902. function BaseFormatter() {
  3903. (0, _classCallCheck2.default)(this, BaseFormatter);
  3904. this._caches = Object.create(null);
  3905. }
  3906. (0, _createClass2.default)(BaseFormatter, [{
  3907. key: "interpolate",
  3908. value: function interpolate(message, values) {
  3909. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3910. if (!values) {
  3911. return [message];
  3912. }
  3913. var tokens = this._caches[message];
  3914. if (!tokens) {
  3915. tokens = parse(message, delimiters);
  3916. this._caches[message] = tokens;
  3917. }
  3918. return compile(tokens, values);
  3919. }
  3920. }]);
  3921. return BaseFormatter;
  3922. }();
  3923. exports.Formatter = BaseFormatter;
  3924. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3925. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3926. function parse(format, _ref) {
  3927. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3928. startDelimiter = _ref2[0],
  3929. endDelimiter = _ref2[1];
  3930. var tokens = [];
  3931. var position = 0;
  3932. var text = '';
  3933. while (position < format.length) {
  3934. var char = format[position++];
  3935. if (char === startDelimiter) {
  3936. if (text) {
  3937. tokens.push({
  3938. type: 'text',
  3939. value: text
  3940. });
  3941. }
  3942. text = '';
  3943. var sub = '';
  3944. char = format[position++];
  3945. while (char !== undefined && char !== endDelimiter) {
  3946. sub += char;
  3947. char = format[position++];
  3948. }
  3949. var isClosed = char === endDelimiter;
  3950. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3951. tokens.push({
  3952. value: sub,
  3953. type: type
  3954. });
  3955. }
  3956. // else if (char === '%') {
  3957. // // when found rails i18n syntax, skip text capture
  3958. // if (format[position] !== '{') {
  3959. // text += char
  3960. // }
  3961. // }
  3962. else {
  3963. text += char;
  3964. }
  3965. }
  3966. text && tokens.push({
  3967. type: 'text',
  3968. value: text
  3969. });
  3970. return tokens;
  3971. }
  3972. function compile(tokens, values) {
  3973. var compiled = [];
  3974. var index = 0;
  3975. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3976. if (mode === 'unknown') {
  3977. return compiled;
  3978. }
  3979. while (index < tokens.length) {
  3980. var token = tokens[index];
  3981. switch (token.type) {
  3982. case 'text':
  3983. compiled.push(token.value);
  3984. break;
  3985. case 'list':
  3986. compiled.push(values[parseInt(token.value, 10)]);
  3987. break;
  3988. case 'named':
  3989. if (mode === 'named') {
  3990. compiled.push(values[token.value]);
  3991. } else {
  3992. if (true) {
  3993. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3994. }
  3995. }
  3996. break;
  3997. case 'unknown':
  3998. if (true) {
  3999. console.warn("Detect 'unknown' type of token!");
  4000. }
  4001. break;
  4002. }
  4003. index++;
  4004. }
  4005. return compiled;
  4006. }
  4007. var LOCALE_ZH_HANS = 'zh-Hans';
  4008. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  4009. var LOCALE_ZH_HANT = 'zh-Hant';
  4010. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  4011. var LOCALE_EN = 'en';
  4012. exports.LOCALE_EN = LOCALE_EN;
  4013. var LOCALE_FR = 'fr';
  4014. exports.LOCALE_FR = LOCALE_FR;
  4015. var LOCALE_ES = 'es';
  4016. exports.LOCALE_ES = LOCALE_ES;
  4017. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4018. var hasOwn = function hasOwn(val, key) {
  4019. return hasOwnProperty.call(val, key);
  4020. };
  4021. var defaultFormatter = new BaseFormatter();
  4022. function include(str, parts) {
  4023. return !!parts.find(function (part) {
  4024. return str.indexOf(part) !== -1;
  4025. });
  4026. }
  4027. function startsWith(str, parts) {
  4028. return parts.find(function (part) {
  4029. return str.indexOf(part) === 0;
  4030. });
  4031. }
  4032. function normalizeLocale(locale, messages) {
  4033. if (!locale) {
  4034. return;
  4035. }
  4036. locale = locale.trim().replace(/_/g, '-');
  4037. if (messages && messages[locale]) {
  4038. return locale;
  4039. }
  4040. locale = locale.toLowerCase();
  4041. if (locale.indexOf('zh') === 0) {
  4042. if (locale.indexOf('-hans') > -1) {
  4043. return LOCALE_ZH_HANS;
  4044. }
  4045. if (locale.indexOf('-hant') > -1) {
  4046. return LOCALE_ZH_HANT;
  4047. }
  4048. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  4049. return LOCALE_ZH_HANT;
  4050. }
  4051. return LOCALE_ZH_HANS;
  4052. }
  4053. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  4054. if (lang) {
  4055. return lang;
  4056. }
  4057. }
  4058. var I18n = /*#__PURE__*/function () {
  4059. function I18n(_ref3) {
  4060. var locale = _ref3.locale,
  4061. fallbackLocale = _ref3.fallbackLocale,
  4062. messages = _ref3.messages,
  4063. watcher = _ref3.watcher,
  4064. formater = _ref3.formater;
  4065. (0, _classCallCheck2.default)(this, I18n);
  4066. this.locale = LOCALE_EN;
  4067. this.fallbackLocale = LOCALE_EN;
  4068. this.message = {};
  4069. this.messages = {};
  4070. this.watchers = [];
  4071. if (fallbackLocale) {
  4072. this.fallbackLocale = fallbackLocale;
  4073. }
  4074. this.formater = formater || defaultFormatter;
  4075. this.messages = messages || {};
  4076. this.setLocale(locale || LOCALE_EN);
  4077. if (watcher) {
  4078. this.watchLocale(watcher);
  4079. }
  4080. }
  4081. (0, _createClass2.default)(I18n, [{
  4082. key: "setLocale",
  4083. value: function setLocale(locale) {
  4084. var _this = this;
  4085. var oldLocale = this.locale;
  4086. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  4087. if (!this.messages[this.locale]) {
  4088. // 可能初始化时不存在
  4089. this.messages[this.locale] = {};
  4090. }
  4091. this.message = this.messages[this.locale];
  4092. // 仅发生变化时,通知
  4093. if (oldLocale !== this.locale) {
  4094. this.watchers.forEach(function (watcher) {
  4095. watcher(_this.locale, oldLocale);
  4096. });
  4097. }
  4098. }
  4099. }, {
  4100. key: "getLocale",
  4101. value: function getLocale() {
  4102. return this.locale;
  4103. }
  4104. }, {
  4105. key: "watchLocale",
  4106. value: function watchLocale(fn) {
  4107. var _this2 = this;
  4108. var index = this.watchers.push(fn) - 1;
  4109. return function () {
  4110. _this2.watchers.splice(index, 1);
  4111. };
  4112. }
  4113. }, {
  4114. key: "add",
  4115. value: function add(locale, message) {
  4116. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4117. var curMessages = this.messages[locale];
  4118. if (curMessages) {
  4119. if (override) {
  4120. Object.assign(curMessages, message);
  4121. } else {
  4122. Object.keys(message).forEach(function (key) {
  4123. if (!hasOwn(curMessages, key)) {
  4124. curMessages[key] = message[key];
  4125. }
  4126. });
  4127. }
  4128. } else {
  4129. this.messages[locale] = message;
  4130. }
  4131. }
  4132. }, {
  4133. key: "f",
  4134. value: function f(message, values, delimiters) {
  4135. return this.formater.interpolate(message, values, delimiters).join('');
  4136. }
  4137. }, {
  4138. key: "t",
  4139. value: function t(key, locale, values) {
  4140. var message = this.message;
  4141. if (typeof locale === 'string') {
  4142. locale = normalizeLocale(locale, this.messages);
  4143. locale && (message = this.messages[locale]);
  4144. } else {
  4145. values = locale;
  4146. }
  4147. if (!hasOwn(message, key)) {
  4148. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  4149. return key;
  4150. }
  4151. return this.formater.interpolate(message[key], values).join('');
  4152. }
  4153. }]);
  4154. return I18n;
  4155. }();
  4156. exports.I18n = I18n;
  4157. function watchAppLocale(appVm, i18n) {
  4158. // 需要保证 watch 的触发在组件渲染之前
  4159. if (appVm.$watchLocale) {
  4160. // vue2
  4161. appVm.$watchLocale(function (newLocale) {
  4162. i18n.setLocale(newLocale);
  4163. });
  4164. } else {
  4165. appVm.$watch(function () {
  4166. return appVm.$locale;
  4167. }, function (newLocale) {
  4168. i18n.setLocale(newLocale);
  4169. });
  4170. }
  4171. }
  4172. function getDefaultLocale() {
  4173. if (typeof uni !== 'undefined' && uni.getLocale) {
  4174. return uni.getLocale();
  4175. }
  4176. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  4177. if (typeof global !== 'undefined' && global.getLocale) {
  4178. return global.getLocale();
  4179. }
  4180. return LOCALE_EN;
  4181. }
  4182. function initVueI18n(locale) {
  4183. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4184. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  4185. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  4186. // 兼容旧版本入参
  4187. if (typeof locale !== 'string') {
  4188. var _ref4 = [messages, locale];
  4189. locale = _ref4[0];
  4190. messages = _ref4[1];
  4191. }
  4192. if (typeof locale !== 'string') {
  4193. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  4194. locale = getDefaultLocale();
  4195. }
  4196. if (typeof fallbackLocale !== 'string') {
  4197. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  4198. }
  4199. var i18n = new I18n({
  4200. locale: locale,
  4201. fallbackLocale: fallbackLocale,
  4202. messages: messages,
  4203. watcher: watcher
  4204. });
  4205. var _t = function t(key, values) {
  4206. if (typeof getApp !== 'function') {
  4207. // app view
  4208. /* eslint-disable no-func-assign */
  4209. _t = function t(key, values) {
  4210. return i18n.t(key, values);
  4211. };
  4212. } else {
  4213. var isWatchedAppLocale = false;
  4214. _t = function t(key, values) {
  4215. var appVm = getApp().$vm;
  4216. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  4217. // options: {
  4218. // type: Array,
  4219. // default () {
  4220. // return [{
  4221. // icon: 'shop',
  4222. // text: t("uni-goods-nav.options.shop"),
  4223. // }, {
  4224. // icon: 'cart',
  4225. // text: t("uni-goods-nav.options.cart")
  4226. // }]
  4227. // }
  4228. // },
  4229. if (appVm) {
  4230. // 触发响应式
  4231. appVm.$locale;
  4232. if (!isWatchedAppLocale) {
  4233. isWatchedAppLocale = true;
  4234. watchAppLocale(appVm, i18n);
  4235. }
  4236. }
  4237. return i18n.t(key, values);
  4238. };
  4239. }
  4240. return _t(key, values);
  4241. };
  4242. return {
  4243. i18n: i18n,
  4244. f: function f(message, values, delimiters) {
  4245. return i18n.f(message, values, delimiters);
  4246. },
  4247. t: function t(key, values) {
  4248. return _t(key, values);
  4249. },
  4250. add: function add(locale, message) {
  4251. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4252. return i18n.add(locale, message, override);
  4253. },
  4254. watch: function watch(fn) {
  4255. return i18n.watchLocale(fn);
  4256. },
  4257. getLocale: function getLocale() {
  4258. return i18n.getLocale();
  4259. },
  4260. setLocale: function setLocale(newLocale) {
  4261. return i18n.setLocale(newLocale);
  4262. }
  4263. };
  4264. }
  4265. var isString = function isString(val) {
  4266. return typeof val === 'string';
  4267. };
  4268. exports.isString = isString;
  4269. var formater;
  4270. function hasI18nJson(jsonObj, delimiters) {
  4271. if (!formater) {
  4272. formater = new BaseFormatter();
  4273. }
  4274. return walkJsonObj(jsonObj, function (jsonObj, key) {
  4275. var value = jsonObj[key];
  4276. if (isString(value)) {
  4277. if (isI18nStr(value, delimiters)) {
  4278. return true;
  4279. }
  4280. } else {
  4281. return hasI18nJson(value, delimiters);
  4282. }
  4283. });
  4284. }
  4285. function parseI18nJson(jsonObj, values, delimiters) {
  4286. if (!formater) {
  4287. formater = new BaseFormatter();
  4288. }
  4289. walkJsonObj(jsonObj, function (jsonObj, key) {
  4290. var value = jsonObj[key];
  4291. if (isString(value)) {
  4292. if (isI18nStr(value, delimiters)) {
  4293. jsonObj[key] = compileStr(value, values, delimiters);
  4294. }
  4295. } else {
  4296. parseI18nJson(value, values, delimiters);
  4297. }
  4298. });
  4299. return jsonObj;
  4300. }
  4301. function compileI18nJsonStr(jsonStr, _ref5) {
  4302. var locale = _ref5.locale,
  4303. locales = _ref5.locales,
  4304. delimiters = _ref5.delimiters;
  4305. if (!isI18nStr(jsonStr, delimiters)) {
  4306. return jsonStr;
  4307. }
  4308. if (!formater) {
  4309. formater = new BaseFormatter();
  4310. }
  4311. var localeValues = [];
  4312. Object.keys(locales).forEach(function (name) {
  4313. if (name !== locale) {
  4314. localeValues.push({
  4315. locale: name,
  4316. values: locales[name]
  4317. });
  4318. }
  4319. });
  4320. localeValues.unshift({
  4321. locale: locale,
  4322. values: locales[locale]
  4323. });
  4324. try {
  4325. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  4326. } catch (e) {}
  4327. return jsonStr;
  4328. }
  4329. function isI18nStr(value, delimiters) {
  4330. return value.indexOf(delimiters[0]) > -1;
  4331. }
  4332. function compileStr(value, values, delimiters) {
  4333. return formater.interpolate(value, values, delimiters).join('');
  4334. }
  4335. function compileValue(jsonObj, key, localeValues, delimiters) {
  4336. var value = jsonObj[key];
  4337. if (isString(value)) {
  4338. // 存在国际化
  4339. if (isI18nStr(value, delimiters)) {
  4340. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  4341. if (localeValues.length > 1) {
  4342. // 格式化国际化语言
  4343. var valueLocales = jsonObj[key + 'Locales'] = {};
  4344. localeValues.forEach(function (localValue) {
  4345. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  4346. });
  4347. }
  4348. }
  4349. } else {
  4350. compileJsonObj(value, localeValues, delimiters);
  4351. }
  4352. }
  4353. function compileJsonObj(jsonObj, localeValues, delimiters) {
  4354. walkJsonObj(jsonObj, function (jsonObj, key) {
  4355. compileValue(jsonObj, key, localeValues, delimiters);
  4356. });
  4357. return jsonObj;
  4358. }
  4359. function walkJsonObj(jsonObj, walk) {
  4360. if (isArray(jsonObj)) {
  4361. for (var i = 0; i < jsonObj.length; i++) {
  4362. if (walk(jsonObj, i)) {
  4363. return true;
  4364. }
  4365. }
  4366. } else if (isObject(jsonObj)) {
  4367. for (var key in jsonObj) {
  4368. if (walk(jsonObj, key)) {
  4369. return true;
  4370. }
  4371. }
  4372. }
  4373. return false;
  4374. }
  4375. function resolveLocale(locales) {
  4376. return function (locale) {
  4377. if (!locale) {
  4378. return locale;
  4379. }
  4380. locale = normalizeLocale(locale) || locale;
  4381. return resolveLocaleChain(locale).find(function (locale) {
  4382. return locales.indexOf(locale) > -1;
  4383. });
  4384. };
  4385. }
  4386. function resolveLocaleChain(locale) {
  4387. var chain = [];
  4388. var tokens = locale.split('-');
  4389. while (tokens.length) {
  4390. chain.push(tokens.join('-'));
  4391. tokens.pop();
  4392. }
  4393. return chain;
  4394. }
  4395. /* 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)))
  4396. /***/ }),
  4397. /***/ 23:
  4398. /*!***************************************************************!*\
  4399. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  4400. \***************************************************************/
  4401. /*! no static exports found */
  4402. /***/ (function(module, exports) {
  4403. function _classCallCheck(instance, Constructor) {
  4404. if (!(instance instanceof Constructor)) {
  4405. throw new TypeError("Cannot call a class as a function");
  4406. }
  4407. }
  4408. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4409. /***/ }),
  4410. /***/ 24:
  4411. /*!************************************************************!*\
  4412. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  4413. \************************************************************/
  4414. /*! no static exports found */
  4415. /***/ (function(module, exports, __webpack_require__) {
  4416. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  4417. function _defineProperties(target, props) {
  4418. for (var i = 0; i < props.length; i++) {
  4419. var descriptor = props[i];
  4420. descriptor.enumerable = descriptor.enumerable || false;
  4421. descriptor.configurable = true;
  4422. if ("value" in descriptor) descriptor.writable = true;
  4423. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  4424. }
  4425. }
  4426. function _createClass(Constructor, protoProps, staticProps) {
  4427. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  4428. if (staticProps) _defineProperties(Constructor, staticProps);
  4429. Object.defineProperty(Constructor, "prototype", {
  4430. writable: false
  4431. });
  4432. return Constructor;
  4433. }
  4434. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4435. /***/ }),
  4436. /***/ 25:
  4437. /*!******************************************************************************************!*\
  4438. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4439. \******************************************************************************************/
  4440. /*! exports provided: default */
  4441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4442. "use strict";
  4443. __webpack_require__.r(__webpack_exports__);
  4444. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4445. * Vue.js v2.6.11
  4446. * (c) 2014-2022 Evan You
  4447. * Released under the MIT License.
  4448. */
  4449. /* */
  4450. var emptyObject = Object.freeze({});
  4451. // These helpers produce better VM code in JS engines due to their
  4452. // explicitness and function inlining.
  4453. function isUndef (v) {
  4454. return v === undefined || v === null
  4455. }
  4456. function isDef (v) {
  4457. return v !== undefined && v !== null
  4458. }
  4459. function isTrue (v) {
  4460. return v === true
  4461. }
  4462. function isFalse (v) {
  4463. return v === false
  4464. }
  4465. /**
  4466. * Check if value is primitive.
  4467. */
  4468. function isPrimitive (value) {
  4469. return (
  4470. typeof value === 'string' ||
  4471. typeof value === 'number' ||
  4472. // $flow-disable-line
  4473. typeof value === 'symbol' ||
  4474. typeof value === 'boolean'
  4475. )
  4476. }
  4477. /**
  4478. * Quick object check - this is primarily used to tell
  4479. * Objects from primitive values when we know the value
  4480. * is a JSON-compliant type.
  4481. */
  4482. function isObject (obj) {
  4483. return obj !== null && typeof obj === 'object'
  4484. }
  4485. /**
  4486. * Get the raw type string of a value, e.g., [object Object].
  4487. */
  4488. var _toString = Object.prototype.toString;
  4489. function toRawType (value) {
  4490. return _toString.call(value).slice(8, -1)
  4491. }
  4492. /**
  4493. * Strict object type check. Only returns true
  4494. * for plain JavaScript objects.
  4495. */
  4496. function isPlainObject (obj) {
  4497. return _toString.call(obj) === '[object Object]'
  4498. }
  4499. function isRegExp (v) {
  4500. return _toString.call(v) === '[object RegExp]'
  4501. }
  4502. /**
  4503. * Check if val is a valid array index.
  4504. */
  4505. function isValidArrayIndex (val) {
  4506. var n = parseFloat(String(val));
  4507. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4508. }
  4509. function isPromise (val) {
  4510. return (
  4511. isDef(val) &&
  4512. typeof val.then === 'function' &&
  4513. typeof val.catch === 'function'
  4514. )
  4515. }
  4516. /**
  4517. * Convert a value to a string that is actually rendered.
  4518. */
  4519. function toString (val) {
  4520. return val == null
  4521. ? ''
  4522. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4523. ? JSON.stringify(val, null, 2)
  4524. : String(val)
  4525. }
  4526. /**
  4527. * Convert an input value to a number for persistence.
  4528. * If the conversion fails, return original string.
  4529. */
  4530. function toNumber (val) {
  4531. var n = parseFloat(val);
  4532. return isNaN(n) ? val : n
  4533. }
  4534. /**
  4535. * Make a map and return a function for checking if a key
  4536. * is in that map.
  4537. */
  4538. function makeMap (
  4539. str,
  4540. expectsLowerCase
  4541. ) {
  4542. var map = Object.create(null);
  4543. var list = str.split(',');
  4544. for (var i = 0; i < list.length; i++) {
  4545. map[list[i]] = true;
  4546. }
  4547. return expectsLowerCase
  4548. ? function (val) { return map[val.toLowerCase()]; }
  4549. : function (val) { return map[val]; }
  4550. }
  4551. /**
  4552. * Check if a tag is a built-in tag.
  4553. */
  4554. var isBuiltInTag = makeMap('slot,component', true);
  4555. /**
  4556. * Check if an attribute is a reserved attribute.
  4557. */
  4558. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4559. /**
  4560. * Remove an item from an array.
  4561. */
  4562. function remove (arr, item) {
  4563. if (arr.length) {
  4564. var index = arr.indexOf(item);
  4565. if (index > -1) {
  4566. return arr.splice(index, 1)
  4567. }
  4568. }
  4569. }
  4570. /**
  4571. * Check whether an object has the property.
  4572. */
  4573. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4574. function hasOwn (obj, key) {
  4575. return hasOwnProperty.call(obj, key)
  4576. }
  4577. /**
  4578. * Create a cached version of a pure function.
  4579. */
  4580. function cached (fn) {
  4581. var cache = Object.create(null);
  4582. return (function cachedFn (str) {
  4583. var hit = cache[str];
  4584. return hit || (cache[str] = fn(str))
  4585. })
  4586. }
  4587. /**
  4588. * Camelize a hyphen-delimited string.
  4589. */
  4590. var camelizeRE = /-(\w)/g;
  4591. var camelize = cached(function (str) {
  4592. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4593. });
  4594. /**
  4595. * Capitalize a string.
  4596. */
  4597. var capitalize = cached(function (str) {
  4598. return str.charAt(0).toUpperCase() + str.slice(1)
  4599. });
  4600. /**
  4601. * Hyphenate a camelCase string.
  4602. */
  4603. var hyphenateRE = /\B([A-Z])/g;
  4604. var hyphenate = cached(function (str) {
  4605. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4606. });
  4607. /**
  4608. * Simple bind polyfill for environments that do not support it,
  4609. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4610. * since native bind is now performant enough in most browsers.
  4611. * But removing it would mean breaking code that was able to run in
  4612. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4613. */
  4614. /* istanbul ignore next */
  4615. function polyfillBind (fn, ctx) {
  4616. function boundFn (a) {
  4617. var l = arguments.length;
  4618. return l
  4619. ? l > 1
  4620. ? fn.apply(ctx, arguments)
  4621. : fn.call(ctx, a)
  4622. : fn.call(ctx)
  4623. }
  4624. boundFn._length = fn.length;
  4625. return boundFn
  4626. }
  4627. function nativeBind (fn, ctx) {
  4628. return fn.bind(ctx)
  4629. }
  4630. var bind = Function.prototype.bind
  4631. ? nativeBind
  4632. : polyfillBind;
  4633. /**
  4634. * Convert an Array-like object to a real Array.
  4635. */
  4636. function toArray (list, start) {
  4637. start = start || 0;
  4638. var i = list.length - start;
  4639. var ret = new Array(i);
  4640. while (i--) {
  4641. ret[i] = list[i + start];
  4642. }
  4643. return ret
  4644. }
  4645. /**
  4646. * Mix properties into target object.
  4647. */
  4648. function extend (to, _from) {
  4649. for (var key in _from) {
  4650. to[key] = _from[key];
  4651. }
  4652. return to
  4653. }
  4654. /**
  4655. * Merge an Array of Objects into a single Object.
  4656. */
  4657. function toObject (arr) {
  4658. var res = {};
  4659. for (var i = 0; i < arr.length; i++) {
  4660. if (arr[i]) {
  4661. extend(res, arr[i]);
  4662. }
  4663. }
  4664. return res
  4665. }
  4666. /* eslint-disable no-unused-vars */
  4667. /**
  4668. * Perform no operation.
  4669. * Stubbing args to make Flow happy without leaving useless transpiled code
  4670. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4671. */
  4672. function noop (a, b, c) {}
  4673. /**
  4674. * Always return false.
  4675. */
  4676. var no = function (a, b, c) { return false; };
  4677. /* eslint-enable no-unused-vars */
  4678. /**
  4679. * Return the same value.
  4680. */
  4681. var identity = function (_) { return _; };
  4682. /**
  4683. * Check if two values are loosely equal - that is,
  4684. * if they are plain objects, do they have the same shape?
  4685. */
  4686. function looseEqual (a, b) {
  4687. if (a === b) { return true }
  4688. var isObjectA = isObject(a);
  4689. var isObjectB = isObject(b);
  4690. if (isObjectA && isObjectB) {
  4691. try {
  4692. var isArrayA = Array.isArray(a);
  4693. var isArrayB = Array.isArray(b);
  4694. if (isArrayA && isArrayB) {
  4695. return a.length === b.length && a.every(function (e, i) {
  4696. return looseEqual(e, b[i])
  4697. })
  4698. } else if (a instanceof Date && b instanceof Date) {
  4699. return a.getTime() === b.getTime()
  4700. } else if (!isArrayA && !isArrayB) {
  4701. var keysA = Object.keys(a);
  4702. var keysB = Object.keys(b);
  4703. return keysA.length === keysB.length && keysA.every(function (key) {
  4704. return looseEqual(a[key], b[key])
  4705. })
  4706. } else {
  4707. /* istanbul ignore next */
  4708. return false
  4709. }
  4710. } catch (e) {
  4711. /* istanbul ignore next */
  4712. return false
  4713. }
  4714. } else if (!isObjectA && !isObjectB) {
  4715. return String(a) === String(b)
  4716. } else {
  4717. return false
  4718. }
  4719. }
  4720. /**
  4721. * Return the first index at which a loosely equal value can be
  4722. * found in the array (if value is a plain object, the array must
  4723. * contain an object of the same shape), or -1 if it is not present.
  4724. */
  4725. function looseIndexOf (arr, val) {
  4726. for (var i = 0; i < arr.length; i++) {
  4727. if (looseEqual(arr[i], val)) { return i }
  4728. }
  4729. return -1
  4730. }
  4731. /**
  4732. * Ensure a function is called only once.
  4733. */
  4734. function once (fn) {
  4735. var called = false;
  4736. return function () {
  4737. if (!called) {
  4738. called = true;
  4739. fn.apply(this, arguments);
  4740. }
  4741. }
  4742. }
  4743. var ASSET_TYPES = [
  4744. 'component',
  4745. 'directive',
  4746. 'filter'
  4747. ];
  4748. var LIFECYCLE_HOOKS = [
  4749. 'beforeCreate',
  4750. 'created',
  4751. 'beforeMount',
  4752. 'mounted',
  4753. 'beforeUpdate',
  4754. 'updated',
  4755. 'beforeDestroy',
  4756. 'destroyed',
  4757. 'activated',
  4758. 'deactivated',
  4759. 'errorCaptured',
  4760. 'serverPrefetch'
  4761. ];
  4762. /* */
  4763. var config = ({
  4764. /**
  4765. * Option merge strategies (used in core/util/options)
  4766. */
  4767. // $flow-disable-line
  4768. optionMergeStrategies: Object.create(null),
  4769. /**
  4770. * Whether to suppress warnings.
  4771. */
  4772. silent: false,
  4773. /**
  4774. * Show production mode tip message on boot?
  4775. */
  4776. productionTip: "development" !== 'production',
  4777. /**
  4778. * Whether to enable devtools
  4779. */
  4780. devtools: "development" !== 'production',
  4781. /**
  4782. * Whether to record perf
  4783. */
  4784. performance: false,
  4785. /**
  4786. * Error handler for watcher errors
  4787. */
  4788. errorHandler: null,
  4789. /**
  4790. * Warn handler for watcher warns
  4791. */
  4792. warnHandler: null,
  4793. /**
  4794. * Ignore certain custom elements
  4795. */
  4796. ignoredElements: [],
  4797. /**
  4798. * Custom user key aliases for v-on
  4799. */
  4800. // $flow-disable-line
  4801. keyCodes: Object.create(null),
  4802. /**
  4803. * Check if a tag is reserved so that it cannot be registered as a
  4804. * component. This is platform-dependent and may be overwritten.
  4805. */
  4806. isReservedTag: no,
  4807. /**
  4808. * Check if an attribute is reserved so that it cannot be used as a component
  4809. * prop. This is platform-dependent and may be overwritten.
  4810. */
  4811. isReservedAttr: no,
  4812. /**
  4813. * Check if a tag is an unknown element.
  4814. * Platform-dependent.
  4815. */
  4816. isUnknownElement: no,
  4817. /**
  4818. * Get the namespace of an element
  4819. */
  4820. getTagNamespace: noop,
  4821. /**
  4822. * Parse the real tag name for the specific platform.
  4823. */
  4824. parsePlatformTagName: identity,
  4825. /**
  4826. * Check if an attribute must be bound using property, e.g. value
  4827. * Platform-dependent.
  4828. */
  4829. mustUseProp: no,
  4830. /**
  4831. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4832. * This will significantly reduce performance if set to false.
  4833. */
  4834. async: true,
  4835. /**
  4836. * Exposed for legacy reasons
  4837. */
  4838. _lifecycleHooks: LIFECYCLE_HOOKS
  4839. });
  4840. /* */
  4841. /**
  4842. * unicode letters used for parsing html tags, component names and property paths.
  4843. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4844. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4845. */
  4846. 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/;
  4847. /**
  4848. * Check if a string starts with $ or _
  4849. */
  4850. function isReserved (str) {
  4851. var c = (str + '').charCodeAt(0);
  4852. return c === 0x24 || c === 0x5F
  4853. }
  4854. /**
  4855. * Define a property.
  4856. */
  4857. function def (obj, key, val, enumerable) {
  4858. Object.defineProperty(obj, key, {
  4859. value: val,
  4860. enumerable: !!enumerable,
  4861. writable: true,
  4862. configurable: true
  4863. });
  4864. }
  4865. /**
  4866. * Parse simple path.
  4867. */
  4868. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4869. function parsePath (path) {
  4870. if (bailRE.test(path)) {
  4871. return
  4872. }
  4873. var segments = path.split('.');
  4874. return function (obj) {
  4875. for (var i = 0; i < segments.length; i++) {
  4876. if (!obj) { return }
  4877. obj = obj[segments[i]];
  4878. }
  4879. return obj
  4880. }
  4881. }
  4882. /* */
  4883. // can we use __proto__?
  4884. var hasProto = '__proto__' in {};
  4885. // Browser environment sniffing
  4886. var inBrowser = typeof window !== 'undefined';
  4887. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4888. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4889. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4890. var isIE = UA && /msie|trident/.test(UA);
  4891. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4892. var isEdge = UA && UA.indexOf('edge/') > 0;
  4893. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4894. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4895. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4896. var isPhantomJS = UA && /phantomjs/.test(UA);
  4897. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4898. // Firefox has a "watch" function on Object.prototype...
  4899. var nativeWatch = ({}).watch;
  4900. if (inBrowser) {
  4901. try {
  4902. var opts = {};
  4903. Object.defineProperty(opts, 'passive', ({
  4904. get: function get () {
  4905. }
  4906. })); // https://github.com/facebook/flow/issues/285
  4907. window.addEventListener('test-passive', null, opts);
  4908. } catch (e) {}
  4909. }
  4910. // this needs to be lazy-evaled because vue may be required before
  4911. // vue-server-renderer can set VUE_ENV
  4912. var _isServer;
  4913. var isServerRendering = function () {
  4914. if (_isServer === undefined) {
  4915. /* istanbul ignore if */
  4916. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4917. // detect presence of vue-server-renderer and avoid
  4918. // Webpack shimming the process
  4919. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4920. } else {
  4921. _isServer = false;
  4922. }
  4923. }
  4924. return _isServer
  4925. };
  4926. // detect devtools
  4927. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4928. /* istanbul ignore next */
  4929. function isNative (Ctor) {
  4930. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4931. }
  4932. var hasSymbol =
  4933. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4934. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4935. var _Set;
  4936. /* istanbul ignore if */ // $flow-disable-line
  4937. if (typeof Set !== 'undefined' && isNative(Set)) {
  4938. // use native Set when available.
  4939. _Set = Set;
  4940. } else {
  4941. // a non-standard Set polyfill that only works with primitive keys.
  4942. _Set = /*@__PURE__*/(function () {
  4943. function Set () {
  4944. this.set = Object.create(null);
  4945. }
  4946. Set.prototype.has = function has (key) {
  4947. return this.set[key] === true
  4948. };
  4949. Set.prototype.add = function add (key) {
  4950. this.set[key] = true;
  4951. };
  4952. Set.prototype.clear = function clear () {
  4953. this.set = Object.create(null);
  4954. };
  4955. return Set;
  4956. }());
  4957. }
  4958. /* */
  4959. var warn = noop;
  4960. var tip = noop;
  4961. var generateComponentTrace = (noop); // work around flow check
  4962. var formatComponentName = (noop);
  4963. if (true) {
  4964. var hasConsole = typeof console !== 'undefined';
  4965. var classifyRE = /(?:^|[-_])(\w)/g;
  4966. var classify = function (str) { return str
  4967. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4968. .replace(/[-_]/g, ''); };
  4969. warn = function (msg, vm) {
  4970. var trace = vm ? generateComponentTrace(vm) : '';
  4971. if (config.warnHandler) {
  4972. config.warnHandler.call(null, msg, vm, trace);
  4973. } else if (hasConsole && (!config.silent)) {
  4974. console.error(("[Vue warn]: " + msg + trace));
  4975. }
  4976. };
  4977. tip = function (msg, vm) {
  4978. if (hasConsole && (!config.silent)) {
  4979. console.warn("[Vue tip]: " + msg + (
  4980. vm ? generateComponentTrace(vm) : ''
  4981. ));
  4982. }
  4983. };
  4984. formatComponentName = function (vm, includeFile) {
  4985. if (vm.$root === vm) {
  4986. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4987. return ('') + vm.$options.__file
  4988. }
  4989. return '<Root>'
  4990. }
  4991. var options = typeof vm === 'function' && vm.cid != null
  4992. ? vm.options
  4993. : vm._isVue
  4994. ? vm.$options || vm.constructor.options
  4995. : vm;
  4996. var name = options.name || options._componentTag;
  4997. var file = options.__file;
  4998. if (!name && file) {
  4999. var match = file.match(/([^/\\]+)\.vue$/);
  5000. name = match && match[1];
  5001. }
  5002. return (
  5003. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  5004. (file && includeFile !== false ? (" at " + file) : '')
  5005. )
  5006. };
  5007. var repeat = function (str, n) {
  5008. var res = '';
  5009. while (n) {
  5010. if (n % 2 === 1) { res += str; }
  5011. if (n > 1) { str += str; }
  5012. n >>= 1;
  5013. }
  5014. return res
  5015. };
  5016. generateComponentTrace = function (vm) {
  5017. if (vm._isVue && vm.$parent) {
  5018. var tree = [];
  5019. var currentRecursiveSequence = 0;
  5020. while (vm && vm.$options.name !== 'PageBody') {
  5021. if (tree.length > 0) {
  5022. var last = tree[tree.length - 1];
  5023. if (last.constructor === vm.constructor) {
  5024. currentRecursiveSequence++;
  5025. vm = vm.$parent;
  5026. continue
  5027. } else if (currentRecursiveSequence > 0) {
  5028. tree[tree.length - 1] = [last, currentRecursiveSequence];
  5029. currentRecursiveSequence = 0;
  5030. }
  5031. }
  5032. !vm.$options.isReserved && tree.push(vm);
  5033. vm = vm.$parent;
  5034. }
  5035. return '\n\nfound in\n\n' + tree
  5036. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  5037. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  5038. : formatComponentName(vm))); })
  5039. .join('\n')
  5040. } else {
  5041. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  5042. }
  5043. };
  5044. }
  5045. /* */
  5046. var uid = 0;
  5047. /**
  5048. * A dep is an observable that can have multiple
  5049. * directives subscribing to it.
  5050. */
  5051. var Dep = function Dep () {
  5052. this.id = uid++;
  5053. this.subs = [];
  5054. };
  5055. Dep.prototype.addSub = function addSub (sub) {
  5056. this.subs.push(sub);
  5057. };
  5058. Dep.prototype.removeSub = function removeSub (sub) {
  5059. remove(this.subs, sub);
  5060. };
  5061. Dep.prototype.depend = function depend () {
  5062. if (Dep.SharedObject.target) {
  5063. Dep.SharedObject.target.addDep(this);
  5064. }
  5065. };
  5066. Dep.prototype.notify = function notify () {
  5067. // stabilize the subscriber list first
  5068. var subs = this.subs.slice();
  5069. if ( true && !config.async) {
  5070. // subs aren't sorted in scheduler if not running async
  5071. // we need to sort them now to make sure they fire in correct
  5072. // order
  5073. subs.sort(function (a, b) { return a.id - b.id; });
  5074. }
  5075. for (var i = 0, l = subs.length; i < l; i++) {
  5076. subs[i].update();
  5077. }
  5078. };
  5079. // The current target watcher being evaluated.
  5080. // This is globally unique because only one watcher
  5081. // can be evaluated at a time.
  5082. // fixed by xxxxxx (nvue shared vuex)
  5083. /* eslint-disable no-undef */
  5084. Dep.SharedObject = {};
  5085. Dep.SharedObject.target = null;
  5086. Dep.SharedObject.targetStack = [];
  5087. function pushTarget (target) {
  5088. Dep.SharedObject.targetStack.push(target);
  5089. Dep.SharedObject.target = target;
  5090. Dep.target = target;
  5091. }
  5092. function popTarget () {
  5093. Dep.SharedObject.targetStack.pop();
  5094. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  5095. Dep.target = Dep.SharedObject.target;
  5096. }
  5097. /* */
  5098. var VNode = function VNode (
  5099. tag,
  5100. data,
  5101. children,
  5102. text,
  5103. elm,
  5104. context,
  5105. componentOptions,
  5106. asyncFactory
  5107. ) {
  5108. this.tag = tag;
  5109. this.data = data;
  5110. this.children = children;
  5111. this.text = text;
  5112. this.elm = elm;
  5113. this.ns = undefined;
  5114. this.context = context;
  5115. this.fnContext = undefined;
  5116. this.fnOptions = undefined;
  5117. this.fnScopeId = undefined;
  5118. this.key = data && data.key;
  5119. this.componentOptions = componentOptions;
  5120. this.componentInstance = undefined;
  5121. this.parent = undefined;
  5122. this.raw = false;
  5123. this.isStatic = false;
  5124. this.isRootInsert = true;
  5125. this.isComment = false;
  5126. this.isCloned = false;
  5127. this.isOnce = false;
  5128. this.asyncFactory = asyncFactory;
  5129. this.asyncMeta = undefined;
  5130. this.isAsyncPlaceholder = false;
  5131. };
  5132. var prototypeAccessors = { child: { configurable: true } };
  5133. // DEPRECATED: alias for componentInstance for backwards compat.
  5134. /* istanbul ignore next */
  5135. prototypeAccessors.child.get = function () {
  5136. return this.componentInstance
  5137. };
  5138. Object.defineProperties( VNode.prototype, prototypeAccessors );
  5139. var createEmptyVNode = function (text) {
  5140. if ( text === void 0 ) text = '';
  5141. var node = new VNode();
  5142. node.text = text;
  5143. node.isComment = true;
  5144. return node
  5145. };
  5146. function createTextVNode (val) {
  5147. return new VNode(undefined, undefined, undefined, String(val))
  5148. }
  5149. // optimized shallow clone
  5150. // used for static nodes and slot nodes because they may be reused across
  5151. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5152. // on their elm reference.
  5153. function cloneVNode (vnode) {
  5154. var cloned = new VNode(
  5155. vnode.tag,
  5156. vnode.data,
  5157. // #7975
  5158. // clone children array to avoid mutating original in case of cloning
  5159. // a child.
  5160. vnode.children && vnode.children.slice(),
  5161. vnode.text,
  5162. vnode.elm,
  5163. vnode.context,
  5164. vnode.componentOptions,
  5165. vnode.asyncFactory
  5166. );
  5167. cloned.ns = vnode.ns;
  5168. cloned.isStatic = vnode.isStatic;
  5169. cloned.key = vnode.key;
  5170. cloned.isComment = vnode.isComment;
  5171. cloned.fnContext = vnode.fnContext;
  5172. cloned.fnOptions = vnode.fnOptions;
  5173. cloned.fnScopeId = vnode.fnScopeId;
  5174. cloned.asyncMeta = vnode.asyncMeta;
  5175. cloned.isCloned = true;
  5176. return cloned
  5177. }
  5178. /*
  5179. * not type checking this file because flow doesn't play well with
  5180. * dynamically accessing methods on Array prototype
  5181. */
  5182. var arrayProto = Array.prototype;
  5183. var arrayMethods = Object.create(arrayProto);
  5184. var methodsToPatch = [
  5185. 'push',
  5186. 'pop',
  5187. 'shift',
  5188. 'unshift',
  5189. 'splice',
  5190. 'sort',
  5191. 'reverse'
  5192. ];
  5193. /**
  5194. * Intercept mutating methods and emit events
  5195. */
  5196. methodsToPatch.forEach(function (method) {
  5197. // cache original method
  5198. var original = arrayProto[method];
  5199. def(arrayMethods, method, function mutator () {
  5200. var args = [], len = arguments.length;
  5201. while ( len-- ) args[ len ] = arguments[ len ];
  5202. var result = original.apply(this, args);
  5203. var ob = this.__ob__;
  5204. var inserted;
  5205. switch (method) {
  5206. case 'push':
  5207. case 'unshift':
  5208. inserted = args;
  5209. break
  5210. case 'splice':
  5211. inserted = args.slice(2);
  5212. break
  5213. }
  5214. if (inserted) { ob.observeArray(inserted); }
  5215. // notify change
  5216. ob.dep.notify();
  5217. return result
  5218. });
  5219. });
  5220. /* */
  5221. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  5222. /**
  5223. * In some cases we may want to disable observation inside a component's
  5224. * update computation.
  5225. */
  5226. var shouldObserve = true;
  5227. function toggleObserving (value) {
  5228. shouldObserve = value;
  5229. }
  5230. /**
  5231. * Observer class that is attached to each observed
  5232. * object. Once attached, the observer converts the target
  5233. * object's property keys into getter/setters that
  5234. * collect dependencies and dispatch updates.
  5235. */
  5236. var Observer = function Observer (value) {
  5237. this.value = value;
  5238. this.dep = new Dep();
  5239. this.vmCount = 0;
  5240. def(value, '__ob__', this);
  5241. if (Array.isArray(value)) {
  5242. if (hasProto) {
  5243. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  5244. if(value.push !== value.__proto__.push){
  5245. copyAugment(value, arrayMethods, arrayKeys);
  5246. } else {
  5247. protoAugment(value, arrayMethods);
  5248. }
  5249. }
  5250. } else {
  5251. copyAugment(value, arrayMethods, arrayKeys);
  5252. }
  5253. this.observeArray(value);
  5254. } else {
  5255. this.walk(value);
  5256. }
  5257. };
  5258. /**
  5259. * Walk through all properties and convert them into
  5260. * getter/setters. This method should only be called when
  5261. * value type is Object.
  5262. */
  5263. Observer.prototype.walk = function walk (obj) {
  5264. var keys = Object.keys(obj);
  5265. for (var i = 0; i < keys.length; i++) {
  5266. defineReactive$$1(obj, keys[i]);
  5267. }
  5268. };
  5269. /**
  5270. * Observe a list of Array items.
  5271. */
  5272. Observer.prototype.observeArray = function observeArray (items) {
  5273. for (var i = 0, l = items.length; i < l; i++) {
  5274. observe(items[i]);
  5275. }
  5276. };
  5277. // helpers
  5278. /**
  5279. * Augment a target Object or Array by intercepting
  5280. * the prototype chain using __proto__
  5281. */
  5282. function protoAugment (target, src) {
  5283. /* eslint-disable no-proto */
  5284. target.__proto__ = src;
  5285. /* eslint-enable no-proto */
  5286. }
  5287. /**
  5288. * Augment a target Object or Array by defining
  5289. * hidden properties.
  5290. */
  5291. /* istanbul ignore next */
  5292. function copyAugment (target, src, keys) {
  5293. for (var i = 0, l = keys.length; i < l; i++) {
  5294. var key = keys[i];
  5295. def(target, key, src[key]);
  5296. }
  5297. }
  5298. /**
  5299. * Attempt to create an observer instance for a value,
  5300. * returns the new observer if successfully observed,
  5301. * or the existing observer if the value already has one.
  5302. */
  5303. function observe (value, asRootData) {
  5304. if (!isObject(value) || value instanceof VNode) {
  5305. return
  5306. }
  5307. var ob;
  5308. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  5309. ob = value.__ob__;
  5310. } else if (
  5311. shouldObserve &&
  5312. !isServerRendering() &&
  5313. (Array.isArray(value) || isPlainObject(value)) &&
  5314. Object.isExtensible(value) &&
  5315. !value._isVue &&
  5316. !value.__v_isMPComponent
  5317. ) {
  5318. ob = new Observer(value);
  5319. }
  5320. if (asRootData && ob) {
  5321. ob.vmCount++;
  5322. }
  5323. return ob
  5324. }
  5325. /**
  5326. * Define a reactive property on an Object.
  5327. */
  5328. function defineReactive$$1 (
  5329. obj,
  5330. key,
  5331. val,
  5332. customSetter,
  5333. shallow
  5334. ) {
  5335. var dep = new Dep();
  5336. var property = Object.getOwnPropertyDescriptor(obj, key);
  5337. if (property && property.configurable === false) {
  5338. return
  5339. }
  5340. // cater for pre-defined getter/setters
  5341. var getter = property && property.get;
  5342. var setter = property && property.set;
  5343. if ((!getter || setter) && arguments.length === 2) {
  5344. val = obj[key];
  5345. }
  5346. var childOb = !shallow && observe(val);
  5347. Object.defineProperty(obj, key, {
  5348. enumerable: true,
  5349. configurable: true,
  5350. get: function reactiveGetter () {
  5351. var value = getter ? getter.call(obj) : val;
  5352. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5353. dep.depend();
  5354. if (childOb) {
  5355. childOb.dep.depend();
  5356. if (Array.isArray(value)) {
  5357. dependArray(value);
  5358. }
  5359. }
  5360. }
  5361. return value
  5362. },
  5363. set: function reactiveSetter (newVal) {
  5364. var value = getter ? getter.call(obj) : val;
  5365. /* eslint-disable no-self-compare */
  5366. if (newVal === value || (newVal !== newVal && value !== value)) {
  5367. return
  5368. }
  5369. /* eslint-enable no-self-compare */
  5370. if ( true && customSetter) {
  5371. customSetter();
  5372. }
  5373. // #7981: for accessor properties without setter
  5374. if (getter && !setter) { return }
  5375. if (setter) {
  5376. setter.call(obj, newVal);
  5377. } else {
  5378. val = newVal;
  5379. }
  5380. childOb = !shallow && observe(newVal);
  5381. dep.notify();
  5382. }
  5383. });
  5384. }
  5385. /**
  5386. * Set a property on an object. Adds the new property and
  5387. * triggers change notification if the property doesn't
  5388. * already exist.
  5389. */
  5390. function set (target, key, val) {
  5391. if ( true &&
  5392. (isUndef(target) || isPrimitive(target))
  5393. ) {
  5394. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5395. }
  5396. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5397. target.length = Math.max(target.length, key);
  5398. target.splice(key, 1, val);
  5399. return val
  5400. }
  5401. if (key in target && !(key in Object.prototype)) {
  5402. target[key] = val;
  5403. return val
  5404. }
  5405. var ob = (target).__ob__;
  5406. if (target._isVue || (ob && ob.vmCount)) {
  5407. true && warn(
  5408. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5409. 'at runtime - declare it upfront in the data option.'
  5410. );
  5411. return val
  5412. }
  5413. if (!ob) {
  5414. target[key] = val;
  5415. return val
  5416. }
  5417. defineReactive$$1(ob.value, key, val);
  5418. ob.dep.notify();
  5419. return val
  5420. }
  5421. /**
  5422. * Delete a property and trigger change if necessary.
  5423. */
  5424. function del (target, key) {
  5425. if ( true &&
  5426. (isUndef(target) || isPrimitive(target))
  5427. ) {
  5428. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5429. }
  5430. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5431. target.splice(key, 1);
  5432. return
  5433. }
  5434. var ob = (target).__ob__;
  5435. if (target._isVue || (ob && ob.vmCount)) {
  5436. true && warn(
  5437. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5438. '- just set it to null.'
  5439. );
  5440. return
  5441. }
  5442. if (!hasOwn(target, key)) {
  5443. return
  5444. }
  5445. delete target[key];
  5446. if (!ob) {
  5447. return
  5448. }
  5449. ob.dep.notify();
  5450. }
  5451. /**
  5452. * Collect dependencies on array elements when the array is touched, since
  5453. * we cannot intercept array element access like property getters.
  5454. */
  5455. function dependArray (value) {
  5456. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5457. e = value[i];
  5458. e && e.__ob__ && e.__ob__.dep.depend();
  5459. if (Array.isArray(e)) {
  5460. dependArray(e);
  5461. }
  5462. }
  5463. }
  5464. /* */
  5465. /**
  5466. * Option overwriting strategies are functions that handle
  5467. * how to merge a parent option value and a child option
  5468. * value into the final value.
  5469. */
  5470. var strats = config.optionMergeStrategies;
  5471. /**
  5472. * Options with restrictions
  5473. */
  5474. if (true) {
  5475. strats.el = strats.propsData = function (parent, child, vm, key) {
  5476. if (!vm) {
  5477. warn(
  5478. "option \"" + key + "\" can only be used during instance " +
  5479. 'creation with the `new` keyword.'
  5480. );
  5481. }
  5482. return defaultStrat(parent, child)
  5483. };
  5484. }
  5485. /**
  5486. * Helper that recursively merges two data objects together.
  5487. */
  5488. function mergeData (to, from) {
  5489. if (!from) { return to }
  5490. var key, toVal, fromVal;
  5491. var keys = hasSymbol
  5492. ? Reflect.ownKeys(from)
  5493. : Object.keys(from);
  5494. for (var i = 0; i < keys.length; i++) {
  5495. key = keys[i];
  5496. // in case the object is already observed...
  5497. if (key === '__ob__') { continue }
  5498. toVal = to[key];
  5499. fromVal = from[key];
  5500. if (!hasOwn(to, key)) {
  5501. set(to, key, fromVal);
  5502. } else if (
  5503. toVal !== fromVal &&
  5504. isPlainObject(toVal) &&
  5505. isPlainObject(fromVal)
  5506. ) {
  5507. mergeData(toVal, fromVal);
  5508. }
  5509. }
  5510. return to
  5511. }
  5512. /**
  5513. * Data
  5514. */
  5515. function mergeDataOrFn (
  5516. parentVal,
  5517. childVal,
  5518. vm
  5519. ) {
  5520. if (!vm) {
  5521. // in a Vue.extend merge, both should be functions
  5522. if (!childVal) {
  5523. return parentVal
  5524. }
  5525. if (!parentVal) {
  5526. return childVal
  5527. }
  5528. // when parentVal & childVal are both present,
  5529. // we need to return a function that returns the
  5530. // merged result of both functions... no need to
  5531. // check if parentVal is a function here because
  5532. // it has to be a function to pass previous merges.
  5533. return function mergedDataFn () {
  5534. return mergeData(
  5535. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5536. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5537. )
  5538. }
  5539. } else {
  5540. return function mergedInstanceDataFn () {
  5541. // instance merge
  5542. var instanceData = typeof childVal === 'function'
  5543. ? childVal.call(vm, vm)
  5544. : childVal;
  5545. var defaultData = typeof parentVal === 'function'
  5546. ? parentVal.call(vm, vm)
  5547. : parentVal;
  5548. if (instanceData) {
  5549. return mergeData(instanceData, defaultData)
  5550. } else {
  5551. return defaultData
  5552. }
  5553. }
  5554. }
  5555. }
  5556. strats.data = function (
  5557. parentVal,
  5558. childVal,
  5559. vm
  5560. ) {
  5561. if (!vm) {
  5562. if (childVal && typeof childVal !== 'function') {
  5563. true && warn(
  5564. 'The "data" option should be a function ' +
  5565. 'that returns a per-instance value in component ' +
  5566. 'definitions.',
  5567. vm
  5568. );
  5569. return parentVal
  5570. }
  5571. return mergeDataOrFn(parentVal, childVal)
  5572. }
  5573. return mergeDataOrFn(parentVal, childVal, vm)
  5574. };
  5575. /**
  5576. * Hooks and props are merged as arrays.
  5577. */
  5578. function mergeHook (
  5579. parentVal,
  5580. childVal
  5581. ) {
  5582. var res = childVal
  5583. ? parentVal
  5584. ? parentVal.concat(childVal)
  5585. : Array.isArray(childVal)
  5586. ? childVal
  5587. : [childVal]
  5588. : parentVal;
  5589. return res
  5590. ? dedupeHooks(res)
  5591. : res
  5592. }
  5593. function dedupeHooks (hooks) {
  5594. var res = [];
  5595. for (var i = 0; i < hooks.length; i++) {
  5596. if (res.indexOf(hooks[i]) === -1) {
  5597. res.push(hooks[i]);
  5598. }
  5599. }
  5600. return res
  5601. }
  5602. LIFECYCLE_HOOKS.forEach(function (hook) {
  5603. strats[hook] = mergeHook;
  5604. });
  5605. /**
  5606. * Assets
  5607. *
  5608. * When a vm is present (instance creation), we need to do
  5609. * a three-way merge between constructor options, instance
  5610. * options and parent options.
  5611. */
  5612. function mergeAssets (
  5613. parentVal,
  5614. childVal,
  5615. vm,
  5616. key
  5617. ) {
  5618. var res = Object.create(parentVal || null);
  5619. if (childVal) {
  5620. true && assertObjectType(key, childVal, vm);
  5621. return extend(res, childVal)
  5622. } else {
  5623. return res
  5624. }
  5625. }
  5626. ASSET_TYPES.forEach(function (type) {
  5627. strats[type + 's'] = mergeAssets;
  5628. });
  5629. /**
  5630. * Watchers.
  5631. *
  5632. * Watchers hashes should not overwrite one
  5633. * another, so we merge them as arrays.
  5634. */
  5635. strats.watch = function (
  5636. parentVal,
  5637. childVal,
  5638. vm,
  5639. key
  5640. ) {
  5641. // work around Firefox's Object.prototype.watch...
  5642. if (parentVal === nativeWatch) { parentVal = undefined; }
  5643. if (childVal === nativeWatch) { childVal = undefined; }
  5644. /* istanbul ignore if */
  5645. if (!childVal) { return Object.create(parentVal || null) }
  5646. if (true) {
  5647. assertObjectType(key, childVal, vm);
  5648. }
  5649. if (!parentVal) { return childVal }
  5650. var ret = {};
  5651. extend(ret, parentVal);
  5652. for (var key$1 in childVal) {
  5653. var parent = ret[key$1];
  5654. var child = childVal[key$1];
  5655. if (parent && !Array.isArray(parent)) {
  5656. parent = [parent];
  5657. }
  5658. ret[key$1] = parent
  5659. ? parent.concat(child)
  5660. : Array.isArray(child) ? child : [child];
  5661. }
  5662. return ret
  5663. };
  5664. /**
  5665. * Other object hashes.
  5666. */
  5667. strats.props =
  5668. strats.methods =
  5669. strats.inject =
  5670. strats.computed = function (
  5671. parentVal,
  5672. childVal,
  5673. vm,
  5674. key
  5675. ) {
  5676. if (childVal && "development" !== 'production') {
  5677. assertObjectType(key, childVal, vm);
  5678. }
  5679. if (!parentVal) { return childVal }
  5680. var ret = Object.create(null);
  5681. extend(ret, parentVal);
  5682. if (childVal) { extend(ret, childVal); }
  5683. return ret
  5684. };
  5685. strats.provide = mergeDataOrFn;
  5686. /**
  5687. * Default strategy.
  5688. */
  5689. var defaultStrat = function (parentVal, childVal) {
  5690. return childVal === undefined
  5691. ? parentVal
  5692. : childVal
  5693. };
  5694. /**
  5695. * Validate component names
  5696. */
  5697. function checkComponents (options) {
  5698. for (var key in options.components) {
  5699. validateComponentName(key);
  5700. }
  5701. }
  5702. function validateComponentName (name) {
  5703. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5704. warn(
  5705. 'Invalid component name: "' + name + '". Component names ' +
  5706. 'should conform to valid custom element name in html5 specification.'
  5707. );
  5708. }
  5709. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5710. warn(
  5711. 'Do not use built-in or reserved HTML elements as component ' +
  5712. 'id: ' + name
  5713. );
  5714. }
  5715. }
  5716. /**
  5717. * Ensure all props option syntax are normalized into the
  5718. * Object-based format.
  5719. */
  5720. function normalizeProps (options, vm) {
  5721. var props = options.props;
  5722. if (!props) { return }
  5723. var res = {};
  5724. var i, val, name;
  5725. if (Array.isArray(props)) {
  5726. i = props.length;
  5727. while (i--) {
  5728. val = props[i];
  5729. if (typeof val === 'string') {
  5730. name = camelize(val);
  5731. res[name] = { type: null };
  5732. } else if (true) {
  5733. warn('props must be strings when using array syntax.');
  5734. }
  5735. }
  5736. } else if (isPlainObject(props)) {
  5737. for (var key in props) {
  5738. val = props[key];
  5739. name = camelize(key);
  5740. res[name] = isPlainObject(val)
  5741. ? val
  5742. : { type: val };
  5743. }
  5744. } else if (true) {
  5745. warn(
  5746. "Invalid value for option \"props\": expected an Array or an Object, " +
  5747. "but got " + (toRawType(props)) + ".",
  5748. vm
  5749. );
  5750. }
  5751. options.props = res;
  5752. }
  5753. /**
  5754. * Normalize all injections into Object-based format
  5755. */
  5756. function normalizeInject (options, vm) {
  5757. var inject = options.inject;
  5758. if (!inject) { return }
  5759. var normalized = options.inject = {};
  5760. if (Array.isArray(inject)) {
  5761. for (var i = 0; i < inject.length; i++) {
  5762. normalized[inject[i]] = { from: inject[i] };
  5763. }
  5764. } else if (isPlainObject(inject)) {
  5765. for (var key in inject) {
  5766. var val = inject[key];
  5767. normalized[key] = isPlainObject(val)
  5768. ? extend({ from: key }, val)
  5769. : { from: val };
  5770. }
  5771. } else if (true) {
  5772. warn(
  5773. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5774. "but got " + (toRawType(inject)) + ".",
  5775. vm
  5776. );
  5777. }
  5778. }
  5779. /**
  5780. * Normalize raw function directives into object format.
  5781. */
  5782. function normalizeDirectives (options) {
  5783. var dirs = options.directives;
  5784. if (dirs) {
  5785. for (var key in dirs) {
  5786. var def$$1 = dirs[key];
  5787. if (typeof def$$1 === 'function') {
  5788. dirs[key] = { bind: def$$1, update: def$$1 };
  5789. }
  5790. }
  5791. }
  5792. }
  5793. function assertObjectType (name, value, vm) {
  5794. if (!isPlainObject(value)) {
  5795. warn(
  5796. "Invalid value for option \"" + name + "\": expected an Object, " +
  5797. "but got " + (toRawType(value)) + ".",
  5798. vm
  5799. );
  5800. }
  5801. }
  5802. /**
  5803. * Merge two option objects into a new one.
  5804. * Core utility used in both instantiation and inheritance.
  5805. */
  5806. function mergeOptions (
  5807. parent,
  5808. child,
  5809. vm
  5810. ) {
  5811. if (true) {
  5812. checkComponents(child);
  5813. }
  5814. if (typeof child === 'function') {
  5815. child = child.options;
  5816. }
  5817. normalizeProps(child, vm);
  5818. normalizeInject(child, vm);
  5819. normalizeDirectives(child);
  5820. // Apply extends and mixins on the child options,
  5821. // but only if it is a raw options object that isn't
  5822. // the result of another mergeOptions call.
  5823. // Only merged options has the _base property.
  5824. if (!child._base) {
  5825. if (child.extends) {
  5826. parent = mergeOptions(parent, child.extends, vm);
  5827. }
  5828. if (child.mixins) {
  5829. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5830. parent = mergeOptions(parent, child.mixins[i], vm);
  5831. }
  5832. }
  5833. }
  5834. var options = {};
  5835. var key;
  5836. for (key in parent) {
  5837. mergeField(key);
  5838. }
  5839. for (key in child) {
  5840. if (!hasOwn(parent, key)) {
  5841. mergeField(key);
  5842. }
  5843. }
  5844. function mergeField (key) {
  5845. var strat = strats[key] || defaultStrat;
  5846. options[key] = strat(parent[key], child[key], vm, key);
  5847. }
  5848. return options
  5849. }
  5850. /**
  5851. * Resolve an asset.
  5852. * This function is used because child instances need access
  5853. * to assets defined in its ancestor chain.
  5854. */
  5855. function resolveAsset (
  5856. options,
  5857. type,
  5858. id,
  5859. warnMissing
  5860. ) {
  5861. /* istanbul ignore if */
  5862. if (typeof id !== 'string') {
  5863. return
  5864. }
  5865. var assets = options[type];
  5866. // check local registration variations first
  5867. if (hasOwn(assets, id)) { return assets[id] }
  5868. var camelizedId = camelize(id);
  5869. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5870. var PascalCaseId = capitalize(camelizedId);
  5871. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5872. // fallback to prototype chain
  5873. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5874. if ( true && warnMissing && !res) {
  5875. warn(
  5876. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5877. options
  5878. );
  5879. }
  5880. return res
  5881. }
  5882. /* */
  5883. function validateProp (
  5884. key,
  5885. propOptions,
  5886. propsData,
  5887. vm
  5888. ) {
  5889. var prop = propOptions[key];
  5890. var absent = !hasOwn(propsData, key);
  5891. var value = propsData[key];
  5892. // boolean casting
  5893. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5894. if (booleanIndex > -1) {
  5895. if (absent && !hasOwn(prop, 'default')) {
  5896. value = false;
  5897. } else if (value === '' || value === hyphenate(key)) {
  5898. // only cast empty string / same name to boolean if
  5899. // boolean has higher priority
  5900. var stringIndex = getTypeIndex(String, prop.type);
  5901. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5902. value = true;
  5903. }
  5904. }
  5905. }
  5906. // check default value
  5907. if (value === undefined) {
  5908. value = getPropDefaultValue(vm, prop, key);
  5909. // since the default value is a fresh copy,
  5910. // make sure to observe it.
  5911. var prevShouldObserve = shouldObserve;
  5912. toggleObserving(true);
  5913. observe(value);
  5914. toggleObserving(prevShouldObserve);
  5915. }
  5916. if (
  5917. true
  5918. ) {
  5919. assertProp(prop, key, value, vm, absent);
  5920. }
  5921. return value
  5922. }
  5923. /**
  5924. * Get the default value of a prop.
  5925. */
  5926. function getPropDefaultValue (vm, prop, key) {
  5927. // no default, return undefined
  5928. if (!hasOwn(prop, 'default')) {
  5929. return undefined
  5930. }
  5931. var def = prop.default;
  5932. // warn against non-factory defaults for Object & Array
  5933. if ( true && isObject(def)) {
  5934. warn(
  5935. 'Invalid default value for prop "' + key + '": ' +
  5936. 'Props with type Object/Array must use a factory function ' +
  5937. 'to return the default value.',
  5938. vm
  5939. );
  5940. }
  5941. // the raw prop value was also undefined from previous render,
  5942. // return previous default value to avoid unnecessary watcher trigger
  5943. if (vm && vm.$options.propsData &&
  5944. vm.$options.propsData[key] === undefined &&
  5945. vm._props[key] !== undefined
  5946. ) {
  5947. return vm._props[key]
  5948. }
  5949. // call factory function for non-Function types
  5950. // a value is Function if its prototype is function even across different execution context
  5951. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5952. ? def.call(vm)
  5953. : def
  5954. }
  5955. /**
  5956. * Assert whether a prop is valid.
  5957. */
  5958. function assertProp (
  5959. prop,
  5960. name,
  5961. value,
  5962. vm,
  5963. absent
  5964. ) {
  5965. if (prop.required && absent) {
  5966. warn(
  5967. 'Missing required prop: "' + name + '"',
  5968. vm
  5969. );
  5970. return
  5971. }
  5972. if (value == null && !prop.required) {
  5973. return
  5974. }
  5975. var type = prop.type;
  5976. var valid = !type || type === true;
  5977. var expectedTypes = [];
  5978. if (type) {
  5979. if (!Array.isArray(type)) {
  5980. type = [type];
  5981. }
  5982. for (var i = 0; i < type.length && !valid; i++) {
  5983. var assertedType = assertType(value, type[i]);
  5984. expectedTypes.push(assertedType.expectedType || '');
  5985. valid = assertedType.valid;
  5986. }
  5987. }
  5988. if (!valid) {
  5989. warn(
  5990. getInvalidTypeMessage(name, value, expectedTypes),
  5991. vm
  5992. );
  5993. return
  5994. }
  5995. var validator = prop.validator;
  5996. if (validator) {
  5997. if (!validator(value)) {
  5998. warn(
  5999. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  6000. vm
  6001. );
  6002. }
  6003. }
  6004. }
  6005. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  6006. function assertType (value, type) {
  6007. var valid;
  6008. var expectedType = getType(type);
  6009. if (simpleCheckRE.test(expectedType)) {
  6010. var t = typeof value;
  6011. valid = t === expectedType.toLowerCase();
  6012. // for primitive wrapper objects
  6013. if (!valid && t === 'object') {
  6014. valid = value instanceof type;
  6015. }
  6016. } else if (expectedType === 'Object') {
  6017. valid = isPlainObject(value);
  6018. } else if (expectedType === 'Array') {
  6019. valid = Array.isArray(value);
  6020. } else {
  6021. valid = value instanceof type;
  6022. }
  6023. return {
  6024. valid: valid,
  6025. expectedType: expectedType
  6026. }
  6027. }
  6028. /**
  6029. * Use function string name to check built-in types,
  6030. * because a simple equality check will fail when running
  6031. * across different vms / iframes.
  6032. */
  6033. function getType (fn) {
  6034. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  6035. return match ? match[1] : ''
  6036. }
  6037. function isSameType (a, b) {
  6038. return getType(a) === getType(b)
  6039. }
  6040. function getTypeIndex (type, expectedTypes) {
  6041. if (!Array.isArray(expectedTypes)) {
  6042. return isSameType(expectedTypes, type) ? 0 : -1
  6043. }
  6044. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  6045. if (isSameType(expectedTypes[i], type)) {
  6046. return i
  6047. }
  6048. }
  6049. return -1
  6050. }
  6051. function getInvalidTypeMessage (name, value, expectedTypes) {
  6052. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  6053. " Expected " + (expectedTypes.map(capitalize).join(', '));
  6054. var expectedType = expectedTypes[0];
  6055. var receivedType = toRawType(value);
  6056. var expectedValue = styleValue(value, expectedType);
  6057. var receivedValue = styleValue(value, receivedType);
  6058. // check if we need to specify expected value
  6059. if (expectedTypes.length === 1 &&
  6060. isExplicable(expectedType) &&
  6061. !isBoolean(expectedType, receivedType)) {
  6062. message += " with value " + expectedValue;
  6063. }
  6064. message += ", got " + receivedType + " ";
  6065. // check if we need to specify received value
  6066. if (isExplicable(receivedType)) {
  6067. message += "with value " + receivedValue + ".";
  6068. }
  6069. return message
  6070. }
  6071. function styleValue (value, type) {
  6072. if (type === 'String') {
  6073. return ("\"" + value + "\"")
  6074. } else if (type === 'Number') {
  6075. return ("" + (Number(value)))
  6076. } else {
  6077. return ("" + value)
  6078. }
  6079. }
  6080. function isExplicable (value) {
  6081. var explicitTypes = ['string', 'number', 'boolean'];
  6082. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  6083. }
  6084. function isBoolean () {
  6085. var args = [], len = arguments.length;
  6086. while ( len-- ) args[ len ] = arguments[ len ];
  6087. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  6088. }
  6089. /* */
  6090. function handleError (err, vm, info) {
  6091. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  6092. // See: https://github.com/vuejs/vuex/issues/1505
  6093. pushTarget();
  6094. try {
  6095. if (vm) {
  6096. var cur = vm;
  6097. while ((cur = cur.$parent)) {
  6098. var hooks = cur.$options.errorCaptured;
  6099. if (hooks) {
  6100. for (var i = 0; i < hooks.length; i++) {
  6101. try {
  6102. var capture = hooks[i].call(cur, err, vm, info) === false;
  6103. if (capture) { return }
  6104. } catch (e) {
  6105. globalHandleError(e, cur, 'errorCaptured hook');
  6106. }
  6107. }
  6108. }
  6109. }
  6110. }
  6111. globalHandleError(err, vm, info);
  6112. } finally {
  6113. popTarget();
  6114. }
  6115. }
  6116. function invokeWithErrorHandling (
  6117. handler,
  6118. context,
  6119. args,
  6120. vm,
  6121. info
  6122. ) {
  6123. var res;
  6124. try {
  6125. res = args ? handler.apply(context, args) : handler.call(context);
  6126. if (res && !res._isVue && isPromise(res) && !res._handled) {
  6127. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  6128. // issue #9511
  6129. // avoid catch triggering multiple times when nested calls
  6130. res._handled = true;
  6131. }
  6132. } catch (e) {
  6133. handleError(e, vm, info);
  6134. }
  6135. return res
  6136. }
  6137. function globalHandleError (err, vm, info) {
  6138. if (config.errorHandler) {
  6139. try {
  6140. return config.errorHandler.call(null, err, vm, info)
  6141. } catch (e) {
  6142. // if the user intentionally throws the original error in the handler,
  6143. // do not log it twice
  6144. if (e !== err) {
  6145. logError(e, null, 'config.errorHandler');
  6146. }
  6147. }
  6148. }
  6149. logError(err, vm, info);
  6150. }
  6151. function logError (err, vm, info) {
  6152. if (true) {
  6153. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6154. }
  6155. /* istanbul ignore else */
  6156. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  6157. console.error(err);
  6158. } else {
  6159. throw err
  6160. }
  6161. }
  6162. /* */
  6163. var callbacks = [];
  6164. var pending = false;
  6165. function flushCallbacks () {
  6166. pending = false;
  6167. var copies = callbacks.slice(0);
  6168. callbacks.length = 0;
  6169. for (var i = 0; i < copies.length; i++) {
  6170. copies[i]();
  6171. }
  6172. }
  6173. // Here we have async deferring wrappers using microtasks.
  6174. // In 2.5 we used (macro) tasks (in combination with microtasks).
  6175. // However, it has subtle problems when state is changed right before repaint
  6176. // (e.g. #6813, out-in transitions).
  6177. // Also, using (macro) tasks in event handler would cause some weird behaviors
  6178. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  6179. // So we now use microtasks everywhere, again.
  6180. // A major drawback of this tradeoff is that there are some scenarios
  6181. // where microtasks have too high a priority and fire in between supposedly
  6182. // sequential events (e.g. #4521, #6690, which have workarounds)
  6183. // or even between bubbling of the same event (#6566).
  6184. var timerFunc;
  6185. // The nextTick behavior leverages the microtask queue, which can be accessed
  6186. // via either native Promise.then or MutationObserver.
  6187. // MutationObserver has wider support, however it is seriously bugged in
  6188. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  6189. // completely stops working after triggering a few times... so, if native
  6190. // Promise is available, we will use it:
  6191. /* istanbul ignore next, $flow-disable-line */
  6192. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  6193. var p = Promise.resolve();
  6194. timerFunc = function () {
  6195. p.then(flushCallbacks);
  6196. // In problematic UIWebViews, Promise.then doesn't completely break, but
  6197. // it can get stuck in a weird state where callbacks are pushed into the
  6198. // microtask queue but the queue isn't being flushed, until the browser
  6199. // needs to do some other work, e.g. handle a timer. Therefore we can
  6200. // "force" the microtask queue to be flushed by adding an empty timer.
  6201. if (isIOS) { setTimeout(noop); }
  6202. };
  6203. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  6204. isNative(MutationObserver) ||
  6205. // PhantomJS and iOS 7.x
  6206. MutationObserver.toString() === '[object MutationObserverConstructor]'
  6207. )) {
  6208. // Use MutationObserver where native Promise is not available,
  6209. // e.g. PhantomJS, iOS7, Android 4.4
  6210. // (#6466 MutationObserver is unreliable in IE11)
  6211. var counter = 1;
  6212. var observer = new MutationObserver(flushCallbacks);
  6213. var textNode = document.createTextNode(String(counter));
  6214. observer.observe(textNode, {
  6215. characterData: true
  6216. });
  6217. timerFunc = function () {
  6218. counter = (counter + 1) % 2;
  6219. textNode.data = String(counter);
  6220. };
  6221. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  6222. // Fallback to setImmediate.
  6223. // Technically it leverages the (macro) task queue,
  6224. // but it is still a better choice than setTimeout.
  6225. timerFunc = function () {
  6226. setImmediate(flushCallbacks);
  6227. };
  6228. } else {
  6229. // Fallback to setTimeout.
  6230. timerFunc = function () {
  6231. setTimeout(flushCallbacks, 0);
  6232. };
  6233. }
  6234. function nextTick (cb, ctx) {
  6235. var _resolve;
  6236. callbacks.push(function () {
  6237. if (cb) {
  6238. try {
  6239. cb.call(ctx);
  6240. } catch (e) {
  6241. handleError(e, ctx, 'nextTick');
  6242. }
  6243. } else if (_resolve) {
  6244. _resolve(ctx);
  6245. }
  6246. });
  6247. if (!pending) {
  6248. pending = true;
  6249. timerFunc();
  6250. }
  6251. // $flow-disable-line
  6252. if (!cb && typeof Promise !== 'undefined') {
  6253. return new Promise(function (resolve) {
  6254. _resolve = resolve;
  6255. })
  6256. }
  6257. }
  6258. /* */
  6259. /* not type checking this file because flow doesn't play well with Proxy */
  6260. var initProxy;
  6261. if (true) {
  6262. var allowedGlobals = makeMap(
  6263. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  6264. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  6265. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  6266. 'require' // for Webpack/Browserify
  6267. );
  6268. var warnNonPresent = function (target, key) {
  6269. warn(
  6270. "Property or method \"" + key + "\" is not defined on the instance but " +
  6271. 'referenced during render. Make sure that this property is reactive, ' +
  6272. 'either in the data option, or for class-based components, by ' +
  6273. 'initializing the property. ' +
  6274. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  6275. target
  6276. );
  6277. };
  6278. var warnReservedPrefix = function (target, key) {
  6279. warn(
  6280. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  6281. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  6282. 'prevent conflicts with Vue internals. ' +
  6283. 'See: https://vuejs.org/v2/api/#data',
  6284. target
  6285. );
  6286. };
  6287. var hasProxy =
  6288. typeof Proxy !== 'undefined' && isNative(Proxy);
  6289. if (hasProxy) {
  6290. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  6291. config.keyCodes = new Proxy(config.keyCodes, {
  6292. set: function set (target, key, value) {
  6293. if (isBuiltInModifier(key)) {
  6294. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  6295. return false
  6296. } else {
  6297. target[key] = value;
  6298. return true
  6299. }
  6300. }
  6301. });
  6302. }
  6303. var hasHandler = {
  6304. has: function has (target, key) {
  6305. var has = key in target;
  6306. var isAllowed = allowedGlobals(key) ||
  6307. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  6308. if (!has && !isAllowed) {
  6309. if (key in target.$data) { warnReservedPrefix(target, key); }
  6310. else { warnNonPresent(target, key); }
  6311. }
  6312. return has || !isAllowed
  6313. }
  6314. };
  6315. var getHandler = {
  6316. get: function get (target, key) {
  6317. if (typeof key === 'string' && !(key in target)) {
  6318. if (key in target.$data) { warnReservedPrefix(target, key); }
  6319. else { warnNonPresent(target, key); }
  6320. }
  6321. return target[key]
  6322. }
  6323. };
  6324. initProxy = function initProxy (vm) {
  6325. if (hasProxy) {
  6326. // determine which proxy handler to use
  6327. var options = vm.$options;
  6328. var handlers = options.render && options.render._withStripped
  6329. ? getHandler
  6330. : hasHandler;
  6331. vm._renderProxy = new Proxy(vm, handlers);
  6332. } else {
  6333. vm._renderProxy = vm;
  6334. }
  6335. };
  6336. }
  6337. /* */
  6338. var seenObjects = new _Set();
  6339. /**
  6340. * Recursively traverse an object to evoke all converted
  6341. * getters, so that every nested property inside the object
  6342. * is collected as a "deep" dependency.
  6343. */
  6344. function traverse (val) {
  6345. _traverse(val, seenObjects);
  6346. seenObjects.clear();
  6347. }
  6348. function _traverse (val, seen) {
  6349. var i, keys;
  6350. var isA = Array.isArray(val);
  6351. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6352. return
  6353. }
  6354. if (val.__ob__) {
  6355. var depId = val.__ob__.dep.id;
  6356. if (seen.has(depId)) {
  6357. return
  6358. }
  6359. seen.add(depId);
  6360. }
  6361. if (isA) {
  6362. i = val.length;
  6363. while (i--) { _traverse(val[i], seen); }
  6364. } else {
  6365. keys = Object.keys(val);
  6366. i = keys.length;
  6367. while (i--) { _traverse(val[keys[i]], seen); }
  6368. }
  6369. }
  6370. var mark;
  6371. var measure;
  6372. if (true) {
  6373. var perf = inBrowser && window.performance;
  6374. /* istanbul ignore if */
  6375. if (
  6376. perf &&
  6377. perf.mark &&
  6378. perf.measure &&
  6379. perf.clearMarks &&
  6380. perf.clearMeasures
  6381. ) {
  6382. mark = function (tag) { return perf.mark(tag); };
  6383. measure = function (name, startTag, endTag) {
  6384. perf.measure(name, startTag, endTag);
  6385. perf.clearMarks(startTag);
  6386. perf.clearMarks(endTag);
  6387. // perf.clearMeasures(name)
  6388. };
  6389. }
  6390. }
  6391. /* */
  6392. var normalizeEvent = cached(function (name) {
  6393. var passive = name.charAt(0) === '&';
  6394. name = passive ? name.slice(1) : name;
  6395. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6396. name = once$$1 ? name.slice(1) : name;
  6397. var capture = name.charAt(0) === '!';
  6398. name = capture ? name.slice(1) : name;
  6399. return {
  6400. name: name,
  6401. once: once$$1,
  6402. capture: capture,
  6403. passive: passive
  6404. }
  6405. });
  6406. function createFnInvoker (fns, vm) {
  6407. function invoker () {
  6408. var arguments$1 = arguments;
  6409. var fns = invoker.fns;
  6410. if (Array.isArray(fns)) {
  6411. var cloned = fns.slice();
  6412. for (var i = 0; i < cloned.length; i++) {
  6413. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6414. }
  6415. } else {
  6416. // return handler return value for single handlers
  6417. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6418. }
  6419. }
  6420. invoker.fns = fns;
  6421. return invoker
  6422. }
  6423. function updateListeners (
  6424. on,
  6425. oldOn,
  6426. add,
  6427. remove$$1,
  6428. createOnceHandler,
  6429. vm
  6430. ) {
  6431. var name, def$$1, cur, old, event;
  6432. for (name in on) {
  6433. def$$1 = cur = on[name];
  6434. old = oldOn[name];
  6435. event = normalizeEvent(name);
  6436. if (isUndef(cur)) {
  6437. true && warn(
  6438. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6439. vm
  6440. );
  6441. } else if (isUndef(old)) {
  6442. if (isUndef(cur.fns)) {
  6443. cur = on[name] = createFnInvoker(cur, vm);
  6444. }
  6445. if (isTrue(event.once)) {
  6446. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6447. }
  6448. add(event.name, cur, event.capture, event.passive, event.params);
  6449. } else if (cur !== old) {
  6450. old.fns = cur;
  6451. on[name] = old;
  6452. }
  6453. }
  6454. for (name in oldOn) {
  6455. if (isUndef(on[name])) {
  6456. event = normalizeEvent(name);
  6457. remove$$1(event.name, oldOn[name], event.capture);
  6458. }
  6459. }
  6460. }
  6461. /* */
  6462. /* */
  6463. // fixed by xxxxxx (mp properties)
  6464. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6465. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6466. if (isUndef(propOptions)) {
  6467. return res
  6468. }
  6469. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6470. var attrs = data.attrs;
  6471. var props = data.props;
  6472. if (isDef(attrs) || isDef(props)) {
  6473. for (var key in propOptions) {
  6474. var altKey = hyphenate(key);
  6475. var result = checkProp(res, props, key, altKey, true) ||
  6476. checkProp(res, attrs, key, altKey, false);
  6477. // externalClass
  6478. if (
  6479. result &&
  6480. res[key] &&
  6481. externalClasses.indexOf(altKey) !== -1 &&
  6482. context[camelize(res[key])]
  6483. ) {
  6484. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6485. res[key] = context[camelize(res[key])];
  6486. }
  6487. }
  6488. }
  6489. return res
  6490. }
  6491. function extractPropsFromVNodeData (
  6492. data,
  6493. Ctor,
  6494. tag,
  6495. context// fixed by xxxxxx
  6496. ) {
  6497. // we are only extracting raw values here.
  6498. // validation and default values are handled in the child
  6499. // component itself.
  6500. var propOptions = Ctor.options.props;
  6501. if (isUndef(propOptions)) {
  6502. // fixed by xxxxxx
  6503. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6504. }
  6505. var res = {};
  6506. var attrs = data.attrs;
  6507. var props = data.props;
  6508. if (isDef(attrs) || isDef(props)) {
  6509. for (var key in propOptions) {
  6510. var altKey = hyphenate(key);
  6511. if (true) {
  6512. var keyInLowerCase = key.toLowerCase();
  6513. if (
  6514. key !== keyInLowerCase &&
  6515. attrs && hasOwn(attrs, keyInLowerCase)
  6516. ) {
  6517. tip(
  6518. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6519. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6520. " \"" + key + "\". " +
  6521. "Note that HTML attributes are case-insensitive and camelCased " +
  6522. "props need to use their kebab-case equivalents when using in-DOM " +
  6523. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6524. );
  6525. }
  6526. }
  6527. checkProp(res, props, key, altKey, true) ||
  6528. checkProp(res, attrs, key, altKey, false);
  6529. }
  6530. }
  6531. // fixed by xxxxxx
  6532. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6533. }
  6534. function checkProp (
  6535. res,
  6536. hash,
  6537. key,
  6538. altKey,
  6539. preserve
  6540. ) {
  6541. if (isDef(hash)) {
  6542. if (hasOwn(hash, key)) {
  6543. res[key] = hash[key];
  6544. if (!preserve) {
  6545. delete hash[key];
  6546. }
  6547. return true
  6548. } else if (hasOwn(hash, altKey)) {
  6549. res[key] = hash[altKey];
  6550. if (!preserve) {
  6551. delete hash[altKey];
  6552. }
  6553. return true
  6554. }
  6555. }
  6556. return false
  6557. }
  6558. /* */
  6559. // The template compiler attempts to minimize the need for normalization by
  6560. // statically analyzing the template at compile time.
  6561. //
  6562. // For plain HTML markup, normalization can be completely skipped because the
  6563. // generated render function is guaranteed to return Array<VNode>. There are
  6564. // two cases where extra normalization is needed:
  6565. // 1. When the children contains components - because a functional component
  6566. // may return an Array instead of a single root. In this case, just a simple
  6567. // normalization is needed - if any child is an Array, we flatten the whole
  6568. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6569. // because functional components already normalize their own children.
  6570. function simpleNormalizeChildren (children) {
  6571. for (var i = 0; i < children.length; i++) {
  6572. if (Array.isArray(children[i])) {
  6573. return Array.prototype.concat.apply([], children)
  6574. }
  6575. }
  6576. return children
  6577. }
  6578. // 2. When the children contains constructs that always generated nested Arrays,
  6579. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6580. // with hand-written render functions / JSX. In such cases a full normalization
  6581. // is needed to cater to all possible types of children values.
  6582. function normalizeChildren (children) {
  6583. return isPrimitive(children)
  6584. ? [createTextVNode(children)]
  6585. : Array.isArray(children)
  6586. ? normalizeArrayChildren(children)
  6587. : undefined
  6588. }
  6589. function isTextNode (node) {
  6590. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6591. }
  6592. function normalizeArrayChildren (children, nestedIndex) {
  6593. var res = [];
  6594. var i, c, lastIndex, last;
  6595. for (i = 0; i < children.length; i++) {
  6596. c = children[i];
  6597. if (isUndef(c) || typeof c === 'boolean') { continue }
  6598. lastIndex = res.length - 1;
  6599. last = res[lastIndex];
  6600. // nested
  6601. if (Array.isArray(c)) {
  6602. if (c.length > 0) {
  6603. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6604. // merge adjacent text nodes
  6605. if (isTextNode(c[0]) && isTextNode(last)) {
  6606. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6607. c.shift();
  6608. }
  6609. res.push.apply(res, c);
  6610. }
  6611. } else if (isPrimitive(c)) {
  6612. if (isTextNode(last)) {
  6613. // merge adjacent text nodes
  6614. // this is necessary for SSR hydration because text nodes are
  6615. // essentially merged when rendered to HTML strings
  6616. res[lastIndex] = createTextVNode(last.text + c);
  6617. } else if (c !== '') {
  6618. // convert primitive to vnode
  6619. res.push(createTextVNode(c));
  6620. }
  6621. } else {
  6622. if (isTextNode(c) && isTextNode(last)) {
  6623. // merge adjacent text nodes
  6624. res[lastIndex] = createTextVNode(last.text + c.text);
  6625. } else {
  6626. // default key for nested array children (likely generated by v-for)
  6627. if (isTrue(children._isVList) &&
  6628. isDef(c.tag) &&
  6629. isUndef(c.key) &&
  6630. isDef(nestedIndex)) {
  6631. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6632. }
  6633. res.push(c);
  6634. }
  6635. }
  6636. }
  6637. return res
  6638. }
  6639. /* */
  6640. function initProvide (vm) {
  6641. var provide = vm.$options.provide;
  6642. if (provide) {
  6643. vm._provided = typeof provide === 'function'
  6644. ? provide.call(vm)
  6645. : provide;
  6646. }
  6647. }
  6648. function initInjections (vm) {
  6649. var result = resolveInject(vm.$options.inject, vm);
  6650. if (result) {
  6651. toggleObserving(false);
  6652. Object.keys(result).forEach(function (key) {
  6653. /* istanbul ignore else */
  6654. if (true) {
  6655. defineReactive$$1(vm, key, result[key], function () {
  6656. warn(
  6657. "Avoid mutating an injected value directly since the changes will be " +
  6658. "overwritten whenever the provided component re-renders. " +
  6659. "injection being mutated: \"" + key + "\"",
  6660. vm
  6661. );
  6662. });
  6663. } else {}
  6664. });
  6665. toggleObserving(true);
  6666. }
  6667. }
  6668. function resolveInject (inject, vm) {
  6669. if (inject) {
  6670. // inject is :any because flow is not smart enough to figure out cached
  6671. var result = Object.create(null);
  6672. var keys = hasSymbol
  6673. ? Reflect.ownKeys(inject)
  6674. : Object.keys(inject);
  6675. for (var i = 0; i < keys.length; i++) {
  6676. var key = keys[i];
  6677. // #6574 in case the inject object is observed...
  6678. if (key === '__ob__') { continue }
  6679. var provideKey = inject[key].from;
  6680. var source = vm;
  6681. while (source) {
  6682. if (source._provided && hasOwn(source._provided, provideKey)) {
  6683. result[key] = source._provided[provideKey];
  6684. break
  6685. }
  6686. source = source.$parent;
  6687. }
  6688. if (!source) {
  6689. if ('default' in inject[key]) {
  6690. var provideDefault = inject[key].default;
  6691. result[key] = typeof provideDefault === 'function'
  6692. ? provideDefault.call(vm)
  6693. : provideDefault;
  6694. } else if (true) {
  6695. warn(("Injection \"" + key + "\" not found"), vm);
  6696. }
  6697. }
  6698. }
  6699. return result
  6700. }
  6701. }
  6702. /* */
  6703. /**
  6704. * Runtime helper for resolving raw children VNodes into a slot object.
  6705. */
  6706. function resolveSlots (
  6707. children,
  6708. context
  6709. ) {
  6710. if (!children || !children.length) {
  6711. return {}
  6712. }
  6713. var slots = {};
  6714. for (var i = 0, l = children.length; i < l; i++) {
  6715. var child = children[i];
  6716. var data = child.data;
  6717. // remove slot attribute if the node is resolved as a Vue slot node
  6718. if (data && data.attrs && data.attrs.slot) {
  6719. delete data.attrs.slot;
  6720. }
  6721. // named slots should only be respected if the vnode was rendered in the
  6722. // same context.
  6723. if ((child.context === context || child.fnContext === context) &&
  6724. data && data.slot != null
  6725. ) {
  6726. var name = data.slot;
  6727. var slot = (slots[name] || (slots[name] = []));
  6728. if (child.tag === 'template') {
  6729. slot.push.apply(slot, child.children || []);
  6730. } else {
  6731. slot.push(child);
  6732. }
  6733. } else {
  6734. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6735. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6736. (slots['page'] || (slots['page'] = [])).push(child);
  6737. }else{
  6738. (slots.default || (slots.default = [])).push(child);
  6739. }
  6740. }
  6741. }
  6742. // ignore slots that contains only whitespace
  6743. for (var name$1 in slots) {
  6744. if (slots[name$1].every(isWhitespace)) {
  6745. delete slots[name$1];
  6746. }
  6747. }
  6748. return slots
  6749. }
  6750. function isWhitespace (node) {
  6751. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6752. }
  6753. /* */
  6754. function normalizeScopedSlots (
  6755. slots,
  6756. normalSlots,
  6757. prevSlots
  6758. ) {
  6759. var res;
  6760. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6761. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6762. var key = slots && slots.$key;
  6763. if (!slots) {
  6764. res = {};
  6765. } else if (slots._normalized) {
  6766. // fast path 1: child component re-render only, parent did not change
  6767. return slots._normalized
  6768. } else if (
  6769. isStable &&
  6770. prevSlots &&
  6771. prevSlots !== emptyObject &&
  6772. key === prevSlots.$key &&
  6773. !hasNormalSlots &&
  6774. !prevSlots.$hasNormal
  6775. ) {
  6776. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6777. // only need to normalize once
  6778. return prevSlots
  6779. } else {
  6780. res = {};
  6781. for (var key$1 in slots) {
  6782. if (slots[key$1] && key$1[0] !== '$') {
  6783. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6784. }
  6785. }
  6786. }
  6787. // expose normal slots on scopedSlots
  6788. for (var key$2 in normalSlots) {
  6789. if (!(key$2 in res)) {
  6790. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6791. }
  6792. }
  6793. // avoriaz seems to mock a non-extensible $scopedSlots object
  6794. // and when that is passed down this would cause an error
  6795. if (slots && Object.isExtensible(slots)) {
  6796. (slots)._normalized = res;
  6797. }
  6798. def(res, '$stable', isStable);
  6799. def(res, '$key', key);
  6800. def(res, '$hasNormal', hasNormalSlots);
  6801. return res
  6802. }
  6803. function normalizeScopedSlot(normalSlots, key, fn) {
  6804. var normalized = function () {
  6805. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6806. res = res && typeof res === 'object' && !Array.isArray(res)
  6807. ? [res] // single vnode
  6808. : normalizeChildren(res);
  6809. return res && (
  6810. res.length === 0 ||
  6811. (res.length === 1 && res[0].isComment) // #9658
  6812. ) ? undefined
  6813. : res
  6814. };
  6815. // this is a slot using the new v-slot syntax without scope. although it is
  6816. // compiled as a scoped slot, render fn users would expect it to be present
  6817. // on this.$slots because the usage is semantically a normal slot.
  6818. if (fn.proxy) {
  6819. Object.defineProperty(normalSlots, key, {
  6820. get: normalized,
  6821. enumerable: true,
  6822. configurable: true
  6823. });
  6824. }
  6825. return normalized
  6826. }
  6827. function proxyNormalSlot(slots, key) {
  6828. return function () { return slots[key]; }
  6829. }
  6830. /* */
  6831. /**
  6832. * Runtime helper for rendering v-for lists.
  6833. */
  6834. function renderList (
  6835. val,
  6836. render
  6837. ) {
  6838. var ret, i, l, keys, key;
  6839. if (Array.isArray(val) || typeof val === 'string') {
  6840. ret = new Array(val.length);
  6841. for (i = 0, l = val.length; i < l; i++) {
  6842. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6843. }
  6844. } else if (typeof val === 'number') {
  6845. ret = new Array(val);
  6846. for (i = 0; i < val; i++) {
  6847. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6848. }
  6849. } else if (isObject(val)) {
  6850. if (hasSymbol && val[Symbol.iterator]) {
  6851. ret = [];
  6852. var iterator = val[Symbol.iterator]();
  6853. var result = iterator.next();
  6854. while (!result.done) {
  6855. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6856. result = iterator.next();
  6857. }
  6858. } else {
  6859. keys = Object.keys(val);
  6860. ret = new Array(keys.length);
  6861. for (i = 0, l = keys.length; i < l; i++) {
  6862. key = keys[i];
  6863. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6864. }
  6865. }
  6866. }
  6867. if (!isDef(ret)) {
  6868. ret = [];
  6869. }
  6870. (ret)._isVList = true;
  6871. return ret
  6872. }
  6873. /* */
  6874. /**
  6875. * Runtime helper for rendering <slot>
  6876. */
  6877. function renderSlot (
  6878. name,
  6879. fallback,
  6880. props,
  6881. bindObject
  6882. ) {
  6883. var scopedSlotFn = this.$scopedSlots[name];
  6884. var nodes;
  6885. if (scopedSlotFn) { // scoped slot
  6886. props = props || {};
  6887. if (bindObject) {
  6888. if ( true && !isObject(bindObject)) {
  6889. warn(
  6890. 'slot v-bind without argument expects an Object',
  6891. this
  6892. );
  6893. }
  6894. props = extend(extend({}, bindObject), props);
  6895. }
  6896. // fixed by xxxxxx app-plus scopedSlot
  6897. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6898. } else {
  6899. nodes = this.$slots[name] || fallback;
  6900. }
  6901. var target = props && props.slot;
  6902. if (target) {
  6903. return this.$createElement('template', { slot: target }, nodes)
  6904. } else {
  6905. return nodes
  6906. }
  6907. }
  6908. /* */
  6909. /**
  6910. * Runtime helper for resolving filters
  6911. */
  6912. function resolveFilter (id) {
  6913. return resolveAsset(this.$options, 'filters', id, true) || identity
  6914. }
  6915. /* */
  6916. function isKeyNotMatch (expect, actual) {
  6917. if (Array.isArray(expect)) {
  6918. return expect.indexOf(actual) === -1
  6919. } else {
  6920. return expect !== actual
  6921. }
  6922. }
  6923. /**
  6924. * Runtime helper for checking keyCodes from config.
  6925. * exposed as Vue.prototype._k
  6926. * passing in eventKeyName as last argument separately for backwards compat
  6927. */
  6928. function checkKeyCodes (
  6929. eventKeyCode,
  6930. key,
  6931. builtInKeyCode,
  6932. eventKeyName,
  6933. builtInKeyName
  6934. ) {
  6935. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6936. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6937. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6938. } else if (mappedKeyCode) {
  6939. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6940. } else if (eventKeyName) {
  6941. return hyphenate(eventKeyName) !== key
  6942. }
  6943. }
  6944. /* */
  6945. /**
  6946. * Runtime helper for merging v-bind="object" into a VNode's data.
  6947. */
  6948. function bindObjectProps (
  6949. data,
  6950. tag,
  6951. value,
  6952. asProp,
  6953. isSync
  6954. ) {
  6955. if (value) {
  6956. if (!isObject(value)) {
  6957. true && warn(
  6958. 'v-bind without argument expects an Object or Array value',
  6959. this
  6960. );
  6961. } else {
  6962. if (Array.isArray(value)) {
  6963. value = toObject(value);
  6964. }
  6965. var hash;
  6966. var loop = function ( key ) {
  6967. if (
  6968. key === 'class' ||
  6969. key === 'style' ||
  6970. isReservedAttribute(key)
  6971. ) {
  6972. hash = data;
  6973. } else {
  6974. var type = data.attrs && data.attrs.type;
  6975. hash = asProp || config.mustUseProp(tag, type, key)
  6976. ? data.domProps || (data.domProps = {})
  6977. : data.attrs || (data.attrs = {});
  6978. }
  6979. var camelizedKey = camelize(key);
  6980. var hyphenatedKey = hyphenate(key);
  6981. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6982. hash[key] = value[key];
  6983. if (isSync) {
  6984. var on = data.on || (data.on = {});
  6985. on[("update:" + key)] = function ($event) {
  6986. value[key] = $event;
  6987. };
  6988. }
  6989. }
  6990. };
  6991. for (var key in value) loop( key );
  6992. }
  6993. }
  6994. return data
  6995. }
  6996. /* */
  6997. /**
  6998. * Runtime helper for rendering static trees.
  6999. */
  7000. function renderStatic (
  7001. index,
  7002. isInFor
  7003. ) {
  7004. var cached = this._staticTrees || (this._staticTrees = []);
  7005. var tree = cached[index];
  7006. // if has already-rendered static tree and not inside v-for,
  7007. // we can reuse the same tree.
  7008. if (tree && !isInFor) {
  7009. return tree
  7010. }
  7011. // otherwise, render a fresh tree.
  7012. tree = cached[index] = this.$options.staticRenderFns[index].call(
  7013. this._renderProxy,
  7014. null,
  7015. this // for render fns generated for functional component templates
  7016. );
  7017. markStatic(tree, ("__static__" + index), false);
  7018. return tree
  7019. }
  7020. /**
  7021. * Runtime helper for v-once.
  7022. * Effectively it means marking the node as static with a unique key.
  7023. */
  7024. function markOnce (
  7025. tree,
  7026. index,
  7027. key
  7028. ) {
  7029. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  7030. return tree
  7031. }
  7032. function markStatic (
  7033. tree,
  7034. key,
  7035. isOnce
  7036. ) {
  7037. if (Array.isArray(tree)) {
  7038. for (var i = 0; i < tree.length; i++) {
  7039. if (tree[i] && typeof tree[i] !== 'string') {
  7040. markStaticNode(tree[i], (key + "_" + i), isOnce);
  7041. }
  7042. }
  7043. } else {
  7044. markStaticNode(tree, key, isOnce);
  7045. }
  7046. }
  7047. function markStaticNode (node, key, isOnce) {
  7048. node.isStatic = true;
  7049. node.key = key;
  7050. node.isOnce = isOnce;
  7051. }
  7052. /* */
  7053. function bindObjectListeners (data, value) {
  7054. if (value) {
  7055. if (!isPlainObject(value)) {
  7056. true && warn(
  7057. 'v-on without argument expects an Object value',
  7058. this
  7059. );
  7060. } else {
  7061. var on = data.on = data.on ? extend({}, data.on) : {};
  7062. for (var key in value) {
  7063. var existing = on[key];
  7064. var ours = value[key];
  7065. on[key] = existing ? [].concat(existing, ours) : ours;
  7066. }
  7067. }
  7068. }
  7069. return data
  7070. }
  7071. /* */
  7072. function resolveScopedSlots (
  7073. fns, // see flow/vnode
  7074. res,
  7075. // the following are added in 2.6
  7076. hasDynamicKeys,
  7077. contentHashKey
  7078. ) {
  7079. res = res || { $stable: !hasDynamicKeys };
  7080. for (var i = 0; i < fns.length; i++) {
  7081. var slot = fns[i];
  7082. if (Array.isArray(slot)) {
  7083. resolveScopedSlots(slot, res, hasDynamicKeys);
  7084. } else if (slot) {
  7085. // marker for reverse proxying v-slot without scope on this.$slots
  7086. if (slot.proxy) {
  7087. slot.fn.proxy = true;
  7088. }
  7089. res[slot.key] = slot.fn;
  7090. }
  7091. }
  7092. if (contentHashKey) {
  7093. (res).$key = contentHashKey;
  7094. }
  7095. return res
  7096. }
  7097. /* */
  7098. function bindDynamicKeys (baseObj, values) {
  7099. for (var i = 0; i < values.length; i += 2) {
  7100. var key = values[i];
  7101. if (typeof key === 'string' && key) {
  7102. baseObj[values[i]] = values[i + 1];
  7103. } else if ( true && key !== '' && key !== null) {
  7104. // null is a special value for explicitly removing a binding
  7105. warn(
  7106. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  7107. this
  7108. );
  7109. }
  7110. }
  7111. return baseObj
  7112. }
  7113. // helper to dynamically append modifier runtime markers to event names.
  7114. // ensure only append when value is already string, otherwise it will be cast
  7115. // to string and cause the type check to miss.
  7116. function prependModifier (value, symbol) {
  7117. return typeof value === 'string' ? symbol + value : value
  7118. }
  7119. /* */
  7120. function installRenderHelpers (target) {
  7121. target._o = markOnce;
  7122. target._n = toNumber;
  7123. target._s = toString;
  7124. target._l = renderList;
  7125. target._t = renderSlot;
  7126. target._q = looseEqual;
  7127. target._i = looseIndexOf;
  7128. target._m = renderStatic;
  7129. target._f = resolveFilter;
  7130. target._k = checkKeyCodes;
  7131. target._b = bindObjectProps;
  7132. target._v = createTextVNode;
  7133. target._e = createEmptyVNode;
  7134. target._u = resolveScopedSlots;
  7135. target._g = bindObjectListeners;
  7136. target._d = bindDynamicKeys;
  7137. target._p = prependModifier;
  7138. }
  7139. /* */
  7140. function FunctionalRenderContext (
  7141. data,
  7142. props,
  7143. children,
  7144. parent,
  7145. Ctor
  7146. ) {
  7147. var this$1 = this;
  7148. var options = Ctor.options;
  7149. // ensure the createElement function in functional components
  7150. // gets a unique context - this is necessary for correct named slot check
  7151. var contextVm;
  7152. if (hasOwn(parent, '_uid')) {
  7153. contextVm = Object.create(parent);
  7154. // $flow-disable-line
  7155. contextVm._original = parent;
  7156. } else {
  7157. // the context vm passed in is a functional context as well.
  7158. // in this case we want to make sure we are able to get a hold to the
  7159. // real context instance.
  7160. contextVm = parent;
  7161. // $flow-disable-line
  7162. parent = parent._original;
  7163. }
  7164. var isCompiled = isTrue(options._compiled);
  7165. var needNormalization = !isCompiled;
  7166. this.data = data;
  7167. this.props = props;
  7168. this.children = children;
  7169. this.parent = parent;
  7170. this.listeners = data.on || emptyObject;
  7171. this.injections = resolveInject(options.inject, parent);
  7172. this.slots = function () {
  7173. if (!this$1.$slots) {
  7174. normalizeScopedSlots(
  7175. data.scopedSlots,
  7176. this$1.$slots = resolveSlots(children, parent)
  7177. );
  7178. }
  7179. return this$1.$slots
  7180. };
  7181. Object.defineProperty(this, 'scopedSlots', ({
  7182. enumerable: true,
  7183. get: function get () {
  7184. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7185. }
  7186. }));
  7187. // support for compiled functional template
  7188. if (isCompiled) {
  7189. // exposing $options for renderStatic()
  7190. this.$options = options;
  7191. // pre-resolve slots for renderSlot()
  7192. this.$slots = this.slots();
  7193. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7194. }
  7195. if (options._scopeId) {
  7196. this._c = function (a, b, c, d) {
  7197. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7198. if (vnode && !Array.isArray(vnode)) {
  7199. vnode.fnScopeId = options._scopeId;
  7200. vnode.fnContext = parent;
  7201. }
  7202. return vnode
  7203. };
  7204. } else {
  7205. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7206. }
  7207. }
  7208. installRenderHelpers(FunctionalRenderContext.prototype);
  7209. function createFunctionalComponent (
  7210. Ctor,
  7211. propsData,
  7212. data,
  7213. contextVm,
  7214. children
  7215. ) {
  7216. var options = Ctor.options;
  7217. var props = {};
  7218. var propOptions = options.props;
  7219. if (isDef(propOptions)) {
  7220. for (var key in propOptions) {
  7221. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7222. }
  7223. } else {
  7224. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7225. if (isDef(data.props)) { mergeProps(props, data.props); }
  7226. }
  7227. var renderContext = new FunctionalRenderContext(
  7228. data,
  7229. props,
  7230. children,
  7231. contextVm,
  7232. Ctor
  7233. );
  7234. var vnode = options.render.call(null, renderContext._c, renderContext);
  7235. if (vnode instanceof VNode) {
  7236. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7237. } else if (Array.isArray(vnode)) {
  7238. var vnodes = normalizeChildren(vnode) || [];
  7239. var res = new Array(vnodes.length);
  7240. for (var i = 0; i < vnodes.length; i++) {
  7241. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7242. }
  7243. return res
  7244. }
  7245. }
  7246. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7247. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7248. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7249. // that should not be matched to match.
  7250. var clone = cloneVNode(vnode);
  7251. clone.fnContext = contextVm;
  7252. clone.fnOptions = options;
  7253. if (true) {
  7254. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  7255. }
  7256. if (data.slot) {
  7257. (clone.data || (clone.data = {})).slot = data.slot;
  7258. }
  7259. return clone
  7260. }
  7261. function mergeProps (to, from) {
  7262. for (var key in from) {
  7263. to[camelize(key)] = from[key];
  7264. }
  7265. }
  7266. /* */
  7267. /* */
  7268. /* */
  7269. /* */
  7270. // inline hooks to be invoked on component VNodes during patch
  7271. var componentVNodeHooks = {
  7272. init: function init (vnode, hydrating) {
  7273. if (
  7274. vnode.componentInstance &&
  7275. !vnode.componentInstance._isDestroyed &&
  7276. vnode.data.keepAlive
  7277. ) {
  7278. // kept-alive components, treat as a patch
  7279. var mountedNode = vnode; // work around flow
  7280. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  7281. } else {
  7282. var child = vnode.componentInstance = createComponentInstanceForVnode(
  7283. vnode,
  7284. activeInstance
  7285. );
  7286. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  7287. }
  7288. },
  7289. prepatch: function prepatch (oldVnode, vnode) {
  7290. var options = vnode.componentOptions;
  7291. var child = vnode.componentInstance = oldVnode.componentInstance;
  7292. updateChildComponent(
  7293. child,
  7294. options.propsData, // updated props
  7295. options.listeners, // updated listeners
  7296. vnode, // new parent vnode
  7297. options.children // new children
  7298. );
  7299. },
  7300. insert: function insert (vnode) {
  7301. var context = vnode.context;
  7302. var componentInstance = vnode.componentInstance;
  7303. if (!componentInstance._isMounted) {
  7304. callHook(componentInstance, 'onServiceCreated');
  7305. callHook(componentInstance, 'onServiceAttached');
  7306. componentInstance._isMounted = true;
  7307. callHook(componentInstance, 'mounted');
  7308. }
  7309. if (vnode.data.keepAlive) {
  7310. if (context._isMounted) {
  7311. // vue-router#1212
  7312. // During updates, a kept-alive component's child components may
  7313. // change, so directly walking the tree here may call activated hooks
  7314. // on incorrect children. Instead we push them into a queue which will
  7315. // be processed after the whole patch process ended.
  7316. queueActivatedComponent(componentInstance);
  7317. } else {
  7318. activateChildComponent(componentInstance, true /* direct */);
  7319. }
  7320. }
  7321. },
  7322. destroy: function destroy (vnode) {
  7323. var componentInstance = vnode.componentInstance;
  7324. if (!componentInstance._isDestroyed) {
  7325. if (!vnode.data.keepAlive) {
  7326. componentInstance.$destroy();
  7327. } else {
  7328. deactivateChildComponent(componentInstance, true /* direct */);
  7329. }
  7330. }
  7331. }
  7332. };
  7333. var hooksToMerge = Object.keys(componentVNodeHooks);
  7334. function createComponent (
  7335. Ctor,
  7336. data,
  7337. context,
  7338. children,
  7339. tag
  7340. ) {
  7341. if (isUndef(Ctor)) {
  7342. return
  7343. }
  7344. var baseCtor = context.$options._base;
  7345. // plain options object: turn it into a constructor
  7346. if (isObject(Ctor)) {
  7347. Ctor = baseCtor.extend(Ctor);
  7348. }
  7349. // if at this stage it's not a constructor or an async component factory,
  7350. // reject.
  7351. if (typeof Ctor !== 'function') {
  7352. if (true) {
  7353. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7354. }
  7355. return
  7356. }
  7357. // async component
  7358. var asyncFactory;
  7359. if (isUndef(Ctor.cid)) {
  7360. asyncFactory = Ctor;
  7361. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7362. if (Ctor === undefined) {
  7363. // return a placeholder node for async component, which is rendered
  7364. // as a comment node but preserves all the raw information for the node.
  7365. // the information will be used for async server-rendering and hydration.
  7366. return createAsyncPlaceholder(
  7367. asyncFactory,
  7368. data,
  7369. context,
  7370. children,
  7371. tag
  7372. )
  7373. }
  7374. }
  7375. data = data || {};
  7376. // resolve constructor options in case global mixins are applied after
  7377. // component constructor creation
  7378. resolveConstructorOptions(Ctor);
  7379. // transform component v-model data into props & events
  7380. if (isDef(data.model)) {
  7381. transformModel(Ctor.options, data);
  7382. }
  7383. // extract props
  7384. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7385. // functional component
  7386. if (isTrue(Ctor.options.functional)) {
  7387. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7388. }
  7389. // extract listeners, since these needs to be treated as
  7390. // child component listeners instead of DOM listeners
  7391. var listeners = data.on;
  7392. // replace with listeners with .native modifier
  7393. // so it gets processed during parent component patch.
  7394. data.on = data.nativeOn;
  7395. if (isTrue(Ctor.options.abstract)) {
  7396. // abstract components do not keep anything
  7397. // other than props & listeners & slot
  7398. // work around flow
  7399. var slot = data.slot;
  7400. data = {};
  7401. if (slot) {
  7402. data.slot = slot;
  7403. }
  7404. }
  7405. // install component management hooks onto the placeholder node
  7406. installComponentHooks(data);
  7407. // return a placeholder vnode
  7408. var name = Ctor.options.name || tag;
  7409. var vnode = new VNode(
  7410. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7411. data, undefined, undefined, undefined, context,
  7412. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7413. asyncFactory
  7414. );
  7415. return vnode
  7416. }
  7417. function createComponentInstanceForVnode (
  7418. vnode, // we know it's MountedComponentVNode but flow doesn't
  7419. parent // activeInstance in lifecycle state
  7420. ) {
  7421. var options = {
  7422. _isComponent: true,
  7423. _parentVnode: vnode,
  7424. parent: parent
  7425. };
  7426. // check inline-template render functions
  7427. var inlineTemplate = vnode.data.inlineTemplate;
  7428. if (isDef(inlineTemplate)) {
  7429. options.render = inlineTemplate.render;
  7430. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7431. }
  7432. return new vnode.componentOptions.Ctor(options)
  7433. }
  7434. function installComponentHooks (data) {
  7435. var hooks = data.hook || (data.hook = {});
  7436. for (var i = 0; i < hooksToMerge.length; i++) {
  7437. var key = hooksToMerge[i];
  7438. var existing = hooks[key];
  7439. var toMerge = componentVNodeHooks[key];
  7440. if (existing !== toMerge && !(existing && existing._merged)) {
  7441. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7442. }
  7443. }
  7444. }
  7445. function mergeHook$1 (f1, f2) {
  7446. var merged = function (a, b) {
  7447. // flow complains about extra args which is why we use any
  7448. f1(a, b);
  7449. f2(a, b);
  7450. };
  7451. merged._merged = true;
  7452. return merged
  7453. }
  7454. // transform component v-model info (value and callback) into
  7455. // prop and event handler respectively.
  7456. function transformModel (options, data) {
  7457. var prop = (options.model && options.model.prop) || 'value';
  7458. var event = (options.model && options.model.event) || 'input'
  7459. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7460. var on = data.on || (data.on = {});
  7461. var existing = on[event];
  7462. var callback = data.model.callback;
  7463. if (isDef(existing)) {
  7464. if (
  7465. Array.isArray(existing)
  7466. ? existing.indexOf(callback) === -1
  7467. : existing !== callback
  7468. ) {
  7469. on[event] = [callback].concat(existing);
  7470. }
  7471. } else {
  7472. on[event] = callback;
  7473. }
  7474. }
  7475. /* */
  7476. var SIMPLE_NORMALIZE = 1;
  7477. var ALWAYS_NORMALIZE = 2;
  7478. // wrapper function for providing a more flexible interface
  7479. // without getting yelled at by flow
  7480. function createElement (
  7481. context,
  7482. tag,
  7483. data,
  7484. children,
  7485. normalizationType,
  7486. alwaysNormalize
  7487. ) {
  7488. if (Array.isArray(data) || isPrimitive(data)) {
  7489. normalizationType = children;
  7490. children = data;
  7491. data = undefined;
  7492. }
  7493. if (isTrue(alwaysNormalize)) {
  7494. normalizationType = ALWAYS_NORMALIZE;
  7495. }
  7496. return _createElement(context, tag, data, children, normalizationType)
  7497. }
  7498. function _createElement (
  7499. context,
  7500. tag,
  7501. data,
  7502. children,
  7503. normalizationType
  7504. ) {
  7505. if (isDef(data) && isDef((data).__ob__)) {
  7506. true && warn(
  7507. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7508. 'Always create fresh vnode data objects in each render!',
  7509. context
  7510. );
  7511. return createEmptyVNode()
  7512. }
  7513. // object syntax in v-bind
  7514. if (isDef(data) && isDef(data.is)) {
  7515. tag = data.is;
  7516. }
  7517. if (!tag) {
  7518. // in case of component :is set to falsy value
  7519. return createEmptyVNode()
  7520. }
  7521. // warn against non-primitive key
  7522. if ( true &&
  7523. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7524. ) {
  7525. {
  7526. warn(
  7527. 'Avoid using non-primitive value as key, ' +
  7528. 'use string/number value instead.',
  7529. context
  7530. );
  7531. }
  7532. }
  7533. // support single function children as default scoped slot
  7534. if (Array.isArray(children) &&
  7535. typeof children[0] === 'function'
  7536. ) {
  7537. data = data || {};
  7538. data.scopedSlots = { default: children[0] };
  7539. children.length = 0;
  7540. }
  7541. if (normalizationType === ALWAYS_NORMALIZE) {
  7542. children = normalizeChildren(children);
  7543. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7544. children = simpleNormalizeChildren(children);
  7545. }
  7546. var vnode, ns;
  7547. if (typeof tag === 'string') {
  7548. var Ctor;
  7549. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7550. if (config.isReservedTag(tag)) {
  7551. // platform built-in elements
  7552. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7553. warn(
  7554. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7555. context
  7556. );
  7557. }
  7558. vnode = new VNode(
  7559. config.parsePlatformTagName(tag), data, children,
  7560. undefined, undefined, context
  7561. );
  7562. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7563. // component
  7564. vnode = createComponent(Ctor, data, context, children, tag);
  7565. } else {
  7566. // unknown or unlisted namespaced elements
  7567. // check at runtime because it may get assigned a namespace when its
  7568. // parent normalizes children
  7569. vnode = new VNode(
  7570. tag, data, children,
  7571. undefined, undefined, context
  7572. );
  7573. }
  7574. } else {
  7575. // direct component options / constructor
  7576. vnode = createComponent(tag, data, context, children);
  7577. }
  7578. if (Array.isArray(vnode)) {
  7579. return vnode
  7580. } else if (isDef(vnode)) {
  7581. if (isDef(ns)) { applyNS(vnode, ns); }
  7582. if (isDef(data)) { registerDeepBindings(data); }
  7583. return vnode
  7584. } else {
  7585. return createEmptyVNode()
  7586. }
  7587. }
  7588. function applyNS (vnode, ns, force) {
  7589. vnode.ns = ns;
  7590. if (vnode.tag === 'foreignObject') {
  7591. // use default namespace inside foreignObject
  7592. ns = undefined;
  7593. force = true;
  7594. }
  7595. if (isDef(vnode.children)) {
  7596. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7597. var child = vnode.children[i];
  7598. if (isDef(child.tag) && (
  7599. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7600. applyNS(child, ns, force);
  7601. }
  7602. }
  7603. }
  7604. }
  7605. // ref #5318
  7606. // necessary to ensure parent re-render when deep bindings like :style and
  7607. // :class are used on slot nodes
  7608. function registerDeepBindings (data) {
  7609. if (isObject(data.style)) {
  7610. traverse(data.style);
  7611. }
  7612. if (isObject(data.class)) {
  7613. traverse(data.class);
  7614. }
  7615. }
  7616. /* */
  7617. function initRender (vm) {
  7618. vm._vnode = null; // the root of the child tree
  7619. vm._staticTrees = null; // v-once cached trees
  7620. var options = vm.$options;
  7621. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7622. var renderContext = parentVnode && parentVnode.context;
  7623. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7624. vm.$scopedSlots = emptyObject;
  7625. // bind the createElement fn to this instance
  7626. // so that we get proper render context inside it.
  7627. // args order: tag, data, children, normalizationType, alwaysNormalize
  7628. // internal version is used by render functions compiled from templates
  7629. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7630. // normalization is always applied for the public version, used in
  7631. // user-written render functions.
  7632. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7633. // $attrs & $listeners are exposed for easier HOC creation.
  7634. // they need to be reactive so that HOCs using them are always updated
  7635. var parentData = parentVnode && parentVnode.data;
  7636. /* istanbul ignore else */
  7637. if (true) {
  7638. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7639. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7640. }, true);
  7641. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7642. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7643. }, true);
  7644. } else {}
  7645. }
  7646. var currentRenderingInstance = null;
  7647. function renderMixin (Vue) {
  7648. // install runtime convenience helpers
  7649. installRenderHelpers(Vue.prototype);
  7650. Vue.prototype.$nextTick = function (fn) {
  7651. return nextTick(fn, this)
  7652. };
  7653. Vue.prototype._render = function () {
  7654. var vm = this;
  7655. var ref = vm.$options;
  7656. var render = ref.render;
  7657. var _parentVnode = ref._parentVnode;
  7658. if (_parentVnode) {
  7659. vm.$scopedSlots = normalizeScopedSlots(
  7660. _parentVnode.data.scopedSlots,
  7661. vm.$slots,
  7662. vm.$scopedSlots
  7663. );
  7664. }
  7665. // set parent vnode. this allows render functions to have access
  7666. // to the data on the placeholder node.
  7667. vm.$vnode = _parentVnode;
  7668. // render self
  7669. var vnode;
  7670. try {
  7671. // There's no need to maintain a stack because all render fns are called
  7672. // separately from one another. Nested component's render fns are called
  7673. // when parent component is patched.
  7674. currentRenderingInstance = vm;
  7675. vnode = render.call(vm._renderProxy, vm.$createElement);
  7676. } catch (e) {
  7677. handleError(e, vm, "render");
  7678. // return error render result,
  7679. // or previous vnode to prevent render error causing blank component
  7680. /* istanbul ignore else */
  7681. if ( true && vm.$options.renderError) {
  7682. try {
  7683. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7684. } catch (e) {
  7685. handleError(e, vm, "renderError");
  7686. vnode = vm._vnode;
  7687. }
  7688. } else {
  7689. vnode = vm._vnode;
  7690. }
  7691. } finally {
  7692. currentRenderingInstance = null;
  7693. }
  7694. // if the returned array contains only a single node, allow it
  7695. if (Array.isArray(vnode) && vnode.length === 1) {
  7696. vnode = vnode[0];
  7697. }
  7698. // return empty vnode in case the render function errored out
  7699. if (!(vnode instanceof VNode)) {
  7700. if ( true && Array.isArray(vnode)) {
  7701. warn(
  7702. 'Multiple root nodes returned from render function. Render function ' +
  7703. 'should return a single root node.',
  7704. vm
  7705. );
  7706. }
  7707. vnode = createEmptyVNode();
  7708. }
  7709. // set parent
  7710. vnode.parent = _parentVnode;
  7711. return vnode
  7712. };
  7713. }
  7714. /* */
  7715. function ensureCtor (comp, base) {
  7716. if (
  7717. comp.__esModule ||
  7718. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7719. ) {
  7720. comp = comp.default;
  7721. }
  7722. return isObject(comp)
  7723. ? base.extend(comp)
  7724. : comp
  7725. }
  7726. function createAsyncPlaceholder (
  7727. factory,
  7728. data,
  7729. context,
  7730. children,
  7731. tag
  7732. ) {
  7733. var node = createEmptyVNode();
  7734. node.asyncFactory = factory;
  7735. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7736. return node
  7737. }
  7738. function resolveAsyncComponent (
  7739. factory,
  7740. baseCtor
  7741. ) {
  7742. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7743. return factory.errorComp
  7744. }
  7745. if (isDef(factory.resolved)) {
  7746. return factory.resolved
  7747. }
  7748. var owner = currentRenderingInstance;
  7749. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7750. // already pending
  7751. factory.owners.push(owner);
  7752. }
  7753. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7754. return factory.loadingComp
  7755. }
  7756. if (owner && !isDef(factory.owners)) {
  7757. var owners = factory.owners = [owner];
  7758. var sync = true;
  7759. var timerLoading = null;
  7760. var timerTimeout = null
  7761. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7762. var forceRender = function (renderCompleted) {
  7763. for (var i = 0, l = owners.length; i < l; i++) {
  7764. (owners[i]).$forceUpdate();
  7765. }
  7766. if (renderCompleted) {
  7767. owners.length = 0;
  7768. if (timerLoading !== null) {
  7769. clearTimeout(timerLoading);
  7770. timerLoading = null;
  7771. }
  7772. if (timerTimeout !== null) {
  7773. clearTimeout(timerTimeout);
  7774. timerTimeout = null;
  7775. }
  7776. }
  7777. };
  7778. var resolve = once(function (res) {
  7779. // cache resolved
  7780. factory.resolved = ensureCtor(res, baseCtor);
  7781. // invoke callbacks only if this is not a synchronous resolve
  7782. // (async resolves are shimmed as synchronous during SSR)
  7783. if (!sync) {
  7784. forceRender(true);
  7785. } else {
  7786. owners.length = 0;
  7787. }
  7788. });
  7789. var reject = once(function (reason) {
  7790. true && warn(
  7791. "Failed to resolve async component: " + (String(factory)) +
  7792. (reason ? ("\nReason: " + reason) : '')
  7793. );
  7794. if (isDef(factory.errorComp)) {
  7795. factory.error = true;
  7796. forceRender(true);
  7797. }
  7798. });
  7799. var res = factory(resolve, reject);
  7800. if (isObject(res)) {
  7801. if (isPromise(res)) {
  7802. // () => Promise
  7803. if (isUndef(factory.resolved)) {
  7804. res.then(resolve, reject);
  7805. }
  7806. } else if (isPromise(res.component)) {
  7807. res.component.then(resolve, reject);
  7808. if (isDef(res.error)) {
  7809. factory.errorComp = ensureCtor(res.error, baseCtor);
  7810. }
  7811. if (isDef(res.loading)) {
  7812. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7813. if (res.delay === 0) {
  7814. factory.loading = true;
  7815. } else {
  7816. timerLoading = setTimeout(function () {
  7817. timerLoading = null;
  7818. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7819. factory.loading = true;
  7820. forceRender(false);
  7821. }
  7822. }, res.delay || 200);
  7823. }
  7824. }
  7825. if (isDef(res.timeout)) {
  7826. timerTimeout = setTimeout(function () {
  7827. timerTimeout = null;
  7828. if (isUndef(factory.resolved)) {
  7829. reject(
  7830. true
  7831. ? ("timeout (" + (res.timeout) + "ms)")
  7832. : undefined
  7833. );
  7834. }
  7835. }, res.timeout);
  7836. }
  7837. }
  7838. }
  7839. sync = false;
  7840. // return in case resolved synchronously
  7841. return factory.loading
  7842. ? factory.loadingComp
  7843. : factory.resolved
  7844. }
  7845. }
  7846. /* */
  7847. function isAsyncPlaceholder (node) {
  7848. return node.isComment && node.asyncFactory
  7849. }
  7850. /* */
  7851. function getFirstComponentChild (children) {
  7852. if (Array.isArray(children)) {
  7853. for (var i = 0; i < children.length; i++) {
  7854. var c = children[i];
  7855. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7856. return c
  7857. }
  7858. }
  7859. }
  7860. }
  7861. /* */
  7862. /* */
  7863. function initEvents (vm) {
  7864. vm._events = Object.create(null);
  7865. vm._hasHookEvent = false;
  7866. // init parent attached events
  7867. var listeners = vm.$options._parentListeners;
  7868. if (listeners) {
  7869. updateComponentListeners(vm, listeners);
  7870. }
  7871. }
  7872. var target;
  7873. function add (event, fn) {
  7874. target.$on(event, fn);
  7875. }
  7876. function remove$1 (event, fn) {
  7877. target.$off(event, fn);
  7878. }
  7879. function createOnceHandler (event, fn) {
  7880. var _target = target;
  7881. return function onceHandler () {
  7882. var res = fn.apply(null, arguments);
  7883. if (res !== null) {
  7884. _target.$off(event, onceHandler);
  7885. }
  7886. }
  7887. }
  7888. function updateComponentListeners (
  7889. vm,
  7890. listeners,
  7891. oldListeners
  7892. ) {
  7893. target = vm;
  7894. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7895. target = undefined;
  7896. }
  7897. function eventsMixin (Vue) {
  7898. var hookRE = /^hook:/;
  7899. Vue.prototype.$on = function (event, fn) {
  7900. var vm = this;
  7901. if (Array.isArray(event)) {
  7902. for (var i = 0, l = event.length; i < l; i++) {
  7903. vm.$on(event[i], fn);
  7904. }
  7905. } else {
  7906. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7907. // optimize hook:event cost by using a boolean flag marked at registration
  7908. // instead of a hash lookup
  7909. if (hookRE.test(event)) {
  7910. vm._hasHookEvent = true;
  7911. }
  7912. }
  7913. return vm
  7914. };
  7915. Vue.prototype.$once = function (event, fn) {
  7916. var vm = this;
  7917. function on () {
  7918. vm.$off(event, on);
  7919. fn.apply(vm, arguments);
  7920. }
  7921. on.fn = fn;
  7922. vm.$on(event, on);
  7923. return vm
  7924. };
  7925. Vue.prototype.$off = function (event, fn) {
  7926. var vm = this;
  7927. // all
  7928. if (!arguments.length) {
  7929. vm._events = Object.create(null);
  7930. return vm
  7931. }
  7932. // array of events
  7933. if (Array.isArray(event)) {
  7934. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7935. vm.$off(event[i$1], fn);
  7936. }
  7937. return vm
  7938. }
  7939. // specific event
  7940. var cbs = vm._events[event];
  7941. if (!cbs) {
  7942. return vm
  7943. }
  7944. if (!fn) {
  7945. vm._events[event] = null;
  7946. return vm
  7947. }
  7948. // specific handler
  7949. var cb;
  7950. var i = cbs.length;
  7951. while (i--) {
  7952. cb = cbs[i];
  7953. if (cb === fn || cb.fn === fn) {
  7954. cbs.splice(i, 1);
  7955. break
  7956. }
  7957. }
  7958. return vm
  7959. };
  7960. Vue.prototype.$emit = function (event) {
  7961. var vm = this;
  7962. if (true) {
  7963. var lowerCaseEvent = event.toLowerCase();
  7964. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7965. tip(
  7966. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7967. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7968. "Note that HTML attributes are case-insensitive and you cannot use " +
  7969. "v-on to listen to camelCase events when using in-DOM templates. " +
  7970. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7971. );
  7972. }
  7973. }
  7974. var cbs = vm._events[event];
  7975. if (cbs) {
  7976. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7977. var args = toArray(arguments, 1);
  7978. var info = "event handler for \"" + event + "\"";
  7979. for (var i = 0, l = cbs.length; i < l; i++) {
  7980. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7981. }
  7982. }
  7983. return vm
  7984. };
  7985. }
  7986. /* */
  7987. var activeInstance = null;
  7988. var isUpdatingChildComponent = false;
  7989. function setActiveInstance(vm) {
  7990. var prevActiveInstance = activeInstance;
  7991. activeInstance = vm;
  7992. return function () {
  7993. activeInstance = prevActiveInstance;
  7994. }
  7995. }
  7996. function initLifecycle (vm) {
  7997. var options = vm.$options;
  7998. // locate first non-abstract parent
  7999. var parent = options.parent;
  8000. if (parent && !options.abstract) {
  8001. while (parent.$options.abstract && parent.$parent) {
  8002. parent = parent.$parent;
  8003. }
  8004. parent.$children.push(vm);
  8005. }
  8006. vm.$parent = parent;
  8007. vm.$root = parent ? parent.$root : vm;
  8008. vm.$children = [];
  8009. vm.$refs = {};
  8010. vm._watcher = null;
  8011. vm._inactive = null;
  8012. vm._directInactive = false;
  8013. vm._isMounted = false;
  8014. vm._isDestroyed = false;
  8015. vm._isBeingDestroyed = false;
  8016. }
  8017. function lifecycleMixin (Vue) {
  8018. Vue.prototype._update = function (vnode, hydrating) {
  8019. var vm = this;
  8020. var prevEl = vm.$el;
  8021. var prevVnode = vm._vnode;
  8022. var restoreActiveInstance = setActiveInstance(vm);
  8023. vm._vnode = vnode;
  8024. // Vue.prototype.__patch__ is injected in entry points
  8025. // based on the rendering backend used.
  8026. if (!prevVnode) {
  8027. // initial render
  8028. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  8029. } else {
  8030. // updates
  8031. vm.$el = vm.__patch__(prevVnode, vnode);
  8032. }
  8033. restoreActiveInstance();
  8034. // update __vue__ reference
  8035. if (prevEl) {
  8036. prevEl.__vue__ = null;
  8037. }
  8038. if (vm.$el) {
  8039. vm.$el.__vue__ = vm;
  8040. }
  8041. // if parent is an HOC, update its $el as well
  8042. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  8043. vm.$parent.$el = vm.$el;
  8044. }
  8045. // updated hook is called by the scheduler to ensure that children are
  8046. // updated in a parent's updated hook.
  8047. };
  8048. Vue.prototype.$forceUpdate = function () {
  8049. var vm = this;
  8050. if (vm._watcher) {
  8051. vm._watcher.update();
  8052. }
  8053. };
  8054. Vue.prototype.$destroy = function () {
  8055. var vm = this;
  8056. if (vm._isBeingDestroyed) {
  8057. return
  8058. }
  8059. callHook(vm, 'beforeDestroy');
  8060. vm._isBeingDestroyed = true;
  8061. // remove self from parent
  8062. var parent = vm.$parent;
  8063. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  8064. remove(parent.$children, vm);
  8065. }
  8066. // teardown watchers
  8067. if (vm._watcher) {
  8068. vm._watcher.teardown();
  8069. }
  8070. var i = vm._watchers.length;
  8071. while (i--) {
  8072. vm._watchers[i].teardown();
  8073. }
  8074. // remove reference from data ob
  8075. // frozen object may not have observer.
  8076. if (vm._data.__ob__) {
  8077. vm._data.__ob__.vmCount--;
  8078. }
  8079. // call the last hook...
  8080. vm._isDestroyed = true;
  8081. // invoke destroy hooks on current rendered tree
  8082. vm.__patch__(vm._vnode, null);
  8083. // fire destroyed hook
  8084. callHook(vm, 'destroyed');
  8085. // turn off all instance listeners.
  8086. vm.$off();
  8087. // remove __vue__ reference
  8088. if (vm.$el) {
  8089. vm.$el.__vue__ = null;
  8090. }
  8091. // release circular reference (#6759)
  8092. if (vm.$vnode) {
  8093. vm.$vnode.parent = null;
  8094. }
  8095. };
  8096. }
  8097. function updateChildComponent (
  8098. vm,
  8099. propsData,
  8100. listeners,
  8101. parentVnode,
  8102. renderChildren
  8103. ) {
  8104. if (true) {
  8105. isUpdatingChildComponent = true;
  8106. }
  8107. // determine whether component has slot children
  8108. // we need to do this before overwriting $options._renderChildren.
  8109. // check if there are dynamic scopedSlots (hand-written or compiled but with
  8110. // dynamic slot names). Static scoped slots compiled from template has the
  8111. // "$stable" marker.
  8112. var newScopedSlots = parentVnode.data.scopedSlots;
  8113. var oldScopedSlots = vm.$scopedSlots;
  8114. var hasDynamicScopedSlot = !!(
  8115. (newScopedSlots && !newScopedSlots.$stable) ||
  8116. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  8117. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  8118. );
  8119. // Any static slot children from the parent may have changed during parent's
  8120. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  8121. // update is necessary to ensure correctness.
  8122. var needsForceUpdate = !!(
  8123. renderChildren || // has new static slots
  8124. vm.$options._renderChildren || // has old static slots
  8125. hasDynamicScopedSlot
  8126. );
  8127. vm.$options._parentVnode = parentVnode;
  8128. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  8129. if (vm._vnode) { // update child tree's parent
  8130. vm._vnode.parent = parentVnode;
  8131. }
  8132. vm.$options._renderChildren = renderChildren;
  8133. // update $attrs and $listeners hash
  8134. // these are also reactive so they may trigger child update if the child
  8135. // used them during render
  8136. vm.$attrs = parentVnode.data.attrs || emptyObject;
  8137. vm.$listeners = listeners || emptyObject;
  8138. // update props
  8139. if (propsData && vm.$options.props) {
  8140. toggleObserving(false);
  8141. var props = vm._props;
  8142. var propKeys = vm.$options._propKeys || [];
  8143. for (var i = 0; i < propKeys.length; i++) {
  8144. var key = propKeys[i];
  8145. var propOptions = vm.$options.props; // wtf flow?
  8146. props[key] = validateProp(key, propOptions, propsData, vm);
  8147. }
  8148. toggleObserving(true);
  8149. // keep a copy of raw propsData
  8150. vm.$options.propsData = propsData;
  8151. }
  8152. // fixed by xxxxxx update properties(mp runtime)
  8153. vm._$updateProperties && vm._$updateProperties(vm);
  8154. // update listeners
  8155. listeners = listeners || emptyObject;
  8156. var oldListeners = vm.$options._parentListeners;
  8157. vm.$options._parentListeners = listeners;
  8158. updateComponentListeners(vm, listeners, oldListeners);
  8159. // resolve slots + force update if has children
  8160. if (needsForceUpdate) {
  8161. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  8162. vm.$forceUpdate();
  8163. }
  8164. if (true) {
  8165. isUpdatingChildComponent = false;
  8166. }
  8167. }
  8168. function isInInactiveTree (vm) {
  8169. while (vm && (vm = vm.$parent)) {
  8170. if (vm._inactive) { return true }
  8171. }
  8172. return false
  8173. }
  8174. function activateChildComponent (vm, direct) {
  8175. if (direct) {
  8176. vm._directInactive = false;
  8177. if (isInInactiveTree(vm)) {
  8178. return
  8179. }
  8180. } else if (vm._directInactive) {
  8181. return
  8182. }
  8183. if (vm._inactive || vm._inactive === null) {
  8184. vm._inactive = false;
  8185. for (var i = 0; i < vm.$children.length; i++) {
  8186. activateChildComponent(vm.$children[i]);
  8187. }
  8188. callHook(vm, 'activated');
  8189. }
  8190. }
  8191. function deactivateChildComponent (vm, direct) {
  8192. if (direct) {
  8193. vm._directInactive = true;
  8194. if (isInInactiveTree(vm)) {
  8195. return
  8196. }
  8197. }
  8198. if (!vm._inactive) {
  8199. vm._inactive = true;
  8200. for (var i = 0; i < vm.$children.length; i++) {
  8201. deactivateChildComponent(vm.$children[i]);
  8202. }
  8203. callHook(vm, 'deactivated');
  8204. }
  8205. }
  8206. function callHook (vm, hook) {
  8207. // #7573 disable dep collection when invoking lifecycle hooks
  8208. pushTarget();
  8209. var handlers = vm.$options[hook];
  8210. var info = hook + " hook";
  8211. if (handlers) {
  8212. for (var i = 0, j = handlers.length; i < j; i++) {
  8213. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  8214. }
  8215. }
  8216. if (vm._hasHookEvent) {
  8217. vm.$emit('hook:' + hook);
  8218. }
  8219. popTarget();
  8220. }
  8221. /* */
  8222. var MAX_UPDATE_COUNT = 100;
  8223. var queue = [];
  8224. var activatedChildren = [];
  8225. var has = {};
  8226. var circular = {};
  8227. var waiting = false;
  8228. var flushing = false;
  8229. var index = 0;
  8230. /**
  8231. * Reset the scheduler's state.
  8232. */
  8233. function resetSchedulerState () {
  8234. index = queue.length = activatedChildren.length = 0;
  8235. has = {};
  8236. if (true) {
  8237. circular = {};
  8238. }
  8239. waiting = flushing = false;
  8240. }
  8241. // Async edge case #6566 requires saving the timestamp when event listeners are
  8242. // attached. However, calling performance.now() has a perf overhead especially
  8243. // if the page has thousands of event listeners. Instead, we take a timestamp
  8244. // every time the scheduler flushes and use that for all event listeners
  8245. // attached during that flush.
  8246. var currentFlushTimestamp = 0;
  8247. // Async edge case fix requires storing an event listener's attach timestamp.
  8248. var getNow = Date.now;
  8249. // Determine what event timestamp the browser is using. Annoyingly, the
  8250. // timestamp can either be hi-res (relative to page load) or low-res
  8251. // (relative to UNIX epoch), so in order to compare time we have to use the
  8252. // same timestamp type when saving the flush timestamp.
  8253. // All IE versions use low-res event timestamps, and have problematic clock
  8254. // implementations (#9632)
  8255. if (inBrowser && !isIE) {
  8256. var performance = window.performance;
  8257. if (
  8258. performance &&
  8259. typeof performance.now === 'function' &&
  8260. getNow() > document.createEvent('Event').timeStamp
  8261. ) {
  8262. // if the event timestamp, although evaluated AFTER the Date.now(), is
  8263. // smaller than it, it means the event is using a hi-res timestamp,
  8264. // and we need to use the hi-res version for event listener timestamps as
  8265. // well.
  8266. getNow = function () { return performance.now(); };
  8267. }
  8268. }
  8269. /**
  8270. * Flush both queues and run the watchers.
  8271. */
  8272. function flushSchedulerQueue () {
  8273. currentFlushTimestamp = getNow();
  8274. flushing = true;
  8275. var watcher, id;
  8276. // Sort queue before flush.
  8277. // This ensures that:
  8278. // 1. Components are updated from parent to child. (because parent is always
  8279. // created before the child)
  8280. // 2. A component's user watchers are run before its render watcher (because
  8281. // user watchers are created before the render watcher)
  8282. // 3. If a component is destroyed during a parent component's watcher run,
  8283. // its watchers can be skipped.
  8284. queue.sort(function (a, b) { return a.id - b.id; });
  8285. // do not cache length because more watchers might be pushed
  8286. // as we run existing watchers
  8287. for (index = 0; index < queue.length; index++) {
  8288. watcher = queue[index];
  8289. if (watcher.before) {
  8290. watcher.before();
  8291. }
  8292. id = watcher.id;
  8293. has[id] = null;
  8294. watcher.run();
  8295. // in dev build, check and stop circular updates.
  8296. if ( true && has[id] != null) {
  8297. circular[id] = (circular[id] || 0) + 1;
  8298. if (circular[id] > MAX_UPDATE_COUNT) {
  8299. warn(
  8300. 'You may have an infinite update loop ' + (
  8301. watcher.user
  8302. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  8303. : "in a component render function."
  8304. ),
  8305. watcher.vm
  8306. );
  8307. break
  8308. }
  8309. }
  8310. }
  8311. // keep copies of post queues before resetting state
  8312. var activatedQueue = activatedChildren.slice();
  8313. var updatedQueue = queue.slice();
  8314. resetSchedulerState();
  8315. // call component updated and activated hooks
  8316. callActivatedHooks(activatedQueue);
  8317. callUpdatedHooks(updatedQueue);
  8318. // devtool hook
  8319. /* istanbul ignore if */
  8320. if (devtools && config.devtools) {
  8321. devtools.emit('flush');
  8322. }
  8323. }
  8324. function callUpdatedHooks (queue) {
  8325. var i = queue.length;
  8326. while (i--) {
  8327. var watcher = queue[i];
  8328. var vm = watcher.vm;
  8329. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8330. callHook(vm, 'updated');
  8331. }
  8332. }
  8333. }
  8334. /**
  8335. * Queue a kept-alive component that was activated during patch.
  8336. * The queue will be processed after the entire tree has been patched.
  8337. */
  8338. function queueActivatedComponent (vm) {
  8339. // setting _inactive to false here so that a render function can
  8340. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8341. vm._inactive = false;
  8342. activatedChildren.push(vm);
  8343. }
  8344. function callActivatedHooks (queue) {
  8345. for (var i = 0; i < queue.length; i++) {
  8346. queue[i]._inactive = true;
  8347. activateChildComponent(queue[i], true /* true */);
  8348. }
  8349. }
  8350. /**
  8351. * Push a watcher into the watcher queue.
  8352. * Jobs with duplicate IDs will be skipped unless it's
  8353. * pushed when the queue is being flushed.
  8354. */
  8355. function queueWatcher (watcher) {
  8356. var id = watcher.id;
  8357. if (has[id] == null) {
  8358. has[id] = true;
  8359. if (!flushing) {
  8360. queue.push(watcher);
  8361. } else {
  8362. // if already flushing, splice the watcher based on its id
  8363. // if already past its id, it will be run next immediately.
  8364. var i = queue.length - 1;
  8365. while (i > index && queue[i].id > watcher.id) {
  8366. i--;
  8367. }
  8368. queue.splice(i + 1, 0, watcher);
  8369. }
  8370. // queue the flush
  8371. if (!waiting) {
  8372. waiting = true;
  8373. if ( true && !config.async) {
  8374. flushSchedulerQueue();
  8375. return
  8376. }
  8377. nextTick(flushSchedulerQueue);
  8378. }
  8379. }
  8380. }
  8381. /* */
  8382. var uid$2 = 0;
  8383. /**
  8384. * A watcher parses an expression, collects dependencies,
  8385. * and fires callback when the expression value changes.
  8386. * This is used for both the $watch() api and directives.
  8387. */
  8388. var Watcher = function Watcher (
  8389. vm,
  8390. expOrFn,
  8391. cb,
  8392. options,
  8393. isRenderWatcher
  8394. ) {
  8395. this.vm = vm;
  8396. if (isRenderWatcher) {
  8397. vm._watcher = this;
  8398. }
  8399. vm._watchers.push(this);
  8400. // options
  8401. if (options) {
  8402. this.deep = !!options.deep;
  8403. this.user = !!options.user;
  8404. this.lazy = !!options.lazy;
  8405. this.sync = !!options.sync;
  8406. this.before = options.before;
  8407. } else {
  8408. this.deep = this.user = this.lazy = this.sync = false;
  8409. }
  8410. this.cb = cb;
  8411. this.id = ++uid$2; // uid for batching
  8412. this.active = true;
  8413. this.dirty = this.lazy; // for lazy watchers
  8414. this.deps = [];
  8415. this.newDeps = [];
  8416. this.depIds = new _Set();
  8417. this.newDepIds = new _Set();
  8418. this.expression = true
  8419. ? expOrFn.toString()
  8420. : undefined;
  8421. // parse expression for getter
  8422. if (typeof expOrFn === 'function') {
  8423. this.getter = expOrFn;
  8424. } else {
  8425. this.getter = parsePath(expOrFn);
  8426. if (!this.getter) {
  8427. this.getter = noop;
  8428. true && warn(
  8429. "Failed watching path: \"" + expOrFn + "\" " +
  8430. 'Watcher only accepts simple dot-delimited paths. ' +
  8431. 'For full control, use a function instead.',
  8432. vm
  8433. );
  8434. }
  8435. }
  8436. this.value = this.lazy
  8437. ? undefined
  8438. : this.get();
  8439. };
  8440. /**
  8441. * Evaluate the getter, and re-collect dependencies.
  8442. */
  8443. Watcher.prototype.get = function get () {
  8444. pushTarget(this);
  8445. var value;
  8446. var vm = this.vm;
  8447. try {
  8448. value = this.getter.call(vm, vm);
  8449. } catch (e) {
  8450. if (this.user) {
  8451. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8452. } else {
  8453. throw e
  8454. }
  8455. } finally {
  8456. // "touch" every property so they are all tracked as
  8457. // dependencies for deep watching
  8458. if (this.deep) {
  8459. traverse(value);
  8460. }
  8461. popTarget();
  8462. this.cleanupDeps();
  8463. }
  8464. return value
  8465. };
  8466. /**
  8467. * Add a dependency to this directive.
  8468. */
  8469. Watcher.prototype.addDep = function addDep (dep) {
  8470. var id = dep.id;
  8471. if (!this.newDepIds.has(id)) {
  8472. this.newDepIds.add(id);
  8473. this.newDeps.push(dep);
  8474. if (!this.depIds.has(id)) {
  8475. dep.addSub(this);
  8476. }
  8477. }
  8478. };
  8479. /**
  8480. * Clean up for dependency collection.
  8481. */
  8482. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8483. var i = this.deps.length;
  8484. while (i--) {
  8485. var dep = this.deps[i];
  8486. if (!this.newDepIds.has(dep.id)) {
  8487. dep.removeSub(this);
  8488. }
  8489. }
  8490. var tmp = this.depIds;
  8491. this.depIds = this.newDepIds;
  8492. this.newDepIds = tmp;
  8493. this.newDepIds.clear();
  8494. tmp = this.deps;
  8495. this.deps = this.newDeps;
  8496. this.newDeps = tmp;
  8497. this.newDeps.length = 0;
  8498. };
  8499. /**
  8500. * Subscriber interface.
  8501. * Will be called when a dependency changes.
  8502. */
  8503. Watcher.prototype.update = function update () {
  8504. /* istanbul ignore else */
  8505. if (this.lazy) {
  8506. this.dirty = true;
  8507. } else if (this.sync) {
  8508. this.run();
  8509. } else {
  8510. queueWatcher(this);
  8511. }
  8512. };
  8513. /**
  8514. * Scheduler job interface.
  8515. * Will be called by the scheduler.
  8516. */
  8517. Watcher.prototype.run = function run () {
  8518. if (this.active) {
  8519. var value = this.get();
  8520. if (
  8521. value !== this.value ||
  8522. // Deep watchers and watchers on Object/Arrays should fire even
  8523. // when the value is the same, because the value may
  8524. // have mutated.
  8525. isObject(value) ||
  8526. this.deep
  8527. ) {
  8528. // set new value
  8529. var oldValue = this.value;
  8530. this.value = value;
  8531. if (this.user) {
  8532. try {
  8533. this.cb.call(this.vm, value, oldValue);
  8534. } catch (e) {
  8535. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8536. }
  8537. } else {
  8538. this.cb.call(this.vm, value, oldValue);
  8539. }
  8540. }
  8541. }
  8542. };
  8543. /**
  8544. * Evaluate the value of the watcher.
  8545. * This only gets called for lazy watchers.
  8546. */
  8547. Watcher.prototype.evaluate = function evaluate () {
  8548. this.value = this.get();
  8549. this.dirty = false;
  8550. };
  8551. /**
  8552. * Depend on all deps collected by this watcher.
  8553. */
  8554. Watcher.prototype.depend = function depend () {
  8555. var i = this.deps.length;
  8556. while (i--) {
  8557. this.deps[i].depend();
  8558. }
  8559. };
  8560. /**
  8561. * Remove self from all dependencies' subscriber list.
  8562. */
  8563. Watcher.prototype.teardown = function teardown () {
  8564. if (this.active) {
  8565. // remove self from vm's watcher list
  8566. // this is a somewhat expensive operation so we skip it
  8567. // if the vm is being destroyed.
  8568. if (!this.vm._isBeingDestroyed) {
  8569. remove(this.vm._watchers, this);
  8570. }
  8571. var i = this.deps.length;
  8572. while (i--) {
  8573. this.deps[i].removeSub(this);
  8574. }
  8575. this.active = false;
  8576. }
  8577. };
  8578. /* */
  8579. var sharedPropertyDefinition = {
  8580. enumerable: true,
  8581. configurable: true,
  8582. get: noop,
  8583. set: noop
  8584. };
  8585. function proxy (target, sourceKey, key) {
  8586. sharedPropertyDefinition.get = function proxyGetter () {
  8587. return this[sourceKey][key]
  8588. };
  8589. sharedPropertyDefinition.set = function proxySetter (val) {
  8590. this[sourceKey][key] = val;
  8591. };
  8592. Object.defineProperty(target, key, sharedPropertyDefinition);
  8593. }
  8594. function initState (vm) {
  8595. vm._watchers = [];
  8596. var opts = vm.$options;
  8597. if (opts.props) { initProps(vm, opts.props); }
  8598. if (opts.methods) { initMethods(vm, opts.methods); }
  8599. if (opts.data) {
  8600. initData(vm);
  8601. } else {
  8602. observe(vm._data = {}, true /* asRootData */);
  8603. }
  8604. if (opts.computed) { initComputed(vm, opts.computed); }
  8605. if (opts.watch && opts.watch !== nativeWatch) {
  8606. initWatch(vm, opts.watch);
  8607. }
  8608. }
  8609. function initProps (vm, propsOptions) {
  8610. var propsData = vm.$options.propsData || {};
  8611. var props = vm._props = {};
  8612. // cache prop keys so that future props updates can iterate using Array
  8613. // instead of dynamic object key enumeration.
  8614. var keys = vm.$options._propKeys = [];
  8615. var isRoot = !vm.$parent;
  8616. // root instance props should be converted
  8617. if (!isRoot) {
  8618. toggleObserving(false);
  8619. }
  8620. var loop = function ( key ) {
  8621. keys.push(key);
  8622. var value = validateProp(key, propsOptions, propsData, vm);
  8623. /* istanbul ignore else */
  8624. if (true) {
  8625. var hyphenatedKey = hyphenate(key);
  8626. if (isReservedAttribute(hyphenatedKey) ||
  8627. config.isReservedAttr(hyphenatedKey)) {
  8628. warn(
  8629. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8630. vm
  8631. );
  8632. }
  8633. defineReactive$$1(props, key, value, function () {
  8634. if (!isRoot && !isUpdatingChildComponent) {
  8635. {
  8636. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  8637. return
  8638. }
  8639. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8640. if(
  8641. key === 'value' &&
  8642. Array.isArray(vm.$options.behaviors) &&
  8643. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8644. ){
  8645. return
  8646. }
  8647. if(vm._getFormData){
  8648. return
  8649. }
  8650. var $parent = vm.$parent;
  8651. while($parent){
  8652. if($parent.__next_tick_pending){
  8653. return
  8654. }
  8655. $parent = $parent.$parent;
  8656. }
  8657. }
  8658. warn(
  8659. "Avoid mutating a prop directly since the value will be " +
  8660. "overwritten whenever the parent component re-renders. " +
  8661. "Instead, use a data or computed property based on the prop's " +
  8662. "value. Prop being mutated: \"" + key + "\"",
  8663. vm
  8664. );
  8665. }
  8666. });
  8667. } else {}
  8668. // static props are already proxied on the component's prototype
  8669. // during Vue.extend(). We only need to proxy props defined at
  8670. // instantiation here.
  8671. if (!(key in vm)) {
  8672. proxy(vm, "_props", key);
  8673. }
  8674. };
  8675. for (var key in propsOptions) loop( key );
  8676. toggleObserving(true);
  8677. }
  8678. function initData (vm) {
  8679. var data = vm.$options.data;
  8680. data = vm._data = typeof data === 'function'
  8681. ? getData(data, vm)
  8682. : data || {};
  8683. if (!isPlainObject(data)) {
  8684. data = {};
  8685. true && warn(
  8686. 'data functions should return an object:\n' +
  8687. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8688. vm
  8689. );
  8690. }
  8691. // proxy data on instance
  8692. var keys = Object.keys(data);
  8693. var props = vm.$options.props;
  8694. var methods = vm.$options.methods;
  8695. var i = keys.length;
  8696. while (i--) {
  8697. var key = keys[i];
  8698. if (true) {
  8699. if (methods && hasOwn(methods, key)) {
  8700. warn(
  8701. ("Method \"" + key + "\" has already been defined as a data property."),
  8702. vm
  8703. );
  8704. }
  8705. }
  8706. if (props && hasOwn(props, key)) {
  8707. true && warn(
  8708. "The data property \"" + key + "\" is already declared as a prop. " +
  8709. "Use prop default value instead.",
  8710. vm
  8711. );
  8712. } else if (!isReserved(key)) {
  8713. proxy(vm, "_data", key);
  8714. }
  8715. }
  8716. // observe data
  8717. observe(data, true /* asRootData */);
  8718. }
  8719. function getData (data, vm) {
  8720. // #7573 disable dep collection when invoking data getters
  8721. pushTarget();
  8722. try {
  8723. return data.call(vm, vm)
  8724. } catch (e) {
  8725. handleError(e, vm, "data()");
  8726. return {}
  8727. } finally {
  8728. popTarget();
  8729. }
  8730. }
  8731. var computedWatcherOptions = { lazy: true };
  8732. function initComputed (vm, computed) {
  8733. // $flow-disable-line
  8734. var watchers = vm._computedWatchers = Object.create(null);
  8735. // computed properties are just getters during SSR
  8736. var isSSR = isServerRendering();
  8737. for (var key in computed) {
  8738. var userDef = computed[key];
  8739. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8740. if ( true && getter == null) {
  8741. warn(
  8742. ("Getter is missing for computed property \"" + key + "\"."),
  8743. vm
  8744. );
  8745. }
  8746. if (!isSSR) {
  8747. // create internal watcher for the computed property.
  8748. watchers[key] = new Watcher(
  8749. vm,
  8750. getter || noop,
  8751. noop,
  8752. computedWatcherOptions
  8753. );
  8754. }
  8755. // component-defined computed properties are already defined on the
  8756. // component prototype. We only need to define computed properties defined
  8757. // at instantiation here.
  8758. if (!(key in vm)) {
  8759. defineComputed(vm, key, userDef);
  8760. } else if (true) {
  8761. if (key in vm.$data) {
  8762. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8763. } else if (vm.$options.props && key in vm.$options.props) {
  8764. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8765. }
  8766. }
  8767. }
  8768. }
  8769. function defineComputed (
  8770. target,
  8771. key,
  8772. userDef
  8773. ) {
  8774. var shouldCache = !isServerRendering();
  8775. if (typeof userDef === 'function') {
  8776. sharedPropertyDefinition.get = shouldCache
  8777. ? createComputedGetter(key)
  8778. : createGetterInvoker(userDef);
  8779. sharedPropertyDefinition.set = noop;
  8780. } else {
  8781. sharedPropertyDefinition.get = userDef.get
  8782. ? shouldCache && userDef.cache !== false
  8783. ? createComputedGetter(key)
  8784. : createGetterInvoker(userDef.get)
  8785. : noop;
  8786. sharedPropertyDefinition.set = userDef.set || noop;
  8787. }
  8788. if ( true &&
  8789. sharedPropertyDefinition.set === noop) {
  8790. sharedPropertyDefinition.set = function () {
  8791. warn(
  8792. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8793. this
  8794. );
  8795. };
  8796. }
  8797. Object.defineProperty(target, key, sharedPropertyDefinition);
  8798. }
  8799. function createComputedGetter (key) {
  8800. return function computedGetter () {
  8801. var watcher = this._computedWatchers && this._computedWatchers[key];
  8802. if (watcher) {
  8803. if (watcher.dirty) {
  8804. watcher.evaluate();
  8805. }
  8806. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8807. watcher.depend();
  8808. }
  8809. return watcher.value
  8810. }
  8811. }
  8812. }
  8813. function createGetterInvoker(fn) {
  8814. return function computedGetter () {
  8815. return fn.call(this, this)
  8816. }
  8817. }
  8818. function initMethods (vm, methods) {
  8819. var props = vm.$options.props;
  8820. for (var key in methods) {
  8821. if (true) {
  8822. if (typeof methods[key] !== 'function') {
  8823. warn(
  8824. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8825. "Did you reference the function correctly?",
  8826. vm
  8827. );
  8828. }
  8829. if (props && hasOwn(props, key)) {
  8830. warn(
  8831. ("Method \"" + key + "\" has already been defined as a prop."),
  8832. vm
  8833. );
  8834. }
  8835. if ((key in vm) && isReserved(key)) {
  8836. warn(
  8837. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8838. "Avoid defining component methods that start with _ or $."
  8839. );
  8840. }
  8841. }
  8842. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8843. }
  8844. }
  8845. function initWatch (vm, watch) {
  8846. for (var key in watch) {
  8847. var handler = watch[key];
  8848. if (Array.isArray(handler)) {
  8849. for (var i = 0; i < handler.length; i++) {
  8850. createWatcher(vm, key, handler[i]);
  8851. }
  8852. } else {
  8853. createWatcher(vm, key, handler);
  8854. }
  8855. }
  8856. }
  8857. function createWatcher (
  8858. vm,
  8859. expOrFn,
  8860. handler,
  8861. options
  8862. ) {
  8863. if (isPlainObject(handler)) {
  8864. options = handler;
  8865. handler = handler.handler;
  8866. }
  8867. if (typeof handler === 'string') {
  8868. handler = vm[handler];
  8869. }
  8870. return vm.$watch(expOrFn, handler, options)
  8871. }
  8872. function stateMixin (Vue) {
  8873. // flow somehow has problems with directly declared definition object
  8874. // when using Object.defineProperty, so we have to procedurally build up
  8875. // the object here.
  8876. var dataDef = {};
  8877. dataDef.get = function () { return this._data };
  8878. var propsDef = {};
  8879. propsDef.get = function () { return this._props };
  8880. if (true) {
  8881. dataDef.set = function () {
  8882. warn(
  8883. 'Avoid replacing instance root $data. ' +
  8884. 'Use nested data properties instead.',
  8885. this
  8886. );
  8887. };
  8888. propsDef.set = function () {
  8889. warn("$props is readonly.", this);
  8890. };
  8891. }
  8892. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8893. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8894. Vue.prototype.$set = set;
  8895. Vue.prototype.$delete = del;
  8896. Vue.prototype.$watch = function (
  8897. expOrFn,
  8898. cb,
  8899. options
  8900. ) {
  8901. var vm = this;
  8902. if (isPlainObject(cb)) {
  8903. return createWatcher(vm, expOrFn, cb, options)
  8904. }
  8905. options = options || {};
  8906. options.user = true;
  8907. var watcher = new Watcher(vm, expOrFn, cb, options);
  8908. if (options.immediate) {
  8909. try {
  8910. cb.call(vm, watcher.value);
  8911. } catch (error) {
  8912. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8913. }
  8914. }
  8915. return function unwatchFn () {
  8916. watcher.teardown();
  8917. }
  8918. };
  8919. }
  8920. /* */
  8921. var uid$3 = 0;
  8922. function initMixin (Vue) {
  8923. Vue.prototype._init = function (options) {
  8924. var vm = this;
  8925. // a uid
  8926. vm._uid = uid$3++;
  8927. var startTag, endTag;
  8928. /* istanbul ignore if */
  8929. if ( true && config.performance && mark) {
  8930. startTag = "vue-perf-start:" + (vm._uid);
  8931. endTag = "vue-perf-end:" + (vm._uid);
  8932. mark(startTag);
  8933. }
  8934. // a flag to avoid this being observed
  8935. vm._isVue = true;
  8936. // merge options
  8937. if (options && options._isComponent) {
  8938. // optimize internal component instantiation
  8939. // since dynamic options merging is pretty slow, and none of the
  8940. // internal component options needs special treatment.
  8941. initInternalComponent(vm, options);
  8942. } else {
  8943. vm.$options = mergeOptions(
  8944. resolveConstructorOptions(vm.constructor),
  8945. options || {},
  8946. vm
  8947. );
  8948. }
  8949. /* istanbul ignore else */
  8950. if (true) {
  8951. initProxy(vm);
  8952. } else {}
  8953. // expose real self
  8954. vm._self = vm;
  8955. initLifecycle(vm);
  8956. initEvents(vm);
  8957. initRender(vm);
  8958. callHook(vm, 'beforeCreate');
  8959. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8960. initState(vm);
  8961. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8962. !vm._$fallback && callHook(vm, 'created');
  8963. /* istanbul ignore if */
  8964. if ( true && config.performance && mark) {
  8965. vm._name = formatComponentName(vm, false);
  8966. mark(endTag);
  8967. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8968. }
  8969. if (vm.$options.el) {
  8970. vm.$mount(vm.$options.el);
  8971. }
  8972. };
  8973. }
  8974. function initInternalComponent (vm, options) {
  8975. var opts = vm.$options = Object.create(vm.constructor.options);
  8976. // doing this because it's faster than dynamic enumeration.
  8977. var parentVnode = options._parentVnode;
  8978. opts.parent = options.parent;
  8979. opts._parentVnode = parentVnode;
  8980. var vnodeComponentOptions = parentVnode.componentOptions;
  8981. opts.propsData = vnodeComponentOptions.propsData;
  8982. opts._parentListeners = vnodeComponentOptions.listeners;
  8983. opts._renderChildren = vnodeComponentOptions.children;
  8984. opts._componentTag = vnodeComponentOptions.tag;
  8985. if (options.render) {
  8986. opts.render = options.render;
  8987. opts.staticRenderFns = options.staticRenderFns;
  8988. }
  8989. }
  8990. function resolveConstructorOptions (Ctor) {
  8991. var options = Ctor.options;
  8992. if (Ctor.super) {
  8993. var superOptions = resolveConstructorOptions(Ctor.super);
  8994. var cachedSuperOptions = Ctor.superOptions;
  8995. if (superOptions !== cachedSuperOptions) {
  8996. // super option changed,
  8997. // need to resolve new options.
  8998. Ctor.superOptions = superOptions;
  8999. // check if there are any late-modified/attached options (#4976)
  9000. var modifiedOptions = resolveModifiedOptions(Ctor);
  9001. // update base extend options
  9002. if (modifiedOptions) {
  9003. extend(Ctor.extendOptions, modifiedOptions);
  9004. }
  9005. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  9006. if (options.name) {
  9007. options.components[options.name] = Ctor;
  9008. }
  9009. }
  9010. }
  9011. return options
  9012. }
  9013. function resolveModifiedOptions (Ctor) {
  9014. var modified;
  9015. var latest = Ctor.options;
  9016. var sealed = Ctor.sealedOptions;
  9017. for (var key in latest) {
  9018. if (latest[key] !== sealed[key]) {
  9019. if (!modified) { modified = {}; }
  9020. modified[key] = latest[key];
  9021. }
  9022. }
  9023. return modified
  9024. }
  9025. function Vue (options) {
  9026. if ( true &&
  9027. !(this instanceof Vue)
  9028. ) {
  9029. warn('Vue is a constructor and should be called with the `new` keyword');
  9030. }
  9031. this._init(options);
  9032. }
  9033. initMixin(Vue);
  9034. stateMixin(Vue);
  9035. eventsMixin(Vue);
  9036. lifecycleMixin(Vue);
  9037. renderMixin(Vue);
  9038. /* */
  9039. function initUse (Vue) {
  9040. Vue.use = function (plugin) {
  9041. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  9042. if (installedPlugins.indexOf(plugin) > -1) {
  9043. return this
  9044. }
  9045. // additional parameters
  9046. var args = toArray(arguments, 1);
  9047. args.unshift(this);
  9048. if (typeof plugin.install === 'function') {
  9049. plugin.install.apply(plugin, args);
  9050. } else if (typeof plugin === 'function') {
  9051. plugin.apply(null, args);
  9052. }
  9053. installedPlugins.push(plugin);
  9054. return this
  9055. };
  9056. }
  9057. /* */
  9058. function initMixin$1 (Vue) {
  9059. Vue.mixin = function (mixin) {
  9060. this.options = mergeOptions(this.options, mixin);
  9061. return this
  9062. };
  9063. }
  9064. /* */
  9065. function initExtend (Vue) {
  9066. /**
  9067. * Each instance constructor, including Vue, has a unique
  9068. * cid. This enables us to create wrapped "child
  9069. * constructors" for prototypal inheritance and cache them.
  9070. */
  9071. Vue.cid = 0;
  9072. var cid = 1;
  9073. /**
  9074. * Class inheritance
  9075. */
  9076. Vue.extend = function (extendOptions) {
  9077. extendOptions = extendOptions || {};
  9078. var Super = this;
  9079. var SuperId = Super.cid;
  9080. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  9081. if (cachedCtors[SuperId]) {
  9082. return cachedCtors[SuperId]
  9083. }
  9084. var name = extendOptions.name || Super.options.name;
  9085. if ( true && name) {
  9086. validateComponentName(name);
  9087. }
  9088. var Sub = function VueComponent (options) {
  9089. this._init(options);
  9090. };
  9091. Sub.prototype = Object.create(Super.prototype);
  9092. Sub.prototype.constructor = Sub;
  9093. Sub.cid = cid++;
  9094. Sub.options = mergeOptions(
  9095. Super.options,
  9096. extendOptions
  9097. );
  9098. Sub['super'] = Super;
  9099. // For props and computed properties, we define the proxy getters on
  9100. // the Vue instances at extension time, on the extended prototype. This
  9101. // avoids Object.defineProperty calls for each instance created.
  9102. if (Sub.options.props) {
  9103. initProps$1(Sub);
  9104. }
  9105. if (Sub.options.computed) {
  9106. initComputed$1(Sub);
  9107. }
  9108. // allow further extension/mixin/plugin usage
  9109. Sub.extend = Super.extend;
  9110. Sub.mixin = Super.mixin;
  9111. Sub.use = Super.use;
  9112. // create asset registers, so extended classes
  9113. // can have their private assets too.
  9114. ASSET_TYPES.forEach(function (type) {
  9115. Sub[type] = Super[type];
  9116. });
  9117. // enable recursive self-lookup
  9118. if (name) {
  9119. Sub.options.components[name] = Sub;
  9120. }
  9121. // keep a reference to the super options at extension time.
  9122. // later at instantiation we can check if Super's options have
  9123. // been updated.
  9124. Sub.superOptions = Super.options;
  9125. Sub.extendOptions = extendOptions;
  9126. Sub.sealedOptions = extend({}, Sub.options);
  9127. // cache constructor
  9128. cachedCtors[SuperId] = Sub;
  9129. return Sub
  9130. };
  9131. }
  9132. function initProps$1 (Comp) {
  9133. var props = Comp.options.props;
  9134. for (var key in props) {
  9135. proxy(Comp.prototype, "_props", key);
  9136. }
  9137. }
  9138. function initComputed$1 (Comp) {
  9139. var computed = Comp.options.computed;
  9140. for (var key in computed) {
  9141. defineComputed(Comp.prototype, key, computed[key]);
  9142. }
  9143. }
  9144. /* */
  9145. function initAssetRegisters (Vue) {
  9146. /**
  9147. * Create asset registration methods.
  9148. */
  9149. ASSET_TYPES.forEach(function (type) {
  9150. Vue[type] = function (
  9151. id,
  9152. definition
  9153. ) {
  9154. if (!definition) {
  9155. return this.options[type + 's'][id]
  9156. } else {
  9157. /* istanbul ignore if */
  9158. if ( true && type === 'component') {
  9159. validateComponentName(id);
  9160. }
  9161. if (type === 'component' && isPlainObject(definition)) {
  9162. definition.name = definition.name || id;
  9163. definition = this.options._base.extend(definition);
  9164. }
  9165. if (type === 'directive' && typeof definition === 'function') {
  9166. definition = { bind: definition, update: definition };
  9167. }
  9168. this.options[type + 's'][id] = definition;
  9169. return definition
  9170. }
  9171. };
  9172. });
  9173. }
  9174. /* */
  9175. function getComponentName (opts) {
  9176. return opts && (opts.Ctor.options.name || opts.tag)
  9177. }
  9178. function matches (pattern, name) {
  9179. if (Array.isArray(pattern)) {
  9180. return pattern.indexOf(name) > -1
  9181. } else if (typeof pattern === 'string') {
  9182. return pattern.split(',').indexOf(name) > -1
  9183. } else if (isRegExp(pattern)) {
  9184. return pattern.test(name)
  9185. }
  9186. /* istanbul ignore next */
  9187. return false
  9188. }
  9189. function pruneCache (keepAliveInstance, filter) {
  9190. var cache = keepAliveInstance.cache;
  9191. var keys = keepAliveInstance.keys;
  9192. var _vnode = keepAliveInstance._vnode;
  9193. for (var key in cache) {
  9194. var cachedNode = cache[key];
  9195. if (cachedNode) {
  9196. var name = getComponentName(cachedNode.componentOptions);
  9197. if (name && !filter(name)) {
  9198. pruneCacheEntry(cache, key, keys, _vnode);
  9199. }
  9200. }
  9201. }
  9202. }
  9203. function pruneCacheEntry (
  9204. cache,
  9205. key,
  9206. keys,
  9207. current
  9208. ) {
  9209. var cached$$1 = cache[key];
  9210. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  9211. cached$$1.componentInstance.$destroy();
  9212. }
  9213. cache[key] = null;
  9214. remove(keys, key);
  9215. }
  9216. var patternTypes = [String, RegExp, Array];
  9217. var KeepAlive = {
  9218. name: 'keep-alive',
  9219. abstract: true,
  9220. props: {
  9221. include: patternTypes,
  9222. exclude: patternTypes,
  9223. max: [String, Number]
  9224. },
  9225. created: function created () {
  9226. this.cache = Object.create(null);
  9227. this.keys = [];
  9228. },
  9229. destroyed: function destroyed () {
  9230. for (var key in this.cache) {
  9231. pruneCacheEntry(this.cache, key, this.keys);
  9232. }
  9233. },
  9234. mounted: function mounted () {
  9235. var this$1 = this;
  9236. this.$watch('include', function (val) {
  9237. pruneCache(this$1, function (name) { return matches(val, name); });
  9238. });
  9239. this.$watch('exclude', function (val) {
  9240. pruneCache(this$1, function (name) { return !matches(val, name); });
  9241. });
  9242. },
  9243. render: function render () {
  9244. var slot = this.$slots.default;
  9245. var vnode = getFirstComponentChild(slot);
  9246. var componentOptions = vnode && vnode.componentOptions;
  9247. if (componentOptions) {
  9248. // check pattern
  9249. var name = getComponentName(componentOptions);
  9250. var ref = this;
  9251. var include = ref.include;
  9252. var exclude = ref.exclude;
  9253. if (
  9254. // not included
  9255. (include && (!name || !matches(include, name))) ||
  9256. // excluded
  9257. (exclude && name && matches(exclude, name))
  9258. ) {
  9259. return vnode
  9260. }
  9261. var ref$1 = this;
  9262. var cache = ref$1.cache;
  9263. var keys = ref$1.keys;
  9264. var key = vnode.key == null
  9265. // same constructor may get registered as different local components
  9266. // so cid alone is not enough (#3269)
  9267. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  9268. : vnode.key;
  9269. if (cache[key]) {
  9270. vnode.componentInstance = cache[key].componentInstance;
  9271. // make current key freshest
  9272. remove(keys, key);
  9273. keys.push(key);
  9274. } else {
  9275. cache[key] = vnode;
  9276. keys.push(key);
  9277. // prune oldest entry
  9278. if (this.max && keys.length > parseInt(this.max)) {
  9279. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  9280. }
  9281. }
  9282. vnode.data.keepAlive = true;
  9283. }
  9284. return vnode || (slot && slot[0])
  9285. }
  9286. };
  9287. var builtInComponents = {
  9288. KeepAlive: KeepAlive
  9289. };
  9290. /* */
  9291. function initGlobalAPI (Vue) {
  9292. // config
  9293. var configDef = {};
  9294. configDef.get = function () { return config; };
  9295. if (true) {
  9296. configDef.set = function () {
  9297. warn(
  9298. 'Do not replace the Vue.config object, set individual fields instead.'
  9299. );
  9300. };
  9301. }
  9302. Object.defineProperty(Vue, 'config', configDef);
  9303. // exposed util methods.
  9304. // NOTE: these are not considered part of the public API - avoid relying on
  9305. // them unless you are aware of the risk.
  9306. Vue.util = {
  9307. warn: warn,
  9308. extend: extend,
  9309. mergeOptions: mergeOptions,
  9310. defineReactive: defineReactive$$1
  9311. };
  9312. Vue.set = set;
  9313. Vue.delete = del;
  9314. Vue.nextTick = nextTick;
  9315. // 2.6 explicit observable API
  9316. Vue.observable = function (obj) {
  9317. observe(obj);
  9318. return obj
  9319. };
  9320. Vue.options = Object.create(null);
  9321. ASSET_TYPES.forEach(function (type) {
  9322. Vue.options[type + 's'] = Object.create(null);
  9323. });
  9324. // this is used to identify the "base" constructor to extend all plain-object
  9325. // components with in Weex's multi-instance scenarios.
  9326. Vue.options._base = Vue;
  9327. extend(Vue.options.components, builtInComponents);
  9328. initUse(Vue);
  9329. initMixin$1(Vue);
  9330. initExtend(Vue);
  9331. initAssetRegisters(Vue);
  9332. }
  9333. initGlobalAPI(Vue);
  9334. Object.defineProperty(Vue.prototype, '$isServer', {
  9335. get: isServerRendering
  9336. });
  9337. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9338. get: function get () {
  9339. /* istanbul ignore next */
  9340. return this.$vnode && this.$vnode.ssrContext
  9341. }
  9342. });
  9343. // expose FunctionalRenderContext for ssr runtime helper installation
  9344. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9345. value: FunctionalRenderContext
  9346. });
  9347. Vue.version = '2.6.11';
  9348. /**
  9349. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9350. */
  9351. var ARRAYTYPE = '[object Array]';
  9352. var OBJECTTYPE = '[object Object]';
  9353. var NULLTYPE = '[object Null]';
  9354. var UNDEFINEDTYPE = '[object Undefined]';
  9355. // const FUNCTIONTYPE = '[object Function]'
  9356. function diff(current, pre) {
  9357. var result = {};
  9358. syncKeys(current, pre);
  9359. _diff(current, pre, '', result);
  9360. return result
  9361. }
  9362. function syncKeys(current, pre) {
  9363. if (current === pre) { return }
  9364. var rootCurrentType = type(current);
  9365. var rootPreType = type(pre);
  9366. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9367. if(Object.keys(current).length >= Object.keys(pre).length){
  9368. for (var key in pre) {
  9369. var currentValue = current[key];
  9370. if (currentValue === undefined) {
  9371. current[key] = null;
  9372. } else {
  9373. syncKeys(currentValue, pre[key]);
  9374. }
  9375. }
  9376. }
  9377. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9378. if (current.length >= pre.length) {
  9379. pre.forEach(function (item, index) {
  9380. syncKeys(current[index], item);
  9381. });
  9382. }
  9383. }
  9384. }
  9385. function nullOrUndefined(currentType, preType) {
  9386. if(
  9387. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  9388. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  9389. ) {
  9390. return false
  9391. }
  9392. return true
  9393. }
  9394. function _diff(current, pre, path, result) {
  9395. if (current === pre) { return }
  9396. var rootCurrentType = type(current);
  9397. var rootPreType = type(pre);
  9398. if (rootCurrentType == OBJECTTYPE) {
  9399. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9400. setResult(result, path, current);
  9401. } else {
  9402. var loop = function ( key ) {
  9403. var currentValue = current[key];
  9404. var preValue = pre[key];
  9405. var currentType = type(currentValue);
  9406. var preType = type(preValue);
  9407. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9408. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  9409. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9410. }
  9411. } else if (currentType == ARRAYTYPE) {
  9412. if (preType != ARRAYTYPE) {
  9413. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9414. } else {
  9415. if (currentValue.length < preValue.length) {
  9416. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9417. } else {
  9418. currentValue.forEach(function (item, index) {
  9419. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9420. });
  9421. }
  9422. }
  9423. } else if (currentType == OBJECTTYPE) {
  9424. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9425. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9426. } else {
  9427. for (var subKey in currentValue) {
  9428. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9429. }
  9430. }
  9431. }
  9432. };
  9433. for (var key in current) loop( key );
  9434. }
  9435. } else if (rootCurrentType == ARRAYTYPE) {
  9436. if (rootPreType != ARRAYTYPE) {
  9437. setResult(result, path, current);
  9438. } else {
  9439. if (current.length < pre.length) {
  9440. setResult(result, path, current);
  9441. } else {
  9442. current.forEach(function (item, index) {
  9443. _diff(item, pre[index], path + '[' + index + ']', result);
  9444. });
  9445. }
  9446. }
  9447. } else {
  9448. setResult(result, path, current);
  9449. }
  9450. }
  9451. function setResult(result, k, v) {
  9452. // if (type(v) != FUNCTIONTYPE) {
  9453. result[k] = v;
  9454. // }
  9455. }
  9456. function type(obj) {
  9457. return Object.prototype.toString.call(obj)
  9458. }
  9459. /* */
  9460. function flushCallbacks$1(vm) {
  9461. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9462. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9463. var mpInstance = vm.$scope;
  9464. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9465. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9466. }
  9467. var copies = vm.__next_tick_callbacks.slice(0);
  9468. vm.__next_tick_callbacks.length = 0;
  9469. for (var i = 0; i < copies.length; i++) {
  9470. copies[i]();
  9471. }
  9472. }
  9473. }
  9474. function hasRenderWatcher(vm) {
  9475. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9476. }
  9477. function nextTick$1(vm, cb) {
  9478. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9479. //2.nextTick 之前存在 render watcher
  9480. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9481. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9482. var mpInstance = vm.$scope;
  9483. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9484. ']:nextVueTick');
  9485. }
  9486. return nextTick(cb, vm)
  9487. }else{
  9488. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9489. var mpInstance$1 = vm.$scope;
  9490. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9491. ']:nextMPTick');
  9492. }
  9493. }
  9494. var _resolve;
  9495. if (!vm.__next_tick_callbacks) {
  9496. vm.__next_tick_callbacks = [];
  9497. }
  9498. vm.__next_tick_callbacks.push(function () {
  9499. if (cb) {
  9500. try {
  9501. cb.call(vm);
  9502. } catch (e) {
  9503. handleError(e, vm, 'nextTick');
  9504. }
  9505. } else if (_resolve) {
  9506. _resolve(vm);
  9507. }
  9508. });
  9509. // $flow-disable-line
  9510. if (!cb && typeof Promise !== 'undefined') {
  9511. return new Promise(function (resolve) {
  9512. _resolve = resolve;
  9513. })
  9514. }
  9515. }
  9516. /* */
  9517. function clearInstance(key, value) {
  9518. // 简易去除 Vue 和小程序组件实例
  9519. if (value) {
  9520. if (value._isVue || value.__v_isMPComponent) {
  9521. return {}
  9522. }
  9523. }
  9524. return value
  9525. }
  9526. function cloneWithData(vm) {
  9527. // 确保当前 vm 所有数据被同步
  9528. var ret = Object.create(null);
  9529. var dataKeys = [].concat(
  9530. Object.keys(vm._data || {}),
  9531. Object.keys(vm._computedWatchers || {}));
  9532. dataKeys.reduce(function(ret, key) {
  9533. ret[key] = vm[key];
  9534. return ret
  9535. }, ret);
  9536. // vue-composition-api
  9537. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9538. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9539. if (rawBindings) {
  9540. Object.keys(rawBindings).forEach(function (key) {
  9541. ret[key] = vm[key];
  9542. });
  9543. }
  9544. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9545. Object.assign(ret, vm.$mp.data || {});
  9546. if (
  9547. Array.isArray(vm.$options.behaviors) &&
  9548. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9549. ) { //form-field
  9550. ret['name'] = vm.name;
  9551. ret['value'] = vm.value;
  9552. }
  9553. return JSON.parse(JSON.stringify(ret, clearInstance))
  9554. }
  9555. var patch = function(oldVnode, vnode) {
  9556. var this$1 = this;
  9557. if (vnode === null) { //destroy
  9558. return
  9559. }
  9560. if (this.mpType === 'page' || this.mpType === 'component') {
  9561. var mpInstance = this.$scope;
  9562. var data = Object.create(null);
  9563. try {
  9564. data = cloneWithData(this);
  9565. } catch (err) {
  9566. console.error(err);
  9567. }
  9568. data.__webviewId__ = mpInstance.data.__webviewId__;
  9569. var mpData = Object.create(null);
  9570. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9571. mpData[key] = mpInstance.data[key];
  9572. });
  9573. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9574. if (Object.keys(diffData).length) {
  9575. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"亲家母优选","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9576. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9577. ']差量更新',
  9578. JSON.stringify(diffData));
  9579. }
  9580. this.__next_tick_pending = true;
  9581. mpInstance.setData(diffData, function () {
  9582. this$1.__next_tick_pending = false;
  9583. flushCallbacks$1(this$1);
  9584. });
  9585. } else {
  9586. flushCallbacks$1(this);
  9587. }
  9588. }
  9589. };
  9590. /* */
  9591. function createEmptyRender() {
  9592. }
  9593. function mountComponent$1(
  9594. vm,
  9595. el,
  9596. hydrating
  9597. ) {
  9598. if (!vm.mpType) {//main.js 中的 new Vue
  9599. return vm
  9600. }
  9601. if (vm.mpType === 'app') {
  9602. vm.$options.render = createEmptyRender;
  9603. }
  9604. if (!vm.$options.render) {
  9605. vm.$options.render = createEmptyRender;
  9606. if (true) {
  9607. /* istanbul ignore if */
  9608. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9609. vm.$options.el || el) {
  9610. warn(
  9611. 'You are using the runtime-only build of Vue where the template ' +
  9612. 'compiler is not available. Either pre-compile the templates into ' +
  9613. 'render functions, or use the compiler-included build.',
  9614. vm
  9615. );
  9616. } else {
  9617. warn(
  9618. 'Failed to mount component: template or render function not defined.',
  9619. vm
  9620. );
  9621. }
  9622. }
  9623. }
  9624. !vm._$fallback && callHook(vm, 'beforeMount');
  9625. var updateComponent = function () {
  9626. vm._update(vm._render(), hydrating);
  9627. };
  9628. // we set this to vm._watcher inside the watcher's constructor
  9629. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9630. // component's mounted hook), which relies on vm._watcher being already defined
  9631. new Watcher(vm, updateComponent, noop, {
  9632. before: function before() {
  9633. if (vm._isMounted && !vm._isDestroyed) {
  9634. callHook(vm, 'beforeUpdate');
  9635. }
  9636. }
  9637. }, true /* isRenderWatcher */);
  9638. hydrating = false;
  9639. return vm
  9640. }
  9641. /* */
  9642. function renderClass (
  9643. staticClass,
  9644. dynamicClass
  9645. ) {
  9646. if (isDef(staticClass) || isDef(dynamicClass)) {
  9647. return concat(staticClass, stringifyClass(dynamicClass))
  9648. }
  9649. /* istanbul ignore next */
  9650. return ''
  9651. }
  9652. function concat (a, b) {
  9653. return a ? b ? (a + ' ' + b) : a : (b || '')
  9654. }
  9655. function stringifyClass (value) {
  9656. if (Array.isArray(value)) {
  9657. return stringifyArray(value)
  9658. }
  9659. if (isObject(value)) {
  9660. return stringifyObject(value)
  9661. }
  9662. if (typeof value === 'string') {
  9663. return value
  9664. }
  9665. /* istanbul ignore next */
  9666. return ''
  9667. }
  9668. function stringifyArray (value) {
  9669. var res = '';
  9670. var stringified;
  9671. for (var i = 0, l = value.length; i < l; i++) {
  9672. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9673. if (res) { res += ' '; }
  9674. res += stringified;
  9675. }
  9676. }
  9677. return res
  9678. }
  9679. function stringifyObject (value) {
  9680. var res = '';
  9681. for (var key in value) {
  9682. if (value[key]) {
  9683. if (res) { res += ' '; }
  9684. res += key;
  9685. }
  9686. }
  9687. return res
  9688. }
  9689. /* */
  9690. var parseStyleText = cached(function (cssText) {
  9691. var res = {};
  9692. var listDelimiter = /;(?![^(]*\))/g;
  9693. var propertyDelimiter = /:(.+)/;
  9694. cssText.split(listDelimiter).forEach(function (item) {
  9695. if (item) {
  9696. var tmp = item.split(propertyDelimiter);
  9697. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9698. }
  9699. });
  9700. return res
  9701. });
  9702. // normalize possible array / string values into Object
  9703. function normalizeStyleBinding (bindingStyle) {
  9704. if (Array.isArray(bindingStyle)) {
  9705. return toObject(bindingStyle)
  9706. }
  9707. if (typeof bindingStyle === 'string') {
  9708. return parseStyleText(bindingStyle)
  9709. }
  9710. return bindingStyle
  9711. }
  9712. /* */
  9713. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9714. function getTarget(obj, path) {
  9715. var parts = path.split('.');
  9716. var key = parts[0];
  9717. if (key.indexOf('__$n') === 0) { //number index
  9718. key = parseInt(key.replace('__$n', ''));
  9719. }
  9720. if (parts.length === 1) {
  9721. return obj[key]
  9722. }
  9723. return getTarget(obj[key], parts.slice(1).join('.'))
  9724. }
  9725. function internalMixin(Vue) {
  9726. Vue.config.errorHandler = function(err, vm, info) {
  9727. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9728. console.error(err);
  9729. /* eslint-disable no-undef */
  9730. var app = typeof getApp === 'function' && getApp();
  9731. if (app && app.onError) {
  9732. app.onError(err);
  9733. }
  9734. };
  9735. var oldEmit = Vue.prototype.$emit;
  9736. Vue.prototype.$emit = function(event) {
  9737. if (this.$scope && event) {
  9738. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9739. if (triggerEvent) {
  9740. try {
  9741. triggerEvent.call(this.$scope, event, {
  9742. __args__: toArray(arguments, 1)
  9743. });
  9744. } catch (error) {
  9745. }
  9746. }
  9747. }
  9748. return oldEmit.apply(this, arguments)
  9749. };
  9750. Vue.prototype.$nextTick = function(fn) {
  9751. return nextTick$1(this, fn)
  9752. };
  9753. MP_METHODS.forEach(function (method) {
  9754. Vue.prototype[method] = function(args) {
  9755. if (this.$scope && this.$scope[method]) {
  9756. return this.$scope[method](args)
  9757. }
  9758. // mp-alipay
  9759. if (typeof my === 'undefined') {
  9760. return
  9761. }
  9762. if (method === 'createSelectorQuery') {
  9763. /* eslint-disable no-undef */
  9764. return my.createSelectorQuery(args)
  9765. } else if (method === 'createIntersectionObserver') {
  9766. /* eslint-disable no-undef */
  9767. return my.createIntersectionObserver(args)
  9768. }
  9769. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9770. };
  9771. });
  9772. Vue.prototype.__init_provide = initProvide;
  9773. Vue.prototype.__init_injections = initInjections;
  9774. Vue.prototype.__call_hook = function(hook, args) {
  9775. var vm = this;
  9776. // #7573 disable dep collection when invoking lifecycle hooks
  9777. pushTarget();
  9778. var handlers = vm.$options[hook];
  9779. var info = hook + " hook";
  9780. var ret;
  9781. if (handlers) {
  9782. for (var i = 0, j = handlers.length; i < j; i++) {
  9783. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9784. }
  9785. }
  9786. if (vm._hasHookEvent) {
  9787. vm.$emit('hook:' + hook, args);
  9788. }
  9789. popTarget();
  9790. return ret
  9791. };
  9792. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9793. if (Array.isArray(modifiers)) {
  9794. if (modifiers.indexOf('trim') !== -1) {
  9795. value = value.trim();
  9796. }
  9797. if (modifiers.indexOf('number') !== -1) {
  9798. value = this._n(value);
  9799. }
  9800. }
  9801. if (!target) {
  9802. target = this;
  9803. }
  9804. // 解决动态属性添加
  9805. Vue.set(target, key, value);
  9806. };
  9807. Vue.prototype.__set_sync = function(target, key, value) {
  9808. if (!target) {
  9809. target = this;
  9810. }
  9811. // 解决动态属性添加
  9812. Vue.set(target, key, value);
  9813. };
  9814. Vue.prototype.__get_orig = function(item) {
  9815. if (isPlainObject(item)) {
  9816. return item['$orig'] || item
  9817. }
  9818. return item
  9819. };
  9820. Vue.prototype.__get_value = function(dataPath, target) {
  9821. return getTarget(target || this, dataPath)
  9822. };
  9823. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9824. return renderClass(staticClass, dynamicClass)
  9825. };
  9826. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9827. if (!dynamicStyle && !staticStyle) {
  9828. return ''
  9829. }
  9830. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9831. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9832. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9833. };
  9834. Vue.prototype.__map = function(val, iteratee) {
  9835. //TODO 暂不考虑 string
  9836. var ret, i, l, keys, key;
  9837. if (Array.isArray(val)) {
  9838. ret = new Array(val.length);
  9839. for (i = 0, l = val.length; i < l; i++) {
  9840. ret[i] = iteratee(val[i], i);
  9841. }
  9842. return ret
  9843. } else if (isObject(val)) {
  9844. keys = Object.keys(val);
  9845. ret = Object.create(null);
  9846. for (i = 0, l = keys.length; i < l; i++) {
  9847. key = keys[i];
  9848. ret[key] = iteratee(val[key], key, i);
  9849. }
  9850. return ret
  9851. } else if (typeof val === 'number') {
  9852. ret = new Array(val);
  9853. for (i = 0, l = val; i < l; i++) {
  9854. // 第一个参数暂时仍和小程序一致
  9855. ret[i] = iteratee(i, i);
  9856. }
  9857. return ret
  9858. }
  9859. return []
  9860. };
  9861. }
  9862. /* */
  9863. var LIFECYCLE_HOOKS$1 = [
  9864. //App
  9865. 'onLaunch',
  9866. 'onShow',
  9867. 'onHide',
  9868. 'onUniNViewMessage',
  9869. 'onPageNotFound',
  9870. 'onThemeChange',
  9871. 'onError',
  9872. 'onUnhandledRejection',
  9873. //Page
  9874. 'onInit',
  9875. 'onLoad',
  9876. // 'onShow',
  9877. 'onReady',
  9878. // 'onHide',
  9879. 'onUnload',
  9880. 'onPullDownRefresh',
  9881. 'onReachBottom',
  9882. 'onTabItemTap',
  9883. 'onAddToFavorites',
  9884. 'onShareTimeline',
  9885. 'onShareAppMessage',
  9886. 'onResize',
  9887. 'onPageScroll',
  9888. 'onNavigationBarButtonTap',
  9889. 'onBackPress',
  9890. 'onNavigationBarSearchInputChanged',
  9891. 'onNavigationBarSearchInputConfirmed',
  9892. 'onNavigationBarSearchInputClicked',
  9893. //Component
  9894. // 'onReady', // 兼容旧版本,应该移除该事件
  9895. 'onPageShow',
  9896. 'onPageHide',
  9897. 'onPageResize',
  9898. 'onUploadDouyinVideo'
  9899. ];
  9900. function lifecycleMixin$1(Vue) {
  9901. //fixed vue-class-component
  9902. var oldExtend = Vue.extend;
  9903. Vue.extend = function(extendOptions) {
  9904. extendOptions = extendOptions || {};
  9905. var methods = extendOptions.methods;
  9906. if (methods) {
  9907. Object.keys(methods).forEach(function (methodName) {
  9908. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9909. extendOptions[methodName] = methods[methodName];
  9910. delete methods[methodName];
  9911. }
  9912. });
  9913. }
  9914. return oldExtend.call(this, extendOptions)
  9915. };
  9916. var strategies = Vue.config.optionMergeStrategies;
  9917. var mergeHook = strategies.created;
  9918. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9919. strategies[hook] = mergeHook;
  9920. });
  9921. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9922. }
  9923. /* */
  9924. // install platform patch function
  9925. Vue.prototype.__patch__ = patch;
  9926. // public mount method
  9927. Vue.prototype.$mount = function(
  9928. el ,
  9929. hydrating
  9930. ) {
  9931. return mountComponent$1(this, el, hydrating)
  9932. };
  9933. lifecycleMixin$1(Vue);
  9934. internalMixin(Vue);
  9935. /* */
  9936. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9937. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9938. /***/ }),
  9939. /***/ 26:
  9940. /*!************************************!*\
  9941. !*** D:/工作/项目2/亲家母/qjm/pages.json ***!
  9942. \************************************/
  9943. /*! no static exports found */
  9944. /***/ (function(module, exports) {
  9945. /***/ }),
  9946. /***/ 27:
  9947. /*!****************************************!*\
  9948. !*** D:/工作/项目2/亲家母/qjm/store/index.js ***!
  9949. \****************************************/
  9950. /*! no static exports found */
  9951. /***/ (function(module, exports, __webpack_require__) {
  9952. "use strict";
  9953. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9954. Object.defineProperty(exports, "__esModule", {
  9955. value: true
  9956. });
  9957. exports.default = void 0;
  9958. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  9959. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 28));
  9960. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 29));
  9961. _vue.default.use(_vuex.default);
  9962. var store = new _vuex.default.Store({
  9963. namespaced: true,
  9964. state: {
  9965. // baseURL: "http://lingjie.frp.liuniu946.com", //'http://eb.shuibo.net',//请求地址配置
  9966. baseURL: 'https://qjm.liuniu946.com',
  9967. //请求地址配置
  9968. urlFile: '/index',
  9969. //项目部署所在文件夹
  9970. userInfo: {},
  9971. //登录信息
  9972. loginInterceptor: false,
  9973. //是否打开强制登录
  9974. weichatInfo: {},
  9975. //保存微信注册信息
  9976. weichatObj: '' //微信对象
  9977. },
  9978. mutations: {
  9979. //保存微信信息
  9980. setWeiChatInfo: function setWeiChatInfo(state, provider) {
  9981. state.weichatInfo = provider;
  9982. },
  9983. //保存微信对象
  9984. setWeiChatObj: function setWeiChatObj(state, provider) {
  9985. state.weichatObj = provider;
  9986. }
  9987. },
  9988. modules: {
  9989. user: _user.default
  9990. },
  9991. actions: {}
  9992. });
  9993. var _default = store;
  9994. exports.default = _default;
  9995. /***/ }),
  9996. /***/ 28:
  9997. /*!**************************************************************************************!*\
  9998. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  9999. \**************************************************************************************/
  10000. /*! no static exports found */
  10001. /***/ (function(module, exports, __webpack_require__) {
  10002. "use strict";
  10003. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10004. * vuex v3.6.2
  10005. * (c) 2021 Evan You
  10006. * @license MIT
  10007. */
  10008. function applyMixin (Vue) {
  10009. var version = Number(Vue.version.split('.')[0]);
  10010. if (version >= 2) {
  10011. Vue.mixin({ beforeCreate: vuexInit });
  10012. } else {
  10013. // override init and inject vuex init procedure
  10014. // for 1.x backwards compatibility.
  10015. var _init = Vue.prototype._init;
  10016. Vue.prototype._init = function (options) {
  10017. if ( options === void 0 ) options = {};
  10018. options.init = options.init
  10019. ? [vuexInit].concat(options.init)
  10020. : vuexInit;
  10021. _init.call(this, options);
  10022. };
  10023. }
  10024. /**
  10025. * Vuex init hook, injected into each instances init hooks list.
  10026. */
  10027. function vuexInit () {
  10028. var options = this.$options;
  10029. // store injection
  10030. if (options.store) {
  10031. this.$store = typeof options.store === 'function'
  10032. ? options.store()
  10033. : options.store;
  10034. } else if (options.parent && options.parent.$store) {
  10035. this.$store = options.parent.$store;
  10036. }
  10037. }
  10038. }
  10039. var target = typeof window !== 'undefined'
  10040. ? window
  10041. : typeof global !== 'undefined'
  10042. ? global
  10043. : {};
  10044. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  10045. function devtoolPlugin (store) {
  10046. if (!devtoolHook) { return }
  10047. store._devtoolHook = devtoolHook;
  10048. devtoolHook.emit('vuex:init', store);
  10049. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  10050. store.replaceState(targetState);
  10051. });
  10052. store.subscribe(function (mutation, state) {
  10053. devtoolHook.emit('vuex:mutation', mutation, state);
  10054. }, { prepend: true });
  10055. store.subscribeAction(function (action, state) {
  10056. devtoolHook.emit('vuex:action', action, state);
  10057. }, { prepend: true });
  10058. }
  10059. /**
  10060. * Get the first item that pass the test
  10061. * by second argument function
  10062. *
  10063. * @param {Array} list
  10064. * @param {Function} f
  10065. * @return {*}
  10066. */
  10067. function find (list, f) {
  10068. return list.filter(f)[0]
  10069. }
  10070. /**
  10071. * Deep copy the given object considering circular structure.
  10072. * This function caches all nested objects and its copies.
  10073. * If it detects circular structure, use cached copy to avoid infinite loop.
  10074. *
  10075. * @param {*} obj
  10076. * @param {Array<Object>} cache
  10077. * @return {*}
  10078. */
  10079. function deepCopy (obj, cache) {
  10080. if ( cache === void 0 ) cache = [];
  10081. // just return if obj is immutable value
  10082. if (obj === null || typeof obj !== 'object') {
  10083. return obj
  10084. }
  10085. // if obj is hit, it is in circular structure
  10086. var hit = find(cache, function (c) { return c.original === obj; });
  10087. if (hit) {
  10088. return hit.copy
  10089. }
  10090. var copy = Array.isArray(obj) ? [] : {};
  10091. // put the copy into cache at first
  10092. // because we want to refer it in recursive deepCopy
  10093. cache.push({
  10094. original: obj,
  10095. copy: copy
  10096. });
  10097. Object.keys(obj).forEach(function (key) {
  10098. copy[key] = deepCopy(obj[key], cache);
  10099. });
  10100. return copy
  10101. }
  10102. /**
  10103. * forEach for object
  10104. */
  10105. function forEachValue (obj, fn) {
  10106. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  10107. }
  10108. function isObject (obj) {
  10109. return obj !== null && typeof obj === 'object'
  10110. }
  10111. function isPromise (val) {
  10112. return val && typeof val.then === 'function'
  10113. }
  10114. function assert (condition, msg) {
  10115. if (!condition) { throw new Error(("[vuex] " + msg)) }
  10116. }
  10117. function partial (fn, arg) {
  10118. return function () {
  10119. return fn(arg)
  10120. }
  10121. }
  10122. // Base data struct for store's module, package with some attribute and method
  10123. var Module = function Module (rawModule, runtime) {
  10124. this.runtime = runtime;
  10125. // Store some children item
  10126. this._children = Object.create(null);
  10127. // Store the origin module object which passed by programmer
  10128. this._rawModule = rawModule;
  10129. var rawState = rawModule.state;
  10130. // Store the origin module's state
  10131. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  10132. };
  10133. var prototypeAccessors = { namespaced: { configurable: true } };
  10134. prototypeAccessors.namespaced.get = function () {
  10135. return !!this._rawModule.namespaced
  10136. };
  10137. Module.prototype.addChild = function addChild (key, module) {
  10138. this._children[key] = module;
  10139. };
  10140. Module.prototype.removeChild = function removeChild (key) {
  10141. delete this._children[key];
  10142. };
  10143. Module.prototype.getChild = function getChild (key) {
  10144. return this._children[key]
  10145. };
  10146. Module.prototype.hasChild = function hasChild (key) {
  10147. return key in this._children
  10148. };
  10149. Module.prototype.update = function update (rawModule) {
  10150. this._rawModule.namespaced = rawModule.namespaced;
  10151. if (rawModule.actions) {
  10152. this._rawModule.actions = rawModule.actions;
  10153. }
  10154. if (rawModule.mutations) {
  10155. this._rawModule.mutations = rawModule.mutations;
  10156. }
  10157. if (rawModule.getters) {
  10158. this._rawModule.getters = rawModule.getters;
  10159. }
  10160. };
  10161. Module.prototype.forEachChild = function forEachChild (fn) {
  10162. forEachValue(this._children, fn);
  10163. };
  10164. Module.prototype.forEachGetter = function forEachGetter (fn) {
  10165. if (this._rawModule.getters) {
  10166. forEachValue(this._rawModule.getters, fn);
  10167. }
  10168. };
  10169. Module.prototype.forEachAction = function forEachAction (fn) {
  10170. if (this._rawModule.actions) {
  10171. forEachValue(this._rawModule.actions, fn);
  10172. }
  10173. };
  10174. Module.prototype.forEachMutation = function forEachMutation (fn) {
  10175. if (this._rawModule.mutations) {
  10176. forEachValue(this._rawModule.mutations, fn);
  10177. }
  10178. };
  10179. Object.defineProperties( Module.prototype, prototypeAccessors );
  10180. var ModuleCollection = function ModuleCollection (rawRootModule) {
  10181. // register root module (Vuex.Store options)
  10182. this.register([], rawRootModule, false);
  10183. };
  10184. ModuleCollection.prototype.get = function get (path) {
  10185. return path.reduce(function (module, key) {
  10186. return module.getChild(key)
  10187. }, this.root)
  10188. };
  10189. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  10190. var module = this.root;
  10191. return path.reduce(function (namespace, key) {
  10192. module = module.getChild(key);
  10193. return namespace + (module.namespaced ? key + '/' : '')
  10194. }, '')
  10195. };
  10196. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  10197. update([], this.root, rawRootModule);
  10198. };
  10199. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  10200. var this$1 = this;
  10201. if ( runtime === void 0 ) runtime = true;
  10202. if ((true)) {
  10203. assertRawModule(path, rawModule);
  10204. }
  10205. var newModule = new Module(rawModule, runtime);
  10206. if (path.length === 0) {
  10207. this.root = newModule;
  10208. } else {
  10209. var parent = this.get(path.slice(0, -1));
  10210. parent.addChild(path[path.length - 1], newModule);
  10211. }
  10212. // register nested modules
  10213. if (rawModule.modules) {
  10214. forEachValue(rawModule.modules, function (rawChildModule, key) {
  10215. this$1.register(path.concat(key), rawChildModule, runtime);
  10216. });
  10217. }
  10218. };
  10219. ModuleCollection.prototype.unregister = function unregister (path) {
  10220. var parent = this.get(path.slice(0, -1));
  10221. var key = path[path.length - 1];
  10222. var child = parent.getChild(key);
  10223. if (!child) {
  10224. if ((true)) {
  10225. console.warn(
  10226. "[vuex] trying to unregister module '" + key + "', which is " +
  10227. "not registered"
  10228. );
  10229. }
  10230. return
  10231. }
  10232. if (!child.runtime) {
  10233. return
  10234. }
  10235. parent.removeChild(key);
  10236. };
  10237. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  10238. var parent = this.get(path.slice(0, -1));
  10239. var key = path[path.length - 1];
  10240. if (parent) {
  10241. return parent.hasChild(key)
  10242. }
  10243. return false
  10244. };
  10245. function update (path, targetModule, newModule) {
  10246. if ((true)) {
  10247. assertRawModule(path, newModule);
  10248. }
  10249. // update target module
  10250. targetModule.update(newModule);
  10251. // update nested modules
  10252. if (newModule.modules) {
  10253. for (var key in newModule.modules) {
  10254. if (!targetModule.getChild(key)) {
  10255. if ((true)) {
  10256. console.warn(
  10257. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  10258. 'manual reload is needed'
  10259. );
  10260. }
  10261. return
  10262. }
  10263. update(
  10264. path.concat(key),
  10265. targetModule.getChild(key),
  10266. newModule.modules[key]
  10267. );
  10268. }
  10269. }
  10270. }
  10271. var functionAssert = {
  10272. assert: function (value) { return typeof value === 'function'; },
  10273. expected: 'function'
  10274. };
  10275. var objectAssert = {
  10276. assert: function (value) { return typeof value === 'function' ||
  10277. (typeof value === 'object' && typeof value.handler === 'function'); },
  10278. expected: 'function or object with "handler" function'
  10279. };
  10280. var assertTypes = {
  10281. getters: functionAssert,
  10282. mutations: functionAssert,
  10283. actions: objectAssert
  10284. };
  10285. function assertRawModule (path, rawModule) {
  10286. Object.keys(assertTypes).forEach(function (key) {
  10287. if (!rawModule[key]) { return }
  10288. var assertOptions = assertTypes[key];
  10289. forEachValue(rawModule[key], function (value, type) {
  10290. assert(
  10291. assertOptions.assert(value),
  10292. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  10293. );
  10294. });
  10295. });
  10296. }
  10297. function makeAssertionMessage (path, key, type, value, expected) {
  10298. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  10299. if (path.length > 0) {
  10300. buf += " in module \"" + (path.join('.')) + "\"";
  10301. }
  10302. buf += " is " + (JSON.stringify(value)) + ".";
  10303. return buf
  10304. }
  10305. var Vue; // bind on install
  10306. var Store = function Store (options) {
  10307. var this$1 = this;
  10308. if ( options === void 0 ) options = {};
  10309. // Auto install if it is not done yet and `window` has `Vue`.
  10310. // To allow users to avoid auto-installation in some cases,
  10311. // this code should be placed here. See #731
  10312. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  10313. install(window.Vue);
  10314. }
  10315. if ((true)) {
  10316. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  10317. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  10318. assert(this instanceof Store, "store must be called with the new operator.");
  10319. }
  10320. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  10321. var strict = options.strict; if ( strict === void 0 ) strict = false;
  10322. // store internal state
  10323. this._committing = false;
  10324. this._actions = Object.create(null);
  10325. this._actionSubscribers = [];
  10326. this._mutations = Object.create(null);
  10327. this._wrappedGetters = Object.create(null);
  10328. this._modules = new ModuleCollection(options);
  10329. this._modulesNamespaceMap = Object.create(null);
  10330. this._subscribers = [];
  10331. this._watcherVM = new Vue();
  10332. this._makeLocalGettersCache = Object.create(null);
  10333. // bind commit and dispatch to self
  10334. var store = this;
  10335. var ref = this;
  10336. var dispatch = ref.dispatch;
  10337. var commit = ref.commit;
  10338. this.dispatch = function boundDispatch (type, payload) {
  10339. return dispatch.call(store, type, payload)
  10340. };
  10341. this.commit = function boundCommit (type, payload, options) {
  10342. return commit.call(store, type, payload, options)
  10343. };
  10344. // strict mode
  10345. this.strict = strict;
  10346. var state = this._modules.root.state;
  10347. // init root module.
  10348. // this also recursively registers all sub-modules
  10349. // and collects all module getters inside this._wrappedGetters
  10350. installModule(this, state, [], this._modules.root);
  10351. // initialize the store vm, which is responsible for the reactivity
  10352. // (also registers _wrappedGetters as computed properties)
  10353. resetStoreVM(this, state);
  10354. // apply plugins
  10355. plugins.forEach(function (plugin) { return plugin(this$1); });
  10356. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  10357. if (useDevtools) {
  10358. devtoolPlugin(this);
  10359. }
  10360. };
  10361. var prototypeAccessors$1 = { state: { configurable: true } };
  10362. prototypeAccessors$1.state.get = function () {
  10363. return this._vm._data.$$state
  10364. };
  10365. prototypeAccessors$1.state.set = function (v) {
  10366. if ((true)) {
  10367. assert(false, "use store.replaceState() to explicit replace store state.");
  10368. }
  10369. };
  10370. Store.prototype.commit = function commit (_type, _payload, _options) {
  10371. var this$1 = this;
  10372. // check object-style commit
  10373. var ref = unifyObjectStyle(_type, _payload, _options);
  10374. var type = ref.type;
  10375. var payload = ref.payload;
  10376. var options = ref.options;
  10377. var mutation = { type: type, payload: payload };
  10378. var entry = this._mutations[type];
  10379. if (!entry) {
  10380. if ((true)) {
  10381. console.error(("[vuex] unknown mutation type: " + type));
  10382. }
  10383. return
  10384. }
  10385. this._withCommit(function () {
  10386. entry.forEach(function commitIterator (handler) {
  10387. handler(payload);
  10388. });
  10389. });
  10390. this._subscribers
  10391. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10392. .forEach(function (sub) { return sub(mutation, this$1.state); });
  10393. if (
  10394. ( true) &&
  10395. options && options.silent
  10396. ) {
  10397. console.warn(
  10398. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  10399. 'Use the filter functionality in the vue-devtools'
  10400. );
  10401. }
  10402. };
  10403. Store.prototype.dispatch = function dispatch (_type, _payload) {
  10404. var this$1 = this;
  10405. // check object-style dispatch
  10406. var ref = unifyObjectStyle(_type, _payload);
  10407. var type = ref.type;
  10408. var payload = ref.payload;
  10409. var action = { type: type, payload: payload };
  10410. var entry = this._actions[type];
  10411. if (!entry) {
  10412. if ((true)) {
  10413. console.error(("[vuex] unknown action type: " + type));
  10414. }
  10415. return
  10416. }
  10417. try {
  10418. this._actionSubscribers
  10419. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10420. .filter(function (sub) { return sub.before; })
  10421. .forEach(function (sub) { return sub.before(action, this$1.state); });
  10422. } catch (e) {
  10423. if ((true)) {
  10424. console.warn("[vuex] error in before action subscribers: ");
  10425. console.error(e);
  10426. }
  10427. }
  10428. var result = entry.length > 1
  10429. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  10430. : entry[0](payload);
  10431. return new Promise(function (resolve, reject) {
  10432. result.then(function (res) {
  10433. try {
  10434. this$1._actionSubscribers
  10435. .filter(function (sub) { return sub.after; })
  10436. .forEach(function (sub) { return sub.after(action, this$1.state); });
  10437. } catch (e) {
  10438. if ((true)) {
  10439. console.warn("[vuex] error in after action subscribers: ");
  10440. console.error(e);
  10441. }
  10442. }
  10443. resolve(res);
  10444. }, function (error) {
  10445. try {
  10446. this$1._actionSubscribers
  10447. .filter(function (sub) { return sub.error; })
  10448. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  10449. } catch (e) {
  10450. if ((true)) {
  10451. console.warn("[vuex] error in error action subscribers: ");
  10452. console.error(e);
  10453. }
  10454. }
  10455. reject(error);
  10456. });
  10457. })
  10458. };
  10459. Store.prototype.subscribe = function subscribe (fn, options) {
  10460. return genericSubscribe(fn, this._subscribers, options)
  10461. };
  10462. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  10463. var subs = typeof fn === 'function' ? { before: fn } : fn;
  10464. return genericSubscribe(subs, this._actionSubscribers, options)
  10465. };
  10466. Store.prototype.watch = function watch (getter, cb, options) {
  10467. var this$1 = this;
  10468. if ((true)) {
  10469. assert(typeof getter === 'function', "store.watch only accepts a function.");
  10470. }
  10471. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  10472. };
  10473. Store.prototype.replaceState = function replaceState (state) {
  10474. var this$1 = this;
  10475. this._withCommit(function () {
  10476. this$1._vm._data.$$state = state;
  10477. });
  10478. };
  10479. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  10480. if ( options === void 0 ) options = {};
  10481. if (typeof path === 'string') { path = [path]; }
  10482. if ((true)) {
  10483. assert(Array.isArray(path), "module path must be a string or an Array.");
  10484. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  10485. }
  10486. this._modules.register(path, rawModule);
  10487. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  10488. // reset store to update getters...
  10489. resetStoreVM(this, this.state);
  10490. };
  10491. Store.prototype.unregisterModule = function unregisterModule (path) {
  10492. var this$1 = this;
  10493. if (typeof path === 'string') { path = [path]; }
  10494. if ((true)) {
  10495. assert(Array.isArray(path), "module path must be a string or an Array.");
  10496. }
  10497. this._modules.unregister(path);
  10498. this._withCommit(function () {
  10499. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  10500. Vue.delete(parentState, path[path.length - 1]);
  10501. });
  10502. resetStore(this);
  10503. };
  10504. Store.prototype.hasModule = function hasModule (path) {
  10505. if (typeof path === 'string') { path = [path]; }
  10506. if ((true)) {
  10507. assert(Array.isArray(path), "module path must be a string or an Array.");
  10508. }
  10509. return this._modules.isRegistered(path)
  10510. };
  10511. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  10512. this._modules.update(newOptions);
  10513. resetStore(this, true);
  10514. };
  10515. Store.prototype._withCommit = function _withCommit (fn) {
  10516. var committing = this._committing;
  10517. this._committing = true;
  10518. fn();
  10519. this._committing = committing;
  10520. };
  10521. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  10522. function genericSubscribe (fn, subs, options) {
  10523. if (subs.indexOf(fn) < 0) {
  10524. options && options.prepend
  10525. ? subs.unshift(fn)
  10526. : subs.push(fn);
  10527. }
  10528. return function () {
  10529. var i = subs.indexOf(fn);
  10530. if (i > -1) {
  10531. subs.splice(i, 1);
  10532. }
  10533. }
  10534. }
  10535. function resetStore (store, hot) {
  10536. store._actions = Object.create(null);
  10537. store._mutations = Object.create(null);
  10538. store._wrappedGetters = Object.create(null);
  10539. store._modulesNamespaceMap = Object.create(null);
  10540. var state = store.state;
  10541. // init all modules
  10542. installModule(store, state, [], store._modules.root, true);
  10543. // reset vm
  10544. resetStoreVM(store, state, hot);
  10545. }
  10546. function resetStoreVM (store, state, hot) {
  10547. var oldVm = store._vm;
  10548. // bind store public getters
  10549. store.getters = {};
  10550. // reset local getters cache
  10551. store._makeLocalGettersCache = Object.create(null);
  10552. var wrappedGetters = store._wrappedGetters;
  10553. var computed = {};
  10554. forEachValue(wrappedGetters, function (fn, key) {
  10555. // use computed to leverage its lazy-caching mechanism
  10556. // direct inline function use will lead to closure preserving oldVm.
  10557. // using partial to return function with only arguments preserved in closure environment.
  10558. computed[key] = partial(fn, store);
  10559. Object.defineProperty(store.getters, key, {
  10560. get: function () { return store._vm[key]; },
  10561. enumerable: true // for local getters
  10562. });
  10563. });
  10564. // use a Vue instance to store the state tree
  10565. // suppress warnings just in case the user has added
  10566. // some funky global mixins
  10567. var silent = Vue.config.silent;
  10568. Vue.config.silent = true;
  10569. store._vm = new Vue({
  10570. data: {
  10571. $$state: state
  10572. },
  10573. computed: computed
  10574. });
  10575. Vue.config.silent = silent;
  10576. // enable strict mode for new vm
  10577. if (store.strict) {
  10578. enableStrictMode(store);
  10579. }
  10580. if (oldVm) {
  10581. if (hot) {
  10582. // dispatch changes in all subscribed watchers
  10583. // to force getter re-evaluation for hot reloading.
  10584. store._withCommit(function () {
  10585. oldVm._data.$$state = null;
  10586. });
  10587. }
  10588. Vue.nextTick(function () { return oldVm.$destroy(); });
  10589. }
  10590. }
  10591. function installModule (store, rootState, path, module, hot) {
  10592. var isRoot = !path.length;
  10593. var namespace = store._modules.getNamespace(path);
  10594. // register in namespace map
  10595. if (module.namespaced) {
  10596. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  10597. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  10598. }
  10599. store._modulesNamespaceMap[namespace] = module;
  10600. }
  10601. // set state
  10602. if (!isRoot && !hot) {
  10603. var parentState = getNestedState(rootState, path.slice(0, -1));
  10604. var moduleName = path[path.length - 1];
  10605. store._withCommit(function () {
  10606. if ((true)) {
  10607. if (moduleName in parentState) {
  10608. console.warn(
  10609. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  10610. );
  10611. }
  10612. }
  10613. Vue.set(parentState, moduleName, module.state);
  10614. });
  10615. }
  10616. var local = module.context = makeLocalContext(store, namespace, path);
  10617. module.forEachMutation(function (mutation, key) {
  10618. var namespacedType = namespace + key;
  10619. registerMutation(store, namespacedType, mutation, local);
  10620. });
  10621. module.forEachAction(function (action, key) {
  10622. var type = action.root ? key : namespace + key;
  10623. var handler = action.handler || action;
  10624. registerAction(store, type, handler, local);
  10625. });
  10626. module.forEachGetter(function (getter, key) {
  10627. var namespacedType = namespace + key;
  10628. registerGetter(store, namespacedType, getter, local);
  10629. });
  10630. module.forEachChild(function (child, key) {
  10631. installModule(store, rootState, path.concat(key), child, hot);
  10632. });
  10633. }
  10634. /**
  10635. * make localized dispatch, commit, getters and state
  10636. * if there is no namespace, just use root ones
  10637. */
  10638. function makeLocalContext (store, namespace, path) {
  10639. var noNamespace = namespace === '';
  10640. var local = {
  10641. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  10642. var args = unifyObjectStyle(_type, _payload, _options);
  10643. var payload = args.payload;
  10644. var options = args.options;
  10645. var type = args.type;
  10646. if (!options || !options.root) {
  10647. type = namespace + type;
  10648. if (( true) && !store._actions[type]) {
  10649. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  10650. return
  10651. }
  10652. }
  10653. return store.dispatch(type, payload)
  10654. },
  10655. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  10656. var args = unifyObjectStyle(_type, _payload, _options);
  10657. var payload = args.payload;
  10658. var options = args.options;
  10659. var type = args.type;
  10660. if (!options || !options.root) {
  10661. type = namespace + type;
  10662. if (( true) && !store._mutations[type]) {
  10663. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  10664. return
  10665. }
  10666. }
  10667. store.commit(type, payload, options);
  10668. }
  10669. };
  10670. // getters and state object must be gotten lazily
  10671. // because they will be changed by vm update
  10672. Object.defineProperties(local, {
  10673. getters: {
  10674. get: noNamespace
  10675. ? function () { return store.getters; }
  10676. : function () { return makeLocalGetters(store, namespace); }
  10677. },
  10678. state: {
  10679. get: function () { return getNestedState(store.state, path); }
  10680. }
  10681. });
  10682. return local
  10683. }
  10684. function makeLocalGetters (store, namespace) {
  10685. if (!store._makeLocalGettersCache[namespace]) {
  10686. var gettersProxy = {};
  10687. var splitPos = namespace.length;
  10688. Object.keys(store.getters).forEach(function (type) {
  10689. // skip if the target getter is not match this namespace
  10690. if (type.slice(0, splitPos) !== namespace) { return }
  10691. // extract local getter type
  10692. var localType = type.slice(splitPos);
  10693. // Add a port to the getters proxy.
  10694. // Define as getter property because
  10695. // we do not want to evaluate the getters in this time.
  10696. Object.defineProperty(gettersProxy, localType, {
  10697. get: function () { return store.getters[type]; },
  10698. enumerable: true
  10699. });
  10700. });
  10701. store._makeLocalGettersCache[namespace] = gettersProxy;
  10702. }
  10703. return store._makeLocalGettersCache[namespace]
  10704. }
  10705. function registerMutation (store, type, handler, local) {
  10706. var entry = store._mutations[type] || (store._mutations[type] = []);
  10707. entry.push(function wrappedMutationHandler (payload) {
  10708. handler.call(store, local.state, payload);
  10709. });
  10710. }
  10711. function registerAction (store, type, handler, local) {
  10712. var entry = store._actions[type] || (store._actions[type] = []);
  10713. entry.push(function wrappedActionHandler (payload) {
  10714. var res = handler.call(store, {
  10715. dispatch: local.dispatch,
  10716. commit: local.commit,
  10717. getters: local.getters,
  10718. state: local.state,
  10719. rootGetters: store.getters,
  10720. rootState: store.state
  10721. }, payload);
  10722. if (!isPromise(res)) {
  10723. res = Promise.resolve(res);
  10724. }
  10725. if (store._devtoolHook) {
  10726. return res.catch(function (err) {
  10727. store._devtoolHook.emit('vuex:error', err);
  10728. throw err
  10729. })
  10730. } else {
  10731. return res
  10732. }
  10733. });
  10734. }
  10735. function registerGetter (store, type, rawGetter, local) {
  10736. if (store._wrappedGetters[type]) {
  10737. if ((true)) {
  10738. console.error(("[vuex] duplicate getter key: " + type));
  10739. }
  10740. return
  10741. }
  10742. store._wrappedGetters[type] = function wrappedGetter (store) {
  10743. return rawGetter(
  10744. local.state, // local state
  10745. local.getters, // local getters
  10746. store.state, // root state
  10747. store.getters // root getters
  10748. )
  10749. };
  10750. }
  10751. function enableStrictMode (store) {
  10752. store._vm.$watch(function () { return this._data.$$state }, function () {
  10753. if ((true)) {
  10754. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  10755. }
  10756. }, { deep: true, sync: true });
  10757. }
  10758. function getNestedState (state, path) {
  10759. return path.reduce(function (state, key) { return state[key]; }, state)
  10760. }
  10761. function unifyObjectStyle (type, payload, options) {
  10762. if (isObject(type) && type.type) {
  10763. options = payload;
  10764. payload = type;
  10765. type = type.type;
  10766. }
  10767. if ((true)) {
  10768. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  10769. }
  10770. return { type: type, payload: payload, options: options }
  10771. }
  10772. function install (_Vue) {
  10773. if (Vue && _Vue === Vue) {
  10774. if ((true)) {
  10775. console.error(
  10776. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  10777. );
  10778. }
  10779. return
  10780. }
  10781. Vue = _Vue;
  10782. applyMixin(Vue);
  10783. }
  10784. /**
  10785. * Reduce the code which written in Vue.js for getting the state.
  10786. * @param {String} [namespace] - Module's namespace
  10787. * @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.
  10788. * @param {Object}
  10789. */
  10790. var mapState = normalizeNamespace(function (namespace, states) {
  10791. var res = {};
  10792. if (( true) && !isValidMap(states)) {
  10793. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  10794. }
  10795. normalizeMap(states).forEach(function (ref) {
  10796. var key = ref.key;
  10797. var val = ref.val;
  10798. res[key] = function mappedState () {
  10799. var state = this.$store.state;
  10800. var getters = this.$store.getters;
  10801. if (namespace) {
  10802. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  10803. if (!module) {
  10804. return
  10805. }
  10806. state = module.context.state;
  10807. getters = module.context.getters;
  10808. }
  10809. return typeof val === 'function'
  10810. ? val.call(this, state, getters)
  10811. : state[val]
  10812. };
  10813. // mark vuex getter for devtools
  10814. res[key].vuex = true;
  10815. });
  10816. return res
  10817. });
  10818. /**
  10819. * Reduce the code which written in Vue.js for committing the mutation
  10820. * @param {String} [namespace] - Module's namespace
  10821. * @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.
  10822. * @return {Object}
  10823. */
  10824. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  10825. var res = {};
  10826. if (( true) && !isValidMap(mutations)) {
  10827. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  10828. }
  10829. normalizeMap(mutations).forEach(function (ref) {
  10830. var key = ref.key;
  10831. var val = ref.val;
  10832. res[key] = function mappedMutation () {
  10833. var args = [], len = arguments.length;
  10834. while ( len-- ) args[ len ] = arguments[ len ];
  10835. // Get the commit method from store
  10836. var commit = this.$store.commit;
  10837. if (namespace) {
  10838. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  10839. if (!module) {
  10840. return
  10841. }
  10842. commit = module.context.commit;
  10843. }
  10844. return typeof val === 'function'
  10845. ? val.apply(this, [commit].concat(args))
  10846. : commit.apply(this.$store, [val].concat(args))
  10847. };
  10848. });
  10849. return res
  10850. });
  10851. /**
  10852. * Reduce the code which written in Vue.js for getting the getters
  10853. * @param {String} [namespace] - Module's namespace
  10854. * @param {Object|Array} getters
  10855. * @return {Object}
  10856. */
  10857. var mapGetters = normalizeNamespace(function (namespace, getters) {
  10858. var res = {};
  10859. if (( true) && !isValidMap(getters)) {
  10860. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  10861. }
  10862. normalizeMap(getters).forEach(function (ref) {
  10863. var key = ref.key;
  10864. var val = ref.val;
  10865. // The namespace has been mutated by normalizeNamespace
  10866. val = namespace + val;
  10867. res[key] = function mappedGetter () {
  10868. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  10869. return
  10870. }
  10871. if (( true) && !(val in this.$store.getters)) {
  10872. console.error(("[vuex] unknown getter: " + val));
  10873. return
  10874. }
  10875. return this.$store.getters[val]
  10876. };
  10877. // mark vuex getter for devtools
  10878. res[key].vuex = true;
  10879. });
  10880. return res
  10881. });
  10882. /**
  10883. * Reduce the code which written in Vue.js for dispatch the action
  10884. * @param {String} [namespace] - Module's namespace
  10885. * @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.
  10886. * @return {Object}
  10887. */
  10888. var mapActions = normalizeNamespace(function (namespace, actions) {
  10889. var res = {};
  10890. if (( true) && !isValidMap(actions)) {
  10891. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  10892. }
  10893. normalizeMap(actions).forEach(function (ref) {
  10894. var key = ref.key;
  10895. var val = ref.val;
  10896. res[key] = function mappedAction () {
  10897. var args = [], len = arguments.length;
  10898. while ( len-- ) args[ len ] = arguments[ len ];
  10899. // get dispatch function from store
  10900. var dispatch = this.$store.dispatch;
  10901. if (namespace) {
  10902. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  10903. if (!module) {
  10904. return
  10905. }
  10906. dispatch = module.context.dispatch;
  10907. }
  10908. return typeof val === 'function'
  10909. ? val.apply(this, [dispatch].concat(args))
  10910. : dispatch.apply(this.$store, [val].concat(args))
  10911. };
  10912. });
  10913. return res
  10914. });
  10915. /**
  10916. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  10917. * @param {String} namespace
  10918. * @return {Object}
  10919. */
  10920. var createNamespacedHelpers = function (namespace) { return ({
  10921. mapState: mapState.bind(null, namespace),
  10922. mapGetters: mapGetters.bind(null, namespace),
  10923. mapMutations: mapMutations.bind(null, namespace),
  10924. mapActions: mapActions.bind(null, namespace)
  10925. }); };
  10926. /**
  10927. * Normalize the map
  10928. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  10929. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  10930. * @param {Array|Object} map
  10931. * @return {Object}
  10932. */
  10933. function normalizeMap (map) {
  10934. if (!isValidMap(map)) {
  10935. return []
  10936. }
  10937. return Array.isArray(map)
  10938. ? map.map(function (key) { return ({ key: key, val: key }); })
  10939. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  10940. }
  10941. /**
  10942. * Validate whether given map is valid or not
  10943. * @param {*} map
  10944. * @return {Boolean}
  10945. */
  10946. function isValidMap (map) {
  10947. return Array.isArray(map) || isObject(map)
  10948. }
  10949. /**
  10950. * 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.
  10951. * @param {Function} fn
  10952. * @return {Function}
  10953. */
  10954. function normalizeNamespace (fn) {
  10955. return function (namespace, map) {
  10956. if (typeof namespace !== 'string') {
  10957. map = namespace;
  10958. namespace = '';
  10959. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  10960. namespace += '/';
  10961. }
  10962. return fn(namespace, map)
  10963. }
  10964. }
  10965. /**
  10966. * Search a special module from store by namespace. if module not exist, print error message.
  10967. * @param {Object} store
  10968. * @param {String} helper
  10969. * @param {String} namespace
  10970. * @return {Object}
  10971. */
  10972. function getModuleByNamespace (store, helper, namespace) {
  10973. var module = store._modulesNamespaceMap[namespace];
  10974. if (( true) && !module) {
  10975. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  10976. }
  10977. return module
  10978. }
  10979. // Credits: borrowed code from fcomb/redux-logger
  10980. function createLogger (ref) {
  10981. if ( ref === void 0 ) ref = {};
  10982. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  10983. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  10984. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  10985. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  10986. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  10987. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  10988. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  10989. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  10990. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  10991. return function (store) {
  10992. var prevState = deepCopy(store.state);
  10993. if (typeof logger === 'undefined') {
  10994. return
  10995. }
  10996. if (logMutations) {
  10997. store.subscribe(function (mutation, state) {
  10998. var nextState = deepCopy(state);
  10999. if (filter(mutation, prevState, nextState)) {
  11000. var formattedTime = getFormattedTime();
  11001. var formattedMutation = mutationTransformer(mutation);
  11002. var message = "mutation " + (mutation.type) + formattedTime;
  11003. startMessage(logger, message, collapsed);
  11004. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  11005. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  11006. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  11007. endMessage(logger);
  11008. }
  11009. prevState = nextState;
  11010. });
  11011. }
  11012. if (logActions) {
  11013. store.subscribeAction(function (action, state) {
  11014. if (actionFilter(action, state)) {
  11015. var formattedTime = getFormattedTime();
  11016. var formattedAction = actionTransformer(action);
  11017. var message = "action " + (action.type) + formattedTime;
  11018. startMessage(logger, message, collapsed);
  11019. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  11020. endMessage(logger);
  11021. }
  11022. });
  11023. }
  11024. }
  11025. }
  11026. function startMessage (logger, message, collapsed) {
  11027. var startMessage = collapsed
  11028. ? logger.groupCollapsed
  11029. : logger.group;
  11030. // render
  11031. try {
  11032. startMessage.call(logger, message);
  11033. } catch (e) {
  11034. logger.log(message);
  11035. }
  11036. }
  11037. function endMessage (logger) {
  11038. try {
  11039. logger.groupEnd();
  11040. } catch (e) {
  11041. logger.log('—— log end ——');
  11042. }
  11043. }
  11044. function getFormattedTime () {
  11045. var time = new Date();
  11046. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  11047. }
  11048. function repeat (str, times) {
  11049. return (new Array(times + 1)).join(str)
  11050. }
  11051. function pad (num, maxLength) {
  11052. return repeat('0', maxLength - num.toString().length) + num
  11053. }
  11054. var index_cjs = {
  11055. Store: Store,
  11056. install: install,
  11057. version: '3.6.2',
  11058. mapState: mapState,
  11059. mapMutations: mapMutations,
  11060. mapGetters: mapGetters,
  11061. mapActions: mapActions,
  11062. createNamespacedHelpers: createNamespacedHelpers,
  11063. createLogger: createLogger
  11064. };
  11065. module.exports = index_cjs;
  11066. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  11067. /***/ }),
  11068. /***/ 29:
  11069. /*!*********************************************!*\
  11070. !*** D:/工作/项目2/亲家母/qjm/store/model/user.js ***!
  11071. \*********************************************/
  11072. /*! no static exports found */
  11073. /***/ (function(module, exports, __webpack_require__) {
  11074. "use strict";
  11075. /* WEBPACK VAR INJECTION */(function(uni) {
  11076. Object.defineProperty(exports, "__esModule", {
  11077. value: true
  11078. });
  11079. exports.default = void 0;
  11080. var state = {
  11081. userInfo: {},
  11082. //用户信息
  11083. orderInfo: {
  11084. complete_count: 0,
  11085. //完成
  11086. received_count: 0,
  11087. //待收货
  11088. unshipped_count: 0,
  11089. //待发货
  11090. order_count: 0,
  11091. //订单总数
  11092. unpaid_count: 0 //待付款
  11093. },
  11094. //订单信息
  11095. hasLogin: false //是否登录
  11096. };
  11097. var mutations = {
  11098. // 登录
  11099. login: function login(state) {
  11100. state.hasLogin = true;
  11101. },
  11102. // 退出登录
  11103. logout: function logout(state, provider) {
  11104. state.hasLogin = false;
  11105. // 清空基础信息
  11106. state.userInfo = {};
  11107. state.orderInfo = {
  11108. complete_count: 0,
  11109. //完成
  11110. received_count: 0,
  11111. //待收货
  11112. unshipped_count: 0,
  11113. //待发货
  11114. order_count: 0,
  11115. //订单总数
  11116. unpaid_count: 0 //待付款
  11117. };
  11118. // 清除缓存用户信息
  11119. uni.removeStorage({
  11120. key: 'userInfo'
  11121. });
  11122. // 清除缓存token
  11123. uni.removeStorage({
  11124. key: 'token'
  11125. });
  11126. },
  11127. // 保存用户信息
  11128. setUserInfo: function setUserInfo(state, provider) {
  11129. state.userInfo = provider;
  11130. uni.setStorage({
  11131. //缓存用户登陆状态
  11132. key: 'userInfo',
  11133. data: provider
  11134. });
  11135. },
  11136. // 保存订单信息
  11137. setOrderInfo: function setOrderInfo(state, provider) {
  11138. state.orderInfo = provider;
  11139. }
  11140. };
  11141. var getters = {};
  11142. var _default = {
  11143. namespaced: true,
  11144. state: state,
  11145. mutations: mutations,
  11146. getters: getters
  11147. };
  11148. exports.default = _default;
  11149. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11150. /***/ }),
  11151. /***/ 3:
  11152. /*!***********************************!*\
  11153. !*** (webpack)/buildin/global.js ***!
  11154. \***********************************/
  11155. /*! no static exports found */
  11156. /***/ (function(module, exports) {
  11157. var g;
  11158. // This works in non-strict mode
  11159. g = (function() {
  11160. return this;
  11161. })();
  11162. try {
  11163. // This works if eval is allowed (see CSP)
  11164. g = g || new Function("return this")();
  11165. } catch (e) {
  11166. // This works if the window reference is available
  11167. if (typeof window === "object") g = window;
  11168. }
  11169. // g can still be undefined, but nothing to do about it...
  11170. // We return undefined, instead of nothing here, so it's
  11171. // easier to handle this case. if(!global) { ...}
  11172. module.exports = g;
  11173. /***/ }),
  11174. /***/ 302:
  11175. /*!***************************************!*\
  11176. !*** D:/工作/项目2/亲家母/qjm/libs/login.js ***!
  11177. \***************************************/
  11178. /*! no static exports found */
  11179. /***/ (function(module, exports, __webpack_require__) {
  11180. "use strict";
  11181. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11182. Object.defineProperty(exports, "__esModule", {
  11183. value: true
  11184. });
  11185. exports.checkLogin = checkLogin;
  11186. exports.toLogin = toLogin;
  11187. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  11188. var _cache = _interopRequireDefault(__webpack_require__(/*! ../utils/cache */ 303));
  11189. var _cache2 = __webpack_require__(/*! ./../config/cache */ 304);
  11190. function prePage() {
  11191. var pages = getCurrentPages();
  11192. var prePage = pages[pages.length - 2];
  11193. return prePage.$vm;
  11194. }
  11195. function toLogin(push, pathLogin) {
  11196. // store.commit("LOGOUT");
  11197. var path = prePage();
  11198. if (path) {
  11199. path = path.router;
  11200. if (path == undefined) {
  11201. path = location.pathname;
  11202. }
  11203. }
  11204. if (!pathLogin) pathLogin = '/page/users/login/index';
  11205. _cache.default.set('login_back_url', path);
  11206. }
  11207. function checkLogin() {
  11208. var token = _cache.default.get(_cache2.LOGIN_STATUS);
  11209. var expiresTime = _cache.default.get(_cache2.EXPIRES_TIME);
  11210. var newTime = Math.round(new Date() / 1000);
  11211. if (expiresTime < newTime || !token) {
  11212. _cache.default.clear(_cache2.LOGIN_STATUS);
  11213. _cache.default.clear(_cache2.EXPIRES_TIME);
  11214. _cache.default.clear(_cache2.USER_INFO);
  11215. _cache.default.clear(_cache2.STATE_R_KEY);
  11216. return false;
  11217. } else {
  11218. _store.default.commit('UPDATE_LOGIN', token);
  11219. var userInfo = _cache.default.get(_cache2.USER_INFO, true);
  11220. if (userInfo) {
  11221. _store.default.commit('UPDATE_USERINFO', userInfo);
  11222. }
  11223. return true;
  11224. }
  11225. }
  11226. /***/ }),
  11227. /***/ 303:
  11228. /*!****************************************!*\
  11229. !*** D:/工作/项目2/亲家母/qjm/utils/cache.js ***!
  11230. \****************************************/
  11231. /*! no static exports found */
  11232. /***/ (function(module, exports, __webpack_require__) {
  11233. "use strict";
  11234. /* WEBPACK VAR INJECTION */(function(uni) {
  11235. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11236. Object.defineProperty(exports, "__esModule", {
  11237. value: true
  11238. });
  11239. exports.default = void 0;
  11240. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11241. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11242. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11243. var Cache = /*#__PURE__*/function () {
  11244. function Cache(handler) {
  11245. (0, _classCallCheck2.default)(this, Cache);
  11246. this.cacheSetHandler = uni.setStorageSync;
  11247. this.cacheGetHandler = uni.getStorageSync;
  11248. this.cacheClearHandler = uni.removeStorageSync;
  11249. this.cacheExpire = '_expire_2019_12_17_18_44';
  11250. }
  11251. /**
  11252. * 获取当前时间戳
  11253. */
  11254. (0, _createClass2.default)(Cache, [{
  11255. key: "time",
  11256. value: function time() {
  11257. return Math.round(new Date() / 1000);
  11258. }
  11259. /**
  11260. * 设置过期时间缓存
  11261. * @param {Object} key
  11262. * @param {Object} expire
  11263. */
  11264. }, {
  11265. key: "setExpireCahe",
  11266. value: function setExpireCahe(key, expire) {
  11267. expire = expire !== undefined ? expire : 0;
  11268. if (expire) {
  11269. this.cacheSetHandler(key + this.cacheExpire, this.time() + expire);
  11270. }
  11271. }
  11272. /**
  11273. * 缓存是否过期,过期自动删除
  11274. * @param {Object} key
  11275. * @param {Object} $bool true = 删除,false = 不删除
  11276. */
  11277. }, {
  11278. key: "getExpireCahe",
  11279. value: function getExpireCahe(key, $bool) {
  11280. try {
  11281. var time = this.cacheGetHandler(key + this.cacheExpire);
  11282. if (time) {
  11283. var newTime = parseInt(time);
  11284. if (time && time < this.time() && !Number.isNaN(newTime)) {
  11285. if ($bool === undefined || $bool === true) {
  11286. this.cacheClearHandler(key);
  11287. this.cacheClearHandler(key + this.cacheExpire);
  11288. }
  11289. return false;
  11290. } else return true;
  11291. } else {
  11292. return !!this.cacheGetHandler(key);
  11293. }
  11294. } catch (e) {
  11295. return false;
  11296. }
  11297. }
  11298. /**
  11299. * 设置缓存
  11300. * @param {Object} key
  11301. * @param {Object} data
  11302. */
  11303. }, {
  11304. key: "set",
  11305. value: function set(key, data, expire) {
  11306. if ((0, _typeof2.default)(data) === 'object') data = JSON.stringify(data);
  11307. try {
  11308. this.setExpireCahe(key, expire);
  11309. return this.cacheSetHandler(key, data);
  11310. } catch (e) {
  11311. return false;
  11312. }
  11313. }
  11314. /**
  11315. * 检测缓存是否存在
  11316. * @param {Object} key
  11317. */
  11318. }, {
  11319. key: "has",
  11320. value: function has(key) {
  11321. return this.getExpireCahe(key);
  11322. }
  11323. /**
  11324. * 获取缓存
  11325. * @param {Object} key
  11326. * @param {Object} $default
  11327. * @param {Object} expire
  11328. */
  11329. }, {
  11330. key: "get",
  11331. value: function get(key, $default, expire) {
  11332. try {
  11333. var isBe = this.getExpireCahe(key);
  11334. var data = this.cacheGetHandler(key);
  11335. if (data && isBe) {
  11336. if (typeof $default === 'boolean') return JSON.parse(data);else return data;
  11337. } else {
  11338. if (typeof $default === 'function') {
  11339. var value = $default();
  11340. this.set(key, value, expire);
  11341. return value;
  11342. } else {
  11343. this.set(key, $default, expire);
  11344. return $default;
  11345. }
  11346. }
  11347. } catch (e) {
  11348. return null;
  11349. }
  11350. }
  11351. /**
  11352. * 删除缓存
  11353. * @param {Object} key
  11354. */
  11355. }, {
  11356. key: "clear",
  11357. value: function clear(key) {
  11358. try {
  11359. var cahceValue = this.cacheGetHandler(key + this.cacheExpire);
  11360. if (cahceValue) this.cacheClearHandler(key + this.cacheExpire);
  11361. return this.cacheClearHandler(key);
  11362. } catch (e) {
  11363. return false;
  11364. }
  11365. }
  11366. /**
  11367. * 清除过期缓存
  11368. */
  11369. }, {
  11370. key: "clearOverdue",
  11371. value: function clearOverdue() {
  11372. // let cacheList = uni.getStorageInfoSync(),that = this;
  11373. // if (typeof cacheList.keys === 'object'){
  11374. // cacheList.keys.forEach(item=>{
  11375. // that.getExpireCahe(item);
  11376. // })
  11377. // }
  11378. }
  11379. }]);
  11380. return Cache;
  11381. }();
  11382. var _default = new Cache();
  11383. exports.default = _default;
  11384. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11385. /***/ }),
  11386. /***/ 304:
  11387. /*!*****************************************!*\
  11388. !*** D:/工作/项目2/亲家母/qjm/config/cache.js ***!
  11389. \*****************************************/
  11390. /*! no static exports found */
  11391. /***/ (function(module, exports) {
  11392. module.exports = {
  11393. //token
  11394. LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
  11395. // uid
  11396. UID: 'UID',
  11397. //�û�
  11398. USER_INFO: 'USER_INFO',
  11399. //token�����¼�
  11400. EXPIRES_TIME: 'EXPIRES_TIME',
  11401. //�Ƿ���Ȩ
  11402. WX_AUTH: 'WX_AUTH',
  11403. //���ں���Ȩcode
  11404. STATE_KEY: 'wx_authorize_state',
  11405. //�û�����
  11406. LOGINTYPE: 'loginType',
  11407. //���ں���ת����
  11408. BACK_URL: 'login_back_url',
  11409. // ����code
  11410. STATE_R_KEY: 'roution_authorize_state',
  11411. //��ȨlogoС����
  11412. LOGO_URL: 'LOGO_URL',
  11413. //模板缓存
  11414. SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
  11415. TIPS_KEY: 'TIPS_KEY',
  11416. SPREAD: 'spread',
  11417. //缓存经度
  11418. CACHE_LONGITUDE: 'LONGITUDE',
  11419. //缓存纬度
  11420. CACHE_LATITUDE: 'LATITUDE'
  11421. };
  11422. /***/ }),
  11423. /***/ 343:
  11424. /*!***************************************!*\
  11425. !*** D:/工作/项目2/亲家母/qjm/api/upload.js ***!
  11426. \***************************************/
  11427. /*! no static exports found */
  11428. /***/ (function(module, exports, __webpack_require__) {
  11429. "use strict";
  11430. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11431. Object.defineProperty(exports, "__esModule", {
  11432. value: true
  11433. });
  11434. exports.get_list = get_list;
  11435. exports.get_product_info = get_product_info;
  11436. exports.get_rule = get_rule;
  11437. exports.is_format_attr = is_format_attr;
  11438. exports.save = save;
  11439. exports.set_apply = set_apply;
  11440. exports.temp_list = temp_list;
  11441. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  11442. // 提交审核
  11443. function set_apply(data, id) {
  11444. return (0, _request.default)({
  11445. url: '/api/user_product/set_apply/' + id,
  11446. method: 'post',
  11447. data: data
  11448. });
  11449. }
  11450. //我的商品列表
  11451. function get_list(data) {
  11452. return (0, _request.default)({
  11453. url: '/api/user_product/get_list',
  11454. method: 'get',
  11455. data: data
  11456. });
  11457. }
  11458. //新增修改商品
  11459. function save(data, id) {
  11460. return (0, _request.default)({
  11461. url: '/api/user_product/save/' + id,
  11462. method: 'post',
  11463. data: data
  11464. });
  11465. }
  11466. // 生成规格列表
  11467. function is_format_attr(data) {
  11468. return (0, _request.default)({
  11469. url: '/api/user_product/is_format_attr/0',
  11470. method: 'post',
  11471. data: data
  11472. });
  11473. }
  11474. // 获取运费模板
  11475. function temp_list(data) {
  11476. return (0, _request.default)({
  11477. url: '/api/user_product/temp_list',
  11478. method: 'get',
  11479. data: data
  11480. });
  11481. }
  11482. // 获取商品详情
  11483. function get_product_info(data, id) {
  11484. return (0, _request.default)({
  11485. url: '/api/user_product/get_product_info/' + id,
  11486. method: 'get',
  11487. data: data
  11488. });
  11489. }
  11490. // 获取规格列表
  11491. function get_rule(data) {
  11492. return (0, _request.default)({
  11493. url: '/api/user_product/get_rule',
  11494. method: 'get',
  11495. data: data
  11496. });
  11497. }
  11498. /***/ }),
  11499. /***/ 35:
  11500. /*!**********************************************************************************************************!*\
  11501. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  11502. \**********************************************************************************************************/
  11503. /*! exports provided: default */
  11504. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11505. "use strict";
  11506. __webpack_require__.r(__webpack_exports__);
  11507. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  11508. /* globals __VUE_SSR_CONTEXT__ */
  11509. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  11510. // This module is a runtime utility for cleaner component module output and will
  11511. // be included in the final webpack user bundle.
  11512. function normalizeComponent (
  11513. scriptExports,
  11514. render,
  11515. staticRenderFns,
  11516. functionalTemplate,
  11517. injectStyles,
  11518. scopeId,
  11519. moduleIdentifier, /* server only */
  11520. shadowMode, /* vue-cli only */
  11521. components, // fixed by xxxxxx auto components
  11522. renderjs // fixed by xxxxxx renderjs
  11523. ) {
  11524. // Vue.extend constructor export interop
  11525. var options = typeof scriptExports === 'function'
  11526. ? scriptExports.options
  11527. : scriptExports
  11528. // fixed by xxxxxx auto components
  11529. if (components) {
  11530. if (!options.components) {
  11531. options.components = {}
  11532. }
  11533. var hasOwn = Object.prototype.hasOwnProperty
  11534. for (var name in components) {
  11535. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  11536. options.components[name] = components[name]
  11537. }
  11538. }
  11539. }
  11540. // fixed by xxxxxx renderjs
  11541. if (renderjs) {
  11542. if(typeof renderjs.beforeCreate === 'function'){
  11543. renderjs.beforeCreate = [renderjs.beforeCreate]
  11544. }
  11545. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  11546. this[renderjs.__module] = this
  11547. });
  11548. (options.mixins || (options.mixins = [])).push(renderjs)
  11549. }
  11550. // render functions
  11551. if (render) {
  11552. options.render = render
  11553. options.staticRenderFns = staticRenderFns
  11554. options._compiled = true
  11555. }
  11556. // functional template
  11557. if (functionalTemplate) {
  11558. options.functional = true
  11559. }
  11560. // scopedId
  11561. if (scopeId) {
  11562. options._scopeId = 'data-v-' + scopeId
  11563. }
  11564. var hook
  11565. if (moduleIdentifier) { // server build
  11566. hook = function (context) {
  11567. // 2.3 injection
  11568. context =
  11569. context || // cached call
  11570. (this.$vnode && this.$vnode.ssrContext) || // stateful
  11571. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  11572. // 2.2 with runInNewContext: true
  11573. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  11574. context = __VUE_SSR_CONTEXT__
  11575. }
  11576. // inject component styles
  11577. if (injectStyles) {
  11578. injectStyles.call(this, context)
  11579. }
  11580. // register component module identifier for async chunk inferrence
  11581. if (context && context._registeredComponents) {
  11582. context._registeredComponents.add(moduleIdentifier)
  11583. }
  11584. }
  11585. // used by ssr in case component is cached and beforeCreate
  11586. // never gets called
  11587. options._ssrRegister = hook
  11588. } else if (injectStyles) {
  11589. hook = shadowMode
  11590. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  11591. : injectStyles
  11592. }
  11593. if (hook) {
  11594. if (options.functional) {
  11595. // for template-only hot-reload because in that case the render fn doesn't
  11596. // go through the normalizer
  11597. options._injectStyles = hook
  11598. // register for functioal component in vue file
  11599. var originalRender = options.render
  11600. options.render = function renderWithStyleInjection (h, context) {
  11601. hook.call(context)
  11602. return originalRender(h, context)
  11603. }
  11604. } else {
  11605. // inject component registration as beforeCreate hook
  11606. var existing = options.beforeCreate
  11607. options.beforeCreate = existing
  11608. ? [].concat(existing, hook)
  11609. : [hook]
  11610. }
  11611. }
  11612. return {
  11613. exports: scriptExports,
  11614. options: options
  11615. }
  11616. }
  11617. /***/ }),
  11618. /***/ 36:
  11619. /*!*******************************************!*\
  11620. !*** D:/工作/项目2/亲家母/qjm/uview-ui/index.js ***!
  11621. \*******************************************/
  11622. /*! no static exports found */
  11623. /***/ (function(module, exports, __webpack_require__) {
  11624. "use strict";
  11625. /* WEBPACK VAR INJECTION */(function(uni) {
  11626. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11627. Object.defineProperty(exports, "__esModule", {
  11628. value: true
  11629. });
  11630. exports.default = void 0;
  11631. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 37));
  11632. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 38));
  11633. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 42));
  11634. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 43));
  11635. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 47));
  11636. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 48));
  11637. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 49));
  11638. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 50));
  11639. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 51));
  11640. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 52));
  11641. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 53));
  11642. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 40));
  11643. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 39));
  11644. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 54));
  11645. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 41));
  11646. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 55));
  11647. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 56));
  11648. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 57));
  11649. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 58));
  11650. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 59));
  11651. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 60);
  11652. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 61));
  11653. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 62));
  11654. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 63));
  11655. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 64));
  11656. // 引入全局mixin
  11657. // 引入关于是否mixin集成小程序分享的配置
  11658. // import wxshare from './libs/mixin/mpShare.js'
  11659. // 全局挂载引入http相关请求拦截插件
  11660. function wranning(str) {
  11661. // 开发环境进行信息输出,主要是一些报错信息
  11662. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  11663. // 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
  11664. if (true) {
  11665. console.warn(str);
  11666. }
  11667. }
  11668. // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  11669. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  11670. // let vuexStore = {};
  11671. // try {
  11672. // vuexStore = require("@/store/$u.mixin.js");
  11673. // } catch (e) {
  11674. // //TODO handle the exception
  11675. // }
  11676. // post类型对象参数转为get类型url参数
  11677. var $u = {
  11678. queryParams: _queryParams.default,
  11679. route: _route.default,
  11680. timeFormat: _timeFormat.default,
  11681. date: _timeFormat.default,
  11682. // 另名date
  11683. timeFrom: _timeFrom.default,
  11684. colorGradient: _colorGradient.default.colorGradient,
  11685. colorToRgba: _colorGradient.default.colorToRgba,
  11686. guid: _guid.default,
  11687. color: _color.default,
  11688. sys: _sys.sys,
  11689. os: _sys.os,
  11690. type2icon: _type2icon.default,
  11691. randomArray: _randomArray.default,
  11692. wranning: wranning,
  11693. get: _request.default.get,
  11694. post: _request.default.post,
  11695. put: _request.default.put,
  11696. 'delete': _request.default.delete,
  11697. hexToRgb: _colorGradient.default.hexToRgb,
  11698. rgbToHex: _colorGradient.default.rgbToHex,
  11699. test: _test.default,
  11700. random: _random.default,
  11701. deepClone: _deepClone.default,
  11702. deepMerge: _deepMerge.default,
  11703. getParent: _getParent.default,
  11704. $parent: _$parent.default,
  11705. addUnit: _addUnit.default,
  11706. trim: _trim.default,
  11707. type: ['primary', 'success', 'error', 'warning', 'info'],
  11708. http: _request.default,
  11709. toast: _toast.default,
  11710. config: _config.default,
  11711. // uView配置信息相关,比如版本号
  11712. zIndex: _zIndex.default,
  11713. debounce: _debounce.default,
  11714. throttle: _throttle.default
  11715. };
  11716. // $u挂载到uni对象上
  11717. uni.$u = $u;
  11718. var install = function install(Vue) {
  11719. Vue.mixin(_mixin.default);
  11720. if (Vue.prototype.openShare) {
  11721. Vue.mixin(mpShare);
  11722. }
  11723. // Vue.mixin(vuexStore);
  11724. // 时间格式化,同时两个名称,date和timeFormat
  11725. Vue.filter('timeFormat', function (timestamp, format) {
  11726. return (0, _timeFormat.default)(timestamp, format);
  11727. });
  11728. Vue.filter('date', function (timestamp, format) {
  11729. return (0, _timeFormat.default)(timestamp, format);
  11730. });
  11731. // 将多久以前的方法,注入到全局过滤器
  11732. Vue.filter('timeFrom', function (timestamp, format) {
  11733. return (0, _timeFrom.default)(timestamp, format);
  11734. });
  11735. Vue.prototype.$u = $u;
  11736. };
  11737. var _default = {
  11738. install: install
  11739. };
  11740. exports.default = _default;
  11741. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11742. /***/ }),
  11743. /***/ 360:
  11744. /*!***************************************!*\
  11745. !*** D:/工作/项目2/亲家母/qjm/api/wallet.js ***!
  11746. \***************************************/
  11747. /*! no static exports found */
  11748. /***/ (function(module, exports, __webpack_require__) {
  11749. "use strict";
  11750. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11751. Object.defineProperty(exports, "__esModule", {
  11752. value: true
  11753. });
  11754. exports.aliInfo = aliInfo;
  11755. exports.balance = balance;
  11756. exports.bankInfo = bankInfo;
  11757. exports.extract = extract;
  11758. exports.extractBank = extractBank;
  11759. exports.extractCash = extractCash;
  11760. exports.rechargeRoutine = rechargeRoutine;
  11761. exports.setAliInfo = setAliInfo;
  11762. exports.setBankInfo = setBankInfo;
  11763. exports.spreadCommission = spreadCommission;
  11764. exports.userBalance = userBalance;
  11765. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  11766. // 获取用户消费记录
  11767. function spreadCommission(data, state) {
  11768. return (0, _request.default)({
  11769. url: '/api/spread/commission/' + state,
  11770. method: 'get',
  11771. data: data
  11772. });
  11773. }
  11774. // 获取账户余额
  11775. function userBalance(data) {
  11776. return (0, _request.default)({
  11777. url: '/api/user/balance',
  11778. method: 'get',
  11779. data: data
  11780. });
  11781. }
  11782. // 提现
  11783. function extractCash(data) {
  11784. return (0, _request.default)({
  11785. url: '/api/extract/cash',
  11786. method: 'post',
  11787. data: data
  11788. });
  11789. }
  11790. // 提现信息
  11791. function extractBank(data) {
  11792. return (0, _request.default)({
  11793. url: '/api/extract/bank',
  11794. method: 'get',
  11795. data: data
  11796. });
  11797. }
  11798. // 小程序充值
  11799. function rechargeRoutine(data) {
  11800. return (0, _request.default)({
  11801. url: '/api/recharge/routine',
  11802. method: 'post',
  11803. data: data
  11804. });
  11805. }
  11806. // 获取提现支付宝账号
  11807. function aliInfo(data) {
  11808. return (0, _request.default)({
  11809. url: '/api/ali/info',
  11810. method: 'get',
  11811. data: data
  11812. });
  11813. }
  11814. //获取默认银行卡账号
  11815. function bankInfo(data) {
  11816. return (0, _request.default)({
  11817. url: '/api/bank/info',
  11818. method: 'get',
  11819. data: data
  11820. });
  11821. }
  11822. // 保存提现支付宝账号
  11823. function setAliInfo(data) {
  11824. return (0, _request.default)({
  11825. url: '/api/ali/edit',
  11826. method: 'post',
  11827. data: data
  11828. });
  11829. }
  11830. //保存默认银行卡账号
  11831. function setBankInfo(data) {
  11832. return (0, _request.default)({
  11833. url: '/api/bank/edit',
  11834. method: 'post',
  11835. data: data
  11836. });
  11837. }
  11838. // 账户余额
  11839. function balance(data) {
  11840. return (0, _request.default)({
  11841. url: '/api/user/balance',
  11842. method: 'get',
  11843. data: data
  11844. });
  11845. }
  11846. // 提现列表
  11847. function extract(data) {
  11848. return (0, _request.default)({
  11849. url: '/api/extract/user',
  11850. method: 'get',
  11851. data: data
  11852. });
  11853. }
  11854. /***/ }),
  11855. /***/ 37:
  11856. /*!******************************************************!*\
  11857. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/mixin/mixin.js ***!
  11858. \******************************************************/
  11859. /*! no static exports found */
  11860. /***/ (function(module, exports, __webpack_require__) {
  11861. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  11862. data: function data() {
  11863. return {};
  11864. },
  11865. onLoad: function onLoad() {
  11866. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  11867. this.$u.getRect = this.$uGetRect;
  11868. },
  11869. methods: {
  11870. // 查询节点信息
  11871. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  11872. // 解决办法为在组件根部再套一个没有任何作用的view元素
  11873. $uGetRect: function $uGetRect(selector, all) {
  11874. var _this = this;
  11875. return new Promise(function (resolve) {
  11876. uni.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  11877. if (all && Array.isArray(rect) && rect.length) {
  11878. resolve(rect);
  11879. }
  11880. if (!all && rect) {
  11881. resolve(rect);
  11882. }
  11883. }).exec();
  11884. });
  11885. },
  11886. getParentData: function getParentData() {
  11887. var _this2 = this;
  11888. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  11889. // 避免在created中去定义parent变量
  11890. if (!this.parent) this.parent = false;
  11891. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  11892. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  11893. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  11894. this.parent = this.$u.$parent.call(this, parentName);
  11895. if (this.parent) {
  11896. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  11897. Object.keys(this.parentData).map(function (key) {
  11898. _this2.parentData[key] = _this2.parent[key];
  11899. });
  11900. }
  11901. },
  11902. // 阻止事件冒泡
  11903. preventEvent: function preventEvent(e) {
  11904. e && e.stopPropagation && e.stopPropagation();
  11905. }
  11906. },
  11907. onReachBottom: function onReachBottom() {
  11908. uni.$emit('uOnReachBottom');
  11909. },
  11910. beforeDestroy: function beforeDestroy() {
  11911. var _this3 = this;
  11912. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  11913. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  11914. if (this.parent && uni.$u.test.array(this.parent.children)) {
  11915. // 组件销毁时,移除父组件中的children数组中对应的实例
  11916. var childrenList = this.parent.children;
  11917. childrenList.map(function (child, index) {
  11918. // 如果相等,则移除
  11919. if (child === _this3) {
  11920. childrenList.splice(index, 1);
  11921. }
  11922. });
  11923. }
  11924. }
  11925. };
  11926. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11927. /***/ }),
  11928. /***/ 38:
  11929. /*!********************************************************!*\
  11930. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/request/index.js ***!
  11931. \********************************************************/
  11932. /*! no static exports found */
  11933. /***/ (function(module, exports, __webpack_require__) {
  11934. "use strict";
  11935. /* WEBPACK VAR INJECTION */(function(uni) {
  11936. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11937. Object.defineProperty(exports, "__esModule", {
  11938. value: true
  11939. });
  11940. exports.default = void 0;
  11941. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11942. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11943. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 39));
  11944. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 41));
  11945. var Request = /*#__PURE__*/function () {
  11946. function Request() {
  11947. var _this = this;
  11948. (0, _classCallCheck2.default)(this, Request);
  11949. this.config = {
  11950. baseUrl: '',
  11951. // 请求的根域名
  11952. // 默认的请求头
  11953. header: {},
  11954. method: 'POST',
  11955. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  11956. dataType: 'json',
  11957. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  11958. responseType: 'text',
  11959. showLoading: true,
  11960. // 是否显示请求中的loading
  11961. loadingText: '请求中...',
  11962. loadingTime: 800,
  11963. // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  11964. timer: null,
  11965. // 定时器
  11966. originalData: false,
  11967. // 是否在拦截器中返回服务端的原始数据,见文档说明
  11968. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  11969. };
  11970. // 拦截器
  11971. this.interceptor = {
  11972. // 请求前的拦截
  11973. request: null,
  11974. // 请求后的拦截
  11975. response: null
  11976. };
  11977. // get请求
  11978. this.get = function (url) {
  11979. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11980. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  11981. return _this.request({
  11982. method: 'GET',
  11983. url: url,
  11984. header: header,
  11985. data: data
  11986. });
  11987. };
  11988. // post请求
  11989. this.post = function (url) {
  11990. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11991. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  11992. return _this.request({
  11993. url: url,
  11994. method: 'POST',
  11995. header: header,
  11996. data: data
  11997. });
  11998. };
  11999. // put请求,不支持支付宝小程序(HX2.6.15)
  12000. this.put = function (url) {
  12001. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12002. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  12003. return _this.request({
  12004. url: url,
  12005. method: 'PUT',
  12006. header: header,
  12007. data: data
  12008. });
  12009. };
  12010. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  12011. this.delete = function (url) {
  12012. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12013. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  12014. return _this.request({
  12015. url: url,
  12016. method: 'DELETE',
  12017. header: header,
  12018. data: data
  12019. });
  12020. };
  12021. }
  12022. (0, _createClass2.default)(Request, [{
  12023. key: "setConfig",
  12024. value:
  12025. // 设置全局默认配置
  12026. function setConfig(customConfig) {
  12027. // 深度合并对象,否则会造成对象深层属性丢失
  12028. this.config = (0, _deepMerge.default)(this.config, customConfig);
  12029. }
  12030. // 主要请求部分
  12031. }, {
  12032. key: "request",
  12033. value: function request() {
  12034. var _this2 = this;
  12035. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12036. // 检查请求拦截
  12037. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  12038. var tmpConfig = {};
  12039. var interceptorRequest = this.interceptor.request(options);
  12040. if (interceptorRequest === false) {
  12041. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  12042. return new Promise(function () {});
  12043. }
  12044. this.options = interceptorRequest;
  12045. }
  12046. options.dataType = options.dataType || this.config.dataType;
  12047. options.responseType = options.responseType || this.config.responseType;
  12048. options.url = options.url || '';
  12049. options.params = options.params || {};
  12050. options.header = Object.assign({}, this.config.header, options.header);
  12051. options.method = options.method || this.config.method;
  12052. return new Promise(function (resolve, reject) {
  12053. options.complete = function (response) {
  12054. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  12055. uni.hideLoading();
  12056. // 清除定时器,如果请求回来了,就无需loading
  12057. clearTimeout(_this2.config.timer);
  12058. _this2.config.timer = null;
  12059. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  12060. if (_this2.config.originalData) {
  12061. // 判断是否存在拦截器
  12062. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  12063. var resInterceptors = _this2.interceptor.response(response);
  12064. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  12065. if (resInterceptors !== false) {
  12066. resolve(resInterceptors);
  12067. } else {
  12068. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  12069. reject(response);
  12070. }
  12071. } else {
  12072. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  12073. resolve(response);
  12074. }
  12075. } else {
  12076. if (response.statusCode == 200) {
  12077. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  12078. var _resInterceptors = _this2.interceptor.response(response.data);
  12079. if (_resInterceptors !== false) {
  12080. resolve(_resInterceptors);
  12081. } else {
  12082. reject(response.data);
  12083. }
  12084. } else {
  12085. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  12086. resolve(response.data);
  12087. }
  12088. } else {
  12089. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  12090. // if(response.errMsg) {
  12091. // uni.showModal({
  12092. // title: response.errMsg
  12093. // });
  12094. // }
  12095. reject(response);
  12096. }
  12097. }
  12098. };
  12099. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  12100. options.url = _test.default.url(options.url) ? options.url : _this2.config.baseUrl + (options.url.indexOf('/') == 0 ? options.url : '/' + options.url);
  12101. // 是否显示loading
  12102. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  12103. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  12104. if (_this2.config.showLoading && !_this2.config.timer) {
  12105. _this2.config.timer = setTimeout(function () {
  12106. uni.showLoading({
  12107. title: _this2.config.loadingText,
  12108. mask: _this2.config.loadingMask
  12109. });
  12110. _this2.config.timer = null;
  12111. }, _this2.config.loadingTime);
  12112. }
  12113. uni.request(options);
  12114. });
  12115. // .catch(res => {
  12116. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  12117. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  12118. // return new Promise(()=>{});
  12119. // })
  12120. }
  12121. }]);
  12122. return Request;
  12123. }();
  12124. var _default = new Request();
  12125. exports.default = _default;
  12126. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12127. /***/ }),
  12128. /***/ 39:
  12129. /*!*************************************************************!*\
  12130. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/deepMerge.js ***!
  12131. \*************************************************************/
  12132. /*! no static exports found */
  12133. /***/ (function(module, exports, __webpack_require__) {
  12134. "use strict";
  12135. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12136. Object.defineProperty(exports, "__esModule", {
  12137. value: true
  12138. });
  12139. exports.default = void 0;
  12140. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  12141. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 40));
  12142. // JS对象深度合并
  12143. function deepMerge() {
  12144. var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12145. var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12146. target = (0, _deepClone.default)(target);
  12147. if ((0, _typeof2.default)(target) !== 'object' || (0, _typeof2.default)(source) !== 'object') return false;
  12148. for (var prop in source) {
  12149. if (!source.hasOwnProperty(prop)) continue;
  12150. if (prop in target) {
  12151. if ((0, _typeof2.default)(target[prop]) !== 'object') {
  12152. target[prop] = source[prop];
  12153. } else {
  12154. if ((0, _typeof2.default)(source[prop]) !== 'object') {
  12155. target[prop] = source[prop];
  12156. } else {
  12157. if (target[prop].concat && source[prop].concat) {
  12158. target[prop] = target[prop].concat(source[prop]);
  12159. } else {
  12160. target[prop] = deepMerge(target[prop], source[prop]);
  12161. }
  12162. }
  12163. }
  12164. } else {
  12165. target[prop] = source[prop];
  12166. }
  12167. }
  12168. return target;
  12169. }
  12170. var _default = deepMerge;
  12171. exports.default = _default;
  12172. /***/ }),
  12173. /***/ 4:
  12174. /*!**********************************************************************!*\
  12175. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  12176. \**********************************************************************/
  12177. /*! no static exports found */
  12178. /***/ (function(module, exports) {
  12179. function _interopRequireDefault(obj) {
  12180. return obj && obj.__esModule ? obj : {
  12181. "default": obj
  12182. };
  12183. }
  12184. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12185. /***/ }),
  12186. /***/ 40:
  12187. /*!*************************************************************!*\
  12188. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/deepClone.js ***!
  12189. \*************************************************************/
  12190. /*! no static exports found */
  12191. /***/ (function(module, exports, __webpack_require__) {
  12192. "use strict";
  12193. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12194. Object.defineProperty(exports, "__esModule", {
  12195. value: true
  12196. });
  12197. exports.default = void 0;
  12198. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  12199. // 判断arr是否为一个数组,返回一个bool值
  12200. function isArray(arr) {
  12201. return Object.prototype.toString.call(arr) === '[object Array]';
  12202. }
  12203. // 深度克隆
  12204. function deepClone(obj) {
  12205. // 对常见的“非”值,直接返回原来值
  12206. if ([null, undefined, NaN, false].includes(obj)) return obj;
  12207. if ((0, _typeof2.default)(obj) !== "object" && typeof obj !== 'function') {
  12208. //原始类型直接返回
  12209. return obj;
  12210. }
  12211. var o = isArray(obj) ? [] : {};
  12212. for (var i in obj) {
  12213. if (obj.hasOwnProperty(i)) {
  12214. o[i] = (0, _typeof2.default)(obj[i]) === "object" ? deepClone(obj[i]) : obj[i];
  12215. }
  12216. }
  12217. return o;
  12218. }
  12219. var _default = deepClone;
  12220. exports.default = _default;
  12221. /***/ }),
  12222. /***/ 41:
  12223. /*!********************************************************!*\
  12224. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/test.js ***!
  12225. \********************************************************/
  12226. /*! no static exports found */
  12227. /***/ (function(module, exports, __webpack_require__) {
  12228. "use strict";
  12229. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12230. Object.defineProperty(exports, "__esModule", {
  12231. value: true
  12232. });
  12233. exports.default = void 0;
  12234. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  12235. /**
  12236. * 验证电子邮箱格式
  12237. */
  12238. function email(value) {
  12239. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  12240. }
  12241. /**
  12242. * 验证手机格式
  12243. */
  12244. function mobile(value) {
  12245. return /^1[3-9]\d{9}$/.test(value);
  12246. }
  12247. /**
  12248. * 验证URL格式
  12249. */
  12250. function url(value) {
  12251. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  12252. }
  12253. /**
  12254. * 验证日期格式
  12255. */
  12256. function date(value) {
  12257. return !/Invalid|NaN/.test(new Date(value).toString());
  12258. }
  12259. /**
  12260. * 验证ISO类型的日期格式
  12261. */
  12262. function dateISO(value) {
  12263. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  12264. }
  12265. /**
  12266. * 验证十进制数字
  12267. */
  12268. function number(value) {
  12269. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  12270. }
  12271. /**
  12272. * 验证整数
  12273. */
  12274. function digits(value) {
  12275. return /^\d+$/.test(value);
  12276. }
  12277. /**
  12278. * 验证身份证号码
  12279. */
  12280. function idCard(value) {
  12281. 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);
  12282. }
  12283. /**
  12284. * 是否车牌号
  12285. */
  12286. function carNo(value) {
  12287. // 新能源车牌
  12288. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  12289. // 旧车牌
  12290. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  12291. if (value.length === 7) {
  12292. return creg.test(value);
  12293. } else if (value.length === 8) {
  12294. return xreg.test(value);
  12295. } else {
  12296. return false;
  12297. }
  12298. }
  12299. /**
  12300. * 金额,只允许2位小数
  12301. */
  12302. function amount(value) {
  12303. //金额,只允许保留两位小数
  12304. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  12305. }
  12306. /**
  12307. * 中文
  12308. */
  12309. function chinese(value) {
  12310. var reg = /^[\u4e00-\u9fa5]+$/gi;
  12311. return reg.test(value);
  12312. }
  12313. /**
  12314. * 只能输入字母
  12315. */
  12316. function letter(value) {
  12317. return /^[a-zA-Z]*$/.test(value);
  12318. }
  12319. /**
  12320. * 只能是字母或者数字
  12321. */
  12322. function enOrNum(value) {
  12323. //英文或者数字
  12324. var reg = /^[0-9a-zA-Z]*$/g;
  12325. return reg.test(value);
  12326. }
  12327. /**
  12328. * 验证是否包含某个值
  12329. */
  12330. function contains(value, param) {
  12331. return value.indexOf(param) >= 0;
  12332. }
  12333. /**
  12334. * 验证一个值范围[min, max]
  12335. */
  12336. function range(value, param) {
  12337. return value >= param[0] && value <= param[1];
  12338. }
  12339. /**
  12340. * 验证一个长度范围[min, max]
  12341. */
  12342. function rangeLength(value, param) {
  12343. return value.length >= param[0] && value.length <= param[1];
  12344. }
  12345. /**
  12346. * 是否固定电话
  12347. */
  12348. function landline(value) {
  12349. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  12350. return reg.test(value);
  12351. }
  12352. /**
  12353. * 判断是否为空
  12354. */
  12355. function empty(value) {
  12356. switch ((0, _typeof2.default)(value)) {
  12357. case 'undefined':
  12358. return true;
  12359. case 'string':
  12360. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  12361. break;
  12362. case 'boolean':
  12363. if (!value) return true;
  12364. break;
  12365. case 'number':
  12366. if (0 === value || isNaN(value)) return true;
  12367. break;
  12368. case 'object':
  12369. if (null === value || value.length === 0) return true;
  12370. for (var i in value) {
  12371. return false;
  12372. }
  12373. return true;
  12374. }
  12375. return false;
  12376. }
  12377. /**
  12378. * 是否json字符串
  12379. */
  12380. function jsonString(value) {
  12381. if (typeof value == 'string') {
  12382. try {
  12383. var obj = JSON.parse(value);
  12384. if ((0, _typeof2.default)(obj) == 'object' && obj) {
  12385. return true;
  12386. } else {
  12387. return false;
  12388. }
  12389. } catch (e) {
  12390. return false;
  12391. }
  12392. }
  12393. return false;
  12394. }
  12395. /**
  12396. * 是否数组
  12397. */
  12398. function array(value) {
  12399. if (typeof Array.isArray === "function") {
  12400. return Array.isArray(value);
  12401. } else {
  12402. return Object.prototype.toString.call(value) === "[object Array]";
  12403. }
  12404. }
  12405. /**
  12406. * 是否对象
  12407. */
  12408. function object(value) {
  12409. return Object.prototype.toString.call(value) === '[object Object]';
  12410. }
  12411. /**
  12412. * 是否短信验证码
  12413. */
  12414. function code(value) {
  12415. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  12416. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  12417. }
  12418. var _default = {
  12419. email: email,
  12420. mobile: mobile,
  12421. url: url,
  12422. date: date,
  12423. dateISO: dateISO,
  12424. number: number,
  12425. digits: digits,
  12426. idCard: idCard,
  12427. carNo: carNo,
  12428. amount: amount,
  12429. chinese: chinese,
  12430. letter: letter,
  12431. enOrNum: enOrNum,
  12432. contains: contains,
  12433. range: range,
  12434. rangeLength: rangeLength,
  12435. empty: empty,
  12436. isEmpty: empty,
  12437. jsonString: jsonString,
  12438. landline: landline,
  12439. object: object,
  12440. array: array,
  12441. code: code
  12442. };
  12443. exports.default = _default;
  12444. /***/ }),
  12445. /***/ 42:
  12446. /*!***************************************************************!*\
  12447. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/queryParams.js ***!
  12448. \***************************************************************/
  12449. /*! no static exports found */
  12450. /***/ (function(module, exports, __webpack_require__) {
  12451. "use strict";
  12452. Object.defineProperty(exports, "__esModule", {
  12453. value: true
  12454. });
  12455. exports.default = void 0;
  12456. /**
  12457. * 对象转url参数
  12458. * @param {*} data,对象
  12459. * @param {*} isPrefix,是否自动加上"?"
  12460. */
  12461. function queryParams() {
  12462. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12463. var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12464. var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  12465. var prefix = isPrefix ? '?' : '';
  12466. var _result = [];
  12467. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
  12468. var _loop = function _loop(key) {
  12469. var value = data[key];
  12470. // 去掉为空的参数
  12471. if (['', undefined, null].indexOf(value) >= 0) {
  12472. return "continue";
  12473. }
  12474. // 如果值为数组,另行处理
  12475. if (value.constructor === Array) {
  12476. // e.g. {ids: [1, 2, 3]}
  12477. switch (arrayFormat) {
  12478. case 'indices':
  12479. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  12480. for (var i = 0; i < value.length; i++) {
  12481. _result.push(key + '[' + i + ']=' + value[i]);
  12482. }
  12483. break;
  12484. case 'brackets':
  12485. // 结果: ids[]=1&ids[]=2&ids[]=3
  12486. value.forEach(function (_value) {
  12487. _result.push(key + '[]=' + _value);
  12488. });
  12489. break;
  12490. case 'repeat':
  12491. // 结果: ids=1&ids=2&ids=3
  12492. value.forEach(function (_value) {
  12493. _result.push(key + '=' + _value);
  12494. });
  12495. break;
  12496. case 'comma':
  12497. // 结果: ids=1,2,3
  12498. var commaStr = "";
  12499. value.forEach(function (_value) {
  12500. commaStr += (commaStr ? "," : "") + _value;
  12501. });
  12502. _result.push(key + '=' + commaStr);
  12503. break;
  12504. default:
  12505. value.forEach(function (_value) {
  12506. _result.push(key + '[]=' + _value);
  12507. });
  12508. }
  12509. } else {
  12510. _result.push(key + '=' + value);
  12511. }
  12512. };
  12513. for (var key in data) {
  12514. var _ret = _loop(key);
  12515. if (_ret === "continue") continue;
  12516. }
  12517. return _result.length ? prefix + _result.join('&') : '';
  12518. }
  12519. var _default = queryParams;
  12520. exports.default = _default;
  12521. /***/ }),
  12522. /***/ 43:
  12523. /*!*********************************************************!*\
  12524. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/route.js ***!
  12525. \*********************************************************/
  12526. /*! no static exports found */
  12527. /***/ (function(module, exports, __webpack_require__) {
  12528. "use strict";
  12529. /* WEBPACK VAR INJECTION */(function(uni) {
  12530. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12531. Object.defineProperty(exports, "__esModule", {
  12532. value: true
  12533. });
  12534. exports.default = void 0;
  12535. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  12536. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  12537. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  12538. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  12539. /**
  12540. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  12541. * 并且带有路由拦截功能
  12542. */
  12543. var Router = /*#__PURE__*/function () {
  12544. function Router() {
  12545. (0, _classCallCheck2.default)(this, Router);
  12546. // 原始属性定义
  12547. this.config = {
  12548. type: 'navigateTo',
  12549. url: '',
  12550. delta: 1,
  12551. // navigateBack页面后退时,回退的层数
  12552. params: {},
  12553. // 传递的参数
  12554. animationType: 'pop-in',
  12555. // 窗口动画,只在APP有效
  12556. animationDuration: 300,
  12557. // 窗口动画持续时间,单位毫秒,只在APP有效
  12558. intercept: false // 是否需要拦截
  12559. };
  12560. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  12561. // 这里在构造函数中进行this绑定
  12562. this.route = this.route.bind(this);
  12563. }
  12564. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  12565. (0, _createClass2.default)(Router, [{
  12566. key: "addRootPath",
  12567. value: function addRootPath(url) {
  12568. return url[0] === '/' ? url : "/".concat(url);
  12569. }
  12570. // 整合路由参数
  12571. }, {
  12572. key: "mixinParam",
  12573. value: function mixinParam(url, params) {
  12574. url = url && this.addRootPath(url);
  12575. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  12576. // 如果有url中有get参数,转换后无需带上"?"
  12577. var query = '';
  12578. if (/.*\/.*\?.*=.*/.test(url)) {
  12579. // object对象转为get类型的参数
  12580. query = uni.$u.queryParams(params, false);
  12581. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  12582. return url += "&" + query;
  12583. } else {
  12584. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  12585. query = uni.$u.queryParams(params);
  12586. return url += query;
  12587. }
  12588. }
  12589. // 对外的方法名称
  12590. }, {
  12591. key: "route",
  12592. value: function () {
  12593. var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  12594. var options,
  12595. params,
  12596. mergeConfig,
  12597. isNext,
  12598. _args = arguments;
  12599. return _regenerator.default.wrap(function _callee$(_context) {
  12600. while (1) {
  12601. switch (_context.prev = _context.next) {
  12602. case 0:
  12603. options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
  12604. params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  12605. // 合并用户的配置和内部的默认配置
  12606. mergeConfig = {};
  12607. if (typeof options === 'string') {
  12608. // 如果options为字符串,则为route(url, params)的形式
  12609. mergeConfig.url = this.mixinParam(options, params);
  12610. mergeConfig.type = 'navigateTo';
  12611. } else {
  12612. mergeConfig = uni.$u.deepClone(options, this.config);
  12613. // 否则正常使用mergeConfig中的url和params进行拼接
  12614. mergeConfig.url = this.mixinParam(options.url, options.params);
  12615. }
  12616. if (params.intercept) {
  12617. this.config.intercept = params.intercept;
  12618. }
  12619. // params参数也带给拦截器
  12620. mergeConfig.params = params;
  12621. // 合并内外部参数
  12622. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  12623. // 判断用户是否定义了拦截器
  12624. if (!(typeof uni.$u.routeIntercept === 'function')) {
  12625. _context.next = 14;
  12626. break;
  12627. }
  12628. _context.next = 10;
  12629. return new Promise(function (resolve, reject) {
  12630. uni.$u.routeIntercept(mergeConfig, resolve);
  12631. });
  12632. case 10:
  12633. isNext = _context.sent;
  12634. // 如果isNext为true,则执行路由跳转
  12635. isNext && this.openPage(mergeConfig);
  12636. _context.next = 15;
  12637. break;
  12638. case 14:
  12639. this.openPage(mergeConfig);
  12640. case 15:
  12641. case "end":
  12642. return _context.stop();
  12643. }
  12644. }
  12645. }, _callee, this);
  12646. }));
  12647. function route() {
  12648. return _route.apply(this, arguments);
  12649. }
  12650. return route;
  12651. }() // 执行路由跳转
  12652. }, {
  12653. key: "openPage",
  12654. value: function openPage(config) {
  12655. // 解构参数
  12656. var url = config.url,
  12657. type = config.type,
  12658. delta = config.delta,
  12659. animationType = config.animationType,
  12660. animationDuration = config.animationDuration;
  12661. if (config.type == 'navigateTo' || config.type == 'to') {
  12662. uni.navigateTo({
  12663. url: url,
  12664. animationType: animationType,
  12665. animationDuration: animationDuration
  12666. });
  12667. }
  12668. if (config.type == 'redirectTo' || config.type == 'redirect') {
  12669. uni.redirectTo({
  12670. url: url
  12671. });
  12672. }
  12673. if (config.type == 'switchTab' || config.type == 'tab') {
  12674. uni.switchTab({
  12675. url: url
  12676. });
  12677. }
  12678. if (config.type == 'reLaunch' || config.type == 'launch') {
  12679. uni.reLaunch({
  12680. url: url
  12681. });
  12682. }
  12683. if (config.type == 'navigateBack' || config.type == 'back') {
  12684. uni.navigateBack({
  12685. delta: delta
  12686. });
  12687. }
  12688. }
  12689. }]);
  12690. return Router;
  12691. }();
  12692. var _default = new Router().route;
  12693. exports.default = _default;
  12694. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12695. /***/ }),
  12696. /***/ 44:
  12697. /*!************************************************************************************************!*\
  12698. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  12699. \************************************************************************************************/
  12700. /*! no static exports found */
  12701. /***/ (function(module, exports, __webpack_require__) {
  12702. // TODO(Babel 8): Remove this file.
  12703. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 45)();
  12704. module.exports = runtime;
  12705. /***/ }),
  12706. /***/ 45:
  12707. /*!*******************************************************************!*\
  12708. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  12709. \*******************************************************************/
  12710. /*! no static exports found */
  12711. /***/ (function(module, exports, __webpack_require__) {
  12712. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  12713. function _regeneratorRuntime() {
  12714. "use strict";
  12715. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  12716. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  12717. return exports;
  12718. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12719. var exports = {},
  12720. Op = Object.prototype,
  12721. hasOwn = Op.hasOwnProperty,
  12722. defineProperty = Object.defineProperty || function (obj, key, desc) {
  12723. obj[key] = desc.value;
  12724. },
  12725. $Symbol = "function" == typeof Symbol ? Symbol : {},
  12726. iteratorSymbol = $Symbol.iterator || "@@iterator",
  12727. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  12728. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  12729. function define(obj, key, value) {
  12730. return Object.defineProperty(obj, key, {
  12731. value: value,
  12732. enumerable: !0,
  12733. configurable: !0,
  12734. writable: !0
  12735. }), obj[key];
  12736. }
  12737. try {
  12738. define({}, "");
  12739. } catch (err) {
  12740. define = function define(obj, key, value) {
  12741. return obj[key] = value;
  12742. };
  12743. }
  12744. function wrap(innerFn, outerFn, self, tryLocsList) {
  12745. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  12746. generator = Object.create(protoGenerator.prototype),
  12747. context = new Context(tryLocsList || []);
  12748. return defineProperty(generator, "_invoke", {
  12749. value: makeInvokeMethod(innerFn, self, context)
  12750. }), generator;
  12751. }
  12752. function tryCatch(fn, obj, arg) {
  12753. try {
  12754. return {
  12755. type: "normal",
  12756. arg: fn.call(obj, arg)
  12757. };
  12758. } catch (err) {
  12759. return {
  12760. type: "throw",
  12761. arg: err
  12762. };
  12763. }
  12764. }
  12765. exports.wrap = wrap;
  12766. var ContinueSentinel = {};
  12767. function Generator() {}
  12768. function GeneratorFunction() {}
  12769. function GeneratorFunctionPrototype() {}
  12770. var IteratorPrototype = {};
  12771. define(IteratorPrototype, iteratorSymbol, function () {
  12772. return this;
  12773. });
  12774. var getProto = Object.getPrototypeOf,
  12775. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  12776. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  12777. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  12778. function defineIteratorMethods(prototype) {
  12779. ["next", "throw", "return"].forEach(function (method) {
  12780. define(prototype, method, function (arg) {
  12781. return this._invoke(method, arg);
  12782. });
  12783. });
  12784. }
  12785. function AsyncIterator(generator, PromiseImpl) {
  12786. function invoke(method, arg, resolve, reject) {
  12787. var record = tryCatch(generator[method], generator, arg);
  12788. if ("throw" !== record.type) {
  12789. var result = record.arg,
  12790. value = result.value;
  12791. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  12792. invoke("next", value, resolve, reject);
  12793. }, function (err) {
  12794. invoke("throw", err, resolve, reject);
  12795. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  12796. result.value = unwrapped, resolve(result);
  12797. }, function (error) {
  12798. return invoke("throw", error, resolve, reject);
  12799. });
  12800. }
  12801. reject(record.arg);
  12802. }
  12803. var previousPromise;
  12804. defineProperty(this, "_invoke", {
  12805. value: function value(method, arg) {
  12806. function callInvokeWithMethodAndArg() {
  12807. return new PromiseImpl(function (resolve, reject) {
  12808. invoke(method, arg, resolve, reject);
  12809. });
  12810. }
  12811. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  12812. }
  12813. });
  12814. }
  12815. function makeInvokeMethod(innerFn, self, context) {
  12816. var state = "suspendedStart";
  12817. return function (method, arg) {
  12818. if ("executing" === state) throw new Error("Generator is already running");
  12819. if ("completed" === state) {
  12820. if ("throw" === method) throw arg;
  12821. return doneResult();
  12822. }
  12823. for (context.method = method, context.arg = arg;;) {
  12824. var delegate = context.delegate;
  12825. if (delegate) {
  12826. var delegateResult = maybeInvokeDelegate(delegate, context);
  12827. if (delegateResult) {
  12828. if (delegateResult === ContinueSentinel) continue;
  12829. return delegateResult;
  12830. }
  12831. }
  12832. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  12833. if ("suspendedStart" === state) throw state = "completed", context.arg;
  12834. context.dispatchException(context.arg);
  12835. } else "return" === context.method && context.abrupt("return", context.arg);
  12836. state = "executing";
  12837. var record = tryCatch(innerFn, self, context);
  12838. if ("normal" === record.type) {
  12839. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  12840. return {
  12841. value: record.arg,
  12842. done: context.done
  12843. };
  12844. }
  12845. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  12846. }
  12847. };
  12848. }
  12849. function maybeInvokeDelegate(delegate, context) {
  12850. var methodName = context.method,
  12851. method = delegate.iterator[methodName];
  12852. 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;
  12853. var record = tryCatch(method, delegate.iterator, context.arg);
  12854. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  12855. var info = record.arg;
  12856. 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);
  12857. }
  12858. function pushTryEntry(locs) {
  12859. var entry = {
  12860. tryLoc: locs[0]
  12861. };
  12862. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  12863. }
  12864. function resetTryEntry(entry) {
  12865. var record = entry.completion || {};
  12866. record.type = "normal", delete record.arg, entry.completion = record;
  12867. }
  12868. function Context(tryLocsList) {
  12869. this.tryEntries = [{
  12870. tryLoc: "root"
  12871. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  12872. }
  12873. function values(iterable) {
  12874. if (iterable) {
  12875. var iteratorMethod = iterable[iteratorSymbol];
  12876. if (iteratorMethod) return iteratorMethod.call(iterable);
  12877. if ("function" == typeof iterable.next) return iterable;
  12878. if (!isNaN(iterable.length)) {
  12879. var i = -1,
  12880. next = function next() {
  12881. for (; ++i < iterable.length;) {
  12882. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  12883. }
  12884. return next.value = undefined, next.done = !0, next;
  12885. };
  12886. return next.next = next;
  12887. }
  12888. }
  12889. return {
  12890. next: doneResult
  12891. };
  12892. }
  12893. function doneResult() {
  12894. return {
  12895. value: undefined,
  12896. done: !0
  12897. };
  12898. }
  12899. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  12900. value: GeneratorFunctionPrototype,
  12901. configurable: !0
  12902. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  12903. value: GeneratorFunction,
  12904. configurable: !0
  12905. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  12906. var ctor = "function" == typeof genFun && genFun.constructor;
  12907. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  12908. }, exports.mark = function (genFun) {
  12909. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  12910. }, exports.awrap = function (arg) {
  12911. return {
  12912. __await: arg
  12913. };
  12914. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  12915. return this;
  12916. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  12917. void 0 === PromiseImpl && (PromiseImpl = Promise);
  12918. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  12919. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  12920. return result.done ? result.value : iter.next();
  12921. });
  12922. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  12923. return this;
  12924. }), define(Gp, "toString", function () {
  12925. return "[object Generator]";
  12926. }), exports.keys = function (val) {
  12927. var object = Object(val),
  12928. keys = [];
  12929. for (var key in object) {
  12930. keys.push(key);
  12931. }
  12932. return keys.reverse(), function next() {
  12933. for (; keys.length;) {
  12934. var key = keys.pop();
  12935. if (key in object) return next.value = key, next.done = !1, next;
  12936. }
  12937. return next.done = !0, next;
  12938. };
  12939. }, exports.values = values, Context.prototype = {
  12940. constructor: Context,
  12941. reset: function reset(skipTempReset) {
  12942. 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) {
  12943. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  12944. }
  12945. },
  12946. stop: function stop() {
  12947. this.done = !0;
  12948. var rootRecord = this.tryEntries[0].completion;
  12949. if ("throw" === rootRecord.type) throw rootRecord.arg;
  12950. return this.rval;
  12951. },
  12952. dispatchException: function dispatchException(exception) {
  12953. if (this.done) throw exception;
  12954. var context = this;
  12955. function handle(loc, caught) {
  12956. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  12957. }
  12958. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  12959. var entry = this.tryEntries[i],
  12960. record = entry.completion;
  12961. if ("root" === entry.tryLoc) return handle("end");
  12962. if (entry.tryLoc <= this.prev) {
  12963. var hasCatch = hasOwn.call(entry, "catchLoc"),
  12964. hasFinally = hasOwn.call(entry, "finallyLoc");
  12965. if (hasCatch && hasFinally) {
  12966. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  12967. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  12968. } else if (hasCatch) {
  12969. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  12970. } else {
  12971. if (!hasFinally) throw new Error("try statement without catch or finally");
  12972. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  12973. }
  12974. }
  12975. }
  12976. },
  12977. abrupt: function abrupt(type, arg) {
  12978. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  12979. var entry = this.tryEntries[i];
  12980. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  12981. var finallyEntry = entry;
  12982. break;
  12983. }
  12984. }
  12985. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  12986. var record = finallyEntry ? finallyEntry.completion : {};
  12987. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  12988. },
  12989. complete: function complete(record, afterLoc) {
  12990. if ("throw" === record.type) throw record.arg;
  12991. 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;
  12992. },
  12993. finish: function finish(finallyLoc) {
  12994. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  12995. var entry = this.tryEntries[i];
  12996. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  12997. }
  12998. },
  12999. "catch": function _catch(tryLoc) {
  13000. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  13001. var entry = this.tryEntries[i];
  13002. if (entry.tryLoc === tryLoc) {
  13003. var record = entry.completion;
  13004. if ("throw" === record.type) {
  13005. var thrown = record.arg;
  13006. resetTryEntry(entry);
  13007. }
  13008. return thrown;
  13009. }
  13010. }
  13011. throw new Error("illegal catch attempt");
  13012. },
  13013. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  13014. return this.delegate = {
  13015. iterator: values(iterable),
  13016. resultName: resultName,
  13017. nextLoc: nextLoc
  13018. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  13019. }
  13020. }, exports;
  13021. }
  13022. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13023. /***/ }),
  13024. /***/ 46:
  13025. /*!*****************************************************************!*\
  13026. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  13027. \*****************************************************************/
  13028. /*! no static exports found */
  13029. /***/ (function(module, exports) {
  13030. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  13031. try {
  13032. var info = gen[key](arg);
  13033. var value = info.value;
  13034. } catch (error) {
  13035. reject(error);
  13036. return;
  13037. }
  13038. if (info.done) {
  13039. resolve(value);
  13040. } else {
  13041. Promise.resolve(value).then(_next, _throw);
  13042. }
  13043. }
  13044. function _asyncToGenerator(fn) {
  13045. return function () {
  13046. var self = this,
  13047. args = arguments;
  13048. return new Promise(function (resolve, reject) {
  13049. var gen = fn.apply(self, args);
  13050. function _next(value) {
  13051. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  13052. }
  13053. function _throw(err) {
  13054. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  13055. }
  13056. _next(undefined);
  13057. });
  13058. };
  13059. }
  13060. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13061. /***/ }),
  13062. /***/ 47:
  13063. /*!**************************************************************!*\
  13064. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/timeFormat.js ***!
  13065. \**************************************************************/
  13066. /*! no static exports found */
  13067. /***/ (function(module, exports, __webpack_require__) {
  13068. "use strict";
  13069. Object.defineProperty(exports, "__esModule", {
  13070. value: true
  13071. });
  13072. exports.default = void 0;
  13073. // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  13074. // 所以这里做一个兼容polyfill的兼容处理
  13075. if (!String.prototype.padStart) {
  13076. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  13077. String.prototype.padStart = function (maxLength) {
  13078. var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  13079. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError('fillString must be String');
  13080. var str = this;
  13081. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  13082. if (str.length >= maxLength) return String(str);
  13083. var fillLength = maxLength - str.length,
  13084. times = Math.ceil(fillLength / fillString.length);
  13085. while (times >>= 1) {
  13086. fillString += fillString;
  13087. if (times === 1) {
  13088. fillString += fillString;
  13089. }
  13090. }
  13091. return fillString.slice(0, fillLength) + str;
  13092. };
  13093. }
  13094. // 其他更多是格式化有如下:
  13095. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  13096. function timeFormat() {
  13097. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  13098. var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  13099. // 如果为null,则格式化当前时间
  13100. if (!dateTime) dateTime = Number(new Date());
  13101. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  13102. if (dateTime.toString().length == 10) dateTime *= 1000;
  13103. var date = new Date(dateTime);
  13104. var ret;
  13105. var opt = {
  13106. "y+": date.getFullYear().toString(),
  13107. // 年
  13108. "m+": (date.getMonth() + 1).toString(),
  13109. // 月
  13110. "d+": date.getDate().toString(),
  13111. // 日
  13112. "h+": date.getHours().toString(),
  13113. // 时
  13114. "M+": date.getMinutes().toString(),
  13115. // 分
  13116. "s+": date.getSeconds().toString() // 秒
  13117. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  13118. };
  13119. for (var k in opt) {
  13120. ret = new RegExp("(" + k + ")").exec(fmt);
  13121. if (ret) {
  13122. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  13123. }
  13124. ;
  13125. }
  13126. ;
  13127. return fmt;
  13128. }
  13129. var _default = timeFormat;
  13130. exports.default = _default;
  13131. /***/ }),
  13132. /***/ 48:
  13133. /*!************************************************************!*\
  13134. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/timeFrom.js ***!
  13135. \************************************************************/
  13136. /*! no static exports found */
  13137. /***/ (function(module, exports, __webpack_require__) {
  13138. "use strict";
  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 _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 47));
  13145. /**
  13146. * 时间戳转为多久之前
  13147. * @param String timestamp 时间戳
  13148. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  13149. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  13150. */
  13151. function timeFrom() {
  13152. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  13153. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  13154. // 如果为null,则格式化当前时间
  13155. if (!dateTime) dateTime = Number(new Date());
  13156. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  13157. if (dateTime.toString().length == 10) dateTime *= 1000;
  13158. var timestamp = +new Date(Number(dateTime));
  13159. var timer = (Number(new Date()) - timestamp) / 1000;
  13160. // 如果小于5分钟,则返回"刚刚",其他以此类推
  13161. var tips = '';
  13162. switch (true) {
  13163. case timer < 300:
  13164. tips = '刚刚';
  13165. break;
  13166. case timer >= 300 && timer < 3600:
  13167. tips = parseInt(timer / 60) + '分钟前';
  13168. break;
  13169. case timer >= 3600 && timer < 86400:
  13170. tips = parseInt(timer / 3600) + '小时前';
  13171. break;
  13172. case timer >= 86400 && timer < 2592000:
  13173. tips = parseInt(timer / 86400) + '天前';
  13174. break;
  13175. default:
  13176. // 如果format为false,则无论什么时间戳,都显示xx之前
  13177. if (format === false) {
  13178. if (timer >= 2592000 && timer < 365 * 86400) {
  13179. tips = parseInt(timer / (86400 * 30)) + '个月前';
  13180. } else {
  13181. tips = parseInt(timer / (86400 * 365)) + '年前';
  13182. }
  13183. } else {
  13184. tips = (0, _timeFormat.default)(timestamp, format);
  13185. }
  13186. }
  13187. return tips;
  13188. }
  13189. var _default = timeFrom;
  13190. exports.default = _default;
  13191. /***/ }),
  13192. /***/ 49:
  13193. /*!*****************************************************************!*\
  13194. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/colorGradient.js ***!
  13195. \*****************************************************************/
  13196. /*! no static exports found */
  13197. /***/ (function(module, exports, __webpack_require__) {
  13198. "use strict";
  13199. Object.defineProperty(exports, "__esModule", {
  13200. value: true
  13201. });
  13202. exports.default = void 0;
  13203. /**
  13204. * 求两个颜色之间的渐变值
  13205. * @param {string} startColor 开始的颜色
  13206. * @param {string} endColor 结束的颜色
  13207. * @param {number} step 颜色等分的份额
  13208. * */
  13209. function colorGradient() {
  13210. var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
  13211. var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
  13212. var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  13213. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  13214. var startR = startRGB[0];
  13215. var startG = startRGB[1];
  13216. var startB = startRGB[2];
  13217. var endRGB = hexToRgb(endColor, false);
  13218. var endR = endRGB[0];
  13219. var endG = endRGB[1];
  13220. var endB = endRGB[2];
  13221. var sR = (endR - startR) / step; //总差值
  13222. var sG = (endG - startG) / step;
  13223. var sB = (endB - startB) / step;
  13224. var colorArr = [];
  13225. for (var i = 0; i < step; i++) {
  13226. //计算每一步的hex值
  13227. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB * i + startB) + ')');
  13228. colorArr.push(hex);
  13229. }
  13230. return colorArr;
  13231. }
  13232. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  13233. function hexToRgb(sColor) {
  13234. var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13235. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13236. sColor = sColor.toLowerCase();
  13237. if (sColor && reg.test(sColor)) {
  13238. if (sColor.length === 4) {
  13239. var sColorNew = "#";
  13240. for (var i = 1; i < 4; i += 1) {
  13241. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  13242. }
  13243. sColor = sColorNew;
  13244. }
  13245. //处理六位的颜色值
  13246. var sColorChange = [];
  13247. for (var _i = 1; _i < 7; _i += 2) {
  13248. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  13249. }
  13250. if (!str) {
  13251. return sColorChange;
  13252. } else {
  13253. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  13254. }
  13255. } else if (/^(rgb|RGB)/.test(sColor)) {
  13256. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  13257. return arr.map(function (val) {
  13258. return Number(val);
  13259. });
  13260. } else {
  13261. return sColor;
  13262. }
  13263. }
  13264. ;
  13265. // 将rgb表示方式转换为hex表示方式
  13266. function rgbToHex(rgb) {
  13267. var _this = rgb;
  13268. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13269. if (/^(rgb|RGB)/.test(_this)) {
  13270. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  13271. var strHex = "#";
  13272. for (var i = 0; i < aColor.length; i++) {
  13273. var hex = Number(aColor[i]).toString(16);
  13274. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  13275. if (hex === "0") {
  13276. hex += hex;
  13277. }
  13278. strHex += hex;
  13279. }
  13280. if (strHex.length !== 7) {
  13281. strHex = _this;
  13282. }
  13283. return strHex;
  13284. } else if (reg.test(_this)) {
  13285. var aNum = _this.replace(/#/, "").split("");
  13286. if (aNum.length === 6) {
  13287. return _this;
  13288. } else if (aNum.length === 3) {
  13289. var numHex = "#";
  13290. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  13291. numHex += aNum[_i2] + aNum[_i2];
  13292. }
  13293. return numHex;
  13294. }
  13295. } else {
  13296. return _this;
  13297. }
  13298. }
  13299. /**
  13300. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  13301. * sHex为传入的十六进制的色值
  13302. * alpha为rgba的透明度
  13303. */
  13304. function colorToRgba(color) {
  13305. var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  13306. color = rgbToHex(color);
  13307. // 十六进制颜色值的正则表达式
  13308. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13309. /* 16进制颜色转为RGB格式 */
  13310. var sColor = color.toLowerCase();
  13311. if (sColor && reg.test(sColor)) {
  13312. if (sColor.length === 4) {
  13313. var sColorNew = '#';
  13314. for (var i = 1; i < 4; i += 1) {
  13315. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  13316. }
  13317. sColor = sColorNew;
  13318. }
  13319. // 处理六位的颜色值
  13320. var sColorChange = [];
  13321. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  13322. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  13323. }
  13324. // return sColorChange.join(',')
  13325. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  13326. } else {
  13327. return sColor;
  13328. }
  13329. }
  13330. var _default = {
  13331. colorGradient: colorGradient,
  13332. hexToRgb: hexToRgb,
  13333. rgbToHex: rgbToHex,
  13334. colorToRgba: colorToRgba
  13335. };
  13336. exports.default = _default;
  13337. /***/ }),
  13338. /***/ 5:
  13339. /*!**************************************************************!*\
  13340. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  13341. \**************************************************************/
  13342. /*! no static exports found */
  13343. /***/ (function(module, exports, __webpack_require__) {
  13344. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  13345. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  13346. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  13347. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  13348. function _slicedToArray(arr, i) {
  13349. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  13350. }
  13351. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13352. /***/ }),
  13353. /***/ 50:
  13354. /*!********************************************************!*\
  13355. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/guid.js ***!
  13356. \********************************************************/
  13357. /*! no static exports found */
  13358. /***/ (function(module, exports, __webpack_require__) {
  13359. "use strict";
  13360. Object.defineProperty(exports, "__esModule", {
  13361. value: true
  13362. });
  13363. exports.default = void 0;
  13364. /**
  13365. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  13366. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  13367. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  13368. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  13369. * v-for的时候,推荐使用后端返回的id而不是循环的index
  13370. * @param {Number} len uuid的长度
  13371. * @param {Boolean} firstU 将返回的首字母置为"u"
  13372. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  13373. */
  13374. function guid() {
  13375. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  13376. var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13377. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  13378. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  13379. var uuid = [];
  13380. radix = radix || chars.length;
  13381. if (len) {
  13382. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  13383. for (var i = 0; i < len; i++) {
  13384. uuid[i] = chars[0 | Math.random() * radix];
  13385. }
  13386. } else {
  13387. var r;
  13388. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  13389. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  13390. uuid[14] = '4';
  13391. for (var _i = 0; _i < 36; _i++) {
  13392. if (!uuid[_i]) {
  13393. r = 0 | Math.random() * 16;
  13394. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  13395. }
  13396. }
  13397. }
  13398. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  13399. if (firstU) {
  13400. uuid.shift();
  13401. return 'u' + uuid.join('');
  13402. } else {
  13403. return uuid.join('');
  13404. }
  13405. }
  13406. var _default = guid;
  13407. exports.default = _default;
  13408. /***/ }),
  13409. /***/ 51:
  13410. /*!*********************************************************!*\
  13411. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/color.js ***!
  13412. \*********************************************************/
  13413. /*! no static exports found */
  13414. /***/ (function(module, exports, __webpack_require__) {
  13415. "use strict";
  13416. Object.defineProperty(exports, "__esModule", {
  13417. value: true
  13418. });
  13419. exports.default = void 0;
  13420. // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  13421. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  13422. var color = {
  13423. primary: "#2979ff",
  13424. primaryDark: "#2b85e4",
  13425. primaryDisabled: "#a0cfff",
  13426. primaryLight: "#ecf5ff",
  13427. bgColor: "#f3f4f6",
  13428. info: "#909399",
  13429. infoDark: "#82848a",
  13430. infoDisabled: "#c8c9cc",
  13431. infoLight: "#f4f4f5",
  13432. warning: "#ff9900",
  13433. warningDark: "#f29100",
  13434. warningDisabled: "#fcbd71",
  13435. warningLight: "#fdf6ec",
  13436. error: "#fa3534",
  13437. errorDark: "#dd6161",
  13438. errorDisabled: "#fab6b6",
  13439. errorLight: "#fef0f0",
  13440. success: "#19be6b",
  13441. successDark: "#18b566",
  13442. successDisabled: "#71d5a1",
  13443. successLight: "#dbf1e1",
  13444. mainColor: "#303133",
  13445. contentColor: "#606266",
  13446. tipsColor: "#909399",
  13447. lightColor: "#c0c4cc",
  13448. borderColor: "#e4e7ed"
  13449. };
  13450. var _default = color;
  13451. exports.default = _default;
  13452. /***/ }),
  13453. /***/ 52:
  13454. /*!*************************************************************!*\
  13455. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/type2icon.js ***!
  13456. \*************************************************************/
  13457. /*! no static exports found */
  13458. /***/ (function(module, exports, __webpack_require__) {
  13459. "use strict";
  13460. Object.defineProperty(exports, "__esModule", {
  13461. value: true
  13462. });
  13463. exports.default = void 0;
  13464. /**
  13465. * 根据主题type值,获取对应的图标
  13466. * @param String type 主题名称,primary|info|error|warning|success
  13467. * @param String fill 是否使用fill填充实体的图标
  13468. */
  13469. function type2icon() {
  13470. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
  13471. var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13472. // 如果非预置值,默认为success
  13473. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  13474. var iconName = '';
  13475. // 目前(2019-12-12),info和primary使用同一个图标
  13476. switch (type) {
  13477. case 'primary':
  13478. iconName = 'info-circle';
  13479. break;
  13480. case 'info':
  13481. iconName = 'info-circle';
  13482. break;
  13483. case 'error':
  13484. iconName = 'close-circle';
  13485. break;
  13486. case 'warning':
  13487. iconName = 'error-circle';
  13488. break;
  13489. case 'success':
  13490. iconName = 'checkmark-circle';
  13491. break;
  13492. default:
  13493. iconName = 'checkmark-circle';
  13494. }
  13495. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  13496. if (fill) iconName += '-fill';
  13497. return iconName;
  13498. }
  13499. var _default = type2icon;
  13500. exports.default = _default;
  13501. /***/ }),
  13502. /***/ 53:
  13503. /*!***************************************************************!*\
  13504. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/randomArray.js ***!
  13505. \***************************************************************/
  13506. /*! no static exports found */
  13507. /***/ (function(module, exports, __webpack_require__) {
  13508. "use strict";
  13509. Object.defineProperty(exports, "__esModule", {
  13510. value: true
  13511. });
  13512. exports.default = void 0;
  13513. // 打乱数组
  13514. function randomArray() {
  13515. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  13516. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  13517. return array.sort(function () {
  13518. return Math.random() - 0.5;
  13519. });
  13520. }
  13521. var _default = randomArray;
  13522. exports.default = _default;
  13523. /***/ }),
  13524. /***/ 54:
  13525. /*!***********************************************************!*\
  13526. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/addUnit.js ***!
  13527. \***********************************************************/
  13528. /*! no static exports found */
  13529. /***/ (function(module, exports, __webpack_require__) {
  13530. "use strict";
  13531. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13532. Object.defineProperty(exports, "__esModule", {
  13533. value: true
  13534. });
  13535. exports.default = addUnit;
  13536. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 41));
  13537. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  13538. function addUnit() {
  13539. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
  13540. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  13541. value = String(value);
  13542. // 用uView内置验证规则中的number判断是否为数值
  13543. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  13544. }
  13545. /***/ }),
  13546. /***/ 55:
  13547. /*!**********************************************************!*\
  13548. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/random.js ***!
  13549. \**********************************************************/
  13550. /*! no static exports found */
  13551. /***/ (function(module, exports, __webpack_require__) {
  13552. "use strict";
  13553. Object.defineProperty(exports, "__esModule", {
  13554. value: true
  13555. });
  13556. exports.default = void 0;
  13557. function random(min, max) {
  13558. if (min >= 0 && max > 0 && max >= min) {
  13559. var gab = max - min + 1;
  13560. return Math.floor(Math.random() * gab + min);
  13561. } else {
  13562. return 0;
  13563. }
  13564. }
  13565. var _default = random;
  13566. exports.default = _default;
  13567. /***/ }),
  13568. /***/ 56:
  13569. /*!********************************************************!*\
  13570. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/trim.js ***!
  13571. \********************************************************/
  13572. /*! no static exports found */
  13573. /***/ (function(module, exports, __webpack_require__) {
  13574. "use strict";
  13575. Object.defineProperty(exports, "__esModule", {
  13576. value: true
  13577. });
  13578. exports.default = void 0;
  13579. function trim(str) {
  13580. var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  13581. if (pos == 'both') {
  13582. return str.replace(/^\s+|\s+$/g, "");
  13583. } else if (pos == "left") {
  13584. return str.replace(/^\s*/, '');
  13585. } else if (pos == 'right') {
  13586. return str.replace(/(\s*$)/g, "");
  13587. } else if (pos == 'all') {
  13588. return str.replace(/\s+/g, "");
  13589. } else {
  13590. return str;
  13591. }
  13592. }
  13593. var _default = trim;
  13594. exports.default = _default;
  13595. /***/ }),
  13596. /***/ 57:
  13597. /*!*********************************************************!*\
  13598. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/toast.js ***!
  13599. \*********************************************************/
  13600. /*! no static exports found */
  13601. /***/ (function(module, exports, __webpack_require__) {
  13602. "use strict";
  13603. /* WEBPACK VAR INJECTION */(function(uni) {
  13604. Object.defineProperty(exports, "__esModule", {
  13605. value: true
  13606. });
  13607. exports.default = void 0;
  13608. function toast(title) {
  13609. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  13610. uni.showToast({
  13611. title: title,
  13612. icon: 'none',
  13613. duration: duration
  13614. });
  13615. }
  13616. var _default = toast;
  13617. exports.default = _default;
  13618. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  13619. /***/ }),
  13620. /***/ 58:
  13621. /*!*************************************************************!*\
  13622. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/getParent.js ***!
  13623. \*************************************************************/
  13624. /*! no static exports found */
  13625. /***/ (function(module, exports, __webpack_require__) {
  13626. "use strict";
  13627. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13628. Object.defineProperty(exports, "__esModule", {
  13629. value: true
  13630. });
  13631. exports.default = getParent;
  13632. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  13633. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  13634. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  13635. function getParent(name, keys) {
  13636. var parent = this.$parent;
  13637. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  13638. while (parent) {
  13639. // 父组件
  13640. if (parent.$options.name !== name) {
  13641. // 如果组件的name不相等,继续上一级寻找
  13642. parent = parent.$parent;
  13643. } else {
  13644. var _ret = function () {
  13645. var data = {};
  13646. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  13647. if (Array.isArray(keys)) {
  13648. keys.map(function (val) {
  13649. data[val] = parent[val] ? parent[val] : '';
  13650. });
  13651. } else {
  13652. // 历遍传过来的对象参数
  13653. for (var i in keys) {
  13654. // 如果子组件有此值则用,无此值则用父组件的值
  13655. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  13656. if (Array.isArray(keys[i])) {
  13657. if (keys[i].length) {
  13658. data[i] = keys[i];
  13659. } else {
  13660. data[i] = parent[i];
  13661. }
  13662. } else if (keys[i].constructor === Object) {
  13663. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  13664. if (Object.keys(keys[i]).length) {
  13665. data[i] = keys[i];
  13666. } else {
  13667. data[i] = parent[i];
  13668. }
  13669. } else {
  13670. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  13671. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  13672. }
  13673. }
  13674. }
  13675. return {
  13676. v: data
  13677. };
  13678. }();
  13679. if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
  13680. }
  13681. }
  13682. return {};
  13683. }
  13684. /***/ }),
  13685. /***/ 59:
  13686. /*!***********************************************************!*\
  13687. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/$parent.js ***!
  13688. \***********************************************************/
  13689. /*! no static exports found */
  13690. /***/ (function(module, exports, __webpack_require__) {
  13691. "use strict";
  13692. Object.defineProperty(exports, "__esModule", {
  13693. value: true
  13694. });
  13695. exports.default = $parent;
  13696. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  13697. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  13698. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  13699. // 值(默认为undefined),就是查找最顶层的$parent
  13700. function $parent() {
  13701. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  13702. var parent = this.$parent;
  13703. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  13704. while (parent) {
  13705. // 父组件
  13706. if (parent.$options && parent.$options.name !== name) {
  13707. // 如果组件的name不相等,继续上一级寻找
  13708. parent = parent.$parent;
  13709. } else {
  13710. return parent;
  13711. }
  13712. }
  13713. return false;
  13714. }
  13715. /***/ }),
  13716. /***/ 6:
  13717. /*!***************************************************************!*\
  13718. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  13719. \***************************************************************/
  13720. /*! no static exports found */
  13721. /***/ (function(module, exports) {
  13722. function _arrayWithHoles(arr) {
  13723. if (Array.isArray(arr)) return arr;
  13724. }
  13725. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13726. /***/ }),
  13727. /***/ 60:
  13728. /*!*******************************************************!*\
  13729. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/sys.js ***!
  13730. \*******************************************************/
  13731. /*! no static exports found */
  13732. /***/ (function(module, exports, __webpack_require__) {
  13733. "use strict";
  13734. /* WEBPACK VAR INJECTION */(function(uni) {
  13735. Object.defineProperty(exports, "__esModule", {
  13736. value: true
  13737. });
  13738. exports.os = os;
  13739. exports.sys = sys;
  13740. function os() {
  13741. return uni.getSystemInfoSync().platform;
  13742. }
  13743. ;
  13744. function sys() {
  13745. return uni.getSystemInfoSync();
  13746. }
  13747. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  13748. /***/ }),
  13749. /***/ 61:
  13750. /*!************************************************************!*\
  13751. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/debounce.js ***!
  13752. \************************************************************/
  13753. /*! no static exports found */
  13754. /***/ (function(module, exports, __webpack_require__) {
  13755. "use strict";
  13756. Object.defineProperty(exports, "__esModule", {
  13757. value: true
  13758. });
  13759. exports.default = void 0;
  13760. var timeout = null;
  13761. /**
  13762. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  13763. *
  13764. * @param {Function} func 要执行的回调函数
  13765. * @param {Number} wait 延时的时间
  13766. * @param {Boolean} immediate 是否立即执行
  13767. * @return null
  13768. */
  13769. function debounce(func) {
  13770. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  13771. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  13772. // 清除定时器
  13773. if (timeout !== null) clearTimeout(timeout);
  13774. // 立即执行,此类情况一般用不到
  13775. if (immediate) {
  13776. var callNow = !timeout;
  13777. timeout = setTimeout(function () {
  13778. timeout = null;
  13779. }, wait);
  13780. if (callNow) typeof func === 'function' && func();
  13781. } else {
  13782. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  13783. timeout = setTimeout(function () {
  13784. typeof func === 'function' && func();
  13785. }, wait);
  13786. }
  13787. }
  13788. var _default = debounce;
  13789. exports.default = _default;
  13790. /***/ }),
  13791. /***/ 62:
  13792. /*!************************************************************!*\
  13793. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/function/throttle.js ***!
  13794. \************************************************************/
  13795. /*! no static exports found */
  13796. /***/ (function(module, exports, __webpack_require__) {
  13797. "use strict";
  13798. Object.defineProperty(exports, "__esModule", {
  13799. value: true
  13800. });
  13801. exports.default = void 0;
  13802. var timer, flag;
  13803. /**
  13804. * 节流原理:在一定时间内,只能触发一次
  13805. *
  13806. * @param {Function} func 要执行的回调函数
  13807. * @param {Number} wait 延时的时间
  13808. * @param {Boolean} immediate 是否立即执行
  13809. * @return null
  13810. */
  13811. function throttle(func) {
  13812. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  13813. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  13814. if (immediate) {
  13815. if (!flag) {
  13816. flag = true;
  13817. // 如果是立即执行,则在wait毫秒内开始时执行
  13818. typeof func === 'function' && func();
  13819. timer = setTimeout(function () {
  13820. flag = false;
  13821. }, wait);
  13822. }
  13823. } else {
  13824. if (!flag) {
  13825. flag = true;
  13826. // 如果是非立即执行,则在wait毫秒内的结束处执行
  13827. timer = setTimeout(function () {
  13828. flag = false;
  13829. typeof func === 'function' && func();
  13830. }, wait);
  13831. }
  13832. }
  13833. }
  13834. ;
  13835. var _default = throttle;
  13836. exports.default = _default;
  13837. /***/ }),
  13838. /***/ 63:
  13839. /*!********************************************************!*\
  13840. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/config/config.js ***!
  13841. \********************************************************/
  13842. /*! no static exports found */
  13843. /***/ (function(module, exports, __webpack_require__) {
  13844. "use strict";
  13845. Object.defineProperty(exports, "__esModule", {
  13846. value: true
  13847. });
  13848. exports.default = void 0;
  13849. // 此版本发布于2020-03-17
  13850. var version = '1.8.4';
  13851. var _default = {
  13852. v: version,
  13853. version: version,
  13854. // 主题名称
  13855. type: ['primary', 'success', 'info', 'error', 'warning']
  13856. };
  13857. exports.default = _default;
  13858. /***/ }),
  13859. /***/ 635:
  13860. /*!*******************************************************!*\
  13861. !*** D:/工作/项目2/亲家母/qjm/components/uni-icons/icons.js ***!
  13862. \*******************************************************/
  13863. /*! no static exports found */
  13864. /***/ (function(module, exports, __webpack_require__) {
  13865. "use strict";
  13866. Object.defineProperty(exports, "__esModule", {
  13867. value: true
  13868. });
  13869. exports.default = void 0;
  13870. var _default = {
  13871. 'contact': "\uE100",
  13872. 'person': "\uE101",
  13873. 'personadd': "\uE102",
  13874. 'contact-filled': "\uE130",
  13875. 'person-filled': "\uE131",
  13876. 'personadd-filled': "\uE132",
  13877. 'phone': "\uE200",
  13878. 'email': "\uE201",
  13879. 'chatbubble': "\uE202",
  13880. 'chatboxes': "\uE203",
  13881. 'phone-filled': "\uE230",
  13882. 'email-filled': "\uE231",
  13883. 'chatbubble-filled': "\uE232",
  13884. 'chatboxes-filled': "\uE233",
  13885. 'weibo': "\uE260",
  13886. 'weixin': "\uE261",
  13887. 'pengyouquan': "\uE262",
  13888. 'chat': "\uE263",
  13889. 'qq': "\uE264",
  13890. 'videocam': "\uE300",
  13891. 'camera': "\uE301",
  13892. 'mic': "\uE302",
  13893. 'location': "\uE303",
  13894. 'mic-filled': "\uE332",
  13895. 'speech': "\uE332",
  13896. 'location-filled': "\uE333",
  13897. 'micoff': "\uE360",
  13898. 'image': "\uE363",
  13899. 'map': "\uE364",
  13900. 'compose': "\uE400",
  13901. 'trash': "\uE401",
  13902. 'upload': "\uE402",
  13903. 'download': "\uE403",
  13904. 'close': "\uE404",
  13905. 'redo': "\uE405",
  13906. 'undo': "\uE406",
  13907. 'refresh': "\uE407",
  13908. 'star': "\uE408",
  13909. 'plus': "\uE409",
  13910. 'minus': "\uE410",
  13911. 'circle': "\uE411",
  13912. 'checkbox': "\uE411",
  13913. 'close-filled': "\uE434",
  13914. 'clear': "\uE434",
  13915. 'refresh-filled': "\uE437",
  13916. 'star-filled': "\uE438",
  13917. 'plus-filled': "\uE439",
  13918. 'minus-filled': "\uE440",
  13919. 'circle-filled': "\uE441",
  13920. 'checkbox-filled': "\uE442",
  13921. 'closeempty': "\uE460",
  13922. 'refreshempty': "\uE461",
  13923. 'reload': "\uE462",
  13924. 'starhalf': "\uE463",
  13925. 'spinner': "\uE464",
  13926. 'spinner-cycle': "\uE465",
  13927. 'search': "\uE466",
  13928. 'plusempty': "\uE468",
  13929. 'forward': "\uE470",
  13930. 'back': "\uE471",
  13931. 'left-nav': "\uE471",
  13932. 'checkmarkempty': "\uE472",
  13933. 'home': "\uE500",
  13934. 'navigate': "\uE501",
  13935. 'gear': "\uE502",
  13936. 'paperplane': "\uE503",
  13937. 'info': "\uE504",
  13938. 'help': "\uE505",
  13939. 'locked': "\uE506",
  13940. 'more': "\uE507",
  13941. 'flag': "\uE508",
  13942. 'home-filled': "\uE530",
  13943. 'gear-filled': "\uE532",
  13944. 'info-filled': "\uE534",
  13945. 'help-filled': "\uE535",
  13946. 'more-filled': "\uE537",
  13947. 'settings': "\uE560",
  13948. 'list': "\uE562",
  13949. 'bars': "\uE563",
  13950. 'loop': "\uE565",
  13951. 'paperclip': "\uE567",
  13952. 'eye': "\uE568",
  13953. 'arrowup': "\uE580",
  13954. 'arrowdown': "\uE581",
  13955. 'arrowleft': "\uE582",
  13956. 'arrowright': "\uE583",
  13957. 'arrowthinup': "\uE584",
  13958. 'arrowthindown': "\uE585",
  13959. 'arrowthinleft': "\uE586",
  13960. 'arrowthinright': "\uE587",
  13961. 'pulldown': "\uE588",
  13962. 'closefill': "\uE589",
  13963. 'sound': "\uE590",
  13964. 'scan': "\uE612"
  13965. };
  13966. exports.default = _default;
  13967. /***/ }),
  13968. /***/ 64:
  13969. /*!********************************************************!*\
  13970. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/config/zIndex.js ***!
  13971. \********************************************************/
  13972. /*! no static exports found */
  13973. /***/ (function(module, exports, __webpack_require__) {
  13974. "use strict";
  13975. Object.defineProperty(exports, "__esModule", {
  13976. value: true
  13977. });
  13978. exports.default = void 0;
  13979. // uniapp在H5中各API的z-index值如下:
  13980. /**
  13981. * actionsheet: 999
  13982. * modal: 999
  13983. * navigate: 998
  13984. * tabbar: 998
  13985. * toast: 999
  13986. */
  13987. var _default = {
  13988. toast: 10090,
  13989. noNetwork: 10080,
  13990. // popup包含popup,actionsheet,keyboard,picker的值
  13991. popup: 10075,
  13992. mask: 10070,
  13993. navbar: 980,
  13994. topTips: 975,
  13995. sticky: 970,
  13996. indexListSticky: 965
  13997. };
  13998. exports.default = _default;
  13999. /***/ }),
  14000. /***/ 664:
  14001. /*!*******************************************************!*\
  14002. !*** D:/工作/项目2/亲家母/qjm/uview-ui/libs/util/emitter.js ***!
  14003. \*******************************************************/
  14004. /*! no static exports found */
  14005. /***/ (function(module, exports, __webpack_require__) {
  14006. "use strict";
  14007. Object.defineProperty(exports, "__esModule", {
  14008. value: true
  14009. });
  14010. exports.default = void 0;
  14011. /**
  14012. * 递归使用 call 方式this指向
  14013. * @param componentName // 需要找的组件的名称
  14014. * @param eventName // 事件名称
  14015. * @param params // 需要传递的参数
  14016. */
  14017. function _broadcast(componentName, eventName, params) {
  14018. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  14019. this.$children.map(function (child) {
  14020. if (componentName === child.$options.name) {
  14021. child.$emit.apply(child, [eventName].concat(params));
  14022. } else {
  14023. _broadcast.apply(child, [componentName, eventName].concat(params));
  14024. }
  14025. });
  14026. }
  14027. var _default = {
  14028. methods: {
  14029. /**
  14030. * 派发 (向上查找) (一个)
  14031. * @param componentName // 需要找的组件的名称
  14032. * @param eventName // 事件名称
  14033. * @param params // 需要传递的参数
  14034. */
  14035. dispatch: function dispatch(componentName, eventName, params) {
  14036. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  14037. var name = parent.$options.name; // 获取当前组件实例的name
  14038. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  14039. // 循环出当前名称的一样的组件实例
  14040. while (parent && (!name || name !== componentName)) {
  14041. parent = parent.$parent;
  14042. if (parent) {
  14043. name = parent.$options.name;
  14044. }
  14045. }
  14046. // 有节点表示当前找到了name一样的实例
  14047. if (parent) {
  14048. parent.$emit.apply(parent, [eventName].concat(params));
  14049. }
  14050. },
  14051. /**
  14052. * 广播 (向下查找) (广播多个)
  14053. * @param componentName // 需要找的组件的名称
  14054. * @param eventName // 事件名称
  14055. * @param params // 需要传递的参数
  14056. */
  14057. broadcast: function broadcast(componentName, eventName, params) {
  14058. _broadcast.call(this, componentName, eventName, params);
  14059. }
  14060. }
  14061. };
  14062. exports.default = _default;
  14063. /***/ }),
  14064. /***/ 7:
  14065. /*!*********************************************************************!*\
  14066. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  14067. \*********************************************************************/
  14068. /*! no static exports found */
  14069. /***/ (function(module, exports) {
  14070. function _iterableToArrayLimit(arr, i) {
  14071. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  14072. if (null != _i) {
  14073. var _s,
  14074. _e,
  14075. _x,
  14076. _r,
  14077. _arr = [],
  14078. _n = !0,
  14079. _d = !1;
  14080. try {
  14081. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  14082. if (Object(_i) !== _i) return;
  14083. _n = !1;
  14084. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  14085. ;
  14086. }
  14087. } catch (err) {
  14088. _d = !0, _e = err;
  14089. } finally {
  14090. try {
  14091. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  14092. } finally {
  14093. if (_d) throw _e;
  14094. }
  14095. }
  14096. return _arr;
  14097. }
  14098. }
  14099. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14100. /***/ }),
  14101. /***/ 71:
  14102. /*!**************************************!*\
  14103. !*** D:/工作/项目2/亲家母/qjm/api/index.js ***!
  14104. \**************************************/
  14105. /*! no static exports found */
  14106. /***/ (function(module, exports, __webpack_require__) {
  14107. "use strict";
  14108. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14109. Object.defineProperty(exports, "__esModule", {
  14110. value: true
  14111. });
  14112. exports.groom1 = groom1;
  14113. exports.groom3 = groom3;
  14114. exports.groom4 = groom4;
  14115. exports.loadIndexs = loadIndexs;
  14116. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  14117. // 促销商品
  14118. function groom4(data) {
  14119. return (0, _request.default)({
  14120. url: '/api/groom/list/4',
  14121. method: 'get',
  14122. data: data
  14123. });
  14124. }
  14125. // 精品推荐
  14126. function groom1(data) {
  14127. return (0, _request.default)({
  14128. url: '/api/groom/list/1',
  14129. method: 'get',
  14130. data: data
  14131. });
  14132. }
  14133. // 新品首发
  14134. function groom3(data) {
  14135. return (0, _request.default)({
  14136. url: '/api/groom/list/3',
  14137. method: 'get',
  14138. data: data
  14139. });
  14140. }
  14141. // 获取首页信息
  14142. function loadIndexs(data) {
  14143. return (0, _request.default)({
  14144. url: '/api/index',
  14145. method: 'get',
  14146. data: data
  14147. });
  14148. }
  14149. /***/ }),
  14150. /***/ 72:
  14151. /*!******************************************!*\
  14152. !*** D:/工作/项目2/亲家母/qjm/utils/request.js ***!
  14153. \******************************************/
  14154. /*! no static exports found */
  14155. /***/ (function(module, exports, __webpack_require__) {
  14156. "use strict";
  14157. /* WEBPACK VAR INJECTION */(function(uni) {
  14158. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14159. Object.defineProperty(exports, "__esModule", {
  14160. value: true
  14161. });
  14162. exports.upFilse = exports.default = void 0;
  14163. var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 73));
  14164. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  14165. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 100);
  14166. // 请求完成后拦截
  14167. _newRequest.default.interceptors.response(function (response) {
  14168. try {
  14169. var res = response.data;
  14170. // 解析字符串为数字
  14171. if (res.status !== 200) {
  14172. console.log(res.status);
  14173. if (res.status == 410000) {
  14174. // 调用退出登录方法清空用户信息
  14175. _store.default.commit('user/logout');
  14176. // 判断是否开启强制登录
  14177. uni.showModal({
  14178. title: "登陆",
  14179. content: '您未登录!是否马上登录?',
  14180. success: function success(e) {
  14181. // 判断是否点击确认按钮
  14182. if (e.confirm) {
  14183. // 保存当前页面地址
  14184. (0, _loginUtils.saveUrl)();
  14185. // 跳转页面
  14186. (0, _loginUtils.interceptor)();
  14187. }
  14188. }
  14189. });
  14190. } else {
  14191. if (res.msg != '系统出现异常') {
  14192. uni.showToast({
  14193. title: res.msg,
  14194. duration: 1500,
  14195. mask: false,
  14196. icon: 'none'
  14197. });
  14198. }
  14199. }
  14200. return Promise.reject(res);
  14201. } else {
  14202. return res;
  14203. }
  14204. } catch (e) {
  14205. console.log(e);
  14206. }
  14207. }, function (error) {
  14208. uni.showToast({
  14209. title: "加载错误请重试",
  14210. duration: 1500,
  14211. mask: false,
  14212. icon: 'none'
  14213. });
  14214. return Promise.reject(error);
  14215. });
  14216. // 请求前拦截器
  14217. _newRequest.default.interceptors.request(function (config) {
  14218. var token = uni.getStorageSync('token') || '';
  14219. // console.log(config);
  14220. if (!config.header) {
  14221. config.header = {
  14222. "Authori-zation": 'Bearer ' + token
  14223. };
  14224. } else {
  14225. // 添加key请求头
  14226. config.header["Authori-zation"] = 'Bearer ' + token;
  14227. }
  14228. return config;
  14229. }, function (error) {
  14230. // 错误处理
  14231. console.log(error);
  14232. return Promise.reject(error);
  14233. });
  14234. var upFilse = _newRequest.default.upFilse;
  14235. exports.upFilse = upFilse;
  14236. var _default = _newRequest.default.open;
  14237. exports.default = _default;
  14238. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14239. /***/ }),
  14240. /***/ 73:
  14241. /*!*********************************************!*\
  14242. !*** D:/工作/项目2/亲家母/qjm/utils/newRequest.js ***!
  14243. \*********************************************/
  14244. /*! no static exports found */
  14245. /***/ (function(module, exports, __webpack_require__) {
  14246. "use strict";
  14247. /* WEBPACK VAR INJECTION */(function(uni) {
  14248. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14249. Object.defineProperty(exports, "__esModule", {
  14250. value: true
  14251. });
  14252. exports.default = void 0;
  14253. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  14254. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  14255. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  14256. var _upFile = __webpack_require__(/*! @/utils/upFile.js */ 74);
  14257. var service = {
  14258. baseURL: _store.default.state.baseURL,
  14259. // 请求头
  14260. header: {
  14261. 'Content-Type': "application/x-www-form-urlencoded"
  14262. },
  14263. // 请求拦截器
  14264. interceptors: {
  14265. // 安装请求前拦截
  14266. request: function request(success, iserror) {
  14267. service.request.success = success;
  14268. service.request.error = iserror;
  14269. },
  14270. // 安装请求完成后拦截
  14271. response: function response(success, iserror) {
  14272. service.response.success = success;
  14273. service.response.error = iserror;
  14274. }
  14275. },
  14276. // 请求前拦截
  14277. request: {
  14278. // 回调成功执行方法
  14279. success: function success(e) {
  14280. return e;
  14281. },
  14282. // 回调失败
  14283. error: function error(e) {
  14284. return e;
  14285. }
  14286. },
  14287. // 请求完成后拦截
  14288. response: {
  14289. // 回调成功执行方法
  14290. success: function success(e) {
  14291. return e;
  14292. },
  14293. // 回调失败
  14294. error: function error(e) {
  14295. return e;
  14296. }
  14297. },
  14298. // 开始请求
  14299. open: function () {
  14300. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {
  14301. return _regenerator.default.wrap(function _callee$(_context) {
  14302. while (1) {
  14303. switch (_context.prev = _context.next) {
  14304. case 0:
  14305. _context.next = 2;
  14306. return new Promise(function (resolve, reject) {
  14307. var requestData = ''; //保存处理完成后请求数据
  14308. var url = ''; //保存链接地址
  14309. //console.log(data);
  14310. // 请求前数据处理
  14311. requestData = service.request.success(data);
  14312. url = service.baseURL + requestData.url;
  14313. // 数据复制用于请求
  14314. uni.request({
  14315. url: url,
  14316. method: requestData.method || 'GET',
  14317. data: requestData.data,
  14318. header: data.header || service.header,
  14319. success: function success(res) {
  14320. if (res.statusCode == 200) {
  14321. try {
  14322. resolve(service.response.success(res));
  14323. } catch (e) {
  14324. service.response.error(e);
  14325. }
  14326. }
  14327. },
  14328. // 请求失败数据处理
  14329. fail: function fail(err) {
  14330. service.response.error(err);
  14331. }
  14332. });
  14333. });
  14334. case 2:
  14335. return _context.abrupt("return", _context.sent);
  14336. case 3:
  14337. case "end":
  14338. return _context.stop();
  14339. }
  14340. }
  14341. }, _callee);
  14342. }));
  14343. function open(_x) {
  14344. return _open.apply(this, arguments);
  14345. }
  14346. return open;
  14347. }(),
  14348. // 上传文件
  14349. upFilse: function () {
  14350. var _upFilse = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {
  14351. var obj;
  14352. return _regenerator.default.wrap(function _callee4$(_context4) {
  14353. while (1) {
  14354. switch (_context4.prev = _context4.next) {
  14355. case 0:
  14356. obj = this;
  14357. _context4.next = 3;
  14358. return new Promise(function (resolve, reject) {
  14359. var requestData = ''; //保存处理完成后请求数据
  14360. var url = ''; //保存请求地址
  14361. try {
  14362. // 请求前数据处理
  14363. requestData = service.request.success(data);
  14364. } catch (e) {
  14365. // 请求报错拦截
  14366. service.request.error(e);
  14367. }
  14368. url = service.baseURL + requestData.url;
  14369. var config = {
  14370. // 上传图片的API
  14371. upload_img_url: url
  14372. };
  14373. var Uploader = {
  14374. // 选择图片
  14375. choose: function choose(num) {
  14376. return new Promise(function (resolve, reject) {
  14377. uni.chooseImage({
  14378. count: num,
  14379. success: function success(res) {
  14380. console.log(res);
  14381. // 缓存文件路径
  14382. resolve(res.tempFilePaths);
  14383. },
  14384. fail: function fail(err) {
  14385. console.log(err);
  14386. reject(err);
  14387. }
  14388. });
  14389. });
  14390. },
  14391. // 上传图片
  14392. upload_one: function upload_one(path) {
  14393. return new Promise(function (resolve, reject) {
  14394. uni.showLoading({
  14395. title: '上传中'
  14396. });
  14397. uni.uploadFile({
  14398. url: config.upload_img_url,
  14399. //仅为示例,非真实的接口地址
  14400. filePath: path,
  14401. name: 'file',
  14402. header: {
  14403. "Authori-zation": 'Bearer ' + uni.getStorageSync('token')
  14404. },
  14405. success: function success(uploadFileRes) {
  14406. if ("string" === typeof uploadFileRes.data) {
  14407. resolve(JSON.parse(uploadFileRes.data).data);
  14408. } else {
  14409. resolve(uploadFileRes.data.data);
  14410. }
  14411. },
  14412. complete: function complete() {
  14413. uni.hideLoading();
  14414. }
  14415. });
  14416. });
  14417. },
  14418. // 上传多个图片
  14419. upload: function upload(path_arr) {
  14420. var _this = this;
  14421. var num = path_arr.length;
  14422. return new Promise( /*#__PURE__*/function () {
  14423. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
  14424. var img_urls, i, img_url;
  14425. return _regenerator.default.wrap(function _callee2$(_context2) {
  14426. while (1) {
  14427. switch (_context2.prev = _context2.next) {
  14428. case 0:
  14429. img_urls = [];
  14430. i = 0;
  14431. case 2:
  14432. if (!(i < num)) {
  14433. _context2.next = 10;
  14434. break;
  14435. }
  14436. _context2.next = 5;
  14437. return _this.upload_one(path_arr[i]);
  14438. case 5:
  14439. img_url = _context2.sent;
  14440. img_urls.push(img_url);
  14441. case 7:
  14442. i++;
  14443. _context2.next = 2;
  14444. break;
  14445. case 10:
  14446. ;
  14447. resolve(img_urls);
  14448. case 12:
  14449. case "end":
  14450. return _context2.stop();
  14451. }
  14452. }
  14453. }, _callee2);
  14454. }));
  14455. return function (_x3, _x4) {
  14456. return _ref.apply(this, arguments);
  14457. };
  14458. }());
  14459. },
  14460. // 触发上传图片事件
  14461. choose_and_upload: function choose_and_upload(num) {
  14462. var _this2 = this;
  14463. return new Promise( /*#__PURE__*/function () {
  14464. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {
  14465. var path_arr;
  14466. return _regenerator.default.wrap(function _callee3$(_context3) {
  14467. while (1) {
  14468. switch (_context3.prev = _context3.next) {
  14469. case 0:
  14470. _context3.next = 2;
  14471. return _this2.choose(num);
  14472. case 2:
  14473. path_arr = _context3.sent;
  14474. _context3.next = 5;
  14475. return _this2.upload(path_arr).then(function (e) {
  14476. resolve(e);
  14477. }).catch(function (e) {
  14478. reject(e);
  14479. });
  14480. case 5:
  14481. case "end":
  14482. return _context3.stop();
  14483. }
  14484. }
  14485. }, _callee3);
  14486. }));
  14487. return function (_x5, _x6) {
  14488. return _ref2.apply(this, arguments);
  14489. };
  14490. }());
  14491. }
  14492. };
  14493. Uploader.choose_and_upload(1).then(function (e) {
  14494. resolve(e);
  14495. }).catch(function (e) {
  14496. console.log(e);
  14497. });
  14498. });
  14499. case 3:
  14500. return _context4.abrupt("return", _context4.sent);
  14501. case 4:
  14502. case "end":
  14503. return _context4.stop();
  14504. }
  14505. }
  14506. }, _callee4, this);
  14507. }));
  14508. function upFilse(_x2) {
  14509. return _upFilse.apply(this, arguments);
  14510. }
  14511. return upFilse;
  14512. }()
  14513. };
  14514. var _default = service;
  14515. exports.default = _default;
  14516. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14517. /***/ }),
  14518. /***/ 74:
  14519. /*!*****************************************!*\
  14520. !*** D:/工作/项目2/亲家母/qjm/utils/upFile.js ***!
  14521. \*****************************************/
  14522. /*! no static exports found */
  14523. /***/ (function(module, exports, __webpack_require__) {
  14524. "use strict";
  14525. /* WEBPACK VAR INJECTION */(function(uni) {
  14526. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14527. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  14528. Object.defineProperty(exports, "__esModule", {
  14529. value: true
  14530. });
  14531. exports.default = void 0;
  14532. exports.toUpLnImg = toUpLnImg;
  14533. exports.toUpVideo = toUpVideo;
  14534. var qiniu = _interopRequireWildcard(__webpack_require__(/*! qiniu-js */ 75));
  14535. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 72));
  14536. 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); }
  14537. 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; }
  14538. function toUpLnImg(files, fun) {
  14539. var _this = this;
  14540. uni.showLoading({
  14541. title: '上传中...'
  14542. });
  14543. var _loop = function _loop(i) {
  14544. var file = files[i];
  14545. var imageType = /^image\//;
  14546. //判断是否为图片不是则跳过不执行下面语句
  14547. if (!imageType.test(file.type)) {
  14548. uni.hideLoading();
  14549. _this.$api.msg('格式错误');
  14550. return "continue";
  14551. }
  14552. (0, _request.default)({
  14553. url: "/Upload/wxUploudtoken",
  14554. method: 'post',
  14555. data: {}
  14556. }).then(function (_ref) {
  14557. var data = _ref.data;
  14558. console.log(data, 99);
  14559. var observable = qiniu.upload(file, file.name, data.token, {
  14560. fname: "",
  14561. params: {},
  14562. mimeType: null
  14563. }, {
  14564. useCdnDomain: true,
  14565. region: qiniu.region.z0
  14566. });
  14567. var observer = {
  14568. next: function next(res) {
  14569. console.log(res);
  14570. // ...
  14571. },
  14572. error: function error(err) {
  14573. console.log(err);
  14574. // ...
  14575. },
  14576. complete: function complete(res) {
  14577. uni.hideLoading();
  14578. this.$api.msg('上传成功');
  14579. fun('https://limg.liuniu946.com/' + res.key);
  14580. // ...
  14581. }
  14582. };
  14583. var subscription = observable.subscribe(observer); // 上传开始
  14584. });
  14585. };
  14586. for (var i = 0; i < files.length; i++) {
  14587. var _ret = _loop(i);
  14588. if (_ret === "continue") continue;
  14589. }
  14590. }
  14591. /**
  14592. * @param {Object} files 要上传的文件
  14593. * @param {Function} fun 上传成功后的回调
  14594. */
  14595. function toUpVideo(files, fun) {
  14596. var _this2 = this;
  14597. Indicator.open({
  14598. text: '上传中...',
  14599. spinnerType: 'fading-circle'
  14600. });
  14601. var _loop2 = function _loop2(i) {
  14602. var file = files[i];
  14603. var Type = /^video\//;
  14604. //判断是否为图片不是则跳过不执行下面语句
  14605. if (!Type.test(file.type)) {
  14606. uni.hideLoading();
  14607. _this2.$api.msg('格式错误');
  14608. return "continue";
  14609. }
  14610. (0, _request.default)({
  14611. url: "/Upload/wxUploudtoken",
  14612. method: 'post',
  14613. data: {}
  14614. }).then(function (_ref2) {
  14615. var data = _ref2.data;
  14616. // console.log(data);
  14617. var observable = qiniu.upload(file, file.name, data.token, {
  14618. fname: "",
  14619. params: {},
  14620. mimeType: null
  14621. }, {
  14622. useCdnDomain: true,
  14623. region: qiniu.region.z0
  14624. });
  14625. var observer = {
  14626. next: function next(res) {
  14627. console.log(res);
  14628. // ...
  14629. },
  14630. error: function error(err) {
  14631. console.log(err);
  14632. // ...
  14633. },
  14634. complete: function complete(res) {
  14635. uni.hideLoading();
  14636. this.$api.msg('上传成功');
  14637. fun('https://limg.liuniu946.com/' + res.key);
  14638. // ...
  14639. }
  14640. };
  14641. var subscription = observable.subscribe(observer); // 上传开始
  14642. });
  14643. };
  14644. for (var i = 0; i < files.length; i++) {
  14645. var _ret2 = _loop2(i);
  14646. if (_ret2 === "continue") continue;
  14647. }
  14648. }
  14649. var _default = {
  14650. toUpLnImg: toUpLnImg,
  14651. toUpVideo: toUpVideo
  14652. };
  14653. exports.default = _default;
  14654. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14655. /***/ }),
  14656. /***/ 75:
  14657. /*!************************************************************!*\
  14658. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/index.js ***!
  14659. \************************************************************/
  14660. /*! no static exports found */
  14661. /***/ (function(module, exports, __webpack_require__) {
  14662. "use strict";
  14663. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14664. Object.defineProperty(exports, "__esModule", {
  14665. value: true
  14666. });
  14667. Object.defineProperty(exports, "QiniuError", {
  14668. enumerable: true,
  14669. get: function get() {
  14670. return _errors.QiniuError;
  14671. }
  14672. });
  14673. Object.defineProperty(exports, "QiniuErrorName", {
  14674. enumerable: true,
  14675. get: function get() {
  14676. return _errors.QiniuErrorName;
  14677. }
  14678. });
  14679. Object.defineProperty(exports, "QiniuNetworkError", {
  14680. enumerable: true,
  14681. get: function get() {
  14682. return _errors.QiniuNetworkError;
  14683. }
  14684. });
  14685. Object.defineProperty(exports, "QiniuRequestError", {
  14686. enumerable: true,
  14687. get: function get() {
  14688. return _errors.QiniuRequestError;
  14689. }
  14690. });
  14691. Object.defineProperty(exports, "compressImage", {
  14692. enumerable: true,
  14693. get: function get() {
  14694. return _utils.compressImage;
  14695. }
  14696. });
  14697. Object.defineProperty(exports, "deleteUploadedChunks", {
  14698. enumerable: true,
  14699. get: function get() {
  14700. return _api.deleteUploadedChunks;
  14701. }
  14702. });
  14703. Object.defineProperty(exports, "exif", {
  14704. enumerable: true,
  14705. get: function get() {
  14706. return _image.exif;
  14707. }
  14708. });
  14709. Object.defineProperty(exports, "getHeadersForChunkUpload", {
  14710. enumerable: true,
  14711. get: function get() {
  14712. return _utils.getHeadersForChunkUpload;
  14713. }
  14714. });
  14715. Object.defineProperty(exports, "getHeadersForMkFile", {
  14716. enumerable: true,
  14717. get: function get() {
  14718. return _utils.getHeadersForMkFile;
  14719. }
  14720. });
  14721. Object.defineProperty(exports, "getUploadUrl", {
  14722. enumerable: true,
  14723. get: function get() {
  14724. return _api.getUploadUrl;
  14725. }
  14726. });
  14727. Object.defineProperty(exports, "imageInfo", {
  14728. enumerable: true,
  14729. get: function get() {
  14730. return _image.imageInfo;
  14731. }
  14732. });
  14733. Object.defineProperty(exports, "imageMogr2", {
  14734. enumerable: true,
  14735. get: function get() {
  14736. return _image.imageMogr2;
  14737. }
  14738. });
  14739. Object.defineProperty(exports, "pipeline", {
  14740. enumerable: true,
  14741. get: function get() {
  14742. return _image.pipeline;
  14743. }
  14744. });
  14745. Object.defineProperty(exports, "region", {
  14746. enumerable: true,
  14747. get: function get() {
  14748. return _config.region;
  14749. }
  14750. });
  14751. Object.defineProperty(exports, "upload", {
  14752. enumerable: true,
  14753. get: function get() {
  14754. return _upload.default;
  14755. }
  14756. });
  14757. Object.defineProperty(exports, "urlSafeBase64Decode", {
  14758. enumerable: true,
  14759. get: function get() {
  14760. return _utils.urlSafeBase64Decode;
  14761. }
  14762. });
  14763. Object.defineProperty(exports, "urlSafeBase64Encode", {
  14764. enumerable: true,
  14765. get: function get() {
  14766. return _utils.urlSafeBase64Encode;
  14767. }
  14768. });
  14769. Object.defineProperty(exports, "watermark", {
  14770. enumerable: true,
  14771. get: function get() {
  14772. return _image.watermark;
  14773. }
  14774. });
  14775. var _errors = __webpack_require__(/*! ./errors */ 76);
  14776. var _image = __webpack_require__(/*! ./image */ 77);
  14777. var _api = __webpack_require__(/*! ./api */ 89);
  14778. var _upload = _interopRequireDefault(__webpack_require__(/*! ./upload */ 87));
  14779. var _config = __webpack_require__(/*! ./config */ 85);
  14780. var _utils = __webpack_require__(/*! ./utils */ 78);
  14781. /***/ }),
  14782. /***/ 76:
  14783. /*!*******************************************************************!*\
  14784. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/errors/index.js ***!
  14785. \*******************************************************************/
  14786. /*! no static exports found */
  14787. /***/ (function(module, exports, __webpack_require__) {
  14788. "use strict";
  14789. Object.defineProperty(exports, "__esModule", {
  14790. value: true
  14791. });
  14792. exports.QiniuRequestError = exports.QiniuNetworkError = exports.QiniuErrorName = exports.QiniuError = void 0;
  14793. var __extends = void 0 && (void 0).__extends || function () {
  14794. var _extendStatics = function extendStatics(d, b) {
  14795. _extendStatics = Object.setPrototypeOf || {
  14796. __proto__: []
  14797. } instanceof Array && function (d, b) {
  14798. d.__proto__ = b;
  14799. } || function (d, b) {
  14800. for (var p in b) {
  14801. if (b.hasOwnProperty(p)) d[p] = b[p];
  14802. }
  14803. };
  14804. return _extendStatics(d, b);
  14805. };
  14806. return function (d, b) {
  14807. _extendStatics(d, b);
  14808. function __() {
  14809. this.constructor = d;
  14810. }
  14811. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  14812. };
  14813. }();
  14814. var QiniuErrorName;
  14815. exports.QiniuErrorName = QiniuErrorName;
  14816. (function (QiniuErrorName) {
  14817. // 输入错误
  14818. QiniuErrorName["InvalidFile"] = "InvalidFile";
  14819. QiniuErrorName["InvalidToken"] = "InvalidToken";
  14820. QiniuErrorName["InvalidMetadata"] = "InvalidMetadata";
  14821. QiniuErrorName["InvalidChunkSize"] = "InvalidChunkSize";
  14822. QiniuErrorName["InvalidCustomVars"] = "InvalidCustomVars";
  14823. QiniuErrorName["NotAvailableUploadHost"] = "NotAvailableUploadHost";
  14824. // 缓存相关
  14825. QiniuErrorName["ReadCacheFailed"] = "ReadCacheFailed";
  14826. QiniuErrorName["InvalidCacheData"] = "InvalidCacheData";
  14827. QiniuErrorName["WriteCacheFailed"] = "WriteCacheFailed";
  14828. QiniuErrorName["RemoveCacheFailed"] = "RemoveCacheFailed";
  14829. // 图片压缩模块相关
  14830. QiniuErrorName["GetCanvasContextFailed"] = "GetCanvasContextFailed";
  14831. QiniuErrorName["UnsupportedFileType"] = "UnsupportedFileType";
  14832. // 运行环境相关
  14833. QiniuErrorName["FileReaderReadFailed"] = "FileReaderReadFailed";
  14834. QiniuErrorName["NotAvailableXMLHttpRequest"] = "NotAvailableXMLHttpRequest";
  14835. QiniuErrorName["InvalidProgressEventTarget"] = "InvalidProgressEventTarget";
  14836. // 请求错误
  14837. QiniuErrorName["RequestError"] = "RequestError";
  14838. })(QiniuErrorName || (exports.QiniuErrorName = QiniuErrorName = {}));
  14839. var QiniuError = /** @class */function () {
  14840. function QiniuError(name, message) {
  14841. this.name = name;
  14842. this.message = message;
  14843. this.stack = new Error().stack;
  14844. }
  14845. return QiniuError;
  14846. }();
  14847. exports.QiniuError = QiniuError;
  14848. var QiniuRequestError = /** @class */function (_super) {
  14849. __extends(QiniuRequestError, _super);
  14850. function QiniuRequestError(code, reqId, message, data) {
  14851. var _this = _super.call(this, QiniuErrorName.RequestError, message) || this;
  14852. _this.code = code;
  14853. _this.reqId = reqId;
  14854. /**
  14855. * @description 标记当前的 error 类型是一个 QiniuRequestError
  14856. * @deprecated 下一个大版本将会移除,不推荐使用,推荐直接使用 instanceof 进行判断
  14857. */
  14858. _this.isRequestError = true;
  14859. _this.data = data;
  14860. return _this;
  14861. }
  14862. return QiniuRequestError;
  14863. }(QiniuError);
  14864. exports.QiniuRequestError = QiniuRequestError;
  14865. /**
  14866. * @description 由于跨域、证书错误、断网、host 解析失败、系统拦截等原因导致的错误
  14867. */
  14868. var QiniuNetworkError = /** @class */function (_super) {
  14869. __extends(QiniuNetworkError, _super);
  14870. function QiniuNetworkError(message, reqId) {
  14871. if (reqId === void 0) {
  14872. reqId = '';
  14873. }
  14874. return _super.call(this, 0, reqId, message) || this;
  14875. }
  14876. return QiniuNetworkError;
  14877. }(QiniuRequestError);
  14878. exports.QiniuNetworkError = QiniuNetworkError;
  14879. /***/ }),
  14880. /***/ 77:
  14881. /*!******************************************************************!*\
  14882. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/image/index.js ***!
  14883. \******************************************************************/
  14884. /*! no static exports found */
  14885. /***/ (function(module, exports, __webpack_require__) {
  14886. "use strict";
  14887. Object.defineProperty(exports, "__esModule", {
  14888. value: true
  14889. });
  14890. exports.exif = exif;
  14891. exports.imageInfo = imageInfo;
  14892. exports.imageMogr2 = imageMogr2;
  14893. exports.imageView2 = imageView2;
  14894. exports.pipeline = pipeline;
  14895. exports.watermark = watermark;
  14896. var _utils = __webpack_require__(/*! ../utils */ 78);
  14897. function getImageUrl(key, domain) {
  14898. key = encodeURIComponent(key);
  14899. if (domain.slice(domain.length - 1) !== '/') {
  14900. domain += '/';
  14901. }
  14902. return domain + key;
  14903. }
  14904. function imageView2(op, key, domain) {
  14905. if (!/^\d$/.test(String(op.mode))) {
  14906. throw 'mode should be number in imageView2';
  14907. }
  14908. var mode = op.mode,
  14909. w = op.w,
  14910. h = op.h,
  14911. q = op.q,
  14912. format = op.format;
  14913. if (!w && !h) {
  14914. throw 'param w and h is empty in imageView2';
  14915. }
  14916. var imageUrl = 'imageView2/' + encodeURIComponent(mode);
  14917. imageUrl += w ? '/w/' + encodeURIComponent(w) : '';
  14918. imageUrl += h ? '/h/' + encodeURIComponent(h) : '';
  14919. imageUrl += q ? '/q/' + encodeURIComponent(q) : '';
  14920. imageUrl += format ? '/format/' + encodeURIComponent(format) : '';
  14921. if (key && domain) {
  14922. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  14923. }
  14924. return imageUrl;
  14925. }
  14926. // invoke the imageMogr2 api of Qiniu
  14927. function imageMogr2(op, key, domain) {
  14928. var autoOrient = op['auto-orient'];
  14929. var thumbnail = op.thumbnail,
  14930. strip = op.strip,
  14931. gravity = op.gravity,
  14932. crop = op.crop,
  14933. quality = op.quality,
  14934. rotate = op.rotate,
  14935. format = op.format,
  14936. blur = op.blur;
  14937. var imageUrl = 'imageMogr2';
  14938. imageUrl += autoOrient ? '/auto-orient' : '';
  14939. imageUrl += thumbnail ? '/thumbnail/' + encodeURIComponent(thumbnail) : '';
  14940. imageUrl += strip ? '/strip' : '';
  14941. imageUrl += gravity ? '/gravity/' + encodeURIComponent(gravity) : '';
  14942. imageUrl += quality ? '/quality/' + encodeURIComponent(quality) : '';
  14943. imageUrl += crop ? '/crop/' + encodeURIComponent(crop) : '';
  14944. imageUrl += rotate ? '/rotate/' + encodeURIComponent(rotate) : '';
  14945. imageUrl += format ? '/format/' + encodeURIComponent(format) : '';
  14946. imageUrl += blur ? '/blur/' + encodeURIComponent(blur) : '';
  14947. if (key && domain) {
  14948. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  14949. }
  14950. return imageUrl;
  14951. }
  14952. // invoke the watermark api of Qiniu
  14953. function watermark(op, key, domain) {
  14954. var mode = op.mode;
  14955. if (!mode) {
  14956. throw "mode can't be empty in watermark";
  14957. }
  14958. var imageUrl = 'watermark/' + mode;
  14959. if (mode !== 1 && mode !== 2) {
  14960. throw 'mode is wrong';
  14961. }
  14962. if (mode === 1) {
  14963. var image = op.image;
  14964. if (!image) {
  14965. throw "image can't be empty in watermark";
  14966. }
  14967. imageUrl += image ? '/image/' + (0, _utils.urlSafeBase64Encode)(image) : '';
  14968. }
  14969. if (mode === 2) {
  14970. var text = op.text,
  14971. font = op.font,
  14972. fontsize = op.fontsize,
  14973. fill = op.fill;
  14974. if (!text) {
  14975. throw "text can't be empty in watermark";
  14976. }
  14977. imageUrl += text ? '/text/' + (0, _utils.urlSafeBase64Encode)(text) : '';
  14978. imageUrl += font ? '/font/' + (0, _utils.urlSafeBase64Encode)(font) : '';
  14979. imageUrl += fontsize ? '/fontsize/' + fontsize : '';
  14980. imageUrl += fill ? '/fill/' + (0, _utils.urlSafeBase64Encode)(fill) : '';
  14981. }
  14982. var dissolve = op.dissolve,
  14983. gravity = op.gravity,
  14984. dx = op.dx,
  14985. dy = op.dy;
  14986. imageUrl += dissolve ? '/dissolve/' + encodeURIComponent(dissolve) : '';
  14987. imageUrl += gravity ? '/gravity/' + encodeURIComponent(gravity) : '';
  14988. imageUrl += dx ? '/dx/' + encodeURIComponent(dx) : '';
  14989. imageUrl += dy ? '/dy/' + encodeURIComponent(dy) : '';
  14990. if (key && domain) {
  14991. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  14992. }
  14993. return imageUrl;
  14994. }
  14995. // invoke the imageInfo api of Qiniu
  14996. function imageInfo(key, domain) {
  14997. var url = getImageUrl(key, domain) + '?imageInfo';
  14998. return (0, _utils.request)(url, {
  14999. method: 'GET'
  15000. });
  15001. }
  15002. // invoke the exif api of Qiniu
  15003. function exif(key, domain) {
  15004. var url = getImageUrl(key, domain) + '?exif';
  15005. return (0, _utils.request)(url, {
  15006. method: 'GET'
  15007. });
  15008. }
  15009. function pipeline(arr, key, domain) {
  15010. var isArray = Object.prototype.toString.call(arr) === '[object Array]';
  15011. var option;
  15012. var errOp = false;
  15013. var imageUrl = '';
  15014. if (isArray) {
  15015. for (var i = 0, len = arr.length; i < len; i++) {
  15016. option = arr[i];
  15017. if (!option.fop) {
  15018. throw "fop can't be empty in pipeline";
  15019. }
  15020. switch (option.fop) {
  15021. case 'watermark':
  15022. imageUrl += watermark(option) + '|';
  15023. break;
  15024. case 'imageView2':
  15025. imageUrl += imageView2(option) + '|';
  15026. break;
  15027. case 'imageMogr2':
  15028. imageUrl += imageMogr2(option) + '|';
  15029. break;
  15030. default:
  15031. errOp = true;
  15032. break;
  15033. }
  15034. if (errOp) {
  15035. throw 'fop is wrong in pipeline';
  15036. }
  15037. }
  15038. if (key && domain) {
  15039. imageUrl = getImageUrl(key, domain) + '?' + imageUrl;
  15040. var length_1 = imageUrl.length;
  15041. if (imageUrl.slice(length_1 - 1) === '|') {
  15042. imageUrl = imageUrl.slice(0, length_1 - 1);
  15043. }
  15044. }
  15045. return imageUrl;
  15046. }
  15047. throw "pipeline's first param should be array";
  15048. }
  15049. /***/ }),
  15050. /***/ 78:
  15051. /*!******************************************************************!*\
  15052. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/index.js ***!
  15053. \******************************************************************/
  15054. /*! no static exports found */
  15055. /***/ (function(module, exports, __webpack_require__) {
  15056. "use strict";
  15057. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15058. Object.defineProperty(exports, "__esModule", {
  15059. value: true
  15060. });
  15061. var _exportNames = {
  15062. compressImage: true
  15063. };
  15064. Object.defineProperty(exports, "compressImage", {
  15065. enumerable: true,
  15066. get: function get() {
  15067. return _compress.default;
  15068. }
  15069. });
  15070. var _pool = __webpack_require__(/*! ./pool */ 79);
  15071. Object.keys(_pool).forEach(function (key) {
  15072. if (key === "default" || key === "__esModule") return;
  15073. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15074. if (key in exports && exports[key] === _pool[key]) return;
  15075. Object.defineProperty(exports, key, {
  15076. enumerable: true,
  15077. get: function get() {
  15078. return _pool[key];
  15079. }
  15080. });
  15081. });
  15082. var _observable = __webpack_require__(/*! ./observable */ 80);
  15083. Object.keys(_observable).forEach(function (key) {
  15084. if (key === "default" || key === "__esModule") return;
  15085. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15086. if (key in exports && exports[key] === _observable[key]) return;
  15087. Object.defineProperty(exports, key, {
  15088. enumerable: true,
  15089. get: function get() {
  15090. return _observable[key];
  15091. }
  15092. });
  15093. });
  15094. var _base = __webpack_require__(/*! ./base64 */ 81);
  15095. Object.keys(_base).forEach(function (key) {
  15096. if (key === "default" || key === "__esModule") return;
  15097. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15098. if (key in exports && exports[key] === _base[key]) return;
  15099. Object.defineProperty(exports, key, {
  15100. enumerable: true,
  15101. get: function get() {
  15102. return _base[key];
  15103. }
  15104. });
  15105. });
  15106. var _helper = __webpack_require__(/*! ./helper */ 82);
  15107. Object.keys(_helper).forEach(function (key) {
  15108. if (key === "default" || key === "__esModule") return;
  15109. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15110. if (key in exports && exports[key] === _helper[key]) return;
  15111. Object.defineProperty(exports, key, {
  15112. enumerable: true,
  15113. get: function get() {
  15114. return _helper[key];
  15115. }
  15116. });
  15117. });
  15118. var _config = __webpack_require__(/*! ./config */ 84);
  15119. Object.keys(_config).forEach(function (key) {
  15120. if (key === "default" || key === "__esModule") return;
  15121. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  15122. if (key in exports && exports[key] === _config[key]) return;
  15123. Object.defineProperty(exports, key, {
  15124. enumerable: true,
  15125. get: function get() {
  15126. return _config[key];
  15127. }
  15128. });
  15129. });
  15130. var _compress = _interopRequireDefault(__webpack_require__(/*! ./compress */ 99));
  15131. /***/ }),
  15132. /***/ 79:
  15133. /*!*****************************************************************!*\
  15134. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/pool.js ***!
  15135. \*****************************************************************/
  15136. /*! no static exports found */
  15137. /***/ (function(module, exports, __webpack_require__) {
  15138. "use strict";
  15139. Object.defineProperty(exports, "__esModule", {
  15140. value: true
  15141. });
  15142. exports.Pool = void 0;
  15143. var Pool = /** @class */function () {
  15144. function Pool(runTask, limit) {
  15145. this.runTask = runTask;
  15146. this.limit = limit;
  15147. this.aborted = false;
  15148. this.queue = [];
  15149. this.processing = [];
  15150. }
  15151. Pool.prototype.enqueue = function (task) {
  15152. var _this = this;
  15153. return new Promise(function (resolve, reject) {
  15154. _this.queue.push({
  15155. task: task,
  15156. resolve: resolve,
  15157. reject: reject
  15158. });
  15159. _this.check();
  15160. });
  15161. };
  15162. Pool.prototype.run = function (item) {
  15163. var _this = this;
  15164. this.queue = this.queue.filter(function (v) {
  15165. return v !== item;
  15166. });
  15167. this.processing.push(item);
  15168. this.runTask(item.task).then(function () {
  15169. _this.processing = _this.processing.filter(function (v) {
  15170. return v !== item;
  15171. });
  15172. item.resolve();
  15173. _this.check();
  15174. }, function (err) {
  15175. return item.reject(err);
  15176. });
  15177. };
  15178. Pool.prototype.check = function () {
  15179. var _this = this;
  15180. if (this.aborted) return;
  15181. var processingNum = this.processing.length;
  15182. var availableNum = this.limit - processingNum;
  15183. this.queue.slice(0, availableNum).forEach(function (item) {
  15184. _this.run(item);
  15185. });
  15186. };
  15187. Pool.prototype.abort = function () {
  15188. this.queue = [];
  15189. this.aborted = true;
  15190. };
  15191. return Pool;
  15192. }();
  15193. exports.Pool = Pool;
  15194. /***/ }),
  15195. /***/ 8:
  15196. /*!***************************************************************************!*\
  15197. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  15198. \***************************************************************************/
  15199. /*! no static exports found */
  15200. /***/ (function(module, exports, __webpack_require__) {
  15201. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  15202. function _unsupportedIterableToArray(o, minLen) {
  15203. if (!o) return;
  15204. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  15205. var n = Object.prototype.toString.call(o).slice(8, -1);
  15206. if (n === "Object" && o.constructor) n = o.constructor.name;
  15207. if (n === "Map" || n === "Set") return Array.from(o);
  15208. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  15209. }
  15210. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15211. /***/ }),
  15212. /***/ 80:
  15213. /*!***********************************************************************!*\
  15214. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/observable.js ***!
  15215. \***********************************************************************/
  15216. /*! no static exports found */
  15217. /***/ (function(module, exports, __webpack_require__) {
  15218. "use strict";
  15219. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15220. Object.defineProperty(exports, "__esModule", {
  15221. value: true
  15222. });
  15223. exports.Subscriber = exports.Observable = void 0;
  15224. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  15225. var __extends = void 0 && (void 0).__extends || function () {
  15226. var _extendStatics = function extendStatics(d, b) {
  15227. _extendStatics = Object.setPrototypeOf || {
  15228. __proto__: []
  15229. } instanceof Array && function (d, b) {
  15230. d.__proto__ = b;
  15231. } || function (d, b) {
  15232. for (var p in b) {
  15233. if (b.hasOwnProperty(p)) d[p] = b[p];
  15234. }
  15235. };
  15236. return _extendStatics(d, b);
  15237. };
  15238. return function (d, b) {
  15239. _extendStatics(d, b);
  15240. function __() {
  15241. this.constructor = d;
  15242. }
  15243. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15244. };
  15245. }();
  15246. var __assign = void 0 && (void 0).__assign || function () {
  15247. __assign = Object.assign || function (t) {
  15248. for (var s, i = 1, n = arguments.length; i < n; i++) {
  15249. s = arguments[i];
  15250. for (var p in s) {
  15251. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  15252. }
  15253. }
  15254. return t;
  15255. };
  15256. return __assign.apply(this, arguments);
  15257. };
  15258. /** 表示可清理的资源,比如 Observable 的执行 */
  15259. var Subscription = /** @class */function () {
  15260. function Subscription() {
  15261. /** 用来标示该 Subscription 是否被取消订阅的标示位 */
  15262. this.closed = false;
  15263. }
  15264. /** 取消 observer 的订阅 */
  15265. Subscription.prototype.unsubscribe = function () {
  15266. if (this.closed) {
  15267. return;
  15268. }
  15269. this.closed = true;
  15270. if (this._unsubscribe) {
  15271. this._unsubscribe();
  15272. }
  15273. };
  15274. /** 添加一个 tear down 在该 Subscription 的 unsubscribe() 期间调用 */
  15275. Subscription.prototype.add = function (teardown) {
  15276. this._unsubscribe = teardown;
  15277. };
  15278. return Subscription;
  15279. }();
  15280. /**
  15281. * 实现 Observer 接口并且继承 Subscription 类,Observer 是消费 Observable 值的公有 API
  15282. * 所有 Observers 都转化成了 Subscriber,以便提供类似 Subscription 的能力,比如 unsubscribe
  15283. */
  15284. var Subscriber = /** @class */function (_super) {
  15285. __extends(Subscriber, _super);
  15286. function Subscriber(observerOrNext, error, complete) {
  15287. var _this = _super.call(this) || this;
  15288. _this.isStopped = false;
  15289. if (observerOrNext && (0, _typeof2.default)(observerOrNext) === 'object') {
  15290. _this.destination = observerOrNext;
  15291. } else {
  15292. _this.destination = __assign(__assign(__assign({}, observerOrNext && {
  15293. next: observerOrNext
  15294. }), error && {
  15295. error: error
  15296. }), complete && {
  15297. complete: complete
  15298. });
  15299. }
  15300. return _this;
  15301. }
  15302. Subscriber.prototype.unsubscribe = function () {
  15303. if (this.closed) {
  15304. return;
  15305. }
  15306. this.isStopped = true;
  15307. _super.prototype.unsubscribe.call(this);
  15308. };
  15309. Subscriber.prototype.next = function (value) {
  15310. if (!this.isStopped && this.destination.next) {
  15311. this.destination.next(value);
  15312. }
  15313. };
  15314. Subscriber.prototype.error = function (err) {
  15315. if (!this.isStopped && this.destination.error) {
  15316. this.isStopped = true;
  15317. this.destination.error(err);
  15318. }
  15319. };
  15320. Subscriber.prototype.complete = function (result) {
  15321. if (!this.isStopped && this.destination.complete) {
  15322. this.isStopped = true;
  15323. this.destination.complete(result);
  15324. }
  15325. };
  15326. return Subscriber;
  15327. }(Subscription);
  15328. exports.Subscriber = Subscriber;
  15329. /** 可观察对象,当前的上传事件的集合 */
  15330. var Observable = /** @class */function () {
  15331. function Observable(_subscribe) {
  15332. this._subscribe = _subscribe;
  15333. }
  15334. Observable.prototype.subscribe = function (observerOrNext, error, complete) {
  15335. var sink = new Subscriber(observerOrNext, error, complete);
  15336. sink.add(this._subscribe(sink));
  15337. return sink;
  15338. };
  15339. return Observable;
  15340. }();
  15341. exports.Observable = Observable;
  15342. /***/ }),
  15343. /***/ 81:
  15344. /*!*******************************************************************!*\
  15345. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/base64.js ***!
  15346. \*******************************************************************/
  15347. /*! no static exports found */
  15348. /***/ (function(module, exports, __webpack_require__) {
  15349. "use strict";
  15350. Object.defineProperty(exports, "__esModule", {
  15351. value: true
  15352. });
  15353. exports.urlSafeBase64Decode = urlSafeBase64Decode;
  15354. exports.urlSafeBase64Encode = urlSafeBase64Encode;
  15355. /* eslint-disable */
  15356. // https://github.com/locutusjs/locutus/blob/master/src/php/xml/utf8_encode.js
  15357. function utf8Encode(argString) {
  15358. // http://kevin.vanzonneveld.net
  15359. // + original by: Webtoolkit.info (http://www.webtoolkit.info/)
  15360. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15361. // + improved by: sowberry
  15362. // + tweaked by: Jack
  15363. // + bugfixed by: Onno Marsman
  15364. // + improved by: Yves Sucaet
  15365. // + bugfixed by: Onno Marsman
  15366. // + bugfixed by: Ulrich
  15367. // + bugfixed by: Rafal Kukawski
  15368. // + improved by: kirilloid
  15369. // + bugfixed by: kirilloid
  15370. // * example 1: this.utf8Encode('Kevin van Zonneveld')
  15371. // * returns 1: 'Kevin van Zonneveld'
  15372. if (argString === null || typeof argString === 'undefined') {
  15373. return '';
  15374. }
  15375. var string = argString + ''; // .replace(/\r\n/g, '\n').replace(/\r/g, '\n')
  15376. var utftext = '',
  15377. start,
  15378. end,
  15379. stringl = 0;
  15380. start = end = 0;
  15381. stringl = string.length;
  15382. for (var n = 0; n < stringl; n++) {
  15383. var c1 = string.charCodeAt(n);
  15384. var enc = null;
  15385. if (c1 < 128) {
  15386. end++;
  15387. } else if (c1 > 127 && c1 < 2048) {
  15388. enc = String.fromCharCode(c1 >> 6 | 192, c1 & 63 | 128);
  15389. } else if ((c1 & 0xf800 ^ 0xd800) > 0) {
  15390. enc = String.fromCharCode(c1 >> 12 | 224, c1 >> 6 & 63 | 128, c1 & 63 | 128);
  15391. } else {
  15392. // surrogate pairs
  15393. if ((c1 & 0xfc00 ^ 0xd800) > 0) {
  15394. throw new RangeError('Unmatched trail surrogate at ' + n);
  15395. }
  15396. var c2 = string.charCodeAt(++n);
  15397. if ((c2 & 0xfc00 ^ 0xdc00) > 0) {
  15398. throw new RangeError('Unmatched lead surrogate at ' + (n - 1));
  15399. }
  15400. c1 = ((c1 & 0x3ff) << 10) + (c2 & 0x3ff) + 0x10000;
  15401. enc = String.fromCharCode(c1 >> 18 | 240, c1 >> 12 & 63 | 128, c1 >> 6 & 63 | 128, c1 & 63 | 128);
  15402. }
  15403. if (enc !== null) {
  15404. if (end > start) {
  15405. utftext += string.slice(start, end);
  15406. }
  15407. utftext += enc;
  15408. start = end = n + 1;
  15409. }
  15410. }
  15411. if (end > start) {
  15412. utftext += string.slice(start, stringl);
  15413. }
  15414. return utftext;
  15415. }
  15416. // https://github.com/locutusjs/locutus/blob/master/src/php/xml/utf8_decode.js
  15417. function utf8Decode(strData) {
  15418. // eslint-disable-line camelcase
  15419. // discuss at: https://locutus.io/php/utf8_decode/
  15420. // original by: Webtoolkit.info (https://www.webtoolkit.info/)
  15421. // input by: Aman Gupta
  15422. // input by: Brett Zamir (https://brett-zamir.me)
  15423. // improved by: Kevin van Zonneveld (https://kvz.io)
  15424. // improved by: Norman "zEh" Fuchs
  15425. // bugfixed by: hitwork
  15426. // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
  15427. // bugfixed by: Kevin van Zonneveld (https://kvz.io)
  15428. // bugfixed by: kirilloid
  15429. // bugfixed by: w35l3y (https://www.wesley.eti.br)
  15430. // example 1: utf8_decode('Kevin van Zonneveld')
  15431. // returns 1: 'Kevin van Zonneveld'
  15432. var tmpArr = [];
  15433. var i = 0;
  15434. var c1 = 0;
  15435. var seqlen = 0;
  15436. strData += '';
  15437. while (i < strData.length) {
  15438. c1 = strData.charCodeAt(i) & 0xFF;
  15439. seqlen = 0;
  15440. // https://en.wikipedia.org/wiki/UTF-8#Codepage_layout
  15441. if (c1 <= 0xBF) {
  15442. c1 = c1 & 0x7F;
  15443. seqlen = 1;
  15444. } else if (c1 <= 0xDF) {
  15445. c1 = c1 & 0x1F;
  15446. seqlen = 2;
  15447. } else if (c1 <= 0xEF) {
  15448. c1 = c1 & 0x0F;
  15449. seqlen = 3;
  15450. } else {
  15451. c1 = c1 & 0x07;
  15452. seqlen = 4;
  15453. }
  15454. for (var ai = 1; ai < seqlen; ++ai) {
  15455. c1 = c1 << 0x06 | strData.charCodeAt(ai + i) & 0x3F;
  15456. }
  15457. if (seqlen === 4) {
  15458. c1 -= 0x10000;
  15459. tmpArr.push(String.fromCharCode(0xD800 | c1 >> 10 & 0x3FF));
  15460. tmpArr.push(String.fromCharCode(0xDC00 | c1 & 0x3FF));
  15461. } else {
  15462. tmpArr.push(String.fromCharCode(c1));
  15463. }
  15464. i += seqlen;
  15465. }
  15466. return tmpArr.join('');
  15467. }
  15468. function base64Encode(data) {
  15469. // http://kevin.vanzonneveld.net
  15470. // + original by: Tyler Akins (http://rumkin.com)
  15471. // + improved by: Bayron Guevara
  15472. // + improved by: Thunder.m
  15473. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15474. // + bugfixed by: Pellentesque Malesuada
  15475. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15476. // - depends on: this.utf8Encode
  15477. // * example 1: this.base64Encode('Kevin van Zonneveld')
  15478. // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
  15479. // mozilla has this native
  15480. // - but breaks in 2.0.0.12!
  15481. // if (typeof this.window['atob'] == 'function') {
  15482. // return atob(data)
  15483. // }
  15484. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  15485. var o1,
  15486. o2,
  15487. o3,
  15488. h1,
  15489. h2,
  15490. h3,
  15491. h4,
  15492. bits,
  15493. i = 0,
  15494. ac = 0,
  15495. enc = '',
  15496. tmp_arr = [];
  15497. if (!data) {
  15498. return data;
  15499. }
  15500. data = utf8Encode(data + '');
  15501. do {
  15502. // pack three octets into four hexets
  15503. o1 = data.charCodeAt(i++);
  15504. o2 = data.charCodeAt(i++);
  15505. o3 = data.charCodeAt(i++);
  15506. bits = o1 << 16 | o2 << 8 | o3;
  15507. h1 = bits >> 18 & 0x3f;
  15508. h2 = bits >> 12 & 0x3f;
  15509. h3 = bits >> 6 & 0x3f;
  15510. h4 = bits & 0x3f;
  15511. // use hexets to index into b64, and append result to encoded string
  15512. tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
  15513. } while (i < data.length);
  15514. enc = tmp_arr.join('');
  15515. switch (data.length % 3) {
  15516. case 1:
  15517. enc = enc.slice(0, -2) + '==';
  15518. break;
  15519. case 2:
  15520. enc = enc.slice(0, -1) + '=';
  15521. break;
  15522. }
  15523. return enc;
  15524. }
  15525. function base64Decode(data) {
  15526. // http://kevin.vanzonneveld.net
  15527. // + original by: Tyler Akins (http://rumkin.com)
  15528. // + improved by: Thunder.m
  15529. // + input by: Aman Gupta
  15530. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15531. // + bugfixed by: Onno Marsman
  15532. // + bugfixed by: Pellentesque Malesuada
  15533. // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15534. // + input by: Brett Zamir (http://brett-zamir.me)
  15535. // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  15536. // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==')
  15537. // * returns 1: 'Kevin van Zonneveld'
  15538. // mozilla has this native
  15539. // - but breaks in 2.0.0.12!
  15540. // if (typeof this.window['atob'] == 'function') {
  15541. // return atob(data)
  15542. // }
  15543. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  15544. var o1,
  15545. o2,
  15546. o3,
  15547. h1,
  15548. h2,
  15549. h3,
  15550. h4,
  15551. bits,
  15552. i = 0,
  15553. ac = 0,
  15554. dec = '',
  15555. tmp_arr = [];
  15556. if (!data) {
  15557. return data;
  15558. }
  15559. data += '';
  15560. do {
  15561. // unpack four hexets into three octets using index points in b64
  15562. h1 = b64.indexOf(data.charAt(i++));
  15563. h2 = b64.indexOf(data.charAt(i++));
  15564. h3 = b64.indexOf(data.charAt(i++));
  15565. h4 = b64.indexOf(data.charAt(i++));
  15566. bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
  15567. o1 = bits >> 16 & 0xff;
  15568. o2 = bits >> 8 & 0xff;
  15569. o3 = bits & 0xff;
  15570. if (h3 === 64) {
  15571. tmp_arr[ac++] = String.fromCharCode(o1);
  15572. } else if (h4 === 64) {
  15573. tmp_arr[ac++] = String.fromCharCode(o1, o2);
  15574. } else {
  15575. tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
  15576. }
  15577. } while (i < data.length);
  15578. dec = tmp_arr.join('');
  15579. return utf8Decode(dec);
  15580. }
  15581. function urlSafeBase64Encode(v) {
  15582. v = base64Encode(v);
  15583. // 参考 https://tools.ietf.org/html/rfc4648#section-5
  15584. return v.replace(/\//g, '_').replace(/\+/g, '-');
  15585. }
  15586. function urlSafeBase64Decode(v) {
  15587. v = v.replace(/_/g, '/').replace(/-/g, '+');
  15588. return base64Decode(v);
  15589. }
  15590. /***/ }),
  15591. /***/ 82:
  15592. /*!*******************************************************************!*\
  15593. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/helper.js ***!
  15594. \*******************************************************************/
  15595. /*! no static exports found */
  15596. /***/ (function(module, exports, __webpack_require__) {
  15597. "use strict";
  15598. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15599. Object.defineProperty(exports, "__esModule", {
  15600. value: true
  15601. });
  15602. exports.MB = void 0;
  15603. exports.computeMd5 = computeMd5;
  15604. exports.createLocalKey = createLocalKey;
  15605. exports.createObjectURL = createObjectURL;
  15606. exports.createXHR = createXHR;
  15607. exports.getAuthHeaders = getAuthHeaders;
  15608. exports.getChunks = getChunks;
  15609. exports.getDomainFromUrl = getDomainFromUrl;
  15610. exports.getHeadersForChunkUpload = getHeadersForChunkUpload;
  15611. exports.getHeadersForMkFile = getHeadersForMkFile;
  15612. exports.getLocalFileInfo = getLocalFileInfo;
  15613. exports.getPortFromUrl = getPortFromUrl;
  15614. exports.getPutPolicy = getPutPolicy;
  15615. exports.isCustomVarsValid = isCustomVarsValid;
  15616. exports.isMetaDataValid = isMetaDataValid;
  15617. exports.readAsArrayBuffer = readAsArrayBuffer;
  15618. exports.removeLocalFileInfo = removeLocalFileInfo;
  15619. exports.request = request;
  15620. exports.setLocalFileInfo = setLocalFileInfo;
  15621. exports.sum = sum;
  15622. var _sparkMd = _interopRequireDefault(__webpack_require__(/*! spark-md5 */ 83));
  15623. var _errors = __webpack_require__(/*! ../errors */ 76);
  15624. var _base = __webpack_require__(/*! ./base64 */ 81);
  15625. var __assign = void 0 && (void 0).__assign || function () {
  15626. __assign = Object.assign || function (t) {
  15627. for (var s, i = 1, n = arguments.length; i < n; i++) {
  15628. s = arguments[i];
  15629. for (var p in s) {
  15630. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  15631. }
  15632. }
  15633. return t;
  15634. };
  15635. return __assign.apply(this, arguments);
  15636. };
  15637. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  15638. function adopt(value) {
  15639. return value instanceof P ? value : new P(function (resolve) {
  15640. resolve(value);
  15641. });
  15642. }
  15643. return new (P || (P = Promise))(function (resolve, reject) {
  15644. function fulfilled(value) {
  15645. try {
  15646. step(generator.next(value));
  15647. } catch (e) {
  15648. reject(e);
  15649. }
  15650. }
  15651. function rejected(value) {
  15652. try {
  15653. step(generator["throw"](value));
  15654. } catch (e) {
  15655. reject(e);
  15656. }
  15657. }
  15658. function step(result) {
  15659. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  15660. }
  15661. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15662. });
  15663. };
  15664. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  15665. var _ = {
  15666. label: 0,
  15667. sent: function sent() {
  15668. if (t[0] & 1) throw t[1];
  15669. return t[1];
  15670. },
  15671. trys: [],
  15672. ops: []
  15673. },
  15674. f,
  15675. y,
  15676. t,
  15677. g;
  15678. return g = {
  15679. next: verb(0),
  15680. "throw": verb(1),
  15681. "return": verb(2)
  15682. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  15683. return this;
  15684. }), g;
  15685. function verb(n) {
  15686. return function (v) {
  15687. return step([n, v]);
  15688. };
  15689. }
  15690. function step(op) {
  15691. if (f) throw new TypeError("Generator is already executing.");
  15692. while (_) {
  15693. try {
  15694. 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;
  15695. if (y = 0, t) op = [op[0] & 2, t.value];
  15696. switch (op[0]) {
  15697. case 0:
  15698. case 1:
  15699. t = op;
  15700. break;
  15701. case 4:
  15702. _.label++;
  15703. return {
  15704. value: op[1],
  15705. done: false
  15706. };
  15707. case 5:
  15708. _.label++;
  15709. y = op[1];
  15710. op = [0];
  15711. continue;
  15712. case 7:
  15713. op = _.ops.pop();
  15714. _.trys.pop();
  15715. continue;
  15716. default:
  15717. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  15718. _ = 0;
  15719. continue;
  15720. }
  15721. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  15722. _.label = op[1];
  15723. break;
  15724. }
  15725. if (op[0] === 6 && _.label < t[1]) {
  15726. _.label = t[1];
  15727. t = op;
  15728. break;
  15729. }
  15730. if (t && _.label < t[2]) {
  15731. _.label = t[2];
  15732. _.ops.push(op);
  15733. break;
  15734. }
  15735. if (t[2]) _.ops.pop();
  15736. _.trys.pop();
  15737. continue;
  15738. }
  15739. op = body.call(thisArg, _);
  15740. } catch (e) {
  15741. op = [6, e];
  15742. y = 0;
  15743. } finally {
  15744. f = t = 0;
  15745. }
  15746. }
  15747. if (op[0] & 5) throw op[1];
  15748. return {
  15749. value: op[0] ? op[1] : void 0,
  15750. done: true
  15751. };
  15752. }
  15753. };
  15754. var MB = Math.pow(1024, 2);
  15755. // 文件分块
  15756. exports.MB = MB;
  15757. function getChunks(file, blockSize) {
  15758. var chunkByteSize = blockSize * MB; // 转换为字节
  15759. // 如果 chunkByteSize 比文件大,则直接取文件的大小
  15760. if (chunkByteSize > file.size) {
  15761. chunkByteSize = file.size;
  15762. } else {
  15763. // 因为最多 10000 chunk,所以如果 chunkSize 不符合则把每片 chunk 大小扩大两倍
  15764. while (file.size > chunkByteSize * 10000) {
  15765. chunkByteSize *= 2;
  15766. }
  15767. }
  15768. var chunks = [];
  15769. var count = Math.ceil(file.size / chunkByteSize);
  15770. for (var i = 0; i < count; i++) {
  15771. var chunk = file.slice(chunkByteSize * i, i === count - 1 ? file.size : chunkByteSize * (i + 1));
  15772. chunks.push(chunk);
  15773. }
  15774. return chunks;
  15775. }
  15776. function isMetaDataValid(params) {
  15777. return Object.keys(params).every(function (key) {
  15778. return key.indexOf('x-qn-meta-') === 0;
  15779. });
  15780. }
  15781. function isCustomVarsValid(params) {
  15782. return Object.keys(params).every(function (key) {
  15783. return key.indexOf('x:') === 0;
  15784. });
  15785. }
  15786. function sum(list) {
  15787. return list.reduce(function (data, loaded) {
  15788. return data + loaded;
  15789. }, 0);
  15790. }
  15791. function setLocalFileInfo(localKey, info, logger) {
  15792. try {
  15793. localStorage.setItem(localKey, JSON.stringify(info));
  15794. } catch (err) {
  15795. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.WriteCacheFailed, "setLocalFileInfo failed: " + localKey));
  15796. }
  15797. }
  15798. function createLocalKey(name, key, size) {
  15799. var localKey = key == null ? '_' : "_key_" + key + "_";
  15800. return "qiniu_js_sdk_upload_file_name_" + name + localKey + "size_" + size;
  15801. }
  15802. function removeLocalFileInfo(localKey, logger) {
  15803. try {
  15804. localStorage.removeItem(localKey);
  15805. } catch (err) {
  15806. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.RemoveCacheFailed, "removeLocalFileInfo failed. key: " + localKey));
  15807. }
  15808. }
  15809. function getLocalFileInfo(localKey, logger) {
  15810. var localInfoString = null;
  15811. try {
  15812. localInfoString = localStorage.getItem(localKey);
  15813. } catch (_a) {
  15814. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.ReadCacheFailed, "getLocalFileInfo failed. key: " + localKey));
  15815. }
  15816. if (localInfoString == null) {
  15817. return null;
  15818. }
  15819. var localInfo = null;
  15820. try {
  15821. localInfo = JSON.parse(localInfoString);
  15822. } catch (_b) {
  15823. // 本地信息已被破坏,直接删除
  15824. removeLocalFileInfo(localKey, logger);
  15825. logger.warn(new _errors.QiniuError(_errors.QiniuErrorName.InvalidCacheData, "getLocalFileInfo failed to parse. key: " + localKey));
  15826. }
  15827. return localInfo;
  15828. }
  15829. function getAuthHeaders(token) {
  15830. var auth = 'UpToken ' + token;
  15831. return {
  15832. Authorization: auth
  15833. };
  15834. }
  15835. function getHeadersForChunkUpload(token) {
  15836. var header = getAuthHeaders(token);
  15837. return __assign({
  15838. 'content-type': 'application/octet-stream'
  15839. }, header);
  15840. }
  15841. function getHeadersForMkFile(token) {
  15842. var header = getAuthHeaders(token);
  15843. return __assign({
  15844. 'content-type': 'application/json'
  15845. }, header);
  15846. }
  15847. function createXHR() {
  15848. if (window.XMLHttpRequest) {
  15849. return new XMLHttpRequest();
  15850. }
  15851. if (window.ActiveXObject) {
  15852. return new window.ActiveXObject('Microsoft.XMLHTTP');
  15853. }
  15854. throw new _errors.QiniuError(_errors.QiniuErrorName.NotAvailableXMLHttpRequest, 'the current environment does not support.');
  15855. }
  15856. function computeMd5(data) {
  15857. return __awaiter(this, void 0, void 0, function () {
  15858. var buffer, spark;
  15859. return __generator(this, function (_a) {
  15860. switch (_a.label) {
  15861. case 0:
  15862. return [4 /*yield*/, readAsArrayBuffer(data)];
  15863. case 1:
  15864. buffer = _a.sent();
  15865. spark = new _sparkMd.default.ArrayBuffer();
  15866. spark.append(buffer);
  15867. return [2 /*return*/, spark.end()];
  15868. }
  15869. });
  15870. });
  15871. }
  15872. function readAsArrayBuffer(data) {
  15873. return new Promise(function (resolve, reject) {
  15874. var reader = new FileReader();
  15875. // evt 类型目前存在问题 https://github.com/Microsoft/TypeScript/issues/4163
  15876. reader.onload = function (evt) {
  15877. if (evt.target) {
  15878. var body = evt.target.result;
  15879. resolve(body);
  15880. } else {
  15881. reject(new _errors.QiniuError(_errors.QiniuErrorName.InvalidProgressEventTarget, 'progress event target is undefined'));
  15882. }
  15883. };
  15884. reader.onerror = function () {
  15885. reject(new _errors.QiniuError(_errors.QiniuErrorName.FileReaderReadFailed, 'fileReader read failed'));
  15886. };
  15887. reader.readAsArrayBuffer(data);
  15888. });
  15889. }
  15890. function request(url, options) {
  15891. return new Promise(function (resolve, reject) {
  15892. var xhr = createXHR();
  15893. xhr.open(options.method, url);
  15894. if (options.onCreate) {
  15895. options.onCreate(xhr);
  15896. }
  15897. if (options.headers) {
  15898. var headers_1 = options.headers;
  15899. Object.keys(headers_1).forEach(function (k) {
  15900. xhr.setRequestHeader(k, headers_1[k]);
  15901. });
  15902. }
  15903. xhr.upload.addEventListener('progress', function (evt) {
  15904. if (evt.lengthComputable && options.onProgress) {
  15905. options.onProgress({
  15906. loaded: evt.loaded,
  15907. total: evt.total
  15908. });
  15909. }
  15910. });
  15911. xhr.onreadystatechange = function () {
  15912. var responseText = xhr.responseText;
  15913. if (xhr.readyState !== 4) {
  15914. return;
  15915. }
  15916. var reqId = xhr.getResponseHeader('x-reqId') || '';
  15917. if (xhr.status === 0) {
  15918. // 发生 0 基本都是网络错误,常见的比如跨域、断网、host 解析失败、系统拦截等等
  15919. reject(new _errors.QiniuNetworkError('network error.', reqId));
  15920. return;
  15921. }
  15922. if (xhr.status !== 200) {
  15923. var message = "xhr request failed, code: " + xhr.status;
  15924. if (responseText) {
  15925. message += " response: " + responseText;
  15926. }
  15927. var data = void 0;
  15928. try {
  15929. data = JSON.parse(responseText);
  15930. } catch (_a) {
  15931. // 无需处理该错误、可能拿到非 json 格式的响应是预期的
  15932. }
  15933. reject(new _errors.QiniuRequestError(xhr.status, reqId, message, data));
  15934. return;
  15935. }
  15936. try {
  15937. resolve({
  15938. data: JSON.parse(responseText),
  15939. reqId: reqId
  15940. });
  15941. } catch (err) {
  15942. reject(err);
  15943. }
  15944. };
  15945. xhr.send(options.body);
  15946. });
  15947. }
  15948. function getPortFromUrl(url) {
  15949. if (url && url.match) {
  15950. var groups = url.match(/(^https?)/);
  15951. if (!groups) {
  15952. return '';
  15953. }
  15954. var type = groups[1];
  15955. groups = url.match(/^https?:\/\/([^:^/]*):(\d*)/);
  15956. if (groups) {
  15957. return groups[2];
  15958. }
  15959. if (type === 'http') {
  15960. return '80';
  15961. }
  15962. return '443';
  15963. }
  15964. return '';
  15965. }
  15966. function getDomainFromUrl(url) {
  15967. if (url && url.match) {
  15968. var groups = url.match(/^https?:\/\/([^:^/]*)/);
  15969. return groups ? groups[1] : '';
  15970. }
  15971. return '';
  15972. }
  15973. function getPutPolicy(token) {
  15974. if (!token) throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'invalid token.');
  15975. var segments = token.split(':');
  15976. if (segments.length === 1) throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'invalid token segments.');
  15977. // token 构造的差异参考:https://github.com/qbox/product/blob/master/kodo/auths/UpToken.md#admin-uptoken-authorization
  15978. var assessKey = segments.length > 3 ? segments[1] : segments[0];
  15979. if (!assessKey) throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'missing assess key field.');
  15980. var putPolicy = null;
  15981. try {
  15982. putPolicy = JSON.parse((0, _base.urlSafeBase64Decode)(segments[segments.length - 1]));
  15983. } catch (error) {
  15984. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'token parse failed.');
  15985. }
  15986. if (putPolicy == null) {
  15987. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'putPolicy is null.');
  15988. }
  15989. if (putPolicy.scope == null) {
  15990. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'scope field is null.');
  15991. }
  15992. var bucketName = putPolicy.scope.split(':')[0];
  15993. if (!bucketName) {
  15994. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidToken, 'resolve bucketName failed.');
  15995. }
  15996. return {
  15997. assessKey: assessKey,
  15998. bucketName: bucketName,
  15999. scope: putPolicy.scope
  16000. };
  16001. }
  16002. function createObjectURL(file) {
  16003. var URL = window.URL || window.webkitURL || window.mozURL;
  16004. // FIXME: 需要 revokeObjectURL
  16005. return URL.createObjectURL(file);
  16006. }
  16007. /***/ }),
  16008. /***/ 83:
  16009. /*!*************************************************************!*\
  16010. !*** D:/工作/项目2/亲家母/qjm/node_modules/spark-md5/spark-md5.js ***!
  16011. \*************************************************************/
  16012. /*! no static exports found */
  16013. /***/ (function(module, exports, __webpack_require__) {
  16014. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  16015. (function (factory) {
  16016. if (( false ? undefined : _typeof(exports)) === 'object') {
  16017. // Node/CommonJS
  16018. module.exports = factory();
  16019. } else if (true) {
  16020. // AMD
  16021. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  16022. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  16023. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  16024. __WEBPACK_AMD_DEFINE_FACTORY__),
  16025. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  16026. } else { var glob; }
  16027. })(function (undefined) {
  16028. 'use strict';
  16029. /*
  16030. * Fastest md5 implementation around (JKM md5).
  16031. * Credits: Joseph Myers
  16032. *
  16033. * @see http://www.myersdaily.org/joseph/javascript/md5-text.html
  16034. * @see http://jsperf.com/md5-shootout/7
  16035. */
  16036. /* this function is much faster,
  16037. so if possible we use it. Some IEs
  16038. are the only ones I know of that
  16039. need the idiotic second function,
  16040. generated by an if clause. */
  16041. var add32 = function add32(a, b) {
  16042. return a + b & 0xFFFFFFFF;
  16043. },
  16044. hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
  16045. function cmn(q, a, b, x, s, t) {
  16046. a = add32(add32(a, q), add32(x, t));
  16047. return add32(a << s | a >>> 32 - s, b);
  16048. }
  16049. function md5cycle(x, k) {
  16050. var a = x[0],
  16051. b = x[1],
  16052. c = x[2],
  16053. d = x[3];
  16054. a += (b & c | ~b & d) + k[0] - 680876936 | 0;
  16055. a = (a << 7 | a >>> 25) + b | 0;
  16056. d += (a & b | ~a & c) + k[1] - 389564586 | 0;
  16057. d = (d << 12 | d >>> 20) + a | 0;
  16058. c += (d & a | ~d & b) + k[2] + 606105819 | 0;
  16059. c = (c << 17 | c >>> 15) + d | 0;
  16060. b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
  16061. b = (b << 22 | b >>> 10) + c | 0;
  16062. a += (b & c | ~b & d) + k[4] - 176418897 | 0;
  16063. a = (a << 7 | a >>> 25) + b | 0;
  16064. d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
  16065. d = (d << 12 | d >>> 20) + a | 0;
  16066. c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
  16067. c = (c << 17 | c >>> 15) + d | 0;
  16068. b += (c & d | ~c & a) + k[7] - 45705983 | 0;
  16069. b = (b << 22 | b >>> 10) + c | 0;
  16070. a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
  16071. a = (a << 7 | a >>> 25) + b | 0;
  16072. d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
  16073. d = (d << 12 | d >>> 20) + a | 0;
  16074. c += (d & a | ~d & b) + k[10] - 42063 | 0;
  16075. c = (c << 17 | c >>> 15) + d | 0;
  16076. b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
  16077. b = (b << 22 | b >>> 10) + c | 0;
  16078. a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
  16079. a = (a << 7 | a >>> 25) + b | 0;
  16080. d += (a & b | ~a & c) + k[13] - 40341101 | 0;
  16081. d = (d << 12 | d >>> 20) + a | 0;
  16082. c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
  16083. c = (c << 17 | c >>> 15) + d | 0;
  16084. b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
  16085. b = (b << 22 | b >>> 10) + c | 0;
  16086. a += (b & d | c & ~d) + k[1] - 165796510 | 0;
  16087. a = (a << 5 | a >>> 27) + b | 0;
  16088. d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
  16089. d = (d << 9 | d >>> 23) + a | 0;
  16090. c += (d & b | a & ~b) + k[11] + 643717713 | 0;
  16091. c = (c << 14 | c >>> 18) + d | 0;
  16092. b += (c & a | d & ~a) + k[0] - 373897302 | 0;
  16093. b = (b << 20 | b >>> 12) + c | 0;
  16094. a += (b & d | c & ~d) + k[5] - 701558691 | 0;
  16095. a = (a << 5 | a >>> 27) + b | 0;
  16096. d += (a & c | b & ~c) + k[10] + 38016083 | 0;
  16097. d = (d << 9 | d >>> 23) + a | 0;
  16098. c += (d & b | a & ~b) + k[15] - 660478335 | 0;
  16099. c = (c << 14 | c >>> 18) + d | 0;
  16100. b += (c & a | d & ~a) + k[4] - 405537848 | 0;
  16101. b = (b << 20 | b >>> 12) + c | 0;
  16102. a += (b & d | c & ~d) + k[9] + 568446438 | 0;
  16103. a = (a << 5 | a >>> 27) + b | 0;
  16104. d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
  16105. d = (d << 9 | d >>> 23) + a | 0;
  16106. c += (d & b | a & ~b) + k[3] - 187363961 | 0;
  16107. c = (c << 14 | c >>> 18) + d | 0;
  16108. b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
  16109. b = (b << 20 | b >>> 12) + c | 0;
  16110. a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
  16111. a = (a << 5 | a >>> 27) + b | 0;
  16112. d += (a & c | b & ~c) + k[2] - 51403784 | 0;
  16113. d = (d << 9 | d >>> 23) + a | 0;
  16114. c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
  16115. c = (c << 14 | c >>> 18) + d | 0;
  16116. b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
  16117. b = (b << 20 | b >>> 12) + c | 0;
  16118. a += (b ^ c ^ d) + k[5] - 378558 | 0;
  16119. a = (a << 4 | a >>> 28) + b | 0;
  16120. d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
  16121. d = (d << 11 | d >>> 21) + a | 0;
  16122. c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
  16123. c = (c << 16 | c >>> 16) + d | 0;
  16124. b += (c ^ d ^ a) + k[14] - 35309556 | 0;
  16125. b = (b << 23 | b >>> 9) + c | 0;
  16126. a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
  16127. a = (a << 4 | a >>> 28) + b | 0;
  16128. d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
  16129. d = (d << 11 | d >>> 21) + a | 0;
  16130. c += (d ^ a ^ b) + k[7] - 155497632 | 0;
  16131. c = (c << 16 | c >>> 16) + d | 0;
  16132. b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
  16133. b = (b << 23 | b >>> 9) + c | 0;
  16134. a += (b ^ c ^ d) + k[13] + 681279174 | 0;
  16135. a = (a << 4 | a >>> 28) + b | 0;
  16136. d += (a ^ b ^ c) + k[0] - 358537222 | 0;
  16137. d = (d << 11 | d >>> 21) + a | 0;
  16138. c += (d ^ a ^ b) + k[3] - 722521979 | 0;
  16139. c = (c << 16 | c >>> 16) + d | 0;
  16140. b += (c ^ d ^ a) + k[6] + 76029189 | 0;
  16141. b = (b << 23 | b >>> 9) + c | 0;
  16142. a += (b ^ c ^ d) + k[9] - 640364487 | 0;
  16143. a = (a << 4 | a >>> 28) + b | 0;
  16144. d += (a ^ b ^ c) + k[12] - 421815835 | 0;
  16145. d = (d << 11 | d >>> 21) + a | 0;
  16146. c += (d ^ a ^ b) + k[15] + 530742520 | 0;
  16147. c = (c << 16 | c >>> 16) + d | 0;
  16148. b += (c ^ d ^ a) + k[2] - 995338651 | 0;
  16149. b = (b << 23 | b >>> 9) + c | 0;
  16150. a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
  16151. a = (a << 6 | a >>> 26) + b | 0;
  16152. d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
  16153. d = (d << 10 | d >>> 22) + a | 0;
  16154. c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
  16155. c = (c << 15 | c >>> 17) + d | 0;
  16156. b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
  16157. b = (b << 21 | b >>> 11) + c | 0;
  16158. a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
  16159. a = (a << 6 | a >>> 26) + b | 0;
  16160. d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
  16161. d = (d << 10 | d >>> 22) + a | 0;
  16162. c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
  16163. c = (c << 15 | c >>> 17) + d | 0;
  16164. b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
  16165. b = (b << 21 | b >>> 11) + c | 0;
  16166. a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
  16167. a = (a << 6 | a >>> 26) + b | 0;
  16168. d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
  16169. d = (d << 10 | d >>> 22) + a | 0;
  16170. c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
  16171. c = (c << 15 | c >>> 17) + d | 0;
  16172. b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
  16173. b = (b << 21 | b >>> 11) + c | 0;
  16174. a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
  16175. a = (a << 6 | a >>> 26) + b | 0;
  16176. d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
  16177. d = (d << 10 | d >>> 22) + a | 0;
  16178. c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
  16179. c = (c << 15 | c >>> 17) + d | 0;
  16180. b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
  16181. b = (b << 21 | b >>> 11) + c | 0;
  16182. x[0] = a + x[0] | 0;
  16183. x[1] = b + x[1] | 0;
  16184. x[2] = c + x[2] | 0;
  16185. x[3] = d + x[3] | 0;
  16186. }
  16187. function md5blk(s) {
  16188. var md5blks = [],
  16189. i; /* Andy King said do it this way. */
  16190. for (i = 0; i < 64; i += 4) {
  16191. md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
  16192. }
  16193. return md5blks;
  16194. }
  16195. function md5blk_array(a) {
  16196. var md5blks = [],
  16197. i; /* Andy King said do it this way. */
  16198. for (i = 0; i < 64; i += 4) {
  16199. md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
  16200. }
  16201. return md5blks;
  16202. }
  16203. function md51(s) {
  16204. var n = s.length,
  16205. state = [1732584193, -271733879, -1732584194, 271733878],
  16206. i,
  16207. length,
  16208. tail,
  16209. tmp,
  16210. lo,
  16211. hi;
  16212. for (i = 64; i <= n; i += 64) {
  16213. md5cycle(state, md5blk(s.substring(i - 64, i)));
  16214. }
  16215. s = s.substring(i - 64);
  16216. length = s.length;
  16217. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  16218. for (i = 0; i < length; i += 1) {
  16219. tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
  16220. }
  16221. tail[i >> 2] |= 0x80 << (i % 4 << 3);
  16222. if (i > 55) {
  16223. md5cycle(state, tail);
  16224. for (i = 0; i < 16; i += 1) {
  16225. tail[i] = 0;
  16226. }
  16227. }
  16228. // Beware that the final length might not fit in 32 bits so we take care of that
  16229. tmp = n * 8;
  16230. tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
  16231. lo = parseInt(tmp[2], 16);
  16232. hi = parseInt(tmp[1], 16) || 0;
  16233. tail[14] = lo;
  16234. tail[15] = hi;
  16235. md5cycle(state, tail);
  16236. return state;
  16237. }
  16238. function md51_array(a) {
  16239. var n = a.length,
  16240. state = [1732584193, -271733879, -1732584194, 271733878],
  16241. i,
  16242. length,
  16243. tail,
  16244. tmp,
  16245. lo,
  16246. hi;
  16247. for (i = 64; i <= n; i += 64) {
  16248. md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
  16249. }
  16250. // Not sure if it is a bug, however IE10 will always produce a sub array of length 1
  16251. // containing the last element of the parent array if the sub array specified starts
  16252. // beyond the length of the parent array - weird.
  16253. // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
  16254. a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);
  16255. length = a.length;
  16256. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  16257. for (i = 0; i < length; i += 1) {
  16258. tail[i >> 2] |= a[i] << (i % 4 << 3);
  16259. }
  16260. tail[i >> 2] |= 0x80 << (i % 4 << 3);
  16261. if (i > 55) {
  16262. md5cycle(state, tail);
  16263. for (i = 0; i < 16; i += 1) {
  16264. tail[i] = 0;
  16265. }
  16266. }
  16267. // Beware that the final length might not fit in 32 bits so we take care of that
  16268. tmp = n * 8;
  16269. tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
  16270. lo = parseInt(tmp[2], 16);
  16271. hi = parseInt(tmp[1], 16) || 0;
  16272. tail[14] = lo;
  16273. tail[15] = hi;
  16274. md5cycle(state, tail);
  16275. return state;
  16276. }
  16277. function rhex(n) {
  16278. var s = '',
  16279. j;
  16280. for (j = 0; j < 4; j += 1) {
  16281. s += hex_chr[n >> j * 8 + 4 & 0x0F] + hex_chr[n >> j * 8 & 0x0F];
  16282. }
  16283. return s;
  16284. }
  16285. function hex(x) {
  16286. var i;
  16287. for (i = 0; i < x.length; i += 1) {
  16288. x[i] = rhex(x[i]);
  16289. }
  16290. return x.join('');
  16291. }
  16292. // In some cases the fast add32 function cannot be used..
  16293. if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {
  16294. add32 = function add32(x, y) {
  16295. var lsw = (x & 0xFFFF) + (y & 0xFFFF),
  16296. msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  16297. return msw << 16 | lsw & 0xFFFF;
  16298. };
  16299. }
  16300. // ---------------------------------------------------
  16301. /**
  16302. * ArrayBuffer slice polyfill.
  16303. *
  16304. * @see https://github.com/ttaubert/node-arraybuffer-slice
  16305. */
  16306. if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {
  16307. (function () {
  16308. function clamp(val, length) {
  16309. val = val | 0 || 0;
  16310. if (val < 0) {
  16311. return Math.max(val + length, 0);
  16312. }
  16313. return Math.min(val, length);
  16314. }
  16315. ArrayBuffer.prototype.slice = function (from, to) {
  16316. var length = this.byteLength,
  16317. begin = clamp(from, length),
  16318. end = length,
  16319. num,
  16320. target,
  16321. targetArray,
  16322. sourceArray;
  16323. if (to !== undefined) {
  16324. end = clamp(to, length);
  16325. }
  16326. if (begin > end) {
  16327. return new ArrayBuffer(0);
  16328. }
  16329. num = end - begin;
  16330. target = new ArrayBuffer(num);
  16331. targetArray = new Uint8Array(target);
  16332. sourceArray = new Uint8Array(this, begin, num);
  16333. targetArray.set(sourceArray);
  16334. return target;
  16335. };
  16336. })();
  16337. }
  16338. // ---------------------------------------------------
  16339. /**
  16340. * Helpers.
  16341. */
  16342. function toUtf8(str) {
  16343. if (/[\u0080-\uFFFF]/.test(str)) {
  16344. str = unescape(encodeURIComponent(str));
  16345. }
  16346. return str;
  16347. }
  16348. function utf8Str2ArrayBuffer(str, returnUInt8Array) {
  16349. var length = str.length,
  16350. buff = new ArrayBuffer(length),
  16351. arr = new Uint8Array(buff),
  16352. i;
  16353. for (i = 0; i < length; i += 1) {
  16354. arr[i] = str.charCodeAt(i);
  16355. }
  16356. return returnUInt8Array ? arr : buff;
  16357. }
  16358. function arrayBuffer2Utf8Str(buff) {
  16359. return String.fromCharCode.apply(null, new Uint8Array(buff));
  16360. }
  16361. function concatenateArrayBuffers(first, second, returnUInt8Array) {
  16362. var result = new Uint8Array(first.byteLength + second.byteLength);
  16363. result.set(new Uint8Array(first));
  16364. result.set(new Uint8Array(second), first.byteLength);
  16365. return returnUInt8Array ? result : result.buffer;
  16366. }
  16367. function hexToBinaryString(hex) {
  16368. var bytes = [],
  16369. length = hex.length,
  16370. x;
  16371. for (x = 0; x < length - 1; x += 2) {
  16372. bytes.push(parseInt(hex.substr(x, 2), 16));
  16373. }
  16374. return String.fromCharCode.apply(String, bytes);
  16375. }
  16376. // ---------------------------------------------------
  16377. /**
  16378. * SparkMD5 OOP implementation.
  16379. *
  16380. * Use this class to perform an incremental md5, otherwise use the
  16381. * static methods instead.
  16382. */
  16383. function SparkMD5() {
  16384. // call reset to init the instance
  16385. this.reset();
  16386. }
  16387. /**
  16388. * Appends a string.
  16389. * A conversion will be applied if an utf8 string is detected.
  16390. *
  16391. * @param {String} str The string to be appended
  16392. *
  16393. * @return {SparkMD5} The instance itself
  16394. */
  16395. SparkMD5.prototype.append = function (str) {
  16396. // Converts the string to utf8 bytes if necessary
  16397. // Then append as binary
  16398. this.appendBinary(toUtf8(str));
  16399. return this;
  16400. };
  16401. /**
  16402. * Appends a binary string.
  16403. *
  16404. * @param {String} contents The binary string to be appended
  16405. *
  16406. * @return {SparkMD5} The instance itself
  16407. */
  16408. SparkMD5.prototype.appendBinary = function (contents) {
  16409. this._buff += contents;
  16410. this._length += contents.length;
  16411. var length = this._buff.length,
  16412. i;
  16413. for (i = 64; i <= length; i += 64) {
  16414. md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
  16415. }
  16416. this._buff = this._buff.substring(i - 64);
  16417. return this;
  16418. };
  16419. /**
  16420. * Finishes the incremental computation, reseting the internal state and
  16421. * returning the result.
  16422. *
  16423. * @param {Boolean} raw True to get the raw string, false to get the hex string
  16424. *
  16425. * @return {String} The result
  16426. */
  16427. SparkMD5.prototype.end = function (raw) {
  16428. var buff = this._buff,
  16429. length = buff.length,
  16430. i,
  16431. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  16432. ret;
  16433. for (i = 0; i < length; i += 1) {
  16434. tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);
  16435. }
  16436. this._finish(tail, length);
  16437. ret = hex(this._hash);
  16438. if (raw) {
  16439. ret = hexToBinaryString(ret);
  16440. }
  16441. this.reset();
  16442. return ret;
  16443. };
  16444. /**
  16445. * Resets the internal state of the computation.
  16446. *
  16447. * @return {SparkMD5} The instance itself
  16448. */
  16449. SparkMD5.prototype.reset = function () {
  16450. this._buff = '';
  16451. this._length = 0;
  16452. this._hash = [1732584193, -271733879, -1732584194, 271733878];
  16453. return this;
  16454. };
  16455. /**
  16456. * Gets the internal state of the computation.
  16457. *
  16458. * @return {Object} The state
  16459. */
  16460. SparkMD5.prototype.getState = function () {
  16461. return {
  16462. buff: this._buff,
  16463. length: this._length,
  16464. hash: this._hash.slice()
  16465. };
  16466. };
  16467. /**
  16468. * Gets the internal state of the computation.
  16469. *
  16470. * @param {Object} state The state
  16471. *
  16472. * @return {SparkMD5} The instance itself
  16473. */
  16474. SparkMD5.prototype.setState = function (state) {
  16475. this._buff = state.buff;
  16476. this._length = state.length;
  16477. this._hash = state.hash;
  16478. return this;
  16479. };
  16480. /**
  16481. * Releases memory used by the incremental buffer and other additional
  16482. * resources. If you plan to use the instance again, use reset instead.
  16483. */
  16484. SparkMD5.prototype.destroy = function () {
  16485. delete this._hash;
  16486. delete this._buff;
  16487. delete this._length;
  16488. };
  16489. /**
  16490. * Finish the final calculation based on the tail.
  16491. *
  16492. * @param {Array} tail The tail (will be modified)
  16493. * @param {Number} length The length of the remaining buffer
  16494. */
  16495. SparkMD5.prototype._finish = function (tail, length) {
  16496. var i = length,
  16497. tmp,
  16498. lo,
  16499. hi;
  16500. tail[i >> 2] |= 0x80 << (i % 4 << 3);
  16501. if (i > 55) {
  16502. md5cycle(this._hash, tail);
  16503. for (i = 0; i < 16; i += 1) {
  16504. tail[i] = 0;
  16505. }
  16506. }
  16507. // Do the final computation based on the tail and length
  16508. // Beware that the final length may not fit in 32 bits so we take care of that
  16509. tmp = this._length * 8;
  16510. tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
  16511. lo = parseInt(tmp[2], 16);
  16512. hi = parseInt(tmp[1], 16) || 0;
  16513. tail[14] = lo;
  16514. tail[15] = hi;
  16515. md5cycle(this._hash, tail);
  16516. };
  16517. /**
  16518. * Performs the md5 hash on a string.
  16519. * A conversion will be applied if utf8 string is detected.
  16520. *
  16521. * @param {String} str The string
  16522. * @param {Boolean} [raw] True to get the raw string, false to get the hex string
  16523. *
  16524. * @return {String} The result
  16525. */
  16526. SparkMD5.hash = function (str, raw) {
  16527. // Converts the string to utf8 bytes if necessary
  16528. // Then compute it using the binary function
  16529. return SparkMD5.hashBinary(toUtf8(str), raw);
  16530. };
  16531. /**
  16532. * Performs the md5 hash on a binary string.
  16533. *
  16534. * @param {String} content The binary string
  16535. * @param {Boolean} [raw] True to get the raw string, false to get the hex string
  16536. *
  16537. * @return {String} The result
  16538. */
  16539. SparkMD5.hashBinary = function (content, raw) {
  16540. var hash = md51(content),
  16541. ret = hex(hash);
  16542. return raw ? hexToBinaryString(ret) : ret;
  16543. };
  16544. // ---------------------------------------------------
  16545. /**
  16546. * SparkMD5 OOP implementation for array buffers.
  16547. *
  16548. * Use this class to perform an incremental md5 ONLY for array buffers.
  16549. */
  16550. SparkMD5.ArrayBuffer = function () {
  16551. // call reset to init the instance
  16552. this.reset();
  16553. };
  16554. /**
  16555. * Appends an array buffer.
  16556. *
  16557. * @param {ArrayBuffer} arr The array to be appended
  16558. *
  16559. * @return {SparkMD5.ArrayBuffer} The instance itself
  16560. */
  16561. SparkMD5.ArrayBuffer.prototype.append = function (arr) {
  16562. var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),
  16563. length = buff.length,
  16564. i;
  16565. this._length += arr.byteLength;
  16566. for (i = 64; i <= length; i += 64) {
  16567. md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
  16568. }
  16569. this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);
  16570. return this;
  16571. };
  16572. /**
  16573. * Finishes the incremental computation, reseting the internal state and
  16574. * returning the result.
  16575. *
  16576. * @param {Boolean} raw True to get the raw string, false to get the hex string
  16577. *
  16578. * @return {String} The result
  16579. */
  16580. SparkMD5.ArrayBuffer.prototype.end = function (raw) {
  16581. var buff = this._buff,
  16582. length = buff.length,
  16583. tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  16584. i,
  16585. ret;
  16586. for (i = 0; i < length; i += 1) {
  16587. tail[i >> 2] |= buff[i] << (i % 4 << 3);
  16588. }
  16589. this._finish(tail, length);
  16590. ret = hex(this._hash);
  16591. if (raw) {
  16592. ret = hexToBinaryString(ret);
  16593. }
  16594. this.reset();
  16595. return ret;
  16596. };
  16597. /**
  16598. * Resets the internal state of the computation.
  16599. *
  16600. * @return {SparkMD5.ArrayBuffer} The instance itself
  16601. */
  16602. SparkMD5.ArrayBuffer.prototype.reset = function () {
  16603. this._buff = new Uint8Array(0);
  16604. this._length = 0;
  16605. this._hash = [1732584193, -271733879, -1732584194, 271733878];
  16606. return this;
  16607. };
  16608. /**
  16609. * Gets the internal state of the computation.
  16610. *
  16611. * @return {Object} The state
  16612. */
  16613. SparkMD5.ArrayBuffer.prototype.getState = function () {
  16614. var state = SparkMD5.prototype.getState.call(this);
  16615. // Convert buffer to a string
  16616. state.buff = arrayBuffer2Utf8Str(state.buff);
  16617. return state;
  16618. };
  16619. /**
  16620. * Gets the internal state of the computation.
  16621. *
  16622. * @param {Object} state The state
  16623. *
  16624. * @return {SparkMD5.ArrayBuffer} The instance itself
  16625. */
  16626. SparkMD5.ArrayBuffer.prototype.setState = function (state) {
  16627. // Convert string to buffer
  16628. state.buff = utf8Str2ArrayBuffer(state.buff, true);
  16629. return SparkMD5.prototype.setState.call(this, state);
  16630. };
  16631. SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
  16632. SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
  16633. /**
  16634. * Performs the md5 hash on an array buffer.
  16635. *
  16636. * @param {ArrayBuffer} arr The array buffer
  16637. * @param {Boolean} [raw] True to get the raw string, false to get the hex one
  16638. *
  16639. * @return {String} The result
  16640. */
  16641. SparkMD5.ArrayBuffer.hash = function (arr, raw) {
  16642. var hash = md51_array(new Uint8Array(arr)),
  16643. ret = hex(hash);
  16644. return raw ? hexToBinaryString(ret) : ret;
  16645. };
  16646. return SparkMD5;
  16647. });
  16648. /***/ }),
  16649. /***/ 84:
  16650. /*!*******************************************************************!*\
  16651. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/config.js ***!
  16652. \*******************************************************************/
  16653. /*! no static exports found */
  16654. /***/ (function(module, exports, __webpack_require__) {
  16655. "use strict";
  16656. Object.defineProperty(exports, "__esModule", {
  16657. value: true
  16658. });
  16659. exports.normalizeUploadConfig = normalizeUploadConfig;
  16660. var _config = __webpack_require__(/*! ../config */ 85);
  16661. var _upload = __webpack_require__(/*! ../upload */ 87);
  16662. var __assign = void 0 && (void 0).__assign || function () {
  16663. __assign = Object.assign || function (t) {
  16664. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16665. s = arguments[i];
  16666. for (var p in s) {
  16667. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16668. }
  16669. }
  16670. return t;
  16671. };
  16672. return __assign.apply(this, arguments);
  16673. };
  16674. var __rest = void 0 && (void 0).__rest || function (s, e) {
  16675. var t = {};
  16676. for (var p in s) {
  16677. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  16678. }
  16679. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  16680. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  16681. }
  16682. return t;
  16683. };
  16684. var __read = void 0 && (void 0).__read || function (o, n) {
  16685. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16686. if (!m) return o;
  16687. var i = m.call(o),
  16688. r,
  16689. ar = [],
  16690. e;
  16691. try {
  16692. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  16693. ar.push(r.value);
  16694. }
  16695. } catch (error) {
  16696. e = {
  16697. error: error
  16698. };
  16699. } finally {
  16700. try {
  16701. if (r && !r.done && (m = i["return"])) m.call(i);
  16702. } finally {
  16703. if (e) throw e.error;
  16704. }
  16705. }
  16706. return ar;
  16707. };
  16708. var __spread = void 0 && (void 0).__spread || function () {
  16709. for (var ar = [], i = 0; i < arguments.length; i++) {
  16710. ar = ar.concat(__read(arguments[i]));
  16711. }
  16712. return ar;
  16713. };
  16714. function normalizeUploadConfig(config, logger) {
  16715. var _a = __assign({}, config),
  16716. upprotocol = _a.upprotocol,
  16717. uphost = _a.uphost,
  16718. otherConfig = __rest(_a, ["upprotocol", "uphost"]);
  16719. var normalizeConfig = __assign({
  16720. uphost: [],
  16721. retryCount: 3,
  16722. checkByMD5: false,
  16723. forceDirect: false,
  16724. useCdnDomain: true,
  16725. checkByServer: false,
  16726. concurrentRequestLimit: 3,
  16727. chunkSize: _upload.DEFAULT_CHUNK_SIZE,
  16728. upprotocol: 'https',
  16729. debugLogLevel: 'OFF',
  16730. disableStatisticsReport: false
  16731. }, otherConfig);
  16732. // 兼容原来的 http: https: 的写法
  16733. if (upprotocol) {
  16734. normalizeConfig.upprotocol = upprotocol.replace(/:$/, '');
  16735. }
  16736. var hostList = [];
  16737. if (logger && (config === null || config === void 0 ? void 0 : config.uphost) != null && (config === null || config === void 0 ? void 0 : config.region) != null) {
  16738. logger.warn('do not use both the uphost and region config.');
  16739. }
  16740. // 如果同时指定了 uphost 参数,添加到可用 host 列表
  16741. if (uphost) {
  16742. if (Array.isArray(uphost)) {
  16743. hostList.push.apply(hostList, __spread(uphost));
  16744. } else {
  16745. hostList.push(uphost);
  16746. }
  16747. // 否则如果用户传了 region,添加指定 region 的 host 到可用 host 列表
  16748. } else if (normalizeConfig === null || normalizeConfig === void 0 ? void 0 : normalizeConfig.region) {
  16749. var hostMap = _config.regionUphostMap[normalizeConfig === null || normalizeConfig === void 0 ? void 0 : normalizeConfig.region];
  16750. if (normalizeConfig.useCdnDomain) {
  16751. hostList.push.apply(hostList, __spread(hostMap.cdnUphost));
  16752. } else {
  16753. hostList.push.apply(hostList, __spread(hostMap.srcUphost));
  16754. }
  16755. }
  16756. return __assign(__assign({}, normalizeConfig), {
  16757. uphost: hostList.filter(Boolean)
  16758. });
  16759. }
  16760. /***/ }),
  16761. /***/ 85:
  16762. /*!*******************************************************************!*\
  16763. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/config/index.js ***!
  16764. \*******************************************************************/
  16765. /*! no static exports found */
  16766. /***/ (function(module, exports, __webpack_require__) {
  16767. "use strict";
  16768. Object.defineProperty(exports, "__esModule", {
  16769. value: true
  16770. });
  16771. var _region = __webpack_require__(/*! ./region */ 86);
  16772. Object.keys(_region).forEach(function (key) {
  16773. if (key === "default" || key === "__esModule") return;
  16774. if (key in exports && exports[key] === _region[key]) return;
  16775. Object.defineProperty(exports, key, {
  16776. enumerable: true,
  16777. get: function get() {
  16778. return _region[key];
  16779. }
  16780. });
  16781. });
  16782. /***/ }),
  16783. /***/ 86:
  16784. /*!********************************************************************!*\
  16785. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/config/region.js ***!
  16786. \********************************************************************/
  16787. /*! no static exports found */
  16788. /***/ (function(module, exports, __webpack_require__) {
  16789. "use strict";
  16790. Object.defineProperty(exports, "__esModule", {
  16791. value: true
  16792. });
  16793. exports.regionUphostMap = exports.region = void 0;
  16794. var _a;
  16795. /** 上传区域 */
  16796. var region = {
  16797. z0: 'z0',
  16798. z1: 'z1',
  16799. z2: 'z2',
  16800. na0: 'na0',
  16801. as0: 'as0',
  16802. cnEast2: 'cn-east-2'
  16803. };
  16804. /** 上传区域对应的 host */
  16805. exports.region = region;
  16806. var regionUphostMap = (_a = {}, _a[region.z0] = {
  16807. srcUphost: ['up.qiniup.com'],
  16808. cdnUphost: ['upload.qiniup.com']
  16809. }, _a[region.z1] = {
  16810. srcUphost: ['up-z1.qiniup.com'],
  16811. cdnUphost: ['upload-z1.qiniup.com']
  16812. }, _a[region.z2] = {
  16813. srcUphost: ['up-z2.qiniup.com'],
  16814. cdnUphost: ['upload-z2.qiniup.com']
  16815. }, _a[region.na0] = {
  16816. srcUphost: ['up-na0.qiniup.com'],
  16817. cdnUphost: ['upload-na0.qiniup.com']
  16818. }, _a[region.as0] = {
  16819. srcUphost: ['up-as0.qiniup.com'],
  16820. cdnUphost: ['upload-as0.qiniup.com']
  16821. }, _a[region.cnEast2] = {
  16822. srcUphost: ['up-cn-east-2.qiniup.com'],
  16823. cdnUphost: ['upload-cn-east-2.qiniup.com']
  16824. }, _a);
  16825. exports.regionUphostMap = regionUphostMap;
  16826. /***/ }),
  16827. /***/ 87:
  16828. /*!*******************************************************************!*\
  16829. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/index.js ***!
  16830. \*******************************************************************/
  16831. /*! no static exports found */
  16832. /***/ (function(module, exports, __webpack_require__) {
  16833. "use strict";
  16834. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16835. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  16836. Object.defineProperty(exports, "__esModule", {
  16837. value: true
  16838. });
  16839. var _exportNames = {
  16840. createUploadManager: true
  16841. };
  16842. exports.createUploadManager = createUploadManager;
  16843. exports.default = upload;
  16844. var _resume = _interopRequireWildcard(__webpack_require__(/*! ./resume */ 88));
  16845. Object.keys(_resume).forEach(function (key) {
  16846. if (key === "default" || key === "__esModule") return;
  16847. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16848. if (key in exports && exports[key] === _resume[key]) return;
  16849. Object.defineProperty(exports, key, {
  16850. enumerable: true,
  16851. get: function get() {
  16852. return _resume[key];
  16853. }
  16854. });
  16855. });
  16856. var _direct = _interopRequireDefault(__webpack_require__(/*! ./direct */ 94));
  16857. var _logger = _interopRequireDefault(__webpack_require__(/*! ../logger */ 96));
  16858. var _utils = __webpack_require__(/*! ../utils */ 78);
  16859. var _hosts = __webpack_require__(/*! ./hosts */ 98);
  16860. var _base = __webpack_require__(/*! ./base */ 93);
  16861. Object.keys(_base).forEach(function (key) {
  16862. if (key === "default" || key === "__esModule") return;
  16863. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16864. if (key in exports && exports[key] === _base[key]) return;
  16865. Object.defineProperty(exports, key, {
  16866. enumerable: true,
  16867. get: function get() {
  16868. return _base[key];
  16869. }
  16870. });
  16871. });
  16872. 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); }
  16873. 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; }
  16874. function createUploadManager(options, handlers, hostPool, logger) {
  16875. if (options.config && options.config.forceDirect) {
  16876. logger.info('ues forceDirect mode.');
  16877. return new _direct.default(options, handlers, hostPool, logger);
  16878. }
  16879. if (options.file.size > 4 * _utils.MB) {
  16880. logger.info('file size over 4M, use Resume.');
  16881. return new _resume.default(options, handlers, hostPool, logger);
  16882. }
  16883. logger.info('file size less or equal than 4M, use Direct.');
  16884. return new _direct.default(options, handlers, hostPool, logger);
  16885. }
  16886. /**
  16887. * @param file 上传文件
  16888. * @param key 目标文件名
  16889. * @param token 上传凭证
  16890. * @param putExtra 上传文件的相关资源信息配置
  16891. * @param config 上传任务的配置
  16892. * @returns 返回用于上传任务的可观察对象
  16893. */
  16894. function upload(file, key, token, putExtra, config) {
  16895. // 为每个任务创建单独的 Logger
  16896. 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);
  16897. var options = {
  16898. file: file,
  16899. key: key,
  16900. token: token,
  16901. putExtra: putExtra,
  16902. config: (0, _utils.normalizeUploadConfig)(config, logger)
  16903. };
  16904. // 创建 host 池
  16905. var hostPool = new _hosts.HostPool(options.config.uphost);
  16906. return new _utils.Observable(function (observer) {
  16907. var manager = createUploadManager(options, {
  16908. onData: function onData(data) {
  16909. return observer.next(data);
  16910. },
  16911. onError: function onError(err) {
  16912. return observer.error(err);
  16913. },
  16914. onComplete: function onComplete(res) {
  16915. return observer.complete(res);
  16916. }
  16917. }, hostPool, logger);
  16918. manager.putFile();
  16919. return manager.stop.bind(manager);
  16920. });
  16921. }
  16922. /***/ }),
  16923. /***/ 88:
  16924. /*!********************************************************************!*\
  16925. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/resume.js ***!
  16926. \********************************************************************/
  16927. /*! no static exports found */
  16928. /***/ (function(module, exports, __webpack_require__) {
  16929. "use strict";
  16930. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16931. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  16932. Object.defineProperty(exports, "__esModule", {
  16933. value: true
  16934. });
  16935. exports.default = void 0;
  16936. var _api = __webpack_require__(/*! ../api */ 89);
  16937. var _errors = __webpack_require__(/*! ../errors */ 76);
  16938. var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ 78));
  16939. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 93));
  16940. 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); }
  16941. 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; }
  16942. var __extends = void 0 && (void 0).__extends || function () {
  16943. var _extendStatics = function extendStatics(d, b) {
  16944. _extendStatics = Object.setPrototypeOf || {
  16945. __proto__: []
  16946. } instanceof Array && function (d, b) {
  16947. d.__proto__ = b;
  16948. } || function (d, b) {
  16949. for (var p in b) {
  16950. if (b.hasOwnProperty(p)) d[p] = b[p];
  16951. }
  16952. };
  16953. return _extendStatics(d, b);
  16954. };
  16955. return function (d, b) {
  16956. _extendStatics(d, b);
  16957. function __() {
  16958. this.constructor = d;
  16959. }
  16960. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16961. };
  16962. }();
  16963. var __assign = void 0 && (void 0).__assign || function () {
  16964. __assign = Object.assign || function (t) {
  16965. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16966. s = arguments[i];
  16967. for (var p in s) {
  16968. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16969. }
  16970. }
  16971. return t;
  16972. };
  16973. return __assign.apply(this, arguments);
  16974. };
  16975. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  16976. function adopt(value) {
  16977. return value instanceof P ? value : new P(function (resolve) {
  16978. resolve(value);
  16979. });
  16980. }
  16981. return new (P || (P = Promise))(function (resolve, reject) {
  16982. function fulfilled(value) {
  16983. try {
  16984. step(generator.next(value));
  16985. } catch (e) {
  16986. reject(e);
  16987. }
  16988. }
  16989. function rejected(value) {
  16990. try {
  16991. step(generator["throw"](value));
  16992. } catch (e) {
  16993. reject(e);
  16994. }
  16995. }
  16996. function step(result) {
  16997. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  16998. }
  16999. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17000. });
  17001. };
  17002. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  17003. var _ = {
  17004. label: 0,
  17005. sent: function sent() {
  17006. if (t[0] & 1) throw t[1];
  17007. return t[1];
  17008. },
  17009. trys: [],
  17010. ops: []
  17011. },
  17012. f,
  17013. y,
  17014. t,
  17015. g;
  17016. return g = {
  17017. next: verb(0),
  17018. "throw": verb(1),
  17019. "return": verb(2)
  17020. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  17021. return this;
  17022. }), g;
  17023. function verb(n) {
  17024. return function (v) {
  17025. return step([n, v]);
  17026. };
  17027. }
  17028. function step(op) {
  17029. if (f) throw new TypeError("Generator is already executing.");
  17030. while (_) {
  17031. try {
  17032. 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;
  17033. if (y = 0, t) op = [op[0] & 2, t.value];
  17034. switch (op[0]) {
  17035. case 0:
  17036. case 1:
  17037. t = op;
  17038. break;
  17039. case 4:
  17040. _.label++;
  17041. return {
  17042. value: op[1],
  17043. done: false
  17044. };
  17045. case 5:
  17046. _.label++;
  17047. y = op[1];
  17048. op = [0];
  17049. continue;
  17050. case 7:
  17051. op = _.ops.pop();
  17052. _.trys.pop();
  17053. continue;
  17054. default:
  17055. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  17056. _ = 0;
  17057. continue;
  17058. }
  17059. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  17060. _.label = op[1];
  17061. break;
  17062. }
  17063. if (op[0] === 6 && _.label < t[1]) {
  17064. _.label = t[1];
  17065. t = op;
  17066. break;
  17067. }
  17068. if (t && _.label < t[2]) {
  17069. _.label = t[2];
  17070. _.ops.push(op);
  17071. break;
  17072. }
  17073. if (t[2]) _.ops.pop();
  17074. _.trys.pop();
  17075. continue;
  17076. }
  17077. op = body.call(thisArg, _);
  17078. } catch (e) {
  17079. op = [6, e];
  17080. y = 0;
  17081. } finally {
  17082. f = t = 0;
  17083. }
  17084. }
  17085. if (op[0] & 5) throw op[1];
  17086. return {
  17087. value: op[0] ? op[1] : void 0,
  17088. done: true
  17089. };
  17090. }
  17091. };
  17092. /** 是否为正整数 */
  17093. function isPositiveInteger(n) {
  17094. var re = /^[1-9]\d*$/;
  17095. return re.test(String(n));
  17096. }
  17097. var Resume = /** @class */function (_super) {
  17098. __extends(Resume, _super);
  17099. function Resume() {
  17100. return _super !== null && _super.apply(this, arguments) || this;
  17101. }
  17102. /**
  17103. * @returns {Promise<ResponseSuccess<any>>}
  17104. * @description 实现了 Base 的 run 接口,处理具体的分片上传事务,并抛出过程中的异常。
  17105. */
  17106. Resume.prototype.run = function () {
  17107. return __awaiter(this, void 0, void 0, function () {
  17108. var pool, mkFileResponse, localKey, uploadChunks, error_1;
  17109. var _this = this;
  17110. return __generator(this, function (_a) {
  17111. switch (_a.label) {
  17112. case 0:
  17113. this.logger.info('start run Resume.');
  17114. if (!this.config.chunkSize || !isPositiveInteger(this.config.chunkSize)) {
  17115. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidChunkSize, 'chunkSize must be a positive integer');
  17116. }
  17117. if (this.config.chunkSize > 1024) {
  17118. throw new _errors.QiniuError(_errors.QiniuErrorName.InvalidChunkSize, 'chunkSize maximum value is 1024');
  17119. }
  17120. return [4 /*yield*/, this.initBeforeUploadChunks()];
  17121. case 1:
  17122. _a.sent();
  17123. pool = new utils.Pool(function (chunkInfo) {
  17124. return __awaiter(_this, void 0, void 0, function () {
  17125. return __generator(this, function (_a) {
  17126. switch (_a.label) {
  17127. case 0:
  17128. if (this.aborted) {
  17129. pool.abort();
  17130. throw new Error('pool is aborted');
  17131. }
  17132. return [4 /*yield*/, this.uploadChunk(chunkInfo)];
  17133. case 1:
  17134. _a.sent();
  17135. return [2 /*return*/];
  17136. }
  17137. });
  17138. });
  17139. }, this.config.concurrentRequestLimit);
  17140. mkFileResponse = null;
  17141. localKey = this.getLocalKey();
  17142. uploadChunks = this.chunks.map(function (chunk, index) {
  17143. return pool.enqueue({
  17144. chunk: chunk,
  17145. index: index
  17146. });
  17147. });
  17148. _a.label = 2;
  17149. case 2:
  17150. _a.trys.push([2, 5,, 6]);
  17151. return [4 /*yield*/, Promise.all(uploadChunks)];
  17152. case 3:
  17153. _a.sent();
  17154. return [4 /*yield*/, this.mkFileReq()];
  17155. case 4:
  17156. mkFileResponse = _a.sent();
  17157. return [3 /*break*/, 6];
  17158. case 5:
  17159. error_1 = _a.sent();
  17160. // uploadId 无效,上传参数有误(多由于本地存储信息的 uploadId 失效)
  17161. if (error_1 instanceof _errors.QiniuRequestError && (error_1.code === 612 || error_1.code === 400)) {
  17162. utils.removeLocalFileInfo(localKey, this.logger);
  17163. }
  17164. throw error_1;
  17165. case 6:
  17166. // 上传成功,清理本地缓存数据
  17167. utils.removeLocalFileInfo(localKey, this.logger);
  17168. return [2 /*return*/, mkFileResponse];
  17169. }
  17170. });
  17171. });
  17172. };
  17173. Resume.prototype.uploadChunk = function (chunkInfo) {
  17174. return __awaiter(this, void 0, void 0, function () {
  17175. var index, chunk, cachedInfo, shouldCheckMD5, reuseSaved, md5, onProgress, requestOptions, response;
  17176. var _this = this;
  17177. return __generator(this, function (_a) {
  17178. switch (_a.label) {
  17179. case 0:
  17180. index = chunkInfo.index, chunk = chunkInfo.chunk;
  17181. cachedInfo = this.cachedUploadedList[index];
  17182. this.logger.info("upload part " + index + ", cache:", cachedInfo);
  17183. shouldCheckMD5 = this.config.checkByMD5;
  17184. reuseSaved = function reuseSaved() {
  17185. _this.usedCacheList[index] = true;
  17186. _this.updateChunkProgress(chunk.size, index);
  17187. _this.uploadedList[index] = cachedInfo;
  17188. _this.updateLocalCache();
  17189. };
  17190. // FIXME: 至少判断一下 size
  17191. if (cachedInfo && !shouldCheckMD5) {
  17192. reuseSaved();
  17193. return [2 /*return*/];
  17194. }
  17195. return [4 /*yield*/, utils.computeMd5(chunk)];
  17196. case 1:
  17197. md5 = _a.sent();
  17198. this.logger.info('computed part md5.', md5);
  17199. if (cachedInfo && md5 === cachedInfo.md5) {
  17200. reuseSaved();
  17201. return [2 /*return*/];
  17202. }
  17203. // 没有使用缓存设置标记为 false
  17204. this.usedCacheList[index] = false;
  17205. onProgress = function onProgress(data) {
  17206. _this.updateChunkProgress(data.loaded, index);
  17207. };
  17208. requestOptions = {
  17209. body: chunk,
  17210. md5: this.config.checkByServer ? md5 : undefined,
  17211. onProgress: onProgress,
  17212. onCreate: function onCreate(xhr) {
  17213. return _this.addXhr(xhr);
  17214. }
  17215. };
  17216. this.logger.info("part " + index + " start uploading.");
  17217. return [4 /*yield*/, (0, _api.uploadChunk)(this.token, this.key, chunkInfo.index + 1, this.getUploadInfo(), requestOptions)];
  17218. case 2:
  17219. response = _a.sent();
  17220. this.logger.info("part " + index + " upload completed.");
  17221. // 在某些浏览器环境下,xhr 的 progress 事件无法被触发,progress 为 null,这里在每次分片上传完成后都手动更新下 progress
  17222. onProgress({
  17223. loaded: chunk.size,
  17224. total: chunk.size
  17225. });
  17226. this.uploadedList[index] = {
  17227. etag: response.data.etag,
  17228. md5: response.data.md5,
  17229. size: chunk.size
  17230. };
  17231. this.updateLocalCache();
  17232. return [2 /*return*/];
  17233. }
  17234. });
  17235. });
  17236. };
  17237. Resume.prototype.mkFileReq = function () {
  17238. return __awaiter(this, void 0, void 0, function () {
  17239. var data, result;
  17240. var _this = this;
  17241. return __generator(this, function (_a) {
  17242. switch (_a.label) {
  17243. case 0:
  17244. data = __assign(__assign(__assign({
  17245. parts: this.uploadedList.map(function (value, index) {
  17246. return {
  17247. etag: value.etag,
  17248. // 接口要求 index 需要从 1 开始,所以需要整体 + 1
  17249. partNumber: index + 1
  17250. };
  17251. }),
  17252. fname: this.putExtra.fname
  17253. }, this.putExtra.mimeType && {
  17254. mimeType: this.putExtra.mimeType
  17255. }), this.putExtra.customVars && {
  17256. customVars: this.putExtra.customVars
  17257. }), this.putExtra.metadata && {
  17258. metadata: this.putExtra.metadata
  17259. });
  17260. this.logger.info('parts upload completed, make file.', data);
  17261. return [4 /*yield*/, (0, _api.uploadComplete)(this.token, this.key, this.getUploadInfo(), {
  17262. onCreate: function onCreate(xhr) {
  17263. return _this.addXhr(xhr);
  17264. },
  17265. body: JSON.stringify(data)
  17266. })];
  17267. case 1:
  17268. result = _a.sent();
  17269. this.logger.info('finish Resume Progress.');
  17270. this.updateMkFileProgress(1);
  17271. return [2 /*return*/, result];
  17272. }
  17273. });
  17274. });
  17275. };
  17276. Resume.prototype.initBeforeUploadChunks = function () {
  17277. return __awaiter(this, void 0, void 0, function () {
  17278. var cachedInfo, res, infoMessage;
  17279. return __generator(this, function (_a) {
  17280. switch (_a.label) {
  17281. case 0:
  17282. this.uploadedList = [];
  17283. this.usedCacheList = [];
  17284. cachedInfo = utils.getLocalFileInfo(this.getLocalKey(), this.logger);
  17285. if (!!cachedInfo) return [3 /*break*/, 2];
  17286. this.logger.info('init upload parts from api.');
  17287. return [4 /*yield*/, (0, _api.initUploadParts)(this.token, this.bucketName, this.key, this.uploadHost.getUrl())];
  17288. case 1:
  17289. res = _a.sent();
  17290. this.logger.info("initd upload parts of id: " + res.data.uploadId + ".");
  17291. this.uploadId = res.data.uploadId;
  17292. this.cachedUploadedList = [];
  17293. return [3 /*break*/, 3];
  17294. case 2:
  17295. infoMessage = ['resume upload parts from local cache,', "total " + cachedInfo.data.length + " part,", "id is " + cachedInfo.id + "."];
  17296. this.logger.info(infoMessage.join(' '));
  17297. this.cachedUploadedList = cachedInfo.data;
  17298. this.uploadId = cachedInfo.id;
  17299. _a.label = 3;
  17300. case 3:
  17301. this.chunks = utils.getChunks(this.file, this.config.chunkSize);
  17302. this.loaded = {
  17303. mkFileProgress: 0,
  17304. chunks: this.chunks.map(function (_) {
  17305. return 0;
  17306. })
  17307. };
  17308. this.notifyResumeProgress();
  17309. return [2 /*return*/];
  17310. }
  17311. });
  17312. });
  17313. };
  17314. Resume.prototype.getUploadInfo = function () {
  17315. return {
  17316. id: this.uploadId,
  17317. url: this.uploadHost.getUrl()
  17318. };
  17319. };
  17320. Resume.prototype.getLocalKey = function () {
  17321. return utils.createLocalKey(this.file.name, this.key, this.file.size);
  17322. };
  17323. Resume.prototype.updateLocalCache = function () {
  17324. utils.setLocalFileInfo(this.getLocalKey(), {
  17325. id: this.uploadId,
  17326. data: this.uploadedList
  17327. }, this.logger);
  17328. };
  17329. Resume.prototype.updateChunkProgress = function (loaded, index) {
  17330. this.loaded.chunks[index] = loaded;
  17331. this.notifyResumeProgress();
  17332. };
  17333. Resume.prototype.updateMkFileProgress = function (progress) {
  17334. this.loaded.mkFileProgress = progress;
  17335. this.notifyResumeProgress();
  17336. };
  17337. Resume.prototype.notifyResumeProgress = function () {
  17338. var _this = this;
  17339. this.progress = {
  17340. total: this.getProgressInfoItem(utils.sum(this.loaded.chunks) + this.loaded.mkFileProgress,
  17341. // FIXME: 不准确的 fileSize
  17342. this.file.size + 1 // 防止在 complete 未调用的时候进度显示 100%
  17343. ),
  17344. chunks: this.chunks.map(function (chunk, index) {
  17345. var fromCache = _this.usedCacheList[index];
  17346. return _this.getProgressInfoItem(_this.loaded.chunks[index], chunk.size, fromCache);
  17347. }),
  17348. uploadInfo: {
  17349. id: this.uploadId,
  17350. url: this.uploadHost.getUrl()
  17351. }
  17352. };
  17353. this.onData(this.progress);
  17354. };
  17355. return Resume;
  17356. }(_base.default);
  17357. var _default = Resume;
  17358. exports.default = _default;
  17359. /***/ }),
  17360. /***/ 89:
  17361. /*!****************************************************************!*\
  17362. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/api/index.js ***!
  17363. \****************************************************************/
  17364. /*! no static exports found */
  17365. /***/ (function(module, exports, __webpack_require__) {
  17366. "use strict";
  17367. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  17368. Object.defineProperty(exports, "__esModule", {
  17369. value: true
  17370. });
  17371. exports.deleteUploadedChunks = deleteUploadedChunks;
  17372. exports.direct = direct;
  17373. exports.getUpHosts = getUpHosts;
  17374. exports.getUploadUrl = getUploadUrl;
  17375. exports.initUploadParts = initUploadParts;
  17376. exports.uploadChunk = uploadChunk;
  17377. exports.uploadComplete = uploadComplete;
  17378. var _querystring = __webpack_require__(/*! querystring */ 90);
  17379. var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ 78));
  17380. 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); }
  17381. 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; }
  17382. var __assign = void 0 && (void 0).__assign || function () {
  17383. __assign = Object.assign || function (t) {
  17384. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17385. s = arguments[i];
  17386. for (var p in s) {
  17387. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17388. }
  17389. }
  17390. return t;
  17391. };
  17392. return __assign.apply(this, arguments);
  17393. };
  17394. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  17395. function adopt(value) {
  17396. return value instanceof P ? value : new P(function (resolve) {
  17397. resolve(value);
  17398. });
  17399. }
  17400. return new (P || (P = Promise))(function (resolve, reject) {
  17401. function fulfilled(value) {
  17402. try {
  17403. step(generator.next(value));
  17404. } catch (e) {
  17405. reject(e);
  17406. }
  17407. }
  17408. function rejected(value) {
  17409. try {
  17410. step(generator["throw"](value));
  17411. } catch (e) {
  17412. reject(e);
  17413. }
  17414. }
  17415. function step(result) {
  17416. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  17417. }
  17418. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17419. });
  17420. };
  17421. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  17422. var _ = {
  17423. label: 0,
  17424. sent: function sent() {
  17425. if (t[0] & 1) throw t[1];
  17426. return t[1];
  17427. },
  17428. trys: [],
  17429. ops: []
  17430. },
  17431. f,
  17432. y,
  17433. t,
  17434. g;
  17435. return g = {
  17436. next: verb(0),
  17437. "throw": verb(1),
  17438. "return": verb(2)
  17439. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  17440. return this;
  17441. }), g;
  17442. function verb(n) {
  17443. return function (v) {
  17444. return step([n, v]);
  17445. };
  17446. }
  17447. function step(op) {
  17448. if (f) throw new TypeError("Generator is already executing.");
  17449. while (_) {
  17450. try {
  17451. 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;
  17452. if (y = 0, t) op = [op[0] & 2, t.value];
  17453. switch (op[0]) {
  17454. case 0:
  17455. case 1:
  17456. t = op;
  17457. break;
  17458. case 4:
  17459. _.label++;
  17460. return {
  17461. value: op[1],
  17462. done: false
  17463. };
  17464. case 5:
  17465. _.label++;
  17466. y = op[1];
  17467. op = [0];
  17468. continue;
  17469. case 7:
  17470. op = _.ops.pop();
  17471. _.trys.pop();
  17472. continue;
  17473. default:
  17474. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  17475. _ = 0;
  17476. continue;
  17477. }
  17478. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  17479. _.label = op[1];
  17480. break;
  17481. }
  17482. if (op[0] === 6 && _.label < t[1]) {
  17483. _.label = t[1];
  17484. t = op;
  17485. break;
  17486. }
  17487. if (t && _.label < t[2]) {
  17488. _.label = t[2];
  17489. _.ops.push(op);
  17490. break;
  17491. }
  17492. if (t[2]) _.ops.pop();
  17493. _.trys.pop();
  17494. continue;
  17495. }
  17496. op = body.call(thisArg, _);
  17497. } catch (e) {
  17498. op = [6, e];
  17499. y = 0;
  17500. } finally {
  17501. f = t = 0;
  17502. }
  17503. }
  17504. if (op[0] & 5) throw op[1];
  17505. return {
  17506. value: op[0] ? op[1] : void 0,
  17507. done: true
  17508. };
  17509. }
  17510. };
  17511. function getUpHosts(accessKey, bucketName, protocol) {
  17512. return __awaiter(this, void 0, void 0, function () {
  17513. var params, url;
  17514. return __generator(this, function (_a) {
  17515. params = (0, _querystring.stringify)({
  17516. ak: accessKey,
  17517. bucket: bucketName
  17518. });
  17519. url = protocol + "://api.qiniu.com/v2/query?" + params;
  17520. return [2 /*return*/, utils.request(url, {
  17521. method: 'GET'
  17522. })];
  17523. });
  17524. });
  17525. }
  17526. /**
  17527. * @param bucket 空间名
  17528. * @param key 目标文件名
  17529. * @param uploadInfo 上传信息
  17530. */
  17531. function getBaseUrl(bucket, key, uploadInfo) {
  17532. var url = uploadInfo.url,
  17533. id = uploadInfo.id;
  17534. return url + "/buckets/" + bucket + "/objects/" + (key != null ? utils.urlSafeBase64Encode(key) : '~') + "/uploads/" + id;
  17535. }
  17536. /**
  17537. * @param token 上传鉴权凭证
  17538. * @param bucket 上传空间
  17539. * @param key 目标文件名
  17540. * @param uploadUrl 上传地址
  17541. */
  17542. function initUploadParts(token, bucket, key, uploadUrl) {
  17543. var url = uploadUrl + "/buckets/" + bucket + "/objects/" + (key != null ? utils.urlSafeBase64Encode(key) : '~') + "/uploads";
  17544. return utils.request(url, {
  17545. method: 'POST',
  17546. headers: utils.getAuthHeaders(token)
  17547. });
  17548. }
  17549. /**
  17550. * @param token 上传鉴权凭证
  17551. * @param index 当前 chunk 的索引
  17552. * @param uploadInfo 上传信息
  17553. * @param options 请求参数
  17554. */
  17555. function uploadChunk(token, key, index, uploadInfo, options) {
  17556. var bucket = utils.getPutPolicy(token).bucketName;
  17557. var url = getBaseUrl(bucket, key, uploadInfo) + ("/" + index);
  17558. var headers = utils.getHeadersForChunkUpload(token);
  17559. if (options.md5) headers['Content-MD5'] = options.md5;
  17560. return utils.request(url, __assign(__assign({}, options), {
  17561. method: 'PUT',
  17562. headers: headers
  17563. }));
  17564. }
  17565. /**
  17566. * @param token 上传鉴权凭证
  17567. * @param key 目标文件名
  17568. * @param uploadInfo 上传信息
  17569. * @param options 请求参数
  17570. */
  17571. function uploadComplete(token, key, uploadInfo, options) {
  17572. var bucket = utils.getPutPolicy(token).bucketName;
  17573. var url = getBaseUrl(bucket, key, uploadInfo);
  17574. return utils.request(url, __assign(__assign({}, options), {
  17575. method: 'POST',
  17576. headers: utils.getHeadersForMkFile(token)
  17577. }));
  17578. }
  17579. /**
  17580. * @param token 上传鉴权凭证
  17581. * @param key 目标文件名
  17582. * @param uploadInfo 上传信息
  17583. */
  17584. function deleteUploadedChunks(token, key, uploadinfo) {
  17585. var bucket = utils.getPutPolicy(token).bucketName;
  17586. var url = getBaseUrl(bucket, key, uploadinfo);
  17587. return utils.request(url, {
  17588. method: 'DELETE',
  17589. headers: utils.getAuthHeaders(token)
  17590. });
  17591. }
  17592. /**
  17593. * @param {string} url
  17594. * @param {FormData} data
  17595. * @param {Partial<utils.RequestOptions>} options
  17596. * @returns Promise
  17597. * @description 直传接口
  17598. */
  17599. function direct(url, data, options) {
  17600. return utils.request(url, __assign({
  17601. method: 'POST',
  17602. body: data
  17603. }, options));
  17604. }
  17605. /**
  17606. * @param {UploadUrlConfig} config
  17607. * @param {string} token
  17608. * @returns Promise
  17609. * @description 获取上传 url
  17610. */
  17611. function getUploadUrl(_config, token) {
  17612. return __awaiter(this, void 0, void 0, function () {
  17613. var config, protocol, putPolicy, res, hosts;
  17614. return __generator(this, function (_a) {
  17615. switch (_a.label) {
  17616. case 0:
  17617. config = (0, utils.normalizeUploadConfig)(_config);
  17618. protocol = config.upprotocol;
  17619. if (config.uphost.length > 0) {
  17620. return [2 /*return*/, protocol + "://" + config.uphost[0]];
  17621. }
  17622. putPolicy = utils.getPutPolicy(token);
  17623. return [4 /*yield*/, getUpHosts(putPolicy.assessKey, putPolicy.bucketName, protocol)];
  17624. case 1:
  17625. res = _a.sent();
  17626. hosts = res.data.up.acc.main;
  17627. return [2 /*return*/, protocol + "://" + hosts[0]];
  17628. }
  17629. });
  17630. });
  17631. }
  17632. /***/ }),
  17633. /***/ 9:
  17634. /*!*****************************************************************!*\
  17635. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  17636. \*****************************************************************/
  17637. /*! no static exports found */
  17638. /***/ (function(module, exports) {
  17639. function _arrayLikeToArray(arr, len) {
  17640. if (len == null || len > arr.length) len = arr.length;
  17641. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  17642. arr2[i] = arr[i];
  17643. }
  17644. return arr2;
  17645. }
  17646. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17647. /***/ }),
  17648. /***/ 90:
  17649. /*!***********************************************!*\
  17650. !*** ./node_modules/querystring-es3/index.js ***!
  17651. \***********************************************/
  17652. /*! no static exports found */
  17653. /***/ (function(module, exports, __webpack_require__) {
  17654. "use strict";
  17655. exports.decode = exports.parse = __webpack_require__(/*! ./decode */ 91);
  17656. exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ 92);
  17657. /***/ }),
  17658. /***/ 91:
  17659. /*!************************************************!*\
  17660. !*** ./node_modules/querystring-es3/decode.js ***!
  17661. \************************************************/
  17662. /*! no static exports found */
  17663. /***/ (function(module, exports, __webpack_require__) {
  17664. "use strict";
  17665. // Copyright Joyent, Inc. and other Node contributors.
  17666. //
  17667. // Permission is hereby granted, free of charge, to any person obtaining a
  17668. // copy of this software and associated documentation files (the
  17669. // "Software"), to deal in the Software without restriction, including
  17670. // without limitation the rights to use, copy, modify, merge, publish,
  17671. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17672. // persons to whom the Software is furnished to do so, subject to the
  17673. // following conditions:
  17674. //
  17675. // The above copyright notice and this permission notice shall be included
  17676. // in all copies or substantial portions of the Software.
  17677. //
  17678. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17679. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17680. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17681. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17682. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17683. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17684. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17685. // If obj.hasOwnProperty has been overridden, then calling
  17686. // obj.hasOwnProperty(prop) will break.
  17687. // See: https://github.com/joyent/node/issues/1707
  17688. function hasOwnProperty(obj, prop) {
  17689. return Object.prototype.hasOwnProperty.call(obj, prop);
  17690. }
  17691. module.exports = function(qs, sep, eq, options) {
  17692. sep = sep || '&';
  17693. eq = eq || '=';
  17694. var obj = {};
  17695. if (typeof qs !== 'string' || qs.length === 0) {
  17696. return obj;
  17697. }
  17698. var regexp = /\+/g;
  17699. qs = qs.split(sep);
  17700. var maxKeys = 1000;
  17701. if (options && typeof options.maxKeys === 'number') {
  17702. maxKeys = options.maxKeys;
  17703. }
  17704. var len = qs.length;
  17705. // maxKeys <= 0 means that we should not limit keys count
  17706. if (maxKeys > 0 && len > maxKeys) {
  17707. len = maxKeys;
  17708. }
  17709. for (var i = 0; i < len; ++i) {
  17710. var x = qs[i].replace(regexp, '%20'),
  17711. idx = x.indexOf(eq),
  17712. kstr, vstr, k, v;
  17713. if (idx >= 0) {
  17714. kstr = x.substr(0, idx);
  17715. vstr = x.substr(idx + 1);
  17716. } else {
  17717. kstr = x;
  17718. vstr = '';
  17719. }
  17720. k = decodeURIComponent(kstr);
  17721. v = decodeURIComponent(vstr);
  17722. if (!hasOwnProperty(obj, k)) {
  17723. obj[k] = v;
  17724. } else if (isArray(obj[k])) {
  17725. obj[k].push(v);
  17726. } else {
  17727. obj[k] = [obj[k], v];
  17728. }
  17729. }
  17730. return obj;
  17731. };
  17732. var isArray = Array.isArray || function (xs) {
  17733. return Object.prototype.toString.call(xs) === '[object Array]';
  17734. };
  17735. /***/ }),
  17736. /***/ 92:
  17737. /*!************************************************!*\
  17738. !*** ./node_modules/querystring-es3/encode.js ***!
  17739. \************************************************/
  17740. /*! no static exports found */
  17741. /***/ (function(module, exports, __webpack_require__) {
  17742. "use strict";
  17743. // Copyright Joyent, Inc. and other Node contributors.
  17744. //
  17745. // Permission is hereby granted, free of charge, to any person obtaining a
  17746. // copy of this software and associated documentation files (the
  17747. // "Software"), to deal in the Software without restriction, including
  17748. // without limitation the rights to use, copy, modify, merge, publish,
  17749. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17750. // persons to whom the Software is furnished to do so, subject to the
  17751. // following conditions:
  17752. //
  17753. // The above copyright notice and this permission notice shall be included
  17754. // in all copies or substantial portions of the Software.
  17755. //
  17756. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17757. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17758. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17759. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17760. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17761. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17762. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17763. var stringifyPrimitive = function(v) {
  17764. switch (typeof v) {
  17765. case 'string':
  17766. return v;
  17767. case 'boolean':
  17768. return v ? 'true' : 'false';
  17769. case 'number':
  17770. return isFinite(v) ? v : '';
  17771. default:
  17772. return '';
  17773. }
  17774. };
  17775. module.exports = function(obj, sep, eq, name) {
  17776. sep = sep || '&';
  17777. eq = eq || '=';
  17778. if (obj === null) {
  17779. obj = undefined;
  17780. }
  17781. if (typeof obj === 'object') {
  17782. return map(objectKeys(obj), function(k) {
  17783. var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
  17784. if (isArray(obj[k])) {
  17785. return map(obj[k], function(v) {
  17786. return ks + encodeURIComponent(stringifyPrimitive(v));
  17787. }).join(sep);
  17788. } else {
  17789. return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
  17790. }
  17791. }).join(sep);
  17792. }
  17793. if (!name) return '';
  17794. return encodeURIComponent(stringifyPrimitive(name)) + eq +
  17795. encodeURIComponent(stringifyPrimitive(obj));
  17796. };
  17797. var isArray = Array.isArray || function (xs) {
  17798. return Object.prototype.toString.call(xs) === '[object Array]';
  17799. };
  17800. function map (xs, f) {
  17801. if (xs.map) return xs.map(f);
  17802. var res = [];
  17803. for (var i = 0; i < xs.length; i++) {
  17804. res.push(f(xs[i], i));
  17805. }
  17806. return res;
  17807. }
  17808. var objectKeys = Object.keys || function (obj) {
  17809. var res = [];
  17810. for (var key in obj) {
  17811. if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
  17812. }
  17813. return res;
  17814. };
  17815. /***/ }),
  17816. /***/ 93:
  17817. /*!******************************************************************!*\
  17818. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/base.js ***!
  17819. \******************************************************************/
  17820. /*! no static exports found */
  17821. /***/ (function(module, exports, __webpack_require__) {
  17822. "use strict";
  17823. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  17824. Object.defineProperty(exports, "__esModule", {
  17825. value: true
  17826. });
  17827. exports.default = exports.RETRY_CODE_LIST = exports.FREEZE_CODE_LIST = exports.DEFAULT_CHUNK_SIZE = void 0;
  17828. var _errors = __webpack_require__(/*! ../errors */ 76);
  17829. var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ 78));
  17830. 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); }
  17831. 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; }
  17832. var __assign = void 0 && (void 0).__assign || function () {
  17833. __assign = Object.assign || function (t) {
  17834. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17835. s = arguments[i];
  17836. for (var p in s) {
  17837. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17838. }
  17839. }
  17840. return t;
  17841. };
  17842. return __assign.apply(this, arguments);
  17843. };
  17844. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  17845. function adopt(value) {
  17846. return value instanceof P ? value : new P(function (resolve) {
  17847. resolve(value);
  17848. });
  17849. }
  17850. return new (P || (P = Promise))(function (resolve, reject) {
  17851. function fulfilled(value) {
  17852. try {
  17853. step(generator.next(value));
  17854. } catch (e) {
  17855. reject(e);
  17856. }
  17857. }
  17858. function rejected(value) {
  17859. try {
  17860. step(generator["throw"](value));
  17861. } catch (e) {
  17862. reject(e);
  17863. }
  17864. }
  17865. function step(result) {
  17866. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  17867. }
  17868. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17869. });
  17870. };
  17871. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  17872. var _ = {
  17873. label: 0,
  17874. sent: function sent() {
  17875. if (t[0] & 1) throw t[1];
  17876. return t[1];
  17877. },
  17878. trys: [],
  17879. ops: []
  17880. },
  17881. f,
  17882. y,
  17883. t,
  17884. g;
  17885. return g = {
  17886. next: verb(0),
  17887. "throw": verb(1),
  17888. "return": verb(2)
  17889. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  17890. return this;
  17891. }), g;
  17892. function verb(n) {
  17893. return function (v) {
  17894. return step([n, v]);
  17895. };
  17896. }
  17897. function step(op) {
  17898. if (f) throw new TypeError("Generator is already executing.");
  17899. while (_) {
  17900. try {
  17901. 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;
  17902. if (y = 0, t) op = [op[0] & 2, t.value];
  17903. switch (op[0]) {
  17904. case 0:
  17905. case 1:
  17906. t = op;
  17907. break;
  17908. case 4:
  17909. _.label++;
  17910. return {
  17911. value: op[1],
  17912. done: false
  17913. };
  17914. case 5:
  17915. _.label++;
  17916. y = op[1];
  17917. op = [0];
  17918. continue;
  17919. case 7:
  17920. op = _.ops.pop();
  17921. _.trys.pop();
  17922. continue;
  17923. default:
  17924. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  17925. _ = 0;
  17926. continue;
  17927. }
  17928. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  17929. _.label = op[1];
  17930. break;
  17931. }
  17932. if (op[0] === 6 && _.label < t[1]) {
  17933. _.label = t[1];
  17934. t = op;
  17935. break;
  17936. }
  17937. if (t && _.label < t[2]) {
  17938. _.label = t[2];
  17939. _.ops.push(op);
  17940. break;
  17941. }
  17942. if (t[2]) _.ops.pop();
  17943. _.trys.pop();
  17944. continue;
  17945. }
  17946. op = body.call(thisArg, _);
  17947. } catch (e) {
  17948. op = [6, e];
  17949. y = 0;
  17950. } finally {
  17951. f = t = 0;
  17952. }
  17953. }
  17954. if (op[0] & 5) throw op[1];
  17955. return {
  17956. value: op[0] ? op[1] : void 0,
  17957. done: true
  17958. };
  17959. }
  17960. };
  17961. var __read = void 0 && (void 0).__read || function (o, n) {
  17962. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17963. if (!m) return o;
  17964. var i = m.call(o),
  17965. r,
  17966. ar = [],
  17967. e;
  17968. try {
  17969. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  17970. ar.push(r.value);
  17971. }
  17972. } catch (error) {
  17973. e = {
  17974. error: error
  17975. };
  17976. } finally {
  17977. try {
  17978. if (r && !r.done && (m = i["return"])) m.call(i);
  17979. } finally {
  17980. if (e) throw e.error;
  17981. }
  17982. }
  17983. return ar;
  17984. };
  17985. var __spread = void 0 && (void 0).__spread || function () {
  17986. for (var ar = [], i = 0; i < arguments.length; i++) {
  17987. ar = ar.concat(__read(arguments[i]));
  17988. }
  17989. return ar;
  17990. };
  17991. var DEFAULT_CHUNK_SIZE = 4; // 单位 MB
  17992. // code 信息地址 https://developer.qiniu.com/kodo/3928/error-responses
  17993. exports.DEFAULT_CHUNK_SIZE = DEFAULT_CHUNK_SIZE;
  17994. var FREEZE_CODE_LIST = [0, 502, 503, 504, 599]; // 将会冻结当前 host 的 code
  17995. exports.FREEZE_CODE_LIST = FREEZE_CODE_LIST;
  17996. var RETRY_CODE_LIST = __spread(FREEZE_CODE_LIST, [612]); // 会进行重试的 code
  17997. exports.RETRY_CODE_LIST = RETRY_CODE_LIST;
  17998. var GB = Math.pow(1024, 3);
  17999. var Base = /** @class */function () {
  18000. function Base(options, handlers, hostPool, logger) {
  18001. this.hostPool = hostPool;
  18002. this.logger = logger;
  18003. this.aborted = false;
  18004. this.retryCount = 0;
  18005. this.xhrList = [];
  18006. this.config = options.config;
  18007. logger.info('config inited.', this.config);
  18008. this.putExtra = __assign({
  18009. fname: ''
  18010. }, options.putExtra);
  18011. logger.info('putExtra inited.', this.putExtra);
  18012. this.key = options.key;
  18013. this.file = options.file;
  18014. this.token = options.token;
  18015. this.onData = handlers.onData;
  18016. this.onError = handlers.onError;
  18017. this.onComplete = handlers.onComplete;
  18018. try {
  18019. var putPolicy = utils.getPutPolicy(this.token);
  18020. this.bucketName = putPolicy.bucketName;
  18021. this.assessKey = putPolicy.assessKey;
  18022. } catch (error) {
  18023. logger.error('get putPolicy from token failed.', error);
  18024. this.onError(error);
  18025. }
  18026. }
  18027. // 检查并更新 upload host
  18028. Base.prototype.checkAndUpdateUploadHost = function () {
  18029. return __awaiter(this, void 0, void 0, function () {
  18030. var newHost;
  18031. return __generator(this, function (_a) {
  18032. switch (_a.label) {
  18033. case 0:
  18034. // 从 hostPool 中获取一个可用的 host 挂载在 this
  18035. this.logger.info('get available upload host.');
  18036. return [4 /*yield*/, this.hostPool.getUp(this.assessKey, this.bucketName, this.config.upprotocol)];
  18037. case 1:
  18038. newHost = _a.sent();
  18039. if (newHost == null) {
  18040. throw new _errors.QiniuError(_errors.QiniuErrorName.NotAvailableUploadHost, 'no available upload host.');
  18041. }
  18042. if (this.uploadHost != null && this.uploadHost.host !== newHost.host) {
  18043. this.logger.warn("host switches from " + this.uploadHost.host + " to " + newHost.host + ".");
  18044. } else {
  18045. this.logger.info("use host " + newHost.host + ".");
  18046. }
  18047. this.uploadHost = newHost;
  18048. return [2 /*return*/];
  18049. }
  18050. });
  18051. });
  18052. };
  18053. // 检查并解冻当前的 host
  18054. Base.prototype.checkAndUnfreezeHost = function () {
  18055. this.logger.info('check unfreeze host.');
  18056. if (this.uploadHost != null && this.uploadHost.isFrozen()) {
  18057. this.logger.warn(this.uploadHost.host + " will be unfrozen.");
  18058. this.uploadHost.unfreeze();
  18059. }
  18060. };
  18061. // 检查并更新冻结当前的 host
  18062. Base.prototype.checkAndFreezeHost = function (error) {
  18063. this.logger.info('check freeze host.');
  18064. if (error instanceof _errors.QiniuRequestError && this.uploadHost != null) {
  18065. if (FREEZE_CODE_LIST.includes(error.code)) {
  18066. this.logger.warn(this.uploadHost.host + " will be temporarily frozen.");
  18067. this.uploadHost.freeze();
  18068. }
  18069. }
  18070. };
  18071. Base.prototype.handleError = function (error) {
  18072. this.logger.error(error.message);
  18073. this.onError(error);
  18074. };
  18075. /**
  18076. * @returns Promise 返回结果与上传最终状态无关,状态信息请通过 [Subscriber] 获取。
  18077. * @description 上传文件,状态信息请通过 [Subscriber] 获取。
  18078. */
  18079. Base.prototype.putFile = function () {
  18080. return __awaiter(this, void 0, void 0, function () {
  18081. var result, err_1, notReachRetryCount, needRetry;
  18082. return __generator(this, function (_a) {
  18083. switch (_a.label) {
  18084. case 0:
  18085. this.aborted = false;
  18086. if (!this.putExtra.fname) {
  18087. this.logger.info('use file.name as fname.');
  18088. this.putExtra.fname = this.file.name;
  18089. }
  18090. if (this.file.size > 10000 * GB) {
  18091. this.handleError(new _errors.QiniuError(_errors.QiniuErrorName.InvalidFile, 'file size exceed maximum value 10000G'));
  18092. return [2 /*return*/];
  18093. }
  18094. if (this.putExtra.customVars) {
  18095. if (!utils.isCustomVarsValid(this.putExtra.customVars)) {
  18096. this.handleError(new _errors.QiniuError(_errors.QiniuErrorName.InvalidCustomVars,
  18097. // FIXME: width => with
  18098. 'customVars key should start width x:'));
  18099. return [2 /*return*/];
  18100. }
  18101. }
  18102. if (this.putExtra.metadata) {
  18103. if (!utils.isMetaDataValid(this.putExtra.metadata)) {
  18104. this.handleError(new _errors.QiniuError(_errors.QiniuErrorName.InvalidMetadata, 'metadata key should start with x-qn-meta-'));
  18105. return [2 /*return*/];
  18106. }
  18107. }
  18108. _a.label = 1;
  18109. case 1:
  18110. _a.trys.push([1, 4,, 5]);
  18111. this.uploadAt = new Date().getTime();
  18112. return [4 /*yield*/, this.checkAndUpdateUploadHost()];
  18113. case 2:
  18114. _a.sent();
  18115. return [4 /*yield*/, this.run()];
  18116. case 3:
  18117. result = _a.sent();
  18118. this.onComplete(result.data);
  18119. this.checkAndUnfreezeHost();
  18120. this.sendLog(result.reqId, 200);
  18121. return [2 /*return*/];
  18122. case 4:
  18123. err_1 = _a.sent();
  18124. if (this.aborted) {
  18125. this.logger.warn('upload is aborted.');
  18126. this.sendLog('', -2);
  18127. return [2 /*return*/];
  18128. }
  18129. this.clear();
  18130. this.logger.error(err_1);
  18131. if (err_1 instanceof _errors.QiniuRequestError) {
  18132. this.sendLog(err_1.reqId, err_1.code);
  18133. // 检查并冻结当前的 host
  18134. this.checkAndFreezeHost(err_1);
  18135. notReachRetryCount = ++this.retryCount <= this.config.retryCount;
  18136. needRetry = RETRY_CODE_LIST.includes(err_1.code);
  18137. // 以下条件满足其中之一则会进行重新上传:
  18138. // 1. 满足 needRetry 的条件且 retryCount 不为 0
  18139. // 2. uploadId 无效时在 resume 里会清除本地数据,并且这里触发重新上传
  18140. if (needRetry && notReachRetryCount) {
  18141. this.logger.warn("error auto retry: " + this.retryCount + "/" + this.config.retryCount + ".");
  18142. this.putFile();
  18143. return [2 /*return*/];
  18144. }
  18145. }
  18146. this.onError(err_1);
  18147. return [3 /*break*/, 5];
  18148. case 5:
  18149. return [2 /*return*/];
  18150. }
  18151. });
  18152. });
  18153. };
  18154. Base.prototype.clear = function () {
  18155. this.xhrList.forEach(function (xhr) {
  18156. xhr.onreadystatechange = null;
  18157. xhr.abort();
  18158. });
  18159. this.xhrList = [];
  18160. this.logger.info('cleanup uploading xhr.');
  18161. };
  18162. Base.prototype.stop = function () {
  18163. this.logger.info('aborted.');
  18164. this.clear();
  18165. this.aborted = true;
  18166. };
  18167. Base.prototype.addXhr = function (xhr) {
  18168. this.xhrList.push(xhr);
  18169. };
  18170. Base.prototype.sendLog = function (reqId, code) {
  18171. var _a, _b;
  18172. this.logger.report({
  18173. code: code,
  18174. reqId: reqId,
  18175. remoteIp: '',
  18176. upType: 'jssdk-h5',
  18177. size: this.file.size,
  18178. time: Math.floor(this.uploadAt / 1000),
  18179. port: utils.getPortFromUrl((_a = this.uploadHost) === null || _a === void 0 ? void 0 : _a.getUrl()),
  18180. host: utils.getDomainFromUrl((_b = this.uploadHost) === null || _b === void 0 ? void 0 : _b.getUrl()),
  18181. bytesSent: this.progress ? this.progress.total.loaded : 0,
  18182. duration: Math.floor((new Date().getTime() - this.uploadAt) / 1000)
  18183. });
  18184. };
  18185. Base.prototype.getProgressInfoItem = function (loaded, size, fromCache) {
  18186. return __assign({
  18187. size: size,
  18188. loaded: loaded,
  18189. percent: loaded / size * 100
  18190. }, fromCache == null ? {} : {
  18191. fromCache: fromCache
  18192. });
  18193. };
  18194. return Base;
  18195. }();
  18196. var _default = Base;
  18197. exports.default = _default;
  18198. /***/ }),
  18199. /***/ 94:
  18200. /*!********************************************************************!*\
  18201. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/direct.js ***!
  18202. \********************************************************************/
  18203. /*! no static exports found */
  18204. /***/ (function(module, exports, __webpack_require__) {
  18205. "use strict";
  18206. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18207. Object.defineProperty(exports, "__esModule", {
  18208. value: true
  18209. });
  18210. exports.default = void 0;
  18211. var _crc = __webpack_require__(/*! ../utils/crc32 */ 95);
  18212. var _api = __webpack_require__(/*! ../api */ 89);
  18213. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 93));
  18214. var __extends = void 0 && (void 0).__extends || function () {
  18215. var _extendStatics = function extendStatics(d, b) {
  18216. _extendStatics = Object.setPrototypeOf || {
  18217. __proto__: []
  18218. } instanceof Array && function (d, b) {
  18219. d.__proto__ = b;
  18220. } || function (d, b) {
  18221. for (var p in b) {
  18222. if (b.hasOwnProperty(p)) d[p] = b[p];
  18223. }
  18224. };
  18225. return _extendStatics(d, b);
  18226. };
  18227. return function (d, b) {
  18228. _extendStatics(d, b);
  18229. function __() {
  18230. this.constructor = d;
  18231. }
  18232. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  18233. };
  18234. }();
  18235. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  18236. function adopt(value) {
  18237. return value instanceof P ? value : new P(function (resolve) {
  18238. resolve(value);
  18239. });
  18240. }
  18241. return new (P || (P = Promise))(function (resolve, reject) {
  18242. function fulfilled(value) {
  18243. try {
  18244. step(generator.next(value));
  18245. } catch (e) {
  18246. reject(e);
  18247. }
  18248. }
  18249. function rejected(value) {
  18250. try {
  18251. step(generator["throw"](value));
  18252. } catch (e) {
  18253. reject(e);
  18254. }
  18255. }
  18256. function step(result) {
  18257. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  18258. }
  18259. step((generator = generator.apply(thisArg, _arguments || [])).next());
  18260. });
  18261. };
  18262. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  18263. var _ = {
  18264. label: 0,
  18265. sent: function sent() {
  18266. if (t[0] & 1) throw t[1];
  18267. return t[1];
  18268. },
  18269. trys: [],
  18270. ops: []
  18271. },
  18272. f,
  18273. y,
  18274. t,
  18275. g;
  18276. return g = {
  18277. next: verb(0),
  18278. "throw": verb(1),
  18279. "return": verb(2)
  18280. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  18281. return this;
  18282. }), g;
  18283. function verb(n) {
  18284. return function (v) {
  18285. return step([n, v]);
  18286. };
  18287. }
  18288. function step(op) {
  18289. if (f) throw new TypeError("Generator is already executing.");
  18290. while (_) {
  18291. try {
  18292. 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;
  18293. if (y = 0, t) op = [op[0] & 2, t.value];
  18294. switch (op[0]) {
  18295. case 0:
  18296. case 1:
  18297. t = op;
  18298. break;
  18299. case 4:
  18300. _.label++;
  18301. return {
  18302. value: op[1],
  18303. done: false
  18304. };
  18305. case 5:
  18306. _.label++;
  18307. y = op[1];
  18308. op = [0];
  18309. continue;
  18310. case 7:
  18311. op = _.ops.pop();
  18312. _.trys.pop();
  18313. continue;
  18314. default:
  18315. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  18316. _ = 0;
  18317. continue;
  18318. }
  18319. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  18320. _.label = op[1];
  18321. break;
  18322. }
  18323. if (op[0] === 6 && _.label < t[1]) {
  18324. _.label = t[1];
  18325. t = op;
  18326. break;
  18327. }
  18328. if (t && _.label < t[2]) {
  18329. _.label = t[2];
  18330. _.ops.push(op);
  18331. break;
  18332. }
  18333. if (t[2]) _.ops.pop();
  18334. _.trys.pop();
  18335. continue;
  18336. }
  18337. op = body.call(thisArg, _);
  18338. } catch (e) {
  18339. op = [6, e];
  18340. y = 0;
  18341. } finally {
  18342. f = t = 0;
  18343. }
  18344. }
  18345. if (op[0] & 5) throw op[1];
  18346. return {
  18347. value: op[0] ? op[1] : void 0,
  18348. done: true
  18349. };
  18350. }
  18351. };
  18352. var Direct = /** @class */function (_super) {
  18353. __extends(Direct, _super);
  18354. function Direct() {
  18355. return _super !== null && _super.apply(this, arguments) || this;
  18356. }
  18357. Direct.prototype.run = function () {
  18358. return __awaiter(this, void 0, void 0, function () {
  18359. var formData, crcSign, customVars_1, result;
  18360. var _this = this;
  18361. return __generator(this, function (_a) {
  18362. switch (_a.label) {
  18363. case 0:
  18364. this.logger.info('start run Direct.');
  18365. formData = new FormData();
  18366. formData.append('file', this.file);
  18367. formData.append('token', this.token);
  18368. if (this.key != null) {
  18369. formData.append('key', this.key);
  18370. }
  18371. formData.append('fname', this.putExtra.fname);
  18372. if (!this.config.checkByServer) return [3 /*break*/, 2];
  18373. return [4 /*yield*/, _crc.CRC32.file(this.file)];
  18374. case 1:
  18375. crcSign = _a.sent();
  18376. formData.append('crc32', crcSign.toString());
  18377. _a.label = 2;
  18378. case 2:
  18379. if (this.putExtra.customVars) {
  18380. this.logger.info('init customVars.');
  18381. customVars_1 = this.putExtra.customVars;
  18382. Object.keys(customVars_1).forEach(function (key) {
  18383. return formData.append(key, customVars_1[key].toString());
  18384. });
  18385. this.logger.info('customVars inited.');
  18386. }
  18387. this.logger.info('formData inited.');
  18388. return [4 /*yield*/, (0, _api.direct)(this.uploadHost.getUrl(), formData, {
  18389. onProgress: function onProgress(data) {
  18390. _this.updateDirectProgress(data.loaded, data.total);
  18391. },
  18392. onCreate: function onCreate(xhr) {
  18393. return _this.addXhr(xhr);
  18394. }
  18395. })];
  18396. case 3:
  18397. result = _a.sent();
  18398. this.logger.info('Direct progress finish.');
  18399. this.finishDirectProgress();
  18400. return [2 /*return*/, result];
  18401. }
  18402. });
  18403. });
  18404. };
  18405. Direct.prototype.updateDirectProgress = function (loaded, total) {
  18406. // 当请求未完成时可能进度会达到100,所以total + 1来防止这种情况出现
  18407. this.progress = {
  18408. total: this.getProgressInfoItem(loaded, total + 1)
  18409. };
  18410. this.onData(this.progress);
  18411. };
  18412. Direct.prototype.finishDirectProgress = function () {
  18413. // 在某些浏览器环境下,xhr 的 progress 事件无法被触发,progress 为 null,这里 fake 下
  18414. if (!this.progress) {
  18415. this.logger.warn('progress is null.');
  18416. this.progress = {
  18417. total: this.getProgressInfoItem(this.file.size, this.file.size)
  18418. };
  18419. this.onData(this.progress);
  18420. return;
  18421. }
  18422. var total = this.progress.total;
  18423. this.progress = {
  18424. total: this.getProgressInfoItem(total.loaded + 1, total.size)
  18425. };
  18426. this.onData(this.progress);
  18427. };
  18428. return Direct;
  18429. }(_base.default);
  18430. var _default = Direct;
  18431. exports.default = _default;
  18432. /***/ }),
  18433. /***/ 95:
  18434. /*!******************************************************************!*\
  18435. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/crc32.js ***!
  18436. \******************************************************************/
  18437. /*! no static exports found */
  18438. /***/ (function(module, exports, __webpack_require__) {
  18439. "use strict";
  18440. Object.defineProperty(exports, "__esModule", {
  18441. value: true
  18442. });
  18443. exports.CRC32 = void 0;
  18444. var _helper = __webpack_require__(/*! ./helper */ 82);
  18445. /* eslint-disable no-bitwise */
  18446. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  18447. function adopt(value) {
  18448. return value instanceof P ? value : new P(function (resolve) {
  18449. resolve(value);
  18450. });
  18451. }
  18452. return new (P || (P = Promise))(function (resolve, reject) {
  18453. function fulfilled(value) {
  18454. try {
  18455. step(generator.next(value));
  18456. } catch (e) {
  18457. reject(e);
  18458. }
  18459. }
  18460. function rejected(value) {
  18461. try {
  18462. step(generator["throw"](value));
  18463. } catch (e) {
  18464. reject(e);
  18465. }
  18466. }
  18467. function step(result) {
  18468. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  18469. }
  18470. step((generator = generator.apply(thisArg, _arguments || [])).next());
  18471. });
  18472. };
  18473. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  18474. var _ = {
  18475. label: 0,
  18476. sent: function sent() {
  18477. if (t[0] & 1) throw t[1];
  18478. return t[1];
  18479. },
  18480. trys: [],
  18481. ops: []
  18482. },
  18483. f,
  18484. y,
  18485. t,
  18486. g;
  18487. return g = {
  18488. next: verb(0),
  18489. "throw": verb(1),
  18490. "return": verb(2)
  18491. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  18492. return this;
  18493. }), g;
  18494. function verb(n) {
  18495. return function (v) {
  18496. return step([n, v]);
  18497. };
  18498. }
  18499. function step(op) {
  18500. if (f) throw new TypeError("Generator is already executing.");
  18501. while (_) {
  18502. try {
  18503. 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;
  18504. if (y = 0, t) op = [op[0] & 2, t.value];
  18505. switch (op[0]) {
  18506. case 0:
  18507. case 1:
  18508. t = op;
  18509. break;
  18510. case 4:
  18511. _.label++;
  18512. return {
  18513. value: op[1],
  18514. done: false
  18515. };
  18516. case 5:
  18517. _.label++;
  18518. y = op[1];
  18519. op = [0];
  18520. continue;
  18521. case 7:
  18522. op = _.ops.pop();
  18523. _.trys.pop();
  18524. continue;
  18525. default:
  18526. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  18527. _ = 0;
  18528. continue;
  18529. }
  18530. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  18531. _.label = op[1];
  18532. break;
  18533. }
  18534. if (op[0] === 6 && _.label < t[1]) {
  18535. _.label = t[1];
  18536. t = op;
  18537. break;
  18538. }
  18539. if (t && _.label < t[2]) {
  18540. _.label = t[2];
  18541. _.ops.push(op);
  18542. break;
  18543. }
  18544. if (t[2]) _.ops.pop();
  18545. _.trys.pop();
  18546. continue;
  18547. }
  18548. op = body.call(thisArg, _);
  18549. } catch (e) {
  18550. op = [6, e];
  18551. y = 0;
  18552. } finally {
  18553. f = t = 0;
  18554. }
  18555. }
  18556. if (op[0] & 5) throw op[1];
  18557. return {
  18558. value: op[0] ? op[1] : void 0,
  18559. done: true
  18560. };
  18561. }
  18562. };
  18563. /**
  18564. * 以下 class 实现参考
  18565. * https://github.com/Stuk/jszip/blob/d4702a70834bd953d4c2d0bc155fad795076631a/lib/crc32.js
  18566. * 该实现主要针对大文件优化、对计算的值进行了 `>>> 0` 运算(为与服务端保持一致)
  18567. */
  18568. var CRC32 = /** @class */function () {
  18569. function CRC32() {
  18570. this.crc = -1;
  18571. this.table = this.makeTable();
  18572. }
  18573. CRC32.prototype.makeTable = function () {
  18574. var table = new Array();
  18575. for (var i = 0; i < 256; i++) {
  18576. var t = i;
  18577. for (var j = 0; j < 8; j++) {
  18578. if (t & 1) {
  18579. // IEEE 标准
  18580. t = t >>> 1 ^ 0xEDB88320;
  18581. } else {
  18582. t >>>= 1;
  18583. }
  18584. }
  18585. table[i] = t;
  18586. }
  18587. return table;
  18588. };
  18589. CRC32.prototype.append = function (data) {
  18590. var crc = this.crc;
  18591. for (var offset = 0; offset < data.byteLength; offset++) {
  18592. crc = crc >>> 8 ^ this.table[(crc ^ data[offset]) & 0xFF];
  18593. }
  18594. this.crc = crc;
  18595. };
  18596. CRC32.prototype.compute = function () {
  18597. return (this.crc ^ -1) >>> 0;
  18598. };
  18599. CRC32.prototype.readAsUint8Array = function (file) {
  18600. return __awaiter(this, void 0, void 0, function () {
  18601. var _a;
  18602. return __generator(this, function (_b) {
  18603. switch (_b.label) {
  18604. case 0:
  18605. if (!(typeof file.arrayBuffer === 'function')) return [3 /*break*/, 2];
  18606. _a = Uint8Array.bind;
  18607. return [4 /*yield*/, file.arrayBuffer()];
  18608. case 1:
  18609. return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
  18610. case 2:
  18611. return [2 /*return*/, new Promise(function (resolve, reject) {
  18612. var reader = new FileReader();
  18613. reader.onload = function () {
  18614. if (reader.result == null) {
  18615. reject();
  18616. return;
  18617. }
  18618. if (typeof reader.result === 'string') {
  18619. reject();
  18620. return;
  18621. }
  18622. resolve(new Uint8Array(reader.result));
  18623. };
  18624. reader.readAsArrayBuffer(file);
  18625. })];
  18626. }
  18627. });
  18628. });
  18629. };
  18630. CRC32.prototype.file = function (file) {
  18631. return __awaiter(this, void 0, void 0, function () {
  18632. var _a, count, index, start, end, chuck;
  18633. return __generator(this, function (_b) {
  18634. switch (_b.label) {
  18635. case 0:
  18636. if (!(file.size <= _helper.MB)) return [3 /*break*/, 2];
  18637. _a = this.append;
  18638. return [4 /*yield*/, this.readAsUint8Array(file)];
  18639. case 1:
  18640. _a.apply(this, [_b.sent()]);
  18641. return [2 /*return*/, this.compute()];
  18642. case 2:
  18643. count = Math.ceil(file.size / _helper.MB);
  18644. index = 0;
  18645. _b.label = 3;
  18646. case 3:
  18647. if (!(index < count)) return [3 /*break*/, 6];
  18648. start = index * _helper.MB;
  18649. end = index === count - 1 ? file.size : start + _helper.MB;
  18650. return [4 /*yield*/, this.readAsUint8Array(file.slice(start, end))];
  18651. case 4:
  18652. chuck = _b.sent();
  18653. this.append(new Uint8Array(chuck));
  18654. _b.label = 5;
  18655. case 5:
  18656. index++;
  18657. return [3 /*break*/, 3];
  18658. case 6:
  18659. return [2 /*return*/, this.compute()];
  18660. }
  18661. });
  18662. });
  18663. };
  18664. CRC32.file = function (file) {
  18665. var crc = new CRC32();
  18666. return crc.file(file);
  18667. };
  18668. return CRC32;
  18669. }();
  18670. exports.CRC32 = CRC32;
  18671. /***/ }),
  18672. /***/ 96:
  18673. /*!*******************************************************************!*\
  18674. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/logger/index.js ***!
  18675. \*******************************************************************/
  18676. /*! no static exports found */
  18677. /***/ (function(module, exports, __webpack_require__) {
  18678. "use strict";
  18679. Object.defineProperty(exports, "__esModule", {
  18680. value: true
  18681. });
  18682. exports.default = void 0;
  18683. var _reportV = __webpack_require__(/*! ./report-v3 */ 97);
  18684. var __read = void 0 && (void 0).__read || function (o, n) {
  18685. var m = typeof Symbol === "function" && o[Symbol.iterator];
  18686. if (!m) return o;
  18687. var i = m.call(o),
  18688. r,
  18689. ar = [],
  18690. e;
  18691. try {
  18692. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  18693. ar.push(r.value);
  18694. }
  18695. } catch (error) {
  18696. e = {
  18697. error: error
  18698. };
  18699. } finally {
  18700. try {
  18701. if (r && !r.done && (m = i["return"])) m.call(i);
  18702. } finally {
  18703. if (e) throw e.error;
  18704. }
  18705. }
  18706. return ar;
  18707. };
  18708. var __spread = void 0 && (void 0).__spread || function () {
  18709. for (var ar = [], i = 0; i < arguments.length; i++) {
  18710. ar = ar.concat(__read(arguments[i]));
  18711. }
  18712. return ar;
  18713. };
  18714. var Logger = /** @class */function () {
  18715. function Logger(token, disableReport, level, prefix) {
  18716. if (disableReport === void 0) {
  18717. disableReport = true;
  18718. }
  18719. if (level === void 0) {
  18720. level = 'OFF';
  18721. }
  18722. if (prefix === void 0) {
  18723. prefix = 'UPLOAD';
  18724. }
  18725. this.token = token;
  18726. this.disableReport = disableReport;
  18727. this.level = level;
  18728. this.prefix = prefix;
  18729. // 为每个类分配一个 id
  18730. // 用以区分不同的上传任务
  18731. this.id = ++Logger.id;
  18732. }
  18733. Logger.prototype.getPrintPrefix = function (level) {
  18734. return "Qiniu-JS-SDK [" + level + "][" + this.prefix + "#" + this.id + "]:";
  18735. };
  18736. /**
  18737. * @param {V3LogInfo} data 上报的数据。
  18738. * @param {boolean} retry 重试次数,可选,默认为 3。
  18739. * @description 向服务端上报统计信息。
  18740. */
  18741. Logger.prototype.report = function (data, retry) {
  18742. if (this.disableReport) return;
  18743. try {
  18744. (0, _reportV.reportV3)(this.token, data, retry);
  18745. } catch (error) {
  18746. this.warn(error);
  18747. }
  18748. };
  18749. /**
  18750. * @param {unknown[]} ...args
  18751. * @description 输出 info 级别的调试信息。
  18752. */
  18753. Logger.prototype.info = function () {
  18754. var args = [];
  18755. for (var _i = 0; _i < arguments.length; _i++) {
  18756. args[_i] = arguments[_i];
  18757. }
  18758. var allowLevel = ['INFO'];
  18759. if (allowLevel.includes(this.level)) {
  18760. // eslint-disable-next-line no-console
  18761. console.log.apply(console, __spread([this.getPrintPrefix('INFO')], args));
  18762. }
  18763. };
  18764. /**
  18765. * @param {unknown[]} ...args
  18766. * @description 输出 warn 级别的调试信息。
  18767. */
  18768. Logger.prototype.warn = function () {
  18769. var args = [];
  18770. for (var _i = 0; _i < arguments.length; _i++) {
  18771. args[_i] = arguments[_i];
  18772. }
  18773. var allowLevel = ['INFO', 'WARN'];
  18774. if (allowLevel.includes(this.level)) {
  18775. // eslint-disable-next-line no-console
  18776. console.warn.apply(console, __spread([this.getPrintPrefix('WARN')], args));
  18777. }
  18778. };
  18779. /**
  18780. * @param {unknown[]} ...args
  18781. * @description 输出 error 级别的调试信息。
  18782. */
  18783. Logger.prototype.error = function () {
  18784. var args = [];
  18785. for (var _i = 0; _i < arguments.length; _i++) {
  18786. args[_i] = arguments[_i];
  18787. }
  18788. var allowLevel = ['INFO', 'WARN', 'ERROR'];
  18789. if (allowLevel.includes(this.level)) {
  18790. // eslint-disable-next-line no-console
  18791. console.error.apply(console, __spread([this.getPrintPrefix('ERROR')], args));
  18792. }
  18793. };
  18794. Logger.id = 0;
  18795. return Logger;
  18796. }();
  18797. var _default = Logger;
  18798. exports.default = _default;
  18799. /***/ }),
  18800. /***/ 97:
  18801. /*!***********************************************************************!*\
  18802. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/logger/report-v3.js ***!
  18803. \***********************************************************************/
  18804. /*! no static exports found */
  18805. /***/ (function(module, exports, __webpack_require__) {
  18806. "use strict";
  18807. Object.defineProperty(exports, "__esModule", {
  18808. value: true
  18809. });
  18810. exports.reportV3 = reportV3;
  18811. var _utils = __webpack_require__(/*! ../utils */ 78);
  18812. /**
  18813. * @param {string} token 上传使用的 token
  18814. * @param {V3LogInfo} data 上报的统计数据
  18815. * @param {number} retry 重试的次数,默认值 3
  18816. * @description v3 版本的日志上传接口,参考文档 https://github.com/qbox/product/blob/master/kodo/uplog.md#%E7%89%88%E6%9C%AC-3。
  18817. */
  18818. function reportV3(token, data, retry) {
  18819. if (retry === void 0) {
  18820. retry = 3;
  18821. }
  18822. var xhr = (0, _utils.createXHR)();
  18823. xhr.open('POST', 'https://uplog.qbox.me/log/3');
  18824. xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  18825. xhr.setRequestHeader('Authorization', (0, _utils.getAuthHeaders)(token).Authorization);
  18826. xhr.onreadystatechange = function () {
  18827. if (xhr.readyState === 4 && xhr.status !== 200 && retry > 0) {
  18828. reportV3(token, data, retry - 1);
  18829. }
  18830. };
  18831. // 顺序参考:https://github.com/qbox/product/blob/master/kodo/uplog.md#%E7%89%88%E6%9C%AC-3
  18832. var stringifyData = [data.code || '', data.reqId || '', data.host || '', data.remoteIp || '', data.port || '', data.duration || '', data.time || '', data.bytesSent || '', data.upType || '', data.size || ''].join(',');
  18833. xhr.send(stringifyData);
  18834. }
  18835. /***/ }),
  18836. /***/ 98:
  18837. /*!*******************************************************************!*\
  18838. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/upload/hosts.js ***!
  18839. \*******************************************************************/
  18840. /*! no static exports found */
  18841. /***/ (function(module, exports, __webpack_require__) {
  18842. "use strict";
  18843. Object.defineProperty(exports, "__esModule", {
  18844. value: true
  18845. });
  18846. exports.HostPool = exports.Host = void 0;
  18847. var _api = __webpack_require__(/*! ../api */ 89);
  18848. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  18849. function adopt(value) {
  18850. return value instanceof P ? value : new P(function (resolve) {
  18851. resolve(value);
  18852. });
  18853. }
  18854. return new (P || (P = Promise))(function (resolve, reject) {
  18855. function fulfilled(value) {
  18856. try {
  18857. step(generator.next(value));
  18858. } catch (e) {
  18859. reject(e);
  18860. }
  18861. }
  18862. function rejected(value) {
  18863. try {
  18864. step(generator["throw"](value));
  18865. } catch (e) {
  18866. reject(e);
  18867. }
  18868. }
  18869. function step(result) {
  18870. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  18871. }
  18872. step((generator = generator.apply(thisArg, _arguments || [])).next());
  18873. });
  18874. };
  18875. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  18876. var _ = {
  18877. label: 0,
  18878. sent: function sent() {
  18879. if (t[0] & 1) throw t[1];
  18880. return t[1];
  18881. },
  18882. trys: [],
  18883. ops: []
  18884. },
  18885. f,
  18886. y,
  18887. t,
  18888. g;
  18889. return g = {
  18890. next: verb(0),
  18891. "throw": verb(1),
  18892. "return": verb(2)
  18893. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  18894. return this;
  18895. }), g;
  18896. function verb(n) {
  18897. return function (v) {
  18898. return step([n, v]);
  18899. };
  18900. }
  18901. function step(op) {
  18902. if (f) throw new TypeError("Generator is already executing.");
  18903. while (_) {
  18904. try {
  18905. 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;
  18906. if (y = 0, t) op = [op[0] & 2, t.value];
  18907. switch (op[0]) {
  18908. case 0:
  18909. case 1:
  18910. t = op;
  18911. break;
  18912. case 4:
  18913. _.label++;
  18914. return {
  18915. value: op[1],
  18916. done: false
  18917. };
  18918. case 5:
  18919. _.label++;
  18920. y = op[1];
  18921. op = [0];
  18922. continue;
  18923. case 7:
  18924. op = _.ops.pop();
  18925. _.trys.pop();
  18926. continue;
  18927. default:
  18928. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  18929. _ = 0;
  18930. continue;
  18931. }
  18932. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  18933. _.label = op[1];
  18934. break;
  18935. }
  18936. if (op[0] === 6 && _.label < t[1]) {
  18937. _.label = t[1];
  18938. t = op;
  18939. break;
  18940. }
  18941. if (t && _.label < t[2]) {
  18942. _.label = t[2];
  18943. _.ops.push(op);
  18944. break;
  18945. }
  18946. if (t[2]) _.ops.pop();
  18947. _.trys.pop();
  18948. continue;
  18949. }
  18950. op = body.call(thisArg, _);
  18951. } catch (e) {
  18952. op = [6, e];
  18953. y = 0;
  18954. } finally {
  18955. f = t = 0;
  18956. }
  18957. }
  18958. if (op[0] & 5) throw op[1];
  18959. return {
  18960. value: op[0] ? op[1] : void 0,
  18961. done: true
  18962. };
  18963. }
  18964. };
  18965. var __read = void 0 && (void 0).__read || function (o, n) {
  18966. var m = typeof Symbol === "function" && o[Symbol.iterator];
  18967. if (!m) return o;
  18968. var i = m.call(o),
  18969. r,
  18970. ar = [],
  18971. e;
  18972. try {
  18973. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  18974. ar.push(r.value);
  18975. }
  18976. } catch (error) {
  18977. e = {
  18978. error: error
  18979. };
  18980. } finally {
  18981. try {
  18982. if (r && !r.done && (m = i["return"])) m.call(i);
  18983. } finally {
  18984. if (e) throw e.error;
  18985. }
  18986. }
  18987. return ar;
  18988. };
  18989. var __spread = void 0 && (void 0).__spread || function () {
  18990. for (var ar = [], i = 0; i < arguments.length; i++) {
  18991. ar = ar.concat(__read(arguments[i]));
  18992. }
  18993. return ar;
  18994. };
  18995. /**
  18996. * @description 解冻时间,key 是 host,value 为解冻时间
  18997. */
  18998. var unfreezeTimeMap = new Map();
  18999. var Host = /** @class */function () {
  19000. function Host(host, protocol) {
  19001. this.host = host;
  19002. this.protocol = protocol;
  19003. }
  19004. /**
  19005. * @description 当前 host 是否为冻结状态
  19006. */
  19007. Host.prototype.isFrozen = function () {
  19008. var currentTime = new Date().getTime();
  19009. var unfreezeTime = unfreezeTimeMap.get(this.host);
  19010. return unfreezeTime != null && unfreezeTime >= currentTime;
  19011. };
  19012. /**
  19013. * @param {number} time 单位秒,默认 20s
  19014. * @description 冻结该 host 对象,该 host 将在指定时间内不可用
  19015. */
  19016. Host.prototype.freeze = function (time) {
  19017. if (time === void 0) {
  19018. time = 20;
  19019. }
  19020. var unfreezeTime = new Date().getTime() + time * 1000;
  19021. unfreezeTimeMap.set(this.host, unfreezeTime);
  19022. };
  19023. /**
  19024. * @description 解冻该 host
  19025. */
  19026. Host.prototype.unfreeze = function () {
  19027. unfreezeTimeMap["delete"](this.host);
  19028. };
  19029. /**
  19030. * @description 获取当前 host 的完整 url
  19031. */
  19032. Host.prototype.getUrl = function () {
  19033. return this.protocol + "://" + this.host;
  19034. };
  19035. /**
  19036. * @description 获取解冻时间
  19037. */
  19038. Host.prototype.getUnfreezeTime = function () {
  19039. return unfreezeTimeMap.get(this.host);
  19040. };
  19041. return Host;
  19042. }();
  19043. exports.Host = Host;
  19044. var HostPool = /** @class */function () {
  19045. /**
  19046. * @param {string[]} initHosts
  19047. * @description 如果在构造时传入 initHosts,则该 host 池始终使用传入的 initHosts 做为可用的数据
  19048. */
  19049. function HostPool(initHosts) {
  19050. if (initHosts === void 0) {
  19051. initHosts = [];
  19052. }
  19053. this.initHosts = initHosts;
  19054. /**
  19055. * @description 缓存的 host 表,以 bucket 和 accessKey 作为 key
  19056. */
  19057. this.cachedHostsMap = new Map();
  19058. }
  19059. /**
  19060. * @param {string} accessKey
  19061. * @param {string} bucketName
  19062. * @param {string[]} hosts
  19063. * @param {InternalConfig['upprotocol']} protocol
  19064. * @returns {void}
  19065. * @description 注册可用 host
  19066. */
  19067. HostPool.prototype.register = function (accessKey, bucketName, hosts, protocol) {
  19068. this.cachedHostsMap.set(accessKey + "@" + bucketName, hosts.map(function (host) {
  19069. return new Host(host, protocol);
  19070. }));
  19071. };
  19072. /**
  19073. * @param {string} accessKey
  19074. * @param {string} bucketName
  19075. * @param {InternalConfig['upprotocol']} protocol
  19076. * @returns {Promise<void>}
  19077. * @description 刷新最新的 host 数据,如果用户在构造时该类时传入了 host 或者已经存在缓存则不会发起请求
  19078. */
  19079. HostPool.prototype.refresh = function (accessKey, bucketName, protocol) {
  19080. var _a, _b, _c, _d;
  19081. return __awaiter(this, void 0, void 0, function () {
  19082. var cachedHostList, response, stashHosts;
  19083. return __generator(this, function (_e) {
  19084. switch (_e.label) {
  19085. case 0:
  19086. cachedHostList = this.cachedHostsMap.get(accessKey + "@" + bucketName) || [];
  19087. if (cachedHostList.length > 0) return [2 /*return*/];
  19088. if (this.initHosts.length > 0) {
  19089. this.register(accessKey, bucketName, this.initHosts, protocol);
  19090. return [2 /*return*/];
  19091. }
  19092. return [4 /*yield*/, (0, _api.getUpHosts)(accessKey, bucketName, protocol)];
  19093. case 1:
  19094. response = _e.sent();
  19095. if ((response === null || response === void 0 ? void 0 : response.data) != null) {
  19096. 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) || []);
  19097. this.register(accessKey, bucketName, stashHosts, protocol);
  19098. }
  19099. return [2 /*return*/];
  19100. }
  19101. });
  19102. });
  19103. };
  19104. /**
  19105. * @param {string} accessKey
  19106. * @param {string} bucketName
  19107. * @param {InternalConfig['upprotocol']} protocol
  19108. * @returns {Promise<Host | null>}
  19109. * @description 获取一个可用的上传 Host,排除已冻结的
  19110. */
  19111. HostPool.prototype.getUp = function (accessKey, bucketName, protocol) {
  19112. return __awaiter(this, void 0, void 0, function () {
  19113. var cachedHostList, availableHostList, priorityQueue;
  19114. return __generator(this, function (_a) {
  19115. switch (_a.label) {
  19116. case 0:
  19117. return [4 /*yield*/, this.refresh(accessKey, bucketName, protocol)];
  19118. case 1:
  19119. _a.sent();
  19120. cachedHostList = this.cachedHostsMap.get(accessKey + "@" + bucketName) || [];
  19121. if (cachedHostList.length === 0) return [2 /*return*/, null];
  19122. availableHostList = cachedHostList.filter(function (host) {
  19123. return !host.isFrozen();
  19124. });
  19125. if (availableHostList.length > 0) return [2 /*return*/, availableHostList[0]
  19126. // 无可用的,去取离解冻最近的 host
  19127. ];
  19128. priorityQueue = cachedHostList.slice().sort(function (hostA, hostB) {
  19129. return (hostA.getUnfreezeTime() || 0) - (hostB.getUnfreezeTime() || 0);
  19130. });
  19131. return [2 /*return*/, priorityQueue[0]];
  19132. }
  19133. });
  19134. });
  19135. };
  19136. return HostPool;
  19137. }();
  19138. exports.HostPool = HostPool;
  19139. /***/ }),
  19140. /***/ 99:
  19141. /*!*********************************************************************!*\
  19142. !*** D:/工作/项目2/亲家母/qjm/node_modules/qiniu-js/esm/utils/compress.js ***!
  19143. \*********************************************************************/
  19144. /*! no static exports found */
  19145. /***/ (function(module, exports, __webpack_require__) {
  19146. "use strict";
  19147. Object.defineProperty(exports, "__esModule", {
  19148. value: true
  19149. });
  19150. exports.default = void 0;
  19151. var _errors = __webpack_require__(/*! ../errors */ 76);
  19152. var _helper = __webpack_require__(/*! ./helper */ 82);
  19153. var __assign = void 0 && (void 0).__assign || function () {
  19154. __assign = Object.assign || function (t) {
  19155. for (var s, i = 1, n = arguments.length; i < n; i++) {
  19156. s = arguments[i];
  19157. for (var p in s) {
  19158. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  19159. }
  19160. }
  19161. return t;
  19162. };
  19163. return __assign.apply(this, arguments);
  19164. };
  19165. var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
  19166. function adopt(value) {
  19167. return value instanceof P ? value : new P(function (resolve) {
  19168. resolve(value);
  19169. });
  19170. }
  19171. return new (P || (P = Promise))(function (resolve, reject) {
  19172. function fulfilled(value) {
  19173. try {
  19174. step(generator.next(value));
  19175. } catch (e) {
  19176. reject(e);
  19177. }
  19178. }
  19179. function rejected(value) {
  19180. try {
  19181. step(generator["throw"](value));
  19182. } catch (e) {
  19183. reject(e);
  19184. }
  19185. }
  19186. function step(result) {
  19187. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  19188. }
  19189. step((generator = generator.apply(thisArg, _arguments || [])).next());
  19190. });
  19191. };
  19192. var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
  19193. var _ = {
  19194. label: 0,
  19195. sent: function sent() {
  19196. if (t[0] & 1) throw t[1];
  19197. return t[1];
  19198. },
  19199. trys: [],
  19200. ops: []
  19201. },
  19202. f,
  19203. y,
  19204. t,
  19205. g;
  19206. return g = {
  19207. next: verb(0),
  19208. "throw": verb(1),
  19209. "return": verb(2)
  19210. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  19211. return this;
  19212. }), g;
  19213. function verb(n) {
  19214. return function (v) {
  19215. return step([n, v]);
  19216. };
  19217. }
  19218. function step(op) {
  19219. if (f) throw new TypeError("Generator is already executing.");
  19220. while (_) {
  19221. try {
  19222. 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;
  19223. if (y = 0, t) op = [op[0] & 2, t.value];
  19224. switch (op[0]) {
  19225. case 0:
  19226. case 1:
  19227. t = op;
  19228. break;
  19229. case 4:
  19230. _.label++;
  19231. return {
  19232. value: op[1],
  19233. done: false
  19234. };
  19235. case 5:
  19236. _.label++;
  19237. y = op[1];
  19238. op = [0];
  19239. continue;
  19240. case 7:
  19241. op = _.ops.pop();
  19242. _.trys.pop();
  19243. continue;
  19244. default:
  19245. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  19246. _ = 0;
  19247. continue;
  19248. }
  19249. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  19250. _.label = op[1];
  19251. break;
  19252. }
  19253. if (op[0] === 6 && _.label < t[1]) {
  19254. _.label = t[1];
  19255. t = op;
  19256. break;
  19257. }
  19258. if (t && _.label < t[2]) {
  19259. _.label = t[2];
  19260. _.ops.push(op);
  19261. break;
  19262. }
  19263. if (t[2]) _.ops.pop();
  19264. _.trys.pop();
  19265. continue;
  19266. }
  19267. op = body.call(thisArg, _);
  19268. } catch (e) {
  19269. op = [6, e];
  19270. y = 0;
  19271. } finally {
  19272. f = t = 0;
  19273. }
  19274. }
  19275. if (op[0] & 5) throw op[1];
  19276. return {
  19277. value: op[0] ? op[1] : void 0,
  19278. done: true
  19279. };
  19280. }
  19281. };
  19282. var mimeTypes = {
  19283. PNG: 'image/png',
  19284. JPEG: 'image/jpeg',
  19285. WEBP: 'image/webp',
  19286. BMP: 'image/bmp'
  19287. };
  19288. var maxSteps = 4;
  19289. var scaleFactor = Math.log(2);
  19290. var supportMimeTypes = Object.keys(mimeTypes).map(function (type) {
  19291. return mimeTypes[type];
  19292. });
  19293. var defaultType = mimeTypes.JPEG;
  19294. function isSupportedType(type) {
  19295. return supportMimeTypes.includes(type);
  19296. }
  19297. var Compress = /** @class */function () {
  19298. function Compress(file, config) {
  19299. this.file = file;
  19300. this.config = config;
  19301. this.config = __assign({
  19302. quality: 0.92,
  19303. noCompressIfLarger: false
  19304. }, this.config);
  19305. }
  19306. Compress.prototype.process = function () {
  19307. return __awaiter(this, void 0, void 0, function () {
  19308. var srcDimension, originImage, canvas, scale, scaleCanvas, distBlob;
  19309. return __generator(this, function (_a) {
  19310. switch (_a.label) {
  19311. case 0:
  19312. this.outputType = this.file.type;
  19313. srcDimension = {};
  19314. if (!isSupportedType(this.file.type)) {
  19315. throw new _errors.QiniuError(_errors.QiniuErrorName.UnsupportedFileType, "unsupported file type: " + this.file.type);
  19316. }
  19317. return [4 /*yield*/, this.getOriginImage()];
  19318. case 1:
  19319. originImage = _a.sent();
  19320. return [4 /*yield*/, this.getCanvas(originImage)];
  19321. case 2:
  19322. canvas = _a.sent();
  19323. scale = 1;
  19324. if (this.config.maxWidth) {
  19325. scale = Math.min(1, this.config.maxWidth / canvas.width);
  19326. }
  19327. if (this.config.maxHeight) {
  19328. scale = Math.min(1, scale, this.config.maxHeight / canvas.height);
  19329. }
  19330. srcDimension.width = canvas.width;
  19331. srcDimension.height = canvas.height;
  19332. return [4 /*yield*/, this.doScale(canvas, scale)];
  19333. case 3:
  19334. scaleCanvas = _a.sent();
  19335. distBlob = this.toBlob(scaleCanvas);
  19336. if (distBlob.size > this.file.size && this.config.noCompressIfLarger) {
  19337. return [2 /*return*/, {
  19338. dist: this.file,
  19339. width: srcDimension.width,
  19340. height: srcDimension.height
  19341. }];
  19342. }
  19343. return [2 /*return*/, {
  19344. dist: distBlob,
  19345. width: scaleCanvas.width,
  19346. height: scaleCanvas.height
  19347. }];
  19348. }
  19349. });
  19350. });
  19351. };
  19352. Compress.prototype.clear = function (ctx, width, height) {
  19353. // jpeg 没有 alpha 通道,透明区间会被填充成黑色,这里把透明区间填充为白色
  19354. if (this.outputType === defaultType) {
  19355. ctx.fillStyle = '#fff';
  19356. ctx.fillRect(0, 0, width, height);
  19357. } else {
  19358. ctx.clearRect(0, 0, width, height);
  19359. }
  19360. };
  19361. /** 通过 file 初始化 image 对象 */
  19362. Compress.prototype.getOriginImage = function () {
  19363. var _this = this;
  19364. return new Promise(function (resolve, reject) {
  19365. var url = (0, _helper.createObjectURL)(_this.file);
  19366. var img = new Image();
  19367. img.onload = function () {
  19368. resolve(img);
  19369. };
  19370. img.onerror = function () {
  19371. reject('image load error');
  19372. };
  19373. img.src = url;
  19374. });
  19375. };
  19376. Compress.prototype.getCanvas = function (img) {
  19377. var _this = this;
  19378. return new Promise(function (resolve, reject) {
  19379. var canvas = document.createElement('canvas');
  19380. var context = canvas.getContext('2d');
  19381. if (!context) {
  19382. reject(new _errors.QiniuError(_errors.QiniuErrorName.GetCanvasContextFailed, 'context is null'));
  19383. return;
  19384. }
  19385. var width = img.width,
  19386. height = img.height;
  19387. canvas.height = height;
  19388. canvas.width = width;
  19389. _this.clear(context, width, height);
  19390. context.drawImage(img, 0, 0);
  19391. resolve(canvas);
  19392. });
  19393. };
  19394. Compress.prototype.doScale = function (source, scale) {
  19395. return __awaiter(this, void 0, void 0, function () {
  19396. var sctx, steps, factor, mirror, mctx, width, height, originWidth, originHeight, src, context, i, dw, dh, canvas, data;
  19397. return __generator(this, function (_a) {
  19398. if (scale === 1) {
  19399. return [2 /*return*/, source];
  19400. }
  19401. sctx = source.getContext('2d');
  19402. steps = Math.min(maxSteps, Math.ceil(1 / scale / scaleFactor));
  19403. factor = Math.pow(scale, 1 / steps);
  19404. mirror = document.createElement('canvas');
  19405. mctx = mirror.getContext('2d');
  19406. width = source.width, height = source.height;
  19407. originWidth = width;
  19408. originHeight = height;
  19409. mirror.width = width;
  19410. mirror.height = height;
  19411. if (!mctx || !sctx) {
  19412. throw new _errors.QiniuError(_errors.QiniuErrorName.GetCanvasContextFailed, "mctx or sctx can't be null");
  19413. }
  19414. for (i = 0; i < steps; i++) {
  19415. dw = width * factor | 0 // eslint-disable-line no-bitwise
  19416. ;
  19417. dh = height * factor | 0 // eslint-disable-line no-bitwise
  19418. ;
  19419. // 到最后一步的时候 dw, dh 用目标缩放尺寸,否则会出现最后尺寸偏小的情况
  19420. if (i === steps - 1) {
  19421. dw = originWidth * scale;
  19422. dh = originHeight * scale;
  19423. }
  19424. if (i % 2 === 0) {
  19425. src = source;
  19426. context = mctx;
  19427. } else {
  19428. src = mirror;
  19429. context = sctx;
  19430. }
  19431. // 每次画前都清空,避免图像重叠
  19432. this.clear(context, width, height);
  19433. context.drawImage(src, 0, 0, width, height, 0, 0, dw, dh);
  19434. width = dw;
  19435. height = dh;
  19436. }
  19437. canvas = src === source ? mirror : source;
  19438. data = context.getImageData(0, 0, width, height);
  19439. // resize
  19440. canvas.width = width;
  19441. canvas.height = height;
  19442. // store image data
  19443. context.putImageData(data, 0, 0);
  19444. return [2 /*return*/, canvas];
  19445. });
  19446. });
  19447. };
  19448. /** 这里把 base64 字符串转为 blob 对象 */
  19449. Compress.prototype.toBlob = function (result) {
  19450. var dataURL = result.toDataURL(this.outputType, this.config.quality);
  19451. var buffer = atob(dataURL.split(',')[1]).split('').map(function (char) {
  19452. return char.charCodeAt(0);
  19453. });
  19454. var blob = new Blob([new Uint8Array(buffer)], {
  19455. type: this.outputType
  19456. });
  19457. return blob;
  19458. };
  19459. return Compress;
  19460. }();
  19461. var compressImage = function compressImage(file, options) {
  19462. return new Compress(file, options).process();
  19463. };
  19464. var _default = compressImage;
  19465. exports.default = _default;
  19466. /***/ })
  19467. }]);
  19468. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map