vendor.js 484 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998
  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 target = typeof globalThis !== 'undefined' ? globalThis : function () {
  15. return this;
  16. }();
  17. var key = ['w', 'x'].join('');
  18. var oldWx = target[key];
  19. function isWxKey(key) {
  20. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  21. }
  22. function initWx() {
  23. var newWx = {};
  24. for (var _key in oldWx) {
  25. if (isWxKey(_key)) {
  26. // TODO wrapper function
  27. newWx[_key] = oldWx[_key];
  28. }
  29. }
  30. return newWx;
  31. }
  32. target[key] = initWx();
  33. var _default = target[key];
  34. exports.default = _default;
  35. /***/ }),
  36. /***/ 10:
  37. /*!****************************************************************!*\
  38. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  39. \****************************************************************/
  40. /*! no static exports found */
  41. /***/ (function(module, exports) {
  42. function _nonIterableRest() {
  43. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  44. }
  45. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  46. /***/ }),
  47. /***/ 11:
  48. /*!***************************************************************!*\
  49. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  50. \***************************************************************/
  51. /*! no static exports found */
  52. /***/ (function(module, exports, __webpack_require__) {
  53. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  54. function _defineProperty(obj, key, value) {
  55. key = toPropertyKey(key);
  56. if (key in obj) {
  57. Object.defineProperty(obj, key, {
  58. value: value,
  59. enumerable: true,
  60. configurable: true,
  61. writable: true
  62. });
  63. } else {
  64. obj[key] = value;
  65. }
  66. return obj;
  67. }
  68. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  69. /***/ }),
  70. /***/ 115:
  71. /*!********************************************************************!*\
  72. !*** C:/Users/Admin/Desktop/work/mdapp/js_sdk/xb-copy/uni-copy.js ***!
  73. \********************************************************************/
  74. /*! no static exports found */
  75. /***/ (function(module, exports, __webpack_require__) {
  76. "use strict";
  77. /* WEBPACK VAR INJECTION */(function(uni) {
  78. Object.defineProperty(exports, "__esModule", {
  79. value: true
  80. });
  81. exports.default = uniCopy;
  82. function uniCopy(_ref) {
  83. var content = _ref.content,
  84. _success = _ref.success,
  85. error = _ref.error;
  86. if (!content) return error('复制的内容不能为空 !');
  87. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  88. /**
  89. * 小程序端 和 app端的复制逻辑
  90. */
  91. uni.setClipboardData({
  92. data: content,
  93. success: function success() {
  94. _success("复制成功~");
  95. console.log('success');
  96. },
  97. fail: function fail() {
  98. _success("复制失败~");
  99. }
  100. });
  101. /**
  102. * H5端的复制逻辑
  103. */
  104. }
  105. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  106. /***/ }),
  107. /***/ 12:
  108. /*!**************************************************************!*\
  109. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  110. \**************************************************************/
  111. /*! no static exports found */
  112. /***/ (function(module, exports, __webpack_require__) {
  113. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  114. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  115. function _toPropertyKey(arg) {
  116. var key = toPrimitive(arg, "string");
  117. return _typeof(key) === "symbol" ? key : String(key);
  118. }
  119. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  120. /***/ }),
  121. /***/ 13:
  122. /*!*******************************************************!*\
  123. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  124. \*******************************************************/
  125. /*! no static exports found */
  126. /***/ (function(module, exports) {
  127. function _typeof(obj) {
  128. "@babel/helpers - typeof";
  129. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  130. return typeof obj;
  131. } : function (obj) {
  132. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  133. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  134. }
  135. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  136. /***/ }),
  137. /***/ 14:
  138. /*!************************************************************!*\
  139. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  140. \************************************************************/
  141. /*! no static exports found */
  142. /***/ (function(module, exports, __webpack_require__) {
  143. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  144. function _toPrimitive(input, hint) {
  145. if (_typeof(input) !== "object" || input === null) return input;
  146. var prim = input[Symbol.toPrimitive];
  147. if (prim !== undefined) {
  148. var res = prim.call(input, hint || "default");
  149. if (_typeof(res) !== "object") return res;
  150. throw new TypeError("@@toPrimitive must return a primitive value.");
  151. }
  152. return (hint === "string" ? String : Number)(input);
  153. }
  154. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  155. /***/ }),
  156. /***/ 140:
  157. /*!*********************************************************!*\
  158. !*** C:/Users/Admin/Desktop/work/mdapp/utils/qrcode.js ***!
  159. \*********************************************************/
  160. /*! no static exports found */
  161. /***/ (function(module, exports, __webpack_require__) {
  162. "use strict";
  163. /* WEBPACK VAR INJECTION */(function(uni) {
  164. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  165. Object.defineProperty(exports, "__esModule", {
  166. value: true
  167. });
  168. exports.default = void 0;
  169. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  170. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  171. /**
  172. * qrcode-wx-miniprogram
  173. */
  174. var QRMode = {
  175. MODE_NUMBER: 1 << 0,
  176. MODE_ALPHA_NUM: 1 << 1,
  177. MODE_8BIT_BYTE: 1 << 2,
  178. MODE_KANJI: 1 << 3
  179. },
  180. QRErrorCorrectLevel = {
  181. L: 1,
  182. M: 0,
  183. Q: 3,
  184. H: 2
  185. },
  186. QRMaskPattern = {
  187. PATTERN000: 0,
  188. PATTERN001: 1,
  189. PATTERN010: 2,
  190. PATTERN011: 3,
  191. PATTERN100: 4,
  192. PATTERN101: 5,
  193. PATTERN110: 6,
  194. PATTERN111: 7
  195. },
  196. QRUtil = {
  197. PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]],
  198. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  199. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  200. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  201. getBCHTypeInfo: function getBCHTypeInfo(data) {
  202. var d = data << 10;
  203. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  204. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  205. }
  206. return (data << 10 | d) ^ QRUtil.G15_MASK;
  207. },
  208. getBCHTypeNumber: function getBCHTypeNumber(data) {
  209. var d = data << 12;
  210. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  211. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  212. }
  213. return data << 12 | d;
  214. },
  215. getBCHDigit: function getBCHDigit(data) {
  216. var digit = 0;
  217. while (data != 0) {
  218. digit++;
  219. data >>>= 1;
  220. }
  221. return digit;
  222. },
  223. getPatternPosition: function getPatternPosition(typeNumber) {
  224. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  225. },
  226. getMask: function getMask(maskPattern, i, j) {
  227. switch (maskPattern) {
  228. case QRMaskPattern.PATTERN000:
  229. return (i + j) % 2 == 0;
  230. case QRMaskPattern.PATTERN001:
  231. return i % 2 == 0;
  232. case QRMaskPattern.PATTERN010:
  233. return j % 3 == 0;
  234. case QRMaskPattern.PATTERN011:
  235. return (i + j) % 3 == 0;
  236. case QRMaskPattern.PATTERN100:
  237. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  238. case QRMaskPattern.PATTERN101:
  239. return i * j % 2 + i * j % 3 == 0;
  240. case QRMaskPattern.PATTERN110:
  241. return (i * j % 2 + i * j % 3) % 2 == 0;
  242. case QRMaskPattern.PATTERN111:
  243. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  244. default:
  245. //throw new Error("bad maskPattern:" + maskPattern);
  246. throwError("bad maskPattern:" + maskPattern);
  247. }
  248. },
  249. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  250. var a = new QRPolynomial([1], 0);
  251. for (var i = 0; i < errorCorrectLength; i++) {
  252. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  253. }
  254. return a;
  255. },
  256. getLengthInBits: function getLengthInBits(mode, type) {
  257. if (1 <= type && type < 10) {
  258. switch (mode) {
  259. case QRMode.MODE_NUMBER:
  260. return 10;
  261. case QRMode.MODE_ALPHA_NUM:
  262. return 9;
  263. case QRMode.MODE_8BIT_BYTE:
  264. return 8;
  265. case QRMode.MODE_KANJI:
  266. return 8;
  267. default:
  268. //throw new Error("mode:" + mode);
  269. throwError("mode:" + mode);
  270. }
  271. } else if (type < 27) {
  272. switch (mode) {
  273. case QRMode.MODE_NUMBER:
  274. return 12;
  275. case QRMode.MODE_ALPHA_NUM:
  276. return 11;
  277. case QRMode.MODE_8BIT_BYTE:
  278. return 16;
  279. case QRMode.MODE_KANJI:
  280. return 10;
  281. default:
  282. //throw new Error("mode:" + mode);
  283. throwError("mode:" + mode);
  284. }
  285. } else if (type < 41) {
  286. switch (mode) {
  287. case QRMode.MODE_NUMBER:
  288. return 14;
  289. case QRMode.MODE_ALPHA_NUM:
  290. return 13;
  291. case QRMode.MODE_8BIT_BYTE:
  292. return 16;
  293. case QRMode.MODE_KANJI:
  294. return 12;
  295. default:
  296. //throw new Error("mode:" + mode);
  297. throwError("mode:" + mode);
  298. }
  299. } else {
  300. //throw new Error("type:" + type);
  301. throwError("type:" + type);
  302. }
  303. },
  304. getLostPoint: function getLostPoint(qrCode) {
  305. var moduleCount = qrCode.getModuleCount();
  306. var lostPoint = 0;
  307. for (var row = 0; row < moduleCount; row++) {
  308. for (var col = 0; col < moduleCount; col++) {
  309. var sameCount = 0;
  310. var dark = qrCode.isDark(row, col);
  311. for (var r = -1; r <= 1; r++) {
  312. if (row + r < 0 || moduleCount <= row + r) {
  313. continue;
  314. }
  315. for (var c = -1; c <= 1; c++) {
  316. if (col + c < 0 || moduleCount <= col + c) {
  317. continue;
  318. }
  319. if (r == 0 && c == 0) {
  320. continue;
  321. }
  322. if (dark == qrCode.isDark(row + r, col + c)) {
  323. sameCount++;
  324. }
  325. }
  326. }
  327. if (sameCount > 5) {
  328. lostPoint += 3 + sameCount - 5;
  329. }
  330. }
  331. }
  332. for (var row = 0; row < moduleCount - 1; row++) {
  333. for (var col = 0; col < moduleCount - 1; col++) {
  334. var count = 0;
  335. if (qrCode.isDark(row, col)) count++;
  336. if (qrCode.isDark(row + 1, col)) count++;
  337. if (qrCode.isDark(row, col + 1)) count++;
  338. if (qrCode.isDark(row + 1, col + 1)) count++;
  339. if (count == 0 || count == 4) {
  340. lostPoint += 3;
  341. }
  342. }
  343. }
  344. for (var row = 0; row < moduleCount; row++) {
  345. for (var col = 0; col < moduleCount - 6; col++) {
  346. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {
  347. lostPoint += 40;
  348. }
  349. }
  350. }
  351. for (var col = 0; col < moduleCount; col++) {
  352. for (var row = 0; row < moduleCount - 6; row++) {
  353. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {
  354. lostPoint += 40;
  355. }
  356. }
  357. }
  358. var darkCount = 0;
  359. for (var col = 0; col < moduleCount; col++) {
  360. for (var row = 0; row < moduleCount; row++) {
  361. if (qrCode.isDark(row, col)) {
  362. darkCount++;
  363. }
  364. }
  365. }
  366. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  367. lostPoint += ratio * 10;
  368. return lostPoint;
  369. }
  370. },
  371. QRMath = {
  372. glog: function glog(n) {
  373. if (n < 1) {
  374. //throw new Error("glog(" + n + ")");
  375. throwError("glog(" + n + ")");
  376. }
  377. return QRMath.LOG_TABLE[n];
  378. },
  379. gexp: function gexp(n) {
  380. while (n < 0) {
  381. n += 255;
  382. }
  383. while (n >= 256) {
  384. n -= 255;
  385. }
  386. return QRMath.EXP_TABLE[n];
  387. },
  388. EXP_TABLE: new Array(256),
  389. LOG_TABLE: new Array(256)
  390. };
  391. for (var i = 0; i < 8; i++) {
  392. QRMath.EXP_TABLE[i] = 1 << i;
  393. }
  394. for (var _i = 8; _i < 256; _i++) {
  395. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.EXP_TABLE[_i - 8];
  396. }
  397. for (var _i2 = 0; _i2 < 255; _i2++) {
  398. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  399. }
  400. /*
  401. * class QR8bitByte
  402. * */
  403. var QR8bitByte = /*#__PURE__*/function () {
  404. function QR8bitByte(data) {
  405. (0, _classCallCheck2.default)(this, QR8bitByte);
  406. this.mode = QRMode.MODE_8BIT_BYTE;
  407. this.data = data;
  408. this.parsedData = [];
  409. // Added to support UTF-8 Characters
  410. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  411. var byteArray = [],
  412. code = this.data.charCodeAt(_i3);
  413. if (code > 0x10000) {
  414. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  415. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  416. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  417. byteArray[3] = 0x80 | code & 0x3F;
  418. } else if (code > 0x800) {
  419. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  420. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  421. byteArray[2] = 0x80 | code & 0x3F;
  422. } else if (code > 0x80) {
  423. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  424. byteArray[1] = 0x80 | code & 0x3F;
  425. } else {
  426. byteArray[0] = code;
  427. }
  428. this.parsedData.push(byteArray);
  429. }
  430. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  431. if (this.parsedData.length !== this.data.length) {
  432. this.parsedData.unshift(191);
  433. this.parsedData.unshift(187);
  434. this.parsedData.unshift(239);
  435. }
  436. }
  437. (0, _createClass2.default)(QR8bitByte, [{
  438. key: "getLength",
  439. value: function getLength(buffer) {
  440. return this.parsedData.length;
  441. }
  442. }, {
  443. key: "write",
  444. value: function write(buffer) {
  445. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  446. buffer.put(this.parsedData[_i4], 8);
  447. }
  448. }
  449. }]);
  450. return QR8bitByte;
  451. }();
  452. /*
  453. * class QRCodeModel
  454. * */
  455. var QRCodeModel = /*#__PURE__*/function () {
  456. function QRCodeModel(typeNumber, errorCorrectLevel) {
  457. (0, _classCallCheck2.default)(this, QRCodeModel);
  458. this.typeNumber = typeNumber;
  459. this.errorCorrectLevel = errorCorrectLevel;
  460. this.modules = null;
  461. this.moduleCount = 0;
  462. this.dataCache = null;
  463. this.dataList = [];
  464. }
  465. (0, _createClass2.default)(QRCodeModel, [{
  466. key: "addData",
  467. value: function addData(data) {
  468. var newData = new QR8bitByte(data);
  469. this.dataList.push(newData);
  470. this.dataCache = null;
  471. }
  472. }, {
  473. key: "isDark",
  474. value: function isDark(row, col) {
  475. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  476. //throw new Error(row + ',' + col);
  477. throwError(row + ',' + col);
  478. }
  479. return this.modules[row][col];
  480. }
  481. }, {
  482. key: "getModuleCount",
  483. value: function getModuleCount() {
  484. return this.moduleCount;
  485. }
  486. }, {
  487. key: "make",
  488. value: function make() {
  489. this.makeImpl(false, this.getBestMaskPattern());
  490. }
  491. }, {
  492. key: "makeImpl",
  493. value: function makeImpl(test, maskPattern) {
  494. this.moduleCount = this.typeNumber * 4 + 17;
  495. this.modules = new Array(this.moduleCount);
  496. for (var row = 0; row < this.moduleCount; row++) {
  497. this.modules[row] = new Array(this.moduleCount);
  498. for (var col = 0; col < this.moduleCount; col++) {
  499. this.modules[row][col] = null;
  500. }
  501. }
  502. this.setupPositionProbePattern(0, 0);
  503. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  504. this.setupPositionProbePattern(0, this.moduleCount - 7);
  505. this.setupPositionAdjustPattern();
  506. this.setupTimingPattern();
  507. this.setupTypeInfo(test, maskPattern);
  508. if (this.typeNumber >= 7) {
  509. this.setupTypeNumber(test);
  510. }
  511. if (this.dataCache == null) {
  512. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  513. }
  514. this.mapData(this.dataCache, maskPattern);
  515. }
  516. }, {
  517. key: "setupPositionProbePattern",
  518. value: function setupPositionProbePattern(row, col) {
  519. for (var r = -1; r <= 7; r++) {
  520. if (row + r <= -1 || this.moduleCount <= row + r) {
  521. continue;
  522. }
  523. for (var c = -1; c <= 7; c++) {
  524. if (col + c <= -1 || this.moduleCount <= col + c) {
  525. continue;
  526. }
  527. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  528. }
  529. }
  530. }
  531. }, {
  532. key: "getBestMaskPattern",
  533. value: function getBestMaskPattern() {
  534. var minLostPoint = 0,
  535. pattern = 0;
  536. for (var _i5 = 0; _i5 < 8; _i5++) {
  537. this.makeImpl(true, _i5);
  538. var lostPoint = QRUtil.getLostPoint(this);
  539. if (_i5 == 0 || minLostPoint > lostPoint) {
  540. minLostPoint = lostPoint;
  541. pattern = _i5;
  542. }
  543. }
  544. return pattern;
  545. }
  546. }, {
  547. key: "setupTimingPattern",
  548. value: function setupTimingPattern() {
  549. for (var r = 8; r < this.moduleCount - 8; r++) {
  550. if (this.modules[r][6] != null) {
  551. continue;
  552. }
  553. this.modules[r][6] = r % 2 == 0;
  554. }
  555. for (var c = 8; c < this.moduleCount - 8; c++) {
  556. if (this.modules[6][c] != null) {
  557. continue;
  558. }
  559. this.modules[6][c] = c % 2 == 0;
  560. }
  561. }
  562. }, {
  563. key: "setupPositionAdjustPattern",
  564. value: function setupPositionAdjustPattern() {
  565. var pos = QRUtil.getPatternPosition(this.typeNumber);
  566. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  567. for (var j = 0; j < pos.length; j++) {
  568. var row = pos[_i6],
  569. col = pos[j];
  570. if (this.modules[row][col] != null) {
  571. continue;
  572. }
  573. for (var r = -2; r <= 2; r++) {
  574. for (var c = -2; c <= 2; c++) {
  575. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0;
  576. }
  577. }
  578. }
  579. }
  580. }
  581. }, {
  582. key: "setupTypeNumber",
  583. value: function setupTypeNumber(test) {
  584. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  585. for (var _i7 = 0; _i7 < 18; _i7++) {
  586. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  587. }
  588. for (var _i8 = 0; _i8 < 18; _i8++) {
  589. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  590. }
  591. }
  592. }, {
  593. key: "setupTypeInfo",
  594. value: function setupTypeInfo(test, maskPattern) {
  595. var data = this.errorCorrectLevel << 3 | maskPattern,
  596. bits = QRUtil.getBCHTypeInfo(data);
  597. for (var _i9 = 0; _i9 < 15; _i9++) {
  598. var mod = !test && (bits >> _i9 & 1) == 1;
  599. if (_i9 < 6) {
  600. this.modules[_i9][8] = mod;
  601. } else if (_i9 < 8) {
  602. this.modules[_i9 + 1][8] = mod;
  603. } else {
  604. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  605. }
  606. }
  607. for (var _i10 = 0; _i10 < 15; _i10++) {
  608. var _mod = !test && (bits >> _i10 & 1) == 1;
  609. if (_i10 < 8) {
  610. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  611. } else if (_i10 < 9) {
  612. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  613. } else {
  614. this.modules[8][15 - _i10 - 1] = _mod;
  615. }
  616. }
  617. this.modules[this.moduleCount - 8][8] = !test;
  618. }
  619. }, {
  620. key: "mapData",
  621. value: function mapData(data, maskPattern) {
  622. var inc = -1,
  623. row = this.moduleCount - 1,
  624. bitIndex = 7,
  625. byteIndex = 0;
  626. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  627. if (col == 6) col--;
  628. while (true) {
  629. for (var c = 0; c < 2; c++) {
  630. if (this.modules[row][col - c] == null) {
  631. var dark = false;
  632. if (byteIndex < data.length) {
  633. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  634. }
  635. var mask = QRUtil.getMask(maskPattern, row, col - c);
  636. if (mask) {
  637. dark = !dark;
  638. }
  639. this.modules[row][col - c] = dark;
  640. bitIndex--;
  641. if (bitIndex == -1) {
  642. byteIndex++;
  643. bitIndex = 7;
  644. }
  645. }
  646. }
  647. row += inc;
  648. if (row < 0 || this.moduleCount <= row) {
  649. row -= inc;
  650. inc = -inc;
  651. break;
  652. }
  653. }
  654. }
  655. }
  656. }]);
  657. return QRCodeModel;
  658. }();
  659. QRCodeModel.PAD0 = 0xEC;
  660. QRCodeModel.PAD1 = 0x11;
  661. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  662. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  663. buffer = new QRBitBuffer();
  664. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  665. var data = dataList[_i11];
  666. buffer.put(data.mode, 4);
  667. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  668. data.write(buffer);
  669. }
  670. var totalDataCount = 0;
  671. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  672. totalDataCount += rsBlocks[_i12].dataCount;
  673. }
  674. if (buffer.getLengthInBits() > totalDataCount * 8) {
  675. /*
  676. throw new Error("code length overflow. (" +
  677. buffer.getLengthInBits() +
  678. ">" +
  679. totalDataCount * 8 +
  680. ")");
  681. */
  682. throwError("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
  683. }
  684. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  685. buffer.put(0, 4);
  686. }
  687. while (buffer.getLengthInBits() % 8 != 0) {
  688. buffer.putBit(false);
  689. }
  690. while (true) {
  691. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  692. break;
  693. }
  694. buffer.put(QRCodeModel.PAD0, 8);
  695. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  696. break;
  697. }
  698. buffer.put(QRCodeModel.PAD1, 8);
  699. }
  700. return QRCodeModel.createBytes(buffer, rsBlocks);
  701. };
  702. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  703. var offset = 0,
  704. maxDcCount = 0,
  705. maxEcCount = 0,
  706. dcData = new Array(rsBlocks.length),
  707. ecData = new Array(rsBlocks.length);
  708. for (var r = 0; r < rsBlocks.length; r++) {
  709. var dcCount = rsBlocks[r].dataCount,
  710. ecCount = rsBlocks[r].totalCount - dcCount;
  711. maxDcCount = Math.max(maxDcCount, dcCount);
  712. maxEcCount = Math.max(maxEcCount, ecCount);
  713. dcData[r] = new Array(dcCount);
  714. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  715. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  716. }
  717. offset += dcCount;
  718. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  719. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  720. modPoly = rawPoly.mod(rsPoly);
  721. ecData[r] = new Array(rsPoly.getLength() - 1);
  722. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  723. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  724. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  725. }
  726. }
  727. var totalCodeCount = 0;
  728. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  729. totalCodeCount += rsBlocks[_i15].totalCount;
  730. }
  731. var data = new Array(totalCodeCount),
  732. index = 0;
  733. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  734. for (var _r = 0; _r < rsBlocks.length; _r++) {
  735. if (_i16 < dcData[_r].length) {
  736. data[index++] = dcData[_r][_i16];
  737. }
  738. }
  739. }
  740. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  741. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  742. if (_i17 < ecData[_r2].length) {
  743. data[index++] = ecData[_r2][_i17];
  744. }
  745. }
  746. }
  747. return data;
  748. };
  749. /*
  750. * class QRPolynomial
  751. * */
  752. var QRPolynomial = /*#__PURE__*/function () {
  753. function QRPolynomial(num, shift) {
  754. (0, _classCallCheck2.default)(this, QRPolynomial);
  755. if (num.length == undefined) {
  756. //throw new Error(num.length + '/' + shift);
  757. throwError(num.length + '/' + shift);
  758. }
  759. var offset = 0;
  760. while (offset < num.length && num[offset] == 0) {
  761. offset++;
  762. }
  763. this.num = new Array(num.length - offset + shift);
  764. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  765. this.num[_i18] = num[_i18 + offset];
  766. }
  767. }
  768. (0, _createClass2.default)(QRPolynomial, [{
  769. key: "get",
  770. value: function get(index) {
  771. return this.num[index];
  772. }
  773. }, {
  774. key: "getLength",
  775. value: function getLength() {
  776. return this.num.length;
  777. }
  778. }, {
  779. key: "multiply",
  780. value: function multiply(e) {
  781. var num = new Array(this.getLength() + e.getLength() - 1);
  782. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  783. for (var j = 0; j < e.getLength(); j++) {
  784. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  785. }
  786. }
  787. return new QRPolynomial(num, 0);
  788. }
  789. }, {
  790. key: "mod",
  791. value: function mod(e) {
  792. if (this.getLength() - e.getLength() < 0) {
  793. return this;
  794. }
  795. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  796. num = new Array(this.getLength());
  797. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  798. num[_i20] = this.get(_i20);
  799. }
  800. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  801. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  802. }
  803. return new QRPolynomial(num, 0).mod(e);
  804. }
  805. }]);
  806. return QRPolynomial;
  807. }();
  808. /*
  809. * class QRRSBlock
  810. * */
  811. var QRRSBlock = /*#__PURE__*/(0, _createClass2.default)(function QRRSBlock(totalCount, dataCount) {
  812. (0, _classCallCheck2.default)(this, QRRSBlock);
  813. this.totalCount = totalCount;
  814. this.dataCount = dataCount;
  815. });
  816. QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
  817. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  818. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  819. if (!rsBlock) {
  820. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  821. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  822. }
  823. var length = rsBlock.length / 3,
  824. list = [];
  825. for (var _i22 = 0; _i22 < length; _i22++) {
  826. var count = rsBlock[_i22 * 3],
  827. totalCount = rsBlock[_i22 * 3 + 1],
  828. dataCount = rsBlock[_i22 * 3 + 2];
  829. for (var j = 0; j < count; j++) {
  830. list.push(new QRRSBlock(totalCount, dataCount));
  831. }
  832. }
  833. return list;
  834. };
  835. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  836. switch (errorCorrectLevel) {
  837. case QRErrorCorrectLevel.L:
  838. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  839. case QRErrorCorrectLevel.M:
  840. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  841. case QRErrorCorrectLevel.Q:
  842. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  843. case QRErrorCorrectLevel.H:
  844. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  845. default:
  846. return undefined;
  847. }
  848. };
  849. /*
  850. * class QRBitBuffer
  851. * */
  852. var QRBitBuffer = /*#__PURE__*/function () {
  853. function QRBitBuffer() {
  854. (0, _classCallCheck2.default)(this, QRBitBuffer);
  855. this.buffer = [];
  856. this.length = 0;
  857. }
  858. (0, _createClass2.default)(QRBitBuffer, [{
  859. key: "get",
  860. value: function get(index) {
  861. var bufIndex = Math.floor(index / 8);
  862. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  863. }
  864. }, {
  865. key: "put",
  866. value: function put(num, length) {
  867. for (var _i23 = 0; _i23 < length; _i23++) {
  868. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  869. }
  870. }
  871. }, {
  872. key: "getLengthInBits",
  873. value: function getLengthInBits() {
  874. return this.length;
  875. }
  876. }, {
  877. key: "putBit",
  878. value: function putBit(bit) {
  879. var bufIndex = Math.floor(this.length / 8);
  880. if (this.buffer.length <= bufIndex) {
  881. this.buffer.push(0);
  882. }
  883. if (bit) {
  884. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  885. }
  886. this.length++;
  887. }
  888. }]);
  889. return QRBitBuffer;
  890. }();
  891. /*
  892. * Class Drawing
  893. * */
  894. var Drawing = /*#__PURE__*/function () {
  895. function Drawing(el, opts) {
  896. (0, _classCallCheck2.default)(this, Drawing);
  897. this._opts = opts;
  898. this._el = el;
  899. this._ctx = uni.createCanvasContext(el);
  900. }
  901. (0, _createClass2.default)(Drawing, [{
  902. key: "draw",
  903. value: function draw(QRCode) {
  904. var ctx = this._ctx,
  905. opts = this._opts;
  906. var ctxPosFix = opts.width / 20;
  907. //console.log(opts.width)
  908. var count = QRCode.getModuleCount(),
  909. width = (opts.width - 2 * ctxPosFix) / count,
  910. height = (opts.height - 2 * ctxPosFix) / count,
  911. roundedWidth = Math.round(width),
  912. roundedHeight = Math.round(height);
  913. this.clear();
  914. ctx.setFillStyle('#fff');
  915. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  916. for (var row = 0; row < count; row++) {
  917. for (var col = 0; col < count; col++) {
  918. var isDark = QRCode.isDark(row, col),
  919. left = col * width + ctxPosFix,
  920. top = row * height + ctxPosFix;
  921. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  922. ctx.setLineWidth(1);
  923. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  924. ctx.fillRect(left, top, width, height);
  925. ctx.strokeRect(Math.floor(left) + 0.5, Math.floor(top) + 0.5, roundedWidth, roundedHeight);
  926. ctx.strokeRect(Math.ceil(left) - 0.5, Math.ceil(top) - 0.5, roundedWidth, roundedHeight);
  927. }
  928. }
  929. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  930. ctx.draw();
  931. this._bIsPainted = true;
  932. if (this._opts.successTips && drawingOptsSuccessTips) {
  933. uni.hideLoading();
  934. uni.showToast({
  935. title: '生成成功',
  936. icon: 'success',
  937. duration: 1000
  938. });
  939. }
  940. drawingOptsSuccessTips = true;
  941. }
  942. }, {
  943. key: "clear",
  944. value: function clear() {
  945. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  946. }
  947. /** anlib **/
  948. /**
  949. * 二维码上添加图片
  950. */
  951. }, {
  952. key: "drawImg",
  953. value: function drawImg(src, width, ctx) {
  954. // logo相对二维码的比例
  955. var scale = 5;
  956. // logo相对二维码的大小
  957. var imgSize = width / scale;
  958. // 偏移位置起始点
  959. var imgPos = width / scale * 2;
  960. // 二维码边框尺寸,这里设置为原宽度的80分之一
  961. var imgPosFix = width / 80;
  962. //console.log('width', width);
  963. //console.log('imgSize', imgSize);
  964. //console.log('imgPos', imgPos);
  965. //console.log('imgPosFix', imgPosFix);
  966. //console.log('src', src);
  967. ctx.setFillStyle('#fff');
  968. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  969. ctx.beginPath();
  970. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  971. ctx.stroke();
  972. ctx.closePath();
  973. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  974. ctx.beginPath();
  975. }
  976. }]);
  977. return Drawing;
  978. }();
  979. /*
  980. * Class QRCode
  981. * */
  982. var QRCode = function () {
  983. /**
  984. * Get the type by string length
  985. * @author anlib
  986. * @private
  987. * @param {String} text
  988. * @param {Number} correctLevel
  989. * @return {Number} type
  990. */
  991. function getTypeNumber(text, correctLevel) {
  992. var type = 1,
  993. length = getUTF8Length(text),
  994. QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];
  995. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  996. var limit = 0;
  997. switch (correctLevel) {
  998. case QRErrorCorrectLevel.L:
  999. limit = QRCodeLimitLength[_i24][0];
  1000. break;
  1001. case QRErrorCorrectLevel.M:
  1002. limit = QRCodeLimitLength[_i24][1];
  1003. break;
  1004. case QRErrorCorrectLevel.Q:
  1005. limit = QRCodeLimitLength[_i24][2];
  1006. break;
  1007. case QRErrorCorrectLevel.H:
  1008. limit = QRCodeLimitLength[_i24][3];
  1009. break;
  1010. }
  1011. if (length <= limit) {
  1012. break;
  1013. } else {
  1014. type++;
  1015. }
  1016. }
  1017. if (type > QRCodeLimitLength.length) {
  1018. // throw new Error('Too long data'); //supfire
  1019. throwError('Too long data');
  1020. }
  1021. return type;
  1022. }
  1023. function getUTF8Length(text) {
  1024. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  1025. return replacedText.length + (replacedText.length != text ? 3 : 0);
  1026. }
  1027. var Fn = /*#__PURE__*/function () {
  1028. function Fn(el, opts) {
  1029. (0, _classCallCheck2.default)(this, Fn);
  1030. this._opts = {
  1031. width: 300,
  1032. height: 300,
  1033. typeNumber: 4,
  1034. colorDark: '#000000',
  1035. colorLight: '#ffffff',
  1036. correctLevel: Fn.correctLevel.H,
  1037. logo: false,
  1038. successTips: false
  1039. };
  1040. if (typeof opts === 'string') {
  1041. opts = {
  1042. text: opts
  1043. };
  1044. }
  1045. // Overwrites options 简单拷贝
  1046. if (opts) {
  1047. for (var _i25 in opts) {
  1048. if (opts.hasOwnProperty(_i25)) {
  1049. this._opts[_i25] = opts[_i25];
  1050. }
  1051. }
  1052. }
  1053. this._el = el;
  1054. this._QRCode = null;
  1055. this._drawing = new Drawing(this._el, this._opts);
  1056. if (this._opts.text) {
  1057. this.makeCode(this._opts.text);
  1058. }
  1059. }
  1060. (0, _createClass2.default)(Fn, [{
  1061. key: "makeCode",
  1062. value: function makeCode(text) {
  1063. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.correctLevel);
  1064. this._QRCode.addData(text);
  1065. this._QRCode.make();
  1066. this._drawing.draw(this._QRCode);
  1067. }
  1068. }, {
  1069. key: "clear",
  1070. value: function clear() {
  1071. this._drawing.clear();
  1072. }
  1073. }]);
  1074. return Fn;
  1075. }();
  1076. Fn.correctLevel = QRErrorCorrectLevel;
  1077. return Fn;
  1078. }();
  1079. /** anlib **/
  1080. var drawingOptsSuccessTips = true;
  1081. /**
  1082. * 抛出错误
  1083. */
  1084. function throwError(str) {
  1085. uni.hideLoading();
  1086. uni.showToast({
  1087. title: '有字符暂不支持',
  1088. icon: 'none',
  1089. duration: 2000
  1090. });
  1091. drawingOptsSuccessTips = false;
  1092. //throw new Error(str);
  1093. }
  1094. var _default = QRCode;
  1095. exports.default = _default;
  1096. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  1097. /***/ }),
  1098. /***/ 15:
  1099. /*!**********************************************************!*\
  1100. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  1101. \**********************************************************/
  1102. /*! no static exports found */
  1103. /***/ (function(module, exports, __webpack_require__) {
  1104. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1105. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  1106. function _construct(Parent, args, Class) {
  1107. if (isNativeReflectConstruct()) {
  1108. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  1109. } else {
  1110. module.exports = _construct = function _construct(Parent, args, Class) {
  1111. var a = [null];
  1112. a.push.apply(a, args);
  1113. var Constructor = Function.bind.apply(Parent, a);
  1114. var instance = new Constructor();
  1115. if (Class) setPrototypeOf(instance, Class.prototype);
  1116. return instance;
  1117. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1118. }
  1119. return _construct.apply(null, arguments);
  1120. }
  1121. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1122. /***/ }),
  1123. /***/ 16:
  1124. /*!***************************************************************!*\
  1125. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  1126. \***************************************************************/
  1127. /*! no static exports found */
  1128. /***/ (function(module, exports) {
  1129. function _setPrototypeOf(o, p) {
  1130. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  1131. o.__proto__ = p;
  1132. return o;
  1133. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1134. return _setPrototypeOf(o, p);
  1135. }
  1136. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1137. /***/ }),
  1138. /***/ 17:
  1139. /*!*************************************************************************!*\
  1140. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  1141. \*************************************************************************/
  1142. /*! no static exports found */
  1143. /***/ (function(module, exports) {
  1144. function _isNativeReflectConstruct() {
  1145. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  1146. if (Reflect.construct.sham) return false;
  1147. if (typeof Proxy === "function") return true;
  1148. try {
  1149. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  1150. return true;
  1151. } catch (e) {
  1152. return false;
  1153. }
  1154. }
  1155. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1156. /***/ }),
  1157. /***/ 18:
  1158. /*!******************************************************************!*\
  1159. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  1160. \******************************************************************/
  1161. /*! no static exports found */
  1162. /***/ (function(module, exports, __webpack_require__) {
  1163. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  1164. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  1165. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  1166. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  1167. function _toConsumableArray(arr) {
  1168. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  1169. }
  1170. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1171. /***/ }),
  1172. /***/ 19:
  1173. /*!******************************************************************!*\
  1174. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1175. \******************************************************************/
  1176. /*! no static exports found */
  1177. /***/ (function(module, exports, __webpack_require__) {
  1178. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1179. function _arrayWithoutHoles(arr) {
  1180. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1181. }
  1182. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1183. /***/ }),
  1184. /***/ 2:
  1185. /*!************************************************************!*\
  1186. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  1187. \************************************************************/
  1188. /*! no static exports found */
  1189. /***/ (function(module, exports, __webpack_require__) {
  1190. "use strict";
  1191. /* WEBPACK VAR INJECTION */(function(wx, global) {
  1192. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1193. Object.defineProperty(exports, "__esModule", {
  1194. value: true
  1195. });
  1196. exports.createApp = createApp;
  1197. exports.createComponent = createComponent;
  1198. exports.createPage = createPage;
  1199. exports.createPlugin = createPlugin;
  1200. exports.createSubpackageApp = createSubpackageApp;
  1201. exports.default = void 0;
  1202. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  1203. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  1204. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  1205. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  1206. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1207. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  1208. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  1209. 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; }
  1210. 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; }
  1211. var realAtob;
  1212. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  1213. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  1214. if (typeof atob !== 'function') {
  1215. realAtob = function realAtob(str) {
  1216. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  1217. if (!b64re.test(str)) {
  1218. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  1219. }
  1220. // Adding the padding if missing, for semplicity
  1221. str += '=='.slice(2 - (str.length & 3));
  1222. var bitmap;
  1223. var result = '';
  1224. var r1;
  1225. var r2;
  1226. var i = 0;
  1227. for (; i < str.length;) {
  1228. 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++)));
  1229. 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);
  1230. }
  1231. return result;
  1232. };
  1233. } else {
  1234. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  1235. realAtob = atob;
  1236. }
  1237. function b64DecodeUnicode(str) {
  1238. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  1239. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  1240. }).join(''));
  1241. }
  1242. function getCurrentUserInfo() {
  1243. var token = wx.getStorageSync('uni_id_token') || '';
  1244. var tokenArr = token.split('.');
  1245. if (!token || tokenArr.length !== 3) {
  1246. return {
  1247. uid: null,
  1248. role: [],
  1249. permission: [],
  1250. tokenExpired: 0
  1251. };
  1252. }
  1253. var userInfo;
  1254. try {
  1255. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  1256. } catch (error) {
  1257. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  1258. }
  1259. userInfo.tokenExpired = userInfo.exp * 1000;
  1260. delete userInfo.exp;
  1261. delete userInfo.iat;
  1262. return userInfo;
  1263. }
  1264. function uniIdMixin(Vue) {
  1265. Vue.prototype.uniIDHasRole = function (roleId) {
  1266. var _getCurrentUserInfo = getCurrentUserInfo(),
  1267. role = _getCurrentUserInfo.role;
  1268. return role.indexOf(roleId) > -1;
  1269. };
  1270. Vue.prototype.uniIDHasPermission = function (permissionId) {
  1271. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  1272. permission = _getCurrentUserInfo2.permission;
  1273. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  1274. };
  1275. Vue.prototype.uniIDTokenValid = function () {
  1276. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  1277. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  1278. return tokenExpired > Date.now();
  1279. };
  1280. }
  1281. var _toString = Object.prototype.toString;
  1282. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1283. function isFn(fn) {
  1284. return typeof fn === 'function';
  1285. }
  1286. function isStr(str) {
  1287. return typeof str === 'string';
  1288. }
  1289. function isObject(obj) {
  1290. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  1291. }
  1292. function isPlainObject(obj) {
  1293. return _toString.call(obj) === '[object Object]';
  1294. }
  1295. function hasOwn(obj, key) {
  1296. return hasOwnProperty.call(obj, key);
  1297. }
  1298. function noop() {}
  1299. /**
  1300. * Create a cached version of a pure function.
  1301. */
  1302. function cached(fn) {
  1303. var cache = Object.create(null);
  1304. return function cachedFn(str) {
  1305. var hit = cache[str];
  1306. return hit || (cache[str] = fn(str));
  1307. };
  1308. }
  1309. /**
  1310. * Camelize a hyphen-delimited string.
  1311. */
  1312. var camelizeRE = /-(\w)/g;
  1313. var camelize = cached(function (str) {
  1314. return str.replace(camelizeRE, function (_, c) {
  1315. return c ? c.toUpperCase() : '';
  1316. });
  1317. });
  1318. function sortObject(obj) {
  1319. var sortObj = {};
  1320. if (isPlainObject(obj)) {
  1321. Object.keys(obj).sort().forEach(function (key) {
  1322. sortObj[key] = obj[key];
  1323. });
  1324. }
  1325. return !Object.keys(sortObj) ? obj : sortObj;
  1326. }
  1327. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  1328. var globalInterceptors = {};
  1329. var scopedInterceptors = {};
  1330. function mergeHook(parentVal, childVal) {
  1331. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  1332. return res ? dedupeHooks(res) : res;
  1333. }
  1334. function dedupeHooks(hooks) {
  1335. var res = [];
  1336. for (var i = 0; i < hooks.length; i++) {
  1337. if (res.indexOf(hooks[i]) === -1) {
  1338. res.push(hooks[i]);
  1339. }
  1340. }
  1341. return res;
  1342. }
  1343. function removeHook(hooks, hook) {
  1344. var index = hooks.indexOf(hook);
  1345. if (index !== -1) {
  1346. hooks.splice(index, 1);
  1347. }
  1348. }
  1349. function mergeInterceptorHook(interceptor, option) {
  1350. Object.keys(option).forEach(function (hook) {
  1351. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1352. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  1353. }
  1354. });
  1355. }
  1356. function removeInterceptorHook(interceptor, option) {
  1357. if (!interceptor || !option) {
  1358. return;
  1359. }
  1360. Object.keys(option).forEach(function (hook) {
  1361. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1362. removeHook(interceptor[hook], option[hook]);
  1363. }
  1364. });
  1365. }
  1366. function addInterceptor(method, option) {
  1367. if (typeof method === 'string' && isPlainObject(option)) {
  1368. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  1369. } else if (isPlainObject(method)) {
  1370. mergeInterceptorHook(globalInterceptors, method);
  1371. }
  1372. }
  1373. function removeInterceptor(method, option) {
  1374. if (typeof method === 'string') {
  1375. if (isPlainObject(option)) {
  1376. removeInterceptorHook(scopedInterceptors[method], option);
  1377. } else {
  1378. delete scopedInterceptors[method];
  1379. }
  1380. } else if (isPlainObject(method)) {
  1381. removeInterceptorHook(globalInterceptors, method);
  1382. }
  1383. }
  1384. function wrapperHook(hook) {
  1385. return function (data) {
  1386. return hook(data) || data;
  1387. };
  1388. }
  1389. function isPromise(obj) {
  1390. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  1391. }
  1392. function queue(hooks, data) {
  1393. var promise = false;
  1394. for (var i = 0; i < hooks.length; i++) {
  1395. var hook = hooks[i];
  1396. if (promise) {
  1397. promise = Promise.resolve(wrapperHook(hook));
  1398. } else {
  1399. var res = hook(data);
  1400. if (isPromise(res)) {
  1401. promise = Promise.resolve(res);
  1402. }
  1403. if (res === false) {
  1404. return {
  1405. then: function then() {}
  1406. };
  1407. }
  1408. }
  1409. }
  1410. return promise || {
  1411. then: function then(callback) {
  1412. return callback(data);
  1413. }
  1414. };
  1415. }
  1416. function wrapperOptions(interceptor) {
  1417. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1418. ['success', 'fail', 'complete'].forEach(function (name) {
  1419. if (Array.isArray(interceptor[name])) {
  1420. var oldCallback = options[name];
  1421. options[name] = function callbackInterceptor(res) {
  1422. queue(interceptor[name], res).then(function (res) {
  1423. /* eslint-disable no-mixed-operators */
  1424. return isFn(oldCallback) && oldCallback(res) || res;
  1425. });
  1426. };
  1427. }
  1428. });
  1429. return options;
  1430. }
  1431. function wrapperReturnValue(method, returnValue) {
  1432. var returnValueHooks = [];
  1433. if (Array.isArray(globalInterceptors.returnValue)) {
  1434. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1435. }
  1436. var interceptor = scopedInterceptors[method];
  1437. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1438. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1439. }
  1440. returnValueHooks.forEach(function (hook) {
  1441. returnValue = hook(returnValue) || returnValue;
  1442. });
  1443. return returnValue;
  1444. }
  1445. function getApiInterceptorHooks(method) {
  1446. var interceptor = Object.create(null);
  1447. Object.keys(globalInterceptors).forEach(function (hook) {
  1448. if (hook !== 'returnValue') {
  1449. interceptor[hook] = globalInterceptors[hook].slice();
  1450. }
  1451. });
  1452. var scopedInterceptor = scopedInterceptors[method];
  1453. if (scopedInterceptor) {
  1454. Object.keys(scopedInterceptor).forEach(function (hook) {
  1455. if (hook !== 'returnValue') {
  1456. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1457. }
  1458. });
  1459. }
  1460. return interceptor;
  1461. }
  1462. function invokeApi(method, api, options) {
  1463. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1464. params[_key - 3] = arguments[_key];
  1465. }
  1466. var interceptor = getApiInterceptorHooks(method);
  1467. if (interceptor && Object.keys(interceptor).length) {
  1468. if (Array.isArray(interceptor.invoke)) {
  1469. var res = queue(interceptor.invoke, options);
  1470. return res.then(function (options) {
  1471. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1472. });
  1473. } else {
  1474. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1475. }
  1476. }
  1477. return api.apply(void 0, [options].concat(params));
  1478. }
  1479. var promiseInterceptor = {
  1480. returnValue: function returnValue(res) {
  1481. if (!isPromise(res)) {
  1482. return res;
  1483. }
  1484. return new Promise(function (resolve, reject) {
  1485. res.then(function (res) {
  1486. if (res[0]) {
  1487. reject(res[0]);
  1488. } else {
  1489. resolve(res[1]);
  1490. }
  1491. });
  1492. });
  1493. }
  1494. };
  1495. 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/;
  1496. var CONTEXT_API_RE = /^create|Manager$/;
  1497. // Context例外情况
  1498. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1499. // 同步例外情况
  1500. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1501. var CALLBACK_API_RE = /^on|^off/;
  1502. function isContextApi(name) {
  1503. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1504. }
  1505. function isSyncApi(name) {
  1506. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1507. }
  1508. function isCallbackApi(name) {
  1509. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1510. }
  1511. function handlePromise(promise) {
  1512. return promise.then(function (data) {
  1513. return [null, data];
  1514. }).catch(function (err) {
  1515. return [err];
  1516. });
  1517. }
  1518. function shouldPromise(name) {
  1519. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1520. return false;
  1521. }
  1522. return true;
  1523. }
  1524. /* eslint-disable no-extend-native */
  1525. if (!Promise.prototype.finally) {
  1526. Promise.prototype.finally = function (callback) {
  1527. var promise = this.constructor;
  1528. return this.then(function (value) {
  1529. return promise.resolve(callback()).then(function () {
  1530. return value;
  1531. });
  1532. }, function (reason) {
  1533. return promise.resolve(callback()).then(function () {
  1534. throw reason;
  1535. });
  1536. });
  1537. };
  1538. }
  1539. function promisify(name, api) {
  1540. if (!shouldPromise(name) || !isFn(api)) {
  1541. return api;
  1542. }
  1543. return function promiseApi() {
  1544. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1545. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1546. params[_key2 - 1] = arguments[_key2];
  1547. }
  1548. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1549. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1550. }
  1551. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1552. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1553. success: resolve,
  1554. fail: reject
  1555. })].concat(params));
  1556. })));
  1557. };
  1558. }
  1559. var EPS = 1e-4;
  1560. var BASE_DEVICE_WIDTH = 750;
  1561. var isIOS = false;
  1562. var deviceWidth = 0;
  1563. var deviceDPR = 0;
  1564. function checkDeviceWidth() {
  1565. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1566. platform = _wx$getSystemInfoSync.platform,
  1567. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1568. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1569. deviceWidth = windowWidth;
  1570. deviceDPR = pixelRatio;
  1571. isIOS = platform === 'ios';
  1572. }
  1573. function upx2px(number, newDeviceWidth) {
  1574. if (deviceWidth === 0) {
  1575. checkDeviceWidth();
  1576. }
  1577. number = Number(number);
  1578. if (number === 0) {
  1579. return 0;
  1580. }
  1581. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1582. if (result < 0) {
  1583. result = -result;
  1584. }
  1585. result = Math.floor(result + EPS);
  1586. if (result === 0) {
  1587. if (deviceDPR === 1 || !isIOS) {
  1588. result = 1;
  1589. } else {
  1590. result = 0.5;
  1591. }
  1592. }
  1593. return number < 0 ? -result : result;
  1594. }
  1595. var LOCALE_ZH_HANS = 'zh-Hans';
  1596. var LOCALE_ZH_HANT = 'zh-Hant';
  1597. var LOCALE_EN = 'en';
  1598. var LOCALE_FR = 'fr';
  1599. var LOCALE_ES = 'es';
  1600. var messages = {};
  1601. var locale;
  1602. {
  1603. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1604. }
  1605. function initI18nMessages() {
  1606. if (!isEnableLocale()) {
  1607. return;
  1608. }
  1609. var localeKeys = Object.keys(__uniConfig.locales);
  1610. if (localeKeys.length) {
  1611. localeKeys.forEach(function (locale) {
  1612. var curMessages = messages[locale];
  1613. var userMessages = __uniConfig.locales[locale];
  1614. if (curMessages) {
  1615. Object.assign(curMessages, userMessages);
  1616. } else {
  1617. messages[locale] = userMessages;
  1618. }
  1619. });
  1620. }
  1621. }
  1622. initI18nMessages();
  1623. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1624. var t = i18n.t;
  1625. var i18nMixin = i18n.mixin = {
  1626. beforeCreate: function beforeCreate() {
  1627. var _this = this;
  1628. var unwatch = i18n.i18n.watchLocale(function () {
  1629. _this.$forceUpdate();
  1630. });
  1631. this.$once('hook:beforeDestroy', function () {
  1632. unwatch();
  1633. });
  1634. },
  1635. methods: {
  1636. $$t: function $$t(key, values) {
  1637. return t(key, values);
  1638. }
  1639. }
  1640. };
  1641. var setLocale = i18n.setLocale;
  1642. var getLocale = i18n.getLocale;
  1643. function initAppLocale(Vue, appVm, locale) {
  1644. var state = Vue.observable({
  1645. locale: locale || i18n.getLocale()
  1646. });
  1647. var localeWatchers = [];
  1648. appVm.$watchLocale = function (fn) {
  1649. localeWatchers.push(fn);
  1650. };
  1651. Object.defineProperty(appVm, '$locale', {
  1652. get: function get() {
  1653. return state.locale;
  1654. },
  1655. set: function set(v) {
  1656. state.locale = v;
  1657. localeWatchers.forEach(function (watch) {
  1658. return watch(v);
  1659. });
  1660. }
  1661. });
  1662. }
  1663. function isEnableLocale() {
  1664. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1665. }
  1666. function include(str, parts) {
  1667. return !!parts.find(function (part) {
  1668. return str.indexOf(part) !== -1;
  1669. });
  1670. }
  1671. function startsWith(str, parts) {
  1672. return parts.find(function (part) {
  1673. return str.indexOf(part) === 0;
  1674. });
  1675. }
  1676. function normalizeLocale(locale, messages) {
  1677. if (!locale) {
  1678. return;
  1679. }
  1680. locale = locale.trim().replace(/_/g, '-');
  1681. if (messages && messages[locale]) {
  1682. return locale;
  1683. }
  1684. locale = locale.toLowerCase();
  1685. if (locale === 'chinese') {
  1686. // 支付宝
  1687. return LOCALE_ZH_HANS;
  1688. }
  1689. if (locale.indexOf('zh') === 0) {
  1690. if (locale.indexOf('-hans') > -1) {
  1691. return LOCALE_ZH_HANS;
  1692. }
  1693. if (locale.indexOf('-hant') > -1) {
  1694. return LOCALE_ZH_HANT;
  1695. }
  1696. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1697. return LOCALE_ZH_HANT;
  1698. }
  1699. return LOCALE_ZH_HANS;
  1700. }
  1701. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1702. if (lang) {
  1703. return lang;
  1704. }
  1705. }
  1706. // export function initI18n() {
  1707. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1708. // if (localeKeys.length) {
  1709. // localeKeys.forEach((locale) =>
  1710. // i18n.add(locale, __uniConfig.locales[locale])
  1711. // )
  1712. // }
  1713. // }
  1714. function getLocale$1() {
  1715. // 优先使用 $locale
  1716. if (isFn(getApp)) {
  1717. var app = getApp({
  1718. allowDefault: true
  1719. });
  1720. if (app && app.$vm) {
  1721. return app.$vm.$locale;
  1722. }
  1723. }
  1724. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1725. }
  1726. function setLocale$1(locale) {
  1727. var app = isFn(getApp) ? getApp() : false;
  1728. if (!app) {
  1729. return false;
  1730. }
  1731. var oldLocale = app.$vm.$locale;
  1732. if (oldLocale !== locale) {
  1733. app.$vm.$locale = locale;
  1734. onLocaleChangeCallbacks.forEach(function (fn) {
  1735. return fn({
  1736. locale: locale
  1737. });
  1738. });
  1739. return true;
  1740. }
  1741. return false;
  1742. }
  1743. var onLocaleChangeCallbacks = [];
  1744. function onLocaleChange(fn) {
  1745. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1746. onLocaleChangeCallbacks.push(fn);
  1747. }
  1748. }
  1749. if (typeof global !== 'undefined') {
  1750. global.getLocale = getLocale$1;
  1751. }
  1752. var interceptors = {
  1753. promiseInterceptor: promiseInterceptor
  1754. };
  1755. var baseApi = /*#__PURE__*/Object.freeze({
  1756. __proto__: null,
  1757. upx2px: upx2px,
  1758. getLocale: getLocale$1,
  1759. setLocale: setLocale$1,
  1760. onLocaleChange: onLocaleChange,
  1761. addInterceptor: addInterceptor,
  1762. removeInterceptor: removeInterceptor,
  1763. interceptors: interceptors
  1764. });
  1765. function findExistsPageIndex(url) {
  1766. var pages = getCurrentPages();
  1767. var len = pages.length;
  1768. while (len--) {
  1769. var page = pages[len];
  1770. if (page.$page && page.$page.fullPath === url) {
  1771. return len;
  1772. }
  1773. }
  1774. return -1;
  1775. }
  1776. var redirectTo = {
  1777. name: function name(fromArgs) {
  1778. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1779. return 'navigateBack';
  1780. }
  1781. return 'redirectTo';
  1782. },
  1783. args: function args(fromArgs) {
  1784. if (fromArgs.exists === 'back' && fromArgs.url) {
  1785. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1786. if (existsPageIndex !== -1) {
  1787. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1788. if (delta > 0) {
  1789. fromArgs.delta = delta;
  1790. }
  1791. }
  1792. }
  1793. }
  1794. };
  1795. var previewImage = {
  1796. args: function args(fromArgs) {
  1797. var currentIndex = parseInt(fromArgs.current);
  1798. if (isNaN(currentIndex)) {
  1799. return;
  1800. }
  1801. var urls = fromArgs.urls;
  1802. if (!Array.isArray(urls)) {
  1803. return;
  1804. }
  1805. var len = urls.length;
  1806. if (!len) {
  1807. return;
  1808. }
  1809. if (currentIndex < 0) {
  1810. currentIndex = 0;
  1811. } else if (currentIndex >= len) {
  1812. currentIndex = len - 1;
  1813. }
  1814. if (currentIndex > 0) {
  1815. fromArgs.current = urls[currentIndex];
  1816. fromArgs.urls = urls.filter(function (item, index) {
  1817. return index < currentIndex ? item !== urls[currentIndex] : true;
  1818. });
  1819. } else {
  1820. fromArgs.current = urls[0];
  1821. }
  1822. return {
  1823. indicator: false,
  1824. loop: false
  1825. };
  1826. }
  1827. };
  1828. var UUID_KEY = '__DC_STAT_UUID';
  1829. var deviceId;
  1830. function useDeviceId(result) {
  1831. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1832. if (!deviceId) {
  1833. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1834. wx.setStorage({
  1835. key: UUID_KEY,
  1836. data: deviceId
  1837. });
  1838. }
  1839. result.deviceId = deviceId;
  1840. }
  1841. function addSafeAreaInsets(result) {
  1842. if (result.safeArea) {
  1843. var safeArea = result.safeArea;
  1844. result.safeAreaInsets = {
  1845. top: safeArea.top,
  1846. left: safeArea.left,
  1847. right: result.windowWidth - safeArea.right,
  1848. bottom: result.screenHeight - safeArea.bottom
  1849. };
  1850. }
  1851. }
  1852. function populateParameters(result) {
  1853. var _result$brand = result.brand,
  1854. brand = _result$brand === void 0 ? '' : _result$brand,
  1855. _result$model = result.model,
  1856. model = _result$model === void 0 ? '' : _result$model,
  1857. _result$system = result.system,
  1858. system = _result$system === void 0 ? '' : _result$system,
  1859. _result$language = result.language,
  1860. language = _result$language === void 0 ? '' : _result$language,
  1861. theme = result.theme,
  1862. version = result.version,
  1863. platform = result.platform,
  1864. fontSizeSetting = result.fontSizeSetting,
  1865. SDKVersion = result.SDKVersion,
  1866. pixelRatio = result.pixelRatio,
  1867. deviceOrientation = result.deviceOrientation;
  1868. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1869. // osName osVersion
  1870. var osName = '';
  1871. var osVersion = '';
  1872. {
  1873. osName = system.split(' ')[0] || '';
  1874. osVersion = system.split(' ')[1] || '';
  1875. }
  1876. var hostVersion = version;
  1877. // deviceType
  1878. var deviceType = getGetDeviceType(result, model);
  1879. // deviceModel
  1880. var deviceBrand = getDeviceBrand(brand);
  1881. // hostName
  1882. var _hostName = getHostName(result);
  1883. // deviceOrientation
  1884. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1885. // devicePixelRatio
  1886. var _devicePixelRatio = pixelRatio;
  1887. // SDKVersion
  1888. var _SDKVersion = SDKVersion;
  1889. // hostLanguage
  1890. var hostLanguage = language.replace(/_/g, '-');
  1891. // wx.getAccountInfoSync
  1892. var parameters = {
  1893. appId: "__UNI__1C40FB4",
  1894. appName: "房票科技",
  1895. appVersion: "1.0.0",
  1896. appVersionCode: "100",
  1897. appLanguage: getAppLanguage(hostLanguage),
  1898. uniCompileVersion: "3.6.18",
  1899. uniRuntimeVersion: "3.6.18",
  1900. uniPlatform: undefined || "mp-weixin",
  1901. deviceBrand: deviceBrand,
  1902. deviceModel: model,
  1903. deviceType: deviceType,
  1904. devicePixelRatio: _devicePixelRatio,
  1905. deviceOrientation: _deviceOrientation,
  1906. osName: osName.toLocaleLowerCase(),
  1907. osVersion: osVersion,
  1908. hostTheme: theme,
  1909. hostVersion: hostVersion,
  1910. hostLanguage: hostLanguage,
  1911. hostName: _hostName,
  1912. hostSDKVersion: _SDKVersion,
  1913. hostFontSizeSetting: fontSizeSetting,
  1914. windowTop: 0,
  1915. windowBottom: 0,
  1916. // TODO
  1917. osLanguage: undefined,
  1918. osTheme: undefined,
  1919. ua: undefined,
  1920. hostPackageName: undefined,
  1921. browserName: undefined,
  1922. browserVersion: undefined
  1923. };
  1924. Object.assign(result, parameters);
  1925. }
  1926. function getGetDeviceType(result, model) {
  1927. var deviceType = result.deviceType || 'phone';
  1928. {
  1929. var deviceTypeMaps = {
  1930. ipad: 'pad',
  1931. windows: 'pc',
  1932. mac: 'pc'
  1933. };
  1934. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1935. var _model = model.toLocaleLowerCase();
  1936. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1937. var _m = deviceTypeMapsKeys[index];
  1938. if (_model.indexOf(_m) !== -1) {
  1939. deviceType = deviceTypeMaps[_m];
  1940. break;
  1941. }
  1942. }
  1943. }
  1944. return deviceType;
  1945. }
  1946. function getDeviceBrand(brand) {
  1947. var deviceBrand = brand;
  1948. if (deviceBrand) {
  1949. deviceBrand = brand.toLocaleLowerCase();
  1950. }
  1951. return deviceBrand;
  1952. }
  1953. function getAppLanguage(defaultLanguage) {
  1954. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1955. }
  1956. function getHostName(result) {
  1957. var _platform = 'WeChat';
  1958. var _hostName = result.hostName || _platform; // mp-jd
  1959. {
  1960. if (result.environment) {
  1961. _hostName = result.environment;
  1962. } else if (result.host && result.host.env) {
  1963. _hostName = result.host.env;
  1964. }
  1965. }
  1966. return _hostName;
  1967. }
  1968. var getSystemInfo = {
  1969. returnValue: function returnValue(result) {
  1970. useDeviceId(result);
  1971. addSafeAreaInsets(result);
  1972. populateParameters(result);
  1973. }
  1974. };
  1975. var showActionSheet = {
  1976. args: function args(fromArgs) {
  1977. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1978. fromArgs.alertText = fromArgs.title;
  1979. }
  1980. }
  1981. };
  1982. var getAppBaseInfo = {
  1983. returnValue: function returnValue(result) {
  1984. var _result = result,
  1985. version = _result.version,
  1986. language = _result.language,
  1987. SDKVersion = _result.SDKVersion,
  1988. theme = _result.theme;
  1989. var _hostName = getHostName(result);
  1990. var hostLanguage = language.replace('_', '-');
  1991. result = sortObject(Object.assign(result, {
  1992. appId: "__UNI__1C40FB4",
  1993. appName: "房票科技",
  1994. appVersion: "1.0.0",
  1995. appVersionCode: "100",
  1996. appLanguage: getAppLanguage(hostLanguage),
  1997. hostVersion: version,
  1998. hostLanguage: hostLanguage,
  1999. hostName: _hostName,
  2000. hostSDKVersion: SDKVersion,
  2001. hostTheme: theme
  2002. }));
  2003. }
  2004. };
  2005. var getDeviceInfo = {
  2006. returnValue: function returnValue(result) {
  2007. var _result2 = result,
  2008. brand = _result2.brand,
  2009. model = _result2.model;
  2010. var deviceType = getGetDeviceType(result, model);
  2011. var deviceBrand = getDeviceBrand(brand);
  2012. useDeviceId(result);
  2013. result = sortObject(Object.assign(result, {
  2014. deviceType: deviceType,
  2015. deviceBrand: deviceBrand,
  2016. deviceModel: model
  2017. }));
  2018. }
  2019. };
  2020. var getWindowInfo = {
  2021. returnValue: function returnValue(result) {
  2022. addSafeAreaInsets(result);
  2023. result = sortObject(Object.assign(result, {
  2024. windowTop: 0,
  2025. windowBottom: 0
  2026. }));
  2027. }
  2028. };
  2029. var getAppAuthorizeSetting = {
  2030. returnValue: function returnValue(result) {
  2031. var locationReducedAccuracy = result.locationReducedAccuracy;
  2032. result.locationAccuracy = 'unsupported';
  2033. if (locationReducedAccuracy === true) {
  2034. result.locationAccuracy = 'reduced';
  2035. } else if (locationReducedAccuracy === false) {
  2036. result.locationAccuracy = 'full';
  2037. }
  2038. }
  2039. };
  2040. // import navigateTo from 'uni-helpers/navigate-to'
  2041. var protocols = {
  2042. redirectTo: redirectTo,
  2043. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  2044. previewImage: previewImage,
  2045. getSystemInfo: getSystemInfo,
  2046. getSystemInfoSync: getSystemInfo,
  2047. showActionSheet: showActionSheet,
  2048. getAppBaseInfo: getAppBaseInfo,
  2049. getDeviceInfo: getDeviceInfo,
  2050. getWindowInfo: getWindowInfo,
  2051. getAppAuthorizeSetting: getAppAuthorizeSetting
  2052. };
  2053. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  2054. var canIUses = [];
  2055. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  2056. function processCallback(methodName, method, returnValue) {
  2057. return function (res) {
  2058. return method(processReturnValue(methodName, res, returnValue));
  2059. };
  2060. }
  2061. function processArgs(methodName, fromArgs) {
  2062. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2063. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  2064. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  2065. if (isPlainObject(fromArgs)) {
  2066. // 一般 api 的参数解析
  2067. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  2068. if (isFn(argsOption)) {
  2069. argsOption = argsOption(fromArgs, toArgs) || {};
  2070. }
  2071. for (var key in fromArgs) {
  2072. if (hasOwn(argsOption, key)) {
  2073. var keyOption = argsOption[key];
  2074. if (isFn(keyOption)) {
  2075. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  2076. }
  2077. if (!keyOption) {
  2078. // 不支持的参数
  2079. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  2080. } else if (isStr(keyOption)) {
  2081. // 重写参数 key
  2082. toArgs[keyOption] = fromArgs[key];
  2083. } else if (isPlainObject(keyOption)) {
  2084. // {name:newName,value:value}可重新指定参数 key:value
  2085. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  2086. }
  2087. } else if (CALLBACKS.indexOf(key) !== -1) {
  2088. if (isFn(fromArgs[key])) {
  2089. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  2090. }
  2091. } else {
  2092. if (!keepFromArgs) {
  2093. toArgs[key] = fromArgs[key];
  2094. }
  2095. }
  2096. }
  2097. return toArgs;
  2098. } else if (isFn(fromArgs)) {
  2099. fromArgs = processCallback(methodName, fromArgs, returnValue);
  2100. }
  2101. return fromArgs;
  2102. }
  2103. function processReturnValue(methodName, res, returnValue) {
  2104. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2105. if (isFn(protocols.returnValue)) {
  2106. // 处理通用 returnValue
  2107. res = protocols.returnValue(methodName, res);
  2108. }
  2109. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  2110. }
  2111. function wrapper(methodName, method) {
  2112. if (hasOwn(protocols, methodName)) {
  2113. var protocol = protocols[methodName];
  2114. if (!protocol) {
  2115. // 暂不支持的 api
  2116. return function () {
  2117. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  2118. };
  2119. }
  2120. return function (arg1, arg2) {
  2121. // 目前 api 最多两个参数
  2122. var options = protocol;
  2123. if (isFn(protocol)) {
  2124. options = protocol(arg1);
  2125. }
  2126. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  2127. var args = [arg1];
  2128. if (typeof arg2 !== 'undefined') {
  2129. args.push(arg2);
  2130. }
  2131. if (isFn(options.name)) {
  2132. methodName = options.name(arg1);
  2133. } else if (isStr(options.name)) {
  2134. methodName = options.name;
  2135. }
  2136. var returnValue = wx[methodName].apply(wx, args);
  2137. if (isSyncApi(methodName)) {
  2138. // 同步 api
  2139. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  2140. }
  2141. return returnValue;
  2142. };
  2143. }
  2144. return method;
  2145. }
  2146. var todoApis = Object.create(null);
  2147. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  2148. function createTodoApi(name) {
  2149. return function todoApi(_ref) {
  2150. var fail = _ref.fail,
  2151. complete = _ref.complete;
  2152. var res = {
  2153. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  2154. };
  2155. isFn(fail) && fail(res);
  2156. isFn(complete) && complete(res);
  2157. };
  2158. }
  2159. TODOS.forEach(function (name) {
  2160. todoApis[name] = createTodoApi(name);
  2161. });
  2162. var providers = {
  2163. oauth: ['weixin'],
  2164. share: ['weixin'],
  2165. payment: ['wxpay'],
  2166. push: ['weixin']
  2167. };
  2168. function getProvider(_ref2) {
  2169. var service = _ref2.service,
  2170. success = _ref2.success,
  2171. fail = _ref2.fail,
  2172. complete = _ref2.complete;
  2173. var res = false;
  2174. if (providers[service]) {
  2175. res = {
  2176. errMsg: 'getProvider:ok',
  2177. service: service,
  2178. provider: providers[service]
  2179. };
  2180. isFn(success) && success(res);
  2181. } else {
  2182. res = {
  2183. errMsg: 'getProvider:fail service not found'
  2184. };
  2185. isFn(fail) && fail(res);
  2186. }
  2187. isFn(complete) && complete(res);
  2188. }
  2189. var extraApi = /*#__PURE__*/Object.freeze({
  2190. __proto__: null,
  2191. getProvider: getProvider
  2192. });
  2193. var getEmitter = function () {
  2194. var Emitter;
  2195. return function getUniEmitter() {
  2196. if (!Emitter) {
  2197. Emitter = new _vue.default();
  2198. }
  2199. return Emitter;
  2200. };
  2201. }();
  2202. function apply(ctx, method, args) {
  2203. return ctx[method].apply(ctx, args);
  2204. }
  2205. function $on() {
  2206. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  2207. }
  2208. function $off() {
  2209. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  2210. }
  2211. function $once() {
  2212. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  2213. }
  2214. function $emit() {
  2215. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  2216. }
  2217. var eventApi = /*#__PURE__*/Object.freeze({
  2218. __proto__: null,
  2219. $on: $on,
  2220. $off: $off,
  2221. $once: $once,
  2222. $emit: $emit
  2223. });
  2224. /**
  2225. * 框架内 try-catch
  2226. */
  2227. /**
  2228. * 开发者 try-catch
  2229. */
  2230. function tryCatch(fn) {
  2231. return function () {
  2232. try {
  2233. return fn.apply(fn, arguments);
  2234. } catch (e) {
  2235. // TODO
  2236. console.error(e);
  2237. }
  2238. };
  2239. }
  2240. function getApiCallbacks(params) {
  2241. var apiCallbacks = {};
  2242. for (var name in params) {
  2243. var param = params[name];
  2244. if (isFn(param)) {
  2245. apiCallbacks[name] = tryCatch(param);
  2246. delete params[name];
  2247. }
  2248. }
  2249. return apiCallbacks;
  2250. }
  2251. var cid;
  2252. var cidErrMsg;
  2253. var enabled;
  2254. function normalizePushMessage(message) {
  2255. try {
  2256. return JSON.parse(message);
  2257. } catch (e) {}
  2258. return message;
  2259. }
  2260. function invokePushCallback(args) {
  2261. if (args.type === 'enabled') {
  2262. enabled = true;
  2263. } else if (args.type === 'clientId') {
  2264. cid = args.cid;
  2265. cidErrMsg = args.errMsg;
  2266. invokeGetPushCidCallbacks(cid, args.errMsg);
  2267. } else if (args.type === 'pushMsg') {
  2268. var message = {
  2269. type: 'receive',
  2270. data: normalizePushMessage(args.message)
  2271. };
  2272. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  2273. var callback = onPushMessageCallbacks[i];
  2274. callback(message);
  2275. // 该消息已被阻止
  2276. if (message.stopped) {
  2277. break;
  2278. }
  2279. }
  2280. } else if (args.type === 'click') {
  2281. onPushMessageCallbacks.forEach(function (callback) {
  2282. callback({
  2283. type: 'click',
  2284. data: normalizePushMessage(args.message)
  2285. });
  2286. });
  2287. }
  2288. }
  2289. var getPushCidCallbacks = [];
  2290. function invokeGetPushCidCallbacks(cid, errMsg) {
  2291. getPushCidCallbacks.forEach(function (callback) {
  2292. callback(cid, errMsg);
  2293. });
  2294. getPushCidCallbacks.length = 0;
  2295. }
  2296. function getPushClientId(args) {
  2297. if (!isPlainObject(args)) {
  2298. args = {};
  2299. }
  2300. var _getApiCallbacks = getApiCallbacks(args),
  2301. success = _getApiCallbacks.success,
  2302. fail = _getApiCallbacks.fail,
  2303. complete = _getApiCallbacks.complete;
  2304. var hasSuccess = isFn(success);
  2305. var hasFail = isFn(fail);
  2306. var hasComplete = isFn(complete);
  2307. Promise.resolve().then(function () {
  2308. if (typeof enabled === 'undefined') {
  2309. enabled = false;
  2310. cid = '';
  2311. cidErrMsg = 'uniPush is not enabled';
  2312. }
  2313. getPushCidCallbacks.push(function (cid, errMsg) {
  2314. var res;
  2315. if (cid) {
  2316. res = {
  2317. errMsg: 'getPushClientId:ok',
  2318. cid: cid
  2319. };
  2320. hasSuccess && success(res);
  2321. } else {
  2322. res = {
  2323. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  2324. };
  2325. hasFail && fail(res);
  2326. }
  2327. hasComplete && complete(res);
  2328. });
  2329. if (typeof cid !== 'undefined') {
  2330. invokeGetPushCidCallbacks(cid, cidErrMsg);
  2331. }
  2332. });
  2333. }
  2334. var onPushMessageCallbacks = [];
  2335. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  2336. var onPushMessage = function onPushMessage(fn) {
  2337. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  2338. onPushMessageCallbacks.push(fn);
  2339. }
  2340. };
  2341. var offPushMessage = function offPushMessage(fn) {
  2342. if (!fn) {
  2343. onPushMessageCallbacks.length = 0;
  2344. } else {
  2345. var index = onPushMessageCallbacks.indexOf(fn);
  2346. if (index > -1) {
  2347. onPushMessageCallbacks.splice(index, 1);
  2348. }
  2349. }
  2350. };
  2351. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  2352. if (!baseInfo) {
  2353. baseInfo = wx.getSystemInfoSync();
  2354. }
  2355. var host = baseInfo ? baseInfo.host : null;
  2356. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  2357. var api = /*#__PURE__*/Object.freeze({
  2358. __proto__: null,
  2359. shareVideoMessage: shareVideoMessage,
  2360. getPushClientId: getPushClientId,
  2361. onPushMessage: onPushMessage,
  2362. offPushMessage: offPushMessage,
  2363. invokePushCallback: invokePushCallback
  2364. });
  2365. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  2366. function findVmByVueId(vm, vuePid) {
  2367. var $children = vm.$children;
  2368. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  2369. for (var i = $children.length - 1; i >= 0; i--) {
  2370. var childVm = $children[i];
  2371. if (childVm.$scope._$vueId === vuePid) {
  2372. return childVm;
  2373. }
  2374. }
  2375. // 反向递归查找
  2376. var parentVm;
  2377. for (var _i = $children.length - 1; _i >= 0; _i--) {
  2378. parentVm = findVmByVueId($children[_i], vuePid);
  2379. if (parentVm) {
  2380. return parentVm;
  2381. }
  2382. }
  2383. }
  2384. function initBehavior(options) {
  2385. return Behavior(options);
  2386. }
  2387. function isPage() {
  2388. return !!this.route;
  2389. }
  2390. function initRelation(detail) {
  2391. this.triggerEvent('__l', detail);
  2392. }
  2393. function selectAllComponents(mpInstance, selector, $refs) {
  2394. var components = mpInstance.selectAllComponents(selector) || [];
  2395. components.forEach(function (component) {
  2396. var ref = component.dataset.ref;
  2397. $refs[ref] = component.$vm || toSkip(component);
  2398. {
  2399. if (component.dataset.vueGeneric === 'scoped') {
  2400. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2401. selectAllComponents(scopedComponent, selector, $refs);
  2402. });
  2403. }
  2404. }
  2405. });
  2406. }
  2407. function syncRefs(refs, newRefs) {
  2408. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2409. var newKeys = Object.keys(newRefs);
  2410. newKeys.forEach(function (key) {
  2411. var oldValue = refs[key];
  2412. var newValue = newRefs[key];
  2413. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2414. return oldValue.includes(value);
  2415. })) {
  2416. return;
  2417. }
  2418. refs[key] = newValue;
  2419. oldKeys.delete(key);
  2420. });
  2421. oldKeys.forEach(function (key) {
  2422. delete refs[key];
  2423. });
  2424. return refs;
  2425. }
  2426. function initRefs(vm) {
  2427. var mpInstance = vm.$scope;
  2428. var refs = {};
  2429. Object.defineProperty(vm, '$refs', {
  2430. get: function get() {
  2431. var $refs = {};
  2432. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2433. // TODO 暂不考虑 for 中的 scoped
  2434. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2435. forComponents.forEach(function (component) {
  2436. var ref = component.dataset.ref;
  2437. if (!$refs[ref]) {
  2438. $refs[ref] = [];
  2439. }
  2440. $refs[ref].push(component.$vm || toSkip(component));
  2441. });
  2442. return syncRefs(refs, $refs);
  2443. }
  2444. });
  2445. }
  2446. function handleLink(event) {
  2447. var _ref3 = event.detail || event.value,
  2448. vuePid = _ref3.vuePid,
  2449. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2450. var parentVm;
  2451. if (vuePid) {
  2452. parentVm = findVmByVueId(this.$vm, vuePid);
  2453. }
  2454. if (!parentVm) {
  2455. parentVm = this.$vm;
  2456. }
  2457. vueOptions.parent = parentVm;
  2458. }
  2459. function markMPComponent(component) {
  2460. // 在 Vue 中标记为小程序组件
  2461. var IS_MP = '__v_isMPComponent';
  2462. Object.defineProperty(component, IS_MP, {
  2463. configurable: true,
  2464. enumerable: false,
  2465. value: true
  2466. });
  2467. return component;
  2468. }
  2469. function toSkip(obj) {
  2470. var OB = '__ob__';
  2471. var SKIP = '__v_skip';
  2472. if (isObject(obj) && Object.isExtensible(obj)) {
  2473. // 避免被 @vue/composition-api 观测
  2474. Object.defineProperty(obj, OB, {
  2475. configurable: true,
  2476. enumerable: false,
  2477. value: (0, _defineProperty2.default)({}, SKIP, true)
  2478. });
  2479. }
  2480. return obj;
  2481. }
  2482. var MPPage = Page;
  2483. var MPComponent = Component;
  2484. var customizeRE = /:/g;
  2485. var customize = cached(function (str) {
  2486. return camelize(str.replace(customizeRE, '-'));
  2487. });
  2488. function initTriggerEvent(mpInstance) {
  2489. var oldTriggerEvent = mpInstance.triggerEvent;
  2490. var newTriggerEvent = function newTriggerEvent(event) {
  2491. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2492. args[_key3 - 1] = arguments[_key3];
  2493. }
  2494. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2495. if (this.$vm || this.dataset && this.dataset.comType) {
  2496. event = customize(event);
  2497. } else {
  2498. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2499. var newEvent = customize(event);
  2500. if (newEvent !== event) {
  2501. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2502. }
  2503. }
  2504. return oldTriggerEvent.apply(this, [event].concat(args));
  2505. };
  2506. try {
  2507. // 京东小程序 triggerEvent 为只读
  2508. mpInstance.triggerEvent = newTriggerEvent;
  2509. } catch (error) {
  2510. mpInstance._triggerEvent = newTriggerEvent;
  2511. }
  2512. }
  2513. function initHook(name, options, isComponent) {
  2514. var oldHook = options[name];
  2515. options[name] = function () {
  2516. markMPComponent(this);
  2517. initTriggerEvent(this);
  2518. if (oldHook) {
  2519. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2520. args[_key4] = arguments[_key4];
  2521. }
  2522. return oldHook.apply(this, args);
  2523. }
  2524. };
  2525. }
  2526. if (!MPPage.__$wrappered) {
  2527. MPPage.__$wrappered = true;
  2528. Page = function Page() {
  2529. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2530. initHook('onLoad', options);
  2531. return MPPage(options);
  2532. };
  2533. Page.after = MPPage.after;
  2534. Component = function Component() {
  2535. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2536. initHook('created', options);
  2537. return MPComponent(options);
  2538. };
  2539. }
  2540. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2541. function initMocks(vm, mocks) {
  2542. var mpInstance = vm.$mp[vm.mpType];
  2543. mocks.forEach(function (mock) {
  2544. if (hasOwn(mpInstance, mock)) {
  2545. vm[mock] = mpInstance[mock];
  2546. }
  2547. });
  2548. }
  2549. function hasHook(hook, vueOptions) {
  2550. if (!vueOptions) {
  2551. return true;
  2552. }
  2553. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2554. return true;
  2555. }
  2556. vueOptions = vueOptions.default || vueOptions;
  2557. if (isFn(vueOptions)) {
  2558. if (isFn(vueOptions.extendOptions[hook])) {
  2559. return true;
  2560. }
  2561. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2562. return true;
  2563. }
  2564. return false;
  2565. }
  2566. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2567. return true;
  2568. }
  2569. var mixins = vueOptions.mixins;
  2570. if (Array.isArray(mixins)) {
  2571. return !!mixins.find(function (mixin) {
  2572. return hasHook(hook, mixin);
  2573. });
  2574. }
  2575. }
  2576. function initHooks(mpOptions, hooks, vueOptions) {
  2577. hooks.forEach(function (hook) {
  2578. if (hasHook(hook, vueOptions)) {
  2579. mpOptions[hook] = function (args) {
  2580. return this.$vm && this.$vm.__call_hook(hook, args);
  2581. };
  2582. }
  2583. });
  2584. }
  2585. function initUnknownHooks(mpOptions, vueOptions) {
  2586. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2587. findHooks(vueOptions).forEach(function (hook) {
  2588. return initHook$1(mpOptions, hook, excludes);
  2589. });
  2590. }
  2591. function findHooks(vueOptions) {
  2592. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2593. if (vueOptions) {
  2594. Object.keys(vueOptions).forEach(function (name) {
  2595. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2596. hooks.push(name);
  2597. }
  2598. });
  2599. }
  2600. return hooks;
  2601. }
  2602. function initHook$1(mpOptions, hook, excludes) {
  2603. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2604. mpOptions[hook] = function (args) {
  2605. return this.$vm && this.$vm.__call_hook(hook, args);
  2606. };
  2607. }
  2608. }
  2609. function initVueComponent(Vue, vueOptions) {
  2610. vueOptions = vueOptions.default || vueOptions;
  2611. var VueComponent;
  2612. if (isFn(vueOptions)) {
  2613. VueComponent = vueOptions;
  2614. } else {
  2615. VueComponent = Vue.extend(vueOptions);
  2616. }
  2617. vueOptions = VueComponent.options;
  2618. return [VueComponent, vueOptions];
  2619. }
  2620. function initSlots(vm, vueSlots) {
  2621. if (Array.isArray(vueSlots) && vueSlots.length) {
  2622. var $slots = Object.create(null);
  2623. vueSlots.forEach(function (slotName) {
  2624. $slots[slotName] = true;
  2625. });
  2626. vm.$scopedSlots = vm.$slots = $slots;
  2627. }
  2628. }
  2629. function initVueIds(vueIds, mpInstance) {
  2630. vueIds = (vueIds || '').split(',');
  2631. var len = vueIds.length;
  2632. if (len === 1) {
  2633. mpInstance._$vueId = vueIds[0];
  2634. } else if (len === 2) {
  2635. mpInstance._$vueId = vueIds[0];
  2636. mpInstance._$vuePid = vueIds[1];
  2637. }
  2638. }
  2639. function initData(vueOptions, context) {
  2640. var data = vueOptions.data || {};
  2641. var methods = vueOptions.methods || {};
  2642. if (typeof data === 'function') {
  2643. try {
  2644. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2645. } catch (e) {
  2646. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2647. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2648. }
  2649. }
  2650. } else {
  2651. try {
  2652. // 对 data 格式化
  2653. data = JSON.parse(JSON.stringify(data));
  2654. } catch (e) {}
  2655. }
  2656. if (!isPlainObject(data)) {
  2657. data = {};
  2658. }
  2659. Object.keys(methods).forEach(function (methodName) {
  2660. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2661. data[methodName] = methods[methodName];
  2662. }
  2663. });
  2664. return data;
  2665. }
  2666. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2667. function createObserver(name) {
  2668. return function observer(newVal, oldVal) {
  2669. if (this.$vm) {
  2670. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2671. }
  2672. };
  2673. }
  2674. function initBehaviors(vueOptions, initBehavior) {
  2675. var vueBehaviors = vueOptions.behaviors;
  2676. var vueExtends = vueOptions.extends;
  2677. var vueMixins = vueOptions.mixins;
  2678. var vueProps = vueOptions.props;
  2679. if (!vueProps) {
  2680. vueOptions.props = vueProps = [];
  2681. }
  2682. var behaviors = [];
  2683. if (Array.isArray(vueBehaviors)) {
  2684. vueBehaviors.forEach(function (behavior) {
  2685. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2686. if (behavior === 'uni://form-field') {
  2687. if (Array.isArray(vueProps)) {
  2688. vueProps.push('name');
  2689. vueProps.push('value');
  2690. } else {
  2691. vueProps.name = {
  2692. type: String,
  2693. default: ''
  2694. };
  2695. vueProps.value = {
  2696. type: [String, Number, Boolean, Array, Object, Date],
  2697. default: ''
  2698. };
  2699. }
  2700. }
  2701. });
  2702. }
  2703. if (isPlainObject(vueExtends) && vueExtends.props) {
  2704. behaviors.push(initBehavior({
  2705. properties: initProperties(vueExtends.props, true)
  2706. }));
  2707. }
  2708. if (Array.isArray(vueMixins)) {
  2709. vueMixins.forEach(function (vueMixin) {
  2710. if (isPlainObject(vueMixin) && vueMixin.props) {
  2711. behaviors.push(initBehavior({
  2712. properties: initProperties(vueMixin.props, true)
  2713. }));
  2714. }
  2715. });
  2716. }
  2717. return behaviors;
  2718. }
  2719. function parsePropType(key, type, defaultValue, file) {
  2720. // [String]=>String
  2721. if (Array.isArray(type) && type.length === 1) {
  2722. return type[0];
  2723. }
  2724. return type;
  2725. }
  2726. function initProperties(props) {
  2727. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2728. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2729. var options = arguments.length > 3 ? arguments[3] : undefined;
  2730. var properties = {};
  2731. if (!isBehavior) {
  2732. properties.vueId = {
  2733. type: String,
  2734. value: ''
  2735. };
  2736. {
  2737. if (options.virtualHost) {
  2738. properties.virtualHostStyle = {
  2739. type: null,
  2740. value: ''
  2741. };
  2742. properties.virtualHostClass = {
  2743. type: null,
  2744. value: ''
  2745. };
  2746. }
  2747. }
  2748. // scopedSlotsCompiler auto
  2749. properties.scopedSlotsCompiler = {
  2750. type: String,
  2751. value: ''
  2752. };
  2753. properties.vueSlots = {
  2754. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2755. type: null,
  2756. value: [],
  2757. observer: function observer(newVal, oldVal) {
  2758. var $slots = Object.create(null);
  2759. newVal.forEach(function (slotName) {
  2760. $slots[slotName] = true;
  2761. });
  2762. this.setData({
  2763. $slots: $slots
  2764. });
  2765. }
  2766. };
  2767. }
  2768. if (Array.isArray(props)) {
  2769. // ['title']
  2770. props.forEach(function (key) {
  2771. properties[key] = {
  2772. type: null,
  2773. observer: createObserver(key)
  2774. };
  2775. });
  2776. } else if (isPlainObject(props)) {
  2777. // {title:{type:String,default:''},content:String}
  2778. Object.keys(props).forEach(function (key) {
  2779. var opts = props[key];
  2780. if (isPlainObject(opts)) {
  2781. // title:{type:String,default:''}
  2782. var value = opts.default;
  2783. if (isFn(value)) {
  2784. value = value();
  2785. }
  2786. opts.type = parsePropType(key, opts.type);
  2787. properties[key] = {
  2788. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2789. value: value,
  2790. observer: createObserver(key)
  2791. };
  2792. } else {
  2793. // content:String
  2794. var type = parsePropType(key, opts);
  2795. properties[key] = {
  2796. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2797. observer: createObserver(key)
  2798. };
  2799. }
  2800. });
  2801. }
  2802. return properties;
  2803. }
  2804. function wrapper$1(event) {
  2805. // TODO 又得兼容 mpvue 的 mp 对象
  2806. try {
  2807. event.mp = JSON.parse(JSON.stringify(event));
  2808. } catch (e) {}
  2809. event.stopPropagation = noop;
  2810. event.preventDefault = noop;
  2811. event.target = event.target || {};
  2812. if (!hasOwn(event, 'detail')) {
  2813. event.detail = {};
  2814. }
  2815. if (hasOwn(event, 'markerId')) {
  2816. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2817. event.detail.markerId = event.markerId;
  2818. }
  2819. if (isPlainObject(event.detail)) {
  2820. event.target = Object.assign({}, event.target, event.detail);
  2821. }
  2822. return event;
  2823. }
  2824. function getExtraValue(vm, dataPathsArray) {
  2825. var context = vm;
  2826. dataPathsArray.forEach(function (dataPathArray) {
  2827. var dataPath = dataPathArray[0];
  2828. var value = dataPathArray[2];
  2829. if (dataPath || typeof value !== 'undefined') {
  2830. // ['','',index,'disable']
  2831. var propPath = dataPathArray[1];
  2832. var valuePath = dataPathArray[3];
  2833. var vFor;
  2834. if (Number.isInteger(dataPath)) {
  2835. vFor = dataPath;
  2836. } else if (!dataPath) {
  2837. vFor = context;
  2838. } else if (typeof dataPath === 'string' && dataPath) {
  2839. if (dataPath.indexOf('#s#') === 0) {
  2840. vFor = dataPath.substr(3);
  2841. } else {
  2842. vFor = vm.__get_value(dataPath, context);
  2843. }
  2844. }
  2845. if (Number.isInteger(vFor)) {
  2846. context = value;
  2847. } else if (!propPath) {
  2848. context = vFor[value];
  2849. } else {
  2850. if (Array.isArray(vFor)) {
  2851. context = vFor.find(function (vForItem) {
  2852. return vm.__get_value(propPath, vForItem) === value;
  2853. });
  2854. } else if (isPlainObject(vFor)) {
  2855. context = Object.keys(vFor).find(function (vForKey) {
  2856. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2857. });
  2858. } else {
  2859. console.error('v-for 暂不支持循环数据:', vFor);
  2860. }
  2861. }
  2862. if (valuePath) {
  2863. context = vm.__get_value(valuePath, context);
  2864. }
  2865. }
  2866. });
  2867. return context;
  2868. }
  2869. function processEventExtra(vm, extra, event, __args__) {
  2870. var extraObj = {};
  2871. if (Array.isArray(extra) && extra.length) {
  2872. /**
  2873. *[
  2874. * ['data.items', 'data.id', item.data.id],
  2875. * ['metas', 'id', meta.id]
  2876. *],
  2877. *[
  2878. * ['data.items', 'data.id', item.data.id],
  2879. * ['metas', 'id', meta.id]
  2880. *],
  2881. *'test'
  2882. */
  2883. extra.forEach(function (dataPath, index) {
  2884. if (typeof dataPath === 'string') {
  2885. if (!dataPath) {
  2886. // model,prop.sync
  2887. extraObj['$' + index] = vm;
  2888. } else {
  2889. if (dataPath === '$event') {
  2890. // $event
  2891. extraObj['$' + index] = event;
  2892. } else if (dataPath === 'arguments') {
  2893. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2894. } else if (dataPath.indexOf('$event.') === 0) {
  2895. // $event.target.value
  2896. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2897. } else {
  2898. extraObj['$' + index] = vm.__get_value(dataPath);
  2899. }
  2900. }
  2901. } else {
  2902. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2903. }
  2904. });
  2905. }
  2906. return extraObj;
  2907. }
  2908. function getObjByArray(arr) {
  2909. var obj = {};
  2910. for (var i = 1; i < arr.length; i++) {
  2911. var element = arr[i];
  2912. obj[element[0]] = element[1];
  2913. }
  2914. return obj;
  2915. }
  2916. function processEventArgs(vm, event) {
  2917. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2918. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2919. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2920. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2921. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2922. // fixed 用户直接触发 mpInstance.triggerEvent
  2923. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2924. if (isCustom) {
  2925. // 自定义事件
  2926. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2927. if (!args.length) {
  2928. // 无参数,直接传入 event 或 detail 数组
  2929. if (isCustomMPEvent) {
  2930. return [event];
  2931. }
  2932. return __args__;
  2933. }
  2934. }
  2935. var extraObj = processEventExtra(vm, extra, event, __args__);
  2936. var ret = [];
  2937. args.forEach(function (arg) {
  2938. if (arg === '$event') {
  2939. if (methodName === '__set_model' && !isCustom) {
  2940. // input v-model value
  2941. ret.push(event.target.value);
  2942. } else {
  2943. if (isCustom && !isCustomMPEvent) {
  2944. ret.push(__args__[0]);
  2945. } else {
  2946. // wxcomponent 组件或内置组件
  2947. ret.push(event);
  2948. }
  2949. }
  2950. } else {
  2951. if (Array.isArray(arg) && arg[0] === 'o') {
  2952. ret.push(getObjByArray(arg));
  2953. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2954. ret.push(extraObj[arg]);
  2955. } else {
  2956. ret.push(arg);
  2957. }
  2958. }
  2959. });
  2960. return ret;
  2961. }
  2962. var ONCE = '~';
  2963. var CUSTOM = '^';
  2964. function isMatchEventType(eventType, optType) {
  2965. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2966. }
  2967. function getContextVm(vm) {
  2968. var $parent = vm.$parent;
  2969. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2970. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2971. $parent = $parent.$parent;
  2972. }
  2973. return $parent && $parent.$parent;
  2974. }
  2975. function handleEvent(event) {
  2976. var _this2 = this;
  2977. event = wrapper$1(event);
  2978. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2979. var dataset = (event.currentTarget || event.target).dataset;
  2980. if (!dataset) {
  2981. return console.warn('事件信息不存在');
  2982. }
  2983. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2984. if (!eventOpts) {
  2985. return console.warn('事件信息不存在');
  2986. }
  2987. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2988. var eventType = event.type;
  2989. var ret = [];
  2990. eventOpts.forEach(function (eventOpt) {
  2991. var type = eventOpt[0];
  2992. var eventsArray = eventOpt[1];
  2993. var isCustom = type.charAt(0) === CUSTOM;
  2994. type = isCustom ? type.slice(1) : type;
  2995. var isOnce = type.charAt(0) === ONCE;
  2996. type = isOnce ? type.slice(1) : type;
  2997. if (eventsArray && isMatchEventType(eventType, type)) {
  2998. eventsArray.forEach(function (eventArray) {
  2999. var methodName = eventArray[0];
  3000. if (methodName) {
  3001. var handlerCtx = _this2.$vm;
  3002. if (handlerCtx.$options.generic) {
  3003. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  3004. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  3005. }
  3006. if (methodName === '$emit') {
  3007. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  3008. return;
  3009. }
  3010. var handler = handlerCtx[methodName];
  3011. if (!isFn(handler)) {
  3012. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  3013. var path = _this2.route || _this2.is;
  3014. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  3015. }
  3016. if (isOnce) {
  3017. if (handler.once) {
  3018. return;
  3019. }
  3020. handler.once = true;
  3021. }
  3022. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  3023. params = Array.isArray(params) ? params : [];
  3024. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  3025. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  3026. // eslint-disable-next-line no-sparse-arrays
  3027. params = params.concat([,,,,,,,,,, event]);
  3028. }
  3029. ret.push(handler.apply(handlerCtx, params));
  3030. }
  3031. });
  3032. }
  3033. });
  3034. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  3035. return ret[0];
  3036. }
  3037. }
  3038. var eventChannels = {};
  3039. var eventChannelStack = [];
  3040. function getEventChannel(id) {
  3041. if (id) {
  3042. var eventChannel = eventChannels[id];
  3043. delete eventChannels[id];
  3044. return eventChannel;
  3045. }
  3046. return eventChannelStack.shift();
  3047. }
  3048. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  3049. function initEventChannel() {
  3050. _vue.default.prototype.getOpenerEventChannel = function () {
  3051. // 微信小程序使用自身getOpenerEventChannel
  3052. {
  3053. return this.$scope.getOpenerEventChannel();
  3054. }
  3055. };
  3056. var callHook = _vue.default.prototype.__call_hook;
  3057. _vue.default.prototype.__call_hook = function (hook, args) {
  3058. if (hook === 'onLoad' && args && args.__id__) {
  3059. this.__eventChannel__ = getEventChannel(args.__id__);
  3060. delete args.__id__;
  3061. }
  3062. return callHook.call(this, hook, args);
  3063. };
  3064. }
  3065. function initScopedSlotsParams() {
  3066. var center = {};
  3067. var parents = {};
  3068. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  3069. var has = center[vueId];
  3070. if (!has) {
  3071. parents[vueId] = this;
  3072. this.$on('hook:destroyed', function () {
  3073. delete parents[vueId];
  3074. });
  3075. }
  3076. return has;
  3077. };
  3078. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  3079. var data = center[vueId];
  3080. if (data) {
  3081. var object = data[name] || {};
  3082. return key ? object[key] : object;
  3083. } else {
  3084. parents[vueId] = this;
  3085. this.$on('hook:destroyed', function () {
  3086. delete parents[vueId];
  3087. });
  3088. }
  3089. };
  3090. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  3091. var vueIds = this.$options.propsData.vueId;
  3092. if (vueIds) {
  3093. var vueId = vueIds.split(',')[0];
  3094. var object = center[vueId] = center[vueId] || {};
  3095. object[name] = value;
  3096. if (parents[vueId]) {
  3097. parents[vueId].$forceUpdate();
  3098. }
  3099. }
  3100. };
  3101. _vue.default.mixin({
  3102. destroyed: function destroyed() {
  3103. var propsData = this.$options.propsData;
  3104. var vueId = propsData && propsData.vueId;
  3105. if (vueId) {
  3106. delete center[vueId];
  3107. delete parents[vueId];
  3108. }
  3109. }
  3110. });
  3111. }
  3112. function parseBaseApp(vm, _ref4) {
  3113. var mocks = _ref4.mocks,
  3114. initRefs = _ref4.initRefs;
  3115. initEventChannel();
  3116. {
  3117. initScopedSlotsParams();
  3118. }
  3119. if (vm.$options.store) {
  3120. _vue.default.prototype.$store = vm.$options.store;
  3121. }
  3122. uniIdMixin(_vue.default);
  3123. _vue.default.prototype.mpHost = "mp-weixin";
  3124. _vue.default.mixin({
  3125. beforeCreate: function beforeCreate() {
  3126. if (!this.$options.mpType) {
  3127. return;
  3128. }
  3129. this.mpType = this.$options.mpType;
  3130. this.$mp = (0, _defineProperty2.default)({
  3131. data: {}
  3132. }, this.mpType, this.$options.mpInstance);
  3133. this.$scope = this.$options.mpInstance;
  3134. delete this.$options.mpType;
  3135. delete this.$options.mpInstance;
  3136. if (this.mpType === 'page' && typeof getApp === 'function') {
  3137. // hack vue-i18n
  3138. var app = getApp();
  3139. if (app.$vm && app.$vm.$i18n) {
  3140. this._i18n = app.$vm.$i18n;
  3141. }
  3142. }
  3143. if (this.mpType !== 'app') {
  3144. initRefs(this);
  3145. initMocks(this, mocks);
  3146. }
  3147. }
  3148. });
  3149. var appOptions = {
  3150. onLaunch: function onLaunch(args) {
  3151. if (this.$vm) {
  3152. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  3153. return;
  3154. }
  3155. {
  3156. if (wx.canIUse && !wx.canIUse('nextTick')) {
  3157. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  3158. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  3159. }
  3160. }
  3161. this.$vm = vm;
  3162. this.$vm.$mp = {
  3163. app: this
  3164. };
  3165. this.$vm.$scope = this;
  3166. // vm 上也挂载 globalData
  3167. this.$vm.globalData = this.globalData;
  3168. this.$vm._isMounted = true;
  3169. this.$vm.__call_hook('mounted', args);
  3170. this.$vm.__call_hook('onLaunch', args);
  3171. }
  3172. };
  3173. // 兼容旧版本 globalData
  3174. appOptions.globalData = vm.$options.globalData || {};
  3175. // 将 methods 中的方法挂在 getApp() 中
  3176. var methods = vm.$options.methods;
  3177. if (methods) {
  3178. Object.keys(methods).forEach(function (name) {
  3179. appOptions[name] = methods[name];
  3180. });
  3181. }
  3182. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  3183. initHooks(appOptions, hooks);
  3184. initUnknownHooks(appOptions, vm.$options);
  3185. return appOptions;
  3186. }
  3187. function parseApp(vm) {
  3188. return parseBaseApp(vm, {
  3189. mocks: mocks,
  3190. initRefs: initRefs
  3191. });
  3192. }
  3193. function createApp(vm) {
  3194. App(parseApp(vm));
  3195. return vm;
  3196. }
  3197. var encodeReserveRE = /[!'()*]/g;
  3198. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  3199. return '%' + c.charCodeAt(0).toString(16);
  3200. };
  3201. var commaRE = /%2C/g;
  3202. // fixed encodeURIComponent which is more conformant to RFC3986:
  3203. // - escapes [!'()*]
  3204. // - preserve commas
  3205. var encode = function encode(str) {
  3206. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  3207. };
  3208. function stringifyQuery(obj) {
  3209. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  3210. var res = obj ? Object.keys(obj).map(function (key) {
  3211. var val = obj[key];
  3212. if (val === undefined) {
  3213. return '';
  3214. }
  3215. if (val === null) {
  3216. return encodeStr(key);
  3217. }
  3218. if (Array.isArray(val)) {
  3219. var result = [];
  3220. val.forEach(function (val2) {
  3221. if (val2 === undefined) {
  3222. return;
  3223. }
  3224. if (val2 === null) {
  3225. result.push(encodeStr(key));
  3226. } else {
  3227. result.push(encodeStr(key) + '=' + encodeStr(val2));
  3228. }
  3229. });
  3230. return result.join('&');
  3231. }
  3232. return encodeStr(key) + '=' + encodeStr(val);
  3233. }).filter(function (x) {
  3234. return x.length > 0;
  3235. }).join('&') : null;
  3236. return res ? "?".concat(res) : '';
  3237. }
  3238. function parseBaseComponent(vueComponentOptions) {
  3239. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  3240. isPage = _ref5.isPage,
  3241. initRelation = _ref5.initRelation;
  3242. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  3243. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  3244. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  3245. VueComponent = _initVueComponent2[0],
  3246. vueOptions = _initVueComponent2[1];
  3247. var options = _objectSpread({
  3248. multipleSlots: true,
  3249. addGlobalClass: true
  3250. }, vueOptions.options || {});
  3251. {
  3252. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  3253. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  3254. Object.assign(options, vueOptions['mp-weixin'].options);
  3255. }
  3256. }
  3257. var componentOptions = {
  3258. options: options,
  3259. data: initData(vueOptions, _vue.default.prototype),
  3260. behaviors: initBehaviors(vueOptions, initBehavior),
  3261. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  3262. lifetimes: {
  3263. attached: function attached() {
  3264. var properties = this.properties;
  3265. var options = {
  3266. mpType: isPage.call(this) ? 'page' : 'component',
  3267. mpInstance: this,
  3268. propsData: properties
  3269. };
  3270. initVueIds(properties.vueId, this);
  3271. // 处理父子关系
  3272. initRelation.call(this, {
  3273. vuePid: this._$vuePid,
  3274. vueOptions: options
  3275. });
  3276. // 初始化 vue 实例
  3277. this.$vm = new VueComponent(options);
  3278. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  3279. initSlots(this.$vm, properties.vueSlots);
  3280. // 触发首次 setData
  3281. this.$vm.$mount();
  3282. },
  3283. ready: function ready() {
  3284. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  3285. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  3286. if (this.$vm) {
  3287. this.$vm._isMounted = true;
  3288. this.$vm.__call_hook('mounted');
  3289. this.$vm.__call_hook('onReady');
  3290. }
  3291. },
  3292. detached: function detached() {
  3293. this.$vm && this.$vm.$destroy();
  3294. }
  3295. },
  3296. pageLifetimes: {
  3297. show: function show(args) {
  3298. this.$vm && this.$vm.__call_hook('onPageShow', args);
  3299. },
  3300. hide: function hide() {
  3301. this.$vm && this.$vm.__call_hook('onPageHide');
  3302. },
  3303. resize: function resize(size) {
  3304. this.$vm && this.$vm.__call_hook('onPageResize', size);
  3305. }
  3306. },
  3307. methods: {
  3308. __l: handleLink,
  3309. __e: handleEvent
  3310. }
  3311. };
  3312. // externalClasses
  3313. if (vueOptions.externalClasses) {
  3314. componentOptions.externalClasses = vueOptions.externalClasses;
  3315. }
  3316. if (Array.isArray(vueOptions.wxsCallMethods)) {
  3317. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  3318. componentOptions.methods[callMethod] = function (args) {
  3319. return this.$vm[callMethod](args);
  3320. };
  3321. });
  3322. }
  3323. if (needVueOptions) {
  3324. return [componentOptions, vueOptions, VueComponent];
  3325. }
  3326. if (isPage) {
  3327. return componentOptions;
  3328. }
  3329. return [componentOptions, VueComponent];
  3330. }
  3331. function parseComponent(vueComponentOptions, needVueOptions) {
  3332. return parseBaseComponent(vueComponentOptions, {
  3333. isPage: isPage,
  3334. initRelation: initRelation
  3335. }, needVueOptions);
  3336. }
  3337. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  3338. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  3339. function parseBasePage(vuePageOptions) {
  3340. var _parseComponent = parseComponent(vuePageOptions, true),
  3341. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  3342. pageOptions = _parseComponent2[0],
  3343. vueOptions = _parseComponent2[1];
  3344. initHooks(pageOptions.methods, hooks$1, vueOptions);
  3345. pageOptions.methods.onLoad = function (query) {
  3346. this.options = query;
  3347. var copyQuery = Object.assign({}, query);
  3348. delete copyQuery.__id__;
  3349. this.$page = {
  3350. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  3351. };
  3352. this.$vm.$mp.query = query; // 兼容 mpvue
  3353. this.$vm.__call_hook('onLoad', query);
  3354. };
  3355. {
  3356. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  3357. }
  3358. return pageOptions;
  3359. }
  3360. function parsePage(vuePageOptions) {
  3361. return parseBasePage(vuePageOptions);
  3362. }
  3363. function createPage(vuePageOptions) {
  3364. {
  3365. return Component(parsePage(vuePageOptions));
  3366. }
  3367. }
  3368. function createComponent(vueOptions) {
  3369. {
  3370. return Component(parseComponent(vueOptions));
  3371. }
  3372. }
  3373. function createSubpackageApp(vm) {
  3374. var appOptions = parseApp(vm);
  3375. var app = getApp({
  3376. allowDefault: true
  3377. });
  3378. vm.$scope = app;
  3379. var globalData = app.globalData;
  3380. if (globalData) {
  3381. Object.keys(appOptions.globalData).forEach(function (name) {
  3382. if (!hasOwn(globalData, name)) {
  3383. globalData[name] = appOptions.globalData[name];
  3384. }
  3385. });
  3386. }
  3387. Object.keys(appOptions).forEach(function (name) {
  3388. if (!hasOwn(app, name)) {
  3389. app[name] = appOptions[name];
  3390. }
  3391. });
  3392. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3393. wx.onAppShow(function () {
  3394. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3395. args[_key5] = arguments[_key5];
  3396. }
  3397. vm.__call_hook('onShow', args);
  3398. });
  3399. }
  3400. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3401. wx.onAppHide(function () {
  3402. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3403. args[_key6] = arguments[_key6];
  3404. }
  3405. vm.__call_hook('onHide', args);
  3406. });
  3407. }
  3408. if (isFn(appOptions.onLaunch)) {
  3409. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3410. vm.__call_hook('onLaunch', args);
  3411. }
  3412. return vm;
  3413. }
  3414. function createPlugin(vm) {
  3415. var appOptions = parseApp(vm);
  3416. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3417. wx.onAppShow(function () {
  3418. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3419. args[_key7] = arguments[_key7];
  3420. }
  3421. vm.__call_hook('onShow', args);
  3422. });
  3423. }
  3424. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3425. wx.onAppHide(function () {
  3426. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3427. args[_key8] = arguments[_key8];
  3428. }
  3429. vm.__call_hook('onHide', args);
  3430. });
  3431. }
  3432. if (isFn(appOptions.onLaunch)) {
  3433. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3434. vm.__call_hook('onLaunch', args);
  3435. }
  3436. return vm;
  3437. }
  3438. todos.forEach(function (todoApi) {
  3439. protocols[todoApi] = false;
  3440. });
  3441. canIUses.forEach(function (canIUseApi) {
  3442. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3443. if (!wx.canIUse(apiName)) {
  3444. protocols[canIUseApi] = false;
  3445. }
  3446. });
  3447. var uni = {};
  3448. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3449. uni = new Proxy({}, {
  3450. get: function get(target, name) {
  3451. if (hasOwn(target, name)) {
  3452. return target[name];
  3453. }
  3454. if (baseApi[name]) {
  3455. return baseApi[name];
  3456. }
  3457. if (api[name]) {
  3458. return promisify(name, api[name]);
  3459. }
  3460. {
  3461. if (extraApi[name]) {
  3462. return promisify(name, extraApi[name]);
  3463. }
  3464. if (todoApis[name]) {
  3465. return promisify(name, todoApis[name]);
  3466. }
  3467. }
  3468. if (eventApi[name]) {
  3469. return eventApi[name];
  3470. }
  3471. return promisify(name, wrapper(name, wx[name]));
  3472. },
  3473. set: function set(target, name, value) {
  3474. target[name] = value;
  3475. return true;
  3476. }
  3477. });
  3478. } else {
  3479. Object.keys(baseApi).forEach(function (name) {
  3480. uni[name] = baseApi[name];
  3481. });
  3482. {
  3483. Object.keys(todoApis).forEach(function (name) {
  3484. uni[name] = promisify(name, todoApis[name]);
  3485. });
  3486. Object.keys(extraApi).forEach(function (name) {
  3487. uni[name] = promisify(name, todoApis[name]);
  3488. });
  3489. }
  3490. Object.keys(eventApi).forEach(function (name) {
  3491. uni[name] = eventApi[name];
  3492. });
  3493. Object.keys(api).forEach(function (name) {
  3494. uni[name] = promisify(name, api[name]);
  3495. });
  3496. Object.keys(wx).forEach(function (name) {
  3497. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3498. uni[name] = promisify(name, wrapper(name, wx[name]));
  3499. }
  3500. });
  3501. }
  3502. wx.createApp = createApp;
  3503. wx.createPage = createPage;
  3504. wx.createComponent = createComponent;
  3505. wx.createSubpackageApp = createSubpackageApp;
  3506. wx.createPlugin = createPlugin;
  3507. var uni$1 = uni;
  3508. var _default = uni$1;
  3509. exports.default = _default;
  3510. /* 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)))
  3511. /***/ }),
  3512. /***/ 20:
  3513. /*!****************************************************************!*\
  3514. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3515. \****************************************************************/
  3516. /*! no static exports found */
  3517. /***/ (function(module, exports) {
  3518. function _iterableToArray(iter) {
  3519. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3520. }
  3521. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3522. /***/ }),
  3523. /***/ 21:
  3524. /*!******************************************************************!*\
  3525. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3526. \******************************************************************/
  3527. /*! no static exports found */
  3528. /***/ (function(module, exports) {
  3529. function _nonIterableSpread() {
  3530. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3531. }
  3532. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3533. /***/ }),
  3534. /***/ 22:
  3535. /*!*************************************************************!*\
  3536. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3537. \*************************************************************/
  3538. /*! no static exports found */
  3539. /***/ (function(module, exports, __webpack_require__) {
  3540. "use strict";
  3541. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3542. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3543. Object.defineProperty(exports, "__esModule", {
  3544. value: true
  3545. });
  3546. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3547. exports.compileI18nJsonStr = compileI18nJsonStr;
  3548. exports.hasI18nJson = hasI18nJson;
  3549. exports.initVueI18n = initVueI18n;
  3550. exports.isI18nStr = isI18nStr;
  3551. exports.isString = void 0;
  3552. exports.normalizeLocale = normalizeLocale;
  3553. exports.parseI18nJson = parseI18nJson;
  3554. exports.resolveLocale = resolveLocale;
  3555. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3556. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3557. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3558. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3559. var isArray = Array.isArray;
  3560. var isObject = function isObject(val) {
  3561. return val !== null && (0, _typeof2.default)(val) === 'object';
  3562. };
  3563. var defaultDelimiters = ['{', '}'];
  3564. var BaseFormatter = /*#__PURE__*/function () {
  3565. function BaseFormatter() {
  3566. (0, _classCallCheck2.default)(this, BaseFormatter);
  3567. this._caches = Object.create(null);
  3568. }
  3569. (0, _createClass2.default)(BaseFormatter, [{
  3570. key: "interpolate",
  3571. value: function interpolate(message, values) {
  3572. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3573. if (!values) {
  3574. return [message];
  3575. }
  3576. var tokens = this._caches[message];
  3577. if (!tokens) {
  3578. tokens = parse(message, delimiters);
  3579. this._caches[message] = tokens;
  3580. }
  3581. return compile(tokens, values);
  3582. }
  3583. }]);
  3584. return BaseFormatter;
  3585. }();
  3586. exports.Formatter = BaseFormatter;
  3587. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3588. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3589. function parse(format, _ref) {
  3590. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3591. startDelimiter = _ref2[0],
  3592. endDelimiter = _ref2[1];
  3593. var tokens = [];
  3594. var position = 0;
  3595. var text = '';
  3596. while (position < format.length) {
  3597. var char = format[position++];
  3598. if (char === startDelimiter) {
  3599. if (text) {
  3600. tokens.push({
  3601. type: 'text',
  3602. value: text
  3603. });
  3604. }
  3605. text = '';
  3606. var sub = '';
  3607. char = format[position++];
  3608. while (char !== undefined && char !== endDelimiter) {
  3609. sub += char;
  3610. char = format[position++];
  3611. }
  3612. var isClosed = char === endDelimiter;
  3613. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3614. tokens.push({
  3615. value: sub,
  3616. type: type
  3617. });
  3618. }
  3619. // else if (char === '%') {
  3620. // // when found rails i18n syntax, skip text capture
  3621. // if (format[position] !== '{') {
  3622. // text += char
  3623. // }
  3624. // }
  3625. else {
  3626. text += char;
  3627. }
  3628. }
  3629. text && tokens.push({
  3630. type: 'text',
  3631. value: text
  3632. });
  3633. return tokens;
  3634. }
  3635. function compile(tokens, values) {
  3636. var compiled = [];
  3637. var index = 0;
  3638. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3639. if (mode === 'unknown') {
  3640. return compiled;
  3641. }
  3642. while (index < tokens.length) {
  3643. var token = tokens[index];
  3644. switch (token.type) {
  3645. case 'text':
  3646. compiled.push(token.value);
  3647. break;
  3648. case 'list':
  3649. compiled.push(values[parseInt(token.value, 10)]);
  3650. break;
  3651. case 'named':
  3652. if (mode === 'named') {
  3653. compiled.push(values[token.value]);
  3654. } else {
  3655. if (true) {
  3656. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3657. }
  3658. }
  3659. break;
  3660. case 'unknown':
  3661. if (true) {
  3662. console.warn("Detect 'unknown' type of token!");
  3663. }
  3664. break;
  3665. }
  3666. index++;
  3667. }
  3668. return compiled;
  3669. }
  3670. var LOCALE_ZH_HANS = 'zh-Hans';
  3671. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3672. var LOCALE_ZH_HANT = 'zh-Hant';
  3673. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3674. var LOCALE_EN = 'en';
  3675. exports.LOCALE_EN = LOCALE_EN;
  3676. var LOCALE_FR = 'fr';
  3677. exports.LOCALE_FR = LOCALE_FR;
  3678. var LOCALE_ES = 'es';
  3679. exports.LOCALE_ES = LOCALE_ES;
  3680. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3681. var hasOwn = function hasOwn(val, key) {
  3682. return hasOwnProperty.call(val, key);
  3683. };
  3684. var defaultFormatter = new BaseFormatter();
  3685. function include(str, parts) {
  3686. return !!parts.find(function (part) {
  3687. return str.indexOf(part) !== -1;
  3688. });
  3689. }
  3690. function startsWith(str, parts) {
  3691. return parts.find(function (part) {
  3692. return str.indexOf(part) === 0;
  3693. });
  3694. }
  3695. function normalizeLocale(locale, messages) {
  3696. if (!locale) {
  3697. return;
  3698. }
  3699. locale = locale.trim().replace(/_/g, '-');
  3700. if (messages && messages[locale]) {
  3701. return locale;
  3702. }
  3703. locale = locale.toLowerCase();
  3704. if (locale.indexOf('zh') === 0) {
  3705. if (locale.indexOf('-hans') > -1) {
  3706. return LOCALE_ZH_HANS;
  3707. }
  3708. if (locale.indexOf('-hant') > -1) {
  3709. return LOCALE_ZH_HANT;
  3710. }
  3711. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3712. return LOCALE_ZH_HANT;
  3713. }
  3714. return LOCALE_ZH_HANS;
  3715. }
  3716. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  3717. if (lang) {
  3718. return lang;
  3719. }
  3720. }
  3721. var I18n = /*#__PURE__*/function () {
  3722. function I18n(_ref3) {
  3723. var locale = _ref3.locale,
  3724. fallbackLocale = _ref3.fallbackLocale,
  3725. messages = _ref3.messages,
  3726. watcher = _ref3.watcher,
  3727. formater = _ref3.formater;
  3728. (0, _classCallCheck2.default)(this, I18n);
  3729. this.locale = LOCALE_EN;
  3730. this.fallbackLocale = LOCALE_EN;
  3731. this.message = {};
  3732. this.messages = {};
  3733. this.watchers = [];
  3734. if (fallbackLocale) {
  3735. this.fallbackLocale = fallbackLocale;
  3736. }
  3737. this.formater = formater || defaultFormatter;
  3738. this.messages = messages || {};
  3739. this.setLocale(locale || LOCALE_EN);
  3740. if (watcher) {
  3741. this.watchLocale(watcher);
  3742. }
  3743. }
  3744. (0, _createClass2.default)(I18n, [{
  3745. key: "setLocale",
  3746. value: function setLocale(locale) {
  3747. var _this = this;
  3748. var oldLocale = this.locale;
  3749. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3750. if (!this.messages[this.locale]) {
  3751. // 可能初始化时不存在
  3752. this.messages[this.locale] = {};
  3753. }
  3754. this.message = this.messages[this.locale];
  3755. // 仅发生变化时,通知
  3756. if (oldLocale !== this.locale) {
  3757. this.watchers.forEach(function (watcher) {
  3758. watcher(_this.locale, oldLocale);
  3759. });
  3760. }
  3761. }
  3762. }, {
  3763. key: "getLocale",
  3764. value: function getLocale() {
  3765. return this.locale;
  3766. }
  3767. }, {
  3768. key: "watchLocale",
  3769. value: function watchLocale(fn) {
  3770. var _this2 = this;
  3771. var index = this.watchers.push(fn) - 1;
  3772. return function () {
  3773. _this2.watchers.splice(index, 1);
  3774. };
  3775. }
  3776. }, {
  3777. key: "add",
  3778. value: function add(locale, message) {
  3779. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3780. var curMessages = this.messages[locale];
  3781. if (curMessages) {
  3782. if (override) {
  3783. Object.assign(curMessages, message);
  3784. } else {
  3785. Object.keys(message).forEach(function (key) {
  3786. if (!hasOwn(curMessages, key)) {
  3787. curMessages[key] = message[key];
  3788. }
  3789. });
  3790. }
  3791. } else {
  3792. this.messages[locale] = message;
  3793. }
  3794. }
  3795. }, {
  3796. key: "f",
  3797. value: function f(message, values, delimiters) {
  3798. return this.formater.interpolate(message, values, delimiters).join('');
  3799. }
  3800. }, {
  3801. key: "t",
  3802. value: function t(key, locale, values) {
  3803. var message = this.message;
  3804. if (typeof locale === 'string') {
  3805. locale = normalizeLocale(locale, this.messages);
  3806. locale && (message = this.messages[locale]);
  3807. } else {
  3808. values = locale;
  3809. }
  3810. if (!hasOwn(message, key)) {
  3811. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3812. return key;
  3813. }
  3814. return this.formater.interpolate(message[key], values).join('');
  3815. }
  3816. }]);
  3817. return I18n;
  3818. }();
  3819. exports.I18n = I18n;
  3820. function watchAppLocale(appVm, i18n) {
  3821. // 需要保证 watch 的触发在组件渲染之前
  3822. if (appVm.$watchLocale) {
  3823. // vue2
  3824. appVm.$watchLocale(function (newLocale) {
  3825. i18n.setLocale(newLocale);
  3826. });
  3827. } else {
  3828. appVm.$watch(function () {
  3829. return appVm.$locale;
  3830. }, function (newLocale) {
  3831. i18n.setLocale(newLocale);
  3832. });
  3833. }
  3834. }
  3835. function getDefaultLocale() {
  3836. if (typeof uni !== 'undefined' && uni.getLocale) {
  3837. return uni.getLocale();
  3838. }
  3839. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3840. if (typeof global !== 'undefined' && global.getLocale) {
  3841. return global.getLocale();
  3842. }
  3843. return LOCALE_EN;
  3844. }
  3845. function initVueI18n(locale) {
  3846. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3847. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3848. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3849. // 兼容旧版本入参
  3850. if (typeof locale !== 'string') {
  3851. var _ref4 = [messages, locale];
  3852. locale = _ref4[0];
  3853. messages = _ref4[1];
  3854. }
  3855. if (typeof locale !== 'string') {
  3856. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3857. locale = getDefaultLocale();
  3858. }
  3859. if (typeof fallbackLocale !== 'string') {
  3860. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3861. }
  3862. var i18n = new I18n({
  3863. locale: locale,
  3864. fallbackLocale: fallbackLocale,
  3865. messages: messages,
  3866. watcher: watcher
  3867. });
  3868. var _t = function t(key, values) {
  3869. if (typeof getApp !== 'function') {
  3870. // app view
  3871. /* eslint-disable no-func-assign */
  3872. _t = function t(key, values) {
  3873. return i18n.t(key, values);
  3874. };
  3875. } else {
  3876. var isWatchedAppLocale = false;
  3877. _t = function t(key, values) {
  3878. var appVm = getApp().$vm;
  3879. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3880. // options: {
  3881. // type: Array,
  3882. // default () {
  3883. // return [{
  3884. // icon: 'shop',
  3885. // text: t("uni-goods-nav.options.shop"),
  3886. // }, {
  3887. // icon: 'cart',
  3888. // text: t("uni-goods-nav.options.cart")
  3889. // }]
  3890. // }
  3891. // },
  3892. if (appVm) {
  3893. // 触发响应式
  3894. appVm.$locale;
  3895. if (!isWatchedAppLocale) {
  3896. isWatchedAppLocale = true;
  3897. watchAppLocale(appVm, i18n);
  3898. }
  3899. }
  3900. return i18n.t(key, values);
  3901. };
  3902. }
  3903. return _t(key, values);
  3904. };
  3905. return {
  3906. i18n: i18n,
  3907. f: function f(message, values, delimiters) {
  3908. return i18n.f(message, values, delimiters);
  3909. },
  3910. t: function t(key, values) {
  3911. return _t(key, values);
  3912. },
  3913. add: function add(locale, message) {
  3914. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3915. return i18n.add(locale, message, override);
  3916. },
  3917. watch: function watch(fn) {
  3918. return i18n.watchLocale(fn);
  3919. },
  3920. getLocale: function getLocale() {
  3921. return i18n.getLocale();
  3922. },
  3923. setLocale: function setLocale(newLocale) {
  3924. return i18n.setLocale(newLocale);
  3925. }
  3926. };
  3927. }
  3928. var isString = function isString(val) {
  3929. return typeof val === 'string';
  3930. };
  3931. exports.isString = isString;
  3932. var formater;
  3933. function hasI18nJson(jsonObj, delimiters) {
  3934. if (!formater) {
  3935. formater = new BaseFormatter();
  3936. }
  3937. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3938. var value = jsonObj[key];
  3939. if (isString(value)) {
  3940. if (isI18nStr(value, delimiters)) {
  3941. return true;
  3942. }
  3943. } else {
  3944. return hasI18nJson(value, delimiters);
  3945. }
  3946. });
  3947. }
  3948. function parseI18nJson(jsonObj, values, delimiters) {
  3949. if (!formater) {
  3950. formater = new BaseFormatter();
  3951. }
  3952. walkJsonObj(jsonObj, function (jsonObj, key) {
  3953. var value = jsonObj[key];
  3954. if (isString(value)) {
  3955. if (isI18nStr(value, delimiters)) {
  3956. jsonObj[key] = compileStr(value, values, delimiters);
  3957. }
  3958. } else {
  3959. parseI18nJson(value, values, delimiters);
  3960. }
  3961. });
  3962. return jsonObj;
  3963. }
  3964. function compileI18nJsonStr(jsonStr, _ref5) {
  3965. var locale = _ref5.locale,
  3966. locales = _ref5.locales,
  3967. delimiters = _ref5.delimiters;
  3968. if (!isI18nStr(jsonStr, delimiters)) {
  3969. return jsonStr;
  3970. }
  3971. if (!formater) {
  3972. formater = new BaseFormatter();
  3973. }
  3974. var localeValues = [];
  3975. Object.keys(locales).forEach(function (name) {
  3976. if (name !== locale) {
  3977. localeValues.push({
  3978. locale: name,
  3979. values: locales[name]
  3980. });
  3981. }
  3982. });
  3983. localeValues.unshift({
  3984. locale: locale,
  3985. values: locales[locale]
  3986. });
  3987. try {
  3988. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3989. } catch (e) {}
  3990. return jsonStr;
  3991. }
  3992. function isI18nStr(value, delimiters) {
  3993. return value.indexOf(delimiters[0]) > -1;
  3994. }
  3995. function compileStr(value, values, delimiters) {
  3996. return formater.interpolate(value, values, delimiters).join('');
  3997. }
  3998. function compileValue(jsonObj, key, localeValues, delimiters) {
  3999. var value = jsonObj[key];
  4000. if (isString(value)) {
  4001. // 存在国际化
  4002. if (isI18nStr(value, delimiters)) {
  4003. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  4004. if (localeValues.length > 1) {
  4005. // 格式化国际化语言
  4006. var valueLocales = jsonObj[key + 'Locales'] = {};
  4007. localeValues.forEach(function (localValue) {
  4008. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  4009. });
  4010. }
  4011. }
  4012. } else {
  4013. compileJsonObj(value, localeValues, delimiters);
  4014. }
  4015. }
  4016. function compileJsonObj(jsonObj, localeValues, delimiters) {
  4017. walkJsonObj(jsonObj, function (jsonObj, key) {
  4018. compileValue(jsonObj, key, localeValues, delimiters);
  4019. });
  4020. return jsonObj;
  4021. }
  4022. function walkJsonObj(jsonObj, walk) {
  4023. if (isArray(jsonObj)) {
  4024. for (var i = 0; i < jsonObj.length; i++) {
  4025. if (walk(jsonObj, i)) {
  4026. return true;
  4027. }
  4028. }
  4029. } else if (isObject(jsonObj)) {
  4030. for (var key in jsonObj) {
  4031. if (walk(jsonObj, key)) {
  4032. return true;
  4033. }
  4034. }
  4035. }
  4036. return false;
  4037. }
  4038. function resolveLocale(locales) {
  4039. return function (locale) {
  4040. if (!locale) {
  4041. return locale;
  4042. }
  4043. locale = normalizeLocale(locale) || locale;
  4044. return resolveLocaleChain(locale).find(function (locale) {
  4045. return locales.indexOf(locale) > -1;
  4046. });
  4047. };
  4048. }
  4049. function resolveLocaleChain(locale) {
  4050. var chain = [];
  4051. var tokens = locale.split('-');
  4052. while (tokens.length) {
  4053. chain.push(tokens.join('-'));
  4054. tokens.pop();
  4055. }
  4056. return chain;
  4057. }
  4058. /* 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)))
  4059. /***/ }),
  4060. /***/ 23:
  4061. /*!***************************************************************!*\
  4062. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  4063. \***************************************************************/
  4064. /*! no static exports found */
  4065. /***/ (function(module, exports) {
  4066. function _classCallCheck(instance, Constructor) {
  4067. if (!(instance instanceof Constructor)) {
  4068. throw new TypeError("Cannot call a class as a function");
  4069. }
  4070. }
  4071. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4072. /***/ }),
  4073. /***/ 24:
  4074. /*!************************************************************!*\
  4075. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  4076. \************************************************************/
  4077. /*! no static exports found */
  4078. /***/ (function(module, exports, __webpack_require__) {
  4079. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  4080. function _defineProperties(target, props) {
  4081. for (var i = 0; i < props.length; i++) {
  4082. var descriptor = props[i];
  4083. descriptor.enumerable = descriptor.enumerable || false;
  4084. descriptor.configurable = true;
  4085. if ("value" in descriptor) descriptor.writable = true;
  4086. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  4087. }
  4088. }
  4089. function _createClass(Constructor, protoProps, staticProps) {
  4090. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  4091. if (staticProps) _defineProperties(Constructor, staticProps);
  4092. Object.defineProperty(Constructor, "prototype", {
  4093. writable: false
  4094. });
  4095. return Constructor;
  4096. }
  4097. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4098. /***/ }),
  4099. /***/ 25:
  4100. /*!******************************************************************************************!*\
  4101. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4102. \******************************************************************************************/
  4103. /*! exports provided: default */
  4104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4105. "use strict";
  4106. __webpack_require__.r(__webpack_exports__);
  4107. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4108. * Vue.js v2.6.11
  4109. * (c) 2014-2022 Evan You
  4110. * Released under the MIT License.
  4111. */
  4112. /* */
  4113. var emptyObject = Object.freeze({});
  4114. // These helpers produce better VM code in JS engines due to their
  4115. // explicitness and function inlining.
  4116. function isUndef (v) {
  4117. return v === undefined || v === null
  4118. }
  4119. function isDef (v) {
  4120. return v !== undefined && v !== null
  4121. }
  4122. function isTrue (v) {
  4123. return v === true
  4124. }
  4125. function isFalse (v) {
  4126. return v === false
  4127. }
  4128. /**
  4129. * Check if value is primitive.
  4130. */
  4131. function isPrimitive (value) {
  4132. return (
  4133. typeof value === 'string' ||
  4134. typeof value === 'number' ||
  4135. // $flow-disable-line
  4136. typeof value === 'symbol' ||
  4137. typeof value === 'boolean'
  4138. )
  4139. }
  4140. /**
  4141. * Quick object check - this is primarily used to tell
  4142. * Objects from primitive values when we know the value
  4143. * is a JSON-compliant type.
  4144. */
  4145. function isObject (obj) {
  4146. return obj !== null && typeof obj === 'object'
  4147. }
  4148. /**
  4149. * Get the raw type string of a value, e.g., [object Object].
  4150. */
  4151. var _toString = Object.prototype.toString;
  4152. function toRawType (value) {
  4153. return _toString.call(value).slice(8, -1)
  4154. }
  4155. /**
  4156. * Strict object type check. Only returns true
  4157. * for plain JavaScript objects.
  4158. */
  4159. function isPlainObject (obj) {
  4160. return _toString.call(obj) === '[object Object]'
  4161. }
  4162. function isRegExp (v) {
  4163. return _toString.call(v) === '[object RegExp]'
  4164. }
  4165. /**
  4166. * Check if val is a valid array index.
  4167. */
  4168. function isValidArrayIndex (val) {
  4169. var n = parseFloat(String(val));
  4170. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4171. }
  4172. function isPromise (val) {
  4173. return (
  4174. isDef(val) &&
  4175. typeof val.then === 'function' &&
  4176. typeof val.catch === 'function'
  4177. )
  4178. }
  4179. /**
  4180. * Convert a value to a string that is actually rendered.
  4181. */
  4182. function toString (val) {
  4183. return val == null
  4184. ? ''
  4185. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4186. ? JSON.stringify(val, null, 2)
  4187. : String(val)
  4188. }
  4189. /**
  4190. * Convert an input value to a number for persistence.
  4191. * If the conversion fails, return original string.
  4192. */
  4193. function toNumber (val) {
  4194. var n = parseFloat(val);
  4195. return isNaN(n) ? val : n
  4196. }
  4197. /**
  4198. * Make a map and return a function for checking if a key
  4199. * is in that map.
  4200. */
  4201. function makeMap (
  4202. str,
  4203. expectsLowerCase
  4204. ) {
  4205. var map = Object.create(null);
  4206. var list = str.split(',');
  4207. for (var i = 0; i < list.length; i++) {
  4208. map[list[i]] = true;
  4209. }
  4210. return expectsLowerCase
  4211. ? function (val) { return map[val.toLowerCase()]; }
  4212. : function (val) { return map[val]; }
  4213. }
  4214. /**
  4215. * Check if a tag is a built-in tag.
  4216. */
  4217. var isBuiltInTag = makeMap('slot,component', true);
  4218. /**
  4219. * Check if an attribute is a reserved attribute.
  4220. */
  4221. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4222. /**
  4223. * Remove an item from an array.
  4224. */
  4225. function remove (arr, item) {
  4226. if (arr.length) {
  4227. var index = arr.indexOf(item);
  4228. if (index > -1) {
  4229. return arr.splice(index, 1)
  4230. }
  4231. }
  4232. }
  4233. /**
  4234. * Check whether an object has the property.
  4235. */
  4236. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4237. function hasOwn (obj, key) {
  4238. return hasOwnProperty.call(obj, key)
  4239. }
  4240. /**
  4241. * Create a cached version of a pure function.
  4242. */
  4243. function cached (fn) {
  4244. var cache = Object.create(null);
  4245. return (function cachedFn (str) {
  4246. var hit = cache[str];
  4247. return hit || (cache[str] = fn(str))
  4248. })
  4249. }
  4250. /**
  4251. * Camelize a hyphen-delimited string.
  4252. */
  4253. var camelizeRE = /-(\w)/g;
  4254. var camelize = cached(function (str) {
  4255. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4256. });
  4257. /**
  4258. * Capitalize a string.
  4259. */
  4260. var capitalize = cached(function (str) {
  4261. return str.charAt(0).toUpperCase() + str.slice(1)
  4262. });
  4263. /**
  4264. * Hyphenate a camelCase string.
  4265. */
  4266. var hyphenateRE = /\B([A-Z])/g;
  4267. var hyphenate = cached(function (str) {
  4268. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4269. });
  4270. /**
  4271. * Simple bind polyfill for environments that do not support it,
  4272. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4273. * since native bind is now performant enough in most browsers.
  4274. * But removing it would mean breaking code that was able to run in
  4275. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4276. */
  4277. /* istanbul ignore next */
  4278. function polyfillBind (fn, ctx) {
  4279. function boundFn (a) {
  4280. var l = arguments.length;
  4281. return l
  4282. ? l > 1
  4283. ? fn.apply(ctx, arguments)
  4284. : fn.call(ctx, a)
  4285. : fn.call(ctx)
  4286. }
  4287. boundFn._length = fn.length;
  4288. return boundFn
  4289. }
  4290. function nativeBind (fn, ctx) {
  4291. return fn.bind(ctx)
  4292. }
  4293. var bind = Function.prototype.bind
  4294. ? nativeBind
  4295. : polyfillBind;
  4296. /**
  4297. * Convert an Array-like object to a real Array.
  4298. */
  4299. function toArray (list, start) {
  4300. start = start || 0;
  4301. var i = list.length - start;
  4302. var ret = new Array(i);
  4303. while (i--) {
  4304. ret[i] = list[i + start];
  4305. }
  4306. return ret
  4307. }
  4308. /**
  4309. * Mix properties into target object.
  4310. */
  4311. function extend (to, _from) {
  4312. for (var key in _from) {
  4313. to[key] = _from[key];
  4314. }
  4315. return to
  4316. }
  4317. /**
  4318. * Merge an Array of Objects into a single Object.
  4319. */
  4320. function toObject (arr) {
  4321. var res = {};
  4322. for (var i = 0; i < arr.length; i++) {
  4323. if (arr[i]) {
  4324. extend(res, arr[i]);
  4325. }
  4326. }
  4327. return res
  4328. }
  4329. /* eslint-disable no-unused-vars */
  4330. /**
  4331. * Perform no operation.
  4332. * Stubbing args to make Flow happy without leaving useless transpiled code
  4333. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4334. */
  4335. function noop (a, b, c) {}
  4336. /**
  4337. * Always return false.
  4338. */
  4339. var no = function (a, b, c) { return false; };
  4340. /* eslint-enable no-unused-vars */
  4341. /**
  4342. * Return the same value.
  4343. */
  4344. var identity = function (_) { return _; };
  4345. /**
  4346. * Check if two values are loosely equal - that is,
  4347. * if they are plain objects, do they have the same shape?
  4348. */
  4349. function looseEqual (a, b) {
  4350. if (a === b) { return true }
  4351. var isObjectA = isObject(a);
  4352. var isObjectB = isObject(b);
  4353. if (isObjectA && isObjectB) {
  4354. try {
  4355. var isArrayA = Array.isArray(a);
  4356. var isArrayB = Array.isArray(b);
  4357. if (isArrayA && isArrayB) {
  4358. return a.length === b.length && a.every(function (e, i) {
  4359. return looseEqual(e, b[i])
  4360. })
  4361. } else if (a instanceof Date && b instanceof Date) {
  4362. return a.getTime() === b.getTime()
  4363. } else if (!isArrayA && !isArrayB) {
  4364. var keysA = Object.keys(a);
  4365. var keysB = Object.keys(b);
  4366. return keysA.length === keysB.length && keysA.every(function (key) {
  4367. return looseEqual(a[key], b[key])
  4368. })
  4369. } else {
  4370. /* istanbul ignore next */
  4371. return false
  4372. }
  4373. } catch (e) {
  4374. /* istanbul ignore next */
  4375. return false
  4376. }
  4377. } else if (!isObjectA && !isObjectB) {
  4378. return String(a) === String(b)
  4379. } else {
  4380. return false
  4381. }
  4382. }
  4383. /**
  4384. * Return the first index at which a loosely equal value can be
  4385. * found in the array (if value is a plain object, the array must
  4386. * contain an object of the same shape), or -1 if it is not present.
  4387. */
  4388. function looseIndexOf (arr, val) {
  4389. for (var i = 0; i < arr.length; i++) {
  4390. if (looseEqual(arr[i], val)) { return i }
  4391. }
  4392. return -1
  4393. }
  4394. /**
  4395. * Ensure a function is called only once.
  4396. */
  4397. function once (fn) {
  4398. var called = false;
  4399. return function () {
  4400. if (!called) {
  4401. called = true;
  4402. fn.apply(this, arguments);
  4403. }
  4404. }
  4405. }
  4406. var ASSET_TYPES = [
  4407. 'component',
  4408. 'directive',
  4409. 'filter'
  4410. ];
  4411. var LIFECYCLE_HOOKS = [
  4412. 'beforeCreate',
  4413. 'created',
  4414. 'beforeMount',
  4415. 'mounted',
  4416. 'beforeUpdate',
  4417. 'updated',
  4418. 'beforeDestroy',
  4419. 'destroyed',
  4420. 'activated',
  4421. 'deactivated',
  4422. 'errorCaptured',
  4423. 'serverPrefetch'
  4424. ];
  4425. /* */
  4426. var config = ({
  4427. /**
  4428. * Option merge strategies (used in core/util/options)
  4429. */
  4430. // $flow-disable-line
  4431. optionMergeStrategies: Object.create(null),
  4432. /**
  4433. * Whether to suppress warnings.
  4434. */
  4435. silent: false,
  4436. /**
  4437. * Show production mode tip message on boot?
  4438. */
  4439. productionTip: "development" !== 'production',
  4440. /**
  4441. * Whether to enable devtools
  4442. */
  4443. devtools: "development" !== 'production',
  4444. /**
  4445. * Whether to record perf
  4446. */
  4447. performance: false,
  4448. /**
  4449. * Error handler for watcher errors
  4450. */
  4451. errorHandler: null,
  4452. /**
  4453. * Warn handler for watcher warns
  4454. */
  4455. warnHandler: null,
  4456. /**
  4457. * Ignore certain custom elements
  4458. */
  4459. ignoredElements: [],
  4460. /**
  4461. * Custom user key aliases for v-on
  4462. */
  4463. // $flow-disable-line
  4464. keyCodes: Object.create(null),
  4465. /**
  4466. * Check if a tag is reserved so that it cannot be registered as a
  4467. * component. This is platform-dependent and may be overwritten.
  4468. */
  4469. isReservedTag: no,
  4470. /**
  4471. * Check if an attribute is reserved so that it cannot be used as a component
  4472. * prop. This is platform-dependent and may be overwritten.
  4473. */
  4474. isReservedAttr: no,
  4475. /**
  4476. * Check if a tag is an unknown element.
  4477. * Platform-dependent.
  4478. */
  4479. isUnknownElement: no,
  4480. /**
  4481. * Get the namespace of an element
  4482. */
  4483. getTagNamespace: noop,
  4484. /**
  4485. * Parse the real tag name for the specific platform.
  4486. */
  4487. parsePlatformTagName: identity,
  4488. /**
  4489. * Check if an attribute must be bound using property, e.g. value
  4490. * Platform-dependent.
  4491. */
  4492. mustUseProp: no,
  4493. /**
  4494. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4495. * This will significantly reduce performance if set to false.
  4496. */
  4497. async: true,
  4498. /**
  4499. * Exposed for legacy reasons
  4500. */
  4501. _lifecycleHooks: LIFECYCLE_HOOKS
  4502. });
  4503. /* */
  4504. /**
  4505. * unicode letters used for parsing html tags, component names and property paths.
  4506. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4507. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4508. */
  4509. 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/;
  4510. /**
  4511. * Check if a string starts with $ or _
  4512. */
  4513. function isReserved (str) {
  4514. var c = (str + '').charCodeAt(0);
  4515. return c === 0x24 || c === 0x5F
  4516. }
  4517. /**
  4518. * Define a property.
  4519. */
  4520. function def (obj, key, val, enumerable) {
  4521. Object.defineProperty(obj, key, {
  4522. value: val,
  4523. enumerable: !!enumerable,
  4524. writable: true,
  4525. configurable: true
  4526. });
  4527. }
  4528. /**
  4529. * Parse simple path.
  4530. */
  4531. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4532. function parsePath (path) {
  4533. if (bailRE.test(path)) {
  4534. return
  4535. }
  4536. var segments = path.split('.');
  4537. return function (obj) {
  4538. for (var i = 0; i < segments.length; i++) {
  4539. if (!obj) { return }
  4540. obj = obj[segments[i]];
  4541. }
  4542. return obj
  4543. }
  4544. }
  4545. /* */
  4546. // can we use __proto__?
  4547. var hasProto = '__proto__' in {};
  4548. // Browser environment sniffing
  4549. var inBrowser = typeof window !== 'undefined';
  4550. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4551. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4552. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4553. var isIE = UA && /msie|trident/.test(UA);
  4554. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4555. var isEdge = UA && UA.indexOf('edge/') > 0;
  4556. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4557. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4558. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4559. var isPhantomJS = UA && /phantomjs/.test(UA);
  4560. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4561. // Firefox has a "watch" function on Object.prototype...
  4562. var nativeWatch = ({}).watch;
  4563. if (inBrowser) {
  4564. try {
  4565. var opts = {};
  4566. Object.defineProperty(opts, 'passive', ({
  4567. get: function get () {
  4568. }
  4569. })); // https://github.com/facebook/flow/issues/285
  4570. window.addEventListener('test-passive', null, opts);
  4571. } catch (e) {}
  4572. }
  4573. // this needs to be lazy-evaled because vue may be required before
  4574. // vue-server-renderer can set VUE_ENV
  4575. var _isServer;
  4576. var isServerRendering = function () {
  4577. if (_isServer === undefined) {
  4578. /* istanbul ignore if */
  4579. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4580. // detect presence of vue-server-renderer and avoid
  4581. // Webpack shimming the process
  4582. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4583. } else {
  4584. _isServer = false;
  4585. }
  4586. }
  4587. return _isServer
  4588. };
  4589. // detect devtools
  4590. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4591. /* istanbul ignore next */
  4592. function isNative (Ctor) {
  4593. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4594. }
  4595. var hasSymbol =
  4596. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4597. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4598. var _Set;
  4599. /* istanbul ignore if */ // $flow-disable-line
  4600. if (typeof Set !== 'undefined' && isNative(Set)) {
  4601. // use native Set when available.
  4602. _Set = Set;
  4603. } else {
  4604. // a non-standard Set polyfill that only works with primitive keys.
  4605. _Set = /*@__PURE__*/(function () {
  4606. function Set () {
  4607. this.set = Object.create(null);
  4608. }
  4609. Set.prototype.has = function has (key) {
  4610. return this.set[key] === true
  4611. };
  4612. Set.prototype.add = function add (key) {
  4613. this.set[key] = true;
  4614. };
  4615. Set.prototype.clear = function clear () {
  4616. this.set = Object.create(null);
  4617. };
  4618. return Set;
  4619. }());
  4620. }
  4621. /* */
  4622. var warn = noop;
  4623. var tip = noop;
  4624. var generateComponentTrace = (noop); // work around flow check
  4625. var formatComponentName = (noop);
  4626. if (true) {
  4627. var hasConsole = typeof console !== 'undefined';
  4628. var classifyRE = /(?:^|[-_])(\w)/g;
  4629. var classify = function (str) { return str
  4630. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4631. .replace(/[-_]/g, ''); };
  4632. warn = function (msg, vm) {
  4633. var trace = vm ? generateComponentTrace(vm) : '';
  4634. if (config.warnHandler) {
  4635. config.warnHandler.call(null, msg, vm, trace);
  4636. } else if (hasConsole && (!config.silent)) {
  4637. console.error(("[Vue warn]: " + msg + trace));
  4638. }
  4639. };
  4640. tip = function (msg, vm) {
  4641. if (hasConsole && (!config.silent)) {
  4642. console.warn("[Vue tip]: " + msg + (
  4643. vm ? generateComponentTrace(vm) : ''
  4644. ));
  4645. }
  4646. };
  4647. formatComponentName = function (vm, includeFile) {
  4648. if (vm.$root === vm) {
  4649. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4650. return ('') + vm.$options.__file
  4651. }
  4652. return '<Root>'
  4653. }
  4654. var options = typeof vm === 'function' && vm.cid != null
  4655. ? vm.options
  4656. : vm._isVue
  4657. ? vm.$options || vm.constructor.options
  4658. : vm;
  4659. var name = options.name || options._componentTag;
  4660. var file = options.__file;
  4661. if (!name && file) {
  4662. var match = file.match(/([^/\\]+)\.vue$/);
  4663. name = match && match[1];
  4664. }
  4665. return (
  4666. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4667. (file && includeFile !== false ? (" at " + file) : '')
  4668. )
  4669. };
  4670. var repeat = function (str, n) {
  4671. var res = '';
  4672. while (n) {
  4673. if (n % 2 === 1) { res += str; }
  4674. if (n > 1) { str += str; }
  4675. n >>= 1;
  4676. }
  4677. return res
  4678. };
  4679. generateComponentTrace = function (vm) {
  4680. if (vm._isVue && vm.$parent) {
  4681. var tree = [];
  4682. var currentRecursiveSequence = 0;
  4683. while (vm && vm.$options.name !== 'PageBody') {
  4684. if (tree.length > 0) {
  4685. var last = tree[tree.length - 1];
  4686. if (last.constructor === vm.constructor) {
  4687. currentRecursiveSequence++;
  4688. vm = vm.$parent;
  4689. continue
  4690. } else if (currentRecursiveSequence > 0) {
  4691. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4692. currentRecursiveSequence = 0;
  4693. }
  4694. }
  4695. !vm.$options.isReserved && tree.push(vm);
  4696. vm = vm.$parent;
  4697. }
  4698. return '\n\nfound in\n\n' + tree
  4699. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4700. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4701. : formatComponentName(vm))); })
  4702. .join('\n')
  4703. } else {
  4704. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4705. }
  4706. };
  4707. }
  4708. /* */
  4709. var uid = 0;
  4710. /**
  4711. * A dep is an observable that can have multiple
  4712. * directives subscribing to it.
  4713. */
  4714. var Dep = function Dep () {
  4715. this.id = uid++;
  4716. this.subs = [];
  4717. };
  4718. Dep.prototype.addSub = function addSub (sub) {
  4719. this.subs.push(sub);
  4720. };
  4721. Dep.prototype.removeSub = function removeSub (sub) {
  4722. remove(this.subs, sub);
  4723. };
  4724. Dep.prototype.depend = function depend () {
  4725. if (Dep.SharedObject.target) {
  4726. Dep.SharedObject.target.addDep(this);
  4727. }
  4728. };
  4729. Dep.prototype.notify = function notify () {
  4730. // stabilize the subscriber list first
  4731. var subs = this.subs.slice();
  4732. if ( true && !config.async) {
  4733. // subs aren't sorted in scheduler if not running async
  4734. // we need to sort them now to make sure they fire in correct
  4735. // order
  4736. subs.sort(function (a, b) { return a.id - b.id; });
  4737. }
  4738. for (var i = 0, l = subs.length; i < l; i++) {
  4739. subs[i].update();
  4740. }
  4741. };
  4742. // The current target watcher being evaluated.
  4743. // This is globally unique because only one watcher
  4744. // can be evaluated at a time.
  4745. // fixed by xxxxxx (nvue shared vuex)
  4746. /* eslint-disable no-undef */
  4747. Dep.SharedObject = {};
  4748. Dep.SharedObject.target = null;
  4749. Dep.SharedObject.targetStack = [];
  4750. function pushTarget (target) {
  4751. Dep.SharedObject.targetStack.push(target);
  4752. Dep.SharedObject.target = target;
  4753. Dep.target = target;
  4754. }
  4755. function popTarget () {
  4756. Dep.SharedObject.targetStack.pop();
  4757. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4758. Dep.target = Dep.SharedObject.target;
  4759. }
  4760. /* */
  4761. var VNode = function VNode (
  4762. tag,
  4763. data,
  4764. children,
  4765. text,
  4766. elm,
  4767. context,
  4768. componentOptions,
  4769. asyncFactory
  4770. ) {
  4771. this.tag = tag;
  4772. this.data = data;
  4773. this.children = children;
  4774. this.text = text;
  4775. this.elm = elm;
  4776. this.ns = undefined;
  4777. this.context = context;
  4778. this.fnContext = undefined;
  4779. this.fnOptions = undefined;
  4780. this.fnScopeId = undefined;
  4781. this.key = data && data.key;
  4782. this.componentOptions = componentOptions;
  4783. this.componentInstance = undefined;
  4784. this.parent = undefined;
  4785. this.raw = false;
  4786. this.isStatic = false;
  4787. this.isRootInsert = true;
  4788. this.isComment = false;
  4789. this.isCloned = false;
  4790. this.isOnce = false;
  4791. this.asyncFactory = asyncFactory;
  4792. this.asyncMeta = undefined;
  4793. this.isAsyncPlaceholder = false;
  4794. };
  4795. var prototypeAccessors = { child: { configurable: true } };
  4796. // DEPRECATED: alias for componentInstance for backwards compat.
  4797. /* istanbul ignore next */
  4798. prototypeAccessors.child.get = function () {
  4799. return this.componentInstance
  4800. };
  4801. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4802. var createEmptyVNode = function (text) {
  4803. if ( text === void 0 ) text = '';
  4804. var node = new VNode();
  4805. node.text = text;
  4806. node.isComment = true;
  4807. return node
  4808. };
  4809. function createTextVNode (val) {
  4810. return new VNode(undefined, undefined, undefined, String(val))
  4811. }
  4812. // optimized shallow clone
  4813. // used for static nodes and slot nodes because they may be reused across
  4814. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4815. // on their elm reference.
  4816. function cloneVNode (vnode) {
  4817. var cloned = new VNode(
  4818. vnode.tag,
  4819. vnode.data,
  4820. // #7975
  4821. // clone children array to avoid mutating original in case of cloning
  4822. // a child.
  4823. vnode.children && vnode.children.slice(),
  4824. vnode.text,
  4825. vnode.elm,
  4826. vnode.context,
  4827. vnode.componentOptions,
  4828. vnode.asyncFactory
  4829. );
  4830. cloned.ns = vnode.ns;
  4831. cloned.isStatic = vnode.isStatic;
  4832. cloned.key = vnode.key;
  4833. cloned.isComment = vnode.isComment;
  4834. cloned.fnContext = vnode.fnContext;
  4835. cloned.fnOptions = vnode.fnOptions;
  4836. cloned.fnScopeId = vnode.fnScopeId;
  4837. cloned.asyncMeta = vnode.asyncMeta;
  4838. cloned.isCloned = true;
  4839. return cloned
  4840. }
  4841. /*
  4842. * not type checking this file because flow doesn't play well with
  4843. * dynamically accessing methods on Array prototype
  4844. */
  4845. var arrayProto = Array.prototype;
  4846. var arrayMethods = Object.create(arrayProto);
  4847. var methodsToPatch = [
  4848. 'push',
  4849. 'pop',
  4850. 'shift',
  4851. 'unshift',
  4852. 'splice',
  4853. 'sort',
  4854. 'reverse'
  4855. ];
  4856. /**
  4857. * Intercept mutating methods and emit events
  4858. */
  4859. methodsToPatch.forEach(function (method) {
  4860. // cache original method
  4861. var original = arrayProto[method];
  4862. def(arrayMethods, method, function mutator () {
  4863. var args = [], len = arguments.length;
  4864. while ( len-- ) args[ len ] = arguments[ len ];
  4865. var result = original.apply(this, args);
  4866. var ob = this.__ob__;
  4867. var inserted;
  4868. switch (method) {
  4869. case 'push':
  4870. case 'unshift':
  4871. inserted = args;
  4872. break
  4873. case 'splice':
  4874. inserted = args.slice(2);
  4875. break
  4876. }
  4877. if (inserted) { ob.observeArray(inserted); }
  4878. // notify change
  4879. ob.dep.notify();
  4880. return result
  4881. });
  4882. });
  4883. /* */
  4884. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4885. /**
  4886. * In some cases we may want to disable observation inside a component's
  4887. * update computation.
  4888. */
  4889. var shouldObserve = true;
  4890. function toggleObserving (value) {
  4891. shouldObserve = value;
  4892. }
  4893. /**
  4894. * Observer class that is attached to each observed
  4895. * object. Once attached, the observer converts the target
  4896. * object's property keys into getter/setters that
  4897. * collect dependencies and dispatch updates.
  4898. */
  4899. var Observer = function Observer (value) {
  4900. this.value = value;
  4901. this.dep = new Dep();
  4902. this.vmCount = 0;
  4903. def(value, '__ob__', this);
  4904. if (Array.isArray(value)) {
  4905. if (hasProto) {
  4906. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4907. if(value.push !== value.__proto__.push){
  4908. copyAugment(value, arrayMethods, arrayKeys);
  4909. } else {
  4910. protoAugment(value, arrayMethods);
  4911. }
  4912. }
  4913. } else {
  4914. copyAugment(value, arrayMethods, arrayKeys);
  4915. }
  4916. this.observeArray(value);
  4917. } else {
  4918. this.walk(value);
  4919. }
  4920. };
  4921. /**
  4922. * Walk through all properties and convert them into
  4923. * getter/setters. This method should only be called when
  4924. * value type is Object.
  4925. */
  4926. Observer.prototype.walk = function walk (obj) {
  4927. var keys = Object.keys(obj);
  4928. for (var i = 0; i < keys.length; i++) {
  4929. defineReactive$$1(obj, keys[i]);
  4930. }
  4931. };
  4932. /**
  4933. * Observe a list of Array items.
  4934. */
  4935. Observer.prototype.observeArray = function observeArray (items) {
  4936. for (var i = 0, l = items.length; i < l; i++) {
  4937. observe(items[i]);
  4938. }
  4939. };
  4940. // helpers
  4941. /**
  4942. * Augment a target Object or Array by intercepting
  4943. * the prototype chain using __proto__
  4944. */
  4945. function protoAugment (target, src) {
  4946. /* eslint-disable no-proto */
  4947. target.__proto__ = src;
  4948. /* eslint-enable no-proto */
  4949. }
  4950. /**
  4951. * Augment a target Object or Array by defining
  4952. * hidden properties.
  4953. */
  4954. /* istanbul ignore next */
  4955. function copyAugment (target, src, keys) {
  4956. for (var i = 0, l = keys.length; i < l; i++) {
  4957. var key = keys[i];
  4958. def(target, key, src[key]);
  4959. }
  4960. }
  4961. /**
  4962. * Attempt to create an observer instance for a value,
  4963. * returns the new observer if successfully observed,
  4964. * or the existing observer if the value already has one.
  4965. */
  4966. function observe (value, asRootData) {
  4967. if (!isObject(value) || value instanceof VNode) {
  4968. return
  4969. }
  4970. var ob;
  4971. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4972. ob = value.__ob__;
  4973. } else if (
  4974. shouldObserve &&
  4975. !isServerRendering() &&
  4976. (Array.isArray(value) || isPlainObject(value)) &&
  4977. Object.isExtensible(value) &&
  4978. !value._isVue &&
  4979. !value.__v_isMPComponent
  4980. ) {
  4981. ob = new Observer(value);
  4982. }
  4983. if (asRootData && ob) {
  4984. ob.vmCount++;
  4985. }
  4986. return ob
  4987. }
  4988. /**
  4989. * Define a reactive property on an Object.
  4990. */
  4991. function defineReactive$$1 (
  4992. obj,
  4993. key,
  4994. val,
  4995. customSetter,
  4996. shallow
  4997. ) {
  4998. var dep = new Dep();
  4999. var property = Object.getOwnPropertyDescriptor(obj, key);
  5000. if (property && property.configurable === false) {
  5001. return
  5002. }
  5003. // cater for pre-defined getter/setters
  5004. var getter = property && property.get;
  5005. var setter = property && property.set;
  5006. if ((!getter || setter) && arguments.length === 2) {
  5007. val = obj[key];
  5008. }
  5009. var childOb = !shallow && observe(val);
  5010. Object.defineProperty(obj, key, {
  5011. enumerable: true,
  5012. configurable: true,
  5013. get: function reactiveGetter () {
  5014. var value = getter ? getter.call(obj) : val;
  5015. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5016. dep.depend();
  5017. if (childOb) {
  5018. childOb.dep.depend();
  5019. if (Array.isArray(value)) {
  5020. dependArray(value);
  5021. }
  5022. }
  5023. }
  5024. return value
  5025. },
  5026. set: function reactiveSetter (newVal) {
  5027. var value = getter ? getter.call(obj) : val;
  5028. /* eslint-disable no-self-compare */
  5029. if (newVal === value || (newVal !== newVal && value !== value)) {
  5030. return
  5031. }
  5032. /* eslint-enable no-self-compare */
  5033. if ( true && customSetter) {
  5034. customSetter();
  5035. }
  5036. // #7981: for accessor properties without setter
  5037. if (getter && !setter) { return }
  5038. if (setter) {
  5039. setter.call(obj, newVal);
  5040. } else {
  5041. val = newVal;
  5042. }
  5043. childOb = !shallow && observe(newVal);
  5044. dep.notify();
  5045. }
  5046. });
  5047. }
  5048. /**
  5049. * Set a property on an object. Adds the new property and
  5050. * triggers change notification if the property doesn't
  5051. * already exist.
  5052. */
  5053. function set (target, key, val) {
  5054. if ( true &&
  5055. (isUndef(target) || isPrimitive(target))
  5056. ) {
  5057. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5058. }
  5059. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5060. target.length = Math.max(target.length, key);
  5061. target.splice(key, 1, val);
  5062. return val
  5063. }
  5064. if (key in target && !(key in Object.prototype)) {
  5065. target[key] = val;
  5066. return val
  5067. }
  5068. var ob = (target).__ob__;
  5069. if (target._isVue || (ob && ob.vmCount)) {
  5070. true && warn(
  5071. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5072. 'at runtime - declare it upfront in the data option.'
  5073. );
  5074. return val
  5075. }
  5076. if (!ob) {
  5077. target[key] = val;
  5078. return val
  5079. }
  5080. defineReactive$$1(ob.value, key, val);
  5081. ob.dep.notify();
  5082. return val
  5083. }
  5084. /**
  5085. * Delete a property and trigger change if necessary.
  5086. */
  5087. function del (target, key) {
  5088. if ( true &&
  5089. (isUndef(target) || isPrimitive(target))
  5090. ) {
  5091. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5092. }
  5093. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5094. target.splice(key, 1);
  5095. return
  5096. }
  5097. var ob = (target).__ob__;
  5098. if (target._isVue || (ob && ob.vmCount)) {
  5099. true && warn(
  5100. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5101. '- just set it to null.'
  5102. );
  5103. return
  5104. }
  5105. if (!hasOwn(target, key)) {
  5106. return
  5107. }
  5108. delete target[key];
  5109. if (!ob) {
  5110. return
  5111. }
  5112. ob.dep.notify();
  5113. }
  5114. /**
  5115. * Collect dependencies on array elements when the array is touched, since
  5116. * we cannot intercept array element access like property getters.
  5117. */
  5118. function dependArray (value) {
  5119. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5120. e = value[i];
  5121. e && e.__ob__ && e.__ob__.dep.depend();
  5122. if (Array.isArray(e)) {
  5123. dependArray(e);
  5124. }
  5125. }
  5126. }
  5127. /* */
  5128. /**
  5129. * Option overwriting strategies are functions that handle
  5130. * how to merge a parent option value and a child option
  5131. * value into the final value.
  5132. */
  5133. var strats = config.optionMergeStrategies;
  5134. /**
  5135. * Options with restrictions
  5136. */
  5137. if (true) {
  5138. strats.el = strats.propsData = function (parent, child, vm, key) {
  5139. if (!vm) {
  5140. warn(
  5141. "option \"" + key + "\" can only be used during instance " +
  5142. 'creation with the `new` keyword.'
  5143. );
  5144. }
  5145. return defaultStrat(parent, child)
  5146. };
  5147. }
  5148. /**
  5149. * Helper that recursively merges two data objects together.
  5150. */
  5151. function mergeData (to, from) {
  5152. if (!from) { return to }
  5153. var key, toVal, fromVal;
  5154. var keys = hasSymbol
  5155. ? Reflect.ownKeys(from)
  5156. : Object.keys(from);
  5157. for (var i = 0; i < keys.length; i++) {
  5158. key = keys[i];
  5159. // in case the object is already observed...
  5160. if (key === '__ob__') { continue }
  5161. toVal = to[key];
  5162. fromVal = from[key];
  5163. if (!hasOwn(to, key)) {
  5164. set(to, key, fromVal);
  5165. } else if (
  5166. toVal !== fromVal &&
  5167. isPlainObject(toVal) &&
  5168. isPlainObject(fromVal)
  5169. ) {
  5170. mergeData(toVal, fromVal);
  5171. }
  5172. }
  5173. return to
  5174. }
  5175. /**
  5176. * Data
  5177. */
  5178. function mergeDataOrFn (
  5179. parentVal,
  5180. childVal,
  5181. vm
  5182. ) {
  5183. if (!vm) {
  5184. // in a Vue.extend merge, both should be functions
  5185. if (!childVal) {
  5186. return parentVal
  5187. }
  5188. if (!parentVal) {
  5189. return childVal
  5190. }
  5191. // when parentVal & childVal are both present,
  5192. // we need to return a function that returns the
  5193. // merged result of both functions... no need to
  5194. // check if parentVal is a function here because
  5195. // it has to be a function to pass previous merges.
  5196. return function mergedDataFn () {
  5197. return mergeData(
  5198. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5199. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5200. )
  5201. }
  5202. } else {
  5203. return function mergedInstanceDataFn () {
  5204. // instance merge
  5205. var instanceData = typeof childVal === 'function'
  5206. ? childVal.call(vm, vm)
  5207. : childVal;
  5208. var defaultData = typeof parentVal === 'function'
  5209. ? parentVal.call(vm, vm)
  5210. : parentVal;
  5211. if (instanceData) {
  5212. return mergeData(instanceData, defaultData)
  5213. } else {
  5214. return defaultData
  5215. }
  5216. }
  5217. }
  5218. }
  5219. strats.data = function (
  5220. parentVal,
  5221. childVal,
  5222. vm
  5223. ) {
  5224. if (!vm) {
  5225. if (childVal && typeof childVal !== 'function') {
  5226. true && warn(
  5227. 'The "data" option should be a function ' +
  5228. 'that returns a per-instance value in component ' +
  5229. 'definitions.',
  5230. vm
  5231. );
  5232. return parentVal
  5233. }
  5234. return mergeDataOrFn(parentVal, childVal)
  5235. }
  5236. return mergeDataOrFn(parentVal, childVal, vm)
  5237. };
  5238. /**
  5239. * Hooks and props are merged as arrays.
  5240. */
  5241. function mergeHook (
  5242. parentVal,
  5243. childVal
  5244. ) {
  5245. var res = childVal
  5246. ? parentVal
  5247. ? parentVal.concat(childVal)
  5248. : Array.isArray(childVal)
  5249. ? childVal
  5250. : [childVal]
  5251. : parentVal;
  5252. return res
  5253. ? dedupeHooks(res)
  5254. : res
  5255. }
  5256. function dedupeHooks (hooks) {
  5257. var res = [];
  5258. for (var i = 0; i < hooks.length; i++) {
  5259. if (res.indexOf(hooks[i]) === -1) {
  5260. res.push(hooks[i]);
  5261. }
  5262. }
  5263. return res
  5264. }
  5265. LIFECYCLE_HOOKS.forEach(function (hook) {
  5266. strats[hook] = mergeHook;
  5267. });
  5268. /**
  5269. * Assets
  5270. *
  5271. * When a vm is present (instance creation), we need to do
  5272. * a three-way merge between constructor options, instance
  5273. * options and parent options.
  5274. */
  5275. function mergeAssets (
  5276. parentVal,
  5277. childVal,
  5278. vm,
  5279. key
  5280. ) {
  5281. var res = Object.create(parentVal || null);
  5282. if (childVal) {
  5283. true && assertObjectType(key, childVal, vm);
  5284. return extend(res, childVal)
  5285. } else {
  5286. return res
  5287. }
  5288. }
  5289. ASSET_TYPES.forEach(function (type) {
  5290. strats[type + 's'] = mergeAssets;
  5291. });
  5292. /**
  5293. * Watchers.
  5294. *
  5295. * Watchers hashes should not overwrite one
  5296. * another, so we merge them as arrays.
  5297. */
  5298. strats.watch = function (
  5299. parentVal,
  5300. childVal,
  5301. vm,
  5302. key
  5303. ) {
  5304. // work around Firefox's Object.prototype.watch...
  5305. if (parentVal === nativeWatch) { parentVal = undefined; }
  5306. if (childVal === nativeWatch) { childVal = undefined; }
  5307. /* istanbul ignore if */
  5308. if (!childVal) { return Object.create(parentVal || null) }
  5309. if (true) {
  5310. assertObjectType(key, childVal, vm);
  5311. }
  5312. if (!parentVal) { return childVal }
  5313. var ret = {};
  5314. extend(ret, parentVal);
  5315. for (var key$1 in childVal) {
  5316. var parent = ret[key$1];
  5317. var child = childVal[key$1];
  5318. if (parent && !Array.isArray(parent)) {
  5319. parent = [parent];
  5320. }
  5321. ret[key$1] = parent
  5322. ? parent.concat(child)
  5323. : Array.isArray(child) ? child : [child];
  5324. }
  5325. return ret
  5326. };
  5327. /**
  5328. * Other object hashes.
  5329. */
  5330. strats.props =
  5331. strats.methods =
  5332. strats.inject =
  5333. strats.computed = function (
  5334. parentVal,
  5335. childVal,
  5336. vm,
  5337. key
  5338. ) {
  5339. if (childVal && "development" !== 'production') {
  5340. assertObjectType(key, childVal, vm);
  5341. }
  5342. if (!parentVal) { return childVal }
  5343. var ret = Object.create(null);
  5344. extend(ret, parentVal);
  5345. if (childVal) { extend(ret, childVal); }
  5346. return ret
  5347. };
  5348. strats.provide = mergeDataOrFn;
  5349. /**
  5350. * Default strategy.
  5351. */
  5352. var defaultStrat = function (parentVal, childVal) {
  5353. return childVal === undefined
  5354. ? parentVal
  5355. : childVal
  5356. };
  5357. /**
  5358. * Validate component names
  5359. */
  5360. function checkComponents (options) {
  5361. for (var key in options.components) {
  5362. validateComponentName(key);
  5363. }
  5364. }
  5365. function validateComponentName (name) {
  5366. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5367. warn(
  5368. 'Invalid component name: "' + name + '". Component names ' +
  5369. 'should conform to valid custom element name in html5 specification.'
  5370. );
  5371. }
  5372. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5373. warn(
  5374. 'Do not use built-in or reserved HTML elements as component ' +
  5375. 'id: ' + name
  5376. );
  5377. }
  5378. }
  5379. /**
  5380. * Ensure all props option syntax are normalized into the
  5381. * Object-based format.
  5382. */
  5383. function normalizeProps (options, vm) {
  5384. var props = options.props;
  5385. if (!props) { return }
  5386. var res = {};
  5387. var i, val, name;
  5388. if (Array.isArray(props)) {
  5389. i = props.length;
  5390. while (i--) {
  5391. val = props[i];
  5392. if (typeof val === 'string') {
  5393. name = camelize(val);
  5394. res[name] = { type: null };
  5395. } else if (true) {
  5396. warn('props must be strings when using array syntax.');
  5397. }
  5398. }
  5399. } else if (isPlainObject(props)) {
  5400. for (var key in props) {
  5401. val = props[key];
  5402. name = camelize(key);
  5403. res[name] = isPlainObject(val)
  5404. ? val
  5405. : { type: val };
  5406. }
  5407. } else if (true) {
  5408. warn(
  5409. "Invalid value for option \"props\": expected an Array or an Object, " +
  5410. "but got " + (toRawType(props)) + ".",
  5411. vm
  5412. );
  5413. }
  5414. options.props = res;
  5415. }
  5416. /**
  5417. * Normalize all injections into Object-based format
  5418. */
  5419. function normalizeInject (options, vm) {
  5420. var inject = options.inject;
  5421. if (!inject) { return }
  5422. var normalized = options.inject = {};
  5423. if (Array.isArray(inject)) {
  5424. for (var i = 0; i < inject.length; i++) {
  5425. normalized[inject[i]] = { from: inject[i] };
  5426. }
  5427. } else if (isPlainObject(inject)) {
  5428. for (var key in inject) {
  5429. var val = inject[key];
  5430. normalized[key] = isPlainObject(val)
  5431. ? extend({ from: key }, val)
  5432. : { from: val };
  5433. }
  5434. } else if (true) {
  5435. warn(
  5436. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5437. "but got " + (toRawType(inject)) + ".",
  5438. vm
  5439. );
  5440. }
  5441. }
  5442. /**
  5443. * Normalize raw function directives into object format.
  5444. */
  5445. function normalizeDirectives (options) {
  5446. var dirs = options.directives;
  5447. if (dirs) {
  5448. for (var key in dirs) {
  5449. var def$$1 = dirs[key];
  5450. if (typeof def$$1 === 'function') {
  5451. dirs[key] = { bind: def$$1, update: def$$1 };
  5452. }
  5453. }
  5454. }
  5455. }
  5456. function assertObjectType (name, value, vm) {
  5457. if (!isPlainObject(value)) {
  5458. warn(
  5459. "Invalid value for option \"" + name + "\": expected an Object, " +
  5460. "but got " + (toRawType(value)) + ".",
  5461. vm
  5462. );
  5463. }
  5464. }
  5465. /**
  5466. * Merge two option objects into a new one.
  5467. * Core utility used in both instantiation and inheritance.
  5468. */
  5469. function mergeOptions (
  5470. parent,
  5471. child,
  5472. vm
  5473. ) {
  5474. if (true) {
  5475. checkComponents(child);
  5476. }
  5477. if (typeof child === 'function') {
  5478. child = child.options;
  5479. }
  5480. normalizeProps(child, vm);
  5481. normalizeInject(child, vm);
  5482. normalizeDirectives(child);
  5483. // Apply extends and mixins on the child options,
  5484. // but only if it is a raw options object that isn't
  5485. // the result of another mergeOptions call.
  5486. // Only merged options has the _base property.
  5487. if (!child._base) {
  5488. if (child.extends) {
  5489. parent = mergeOptions(parent, child.extends, vm);
  5490. }
  5491. if (child.mixins) {
  5492. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5493. parent = mergeOptions(parent, child.mixins[i], vm);
  5494. }
  5495. }
  5496. }
  5497. var options = {};
  5498. var key;
  5499. for (key in parent) {
  5500. mergeField(key);
  5501. }
  5502. for (key in child) {
  5503. if (!hasOwn(parent, key)) {
  5504. mergeField(key);
  5505. }
  5506. }
  5507. function mergeField (key) {
  5508. var strat = strats[key] || defaultStrat;
  5509. options[key] = strat(parent[key], child[key], vm, key);
  5510. }
  5511. return options
  5512. }
  5513. /**
  5514. * Resolve an asset.
  5515. * This function is used because child instances need access
  5516. * to assets defined in its ancestor chain.
  5517. */
  5518. function resolveAsset (
  5519. options,
  5520. type,
  5521. id,
  5522. warnMissing
  5523. ) {
  5524. /* istanbul ignore if */
  5525. if (typeof id !== 'string') {
  5526. return
  5527. }
  5528. var assets = options[type];
  5529. // check local registration variations first
  5530. if (hasOwn(assets, id)) { return assets[id] }
  5531. var camelizedId = camelize(id);
  5532. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5533. var PascalCaseId = capitalize(camelizedId);
  5534. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5535. // fallback to prototype chain
  5536. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5537. if ( true && warnMissing && !res) {
  5538. warn(
  5539. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5540. options
  5541. );
  5542. }
  5543. return res
  5544. }
  5545. /* */
  5546. function validateProp (
  5547. key,
  5548. propOptions,
  5549. propsData,
  5550. vm
  5551. ) {
  5552. var prop = propOptions[key];
  5553. var absent = !hasOwn(propsData, key);
  5554. var value = propsData[key];
  5555. // boolean casting
  5556. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5557. if (booleanIndex > -1) {
  5558. if (absent && !hasOwn(prop, 'default')) {
  5559. value = false;
  5560. } else if (value === '' || value === hyphenate(key)) {
  5561. // only cast empty string / same name to boolean if
  5562. // boolean has higher priority
  5563. var stringIndex = getTypeIndex(String, prop.type);
  5564. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5565. value = true;
  5566. }
  5567. }
  5568. }
  5569. // check default value
  5570. if (value === undefined) {
  5571. value = getPropDefaultValue(vm, prop, key);
  5572. // since the default value is a fresh copy,
  5573. // make sure to observe it.
  5574. var prevShouldObserve = shouldObserve;
  5575. toggleObserving(true);
  5576. observe(value);
  5577. toggleObserving(prevShouldObserve);
  5578. }
  5579. if (
  5580. true
  5581. ) {
  5582. assertProp(prop, key, value, vm, absent);
  5583. }
  5584. return value
  5585. }
  5586. /**
  5587. * Get the default value of a prop.
  5588. */
  5589. function getPropDefaultValue (vm, prop, key) {
  5590. // no default, return undefined
  5591. if (!hasOwn(prop, 'default')) {
  5592. return undefined
  5593. }
  5594. var def = prop.default;
  5595. // warn against non-factory defaults for Object & Array
  5596. if ( true && isObject(def)) {
  5597. warn(
  5598. 'Invalid default value for prop "' + key + '": ' +
  5599. 'Props with type Object/Array must use a factory function ' +
  5600. 'to return the default value.',
  5601. vm
  5602. );
  5603. }
  5604. // the raw prop value was also undefined from previous render,
  5605. // return previous default value to avoid unnecessary watcher trigger
  5606. if (vm && vm.$options.propsData &&
  5607. vm.$options.propsData[key] === undefined &&
  5608. vm._props[key] !== undefined
  5609. ) {
  5610. return vm._props[key]
  5611. }
  5612. // call factory function for non-Function types
  5613. // a value is Function if its prototype is function even across different execution context
  5614. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5615. ? def.call(vm)
  5616. : def
  5617. }
  5618. /**
  5619. * Assert whether a prop is valid.
  5620. */
  5621. function assertProp (
  5622. prop,
  5623. name,
  5624. value,
  5625. vm,
  5626. absent
  5627. ) {
  5628. if (prop.required && absent) {
  5629. warn(
  5630. 'Missing required prop: "' + name + '"',
  5631. vm
  5632. );
  5633. return
  5634. }
  5635. if (value == null && !prop.required) {
  5636. return
  5637. }
  5638. var type = prop.type;
  5639. var valid = !type || type === true;
  5640. var expectedTypes = [];
  5641. if (type) {
  5642. if (!Array.isArray(type)) {
  5643. type = [type];
  5644. }
  5645. for (var i = 0; i < type.length && !valid; i++) {
  5646. var assertedType = assertType(value, type[i]);
  5647. expectedTypes.push(assertedType.expectedType || '');
  5648. valid = assertedType.valid;
  5649. }
  5650. }
  5651. if (!valid) {
  5652. warn(
  5653. getInvalidTypeMessage(name, value, expectedTypes),
  5654. vm
  5655. );
  5656. return
  5657. }
  5658. var validator = prop.validator;
  5659. if (validator) {
  5660. if (!validator(value)) {
  5661. warn(
  5662. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5663. vm
  5664. );
  5665. }
  5666. }
  5667. }
  5668. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5669. function assertType (value, type) {
  5670. var valid;
  5671. var expectedType = getType(type);
  5672. if (simpleCheckRE.test(expectedType)) {
  5673. var t = typeof value;
  5674. valid = t === expectedType.toLowerCase();
  5675. // for primitive wrapper objects
  5676. if (!valid && t === 'object') {
  5677. valid = value instanceof type;
  5678. }
  5679. } else if (expectedType === 'Object') {
  5680. valid = isPlainObject(value);
  5681. } else if (expectedType === 'Array') {
  5682. valid = Array.isArray(value);
  5683. } else {
  5684. valid = value instanceof type;
  5685. }
  5686. return {
  5687. valid: valid,
  5688. expectedType: expectedType
  5689. }
  5690. }
  5691. /**
  5692. * Use function string name to check built-in types,
  5693. * because a simple equality check will fail when running
  5694. * across different vms / iframes.
  5695. */
  5696. function getType (fn) {
  5697. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5698. return match ? match[1] : ''
  5699. }
  5700. function isSameType (a, b) {
  5701. return getType(a) === getType(b)
  5702. }
  5703. function getTypeIndex (type, expectedTypes) {
  5704. if (!Array.isArray(expectedTypes)) {
  5705. return isSameType(expectedTypes, type) ? 0 : -1
  5706. }
  5707. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5708. if (isSameType(expectedTypes[i], type)) {
  5709. return i
  5710. }
  5711. }
  5712. return -1
  5713. }
  5714. function getInvalidTypeMessage (name, value, expectedTypes) {
  5715. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5716. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5717. var expectedType = expectedTypes[0];
  5718. var receivedType = toRawType(value);
  5719. var expectedValue = styleValue(value, expectedType);
  5720. var receivedValue = styleValue(value, receivedType);
  5721. // check if we need to specify expected value
  5722. if (expectedTypes.length === 1 &&
  5723. isExplicable(expectedType) &&
  5724. !isBoolean(expectedType, receivedType)) {
  5725. message += " with value " + expectedValue;
  5726. }
  5727. message += ", got " + receivedType + " ";
  5728. // check if we need to specify received value
  5729. if (isExplicable(receivedType)) {
  5730. message += "with value " + receivedValue + ".";
  5731. }
  5732. return message
  5733. }
  5734. function styleValue (value, type) {
  5735. if (type === 'String') {
  5736. return ("\"" + value + "\"")
  5737. } else if (type === 'Number') {
  5738. return ("" + (Number(value)))
  5739. } else {
  5740. return ("" + value)
  5741. }
  5742. }
  5743. function isExplicable (value) {
  5744. var explicitTypes = ['string', 'number', 'boolean'];
  5745. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5746. }
  5747. function isBoolean () {
  5748. var args = [], len = arguments.length;
  5749. while ( len-- ) args[ len ] = arguments[ len ];
  5750. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5751. }
  5752. /* */
  5753. function handleError (err, vm, info) {
  5754. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5755. // See: https://github.com/vuejs/vuex/issues/1505
  5756. pushTarget();
  5757. try {
  5758. if (vm) {
  5759. var cur = vm;
  5760. while ((cur = cur.$parent)) {
  5761. var hooks = cur.$options.errorCaptured;
  5762. if (hooks) {
  5763. for (var i = 0; i < hooks.length; i++) {
  5764. try {
  5765. var capture = hooks[i].call(cur, err, vm, info) === false;
  5766. if (capture) { return }
  5767. } catch (e) {
  5768. globalHandleError(e, cur, 'errorCaptured hook');
  5769. }
  5770. }
  5771. }
  5772. }
  5773. }
  5774. globalHandleError(err, vm, info);
  5775. } finally {
  5776. popTarget();
  5777. }
  5778. }
  5779. function invokeWithErrorHandling (
  5780. handler,
  5781. context,
  5782. args,
  5783. vm,
  5784. info
  5785. ) {
  5786. var res;
  5787. try {
  5788. res = args ? handler.apply(context, args) : handler.call(context);
  5789. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5790. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5791. // issue #9511
  5792. // avoid catch triggering multiple times when nested calls
  5793. res._handled = true;
  5794. }
  5795. } catch (e) {
  5796. handleError(e, vm, info);
  5797. }
  5798. return res
  5799. }
  5800. function globalHandleError (err, vm, info) {
  5801. if (config.errorHandler) {
  5802. try {
  5803. return config.errorHandler.call(null, err, vm, info)
  5804. } catch (e) {
  5805. // if the user intentionally throws the original error in the handler,
  5806. // do not log it twice
  5807. if (e !== err) {
  5808. logError(e, null, 'config.errorHandler');
  5809. }
  5810. }
  5811. }
  5812. logError(err, vm, info);
  5813. }
  5814. function logError (err, vm, info) {
  5815. if (true) {
  5816. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5817. }
  5818. /* istanbul ignore else */
  5819. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5820. console.error(err);
  5821. } else {
  5822. throw err
  5823. }
  5824. }
  5825. /* */
  5826. var callbacks = [];
  5827. var pending = false;
  5828. function flushCallbacks () {
  5829. pending = false;
  5830. var copies = callbacks.slice(0);
  5831. callbacks.length = 0;
  5832. for (var i = 0; i < copies.length; i++) {
  5833. copies[i]();
  5834. }
  5835. }
  5836. // Here we have async deferring wrappers using microtasks.
  5837. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5838. // However, it has subtle problems when state is changed right before repaint
  5839. // (e.g. #6813, out-in transitions).
  5840. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5841. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5842. // So we now use microtasks everywhere, again.
  5843. // A major drawback of this tradeoff is that there are some scenarios
  5844. // where microtasks have too high a priority and fire in between supposedly
  5845. // sequential events (e.g. #4521, #6690, which have workarounds)
  5846. // or even between bubbling of the same event (#6566).
  5847. var timerFunc;
  5848. // The nextTick behavior leverages the microtask queue, which can be accessed
  5849. // via either native Promise.then or MutationObserver.
  5850. // MutationObserver has wider support, however it is seriously bugged in
  5851. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5852. // completely stops working after triggering a few times... so, if native
  5853. // Promise is available, we will use it:
  5854. /* istanbul ignore next, $flow-disable-line */
  5855. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5856. var p = Promise.resolve();
  5857. timerFunc = function () {
  5858. p.then(flushCallbacks);
  5859. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5860. // it can get stuck in a weird state where callbacks are pushed into the
  5861. // microtask queue but the queue isn't being flushed, until the browser
  5862. // needs to do some other work, e.g. handle a timer. Therefore we can
  5863. // "force" the microtask queue to be flushed by adding an empty timer.
  5864. if (isIOS) { setTimeout(noop); }
  5865. };
  5866. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5867. isNative(MutationObserver) ||
  5868. // PhantomJS and iOS 7.x
  5869. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5870. )) {
  5871. // Use MutationObserver where native Promise is not available,
  5872. // e.g. PhantomJS, iOS7, Android 4.4
  5873. // (#6466 MutationObserver is unreliable in IE11)
  5874. var counter = 1;
  5875. var observer = new MutationObserver(flushCallbacks);
  5876. var textNode = document.createTextNode(String(counter));
  5877. observer.observe(textNode, {
  5878. characterData: true
  5879. });
  5880. timerFunc = function () {
  5881. counter = (counter + 1) % 2;
  5882. textNode.data = String(counter);
  5883. };
  5884. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5885. // Fallback to setImmediate.
  5886. // Technically it leverages the (macro) task queue,
  5887. // but it is still a better choice than setTimeout.
  5888. timerFunc = function () {
  5889. setImmediate(flushCallbacks);
  5890. };
  5891. } else {
  5892. // Fallback to setTimeout.
  5893. timerFunc = function () {
  5894. setTimeout(flushCallbacks, 0);
  5895. };
  5896. }
  5897. function nextTick (cb, ctx) {
  5898. var _resolve;
  5899. callbacks.push(function () {
  5900. if (cb) {
  5901. try {
  5902. cb.call(ctx);
  5903. } catch (e) {
  5904. handleError(e, ctx, 'nextTick');
  5905. }
  5906. } else if (_resolve) {
  5907. _resolve(ctx);
  5908. }
  5909. });
  5910. if (!pending) {
  5911. pending = true;
  5912. timerFunc();
  5913. }
  5914. // $flow-disable-line
  5915. if (!cb && typeof Promise !== 'undefined') {
  5916. return new Promise(function (resolve) {
  5917. _resolve = resolve;
  5918. })
  5919. }
  5920. }
  5921. /* */
  5922. /* not type checking this file because flow doesn't play well with Proxy */
  5923. var initProxy;
  5924. if (true) {
  5925. var allowedGlobals = makeMap(
  5926. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5927. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5928. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5929. 'require' // for Webpack/Browserify
  5930. );
  5931. var warnNonPresent = function (target, key) {
  5932. warn(
  5933. "Property or method \"" + key + "\" is not defined on the instance but " +
  5934. 'referenced during render. Make sure that this property is reactive, ' +
  5935. 'either in the data option, or for class-based components, by ' +
  5936. 'initializing the property. ' +
  5937. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5938. target
  5939. );
  5940. };
  5941. var warnReservedPrefix = function (target, key) {
  5942. warn(
  5943. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5944. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5945. 'prevent conflicts with Vue internals. ' +
  5946. 'See: https://vuejs.org/v2/api/#data',
  5947. target
  5948. );
  5949. };
  5950. var hasProxy =
  5951. typeof Proxy !== 'undefined' && isNative(Proxy);
  5952. if (hasProxy) {
  5953. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5954. config.keyCodes = new Proxy(config.keyCodes, {
  5955. set: function set (target, key, value) {
  5956. if (isBuiltInModifier(key)) {
  5957. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5958. return false
  5959. } else {
  5960. target[key] = value;
  5961. return true
  5962. }
  5963. }
  5964. });
  5965. }
  5966. var hasHandler = {
  5967. has: function has (target, key) {
  5968. var has = key in target;
  5969. var isAllowed = allowedGlobals(key) ||
  5970. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5971. if (!has && !isAllowed) {
  5972. if (key in target.$data) { warnReservedPrefix(target, key); }
  5973. else { warnNonPresent(target, key); }
  5974. }
  5975. return has || !isAllowed
  5976. }
  5977. };
  5978. var getHandler = {
  5979. get: function get (target, key) {
  5980. if (typeof key === 'string' && !(key in target)) {
  5981. if (key in target.$data) { warnReservedPrefix(target, key); }
  5982. else { warnNonPresent(target, key); }
  5983. }
  5984. return target[key]
  5985. }
  5986. };
  5987. initProxy = function initProxy (vm) {
  5988. if (hasProxy) {
  5989. // determine which proxy handler to use
  5990. var options = vm.$options;
  5991. var handlers = options.render && options.render._withStripped
  5992. ? getHandler
  5993. : hasHandler;
  5994. vm._renderProxy = new Proxy(vm, handlers);
  5995. } else {
  5996. vm._renderProxy = vm;
  5997. }
  5998. };
  5999. }
  6000. /* */
  6001. var seenObjects = new _Set();
  6002. /**
  6003. * Recursively traverse an object to evoke all converted
  6004. * getters, so that every nested property inside the object
  6005. * is collected as a "deep" dependency.
  6006. */
  6007. function traverse (val) {
  6008. _traverse(val, seenObjects);
  6009. seenObjects.clear();
  6010. }
  6011. function _traverse (val, seen) {
  6012. var i, keys;
  6013. var isA = Array.isArray(val);
  6014. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6015. return
  6016. }
  6017. if (val.__ob__) {
  6018. var depId = val.__ob__.dep.id;
  6019. if (seen.has(depId)) {
  6020. return
  6021. }
  6022. seen.add(depId);
  6023. }
  6024. if (isA) {
  6025. i = val.length;
  6026. while (i--) { _traverse(val[i], seen); }
  6027. } else {
  6028. keys = Object.keys(val);
  6029. i = keys.length;
  6030. while (i--) { _traverse(val[keys[i]], seen); }
  6031. }
  6032. }
  6033. var mark;
  6034. var measure;
  6035. if (true) {
  6036. var perf = inBrowser && window.performance;
  6037. /* istanbul ignore if */
  6038. if (
  6039. perf &&
  6040. perf.mark &&
  6041. perf.measure &&
  6042. perf.clearMarks &&
  6043. perf.clearMeasures
  6044. ) {
  6045. mark = function (tag) { return perf.mark(tag); };
  6046. measure = function (name, startTag, endTag) {
  6047. perf.measure(name, startTag, endTag);
  6048. perf.clearMarks(startTag);
  6049. perf.clearMarks(endTag);
  6050. // perf.clearMeasures(name)
  6051. };
  6052. }
  6053. }
  6054. /* */
  6055. var normalizeEvent = cached(function (name) {
  6056. var passive = name.charAt(0) === '&';
  6057. name = passive ? name.slice(1) : name;
  6058. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6059. name = once$$1 ? name.slice(1) : name;
  6060. var capture = name.charAt(0) === '!';
  6061. name = capture ? name.slice(1) : name;
  6062. return {
  6063. name: name,
  6064. once: once$$1,
  6065. capture: capture,
  6066. passive: passive
  6067. }
  6068. });
  6069. function createFnInvoker (fns, vm) {
  6070. function invoker () {
  6071. var arguments$1 = arguments;
  6072. var fns = invoker.fns;
  6073. if (Array.isArray(fns)) {
  6074. var cloned = fns.slice();
  6075. for (var i = 0; i < cloned.length; i++) {
  6076. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6077. }
  6078. } else {
  6079. // return handler return value for single handlers
  6080. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6081. }
  6082. }
  6083. invoker.fns = fns;
  6084. return invoker
  6085. }
  6086. function updateListeners (
  6087. on,
  6088. oldOn,
  6089. add,
  6090. remove$$1,
  6091. createOnceHandler,
  6092. vm
  6093. ) {
  6094. var name, def$$1, cur, old, event;
  6095. for (name in on) {
  6096. def$$1 = cur = on[name];
  6097. old = oldOn[name];
  6098. event = normalizeEvent(name);
  6099. if (isUndef(cur)) {
  6100. true && warn(
  6101. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6102. vm
  6103. );
  6104. } else if (isUndef(old)) {
  6105. if (isUndef(cur.fns)) {
  6106. cur = on[name] = createFnInvoker(cur, vm);
  6107. }
  6108. if (isTrue(event.once)) {
  6109. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6110. }
  6111. add(event.name, cur, event.capture, event.passive, event.params);
  6112. } else if (cur !== old) {
  6113. old.fns = cur;
  6114. on[name] = old;
  6115. }
  6116. }
  6117. for (name in oldOn) {
  6118. if (isUndef(on[name])) {
  6119. event = normalizeEvent(name);
  6120. remove$$1(event.name, oldOn[name], event.capture);
  6121. }
  6122. }
  6123. }
  6124. /* */
  6125. /* */
  6126. // fixed by xxxxxx (mp properties)
  6127. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6128. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6129. if (isUndef(propOptions)) {
  6130. return res
  6131. }
  6132. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6133. var attrs = data.attrs;
  6134. var props = data.props;
  6135. if (isDef(attrs) || isDef(props)) {
  6136. for (var key in propOptions) {
  6137. var altKey = hyphenate(key);
  6138. var result = checkProp(res, props, key, altKey, true) ||
  6139. checkProp(res, attrs, key, altKey, false);
  6140. // externalClass
  6141. if (
  6142. result &&
  6143. res[key] &&
  6144. externalClasses.indexOf(altKey) !== -1 &&
  6145. context[camelize(res[key])]
  6146. ) {
  6147. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6148. res[key] = context[camelize(res[key])];
  6149. }
  6150. }
  6151. }
  6152. return res
  6153. }
  6154. function extractPropsFromVNodeData (
  6155. data,
  6156. Ctor,
  6157. tag,
  6158. context// fixed by xxxxxx
  6159. ) {
  6160. // we are only extracting raw values here.
  6161. // validation and default values are handled in the child
  6162. // component itself.
  6163. var propOptions = Ctor.options.props;
  6164. if (isUndef(propOptions)) {
  6165. // fixed by xxxxxx
  6166. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6167. }
  6168. var res = {};
  6169. var attrs = data.attrs;
  6170. var props = data.props;
  6171. if (isDef(attrs) || isDef(props)) {
  6172. for (var key in propOptions) {
  6173. var altKey = hyphenate(key);
  6174. if (true) {
  6175. var keyInLowerCase = key.toLowerCase();
  6176. if (
  6177. key !== keyInLowerCase &&
  6178. attrs && hasOwn(attrs, keyInLowerCase)
  6179. ) {
  6180. tip(
  6181. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6182. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6183. " \"" + key + "\". " +
  6184. "Note that HTML attributes are case-insensitive and camelCased " +
  6185. "props need to use their kebab-case equivalents when using in-DOM " +
  6186. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6187. );
  6188. }
  6189. }
  6190. checkProp(res, props, key, altKey, true) ||
  6191. checkProp(res, attrs, key, altKey, false);
  6192. }
  6193. }
  6194. // fixed by xxxxxx
  6195. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6196. }
  6197. function checkProp (
  6198. res,
  6199. hash,
  6200. key,
  6201. altKey,
  6202. preserve
  6203. ) {
  6204. if (isDef(hash)) {
  6205. if (hasOwn(hash, key)) {
  6206. res[key] = hash[key];
  6207. if (!preserve) {
  6208. delete hash[key];
  6209. }
  6210. return true
  6211. } else if (hasOwn(hash, altKey)) {
  6212. res[key] = hash[altKey];
  6213. if (!preserve) {
  6214. delete hash[altKey];
  6215. }
  6216. return true
  6217. }
  6218. }
  6219. return false
  6220. }
  6221. /* */
  6222. // The template compiler attempts to minimize the need for normalization by
  6223. // statically analyzing the template at compile time.
  6224. //
  6225. // For plain HTML markup, normalization can be completely skipped because the
  6226. // generated render function is guaranteed to return Array<VNode>. There are
  6227. // two cases where extra normalization is needed:
  6228. // 1. When the children contains components - because a functional component
  6229. // may return an Array instead of a single root. In this case, just a simple
  6230. // normalization is needed - if any child is an Array, we flatten the whole
  6231. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6232. // because functional components already normalize their own children.
  6233. function simpleNormalizeChildren (children) {
  6234. for (var i = 0; i < children.length; i++) {
  6235. if (Array.isArray(children[i])) {
  6236. return Array.prototype.concat.apply([], children)
  6237. }
  6238. }
  6239. return children
  6240. }
  6241. // 2. When the children contains constructs that always generated nested Arrays,
  6242. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6243. // with hand-written render functions / JSX. In such cases a full normalization
  6244. // is needed to cater to all possible types of children values.
  6245. function normalizeChildren (children) {
  6246. return isPrimitive(children)
  6247. ? [createTextVNode(children)]
  6248. : Array.isArray(children)
  6249. ? normalizeArrayChildren(children)
  6250. : undefined
  6251. }
  6252. function isTextNode (node) {
  6253. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6254. }
  6255. function normalizeArrayChildren (children, nestedIndex) {
  6256. var res = [];
  6257. var i, c, lastIndex, last;
  6258. for (i = 0; i < children.length; i++) {
  6259. c = children[i];
  6260. if (isUndef(c) || typeof c === 'boolean') { continue }
  6261. lastIndex = res.length - 1;
  6262. last = res[lastIndex];
  6263. // nested
  6264. if (Array.isArray(c)) {
  6265. if (c.length > 0) {
  6266. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6267. // merge adjacent text nodes
  6268. if (isTextNode(c[0]) && isTextNode(last)) {
  6269. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6270. c.shift();
  6271. }
  6272. res.push.apply(res, c);
  6273. }
  6274. } else if (isPrimitive(c)) {
  6275. if (isTextNode(last)) {
  6276. // merge adjacent text nodes
  6277. // this is necessary for SSR hydration because text nodes are
  6278. // essentially merged when rendered to HTML strings
  6279. res[lastIndex] = createTextVNode(last.text + c);
  6280. } else if (c !== '') {
  6281. // convert primitive to vnode
  6282. res.push(createTextVNode(c));
  6283. }
  6284. } else {
  6285. if (isTextNode(c) && isTextNode(last)) {
  6286. // merge adjacent text nodes
  6287. res[lastIndex] = createTextVNode(last.text + c.text);
  6288. } else {
  6289. // default key for nested array children (likely generated by v-for)
  6290. if (isTrue(children._isVList) &&
  6291. isDef(c.tag) &&
  6292. isUndef(c.key) &&
  6293. isDef(nestedIndex)) {
  6294. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6295. }
  6296. res.push(c);
  6297. }
  6298. }
  6299. }
  6300. return res
  6301. }
  6302. /* */
  6303. function initProvide (vm) {
  6304. var provide = vm.$options.provide;
  6305. if (provide) {
  6306. vm._provided = typeof provide === 'function'
  6307. ? provide.call(vm)
  6308. : provide;
  6309. }
  6310. }
  6311. function initInjections (vm) {
  6312. var result = resolveInject(vm.$options.inject, vm);
  6313. if (result) {
  6314. toggleObserving(false);
  6315. Object.keys(result).forEach(function (key) {
  6316. /* istanbul ignore else */
  6317. if (true) {
  6318. defineReactive$$1(vm, key, result[key], function () {
  6319. warn(
  6320. "Avoid mutating an injected value directly since the changes will be " +
  6321. "overwritten whenever the provided component re-renders. " +
  6322. "injection being mutated: \"" + key + "\"",
  6323. vm
  6324. );
  6325. });
  6326. } else {}
  6327. });
  6328. toggleObserving(true);
  6329. }
  6330. }
  6331. function resolveInject (inject, vm) {
  6332. if (inject) {
  6333. // inject is :any because flow is not smart enough to figure out cached
  6334. var result = Object.create(null);
  6335. var keys = hasSymbol
  6336. ? Reflect.ownKeys(inject)
  6337. : Object.keys(inject);
  6338. for (var i = 0; i < keys.length; i++) {
  6339. var key = keys[i];
  6340. // #6574 in case the inject object is observed...
  6341. if (key === '__ob__') { continue }
  6342. var provideKey = inject[key].from;
  6343. var source = vm;
  6344. while (source) {
  6345. if (source._provided && hasOwn(source._provided, provideKey)) {
  6346. result[key] = source._provided[provideKey];
  6347. break
  6348. }
  6349. source = source.$parent;
  6350. }
  6351. if (!source) {
  6352. if ('default' in inject[key]) {
  6353. var provideDefault = inject[key].default;
  6354. result[key] = typeof provideDefault === 'function'
  6355. ? provideDefault.call(vm)
  6356. : provideDefault;
  6357. } else if (true) {
  6358. warn(("Injection \"" + key + "\" not found"), vm);
  6359. }
  6360. }
  6361. }
  6362. return result
  6363. }
  6364. }
  6365. /* */
  6366. /**
  6367. * Runtime helper for resolving raw children VNodes into a slot object.
  6368. */
  6369. function resolveSlots (
  6370. children,
  6371. context
  6372. ) {
  6373. if (!children || !children.length) {
  6374. return {}
  6375. }
  6376. var slots = {};
  6377. for (var i = 0, l = children.length; i < l; i++) {
  6378. var child = children[i];
  6379. var data = child.data;
  6380. // remove slot attribute if the node is resolved as a Vue slot node
  6381. if (data && data.attrs && data.attrs.slot) {
  6382. delete data.attrs.slot;
  6383. }
  6384. // named slots should only be respected if the vnode was rendered in the
  6385. // same context.
  6386. if ((child.context === context || child.fnContext === context) &&
  6387. data && data.slot != null
  6388. ) {
  6389. var name = data.slot;
  6390. var slot = (slots[name] || (slots[name] = []));
  6391. if (child.tag === 'template') {
  6392. slot.push.apply(slot, child.children || []);
  6393. } else {
  6394. slot.push(child);
  6395. }
  6396. } else {
  6397. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6398. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6399. (slots['page'] || (slots['page'] = [])).push(child);
  6400. }else{
  6401. (slots.default || (slots.default = [])).push(child);
  6402. }
  6403. }
  6404. }
  6405. // ignore slots that contains only whitespace
  6406. for (var name$1 in slots) {
  6407. if (slots[name$1].every(isWhitespace)) {
  6408. delete slots[name$1];
  6409. }
  6410. }
  6411. return slots
  6412. }
  6413. function isWhitespace (node) {
  6414. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6415. }
  6416. /* */
  6417. function normalizeScopedSlots (
  6418. slots,
  6419. normalSlots,
  6420. prevSlots
  6421. ) {
  6422. var res;
  6423. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6424. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6425. var key = slots && slots.$key;
  6426. if (!slots) {
  6427. res = {};
  6428. } else if (slots._normalized) {
  6429. // fast path 1: child component re-render only, parent did not change
  6430. return slots._normalized
  6431. } else if (
  6432. isStable &&
  6433. prevSlots &&
  6434. prevSlots !== emptyObject &&
  6435. key === prevSlots.$key &&
  6436. !hasNormalSlots &&
  6437. !prevSlots.$hasNormal
  6438. ) {
  6439. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6440. // only need to normalize once
  6441. return prevSlots
  6442. } else {
  6443. res = {};
  6444. for (var key$1 in slots) {
  6445. if (slots[key$1] && key$1[0] !== '$') {
  6446. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6447. }
  6448. }
  6449. }
  6450. // expose normal slots on scopedSlots
  6451. for (var key$2 in normalSlots) {
  6452. if (!(key$2 in res)) {
  6453. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6454. }
  6455. }
  6456. // avoriaz seems to mock a non-extensible $scopedSlots object
  6457. // and when that is passed down this would cause an error
  6458. if (slots && Object.isExtensible(slots)) {
  6459. (slots)._normalized = res;
  6460. }
  6461. def(res, '$stable', isStable);
  6462. def(res, '$key', key);
  6463. def(res, '$hasNormal', hasNormalSlots);
  6464. return res
  6465. }
  6466. function normalizeScopedSlot(normalSlots, key, fn) {
  6467. var normalized = function () {
  6468. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6469. res = res && typeof res === 'object' && !Array.isArray(res)
  6470. ? [res] // single vnode
  6471. : normalizeChildren(res);
  6472. return res && (
  6473. res.length === 0 ||
  6474. (res.length === 1 && res[0].isComment) // #9658
  6475. ) ? undefined
  6476. : res
  6477. };
  6478. // this is a slot using the new v-slot syntax without scope. although it is
  6479. // compiled as a scoped slot, render fn users would expect it to be present
  6480. // on this.$slots because the usage is semantically a normal slot.
  6481. if (fn.proxy) {
  6482. Object.defineProperty(normalSlots, key, {
  6483. get: normalized,
  6484. enumerable: true,
  6485. configurable: true
  6486. });
  6487. }
  6488. return normalized
  6489. }
  6490. function proxyNormalSlot(slots, key) {
  6491. return function () { return slots[key]; }
  6492. }
  6493. /* */
  6494. /**
  6495. * Runtime helper for rendering v-for lists.
  6496. */
  6497. function renderList (
  6498. val,
  6499. render
  6500. ) {
  6501. var ret, i, l, keys, key;
  6502. if (Array.isArray(val) || typeof val === 'string') {
  6503. ret = new Array(val.length);
  6504. for (i = 0, l = val.length; i < l; i++) {
  6505. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6506. }
  6507. } else if (typeof val === 'number') {
  6508. ret = new Array(val);
  6509. for (i = 0; i < val; i++) {
  6510. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6511. }
  6512. } else if (isObject(val)) {
  6513. if (hasSymbol && val[Symbol.iterator]) {
  6514. ret = [];
  6515. var iterator = val[Symbol.iterator]();
  6516. var result = iterator.next();
  6517. while (!result.done) {
  6518. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6519. result = iterator.next();
  6520. }
  6521. } else {
  6522. keys = Object.keys(val);
  6523. ret = new Array(keys.length);
  6524. for (i = 0, l = keys.length; i < l; i++) {
  6525. key = keys[i];
  6526. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6527. }
  6528. }
  6529. }
  6530. if (!isDef(ret)) {
  6531. ret = [];
  6532. }
  6533. (ret)._isVList = true;
  6534. return ret
  6535. }
  6536. /* */
  6537. /**
  6538. * Runtime helper for rendering <slot>
  6539. */
  6540. function renderSlot (
  6541. name,
  6542. fallback,
  6543. props,
  6544. bindObject
  6545. ) {
  6546. var scopedSlotFn = this.$scopedSlots[name];
  6547. var nodes;
  6548. if (scopedSlotFn) { // scoped slot
  6549. props = props || {};
  6550. if (bindObject) {
  6551. if ( true && !isObject(bindObject)) {
  6552. warn(
  6553. 'slot v-bind without argument expects an Object',
  6554. this
  6555. );
  6556. }
  6557. props = extend(extend({}, bindObject), props);
  6558. }
  6559. // fixed by xxxxxx app-plus scopedSlot
  6560. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6561. } else {
  6562. nodes = this.$slots[name] || fallback;
  6563. }
  6564. var target = props && props.slot;
  6565. if (target) {
  6566. return this.$createElement('template', { slot: target }, nodes)
  6567. } else {
  6568. return nodes
  6569. }
  6570. }
  6571. /* */
  6572. /**
  6573. * Runtime helper for resolving filters
  6574. */
  6575. function resolveFilter (id) {
  6576. return resolveAsset(this.$options, 'filters', id, true) || identity
  6577. }
  6578. /* */
  6579. function isKeyNotMatch (expect, actual) {
  6580. if (Array.isArray(expect)) {
  6581. return expect.indexOf(actual) === -1
  6582. } else {
  6583. return expect !== actual
  6584. }
  6585. }
  6586. /**
  6587. * Runtime helper for checking keyCodes from config.
  6588. * exposed as Vue.prototype._k
  6589. * passing in eventKeyName as last argument separately for backwards compat
  6590. */
  6591. function checkKeyCodes (
  6592. eventKeyCode,
  6593. key,
  6594. builtInKeyCode,
  6595. eventKeyName,
  6596. builtInKeyName
  6597. ) {
  6598. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6599. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6600. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6601. } else if (mappedKeyCode) {
  6602. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6603. } else if (eventKeyName) {
  6604. return hyphenate(eventKeyName) !== key
  6605. }
  6606. }
  6607. /* */
  6608. /**
  6609. * Runtime helper for merging v-bind="object" into a VNode's data.
  6610. */
  6611. function bindObjectProps (
  6612. data,
  6613. tag,
  6614. value,
  6615. asProp,
  6616. isSync
  6617. ) {
  6618. if (value) {
  6619. if (!isObject(value)) {
  6620. true && warn(
  6621. 'v-bind without argument expects an Object or Array value',
  6622. this
  6623. );
  6624. } else {
  6625. if (Array.isArray(value)) {
  6626. value = toObject(value);
  6627. }
  6628. var hash;
  6629. var loop = function ( key ) {
  6630. if (
  6631. key === 'class' ||
  6632. key === 'style' ||
  6633. isReservedAttribute(key)
  6634. ) {
  6635. hash = data;
  6636. } else {
  6637. var type = data.attrs && data.attrs.type;
  6638. hash = asProp || config.mustUseProp(tag, type, key)
  6639. ? data.domProps || (data.domProps = {})
  6640. : data.attrs || (data.attrs = {});
  6641. }
  6642. var camelizedKey = camelize(key);
  6643. var hyphenatedKey = hyphenate(key);
  6644. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6645. hash[key] = value[key];
  6646. if (isSync) {
  6647. var on = data.on || (data.on = {});
  6648. on[("update:" + key)] = function ($event) {
  6649. value[key] = $event;
  6650. };
  6651. }
  6652. }
  6653. };
  6654. for (var key in value) loop( key );
  6655. }
  6656. }
  6657. return data
  6658. }
  6659. /* */
  6660. /**
  6661. * Runtime helper for rendering static trees.
  6662. */
  6663. function renderStatic (
  6664. index,
  6665. isInFor
  6666. ) {
  6667. var cached = this._staticTrees || (this._staticTrees = []);
  6668. var tree = cached[index];
  6669. // if has already-rendered static tree and not inside v-for,
  6670. // we can reuse the same tree.
  6671. if (tree && !isInFor) {
  6672. return tree
  6673. }
  6674. // otherwise, render a fresh tree.
  6675. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6676. this._renderProxy,
  6677. null,
  6678. this // for render fns generated for functional component templates
  6679. );
  6680. markStatic(tree, ("__static__" + index), false);
  6681. return tree
  6682. }
  6683. /**
  6684. * Runtime helper for v-once.
  6685. * Effectively it means marking the node as static with a unique key.
  6686. */
  6687. function markOnce (
  6688. tree,
  6689. index,
  6690. key
  6691. ) {
  6692. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6693. return tree
  6694. }
  6695. function markStatic (
  6696. tree,
  6697. key,
  6698. isOnce
  6699. ) {
  6700. if (Array.isArray(tree)) {
  6701. for (var i = 0; i < tree.length; i++) {
  6702. if (tree[i] && typeof tree[i] !== 'string') {
  6703. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6704. }
  6705. }
  6706. } else {
  6707. markStaticNode(tree, key, isOnce);
  6708. }
  6709. }
  6710. function markStaticNode (node, key, isOnce) {
  6711. node.isStatic = true;
  6712. node.key = key;
  6713. node.isOnce = isOnce;
  6714. }
  6715. /* */
  6716. function bindObjectListeners (data, value) {
  6717. if (value) {
  6718. if (!isPlainObject(value)) {
  6719. true && warn(
  6720. 'v-on without argument expects an Object value',
  6721. this
  6722. );
  6723. } else {
  6724. var on = data.on = data.on ? extend({}, data.on) : {};
  6725. for (var key in value) {
  6726. var existing = on[key];
  6727. var ours = value[key];
  6728. on[key] = existing ? [].concat(existing, ours) : ours;
  6729. }
  6730. }
  6731. }
  6732. return data
  6733. }
  6734. /* */
  6735. function resolveScopedSlots (
  6736. fns, // see flow/vnode
  6737. res,
  6738. // the following are added in 2.6
  6739. hasDynamicKeys,
  6740. contentHashKey
  6741. ) {
  6742. res = res || { $stable: !hasDynamicKeys };
  6743. for (var i = 0; i < fns.length; i++) {
  6744. var slot = fns[i];
  6745. if (Array.isArray(slot)) {
  6746. resolveScopedSlots(slot, res, hasDynamicKeys);
  6747. } else if (slot) {
  6748. // marker for reverse proxying v-slot without scope on this.$slots
  6749. if (slot.proxy) {
  6750. slot.fn.proxy = true;
  6751. }
  6752. res[slot.key] = slot.fn;
  6753. }
  6754. }
  6755. if (contentHashKey) {
  6756. (res).$key = contentHashKey;
  6757. }
  6758. return res
  6759. }
  6760. /* */
  6761. function bindDynamicKeys (baseObj, values) {
  6762. for (var i = 0; i < values.length; i += 2) {
  6763. var key = values[i];
  6764. if (typeof key === 'string' && key) {
  6765. baseObj[values[i]] = values[i + 1];
  6766. } else if ( true && key !== '' && key !== null) {
  6767. // null is a special value for explicitly removing a binding
  6768. warn(
  6769. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6770. this
  6771. );
  6772. }
  6773. }
  6774. return baseObj
  6775. }
  6776. // helper to dynamically append modifier runtime markers to event names.
  6777. // ensure only append when value is already string, otherwise it will be cast
  6778. // to string and cause the type check to miss.
  6779. function prependModifier (value, symbol) {
  6780. return typeof value === 'string' ? symbol + value : value
  6781. }
  6782. /* */
  6783. function installRenderHelpers (target) {
  6784. target._o = markOnce;
  6785. target._n = toNumber;
  6786. target._s = toString;
  6787. target._l = renderList;
  6788. target._t = renderSlot;
  6789. target._q = looseEqual;
  6790. target._i = looseIndexOf;
  6791. target._m = renderStatic;
  6792. target._f = resolveFilter;
  6793. target._k = checkKeyCodes;
  6794. target._b = bindObjectProps;
  6795. target._v = createTextVNode;
  6796. target._e = createEmptyVNode;
  6797. target._u = resolveScopedSlots;
  6798. target._g = bindObjectListeners;
  6799. target._d = bindDynamicKeys;
  6800. target._p = prependModifier;
  6801. }
  6802. /* */
  6803. function FunctionalRenderContext (
  6804. data,
  6805. props,
  6806. children,
  6807. parent,
  6808. Ctor
  6809. ) {
  6810. var this$1 = this;
  6811. var options = Ctor.options;
  6812. // ensure the createElement function in functional components
  6813. // gets a unique context - this is necessary for correct named slot check
  6814. var contextVm;
  6815. if (hasOwn(parent, '_uid')) {
  6816. contextVm = Object.create(parent);
  6817. // $flow-disable-line
  6818. contextVm._original = parent;
  6819. } else {
  6820. // the context vm passed in is a functional context as well.
  6821. // in this case we want to make sure we are able to get a hold to the
  6822. // real context instance.
  6823. contextVm = parent;
  6824. // $flow-disable-line
  6825. parent = parent._original;
  6826. }
  6827. var isCompiled = isTrue(options._compiled);
  6828. var needNormalization = !isCompiled;
  6829. this.data = data;
  6830. this.props = props;
  6831. this.children = children;
  6832. this.parent = parent;
  6833. this.listeners = data.on || emptyObject;
  6834. this.injections = resolveInject(options.inject, parent);
  6835. this.slots = function () {
  6836. if (!this$1.$slots) {
  6837. normalizeScopedSlots(
  6838. data.scopedSlots,
  6839. this$1.$slots = resolveSlots(children, parent)
  6840. );
  6841. }
  6842. return this$1.$slots
  6843. };
  6844. Object.defineProperty(this, 'scopedSlots', ({
  6845. enumerable: true,
  6846. get: function get () {
  6847. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6848. }
  6849. }));
  6850. // support for compiled functional template
  6851. if (isCompiled) {
  6852. // exposing $options for renderStatic()
  6853. this.$options = options;
  6854. // pre-resolve slots for renderSlot()
  6855. this.$slots = this.slots();
  6856. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6857. }
  6858. if (options._scopeId) {
  6859. this._c = function (a, b, c, d) {
  6860. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6861. if (vnode && !Array.isArray(vnode)) {
  6862. vnode.fnScopeId = options._scopeId;
  6863. vnode.fnContext = parent;
  6864. }
  6865. return vnode
  6866. };
  6867. } else {
  6868. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6869. }
  6870. }
  6871. installRenderHelpers(FunctionalRenderContext.prototype);
  6872. function createFunctionalComponent (
  6873. Ctor,
  6874. propsData,
  6875. data,
  6876. contextVm,
  6877. children
  6878. ) {
  6879. var options = Ctor.options;
  6880. var props = {};
  6881. var propOptions = options.props;
  6882. if (isDef(propOptions)) {
  6883. for (var key in propOptions) {
  6884. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6885. }
  6886. } else {
  6887. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6888. if (isDef(data.props)) { mergeProps(props, data.props); }
  6889. }
  6890. var renderContext = new FunctionalRenderContext(
  6891. data,
  6892. props,
  6893. children,
  6894. contextVm,
  6895. Ctor
  6896. );
  6897. var vnode = options.render.call(null, renderContext._c, renderContext);
  6898. if (vnode instanceof VNode) {
  6899. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6900. } else if (Array.isArray(vnode)) {
  6901. var vnodes = normalizeChildren(vnode) || [];
  6902. var res = new Array(vnodes.length);
  6903. for (var i = 0; i < vnodes.length; i++) {
  6904. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6905. }
  6906. return res
  6907. }
  6908. }
  6909. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6910. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6911. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6912. // that should not be matched to match.
  6913. var clone = cloneVNode(vnode);
  6914. clone.fnContext = contextVm;
  6915. clone.fnOptions = options;
  6916. if (true) {
  6917. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6918. }
  6919. if (data.slot) {
  6920. (clone.data || (clone.data = {})).slot = data.slot;
  6921. }
  6922. return clone
  6923. }
  6924. function mergeProps (to, from) {
  6925. for (var key in from) {
  6926. to[camelize(key)] = from[key];
  6927. }
  6928. }
  6929. /* */
  6930. /* */
  6931. /* */
  6932. /* */
  6933. // inline hooks to be invoked on component VNodes during patch
  6934. var componentVNodeHooks = {
  6935. init: function init (vnode, hydrating) {
  6936. if (
  6937. vnode.componentInstance &&
  6938. !vnode.componentInstance._isDestroyed &&
  6939. vnode.data.keepAlive
  6940. ) {
  6941. // kept-alive components, treat as a patch
  6942. var mountedNode = vnode; // work around flow
  6943. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6944. } else {
  6945. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6946. vnode,
  6947. activeInstance
  6948. );
  6949. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6950. }
  6951. },
  6952. prepatch: function prepatch (oldVnode, vnode) {
  6953. var options = vnode.componentOptions;
  6954. var child = vnode.componentInstance = oldVnode.componentInstance;
  6955. updateChildComponent(
  6956. child,
  6957. options.propsData, // updated props
  6958. options.listeners, // updated listeners
  6959. vnode, // new parent vnode
  6960. options.children // new children
  6961. );
  6962. },
  6963. insert: function insert (vnode) {
  6964. var context = vnode.context;
  6965. var componentInstance = vnode.componentInstance;
  6966. if (!componentInstance._isMounted) {
  6967. callHook(componentInstance, 'onServiceCreated');
  6968. callHook(componentInstance, 'onServiceAttached');
  6969. componentInstance._isMounted = true;
  6970. callHook(componentInstance, 'mounted');
  6971. }
  6972. if (vnode.data.keepAlive) {
  6973. if (context._isMounted) {
  6974. // vue-router#1212
  6975. // During updates, a kept-alive component's child components may
  6976. // change, so directly walking the tree here may call activated hooks
  6977. // on incorrect children. Instead we push them into a queue which will
  6978. // be processed after the whole patch process ended.
  6979. queueActivatedComponent(componentInstance);
  6980. } else {
  6981. activateChildComponent(componentInstance, true /* direct */);
  6982. }
  6983. }
  6984. },
  6985. destroy: function destroy (vnode) {
  6986. var componentInstance = vnode.componentInstance;
  6987. if (!componentInstance._isDestroyed) {
  6988. if (!vnode.data.keepAlive) {
  6989. componentInstance.$destroy();
  6990. } else {
  6991. deactivateChildComponent(componentInstance, true /* direct */);
  6992. }
  6993. }
  6994. }
  6995. };
  6996. var hooksToMerge = Object.keys(componentVNodeHooks);
  6997. function createComponent (
  6998. Ctor,
  6999. data,
  7000. context,
  7001. children,
  7002. tag
  7003. ) {
  7004. if (isUndef(Ctor)) {
  7005. return
  7006. }
  7007. var baseCtor = context.$options._base;
  7008. // plain options object: turn it into a constructor
  7009. if (isObject(Ctor)) {
  7010. Ctor = baseCtor.extend(Ctor);
  7011. }
  7012. // if at this stage it's not a constructor or an async component factory,
  7013. // reject.
  7014. if (typeof Ctor !== 'function') {
  7015. if (true) {
  7016. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7017. }
  7018. return
  7019. }
  7020. // async component
  7021. var asyncFactory;
  7022. if (isUndef(Ctor.cid)) {
  7023. asyncFactory = Ctor;
  7024. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7025. if (Ctor === undefined) {
  7026. // return a placeholder node for async component, which is rendered
  7027. // as a comment node but preserves all the raw information for the node.
  7028. // the information will be used for async server-rendering and hydration.
  7029. return createAsyncPlaceholder(
  7030. asyncFactory,
  7031. data,
  7032. context,
  7033. children,
  7034. tag
  7035. )
  7036. }
  7037. }
  7038. data = data || {};
  7039. // resolve constructor options in case global mixins are applied after
  7040. // component constructor creation
  7041. resolveConstructorOptions(Ctor);
  7042. // transform component v-model data into props & events
  7043. if (isDef(data.model)) {
  7044. transformModel(Ctor.options, data);
  7045. }
  7046. // extract props
  7047. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7048. // functional component
  7049. if (isTrue(Ctor.options.functional)) {
  7050. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7051. }
  7052. // extract listeners, since these needs to be treated as
  7053. // child component listeners instead of DOM listeners
  7054. var listeners = data.on;
  7055. // replace with listeners with .native modifier
  7056. // so it gets processed during parent component patch.
  7057. data.on = data.nativeOn;
  7058. if (isTrue(Ctor.options.abstract)) {
  7059. // abstract components do not keep anything
  7060. // other than props & listeners & slot
  7061. // work around flow
  7062. var slot = data.slot;
  7063. data = {};
  7064. if (slot) {
  7065. data.slot = slot;
  7066. }
  7067. }
  7068. // install component management hooks onto the placeholder node
  7069. installComponentHooks(data);
  7070. // return a placeholder vnode
  7071. var name = Ctor.options.name || tag;
  7072. var vnode = new VNode(
  7073. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7074. data, undefined, undefined, undefined, context,
  7075. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7076. asyncFactory
  7077. );
  7078. return vnode
  7079. }
  7080. function createComponentInstanceForVnode (
  7081. vnode, // we know it's MountedComponentVNode but flow doesn't
  7082. parent // activeInstance in lifecycle state
  7083. ) {
  7084. var options = {
  7085. _isComponent: true,
  7086. _parentVnode: vnode,
  7087. parent: parent
  7088. };
  7089. // check inline-template render functions
  7090. var inlineTemplate = vnode.data.inlineTemplate;
  7091. if (isDef(inlineTemplate)) {
  7092. options.render = inlineTemplate.render;
  7093. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7094. }
  7095. return new vnode.componentOptions.Ctor(options)
  7096. }
  7097. function installComponentHooks (data) {
  7098. var hooks = data.hook || (data.hook = {});
  7099. for (var i = 0; i < hooksToMerge.length; i++) {
  7100. var key = hooksToMerge[i];
  7101. var existing = hooks[key];
  7102. var toMerge = componentVNodeHooks[key];
  7103. if (existing !== toMerge && !(existing && existing._merged)) {
  7104. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7105. }
  7106. }
  7107. }
  7108. function mergeHook$1 (f1, f2) {
  7109. var merged = function (a, b) {
  7110. // flow complains about extra args which is why we use any
  7111. f1(a, b);
  7112. f2(a, b);
  7113. };
  7114. merged._merged = true;
  7115. return merged
  7116. }
  7117. // transform component v-model info (value and callback) into
  7118. // prop and event handler respectively.
  7119. function transformModel (options, data) {
  7120. var prop = (options.model && options.model.prop) || 'value';
  7121. var event = (options.model && options.model.event) || 'input'
  7122. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7123. var on = data.on || (data.on = {});
  7124. var existing = on[event];
  7125. var callback = data.model.callback;
  7126. if (isDef(existing)) {
  7127. if (
  7128. Array.isArray(existing)
  7129. ? existing.indexOf(callback) === -1
  7130. : existing !== callback
  7131. ) {
  7132. on[event] = [callback].concat(existing);
  7133. }
  7134. } else {
  7135. on[event] = callback;
  7136. }
  7137. }
  7138. /* */
  7139. var SIMPLE_NORMALIZE = 1;
  7140. var ALWAYS_NORMALIZE = 2;
  7141. // wrapper function for providing a more flexible interface
  7142. // without getting yelled at by flow
  7143. function createElement (
  7144. context,
  7145. tag,
  7146. data,
  7147. children,
  7148. normalizationType,
  7149. alwaysNormalize
  7150. ) {
  7151. if (Array.isArray(data) || isPrimitive(data)) {
  7152. normalizationType = children;
  7153. children = data;
  7154. data = undefined;
  7155. }
  7156. if (isTrue(alwaysNormalize)) {
  7157. normalizationType = ALWAYS_NORMALIZE;
  7158. }
  7159. return _createElement(context, tag, data, children, normalizationType)
  7160. }
  7161. function _createElement (
  7162. context,
  7163. tag,
  7164. data,
  7165. children,
  7166. normalizationType
  7167. ) {
  7168. if (isDef(data) && isDef((data).__ob__)) {
  7169. true && warn(
  7170. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7171. 'Always create fresh vnode data objects in each render!',
  7172. context
  7173. );
  7174. return createEmptyVNode()
  7175. }
  7176. // object syntax in v-bind
  7177. if (isDef(data) && isDef(data.is)) {
  7178. tag = data.is;
  7179. }
  7180. if (!tag) {
  7181. // in case of component :is set to falsy value
  7182. return createEmptyVNode()
  7183. }
  7184. // warn against non-primitive key
  7185. if ( true &&
  7186. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7187. ) {
  7188. {
  7189. warn(
  7190. 'Avoid using non-primitive value as key, ' +
  7191. 'use string/number value instead.',
  7192. context
  7193. );
  7194. }
  7195. }
  7196. // support single function children as default scoped slot
  7197. if (Array.isArray(children) &&
  7198. typeof children[0] === 'function'
  7199. ) {
  7200. data = data || {};
  7201. data.scopedSlots = { default: children[0] };
  7202. children.length = 0;
  7203. }
  7204. if (normalizationType === ALWAYS_NORMALIZE) {
  7205. children = normalizeChildren(children);
  7206. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7207. children = simpleNormalizeChildren(children);
  7208. }
  7209. var vnode, ns;
  7210. if (typeof tag === 'string') {
  7211. var Ctor;
  7212. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7213. if (config.isReservedTag(tag)) {
  7214. // platform built-in elements
  7215. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7216. warn(
  7217. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7218. context
  7219. );
  7220. }
  7221. vnode = new VNode(
  7222. config.parsePlatformTagName(tag), data, children,
  7223. undefined, undefined, context
  7224. );
  7225. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7226. // component
  7227. vnode = createComponent(Ctor, data, context, children, tag);
  7228. } else {
  7229. // unknown or unlisted namespaced elements
  7230. // check at runtime because it may get assigned a namespace when its
  7231. // parent normalizes children
  7232. vnode = new VNode(
  7233. tag, data, children,
  7234. undefined, undefined, context
  7235. );
  7236. }
  7237. } else {
  7238. // direct component options / constructor
  7239. vnode = createComponent(tag, data, context, children);
  7240. }
  7241. if (Array.isArray(vnode)) {
  7242. return vnode
  7243. } else if (isDef(vnode)) {
  7244. if (isDef(ns)) { applyNS(vnode, ns); }
  7245. if (isDef(data)) { registerDeepBindings(data); }
  7246. return vnode
  7247. } else {
  7248. return createEmptyVNode()
  7249. }
  7250. }
  7251. function applyNS (vnode, ns, force) {
  7252. vnode.ns = ns;
  7253. if (vnode.tag === 'foreignObject') {
  7254. // use default namespace inside foreignObject
  7255. ns = undefined;
  7256. force = true;
  7257. }
  7258. if (isDef(vnode.children)) {
  7259. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7260. var child = vnode.children[i];
  7261. if (isDef(child.tag) && (
  7262. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7263. applyNS(child, ns, force);
  7264. }
  7265. }
  7266. }
  7267. }
  7268. // ref #5318
  7269. // necessary to ensure parent re-render when deep bindings like :style and
  7270. // :class are used on slot nodes
  7271. function registerDeepBindings (data) {
  7272. if (isObject(data.style)) {
  7273. traverse(data.style);
  7274. }
  7275. if (isObject(data.class)) {
  7276. traverse(data.class);
  7277. }
  7278. }
  7279. /* */
  7280. function initRender (vm) {
  7281. vm._vnode = null; // the root of the child tree
  7282. vm._staticTrees = null; // v-once cached trees
  7283. var options = vm.$options;
  7284. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7285. var renderContext = parentVnode && parentVnode.context;
  7286. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7287. vm.$scopedSlots = emptyObject;
  7288. // bind the createElement fn to this instance
  7289. // so that we get proper render context inside it.
  7290. // args order: tag, data, children, normalizationType, alwaysNormalize
  7291. // internal version is used by render functions compiled from templates
  7292. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7293. // normalization is always applied for the public version, used in
  7294. // user-written render functions.
  7295. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7296. // $attrs & $listeners are exposed for easier HOC creation.
  7297. // they need to be reactive so that HOCs using them are always updated
  7298. var parentData = parentVnode && parentVnode.data;
  7299. /* istanbul ignore else */
  7300. if (true) {
  7301. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7302. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7303. }, true);
  7304. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7305. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7306. }, true);
  7307. } else {}
  7308. }
  7309. var currentRenderingInstance = null;
  7310. function renderMixin (Vue) {
  7311. // install runtime convenience helpers
  7312. installRenderHelpers(Vue.prototype);
  7313. Vue.prototype.$nextTick = function (fn) {
  7314. return nextTick(fn, this)
  7315. };
  7316. Vue.prototype._render = function () {
  7317. var vm = this;
  7318. var ref = vm.$options;
  7319. var render = ref.render;
  7320. var _parentVnode = ref._parentVnode;
  7321. if (_parentVnode) {
  7322. vm.$scopedSlots = normalizeScopedSlots(
  7323. _parentVnode.data.scopedSlots,
  7324. vm.$slots,
  7325. vm.$scopedSlots
  7326. );
  7327. }
  7328. // set parent vnode. this allows render functions to have access
  7329. // to the data on the placeholder node.
  7330. vm.$vnode = _parentVnode;
  7331. // render self
  7332. var vnode;
  7333. try {
  7334. // There's no need to maintain a stack because all render fns are called
  7335. // separately from one another. Nested component's render fns are called
  7336. // when parent component is patched.
  7337. currentRenderingInstance = vm;
  7338. vnode = render.call(vm._renderProxy, vm.$createElement);
  7339. } catch (e) {
  7340. handleError(e, vm, "render");
  7341. // return error render result,
  7342. // or previous vnode to prevent render error causing blank component
  7343. /* istanbul ignore else */
  7344. if ( true && vm.$options.renderError) {
  7345. try {
  7346. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7347. } catch (e) {
  7348. handleError(e, vm, "renderError");
  7349. vnode = vm._vnode;
  7350. }
  7351. } else {
  7352. vnode = vm._vnode;
  7353. }
  7354. } finally {
  7355. currentRenderingInstance = null;
  7356. }
  7357. // if the returned array contains only a single node, allow it
  7358. if (Array.isArray(vnode) && vnode.length === 1) {
  7359. vnode = vnode[0];
  7360. }
  7361. // return empty vnode in case the render function errored out
  7362. if (!(vnode instanceof VNode)) {
  7363. if ( true && Array.isArray(vnode)) {
  7364. warn(
  7365. 'Multiple root nodes returned from render function. Render function ' +
  7366. 'should return a single root node.',
  7367. vm
  7368. );
  7369. }
  7370. vnode = createEmptyVNode();
  7371. }
  7372. // set parent
  7373. vnode.parent = _parentVnode;
  7374. return vnode
  7375. };
  7376. }
  7377. /* */
  7378. function ensureCtor (comp, base) {
  7379. if (
  7380. comp.__esModule ||
  7381. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7382. ) {
  7383. comp = comp.default;
  7384. }
  7385. return isObject(comp)
  7386. ? base.extend(comp)
  7387. : comp
  7388. }
  7389. function createAsyncPlaceholder (
  7390. factory,
  7391. data,
  7392. context,
  7393. children,
  7394. tag
  7395. ) {
  7396. var node = createEmptyVNode();
  7397. node.asyncFactory = factory;
  7398. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7399. return node
  7400. }
  7401. function resolveAsyncComponent (
  7402. factory,
  7403. baseCtor
  7404. ) {
  7405. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7406. return factory.errorComp
  7407. }
  7408. if (isDef(factory.resolved)) {
  7409. return factory.resolved
  7410. }
  7411. var owner = currentRenderingInstance;
  7412. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7413. // already pending
  7414. factory.owners.push(owner);
  7415. }
  7416. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7417. return factory.loadingComp
  7418. }
  7419. if (owner && !isDef(factory.owners)) {
  7420. var owners = factory.owners = [owner];
  7421. var sync = true;
  7422. var timerLoading = null;
  7423. var timerTimeout = null
  7424. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7425. var forceRender = function (renderCompleted) {
  7426. for (var i = 0, l = owners.length; i < l; i++) {
  7427. (owners[i]).$forceUpdate();
  7428. }
  7429. if (renderCompleted) {
  7430. owners.length = 0;
  7431. if (timerLoading !== null) {
  7432. clearTimeout(timerLoading);
  7433. timerLoading = null;
  7434. }
  7435. if (timerTimeout !== null) {
  7436. clearTimeout(timerTimeout);
  7437. timerTimeout = null;
  7438. }
  7439. }
  7440. };
  7441. var resolve = once(function (res) {
  7442. // cache resolved
  7443. factory.resolved = ensureCtor(res, baseCtor);
  7444. // invoke callbacks only if this is not a synchronous resolve
  7445. // (async resolves are shimmed as synchronous during SSR)
  7446. if (!sync) {
  7447. forceRender(true);
  7448. } else {
  7449. owners.length = 0;
  7450. }
  7451. });
  7452. var reject = once(function (reason) {
  7453. true && warn(
  7454. "Failed to resolve async component: " + (String(factory)) +
  7455. (reason ? ("\nReason: " + reason) : '')
  7456. );
  7457. if (isDef(factory.errorComp)) {
  7458. factory.error = true;
  7459. forceRender(true);
  7460. }
  7461. });
  7462. var res = factory(resolve, reject);
  7463. if (isObject(res)) {
  7464. if (isPromise(res)) {
  7465. // () => Promise
  7466. if (isUndef(factory.resolved)) {
  7467. res.then(resolve, reject);
  7468. }
  7469. } else if (isPromise(res.component)) {
  7470. res.component.then(resolve, reject);
  7471. if (isDef(res.error)) {
  7472. factory.errorComp = ensureCtor(res.error, baseCtor);
  7473. }
  7474. if (isDef(res.loading)) {
  7475. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7476. if (res.delay === 0) {
  7477. factory.loading = true;
  7478. } else {
  7479. timerLoading = setTimeout(function () {
  7480. timerLoading = null;
  7481. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7482. factory.loading = true;
  7483. forceRender(false);
  7484. }
  7485. }, res.delay || 200);
  7486. }
  7487. }
  7488. if (isDef(res.timeout)) {
  7489. timerTimeout = setTimeout(function () {
  7490. timerTimeout = null;
  7491. if (isUndef(factory.resolved)) {
  7492. reject(
  7493. true
  7494. ? ("timeout (" + (res.timeout) + "ms)")
  7495. : undefined
  7496. );
  7497. }
  7498. }, res.timeout);
  7499. }
  7500. }
  7501. }
  7502. sync = false;
  7503. // return in case resolved synchronously
  7504. return factory.loading
  7505. ? factory.loadingComp
  7506. : factory.resolved
  7507. }
  7508. }
  7509. /* */
  7510. function isAsyncPlaceholder (node) {
  7511. return node.isComment && node.asyncFactory
  7512. }
  7513. /* */
  7514. function getFirstComponentChild (children) {
  7515. if (Array.isArray(children)) {
  7516. for (var i = 0; i < children.length; i++) {
  7517. var c = children[i];
  7518. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7519. return c
  7520. }
  7521. }
  7522. }
  7523. }
  7524. /* */
  7525. /* */
  7526. function initEvents (vm) {
  7527. vm._events = Object.create(null);
  7528. vm._hasHookEvent = false;
  7529. // init parent attached events
  7530. var listeners = vm.$options._parentListeners;
  7531. if (listeners) {
  7532. updateComponentListeners(vm, listeners);
  7533. }
  7534. }
  7535. var target;
  7536. function add (event, fn) {
  7537. target.$on(event, fn);
  7538. }
  7539. function remove$1 (event, fn) {
  7540. target.$off(event, fn);
  7541. }
  7542. function createOnceHandler (event, fn) {
  7543. var _target = target;
  7544. return function onceHandler () {
  7545. var res = fn.apply(null, arguments);
  7546. if (res !== null) {
  7547. _target.$off(event, onceHandler);
  7548. }
  7549. }
  7550. }
  7551. function updateComponentListeners (
  7552. vm,
  7553. listeners,
  7554. oldListeners
  7555. ) {
  7556. target = vm;
  7557. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7558. target = undefined;
  7559. }
  7560. function eventsMixin (Vue) {
  7561. var hookRE = /^hook:/;
  7562. Vue.prototype.$on = function (event, fn) {
  7563. var vm = this;
  7564. if (Array.isArray(event)) {
  7565. for (var i = 0, l = event.length; i < l; i++) {
  7566. vm.$on(event[i], fn);
  7567. }
  7568. } else {
  7569. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7570. // optimize hook:event cost by using a boolean flag marked at registration
  7571. // instead of a hash lookup
  7572. if (hookRE.test(event)) {
  7573. vm._hasHookEvent = true;
  7574. }
  7575. }
  7576. return vm
  7577. };
  7578. Vue.prototype.$once = function (event, fn) {
  7579. var vm = this;
  7580. function on () {
  7581. vm.$off(event, on);
  7582. fn.apply(vm, arguments);
  7583. }
  7584. on.fn = fn;
  7585. vm.$on(event, on);
  7586. return vm
  7587. };
  7588. Vue.prototype.$off = function (event, fn) {
  7589. var vm = this;
  7590. // all
  7591. if (!arguments.length) {
  7592. vm._events = Object.create(null);
  7593. return vm
  7594. }
  7595. // array of events
  7596. if (Array.isArray(event)) {
  7597. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7598. vm.$off(event[i$1], fn);
  7599. }
  7600. return vm
  7601. }
  7602. // specific event
  7603. var cbs = vm._events[event];
  7604. if (!cbs) {
  7605. return vm
  7606. }
  7607. if (!fn) {
  7608. vm._events[event] = null;
  7609. return vm
  7610. }
  7611. // specific handler
  7612. var cb;
  7613. var i = cbs.length;
  7614. while (i--) {
  7615. cb = cbs[i];
  7616. if (cb === fn || cb.fn === fn) {
  7617. cbs.splice(i, 1);
  7618. break
  7619. }
  7620. }
  7621. return vm
  7622. };
  7623. Vue.prototype.$emit = function (event) {
  7624. var vm = this;
  7625. if (true) {
  7626. var lowerCaseEvent = event.toLowerCase();
  7627. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7628. tip(
  7629. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7630. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7631. "Note that HTML attributes are case-insensitive and you cannot use " +
  7632. "v-on to listen to camelCase events when using in-DOM templates. " +
  7633. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7634. );
  7635. }
  7636. }
  7637. var cbs = vm._events[event];
  7638. if (cbs) {
  7639. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7640. var args = toArray(arguments, 1);
  7641. var info = "event handler for \"" + event + "\"";
  7642. for (var i = 0, l = cbs.length; i < l; i++) {
  7643. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7644. }
  7645. }
  7646. return vm
  7647. };
  7648. }
  7649. /* */
  7650. var activeInstance = null;
  7651. var isUpdatingChildComponent = false;
  7652. function setActiveInstance(vm) {
  7653. var prevActiveInstance = activeInstance;
  7654. activeInstance = vm;
  7655. return function () {
  7656. activeInstance = prevActiveInstance;
  7657. }
  7658. }
  7659. function initLifecycle (vm) {
  7660. var options = vm.$options;
  7661. // locate first non-abstract parent
  7662. var parent = options.parent;
  7663. if (parent && !options.abstract) {
  7664. while (parent.$options.abstract && parent.$parent) {
  7665. parent = parent.$parent;
  7666. }
  7667. parent.$children.push(vm);
  7668. }
  7669. vm.$parent = parent;
  7670. vm.$root = parent ? parent.$root : vm;
  7671. vm.$children = [];
  7672. vm.$refs = {};
  7673. vm._watcher = null;
  7674. vm._inactive = null;
  7675. vm._directInactive = false;
  7676. vm._isMounted = false;
  7677. vm._isDestroyed = false;
  7678. vm._isBeingDestroyed = false;
  7679. }
  7680. function lifecycleMixin (Vue) {
  7681. Vue.prototype._update = function (vnode, hydrating) {
  7682. var vm = this;
  7683. var prevEl = vm.$el;
  7684. var prevVnode = vm._vnode;
  7685. var restoreActiveInstance = setActiveInstance(vm);
  7686. vm._vnode = vnode;
  7687. // Vue.prototype.__patch__ is injected in entry points
  7688. // based on the rendering backend used.
  7689. if (!prevVnode) {
  7690. // initial render
  7691. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7692. } else {
  7693. // updates
  7694. vm.$el = vm.__patch__(prevVnode, vnode);
  7695. }
  7696. restoreActiveInstance();
  7697. // update __vue__ reference
  7698. if (prevEl) {
  7699. prevEl.__vue__ = null;
  7700. }
  7701. if (vm.$el) {
  7702. vm.$el.__vue__ = vm;
  7703. }
  7704. // if parent is an HOC, update its $el as well
  7705. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7706. vm.$parent.$el = vm.$el;
  7707. }
  7708. // updated hook is called by the scheduler to ensure that children are
  7709. // updated in a parent's updated hook.
  7710. };
  7711. Vue.prototype.$forceUpdate = function () {
  7712. var vm = this;
  7713. if (vm._watcher) {
  7714. vm._watcher.update();
  7715. }
  7716. };
  7717. Vue.prototype.$destroy = function () {
  7718. var vm = this;
  7719. if (vm._isBeingDestroyed) {
  7720. return
  7721. }
  7722. callHook(vm, 'beforeDestroy');
  7723. vm._isBeingDestroyed = true;
  7724. // remove self from parent
  7725. var parent = vm.$parent;
  7726. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7727. remove(parent.$children, vm);
  7728. }
  7729. // teardown watchers
  7730. if (vm._watcher) {
  7731. vm._watcher.teardown();
  7732. }
  7733. var i = vm._watchers.length;
  7734. while (i--) {
  7735. vm._watchers[i].teardown();
  7736. }
  7737. // remove reference from data ob
  7738. // frozen object may not have observer.
  7739. if (vm._data.__ob__) {
  7740. vm._data.__ob__.vmCount--;
  7741. }
  7742. // call the last hook...
  7743. vm._isDestroyed = true;
  7744. // invoke destroy hooks on current rendered tree
  7745. vm.__patch__(vm._vnode, null);
  7746. // fire destroyed hook
  7747. callHook(vm, 'destroyed');
  7748. // turn off all instance listeners.
  7749. vm.$off();
  7750. // remove __vue__ reference
  7751. if (vm.$el) {
  7752. vm.$el.__vue__ = null;
  7753. }
  7754. // release circular reference (#6759)
  7755. if (vm.$vnode) {
  7756. vm.$vnode.parent = null;
  7757. }
  7758. };
  7759. }
  7760. function updateChildComponent (
  7761. vm,
  7762. propsData,
  7763. listeners,
  7764. parentVnode,
  7765. renderChildren
  7766. ) {
  7767. if (true) {
  7768. isUpdatingChildComponent = true;
  7769. }
  7770. // determine whether component has slot children
  7771. // we need to do this before overwriting $options._renderChildren.
  7772. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7773. // dynamic slot names). Static scoped slots compiled from template has the
  7774. // "$stable" marker.
  7775. var newScopedSlots = parentVnode.data.scopedSlots;
  7776. var oldScopedSlots = vm.$scopedSlots;
  7777. var hasDynamicScopedSlot = !!(
  7778. (newScopedSlots && !newScopedSlots.$stable) ||
  7779. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7780. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7781. );
  7782. // Any static slot children from the parent may have changed during parent's
  7783. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7784. // update is necessary to ensure correctness.
  7785. var needsForceUpdate = !!(
  7786. renderChildren || // has new static slots
  7787. vm.$options._renderChildren || // has old static slots
  7788. hasDynamicScopedSlot
  7789. );
  7790. vm.$options._parentVnode = parentVnode;
  7791. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7792. if (vm._vnode) { // update child tree's parent
  7793. vm._vnode.parent = parentVnode;
  7794. }
  7795. vm.$options._renderChildren = renderChildren;
  7796. // update $attrs and $listeners hash
  7797. // these are also reactive so they may trigger child update if the child
  7798. // used them during render
  7799. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7800. vm.$listeners = listeners || emptyObject;
  7801. // update props
  7802. if (propsData && vm.$options.props) {
  7803. toggleObserving(false);
  7804. var props = vm._props;
  7805. var propKeys = vm.$options._propKeys || [];
  7806. for (var i = 0; i < propKeys.length; i++) {
  7807. var key = propKeys[i];
  7808. var propOptions = vm.$options.props; // wtf flow?
  7809. props[key] = validateProp(key, propOptions, propsData, vm);
  7810. }
  7811. toggleObserving(true);
  7812. // keep a copy of raw propsData
  7813. vm.$options.propsData = propsData;
  7814. }
  7815. // fixed by xxxxxx update properties(mp runtime)
  7816. vm._$updateProperties && vm._$updateProperties(vm);
  7817. // update listeners
  7818. listeners = listeners || emptyObject;
  7819. var oldListeners = vm.$options._parentListeners;
  7820. vm.$options._parentListeners = listeners;
  7821. updateComponentListeners(vm, listeners, oldListeners);
  7822. // resolve slots + force update if has children
  7823. if (needsForceUpdate) {
  7824. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7825. vm.$forceUpdate();
  7826. }
  7827. if (true) {
  7828. isUpdatingChildComponent = false;
  7829. }
  7830. }
  7831. function isInInactiveTree (vm) {
  7832. while (vm && (vm = vm.$parent)) {
  7833. if (vm._inactive) { return true }
  7834. }
  7835. return false
  7836. }
  7837. function activateChildComponent (vm, direct) {
  7838. if (direct) {
  7839. vm._directInactive = false;
  7840. if (isInInactiveTree(vm)) {
  7841. return
  7842. }
  7843. } else if (vm._directInactive) {
  7844. return
  7845. }
  7846. if (vm._inactive || vm._inactive === null) {
  7847. vm._inactive = false;
  7848. for (var i = 0; i < vm.$children.length; i++) {
  7849. activateChildComponent(vm.$children[i]);
  7850. }
  7851. callHook(vm, 'activated');
  7852. }
  7853. }
  7854. function deactivateChildComponent (vm, direct) {
  7855. if (direct) {
  7856. vm._directInactive = true;
  7857. if (isInInactiveTree(vm)) {
  7858. return
  7859. }
  7860. }
  7861. if (!vm._inactive) {
  7862. vm._inactive = true;
  7863. for (var i = 0; i < vm.$children.length; i++) {
  7864. deactivateChildComponent(vm.$children[i]);
  7865. }
  7866. callHook(vm, 'deactivated');
  7867. }
  7868. }
  7869. function callHook (vm, hook) {
  7870. // #7573 disable dep collection when invoking lifecycle hooks
  7871. pushTarget();
  7872. var handlers = vm.$options[hook];
  7873. var info = hook + " hook";
  7874. if (handlers) {
  7875. for (var i = 0, j = handlers.length; i < j; i++) {
  7876. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7877. }
  7878. }
  7879. if (vm._hasHookEvent) {
  7880. vm.$emit('hook:' + hook);
  7881. }
  7882. popTarget();
  7883. }
  7884. /* */
  7885. var MAX_UPDATE_COUNT = 100;
  7886. var queue = [];
  7887. var activatedChildren = [];
  7888. var has = {};
  7889. var circular = {};
  7890. var waiting = false;
  7891. var flushing = false;
  7892. var index = 0;
  7893. /**
  7894. * Reset the scheduler's state.
  7895. */
  7896. function resetSchedulerState () {
  7897. index = queue.length = activatedChildren.length = 0;
  7898. has = {};
  7899. if (true) {
  7900. circular = {};
  7901. }
  7902. waiting = flushing = false;
  7903. }
  7904. // Async edge case #6566 requires saving the timestamp when event listeners are
  7905. // attached. However, calling performance.now() has a perf overhead especially
  7906. // if the page has thousands of event listeners. Instead, we take a timestamp
  7907. // every time the scheduler flushes and use that for all event listeners
  7908. // attached during that flush.
  7909. var currentFlushTimestamp = 0;
  7910. // Async edge case fix requires storing an event listener's attach timestamp.
  7911. var getNow = Date.now;
  7912. // Determine what event timestamp the browser is using. Annoyingly, the
  7913. // timestamp can either be hi-res (relative to page load) or low-res
  7914. // (relative to UNIX epoch), so in order to compare time we have to use the
  7915. // same timestamp type when saving the flush timestamp.
  7916. // All IE versions use low-res event timestamps, and have problematic clock
  7917. // implementations (#9632)
  7918. if (inBrowser && !isIE) {
  7919. var performance = window.performance;
  7920. if (
  7921. performance &&
  7922. typeof performance.now === 'function' &&
  7923. getNow() > document.createEvent('Event').timeStamp
  7924. ) {
  7925. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7926. // smaller than it, it means the event is using a hi-res timestamp,
  7927. // and we need to use the hi-res version for event listener timestamps as
  7928. // well.
  7929. getNow = function () { return performance.now(); };
  7930. }
  7931. }
  7932. /**
  7933. * Flush both queues and run the watchers.
  7934. */
  7935. function flushSchedulerQueue () {
  7936. currentFlushTimestamp = getNow();
  7937. flushing = true;
  7938. var watcher, id;
  7939. // Sort queue before flush.
  7940. // This ensures that:
  7941. // 1. Components are updated from parent to child. (because parent is always
  7942. // created before the child)
  7943. // 2. A component's user watchers are run before its render watcher (because
  7944. // user watchers are created before the render watcher)
  7945. // 3. If a component is destroyed during a parent component's watcher run,
  7946. // its watchers can be skipped.
  7947. queue.sort(function (a, b) { return a.id - b.id; });
  7948. // do not cache length because more watchers might be pushed
  7949. // as we run existing watchers
  7950. for (index = 0; index < queue.length; index++) {
  7951. watcher = queue[index];
  7952. if (watcher.before) {
  7953. watcher.before();
  7954. }
  7955. id = watcher.id;
  7956. has[id] = null;
  7957. watcher.run();
  7958. // in dev build, check and stop circular updates.
  7959. if ( true && has[id] != null) {
  7960. circular[id] = (circular[id] || 0) + 1;
  7961. if (circular[id] > MAX_UPDATE_COUNT) {
  7962. warn(
  7963. 'You may have an infinite update loop ' + (
  7964. watcher.user
  7965. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7966. : "in a component render function."
  7967. ),
  7968. watcher.vm
  7969. );
  7970. break
  7971. }
  7972. }
  7973. }
  7974. // keep copies of post queues before resetting state
  7975. var activatedQueue = activatedChildren.slice();
  7976. var updatedQueue = queue.slice();
  7977. resetSchedulerState();
  7978. // call component updated and activated hooks
  7979. callActivatedHooks(activatedQueue);
  7980. callUpdatedHooks(updatedQueue);
  7981. // devtool hook
  7982. /* istanbul ignore if */
  7983. if (devtools && config.devtools) {
  7984. devtools.emit('flush');
  7985. }
  7986. }
  7987. function callUpdatedHooks (queue) {
  7988. var i = queue.length;
  7989. while (i--) {
  7990. var watcher = queue[i];
  7991. var vm = watcher.vm;
  7992. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7993. callHook(vm, 'updated');
  7994. }
  7995. }
  7996. }
  7997. /**
  7998. * Queue a kept-alive component that was activated during patch.
  7999. * The queue will be processed after the entire tree has been patched.
  8000. */
  8001. function queueActivatedComponent (vm) {
  8002. // setting _inactive to false here so that a render function can
  8003. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8004. vm._inactive = false;
  8005. activatedChildren.push(vm);
  8006. }
  8007. function callActivatedHooks (queue) {
  8008. for (var i = 0; i < queue.length; i++) {
  8009. queue[i]._inactive = true;
  8010. activateChildComponent(queue[i], true /* true */);
  8011. }
  8012. }
  8013. /**
  8014. * Push a watcher into the watcher queue.
  8015. * Jobs with duplicate IDs will be skipped unless it's
  8016. * pushed when the queue is being flushed.
  8017. */
  8018. function queueWatcher (watcher) {
  8019. var id = watcher.id;
  8020. if (has[id] == null) {
  8021. has[id] = true;
  8022. if (!flushing) {
  8023. queue.push(watcher);
  8024. } else {
  8025. // if already flushing, splice the watcher based on its id
  8026. // if already past its id, it will be run next immediately.
  8027. var i = queue.length - 1;
  8028. while (i > index && queue[i].id > watcher.id) {
  8029. i--;
  8030. }
  8031. queue.splice(i + 1, 0, watcher);
  8032. }
  8033. // queue the flush
  8034. if (!waiting) {
  8035. waiting = true;
  8036. if ( true && !config.async) {
  8037. flushSchedulerQueue();
  8038. return
  8039. }
  8040. nextTick(flushSchedulerQueue);
  8041. }
  8042. }
  8043. }
  8044. /* */
  8045. var uid$2 = 0;
  8046. /**
  8047. * A watcher parses an expression, collects dependencies,
  8048. * and fires callback when the expression value changes.
  8049. * This is used for both the $watch() api and directives.
  8050. */
  8051. var Watcher = function Watcher (
  8052. vm,
  8053. expOrFn,
  8054. cb,
  8055. options,
  8056. isRenderWatcher
  8057. ) {
  8058. this.vm = vm;
  8059. if (isRenderWatcher) {
  8060. vm._watcher = this;
  8061. }
  8062. vm._watchers.push(this);
  8063. // options
  8064. if (options) {
  8065. this.deep = !!options.deep;
  8066. this.user = !!options.user;
  8067. this.lazy = !!options.lazy;
  8068. this.sync = !!options.sync;
  8069. this.before = options.before;
  8070. } else {
  8071. this.deep = this.user = this.lazy = this.sync = false;
  8072. }
  8073. this.cb = cb;
  8074. this.id = ++uid$2; // uid for batching
  8075. this.active = true;
  8076. this.dirty = this.lazy; // for lazy watchers
  8077. this.deps = [];
  8078. this.newDeps = [];
  8079. this.depIds = new _Set();
  8080. this.newDepIds = new _Set();
  8081. this.expression = true
  8082. ? expOrFn.toString()
  8083. : undefined;
  8084. // parse expression for getter
  8085. if (typeof expOrFn === 'function') {
  8086. this.getter = expOrFn;
  8087. } else {
  8088. this.getter = parsePath(expOrFn);
  8089. if (!this.getter) {
  8090. this.getter = noop;
  8091. true && warn(
  8092. "Failed watching path: \"" + expOrFn + "\" " +
  8093. 'Watcher only accepts simple dot-delimited paths. ' +
  8094. 'For full control, use a function instead.',
  8095. vm
  8096. );
  8097. }
  8098. }
  8099. this.value = this.lazy
  8100. ? undefined
  8101. : this.get();
  8102. };
  8103. /**
  8104. * Evaluate the getter, and re-collect dependencies.
  8105. */
  8106. Watcher.prototype.get = function get () {
  8107. pushTarget(this);
  8108. var value;
  8109. var vm = this.vm;
  8110. try {
  8111. value = this.getter.call(vm, vm);
  8112. } catch (e) {
  8113. if (this.user) {
  8114. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8115. } else {
  8116. throw e
  8117. }
  8118. } finally {
  8119. // "touch" every property so they are all tracked as
  8120. // dependencies for deep watching
  8121. if (this.deep) {
  8122. traverse(value);
  8123. }
  8124. popTarget();
  8125. this.cleanupDeps();
  8126. }
  8127. return value
  8128. };
  8129. /**
  8130. * Add a dependency to this directive.
  8131. */
  8132. Watcher.prototype.addDep = function addDep (dep) {
  8133. var id = dep.id;
  8134. if (!this.newDepIds.has(id)) {
  8135. this.newDepIds.add(id);
  8136. this.newDeps.push(dep);
  8137. if (!this.depIds.has(id)) {
  8138. dep.addSub(this);
  8139. }
  8140. }
  8141. };
  8142. /**
  8143. * Clean up for dependency collection.
  8144. */
  8145. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8146. var i = this.deps.length;
  8147. while (i--) {
  8148. var dep = this.deps[i];
  8149. if (!this.newDepIds.has(dep.id)) {
  8150. dep.removeSub(this);
  8151. }
  8152. }
  8153. var tmp = this.depIds;
  8154. this.depIds = this.newDepIds;
  8155. this.newDepIds = tmp;
  8156. this.newDepIds.clear();
  8157. tmp = this.deps;
  8158. this.deps = this.newDeps;
  8159. this.newDeps = tmp;
  8160. this.newDeps.length = 0;
  8161. };
  8162. /**
  8163. * Subscriber interface.
  8164. * Will be called when a dependency changes.
  8165. */
  8166. Watcher.prototype.update = function update () {
  8167. /* istanbul ignore else */
  8168. if (this.lazy) {
  8169. this.dirty = true;
  8170. } else if (this.sync) {
  8171. this.run();
  8172. } else {
  8173. queueWatcher(this);
  8174. }
  8175. };
  8176. /**
  8177. * Scheduler job interface.
  8178. * Will be called by the scheduler.
  8179. */
  8180. Watcher.prototype.run = function run () {
  8181. if (this.active) {
  8182. var value = this.get();
  8183. if (
  8184. value !== this.value ||
  8185. // Deep watchers and watchers on Object/Arrays should fire even
  8186. // when the value is the same, because the value may
  8187. // have mutated.
  8188. isObject(value) ||
  8189. this.deep
  8190. ) {
  8191. // set new value
  8192. var oldValue = this.value;
  8193. this.value = value;
  8194. if (this.user) {
  8195. try {
  8196. this.cb.call(this.vm, value, oldValue);
  8197. } catch (e) {
  8198. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8199. }
  8200. } else {
  8201. this.cb.call(this.vm, value, oldValue);
  8202. }
  8203. }
  8204. }
  8205. };
  8206. /**
  8207. * Evaluate the value of the watcher.
  8208. * This only gets called for lazy watchers.
  8209. */
  8210. Watcher.prototype.evaluate = function evaluate () {
  8211. this.value = this.get();
  8212. this.dirty = false;
  8213. };
  8214. /**
  8215. * Depend on all deps collected by this watcher.
  8216. */
  8217. Watcher.prototype.depend = function depend () {
  8218. var i = this.deps.length;
  8219. while (i--) {
  8220. this.deps[i].depend();
  8221. }
  8222. };
  8223. /**
  8224. * Remove self from all dependencies' subscriber list.
  8225. */
  8226. Watcher.prototype.teardown = function teardown () {
  8227. if (this.active) {
  8228. // remove self from vm's watcher list
  8229. // this is a somewhat expensive operation so we skip it
  8230. // if the vm is being destroyed.
  8231. if (!this.vm._isBeingDestroyed) {
  8232. remove(this.vm._watchers, this);
  8233. }
  8234. var i = this.deps.length;
  8235. while (i--) {
  8236. this.deps[i].removeSub(this);
  8237. }
  8238. this.active = false;
  8239. }
  8240. };
  8241. /* */
  8242. var sharedPropertyDefinition = {
  8243. enumerable: true,
  8244. configurable: true,
  8245. get: noop,
  8246. set: noop
  8247. };
  8248. function proxy (target, sourceKey, key) {
  8249. sharedPropertyDefinition.get = function proxyGetter () {
  8250. return this[sourceKey][key]
  8251. };
  8252. sharedPropertyDefinition.set = function proxySetter (val) {
  8253. this[sourceKey][key] = val;
  8254. };
  8255. Object.defineProperty(target, key, sharedPropertyDefinition);
  8256. }
  8257. function initState (vm) {
  8258. vm._watchers = [];
  8259. var opts = vm.$options;
  8260. if (opts.props) { initProps(vm, opts.props); }
  8261. if (opts.methods) { initMethods(vm, opts.methods); }
  8262. if (opts.data) {
  8263. initData(vm);
  8264. } else {
  8265. observe(vm._data = {}, true /* asRootData */);
  8266. }
  8267. if (opts.computed) { initComputed(vm, opts.computed); }
  8268. if (opts.watch && opts.watch !== nativeWatch) {
  8269. initWatch(vm, opts.watch);
  8270. }
  8271. }
  8272. function initProps (vm, propsOptions) {
  8273. var propsData = vm.$options.propsData || {};
  8274. var props = vm._props = {};
  8275. // cache prop keys so that future props updates can iterate using Array
  8276. // instead of dynamic object key enumeration.
  8277. var keys = vm.$options._propKeys = [];
  8278. var isRoot = !vm.$parent;
  8279. // root instance props should be converted
  8280. if (!isRoot) {
  8281. toggleObserving(false);
  8282. }
  8283. var loop = function ( key ) {
  8284. keys.push(key);
  8285. var value = validateProp(key, propsOptions, propsData, vm);
  8286. /* istanbul ignore else */
  8287. if (true) {
  8288. var hyphenatedKey = hyphenate(key);
  8289. if (isReservedAttribute(hyphenatedKey) ||
  8290. config.isReservedAttr(hyphenatedKey)) {
  8291. warn(
  8292. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8293. vm
  8294. );
  8295. }
  8296. defineReactive$$1(props, key, value, function () {
  8297. if (!isRoot && !isUpdatingChildComponent) {
  8298. {
  8299. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  8300. return
  8301. }
  8302. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8303. if(
  8304. key === 'value' &&
  8305. Array.isArray(vm.$options.behaviors) &&
  8306. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8307. ){
  8308. return
  8309. }
  8310. if(vm._getFormData){
  8311. return
  8312. }
  8313. var $parent = vm.$parent;
  8314. while($parent){
  8315. if($parent.__next_tick_pending){
  8316. return
  8317. }
  8318. $parent = $parent.$parent;
  8319. }
  8320. }
  8321. warn(
  8322. "Avoid mutating a prop directly since the value will be " +
  8323. "overwritten whenever the parent component re-renders. " +
  8324. "Instead, use a data or computed property based on the prop's " +
  8325. "value. Prop being mutated: \"" + key + "\"",
  8326. vm
  8327. );
  8328. }
  8329. });
  8330. } else {}
  8331. // static props are already proxied on the component's prototype
  8332. // during Vue.extend(). We only need to proxy props defined at
  8333. // instantiation here.
  8334. if (!(key in vm)) {
  8335. proxy(vm, "_props", key);
  8336. }
  8337. };
  8338. for (var key in propsOptions) loop( key );
  8339. toggleObserving(true);
  8340. }
  8341. function initData (vm) {
  8342. var data = vm.$options.data;
  8343. data = vm._data = typeof data === 'function'
  8344. ? getData(data, vm)
  8345. : data || {};
  8346. if (!isPlainObject(data)) {
  8347. data = {};
  8348. true && warn(
  8349. 'data functions should return an object:\n' +
  8350. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8351. vm
  8352. );
  8353. }
  8354. // proxy data on instance
  8355. var keys = Object.keys(data);
  8356. var props = vm.$options.props;
  8357. var methods = vm.$options.methods;
  8358. var i = keys.length;
  8359. while (i--) {
  8360. var key = keys[i];
  8361. if (true) {
  8362. if (methods && hasOwn(methods, key)) {
  8363. warn(
  8364. ("Method \"" + key + "\" has already been defined as a data property."),
  8365. vm
  8366. );
  8367. }
  8368. }
  8369. if (props && hasOwn(props, key)) {
  8370. true && warn(
  8371. "The data property \"" + key + "\" is already declared as a prop. " +
  8372. "Use prop default value instead.",
  8373. vm
  8374. );
  8375. } else if (!isReserved(key)) {
  8376. proxy(vm, "_data", key);
  8377. }
  8378. }
  8379. // observe data
  8380. observe(data, true /* asRootData */);
  8381. }
  8382. function getData (data, vm) {
  8383. // #7573 disable dep collection when invoking data getters
  8384. pushTarget();
  8385. try {
  8386. return data.call(vm, vm)
  8387. } catch (e) {
  8388. handleError(e, vm, "data()");
  8389. return {}
  8390. } finally {
  8391. popTarget();
  8392. }
  8393. }
  8394. var computedWatcherOptions = { lazy: true };
  8395. function initComputed (vm, computed) {
  8396. // $flow-disable-line
  8397. var watchers = vm._computedWatchers = Object.create(null);
  8398. // computed properties are just getters during SSR
  8399. var isSSR = isServerRendering();
  8400. for (var key in computed) {
  8401. var userDef = computed[key];
  8402. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8403. if ( true && getter == null) {
  8404. warn(
  8405. ("Getter is missing for computed property \"" + key + "\"."),
  8406. vm
  8407. );
  8408. }
  8409. if (!isSSR) {
  8410. // create internal watcher for the computed property.
  8411. watchers[key] = new Watcher(
  8412. vm,
  8413. getter || noop,
  8414. noop,
  8415. computedWatcherOptions
  8416. );
  8417. }
  8418. // component-defined computed properties are already defined on the
  8419. // component prototype. We only need to define computed properties defined
  8420. // at instantiation here.
  8421. if (!(key in vm)) {
  8422. defineComputed(vm, key, userDef);
  8423. } else if (true) {
  8424. if (key in vm.$data) {
  8425. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8426. } else if (vm.$options.props && key in vm.$options.props) {
  8427. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8428. }
  8429. }
  8430. }
  8431. }
  8432. function defineComputed (
  8433. target,
  8434. key,
  8435. userDef
  8436. ) {
  8437. var shouldCache = !isServerRendering();
  8438. if (typeof userDef === 'function') {
  8439. sharedPropertyDefinition.get = shouldCache
  8440. ? createComputedGetter(key)
  8441. : createGetterInvoker(userDef);
  8442. sharedPropertyDefinition.set = noop;
  8443. } else {
  8444. sharedPropertyDefinition.get = userDef.get
  8445. ? shouldCache && userDef.cache !== false
  8446. ? createComputedGetter(key)
  8447. : createGetterInvoker(userDef.get)
  8448. : noop;
  8449. sharedPropertyDefinition.set = userDef.set || noop;
  8450. }
  8451. if ( true &&
  8452. sharedPropertyDefinition.set === noop) {
  8453. sharedPropertyDefinition.set = function () {
  8454. warn(
  8455. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8456. this
  8457. );
  8458. };
  8459. }
  8460. Object.defineProperty(target, key, sharedPropertyDefinition);
  8461. }
  8462. function createComputedGetter (key) {
  8463. return function computedGetter () {
  8464. var watcher = this._computedWatchers && this._computedWatchers[key];
  8465. if (watcher) {
  8466. if (watcher.dirty) {
  8467. watcher.evaluate();
  8468. }
  8469. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8470. watcher.depend();
  8471. }
  8472. return watcher.value
  8473. }
  8474. }
  8475. }
  8476. function createGetterInvoker(fn) {
  8477. return function computedGetter () {
  8478. return fn.call(this, this)
  8479. }
  8480. }
  8481. function initMethods (vm, methods) {
  8482. var props = vm.$options.props;
  8483. for (var key in methods) {
  8484. if (true) {
  8485. if (typeof methods[key] !== 'function') {
  8486. warn(
  8487. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8488. "Did you reference the function correctly?",
  8489. vm
  8490. );
  8491. }
  8492. if (props && hasOwn(props, key)) {
  8493. warn(
  8494. ("Method \"" + key + "\" has already been defined as a prop."),
  8495. vm
  8496. );
  8497. }
  8498. if ((key in vm) && isReserved(key)) {
  8499. warn(
  8500. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8501. "Avoid defining component methods that start with _ or $."
  8502. );
  8503. }
  8504. }
  8505. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8506. }
  8507. }
  8508. function initWatch (vm, watch) {
  8509. for (var key in watch) {
  8510. var handler = watch[key];
  8511. if (Array.isArray(handler)) {
  8512. for (var i = 0; i < handler.length; i++) {
  8513. createWatcher(vm, key, handler[i]);
  8514. }
  8515. } else {
  8516. createWatcher(vm, key, handler);
  8517. }
  8518. }
  8519. }
  8520. function createWatcher (
  8521. vm,
  8522. expOrFn,
  8523. handler,
  8524. options
  8525. ) {
  8526. if (isPlainObject(handler)) {
  8527. options = handler;
  8528. handler = handler.handler;
  8529. }
  8530. if (typeof handler === 'string') {
  8531. handler = vm[handler];
  8532. }
  8533. return vm.$watch(expOrFn, handler, options)
  8534. }
  8535. function stateMixin (Vue) {
  8536. // flow somehow has problems with directly declared definition object
  8537. // when using Object.defineProperty, so we have to procedurally build up
  8538. // the object here.
  8539. var dataDef = {};
  8540. dataDef.get = function () { return this._data };
  8541. var propsDef = {};
  8542. propsDef.get = function () { return this._props };
  8543. if (true) {
  8544. dataDef.set = function () {
  8545. warn(
  8546. 'Avoid replacing instance root $data. ' +
  8547. 'Use nested data properties instead.',
  8548. this
  8549. );
  8550. };
  8551. propsDef.set = function () {
  8552. warn("$props is readonly.", this);
  8553. };
  8554. }
  8555. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8556. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8557. Vue.prototype.$set = set;
  8558. Vue.prototype.$delete = del;
  8559. Vue.prototype.$watch = function (
  8560. expOrFn,
  8561. cb,
  8562. options
  8563. ) {
  8564. var vm = this;
  8565. if (isPlainObject(cb)) {
  8566. return createWatcher(vm, expOrFn, cb, options)
  8567. }
  8568. options = options || {};
  8569. options.user = true;
  8570. var watcher = new Watcher(vm, expOrFn, cb, options);
  8571. if (options.immediate) {
  8572. try {
  8573. cb.call(vm, watcher.value);
  8574. } catch (error) {
  8575. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8576. }
  8577. }
  8578. return function unwatchFn () {
  8579. watcher.teardown();
  8580. }
  8581. };
  8582. }
  8583. /* */
  8584. var uid$3 = 0;
  8585. function initMixin (Vue) {
  8586. Vue.prototype._init = function (options) {
  8587. var vm = this;
  8588. // a uid
  8589. vm._uid = uid$3++;
  8590. var startTag, endTag;
  8591. /* istanbul ignore if */
  8592. if ( true && config.performance && mark) {
  8593. startTag = "vue-perf-start:" + (vm._uid);
  8594. endTag = "vue-perf-end:" + (vm._uid);
  8595. mark(startTag);
  8596. }
  8597. // a flag to avoid this being observed
  8598. vm._isVue = true;
  8599. // merge options
  8600. if (options && options._isComponent) {
  8601. // optimize internal component instantiation
  8602. // since dynamic options merging is pretty slow, and none of the
  8603. // internal component options needs special treatment.
  8604. initInternalComponent(vm, options);
  8605. } else {
  8606. vm.$options = mergeOptions(
  8607. resolveConstructorOptions(vm.constructor),
  8608. options || {},
  8609. vm
  8610. );
  8611. }
  8612. /* istanbul ignore else */
  8613. if (true) {
  8614. initProxy(vm);
  8615. } else {}
  8616. // expose real self
  8617. vm._self = vm;
  8618. initLifecycle(vm);
  8619. initEvents(vm);
  8620. initRender(vm);
  8621. callHook(vm, 'beforeCreate');
  8622. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8623. initState(vm);
  8624. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8625. !vm._$fallback && callHook(vm, 'created');
  8626. /* istanbul ignore if */
  8627. if ( true && config.performance && mark) {
  8628. vm._name = formatComponentName(vm, false);
  8629. mark(endTag);
  8630. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8631. }
  8632. if (vm.$options.el) {
  8633. vm.$mount(vm.$options.el);
  8634. }
  8635. };
  8636. }
  8637. function initInternalComponent (vm, options) {
  8638. var opts = vm.$options = Object.create(vm.constructor.options);
  8639. // doing this because it's faster than dynamic enumeration.
  8640. var parentVnode = options._parentVnode;
  8641. opts.parent = options.parent;
  8642. opts._parentVnode = parentVnode;
  8643. var vnodeComponentOptions = parentVnode.componentOptions;
  8644. opts.propsData = vnodeComponentOptions.propsData;
  8645. opts._parentListeners = vnodeComponentOptions.listeners;
  8646. opts._renderChildren = vnodeComponentOptions.children;
  8647. opts._componentTag = vnodeComponentOptions.tag;
  8648. if (options.render) {
  8649. opts.render = options.render;
  8650. opts.staticRenderFns = options.staticRenderFns;
  8651. }
  8652. }
  8653. function resolveConstructorOptions (Ctor) {
  8654. var options = Ctor.options;
  8655. if (Ctor.super) {
  8656. var superOptions = resolveConstructorOptions(Ctor.super);
  8657. var cachedSuperOptions = Ctor.superOptions;
  8658. if (superOptions !== cachedSuperOptions) {
  8659. // super option changed,
  8660. // need to resolve new options.
  8661. Ctor.superOptions = superOptions;
  8662. // check if there are any late-modified/attached options (#4976)
  8663. var modifiedOptions = resolveModifiedOptions(Ctor);
  8664. // update base extend options
  8665. if (modifiedOptions) {
  8666. extend(Ctor.extendOptions, modifiedOptions);
  8667. }
  8668. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8669. if (options.name) {
  8670. options.components[options.name] = Ctor;
  8671. }
  8672. }
  8673. }
  8674. return options
  8675. }
  8676. function resolveModifiedOptions (Ctor) {
  8677. var modified;
  8678. var latest = Ctor.options;
  8679. var sealed = Ctor.sealedOptions;
  8680. for (var key in latest) {
  8681. if (latest[key] !== sealed[key]) {
  8682. if (!modified) { modified = {}; }
  8683. modified[key] = latest[key];
  8684. }
  8685. }
  8686. return modified
  8687. }
  8688. function Vue (options) {
  8689. if ( true &&
  8690. !(this instanceof Vue)
  8691. ) {
  8692. warn('Vue is a constructor and should be called with the `new` keyword');
  8693. }
  8694. this._init(options);
  8695. }
  8696. initMixin(Vue);
  8697. stateMixin(Vue);
  8698. eventsMixin(Vue);
  8699. lifecycleMixin(Vue);
  8700. renderMixin(Vue);
  8701. /* */
  8702. function initUse (Vue) {
  8703. Vue.use = function (plugin) {
  8704. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8705. if (installedPlugins.indexOf(plugin) > -1) {
  8706. return this
  8707. }
  8708. // additional parameters
  8709. var args = toArray(arguments, 1);
  8710. args.unshift(this);
  8711. if (typeof plugin.install === 'function') {
  8712. plugin.install.apply(plugin, args);
  8713. } else if (typeof plugin === 'function') {
  8714. plugin.apply(null, args);
  8715. }
  8716. installedPlugins.push(plugin);
  8717. return this
  8718. };
  8719. }
  8720. /* */
  8721. function initMixin$1 (Vue) {
  8722. Vue.mixin = function (mixin) {
  8723. this.options = mergeOptions(this.options, mixin);
  8724. return this
  8725. };
  8726. }
  8727. /* */
  8728. function initExtend (Vue) {
  8729. /**
  8730. * Each instance constructor, including Vue, has a unique
  8731. * cid. This enables us to create wrapped "child
  8732. * constructors" for prototypal inheritance and cache them.
  8733. */
  8734. Vue.cid = 0;
  8735. var cid = 1;
  8736. /**
  8737. * Class inheritance
  8738. */
  8739. Vue.extend = function (extendOptions) {
  8740. extendOptions = extendOptions || {};
  8741. var Super = this;
  8742. var SuperId = Super.cid;
  8743. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8744. if (cachedCtors[SuperId]) {
  8745. return cachedCtors[SuperId]
  8746. }
  8747. var name = extendOptions.name || Super.options.name;
  8748. if ( true && name) {
  8749. validateComponentName(name);
  8750. }
  8751. var Sub = function VueComponent (options) {
  8752. this._init(options);
  8753. };
  8754. Sub.prototype = Object.create(Super.prototype);
  8755. Sub.prototype.constructor = Sub;
  8756. Sub.cid = cid++;
  8757. Sub.options = mergeOptions(
  8758. Super.options,
  8759. extendOptions
  8760. );
  8761. Sub['super'] = Super;
  8762. // For props and computed properties, we define the proxy getters on
  8763. // the Vue instances at extension time, on the extended prototype. This
  8764. // avoids Object.defineProperty calls for each instance created.
  8765. if (Sub.options.props) {
  8766. initProps$1(Sub);
  8767. }
  8768. if (Sub.options.computed) {
  8769. initComputed$1(Sub);
  8770. }
  8771. // allow further extension/mixin/plugin usage
  8772. Sub.extend = Super.extend;
  8773. Sub.mixin = Super.mixin;
  8774. Sub.use = Super.use;
  8775. // create asset registers, so extended classes
  8776. // can have their private assets too.
  8777. ASSET_TYPES.forEach(function (type) {
  8778. Sub[type] = Super[type];
  8779. });
  8780. // enable recursive self-lookup
  8781. if (name) {
  8782. Sub.options.components[name] = Sub;
  8783. }
  8784. // keep a reference to the super options at extension time.
  8785. // later at instantiation we can check if Super's options have
  8786. // been updated.
  8787. Sub.superOptions = Super.options;
  8788. Sub.extendOptions = extendOptions;
  8789. Sub.sealedOptions = extend({}, Sub.options);
  8790. // cache constructor
  8791. cachedCtors[SuperId] = Sub;
  8792. return Sub
  8793. };
  8794. }
  8795. function initProps$1 (Comp) {
  8796. var props = Comp.options.props;
  8797. for (var key in props) {
  8798. proxy(Comp.prototype, "_props", key);
  8799. }
  8800. }
  8801. function initComputed$1 (Comp) {
  8802. var computed = Comp.options.computed;
  8803. for (var key in computed) {
  8804. defineComputed(Comp.prototype, key, computed[key]);
  8805. }
  8806. }
  8807. /* */
  8808. function initAssetRegisters (Vue) {
  8809. /**
  8810. * Create asset registration methods.
  8811. */
  8812. ASSET_TYPES.forEach(function (type) {
  8813. Vue[type] = function (
  8814. id,
  8815. definition
  8816. ) {
  8817. if (!definition) {
  8818. return this.options[type + 's'][id]
  8819. } else {
  8820. /* istanbul ignore if */
  8821. if ( true && type === 'component') {
  8822. validateComponentName(id);
  8823. }
  8824. if (type === 'component' && isPlainObject(definition)) {
  8825. definition.name = definition.name || id;
  8826. definition = this.options._base.extend(definition);
  8827. }
  8828. if (type === 'directive' && typeof definition === 'function') {
  8829. definition = { bind: definition, update: definition };
  8830. }
  8831. this.options[type + 's'][id] = definition;
  8832. return definition
  8833. }
  8834. };
  8835. });
  8836. }
  8837. /* */
  8838. function getComponentName (opts) {
  8839. return opts && (opts.Ctor.options.name || opts.tag)
  8840. }
  8841. function matches (pattern, name) {
  8842. if (Array.isArray(pattern)) {
  8843. return pattern.indexOf(name) > -1
  8844. } else if (typeof pattern === 'string') {
  8845. return pattern.split(',').indexOf(name) > -1
  8846. } else if (isRegExp(pattern)) {
  8847. return pattern.test(name)
  8848. }
  8849. /* istanbul ignore next */
  8850. return false
  8851. }
  8852. function pruneCache (keepAliveInstance, filter) {
  8853. var cache = keepAliveInstance.cache;
  8854. var keys = keepAliveInstance.keys;
  8855. var _vnode = keepAliveInstance._vnode;
  8856. for (var key in cache) {
  8857. var cachedNode = cache[key];
  8858. if (cachedNode) {
  8859. var name = getComponentName(cachedNode.componentOptions);
  8860. if (name && !filter(name)) {
  8861. pruneCacheEntry(cache, key, keys, _vnode);
  8862. }
  8863. }
  8864. }
  8865. }
  8866. function pruneCacheEntry (
  8867. cache,
  8868. key,
  8869. keys,
  8870. current
  8871. ) {
  8872. var cached$$1 = cache[key];
  8873. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8874. cached$$1.componentInstance.$destroy();
  8875. }
  8876. cache[key] = null;
  8877. remove(keys, key);
  8878. }
  8879. var patternTypes = [String, RegExp, Array];
  8880. var KeepAlive = {
  8881. name: 'keep-alive',
  8882. abstract: true,
  8883. props: {
  8884. include: patternTypes,
  8885. exclude: patternTypes,
  8886. max: [String, Number]
  8887. },
  8888. created: function created () {
  8889. this.cache = Object.create(null);
  8890. this.keys = [];
  8891. },
  8892. destroyed: function destroyed () {
  8893. for (var key in this.cache) {
  8894. pruneCacheEntry(this.cache, key, this.keys);
  8895. }
  8896. },
  8897. mounted: function mounted () {
  8898. var this$1 = this;
  8899. this.$watch('include', function (val) {
  8900. pruneCache(this$1, function (name) { return matches(val, name); });
  8901. });
  8902. this.$watch('exclude', function (val) {
  8903. pruneCache(this$1, function (name) { return !matches(val, name); });
  8904. });
  8905. },
  8906. render: function render () {
  8907. var slot = this.$slots.default;
  8908. var vnode = getFirstComponentChild(slot);
  8909. var componentOptions = vnode && vnode.componentOptions;
  8910. if (componentOptions) {
  8911. // check pattern
  8912. var name = getComponentName(componentOptions);
  8913. var ref = this;
  8914. var include = ref.include;
  8915. var exclude = ref.exclude;
  8916. if (
  8917. // not included
  8918. (include && (!name || !matches(include, name))) ||
  8919. // excluded
  8920. (exclude && name && matches(exclude, name))
  8921. ) {
  8922. return vnode
  8923. }
  8924. var ref$1 = this;
  8925. var cache = ref$1.cache;
  8926. var keys = ref$1.keys;
  8927. var key = vnode.key == null
  8928. // same constructor may get registered as different local components
  8929. // so cid alone is not enough (#3269)
  8930. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8931. : vnode.key;
  8932. if (cache[key]) {
  8933. vnode.componentInstance = cache[key].componentInstance;
  8934. // make current key freshest
  8935. remove(keys, key);
  8936. keys.push(key);
  8937. } else {
  8938. cache[key] = vnode;
  8939. keys.push(key);
  8940. // prune oldest entry
  8941. if (this.max && keys.length > parseInt(this.max)) {
  8942. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8943. }
  8944. }
  8945. vnode.data.keepAlive = true;
  8946. }
  8947. return vnode || (slot && slot[0])
  8948. }
  8949. };
  8950. var builtInComponents = {
  8951. KeepAlive: KeepAlive
  8952. };
  8953. /* */
  8954. function initGlobalAPI (Vue) {
  8955. // config
  8956. var configDef = {};
  8957. configDef.get = function () { return config; };
  8958. if (true) {
  8959. configDef.set = function () {
  8960. warn(
  8961. 'Do not replace the Vue.config object, set individual fields instead.'
  8962. );
  8963. };
  8964. }
  8965. Object.defineProperty(Vue, 'config', configDef);
  8966. // exposed util methods.
  8967. // NOTE: these are not considered part of the public API - avoid relying on
  8968. // them unless you are aware of the risk.
  8969. Vue.util = {
  8970. warn: warn,
  8971. extend: extend,
  8972. mergeOptions: mergeOptions,
  8973. defineReactive: defineReactive$$1
  8974. };
  8975. Vue.set = set;
  8976. Vue.delete = del;
  8977. Vue.nextTick = nextTick;
  8978. // 2.6 explicit observable API
  8979. Vue.observable = function (obj) {
  8980. observe(obj);
  8981. return obj
  8982. };
  8983. Vue.options = Object.create(null);
  8984. ASSET_TYPES.forEach(function (type) {
  8985. Vue.options[type + 's'] = Object.create(null);
  8986. });
  8987. // this is used to identify the "base" constructor to extend all plain-object
  8988. // components with in Weex's multi-instance scenarios.
  8989. Vue.options._base = Vue;
  8990. extend(Vue.options.components, builtInComponents);
  8991. initUse(Vue);
  8992. initMixin$1(Vue);
  8993. initExtend(Vue);
  8994. initAssetRegisters(Vue);
  8995. }
  8996. initGlobalAPI(Vue);
  8997. Object.defineProperty(Vue.prototype, '$isServer', {
  8998. get: isServerRendering
  8999. });
  9000. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9001. get: function get () {
  9002. /* istanbul ignore next */
  9003. return this.$vnode && this.$vnode.ssrContext
  9004. }
  9005. });
  9006. // expose FunctionalRenderContext for ssr runtime helper installation
  9007. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9008. value: FunctionalRenderContext
  9009. });
  9010. Vue.version = '2.6.11';
  9011. /**
  9012. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9013. */
  9014. var ARRAYTYPE = '[object Array]';
  9015. var OBJECTTYPE = '[object Object]';
  9016. var NULLTYPE = '[object Null]';
  9017. var UNDEFINEDTYPE = '[object Undefined]';
  9018. // const FUNCTIONTYPE = '[object Function]'
  9019. function diff(current, pre) {
  9020. var result = {};
  9021. syncKeys(current, pre);
  9022. _diff(current, pre, '', result);
  9023. return result
  9024. }
  9025. function syncKeys(current, pre) {
  9026. if (current === pre) { return }
  9027. var rootCurrentType = type(current);
  9028. var rootPreType = type(pre);
  9029. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9030. if(Object.keys(current).length >= Object.keys(pre).length){
  9031. for (var key in pre) {
  9032. var currentValue = current[key];
  9033. if (currentValue === undefined) {
  9034. current[key] = null;
  9035. } else {
  9036. syncKeys(currentValue, pre[key]);
  9037. }
  9038. }
  9039. }
  9040. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9041. if (current.length >= pre.length) {
  9042. pre.forEach(function (item, index) {
  9043. syncKeys(current[index], item);
  9044. });
  9045. }
  9046. }
  9047. }
  9048. function nullOrUndefined(currentType, preType) {
  9049. if(
  9050. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  9051. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  9052. ) {
  9053. return false
  9054. }
  9055. return true
  9056. }
  9057. function _diff(current, pre, path, result) {
  9058. if (current === pre) { return }
  9059. var rootCurrentType = type(current);
  9060. var rootPreType = type(pre);
  9061. if (rootCurrentType == OBJECTTYPE) {
  9062. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9063. setResult(result, path, current);
  9064. } else {
  9065. var loop = function ( key ) {
  9066. var currentValue = current[key];
  9067. var preValue = pre[key];
  9068. var currentType = type(currentValue);
  9069. var preType = type(preValue);
  9070. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9071. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  9072. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9073. }
  9074. } else if (currentType == ARRAYTYPE) {
  9075. if (preType != ARRAYTYPE) {
  9076. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9077. } else {
  9078. if (currentValue.length < preValue.length) {
  9079. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9080. } else {
  9081. currentValue.forEach(function (item, index) {
  9082. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9083. });
  9084. }
  9085. }
  9086. } else if (currentType == OBJECTTYPE) {
  9087. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9088. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9089. } else {
  9090. for (var subKey in currentValue) {
  9091. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9092. }
  9093. }
  9094. }
  9095. };
  9096. for (var key in current) loop( key );
  9097. }
  9098. } else if (rootCurrentType == ARRAYTYPE) {
  9099. if (rootPreType != ARRAYTYPE) {
  9100. setResult(result, path, current);
  9101. } else {
  9102. if (current.length < pre.length) {
  9103. setResult(result, path, current);
  9104. } else {
  9105. current.forEach(function (item, index) {
  9106. _diff(item, pre[index], path + '[' + index + ']', result);
  9107. });
  9108. }
  9109. }
  9110. } else {
  9111. setResult(result, path, current);
  9112. }
  9113. }
  9114. function setResult(result, k, v) {
  9115. // if (type(v) != FUNCTIONTYPE) {
  9116. result[k] = v;
  9117. // }
  9118. }
  9119. function type(obj) {
  9120. return Object.prototype.toString.call(obj)
  9121. }
  9122. /* */
  9123. function flushCallbacks$1(vm) {
  9124. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9125. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9126. var mpInstance = vm.$scope;
  9127. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9128. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9129. }
  9130. var copies = vm.__next_tick_callbacks.slice(0);
  9131. vm.__next_tick_callbacks.length = 0;
  9132. for (var i = 0; i < copies.length; i++) {
  9133. copies[i]();
  9134. }
  9135. }
  9136. }
  9137. function hasRenderWatcher(vm) {
  9138. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9139. }
  9140. function nextTick$1(vm, cb) {
  9141. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9142. //2.nextTick 之前存在 render watcher
  9143. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9144. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  9145. var mpInstance = vm.$scope;
  9146. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9147. ']:nextVueTick');
  9148. }
  9149. return nextTick(cb, vm)
  9150. }else{
  9151. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  9152. var mpInstance$1 = vm.$scope;
  9153. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9154. ']:nextMPTick');
  9155. }
  9156. }
  9157. var _resolve;
  9158. if (!vm.__next_tick_callbacks) {
  9159. vm.__next_tick_callbacks = [];
  9160. }
  9161. vm.__next_tick_callbacks.push(function () {
  9162. if (cb) {
  9163. try {
  9164. cb.call(vm);
  9165. } catch (e) {
  9166. handleError(e, vm, 'nextTick');
  9167. }
  9168. } else if (_resolve) {
  9169. _resolve(vm);
  9170. }
  9171. });
  9172. // $flow-disable-line
  9173. if (!cb && typeof Promise !== 'undefined') {
  9174. return new Promise(function (resolve) {
  9175. _resolve = resolve;
  9176. })
  9177. }
  9178. }
  9179. /* */
  9180. function clearInstance(key, value) {
  9181. // 简易去除 Vue 和小程序组件实例
  9182. if (value) {
  9183. if (value._isVue || value.__v_isMPComponent) {
  9184. return {}
  9185. }
  9186. }
  9187. return value
  9188. }
  9189. function cloneWithData(vm) {
  9190. // 确保当前 vm 所有数据被同步
  9191. var ret = Object.create(null);
  9192. var dataKeys = [].concat(
  9193. Object.keys(vm._data || {}),
  9194. Object.keys(vm._computedWatchers || {}));
  9195. dataKeys.reduce(function(ret, key) {
  9196. ret[key] = vm[key];
  9197. return ret
  9198. }, ret);
  9199. // vue-composition-api
  9200. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9201. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9202. if (rawBindings) {
  9203. Object.keys(rawBindings).forEach(function (key) {
  9204. ret[key] = vm[key];
  9205. });
  9206. }
  9207. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9208. Object.assign(ret, vm.$mp.data || {});
  9209. if (
  9210. Array.isArray(vm.$options.behaviors) &&
  9211. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9212. ) { //form-field
  9213. ret['name'] = vm.name;
  9214. ret['value'] = vm.value;
  9215. }
  9216. return JSON.parse(JSON.stringify(ret, clearInstance))
  9217. }
  9218. var patch = function(oldVnode, vnode) {
  9219. var this$1 = this;
  9220. if (vnode === null) { //destroy
  9221. return
  9222. }
  9223. if (this.mpType === 'page' || this.mpType === 'component') {
  9224. var mpInstance = this.$scope;
  9225. var data = Object.create(null);
  9226. try {
  9227. data = cloneWithData(this);
  9228. } catch (err) {
  9229. console.error(err);
  9230. }
  9231. data.__webviewId__ = mpInstance.data.__webviewId__;
  9232. var mpData = Object.create(null);
  9233. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9234. mpData[key] = mpInstance.data[key];
  9235. });
  9236. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9237. if (Object.keys(diffData).length) {
  9238. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9239. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9240. ']差量更新',
  9241. JSON.stringify(diffData));
  9242. }
  9243. this.__next_tick_pending = true;
  9244. mpInstance.setData(diffData, function () {
  9245. this$1.__next_tick_pending = false;
  9246. flushCallbacks$1(this$1);
  9247. });
  9248. } else {
  9249. flushCallbacks$1(this);
  9250. }
  9251. }
  9252. };
  9253. /* */
  9254. function createEmptyRender() {
  9255. }
  9256. function mountComponent$1(
  9257. vm,
  9258. el,
  9259. hydrating
  9260. ) {
  9261. if (!vm.mpType) {//main.js 中的 new Vue
  9262. return vm
  9263. }
  9264. if (vm.mpType === 'app') {
  9265. vm.$options.render = createEmptyRender;
  9266. }
  9267. if (!vm.$options.render) {
  9268. vm.$options.render = createEmptyRender;
  9269. if (true) {
  9270. /* istanbul ignore if */
  9271. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9272. vm.$options.el || el) {
  9273. warn(
  9274. 'You are using the runtime-only build of Vue where the template ' +
  9275. 'compiler is not available. Either pre-compile the templates into ' +
  9276. 'render functions, or use the compiler-included build.',
  9277. vm
  9278. );
  9279. } else {
  9280. warn(
  9281. 'Failed to mount component: template or render function not defined.',
  9282. vm
  9283. );
  9284. }
  9285. }
  9286. }
  9287. !vm._$fallback && callHook(vm, 'beforeMount');
  9288. var updateComponent = function () {
  9289. vm._update(vm._render(), hydrating);
  9290. };
  9291. // we set this to vm._watcher inside the watcher's constructor
  9292. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9293. // component's mounted hook), which relies on vm._watcher being already defined
  9294. new Watcher(vm, updateComponent, noop, {
  9295. before: function before() {
  9296. if (vm._isMounted && !vm._isDestroyed) {
  9297. callHook(vm, 'beforeUpdate');
  9298. }
  9299. }
  9300. }, true /* isRenderWatcher */);
  9301. hydrating = false;
  9302. return vm
  9303. }
  9304. /* */
  9305. function renderClass (
  9306. staticClass,
  9307. dynamicClass
  9308. ) {
  9309. if (isDef(staticClass) || isDef(dynamicClass)) {
  9310. return concat(staticClass, stringifyClass(dynamicClass))
  9311. }
  9312. /* istanbul ignore next */
  9313. return ''
  9314. }
  9315. function concat (a, b) {
  9316. return a ? b ? (a + ' ' + b) : a : (b || '')
  9317. }
  9318. function stringifyClass (value) {
  9319. if (Array.isArray(value)) {
  9320. return stringifyArray(value)
  9321. }
  9322. if (isObject(value)) {
  9323. return stringifyObject(value)
  9324. }
  9325. if (typeof value === 'string') {
  9326. return value
  9327. }
  9328. /* istanbul ignore next */
  9329. return ''
  9330. }
  9331. function stringifyArray (value) {
  9332. var res = '';
  9333. var stringified;
  9334. for (var i = 0, l = value.length; i < l; i++) {
  9335. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9336. if (res) { res += ' '; }
  9337. res += stringified;
  9338. }
  9339. }
  9340. return res
  9341. }
  9342. function stringifyObject (value) {
  9343. var res = '';
  9344. for (var key in value) {
  9345. if (value[key]) {
  9346. if (res) { res += ' '; }
  9347. res += key;
  9348. }
  9349. }
  9350. return res
  9351. }
  9352. /* */
  9353. var parseStyleText = cached(function (cssText) {
  9354. var res = {};
  9355. var listDelimiter = /;(?![^(]*\))/g;
  9356. var propertyDelimiter = /:(.+)/;
  9357. cssText.split(listDelimiter).forEach(function (item) {
  9358. if (item) {
  9359. var tmp = item.split(propertyDelimiter);
  9360. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9361. }
  9362. });
  9363. return res
  9364. });
  9365. // normalize possible array / string values into Object
  9366. function normalizeStyleBinding (bindingStyle) {
  9367. if (Array.isArray(bindingStyle)) {
  9368. return toObject(bindingStyle)
  9369. }
  9370. if (typeof bindingStyle === 'string') {
  9371. return parseStyleText(bindingStyle)
  9372. }
  9373. return bindingStyle
  9374. }
  9375. /* */
  9376. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9377. function getTarget(obj, path) {
  9378. var parts = path.split('.');
  9379. var key = parts[0];
  9380. if (key.indexOf('__$n') === 0) { //number index
  9381. key = parseInt(key.replace('__$n', ''));
  9382. }
  9383. if (parts.length === 1) {
  9384. return obj[key]
  9385. }
  9386. return getTarget(obj[key], parts.slice(1).join('.'))
  9387. }
  9388. function internalMixin(Vue) {
  9389. Vue.config.errorHandler = function(err, vm, info) {
  9390. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9391. console.error(err);
  9392. /* eslint-disable no-undef */
  9393. var app = typeof getApp === 'function' && getApp();
  9394. if (app && app.onError) {
  9395. app.onError(err);
  9396. }
  9397. };
  9398. var oldEmit = Vue.prototype.$emit;
  9399. Vue.prototype.$emit = function(event) {
  9400. if (this.$scope && event) {
  9401. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9402. if (triggerEvent) {
  9403. try {
  9404. triggerEvent.call(this.$scope, event, {
  9405. __args__: toArray(arguments, 1)
  9406. });
  9407. } catch (error) {
  9408. }
  9409. }
  9410. }
  9411. return oldEmit.apply(this, arguments)
  9412. };
  9413. Vue.prototype.$nextTick = function(fn) {
  9414. return nextTick$1(this, fn)
  9415. };
  9416. MP_METHODS.forEach(function (method) {
  9417. Vue.prototype[method] = function(args) {
  9418. if (this.$scope && this.$scope[method]) {
  9419. return this.$scope[method](args)
  9420. }
  9421. // mp-alipay
  9422. if (typeof my === 'undefined') {
  9423. return
  9424. }
  9425. if (method === 'createSelectorQuery') {
  9426. /* eslint-disable no-undef */
  9427. return my.createSelectorQuery(args)
  9428. } else if (method === 'createIntersectionObserver') {
  9429. /* eslint-disable no-undef */
  9430. return my.createIntersectionObserver(args)
  9431. }
  9432. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9433. };
  9434. });
  9435. Vue.prototype.__init_provide = initProvide;
  9436. Vue.prototype.__init_injections = initInjections;
  9437. Vue.prototype.__call_hook = function(hook, args) {
  9438. var vm = this;
  9439. // #7573 disable dep collection when invoking lifecycle hooks
  9440. pushTarget();
  9441. var handlers = vm.$options[hook];
  9442. var info = hook + " hook";
  9443. var ret;
  9444. if (handlers) {
  9445. for (var i = 0, j = handlers.length; i < j; i++) {
  9446. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9447. }
  9448. }
  9449. if (vm._hasHookEvent) {
  9450. vm.$emit('hook:' + hook, args);
  9451. }
  9452. popTarget();
  9453. return ret
  9454. };
  9455. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9456. if (Array.isArray(modifiers)) {
  9457. if (modifiers.indexOf('trim') !== -1) {
  9458. value = value.trim();
  9459. }
  9460. if (modifiers.indexOf('number') !== -1) {
  9461. value = this._n(value);
  9462. }
  9463. }
  9464. if (!target) {
  9465. target = this;
  9466. }
  9467. // 解决动态属性添加
  9468. Vue.set(target, key, value);
  9469. };
  9470. Vue.prototype.__set_sync = function(target, key, value) {
  9471. if (!target) {
  9472. target = this;
  9473. }
  9474. // 解决动态属性添加
  9475. Vue.set(target, key, value);
  9476. };
  9477. Vue.prototype.__get_orig = function(item) {
  9478. if (isPlainObject(item)) {
  9479. return item['$orig'] || item
  9480. }
  9481. return item
  9482. };
  9483. Vue.prototype.__get_value = function(dataPath, target) {
  9484. return getTarget(target || this, dataPath)
  9485. };
  9486. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9487. return renderClass(staticClass, dynamicClass)
  9488. };
  9489. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9490. if (!dynamicStyle && !staticStyle) {
  9491. return ''
  9492. }
  9493. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9494. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9495. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9496. };
  9497. Vue.prototype.__map = function(val, iteratee) {
  9498. //TODO 暂不考虑 string
  9499. var ret, i, l, keys, key;
  9500. if (Array.isArray(val)) {
  9501. ret = new Array(val.length);
  9502. for (i = 0, l = val.length; i < l; i++) {
  9503. ret[i] = iteratee(val[i], i);
  9504. }
  9505. return ret
  9506. } else if (isObject(val)) {
  9507. keys = Object.keys(val);
  9508. ret = Object.create(null);
  9509. for (i = 0, l = keys.length; i < l; i++) {
  9510. key = keys[i];
  9511. ret[key] = iteratee(val[key], key, i);
  9512. }
  9513. return ret
  9514. } else if (typeof val === 'number') {
  9515. ret = new Array(val);
  9516. for (i = 0, l = val; i < l; i++) {
  9517. // 第一个参数暂时仍和小程序一致
  9518. ret[i] = iteratee(i, i);
  9519. }
  9520. return ret
  9521. }
  9522. return []
  9523. };
  9524. }
  9525. /* */
  9526. var LIFECYCLE_HOOKS$1 = [
  9527. //App
  9528. 'onLaunch',
  9529. 'onShow',
  9530. 'onHide',
  9531. 'onUniNViewMessage',
  9532. 'onPageNotFound',
  9533. 'onThemeChange',
  9534. 'onError',
  9535. 'onUnhandledRejection',
  9536. //Page
  9537. 'onInit',
  9538. 'onLoad',
  9539. // 'onShow',
  9540. 'onReady',
  9541. // 'onHide',
  9542. 'onUnload',
  9543. 'onPullDownRefresh',
  9544. 'onReachBottom',
  9545. 'onTabItemTap',
  9546. 'onAddToFavorites',
  9547. 'onShareTimeline',
  9548. 'onShareAppMessage',
  9549. 'onResize',
  9550. 'onPageScroll',
  9551. 'onNavigationBarButtonTap',
  9552. 'onBackPress',
  9553. 'onNavigationBarSearchInputChanged',
  9554. 'onNavigationBarSearchInputConfirmed',
  9555. 'onNavigationBarSearchInputClicked',
  9556. //Component
  9557. // 'onReady', // 兼容旧版本,应该移除该事件
  9558. 'onPageShow',
  9559. 'onPageHide',
  9560. 'onPageResize',
  9561. 'onUploadDouyinVideo'
  9562. ];
  9563. function lifecycleMixin$1(Vue) {
  9564. //fixed vue-class-component
  9565. var oldExtend = Vue.extend;
  9566. Vue.extend = function(extendOptions) {
  9567. extendOptions = extendOptions || {};
  9568. var methods = extendOptions.methods;
  9569. if (methods) {
  9570. Object.keys(methods).forEach(function (methodName) {
  9571. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9572. extendOptions[methodName] = methods[methodName];
  9573. delete methods[methodName];
  9574. }
  9575. });
  9576. }
  9577. return oldExtend.call(this, extendOptions)
  9578. };
  9579. var strategies = Vue.config.optionMergeStrategies;
  9580. var mergeHook = strategies.created;
  9581. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9582. strategies[hook] = mergeHook;
  9583. });
  9584. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9585. }
  9586. /* */
  9587. // install platform patch function
  9588. Vue.prototype.__patch__ = patch;
  9589. // public mount method
  9590. Vue.prototype.$mount = function(
  9591. el ,
  9592. hydrating
  9593. ) {
  9594. return mountComponent$1(this, el, hydrating)
  9595. };
  9596. lifecycleMixin$1(Vue);
  9597. internalMixin(Vue);
  9598. /* */
  9599. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9600. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9601. /***/ }),
  9602. /***/ 26:
  9603. /*!****************************************************!*\
  9604. !*** C:/Users/Admin/Desktop/work/mdapp/pages.json ***!
  9605. \****************************************************/
  9606. /*! no static exports found */
  9607. /***/ (function(module, exports) {
  9608. /***/ }),
  9609. /***/ 287:
  9610. /*!**********************************************************************!*\
  9611. !*** C:/Users/Admin/Desktop/work/mdapp/pages/estate/img/i_house.png ***!
  9612. \**********************************************************************/
  9613. /*! no static exports found */
  9614. /***/ (function(module, exports) {
  9615. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADqklEQVR4Xu1b71XbMBDXWQOUDQoTNH4+8xWYoGUDmKCwQTsBMEHTCcoGha9EfqYTlE7QZID4+o7KeY5t2VaebJxE/kZ8Pt39dLp/OkDs+QN7rr/wAHgL2HME/BHYcwOwc4JPT0+TIAhOAOCgb+CIaJ5l2ePx8fFzn2t1PgKz2ewGAK76FKaONxHdxnF83de6nQBIkuSKiG76EqKNLwBcR1F020a3yftOACilUiHEZJMFHH3zjIihI15rbLoCQH0sbsMTETvJasOTaTsxVUp5AJqQBYDHLMu+5DRBEEyafAYRfRVCPOT02rl+bFpjzBawkFIehmE4LyqglGKn9blGqe+IeFH+XSn1IoR4bwJhtADw7kdRdFoWfDabnQLAz/LvvPtxHK+sJX+fJMkDEZ14AAwIjNYChBAviHhUltuUO+ycBWjFrxDxLgchTdPD5XLJ5n9Ys6Gc4p4VU9wkSS6I6FtLCJsi4qVtmGuj35ow2KaIjir3xY3o8M325AFdlNE0VpaySxawwoiIzuI4XuUZjTlMF2THkAl2kTOnMTnaOh47aQGm3KRvABYA8ExE3Cz50GHHfgHAnIg4UhgzwA58KiSDAwAAl1EUTUthkM9gnWKcOk/CMOTU9/VRSn0SQvzYRNnaXTVkp31ZwB9ErMR714mQDTiDWsBQtYAHwAKBQS1ACDGXUh45KId/G1JnC9X/kw4NAK/Jpewtt7L5DynlKRFVSt5CnGbaey3sAQBwf4AdoZPnLQBwIrgrJh6AgcOgq41zxsdbgLeA+j5lX5kg810IIaZ5FAiCgKOAscGp2+jFtjhHAWf1wOBHQOcBq9xe5/cc5iq9/jrh0jQ9WC6X/P07F45gUABMi5kKnE2bojbAjAIA1/cCowVACFF7c2vq9O6cBfDOZFkWlic5lFLcFq/cGDFgUsqzYu2gJ0+Y3snkyaBHQJsm1wDFURbuD9TdCeSWzA6v6DR59sCk/ILrjOJlqq4huHbg6FFxnG8BgM0RtaJt6vCami47BUDTnaDJ0XoAdikV9hbQMBvkj4BhCMP7AO8Dhi+HrWK7DfGbO0Fdqv61EdolbV2pnfM3VZzOfIBWnmeEK2NtLpVs4fUgpTwv3zvoMRy+TzSN8J4j4mvrvelZXY/rgoSVrStg2vhsw3u+iZ6WJ89XACilajs426CZpYxrluEByNHjIyCl5CsrYzPTEumxkb82bhFx7Z8+Oo3IjE0Tl/J4AFyiuY28vAVs4665lHnvLeAf8XaCXwWtufUAAAAASUVORK5CYII="
  9616. /***/ }),
  9617. /***/ 288:
  9618. /*!********************************************************************!*\
  9619. !*** C:/Users/Admin/Desktop/work/mdapp/pages/estate/img/i_pos.png ***!
  9620. \********************************************************************/
  9621. /*! no static exports found */
  9622. /***/ (function(module, exports) {
  9623. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHDklEQVR4Xs1bfYhVRRQ/565uGSomWX8kFQlhmq28ObOsq0mitiFhYiSVUFFa4T+aEIaE2hdKkUYQfWBlJaWpRQlZoSmEtrt37t21WrOMRJCiDJfUlF323ROjd2Vddt+dmTvv7Q68v+45v3POb2bOfJx5CBVoR48evby9vf1GZta/cQAwPv31tn4EAL4MgmB/oVA4UQHXAMtpJI7jWUmS3AMA+jfGxhYz7waA/Yi4hYgO2+jayHonoKWlZVSxWFyUBl1n40w/skUA2MrMW6WUX3jAuwTCKwFKqXkAsBoAJvt2VOMhYlgsFlfV1tZ+5QvfCwG615MkWc3My3w5loGzkojW+rCVmwClVAEA3ilXr5cIcjszr5BS/p6HiFwExHE8PUmSDwHgujxO5NBtC4JgQaFQOOSK4UxAGIZzgiDYzMxXuhr3pJeLBCcCdLJj5u2IWOUpiLwwziRYE5Auc3sHYM5nkdQybNiw6RMnTjyTJdjzuzUBURRtqGC2t4lFy64lopU2SlYEpOv8ZzYGKi2LiNOFEN+Z2rUiIIqikJnJFHwg5BBxlxBijqltYwLCMHwQEd83BS4htw0AtgVB0NbZ2Xlcy1VXV49NkmQiANyb/vKaeZiIjHw1JkAppRPf7Tk8WwcAHxHRj6UwmpqaplRVVT2Zhwhm3imlnGviqxEBURTNZ+YdJoD9yCwgIt3zxi0MwzWIqM8VTi0IgsmFQuFglrIRAUqpnQBwVxaYr+C7ccIwnI2I3zjafZ6IVmXpZhLAzFVxHJ9w3PFZ93xvh5VS+tDzdFYgvb8j4iEhhM4rJVsmAXEcT0mS5EAWUO/vzLxBSrncVq+3fBzHY5Ik+R4A9E2SVWPmOVLKXaWUMglQSi0FgFetLAOcHjp06ISamprzWT5vU0otAYDXHXAyN0aZBERRpA88Cy2N7yOiGZY6/Yq3trZe29XV5ULmB0T0UK4REIbhAUScYhMMMz8rpVxjo5MlG0XRQWa+NUuu53dm3iOlnJWLAKWUXrdvsTS8SEqpL0m8NaXUJw57g8NEdHNeAo7ZXngg4p1CiK+9RQ8AYRiuR0S9QTJuzHxaSjkyFwFRFJ20XQKZeYaUcp+xpwaCjqfQf4io5HV8ZhIMw7DL9uKjHAQopfQpVN8627T9RDQt1whQSv0EAJkbil7Jx3sSVEr9ZrsXQMR3hRCP5iVgIwCUBOnDQBsRWSXOUk4qpXQp7Webrtey6a3xS3kJeAIA3rA1joiPCyHettXrS951OxwEwd2FQqFkNSkzBzQ3N9frYqVDIBER5b48SesOeit+ma0PzDxeSvlLrhGwd+/e4cOHDz+GiKNtHdAXH0S0wEHvoorLRqxbmYgyOzhTQIMppTYDgO12+LwfeXaFOe8EPiaiB7LINyIgiqKFzKxJcGqIuAkRXzat4Ohhz8xPIeJ9TgYvED9PSvl5lr4RAW1tbaPPnj17xHEadPtwSh+Ri8Xip3V1dT/0k+wmAYDuNb3js57zPTD/6+zsHFNfX3/OCwF5p0EfTuxj5uOIqE94IxFxbHrQuSHLYZPviPieEOIRI1kTIS2TdxqY2vEhx8z3Sym3mGAZTQEN5GkamPiUSwYR/+jo6JhUX19/0gTImAANFobhm3qDYwI8UDK2q44VAU1NTTVVVVXNupYxUAGWsqt7X1euiOhPU/+sCEiTob4f1PeEg67Z9r4OwJqA1tbWm7q6ukKdvQcTAy6970RAmgvWIeKKwUSAS+87E6CU0m+C9Ci4ejCQ4Nr7zgSkoyBX7c4nca69n4uANCHqut1sn8HYYjGzKhaLM+vq6k7Z6uYmoLGxsW7IkCF7AOAKF+OedBqIyLWAar8K9HY6juPlSZK84ikYW5jVRPScrVJPeetlsC9jURTtYOb5eRyx1WXmXVJK46cw/eF7ISCO4wlJknwLANfYBuIo387MM6WULY76F9W8EKDRoihazMxeLkENglpCRNYXtX3heiMgXRU2AUDJaqxBcFkimRXfLADvOaAbUCl1FQDot/zCxglTWWZura6ubqipqfnbVCdLzusISKfCbcysSfC9NOoSXYMQQucab807ASkJjzHzW968vAC0lIhe84yZfx/Qn0NhGG5ARF//INlIRIt9B6/xyjICeuQEPRUacjreSERWL1Rs7JWVgCiK9OuMXcx8vY1TPWTPdHR0jJs6daq3pNfbj7ISoI01NzfPD4LA6ZVpkiRza2tr9SPNsrWyE5AmxWW6KGITBSK+KIR4xkbHRbYiBKQkrGdmozc+iLhbCFGRY3bFCEhJ0H9103+jLdUy3/W49HR/OhUlQJfaR4wYoe8PaksEMYqI/vUZZCmsihKgHUmfu+gH0Jc8eGLmv4IguEMI0WfhtFyEVJyA7kB0rREAZjHzKET89dy5cy9MmzbtdLkC7Q/3fxMowF8w/lVXAAAAAElFTkSuQmCC"
  9624. /***/ }),
  9625. /***/ 3:
  9626. /*!***********************************!*\
  9627. !*** (webpack)/buildin/global.js ***!
  9628. \***********************************/
  9629. /*! no static exports found */
  9630. /***/ (function(module, exports) {
  9631. var g;
  9632. // This works in non-strict mode
  9633. g = (function() {
  9634. return this;
  9635. })();
  9636. try {
  9637. // This works if eval is allowed (see CSP)
  9638. g = g || new Function("return this")();
  9639. } catch (e) {
  9640. // This works if the window reference is available
  9641. if (typeof window === "object") g = window;
  9642. }
  9643. // g can still be undefined, but nothing to do about it...
  9644. // We return undefined, instead of nothing here, so it's
  9645. // easier to handle this case. if(!global) { ...}
  9646. module.exports = g;
  9647. /***/ }),
  9648. /***/ 32:
  9649. /*!**********************************************************************************************************!*\
  9650. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  9651. \**********************************************************************************************************/
  9652. /*! exports provided: default */
  9653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9654. "use strict";
  9655. __webpack_require__.r(__webpack_exports__);
  9656. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  9657. /* globals __VUE_SSR_CONTEXT__ */
  9658. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  9659. // This module is a runtime utility for cleaner component module output and will
  9660. // be included in the final webpack user bundle.
  9661. function normalizeComponent (
  9662. scriptExports,
  9663. render,
  9664. staticRenderFns,
  9665. functionalTemplate,
  9666. injectStyles,
  9667. scopeId,
  9668. moduleIdentifier, /* server only */
  9669. shadowMode, /* vue-cli only */
  9670. components, // fixed by xxxxxx auto components
  9671. renderjs // fixed by xxxxxx renderjs
  9672. ) {
  9673. // Vue.extend constructor export interop
  9674. var options = typeof scriptExports === 'function'
  9675. ? scriptExports.options
  9676. : scriptExports
  9677. // fixed by xxxxxx auto components
  9678. if (components) {
  9679. if (!options.components) {
  9680. options.components = {}
  9681. }
  9682. var hasOwn = Object.prototype.hasOwnProperty
  9683. for (var name in components) {
  9684. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  9685. options.components[name] = components[name]
  9686. }
  9687. }
  9688. }
  9689. // fixed by xxxxxx renderjs
  9690. if (renderjs) {
  9691. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  9692. this[renderjs.__module] = this
  9693. });
  9694. (options.mixins || (options.mixins = [])).push(renderjs)
  9695. }
  9696. // render functions
  9697. if (render) {
  9698. options.render = render
  9699. options.staticRenderFns = staticRenderFns
  9700. options._compiled = true
  9701. }
  9702. // functional template
  9703. if (functionalTemplate) {
  9704. options.functional = true
  9705. }
  9706. // scopedId
  9707. if (scopeId) {
  9708. options._scopeId = 'data-v-' + scopeId
  9709. }
  9710. var hook
  9711. if (moduleIdentifier) { // server build
  9712. hook = function (context) {
  9713. // 2.3 injection
  9714. context =
  9715. context || // cached call
  9716. (this.$vnode && this.$vnode.ssrContext) || // stateful
  9717. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  9718. // 2.2 with runInNewContext: true
  9719. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  9720. context = __VUE_SSR_CONTEXT__
  9721. }
  9722. // inject component styles
  9723. if (injectStyles) {
  9724. injectStyles.call(this, context)
  9725. }
  9726. // register component module identifier for async chunk inferrence
  9727. if (context && context._registeredComponents) {
  9728. context._registeredComponents.add(moduleIdentifier)
  9729. }
  9730. }
  9731. // used by ssr in case component is cached and beforeCreate
  9732. // never gets called
  9733. options._ssrRegister = hook
  9734. } else if (injectStyles) {
  9735. hook = shadowMode
  9736. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  9737. : injectStyles
  9738. }
  9739. if (hook) {
  9740. if (options.functional) {
  9741. // for template-only hot-reload because in that case the render fn doesn't
  9742. // go through the normalizer
  9743. options._injectStyles = hook
  9744. // register for functioal component in vue file
  9745. var originalRender = options.render
  9746. options.render = function renderWithStyleInjection (h, context) {
  9747. hook.call(context)
  9748. return originalRender(h, context)
  9749. }
  9750. } else {
  9751. // inject component registration as beforeCreate hook
  9752. var existing = options.beforeCreate
  9753. options.beforeCreate = existing
  9754. ? [].concat(existing, hook)
  9755. : [hook]
  9756. }
  9757. }
  9758. return {
  9759. exports: scriptExports,
  9760. options: options
  9761. }
  9762. }
  9763. /***/ }),
  9764. /***/ 33:
  9765. /*!**************************************************************************!*\
  9766. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/index.js ***!
  9767. \**************************************************************************/
  9768. /*! no static exports found */
  9769. /***/ (function(module, exports, __webpack_require__) {
  9770. "use strict";
  9771. /* WEBPACK VAR INJECTION */(function(uni) {
  9772. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9773. Object.defineProperty(exports, "__esModule", {
  9774. value: true
  9775. });
  9776. exports.default = void 0;
  9777. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 34));
  9778. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 35));
  9779. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 39));
  9780. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 40));
  9781. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 44));
  9782. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 45));
  9783. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 46));
  9784. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 47));
  9785. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 48));
  9786. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 49));
  9787. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 50));
  9788. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 37));
  9789. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 36));
  9790. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 51));
  9791. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 38));
  9792. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 52));
  9793. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 53));
  9794. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 54));
  9795. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 55));
  9796. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 56));
  9797. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 57);
  9798. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 58));
  9799. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 59));
  9800. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 60));
  9801. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 61));
  9802. // 引入全局mixin
  9803. // 引入关于是否mixin集成小程序分享的配置
  9804. // import wxshare from './libs/mixin/mpShare.js'
  9805. // 全局挂载引入http相关请求拦截插件
  9806. function wranning(str) {
  9807. // 开发环境进行信息输出,主要是一些报错信息
  9808. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  9809. // 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
  9810. if (true) {
  9811. console.warn(str);
  9812. }
  9813. }
  9814. // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  9815. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  9816. // let vuexStore = {};
  9817. // try {
  9818. // vuexStore = require("@/store/$u.mixin.js");
  9819. // } catch (e) {
  9820. // //TODO handle the exception
  9821. // }
  9822. // post类型对象参数转为get类型url参数
  9823. var $u = {
  9824. queryParams: _queryParams.default,
  9825. route: _route.default,
  9826. timeFormat: _timeFormat.default,
  9827. date: _timeFormat.default,
  9828. // 另名date
  9829. timeFrom: _timeFrom.default,
  9830. colorGradient: _colorGradient.default.colorGradient,
  9831. colorToRgba: _colorGradient.default.colorToRgba,
  9832. guid: _guid.default,
  9833. color: _color.default,
  9834. sys: _sys.sys,
  9835. os: _sys.os,
  9836. type2icon: _type2icon.default,
  9837. randomArray: _randomArray.default,
  9838. wranning: wranning,
  9839. get: _request.default.get,
  9840. post: _request.default.post,
  9841. put: _request.default.put,
  9842. 'delete': _request.default.delete,
  9843. hexToRgb: _colorGradient.default.hexToRgb,
  9844. rgbToHex: _colorGradient.default.rgbToHex,
  9845. test: _test.default,
  9846. random: _random.default,
  9847. deepClone: _deepClone.default,
  9848. deepMerge: _deepMerge.default,
  9849. getParent: _getParent.default,
  9850. $parent: _$parent.default,
  9851. addUnit: _addUnit.default,
  9852. trim: _trim.default,
  9853. type: ['primary', 'success', 'error', 'warning', 'info'],
  9854. http: _request.default,
  9855. toast: _toast.default,
  9856. config: _config.default,
  9857. // uView配置信息相关,比如版本号
  9858. zIndex: _zIndex.default,
  9859. debounce: _debounce.default,
  9860. throttle: _throttle.default
  9861. };
  9862. // $u挂载到uni对象上
  9863. uni.$u = $u;
  9864. var install = function install(Vue) {
  9865. Vue.mixin(_mixin.default);
  9866. if (Vue.prototype.openShare) {
  9867. Vue.mixin(mpShare);
  9868. }
  9869. // Vue.mixin(vuexStore);
  9870. // 时间格式化,同时两个名称,date和timeFormat
  9871. Vue.filter('timeFormat', function (timestamp, format) {
  9872. return (0, _timeFormat.default)(timestamp, format);
  9873. });
  9874. Vue.filter('date', function (timestamp, format) {
  9875. return (0, _timeFormat.default)(timestamp, format);
  9876. });
  9877. // 将多久以前的方法,注入到全局过滤器
  9878. Vue.filter('timeFrom', function (timestamp, format) {
  9879. return (0, _timeFrom.default)(timestamp, format);
  9880. });
  9881. Vue.prototype.$u = $u;
  9882. };
  9883. var _default = {
  9884. install: install
  9885. };
  9886. exports.default = _default;
  9887. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9888. /***/ }),
  9889. /***/ 34:
  9890. /*!*************************************************************************************!*\
  9891. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  9892. \*************************************************************************************/
  9893. /*! no static exports found */
  9894. /***/ (function(module, exports, __webpack_require__) {
  9895. "use strict";
  9896. /* WEBPACK VAR INJECTION */(function(uni) {
  9897. Object.defineProperty(exports, "__esModule", {
  9898. value: true
  9899. });
  9900. exports.default = void 0;
  9901. var _default = {
  9902. data: function data() {
  9903. return {};
  9904. },
  9905. onLoad: function onLoad() {
  9906. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  9907. this.$u.getRect = this.$uGetRect;
  9908. },
  9909. methods: {
  9910. // 查询节点信息
  9911. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  9912. // 解决办法为在组件根部再套一个没有任何作用的view元素
  9913. $uGetRect: function $uGetRect(selector, all) {
  9914. var _this = this;
  9915. return new Promise(function (resolve) {
  9916. uni.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  9917. if (all && Array.isArray(rect) && rect.length) {
  9918. resolve(rect);
  9919. }
  9920. if (!all && rect) {
  9921. resolve(rect);
  9922. }
  9923. }).exec();
  9924. });
  9925. },
  9926. getParentData: function getParentData() {
  9927. var _this2 = this;
  9928. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  9929. // 避免在created中去定义parent变量
  9930. if (!this.parent) this.parent = false;
  9931. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  9932. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  9933. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  9934. this.parent = this.$u.$parent.call(this, parentName);
  9935. if (this.parent) {
  9936. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  9937. Object.keys(this.parentData).map(function (key) {
  9938. _this2.parentData[key] = _this2.parent[key];
  9939. });
  9940. }
  9941. },
  9942. // 阻止事件冒泡
  9943. preventEvent: function preventEvent(e) {
  9944. e && e.stopPropagation && e.stopPropagation();
  9945. }
  9946. },
  9947. onReachBottom: function onReachBottom() {
  9948. uni.$emit('uOnReachBottom');
  9949. },
  9950. beforeDestroy: function beforeDestroy() {
  9951. var _this3 = this;
  9952. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  9953. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  9954. if (this.parent && uni.$u.test.array(this.parent.children)) {
  9955. // 组件销毁时,移除父组件中的children数组中对应的实例
  9956. var childrenList = this.parent.children;
  9957. childrenList.map(function (child, index) {
  9958. // 如果相等,则移除
  9959. if (child === _this3) {
  9960. childrenList.splice(index, 1);
  9961. }
  9962. });
  9963. }
  9964. }
  9965. };
  9966. exports.default = _default;
  9967. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9968. /***/ }),
  9969. /***/ 35:
  9970. /*!***************************************************************************************!*\
  9971. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  9972. \***************************************************************************************/
  9973. /*! no static exports found */
  9974. /***/ (function(module, exports, __webpack_require__) {
  9975. "use strict";
  9976. /* WEBPACK VAR INJECTION */(function(uni) {
  9977. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9978. Object.defineProperty(exports, "__esModule", {
  9979. value: true
  9980. });
  9981. exports.default = void 0;
  9982. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  9983. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  9984. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 36));
  9985. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 38));
  9986. var Request = /*#__PURE__*/function () {
  9987. function Request() {
  9988. var _this = this;
  9989. (0, _classCallCheck2.default)(this, Request);
  9990. this.config = {
  9991. baseUrl: '',
  9992. // 请求的根域名
  9993. // 默认的请求头
  9994. header: {},
  9995. method: 'POST',
  9996. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  9997. dataType: 'json',
  9998. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  9999. responseType: 'text',
  10000. showLoading: true,
  10001. // 是否显示请求中的loading
  10002. loadingText: '请求中...',
  10003. loadingTime: 800,
  10004. // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  10005. timer: null,
  10006. // 定时器
  10007. originalData: false,
  10008. // 是否在拦截器中返回服务端的原始数据,见文档说明
  10009. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  10010. };
  10011. // 拦截器
  10012. this.interceptor = {
  10013. // 请求前的拦截
  10014. request: null,
  10015. // 请求后的拦截
  10016. response: null
  10017. };
  10018. // get请求
  10019. this.get = function (url) {
  10020. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10021. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10022. return _this.request({
  10023. method: 'GET',
  10024. url: url,
  10025. header: header,
  10026. data: data
  10027. });
  10028. };
  10029. // post请求
  10030. this.post = function (url) {
  10031. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10032. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10033. return _this.request({
  10034. url: url,
  10035. method: 'POST',
  10036. header: header,
  10037. data: data
  10038. });
  10039. };
  10040. // put请求,不支持支付宝小程序(HX2.6.15)
  10041. this.put = function (url) {
  10042. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10043. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10044. return _this.request({
  10045. url: url,
  10046. method: 'PUT',
  10047. header: header,
  10048. data: data
  10049. });
  10050. };
  10051. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  10052. this.delete = function (url) {
  10053. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10054. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10055. return _this.request({
  10056. url: url,
  10057. method: 'DELETE',
  10058. header: header,
  10059. data: data
  10060. });
  10061. };
  10062. }
  10063. (0, _createClass2.default)(Request, [{
  10064. key: "setConfig",
  10065. value:
  10066. // 设置全局默认配置
  10067. function setConfig(customConfig) {
  10068. // 深度合并对象,否则会造成对象深层属性丢失
  10069. this.config = (0, _deepMerge.default)(this.config, customConfig);
  10070. }
  10071. // 主要请求部分
  10072. }, {
  10073. key: "request",
  10074. value: function request() {
  10075. var _this2 = this;
  10076. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10077. // 检查请求拦截
  10078. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  10079. var tmpConfig = {};
  10080. var interceptorRequest = this.interceptor.request(options);
  10081. if (interceptorRequest === false) {
  10082. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  10083. return new Promise(function () {});
  10084. }
  10085. this.options = interceptorRequest;
  10086. }
  10087. options.dataType = options.dataType || this.config.dataType;
  10088. options.responseType = options.responseType || this.config.responseType;
  10089. options.url = options.url || '';
  10090. options.params = options.params || {};
  10091. options.header = Object.assign({}, this.config.header, options.header);
  10092. options.method = options.method || this.config.method;
  10093. return new Promise(function (resolve, reject) {
  10094. options.complete = function (response) {
  10095. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  10096. uni.hideLoading();
  10097. // 清除定时器,如果请求回来了,就无需loading
  10098. clearTimeout(_this2.config.timer);
  10099. _this2.config.timer = null;
  10100. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  10101. if (_this2.config.originalData) {
  10102. // 判断是否存在拦截器
  10103. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10104. var resInterceptors = _this2.interceptor.response(response);
  10105. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  10106. if (resInterceptors !== false) {
  10107. resolve(resInterceptors);
  10108. } else {
  10109. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  10110. reject(response);
  10111. }
  10112. } else {
  10113. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  10114. resolve(response);
  10115. }
  10116. } else {
  10117. if (response.statusCode == 200) {
  10118. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10119. var _resInterceptors = _this2.interceptor.response(response.data);
  10120. if (_resInterceptors !== false) {
  10121. resolve(_resInterceptors);
  10122. } else {
  10123. reject(response.data);
  10124. }
  10125. } else {
  10126. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  10127. resolve(response.data);
  10128. }
  10129. } else {
  10130. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  10131. // if(response.errMsg) {
  10132. // uni.showModal({
  10133. // title: response.errMsg
  10134. // });
  10135. // }
  10136. reject(response);
  10137. }
  10138. }
  10139. };
  10140. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  10141. options.url = _test.default.url(options.url) ? options.url : _this2.config.baseUrl + (options.url.indexOf('/') == 0 ? options.url : '/' + options.url);
  10142. // 是否显示loading
  10143. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  10144. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  10145. if (_this2.config.showLoading && !_this2.config.timer) {
  10146. _this2.config.timer = setTimeout(function () {
  10147. uni.showLoading({
  10148. title: _this2.config.loadingText,
  10149. mask: _this2.config.loadingMask
  10150. });
  10151. _this2.config.timer = null;
  10152. }, _this2.config.loadingTime);
  10153. }
  10154. uni.request(options);
  10155. });
  10156. // .catch(res => {
  10157. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  10158. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  10159. // return new Promise(()=>{});
  10160. // })
  10161. }
  10162. }]);
  10163. return Request;
  10164. }();
  10165. var _default = new Request();
  10166. exports.default = _default;
  10167. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10168. /***/ }),
  10169. /***/ 36:
  10170. /*!********************************************************************************************!*\
  10171. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  10172. \********************************************************************************************/
  10173. /*! no static exports found */
  10174. /***/ (function(module, exports, __webpack_require__) {
  10175. "use strict";
  10176. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10177. Object.defineProperty(exports, "__esModule", {
  10178. value: true
  10179. });
  10180. exports.default = void 0;
  10181. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10182. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 37));
  10183. // JS对象深度合并
  10184. function deepMerge() {
  10185. var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10186. var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10187. target = (0, _deepClone.default)(target);
  10188. if ((0, _typeof2.default)(target) !== 'object' || (0, _typeof2.default)(source) !== 'object') return false;
  10189. for (var prop in source) {
  10190. if (!source.hasOwnProperty(prop)) continue;
  10191. if (prop in target) {
  10192. if ((0, _typeof2.default)(target[prop]) !== 'object') {
  10193. target[prop] = source[prop];
  10194. } else {
  10195. if ((0, _typeof2.default)(source[prop]) !== 'object') {
  10196. target[prop] = source[prop];
  10197. } else {
  10198. if (target[prop].concat && source[prop].concat) {
  10199. target[prop] = target[prop].concat(source[prop]);
  10200. } else {
  10201. target[prop] = deepMerge(target[prop], source[prop]);
  10202. }
  10203. }
  10204. }
  10205. } else {
  10206. target[prop] = source[prop];
  10207. }
  10208. }
  10209. return target;
  10210. }
  10211. var _default = deepMerge;
  10212. exports.default = _default;
  10213. /***/ }),
  10214. /***/ 37:
  10215. /*!********************************************************************************************!*\
  10216. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  10217. \********************************************************************************************/
  10218. /*! no static exports found */
  10219. /***/ (function(module, exports, __webpack_require__) {
  10220. "use strict";
  10221. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10222. Object.defineProperty(exports, "__esModule", {
  10223. value: true
  10224. });
  10225. exports.default = void 0;
  10226. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10227. // 判断arr是否为一个数组,返回一个bool值
  10228. function isArray(arr) {
  10229. return Object.prototype.toString.call(arr) === '[object Array]';
  10230. }
  10231. // 深度克隆
  10232. function deepClone(obj) {
  10233. // 对常见的“非”值,直接返回原来值
  10234. if ([null, undefined, NaN, false].includes(obj)) return obj;
  10235. if ((0, _typeof2.default)(obj) !== "object" && typeof obj !== 'function') {
  10236. //原始类型直接返回
  10237. return obj;
  10238. }
  10239. var o = isArray(obj) ? [] : {};
  10240. for (var i in obj) {
  10241. if (obj.hasOwnProperty(i)) {
  10242. o[i] = (0, _typeof2.default)(obj[i]) === "object" ? deepClone(obj[i]) : obj[i];
  10243. }
  10244. }
  10245. return o;
  10246. }
  10247. var _default = deepClone;
  10248. exports.default = _default;
  10249. /***/ }),
  10250. /***/ 38:
  10251. /*!***************************************************************************************!*\
  10252. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  10253. \***************************************************************************************/
  10254. /*! no static exports found */
  10255. /***/ (function(module, exports, __webpack_require__) {
  10256. "use strict";
  10257. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10258. Object.defineProperty(exports, "__esModule", {
  10259. value: true
  10260. });
  10261. exports.default = void 0;
  10262. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10263. /**
  10264. * 验证电子邮箱格式
  10265. */
  10266. function email(value) {
  10267. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  10268. }
  10269. /**
  10270. * 验证手机格式
  10271. */
  10272. function mobile(value) {
  10273. return /^1[23456789]\d{9}$/.test(value);
  10274. }
  10275. /**
  10276. * 验证URL格式
  10277. */
  10278. function url(value) {
  10279. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  10280. }
  10281. /**
  10282. * 验证日期格式
  10283. */
  10284. function date(value) {
  10285. return !/Invalid|NaN/.test(new Date(value).toString());
  10286. }
  10287. /**
  10288. * 验证ISO类型的日期格式
  10289. */
  10290. function dateISO(value) {
  10291. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  10292. }
  10293. /**
  10294. * 验证十进制数字
  10295. */
  10296. function number(value) {
  10297. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  10298. }
  10299. /**
  10300. * 验证整数
  10301. */
  10302. function digits(value) {
  10303. return /^\d+$/.test(value);
  10304. }
  10305. /**
  10306. * 验证身份证号码
  10307. */
  10308. function idCard(value) {
  10309. 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);
  10310. }
  10311. /**
  10312. * 是否车牌号
  10313. */
  10314. function carNo(value) {
  10315. // 新能源车牌
  10316. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  10317. // 旧车牌
  10318. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  10319. if (value.length === 7) {
  10320. return creg.test(value);
  10321. } else if (value.length === 8) {
  10322. return xreg.test(value);
  10323. } else {
  10324. return false;
  10325. }
  10326. }
  10327. /**
  10328. * 金额,只允许2位小数
  10329. */
  10330. function amount(value) {
  10331. //金额,只允许保留两位小数
  10332. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  10333. }
  10334. /**
  10335. * 中文
  10336. */
  10337. function chinese(value) {
  10338. var reg = /^[\u4e00-\u9fa5]+$/gi;
  10339. return reg.test(value);
  10340. }
  10341. /**
  10342. * 只能输入字母
  10343. */
  10344. function letter(value) {
  10345. return /^[a-zA-Z]*$/.test(value);
  10346. }
  10347. /**
  10348. * 只能是字母或者数字
  10349. */
  10350. function enOrNum(value) {
  10351. //英文或者数字
  10352. var reg = /^[0-9a-zA-Z]*$/g;
  10353. return reg.test(value);
  10354. }
  10355. /**
  10356. * 验证是否包含某个值
  10357. */
  10358. function contains(value, param) {
  10359. return value.indexOf(param) >= 0;
  10360. }
  10361. /**
  10362. * 验证一个值范围[min, max]
  10363. */
  10364. function range(value, param) {
  10365. return value >= param[0] && value <= param[1];
  10366. }
  10367. /**
  10368. * 验证一个长度范围[min, max]
  10369. */
  10370. function rangeLength(value, param) {
  10371. return value.length >= param[0] && value.length <= param[1];
  10372. }
  10373. /**
  10374. * 是否固定电话
  10375. */
  10376. function landline(value) {
  10377. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  10378. return reg.test(value);
  10379. }
  10380. /**
  10381. * 判断是否为空
  10382. */
  10383. function empty(value) {
  10384. switch ((0, _typeof2.default)(value)) {
  10385. case 'undefined':
  10386. return true;
  10387. case 'string':
  10388. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  10389. break;
  10390. case 'boolean':
  10391. if (!value) return true;
  10392. break;
  10393. case 'number':
  10394. if (0 === value || isNaN(value)) return true;
  10395. break;
  10396. case 'object':
  10397. if (null === value || value.length === 0) return true;
  10398. for (var i in value) {
  10399. return false;
  10400. }
  10401. return true;
  10402. }
  10403. return false;
  10404. }
  10405. /**
  10406. * 是否json字符串
  10407. */
  10408. function jsonString(value) {
  10409. if (typeof value == 'string') {
  10410. try {
  10411. var obj = JSON.parse(value);
  10412. if ((0, _typeof2.default)(obj) == 'object' && obj) {
  10413. return true;
  10414. } else {
  10415. return false;
  10416. }
  10417. } catch (e) {
  10418. return false;
  10419. }
  10420. }
  10421. return false;
  10422. }
  10423. /**
  10424. * 是否数组
  10425. */
  10426. function array(value) {
  10427. if (typeof Array.isArray === "function") {
  10428. return Array.isArray(value);
  10429. } else {
  10430. return Object.prototype.toString.call(value) === "[object Array]";
  10431. }
  10432. }
  10433. /**
  10434. * 是否对象
  10435. */
  10436. function object(value) {
  10437. return Object.prototype.toString.call(value) === '[object Object]';
  10438. }
  10439. /**
  10440. * 是否短信验证码
  10441. */
  10442. function code(value) {
  10443. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  10444. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  10445. }
  10446. var _default = {
  10447. email: email,
  10448. mobile: mobile,
  10449. url: url,
  10450. date: date,
  10451. dateISO: dateISO,
  10452. number: number,
  10453. digits: digits,
  10454. idCard: idCard,
  10455. carNo: carNo,
  10456. amount: amount,
  10457. chinese: chinese,
  10458. letter: letter,
  10459. enOrNum: enOrNum,
  10460. contains: contains,
  10461. range: range,
  10462. rangeLength: rangeLength,
  10463. empty: empty,
  10464. isEmpty: empty,
  10465. jsonString: jsonString,
  10466. landline: landline,
  10467. object: object,
  10468. array: array,
  10469. code: code
  10470. };
  10471. exports.default = _default;
  10472. /***/ }),
  10473. /***/ 384:
  10474. /*!*********************************************************************************************************!*\
  10475. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  10476. \*********************************************************************************************************/
  10477. /*! no static exports found */
  10478. /***/ (function(module, exports, __webpack_require__) {
  10479. "use strict";
  10480. /* WEBPACK VAR INJECTION */(function(uni) {
  10481. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10482. Object.defineProperty(exports, "__esModule", {
  10483. value: true
  10484. });
  10485. exports.default = void 0;
  10486. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 385));
  10487. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 386));
  10488. /**
  10489. * html 解析器
  10490. * @tutorial https://github.com/jin-yufeng/Parser
  10491. * @version 20201029
  10492. * @author JinYufeng
  10493. * @listens MIT
  10494. */
  10495. var blankChar = _config.default.blankChar;
  10496. var windowWidth = uni.getSystemInfoSync().windowWidth;
  10497. var emoji;
  10498. function MpHtmlParser(data) {
  10499. var _this = this;
  10500. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10501. this.attrs = {};
  10502. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  10503. this.data = data;
  10504. this.domain = options.domain;
  10505. this.DOM = [];
  10506. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  10507. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  10508. this.options = options;
  10509. this.state = this.Text;
  10510. this.STACK = [];
  10511. // 工具函数
  10512. this.bubble = function () {
  10513. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  10514. if (_config.default.richOnlyTags[item.name]) return false;
  10515. item.c = 1;
  10516. }
  10517. return true;
  10518. };
  10519. this.decode = function (val, amp) {
  10520. var i = -1,
  10521. j,
  10522. en;
  10523. while (1) {
  10524. if ((i = val.indexOf('&', i + 1)) == -1) break;
  10525. if ((j = val.indexOf(';', i + 2)) == -1) break;
  10526. if (val[i + 1] == '#') {
  10527. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  10528. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  10529. } else {
  10530. en = val.substring(i + 1, j);
  10531. if (_config.default.entities[en] || en == amp) val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  10532. }
  10533. }
  10534. return val;
  10535. };
  10536. this.getUrl = function (url) {
  10537. if (url[0] == '/') {
  10538. if (url[1] == '/') url = _this.options.prot + ':' + url;else if (_this.domain) url = _this.domain + url;
  10539. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://')) url = _this.domain + '/' + url;
  10540. return url;
  10541. };
  10542. this.isClose = function () {
  10543. return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';
  10544. };
  10545. this.section = function () {
  10546. return _this.data.substring(_this.start, _this.i);
  10547. };
  10548. this.parent = function () {
  10549. return _this.STACK[_this.STACK.length - 1];
  10550. };
  10551. this.siblings = function () {
  10552. return _this.STACK.length ? _this.parent().children : _this.DOM;
  10553. };
  10554. }
  10555. MpHtmlParser.prototype.parse = function () {
  10556. if (emoji) this.data = emoji.parseEmoji(this.data);
  10557. for (var c; c = this.data[this.i]; this.i++) {
  10558. this.state(c);
  10559. }
  10560. if (this.state == this.Text) this.setText();
  10561. while (this.STACK.length) {
  10562. this.popNode(this.STACK.pop());
  10563. }
  10564. return this.DOM;
  10565. };
  10566. // 设置属性
  10567. MpHtmlParser.prototype.setAttr = function () {
  10568. var name = this.attrName.toLowerCase(),
  10569. val = this.attrVal;
  10570. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else if (val) {
  10571. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  10572. }
  10573. this.attrVal = '';
  10574. while (blankChar[this.data[this.i]]) {
  10575. this.i++;
  10576. }
  10577. if (this.isClose()) this.setNode();else {
  10578. this.start = this.i;
  10579. this.state = this.AttrName;
  10580. }
  10581. };
  10582. // 设置文本节点
  10583. MpHtmlParser.prototype.setText = function () {
  10584. var back,
  10585. text = this.section();
  10586. if (!text) return;
  10587. text = _config.default.onText && _config.default.onText(text, function () {
  10588. return back = true;
  10589. }) || text;
  10590. if (back) {
  10591. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  10592. var j = this.start + text.length;
  10593. for (this.i = this.start; this.i < j; this.i++) {
  10594. this.state(this.data[this.i]);
  10595. }
  10596. return;
  10597. }
  10598. if (!this.pre) {
  10599. // 合并空白符
  10600. var flag,
  10601. tmp = [];
  10602. for (var i = text.length, c; c = text[--i];) {
  10603. if (!blankChar[c]) {
  10604. tmp.unshift(c);
  10605. if (!flag) flag = 1;
  10606. } else {
  10607. if (tmp[0] != ' ') tmp.unshift(' ');
  10608. if (c == '\n' && flag == void 0) flag = 0;
  10609. }
  10610. }
  10611. if (flag == 0) return;
  10612. text = tmp.join('');
  10613. }
  10614. this.siblings().push({
  10615. type: 'text',
  10616. text: this.decode(text)
  10617. });
  10618. };
  10619. // 设置元素节点
  10620. MpHtmlParser.prototype.setNode = function () {
  10621. var node = {
  10622. name: this.tagName.toLowerCase(),
  10623. attrs: this.attrs
  10624. },
  10625. close = _config.default.selfClosingTags[node.name];
  10626. if (this.options.nodes.length) node.type = 'node';
  10627. this.attrs = {};
  10628. if (!_config.default.ignoreTags[node.name]) {
  10629. // 处理属性
  10630. var attrs = node.attrs,
  10631. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  10632. styleObj = {};
  10633. if (attrs.id) {
  10634. if (this.options.compress & 1) attrs.id = void 0;else if (this.options.useAnchor) this.bubble();
  10635. }
  10636. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  10637. switch (node.name) {
  10638. case 'a':
  10639. case 'ad':
  10640. this.bubble();
  10641. break;
  10642. case 'font':
  10643. if (attrs.color) {
  10644. styleObj['color'] = attrs.color;
  10645. attrs.color = void 0;
  10646. }
  10647. if (attrs.face) {
  10648. styleObj['font-family'] = attrs.face;
  10649. attrs.face = void 0;
  10650. }
  10651. if (attrs.size) {
  10652. var size = parseInt(attrs.size);
  10653. if (size < 1) size = 1;else if (size > 7) size = 7;
  10654. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  10655. styleObj['font-size'] = map[size - 1];
  10656. attrs.size = void 0;
  10657. }
  10658. break;
  10659. case 'embed':
  10660. var src = node.attrs.src || '',
  10661. type = node.attrs.type || '';
  10662. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8')) node.name = 'video';else if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes('.aac')) node.name = 'audio';else break;
  10663. if (node.attrs.autostart) node.attrs.autoplay = 'T';
  10664. node.attrs.controls = 'T';
  10665. case 'video':
  10666. case 'audio':
  10667. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else this["".concat(node.name, "Num")]++;
  10668. if (node.name == 'video') {
  10669. if (this.videoNum > 3) node.lazyLoad = 1;
  10670. if (attrs.width) {
  10671. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  10672. attrs.width = void 0;
  10673. }
  10674. if (attrs.height) {
  10675. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  10676. attrs.height = void 0;
  10677. }
  10678. }
  10679. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  10680. attrs.source = [];
  10681. if (attrs.src) {
  10682. attrs.source.push(attrs.src);
  10683. attrs.src = void 0;
  10684. }
  10685. this.bubble();
  10686. break;
  10687. case 'td':
  10688. case 'th':
  10689. if (attrs.colspan || attrs.rowspan) for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  10690. if (item.name == 'table') {
  10691. item.flag = 1;
  10692. break;
  10693. }
  10694. }
  10695. }
  10696. if (attrs.align) {
  10697. if (node.name == 'table') {
  10698. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else styleObj['float'] = attrs.align;
  10699. } else styleObj['text-align'] = attrs.align;
  10700. attrs.align = void 0;
  10701. }
  10702. // 压缩 style
  10703. var styles = style.split(';');
  10704. style = '';
  10705. for (var i = 0, len = styles.length; i < len; i++) {
  10706. var info = styles[i].split(':');
  10707. if (info.length < 2) continue;
  10708. var _key = info[0].trim().toLowerCase(),
  10709. _value = info.slice(1).join(':').trim();
  10710. if (_value[0] == '-' || _value.includes('safe')) style += ";".concat(_key, ":").concat(_value);else if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import')) styleObj[_key] = _value;
  10711. }
  10712. if (node.name == 'img') {
  10713. if (attrs.src && !attrs.ignore) {
  10714. if (this.bubble()) attrs.i = (this.imgNum++).toString();else attrs.ignore = 'T';
  10715. }
  10716. if (attrs.ignore) {
  10717. style += ';-webkit-touch-callout:none';
  10718. styleObj['max-width'] = '100%';
  10719. }
  10720. var width;
  10721. if (styleObj.width) width = styleObj.width;else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  10722. if (width) {
  10723. styleObj.width = width;
  10724. attrs.width = '100%';
  10725. if (parseInt(width) > windowWidth) {
  10726. styleObj.height = '';
  10727. if (attrs.height) attrs.height = void 0;
  10728. }
  10729. }
  10730. if (styleObj.height) {
  10731. attrs.height = styleObj.height;
  10732. styleObj.height = '';
  10733. } else if (attrs.height && !attrs.height.includes('%')) attrs.height = parseFloat(attrs.height) + 'px';
  10734. }
  10735. for (var key in styleObj) {
  10736. var value = styleObj[key];
  10737. if (!value) continue;
  10738. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  10739. // 填充链接
  10740. if (value.includes('url')) {
  10741. var j = value.indexOf('(');
  10742. if (j++ != -1) {
  10743. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {
  10744. j++;
  10745. }
  10746. value = value.substr(0, j) + this.getUrl(value.substr(j));
  10747. }
  10748. }
  10749. // 转换 rpx
  10750. else if (value.includes('rpx')) value = value.replace(/[0-9.]+\s*rpx/g, function ($) {
  10751. return parseFloat($) * windowWidth / 750 + 'px';
  10752. });else if (key == 'white-space' && value.includes('pre') && !close) this.pre = node.pre = true;
  10753. style += ";".concat(key, ":").concat(value);
  10754. }
  10755. style = style.substr(1);
  10756. if (style) attrs.style = style;
  10757. if (!close) {
  10758. node.children = [];
  10759. if (node.name == 'pre' && _config.default.highlight) {
  10760. this.remove(node);
  10761. this.pre = node.pre = true;
  10762. }
  10763. this.siblings().push(node);
  10764. this.STACK.push(node);
  10765. } else if (!_config.default.filter || _config.default.filter(node, this) != false) this.siblings().push(node);
  10766. } else {
  10767. if (!close) this.remove(node);else if (node.name == 'source') {
  10768. var parent = this.parent();
  10769. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src) parent.attrs.source.push(node.attrs.src);
  10770. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  10771. }
  10772. if (this.data[this.i] == '/') this.i++;
  10773. this.start = this.i + 1;
  10774. this.state = this.Text;
  10775. };
  10776. // 移除标签
  10777. MpHtmlParser.prototype.remove = function (node) {
  10778. var _this2 = this;
  10779. var name = node.name,
  10780. j = this.i;
  10781. // 处理 svg
  10782. var handleSvg = function handleSvg() {
  10783. var src = _this2.data.substring(j, _this2.i + 1);
  10784. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  10785. for (var key in node.attrs) {
  10786. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  10787. }
  10788. src = '<svg' + src;
  10789. var parent = _this2.parent();
  10790. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline')) parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  10791. _this2.siblings().push({
  10792. name: 'img',
  10793. attrs: {
  10794. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  10795. style: node.attrs.style,
  10796. ignore: 'T'
  10797. }
  10798. });
  10799. };
  10800. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  10801. while (1) {
  10802. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  10803. if (name == 'pre' || name == 'svg') this.i = j;else this.i = this.data.length;
  10804. return;
  10805. }
  10806. this.start = this.i += 2;
  10807. while (!blankChar[this.data[this.i]] && !this.isClose()) {
  10808. this.i++;
  10809. }
  10810. if (this.section().toLowerCase() == name) {
  10811. // 代码块高亮
  10812. if (name == 'pre') {
  10813. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.substr(this.i - 5);
  10814. return this.i = j;
  10815. } else if (name == 'style') this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else if (name == 'title') this.DOM.title = this.data.substring(j + 1, this.i - 7);
  10816. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  10817. if (name == 'svg') handleSvg();
  10818. return;
  10819. }
  10820. }
  10821. };
  10822. // 节点出栈处理
  10823. MpHtmlParser.prototype.popNode = function (node) {
  10824. // 空白符处理
  10825. if (node.pre) {
  10826. node.pre = this.pre = void 0;
  10827. for (var i = this.STACK.length; i--;) {
  10828. if (this.STACK[i].pre) this.pre = true;
  10829. }
  10830. }
  10831. var siblings = this.siblings(),
  10832. len = siblings.length,
  10833. childs = node.children;
  10834. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false) return siblings.pop();
  10835. var attrs = node.attrs;
  10836. // 替换一些标签名
  10837. if (_config.default.blockTags[node.name]) node.name = 'div';else if (!_config.default.trustTags[node.name]) node.name = 'span';
  10838. // 处理列表
  10839. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  10840. if ((node.attrs.style || '').includes('list-style:none')) {
  10841. for (var _i = 0, child; child = childs[_i++];) {
  10842. if (child.name == 'li') child.name = 'div';
  10843. }
  10844. } else if (node.name == 'ul') {
  10845. var floor = 1;
  10846. for (var _i2 = this.STACK.length; _i2--;) {
  10847. if (this.STACK[_i2].name == 'ul') floor++;
  10848. }
  10849. if (floor != 1) for (var _i3 = childs.length; _i3--;) {
  10850. childs[_i3].floor = floor;
  10851. }
  10852. } else {
  10853. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  10854. if (_child.name == 'li') {
  10855. _child.type = 'ol';
  10856. _child.num = function (num, type) {
  10857. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  10858. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  10859. if (type == 'i' || type == 'I') {
  10860. num = (num - 1) % 99 + 1;
  10861. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  10862. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  10863. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  10864. if (type == 'i') return res.toLowerCase();
  10865. return res;
  10866. }
  10867. return num;
  10868. }(num++, attrs.type) + '.';
  10869. }
  10870. }
  10871. }
  10872. }
  10873. // 处理表格
  10874. if (node.name == 'table') {
  10875. var padding = parseFloat(attrs.cellpadding),
  10876. spacing = parseFloat(attrs.cellspacing),
  10877. border = parseFloat(attrs.border);
  10878. if (node.c) {
  10879. if (isNaN(padding)) padding = 2;
  10880. if (isNaN(spacing)) spacing = 2;
  10881. }
  10882. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  10883. if (node.flag && node.c) {
  10884. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  10885. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  10886. var row = 1,
  10887. col = 1,
  10888. colNum,
  10889. trs = [],
  10890. children = [],
  10891. map = {};
  10892. (function f(ns) {
  10893. for (var i = 0; i < ns.length; i++) {
  10894. if (ns[i].name == 'tr') trs.push(ns[i]);else f(ns[i].children || []);
  10895. }
  10896. })(node.children);
  10897. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  10898. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  10899. if (td.name == 'td' || td.name == 'th') {
  10900. while (map[row + '.' + col]) {
  10901. col++;
  10902. }
  10903. var cell = {
  10904. name: 'div',
  10905. c: 1,
  10906. attrs: {
  10907. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' : ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '')
  10908. },
  10909. children: td.children
  10910. };
  10911. if (td.attrs.colspan) {
  10912. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  10913. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  10914. col += parseInt(td.attrs.colspan) - 1;
  10915. }
  10916. if (td.attrs.rowspan) {
  10917. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  10918. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  10919. for (var k = 1; k < td.attrs.rowspan; k++) {
  10920. map[row + k + '.' + col] = 1;
  10921. }
  10922. }
  10923. children.push(cell);
  10924. col++;
  10925. }
  10926. }
  10927. if (!colNum) {
  10928. colNum = col - 1;
  10929. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  10930. }
  10931. col = 1;
  10932. row++;
  10933. }
  10934. node.children = children;
  10935. } else {
  10936. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  10937. if (border || padding) (function f(ns) {
  10938. for (var i = 0, n; n = ns[i]; i++) {
  10939. if (n.name == 'th' || n.name == 'td') {
  10940. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  10941. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  10942. } else f(n.children || []);
  10943. }
  10944. })(childs);
  10945. }
  10946. if (this.options.autoscroll) {
  10947. var table = Object.assign({}, node);
  10948. node.name = 'div';
  10949. node.attrs = {
  10950. style: 'overflow:scroll'
  10951. };
  10952. node.children = [table];
  10953. }
  10954. }
  10955. this.CssHandler.pop && this.CssHandler.pop(node);
  10956. // 自动压缩
  10957. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div') siblings[len - 1] = childs[0];
  10958. };
  10959. // 状态机
  10960. MpHtmlParser.prototype.Text = function (c) {
  10961. if (c == '<') {
  10962. var next = this.data[this.i + 1],
  10963. isLetter = function isLetter(c) {
  10964. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  10965. };
  10966. if (isLetter(next)) {
  10967. this.setText();
  10968. this.start = this.i + 1;
  10969. this.state = this.TagName;
  10970. } else if (next == '/') {
  10971. this.setText();
  10972. if (isLetter(this.data[++this.i + 1])) {
  10973. this.start = this.i + 1;
  10974. this.state = this.EndTag;
  10975. } else this.Comment();
  10976. } else if (next == '!' || next == '?') {
  10977. this.setText();
  10978. this.Comment();
  10979. }
  10980. }
  10981. };
  10982. MpHtmlParser.prototype.Comment = function () {
  10983. var key;
  10984. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else key = '>';
  10985. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else this.i += key.length - 1;
  10986. this.start = this.i + 1;
  10987. this.state = this.Text;
  10988. };
  10989. MpHtmlParser.prototype.TagName = function (c) {
  10990. if (blankChar[c]) {
  10991. this.tagName = this.section();
  10992. while (blankChar[this.data[this.i]]) {
  10993. this.i++;
  10994. }
  10995. if (this.isClose()) this.setNode();else {
  10996. this.start = this.i;
  10997. this.state = this.AttrName;
  10998. }
  10999. } else if (this.isClose()) {
  11000. this.tagName = this.section();
  11001. this.setNode();
  11002. }
  11003. };
  11004. MpHtmlParser.prototype.AttrName = function (c) {
  11005. if (c == '=' || blankChar[c] || this.isClose()) {
  11006. this.attrName = this.section();
  11007. if (blankChar[c]) while (blankChar[this.data[++this.i]]) {
  11008. ;
  11009. }
  11010. if (this.data[this.i] == '=') {
  11011. while (blankChar[this.data[++this.i]]) {
  11012. ;
  11013. }
  11014. this.start = this.i--;
  11015. this.state = this.AttrValue;
  11016. } else this.setAttr();
  11017. }
  11018. };
  11019. MpHtmlParser.prototype.AttrValue = function (c) {
  11020. if (c == '"' || c == "'") {
  11021. this.start++;
  11022. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  11023. this.attrVal = this.section();
  11024. this.i++;
  11025. } else {
  11026. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {
  11027. ;
  11028. }
  11029. this.attrVal = this.section();
  11030. }
  11031. this.setAttr();
  11032. };
  11033. MpHtmlParser.prototype.EndTag = function (c) {
  11034. if (blankChar[c] || c == '>' || c == '/') {
  11035. var name = this.section().toLowerCase();
  11036. for (var i = this.STACK.length; i--;) {
  11037. if (this.STACK[i].name == name) break;
  11038. }
  11039. if (i != -1) {
  11040. var node;
  11041. while ((node = this.STACK.pop()).name != name) {
  11042. this.popNode(node);
  11043. }
  11044. this.popNode(node);
  11045. } else if (name == 'p' || name == 'br') this.siblings().push({
  11046. name: name,
  11047. attrs: {}
  11048. });
  11049. this.i = this.data.indexOf('>', this.i);
  11050. this.start = this.i + 1;
  11051. if (this.i == -1) this.i = this.data.length;else this.state = this.Text;
  11052. }
  11053. };
  11054. var _default = MpHtmlParser;
  11055. exports.default = _default;
  11056. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11057. /***/ }),
  11058. /***/ 385:
  11059. /*!***************************************************************************************************!*\
  11060. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  11061. \***************************************************************************************************/
  11062. /*! no static exports found */
  11063. /***/ (function(module, exports, __webpack_require__) {
  11064. "use strict";
  11065. /* WEBPACK VAR INJECTION */(function(wx) {
  11066. Object.defineProperty(exports, "__esModule", {
  11067. value: true
  11068. });
  11069. exports.default = void 0;
  11070. /* 配置文件 */
  11071. var cfg = {
  11072. // 出错占位图
  11073. errorImg: null,
  11074. // 过滤器函数
  11075. filter: null,
  11076. // 代码高亮函数
  11077. highlight: null,
  11078. // 文本处理函数
  11079. onText: null,
  11080. // 实体编码列表
  11081. entities: {
  11082. quot: '"',
  11083. apos: "'",
  11084. semi: ';',
  11085. nbsp: '\xA0',
  11086. ensp: "\u2002",
  11087. emsp: "\u2003",
  11088. ndash: '–',
  11089. mdash: '—',
  11090. middot: '·',
  11091. lsquo: '‘',
  11092. rsquo: '’',
  11093. ldquo: '“',
  11094. rdquo: '”',
  11095. bull: '•',
  11096. hellip: '…'
  11097. },
  11098. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  11099. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  11100. // 块级标签,将被转为 div
  11101. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  11102. // 将被移除的标签
  11103. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  11104. // 只能被 rich-text 显示的标签
  11105. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  11106. // 自闭合的标签
  11107. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  11108. // 信任的标签
  11109. trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video'),
  11110. // 默认的标签样式
  11111. userAgentStyles: {
  11112. address: 'font-style:italic',
  11113. big: 'display:inline;font-size:1.2em',
  11114. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  11115. caption: 'display:table-caption;text-align:center',
  11116. center: 'text-align:center',
  11117. cite: 'font-style:italic',
  11118. dd: 'margin-left:40px',
  11119. mark: 'background-color:yellow',
  11120. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  11121. s: 'text-decoration:line-through',
  11122. small: 'display:inline;font-size:0.8em',
  11123. u: 'text-decoration:underline'
  11124. }
  11125. };
  11126. function makeMap(str) {
  11127. var map = Object.create(null),
  11128. list = str.split(',');
  11129. for (var i = list.length; i--;) {
  11130. map[list[i]] = true;
  11131. }
  11132. return map;
  11133. }
  11134. if (wx.canIUse('editor')) {
  11135. cfg.blockTags.pre = void 0;
  11136. cfg.ignoreTags.rp = true;
  11137. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  11138. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  11139. }
  11140. var _default = cfg;
  11141. exports.default = _default;
  11142. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  11143. /***/ }),
  11144. /***/ 386:
  11145. /*!*******************************************************************************************************!*\
  11146. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  11147. \*******************************************************************************************************/
  11148. /*! no static exports found */
  11149. /***/ (function(module, exports, __webpack_require__) {
  11150. "use strict";
  11151. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11152. Object.defineProperty(exports, "__esModule", {
  11153. value: true
  11154. });
  11155. exports.default = void 0;
  11156. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 385));
  11157. var isLetter = function isLetter(c) {
  11158. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  11159. };
  11160. function CssHandler(tagStyle) {
  11161. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  11162. for (var item in tagStyle) {
  11163. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
  11164. }
  11165. this.styles = styles;
  11166. }
  11167. CssHandler.prototype.getStyle = function (data) {
  11168. this.styles = new parser(data, this.styles).parse();
  11169. };
  11170. CssHandler.prototype.match = function (name, attrs) {
  11171. var tmp,
  11172. matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  11173. if (attrs.class) {
  11174. var items = attrs.class.split(' ');
  11175. for (var i = 0, item; item = items[i]; i++) {
  11176. if (tmp = this.styles['.' + item]) matched += tmp + ';';
  11177. }
  11178. }
  11179. if (tmp = this.styles['#' + attrs.id]) matched += tmp + ';';
  11180. return matched;
  11181. };
  11182. var _default = CssHandler;
  11183. exports.default = _default;
  11184. function parser(data, init) {
  11185. this.data = data;
  11186. this.floor = 0;
  11187. this.i = 0;
  11188. this.list = [];
  11189. this.res = init;
  11190. this.state = this.Space;
  11191. }
  11192. parser.prototype.parse = function () {
  11193. for (var c; c = this.data[this.i]; this.i++) {
  11194. this.state(c);
  11195. }
  11196. return this.res;
  11197. };
  11198. parser.prototype.section = function () {
  11199. return this.data.substring(this.start, this.i);
  11200. };
  11201. // 状态机
  11202. parser.prototype.Space = function (c) {
  11203. if (c == '.' || c == '#' || isLetter(c)) {
  11204. this.start = this.i;
  11205. this.state = this.Name;
  11206. } else if (c == '/' && this.data[this.i + 1] == '*') this.Comment();else if (!_config.default.blankChar[c] && c != ';') this.state = this.Ignore;
  11207. };
  11208. parser.prototype.Comment = function () {
  11209. this.i = this.data.indexOf('*/', this.i) + 1;
  11210. if (!this.i) this.i = this.data.length;
  11211. this.state = this.Space;
  11212. };
  11213. parser.prototype.Ignore = function (c) {
  11214. if (c == '{') this.floor++;else if (c == '}' && ! --this.floor) {
  11215. this.list = [];
  11216. this.state = this.Space;
  11217. }
  11218. };
  11219. parser.prototype.Name = function (c) {
  11220. if (_config.default.blankChar[c]) {
  11221. this.list.push(this.section());
  11222. this.state = this.NameSpace;
  11223. } else if (c == '{') {
  11224. this.list.push(this.section());
  11225. this.Content();
  11226. } else if (c == ',') {
  11227. this.list.push(this.section());
  11228. this.Comma();
  11229. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_') this.state = this.Ignore;
  11230. };
  11231. parser.prototype.NameSpace = function (c) {
  11232. if (c == '{') this.Content();else if (c == ',') this.Comma();else if (!_config.default.blankChar[c]) this.state = this.Ignore;
  11233. };
  11234. parser.prototype.Comma = function () {
  11235. while (_config.default.blankChar[this.data[++this.i]]) {
  11236. ;
  11237. }
  11238. if (this.data[this.i] == '{') this.Content();else {
  11239. this.start = this.i--;
  11240. this.state = this.Name;
  11241. }
  11242. };
  11243. parser.prototype.Content = function () {
  11244. this.start = ++this.i;
  11245. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  11246. var content = this.section();
  11247. for (var i = 0, item; item = this.list[i++];) {
  11248. if (this.res[item]) this.res[item] += ';' + content;else this.res[item] = content;
  11249. }
  11250. this.list = [];
  11251. this.state = this.Space;
  11252. };
  11253. /***/ }),
  11254. /***/ 39:
  11255. /*!**********************************************************************************************!*\
  11256. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  11257. \**********************************************************************************************/
  11258. /*! no static exports found */
  11259. /***/ (function(module, exports, __webpack_require__) {
  11260. "use strict";
  11261. Object.defineProperty(exports, "__esModule", {
  11262. value: true
  11263. });
  11264. exports.default = void 0;
  11265. /**
  11266. * 对象转url参数
  11267. * @param {*} data,对象
  11268. * @param {*} isPrefix,是否自动加上"?"
  11269. */
  11270. function queryParams() {
  11271. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11272. var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11273. var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  11274. var prefix = isPrefix ? '?' : '';
  11275. var _result = [];
  11276. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
  11277. var _loop = function _loop(key) {
  11278. var value = data[key];
  11279. // 去掉为空的参数
  11280. if (['', undefined, null].indexOf(value) >= 0) {
  11281. return "continue";
  11282. }
  11283. // 如果值为数组,另行处理
  11284. if (value.constructor === Array) {
  11285. // e.g. {ids: [1, 2, 3]}
  11286. switch (arrayFormat) {
  11287. case 'indices':
  11288. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  11289. for (var i = 0; i < value.length; i++) {
  11290. _result.push(key + '[' + i + ']=' + value[i]);
  11291. }
  11292. break;
  11293. case 'brackets':
  11294. // 结果: ids[]=1&ids[]=2&ids[]=3
  11295. value.forEach(function (_value) {
  11296. _result.push(key + '[]=' + _value);
  11297. });
  11298. break;
  11299. case 'repeat':
  11300. // 结果: ids=1&ids=2&ids=3
  11301. value.forEach(function (_value) {
  11302. _result.push(key + '=' + _value);
  11303. });
  11304. break;
  11305. case 'comma':
  11306. // 结果: ids=1,2,3
  11307. var commaStr = "";
  11308. value.forEach(function (_value) {
  11309. commaStr += (commaStr ? "," : "") + _value;
  11310. });
  11311. _result.push(key + '=' + commaStr);
  11312. break;
  11313. default:
  11314. value.forEach(function (_value) {
  11315. _result.push(key + '[]=' + _value);
  11316. });
  11317. }
  11318. } else {
  11319. _result.push(key + '=' + value);
  11320. }
  11321. };
  11322. for (var key in data) {
  11323. var _ret = _loop(key);
  11324. if (_ret === "continue") continue;
  11325. }
  11326. return _result.length ? prefix + _result.join('&') : '';
  11327. }
  11328. var _default = queryParams;
  11329. exports.default = _default;
  11330. /***/ }),
  11331. /***/ 4:
  11332. /*!**********************************************************************!*\
  11333. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  11334. \**********************************************************************/
  11335. /*! no static exports found */
  11336. /***/ (function(module, exports) {
  11337. function _interopRequireDefault(obj) {
  11338. return obj && obj.__esModule ? obj : {
  11339. "default": obj
  11340. };
  11341. }
  11342. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11343. /***/ }),
  11344. /***/ 40:
  11345. /*!****************************************************************************************!*\
  11346. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  11347. \****************************************************************************************/
  11348. /*! no static exports found */
  11349. /***/ (function(module, exports, __webpack_require__) {
  11350. "use strict";
  11351. /* WEBPACK VAR INJECTION */(function(uni) {
  11352. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11353. Object.defineProperty(exports, "__esModule", {
  11354. value: true
  11355. });
  11356. exports.default = void 0;
  11357. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  11358. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  11359. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11360. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11361. /**
  11362. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  11363. * 并且带有路由拦截功能
  11364. */
  11365. var Router = /*#__PURE__*/function () {
  11366. function Router() {
  11367. (0, _classCallCheck2.default)(this, Router);
  11368. // 原始属性定义
  11369. this.config = {
  11370. type: 'navigateTo',
  11371. url: '',
  11372. delta: 1,
  11373. // navigateBack页面后退时,回退的层数
  11374. params: {},
  11375. // 传递的参数
  11376. animationType: 'pop-in',
  11377. // 窗口动画,只在APP有效
  11378. animationDuration: 300,
  11379. // 窗口动画持续时间,单位毫秒,只在APP有效
  11380. intercept: false // 是否需要拦截
  11381. };
  11382. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  11383. // 这里在构造函数中进行this绑定
  11384. this.route = this.route.bind(this);
  11385. }
  11386. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  11387. (0, _createClass2.default)(Router, [{
  11388. key: "addRootPath",
  11389. value: function addRootPath(url) {
  11390. return url[0] === '/' ? url : "/".concat(url);
  11391. }
  11392. // 整合路由参数
  11393. }, {
  11394. key: "mixinParam",
  11395. value: function mixinParam(url, params) {
  11396. url = url && this.addRootPath(url);
  11397. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  11398. // 如果有url中有get参数,转换后无需带上"?"
  11399. var query = '';
  11400. if (/.*\/.*\?.*=.*/.test(url)) {
  11401. // object对象转为get类型的参数
  11402. query = uni.$u.queryParams(params, false);
  11403. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  11404. return url += "&" + query;
  11405. } else {
  11406. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  11407. query = uni.$u.queryParams(params);
  11408. return url += query;
  11409. }
  11410. }
  11411. // 对外的方法名称
  11412. }, {
  11413. key: "route",
  11414. value: function () {
  11415. var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  11416. var options,
  11417. params,
  11418. mergeConfig,
  11419. isNext,
  11420. _args = arguments;
  11421. return _regenerator.default.wrap(function _callee$(_context) {
  11422. while (1) {
  11423. switch (_context.prev = _context.next) {
  11424. case 0:
  11425. options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
  11426. params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  11427. // 合并用户的配置和内部的默认配置
  11428. mergeConfig = {};
  11429. if (typeof options === 'string') {
  11430. // 如果options为字符串,则为route(url, params)的形式
  11431. mergeConfig.url = this.mixinParam(options, params);
  11432. mergeConfig.type = 'navigateTo';
  11433. } else {
  11434. mergeConfig = uni.$u.deepClone(options, this.config);
  11435. // 否则正常使用mergeConfig中的url和params进行拼接
  11436. mergeConfig.url = this.mixinParam(options.url, options.params);
  11437. }
  11438. if (params.intercept) {
  11439. this.config.intercept = params.intercept;
  11440. }
  11441. // params参数也带给拦截器
  11442. mergeConfig.params = params;
  11443. // 合并内外部参数
  11444. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  11445. // 判断用户是否定义了拦截器
  11446. if (!(typeof uni.$u.routeIntercept === 'function')) {
  11447. _context.next = 14;
  11448. break;
  11449. }
  11450. _context.next = 10;
  11451. return new Promise(function (resolve, reject) {
  11452. uni.$u.routeIntercept(mergeConfig, resolve);
  11453. });
  11454. case 10:
  11455. isNext = _context.sent;
  11456. // 如果isNext为true,则执行路由跳转
  11457. isNext && this.openPage(mergeConfig);
  11458. _context.next = 15;
  11459. break;
  11460. case 14:
  11461. this.openPage(mergeConfig);
  11462. case 15:
  11463. case "end":
  11464. return _context.stop();
  11465. }
  11466. }
  11467. }, _callee, this);
  11468. }));
  11469. function route() {
  11470. return _route.apply(this, arguments);
  11471. }
  11472. return route;
  11473. }() // 执行路由跳转
  11474. }, {
  11475. key: "openPage",
  11476. value: function openPage(config) {
  11477. // 解构参数
  11478. var url = config.url,
  11479. type = config.type,
  11480. delta = config.delta,
  11481. animationType = config.animationType,
  11482. animationDuration = config.animationDuration;
  11483. if (config.type == 'navigateTo' || config.type == 'to') {
  11484. uni.navigateTo({
  11485. url: url,
  11486. animationType: animationType,
  11487. animationDuration: animationDuration
  11488. });
  11489. }
  11490. if (config.type == 'redirectTo' || config.type == 'redirect') {
  11491. uni.redirectTo({
  11492. url: url
  11493. });
  11494. }
  11495. if (config.type == 'switchTab' || config.type == 'tab') {
  11496. uni.switchTab({
  11497. url: url
  11498. });
  11499. }
  11500. if (config.type == 'reLaunch' || config.type == 'launch') {
  11501. uni.reLaunch({
  11502. url: url
  11503. });
  11504. }
  11505. if (config.type == 'navigateBack' || config.type == 'back') {
  11506. uni.navigateBack({
  11507. delta: delta
  11508. });
  11509. }
  11510. }
  11511. }]);
  11512. return Router;
  11513. }();
  11514. var _default = new Router().route;
  11515. exports.default = _default;
  11516. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11517. /***/ }),
  11518. /***/ 41:
  11519. /*!************************************************************************************************!*\
  11520. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  11521. \************************************************************************************************/
  11522. /*! no static exports found */
  11523. /***/ (function(module, exports, __webpack_require__) {
  11524. // TODO(Babel 8): Remove this file.
  11525. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 42)();
  11526. module.exports = runtime;
  11527. /***/ }),
  11528. /***/ 42:
  11529. /*!*******************************************************************!*\
  11530. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  11531. \*******************************************************************/
  11532. /*! no static exports found */
  11533. /***/ (function(module, exports, __webpack_require__) {
  11534. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  11535. function _regeneratorRuntime() {
  11536. "use strict";
  11537. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  11538. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  11539. return exports;
  11540. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11541. var exports = {},
  11542. Op = Object.prototype,
  11543. hasOwn = Op.hasOwnProperty,
  11544. defineProperty = Object.defineProperty || function (obj, key, desc) {
  11545. obj[key] = desc.value;
  11546. },
  11547. $Symbol = "function" == typeof Symbol ? Symbol : {},
  11548. iteratorSymbol = $Symbol.iterator || "@@iterator",
  11549. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  11550. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  11551. function define(obj, key, value) {
  11552. return Object.defineProperty(obj, key, {
  11553. value: value,
  11554. enumerable: !0,
  11555. configurable: !0,
  11556. writable: !0
  11557. }), obj[key];
  11558. }
  11559. try {
  11560. define({}, "");
  11561. } catch (err) {
  11562. define = function define(obj, key, value) {
  11563. return obj[key] = value;
  11564. };
  11565. }
  11566. function wrap(innerFn, outerFn, self, tryLocsList) {
  11567. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  11568. generator = Object.create(protoGenerator.prototype),
  11569. context = new Context(tryLocsList || []);
  11570. return defineProperty(generator, "_invoke", {
  11571. value: makeInvokeMethod(innerFn, self, context)
  11572. }), generator;
  11573. }
  11574. function tryCatch(fn, obj, arg) {
  11575. try {
  11576. return {
  11577. type: "normal",
  11578. arg: fn.call(obj, arg)
  11579. };
  11580. } catch (err) {
  11581. return {
  11582. type: "throw",
  11583. arg: err
  11584. };
  11585. }
  11586. }
  11587. exports.wrap = wrap;
  11588. var ContinueSentinel = {};
  11589. function Generator() {}
  11590. function GeneratorFunction() {}
  11591. function GeneratorFunctionPrototype() {}
  11592. var IteratorPrototype = {};
  11593. define(IteratorPrototype, iteratorSymbol, function () {
  11594. return this;
  11595. });
  11596. var getProto = Object.getPrototypeOf,
  11597. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  11598. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  11599. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  11600. function defineIteratorMethods(prototype) {
  11601. ["next", "throw", "return"].forEach(function (method) {
  11602. define(prototype, method, function (arg) {
  11603. return this._invoke(method, arg);
  11604. });
  11605. });
  11606. }
  11607. function AsyncIterator(generator, PromiseImpl) {
  11608. function invoke(method, arg, resolve, reject) {
  11609. var record = tryCatch(generator[method], generator, arg);
  11610. if ("throw" !== record.type) {
  11611. var result = record.arg,
  11612. value = result.value;
  11613. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  11614. invoke("next", value, resolve, reject);
  11615. }, function (err) {
  11616. invoke("throw", err, resolve, reject);
  11617. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  11618. result.value = unwrapped, resolve(result);
  11619. }, function (error) {
  11620. return invoke("throw", error, resolve, reject);
  11621. });
  11622. }
  11623. reject(record.arg);
  11624. }
  11625. var previousPromise;
  11626. defineProperty(this, "_invoke", {
  11627. value: function value(method, arg) {
  11628. function callInvokeWithMethodAndArg() {
  11629. return new PromiseImpl(function (resolve, reject) {
  11630. invoke(method, arg, resolve, reject);
  11631. });
  11632. }
  11633. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  11634. }
  11635. });
  11636. }
  11637. function makeInvokeMethod(innerFn, self, context) {
  11638. var state = "suspendedStart";
  11639. return function (method, arg) {
  11640. if ("executing" === state) throw new Error("Generator is already running");
  11641. if ("completed" === state) {
  11642. if ("throw" === method) throw arg;
  11643. return doneResult();
  11644. }
  11645. for (context.method = method, context.arg = arg;;) {
  11646. var delegate = context.delegate;
  11647. if (delegate) {
  11648. var delegateResult = maybeInvokeDelegate(delegate, context);
  11649. if (delegateResult) {
  11650. if (delegateResult === ContinueSentinel) continue;
  11651. return delegateResult;
  11652. }
  11653. }
  11654. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  11655. if ("suspendedStart" === state) throw state = "completed", context.arg;
  11656. context.dispatchException(context.arg);
  11657. } else "return" === context.method && context.abrupt("return", context.arg);
  11658. state = "executing";
  11659. var record = tryCatch(innerFn, self, context);
  11660. if ("normal" === record.type) {
  11661. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  11662. return {
  11663. value: record.arg,
  11664. done: context.done
  11665. };
  11666. }
  11667. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  11668. }
  11669. };
  11670. }
  11671. function maybeInvokeDelegate(delegate, context) {
  11672. var methodName = context.method,
  11673. method = delegate.iterator[methodName];
  11674. 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;
  11675. var record = tryCatch(method, delegate.iterator, context.arg);
  11676. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  11677. var info = record.arg;
  11678. 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);
  11679. }
  11680. function pushTryEntry(locs) {
  11681. var entry = {
  11682. tryLoc: locs[0]
  11683. };
  11684. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  11685. }
  11686. function resetTryEntry(entry) {
  11687. var record = entry.completion || {};
  11688. record.type = "normal", delete record.arg, entry.completion = record;
  11689. }
  11690. function Context(tryLocsList) {
  11691. this.tryEntries = [{
  11692. tryLoc: "root"
  11693. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  11694. }
  11695. function values(iterable) {
  11696. if (iterable) {
  11697. var iteratorMethod = iterable[iteratorSymbol];
  11698. if (iteratorMethod) return iteratorMethod.call(iterable);
  11699. if ("function" == typeof iterable.next) return iterable;
  11700. if (!isNaN(iterable.length)) {
  11701. var i = -1,
  11702. next = function next() {
  11703. for (; ++i < iterable.length;) {
  11704. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  11705. }
  11706. return next.value = undefined, next.done = !0, next;
  11707. };
  11708. return next.next = next;
  11709. }
  11710. }
  11711. return {
  11712. next: doneResult
  11713. };
  11714. }
  11715. function doneResult() {
  11716. return {
  11717. value: undefined,
  11718. done: !0
  11719. };
  11720. }
  11721. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  11722. value: GeneratorFunctionPrototype,
  11723. configurable: !0
  11724. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  11725. value: GeneratorFunction,
  11726. configurable: !0
  11727. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  11728. var ctor = "function" == typeof genFun && genFun.constructor;
  11729. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  11730. }, exports.mark = function (genFun) {
  11731. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  11732. }, exports.awrap = function (arg) {
  11733. return {
  11734. __await: arg
  11735. };
  11736. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  11737. return this;
  11738. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  11739. void 0 === PromiseImpl && (PromiseImpl = Promise);
  11740. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  11741. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  11742. return result.done ? result.value : iter.next();
  11743. });
  11744. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  11745. return this;
  11746. }), define(Gp, "toString", function () {
  11747. return "[object Generator]";
  11748. }), exports.keys = function (val) {
  11749. var object = Object(val),
  11750. keys = [];
  11751. for (var key in object) {
  11752. keys.push(key);
  11753. }
  11754. return keys.reverse(), function next() {
  11755. for (; keys.length;) {
  11756. var key = keys.pop();
  11757. if (key in object) return next.value = key, next.done = !1, next;
  11758. }
  11759. return next.done = !0, next;
  11760. };
  11761. }, exports.values = values, Context.prototype = {
  11762. constructor: Context,
  11763. reset: function reset(skipTempReset) {
  11764. 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) {
  11765. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  11766. }
  11767. },
  11768. stop: function stop() {
  11769. this.done = !0;
  11770. var rootRecord = this.tryEntries[0].completion;
  11771. if ("throw" === rootRecord.type) throw rootRecord.arg;
  11772. return this.rval;
  11773. },
  11774. dispatchException: function dispatchException(exception) {
  11775. if (this.done) throw exception;
  11776. var context = this;
  11777. function handle(loc, caught) {
  11778. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  11779. }
  11780. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11781. var entry = this.tryEntries[i],
  11782. record = entry.completion;
  11783. if ("root" === entry.tryLoc) return handle("end");
  11784. if (entry.tryLoc <= this.prev) {
  11785. var hasCatch = hasOwn.call(entry, "catchLoc"),
  11786. hasFinally = hasOwn.call(entry, "finallyLoc");
  11787. if (hasCatch && hasFinally) {
  11788. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11789. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11790. } else if (hasCatch) {
  11791. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11792. } else {
  11793. if (!hasFinally) throw new Error("try statement without catch or finally");
  11794. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11795. }
  11796. }
  11797. }
  11798. },
  11799. abrupt: function abrupt(type, arg) {
  11800. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11801. var entry = this.tryEntries[i];
  11802. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  11803. var finallyEntry = entry;
  11804. break;
  11805. }
  11806. }
  11807. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  11808. var record = finallyEntry ? finallyEntry.completion : {};
  11809. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  11810. },
  11811. complete: function complete(record, afterLoc) {
  11812. if ("throw" === record.type) throw record.arg;
  11813. 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;
  11814. },
  11815. finish: function finish(finallyLoc) {
  11816. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11817. var entry = this.tryEntries[i];
  11818. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  11819. }
  11820. },
  11821. "catch": function _catch(tryLoc) {
  11822. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11823. var entry = this.tryEntries[i];
  11824. if (entry.tryLoc === tryLoc) {
  11825. var record = entry.completion;
  11826. if ("throw" === record.type) {
  11827. var thrown = record.arg;
  11828. resetTryEntry(entry);
  11829. }
  11830. return thrown;
  11831. }
  11832. }
  11833. throw new Error("illegal catch attempt");
  11834. },
  11835. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  11836. return this.delegate = {
  11837. iterator: values(iterable),
  11838. resultName: resultName,
  11839. nextLoc: nextLoc
  11840. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  11841. }
  11842. }, exports;
  11843. }
  11844. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11845. /***/ }),
  11846. /***/ 422:
  11847. /*!**************************************************************************************!*\
  11848. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  11849. \**************************************************************************************/
  11850. /*! no static exports found */
  11851. /***/ (function(module, exports, __webpack_require__) {
  11852. "use strict";
  11853. Object.defineProperty(exports, "__esModule", {
  11854. value: true
  11855. });
  11856. exports.default = void 0;
  11857. /**
  11858. * 递归使用 call 方式this指向
  11859. * @param componentName // 需要找的组件的名称
  11860. * @param eventName // 事件名称
  11861. * @param params // 需要传递的参数
  11862. */
  11863. function _broadcast(componentName, eventName, params) {
  11864. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  11865. var $children;
  11866. $children = this.$children;
  11867. $children.map(function (child) {
  11868. if (componentName === child.$options.name) {
  11869. child.$emit.apply(child, [eventName].concat(params));
  11870. } else {
  11871. _broadcast.apply(child, [componentName, eventName].concat(params));
  11872. }
  11873. });
  11874. }
  11875. var _default = {
  11876. methods: {
  11877. /**
  11878. * 派发 (向上查找) (一个)
  11879. * @param componentName // 需要找的组件的名称
  11880. * @param eventName // 事件名称
  11881. * @param params // 需要传递的参数
  11882. */
  11883. dispatch: function dispatch(componentName, eventName, params) {
  11884. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  11885. var name = parent.$options.name; // 获取当前组件实例的name
  11886. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  11887. // 循环出当前名称的一样的组件实例
  11888. while (parent && (!name || name !== componentName)) {
  11889. parent = parent.$parent;
  11890. if (parent) {
  11891. name = parent.$options.name;
  11892. }
  11893. }
  11894. // 有节点表示当前找到了name一样的实例
  11895. if (parent) {
  11896. parent.$emit.apply(parent, [eventName].concat(params));
  11897. }
  11898. },
  11899. /**
  11900. * 广播 (向下查找) (广播多个)
  11901. * @param componentName // 需要找的组件的名称
  11902. * @param eventName // 事件名称
  11903. * @param params // 需要传递的参数
  11904. */
  11905. broadcast: function broadcast(componentName, eventName, params) {
  11906. _broadcast.call(this, componentName, eventName, params);
  11907. }
  11908. }
  11909. };
  11910. exports.default = _default;
  11911. /***/ }),
  11912. /***/ 423:
  11913. /*!**********************************************************************************************!*\
  11914. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  11915. \**********************************************************************************************/
  11916. /*! no static exports found */
  11917. /***/ (function(module, exports, __webpack_require__) {
  11918. "use strict";
  11919. /* WEBPACK VAR INJECTION */(function(process) {
  11920. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11921. Object.defineProperty(exports, "__esModule", {
  11922. value: true
  11923. });
  11924. exports.default = void 0;
  11925. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11926. function _extends() {
  11927. _extends = Object.assign || function (target) {
  11928. for (var i = 1; i < arguments.length; i++) {
  11929. var source = arguments[i];
  11930. for (var key in source) {
  11931. if (Object.prototype.hasOwnProperty.call(source, key)) {
  11932. target[key] = source[key];
  11933. }
  11934. }
  11935. }
  11936. return target;
  11937. };
  11938. return _extends.apply(this, arguments);
  11939. }
  11940. /* eslint no-console:0 */
  11941. var formatRegExp = /%[sdj%]/g;
  11942. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  11943. if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
  11944. warning = function warning(type, errors) {
  11945. if (typeof console !== 'undefined' && console.warn) {
  11946. if (errors.every(function (e) {
  11947. return typeof e === 'string';
  11948. })) {
  11949. console.warn(type, errors);
  11950. }
  11951. }
  11952. };
  11953. }
  11954. function convertFieldsError(errors) {
  11955. if (!errors || !errors.length) return null;
  11956. var fields = {};
  11957. errors.forEach(function (error) {
  11958. var field = error.field;
  11959. fields[field] = fields[field] || [];
  11960. fields[field].push(error);
  11961. });
  11962. return fields;
  11963. }
  11964. function format() {
  11965. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  11966. args[_key] = arguments[_key];
  11967. }
  11968. var i = 1;
  11969. var f = args[0];
  11970. var len = args.length;
  11971. if (typeof f === 'function') {
  11972. return f.apply(null, args.slice(1));
  11973. }
  11974. if (typeof f === 'string') {
  11975. var str = String(f).replace(formatRegExp, function (x) {
  11976. if (x === '%%') {
  11977. return '%';
  11978. }
  11979. if (i >= len) {
  11980. return x;
  11981. }
  11982. switch (x) {
  11983. case '%s':
  11984. return String(args[i++]);
  11985. case '%d':
  11986. return Number(args[i++]);
  11987. case '%j':
  11988. try {
  11989. return JSON.stringify(args[i++]);
  11990. } catch (_) {
  11991. return '[Circular]';
  11992. }
  11993. break;
  11994. default:
  11995. return x;
  11996. }
  11997. });
  11998. for (var arg = args[i]; i < len; arg = args[++i]) {
  11999. str += " " + arg;
  12000. }
  12001. return str;
  12002. }
  12003. return f;
  12004. }
  12005. function isNativeStringType(type) {
  12006. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  12007. }
  12008. function isEmptyValue(value, type) {
  12009. if (value === undefined || value === null) {
  12010. return true;
  12011. }
  12012. if (type === 'array' && Array.isArray(value) && !value.length) {
  12013. return true;
  12014. }
  12015. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  12016. return true;
  12017. }
  12018. return false;
  12019. }
  12020. function asyncParallelArray(arr, func, callback) {
  12021. var results = [];
  12022. var total = 0;
  12023. var arrLength = arr.length;
  12024. function count(errors) {
  12025. results.push.apply(results, errors);
  12026. total++;
  12027. if (total === arrLength) {
  12028. callback(results);
  12029. }
  12030. }
  12031. arr.forEach(function (a) {
  12032. func(a, count);
  12033. });
  12034. }
  12035. function asyncSerialArray(arr, func, callback) {
  12036. var index = 0;
  12037. var arrLength = arr.length;
  12038. function next(errors) {
  12039. if (errors && errors.length) {
  12040. callback(errors);
  12041. return;
  12042. }
  12043. var original = index;
  12044. index = index + 1;
  12045. if (original < arrLength) {
  12046. func(arr[original], next);
  12047. } else {
  12048. callback([]);
  12049. }
  12050. }
  12051. next([]);
  12052. }
  12053. function flattenObjArr(objArr) {
  12054. var ret = [];
  12055. Object.keys(objArr).forEach(function (k) {
  12056. ret.push.apply(ret, objArr[k]);
  12057. });
  12058. return ret;
  12059. }
  12060. function asyncMap(objArr, option, func, callback) {
  12061. if (option.first) {
  12062. var _pending = new Promise(function (resolve, reject) {
  12063. var next = function next(errors) {
  12064. callback(errors);
  12065. return errors.length ? reject({
  12066. errors: errors,
  12067. fields: convertFieldsError(errors)
  12068. }) : resolve();
  12069. };
  12070. var flattenArr = flattenObjArr(objArr);
  12071. asyncSerialArray(flattenArr, func, next);
  12072. });
  12073. _pending["catch"](function (e) {
  12074. return e;
  12075. });
  12076. return _pending;
  12077. }
  12078. var firstFields = option.firstFields || [];
  12079. if (firstFields === true) {
  12080. firstFields = Object.keys(objArr);
  12081. }
  12082. var objArrKeys = Object.keys(objArr);
  12083. var objArrLength = objArrKeys.length;
  12084. var total = 0;
  12085. var results = [];
  12086. var pending = new Promise(function (resolve, reject) {
  12087. var next = function next(errors) {
  12088. results.push.apply(results, errors);
  12089. total++;
  12090. if (total === objArrLength) {
  12091. callback(results);
  12092. return results.length ? reject({
  12093. errors: results,
  12094. fields: convertFieldsError(results)
  12095. }) : resolve();
  12096. }
  12097. };
  12098. if (!objArrKeys.length) {
  12099. callback(results);
  12100. resolve();
  12101. }
  12102. objArrKeys.forEach(function (key) {
  12103. var arr = objArr[key];
  12104. if (firstFields.indexOf(key) !== -1) {
  12105. asyncSerialArray(arr, func, next);
  12106. } else {
  12107. asyncParallelArray(arr, func, next);
  12108. }
  12109. });
  12110. });
  12111. pending["catch"](function (e) {
  12112. return e;
  12113. });
  12114. return pending;
  12115. }
  12116. function complementError(rule) {
  12117. return function (oe) {
  12118. if (oe && oe.message) {
  12119. oe.field = oe.field || rule.fullField;
  12120. return oe;
  12121. }
  12122. return {
  12123. message: typeof oe === 'function' ? oe() : oe,
  12124. field: oe.field || rule.fullField
  12125. };
  12126. };
  12127. }
  12128. function deepMerge(target, source) {
  12129. if (source) {
  12130. for (var s in source) {
  12131. if (source.hasOwnProperty(s)) {
  12132. var value = source[s];
  12133. if ((0, _typeof2.default)(value) === 'object' && (0, _typeof2.default)(target[s]) === 'object') {
  12134. target[s] = _extends({}, target[s], {}, value);
  12135. } else {
  12136. target[s] = value;
  12137. }
  12138. }
  12139. }
  12140. }
  12141. return target;
  12142. }
  12143. /**
  12144. * Rule for validating required fields.
  12145. *
  12146. * @param rule The validation rule.
  12147. * @param value The value of the field on the source object.
  12148. * @param source The source object being validated.
  12149. * @param errors An array of errors that this rule may add
  12150. * validation errors to.
  12151. * @param options The validation options.
  12152. * @param options.messages The validation messages.
  12153. */
  12154. function required(rule, value, source, errors, options, type) {
  12155. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  12156. errors.push(format(options.messages.required, rule.fullField));
  12157. }
  12158. }
  12159. /**
  12160. * Rule for validating whitespace.
  12161. *
  12162. * @param rule The validation rule.
  12163. * @param value The value of the field on the source object.
  12164. * @param source The source object being validated.
  12165. * @param errors An array of errors that this rule may add
  12166. * validation errors to.
  12167. * @param options The validation options.
  12168. * @param options.messages The validation messages.
  12169. */
  12170. function whitespace(rule, value, source, errors, options) {
  12171. if (/^\s+$/.test(value) || value === '') {
  12172. errors.push(format(options.messages.whitespace, rule.fullField));
  12173. }
  12174. }
  12175. /* eslint max-len:0 */
  12176. var pattern = {
  12177. // http://emailregex.com/
  12178. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
  12179. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i'),
  12180. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  12181. };
  12182. var types = {
  12183. integer: function integer(value) {
  12184. return types.number(value) && parseInt(value, 10) === value;
  12185. },
  12186. "float": function float(value) {
  12187. return types.number(value) && !types.integer(value);
  12188. },
  12189. array: function array(value) {
  12190. return Array.isArray(value);
  12191. },
  12192. regexp: function regexp(value) {
  12193. if (value instanceof RegExp) {
  12194. return true;
  12195. }
  12196. try {
  12197. return !!new RegExp(value);
  12198. } catch (e) {
  12199. return false;
  12200. }
  12201. },
  12202. date: function date(value) {
  12203. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
  12204. },
  12205. number: function number(value) {
  12206. if (isNaN(value)) {
  12207. return false;
  12208. }
  12209. // 修改源码,将字符串数值先转为数值
  12210. return typeof +value === 'number';
  12211. },
  12212. object: function object(value) {
  12213. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  12214. },
  12215. method: function method(value) {
  12216. return typeof value === 'function';
  12217. },
  12218. email: function email(value) {
  12219. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  12220. },
  12221. url: function url(value) {
  12222. return typeof value === 'string' && !!value.match(pattern.url);
  12223. },
  12224. hex: function hex(value) {
  12225. return typeof value === 'string' && !!value.match(pattern.hex);
  12226. }
  12227. };
  12228. /**
  12229. * Rule for validating the type of a value.
  12230. *
  12231. * @param rule The validation rule.
  12232. * @param value The value of the field on the source object.
  12233. * @param source The source object being validated.
  12234. * @param errors An array of errors that this rule may add
  12235. * validation errors to.
  12236. * @param options The validation options.
  12237. * @param options.messages The validation messages.
  12238. */
  12239. function type(rule, value, source, errors, options) {
  12240. if (rule.required && value === undefined) {
  12241. required(rule, value, source, errors, options);
  12242. return;
  12243. }
  12244. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  12245. var ruleType = rule.type;
  12246. if (custom.indexOf(ruleType) > -1) {
  12247. if (!types[ruleType](value)) {
  12248. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  12249. } // straight typeof check
  12250. } else if (ruleType && (0, _typeof2.default)(value) !== rule.type) {
  12251. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  12252. }
  12253. }
  12254. /**
  12255. * Rule for validating minimum and maximum allowed values.
  12256. *
  12257. * @param rule The validation rule.
  12258. * @param value The value of the field on the source object.
  12259. * @param source The source object being validated.
  12260. * @param errors An array of errors that this rule may add
  12261. * validation errors to.
  12262. * @param options The validation options.
  12263. * @param options.messages The validation messages.
  12264. */
  12265. function range(rule, value, source, errors, options) {
  12266. var len = typeof rule.len === 'number';
  12267. var min = typeof rule.min === 'number';
  12268. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  12269. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  12270. var val = value;
  12271. var key = null;
  12272. var num = typeof value === 'number';
  12273. var str = typeof value === 'string';
  12274. var arr = Array.isArray(value);
  12275. if (num) {
  12276. key = 'number';
  12277. } else if (str) {
  12278. key = 'string';
  12279. } else if (arr) {
  12280. key = 'array';
  12281. } // if the value is not of a supported type for range validation
  12282. // the validation rule rule should use the
  12283. // type property to also test for a particular type
  12284. if (!key) {
  12285. return false;
  12286. }
  12287. if (arr) {
  12288. val = value.length;
  12289. }
  12290. if (str) {
  12291. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  12292. val = value.replace(spRegexp, '_').length;
  12293. }
  12294. if (len) {
  12295. if (val !== rule.len) {
  12296. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  12297. }
  12298. } else if (min && !max && val < rule.min) {
  12299. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  12300. } else if (max && !min && val > rule.max) {
  12301. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  12302. } else if (min && max && (val < rule.min || val > rule.max)) {
  12303. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  12304. }
  12305. }
  12306. var ENUM = 'enum';
  12307. /**
  12308. * Rule for validating a value exists in an enumerable list.
  12309. *
  12310. * @param rule The validation rule.
  12311. * @param value The value of the field on the source object.
  12312. * @param source The source object being validated.
  12313. * @param errors An array of errors that this rule may add
  12314. * validation errors to.
  12315. * @param options The validation options.
  12316. * @param options.messages The validation messages.
  12317. */
  12318. function enumerable(rule, value, source, errors, options) {
  12319. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  12320. if (rule[ENUM].indexOf(value) === -1) {
  12321. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  12322. }
  12323. }
  12324. /**
  12325. * Rule for validating a regular expression pattern.
  12326. *
  12327. * @param rule The validation rule.
  12328. * @param value The value of the field on the source object.
  12329. * @param source The source object being validated.
  12330. * @param errors An array of errors that this rule may add
  12331. * validation errors to.
  12332. * @param options The validation options.
  12333. * @param options.messages The validation messages.
  12334. */
  12335. function pattern$1(rule, value, source, errors, options) {
  12336. if (rule.pattern) {
  12337. if (rule.pattern instanceof RegExp) {
  12338. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  12339. // flag is accidentally set to `true`, which in a validation scenario
  12340. // is not necessary and the result might be misleading
  12341. rule.pattern.lastIndex = 0;
  12342. if (!rule.pattern.test(value)) {
  12343. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12344. }
  12345. } else if (typeof rule.pattern === 'string') {
  12346. var _pattern = new RegExp(rule.pattern);
  12347. if (!_pattern.test(value)) {
  12348. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12349. }
  12350. }
  12351. }
  12352. }
  12353. var rules = {
  12354. required: required,
  12355. whitespace: whitespace,
  12356. type: type,
  12357. range: range,
  12358. "enum": enumerable,
  12359. pattern: pattern$1
  12360. };
  12361. /**
  12362. * Performs validation for string types.
  12363. *
  12364. * @param rule The validation rule.
  12365. * @param value The value of the field on the source object.
  12366. * @param callback The callback function.
  12367. * @param source The source object being validated.
  12368. * @param options The validation options.
  12369. * @param options.messages The validation messages.
  12370. */
  12371. function string(rule, value, callback, source, options) {
  12372. var errors = [];
  12373. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12374. if (validate) {
  12375. if (isEmptyValue(value, 'string') && !rule.required) {
  12376. return callback();
  12377. }
  12378. rules.required(rule, value, source, errors, options, 'string');
  12379. if (!isEmptyValue(value, 'string')) {
  12380. rules.type(rule, value, source, errors, options);
  12381. rules.range(rule, value, source, errors, options);
  12382. rules.pattern(rule, value, source, errors, options);
  12383. if (rule.whitespace === true) {
  12384. rules.whitespace(rule, value, source, errors, options);
  12385. }
  12386. }
  12387. }
  12388. callback(errors);
  12389. }
  12390. /**
  12391. * Validates a function.
  12392. *
  12393. * @param rule The validation rule.
  12394. * @param value The value of the field on the source object.
  12395. * @param callback The callback function.
  12396. * @param source The source object being validated.
  12397. * @param options The validation options.
  12398. * @param options.messages The validation messages.
  12399. */
  12400. function method(rule, value, callback, source, options) {
  12401. var errors = [];
  12402. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12403. if (validate) {
  12404. if (isEmptyValue(value) && !rule.required) {
  12405. return callback();
  12406. }
  12407. rules.required(rule, value, source, errors, options);
  12408. if (value !== undefined) {
  12409. rules.type(rule, value, source, errors, options);
  12410. }
  12411. }
  12412. callback(errors);
  12413. }
  12414. /**
  12415. * Validates a number.
  12416. *
  12417. * @param rule The validation rule.
  12418. * @param value The value of the field on the source object.
  12419. * @param callback The callback function.
  12420. * @param source The source object being validated.
  12421. * @param options The validation options.
  12422. * @param options.messages The validation messages.
  12423. */
  12424. function number(rule, value, callback, source, options) {
  12425. var errors = [];
  12426. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12427. if (validate) {
  12428. if (value === '') {
  12429. value = undefined;
  12430. }
  12431. if (isEmptyValue(value) && !rule.required) {
  12432. return callback();
  12433. }
  12434. rules.required(rule, value, source, errors, options);
  12435. if (value !== undefined) {
  12436. rules.type(rule, value, source, errors, options);
  12437. rules.range(rule, value, source, errors, options);
  12438. }
  12439. }
  12440. callback(errors);
  12441. }
  12442. /**
  12443. * Validates a boolean.
  12444. *
  12445. * @param rule The validation rule.
  12446. * @param value The value of the field on the source object.
  12447. * @param callback The callback function.
  12448. * @param source The source object being validated.
  12449. * @param options The validation options.
  12450. * @param options.messages The validation messages.
  12451. */
  12452. function _boolean(rule, value, callback, source, options) {
  12453. var errors = [];
  12454. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12455. if (validate) {
  12456. if (isEmptyValue(value) && !rule.required) {
  12457. return callback();
  12458. }
  12459. rules.required(rule, value, source, errors, options);
  12460. if (value !== undefined) {
  12461. rules.type(rule, value, source, errors, options);
  12462. }
  12463. }
  12464. callback(errors);
  12465. }
  12466. /**
  12467. * Validates the regular expression type.
  12468. *
  12469. * @param rule The validation rule.
  12470. * @param value The value of the field on the source object.
  12471. * @param callback The callback function.
  12472. * @param source The source object being validated.
  12473. * @param options The validation options.
  12474. * @param options.messages The validation messages.
  12475. */
  12476. function regexp(rule, value, callback, source, options) {
  12477. var errors = [];
  12478. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12479. if (validate) {
  12480. if (isEmptyValue(value) && !rule.required) {
  12481. return callback();
  12482. }
  12483. rules.required(rule, value, source, errors, options);
  12484. if (!isEmptyValue(value)) {
  12485. rules.type(rule, value, source, errors, options);
  12486. }
  12487. }
  12488. callback(errors);
  12489. }
  12490. /**
  12491. * Validates a number is an integer.
  12492. *
  12493. * @param rule The validation rule.
  12494. * @param value The value of the field on the source object.
  12495. * @param callback The callback function.
  12496. * @param source The source object being validated.
  12497. * @param options The validation options.
  12498. * @param options.messages The validation messages.
  12499. */
  12500. function integer(rule, value, callback, source, options) {
  12501. var errors = [];
  12502. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12503. if (validate) {
  12504. if (isEmptyValue(value) && !rule.required) {
  12505. return callback();
  12506. }
  12507. rules.required(rule, value, source, errors, options);
  12508. if (value !== undefined) {
  12509. rules.type(rule, value, source, errors, options);
  12510. rules.range(rule, value, source, errors, options);
  12511. }
  12512. }
  12513. callback(errors);
  12514. }
  12515. /**
  12516. * Validates a number is a floating point number.
  12517. *
  12518. * @param rule The validation rule.
  12519. * @param value The value of the field on the source object.
  12520. * @param callback The callback function.
  12521. * @param source The source object being validated.
  12522. * @param options The validation options.
  12523. * @param options.messages The validation messages.
  12524. */
  12525. function floatFn(rule, value, callback, source, options) {
  12526. var errors = [];
  12527. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12528. if (validate) {
  12529. if (isEmptyValue(value) && !rule.required) {
  12530. return callback();
  12531. }
  12532. rules.required(rule, value, source, errors, options);
  12533. if (value !== undefined) {
  12534. rules.type(rule, value, source, errors, options);
  12535. rules.range(rule, value, source, errors, options);
  12536. }
  12537. }
  12538. callback(errors);
  12539. }
  12540. /**
  12541. * Validates an array.
  12542. *
  12543. * @param rule The validation rule.
  12544. * @param value The value of the field on the source object.
  12545. * @param callback The callback function.
  12546. * @param source The source object being validated.
  12547. * @param options The validation options.
  12548. * @param options.messages The validation messages.
  12549. */
  12550. function array(rule, value, callback, source, options) {
  12551. var errors = [];
  12552. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12553. if (validate) {
  12554. if (isEmptyValue(value, 'array') && !rule.required) {
  12555. return callback();
  12556. }
  12557. rules.required(rule, value, source, errors, options, 'array');
  12558. if (!isEmptyValue(value, 'array')) {
  12559. rules.type(rule, value, source, errors, options);
  12560. rules.range(rule, value, source, errors, options);
  12561. }
  12562. }
  12563. callback(errors);
  12564. }
  12565. /**
  12566. * Validates an object.
  12567. *
  12568. * @param rule The validation rule.
  12569. * @param value The value of the field on the source object.
  12570. * @param callback The callback function.
  12571. * @param source The source object being validated.
  12572. * @param options The validation options.
  12573. * @param options.messages The validation messages.
  12574. */
  12575. function object(rule, value, callback, source, options) {
  12576. var errors = [];
  12577. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12578. if (validate) {
  12579. if (isEmptyValue(value) && !rule.required) {
  12580. return callback();
  12581. }
  12582. rules.required(rule, value, source, errors, options);
  12583. if (value !== undefined) {
  12584. rules.type(rule, value, source, errors, options);
  12585. }
  12586. }
  12587. callback(errors);
  12588. }
  12589. var ENUM$1 = 'enum';
  12590. /**
  12591. * Validates an enumerable list.
  12592. *
  12593. * @param rule The validation rule.
  12594. * @param value The value of the field on the source object.
  12595. * @param callback The callback function.
  12596. * @param source The source object being validated.
  12597. * @param options The validation options.
  12598. * @param options.messages The validation messages.
  12599. */
  12600. function enumerable$1(rule, value, callback, source, options) {
  12601. var errors = [];
  12602. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12603. if (validate) {
  12604. if (isEmptyValue(value) && !rule.required) {
  12605. return callback();
  12606. }
  12607. rules.required(rule, value, source, errors, options);
  12608. if (value !== undefined) {
  12609. rules[ENUM$1](rule, value, source, errors, options);
  12610. }
  12611. }
  12612. callback(errors);
  12613. }
  12614. /**
  12615. * Validates a regular expression pattern.
  12616. *
  12617. * Performs validation when a rule only contains
  12618. * a pattern property but is not declared as a string type.
  12619. *
  12620. * @param rule The validation rule.
  12621. * @param value The value of the field on the source object.
  12622. * @param callback The callback function.
  12623. * @param source The source object being validated.
  12624. * @param options The validation options.
  12625. * @param options.messages The validation messages.
  12626. */
  12627. function pattern$2(rule, value, callback, source, options) {
  12628. var errors = [];
  12629. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12630. if (validate) {
  12631. if (isEmptyValue(value, 'string') && !rule.required) {
  12632. return callback();
  12633. }
  12634. rules.required(rule, value, source, errors, options);
  12635. if (!isEmptyValue(value, 'string')) {
  12636. rules.pattern(rule, value, source, errors, options);
  12637. }
  12638. }
  12639. callback(errors);
  12640. }
  12641. function date(rule, value, callback, source, options) {
  12642. var errors = [];
  12643. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12644. if (validate) {
  12645. if (isEmptyValue(value) && !rule.required) {
  12646. return callback();
  12647. }
  12648. rules.required(rule, value, source, errors, options);
  12649. if (!isEmptyValue(value)) {
  12650. var dateObject;
  12651. if (typeof value === 'number') {
  12652. dateObject = new Date(value);
  12653. } else {
  12654. dateObject = value;
  12655. }
  12656. rules.type(rule, dateObject, source, errors, options);
  12657. if (dateObject) {
  12658. rules.range(rule, dateObject.getTime(), source, errors, options);
  12659. }
  12660. }
  12661. }
  12662. callback(errors);
  12663. }
  12664. function required$1(rule, value, callback, source, options) {
  12665. var errors = [];
  12666. var type = Array.isArray(value) ? 'array' : (0, _typeof2.default)(value);
  12667. rules.required(rule, value, source, errors, options, type);
  12668. callback(errors);
  12669. }
  12670. function type$1(rule, value, callback, source, options) {
  12671. var ruleType = rule.type;
  12672. var errors = [];
  12673. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12674. if (validate) {
  12675. if (isEmptyValue(value, ruleType) && !rule.required) {
  12676. return callback();
  12677. }
  12678. rules.required(rule, value, source, errors, options, ruleType);
  12679. if (!isEmptyValue(value, ruleType)) {
  12680. rules.type(rule, value, source, errors, options);
  12681. }
  12682. }
  12683. callback(errors);
  12684. }
  12685. /**
  12686. * Performs validation for any type.
  12687. *
  12688. * @param rule The validation rule.
  12689. * @param value The value of the field on the source object.
  12690. * @param callback The callback function.
  12691. * @param source The source object being validated.
  12692. * @param options The validation options.
  12693. * @param options.messages The validation messages.
  12694. */
  12695. function any(rule, value, callback, source, options) {
  12696. var errors = [];
  12697. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12698. if (validate) {
  12699. if (isEmptyValue(value) && !rule.required) {
  12700. return callback();
  12701. }
  12702. rules.required(rule, value, source, errors, options);
  12703. }
  12704. callback(errors);
  12705. }
  12706. var validators = {
  12707. string: string,
  12708. method: method,
  12709. number: number,
  12710. "boolean": _boolean,
  12711. regexp: regexp,
  12712. integer: integer,
  12713. "float": floatFn,
  12714. array: array,
  12715. object: object,
  12716. "enum": enumerable$1,
  12717. pattern: pattern$2,
  12718. date: date,
  12719. url: type$1,
  12720. hex: type$1,
  12721. email: type$1,
  12722. required: required$1,
  12723. any: any
  12724. };
  12725. function newMessages() {
  12726. return {
  12727. "default": 'Validation error on field %s',
  12728. required: '%s is required',
  12729. "enum": '%s must be one of %s',
  12730. whitespace: '%s cannot be empty',
  12731. date: {
  12732. format: '%s date %s is invalid for format %s',
  12733. parse: '%s date could not be parsed, %s is invalid ',
  12734. invalid: '%s date %s is invalid'
  12735. },
  12736. types: {
  12737. string: '%s is not a %s',
  12738. method: '%s is not a %s (function)',
  12739. array: '%s is not an %s',
  12740. object: '%s is not an %s',
  12741. number: '%s is not a %s',
  12742. date: '%s is not a %s',
  12743. "boolean": '%s is not a %s',
  12744. integer: '%s is not an %s',
  12745. "float": '%s is not a %s',
  12746. regexp: '%s is not a valid %s',
  12747. email: '%s is not a valid %s',
  12748. url: '%s is not a valid %s',
  12749. hex: '%s is not a valid %s'
  12750. },
  12751. string: {
  12752. len: '%s must be exactly %s characters',
  12753. min: '%s must be at least %s characters',
  12754. max: '%s cannot be longer than %s characters',
  12755. range: '%s must be between %s and %s characters'
  12756. },
  12757. number: {
  12758. len: '%s must equal %s',
  12759. min: '%s cannot be less than %s',
  12760. max: '%s cannot be greater than %s',
  12761. range: '%s must be between %s and %s'
  12762. },
  12763. array: {
  12764. len: '%s must be exactly %s in length',
  12765. min: '%s cannot be less than %s in length',
  12766. max: '%s cannot be greater than %s in length',
  12767. range: '%s must be between %s and %s in length'
  12768. },
  12769. pattern: {
  12770. mismatch: '%s value %s does not match pattern %s'
  12771. },
  12772. clone: function clone() {
  12773. var cloned = JSON.parse(JSON.stringify(this));
  12774. cloned.clone = this.clone;
  12775. return cloned;
  12776. }
  12777. };
  12778. }
  12779. var messages = newMessages();
  12780. /**
  12781. * Encapsulates a validation schema.
  12782. *
  12783. * @param descriptor An object declaring validation rules
  12784. * for this schema.
  12785. */
  12786. function Schema(descriptor) {
  12787. this.rules = null;
  12788. this._messages = messages;
  12789. this.define(descriptor);
  12790. }
  12791. Schema.prototype = {
  12792. messages: function messages(_messages) {
  12793. if (_messages) {
  12794. this._messages = deepMerge(newMessages(), _messages);
  12795. }
  12796. return this._messages;
  12797. },
  12798. define: function define(rules) {
  12799. if (!rules) {
  12800. throw new Error('Cannot configure a schema with no rules');
  12801. }
  12802. if ((0, _typeof2.default)(rules) !== 'object' || Array.isArray(rules)) {
  12803. throw new Error('Rules must be an object');
  12804. }
  12805. this.rules = {};
  12806. var z;
  12807. var item;
  12808. for (z in rules) {
  12809. if (rules.hasOwnProperty(z)) {
  12810. item = rules[z];
  12811. this.rules[z] = Array.isArray(item) ? item : [item];
  12812. }
  12813. }
  12814. },
  12815. validate: function validate(source_, o, oc) {
  12816. var _this = this;
  12817. if (o === void 0) {
  12818. o = {};
  12819. }
  12820. if (oc === void 0) {
  12821. oc = function oc() {};
  12822. }
  12823. var source = source_;
  12824. var options = o;
  12825. var callback = oc;
  12826. if (typeof options === 'function') {
  12827. callback = options;
  12828. options = {};
  12829. }
  12830. if (!this.rules || Object.keys(this.rules).length === 0) {
  12831. if (callback) {
  12832. callback();
  12833. }
  12834. return Promise.resolve();
  12835. }
  12836. function complete(results) {
  12837. var i;
  12838. var errors = [];
  12839. var fields = {};
  12840. function add(e) {
  12841. if (Array.isArray(e)) {
  12842. var _errors;
  12843. errors = (_errors = errors).concat.apply(_errors, e);
  12844. } else {
  12845. errors.push(e);
  12846. }
  12847. }
  12848. for (i = 0; i < results.length; i++) {
  12849. add(results[i]);
  12850. }
  12851. if (!errors.length) {
  12852. errors = null;
  12853. fields = null;
  12854. } else {
  12855. fields = convertFieldsError(errors);
  12856. }
  12857. callback(errors, fields);
  12858. }
  12859. if (options.messages) {
  12860. var messages$1 = this.messages();
  12861. if (messages$1 === messages) {
  12862. messages$1 = newMessages();
  12863. }
  12864. deepMerge(messages$1, options.messages);
  12865. options.messages = messages$1;
  12866. } else {
  12867. options.messages = this.messages();
  12868. }
  12869. var arr;
  12870. var value;
  12871. var series = {};
  12872. var keys = options.keys || Object.keys(this.rules);
  12873. keys.forEach(function (z) {
  12874. arr = _this.rules[z];
  12875. value = source[z];
  12876. arr.forEach(function (r) {
  12877. var rule = r;
  12878. if (typeof rule.transform === 'function') {
  12879. if (source === source_) {
  12880. source = _extends({}, source);
  12881. }
  12882. value = source[z] = rule.transform(value);
  12883. }
  12884. if (typeof rule === 'function') {
  12885. rule = {
  12886. validator: rule
  12887. };
  12888. } else {
  12889. rule = _extends({}, rule);
  12890. }
  12891. rule.validator = _this.getValidationMethod(rule);
  12892. rule.field = z;
  12893. rule.fullField = rule.fullField || z;
  12894. rule.type = _this.getType(rule);
  12895. if (!rule.validator) {
  12896. return;
  12897. }
  12898. series[z] = series[z] || [];
  12899. series[z].push({
  12900. rule: rule,
  12901. value: value,
  12902. source: source,
  12903. field: z
  12904. });
  12905. });
  12906. });
  12907. var errorFields = {};
  12908. return asyncMap(series, options, function (data, doIt) {
  12909. var rule = data.rule;
  12910. var deep = (rule.type === 'object' || rule.type === 'array') && ((0, _typeof2.default)(rule.fields) === 'object' || (0, _typeof2.default)(rule.defaultField) === 'object');
  12911. deep = deep && (rule.required || !rule.required && data.value);
  12912. rule.field = data.field;
  12913. function addFullfield(key, schema) {
  12914. return _extends({}, schema, {
  12915. fullField: rule.fullField + "." + key
  12916. });
  12917. }
  12918. function cb(e) {
  12919. if (e === void 0) {
  12920. e = [];
  12921. }
  12922. var errors = e;
  12923. if (!Array.isArray(errors)) {
  12924. errors = [errors];
  12925. }
  12926. if (!options.suppressWarning && errors.length) {
  12927. Schema.warning('async-validator:', errors);
  12928. }
  12929. if (errors.length && rule.message) {
  12930. errors = [].concat(rule.message);
  12931. }
  12932. errors = errors.map(complementError(rule));
  12933. if (options.first && errors.length) {
  12934. errorFields[rule.field] = 1;
  12935. return doIt(errors);
  12936. }
  12937. if (!deep) {
  12938. doIt(errors);
  12939. } else {
  12940. // if rule is required but the target object
  12941. // does not exist fail at the rule level and don't
  12942. // go deeper
  12943. if (rule.required && !data.value) {
  12944. if (rule.message) {
  12945. errors = [].concat(rule.message).map(complementError(rule));
  12946. } else if (options.error) {
  12947. errors = [options.error(rule, format(options.messages.required, rule.field))];
  12948. } else {
  12949. errors = [];
  12950. }
  12951. return doIt(errors);
  12952. }
  12953. var fieldsSchema = {};
  12954. if (rule.defaultField) {
  12955. for (var k in data.value) {
  12956. if (data.value.hasOwnProperty(k)) {
  12957. fieldsSchema[k] = rule.defaultField;
  12958. }
  12959. }
  12960. }
  12961. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  12962. for (var f in fieldsSchema) {
  12963. if (fieldsSchema.hasOwnProperty(f)) {
  12964. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  12965. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  12966. }
  12967. }
  12968. var schema = new Schema(fieldsSchema);
  12969. schema.messages(options.messages);
  12970. if (data.rule.options) {
  12971. data.rule.options.messages = options.messages;
  12972. data.rule.options.error = options.error;
  12973. }
  12974. schema.validate(data.value, data.rule.options || options, function (errs) {
  12975. var finalErrors = [];
  12976. if (errors && errors.length) {
  12977. finalErrors.push.apply(finalErrors, errors);
  12978. }
  12979. if (errs && errs.length) {
  12980. finalErrors.push.apply(finalErrors, errs);
  12981. }
  12982. doIt(finalErrors.length ? finalErrors : null);
  12983. });
  12984. }
  12985. }
  12986. var res;
  12987. if (rule.asyncValidator) {
  12988. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  12989. } else if (rule.validator) {
  12990. res = rule.validator(rule, data.value, cb, data.source, options);
  12991. if (res === true) {
  12992. cb();
  12993. } else if (res === false) {
  12994. cb(rule.message || rule.field + " fails");
  12995. } else if (res instanceof Array) {
  12996. cb(res);
  12997. } else if (res instanceof Error) {
  12998. cb(res.message);
  12999. }
  13000. }
  13001. if (res && res.then) {
  13002. res.then(function () {
  13003. return cb();
  13004. }, function (e) {
  13005. return cb(e);
  13006. });
  13007. }
  13008. }, function (results) {
  13009. complete(results);
  13010. });
  13011. },
  13012. getType: function getType(rule) {
  13013. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  13014. rule.type = 'pattern';
  13015. }
  13016. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  13017. throw new Error(format('Unknown rule type %s', rule.type));
  13018. }
  13019. return rule.type || 'string';
  13020. },
  13021. getValidationMethod: function getValidationMethod(rule) {
  13022. if (typeof rule.validator === 'function') {
  13023. return rule.validator;
  13024. }
  13025. var keys = Object.keys(rule);
  13026. var messageIndex = keys.indexOf('message');
  13027. if (messageIndex !== -1) {
  13028. keys.splice(messageIndex, 1);
  13029. }
  13030. if (keys.length === 1 && keys[0] === 'required') {
  13031. return validators.required;
  13032. }
  13033. return validators[this.getType(rule)] || false;
  13034. }
  13035. };
  13036. Schema.register = function register(type, validator) {
  13037. if (typeof validator !== 'function') {
  13038. throw new Error('Cannot register a validator by type, validator is not a function');
  13039. }
  13040. validators[type] = validator;
  13041. };
  13042. Schema.warning = warning;
  13043. Schema.messages = messages;
  13044. var _default = Schema;
  13045. exports.default = _default;
  13046. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../Downloads/HBuilderX.3.6.18.20230117/HBuilderX/plugins/uniapp-cli/node_modules/node-libs-browser/mock/process.js */ 424)))
  13047. /***/ }),
  13048. /***/ 424:
  13049. /*!********************************************************!*\
  13050. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  13051. \********************************************************/
  13052. /*! no static exports found */
  13053. /***/ (function(module, exports, __webpack_require__) {
  13054. exports.nextTick = function nextTick(fn) {
  13055. var args = Array.prototype.slice.call(arguments);
  13056. args.shift();
  13057. setTimeout(function () {
  13058. fn.apply(null, args);
  13059. }, 0);
  13060. };
  13061. exports.platform = exports.arch =
  13062. exports.execPath = exports.title = 'browser';
  13063. exports.pid = 1;
  13064. exports.browser = true;
  13065. exports.env = {};
  13066. exports.argv = [];
  13067. exports.binding = function (name) {
  13068. throw new Error('No such module. (Possibly not yet loaded)')
  13069. };
  13070. (function () {
  13071. var cwd = '/';
  13072. var path;
  13073. exports.cwd = function () { return cwd };
  13074. exports.chdir = function (dir) {
  13075. if (!path) path = __webpack_require__(/*! path */ 425);
  13076. cwd = path.resolve(dir, cwd);
  13077. };
  13078. })();
  13079. exports.exit = exports.kill =
  13080. exports.umask = exports.dlopen =
  13081. exports.uptime = exports.memoryUsage =
  13082. exports.uvCounters = function() {};
  13083. exports.features = {};
  13084. /***/ }),
  13085. /***/ 425:
  13086. /*!***********************************************!*\
  13087. !*** ./node_modules/path-browserify/index.js ***!
  13088. \***********************************************/
  13089. /*! no static exports found */
  13090. /***/ (function(module, exports, __webpack_require__) {
  13091. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  13092. // backported and transplited with Babel, with backwards-compat fixes
  13093. // Copyright Joyent, Inc. and other Node contributors.
  13094. //
  13095. // Permission is hereby granted, free of charge, to any person obtaining a
  13096. // copy of this software and associated documentation files (the
  13097. // "Software"), to deal in the Software without restriction, including
  13098. // without limitation the rights to use, copy, modify, merge, publish,
  13099. // distribute, sublicense, and/or sell copies of the Software, and to permit
  13100. // persons to whom the Software is furnished to do so, subject to the
  13101. // following conditions:
  13102. //
  13103. // The above copyright notice and this permission notice shall be included
  13104. // in all copies or substantial portions of the Software.
  13105. //
  13106. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13107. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13108. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  13109. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13110. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  13111. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  13112. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  13113. // resolves . and .. elements in a path array with directory names there
  13114. // must be no slashes, empty elements, or device names (c:\) in the array
  13115. // (so also no leading and trailing slashes - it does not distinguish
  13116. // relative and absolute paths)
  13117. function normalizeArray(parts, allowAboveRoot) {
  13118. // if the path tries to go above the root, `up` ends up > 0
  13119. var up = 0;
  13120. for (var i = parts.length - 1; i >= 0; i--) {
  13121. var last = parts[i];
  13122. if (last === '.') {
  13123. parts.splice(i, 1);
  13124. } else if (last === '..') {
  13125. parts.splice(i, 1);
  13126. up++;
  13127. } else if (up) {
  13128. parts.splice(i, 1);
  13129. up--;
  13130. }
  13131. }
  13132. // if the path is allowed to go above the root, restore leading ..s
  13133. if (allowAboveRoot) {
  13134. for (; up--; up) {
  13135. parts.unshift('..');
  13136. }
  13137. }
  13138. return parts;
  13139. }
  13140. // path.resolve([from ...], to)
  13141. // posix version
  13142. exports.resolve = function() {
  13143. var resolvedPath = '',
  13144. resolvedAbsolute = false;
  13145. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  13146. var path = (i >= 0) ? arguments[i] : process.cwd();
  13147. // Skip empty and invalid entries
  13148. if (typeof path !== 'string') {
  13149. throw new TypeError('Arguments to path.resolve must be strings');
  13150. } else if (!path) {
  13151. continue;
  13152. }
  13153. resolvedPath = path + '/' + resolvedPath;
  13154. resolvedAbsolute = path.charAt(0) === '/';
  13155. }
  13156. // At this point the path should be resolved to a full absolute path, but
  13157. // handle relative paths to be safe (might happen when process.cwd() fails)
  13158. // Normalize the path
  13159. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  13160. return !!p;
  13161. }), !resolvedAbsolute).join('/');
  13162. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  13163. };
  13164. // path.normalize(path)
  13165. // posix version
  13166. exports.normalize = function(path) {
  13167. var isAbsolute = exports.isAbsolute(path),
  13168. trailingSlash = substr(path, -1) === '/';
  13169. // Normalize the path
  13170. path = normalizeArray(filter(path.split('/'), function(p) {
  13171. return !!p;
  13172. }), !isAbsolute).join('/');
  13173. if (!path && !isAbsolute) {
  13174. path = '.';
  13175. }
  13176. if (path && trailingSlash) {
  13177. path += '/';
  13178. }
  13179. return (isAbsolute ? '/' : '') + path;
  13180. };
  13181. // posix version
  13182. exports.isAbsolute = function(path) {
  13183. return path.charAt(0) === '/';
  13184. };
  13185. // posix version
  13186. exports.join = function() {
  13187. var paths = Array.prototype.slice.call(arguments, 0);
  13188. return exports.normalize(filter(paths, function(p, index) {
  13189. if (typeof p !== 'string') {
  13190. throw new TypeError('Arguments to path.join must be strings');
  13191. }
  13192. return p;
  13193. }).join('/'));
  13194. };
  13195. // path.relative(from, to)
  13196. // posix version
  13197. exports.relative = function(from, to) {
  13198. from = exports.resolve(from).substr(1);
  13199. to = exports.resolve(to).substr(1);
  13200. function trim(arr) {
  13201. var start = 0;
  13202. for (; start < arr.length; start++) {
  13203. if (arr[start] !== '') break;
  13204. }
  13205. var end = arr.length - 1;
  13206. for (; end >= 0; end--) {
  13207. if (arr[end] !== '') break;
  13208. }
  13209. if (start > end) return [];
  13210. return arr.slice(start, end - start + 1);
  13211. }
  13212. var fromParts = trim(from.split('/'));
  13213. var toParts = trim(to.split('/'));
  13214. var length = Math.min(fromParts.length, toParts.length);
  13215. var samePartsLength = length;
  13216. for (var i = 0; i < length; i++) {
  13217. if (fromParts[i] !== toParts[i]) {
  13218. samePartsLength = i;
  13219. break;
  13220. }
  13221. }
  13222. var outputParts = [];
  13223. for (var i = samePartsLength; i < fromParts.length; i++) {
  13224. outputParts.push('..');
  13225. }
  13226. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  13227. return outputParts.join('/');
  13228. };
  13229. exports.sep = '/';
  13230. exports.delimiter = ':';
  13231. exports.dirname = function (path) {
  13232. if (typeof path !== 'string') path = path + '';
  13233. if (path.length === 0) return '.';
  13234. var code = path.charCodeAt(0);
  13235. var hasRoot = code === 47 /*/*/;
  13236. var end = -1;
  13237. var matchedSlash = true;
  13238. for (var i = path.length - 1; i >= 1; --i) {
  13239. code = path.charCodeAt(i);
  13240. if (code === 47 /*/*/) {
  13241. if (!matchedSlash) {
  13242. end = i;
  13243. break;
  13244. }
  13245. } else {
  13246. // We saw the first non-path separator
  13247. matchedSlash = false;
  13248. }
  13249. }
  13250. if (end === -1) return hasRoot ? '/' : '.';
  13251. if (hasRoot && end === 1) {
  13252. // return '//';
  13253. // Backwards-compat fix:
  13254. return '/';
  13255. }
  13256. return path.slice(0, end);
  13257. };
  13258. function basename(path) {
  13259. if (typeof path !== 'string') path = path + '';
  13260. var start = 0;
  13261. var end = -1;
  13262. var matchedSlash = true;
  13263. var i;
  13264. for (i = path.length - 1; i >= 0; --i) {
  13265. if (path.charCodeAt(i) === 47 /*/*/) {
  13266. // If we reached a path separator that was not part of a set of path
  13267. // separators at the end of the string, stop now
  13268. if (!matchedSlash) {
  13269. start = i + 1;
  13270. break;
  13271. }
  13272. } else if (end === -1) {
  13273. // We saw the first non-path separator, mark this as the end of our
  13274. // path component
  13275. matchedSlash = false;
  13276. end = i + 1;
  13277. }
  13278. }
  13279. if (end === -1) return '';
  13280. return path.slice(start, end);
  13281. }
  13282. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  13283. // in new Node.js versions, so only basename() above is backported here
  13284. exports.basename = function (path, ext) {
  13285. var f = basename(path);
  13286. if (ext && f.substr(-1 * ext.length) === ext) {
  13287. f = f.substr(0, f.length - ext.length);
  13288. }
  13289. return f;
  13290. };
  13291. exports.extname = function (path) {
  13292. if (typeof path !== 'string') path = path + '';
  13293. var startDot = -1;
  13294. var startPart = 0;
  13295. var end = -1;
  13296. var matchedSlash = true;
  13297. // Track the state of characters (if any) we see before our first dot and
  13298. // after any path separator we find
  13299. var preDotState = 0;
  13300. for (var i = path.length - 1; i >= 0; --i) {
  13301. var code = path.charCodeAt(i);
  13302. if (code === 47 /*/*/) {
  13303. // If we reached a path separator that was not part of a set of path
  13304. // separators at the end of the string, stop now
  13305. if (!matchedSlash) {
  13306. startPart = i + 1;
  13307. break;
  13308. }
  13309. continue;
  13310. }
  13311. if (end === -1) {
  13312. // We saw the first non-path separator, mark this as the end of our
  13313. // extension
  13314. matchedSlash = false;
  13315. end = i + 1;
  13316. }
  13317. if (code === 46 /*.*/) {
  13318. // If this is our first dot, mark it as the start of our extension
  13319. if (startDot === -1)
  13320. startDot = i;
  13321. else if (preDotState !== 1)
  13322. preDotState = 1;
  13323. } else if (startDot !== -1) {
  13324. // We saw a non-dot and non-path separator before our dot, so we should
  13325. // have a good chance at having a non-empty extension
  13326. preDotState = -1;
  13327. }
  13328. }
  13329. if (startDot === -1 || end === -1 ||
  13330. // We saw a non-dot character immediately before the dot
  13331. preDotState === 0 ||
  13332. // The (right-most) trimmed path component is exactly '..'
  13333. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  13334. return '';
  13335. }
  13336. return path.slice(startDot, end);
  13337. };
  13338. function filter (xs, f) {
  13339. if (xs.filter) return xs.filter(f);
  13340. var res = [];
  13341. for (var i = 0; i < xs.length; i++) {
  13342. if (f(xs[i], i, xs)) res.push(xs[i]);
  13343. }
  13344. return res;
  13345. }
  13346. // String.prototype.substr - negative index don't work in IE8
  13347. var substr = 'ab'.substr(-1) === 'b'
  13348. ? function (str, start, len) { return str.substr(start, len) }
  13349. : function (str, start, len) {
  13350. if (start < 0) start = str.length + start;
  13351. return str.substr(start, len);
  13352. }
  13353. ;
  13354. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 424)))
  13355. /***/ }),
  13356. /***/ 43:
  13357. /*!*****************************************************************!*\
  13358. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  13359. \*****************************************************************/
  13360. /*! no static exports found */
  13361. /***/ (function(module, exports) {
  13362. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  13363. try {
  13364. var info = gen[key](arg);
  13365. var value = info.value;
  13366. } catch (error) {
  13367. reject(error);
  13368. return;
  13369. }
  13370. if (info.done) {
  13371. resolve(value);
  13372. } else {
  13373. Promise.resolve(value).then(_next, _throw);
  13374. }
  13375. }
  13376. function _asyncToGenerator(fn) {
  13377. return function () {
  13378. var self = this,
  13379. args = arguments;
  13380. return new Promise(function (resolve, reject) {
  13381. var gen = fn.apply(self, args);
  13382. function _next(value) {
  13383. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  13384. }
  13385. function _throw(err) {
  13386. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  13387. }
  13388. _next(undefined);
  13389. });
  13390. };
  13391. }
  13392. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13393. /***/ }),
  13394. /***/ 44:
  13395. /*!*********************************************************************************************!*\
  13396. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  13397. \*********************************************************************************************/
  13398. /*! no static exports found */
  13399. /***/ (function(module, exports, __webpack_require__) {
  13400. "use strict";
  13401. Object.defineProperty(exports, "__esModule", {
  13402. value: true
  13403. });
  13404. exports.default = void 0;
  13405. // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  13406. // 所以这里做一个兼容polyfill的兼容处理
  13407. if (!String.prototype.padStart) {
  13408. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  13409. String.prototype.padStart = function (maxLength) {
  13410. var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  13411. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError('fillString must be String');
  13412. var str = this;
  13413. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  13414. if (str.length >= maxLength) return String(str);
  13415. var fillLength = maxLength - str.length,
  13416. times = Math.ceil(fillLength / fillString.length);
  13417. while (times >>= 1) {
  13418. fillString += fillString;
  13419. if (times === 1) {
  13420. fillString += fillString;
  13421. }
  13422. }
  13423. return fillString.slice(0, fillLength) + str;
  13424. };
  13425. }
  13426. // 其他更多是格式化有如下:
  13427. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  13428. function timeFormat() {
  13429. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  13430. var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  13431. // 如果为null,则格式化当前时间
  13432. if (!dateTime) dateTime = Number(new Date());
  13433. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  13434. if (dateTime.toString().length == 10) dateTime *= 1000;
  13435. var date = new Date(dateTime);
  13436. var ret;
  13437. var opt = {
  13438. "y+": date.getFullYear().toString(),
  13439. // 年
  13440. "m+": (date.getMonth() + 1).toString(),
  13441. // 月
  13442. "d+": date.getDate().toString(),
  13443. // 日
  13444. "h+": date.getHours().toString(),
  13445. // 时
  13446. "M+": date.getMinutes().toString(),
  13447. // 分
  13448. "s+": date.getSeconds().toString() // 秒
  13449. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  13450. };
  13451. for (var k in opt) {
  13452. ret = new RegExp("(" + k + ")").exec(fmt);
  13453. if (ret) {
  13454. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  13455. }
  13456. ;
  13457. }
  13458. ;
  13459. return fmt;
  13460. }
  13461. var _default = timeFormat;
  13462. exports.default = _default;
  13463. /***/ }),
  13464. /***/ 45:
  13465. /*!*******************************************************************************************!*\
  13466. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  13467. \*******************************************************************************************/
  13468. /*! no static exports found */
  13469. /***/ (function(module, exports, __webpack_require__) {
  13470. "use strict";
  13471. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13472. Object.defineProperty(exports, "__esModule", {
  13473. value: true
  13474. });
  13475. exports.default = void 0;
  13476. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 44));
  13477. /**
  13478. * 时间戳转为多久之前
  13479. * @param String timestamp 时间戳
  13480. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  13481. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  13482. */
  13483. function timeFrom() {
  13484. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  13485. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  13486. // 如果为null,则格式化当前时间
  13487. if (!dateTime) dateTime = Number(new Date());
  13488. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  13489. if (dateTime.toString().length == 10) dateTime *= 1000;
  13490. var timestamp = +new Date(Number(dateTime));
  13491. var timer = (Number(new Date()) - timestamp) / 1000;
  13492. // 如果小于5分钟,则返回"刚刚",其他以此类推
  13493. var tips = '';
  13494. switch (true) {
  13495. case timer < 300:
  13496. tips = '刚刚';
  13497. break;
  13498. case timer >= 300 && timer < 3600:
  13499. tips = parseInt(timer / 60) + '分钟前';
  13500. break;
  13501. case timer >= 3600 && timer < 86400:
  13502. tips = parseInt(timer / 3600) + '小时前';
  13503. break;
  13504. case timer >= 86400 && timer < 2592000:
  13505. tips = parseInt(timer / 86400) + '天前';
  13506. break;
  13507. default:
  13508. // 如果format为false,则无论什么时间戳,都显示xx之前
  13509. if (format === false) {
  13510. if (timer >= 2592000 && timer < 365 * 86400) {
  13511. tips = parseInt(timer / (86400 * 30)) + '个月前';
  13512. } else {
  13513. tips = parseInt(timer / (86400 * 365)) + '年前';
  13514. }
  13515. } else {
  13516. tips = (0, _timeFormat.default)(timestamp, format);
  13517. }
  13518. }
  13519. return tips;
  13520. }
  13521. var _default = timeFrom;
  13522. exports.default = _default;
  13523. /***/ }),
  13524. /***/ 46:
  13525. /*!************************************************************************************************!*\
  13526. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  13527. \************************************************************************************************/
  13528. /*! no static exports found */
  13529. /***/ (function(module, exports, __webpack_require__) {
  13530. "use strict";
  13531. Object.defineProperty(exports, "__esModule", {
  13532. value: true
  13533. });
  13534. exports.default = void 0;
  13535. /**
  13536. * 求两个颜色之间的渐变值
  13537. * @param {string} startColor 开始的颜色
  13538. * @param {string} endColor 结束的颜色
  13539. * @param {number} step 颜色等分的份额
  13540. * */
  13541. function colorGradient() {
  13542. var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
  13543. var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
  13544. var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  13545. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  13546. var startR = startRGB[0];
  13547. var startG = startRGB[1];
  13548. var startB = startRGB[2];
  13549. var endRGB = hexToRgb(endColor, false);
  13550. var endR = endRGB[0];
  13551. var endG = endRGB[1];
  13552. var endB = endRGB[2];
  13553. var sR = (endR - startR) / step; //总差值
  13554. var sG = (endG - startG) / step;
  13555. var sB = (endB - startB) / step;
  13556. var colorArr = [];
  13557. for (var i = 0; i < step; i++) {
  13558. //计算每一步的hex值
  13559. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB * i + startB) + ')');
  13560. colorArr.push(hex);
  13561. }
  13562. return colorArr;
  13563. }
  13564. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  13565. function hexToRgb(sColor) {
  13566. var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13567. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13568. sColor = sColor.toLowerCase();
  13569. if (sColor && reg.test(sColor)) {
  13570. if (sColor.length === 4) {
  13571. var sColorNew = "#";
  13572. for (var i = 1; i < 4; i += 1) {
  13573. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  13574. }
  13575. sColor = sColorNew;
  13576. }
  13577. //处理六位的颜色值
  13578. var sColorChange = [];
  13579. for (var _i = 1; _i < 7; _i += 2) {
  13580. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  13581. }
  13582. if (!str) {
  13583. return sColorChange;
  13584. } else {
  13585. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  13586. }
  13587. } else if (/^(rgb|RGB)/.test(sColor)) {
  13588. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  13589. return arr.map(function (val) {
  13590. return Number(val);
  13591. });
  13592. } else {
  13593. return sColor;
  13594. }
  13595. }
  13596. ;
  13597. // 将rgb表示方式转换为hex表示方式
  13598. function rgbToHex(rgb) {
  13599. var _this = rgb;
  13600. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13601. if (/^(rgb|RGB)/.test(_this)) {
  13602. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  13603. var strHex = "#";
  13604. for (var i = 0; i < aColor.length; i++) {
  13605. var hex = Number(aColor[i]).toString(16);
  13606. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  13607. if (hex === "0") {
  13608. hex += hex;
  13609. }
  13610. strHex += hex;
  13611. }
  13612. if (strHex.length !== 7) {
  13613. strHex = _this;
  13614. }
  13615. return strHex;
  13616. } else if (reg.test(_this)) {
  13617. var aNum = _this.replace(/#/, "").split("");
  13618. if (aNum.length === 6) {
  13619. return _this;
  13620. } else if (aNum.length === 3) {
  13621. var numHex = "#";
  13622. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  13623. numHex += aNum[_i2] + aNum[_i2];
  13624. }
  13625. return numHex;
  13626. }
  13627. } else {
  13628. return _this;
  13629. }
  13630. }
  13631. /**
  13632. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  13633. * sHex为传入的十六进制的色值
  13634. * alpha为rgba的透明度
  13635. */
  13636. function colorToRgba(color) {
  13637. var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  13638. color = rgbToHex(color);
  13639. // 十六进制颜色值的正则表达式
  13640. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13641. /* 16进制颜色转为RGB格式 */
  13642. var sColor = color.toLowerCase();
  13643. if (sColor && reg.test(sColor)) {
  13644. if (sColor.length === 4) {
  13645. var sColorNew = '#';
  13646. for (var i = 1; i < 4; i += 1) {
  13647. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  13648. }
  13649. sColor = sColorNew;
  13650. }
  13651. // 处理六位的颜色值
  13652. var sColorChange = [];
  13653. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  13654. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  13655. }
  13656. // return sColorChange.join(',')
  13657. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  13658. } else {
  13659. return sColor;
  13660. }
  13661. }
  13662. var _default = {
  13663. colorGradient: colorGradient,
  13664. hexToRgb: hexToRgb,
  13665. rgbToHex: rgbToHex,
  13666. colorToRgba: colorToRgba
  13667. };
  13668. exports.default = _default;
  13669. /***/ }),
  13670. /***/ 47:
  13671. /*!***************************************************************************************!*\
  13672. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  13673. \***************************************************************************************/
  13674. /*! no static exports found */
  13675. /***/ (function(module, exports, __webpack_require__) {
  13676. "use strict";
  13677. Object.defineProperty(exports, "__esModule", {
  13678. value: true
  13679. });
  13680. exports.default = void 0;
  13681. /**
  13682. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  13683. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  13684. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  13685. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  13686. * v-for的时候,推荐使用后端返回的id而不是循环的index
  13687. * @param {Number} len uuid的长度
  13688. * @param {Boolean} firstU 将返回的首字母置为"u"
  13689. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  13690. */
  13691. function guid() {
  13692. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  13693. var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13694. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  13695. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  13696. var uuid = [];
  13697. radix = radix || chars.length;
  13698. if (len) {
  13699. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  13700. for (var i = 0; i < len; i++) {
  13701. uuid[i] = chars[0 | Math.random() * radix];
  13702. }
  13703. } else {
  13704. var r;
  13705. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  13706. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  13707. uuid[14] = '4';
  13708. for (var _i = 0; _i < 36; _i++) {
  13709. if (!uuid[_i]) {
  13710. r = 0 | Math.random() * 16;
  13711. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  13712. }
  13713. }
  13714. }
  13715. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  13716. if (firstU) {
  13717. uuid.shift();
  13718. return 'u' + uuid.join('');
  13719. } else {
  13720. return uuid.join('');
  13721. }
  13722. }
  13723. var _default = guid;
  13724. exports.default = _default;
  13725. /***/ }),
  13726. /***/ 48:
  13727. /*!****************************************************************************************!*\
  13728. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  13729. \****************************************************************************************/
  13730. /*! no static exports found */
  13731. /***/ (function(module, exports, __webpack_require__) {
  13732. "use strict";
  13733. Object.defineProperty(exports, "__esModule", {
  13734. value: true
  13735. });
  13736. exports.default = void 0;
  13737. // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  13738. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  13739. var color = {
  13740. primary: "#2979ff",
  13741. primaryDark: "#2b85e4",
  13742. primaryDisabled: "#a0cfff",
  13743. primaryLight: "#ecf5ff",
  13744. bgColor: "#f3f4f6",
  13745. info: "#909399",
  13746. infoDark: "#82848a",
  13747. infoDisabled: "#c8c9cc",
  13748. infoLight: "#f4f4f5",
  13749. warning: "#ff9900",
  13750. warningDark: "#f29100",
  13751. warningDisabled: "#fcbd71",
  13752. warningLight: "#fdf6ec",
  13753. error: "#fa3534",
  13754. errorDark: "#dd6161",
  13755. errorDisabled: "#fab6b6",
  13756. errorLight: "#fef0f0",
  13757. success: "#19be6b",
  13758. successDark: "#18b566",
  13759. successDisabled: "#71d5a1",
  13760. successLight: "#dbf1e1",
  13761. mainColor: "#303133",
  13762. contentColor: "#606266",
  13763. tipsColor: "#909399",
  13764. lightColor: "#c0c4cc",
  13765. borderColor: "#e4e7ed"
  13766. };
  13767. var _default = color;
  13768. exports.default = _default;
  13769. /***/ }),
  13770. /***/ 49:
  13771. /*!********************************************************************************************!*\
  13772. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  13773. \********************************************************************************************/
  13774. /*! no static exports found */
  13775. /***/ (function(module, exports, __webpack_require__) {
  13776. "use strict";
  13777. Object.defineProperty(exports, "__esModule", {
  13778. value: true
  13779. });
  13780. exports.default = void 0;
  13781. /**
  13782. * 根据主题type值,获取对应的图标
  13783. * @param String type 主题名称,primary|info|error|warning|success
  13784. * @param String fill 是否使用fill填充实体的图标
  13785. */
  13786. function type2icon() {
  13787. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
  13788. var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13789. // 如果非预置值,默认为success
  13790. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  13791. var iconName = '';
  13792. // 目前(2019-12-12),info和primary使用同一个图标
  13793. switch (type) {
  13794. case 'primary':
  13795. iconName = 'info-circle';
  13796. break;
  13797. case 'info':
  13798. iconName = 'info-circle';
  13799. break;
  13800. case 'error':
  13801. iconName = 'close-circle';
  13802. break;
  13803. case 'warning':
  13804. iconName = 'error-circle';
  13805. break;
  13806. case 'success':
  13807. iconName = 'checkmark-circle';
  13808. break;
  13809. default:
  13810. iconName = 'checkmark-circle';
  13811. }
  13812. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  13813. if (fill) iconName += '-fill';
  13814. return iconName;
  13815. }
  13816. var _default = type2icon;
  13817. exports.default = _default;
  13818. /***/ }),
  13819. /***/ 5:
  13820. /*!**************************************************************!*\
  13821. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  13822. \**************************************************************/
  13823. /*! no static exports found */
  13824. /***/ (function(module, exports, __webpack_require__) {
  13825. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  13826. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  13827. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  13828. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  13829. function _slicedToArray(arr, i) {
  13830. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  13831. }
  13832. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13833. /***/ }),
  13834. /***/ 50:
  13835. /*!**********************************************************************************************!*\
  13836. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  13837. \**********************************************************************************************/
  13838. /*! no static exports found */
  13839. /***/ (function(module, exports, __webpack_require__) {
  13840. "use strict";
  13841. Object.defineProperty(exports, "__esModule", {
  13842. value: true
  13843. });
  13844. exports.default = void 0;
  13845. // 打乱数组
  13846. function randomArray() {
  13847. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  13848. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  13849. return array.sort(function () {
  13850. return Math.random() - 0.5;
  13851. });
  13852. }
  13853. var _default = randomArray;
  13854. exports.default = _default;
  13855. /***/ }),
  13856. /***/ 51:
  13857. /*!******************************************************************************************!*\
  13858. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  13859. \******************************************************************************************/
  13860. /*! no static exports found */
  13861. /***/ (function(module, exports, __webpack_require__) {
  13862. "use strict";
  13863. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13864. Object.defineProperty(exports, "__esModule", {
  13865. value: true
  13866. });
  13867. exports.default = addUnit;
  13868. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 38));
  13869. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  13870. function addUnit() {
  13871. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
  13872. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  13873. value = String(value);
  13874. // 用uView内置验证规则中的number判断是否为数值
  13875. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  13876. }
  13877. /***/ }),
  13878. /***/ 52:
  13879. /*!*****************************************************************************************!*\
  13880. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  13881. \*****************************************************************************************/
  13882. /*! no static exports found */
  13883. /***/ (function(module, exports, __webpack_require__) {
  13884. "use strict";
  13885. Object.defineProperty(exports, "__esModule", {
  13886. value: true
  13887. });
  13888. exports.default = void 0;
  13889. function random(min, max) {
  13890. if (min >= 0 && max > 0 && max >= min) {
  13891. var gab = max - min + 1;
  13892. return Math.floor(Math.random() * gab + min);
  13893. } else {
  13894. return 0;
  13895. }
  13896. }
  13897. var _default = random;
  13898. exports.default = _default;
  13899. /***/ }),
  13900. /***/ 53:
  13901. /*!***************************************************************************************!*\
  13902. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  13903. \***************************************************************************************/
  13904. /*! no static exports found */
  13905. /***/ (function(module, exports, __webpack_require__) {
  13906. "use strict";
  13907. Object.defineProperty(exports, "__esModule", {
  13908. value: true
  13909. });
  13910. exports.default = void 0;
  13911. function trim(str) {
  13912. var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  13913. if (pos == 'both') {
  13914. return str.replace(/^\s+|\s+$/g, "");
  13915. } else if (pos == "left") {
  13916. return str.replace(/^\s*/, '');
  13917. } else if (pos == 'right') {
  13918. return str.replace(/(\s*$)/g, "");
  13919. } else if (pos == 'all') {
  13920. return str.replace(/\s+/g, "");
  13921. } else {
  13922. return str;
  13923. }
  13924. }
  13925. var _default = trim;
  13926. exports.default = _default;
  13927. /***/ }),
  13928. /***/ 54:
  13929. /*!****************************************************************************************!*\
  13930. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  13931. \****************************************************************************************/
  13932. /*! no static exports found */
  13933. /***/ (function(module, exports, __webpack_require__) {
  13934. "use strict";
  13935. /* WEBPACK VAR INJECTION */(function(uni) {
  13936. Object.defineProperty(exports, "__esModule", {
  13937. value: true
  13938. });
  13939. exports.default = void 0;
  13940. function toast(title) {
  13941. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  13942. uni.showToast({
  13943. title: title,
  13944. icon: 'none',
  13945. duration: duration
  13946. });
  13947. }
  13948. var _default = toast;
  13949. exports.default = _default;
  13950. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  13951. /***/ }),
  13952. /***/ 55:
  13953. /*!********************************************************************************************!*\
  13954. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  13955. \********************************************************************************************/
  13956. /*! no static exports found */
  13957. /***/ (function(module, exports, __webpack_require__) {
  13958. "use strict";
  13959. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13960. Object.defineProperty(exports, "__esModule", {
  13961. value: true
  13962. });
  13963. exports.default = getParent;
  13964. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  13965. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  13966. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  13967. function getParent(name, keys) {
  13968. var parent = this.$parent;
  13969. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  13970. while (parent) {
  13971. // 父组件
  13972. if (parent.$options.name !== name) {
  13973. // 如果组件的name不相等,继续上一级寻找
  13974. parent = parent.$parent;
  13975. } else {
  13976. var _ret = function () {
  13977. var data = {};
  13978. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  13979. if (Array.isArray(keys)) {
  13980. keys.map(function (val) {
  13981. data[val] = parent[val] ? parent[val] : '';
  13982. });
  13983. } else {
  13984. // 历遍传过来的对象参数
  13985. for (var i in keys) {
  13986. // 如果子组件有此值则用,无此值则用父组件的值
  13987. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  13988. if (Array.isArray(keys[i])) {
  13989. if (keys[i].length) {
  13990. data[i] = keys[i];
  13991. } else {
  13992. data[i] = parent[i];
  13993. }
  13994. } else if (keys[i].constructor === Object) {
  13995. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  13996. if (Object.keys(keys[i]).length) {
  13997. data[i] = keys[i];
  13998. } else {
  13999. data[i] = parent[i];
  14000. }
  14001. } else {
  14002. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  14003. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  14004. }
  14005. }
  14006. }
  14007. return {
  14008. v: data
  14009. };
  14010. }();
  14011. if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
  14012. }
  14013. }
  14014. return {};
  14015. }
  14016. /***/ }),
  14017. /***/ 56:
  14018. /*!******************************************************************************************!*\
  14019. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  14020. \******************************************************************************************/
  14021. /*! no static exports found */
  14022. /***/ (function(module, exports, __webpack_require__) {
  14023. "use strict";
  14024. Object.defineProperty(exports, "__esModule", {
  14025. value: true
  14026. });
  14027. exports.default = $parent;
  14028. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  14029. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  14030. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  14031. // 值(默认为undefined),就是查找最顶层的$parent
  14032. function $parent() {
  14033. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  14034. var parent = this.$parent;
  14035. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  14036. while (parent) {
  14037. // 父组件
  14038. if (parent.$options && parent.$options.name !== name) {
  14039. // 如果组件的name不相等,继续上一级寻找
  14040. parent = parent.$parent;
  14041. } else {
  14042. return parent;
  14043. }
  14044. }
  14045. return false;
  14046. }
  14047. /***/ }),
  14048. /***/ 57:
  14049. /*!**************************************************************************************!*\
  14050. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  14051. \**************************************************************************************/
  14052. /*! no static exports found */
  14053. /***/ (function(module, exports, __webpack_require__) {
  14054. "use strict";
  14055. /* WEBPACK VAR INJECTION */(function(uni) {
  14056. Object.defineProperty(exports, "__esModule", {
  14057. value: true
  14058. });
  14059. exports.os = os;
  14060. exports.sys = sys;
  14061. function os() {
  14062. return uni.getSystemInfoSync().platform;
  14063. }
  14064. ;
  14065. function sys() {
  14066. return uni.getSystemInfoSync();
  14067. }
  14068. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14069. /***/ }),
  14070. /***/ 58:
  14071. /*!*******************************************************************************************!*\
  14072. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  14073. \*******************************************************************************************/
  14074. /*! no static exports found */
  14075. /***/ (function(module, exports, __webpack_require__) {
  14076. "use strict";
  14077. Object.defineProperty(exports, "__esModule", {
  14078. value: true
  14079. });
  14080. exports.default = void 0;
  14081. var timeout = null;
  14082. /**
  14083. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  14084. *
  14085. * @param {Function} func 要执行的回调函数
  14086. * @param {Number} wait 延时的时间
  14087. * @param {Boolean} immediate 是否立即执行
  14088. * @return null
  14089. */
  14090. function debounce(func) {
  14091. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14092. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14093. // 清除定时器
  14094. if (timeout !== null) clearTimeout(timeout);
  14095. // 立即执行,此类情况一般用不到
  14096. if (immediate) {
  14097. var callNow = !timeout;
  14098. timeout = setTimeout(function () {
  14099. timeout = null;
  14100. }, wait);
  14101. if (callNow) typeof func === 'function' && func();
  14102. } else {
  14103. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  14104. timeout = setTimeout(function () {
  14105. typeof func === 'function' && func();
  14106. }, wait);
  14107. }
  14108. }
  14109. var _default = debounce;
  14110. exports.default = _default;
  14111. /***/ }),
  14112. /***/ 59:
  14113. /*!*******************************************************************************************!*\
  14114. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  14115. \*******************************************************************************************/
  14116. /*! no static exports found */
  14117. /***/ (function(module, exports, __webpack_require__) {
  14118. "use strict";
  14119. Object.defineProperty(exports, "__esModule", {
  14120. value: true
  14121. });
  14122. exports.default = void 0;
  14123. var timeoutArr = [];
  14124. var flagArr = [];
  14125. /**
  14126. * 节流函数
  14127. * 节流原理:在一定时间内,只能触发一次
  14128. * @param {Function} fn 要执行的回调函数
  14129. * @param {Number} time 延时的时间
  14130. * @param {Boolean} isImmediate 是否立即执行
  14131. * @param {String} timeoutName 定时器ID
  14132. * @return null
  14133. */
  14134. function throttle(fn) {
  14135. var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14136. var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  14137. var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  14138. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  14139. if (isImmediate) {
  14140. if (!flagArr[timeoutName]) {
  14141. flagArr[timeoutName] = true;
  14142. // 如果是立即执行,则在time毫秒内开始时执行
  14143. if (typeof fn === 'function') fn();
  14144. timeoutArr[timeoutName] = setTimeout(function () {
  14145. flagArr[timeoutName] = false;
  14146. }, time);
  14147. }
  14148. } else {
  14149. if (!flagArr[timeoutName]) {
  14150. flagArr[timeoutName] = true;
  14151. // 如果是非立即执行,则在time毫秒内的结束处执行
  14152. timeoutArr[timeoutName] = setTimeout(function () {
  14153. flagArr[timeoutName] = false;
  14154. if (typeof fn === 'function') fn();
  14155. }, time);
  14156. }
  14157. }
  14158. }
  14159. ;
  14160. var _default = throttle;
  14161. exports.default = _default;
  14162. /***/ }),
  14163. /***/ 6:
  14164. /*!***************************************************************!*\
  14165. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  14166. \***************************************************************/
  14167. /*! no static exports found */
  14168. /***/ (function(module, exports) {
  14169. function _arrayWithHoles(arr) {
  14170. if (Array.isArray(arr)) return arr;
  14171. }
  14172. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14173. /***/ }),
  14174. /***/ 60:
  14175. /*!***************************************************************************************!*\
  14176. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  14177. \***************************************************************************************/
  14178. /*! no static exports found */
  14179. /***/ (function(module, exports, __webpack_require__) {
  14180. "use strict";
  14181. Object.defineProperty(exports, "__esModule", {
  14182. value: true
  14183. });
  14184. exports.default = void 0;
  14185. // 第一版 1.10.1 版本发布于2021-11-18
  14186. var version = '1.10.1';
  14187. var _default = {
  14188. v: version,
  14189. version: version,
  14190. // 主题名称
  14191. type: ['primary', 'success', 'info', 'error', 'warning']
  14192. };
  14193. exports.default = _default;
  14194. /***/ }),
  14195. /***/ 61:
  14196. /*!***************************************************************************************!*\
  14197. !*** C:/Users/Admin/Desktop/work/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  14198. \***************************************************************************************/
  14199. /*! no static exports found */
  14200. /***/ (function(module, exports, __webpack_require__) {
  14201. "use strict";
  14202. Object.defineProperty(exports, "__esModule", {
  14203. value: true
  14204. });
  14205. exports.default = void 0;
  14206. // uniapp在H5中各API的z-index值如下:
  14207. /**
  14208. * actionsheet: 999
  14209. * modal: 999
  14210. * navigate: 998
  14211. * tabbar: 998
  14212. * toast: 999
  14213. */
  14214. var _default = {
  14215. toast: 10090,
  14216. noNetwork: 10080,
  14217. // popup包含popup,actionsheet,keyboard,picker的值
  14218. popup: 10075,
  14219. mask: 10070,
  14220. navbar: 980,
  14221. topTips: 975,
  14222. sticky: 970,
  14223. indexListSticky: 965
  14224. };
  14225. exports.default = _default;
  14226. /***/ }),
  14227. /***/ 62:
  14228. /*!******************************************************!*\
  14229. !*** C:/Users/Admin/Desktop/work/mdapp/api/index.js ***!
  14230. \******************************************************/
  14231. /*! no static exports found */
  14232. /***/ (function(module, exports, __webpack_require__) {
  14233. "use strict";
  14234. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14235. Object.defineProperty(exports, "__esModule", {
  14236. value: true
  14237. });
  14238. exports.default = void 0;
  14239. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 63));
  14240. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 66));
  14241. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 67));
  14242. var _default = {
  14243. base: _base.default,
  14244. estate: _estate.default,
  14245. cust: _cust.default
  14246. };
  14247. exports.default = _default;
  14248. /***/ }),
  14249. /***/ 63:
  14250. /*!*****************************************************!*\
  14251. !*** C:/Users/Admin/Desktop/work/mdapp/api/base.js ***!
  14252. \*****************************************************/
  14253. /*! no static exports found */
  14254. /***/ (function(module, exports, __webpack_require__) {
  14255. "use strict";
  14256. Object.defineProperty(exports, "__esModule", {
  14257. value: true
  14258. });
  14259. exports.default = void 0;
  14260. var _http = __webpack_require__(/*! @/utils/http */ 64);
  14261. var _default = {
  14262. apilogin: function apilogin(params) {
  14263. // 登录
  14264. return (0, _http.request)('api/login', params, 'loading');
  14265. },
  14266. apiregister: function apiregister(params) {
  14267. // 注册
  14268. return (0, _http.request)('api/register', params, 'loading');
  14269. },
  14270. apisendsms: function apisendsms(params) {
  14271. // 发送短信
  14272. return (0, _http.request)('api/send/sms', params, 'loading');
  14273. },
  14274. apicaptcha: function apicaptcha(params) {
  14275. // 验证码图片
  14276. return (0, _http.request)('api/captcha', params, 'loading');
  14277. },
  14278. apicheckcaptcha: function apicheckcaptcha(params) {
  14279. // 检查手机号
  14280. return (0, _http.request)('api/check/captcha', params);
  14281. },
  14282. apiwxlogin: function apiwxlogin(params) {
  14283. // 微信登录
  14284. return (0, _http.request)('api/wx/login', params, 'loading');
  14285. },
  14286. apiwxautologin: function apiwxautologin(params) {
  14287. // 微信登录 自动
  14288. return (0, _http.request)('api/wx/autologin', params, 'loading');
  14289. },
  14290. apiuserinfo: function apiuserinfo(params) {
  14291. // 用户信息
  14292. return (0, _http.request)('api/user/info', params, 'loading');
  14293. },
  14294. apiuseredit: function apiuseredit(params) {
  14295. // 用户编辑
  14296. return (0, _http.request)('api/user/edit', params, 'loading');
  14297. },
  14298. apiuserbindwechat: function apiuserbindwechat(params) {
  14299. // 绑定微信
  14300. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  14301. },
  14302. apiuserauthadd: function apiuserauthadd(params) {
  14303. // 用户认证 - 提交认证
  14304. return (0, _http.request)('api/user/auth/add', params, 'loading');
  14305. },
  14306. apiuserauthinfo: function apiuserauthinfo(params) {
  14307. // 用户认证 - 认证详情
  14308. return (0, _http.request)('api/user/auth/info', params, 'loading');
  14309. },
  14310. apiuploadcloudpiv: function apiuploadcloudpiv(params) {
  14311. // 图片上传云接口
  14312. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  14313. },
  14314. apidicttree: function apidicttree(params) {
  14315. // 字典
  14316. return (0, _http.request)('api/dict/tree', params, 'loading');
  14317. },
  14318. apiuserauthlist: function apiuserauthlist(params) {
  14319. // 认证列表
  14320. return (0, _http.request)('api/user/auth/list', params, 'loading');
  14321. },
  14322. apiuserauthedit: function apiuserauthedit(params) {
  14323. // 认证 审核 中介
  14324. return (0, _http.request)('api/user/auth/edit', params, 'loading');
  14325. },
  14326. apideptauthedit: function apideptauthedit(params) {
  14327. // 认证 审核 渠道
  14328. return (0, _http.request)('api/dept/auth/edit', params, 'loading');
  14329. },
  14330. apiuserreferreredit: function apiuserreferreredit(params) {
  14331. // 修改推荐人
  14332. return (0, _http.request)('api/user/referrer/edit', params, 'loading');
  14333. },
  14334. apiusernoticeopen: function apiusernoticeopen(params) {
  14335. // 公众号 推送 打开
  14336. return (0, _http.request)('api/user/notice/open', params, 'loading');
  14337. },
  14338. apiusernoticeclose: function apiusernoticeclose(params) {
  14339. // 公众号 推送 关闭
  14340. return (0, _http.request)('api/user/notice/close', params, 'loading');
  14341. }
  14342. };
  14343. exports.default = _default;
  14344. /***/ }),
  14345. /***/ 64:
  14346. /*!*******************************************************!*\
  14347. !*** C:/Users/Admin/Desktop/work/mdapp/utils/http.js ***!
  14348. \*******************************************************/
  14349. /*! no static exports found */
  14350. /***/ (function(module, exports, __webpack_require__) {
  14351. "use strict";
  14352. /* WEBPACK VAR INJECTION */(function(uni) {
  14353. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14354. Object.defineProperty(exports, "__esModule", {
  14355. value: true
  14356. });
  14357. exports.request = request;
  14358. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  14359. var _utils = __webpack_require__(/*! @utils */ 65);
  14360. 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; }
  14361. 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; }
  14362. var Http = function Http() {
  14363. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  14364. data: {}
  14365. };
  14366. return new Promise(function (resolve, reject) {
  14367. if (options.loadingStr === 'loading') {
  14368. uni.showLoading({
  14369. mask: true,
  14370. title: '加载中..'
  14371. });
  14372. }
  14373. var token = uni.getStorageSync('MD_token') || '';
  14374. var header = {
  14375. 'Content-Type': 'application/json',
  14376. 'token': token
  14377. // 'Content-Type': 'application/x-www-form-urlencoded'
  14378. };
  14379. var params = _objectSpread({}, options.data);
  14380. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  14381. for (var key in options.data) {
  14382. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  14383. params[key] = '';
  14384. }
  14385. }
  14386. var url = uni.baseUrl + options.url;
  14387. // let url = options.url
  14388. if (options.queryData) {
  14389. var qStr = '';
  14390. for (var k in options.queryData) {
  14391. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  14392. }
  14393. qStr = qStr.substr(0, qStr.length - 1);
  14394. url += "?".concat(qStr);
  14395. }
  14396. uni.request({
  14397. url: url,
  14398. data: _objectSpread({}, params),
  14399. header: header,
  14400. method: options.method || 'POST',
  14401. complete: function complete(res) {
  14402. if (options.loadingStr === 'loading') {
  14403. uni.hideLoading();
  14404. }
  14405. },
  14406. success: function success(res) {
  14407. var cData = res.data;
  14408. var code = cData.errno;
  14409. switch (code) {
  14410. case 0:
  14411. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  14412. break;
  14413. case 401:
  14414. case 404:
  14415. case 405:
  14416. uni.removeStorageSync('MD_userInfo');
  14417. var u2 = uni.getStorageSync('MD_userInfo2');
  14418. if (u2.bind_wechat === '1' && uni.getStorageSync('MD_token')) {
  14419. uni.login({
  14420. success: function success(res) {
  14421. if (res.code) {
  14422. uni.api.base.apiwxautologin({
  14423. code: res.code
  14424. }).then(function (cData) {
  14425. if (cData.token === 'error') {
  14426. uni.removeStorageSync('MD_token');
  14427. } else {
  14428. uni.setStorageSync('MD_userInfo', cData);
  14429. uni.setStorageSync('MD_token', cData.token);
  14430. uni.api.base.apidicttree().then(function (res) {
  14431. var cObj = res || {};
  14432. var newDict = {};
  14433. for (var _k in cObj) {
  14434. var cArr = cObj[_k].map(function (item) {
  14435. return _objectSpread(_objectSpread({}, item), {}, {
  14436. key: item.dict_label,
  14437. val: item.dict_value
  14438. });
  14439. });
  14440. newDict[_k] = cArr;
  14441. }
  14442. uni.setStorageSync('MD_dict', newDict);
  14443. });
  14444. uni.api.base.apiuserinfo().then(function (res2) {
  14445. uni.setStorageSync('MD_userInfo2', res2);
  14446. uni.reLaunch({
  14447. url: '/pages/index/index'
  14448. });
  14449. });
  14450. }
  14451. });
  14452. }
  14453. }
  14454. });
  14455. } else {
  14456. uni.showToast({
  14457. title: "\u8BF7\u5148\u767B\u5F55~",
  14458. icon: 'none'
  14459. });
  14460. uni.navigateTo({
  14461. url: '/pages/user/login/login'
  14462. });
  14463. }
  14464. break;
  14465. default:
  14466. uni.showModal({
  14467. title: '提示',
  14468. content: "".concat(cData.errmsg, "(").concat(code, ")")
  14469. });
  14470. return reject(cData);
  14471. }
  14472. // resolve()
  14473. },
  14474. fail: function fail(err) {
  14475. console.log(err);
  14476. reject(err);
  14477. }
  14478. });
  14479. });
  14480. };
  14481. // export default Http
  14482. function request(url, data, loadingStr, queryData) {
  14483. return Http({
  14484. url: url,
  14485. data: data,
  14486. loadingStr: loadingStr,
  14487. queryData: queryData
  14488. });
  14489. }
  14490. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14491. /***/ }),
  14492. /***/ 65:
  14493. /*!********************************************************!*\
  14494. !*** C:/Users/Admin/Desktop/work/mdapp/utils/index.js ***!
  14495. \********************************************************/
  14496. /*! no static exports found */
  14497. /***/ (function(module, exports, __webpack_require__) {
  14498. "use strict";
  14499. Object.defineProperty(exports, "__esModule", {
  14500. value: true
  14501. });
  14502. exports.arrToObj = arrToObj;
  14503. exports.comGetTime = comGetTime;
  14504. exports.noEmpty = noEmpty;
  14505. exports.numFormat3 = numFormat3;
  14506. exports.strTrim = strTrim;
  14507. /**
  14508. * @param {string} str
  14509. * @returns {string}
  14510. */
  14511. function strTrim(str) {
  14512. return str.replace(/(^\s*)|(\s*$)/g, '');
  14513. }
  14514. /**
  14515. * @param {Number} num
  14516. * @returns {string}
  14517. */
  14518. function numFormat3(num) {
  14519. var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14520. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  14521. var arr = numArr[0].split('').reverse();
  14522. var res = [];
  14523. for (var i = 0; i < arr.length; i++) {
  14524. if (i % 3 === 0 && i !== 0) {
  14525. res.push(',');
  14526. }
  14527. res.push(arr[i]);
  14528. }
  14529. res.reverse();
  14530. if (numArr[1]) {
  14531. res = res.join('').concat('.' + numArr[1]);
  14532. } else {
  14533. res = res.join('');
  14534. }
  14535. // let res = num.toString().replace(/\d+/, function(n){
  14536. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  14537. // return $1 + ","
  14538. // })
  14539. // })
  14540. // toLocaleString()
  14541. return res;
  14542. }
  14543. /**
  14544. * @param {Array} arr
  14545. * @returns {Object}
  14546. */
  14547. function arrToObj(arr) {
  14548. var obj = {};
  14549. if (Object.prototype.toString.call(arr) === '[object Array]') {
  14550. if (arr.length > 0) {
  14551. arr.forEach(function (item) {
  14552. obj[item.val] = item.key;
  14553. });
  14554. }
  14555. }
  14556. return obj;
  14557. }
  14558. /**
  14559. * @param {any} val
  14560. * @returns {Boolean}
  14561. */
  14562. function noEmpty(val) {
  14563. if (val === null || val === undefined || val === '') {
  14564. return false;
  14565. } else {
  14566. return true;
  14567. }
  14568. }
  14569. /**
  14570. * @param {Number} date
  14571. * @param {Boolean} onlyDate
  14572. * @returns {String}
  14573. * function time(time = +new Date()) {
  14574. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  14575. return date.toJSON().substr(0, 19).replace('T', ' ');
  14576. }
  14577. */
  14578. function comGetTime() {
  14579. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
  14580. var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  14581. var year = date.getFullYear();
  14582. var month = date.getMonth() + 1;
  14583. month = month > 9 ? month : '0' + month;
  14584. var day = date.getDate();
  14585. day = day > 9 ? day : '0' + day;
  14586. var hour = date.getHours();
  14587. hour = hour > 9 ? hour : '0' + hour;
  14588. var minute = date.getMinutes();
  14589. minute = minute > 9 ? minute : '0' + minute;
  14590. var second = date.getSeconds();
  14591. second = second > 9 ? second : '0' + second;
  14592. var milli = date.getMilliseconds();
  14593. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  14594. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  14595. }
  14596. /***/ }),
  14597. /***/ 66:
  14598. /*!*******************************************************!*\
  14599. !*** C:/Users/Admin/Desktop/work/mdapp/api/estate.js ***!
  14600. \*******************************************************/
  14601. /*! no static exports found */
  14602. /***/ (function(module, exports, __webpack_require__) {
  14603. "use strict";
  14604. Object.defineProperty(exports, "__esModule", {
  14605. value: true
  14606. });
  14607. exports.default = void 0;
  14608. var _http = __webpack_require__(/*! @/utils/http */ 64);
  14609. var _default = {
  14610. apiestatelist: function apiestatelist(params) {
  14611. // 楼盘列表
  14612. return (0, _http.request)('api/estate/list', params, 'loading');
  14613. },
  14614. apiestatecontentdetail: function apiestatecontentdetail(params) {
  14615. // 楼盘 介绍详情
  14616. return (0, _http.request)('api/estate/content/detail', params, 'loading');
  14617. },
  14618. apireportadd: function apireportadd(params) {
  14619. // 报备 - 添加报备
  14620. return (0, _http.request)('api/report/add', params, 'loading');
  14621. },
  14622. apireportlist: function apireportlist(params) {
  14623. // 报备 - 报备列表
  14624. return (0, _http.request)('api/report/list', params, 'loading');
  14625. },
  14626. apireportdetail: function apireportdetail(params) {
  14627. // 报备 - 报备详情
  14628. return (0, _http.request)('api/report/detail', params, 'loading');
  14629. },
  14630. apireport2detail: function apireport2detail(params) {
  14631. // 报备 - 报备详情2 普通的报备详情
  14632. return (0, _http.request)('api/report2/detail', params, 'loading');
  14633. },
  14634. apigoverndetail: function apigoverndetail(params) {
  14635. // 报备 - 报备详情 /govern/detail
  14636. return (0, _http.request)('api/govern/detail', params, 'loading');
  14637. },
  14638. apireportsite: function apireportsite(params) {
  14639. // 案场 - 报备详情
  14640. return (0, _http.request)('api/report/site', params, 'loading');
  14641. },
  14642. apireportconfirm: function apireportconfirm(params) {
  14643. // 报备 - 报备确认
  14644. return (0, _http.request)('api/report/confirm', params, 'loading');
  14645. },
  14646. apireportcount: function apireportcount(params) {
  14647. // 报备 - 报备统计
  14648. return (0, _http.request)('api/report/count', params, 'loading');
  14649. },
  14650. apireportgroupcount: function apireportgroupcount(params) {
  14651. // 报备 - 报备分组统计
  14652. return (0, _http.request)('api/report/group/count', params, 'loading');
  14653. },
  14654. apiestateinfodetail: function apiestateinfodetail(params) {
  14655. // 楼盘一页纸
  14656. return (0, _http.request)('api/estate/info/detail', params, 'loading');
  14657. },
  14658. apiestatedetail: function apiestatedetail(params) {
  14659. // 楼盘详情 copy plus
  14660. return (0, _http.request)('api/estate/detail', params, 'loading');
  14661. },
  14662. apigovernlist: function apigovernlist(params) {
  14663. // 案场缺课列表
  14664. return (0, _http.request)('api/govern/list', params, 'loading');
  14665. },
  14666. apireportedit: function apireportedit(params) {
  14667. // 报备修改 接口
  14668. return (0, _http.request)('api/report/edit', params, 'loading');
  14669. },
  14670. apireportsubscrlist: function apireportsubscrlist(params) {
  14671. // 认购审核列表
  14672. return (0, _http.request)('api/report/subscr/list', params, 'loading');
  14673. },
  14674. apireportsubscrDeal: function apireportsubscrDeal(params) {
  14675. // 已认购审核
  14676. return (0, _http.request)('api/report/subscr', params, 'loading');
  14677. },
  14678. apireportsignupDeal: function apireportsignupDeal(params) {
  14679. // 已签约审核
  14680. return (0, _http.request)('api/report/signup', params, 'loading');
  14681. },
  14682. apiestateliblist: function apiestateliblist(params) {
  14683. // 内部 各楼盘各平台佣金汇集
  14684. return (0, _http.request)('api/estate/lib/list', params, 'loading');
  14685. },
  14686. apiestatelibdetail: function apiestatelibdetail(params) {
  14687. // 内部 各楼盘各平台佣金汇集 详情
  14688. return (0, _http.request)('api/estate/lib/detail', params, 'loading');
  14689. }
  14690. };
  14691. exports.default = _default;
  14692. /***/ }),
  14693. /***/ 67:
  14694. /*!*****************************************************!*\
  14695. !*** C:/Users/Admin/Desktop/work/mdapp/api/cust.js ***!
  14696. \*****************************************************/
  14697. /*! no static exports found */
  14698. /***/ (function(module, exports, __webpack_require__) {
  14699. "use strict";
  14700. Object.defineProperty(exports, "__esModule", {
  14701. value: true
  14702. });
  14703. exports.default = void 0;
  14704. var _http = __webpack_require__(/*! @/utils/http */ 64);
  14705. var _default = {
  14706. apicustomerlist: function apicustomerlist(params) {
  14707. // 客户 列表
  14708. return (0, _http.request)('api/customer/list', params);
  14709. },
  14710. apicustomeradd: function apicustomeradd(params) {
  14711. // 客户 添加
  14712. return (0, _http.request)('api/customer/add', params, 'loading');
  14713. },
  14714. apicustomeredit: function apicustomeredit(params) {
  14715. // 客户 编辑
  14716. return (0, _http.request)('api/customer/edit', params, 'loading');
  14717. },
  14718. apicustomerdel: function apicustomerdel(params) {
  14719. // 客户 删除
  14720. return (0, _http.request)('api/customer/del', params, 'loading');
  14721. },
  14722. apicustomerdetail: function apicustomerdetail(params) {
  14723. // 客户 详情
  14724. return (0, _http.request)('api/customer/detail', params, 'loading');
  14725. },
  14726. apireportvisitchange: function apireportvisitchange(params) {
  14727. // 到访材料添加
  14728. return (0, _http.request)('api/report/visit/change', params, 'loading');
  14729. },
  14730. apireportvisitdetail: function apireportvisitdetail(params) {
  14731. // 到访材料详情
  14732. return (0, _http.request)('api/report/visit/detail', params, 'loading');
  14733. },
  14734. apireportvisit: function apireportvisit(params) {
  14735. // 报备到访
  14736. return (0, _http.request)('api/report/visit', params, 'loading');
  14737. },
  14738. apireportverify: function apireportverify(params) {
  14739. // 报备审核
  14740. return (0, _http.request)('api/report/verify', params, 'loading');
  14741. },
  14742. apideptuserlist: function apideptuserlist(params) {
  14743. // 我的门店下级人员
  14744. return (0, _http.request)('api/dept/user/list', params, 'loading');
  14745. },
  14746. apiprivatecustomerlist: function apiprivatecustomerlist(params) {
  14747. // 内部客户 列表
  14748. return (0, _http.request)('api/private/customer/list', params);
  14749. },
  14750. apiprivatecustomeradd: function apiprivatecustomeradd(params) {
  14751. // 内部客户 添加
  14752. return (0, _http.request)('api/private/customer/add', params, 'loading');
  14753. },
  14754. apiprivatecustomeredit: function apiprivatecustomeredit(params) {
  14755. // 内部客户 编辑
  14756. return (0, _http.request)('api/private/customer/edit', params, 'loading');
  14757. },
  14758. apiprivatecustomerdel: function apiprivatecustomerdel(params) {
  14759. // 内部客户 删除
  14760. return (0, _http.request)('api/private/customer/del', params, 'loading');
  14761. },
  14762. apiprivatecustomerdetail: function apiprivatecustomerdetail(params) {
  14763. // 内部客户 详情
  14764. return (0, _http.request)('api/private/customer/detail', params, 'loading');
  14765. },
  14766. apiprivaterecordlist: function apiprivaterecordlist(params) {
  14767. // 内部客户 - 跟进记录 - 列表
  14768. return (0, _http.request)('api/private/record/list', params);
  14769. },
  14770. apiprivaterecordadd: function apiprivaterecordadd(params) {
  14771. // 内部客户 - 跟进记录 - 添加
  14772. return (0, _http.request)('api/private/record/add', params, 'loading');
  14773. },
  14774. apiprivaterecordedit: function apiprivaterecordedit(params) {
  14775. // 内部客户 - 跟进记录 - 编辑
  14776. return (0, _http.request)('api/private/record/edit', params, 'loading');
  14777. },
  14778. apiprivaterecorddel: function apiprivaterecorddel(params) {
  14779. // 内部客户 - 跟进记录 - 删除
  14780. return (0, _http.request)('api/private/record/del', params, 'loading');
  14781. },
  14782. apirecordremindcount: function apirecordremindcount(params) {
  14783. // 内部客户 - 跟进记录 - 数量统计
  14784. return (0, _http.request)('api/record/remind/count', params, 'loading');
  14785. }
  14786. };
  14787. exports.default = _default;
  14788. /***/ }),
  14789. /***/ 68:
  14790. /*!*******************************************************!*\
  14791. !*** C:/Users/Admin/Desktop/work/mdapp/utils/tool.js ***!
  14792. \*******************************************************/
  14793. /*! no static exports found */
  14794. /***/ (function(module, exports, __webpack_require__) {
  14795. "use strict";
  14796. /* WEBPACK VAR INJECTION */(function(uni) {
  14797. Object.defineProperty(exports, "__esModule", {
  14798. value: true
  14799. });
  14800. exports.msgBase = exports.getRandomNum = exports.confirmMsgFn = void 0;
  14801. var getRandomNum = function getRandomNum(len, radix) {
  14802. // getRandomNum(24, 16)
  14803. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  14804. var uuid = [];
  14805. radix = radix || chars.length;
  14806. if (len) {
  14807. // Compact form
  14808. for (var i = 0; i < len; i++) {
  14809. uuid[i] = chars[0 | Math.random() * radix];
  14810. }
  14811. } else {
  14812. // rfc4122, version 4 form
  14813. var r;
  14814. // rfc4122 requires these characters
  14815. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  14816. uuid[14] = '4';
  14817. // Fill in random data.  At i==19 set the high bits of clock sequence as
  14818. // per rfc4122, sec. 4.1.5
  14819. for (var _i = 0; _i < 36; _i++) {
  14820. if (!uuid[_i]) {
  14821. r = 0 | Math.random() * 16;
  14822. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  14823. }
  14824. }
  14825. }
  14826. return uuid.join('') + new Date().getTime();
  14827. };
  14828. exports.getRandomNum = getRandomNum;
  14829. var msgBase = function msgBase(msgText, bc) {
  14830. uni.showToast({
  14831. title: msgText,
  14832. icon: 'none',
  14833. duration: 2000
  14834. }).then(function () {
  14835. if (bc) bc();
  14836. });
  14837. };
  14838. exports.msgBase = msgBase;
  14839. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {
  14840. var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  14841. uni.showModal({
  14842. title: title,
  14843. content: msgText,
  14844. success: function success(res) {
  14845. if (res.confirm) {
  14846. if (successBc) successBc();
  14847. } else if (res.cancel) {
  14848. if (errorBc) errorBc();
  14849. }
  14850. }
  14851. });
  14852. };
  14853. exports.confirmMsgFn = confirmMsgFn;
  14854. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14855. /***/ }),
  14856. /***/ 7:
  14857. /*!*********************************************************************!*\
  14858. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  14859. \*********************************************************************/
  14860. /*! no static exports found */
  14861. /***/ (function(module, exports) {
  14862. function _iterableToArrayLimit(arr, i) {
  14863. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  14864. if (null != _i) {
  14865. var _s,
  14866. _e,
  14867. _x,
  14868. _r,
  14869. _arr = [],
  14870. _n = !0,
  14871. _d = !1;
  14872. try {
  14873. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  14874. if (Object(_i) !== _i) return;
  14875. _n = !1;
  14876. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  14877. ;
  14878. }
  14879. } catch (err) {
  14880. _d = !0, _e = err;
  14881. } finally {
  14882. try {
  14883. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  14884. } finally {
  14885. if (_d) throw _e;
  14886. }
  14887. }
  14888. return _arr;
  14889. }
  14890. }
  14891. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14892. /***/ }),
  14893. /***/ 8:
  14894. /*!***************************************************************************!*\
  14895. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  14896. \***************************************************************************/
  14897. /*! no static exports found */
  14898. /***/ (function(module, exports, __webpack_require__) {
  14899. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  14900. function _unsupportedIterableToArray(o, minLen) {
  14901. if (!o) return;
  14902. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  14903. var n = Object.prototype.toString.call(o).slice(8, -1);
  14904. if (n === "Object" && o.constructor) n = o.constructor.name;
  14905. if (n === "Map" || n === "Set") return Array.from(o);
  14906. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  14907. }
  14908. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14909. /***/ }),
  14910. /***/ 9:
  14911. /*!*****************************************************************!*\
  14912. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  14913. \*****************************************************************/
  14914. /*! no static exports found */
  14915. /***/ (function(module, exports) {
  14916. function _arrayLikeToArray(arr, len) {
  14917. if (len == null || len > arr.length) len = arr.length;
  14918. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  14919. arr2[i] = arr[i];
  14920. }
  14921. return arr2;
  14922. }
  14923. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14924. /***/ })
  14925. }]);
  14926. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map