vendor.js 483 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function _toPropertyKey(arg) {
  84. var key = toPrimitive(arg, "string");
  85. return _typeof(key) === "symbol" ? key : String(key);
  86. }
  87. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 123:
  90. /*!************************************************!*\
  91. !*** E:/work/mdapp/js_sdk/xb-copy/uni-copy.js ***!
  92. \************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports, __webpack_require__) {
  95. "use strict";
  96. /* WEBPACK VAR INJECTION */(function(uni) {
  97. Object.defineProperty(exports, "__esModule", {
  98. value: true
  99. });
  100. exports.default = uniCopy;
  101. function uniCopy(_ref) {
  102. var content = _ref.content,
  103. _success = _ref.success,
  104. error = _ref.error;
  105. if (!content) return error('复制的内容不能为空 !');
  106. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  107. /**
  108. * 小程序端 和 app端的复制逻辑
  109. */
  110. uni.setClipboardData({
  111. data: content,
  112. success: function success() {
  113. _success("复制成功~");
  114. console.log('success');
  115. },
  116. fail: function fail() {
  117. _success("复制失败~");
  118. }
  119. });
  120. /**
  121. * H5端的复制逻辑
  122. */
  123. }
  124. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  125. /***/ }),
  126. /***/ 13:
  127. /*!*******************************************************!*\
  128. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  129. \*******************************************************/
  130. /*! no static exports found */
  131. /***/ (function(module, exports) {
  132. function _typeof(obj) {
  133. "@babel/helpers - typeof";
  134. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  135. return typeof obj;
  136. } : function (obj) {
  137. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  138. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  139. }
  140. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  141. /***/ }),
  142. /***/ 14:
  143. /*!************************************************************!*\
  144. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  145. \************************************************************/
  146. /*! no static exports found */
  147. /***/ (function(module, exports, __webpack_require__) {
  148. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  149. function _toPrimitive(input, hint) {
  150. if (_typeof(input) !== "object" || input === null) return input;
  151. var prim = input[Symbol.toPrimitive];
  152. if (prim !== undefined) {
  153. var res = prim.call(input, hint || "default");
  154. if (_typeof(res) !== "object") return res;
  155. throw new TypeError("@@toPrimitive must return a primitive value.");
  156. }
  157. return (hint === "string" ? String : Number)(input);
  158. }
  159. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  160. /***/ }),
  161. /***/ 148:
  162. /*!*************************************!*\
  163. !*** E:/work/mdapp/utils/qrcode.js ***!
  164. \*************************************/
  165. /*! no static exports found */
  166. /***/ (function(module, exports, __webpack_require__) {
  167. "use strict";
  168. /* WEBPACK VAR INJECTION */(function(uni) {
  169. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  170. Object.defineProperty(exports, "__esModule", {
  171. value: true
  172. });
  173. exports.default = void 0;
  174. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  175. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  176. /**
  177. * qrcode-wx-miniprogram
  178. */
  179. var QRMode = {
  180. MODE_NUMBER: 1 << 0,
  181. MODE_ALPHA_NUM: 1 << 1,
  182. MODE_8BIT_BYTE: 1 << 2,
  183. MODE_KANJI: 1 << 3
  184. },
  185. QRErrorCorrectLevel = {
  186. L: 1,
  187. M: 0,
  188. Q: 3,
  189. H: 2
  190. },
  191. QRMaskPattern = {
  192. PATTERN000: 0,
  193. PATTERN001: 1,
  194. PATTERN010: 2,
  195. PATTERN011: 3,
  196. PATTERN100: 4,
  197. PATTERN101: 5,
  198. PATTERN110: 6,
  199. PATTERN111: 7
  200. },
  201. QRUtil = {
  202. 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]],
  203. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  204. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  205. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  206. getBCHTypeInfo: function getBCHTypeInfo(data) {
  207. var d = data << 10;
  208. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  209. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  210. }
  211. return (data << 10 | d) ^ QRUtil.G15_MASK;
  212. },
  213. getBCHTypeNumber: function getBCHTypeNumber(data) {
  214. var d = data << 12;
  215. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  216. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  217. }
  218. return data << 12 | d;
  219. },
  220. getBCHDigit: function getBCHDigit(data) {
  221. var digit = 0;
  222. while (data != 0) {
  223. digit++;
  224. data >>>= 1;
  225. }
  226. return digit;
  227. },
  228. getPatternPosition: function getPatternPosition(typeNumber) {
  229. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  230. },
  231. getMask: function getMask(maskPattern, i, j) {
  232. switch (maskPattern) {
  233. case QRMaskPattern.PATTERN000:
  234. return (i + j) % 2 == 0;
  235. case QRMaskPattern.PATTERN001:
  236. return i % 2 == 0;
  237. case QRMaskPattern.PATTERN010:
  238. return j % 3 == 0;
  239. case QRMaskPattern.PATTERN011:
  240. return (i + j) % 3 == 0;
  241. case QRMaskPattern.PATTERN100:
  242. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  243. case QRMaskPattern.PATTERN101:
  244. return i * j % 2 + i * j % 3 == 0;
  245. case QRMaskPattern.PATTERN110:
  246. return (i * j % 2 + i * j % 3) % 2 == 0;
  247. case QRMaskPattern.PATTERN111:
  248. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  249. default:
  250. //throw new Error("bad maskPattern:" + maskPattern);
  251. throwError("bad maskPattern:" + maskPattern);
  252. }
  253. },
  254. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  255. var a = new QRPolynomial([1], 0);
  256. for (var i = 0; i < errorCorrectLength; i++) {
  257. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  258. }
  259. return a;
  260. },
  261. getLengthInBits: function getLengthInBits(mode, type) {
  262. if (1 <= type && type < 10) {
  263. switch (mode) {
  264. case QRMode.MODE_NUMBER:
  265. return 10;
  266. case QRMode.MODE_ALPHA_NUM:
  267. return 9;
  268. case QRMode.MODE_8BIT_BYTE:
  269. return 8;
  270. case QRMode.MODE_KANJI:
  271. return 8;
  272. default:
  273. //throw new Error("mode:" + mode);
  274. throwError("mode:" + mode);
  275. }
  276. } else if (type < 27) {
  277. switch (mode) {
  278. case QRMode.MODE_NUMBER:
  279. return 12;
  280. case QRMode.MODE_ALPHA_NUM:
  281. return 11;
  282. case QRMode.MODE_8BIT_BYTE:
  283. return 16;
  284. case QRMode.MODE_KANJI:
  285. return 10;
  286. default:
  287. //throw new Error("mode:" + mode);
  288. throwError("mode:" + mode);
  289. }
  290. } else if (type < 41) {
  291. switch (mode) {
  292. case QRMode.MODE_NUMBER:
  293. return 14;
  294. case QRMode.MODE_ALPHA_NUM:
  295. return 13;
  296. case QRMode.MODE_8BIT_BYTE:
  297. return 16;
  298. case QRMode.MODE_KANJI:
  299. return 12;
  300. default:
  301. //throw new Error("mode:" + mode);
  302. throwError("mode:" + mode);
  303. }
  304. } else {
  305. //throw new Error("type:" + type);
  306. throwError("type:" + type);
  307. }
  308. },
  309. getLostPoint: function getLostPoint(qrCode) {
  310. var moduleCount = qrCode.getModuleCount();
  311. var lostPoint = 0;
  312. for (var row = 0; row < moduleCount; row++) {
  313. for (var col = 0; col < moduleCount; col++) {
  314. var sameCount = 0;
  315. var dark = qrCode.isDark(row, col);
  316. for (var r = -1; r <= 1; r++) {
  317. if (row + r < 0 || moduleCount <= row + r) {
  318. continue;
  319. }
  320. for (var c = -1; c <= 1; c++) {
  321. if (col + c < 0 || moduleCount <= col + c) {
  322. continue;
  323. }
  324. if (r == 0 && c == 0) {
  325. continue;
  326. }
  327. if (dark == qrCode.isDark(row + r, col + c)) {
  328. sameCount++;
  329. }
  330. }
  331. }
  332. if (sameCount > 5) {
  333. lostPoint += 3 + sameCount - 5;
  334. }
  335. }
  336. }
  337. for (var row = 0; row < moduleCount - 1; row++) {
  338. for (var col = 0; col < moduleCount - 1; col++) {
  339. var count = 0;
  340. if (qrCode.isDark(row, col)) count++;
  341. if (qrCode.isDark(row + 1, col)) count++;
  342. if (qrCode.isDark(row, col + 1)) count++;
  343. if (qrCode.isDark(row + 1, col + 1)) count++;
  344. if (count == 0 || count == 4) {
  345. lostPoint += 3;
  346. }
  347. }
  348. }
  349. for (var row = 0; row < moduleCount; row++) {
  350. for (var col = 0; col < moduleCount - 6; col++) {
  351. 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)) {
  352. lostPoint += 40;
  353. }
  354. }
  355. }
  356. for (var col = 0; col < moduleCount; col++) {
  357. for (var row = 0; row < moduleCount - 6; row++) {
  358. 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)) {
  359. lostPoint += 40;
  360. }
  361. }
  362. }
  363. var darkCount = 0;
  364. for (var col = 0; col < moduleCount; col++) {
  365. for (var row = 0; row < moduleCount; row++) {
  366. if (qrCode.isDark(row, col)) {
  367. darkCount++;
  368. }
  369. }
  370. }
  371. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  372. lostPoint += ratio * 10;
  373. return lostPoint;
  374. }
  375. },
  376. QRMath = {
  377. glog: function glog(n) {
  378. if (n < 1) {
  379. //throw new Error("glog(" + n + ")");
  380. throwError("glog(" + n + ")");
  381. }
  382. return QRMath.LOG_TABLE[n];
  383. },
  384. gexp: function gexp(n) {
  385. while (n < 0) {
  386. n += 255;
  387. }
  388. while (n >= 256) {
  389. n -= 255;
  390. }
  391. return QRMath.EXP_TABLE[n];
  392. },
  393. EXP_TABLE: new Array(256),
  394. LOG_TABLE: new Array(256)
  395. };
  396. for (var i = 0; i < 8; i++) {
  397. QRMath.EXP_TABLE[i] = 1 << i;
  398. }
  399. for (var _i = 8; _i < 256; _i++) {
  400. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.EXP_TABLE[_i - 8];
  401. }
  402. for (var _i2 = 0; _i2 < 255; _i2++) {
  403. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  404. }
  405. /*
  406. * class QR8bitByte
  407. * */
  408. var QR8bitByte = /*#__PURE__*/function () {
  409. function QR8bitByte(data) {
  410. (0, _classCallCheck2.default)(this, QR8bitByte);
  411. this.mode = QRMode.MODE_8BIT_BYTE;
  412. this.data = data;
  413. this.parsedData = [];
  414. // Added to support UTF-8 Characters
  415. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  416. var byteArray = [],
  417. code = this.data.charCodeAt(_i3);
  418. if (code > 0x10000) {
  419. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  420. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  421. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  422. byteArray[3] = 0x80 | code & 0x3F;
  423. } else if (code > 0x800) {
  424. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  425. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  426. byteArray[2] = 0x80 | code & 0x3F;
  427. } else if (code > 0x80) {
  428. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  429. byteArray[1] = 0x80 | code & 0x3F;
  430. } else {
  431. byteArray[0] = code;
  432. }
  433. this.parsedData.push(byteArray);
  434. }
  435. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  436. if (this.parsedData.length !== this.data.length) {
  437. this.parsedData.unshift(191);
  438. this.parsedData.unshift(187);
  439. this.parsedData.unshift(239);
  440. }
  441. }
  442. (0, _createClass2.default)(QR8bitByte, [{
  443. key: "getLength",
  444. value: function getLength(buffer) {
  445. return this.parsedData.length;
  446. }
  447. }, {
  448. key: "write",
  449. value: function write(buffer) {
  450. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  451. buffer.put(this.parsedData[_i4], 8);
  452. }
  453. }
  454. }]);
  455. return QR8bitByte;
  456. }();
  457. /*
  458. * class QRCodeModel
  459. * */
  460. var QRCodeModel = /*#__PURE__*/function () {
  461. function QRCodeModel(typeNumber, errorCorrectLevel) {
  462. (0, _classCallCheck2.default)(this, QRCodeModel);
  463. this.typeNumber = typeNumber;
  464. this.errorCorrectLevel = errorCorrectLevel;
  465. this.modules = null;
  466. this.moduleCount = 0;
  467. this.dataCache = null;
  468. this.dataList = [];
  469. }
  470. (0, _createClass2.default)(QRCodeModel, [{
  471. key: "addData",
  472. value: function addData(data) {
  473. var newData = new QR8bitByte(data);
  474. this.dataList.push(newData);
  475. this.dataCache = null;
  476. }
  477. }, {
  478. key: "isDark",
  479. value: function isDark(row, col) {
  480. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  481. //throw new Error(row + ',' + col);
  482. throwError(row + ',' + col);
  483. }
  484. return this.modules[row][col];
  485. }
  486. }, {
  487. key: "getModuleCount",
  488. value: function getModuleCount() {
  489. return this.moduleCount;
  490. }
  491. }, {
  492. key: "make",
  493. value: function make() {
  494. this.makeImpl(false, this.getBestMaskPattern());
  495. }
  496. }, {
  497. key: "makeImpl",
  498. value: function makeImpl(test, maskPattern) {
  499. this.moduleCount = this.typeNumber * 4 + 17;
  500. this.modules = new Array(this.moduleCount);
  501. for (var row = 0; row < this.moduleCount; row++) {
  502. this.modules[row] = new Array(this.moduleCount);
  503. for (var col = 0; col < this.moduleCount; col++) {
  504. this.modules[row][col] = null;
  505. }
  506. }
  507. this.setupPositionProbePattern(0, 0);
  508. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  509. this.setupPositionProbePattern(0, this.moduleCount - 7);
  510. this.setupPositionAdjustPattern();
  511. this.setupTimingPattern();
  512. this.setupTypeInfo(test, maskPattern);
  513. if (this.typeNumber >= 7) {
  514. this.setupTypeNumber(test);
  515. }
  516. if (this.dataCache == null) {
  517. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  518. }
  519. this.mapData(this.dataCache, maskPattern);
  520. }
  521. }, {
  522. key: "setupPositionProbePattern",
  523. value: function setupPositionProbePattern(row, col) {
  524. for (var r = -1; r <= 7; r++) {
  525. if (row + r <= -1 || this.moduleCount <= row + r) {
  526. continue;
  527. }
  528. for (var c = -1; c <= 7; c++) {
  529. if (col + c <= -1 || this.moduleCount <= col + c) {
  530. continue;
  531. }
  532. 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;
  533. }
  534. }
  535. }
  536. }, {
  537. key: "getBestMaskPattern",
  538. value: function getBestMaskPattern() {
  539. var minLostPoint = 0,
  540. pattern = 0;
  541. for (var _i5 = 0; _i5 < 8; _i5++) {
  542. this.makeImpl(true, _i5);
  543. var lostPoint = QRUtil.getLostPoint(this);
  544. if (_i5 == 0 || minLostPoint > lostPoint) {
  545. minLostPoint = lostPoint;
  546. pattern = _i5;
  547. }
  548. }
  549. return pattern;
  550. }
  551. }, {
  552. key: "setupTimingPattern",
  553. value: function setupTimingPattern() {
  554. for (var r = 8; r < this.moduleCount - 8; r++) {
  555. if (this.modules[r][6] != null) {
  556. continue;
  557. }
  558. this.modules[r][6] = r % 2 == 0;
  559. }
  560. for (var c = 8; c < this.moduleCount - 8; c++) {
  561. if (this.modules[6][c] != null) {
  562. continue;
  563. }
  564. this.modules[6][c] = c % 2 == 0;
  565. }
  566. }
  567. }, {
  568. key: "setupPositionAdjustPattern",
  569. value: function setupPositionAdjustPattern() {
  570. var pos = QRUtil.getPatternPosition(this.typeNumber);
  571. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  572. for (var j = 0; j < pos.length; j++) {
  573. var row = pos[_i6],
  574. col = pos[j];
  575. if (this.modules[row][col] != null) {
  576. continue;
  577. }
  578. for (var r = -2; r <= 2; r++) {
  579. for (var c = -2; c <= 2; c++) {
  580. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0;
  581. }
  582. }
  583. }
  584. }
  585. }
  586. }, {
  587. key: "setupTypeNumber",
  588. value: function setupTypeNumber(test) {
  589. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  590. for (var _i7 = 0; _i7 < 18; _i7++) {
  591. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  592. }
  593. for (var _i8 = 0; _i8 < 18; _i8++) {
  594. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  595. }
  596. }
  597. }, {
  598. key: "setupTypeInfo",
  599. value: function setupTypeInfo(test, maskPattern) {
  600. var data = this.errorCorrectLevel << 3 | maskPattern,
  601. bits = QRUtil.getBCHTypeInfo(data);
  602. for (var _i9 = 0; _i9 < 15; _i9++) {
  603. var mod = !test && (bits >> _i9 & 1) == 1;
  604. if (_i9 < 6) {
  605. this.modules[_i9][8] = mod;
  606. } else if (_i9 < 8) {
  607. this.modules[_i9 + 1][8] = mod;
  608. } else {
  609. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  610. }
  611. }
  612. for (var _i10 = 0; _i10 < 15; _i10++) {
  613. var _mod = !test && (bits >> _i10 & 1) == 1;
  614. if (_i10 < 8) {
  615. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  616. } else if (_i10 < 9) {
  617. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  618. } else {
  619. this.modules[8][15 - _i10 - 1] = _mod;
  620. }
  621. }
  622. this.modules[this.moduleCount - 8][8] = !test;
  623. }
  624. }, {
  625. key: "mapData",
  626. value: function mapData(data, maskPattern) {
  627. var inc = -1,
  628. row = this.moduleCount - 1,
  629. bitIndex = 7,
  630. byteIndex = 0;
  631. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  632. if (col == 6) col--;
  633. while (true) {
  634. for (var c = 0; c < 2; c++) {
  635. if (this.modules[row][col - c] == null) {
  636. var dark = false;
  637. if (byteIndex < data.length) {
  638. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  639. }
  640. var mask = QRUtil.getMask(maskPattern, row, col - c);
  641. if (mask) {
  642. dark = !dark;
  643. }
  644. this.modules[row][col - c] = dark;
  645. bitIndex--;
  646. if (bitIndex == -1) {
  647. byteIndex++;
  648. bitIndex = 7;
  649. }
  650. }
  651. }
  652. row += inc;
  653. if (row < 0 || this.moduleCount <= row) {
  654. row -= inc;
  655. inc = -inc;
  656. break;
  657. }
  658. }
  659. }
  660. }
  661. }]);
  662. return QRCodeModel;
  663. }();
  664. QRCodeModel.PAD0 = 0xEC;
  665. QRCodeModel.PAD1 = 0x11;
  666. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  667. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  668. buffer = new QRBitBuffer();
  669. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  670. var data = dataList[_i11];
  671. buffer.put(data.mode, 4);
  672. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  673. data.write(buffer);
  674. }
  675. var totalDataCount = 0;
  676. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  677. totalDataCount += rsBlocks[_i12].dataCount;
  678. }
  679. if (buffer.getLengthInBits() > totalDataCount * 8) {
  680. /*
  681. throw new Error("code length overflow. (" +
  682. buffer.getLengthInBits() +
  683. ">" +
  684. totalDataCount * 8 +
  685. ")");
  686. */
  687. throwError("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
  688. }
  689. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  690. buffer.put(0, 4);
  691. }
  692. while (buffer.getLengthInBits() % 8 != 0) {
  693. buffer.putBit(false);
  694. }
  695. while (true) {
  696. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  697. break;
  698. }
  699. buffer.put(QRCodeModel.PAD0, 8);
  700. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  701. break;
  702. }
  703. buffer.put(QRCodeModel.PAD1, 8);
  704. }
  705. return QRCodeModel.createBytes(buffer, rsBlocks);
  706. };
  707. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  708. var offset = 0,
  709. maxDcCount = 0,
  710. maxEcCount = 0,
  711. dcData = new Array(rsBlocks.length),
  712. ecData = new Array(rsBlocks.length);
  713. for (var r = 0; r < rsBlocks.length; r++) {
  714. var dcCount = rsBlocks[r].dataCount,
  715. ecCount = rsBlocks[r].totalCount - dcCount;
  716. maxDcCount = Math.max(maxDcCount, dcCount);
  717. maxEcCount = Math.max(maxEcCount, ecCount);
  718. dcData[r] = new Array(dcCount);
  719. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  720. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  721. }
  722. offset += dcCount;
  723. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  724. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  725. modPoly = rawPoly.mod(rsPoly);
  726. ecData[r] = new Array(rsPoly.getLength() - 1);
  727. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  728. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  729. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  730. }
  731. }
  732. var totalCodeCount = 0;
  733. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  734. totalCodeCount += rsBlocks[_i15].totalCount;
  735. }
  736. var data = new Array(totalCodeCount),
  737. index = 0;
  738. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  739. for (var _r = 0; _r < rsBlocks.length; _r++) {
  740. if (_i16 < dcData[_r].length) {
  741. data[index++] = dcData[_r][_i16];
  742. }
  743. }
  744. }
  745. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  746. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  747. if (_i17 < ecData[_r2].length) {
  748. data[index++] = ecData[_r2][_i17];
  749. }
  750. }
  751. }
  752. return data;
  753. };
  754. /*
  755. * class QRPolynomial
  756. * */
  757. var QRPolynomial = /*#__PURE__*/function () {
  758. function QRPolynomial(num, shift) {
  759. (0, _classCallCheck2.default)(this, QRPolynomial);
  760. if (num.length == undefined) {
  761. //throw new Error(num.length + '/' + shift);
  762. throwError(num.length + '/' + shift);
  763. }
  764. var offset = 0;
  765. while (offset < num.length && num[offset] == 0) {
  766. offset++;
  767. }
  768. this.num = new Array(num.length - offset + shift);
  769. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  770. this.num[_i18] = num[_i18 + offset];
  771. }
  772. }
  773. (0, _createClass2.default)(QRPolynomial, [{
  774. key: "get",
  775. value: function get(index) {
  776. return this.num[index];
  777. }
  778. }, {
  779. key: "getLength",
  780. value: function getLength() {
  781. return this.num.length;
  782. }
  783. }, {
  784. key: "multiply",
  785. value: function multiply(e) {
  786. var num = new Array(this.getLength() + e.getLength() - 1);
  787. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  788. for (var j = 0; j < e.getLength(); j++) {
  789. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  790. }
  791. }
  792. return new QRPolynomial(num, 0);
  793. }
  794. }, {
  795. key: "mod",
  796. value: function mod(e) {
  797. if (this.getLength() - e.getLength() < 0) {
  798. return this;
  799. }
  800. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  801. num = new Array(this.getLength());
  802. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  803. num[_i20] = this.get(_i20);
  804. }
  805. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  806. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  807. }
  808. return new QRPolynomial(num, 0).mod(e);
  809. }
  810. }]);
  811. return QRPolynomial;
  812. }();
  813. /*
  814. * class QRRSBlock
  815. * */
  816. var QRRSBlock = /*#__PURE__*/(0, _createClass2.default)(function QRRSBlock(totalCount, dataCount) {
  817. (0, _classCallCheck2.default)(this, QRRSBlock);
  818. this.totalCount = totalCount;
  819. this.dataCount = dataCount;
  820. });
  821. 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]];
  822. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  823. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  824. if (!rsBlock) {
  825. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  826. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  827. }
  828. var length = rsBlock.length / 3,
  829. list = [];
  830. for (var _i22 = 0; _i22 < length; _i22++) {
  831. var count = rsBlock[_i22 * 3],
  832. totalCount = rsBlock[_i22 * 3 + 1],
  833. dataCount = rsBlock[_i22 * 3 + 2];
  834. for (var j = 0; j < count; j++) {
  835. list.push(new QRRSBlock(totalCount, dataCount));
  836. }
  837. }
  838. return list;
  839. };
  840. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  841. switch (errorCorrectLevel) {
  842. case QRErrorCorrectLevel.L:
  843. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  844. case QRErrorCorrectLevel.M:
  845. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  846. case QRErrorCorrectLevel.Q:
  847. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  848. case QRErrorCorrectLevel.H:
  849. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  850. default:
  851. return undefined;
  852. }
  853. };
  854. /*
  855. * class QRBitBuffer
  856. * */
  857. var QRBitBuffer = /*#__PURE__*/function () {
  858. function QRBitBuffer() {
  859. (0, _classCallCheck2.default)(this, QRBitBuffer);
  860. this.buffer = [];
  861. this.length = 0;
  862. }
  863. (0, _createClass2.default)(QRBitBuffer, [{
  864. key: "get",
  865. value: function get(index) {
  866. var bufIndex = Math.floor(index / 8);
  867. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  868. }
  869. }, {
  870. key: "put",
  871. value: function put(num, length) {
  872. for (var _i23 = 0; _i23 < length; _i23++) {
  873. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  874. }
  875. }
  876. }, {
  877. key: "getLengthInBits",
  878. value: function getLengthInBits() {
  879. return this.length;
  880. }
  881. }, {
  882. key: "putBit",
  883. value: function putBit(bit) {
  884. var bufIndex = Math.floor(this.length / 8);
  885. if (this.buffer.length <= bufIndex) {
  886. this.buffer.push(0);
  887. }
  888. if (bit) {
  889. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  890. }
  891. this.length++;
  892. }
  893. }]);
  894. return QRBitBuffer;
  895. }();
  896. /*
  897. * Class Drawing
  898. * */
  899. var Drawing = /*#__PURE__*/function () {
  900. function Drawing(el, opts) {
  901. (0, _classCallCheck2.default)(this, Drawing);
  902. this._opts = opts;
  903. this._el = el;
  904. this._ctx = uni.createCanvasContext(el);
  905. }
  906. (0, _createClass2.default)(Drawing, [{
  907. key: "draw",
  908. value: function draw(QRCode) {
  909. var ctx = this._ctx,
  910. opts = this._opts;
  911. var ctxPosFix = opts.width / 20;
  912. //console.log(opts.width)
  913. var count = QRCode.getModuleCount(),
  914. width = (opts.width - 2 * ctxPosFix) / count,
  915. height = (opts.height - 2 * ctxPosFix) / count,
  916. roundedWidth = Math.round(width),
  917. roundedHeight = Math.round(height);
  918. this.clear();
  919. ctx.setFillStyle('#fff');
  920. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  921. for (var row = 0; row < count; row++) {
  922. for (var col = 0; col < count; col++) {
  923. var isDark = QRCode.isDark(row, col),
  924. left = col * width + ctxPosFix,
  925. top = row * height + ctxPosFix;
  926. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  927. ctx.setLineWidth(1);
  928. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  929. ctx.fillRect(left, top, width, height);
  930. ctx.strokeRect(Math.floor(left) + 0.5, Math.floor(top) + 0.5, roundedWidth, roundedHeight);
  931. ctx.strokeRect(Math.ceil(left) - 0.5, Math.ceil(top) - 0.5, roundedWidth, roundedHeight);
  932. }
  933. }
  934. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  935. ctx.draw();
  936. this._bIsPainted = true;
  937. if (this._opts.successTips && drawingOptsSuccessTips) {
  938. uni.hideLoading();
  939. uni.showToast({
  940. title: '生成成功',
  941. icon: 'success',
  942. duration: 1000
  943. });
  944. }
  945. drawingOptsSuccessTips = true;
  946. }
  947. }, {
  948. key: "clear",
  949. value: function clear() {
  950. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  951. }
  952. /** anlib **/
  953. /**
  954. * 二维码上添加图片
  955. */
  956. }, {
  957. key: "drawImg",
  958. value: function drawImg(src, width, ctx) {
  959. // logo相对二维码的比例
  960. var scale = 5;
  961. // logo相对二维码的大小
  962. var imgSize = width / scale;
  963. // 偏移位置起始点
  964. var imgPos = width / scale * 2;
  965. // 二维码边框尺寸,这里设置为原宽度的80分之一
  966. var imgPosFix = width / 80;
  967. //console.log('width', width);
  968. //console.log('imgSize', imgSize);
  969. //console.log('imgPos', imgPos);
  970. //console.log('imgPosFix', imgPosFix);
  971. //console.log('src', src);
  972. ctx.setFillStyle('#fff');
  973. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  974. ctx.beginPath();
  975. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  976. ctx.stroke();
  977. ctx.closePath();
  978. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  979. ctx.beginPath();
  980. }
  981. }]);
  982. return Drawing;
  983. }();
  984. /*
  985. * Class QRCode
  986. * */
  987. var QRCode = function () {
  988. /**
  989. * Get the type by string length
  990. * @author anlib
  991. * @private
  992. * @param {String} text
  993. * @param {Number} correctLevel
  994. * @return {Number} type
  995. */
  996. function getTypeNumber(text, correctLevel) {
  997. var type = 1,
  998. length = getUTF8Length(text),
  999. 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]];
  1000. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  1001. var limit = 0;
  1002. switch (correctLevel) {
  1003. case QRErrorCorrectLevel.L:
  1004. limit = QRCodeLimitLength[_i24][0];
  1005. break;
  1006. case QRErrorCorrectLevel.M:
  1007. limit = QRCodeLimitLength[_i24][1];
  1008. break;
  1009. case QRErrorCorrectLevel.Q:
  1010. limit = QRCodeLimitLength[_i24][2];
  1011. break;
  1012. case QRErrorCorrectLevel.H:
  1013. limit = QRCodeLimitLength[_i24][3];
  1014. break;
  1015. }
  1016. if (length <= limit) {
  1017. break;
  1018. } else {
  1019. type++;
  1020. }
  1021. }
  1022. if (type > QRCodeLimitLength.length) {
  1023. // throw new Error('Too long data'); //supfire
  1024. throwError('Too long data');
  1025. }
  1026. return type;
  1027. }
  1028. function getUTF8Length(text) {
  1029. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  1030. return replacedText.length + (replacedText.length != text ? 3 : 0);
  1031. }
  1032. var Fn = /*#__PURE__*/function () {
  1033. function Fn(el, opts) {
  1034. (0, _classCallCheck2.default)(this, Fn);
  1035. this._opts = {
  1036. width: 300,
  1037. height: 300,
  1038. typeNumber: 4,
  1039. colorDark: '#000000',
  1040. colorLight: '#ffffff',
  1041. correctLevel: Fn.correctLevel.H,
  1042. logo: false,
  1043. successTips: false
  1044. };
  1045. if (typeof opts === 'string') {
  1046. opts = {
  1047. text: opts
  1048. };
  1049. }
  1050. // Overwrites options 简单拷贝
  1051. if (opts) {
  1052. for (var _i25 in opts) {
  1053. if (opts.hasOwnProperty(_i25)) {
  1054. this._opts[_i25] = opts[_i25];
  1055. }
  1056. }
  1057. }
  1058. this._el = el;
  1059. this._QRCode = null;
  1060. this._drawing = new Drawing(this._el, this._opts);
  1061. if (this._opts.text) {
  1062. this.makeCode(this._opts.text);
  1063. }
  1064. }
  1065. (0, _createClass2.default)(Fn, [{
  1066. key: "makeCode",
  1067. value: function makeCode(text) {
  1068. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.correctLevel);
  1069. this._QRCode.addData(text);
  1070. this._QRCode.make();
  1071. this._drawing.draw(this._QRCode);
  1072. }
  1073. }, {
  1074. key: "clear",
  1075. value: function clear() {
  1076. this._drawing.clear();
  1077. }
  1078. }]);
  1079. return Fn;
  1080. }();
  1081. Fn.correctLevel = QRErrorCorrectLevel;
  1082. return Fn;
  1083. }();
  1084. /** anlib **/
  1085. var drawingOptsSuccessTips = true;
  1086. /**
  1087. * 抛出错误
  1088. */
  1089. function throwError(str) {
  1090. uni.hideLoading();
  1091. uni.showToast({
  1092. title: '有字符暂不支持',
  1093. icon: 'none',
  1094. duration: 2000
  1095. });
  1096. drawingOptsSuccessTips = false;
  1097. //throw new Error(str);
  1098. }
  1099. var _default = QRCode;
  1100. exports.default = _default;
  1101. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  1102. /***/ }),
  1103. /***/ 15:
  1104. /*!**********************************************************!*\
  1105. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  1106. \**********************************************************/
  1107. /*! no static exports found */
  1108. /***/ (function(module, exports, __webpack_require__) {
  1109. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1110. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  1111. function _construct(Parent, args, Class) {
  1112. if (isNativeReflectConstruct()) {
  1113. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  1114. } else {
  1115. module.exports = _construct = function _construct(Parent, args, Class) {
  1116. var a = [null];
  1117. a.push.apply(a, args);
  1118. var Constructor = Function.bind.apply(Parent, a);
  1119. var instance = new Constructor();
  1120. if (Class) setPrototypeOf(instance, Class.prototype);
  1121. return instance;
  1122. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1123. }
  1124. return _construct.apply(null, arguments);
  1125. }
  1126. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1127. /***/ }),
  1128. /***/ 16:
  1129. /*!***************************************************************!*\
  1130. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  1131. \***************************************************************/
  1132. /*! no static exports found */
  1133. /***/ (function(module, exports) {
  1134. function _setPrototypeOf(o, p) {
  1135. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  1136. o.__proto__ = p;
  1137. return o;
  1138. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1139. return _setPrototypeOf(o, p);
  1140. }
  1141. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1142. /***/ }),
  1143. /***/ 17:
  1144. /*!*************************************************************************!*\
  1145. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  1146. \*************************************************************************/
  1147. /*! no static exports found */
  1148. /***/ (function(module, exports) {
  1149. function _isNativeReflectConstruct() {
  1150. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  1151. if (Reflect.construct.sham) return false;
  1152. if (typeof Proxy === "function") return true;
  1153. try {
  1154. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  1155. return true;
  1156. } catch (e) {
  1157. return false;
  1158. }
  1159. }
  1160. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1161. /***/ }),
  1162. /***/ 18:
  1163. /*!******************************************************************!*\
  1164. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  1165. \******************************************************************/
  1166. /*! no static exports found */
  1167. /***/ (function(module, exports, __webpack_require__) {
  1168. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  1169. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  1170. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  1171. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  1172. function _toConsumableArray(arr) {
  1173. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  1174. }
  1175. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1176. /***/ }),
  1177. /***/ 19:
  1178. /*!******************************************************************!*\
  1179. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1180. \******************************************************************/
  1181. /*! no static exports found */
  1182. /***/ (function(module, exports, __webpack_require__) {
  1183. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1184. function _arrayWithoutHoles(arr) {
  1185. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1186. }
  1187. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1188. /***/ }),
  1189. /***/ 2:
  1190. /*!************************************************************!*\
  1191. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  1192. \************************************************************/
  1193. /*! no static exports found */
  1194. /***/ (function(module, exports, __webpack_require__) {
  1195. "use strict";
  1196. /* WEBPACK VAR INJECTION */(function(wx, global) {
  1197. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1198. Object.defineProperty(exports, "__esModule", {
  1199. value: true
  1200. });
  1201. exports.createApp = createApp;
  1202. exports.createComponent = createComponent;
  1203. exports.createPage = createPage;
  1204. exports.createPlugin = createPlugin;
  1205. exports.createSubpackageApp = createSubpackageApp;
  1206. exports.default = void 0;
  1207. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  1208. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  1209. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  1210. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  1211. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1212. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  1213. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  1214. 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; }
  1215. 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; }
  1216. var realAtob;
  1217. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  1218. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  1219. if (typeof atob !== 'function') {
  1220. realAtob = function realAtob(str) {
  1221. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  1222. if (!b64re.test(str)) {
  1223. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  1224. }
  1225. // Adding the padding if missing, for semplicity
  1226. str += '=='.slice(2 - (str.length & 3));
  1227. var bitmap;
  1228. var result = '';
  1229. var r1;
  1230. var r2;
  1231. var i = 0;
  1232. for (; i < str.length;) {
  1233. 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++)));
  1234. 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);
  1235. }
  1236. return result;
  1237. };
  1238. } else {
  1239. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  1240. realAtob = atob;
  1241. }
  1242. function b64DecodeUnicode(str) {
  1243. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  1244. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  1245. }).join(''));
  1246. }
  1247. function getCurrentUserInfo() {
  1248. var token = wx.getStorageSync('uni_id_token') || '';
  1249. var tokenArr = token.split('.');
  1250. if (!token || tokenArr.length !== 3) {
  1251. return {
  1252. uid: null,
  1253. role: [],
  1254. permission: [],
  1255. tokenExpired: 0
  1256. };
  1257. }
  1258. var userInfo;
  1259. try {
  1260. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  1261. } catch (error) {
  1262. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  1263. }
  1264. userInfo.tokenExpired = userInfo.exp * 1000;
  1265. delete userInfo.exp;
  1266. delete userInfo.iat;
  1267. return userInfo;
  1268. }
  1269. function uniIdMixin(Vue) {
  1270. Vue.prototype.uniIDHasRole = function (roleId) {
  1271. var _getCurrentUserInfo = getCurrentUserInfo(),
  1272. role = _getCurrentUserInfo.role;
  1273. return role.indexOf(roleId) > -1;
  1274. };
  1275. Vue.prototype.uniIDHasPermission = function (permissionId) {
  1276. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  1277. permission = _getCurrentUserInfo2.permission;
  1278. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  1279. };
  1280. Vue.prototype.uniIDTokenValid = function () {
  1281. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  1282. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  1283. return tokenExpired > Date.now();
  1284. };
  1285. }
  1286. var _toString = Object.prototype.toString;
  1287. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1288. function isFn(fn) {
  1289. return typeof fn === 'function';
  1290. }
  1291. function isStr(str) {
  1292. return typeof str === 'string';
  1293. }
  1294. function isObject(obj) {
  1295. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  1296. }
  1297. function isPlainObject(obj) {
  1298. return _toString.call(obj) === '[object Object]';
  1299. }
  1300. function hasOwn(obj, key) {
  1301. return hasOwnProperty.call(obj, key);
  1302. }
  1303. function noop() {}
  1304. /**
  1305. * Create a cached version of a pure function.
  1306. */
  1307. function cached(fn) {
  1308. var cache = Object.create(null);
  1309. return function cachedFn(str) {
  1310. var hit = cache[str];
  1311. return hit || (cache[str] = fn(str));
  1312. };
  1313. }
  1314. /**
  1315. * Camelize a hyphen-delimited string.
  1316. */
  1317. var camelizeRE = /-(\w)/g;
  1318. var camelize = cached(function (str) {
  1319. return str.replace(camelizeRE, function (_, c) {
  1320. return c ? c.toUpperCase() : '';
  1321. });
  1322. });
  1323. function sortObject(obj) {
  1324. var sortObj = {};
  1325. if (isPlainObject(obj)) {
  1326. Object.keys(obj).sort().forEach(function (key) {
  1327. sortObj[key] = obj[key];
  1328. });
  1329. }
  1330. return !Object.keys(sortObj) ? obj : sortObj;
  1331. }
  1332. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  1333. var globalInterceptors = {};
  1334. var scopedInterceptors = {};
  1335. function mergeHook(parentVal, childVal) {
  1336. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  1337. return res ? dedupeHooks(res) : res;
  1338. }
  1339. function dedupeHooks(hooks) {
  1340. var res = [];
  1341. for (var i = 0; i < hooks.length; i++) {
  1342. if (res.indexOf(hooks[i]) === -1) {
  1343. res.push(hooks[i]);
  1344. }
  1345. }
  1346. return res;
  1347. }
  1348. function removeHook(hooks, hook) {
  1349. var index = hooks.indexOf(hook);
  1350. if (index !== -1) {
  1351. hooks.splice(index, 1);
  1352. }
  1353. }
  1354. function mergeInterceptorHook(interceptor, option) {
  1355. Object.keys(option).forEach(function (hook) {
  1356. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1357. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  1358. }
  1359. });
  1360. }
  1361. function removeInterceptorHook(interceptor, option) {
  1362. if (!interceptor || !option) {
  1363. return;
  1364. }
  1365. Object.keys(option).forEach(function (hook) {
  1366. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1367. removeHook(interceptor[hook], option[hook]);
  1368. }
  1369. });
  1370. }
  1371. function addInterceptor(method, option) {
  1372. if (typeof method === 'string' && isPlainObject(option)) {
  1373. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  1374. } else if (isPlainObject(method)) {
  1375. mergeInterceptorHook(globalInterceptors, method);
  1376. }
  1377. }
  1378. function removeInterceptor(method, option) {
  1379. if (typeof method === 'string') {
  1380. if (isPlainObject(option)) {
  1381. removeInterceptorHook(scopedInterceptors[method], option);
  1382. } else {
  1383. delete scopedInterceptors[method];
  1384. }
  1385. } else if (isPlainObject(method)) {
  1386. removeInterceptorHook(globalInterceptors, method);
  1387. }
  1388. }
  1389. function wrapperHook(hook) {
  1390. return function (data) {
  1391. return hook(data) || data;
  1392. };
  1393. }
  1394. function isPromise(obj) {
  1395. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  1396. }
  1397. function queue(hooks, data) {
  1398. var promise = false;
  1399. for (var i = 0; i < hooks.length; i++) {
  1400. var hook = hooks[i];
  1401. if (promise) {
  1402. promise = Promise.resolve(wrapperHook(hook));
  1403. } else {
  1404. var res = hook(data);
  1405. if (isPromise(res)) {
  1406. promise = Promise.resolve(res);
  1407. }
  1408. if (res === false) {
  1409. return {
  1410. then: function then() {}
  1411. };
  1412. }
  1413. }
  1414. }
  1415. return promise || {
  1416. then: function then(callback) {
  1417. return callback(data);
  1418. }
  1419. };
  1420. }
  1421. function wrapperOptions(interceptor) {
  1422. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1423. ['success', 'fail', 'complete'].forEach(function (name) {
  1424. if (Array.isArray(interceptor[name])) {
  1425. var oldCallback = options[name];
  1426. options[name] = function callbackInterceptor(res) {
  1427. queue(interceptor[name], res).then(function (res) {
  1428. /* eslint-disable no-mixed-operators */
  1429. return isFn(oldCallback) && oldCallback(res) || res;
  1430. });
  1431. };
  1432. }
  1433. });
  1434. return options;
  1435. }
  1436. function wrapperReturnValue(method, returnValue) {
  1437. var returnValueHooks = [];
  1438. if (Array.isArray(globalInterceptors.returnValue)) {
  1439. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1440. }
  1441. var interceptor = scopedInterceptors[method];
  1442. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1443. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1444. }
  1445. returnValueHooks.forEach(function (hook) {
  1446. returnValue = hook(returnValue) || returnValue;
  1447. });
  1448. return returnValue;
  1449. }
  1450. function getApiInterceptorHooks(method) {
  1451. var interceptor = Object.create(null);
  1452. Object.keys(globalInterceptors).forEach(function (hook) {
  1453. if (hook !== 'returnValue') {
  1454. interceptor[hook] = globalInterceptors[hook].slice();
  1455. }
  1456. });
  1457. var scopedInterceptor = scopedInterceptors[method];
  1458. if (scopedInterceptor) {
  1459. Object.keys(scopedInterceptor).forEach(function (hook) {
  1460. if (hook !== 'returnValue') {
  1461. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1462. }
  1463. });
  1464. }
  1465. return interceptor;
  1466. }
  1467. function invokeApi(method, api, options) {
  1468. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1469. params[_key - 3] = arguments[_key];
  1470. }
  1471. var interceptor = getApiInterceptorHooks(method);
  1472. if (interceptor && Object.keys(interceptor).length) {
  1473. if (Array.isArray(interceptor.invoke)) {
  1474. var res = queue(interceptor.invoke, options);
  1475. return res.then(function (options) {
  1476. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1477. });
  1478. } else {
  1479. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1480. }
  1481. }
  1482. return api.apply(void 0, [options].concat(params));
  1483. }
  1484. var promiseInterceptor = {
  1485. returnValue: function returnValue(res) {
  1486. if (!isPromise(res)) {
  1487. return res;
  1488. }
  1489. return new Promise(function (resolve, reject) {
  1490. res.then(function (res) {
  1491. if (res[0]) {
  1492. reject(res[0]);
  1493. } else {
  1494. resolve(res[1]);
  1495. }
  1496. });
  1497. });
  1498. }
  1499. };
  1500. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  1501. var CONTEXT_API_RE = /^create|Manager$/;
  1502. // Context例外情况
  1503. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1504. // 同步例外情况
  1505. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1506. var CALLBACK_API_RE = /^on|^off/;
  1507. function isContextApi(name) {
  1508. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1509. }
  1510. function isSyncApi(name) {
  1511. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1512. }
  1513. function isCallbackApi(name) {
  1514. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1515. }
  1516. function handlePromise(promise) {
  1517. return promise.then(function (data) {
  1518. return [null, data];
  1519. }).catch(function (err) {
  1520. return [err];
  1521. });
  1522. }
  1523. function shouldPromise(name) {
  1524. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1525. return false;
  1526. }
  1527. return true;
  1528. }
  1529. /* eslint-disable no-extend-native */
  1530. if (!Promise.prototype.finally) {
  1531. Promise.prototype.finally = function (callback) {
  1532. var promise = this.constructor;
  1533. return this.then(function (value) {
  1534. return promise.resolve(callback()).then(function () {
  1535. return value;
  1536. });
  1537. }, function (reason) {
  1538. return promise.resolve(callback()).then(function () {
  1539. throw reason;
  1540. });
  1541. });
  1542. };
  1543. }
  1544. function promisify(name, api) {
  1545. if (!shouldPromise(name) || !isFn(api)) {
  1546. return api;
  1547. }
  1548. return function promiseApi() {
  1549. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1550. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1551. params[_key2 - 1] = arguments[_key2];
  1552. }
  1553. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1554. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1555. }
  1556. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1557. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1558. success: resolve,
  1559. fail: reject
  1560. })].concat(params));
  1561. })));
  1562. };
  1563. }
  1564. var EPS = 1e-4;
  1565. var BASE_DEVICE_WIDTH = 750;
  1566. var isIOS = false;
  1567. var deviceWidth = 0;
  1568. var deviceDPR = 0;
  1569. function checkDeviceWidth() {
  1570. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1571. platform = _wx$getSystemInfoSync.platform,
  1572. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1573. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1574. deviceWidth = windowWidth;
  1575. deviceDPR = pixelRatio;
  1576. isIOS = platform === 'ios';
  1577. }
  1578. function upx2px(number, newDeviceWidth) {
  1579. if (deviceWidth === 0) {
  1580. checkDeviceWidth();
  1581. }
  1582. number = Number(number);
  1583. if (number === 0) {
  1584. return 0;
  1585. }
  1586. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1587. if (result < 0) {
  1588. result = -result;
  1589. }
  1590. result = Math.floor(result + EPS);
  1591. if (result === 0) {
  1592. if (deviceDPR === 1 || !isIOS) {
  1593. result = 1;
  1594. } else {
  1595. result = 0.5;
  1596. }
  1597. }
  1598. return number < 0 ? -result : result;
  1599. }
  1600. var LOCALE_ZH_HANS = 'zh-Hans';
  1601. var LOCALE_ZH_HANT = 'zh-Hant';
  1602. var LOCALE_EN = 'en';
  1603. var LOCALE_FR = 'fr';
  1604. var LOCALE_ES = 'es';
  1605. var messages = {};
  1606. var locale;
  1607. {
  1608. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1609. }
  1610. function initI18nMessages() {
  1611. if (!isEnableLocale()) {
  1612. return;
  1613. }
  1614. var localeKeys = Object.keys(__uniConfig.locales);
  1615. if (localeKeys.length) {
  1616. localeKeys.forEach(function (locale) {
  1617. var curMessages = messages[locale];
  1618. var userMessages = __uniConfig.locales[locale];
  1619. if (curMessages) {
  1620. Object.assign(curMessages, userMessages);
  1621. } else {
  1622. messages[locale] = userMessages;
  1623. }
  1624. });
  1625. }
  1626. }
  1627. initI18nMessages();
  1628. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1629. var t = i18n.t;
  1630. var i18nMixin = i18n.mixin = {
  1631. beforeCreate: function beforeCreate() {
  1632. var _this = this;
  1633. var unwatch = i18n.i18n.watchLocale(function () {
  1634. _this.$forceUpdate();
  1635. });
  1636. this.$once('hook:beforeDestroy', function () {
  1637. unwatch();
  1638. });
  1639. },
  1640. methods: {
  1641. $$t: function $$t(key, values) {
  1642. return t(key, values);
  1643. }
  1644. }
  1645. };
  1646. var setLocale = i18n.setLocale;
  1647. var getLocale = i18n.getLocale;
  1648. function initAppLocale(Vue, appVm, locale) {
  1649. var state = Vue.observable({
  1650. locale: locale || i18n.getLocale()
  1651. });
  1652. var localeWatchers = [];
  1653. appVm.$watchLocale = function (fn) {
  1654. localeWatchers.push(fn);
  1655. };
  1656. Object.defineProperty(appVm, '$locale', {
  1657. get: function get() {
  1658. return state.locale;
  1659. },
  1660. set: function set(v) {
  1661. state.locale = v;
  1662. localeWatchers.forEach(function (watch) {
  1663. return watch(v);
  1664. });
  1665. }
  1666. });
  1667. }
  1668. function isEnableLocale() {
  1669. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1670. }
  1671. function include(str, parts) {
  1672. return !!parts.find(function (part) {
  1673. return str.indexOf(part) !== -1;
  1674. });
  1675. }
  1676. function startsWith(str, parts) {
  1677. return parts.find(function (part) {
  1678. return str.indexOf(part) === 0;
  1679. });
  1680. }
  1681. function normalizeLocale(locale, messages) {
  1682. if (!locale) {
  1683. return;
  1684. }
  1685. locale = locale.trim().replace(/_/g, '-');
  1686. if (messages && messages[locale]) {
  1687. return locale;
  1688. }
  1689. locale = locale.toLowerCase();
  1690. if (locale === 'chinese') {
  1691. // 支付宝
  1692. return LOCALE_ZH_HANS;
  1693. }
  1694. if (locale.indexOf('zh') === 0) {
  1695. if (locale.indexOf('-hans') > -1) {
  1696. return LOCALE_ZH_HANS;
  1697. }
  1698. if (locale.indexOf('-hant') > -1) {
  1699. return LOCALE_ZH_HANT;
  1700. }
  1701. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1702. return LOCALE_ZH_HANT;
  1703. }
  1704. return LOCALE_ZH_HANS;
  1705. }
  1706. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1707. if (lang) {
  1708. return lang;
  1709. }
  1710. }
  1711. // export function initI18n() {
  1712. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1713. // if (localeKeys.length) {
  1714. // localeKeys.forEach((locale) =>
  1715. // i18n.add(locale, __uniConfig.locales[locale])
  1716. // )
  1717. // }
  1718. // }
  1719. function getLocale$1() {
  1720. // 优先使用 $locale
  1721. if (isFn(getApp)) {
  1722. var app = getApp({
  1723. allowDefault: true
  1724. });
  1725. if (app && app.$vm) {
  1726. return app.$vm.$locale;
  1727. }
  1728. }
  1729. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1730. }
  1731. function setLocale$1(locale) {
  1732. var app = isFn(getApp) ? getApp() : false;
  1733. if (!app) {
  1734. return false;
  1735. }
  1736. var oldLocale = app.$vm.$locale;
  1737. if (oldLocale !== locale) {
  1738. app.$vm.$locale = locale;
  1739. onLocaleChangeCallbacks.forEach(function (fn) {
  1740. return fn({
  1741. locale: locale
  1742. });
  1743. });
  1744. return true;
  1745. }
  1746. return false;
  1747. }
  1748. var onLocaleChangeCallbacks = [];
  1749. function onLocaleChange(fn) {
  1750. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1751. onLocaleChangeCallbacks.push(fn);
  1752. }
  1753. }
  1754. if (typeof global !== 'undefined') {
  1755. global.getLocale = getLocale$1;
  1756. }
  1757. var interceptors = {
  1758. promiseInterceptor: promiseInterceptor
  1759. };
  1760. var baseApi = /*#__PURE__*/Object.freeze({
  1761. __proto__: null,
  1762. upx2px: upx2px,
  1763. getLocale: getLocale$1,
  1764. setLocale: setLocale$1,
  1765. onLocaleChange: onLocaleChange,
  1766. addInterceptor: addInterceptor,
  1767. removeInterceptor: removeInterceptor,
  1768. interceptors: interceptors
  1769. });
  1770. function findExistsPageIndex(url) {
  1771. var pages = getCurrentPages();
  1772. var len = pages.length;
  1773. while (len--) {
  1774. var page = pages[len];
  1775. if (page.$page && page.$page.fullPath === url) {
  1776. return len;
  1777. }
  1778. }
  1779. return -1;
  1780. }
  1781. var redirectTo = {
  1782. name: function name(fromArgs) {
  1783. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1784. return 'navigateBack';
  1785. }
  1786. return 'redirectTo';
  1787. },
  1788. args: function args(fromArgs) {
  1789. if (fromArgs.exists === 'back' && fromArgs.url) {
  1790. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1791. if (existsPageIndex !== -1) {
  1792. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1793. if (delta > 0) {
  1794. fromArgs.delta = delta;
  1795. }
  1796. }
  1797. }
  1798. }
  1799. };
  1800. var previewImage = {
  1801. args: function args(fromArgs) {
  1802. var currentIndex = parseInt(fromArgs.current);
  1803. if (isNaN(currentIndex)) {
  1804. return;
  1805. }
  1806. var urls = fromArgs.urls;
  1807. if (!Array.isArray(urls)) {
  1808. return;
  1809. }
  1810. var len = urls.length;
  1811. if (!len) {
  1812. return;
  1813. }
  1814. if (currentIndex < 0) {
  1815. currentIndex = 0;
  1816. } else if (currentIndex >= len) {
  1817. currentIndex = len - 1;
  1818. }
  1819. if (currentIndex > 0) {
  1820. fromArgs.current = urls[currentIndex];
  1821. fromArgs.urls = urls.filter(function (item, index) {
  1822. return index < currentIndex ? item !== urls[currentIndex] : true;
  1823. });
  1824. } else {
  1825. fromArgs.current = urls[0];
  1826. }
  1827. return {
  1828. indicator: false,
  1829. loop: false
  1830. };
  1831. }
  1832. };
  1833. var UUID_KEY = '__DC_STAT_UUID';
  1834. var deviceId;
  1835. function useDeviceId(result) {
  1836. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1837. if (!deviceId) {
  1838. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1839. wx.setStorage({
  1840. key: UUID_KEY,
  1841. data: deviceId
  1842. });
  1843. }
  1844. result.deviceId = deviceId;
  1845. }
  1846. function addSafeAreaInsets(result) {
  1847. if (result.safeArea) {
  1848. var safeArea = result.safeArea;
  1849. result.safeAreaInsets = {
  1850. top: safeArea.top,
  1851. left: safeArea.left,
  1852. right: result.windowWidth - safeArea.right,
  1853. bottom: result.screenHeight - safeArea.bottom
  1854. };
  1855. }
  1856. }
  1857. function populateParameters(result) {
  1858. var _result$brand = result.brand,
  1859. brand = _result$brand === void 0 ? '' : _result$brand,
  1860. _result$model = result.model,
  1861. model = _result$model === void 0 ? '' : _result$model,
  1862. _result$system = result.system,
  1863. system = _result$system === void 0 ? '' : _result$system,
  1864. _result$language = result.language,
  1865. language = _result$language === void 0 ? '' : _result$language,
  1866. theme = result.theme,
  1867. version = result.version,
  1868. platform = result.platform,
  1869. fontSizeSetting = result.fontSizeSetting,
  1870. SDKVersion = result.SDKVersion,
  1871. pixelRatio = result.pixelRatio,
  1872. deviceOrientation = result.deviceOrientation;
  1873. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1874. var extraParam = {};
  1875. // osName osVersion
  1876. var osName = '';
  1877. var osVersion = '';
  1878. {
  1879. osName = system.split(' ')[0] || '';
  1880. osVersion = system.split(' ')[1] || '';
  1881. }
  1882. var hostVersion = version;
  1883. // deviceType
  1884. var deviceType = getGetDeviceType(result, model);
  1885. // deviceModel
  1886. var deviceBrand = getDeviceBrand(brand);
  1887. // hostName
  1888. var _hostName = getHostName(result);
  1889. // deviceOrientation
  1890. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1891. // devicePixelRatio
  1892. var _devicePixelRatio = pixelRatio;
  1893. // SDKVersion
  1894. var _SDKVersion = SDKVersion;
  1895. // hostLanguage
  1896. var hostLanguage = language.replace(/_/g, '-');
  1897. // wx.getAccountInfoSync
  1898. var parameters = {
  1899. appId: "__UNI__1C40FB4",
  1900. appName: "房票科技",
  1901. appVersion: "1.0.0",
  1902. appVersionCode: "100",
  1903. appLanguage: getAppLanguage(hostLanguage),
  1904. uniCompileVersion: "3.7.3",
  1905. uniRuntimeVersion: "3.7.3",
  1906. uniPlatform: undefined || "mp-weixin",
  1907. deviceBrand: deviceBrand,
  1908. deviceModel: model,
  1909. deviceType: deviceType,
  1910. devicePixelRatio: _devicePixelRatio,
  1911. deviceOrientation: _deviceOrientation,
  1912. osName: osName.toLocaleLowerCase(),
  1913. osVersion: osVersion,
  1914. hostTheme: theme,
  1915. hostVersion: hostVersion,
  1916. hostLanguage: hostLanguage,
  1917. hostName: _hostName,
  1918. hostSDKVersion: _SDKVersion,
  1919. hostFontSizeSetting: fontSizeSetting,
  1920. windowTop: 0,
  1921. windowBottom: 0,
  1922. // TODO
  1923. osLanguage: undefined,
  1924. osTheme: undefined,
  1925. ua: undefined,
  1926. hostPackageName: undefined,
  1927. browserName: undefined,
  1928. browserVersion: undefined
  1929. };
  1930. Object.assign(result, parameters, extraParam);
  1931. }
  1932. function getGetDeviceType(result, model) {
  1933. var deviceType = result.deviceType || 'phone';
  1934. {
  1935. var deviceTypeMaps = {
  1936. ipad: 'pad',
  1937. windows: 'pc',
  1938. mac: 'pc'
  1939. };
  1940. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1941. var _model = model.toLocaleLowerCase();
  1942. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1943. var _m = deviceTypeMapsKeys[index];
  1944. if (_model.indexOf(_m) !== -1) {
  1945. deviceType = deviceTypeMaps[_m];
  1946. break;
  1947. }
  1948. }
  1949. }
  1950. return deviceType;
  1951. }
  1952. function getDeviceBrand(brand) {
  1953. var deviceBrand = brand;
  1954. if (deviceBrand) {
  1955. deviceBrand = brand.toLocaleLowerCase();
  1956. }
  1957. return deviceBrand;
  1958. }
  1959. function getAppLanguage(defaultLanguage) {
  1960. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1961. }
  1962. function getHostName(result) {
  1963. var _platform = 'WeChat';
  1964. var _hostName = result.hostName || _platform; // mp-jd
  1965. {
  1966. if (result.environment) {
  1967. _hostName = result.environment;
  1968. } else if (result.host && result.host.env) {
  1969. _hostName = result.host.env;
  1970. }
  1971. }
  1972. return _hostName;
  1973. }
  1974. var getSystemInfo = {
  1975. returnValue: function returnValue(result) {
  1976. useDeviceId(result);
  1977. addSafeAreaInsets(result);
  1978. populateParameters(result);
  1979. }
  1980. };
  1981. var showActionSheet = {
  1982. args: function args(fromArgs) {
  1983. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1984. fromArgs.alertText = fromArgs.title;
  1985. }
  1986. }
  1987. };
  1988. var getAppBaseInfo = {
  1989. returnValue: function returnValue(result) {
  1990. var _result = result,
  1991. version = _result.version,
  1992. language = _result.language,
  1993. SDKVersion = _result.SDKVersion,
  1994. theme = _result.theme;
  1995. var _hostName = getHostName(result);
  1996. var hostLanguage = language.replace('_', '-');
  1997. result = sortObject(Object.assign(result, {
  1998. appId: "__UNI__1C40FB4",
  1999. appName: "房票科技",
  2000. appVersion: "1.0.0",
  2001. appVersionCode: "100",
  2002. appLanguage: getAppLanguage(hostLanguage),
  2003. hostVersion: version,
  2004. hostLanguage: hostLanguage,
  2005. hostName: _hostName,
  2006. hostSDKVersion: SDKVersion,
  2007. hostTheme: theme
  2008. }));
  2009. }
  2010. };
  2011. var getDeviceInfo = {
  2012. returnValue: function returnValue(result) {
  2013. var _result2 = result,
  2014. brand = _result2.brand,
  2015. model = _result2.model;
  2016. var deviceType = getGetDeviceType(result, model);
  2017. var deviceBrand = getDeviceBrand(brand);
  2018. useDeviceId(result);
  2019. result = sortObject(Object.assign(result, {
  2020. deviceType: deviceType,
  2021. deviceBrand: deviceBrand,
  2022. deviceModel: model
  2023. }));
  2024. }
  2025. };
  2026. var getWindowInfo = {
  2027. returnValue: function returnValue(result) {
  2028. addSafeAreaInsets(result);
  2029. result = sortObject(Object.assign(result, {
  2030. windowTop: 0,
  2031. windowBottom: 0
  2032. }));
  2033. }
  2034. };
  2035. var getAppAuthorizeSetting = {
  2036. returnValue: function returnValue(result) {
  2037. var locationReducedAccuracy = result.locationReducedAccuracy;
  2038. result.locationAccuracy = 'unsupported';
  2039. if (locationReducedAccuracy === true) {
  2040. result.locationAccuracy = 'reduced';
  2041. } else if (locationReducedAccuracy === false) {
  2042. result.locationAccuracy = 'full';
  2043. }
  2044. }
  2045. };
  2046. // import navigateTo from 'uni-helpers/navigate-to'
  2047. var compressImage = {
  2048. args: function args(fromArgs) {
  2049. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  2050. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  2051. fromArgs.compressHeight = fromArgs.compressedHeight;
  2052. }
  2053. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  2054. fromArgs.compressWidth = fromArgs.compressedWidth;
  2055. }
  2056. }
  2057. };
  2058. var protocols = {
  2059. redirectTo: redirectTo,
  2060. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  2061. previewImage: previewImage,
  2062. getSystemInfo: getSystemInfo,
  2063. getSystemInfoSync: getSystemInfo,
  2064. showActionSheet: showActionSheet,
  2065. getAppBaseInfo: getAppBaseInfo,
  2066. getDeviceInfo: getDeviceInfo,
  2067. getWindowInfo: getWindowInfo,
  2068. getAppAuthorizeSetting: getAppAuthorizeSetting,
  2069. compressImage: compressImage
  2070. };
  2071. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  2072. var canIUses = [];
  2073. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  2074. function processCallback(methodName, method, returnValue) {
  2075. return function (res) {
  2076. return method(processReturnValue(methodName, res, returnValue));
  2077. };
  2078. }
  2079. function processArgs(methodName, fromArgs) {
  2080. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2081. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  2082. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  2083. if (isPlainObject(fromArgs)) {
  2084. // 一般 api 的参数解析
  2085. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  2086. if (isFn(argsOption)) {
  2087. argsOption = argsOption(fromArgs, toArgs) || {};
  2088. }
  2089. for (var key in fromArgs) {
  2090. if (hasOwn(argsOption, key)) {
  2091. var keyOption = argsOption[key];
  2092. if (isFn(keyOption)) {
  2093. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  2094. }
  2095. if (!keyOption) {
  2096. // 不支持的参数
  2097. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  2098. } else if (isStr(keyOption)) {
  2099. // 重写参数 key
  2100. toArgs[keyOption] = fromArgs[key];
  2101. } else if (isPlainObject(keyOption)) {
  2102. // {name:newName,value:value}可重新指定参数 key:value
  2103. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  2104. }
  2105. } else if (CALLBACKS.indexOf(key) !== -1) {
  2106. if (isFn(fromArgs[key])) {
  2107. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  2108. }
  2109. } else {
  2110. if (!keepFromArgs) {
  2111. toArgs[key] = fromArgs[key];
  2112. }
  2113. }
  2114. }
  2115. return toArgs;
  2116. } else if (isFn(fromArgs)) {
  2117. fromArgs = processCallback(methodName, fromArgs, returnValue);
  2118. }
  2119. return fromArgs;
  2120. }
  2121. function processReturnValue(methodName, res, returnValue) {
  2122. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2123. if (isFn(protocols.returnValue)) {
  2124. // 处理通用 returnValue
  2125. res = protocols.returnValue(methodName, res);
  2126. }
  2127. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  2128. }
  2129. function wrapper(methodName, method) {
  2130. if (hasOwn(protocols, methodName)) {
  2131. var protocol = protocols[methodName];
  2132. if (!protocol) {
  2133. // 暂不支持的 api
  2134. return function () {
  2135. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  2136. };
  2137. }
  2138. return function (arg1, arg2) {
  2139. // 目前 api 最多两个参数
  2140. var options = protocol;
  2141. if (isFn(protocol)) {
  2142. options = protocol(arg1);
  2143. }
  2144. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  2145. var args = [arg1];
  2146. if (typeof arg2 !== 'undefined') {
  2147. args.push(arg2);
  2148. }
  2149. if (isFn(options.name)) {
  2150. methodName = options.name(arg1);
  2151. } else if (isStr(options.name)) {
  2152. methodName = options.name;
  2153. }
  2154. var returnValue = wx[methodName].apply(wx, args);
  2155. if (isSyncApi(methodName)) {
  2156. // 同步 api
  2157. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  2158. }
  2159. return returnValue;
  2160. };
  2161. }
  2162. return method;
  2163. }
  2164. var todoApis = Object.create(null);
  2165. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  2166. function createTodoApi(name) {
  2167. return function todoApi(_ref) {
  2168. var fail = _ref.fail,
  2169. complete = _ref.complete;
  2170. var res = {
  2171. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  2172. };
  2173. isFn(fail) && fail(res);
  2174. isFn(complete) && complete(res);
  2175. };
  2176. }
  2177. TODOS.forEach(function (name) {
  2178. todoApis[name] = createTodoApi(name);
  2179. });
  2180. var providers = {
  2181. oauth: ['weixin'],
  2182. share: ['weixin'],
  2183. payment: ['wxpay'],
  2184. push: ['weixin']
  2185. };
  2186. function getProvider(_ref2) {
  2187. var service = _ref2.service,
  2188. success = _ref2.success,
  2189. fail = _ref2.fail,
  2190. complete = _ref2.complete;
  2191. var res = false;
  2192. if (providers[service]) {
  2193. res = {
  2194. errMsg: 'getProvider:ok',
  2195. service: service,
  2196. provider: providers[service]
  2197. };
  2198. isFn(success) && success(res);
  2199. } else {
  2200. res = {
  2201. errMsg: 'getProvider:fail service not found'
  2202. };
  2203. isFn(fail) && fail(res);
  2204. }
  2205. isFn(complete) && complete(res);
  2206. }
  2207. var extraApi = /*#__PURE__*/Object.freeze({
  2208. __proto__: null,
  2209. getProvider: getProvider
  2210. });
  2211. var getEmitter = function () {
  2212. var Emitter;
  2213. return function getUniEmitter() {
  2214. if (!Emitter) {
  2215. Emitter = new _vue.default();
  2216. }
  2217. return Emitter;
  2218. };
  2219. }();
  2220. function apply(ctx, method, args) {
  2221. return ctx[method].apply(ctx, args);
  2222. }
  2223. function $on() {
  2224. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  2225. }
  2226. function $off() {
  2227. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  2228. }
  2229. function $once() {
  2230. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  2231. }
  2232. function $emit() {
  2233. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  2234. }
  2235. var eventApi = /*#__PURE__*/Object.freeze({
  2236. __proto__: null,
  2237. $on: $on,
  2238. $off: $off,
  2239. $once: $once,
  2240. $emit: $emit
  2241. });
  2242. /**
  2243. * 框架内 try-catch
  2244. */
  2245. /**
  2246. * 开发者 try-catch
  2247. */
  2248. function tryCatch(fn) {
  2249. return function () {
  2250. try {
  2251. return fn.apply(fn, arguments);
  2252. } catch (e) {
  2253. // TODO
  2254. console.error(e);
  2255. }
  2256. };
  2257. }
  2258. function getApiCallbacks(params) {
  2259. var apiCallbacks = {};
  2260. for (var name in params) {
  2261. var param = params[name];
  2262. if (isFn(param)) {
  2263. apiCallbacks[name] = tryCatch(param);
  2264. delete params[name];
  2265. }
  2266. }
  2267. return apiCallbacks;
  2268. }
  2269. var cid;
  2270. var cidErrMsg;
  2271. var enabled;
  2272. function normalizePushMessage(message) {
  2273. try {
  2274. return JSON.parse(message);
  2275. } catch (e) {}
  2276. return message;
  2277. }
  2278. function invokePushCallback(args) {
  2279. if (args.type === 'enabled') {
  2280. enabled = true;
  2281. } else if (args.type === 'clientId') {
  2282. cid = args.cid;
  2283. cidErrMsg = args.errMsg;
  2284. invokeGetPushCidCallbacks(cid, args.errMsg);
  2285. } else if (args.type === 'pushMsg') {
  2286. var message = {
  2287. type: 'receive',
  2288. data: normalizePushMessage(args.message)
  2289. };
  2290. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  2291. var callback = onPushMessageCallbacks[i];
  2292. callback(message);
  2293. // 该消息已被阻止
  2294. if (message.stopped) {
  2295. break;
  2296. }
  2297. }
  2298. } else if (args.type === 'click') {
  2299. onPushMessageCallbacks.forEach(function (callback) {
  2300. callback({
  2301. type: 'click',
  2302. data: normalizePushMessage(args.message)
  2303. });
  2304. });
  2305. }
  2306. }
  2307. var getPushCidCallbacks = [];
  2308. function invokeGetPushCidCallbacks(cid, errMsg) {
  2309. getPushCidCallbacks.forEach(function (callback) {
  2310. callback(cid, errMsg);
  2311. });
  2312. getPushCidCallbacks.length = 0;
  2313. }
  2314. function getPushClientId(args) {
  2315. if (!isPlainObject(args)) {
  2316. args = {};
  2317. }
  2318. var _getApiCallbacks = getApiCallbacks(args),
  2319. success = _getApiCallbacks.success,
  2320. fail = _getApiCallbacks.fail,
  2321. complete = _getApiCallbacks.complete;
  2322. var hasSuccess = isFn(success);
  2323. var hasFail = isFn(fail);
  2324. var hasComplete = isFn(complete);
  2325. Promise.resolve().then(function () {
  2326. if (typeof enabled === 'undefined') {
  2327. enabled = false;
  2328. cid = '';
  2329. cidErrMsg = 'uniPush is not enabled';
  2330. }
  2331. getPushCidCallbacks.push(function (cid, errMsg) {
  2332. var res;
  2333. if (cid) {
  2334. res = {
  2335. errMsg: 'getPushClientId:ok',
  2336. cid: cid
  2337. };
  2338. hasSuccess && success(res);
  2339. } else {
  2340. res = {
  2341. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  2342. };
  2343. hasFail && fail(res);
  2344. }
  2345. hasComplete && complete(res);
  2346. });
  2347. if (typeof cid !== 'undefined') {
  2348. invokeGetPushCidCallbacks(cid, cidErrMsg);
  2349. }
  2350. });
  2351. }
  2352. var onPushMessageCallbacks = [];
  2353. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  2354. var onPushMessage = function onPushMessage(fn) {
  2355. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  2356. onPushMessageCallbacks.push(fn);
  2357. }
  2358. };
  2359. var offPushMessage = function offPushMessage(fn) {
  2360. if (!fn) {
  2361. onPushMessageCallbacks.length = 0;
  2362. } else {
  2363. var index = onPushMessageCallbacks.indexOf(fn);
  2364. if (index > -1) {
  2365. onPushMessageCallbacks.splice(index, 1);
  2366. }
  2367. }
  2368. };
  2369. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  2370. if (!baseInfo) {
  2371. baseInfo = wx.getSystemInfoSync();
  2372. }
  2373. var host = baseInfo ? baseInfo.host : null;
  2374. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  2375. var api = /*#__PURE__*/Object.freeze({
  2376. __proto__: null,
  2377. shareVideoMessage: shareVideoMessage,
  2378. getPushClientId: getPushClientId,
  2379. onPushMessage: onPushMessage,
  2380. offPushMessage: offPushMessage,
  2381. invokePushCallback: invokePushCallback
  2382. });
  2383. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  2384. function findVmByVueId(vm, vuePid) {
  2385. var $children = vm.$children;
  2386. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  2387. for (var i = $children.length - 1; i >= 0; i--) {
  2388. var childVm = $children[i];
  2389. if (childVm.$scope._$vueId === vuePid) {
  2390. return childVm;
  2391. }
  2392. }
  2393. // 反向递归查找
  2394. var parentVm;
  2395. for (var _i = $children.length - 1; _i >= 0; _i--) {
  2396. parentVm = findVmByVueId($children[_i], vuePid);
  2397. if (parentVm) {
  2398. return parentVm;
  2399. }
  2400. }
  2401. }
  2402. function initBehavior(options) {
  2403. return Behavior(options);
  2404. }
  2405. function isPage() {
  2406. return !!this.route;
  2407. }
  2408. function initRelation(detail) {
  2409. this.triggerEvent('__l', detail);
  2410. }
  2411. function selectAllComponents(mpInstance, selector, $refs) {
  2412. var components = mpInstance.selectAllComponents(selector) || [];
  2413. components.forEach(function (component) {
  2414. var ref = component.dataset.ref;
  2415. $refs[ref] = component.$vm || toSkip(component);
  2416. {
  2417. if (component.dataset.vueGeneric === 'scoped') {
  2418. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2419. selectAllComponents(scopedComponent, selector, $refs);
  2420. });
  2421. }
  2422. }
  2423. });
  2424. }
  2425. function syncRefs(refs, newRefs) {
  2426. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2427. var newKeys = Object.keys(newRefs);
  2428. newKeys.forEach(function (key) {
  2429. var oldValue = refs[key];
  2430. var newValue = newRefs[key];
  2431. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2432. return oldValue.includes(value);
  2433. })) {
  2434. return;
  2435. }
  2436. refs[key] = newValue;
  2437. oldKeys.delete(key);
  2438. });
  2439. oldKeys.forEach(function (key) {
  2440. delete refs[key];
  2441. });
  2442. return refs;
  2443. }
  2444. function initRefs(vm) {
  2445. var mpInstance = vm.$scope;
  2446. var refs = {};
  2447. Object.defineProperty(vm, '$refs', {
  2448. get: function get() {
  2449. var $refs = {};
  2450. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2451. // TODO 暂不考虑 for 中的 scoped
  2452. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2453. forComponents.forEach(function (component) {
  2454. var ref = component.dataset.ref;
  2455. if (!$refs[ref]) {
  2456. $refs[ref] = [];
  2457. }
  2458. $refs[ref].push(component.$vm || toSkip(component));
  2459. });
  2460. return syncRefs(refs, $refs);
  2461. }
  2462. });
  2463. }
  2464. function handleLink(event) {
  2465. var _ref3 = event.detail || event.value,
  2466. vuePid = _ref3.vuePid,
  2467. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2468. var parentVm;
  2469. if (vuePid) {
  2470. parentVm = findVmByVueId(this.$vm, vuePid);
  2471. }
  2472. if (!parentVm) {
  2473. parentVm = this.$vm;
  2474. }
  2475. vueOptions.parent = parentVm;
  2476. }
  2477. function markMPComponent(component) {
  2478. // 在 Vue 中标记为小程序组件
  2479. var IS_MP = '__v_isMPComponent';
  2480. Object.defineProperty(component, IS_MP, {
  2481. configurable: true,
  2482. enumerable: false,
  2483. value: true
  2484. });
  2485. return component;
  2486. }
  2487. function toSkip(obj) {
  2488. var OB = '__ob__';
  2489. var SKIP = '__v_skip';
  2490. if (isObject(obj) && Object.isExtensible(obj)) {
  2491. // 避免被 @vue/composition-api 观测
  2492. Object.defineProperty(obj, OB, {
  2493. configurable: true,
  2494. enumerable: false,
  2495. value: (0, _defineProperty2.default)({}, SKIP, true)
  2496. });
  2497. }
  2498. return obj;
  2499. }
  2500. var MPPage = Page;
  2501. var MPComponent = Component;
  2502. var customizeRE = /:/g;
  2503. var customize = cached(function (str) {
  2504. return camelize(str.replace(customizeRE, '-'));
  2505. });
  2506. function initTriggerEvent(mpInstance) {
  2507. var oldTriggerEvent = mpInstance.triggerEvent;
  2508. var newTriggerEvent = function newTriggerEvent(event) {
  2509. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2510. args[_key3 - 1] = arguments[_key3];
  2511. }
  2512. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2513. if (this.$vm || this.dataset && this.dataset.comType) {
  2514. event = customize(event);
  2515. } else {
  2516. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2517. var newEvent = customize(event);
  2518. if (newEvent !== event) {
  2519. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2520. }
  2521. }
  2522. return oldTriggerEvent.apply(this, [event].concat(args));
  2523. };
  2524. try {
  2525. // 京东小程序 triggerEvent 为只读
  2526. mpInstance.triggerEvent = newTriggerEvent;
  2527. } catch (error) {
  2528. mpInstance._triggerEvent = newTriggerEvent;
  2529. }
  2530. }
  2531. function initHook(name, options, isComponent) {
  2532. var oldHook = options[name];
  2533. options[name] = function () {
  2534. markMPComponent(this);
  2535. initTriggerEvent(this);
  2536. if (oldHook) {
  2537. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2538. args[_key4] = arguments[_key4];
  2539. }
  2540. return oldHook.apply(this, args);
  2541. }
  2542. };
  2543. }
  2544. if (!MPPage.__$wrappered) {
  2545. MPPage.__$wrappered = true;
  2546. Page = function Page() {
  2547. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2548. initHook('onLoad', options);
  2549. return MPPage(options);
  2550. };
  2551. Page.after = MPPage.after;
  2552. Component = function Component() {
  2553. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2554. initHook('created', options);
  2555. return MPComponent(options);
  2556. };
  2557. }
  2558. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2559. function initMocks(vm, mocks) {
  2560. var mpInstance = vm.$mp[vm.mpType];
  2561. mocks.forEach(function (mock) {
  2562. if (hasOwn(mpInstance, mock)) {
  2563. vm[mock] = mpInstance[mock];
  2564. }
  2565. });
  2566. }
  2567. function hasHook(hook, vueOptions) {
  2568. if (!vueOptions) {
  2569. return true;
  2570. }
  2571. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2572. return true;
  2573. }
  2574. vueOptions = vueOptions.default || vueOptions;
  2575. if (isFn(vueOptions)) {
  2576. if (isFn(vueOptions.extendOptions[hook])) {
  2577. return true;
  2578. }
  2579. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2580. return true;
  2581. }
  2582. return false;
  2583. }
  2584. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2585. return true;
  2586. }
  2587. var mixins = vueOptions.mixins;
  2588. if (Array.isArray(mixins)) {
  2589. return !!mixins.find(function (mixin) {
  2590. return hasHook(hook, mixin);
  2591. });
  2592. }
  2593. }
  2594. function initHooks(mpOptions, hooks, vueOptions) {
  2595. hooks.forEach(function (hook) {
  2596. if (hasHook(hook, vueOptions)) {
  2597. mpOptions[hook] = function (args) {
  2598. return this.$vm && this.$vm.__call_hook(hook, args);
  2599. };
  2600. }
  2601. });
  2602. }
  2603. function initUnknownHooks(mpOptions, vueOptions) {
  2604. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2605. findHooks(vueOptions).forEach(function (hook) {
  2606. return initHook$1(mpOptions, hook, excludes);
  2607. });
  2608. }
  2609. function findHooks(vueOptions) {
  2610. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2611. if (vueOptions) {
  2612. Object.keys(vueOptions).forEach(function (name) {
  2613. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2614. hooks.push(name);
  2615. }
  2616. });
  2617. }
  2618. return hooks;
  2619. }
  2620. function initHook$1(mpOptions, hook, excludes) {
  2621. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2622. mpOptions[hook] = function (args) {
  2623. return this.$vm && this.$vm.__call_hook(hook, args);
  2624. };
  2625. }
  2626. }
  2627. function initVueComponent(Vue, vueOptions) {
  2628. vueOptions = vueOptions.default || vueOptions;
  2629. var VueComponent;
  2630. if (isFn(vueOptions)) {
  2631. VueComponent = vueOptions;
  2632. } else {
  2633. VueComponent = Vue.extend(vueOptions);
  2634. }
  2635. vueOptions = VueComponent.options;
  2636. return [VueComponent, vueOptions];
  2637. }
  2638. function initSlots(vm, vueSlots) {
  2639. if (Array.isArray(vueSlots) && vueSlots.length) {
  2640. var $slots = Object.create(null);
  2641. vueSlots.forEach(function (slotName) {
  2642. $slots[slotName] = true;
  2643. });
  2644. vm.$scopedSlots = vm.$slots = $slots;
  2645. }
  2646. }
  2647. function initVueIds(vueIds, mpInstance) {
  2648. vueIds = (vueIds || '').split(',');
  2649. var len = vueIds.length;
  2650. if (len === 1) {
  2651. mpInstance._$vueId = vueIds[0];
  2652. } else if (len === 2) {
  2653. mpInstance._$vueId = vueIds[0];
  2654. mpInstance._$vuePid = vueIds[1];
  2655. }
  2656. }
  2657. function initData(vueOptions, context) {
  2658. var data = vueOptions.data || {};
  2659. var methods = vueOptions.methods || {};
  2660. if (typeof data === 'function') {
  2661. try {
  2662. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2663. } catch (e) {
  2664. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2665. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2666. }
  2667. }
  2668. } else {
  2669. try {
  2670. // 对 data 格式化
  2671. data = JSON.parse(JSON.stringify(data));
  2672. } catch (e) {}
  2673. }
  2674. if (!isPlainObject(data)) {
  2675. data = {};
  2676. }
  2677. Object.keys(methods).forEach(function (methodName) {
  2678. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2679. data[methodName] = methods[methodName];
  2680. }
  2681. });
  2682. return data;
  2683. }
  2684. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2685. function createObserver(name) {
  2686. return function observer(newVal, oldVal) {
  2687. if (this.$vm) {
  2688. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2689. }
  2690. };
  2691. }
  2692. function initBehaviors(vueOptions, initBehavior) {
  2693. var vueBehaviors = vueOptions.behaviors;
  2694. var vueExtends = vueOptions.extends;
  2695. var vueMixins = vueOptions.mixins;
  2696. var vueProps = vueOptions.props;
  2697. if (!vueProps) {
  2698. vueOptions.props = vueProps = [];
  2699. }
  2700. var behaviors = [];
  2701. if (Array.isArray(vueBehaviors)) {
  2702. vueBehaviors.forEach(function (behavior) {
  2703. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2704. if (behavior === 'uni://form-field') {
  2705. if (Array.isArray(vueProps)) {
  2706. vueProps.push('name');
  2707. vueProps.push('value');
  2708. } else {
  2709. vueProps.name = {
  2710. type: String,
  2711. default: ''
  2712. };
  2713. vueProps.value = {
  2714. type: [String, Number, Boolean, Array, Object, Date],
  2715. default: ''
  2716. };
  2717. }
  2718. }
  2719. });
  2720. }
  2721. if (isPlainObject(vueExtends) && vueExtends.props) {
  2722. behaviors.push(initBehavior({
  2723. properties: initProperties(vueExtends.props, true)
  2724. }));
  2725. }
  2726. if (Array.isArray(vueMixins)) {
  2727. vueMixins.forEach(function (vueMixin) {
  2728. if (isPlainObject(vueMixin) && vueMixin.props) {
  2729. behaviors.push(initBehavior({
  2730. properties: initProperties(vueMixin.props, true)
  2731. }));
  2732. }
  2733. });
  2734. }
  2735. return behaviors;
  2736. }
  2737. function parsePropType(key, type, defaultValue, file) {
  2738. // [String]=>String
  2739. if (Array.isArray(type) && type.length === 1) {
  2740. return type[0];
  2741. }
  2742. return type;
  2743. }
  2744. function initProperties(props) {
  2745. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2746. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2747. var options = arguments.length > 3 ? arguments[3] : undefined;
  2748. var properties = {};
  2749. if (!isBehavior) {
  2750. properties.vueId = {
  2751. type: String,
  2752. value: ''
  2753. };
  2754. {
  2755. if (options.virtualHost) {
  2756. properties.virtualHostStyle = {
  2757. type: null,
  2758. value: ''
  2759. };
  2760. properties.virtualHostClass = {
  2761. type: null,
  2762. value: ''
  2763. };
  2764. }
  2765. }
  2766. // scopedSlotsCompiler auto
  2767. properties.scopedSlotsCompiler = {
  2768. type: String,
  2769. value: ''
  2770. };
  2771. properties.vueSlots = {
  2772. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2773. type: null,
  2774. value: [],
  2775. observer: function observer(newVal, oldVal) {
  2776. var $slots = Object.create(null);
  2777. newVal.forEach(function (slotName) {
  2778. $slots[slotName] = true;
  2779. });
  2780. this.setData({
  2781. $slots: $slots
  2782. });
  2783. }
  2784. };
  2785. }
  2786. if (Array.isArray(props)) {
  2787. // ['title']
  2788. props.forEach(function (key) {
  2789. properties[key] = {
  2790. type: null,
  2791. observer: createObserver(key)
  2792. };
  2793. });
  2794. } else if (isPlainObject(props)) {
  2795. // {title:{type:String,default:''},content:String}
  2796. Object.keys(props).forEach(function (key) {
  2797. var opts = props[key];
  2798. if (isPlainObject(opts)) {
  2799. // title:{type:String,default:''}
  2800. var value = opts.default;
  2801. if (isFn(value)) {
  2802. value = value();
  2803. }
  2804. opts.type = parsePropType(key, opts.type);
  2805. properties[key] = {
  2806. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2807. value: value,
  2808. observer: createObserver(key)
  2809. };
  2810. } else {
  2811. // content:String
  2812. var type = parsePropType(key, opts);
  2813. properties[key] = {
  2814. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2815. observer: createObserver(key)
  2816. };
  2817. }
  2818. });
  2819. }
  2820. return properties;
  2821. }
  2822. function wrapper$1(event) {
  2823. // TODO 又得兼容 mpvue 的 mp 对象
  2824. try {
  2825. event.mp = JSON.parse(JSON.stringify(event));
  2826. } catch (e) {}
  2827. event.stopPropagation = noop;
  2828. event.preventDefault = noop;
  2829. event.target = event.target || {};
  2830. if (!hasOwn(event, 'detail')) {
  2831. event.detail = {};
  2832. }
  2833. if (hasOwn(event, 'markerId')) {
  2834. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2835. event.detail.markerId = event.markerId;
  2836. }
  2837. if (isPlainObject(event.detail)) {
  2838. event.target = Object.assign({}, event.target, event.detail);
  2839. }
  2840. return event;
  2841. }
  2842. function getExtraValue(vm, dataPathsArray) {
  2843. var context = vm;
  2844. dataPathsArray.forEach(function (dataPathArray) {
  2845. var dataPath = dataPathArray[0];
  2846. var value = dataPathArray[2];
  2847. if (dataPath || typeof value !== 'undefined') {
  2848. // ['','',index,'disable']
  2849. var propPath = dataPathArray[1];
  2850. var valuePath = dataPathArray[3];
  2851. var vFor;
  2852. if (Number.isInteger(dataPath)) {
  2853. vFor = dataPath;
  2854. } else if (!dataPath) {
  2855. vFor = context;
  2856. } else if (typeof dataPath === 'string' && dataPath) {
  2857. if (dataPath.indexOf('#s#') === 0) {
  2858. vFor = dataPath.substr(3);
  2859. } else {
  2860. vFor = vm.__get_value(dataPath, context);
  2861. }
  2862. }
  2863. if (Number.isInteger(vFor)) {
  2864. context = value;
  2865. } else if (!propPath) {
  2866. context = vFor[value];
  2867. } else {
  2868. if (Array.isArray(vFor)) {
  2869. context = vFor.find(function (vForItem) {
  2870. return vm.__get_value(propPath, vForItem) === value;
  2871. });
  2872. } else if (isPlainObject(vFor)) {
  2873. context = Object.keys(vFor).find(function (vForKey) {
  2874. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2875. });
  2876. } else {
  2877. console.error('v-for 暂不支持循环数据:', vFor);
  2878. }
  2879. }
  2880. if (valuePath) {
  2881. context = vm.__get_value(valuePath, context);
  2882. }
  2883. }
  2884. });
  2885. return context;
  2886. }
  2887. function processEventExtra(vm, extra, event, __args__) {
  2888. var extraObj = {};
  2889. if (Array.isArray(extra) && extra.length) {
  2890. /**
  2891. *[
  2892. * ['data.items', 'data.id', item.data.id],
  2893. * ['metas', 'id', meta.id]
  2894. *],
  2895. *[
  2896. * ['data.items', 'data.id', item.data.id],
  2897. * ['metas', 'id', meta.id]
  2898. *],
  2899. *'test'
  2900. */
  2901. extra.forEach(function (dataPath, index) {
  2902. if (typeof dataPath === 'string') {
  2903. if (!dataPath) {
  2904. // model,prop.sync
  2905. extraObj['$' + index] = vm;
  2906. } else {
  2907. if (dataPath === '$event') {
  2908. // $event
  2909. extraObj['$' + index] = event;
  2910. } else if (dataPath === 'arguments') {
  2911. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2912. } else if (dataPath.indexOf('$event.') === 0) {
  2913. // $event.target.value
  2914. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2915. } else {
  2916. extraObj['$' + index] = vm.__get_value(dataPath);
  2917. }
  2918. }
  2919. } else {
  2920. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2921. }
  2922. });
  2923. }
  2924. return extraObj;
  2925. }
  2926. function getObjByArray(arr) {
  2927. var obj = {};
  2928. for (var i = 1; i < arr.length; i++) {
  2929. var element = arr[i];
  2930. obj[element[0]] = element[1];
  2931. }
  2932. return obj;
  2933. }
  2934. function processEventArgs(vm, event) {
  2935. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2936. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2937. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2938. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2939. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2940. // fixed 用户直接触发 mpInstance.triggerEvent
  2941. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2942. if (isCustom) {
  2943. // 自定义事件
  2944. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2945. if (!args.length) {
  2946. // 无参数,直接传入 event 或 detail 数组
  2947. if (isCustomMPEvent) {
  2948. return [event];
  2949. }
  2950. return __args__;
  2951. }
  2952. }
  2953. var extraObj = processEventExtra(vm, extra, event, __args__);
  2954. var ret = [];
  2955. args.forEach(function (arg) {
  2956. if (arg === '$event') {
  2957. if (methodName === '__set_model' && !isCustom) {
  2958. // input v-model value
  2959. ret.push(event.target.value);
  2960. } else {
  2961. if (isCustom && !isCustomMPEvent) {
  2962. ret.push(__args__[0]);
  2963. } else {
  2964. // wxcomponent 组件或内置组件
  2965. ret.push(event);
  2966. }
  2967. }
  2968. } else {
  2969. if (Array.isArray(arg) && arg[0] === 'o') {
  2970. ret.push(getObjByArray(arg));
  2971. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2972. ret.push(extraObj[arg]);
  2973. } else {
  2974. ret.push(arg);
  2975. }
  2976. }
  2977. });
  2978. return ret;
  2979. }
  2980. var ONCE = '~';
  2981. var CUSTOM = '^';
  2982. function isMatchEventType(eventType, optType) {
  2983. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2984. }
  2985. function getContextVm(vm) {
  2986. var $parent = vm.$parent;
  2987. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2988. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2989. $parent = $parent.$parent;
  2990. }
  2991. return $parent && $parent.$parent;
  2992. }
  2993. function handleEvent(event) {
  2994. var _this2 = this;
  2995. event = wrapper$1(event);
  2996. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2997. var dataset = (event.currentTarget || event.target).dataset;
  2998. if (!dataset) {
  2999. return console.warn('事件信息不存在');
  3000. }
  3001. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  3002. if (!eventOpts) {
  3003. return console.warn('事件信息不存在');
  3004. }
  3005. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  3006. var eventType = event.type;
  3007. var ret = [];
  3008. eventOpts.forEach(function (eventOpt) {
  3009. var type = eventOpt[0];
  3010. var eventsArray = eventOpt[1];
  3011. var isCustom = type.charAt(0) === CUSTOM;
  3012. type = isCustom ? type.slice(1) : type;
  3013. var isOnce = type.charAt(0) === ONCE;
  3014. type = isOnce ? type.slice(1) : type;
  3015. if (eventsArray && isMatchEventType(eventType, type)) {
  3016. eventsArray.forEach(function (eventArray) {
  3017. var methodName = eventArray[0];
  3018. if (methodName) {
  3019. var handlerCtx = _this2.$vm;
  3020. if (handlerCtx.$options.generic) {
  3021. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  3022. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  3023. }
  3024. if (methodName === '$emit') {
  3025. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  3026. return;
  3027. }
  3028. var handler = handlerCtx[methodName];
  3029. if (!isFn(handler)) {
  3030. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  3031. var path = _this2.route || _this2.is;
  3032. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  3033. }
  3034. if (isOnce) {
  3035. if (handler.once) {
  3036. return;
  3037. }
  3038. handler.once = true;
  3039. }
  3040. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  3041. params = Array.isArray(params) ? params : [];
  3042. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  3043. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  3044. // eslint-disable-next-line no-sparse-arrays
  3045. params = params.concat([,,,,,,,,,, event]);
  3046. }
  3047. ret.push(handler.apply(handlerCtx, params));
  3048. }
  3049. });
  3050. }
  3051. });
  3052. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  3053. return ret[0];
  3054. }
  3055. }
  3056. var eventChannels = {};
  3057. var eventChannelStack = [];
  3058. function getEventChannel(id) {
  3059. if (id) {
  3060. var eventChannel = eventChannels[id];
  3061. delete eventChannels[id];
  3062. return eventChannel;
  3063. }
  3064. return eventChannelStack.shift();
  3065. }
  3066. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  3067. function initEventChannel() {
  3068. _vue.default.prototype.getOpenerEventChannel = function () {
  3069. // 微信小程序使用自身getOpenerEventChannel
  3070. {
  3071. return this.$scope.getOpenerEventChannel();
  3072. }
  3073. };
  3074. var callHook = _vue.default.prototype.__call_hook;
  3075. _vue.default.prototype.__call_hook = function (hook, args) {
  3076. if (hook === 'onLoad' && args && args.__id__) {
  3077. this.__eventChannel__ = getEventChannel(args.__id__);
  3078. delete args.__id__;
  3079. }
  3080. return callHook.call(this, hook, args);
  3081. };
  3082. }
  3083. function initScopedSlotsParams() {
  3084. var center = {};
  3085. var parents = {};
  3086. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  3087. var has = center[vueId];
  3088. if (!has) {
  3089. parents[vueId] = this;
  3090. this.$on('hook:destroyed', function () {
  3091. delete parents[vueId];
  3092. });
  3093. }
  3094. return has;
  3095. };
  3096. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  3097. var data = center[vueId];
  3098. if (data) {
  3099. var object = data[name] || {};
  3100. return key ? object[key] : object;
  3101. } else {
  3102. parents[vueId] = this;
  3103. this.$on('hook:destroyed', function () {
  3104. delete parents[vueId];
  3105. });
  3106. }
  3107. };
  3108. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  3109. var vueIds = this.$options.propsData.vueId;
  3110. if (vueIds) {
  3111. var vueId = vueIds.split(',')[0];
  3112. var object = center[vueId] = center[vueId] || {};
  3113. object[name] = value;
  3114. if (parents[vueId]) {
  3115. parents[vueId].$forceUpdate();
  3116. }
  3117. }
  3118. };
  3119. _vue.default.mixin({
  3120. destroyed: function destroyed() {
  3121. var propsData = this.$options.propsData;
  3122. var vueId = propsData && propsData.vueId;
  3123. if (vueId) {
  3124. delete center[vueId];
  3125. delete parents[vueId];
  3126. }
  3127. }
  3128. });
  3129. }
  3130. function parseBaseApp(vm, _ref4) {
  3131. var mocks = _ref4.mocks,
  3132. initRefs = _ref4.initRefs;
  3133. initEventChannel();
  3134. {
  3135. initScopedSlotsParams();
  3136. }
  3137. if (vm.$options.store) {
  3138. _vue.default.prototype.$store = vm.$options.store;
  3139. }
  3140. uniIdMixin(_vue.default);
  3141. _vue.default.prototype.mpHost = "mp-weixin";
  3142. _vue.default.mixin({
  3143. beforeCreate: function beforeCreate() {
  3144. if (!this.$options.mpType) {
  3145. return;
  3146. }
  3147. this.mpType = this.$options.mpType;
  3148. this.$mp = (0, _defineProperty2.default)({
  3149. data: {}
  3150. }, this.mpType, this.$options.mpInstance);
  3151. this.$scope = this.$options.mpInstance;
  3152. delete this.$options.mpType;
  3153. delete this.$options.mpInstance;
  3154. if (this.mpType === 'page' && typeof getApp === 'function') {
  3155. // hack vue-i18n
  3156. var app = getApp();
  3157. if (app.$vm && app.$vm.$i18n) {
  3158. this._i18n = app.$vm.$i18n;
  3159. }
  3160. }
  3161. if (this.mpType !== 'app') {
  3162. initRefs(this);
  3163. initMocks(this, mocks);
  3164. }
  3165. }
  3166. });
  3167. var appOptions = {
  3168. onLaunch: function onLaunch(args) {
  3169. if (this.$vm) {
  3170. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  3171. return;
  3172. }
  3173. {
  3174. if (wx.canIUse && !wx.canIUse('nextTick')) {
  3175. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  3176. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  3177. }
  3178. }
  3179. this.$vm = vm;
  3180. this.$vm.$mp = {
  3181. app: this
  3182. };
  3183. this.$vm.$scope = this;
  3184. // vm 上也挂载 globalData
  3185. this.$vm.globalData = this.globalData;
  3186. this.$vm._isMounted = true;
  3187. this.$vm.__call_hook('mounted', args);
  3188. this.$vm.__call_hook('onLaunch', args);
  3189. }
  3190. };
  3191. // 兼容旧版本 globalData
  3192. appOptions.globalData = vm.$options.globalData || {};
  3193. // 将 methods 中的方法挂在 getApp() 中
  3194. var methods = vm.$options.methods;
  3195. if (methods) {
  3196. Object.keys(methods).forEach(function (name) {
  3197. appOptions[name] = methods[name];
  3198. });
  3199. }
  3200. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  3201. initHooks(appOptions, hooks);
  3202. initUnknownHooks(appOptions, vm.$options);
  3203. return appOptions;
  3204. }
  3205. function parseApp(vm) {
  3206. return parseBaseApp(vm, {
  3207. mocks: mocks,
  3208. initRefs: initRefs
  3209. });
  3210. }
  3211. function createApp(vm) {
  3212. App(parseApp(vm));
  3213. return vm;
  3214. }
  3215. var encodeReserveRE = /[!'()*]/g;
  3216. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  3217. return '%' + c.charCodeAt(0).toString(16);
  3218. };
  3219. var commaRE = /%2C/g;
  3220. // fixed encodeURIComponent which is more conformant to RFC3986:
  3221. // - escapes [!'()*]
  3222. // - preserve commas
  3223. var encode = function encode(str) {
  3224. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  3225. };
  3226. function stringifyQuery(obj) {
  3227. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  3228. var res = obj ? Object.keys(obj).map(function (key) {
  3229. var val = obj[key];
  3230. if (val === undefined) {
  3231. return '';
  3232. }
  3233. if (val === null) {
  3234. return encodeStr(key);
  3235. }
  3236. if (Array.isArray(val)) {
  3237. var result = [];
  3238. val.forEach(function (val2) {
  3239. if (val2 === undefined) {
  3240. return;
  3241. }
  3242. if (val2 === null) {
  3243. result.push(encodeStr(key));
  3244. } else {
  3245. result.push(encodeStr(key) + '=' + encodeStr(val2));
  3246. }
  3247. });
  3248. return result.join('&');
  3249. }
  3250. return encodeStr(key) + '=' + encodeStr(val);
  3251. }).filter(function (x) {
  3252. return x.length > 0;
  3253. }).join('&') : null;
  3254. return res ? "?".concat(res) : '';
  3255. }
  3256. function parseBaseComponent(vueComponentOptions) {
  3257. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  3258. isPage = _ref5.isPage,
  3259. initRelation = _ref5.initRelation;
  3260. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  3261. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  3262. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  3263. VueComponent = _initVueComponent2[0],
  3264. vueOptions = _initVueComponent2[1];
  3265. var options = _objectSpread({
  3266. multipleSlots: true,
  3267. addGlobalClass: true
  3268. }, vueOptions.options || {});
  3269. {
  3270. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  3271. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  3272. Object.assign(options, vueOptions['mp-weixin'].options);
  3273. }
  3274. }
  3275. var componentOptions = {
  3276. options: options,
  3277. data: initData(vueOptions, _vue.default.prototype),
  3278. behaviors: initBehaviors(vueOptions, initBehavior),
  3279. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  3280. lifetimes: {
  3281. attached: function attached() {
  3282. var properties = this.properties;
  3283. var options = {
  3284. mpType: isPage.call(this) ? 'page' : 'component',
  3285. mpInstance: this,
  3286. propsData: properties
  3287. };
  3288. initVueIds(properties.vueId, this);
  3289. // 处理父子关系
  3290. initRelation.call(this, {
  3291. vuePid: this._$vuePid,
  3292. vueOptions: options
  3293. });
  3294. // 初始化 vue 实例
  3295. this.$vm = new VueComponent(options);
  3296. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  3297. initSlots(this.$vm, properties.vueSlots);
  3298. // 触发首次 setData
  3299. this.$vm.$mount();
  3300. },
  3301. ready: function ready() {
  3302. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  3303. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  3304. if (this.$vm) {
  3305. this.$vm._isMounted = true;
  3306. this.$vm.__call_hook('mounted');
  3307. this.$vm.__call_hook('onReady');
  3308. }
  3309. },
  3310. detached: function detached() {
  3311. this.$vm && this.$vm.$destroy();
  3312. }
  3313. },
  3314. pageLifetimes: {
  3315. show: function show(args) {
  3316. this.$vm && this.$vm.__call_hook('onPageShow', args);
  3317. },
  3318. hide: function hide() {
  3319. this.$vm && this.$vm.__call_hook('onPageHide');
  3320. },
  3321. resize: function resize(size) {
  3322. this.$vm && this.$vm.__call_hook('onPageResize', size);
  3323. }
  3324. },
  3325. methods: {
  3326. __l: handleLink,
  3327. __e: handleEvent
  3328. }
  3329. };
  3330. // externalClasses
  3331. if (vueOptions.externalClasses) {
  3332. componentOptions.externalClasses = vueOptions.externalClasses;
  3333. }
  3334. if (Array.isArray(vueOptions.wxsCallMethods)) {
  3335. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  3336. componentOptions.methods[callMethod] = function (args) {
  3337. return this.$vm[callMethod](args);
  3338. };
  3339. });
  3340. }
  3341. if (needVueOptions) {
  3342. return [componentOptions, vueOptions, VueComponent];
  3343. }
  3344. if (isPage) {
  3345. return componentOptions;
  3346. }
  3347. return [componentOptions, VueComponent];
  3348. }
  3349. function parseComponent(vueComponentOptions, needVueOptions) {
  3350. return parseBaseComponent(vueComponentOptions, {
  3351. isPage: isPage,
  3352. initRelation: initRelation
  3353. }, needVueOptions);
  3354. }
  3355. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  3356. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  3357. function parseBasePage(vuePageOptions) {
  3358. var _parseComponent = parseComponent(vuePageOptions, true),
  3359. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  3360. pageOptions = _parseComponent2[0],
  3361. vueOptions = _parseComponent2[1];
  3362. initHooks(pageOptions.methods, hooks$1, vueOptions);
  3363. pageOptions.methods.onLoad = function (query) {
  3364. this.options = query;
  3365. var copyQuery = Object.assign({}, query);
  3366. delete copyQuery.__id__;
  3367. this.$page = {
  3368. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  3369. };
  3370. this.$vm.$mp.query = query; // 兼容 mpvue
  3371. this.$vm.__call_hook('onLoad', query);
  3372. };
  3373. {
  3374. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  3375. }
  3376. return pageOptions;
  3377. }
  3378. function parsePage(vuePageOptions) {
  3379. return parseBasePage(vuePageOptions);
  3380. }
  3381. function createPage(vuePageOptions) {
  3382. {
  3383. return Component(parsePage(vuePageOptions));
  3384. }
  3385. }
  3386. function createComponent(vueOptions) {
  3387. {
  3388. return Component(parseComponent(vueOptions));
  3389. }
  3390. }
  3391. function createSubpackageApp(vm) {
  3392. var appOptions = parseApp(vm);
  3393. var app = getApp({
  3394. allowDefault: true
  3395. });
  3396. vm.$scope = app;
  3397. var globalData = app.globalData;
  3398. if (globalData) {
  3399. Object.keys(appOptions.globalData).forEach(function (name) {
  3400. if (!hasOwn(globalData, name)) {
  3401. globalData[name] = appOptions.globalData[name];
  3402. }
  3403. });
  3404. }
  3405. Object.keys(appOptions).forEach(function (name) {
  3406. if (!hasOwn(app, name)) {
  3407. app[name] = appOptions[name];
  3408. }
  3409. });
  3410. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3411. wx.onAppShow(function () {
  3412. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3413. args[_key5] = arguments[_key5];
  3414. }
  3415. vm.__call_hook('onShow', args);
  3416. });
  3417. }
  3418. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3419. wx.onAppHide(function () {
  3420. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3421. args[_key6] = arguments[_key6];
  3422. }
  3423. vm.__call_hook('onHide', args);
  3424. });
  3425. }
  3426. if (isFn(appOptions.onLaunch)) {
  3427. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3428. vm.__call_hook('onLaunch', args);
  3429. }
  3430. return vm;
  3431. }
  3432. function createPlugin(vm) {
  3433. var appOptions = parseApp(vm);
  3434. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3435. wx.onAppShow(function () {
  3436. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3437. args[_key7] = arguments[_key7];
  3438. }
  3439. vm.__call_hook('onShow', args);
  3440. });
  3441. }
  3442. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3443. wx.onAppHide(function () {
  3444. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3445. args[_key8] = arguments[_key8];
  3446. }
  3447. vm.__call_hook('onHide', args);
  3448. });
  3449. }
  3450. if (isFn(appOptions.onLaunch)) {
  3451. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3452. vm.__call_hook('onLaunch', args);
  3453. }
  3454. return vm;
  3455. }
  3456. todos.forEach(function (todoApi) {
  3457. protocols[todoApi] = false;
  3458. });
  3459. canIUses.forEach(function (canIUseApi) {
  3460. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3461. if (!wx.canIUse(apiName)) {
  3462. protocols[canIUseApi] = false;
  3463. }
  3464. });
  3465. var uni = {};
  3466. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3467. uni = new Proxy({}, {
  3468. get: function get(target, name) {
  3469. if (hasOwn(target, name)) {
  3470. return target[name];
  3471. }
  3472. if (baseApi[name]) {
  3473. return baseApi[name];
  3474. }
  3475. if (api[name]) {
  3476. return promisify(name, api[name]);
  3477. }
  3478. {
  3479. if (extraApi[name]) {
  3480. return promisify(name, extraApi[name]);
  3481. }
  3482. if (todoApis[name]) {
  3483. return promisify(name, todoApis[name]);
  3484. }
  3485. }
  3486. if (eventApi[name]) {
  3487. return eventApi[name];
  3488. }
  3489. return promisify(name, wrapper(name, wx[name]));
  3490. },
  3491. set: function set(target, name, value) {
  3492. target[name] = value;
  3493. return true;
  3494. }
  3495. });
  3496. } else {
  3497. Object.keys(baseApi).forEach(function (name) {
  3498. uni[name] = baseApi[name];
  3499. });
  3500. {
  3501. Object.keys(todoApis).forEach(function (name) {
  3502. uni[name] = promisify(name, todoApis[name]);
  3503. });
  3504. Object.keys(extraApi).forEach(function (name) {
  3505. uni[name] = promisify(name, todoApis[name]);
  3506. });
  3507. }
  3508. Object.keys(eventApi).forEach(function (name) {
  3509. uni[name] = eventApi[name];
  3510. });
  3511. Object.keys(api).forEach(function (name) {
  3512. uni[name] = promisify(name, api[name]);
  3513. });
  3514. Object.keys(wx).forEach(function (name) {
  3515. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3516. uni[name] = promisify(name, wrapper(name, wx[name]));
  3517. }
  3518. });
  3519. }
  3520. wx.createApp = createApp;
  3521. wx.createPage = createPage;
  3522. wx.createComponent = createComponent;
  3523. wx.createSubpackageApp = createSubpackageApp;
  3524. wx.createPlugin = createPlugin;
  3525. var uni$1 = uni;
  3526. var _default = uni$1;
  3527. exports.default = _default;
  3528. /* 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)))
  3529. /***/ }),
  3530. /***/ 20:
  3531. /*!****************************************************************!*\
  3532. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3533. \****************************************************************/
  3534. /*! no static exports found */
  3535. /***/ (function(module, exports) {
  3536. function _iterableToArray(iter) {
  3537. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3538. }
  3539. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3540. /***/ }),
  3541. /***/ 21:
  3542. /*!******************************************************************!*\
  3543. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3544. \******************************************************************/
  3545. /*! no static exports found */
  3546. /***/ (function(module, exports) {
  3547. function _nonIterableSpread() {
  3548. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3549. }
  3550. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3551. /***/ }),
  3552. /***/ 22:
  3553. /*!*************************************************************!*\
  3554. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3555. \*************************************************************/
  3556. /*! no static exports found */
  3557. /***/ (function(module, exports, __webpack_require__) {
  3558. "use strict";
  3559. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3560. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3561. Object.defineProperty(exports, "__esModule", {
  3562. value: true
  3563. });
  3564. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3565. exports.compileI18nJsonStr = compileI18nJsonStr;
  3566. exports.hasI18nJson = hasI18nJson;
  3567. exports.initVueI18n = initVueI18n;
  3568. exports.isI18nStr = isI18nStr;
  3569. exports.isString = void 0;
  3570. exports.normalizeLocale = normalizeLocale;
  3571. exports.parseI18nJson = parseI18nJson;
  3572. exports.resolveLocale = resolveLocale;
  3573. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3574. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3575. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3576. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3577. var isArray = Array.isArray;
  3578. var isObject = function isObject(val) {
  3579. return val !== null && (0, _typeof2.default)(val) === 'object';
  3580. };
  3581. var defaultDelimiters = ['{', '}'];
  3582. var BaseFormatter = /*#__PURE__*/function () {
  3583. function BaseFormatter() {
  3584. (0, _classCallCheck2.default)(this, BaseFormatter);
  3585. this._caches = Object.create(null);
  3586. }
  3587. (0, _createClass2.default)(BaseFormatter, [{
  3588. key: "interpolate",
  3589. value: function interpolate(message, values) {
  3590. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3591. if (!values) {
  3592. return [message];
  3593. }
  3594. var tokens = this._caches[message];
  3595. if (!tokens) {
  3596. tokens = parse(message, delimiters);
  3597. this._caches[message] = tokens;
  3598. }
  3599. return compile(tokens, values);
  3600. }
  3601. }]);
  3602. return BaseFormatter;
  3603. }();
  3604. exports.Formatter = BaseFormatter;
  3605. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3606. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3607. function parse(format, _ref) {
  3608. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3609. startDelimiter = _ref2[0],
  3610. endDelimiter = _ref2[1];
  3611. var tokens = [];
  3612. var position = 0;
  3613. var text = '';
  3614. while (position < format.length) {
  3615. var char = format[position++];
  3616. if (char === startDelimiter) {
  3617. if (text) {
  3618. tokens.push({
  3619. type: 'text',
  3620. value: text
  3621. });
  3622. }
  3623. text = '';
  3624. var sub = '';
  3625. char = format[position++];
  3626. while (char !== undefined && char !== endDelimiter) {
  3627. sub += char;
  3628. char = format[position++];
  3629. }
  3630. var isClosed = char === endDelimiter;
  3631. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3632. tokens.push({
  3633. value: sub,
  3634. type: type
  3635. });
  3636. }
  3637. // else if (char === '%') {
  3638. // // when found rails i18n syntax, skip text capture
  3639. // if (format[position] !== '{') {
  3640. // text += char
  3641. // }
  3642. // }
  3643. else {
  3644. text += char;
  3645. }
  3646. }
  3647. text && tokens.push({
  3648. type: 'text',
  3649. value: text
  3650. });
  3651. return tokens;
  3652. }
  3653. function compile(tokens, values) {
  3654. var compiled = [];
  3655. var index = 0;
  3656. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3657. if (mode === 'unknown') {
  3658. return compiled;
  3659. }
  3660. while (index < tokens.length) {
  3661. var token = tokens[index];
  3662. switch (token.type) {
  3663. case 'text':
  3664. compiled.push(token.value);
  3665. break;
  3666. case 'list':
  3667. compiled.push(values[parseInt(token.value, 10)]);
  3668. break;
  3669. case 'named':
  3670. if (mode === 'named') {
  3671. compiled.push(values[token.value]);
  3672. } else {
  3673. if (true) {
  3674. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3675. }
  3676. }
  3677. break;
  3678. case 'unknown':
  3679. if (true) {
  3680. console.warn("Detect 'unknown' type of token!");
  3681. }
  3682. break;
  3683. }
  3684. index++;
  3685. }
  3686. return compiled;
  3687. }
  3688. var LOCALE_ZH_HANS = 'zh-Hans';
  3689. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3690. var LOCALE_ZH_HANT = 'zh-Hant';
  3691. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3692. var LOCALE_EN = 'en';
  3693. exports.LOCALE_EN = LOCALE_EN;
  3694. var LOCALE_FR = 'fr';
  3695. exports.LOCALE_FR = LOCALE_FR;
  3696. var LOCALE_ES = 'es';
  3697. exports.LOCALE_ES = LOCALE_ES;
  3698. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3699. var hasOwn = function hasOwn(val, key) {
  3700. return hasOwnProperty.call(val, key);
  3701. };
  3702. var defaultFormatter = new BaseFormatter();
  3703. function include(str, parts) {
  3704. return !!parts.find(function (part) {
  3705. return str.indexOf(part) !== -1;
  3706. });
  3707. }
  3708. function startsWith(str, parts) {
  3709. return parts.find(function (part) {
  3710. return str.indexOf(part) === 0;
  3711. });
  3712. }
  3713. function normalizeLocale(locale, messages) {
  3714. if (!locale) {
  3715. return;
  3716. }
  3717. locale = locale.trim().replace(/_/g, '-');
  3718. if (messages && messages[locale]) {
  3719. return locale;
  3720. }
  3721. locale = locale.toLowerCase();
  3722. if (locale.indexOf('zh') === 0) {
  3723. if (locale.indexOf('-hans') > -1) {
  3724. return LOCALE_ZH_HANS;
  3725. }
  3726. if (locale.indexOf('-hant') > -1) {
  3727. return LOCALE_ZH_HANT;
  3728. }
  3729. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3730. return LOCALE_ZH_HANT;
  3731. }
  3732. return LOCALE_ZH_HANS;
  3733. }
  3734. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  3735. if (lang) {
  3736. return lang;
  3737. }
  3738. }
  3739. var I18n = /*#__PURE__*/function () {
  3740. function I18n(_ref3) {
  3741. var locale = _ref3.locale,
  3742. fallbackLocale = _ref3.fallbackLocale,
  3743. messages = _ref3.messages,
  3744. watcher = _ref3.watcher,
  3745. formater = _ref3.formater;
  3746. (0, _classCallCheck2.default)(this, I18n);
  3747. this.locale = LOCALE_EN;
  3748. this.fallbackLocale = LOCALE_EN;
  3749. this.message = {};
  3750. this.messages = {};
  3751. this.watchers = [];
  3752. if (fallbackLocale) {
  3753. this.fallbackLocale = fallbackLocale;
  3754. }
  3755. this.formater = formater || defaultFormatter;
  3756. this.messages = messages || {};
  3757. this.setLocale(locale || LOCALE_EN);
  3758. if (watcher) {
  3759. this.watchLocale(watcher);
  3760. }
  3761. }
  3762. (0, _createClass2.default)(I18n, [{
  3763. key: "setLocale",
  3764. value: function setLocale(locale) {
  3765. var _this = this;
  3766. var oldLocale = this.locale;
  3767. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3768. if (!this.messages[this.locale]) {
  3769. // 可能初始化时不存在
  3770. this.messages[this.locale] = {};
  3771. }
  3772. this.message = this.messages[this.locale];
  3773. // 仅发生变化时,通知
  3774. if (oldLocale !== this.locale) {
  3775. this.watchers.forEach(function (watcher) {
  3776. watcher(_this.locale, oldLocale);
  3777. });
  3778. }
  3779. }
  3780. }, {
  3781. key: "getLocale",
  3782. value: function getLocale() {
  3783. return this.locale;
  3784. }
  3785. }, {
  3786. key: "watchLocale",
  3787. value: function watchLocale(fn) {
  3788. var _this2 = this;
  3789. var index = this.watchers.push(fn) - 1;
  3790. return function () {
  3791. _this2.watchers.splice(index, 1);
  3792. };
  3793. }
  3794. }, {
  3795. key: "add",
  3796. value: function add(locale, message) {
  3797. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3798. var curMessages = this.messages[locale];
  3799. if (curMessages) {
  3800. if (override) {
  3801. Object.assign(curMessages, message);
  3802. } else {
  3803. Object.keys(message).forEach(function (key) {
  3804. if (!hasOwn(curMessages, key)) {
  3805. curMessages[key] = message[key];
  3806. }
  3807. });
  3808. }
  3809. } else {
  3810. this.messages[locale] = message;
  3811. }
  3812. }
  3813. }, {
  3814. key: "f",
  3815. value: function f(message, values, delimiters) {
  3816. return this.formater.interpolate(message, values, delimiters).join('');
  3817. }
  3818. }, {
  3819. key: "t",
  3820. value: function t(key, locale, values) {
  3821. var message = this.message;
  3822. if (typeof locale === 'string') {
  3823. locale = normalizeLocale(locale, this.messages);
  3824. locale && (message = this.messages[locale]);
  3825. } else {
  3826. values = locale;
  3827. }
  3828. if (!hasOwn(message, key)) {
  3829. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3830. return key;
  3831. }
  3832. return this.formater.interpolate(message[key], values).join('');
  3833. }
  3834. }]);
  3835. return I18n;
  3836. }();
  3837. exports.I18n = I18n;
  3838. function watchAppLocale(appVm, i18n) {
  3839. // 需要保证 watch 的触发在组件渲染之前
  3840. if (appVm.$watchLocale) {
  3841. // vue2
  3842. appVm.$watchLocale(function (newLocale) {
  3843. i18n.setLocale(newLocale);
  3844. });
  3845. } else {
  3846. appVm.$watch(function () {
  3847. return appVm.$locale;
  3848. }, function (newLocale) {
  3849. i18n.setLocale(newLocale);
  3850. });
  3851. }
  3852. }
  3853. function getDefaultLocale() {
  3854. if (typeof uni !== 'undefined' && uni.getLocale) {
  3855. return uni.getLocale();
  3856. }
  3857. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3858. if (typeof global !== 'undefined' && global.getLocale) {
  3859. return global.getLocale();
  3860. }
  3861. return LOCALE_EN;
  3862. }
  3863. function initVueI18n(locale) {
  3864. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3865. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3866. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3867. // 兼容旧版本入参
  3868. if (typeof locale !== 'string') {
  3869. var _ref4 = [messages, locale];
  3870. locale = _ref4[0];
  3871. messages = _ref4[1];
  3872. }
  3873. if (typeof locale !== 'string') {
  3874. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3875. locale = getDefaultLocale();
  3876. }
  3877. if (typeof fallbackLocale !== 'string') {
  3878. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3879. }
  3880. var i18n = new I18n({
  3881. locale: locale,
  3882. fallbackLocale: fallbackLocale,
  3883. messages: messages,
  3884. watcher: watcher
  3885. });
  3886. var _t = function t(key, values) {
  3887. if (typeof getApp !== 'function') {
  3888. // app view
  3889. /* eslint-disable no-func-assign */
  3890. _t = function t(key, values) {
  3891. return i18n.t(key, values);
  3892. };
  3893. } else {
  3894. var isWatchedAppLocale = false;
  3895. _t = function t(key, values) {
  3896. var appVm = getApp().$vm;
  3897. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3898. // options: {
  3899. // type: Array,
  3900. // default () {
  3901. // return [{
  3902. // icon: 'shop',
  3903. // text: t("uni-goods-nav.options.shop"),
  3904. // }, {
  3905. // icon: 'cart',
  3906. // text: t("uni-goods-nav.options.cart")
  3907. // }]
  3908. // }
  3909. // },
  3910. if (appVm) {
  3911. // 触发响应式
  3912. appVm.$locale;
  3913. if (!isWatchedAppLocale) {
  3914. isWatchedAppLocale = true;
  3915. watchAppLocale(appVm, i18n);
  3916. }
  3917. }
  3918. return i18n.t(key, values);
  3919. };
  3920. }
  3921. return _t(key, values);
  3922. };
  3923. return {
  3924. i18n: i18n,
  3925. f: function f(message, values, delimiters) {
  3926. return i18n.f(message, values, delimiters);
  3927. },
  3928. t: function t(key, values) {
  3929. return _t(key, values);
  3930. },
  3931. add: function add(locale, message) {
  3932. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3933. return i18n.add(locale, message, override);
  3934. },
  3935. watch: function watch(fn) {
  3936. return i18n.watchLocale(fn);
  3937. },
  3938. getLocale: function getLocale() {
  3939. return i18n.getLocale();
  3940. },
  3941. setLocale: function setLocale(newLocale) {
  3942. return i18n.setLocale(newLocale);
  3943. }
  3944. };
  3945. }
  3946. var isString = function isString(val) {
  3947. return typeof val === 'string';
  3948. };
  3949. exports.isString = isString;
  3950. var formater;
  3951. function hasI18nJson(jsonObj, delimiters) {
  3952. if (!formater) {
  3953. formater = new BaseFormatter();
  3954. }
  3955. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3956. var value = jsonObj[key];
  3957. if (isString(value)) {
  3958. if (isI18nStr(value, delimiters)) {
  3959. return true;
  3960. }
  3961. } else {
  3962. return hasI18nJson(value, delimiters);
  3963. }
  3964. });
  3965. }
  3966. function parseI18nJson(jsonObj, values, delimiters) {
  3967. if (!formater) {
  3968. formater = new BaseFormatter();
  3969. }
  3970. walkJsonObj(jsonObj, function (jsonObj, key) {
  3971. var value = jsonObj[key];
  3972. if (isString(value)) {
  3973. if (isI18nStr(value, delimiters)) {
  3974. jsonObj[key] = compileStr(value, values, delimiters);
  3975. }
  3976. } else {
  3977. parseI18nJson(value, values, delimiters);
  3978. }
  3979. });
  3980. return jsonObj;
  3981. }
  3982. function compileI18nJsonStr(jsonStr, _ref5) {
  3983. var locale = _ref5.locale,
  3984. locales = _ref5.locales,
  3985. delimiters = _ref5.delimiters;
  3986. if (!isI18nStr(jsonStr, delimiters)) {
  3987. return jsonStr;
  3988. }
  3989. if (!formater) {
  3990. formater = new BaseFormatter();
  3991. }
  3992. var localeValues = [];
  3993. Object.keys(locales).forEach(function (name) {
  3994. if (name !== locale) {
  3995. localeValues.push({
  3996. locale: name,
  3997. values: locales[name]
  3998. });
  3999. }
  4000. });
  4001. localeValues.unshift({
  4002. locale: locale,
  4003. values: locales[locale]
  4004. });
  4005. try {
  4006. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  4007. } catch (e) {}
  4008. return jsonStr;
  4009. }
  4010. function isI18nStr(value, delimiters) {
  4011. return value.indexOf(delimiters[0]) > -1;
  4012. }
  4013. function compileStr(value, values, delimiters) {
  4014. return formater.interpolate(value, values, delimiters).join('');
  4015. }
  4016. function compileValue(jsonObj, key, localeValues, delimiters) {
  4017. var value = jsonObj[key];
  4018. if (isString(value)) {
  4019. // 存在国际化
  4020. if (isI18nStr(value, delimiters)) {
  4021. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  4022. if (localeValues.length > 1) {
  4023. // 格式化国际化语言
  4024. var valueLocales = jsonObj[key + 'Locales'] = {};
  4025. localeValues.forEach(function (localValue) {
  4026. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  4027. });
  4028. }
  4029. }
  4030. } else {
  4031. compileJsonObj(value, localeValues, delimiters);
  4032. }
  4033. }
  4034. function compileJsonObj(jsonObj, localeValues, delimiters) {
  4035. walkJsonObj(jsonObj, function (jsonObj, key) {
  4036. compileValue(jsonObj, key, localeValues, delimiters);
  4037. });
  4038. return jsonObj;
  4039. }
  4040. function walkJsonObj(jsonObj, walk) {
  4041. if (isArray(jsonObj)) {
  4042. for (var i = 0; i < jsonObj.length; i++) {
  4043. if (walk(jsonObj, i)) {
  4044. return true;
  4045. }
  4046. }
  4047. } else if (isObject(jsonObj)) {
  4048. for (var key in jsonObj) {
  4049. if (walk(jsonObj, key)) {
  4050. return true;
  4051. }
  4052. }
  4053. }
  4054. return false;
  4055. }
  4056. function resolveLocale(locales) {
  4057. return function (locale) {
  4058. if (!locale) {
  4059. return locale;
  4060. }
  4061. locale = normalizeLocale(locale) || locale;
  4062. return resolveLocaleChain(locale).find(function (locale) {
  4063. return locales.indexOf(locale) > -1;
  4064. });
  4065. };
  4066. }
  4067. function resolveLocaleChain(locale) {
  4068. var chain = [];
  4069. var tokens = locale.split('-');
  4070. while (tokens.length) {
  4071. chain.push(tokens.join('-'));
  4072. tokens.pop();
  4073. }
  4074. return chain;
  4075. }
  4076. /* 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)))
  4077. /***/ }),
  4078. /***/ 23:
  4079. /*!***************************************************************!*\
  4080. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  4081. \***************************************************************/
  4082. /*! no static exports found */
  4083. /***/ (function(module, exports) {
  4084. function _classCallCheck(instance, Constructor) {
  4085. if (!(instance instanceof Constructor)) {
  4086. throw new TypeError("Cannot call a class as a function");
  4087. }
  4088. }
  4089. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4090. /***/ }),
  4091. /***/ 24:
  4092. /*!************************************************************!*\
  4093. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  4094. \************************************************************/
  4095. /*! no static exports found */
  4096. /***/ (function(module, exports, __webpack_require__) {
  4097. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  4098. function _defineProperties(target, props) {
  4099. for (var i = 0; i < props.length; i++) {
  4100. var descriptor = props[i];
  4101. descriptor.enumerable = descriptor.enumerable || false;
  4102. descriptor.configurable = true;
  4103. if ("value" in descriptor) descriptor.writable = true;
  4104. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  4105. }
  4106. }
  4107. function _createClass(Constructor, protoProps, staticProps) {
  4108. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  4109. if (staticProps) _defineProperties(Constructor, staticProps);
  4110. Object.defineProperty(Constructor, "prototype", {
  4111. writable: false
  4112. });
  4113. return Constructor;
  4114. }
  4115. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4116. /***/ }),
  4117. /***/ 25:
  4118. /*!******************************************************************************************!*\
  4119. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4120. \******************************************************************************************/
  4121. /*! exports provided: default */
  4122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4123. "use strict";
  4124. __webpack_require__.r(__webpack_exports__);
  4125. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4126. * Vue.js v2.6.11
  4127. * (c) 2014-2022 Evan You
  4128. * Released under the MIT License.
  4129. */
  4130. /* */
  4131. var emptyObject = Object.freeze({});
  4132. // These helpers produce better VM code in JS engines due to their
  4133. // explicitness and function inlining.
  4134. function isUndef (v) {
  4135. return v === undefined || v === null
  4136. }
  4137. function isDef (v) {
  4138. return v !== undefined && v !== null
  4139. }
  4140. function isTrue (v) {
  4141. return v === true
  4142. }
  4143. function isFalse (v) {
  4144. return v === false
  4145. }
  4146. /**
  4147. * Check if value is primitive.
  4148. */
  4149. function isPrimitive (value) {
  4150. return (
  4151. typeof value === 'string' ||
  4152. typeof value === 'number' ||
  4153. // $flow-disable-line
  4154. typeof value === 'symbol' ||
  4155. typeof value === 'boolean'
  4156. )
  4157. }
  4158. /**
  4159. * Quick object check - this is primarily used to tell
  4160. * Objects from primitive values when we know the value
  4161. * is a JSON-compliant type.
  4162. */
  4163. function isObject (obj) {
  4164. return obj !== null && typeof obj === 'object'
  4165. }
  4166. /**
  4167. * Get the raw type string of a value, e.g., [object Object].
  4168. */
  4169. var _toString = Object.prototype.toString;
  4170. function toRawType (value) {
  4171. return _toString.call(value).slice(8, -1)
  4172. }
  4173. /**
  4174. * Strict object type check. Only returns true
  4175. * for plain JavaScript objects.
  4176. */
  4177. function isPlainObject (obj) {
  4178. return _toString.call(obj) === '[object Object]'
  4179. }
  4180. function isRegExp (v) {
  4181. return _toString.call(v) === '[object RegExp]'
  4182. }
  4183. /**
  4184. * Check if val is a valid array index.
  4185. */
  4186. function isValidArrayIndex (val) {
  4187. var n = parseFloat(String(val));
  4188. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4189. }
  4190. function isPromise (val) {
  4191. return (
  4192. isDef(val) &&
  4193. typeof val.then === 'function' &&
  4194. typeof val.catch === 'function'
  4195. )
  4196. }
  4197. /**
  4198. * Convert a value to a string that is actually rendered.
  4199. */
  4200. function toString (val) {
  4201. return val == null
  4202. ? ''
  4203. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4204. ? JSON.stringify(val, null, 2)
  4205. : String(val)
  4206. }
  4207. /**
  4208. * Convert an input value to a number for persistence.
  4209. * If the conversion fails, return original string.
  4210. */
  4211. function toNumber (val) {
  4212. var n = parseFloat(val);
  4213. return isNaN(n) ? val : n
  4214. }
  4215. /**
  4216. * Make a map and return a function for checking if a key
  4217. * is in that map.
  4218. */
  4219. function makeMap (
  4220. str,
  4221. expectsLowerCase
  4222. ) {
  4223. var map = Object.create(null);
  4224. var list = str.split(',');
  4225. for (var i = 0; i < list.length; i++) {
  4226. map[list[i]] = true;
  4227. }
  4228. return expectsLowerCase
  4229. ? function (val) { return map[val.toLowerCase()]; }
  4230. : function (val) { return map[val]; }
  4231. }
  4232. /**
  4233. * Check if a tag is a built-in tag.
  4234. */
  4235. var isBuiltInTag = makeMap('slot,component', true);
  4236. /**
  4237. * Check if an attribute is a reserved attribute.
  4238. */
  4239. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4240. /**
  4241. * Remove an item from an array.
  4242. */
  4243. function remove (arr, item) {
  4244. if (arr.length) {
  4245. var index = arr.indexOf(item);
  4246. if (index > -1) {
  4247. return arr.splice(index, 1)
  4248. }
  4249. }
  4250. }
  4251. /**
  4252. * Check whether an object has the property.
  4253. */
  4254. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4255. function hasOwn (obj, key) {
  4256. return hasOwnProperty.call(obj, key)
  4257. }
  4258. /**
  4259. * Create a cached version of a pure function.
  4260. */
  4261. function cached (fn) {
  4262. var cache = Object.create(null);
  4263. return (function cachedFn (str) {
  4264. var hit = cache[str];
  4265. return hit || (cache[str] = fn(str))
  4266. })
  4267. }
  4268. /**
  4269. * Camelize a hyphen-delimited string.
  4270. */
  4271. var camelizeRE = /-(\w)/g;
  4272. var camelize = cached(function (str) {
  4273. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4274. });
  4275. /**
  4276. * Capitalize a string.
  4277. */
  4278. var capitalize = cached(function (str) {
  4279. return str.charAt(0).toUpperCase() + str.slice(1)
  4280. });
  4281. /**
  4282. * Hyphenate a camelCase string.
  4283. */
  4284. var hyphenateRE = /\B([A-Z])/g;
  4285. var hyphenate = cached(function (str) {
  4286. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4287. });
  4288. /**
  4289. * Simple bind polyfill for environments that do not support it,
  4290. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4291. * since native bind is now performant enough in most browsers.
  4292. * But removing it would mean breaking code that was able to run in
  4293. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4294. */
  4295. /* istanbul ignore next */
  4296. function polyfillBind (fn, ctx) {
  4297. function boundFn (a) {
  4298. var l = arguments.length;
  4299. return l
  4300. ? l > 1
  4301. ? fn.apply(ctx, arguments)
  4302. : fn.call(ctx, a)
  4303. : fn.call(ctx)
  4304. }
  4305. boundFn._length = fn.length;
  4306. return boundFn
  4307. }
  4308. function nativeBind (fn, ctx) {
  4309. return fn.bind(ctx)
  4310. }
  4311. var bind = Function.prototype.bind
  4312. ? nativeBind
  4313. : polyfillBind;
  4314. /**
  4315. * Convert an Array-like object to a real Array.
  4316. */
  4317. function toArray (list, start) {
  4318. start = start || 0;
  4319. var i = list.length - start;
  4320. var ret = new Array(i);
  4321. while (i--) {
  4322. ret[i] = list[i + start];
  4323. }
  4324. return ret
  4325. }
  4326. /**
  4327. * Mix properties into target object.
  4328. */
  4329. function extend (to, _from) {
  4330. for (var key in _from) {
  4331. to[key] = _from[key];
  4332. }
  4333. return to
  4334. }
  4335. /**
  4336. * Merge an Array of Objects into a single Object.
  4337. */
  4338. function toObject (arr) {
  4339. var res = {};
  4340. for (var i = 0; i < arr.length; i++) {
  4341. if (arr[i]) {
  4342. extend(res, arr[i]);
  4343. }
  4344. }
  4345. return res
  4346. }
  4347. /* eslint-disable no-unused-vars */
  4348. /**
  4349. * Perform no operation.
  4350. * Stubbing args to make Flow happy without leaving useless transpiled code
  4351. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4352. */
  4353. function noop (a, b, c) {}
  4354. /**
  4355. * Always return false.
  4356. */
  4357. var no = function (a, b, c) { return false; };
  4358. /* eslint-enable no-unused-vars */
  4359. /**
  4360. * Return the same value.
  4361. */
  4362. var identity = function (_) { return _; };
  4363. /**
  4364. * Check if two values are loosely equal - that is,
  4365. * if they are plain objects, do they have the same shape?
  4366. */
  4367. function looseEqual (a, b) {
  4368. if (a === b) { return true }
  4369. var isObjectA = isObject(a);
  4370. var isObjectB = isObject(b);
  4371. if (isObjectA && isObjectB) {
  4372. try {
  4373. var isArrayA = Array.isArray(a);
  4374. var isArrayB = Array.isArray(b);
  4375. if (isArrayA && isArrayB) {
  4376. return a.length === b.length && a.every(function (e, i) {
  4377. return looseEqual(e, b[i])
  4378. })
  4379. } else if (a instanceof Date && b instanceof Date) {
  4380. return a.getTime() === b.getTime()
  4381. } else if (!isArrayA && !isArrayB) {
  4382. var keysA = Object.keys(a);
  4383. var keysB = Object.keys(b);
  4384. return keysA.length === keysB.length && keysA.every(function (key) {
  4385. return looseEqual(a[key], b[key])
  4386. })
  4387. } else {
  4388. /* istanbul ignore next */
  4389. return false
  4390. }
  4391. } catch (e) {
  4392. /* istanbul ignore next */
  4393. return false
  4394. }
  4395. } else if (!isObjectA && !isObjectB) {
  4396. return String(a) === String(b)
  4397. } else {
  4398. return false
  4399. }
  4400. }
  4401. /**
  4402. * Return the first index at which a loosely equal value can be
  4403. * found in the array (if value is a plain object, the array must
  4404. * contain an object of the same shape), or -1 if it is not present.
  4405. */
  4406. function looseIndexOf (arr, val) {
  4407. for (var i = 0; i < arr.length; i++) {
  4408. if (looseEqual(arr[i], val)) { return i }
  4409. }
  4410. return -1
  4411. }
  4412. /**
  4413. * Ensure a function is called only once.
  4414. */
  4415. function once (fn) {
  4416. var called = false;
  4417. return function () {
  4418. if (!called) {
  4419. called = true;
  4420. fn.apply(this, arguments);
  4421. }
  4422. }
  4423. }
  4424. var ASSET_TYPES = [
  4425. 'component',
  4426. 'directive',
  4427. 'filter'
  4428. ];
  4429. var LIFECYCLE_HOOKS = [
  4430. 'beforeCreate',
  4431. 'created',
  4432. 'beforeMount',
  4433. 'mounted',
  4434. 'beforeUpdate',
  4435. 'updated',
  4436. 'beforeDestroy',
  4437. 'destroyed',
  4438. 'activated',
  4439. 'deactivated',
  4440. 'errorCaptured',
  4441. 'serverPrefetch'
  4442. ];
  4443. /* */
  4444. var config = ({
  4445. /**
  4446. * Option merge strategies (used in core/util/options)
  4447. */
  4448. // $flow-disable-line
  4449. optionMergeStrategies: Object.create(null),
  4450. /**
  4451. * Whether to suppress warnings.
  4452. */
  4453. silent: false,
  4454. /**
  4455. * Show production mode tip message on boot?
  4456. */
  4457. productionTip: "development" !== 'production',
  4458. /**
  4459. * Whether to enable devtools
  4460. */
  4461. devtools: "development" !== 'production',
  4462. /**
  4463. * Whether to record perf
  4464. */
  4465. performance: false,
  4466. /**
  4467. * Error handler for watcher errors
  4468. */
  4469. errorHandler: null,
  4470. /**
  4471. * Warn handler for watcher warns
  4472. */
  4473. warnHandler: null,
  4474. /**
  4475. * Ignore certain custom elements
  4476. */
  4477. ignoredElements: [],
  4478. /**
  4479. * Custom user key aliases for v-on
  4480. */
  4481. // $flow-disable-line
  4482. keyCodes: Object.create(null),
  4483. /**
  4484. * Check if a tag is reserved so that it cannot be registered as a
  4485. * component. This is platform-dependent and may be overwritten.
  4486. */
  4487. isReservedTag: no,
  4488. /**
  4489. * Check if an attribute is reserved so that it cannot be used as a component
  4490. * prop. This is platform-dependent and may be overwritten.
  4491. */
  4492. isReservedAttr: no,
  4493. /**
  4494. * Check if a tag is an unknown element.
  4495. * Platform-dependent.
  4496. */
  4497. isUnknownElement: no,
  4498. /**
  4499. * Get the namespace of an element
  4500. */
  4501. getTagNamespace: noop,
  4502. /**
  4503. * Parse the real tag name for the specific platform.
  4504. */
  4505. parsePlatformTagName: identity,
  4506. /**
  4507. * Check if an attribute must be bound using property, e.g. value
  4508. * Platform-dependent.
  4509. */
  4510. mustUseProp: no,
  4511. /**
  4512. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4513. * This will significantly reduce performance if set to false.
  4514. */
  4515. async: true,
  4516. /**
  4517. * Exposed for legacy reasons
  4518. */
  4519. _lifecycleHooks: LIFECYCLE_HOOKS
  4520. });
  4521. /* */
  4522. /**
  4523. * unicode letters used for parsing html tags, component names and property paths.
  4524. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4525. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4526. */
  4527. 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/;
  4528. /**
  4529. * Check if a string starts with $ or _
  4530. */
  4531. function isReserved (str) {
  4532. var c = (str + '').charCodeAt(0);
  4533. return c === 0x24 || c === 0x5F
  4534. }
  4535. /**
  4536. * Define a property.
  4537. */
  4538. function def (obj, key, val, enumerable) {
  4539. Object.defineProperty(obj, key, {
  4540. value: val,
  4541. enumerable: !!enumerable,
  4542. writable: true,
  4543. configurable: true
  4544. });
  4545. }
  4546. /**
  4547. * Parse simple path.
  4548. */
  4549. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4550. function parsePath (path) {
  4551. if (bailRE.test(path)) {
  4552. return
  4553. }
  4554. var segments = path.split('.');
  4555. return function (obj) {
  4556. for (var i = 0; i < segments.length; i++) {
  4557. if (!obj) { return }
  4558. obj = obj[segments[i]];
  4559. }
  4560. return obj
  4561. }
  4562. }
  4563. /* */
  4564. // can we use __proto__?
  4565. var hasProto = '__proto__' in {};
  4566. // Browser environment sniffing
  4567. var inBrowser = typeof window !== 'undefined';
  4568. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4569. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4570. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4571. var isIE = UA && /msie|trident/.test(UA);
  4572. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4573. var isEdge = UA && UA.indexOf('edge/') > 0;
  4574. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4575. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4576. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4577. var isPhantomJS = UA && /phantomjs/.test(UA);
  4578. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4579. // Firefox has a "watch" function on Object.prototype...
  4580. var nativeWatch = ({}).watch;
  4581. if (inBrowser) {
  4582. try {
  4583. var opts = {};
  4584. Object.defineProperty(opts, 'passive', ({
  4585. get: function get () {
  4586. }
  4587. })); // https://github.com/facebook/flow/issues/285
  4588. window.addEventListener('test-passive', null, opts);
  4589. } catch (e) {}
  4590. }
  4591. // this needs to be lazy-evaled because vue may be required before
  4592. // vue-server-renderer can set VUE_ENV
  4593. var _isServer;
  4594. var isServerRendering = function () {
  4595. if (_isServer === undefined) {
  4596. /* istanbul ignore if */
  4597. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4598. // detect presence of vue-server-renderer and avoid
  4599. // Webpack shimming the process
  4600. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4601. } else {
  4602. _isServer = false;
  4603. }
  4604. }
  4605. return _isServer
  4606. };
  4607. // detect devtools
  4608. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4609. /* istanbul ignore next */
  4610. function isNative (Ctor) {
  4611. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4612. }
  4613. var hasSymbol =
  4614. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4615. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4616. var _Set;
  4617. /* istanbul ignore if */ // $flow-disable-line
  4618. if (typeof Set !== 'undefined' && isNative(Set)) {
  4619. // use native Set when available.
  4620. _Set = Set;
  4621. } else {
  4622. // a non-standard Set polyfill that only works with primitive keys.
  4623. _Set = /*@__PURE__*/(function () {
  4624. function Set () {
  4625. this.set = Object.create(null);
  4626. }
  4627. Set.prototype.has = function has (key) {
  4628. return this.set[key] === true
  4629. };
  4630. Set.prototype.add = function add (key) {
  4631. this.set[key] = true;
  4632. };
  4633. Set.prototype.clear = function clear () {
  4634. this.set = Object.create(null);
  4635. };
  4636. return Set;
  4637. }());
  4638. }
  4639. /* */
  4640. var warn = noop;
  4641. var tip = noop;
  4642. var generateComponentTrace = (noop); // work around flow check
  4643. var formatComponentName = (noop);
  4644. if (true) {
  4645. var hasConsole = typeof console !== 'undefined';
  4646. var classifyRE = /(?:^|[-_])(\w)/g;
  4647. var classify = function (str) { return str
  4648. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4649. .replace(/[-_]/g, ''); };
  4650. warn = function (msg, vm) {
  4651. var trace = vm ? generateComponentTrace(vm) : '';
  4652. if (config.warnHandler) {
  4653. config.warnHandler.call(null, msg, vm, trace);
  4654. } else if (hasConsole && (!config.silent)) {
  4655. console.error(("[Vue warn]: " + msg + trace));
  4656. }
  4657. };
  4658. tip = function (msg, vm) {
  4659. if (hasConsole && (!config.silent)) {
  4660. console.warn("[Vue tip]: " + msg + (
  4661. vm ? generateComponentTrace(vm) : ''
  4662. ));
  4663. }
  4664. };
  4665. formatComponentName = function (vm, includeFile) {
  4666. if (vm.$root === vm) {
  4667. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4668. return ('') + vm.$options.__file
  4669. }
  4670. return '<Root>'
  4671. }
  4672. var options = typeof vm === 'function' && vm.cid != null
  4673. ? vm.options
  4674. : vm._isVue
  4675. ? vm.$options || vm.constructor.options
  4676. : vm;
  4677. var name = options.name || options._componentTag;
  4678. var file = options.__file;
  4679. if (!name && file) {
  4680. var match = file.match(/([^/\\]+)\.vue$/);
  4681. name = match && match[1];
  4682. }
  4683. return (
  4684. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4685. (file && includeFile !== false ? (" at " + file) : '')
  4686. )
  4687. };
  4688. var repeat = function (str, n) {
  4689. var res = '';
  4690. while (n) {
  4691. if (n % 2 === 1) { res += str; }
  4692. if (n > 1) { str += str; }
  4693. n >>= 1;
  4694. }
  4695. return res
  4696. };
  4697. generateComponentTrace = function (vm) {
  4698. if (vm._isVue && vm.$parent) {
  4699. var tree = [];
  4700. var currentRecursiveSequence = 0;
  4701. while (vm && vm.$options.name !== 'PageBody') {
  4702. if (tree.length > 0) {
  4703. var last = tree[tree.length - 1];
  4704. if (last.constructor === vm.constructor) {
  4705. currentRecursiveSequence++;
  4706. vm = vm.$parent;
  4707. continue
  4708. } else if (currentRecursiveSequence > 0) {
  4709. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4710. currentRecursiveSequence = 0;
  4711. }
  4712. }
  4713. !vm.$options.isReserved && tree.push(vm);
  4714. vm = vm.$parent;
  4715. }
  4716. return '\n\nfound in\n\n' + tree
  4717. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4718. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4719. : formatComponentName(vm))); })
  4720. .join('\n')
  4721. } else {
  4722. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4723. }
  4724. };
  4725. }
  4726. /* */
  4727. var uid = 0;
  4728. /**
  4729. * A dep is an observable that can have multiple
  4730. * directives subscribing to it.
  4731. */
  4732. var Dep = function Dep () {
  4733. this.id = uid++;
  4734. this.subs = [];
  4735. };
  4736. Dep.prototype.addSub = function addSub (sub) {
  4737. this.subs.push(sub);
  4738. };
  4739. Dep.prototype.removeSub = function removeSub (sub) {
  4740. remove(this.subs, sub);
  4741. };
  4742. Dep.prototype.depend = function depend () {
  4743. if (Dep.SharedObject.target) {
  4744. Dep.SharedObject.target.addDep(this);
  4745. }
  4746. };
  4747. Dep.prototype.notify = function notify () {
  4748. // stabilize the subscriber list first
  4749. var subs = this.subs.slice();
  4750. if ( true && !config.async) {
  4751. // subs aren't sorted in scheduler if not running async
  4752. // we need to sort them now to make sure they fire in correct
  4753. // order
  4754. subs.sort(function (a, b) { return a.id - b.id; });
  4755. }
  4756. for (var i = 0, l = subs.length; i < l; i++) {
  4757. subs[i].update();
  4758. }
  4759. };
  4760. // The current target watcher being evaluated.
  4761. // This is globally unique because only one watcher
  4762. // can be evaluated at a time.
  4763. // fixed by xxxxxx (nvue shared vuex)
  4764. /* eslint-disable no-undef */
  4765. Dep.SharedObject = {};
  4766. Dep.SharedObject.target = null;
  4767. Dep.SharedObject.targetStack = [];
  4768. function pushTarget (target) {
  4769. Dep.SharedObject.targetStack.push(target);
  4770. Dep.SharedObject.target = target;
  4771. Dep.target = target;
  4772. }
  4773. function popTarget () {
  4774. Dep.SharedObject.targetStack.pop();
  4775. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4776. Dep.target = Dep.SharedObject.target;
  4777. }
  4778. /* */
  4779. var VNode = function VNode (
  4780. tag,
  4781. data,
  4782. children,
  4783. text,
  4784. elm,
  4785. context,
  4786. componentOptions,
  4787. asyncFactory
  4788. ) {
  4789. this.tag = tag;
  4790. this.data = data;
  4791. this.children = children;
  4792. this.text = text;
  4793. this.elm = elm;
  4794. this.ns = undefined;
  4795. this.context = context;
  4796. this.fnContext = undefined;
  4797. this.fnOptions = undefined;
  4798. this.fnScopeId = undefined;
  4799. this.key = data && data.key;
  4800. this.componentOptions = componentOptions;
  4801. this.componentInstance = undefined;
  4802. this.parent = undefined;
  4803. this.raw = false;
  4804. this.isStatic = false;
  4805. this.isRootInsert = true;
  4806. this.isComment = false;
  4807. this.isCloned = false;
  4808. this.isOnce = false;
  4809. this.asyncFactory = asyncFactory;
  4810. this.asyncMeta = undefined;
  4811. this.isAsyncPlaceholder = false;
  4812. };
  4813. var prototypeAccessors = { child: { configurable: true } };
  4814. // DEPRECATED: alias for componentInstance for backwards compat.
  4815. /* istanbul ignore next */
  4816. prototypeAccessors.child.get = function () {
  4817. return this.componentInstance
  4818. };
  4819. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4820. var createEmptyVNode = function (text) {
  4821. if ( text === void 0 ) text = '';
  4822. var node = new VNode();
  4823. node.text = text;
  4824. node.isComment = true;
  4825. return node
  4826. };
  4827. function createTextVNode (val) {
  4828. return new VNode(undefined, undefined, undefined, String(val))
  4829. }
  4830. // optimized shallow clone
  4831. // used for static nodes and slot nodes because they may be reused across
  4832. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4833. // on their elm reference.
  4834. function cloneVNode (vnode) {
  4835. var cloned = new VNode(
  4836. vnode.tag,
  4837. vnode.data,
  4838. // #7975
  4839. // clone children array to avoid mutating original in case of cloning
  4840. // a child.
  4841. vnode.children && vnode.children.slice(),
  4842. vnode.text,
  4843. vnode.elm,
  4844. vnode.context,
  4845. vnode.componentOptions,
  4846. vnode.asyncFactory
  4847. );
  4848. cloned.ns = vnode.ns;
  4849. cloned.isStatic = vnode.isStatic;
  4850. cloned.key = vnode.key;
  4851. cloned.isComment = vnode.isComment;
  4852. cloned.fnContext = vnode.fnContext;
  4853. cloned.fnOptions = vnode.fnOptions;
  4854. cloned.fnScopeId = vnode.fnScopeId;
  4855. cloned.asyncMeta = vnode.asyncMeta;
  4856. cloned.isCloned = true;
  4857. return cloned
  4858. }
  4859. /*
  4860. * not type checking this file because flow doesn't play well with
  4861. * dynamically accessing methods on Array prototype
  4862. */
  4863. var arrayProto = Array.prototype;
  4864. var arrayMethods = Object.create(arrayProto);
  4865. var methodsToPatch = [
  4866. 'push',
  4867. 'pop',
  4868. 'shift',
  4869. 'unshift',
  4870. 'splice',
  4871. 'sort',
  4872. 'reverse'
  4873. ];
  4874. /**
  4875. * Intercept mutating methods and emit events
  4876. */
  4877. methodsToPatch.forEach(function (method) {
  4878. // cache original method
  4879. var original = arrayProto[method];
  4880. def(arrayMethods, method, function mutator () {
  4881. var args = [], len = arguments.length;
  4882. while ( len-- ) args[ len ] = arguments[ len ];
  4883. var result = original.apply(this, args);
  4884. var ob = this.__ob__;
  4885. var inserted;
  4886. switch (method) {
  4887. case 'push':
  4888. case 'unshift':
  4889. inserted = args;
  4890. break
  4891. case 'splice':
  4892. inserted = args.slice(2);
  4893. break
  4894. }
  4895. if (inserted) { ob.observeArray(inserted); }
  4896. // notify change
  4897. ob.dep.notify();
  4898. return result
  4899. });
  4900. });
  4901. /* */
  4902. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4903. /**
  4904. * In some cases we may want to disable observation inside a component's
  4905. * update computation.
  4906. */
  4907. var shouldObserve = true;
  4908. function toggleObserving (value) {
  4909. shouldObserve = value;
  4910. }
  4911. /**
  4912. * Observer class that is attached to each observed
  4913. * object. Once attached, the observer converts the target
  4914. * object's property keys into getter/setters that
  4915. * collect dependencies and dispatch updates.
  4916. */
  4917. var Observer = function Observer (value) {
  4918. this.value = value;
  4919. this.dep = new Dep();
  4920. this.vmCount = 0;
  4921. def(value, '__ob__', this);
  4922. if (Array.isArray(value)) {
  4923. if (hasProto) {
  4924. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4925. if(value.push !== value.__proto__.push){
  4926. copyAugment(value, arrayMethods, arrayKeys);
  4927. } else {
  4928. protoAugment(value, arrayMethods);
  4929. }
  4930. }
  4931. } else {
  4932. copyAugment(value, arrayMethods, arrayKeys);
  4933. }
  4934. this.observeArray(value);
  4935. } else {
  4936. this.walk(value);
  4937. }
  4938. };
  4939. /**
  4940. * Walk through all properties and convert them into
  4941. * getter/setters. This method should only be called when
  4942. * value type is Object.
  4943. */
  4944. Observer.prototype.walk = function walk (obj) {
  4945. var keys = Object.keys(obj);
  4946. for (var i = 0; i < keys.length; i++) {
  4947. defineReactive$$1(obj, keys[i]);
  4948. }
  4949. };
  4950. /**
  4951. * Observe a list of Array items.
  4952. */
  4953. Observer.prototype.observeArray = function observeArray (items) {
  4954. for (var i = 0, l = items.length; i < l; i++) {
  4955. observe(items[i]);
  4956. }
  4957. };
  4958. // helpers
  4959. /**
  4960. * Augment a target Object or Array by intercepting
  4961. * the prototype chain using __proto__
  4962. */
  4963. function protoAugment (target, src) {
  4964. /* eslint-disable no-proto */
  4965. target.__proto__ = src;
  4966. /* eslint-enable no-proto */
  4967. }
  4968. /**
  4969. * Augment a target Object or Array by defining
  4970. * hidden properties.
  4971. */
  4972. /* istanbul ignore next */
  4973. function copyAugment (target, src, keys) {
  4974. for (var i = 0, l = keys.length; i < l; i++) {
  4975. var key = keys[i];
  4976. def(target, key, src[key]);
  4977. }
  4978. }
  4979. /**
  4980. * Attempt to create an observer instance for a value,
  4981. * returns the new observer if successfully observed,
  4982. * or the existing observer if the value already has one.
  4983. */
  4984. function observe (value, asRootData) {
  4985. if (!isObject(value) || value instanceof VNode) {
  4986. return
  4987. }
  4988. var ob;
  4989. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4990. ob = value.__ob__;
  4991. } else if (
  4992. shouldObserve &&
  4993. !isServerRendering() &&
  4994. (Array.isArray(value) || isPlainObject(value)) &&
  4995. Object.isExtensible(value) &&
  4996. !value._isVue &&
  4997. !value.__v_isMPComponent
  4998. ) {
  4999. ob = new Observer(value);
  5000. }
  5001. if (asRootData && ob) {
  5002. ob.vmCount++;
  5003. }
  5004. return ob
  5005. }
  5006. /**
  5007. * Define a reactive property on an Object.
  5008. */
  5009. function defineReactive$$1 (
  5010. obj,
  5011. key,
  5012. val,
  5013. customSetter,
  5014. shallow
  5015. ) {
  5016. var dep = new Dep();
  5017. var property = Object.getOwnPropertyDescriptor(obj, key);
  5018. if (property && property.configurable === false) {
  5019. return
  5020. }
  5021. // cater for pre-defined getter/setters
  5022. var getter = property && property.get;
  5023. var setter = property && property.set;
  5024. if ((!getter || setter) && arguments.length === 2) {
  5025. val = obj[key];
  5026. }
  5027. var childOb = !shallow && observe(val);
  5028. Object.defineProperty(obj, key, {
  5029. enumerable: true,
  5030. configurable: true,
  5031. get: function reactiveGetter () {
  5032. var value = getter ? getter.call(obj) : val;
  5033. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5034. dep.depend();
  5035. if (childOb) {
  5036. childOb.dep.depend();
  5037. if (Array.isArray(value)) {
  5038. dependArray(value);
  5039. }
  5040. }
  5041. }
  5042. return value
  5043. },
  5044. set: function reactiveSetter (newVal) {
  5045. var value = getter ? getter.call(obj) : val;
  5046. /* eslint-disable no-self-compare */
  5047. if (newVal === value || (newVal !== newVal && value !== value)) {
  5048. return
  5049. }
  5050. /* eslint-enable no-self-compare */
  5051. if ( true && customSetter) {
  5052. customSetter();
  5053. }
  5054. // #7981: for accessor properties without setter
  5055. if (getter && !setter) { return }
  5056. if (setter) {
  5057. setter.call(obj, newVal);
  5058. } else {
  5059. val = newVal;
  5060. }
  5061. childOb = !shallow && observe(newVal);
  5062. dep.notify();
  5063. }
  5064. });
  5065. }
  5066. /**
  5067. * Set a property on an object. Adds the new property and
  5068. * triggers change notification if the property doesn't
  5069. * already exist.
  5070. */
  5071. function set (target, key, val) {
  5072. if ( true &&
  5073. (isUndef(target) || isPrimitive(target))
  5074. ) {
  5075. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5076. }
  5077. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5078. target.length = Math.max(target.length, key);
  5079. target.splice(key, 1, val);
  5080. return val
  5081. }
  5082. if (key in target && !(key in Object.prototype)) {
  5083. target[key] = val;
  5084. return val
  5085. }
  5086. var ob = (target).__ob__;
  5087. if (target._isVue || (ob && ob.vmCount)) {
  5088. true && warn(
  5089. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5090. 'at runtime - declare it upfront in the data option.'
  5091. );
  5092. return val
  5093. }
  5094. if (!ob) {
  5095. target[key] = val;
  5096. return val
  5097. }
  5098. defineReactive$$1(ob.value, key, val);
  5099. ob.dep.notify();
  5100. return val
  5101. }
  5102. /**
  5103. * Delete a property and trigger change if necessary.
  5104. */
  5105. function del (target, key) {
  5106. if ( true &&
  5107. (isUndef(target) || isPrimitive(target))
  5108. ) {
  5109. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5110. }
  5111. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5112. target.splice(key, 1);
  5113. return
  5114. }
  5115. var ob = (target).__ob__;
  5116. if (target._isVue || (ob && ob.vmCount)) {
  5117. true && warn(
  5118. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5119. '- just set it to null.'
  5120. );
  5121. return
  5122. }
  5123. if (!hasOwn(target, key)) {
  5124. return
  5125. }
  5126. delete target[key];
  5127. if (!ob) {
  5128. return
  5129. }
  5130. ob.dep.notify();
  5131. }
  5132. /**
  5133. * Collect dependencies on array elements when the array is touched, since
  5134. * we cannot intercept array element access like property getters.
  5135. */
  5136. function dependArray (value) {
  5137. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5138. e = value[i];
  5139. e && e.__ob__ && e.__ob__.dep.depend();
  5140. if (Array.isArray(e)) {
  5141. dependArray(e);
  5142. }
  5143. }
  5144. }
  5145. /* */
  5146. /**
  5147. * Option overwriting strategies are functions that handle
  5148. * how to merge a parent option value and a child option
  5149. * value into the final value.
  5150. */
  5151. var strats = config.optionMergeStrategies;
  5152. /**
  5153. * Options with restrictions
  5154. */
  5155. if (true) {
  5156. strats.el = strats.propsData = function (parent, child, vm, key) {
  5157. if (!vm) {
  5158. warn(
  5159. "option \"" + key + "\" can only be used during instance " +
  5160. 'creation with the `new` keyword.'
  5161. );
  5162. }
  5163. return defaultStrat(parent, child)
  5164. };
  5165. }
  5166. /**
  5167. * Helper that recursively merges two data objects together.
  5168. */
  5169. function mergeData (to, from) {
  5170. if (!from) { return to }
  5171. var key, toVal, fromVal;
  5172. var keys = hasSymbol
  5173. ? Reflect.ownKeys(from)
  5174. : Object.keys(from);
  5175. for (var i = 0; i < keys.length; i++) {
  5176. key = keys[i];
  5177. // in case the object is already observed...
  5178. if (key === '__ob__') { continue }
  5179. toVal = to[key];
  5180. fromVal = from[key];
  5181. if (!hasOwn(to, key)) {
  5182. set(to, key, fromVal);
  5183. } else if (
  5184. toVal !== fromVal &&
  5185. isPlainObject(toVal) &&
  5186. isPlainObject(fromVal)
  5187. ) {
  5188. mergeData(toVal, fromVal);
  5189. }
  5190. }
  5191. return to
  5192. }
  5193. /**
  5194. * Data
  5195. */
  5196. function mergeDataOrFn (
  5197. parentVal,
  5198. childVal,
  5199. vm
  5200. ) {
  5201. if (!vm) {
  5202. // in a Vue.extend merge, both should be functions
  5203. if (!childVal) {
  5204. return parentVal
  5205. }
  5206. if (!parentVal) {
  5207. return childVal
  5208. }
  5209. // when parentVal & childVal are both present,
  5210. // we need to return a function that returns the
  5211. // merged result of both functions... no need to
  5212. // check if parentVal is a function here because
  5213. // it has to be a function to pass previous merges.
  5214. return function mergedDataFn () {
  5215. return mergeData(
  5216. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5217. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5218. )
  5219. }
  5220. } else {
  5221. return function mergedInstanceDataFn () {
  5222. // instance merge
  5223. var instanceData = typeof childVal === 'function'
  5224. ? childVal.call(vm, vm)
  5225. : childVal;
  5226. var defaultData = typeof parentVal === 'function'
  5227. ? parentVal.call(vm, vm)
  5228. : parentVal;
  5229. if (instanceData) {
  5230. return mergeData(instanceData, defaultData)
  5231. } else {
  5232. return defaultData
  5233. }
  5234. }
  5235. }
  5236. }
  5237. strats.data = function (
  5238. parentVal,
  5239. childVal,
  5240. vm
  5241. ) {
  5242. if (!vm) {
  5243. if (childVal && typeof childVal !== 'function') {
  5244. true && warn(
  5245. 'The "data" option should be a function ' +
  5246. 'that returns a per-instance value in component ' +
  5247. 'definitions.',
  5248. vm
  5249. );
  5250. return parentVal
  5251. }
  5252. return mergeDataOrFn(parentVal, childVal)
  5253. }
  5254. return mergeDataOrFn(parentVal, childVal, vm)
  5255. };
  5256. /**
  5257. * Hooks and props are merged as arrays.
  5258. */
  5259. function mergeHook (
  5260. parentVal,
  5261. childVal
  5262. ) {
  5263. var res = childVal
  5264. ? parentVal
  5265. ? parentVal.concat(childVal)
  5266. : Array.isArray(childVal)
  5267. ? childVal
  5268. : [childVal]
  5269. : parentVal;
  5270. return res
  5271. ? dedupeHooks(res)
  5272. : res
  5273. }
  5274. function dedupeHooks (hooks) {
  5275. var res = [];
  5276. for (var i = 0; i < hooks.length; i++) {
  5277. if (res.indexOf(hooks[i]) === -1) {
  5278. res.push(hooks[i]);
  5279. }
  5280. }
  5281. return res
  5282. }
  5283. LIFECYCLE_HOOKS.forEach(function (hook) {
  5284. strats[hook] = mergeHook;
  5285. });
  5286. /**
  5287. * Assets
  5288. *
  5289. * When a vm is present (instance creation), we need to do
  5290. * a three-way merge between constructor options, instance
  5291. * options and parent options.
  5292. */
  5293. function mergeAssets (
  5294. parentVal,
  5295. childVal,
  5296. vm,
  5297. key
  5298. ) {
  5299. var res = Object.create(parentVal || null);
  5300. if (childVal) {
  5301. true && assertObjectType(key, childVal, vm);
  5302. return extend(res, childVal)
  5303. } else {
  5304. return res
  5305. }
  5306. }
  5307. ASSET_TYPES.forEach(function (type) {
  5308. strats[type + 's'] = mergeAssets;
  5309. });
  5310. /**
  5311. * Watchers.
  5312. *
  5313. * Watchers hashes should not overwrite one
  5314. * another, so we merge them as arrays.
  5315. */
  5316. strats.watch = function (
  5317. parentVal,
  5318. childVal,
  5319. vm,
  5320. key
  5321. ) {
  5322. // work around Firefox's Object.prototype.watch...
  5323. if (parentVal === nativeWatch) { parentVal = undefined; }
  5324. if (childVal === nativeWatch) { childVal = undefined; }
  5325. /* istanbul ignore if */
  5326. if (!childVal) { return Object.create(parentVal || null) }
  5327. if (true) {
  5328. assertObjectType(key, childVal, vm);
  5329. }
  5330. if (!parentVal) { return childVal }
  5331. var ret = {};
  5332. extend(ret, parentVal);
  5333. for (var key$1 in childVal) {
  5334. var parent = ret[key$1];
  5335. var child = childVal[key$1];
  5336. if (parent && !Array.isArray(parent)) {
  5337. parent = [parent];
  5338. }
  5339. ret[key$1] = parent
  5340. ? parent.concat(child)
  5341. : Array.isArray(child) ? child : [child];
  5342. }
  5343. return ret
  5344. };
  5345. /**
  5346. * Other object hashes.
  5347. */
  5348. strats.props =
  5349. strats.methods =
  5350. strats.inject =
  5351. strats.computed = function (
  5352. parentVal,
  5353. childVal,
  5354. vm,
  5355. key
  5356. ) {
  5357. if (childVal && "development" !== 'production') {
  5358. assertObjectType(key, childVal, vm);
  5359. }
  5360. if (!parentVal) { return childVal }
  5361. var ret = Object.create(null);
  5362. extend(ret, parentVal);
  5363. if (childVal) { extend(ret, childVal); }
  5364. return ret
  5365. };
  5366. strats.provide = mergeDataOrFn;
  5367. /**
  5368. * Default strategy.
  5369. */
  5370. var defaultStrat = function (parentVal, childVal) {
  5371. return childVal === undefined
  5372. ? parentVal
  5373. : childVal
  5374. };
  5375. /**
  5376. * Validate component names
  5377. */
  5378. function checkComponents (options) {
  5379. for (var key in options.components) {
  5380. validateComponentName(key);
  5381. }
  5382. }
  5383. function validateComponentName (name) {
  5384. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5385. warn(
  5386. 'Invalid component name: "' + name + '". Component names ' +
  5387. 'should conform to valid custom element name in html5 specification.'
  5388. );
  5389. }
  5390. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5391. warn(
  5392. 'Do not use built-in or reserved HTML elements as component ' +
  5393. 'id: ' + name
  5394. );
  5395. }
  5396. }
  5397. /**
  5398. * Ensure all props option syntax are normalized into the
  5399. * Object-based format.
  5400. */
  5401. function normalizeProps (options, vm) {
  5402. var props = options.props;
  5403. if (!props) { return }
  5404. var res = {};
  5405. var i, val, name;
  5406. if (Array.isArray(props)) {
  5407. i = props.length;
  5408. while (i--) {
  5409. val = props[i];
  5410. if (typeof val === 'string') {
  5411. name = camelize(val);
  5412. res[name] = { type: null };
  5413. } else if (true) {
  5414. warn('props must be strings when using array syntax.');
  5415. }
  5416. }
  5417. } else if (isPlainObject(props)) {
  5418. for (var key in props) {
  5419. val = props[key];
  5420. name = camelize(key);
  5421. res[name] = isPlainObject(val)
  5422. ? val
  5423. : { type: val };
  5424. }
  5425. } else if (true) {
  5426. warn(
  5427. "Invalid value for option \"props\": expected an Array or an Object, " +
  5428. "but got " + (toRawType(props)) + ".",
  5429. vm
  5430. );
  5431. }
  5432. options.props = res;
  5433. }
  5434. /**
  5435. * Normalize all injections into Object-based format
  5436. */
  5437. function normalizeInject (options, vm) {
  5438. var inject = options.inject;
  5439. if (!inject) { return }
  5440. var normalized = options.inject = {};
  5441. if (Array.isArray(inject)) {
  5442. for (var i = 0; i < inject.length; i++) {
  5443. normalized[inject[i]] = { from: inject[i] };
  5444. }
  5445. } else if (isPlainObject(inject)) {
  5446. for (var key in inject) {
  5447. var val = inject[key];
  5448. normalized[key] = isPlainObject(val)
  5449. ? extend({ from: key }, val)
  5450. : { from: val };
  5451. }
  5452. } else if (true) {
  5453. warn(
  5454. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5455. "but got " + (toRawType(inject)) + ".",
  5456. vm
  5457. );
  5458. }
  5459. }
  5460. /**
  5461. * Normalize raw function directives into object format.
  5462. */
  5463. function normalizeDirectives (options) {
  5464. var dirs = options.directives;
  5465. if (dirs) {
  5466. for (var key in dirs) {
  5467. var def$$1 = dirs[key];
  5468. if (typeof def$$1 === 'function') {
  5469. dirs[key] = { bind: def$$1, update: def$$1 };
  5470. }
  5471. }
  5472. }
  5473. }
  5474. function assertObjectType (name, value, vm) {
  5475. if (!isPlainObject(value)) {
  5476. warn(
  5477. "Invalid value for option \"" + name + "\": expected an Object, " +
  5478. "but got " + (toRawType(value)) + ".",
  5479. vm
  5480. );
  5481. }
  5482. }
  5483. /**
  5484. * Merge two option objects into a new one.
  5485. * Core utility used in both instantiation and inheritance.
  5486. */
  5487. function mergeOptions (
  5488. parent,
  5489. child,
  5490. vm
  5491. ) {
  5492. if (true) {
  5493. checkComponents(child);
  5494. }
  5495. if (typeof child === 'function') {
  5496. child = child.options;
  5497. }
  5498. normalizeProps(child, vm);
  5499. normalizeInject(child, vm);
  5500. normalizeDirectives(child);
  5501. // Apply extends and mixins on the child options,
  5502. // but only if it is a raw options object that isn't
  5503. // the result of another mergeOptions call.
  5504. // Only merged options has the _base property.
  5505. if (!child._base) {
  5506. if (child.extends) {
  5507. parent = mergeOptions(parent, child.extends, vm);
  5508. }
  5509. if (child.mixins) {
  5510. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5511. parent = mergeOptions(parent, child.mixins[i], vm);
  5512. }
  5513. }
  5514. }
  5515. var options = {};
  5516. var key;
  5517. for (key in parent) {
  5518. mergeField(key);
  5519. }
  5520. for (key in child) {
  5521. if (!hasOwn(parent, key)) {
  5522. mergeField(key);
  5523. }
  5524. }
  5525. function mergeField (key) {
  5526. var strat = strats[key] || defaultStrat;
  5527. options[key] = strat(parent[key], child[key], vm, key);
  5528. }
  5529. return options
  5530. }
  5531. /**
  5532. * Resolve an asset.
  5533. * This function is used because child instances need access
  5534. * to assets defined in its ancestor chain.
  5535. */
  5536. function resolveAsset (
  5537. options,
  5538. type,
  5539. id,
  5540. warnMissing
  5541. ) {
  5542. /* istanbul ignore if */
  5543. if (typeof id !== 'string') {
  5544. return
  5545. }
  5546. var assets = options[type];
  5547. // check local registration variations first
  5548. if (hasOwn(assets, id)) { return assets[id] }
  5549. var camelizedId = camelize(id);
  5550. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5551. var PascalCaseId = capitalize(camelizedId);
  5552. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5553. // fallback to prototype chain
  5554. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5555. if ( true && warnMissing && !res) {
  5556. warn(
  5557. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5558. options
  5559. );
  5560. }
  5561. return res
  5562. }
  5563. /* */
  5564. function validateProp (
  5565. key,
  5566. propOptions,
  5567. propsData,
  5568. vm
  5569. ) {
  5570. var prop = propOptions[key];
  5571. var absent = !hasOwn(propsData, key);
  5572. var value = propsData[key];
  5573. // boolean casting
  5574. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5575. if (booleanIndex > -1) {
  5576. if (absent && !hasOwn(prop, 'default')) {
  5577. value = false;
  5578. } else if (value === '' || value === hyphenate(key)) {
  5579. // only cast empty string / same name to boolean if
  5580. // boolean has higher priority
  5581. var stringIndex = getTypeIndex(String, prop.type);
  5582. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5583. value = true;
  5584. }
  5585. }
  5586. }
  5587. // check default value
  5588. if (value === undefined) {
  5589. value = getPropDefaultValue(vm, prop, key);
  5590. // since the default value is a fresh copy,
  5591. // make sure to observe it.
  5592. var prevShouldObserve = shouldObserve;
  5593. toggleObserving(true);
  5594. observe(value);
  5595. toggleObserving(prevShouldObserve);
  5596. }
  5597. if (
  5598. true
  5599. ) {
  5600. assertProp(prop, key, value, vm, absent);
  5601. }
  5602. return value
  5603. }
  5604. /**
  5605. * Get the default value of a prop.
  5606. */
  5607. function getPropDefaultValue (vm, prop, key) {
  5608. // no default, return undefined
  5609. if (!hasOwn(prop, 'default')) {
  5610. return undefined
  5611. }
  5612. var def = prop.default;
  5613. // warn against non-factory defaults for Object & Array
  5614. if ( true && isObject(def)) {
  5615. warn(
  5616. 'Invalid default value for prop "' + key + '": ' +
  5617. 'Props with type Object/Array must use a factory function ' +
  5618. 'to return the default value.',
  5619. vm
  5620. );
  5621. }
  5622. // the raw prop value was also undefined from previous render,
  5623. // return previous default value to avoid unnecessary watcher trigger
  5624. if (vm && vm.$options.propsData &&
  5625. vm.$options.propsData[key] === undefined &&
  5626. vm._props[key] !== undefined
  5627. ) {
  5628. return vm._props[key]
  5629. }
  5630. // call factory function for non-Function types
  5631. // a value is Function if its prototype is function even across different execution context
  5632. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5633. ? def.call(vm)
  5634. : def
  5635. }
  5636. /**
  5637. * Assert whether a prop is valid.
  5638. */
  5639. function assertProp (
  5640. prop,
  5641. name,
  5642. value,
  5643. vm,
  5644. absent
  5645. ) {
  5646. if (prop.required && absent) {
  5647. warn(
  5648. 'Missing required prop: "' + name + '"',
  5649. vm
  5650. );
  5651. return
  5652. }
  5653. if (value == null && !prop.required) {
  5654. return
  5655. }
  5656. var type = prop.type;
  5657. var valid = !type || type === true;
  5658. var expectedTypes = [];
  5659. if (type) {
  5660. if (!Array.isArray(type)) {
  5661. type = [type];
  5662. }
  5663. for (var i = 0; i < type.length && !valid; i++) {
  5664. var assertedType = assertType(value, type[i]);
  5665. expectedTypes.push(assertedType.expectedType || '');
  5666. valid = assertedType.valid;
  5667. }
  5668. }
  5669. if (!valid) {
  5670. warn(
  5671. getInvalidTypeMessage(name, value, expectedTypes),
  5672. vm
  5673. );
  5674. return
  5675. }
  5676. var validator = prop.validator;
  5677. if (validator) {
  5678. if (!validator(value)) {
  5679. warn(
  5680. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5681. vm
  5682. );
  5683. }
  5684. }
  5685. }
  5686. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5687. function assertType (value, type) {
  5688. var valid;
  5689. var expectedType = getType(type);
  5690. if (simpleCheckRE.test(expectedType)) {
  5691. var t = typeof value;
  5692. valid = t === expectedType.toLowerCase();
  5693. // for primitive wrapper objects
  5694. if (!valid && t === 'object') {
  5695. valid = value instanceof type;
  5696. }
  5697. } else if (expectedType === 'Object') {
  5698. valid = isPlainObject(value);
  5699. } else if (expectedType === 'Array') {
  5700. valid = Array.isArray(value);
  5701. } else {
  5702. valid = value instanceof type;
  5703. }
  5704. return {
  5705. valid: valid,
  5706. expectedType: expectedType
  5707. }
  5708. }
  5709. /**
  5710. * Use function string name to check built-in types,
  5711. * because a simple equality check will fail when running
  5712. * across different vms / iframes.
  5713. */
  5714. function getType (fn) {
  5715. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5716. return match ? match[1] : ''
  5717. }
  5718. function isSameType (a, b) {
  5719. return getType(a) === getType(b)
  5720. }
  5721. function getTypeIndex (type, expectedTypes) {
  5722. if (!Array.isArray(expectedTypes)) {
  5723. return isSameType(expectedTypes, type) ? 0 : -1
  5724. }
  5725. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5726. if (isSameType(expectedTypes[i], type)) {
  5727. return i
  5728. }
  5729. }
  5730. return -1
  5731. }
  5732. function getInvalidTypeMessage (name, value, expectedTypes) {
  5733. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5734. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5735. var expectedType = expectedTypes[0];
  5736. var receivedType = toRawType(value);
  5737. var expectedValue = styleValue(value, expectedType);
  5738. var receivedValue = styleValue(value, receivedType);
  5739. // check if we need to specify expected value
  5740. if (expectedTypes.length === 1 &&
  5741. isExplicable(expectedType) &&
  5742. !isBoolean(expectedType, receivedType)) {
  5743. message += " with value " + expectedValue;
  5744. }
  5745. message += ", got " + receivedType + " ";
  5746. // check if we need to specify received value
  5747. if (isExplicable(receivedType)) {
  5748. message += "with value " + receivedValue + ".";
  5749. }
  5750. return message
  5751. }
  5752. function styleValue (value, type) {
  5753. if (type === 'String') {
  5754. return ("\"" + value + "\"")
  5755. } else if (type === 'Number') {
  5756. return ("" + (Number(value)))
  5757. } else {
  5758. return ("" + value)
  5759. }
  5760. }
  5761. function isExplicable (value) {
  5762. var explicitTypes = ['string', 'number', 'boolean'];
  5763. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5764. }
  5765. function isBoolean () {
  5766. var args = [], len = arguments.length;
  5767. while ( len-- ) args[ len ] = arguments[ len ];
  5768. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5769. }
  5770. /* */
  5771. function handleError (err, vm, info) {
  5772. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5773. // See: https://github.com/vuejs/vuex/issues/1505
  5774. pushTarget();
  5775. try {
  5776. if (vm) {
  5777. var cur = vm;
  5778. while ((cur = cur.$parent)) {
  5779. var hooks = cur.$options.errorCaptured;
  5780. if (hooks) {
  5781. for (var i = 0; i < hooks.length; i++) {
  5782. try {
  5783. var capture = hooks[i].call(cur, err, vm, info) === false;
  5784. if (capture) { return }
  5785. } catch (e) {
  5786. globalHandleError(e, cur, 'errorCaptured hook');
  5787. }
  5788. }
  5789. }
  5790. }
  5791. }
  5792. globalHandleError(err, vm, info);
  5793. } finally {
  5794. popTarget();
  5795. }
  5796. }
  5797. function invokeWithErrorHandling (
  5798. handler,
  5799. context,
  5800. args,
  5801. vm,
  5802. info
  5803. ) {
  5804. var res;
  5805. try {
  5806. res = args ? handler.apply(context, args) : handler.call(context);
  5807. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5808. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5809. // issue #9511
  5810. // avoid catch triggering multiple times when nested calls
  5811. res._handled = true;
  5812. }
  5813. } catch (e) {
  5814. handleError(e, vm, info);
  5815. }
  5816. return res
  5817. }
  5818. function globalHandleError (err, vm, info) {
  5819. if (config.errorHandler) {
  5820. try {
  5821. return config.errorHandler.call(null, err, vm, info)
  5822. } catch (e) {
  5823. // if the user intentionally throws the original error in the handler,
  5824. // do not log it twice
  5825. if (e !== err) {
  5826. logError(e, null, 'config.errorHandler');
  5827. }
  5828. }
  5829. }
  5830. logError(err, vm, info);
  5831. }
  5832. function logError (err, vm, info) {
  5833. if (true) {
  5834. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5835. }
  5836. /* istanbul ignore else */
  5837. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5838. console.error(err);
  5839. } else {
  5840. throw err
  5841. }
  5842. }
  5843. /* */
  5844. var callbacks = [];
  5845. var pending = false;
  5846. function flushCallbacks () {
  5847. pending = false;
  5848. var copies = callbacks.slice(0);
  5849. callbacks.length = 0;
  5850. for (var i = 0; i < copies.length; i++) {
  5851. copies[i]();
  5852. }
  5853. }
  5854. // Here we have async deferring wrappers using microtasks.
  5855. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5856. // However, it has subtle problems when state is changed right before repaint
  5857. // (e.g. #6813, out-in transitions).
  5858. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5859. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5860. // So we now use microtasks everywhere, again.
  5861. // A major drawback of this tradeoff is that there are some scenarios
  5862. // where microtasks have too high a priority and fire in between supposedly
  5863. // sequential events (e.g. #4521, #6690, which have workarounds)
  5864. // or even between bubbling of the same event (#6566).
  5865. var timerFunc;
  5866. // The nextTick behavior leverages the microtask queue, which can be accessed
  5867. // via either native Promise.then or MutationObserver.
  5868. // MutationObserver has wider support, however it is seriously bugged in
  5869. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5870. // completely stops working after triggering a few times... so, if native
  5871. // Promise is available, we will use it:
  5872. /* istanbul ignore next, $flow-disable-line */
  5873. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5874. var p = Promise.resolve();
  5875. timerFunc = function () {
  5876. p.then(flushCallbacks);
  5877. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5878. // it can get stuck in a weird state where callbacks are pushed into the
  5879. // microtask queue but the queue isn't being flushed, until the browser
  5880. // needs to do some other work, e.g. handle a timer. Therefore we can
  5881. // "force" the microtask queue to be flushed by adding an empty timer.
  5882. if (isIOS) { setTimeout(noop); }
  5883. };
  5884. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5885. isNative(MutationObserver) ||
  5886. // PhantomJS and iOS 7.x
  5887. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5888. )) {
  5889. // Use MutationObserver where native Promise is not available,
  5890. // e.g. PhantomJS, iOS7, Android 4.4
  5891. // (#6466 MutationObserver is unreliable in IE11)
  5892. var counter = 1;
  5893. var observer = new MutationObserver(flushCallbacks);
  5894. var textNode = document.createTextNode(String(counter));
  5895. observer.observe(textNode, {
  5896. characterData: true
  5897. });
  5898. timerFunc = function () {
  5899. counter = (counter + 1) % 2;
  5900. textNode.data = String(counter);
  5901. };
  5902. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5903. // Fallback to setImmediate.
  5904. // Technically it leverages the (macro) task queue,
  5905. // but it is still a better choice than setTimeout.
  5906. timerFunc = function () {
  5907. setImmediate(flushCallbacks);
  5908. };
  5909. } else {
  5910. // Fallback to setTimeout.
  5911. timerFunc = function () {
  5912. setTimeout(flushCallbacks, 0);
  5913. };
  5914. }
  5915. function nextTick (cb, ctx) {
  5916. var _resolve;
  5917. callbacks.push(function () {
  5918. if (cb) {
  5919. try {
  5920. cb.call(ctx);
  5921. } catch (e) {
  5922. handleError(e, ctx, 'nextTick');
  5923. }
  5924. } else if (_resolve) {
  5925. _resolve(ctx);
  5926. }
  5927. });
  5928. if (!pending) {
  5929. pending = true;
  5930. timerFunc();
  5931. }
  5932. // $flow-disable-line
  5933. if (!cb && typeof Promise !== 'undefined') {
  5934. return new Promise(function (resolve) {
  5935. _resolve = resolve;
  5936. })
  5937. }
  5938. }
  5939. /* */
  5940. /* not type checking this file because flow doesn't play well with Proxy */
  5941. var initProxy;
  5942. if (true) {
  5943. var allowedGlobals = makeMap(
  5944. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5945. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5946. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5947. 'require' // for Webpack/Browserify
  5948. );
  5949. var warnNonPresent = function (target, key) {
  5950. warn(
  5951. "Property or method \"" + key + "\" is not defined on the instance but " +
  5952. 'referenced during render. Make sure that this property is reactive, ' +
  5953. 'either in the data option, or for class-based components, by ' +
  5954. 'initializing the property. ' +
  5955. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5956. target
  5957. );
  5958. };
  5959. var warnReservedPrefix = function (target, key) {
  5960. warn(
  5961. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5962. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5963. 'prevent conflicts with Vue internals. ' +
  5964. 'See: https://vuejs.org/v2/api/#data',
  5965. target
  5966. );
  5967. };
  5968. var hasProxy =
  5969. typeof Proxy !== 'undefined' && isNative(Proxy);
  5970. if (hasProxy) {
  5971. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5972. config.keyCodes = new Proxy(config.keyCodes, {
  5973. set: function set (target, key, value) {
  5974. if (isBuiltInModifier(key)) {
  5975. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5976. return false
  5977. } else {
  5978. target[key] = value;
  5979. return true
  5980. }
  5981. }
  5982. });
  5983. }
  5984. var hasHandler = {
  5985. has: function has (target, key) {
  5986. var has = key in target;
  5987. var isAllowed = allowedGlobals(key) ||
  5988. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5989. if (!has && !isAllowed) {
  5990. if (key in target.$data) { warnReservedPrefix(target, key); }
  5991. else { warnNonPresent(target, key); }
  5992. }
  5993. return has || !isAllowed
  5994. }
  5995. };
  5996. var getHandler = {
  5997. get: function get (target, key) {
  5998. if (typeof key === 'string' && !(key in target)) {
  5999. if (key in target.$data) { warnReservedPrefix(target, key); }
  6000. else { warnNonPresent(target, key); }
  6001. }
  6002. return target[key]
  6003. }
  6004. };
  6005. initProxy = function initProxy (vm) {
  6006. if (hasProxy) {
  6007. // determine which proxy handler to use
  6008. var options = vm.$options;
  6009. var handlers = options.render && options.render._withStripped
  6010. ? getHandler
  6011. : hasHandler;
  6012. vm._renderProxy = new Proxy(vm, handlers);
  6013. } else {
  6014. vm._renderProxy = vm;
  6015. }
  6016. };
  6017. }
  6018. /* */
  6019. var seenObjects = new _Set();
  6020. /**
  6021. * Recursively traverse an object to evoke all converted
  6022. * getters, so that every nested property inside the object
  6023. * is collected as a "deep" dependency.
  6024. */
  6025. function traverse (val) {
  6026. _traverse(val, seenObjects);
  6027. seenObjects.clear();
  6028. }
  6029. function _traverse (val, seen) {
  6030. var i, keys;
  6031. var isA = Array.isArray(val);
  6032. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6033. return
  6034. }
  6035. if (val.__ob__) {
  6036. var depId = val.__ob__.dep.id;
  6037. if (seen.has(depId)) {
  6038. return
  6039. }
  6040. seen.add(depId);
  6041. }
  6042. if (isA) {
  6043. i = val.length;
  6044. while (i--) { _traverse(val[i], seen); }
  6045. } else {
  6046. keys = Object.keys(val);
  6047. i = keys.length;
  6048. while (i--) { _traverse(val[keys[i]], seen); }
  6049. }
  6050. }
  6051. var mark;
  6052. var measure;
  6053. if (true) {
  6054. var perf = inBrowser && window.performance;
  6055. /* istanbul ignore if */
  6056. if (
  6057. perf &&
  6058. perf.mark &&
  6059. perf.measure &&
  6060. perf.clearMarks &&
  6061. perf.clearMeasures
  6062. ) {
  6063. mark = function (tag) { return perf.mark(tag); };
  6064. measure = function (name, startTag, endTag) {
  6065. perf.measure(name, startTag, endTag);
  6066. perf.clearMarks(startTag);
  6067. perf.clearMarks(endTag);
  6068. // perf.clearMeasures(name)
  6069. };
  6070. }
  6071. }
  6072. /* */
  6073. var normalizeEvent = cached(function (name) {
  6074. var passive = name.charAt(0) === '&';
  6075. name = passive ? name.slice(1) : name;
  6076. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6077. name = once$$1 ? name.slice(1) : name;
  6078. var capture = name.charAt(0) === '!';
  6079. name = capture ? name.slice(1) : name;
  6080. return {
  6081. name: name,
  6082. once: once$$1,
  6083. capture: capture,
  6084. passive: passive
  6085. }
  6086. });
  6087. function createFnInvoker (fns, vm) {
  6088. function invoker () {
  6089. var arguments$1 = arguments;
  6090. var fns = invoker.fns;
  6091. if (Array.isArray(fns)) {
  6092. var cloned = fns.slice();
  6093. for (var i = 0; i < cloned.length; i++) {
  6094. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6095. }
  6096. } else {
  6097. // return handler return value for single handlers
  6098. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6099. }
  6100. }
  6101. invoker.fns = fns;
  6102. return invoker
  6103. }
  6104. function updateListeners (
  6105. on,
  6106. oldOn,
  6107. add,
  6108. remove$$1,
  6109. createOnceHandler,
  6110. vm
  6111. ) {
  6112. var name, def$$1, cur, old, event;
  6113. for (name in on) {
  6114. def$$1 = cur = on[name];
  6115. old = oldOn[name];
  6116. event = normalizeEvent(name);
  6117. if (isUndef(cur)) {
  6118. true && warn(
  6119. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6120. vm
  6121. );
  6122. } else if (isUndef(old)) {
  6123. if (isUndef(cur.fns)) {
  6124. cur = on[name] = createFnInvoker(cur, vm);
  6125. }
  6126. if (isTrue(event.once)) {
  6127. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6128. }
  6129. add(event.name, cur, event.capture, event.passive, event.params);
  6130. } else if (cur !== old) {
  6131. old.fns = cur;
  6132. on[name] = old;
  6133. }
  6134. }
  6135. for (name in oldOn) {
  6136. if (isUndef(on[name])) {
  6137. event = normalizeEvent(name);
  6138. remove$$1(event.name, oldOn[name], event.capture);
  6139. }
  6140. }
  6141. }
  6142. /* */
  6143. /* */
  6144. // fixed by xxxxxx (mp properties)
  6145. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6146. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6147. if (isUndef(propOptions)) {
  6148. return res
  6149. }
  6150. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6151. var attrs = data.attrs;
  6152. var props = data.props;
  6153. if (isDef(attrs) || isDef(props)) {
  6154. for (var key in propOptions) {
  6155. var altKey = hyphenate(key);
  6156. var result = checkProp(res, props, key, altKey, true) ||
  6157. checkProp(res, attrs, key, altKey, false);
  6158. // externalClass
  6159. if (
  6160. result &&
  6161. res[key] &&
  6162. externalClasses.indexOf(altKey) !== -1 &&
  6163. context[camelize(res[key])]
  6164. ) {
  6165. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6166. res[key] = context[camelize(res[key])];
  6167. }
  6168. }
  6169. }
  6170. return res
  6171. }
  6172. function extractPropsFromVNodeData (
  6173. data,
  6174. Ctor,
  6175. tag,
  6176. context// fixed by xxxxxx
  6177. ) {
  6178. // we are only extracting raw values here.
  6179. // validation and default values are handled in the child
  6180. // component itself.
  6181. var propOptions = Ctor.options.props;
  6182. if (isUndef(propOptions)) {
  6183. // fixed by xxxxxx
  6184. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6185. }
  6186. var res = {};
  6187. var attrs = data.attrs;
  6188. var props = data.props;
  6189. if (isDef(attrs) || isDef(props)) {
  6190. for (var key in propOptions) {
  6191. var altKey = hyphenate(key);
  6192. if (true) {
  6193. var keyInLowerCase = key.toLowerCase();
  6194. if (
  6195. key !== keyInLowerCase &&
  6196. attrs && hasOwn(attrs, keyInLowerCase)
  6197. ) {
  6198. tip(
  6199. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6200. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6201. " \"" + key + "\". " +
  6202. "Note that HTML attributes are case-insensitive and camelCased " +
  6203. "props need to use their kebab-case equivalents when using in-DOM " +
  6204. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6205. );
  6206. }
  6207. }
  6208. checkProp(res, props, key, altKey, true) ||
  6209. checkProp(res, attrs, key, altKey, false);
  6210. }
  6211. }
  6212. // fixed by xxxxxx
  6213. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6214. }
  6215. function checkProp (
  6216. res,
  6217. hash,
  6218. key,
  6219. altKey,
  6220. preserve
  6221. ) {
  6222. if (isDef(hash)) {
  6223. if (hasOwn(hash, key)) {
  6224. res[key] = hash[key];
  6225. if (!preserve) {
  6226. delete hash[key];
  6227. }
  6228. return true
  6229. } else if (hasOwn(hash, altKey)) {
  6230. res[key] = hash[altKey];
  6231. if (!preserve) {
  6232. delete hash[altKey];
  6233. }
  6234. return true
  6235. }
  6236. }
  6237. return false
  6238. }
  6239. /* */
  6240. // The template compiler attempts to minimize the need for normalization by
  6241. // statically analyzing the template at compile time.
  6242. //
  6243. // For plain HTML markup, normalization can be completely skipped because the
  6244. // generated render function is guaranteed to return Array<VNode>. There are
  6245. // two cases where extra normalization is needed:
  6246. // 1. When the children contains components - because a functional component
  6247. // may return an Array instead of a single root. In this case, just a simple
  6248. // normalization is needed - if any child is an Array, we flatten the whole
  6249. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6250. // because functional components already normalize their own children.
  6251. function simpleNormalizeChildren (children) {
  6252. for (var i = 0; i < children.length; i++) {
  6253. if (Array.isArray(children[i])) {
  6254. return Array.prototype.concat.apply([], children)
  6255. }
  6256. }
  6257. return children
  6258. }
  6259. // 2. When the children contains constructs that always generated nested Arrays,
  6260. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6261. // with hand-written render functions / JSX. In such cases a full normalization
  6262. // is needed to cater to all possible types of children values.
  6263. function normalizeChildren (children) {
  6264. return isPrimitive(children)
  6265. ? [createTextVNode(children)]
  6266. : Array.isArray(children)
  6267. ? normalizeArrayChildren(children)
  6268. : undefined
  6269. }
  6270. function isTextNode (node) {
  6271. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6272. }
  6273. function normalizeArrayChildren (children, nestedIndex) {
  6274. var res = [];
  6275. var i, c, lastIndex, last;
  6276. for (i = 0; i < children.length; i++) {
  6277. c = children[i];
  6278. if (isUndef(c) || typeof c === 'boolean') { continue }
  6279. lastIndex = res.length - 1;
  6280. last = res[lastIndex];
  6281. // nested
  6282. if (Array.isArray(c)) {
  6283. if (c.length > 0) {
  6284. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6285. // merge adjacent text nodes
  6286. if (isTextNode(c[0]) && isTextNode(last)) {
  6287. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6288. c.shift();
  6289. }
  6290. res.push.apply(res, c);
  6291. }
  6292. } else if (isPrimitive(c)) {
  6293. if (isTextNode(last)) {
  6294. // merge adjacent text nodes
  6295. // this is necessary for SSR hydration because text nodes are
  6296. // essentially merged when rendered to HTML strings
  6297. res[lastIndex] = createTextVNode(last.text + c);
  6298. } else if (c !== '') {
  6299. // convert primitive to vnode
  6300. res.push(createTextVNode(c));
  6301. }
  6302. } else {
  6303. if (isTextNode(c) && isTextNode(last)) {
  6304. // merge adjacent text nodes
  6305. res[lastIndex] = createTextVNode(last.text + c.text);
  6306. } else {
  6307. // default key for nested array children (likely generated by v-for)
  6308. if (isTrue(children._isVList) &&
  6309. isDef(c.tag) &&
  6310. isUndef(c.key) &&
  6311. isDef(nestedIndex)) {
  6312. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6313. }
  6314. res.push(c);
  6315. }
  6316. }
  6317. }
  6318. return res
  6319. }
  6320. /* */
  6321. function initProvide (vm) {
  6322. var provide = vm.$options.provide;
  6323. if (provide) {
  6324. vm._provided = typeof provide === 'function'
  6325. ? provide.call(vm)
  6326. : provide;
  6327. }
  6328. }
  6329. function initInjections (vm) {
  6330. var result = resolveInject(vm.$options.inject, vm);
  6331. if (result) {
  6332. toggleObserving(false);
  6333. Object.keys(result).forEach(function (key) {
  6334. /* istanbul ignore else */
  6335. if (true) {
  6336. defineReactive$$1(vm, key, result[key], function () {
  6337. warn(
  6338. "Avoid mutating an injected value directly since the changes will be " +
  6339. "overwritten whenever the provided component re-renders. " +
  6340. "injection being mutated: \"" + key + "\"",
  6341. vm
  6342. );
  6343. });
  6344. } else {}
  6345. });
  6346. toggleObserving(true);
  6347. }
  6348. }
  6349. function resolveInject (inject, vm) {
  6350. if (inject) {
  6351. // inject is :any because flow is not smart enough to figure out cached
  6352. var result = Object.create(null);
  6353. var keys = hasSymbol
  6354. ? Reflect.ownKeys(inject)
  6355. : Object.keys(inject);
  6356. for (var i = 0; i < keys.length; i++) {
  6357. var key = keys[i];
  6358. // #6574 in case the inject object is observed...
  6359. if (key === '__ob__') { continue }
  6360. var provideKey = inject[key].from;
  6361. var source = vm;
  6362. while (source) {
  6363. if (source._provided && hasOwn(source._provided, provideKey)) {
  6364. result[key] = source._provided[provideKey];
  6365. break
  6366. }
  6367. source = source.$parent;
  6368. }
  6369. if (!source) {
  6370. if ('default' in inject[key]) {
  6371. var provideDefault = inject[key].default;
  6372. result[key] = typeof provideDefault === 'function'
  6373. ? provideDefault.call(vm)
  6374. : provideDefault;
  6375. } else if (true) {
  6376. warn(("Injection \"" + key + "\" not found"), vm);
  6377. }
  6378. }
  6379. }
  6380. return result
  6381. }
  6382. }
  6383. /* */
  6384. /**
  6385. * Runtime helper for resolving raw children VNodes into a slot object.
  6386. */
  6387. function resolveSlots (
  6388. children,
  6389. context
  6390. ) {
  6391. if (!children || !children.length) {
  6392. return {}
  6393. }
  6394. var slots = {};
  6395. for (var i = 0, l = children.length; i < l; i++) {
  6396. var child = children[i];
  6397. var data = child.data;
  6398. // remove slot attribute if the node is resolved as a Vue slot node
  6399. if (data && data.attrs && data.attrs.slot) {
  6400. delete data.attrs.slot;
  6401. }
  6402. // named slots should only be respected if the vnode was rendered in the
  6403. // same context.
  6404. if ((child.context === context || child.fnContext === context) &&
  6405. data && data.slot != null
  6406. ) {
  6407. var name = data.slot;
  6408. var slot = (slots[name] || (slots[name] = []));
  6409. if (child.tag === 'template') {
  6410. slot.push.apply(slot, child.children || []);
  6411. } else {
  6412. slot.push(child);
  6413. }
  6414. } else {
  6415. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6416. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6417. (slots['page'] || (slots['page'] = [])).push(child);
  6418. }else{
  6419. (slots.default || (slots.default = [])).push(child);
  6420. }
  6421. }
  6422. }
  6423. // ignore slots that contains only whitespace
  6424. for (var name$1 in slots) {
  6425. if (slots[name$1].every(isWhitespace)) {
  6426. delete slots[name$1];
  6427. }
  6428. }
  6429. return slots
  6430. }
  6431. function isWhitespace (node) {
  6432. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6433. }
  6434. /* */
  6435. function normalizeScopedSlots (
  6436. slots,
  6437. normalSlots,
  6438. prevSlots
  6439. ) {
  6440. var res;
  6441. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6442. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6443. var key = slots && slots.$key;
  6444. if (!slots) {
  6445. res = {};
  6446. } else if (slots._normalized) {
  6447. // fast path 1: child component re-render only, parent did not change
  6448. return slots._normalized
  6449. } else if (
  6450. isStable &&
  6451. prevSlots &&
  6452. prevSlots !== emptyObject &&
  6453. key === prevSlots.$key &&
  6454. !hasNormalSlots &&
  6455. !prevSlots.$hasNormal
  6456. ) {
  6457. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6458. // only need to normalize once
  6459. return prevSlots
  6460. } else {
  6461. res = {};
  6462. for (var key$1 in slots) {
  6463. if (slots[key$1] && key$1[0] !== '$') {
  6464. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6465. }
  6466. }
  6467. }
  6468. // expose normal slots on scopedSlots
  6469. for (var key$2 in normalSlots) {
  6470. if (!(key$2 in res)) {
  6471. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6472. }
  6473. }
  6474. // avoriaz seems to mock a non-extensible $scopedSlots object
  6475. // and when that is passed down this would cause an error
  6476. if (slots && Object.isExtensible(slots)) {
  6477. (slots)._normalized = res;
  6478. }
  6479. def(res, '$stable', isStable);
  6480. def(res, '$key', key);
  6481. def(res, '$hasNormal', hasNormalSlots);
  6482. return res
  6483. }
  6484. function normalizeScopedSlot(normalSlots, key, fn) {
  6485. var normalized = function () {
  6486. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6487. res = res && typeof res === 'object' && !Array.isArray(res)
  6488. ? [res] // single vnode
  6489. : normalizeChildren(res);
  6490. return res && (
  6491. res.length === 0 ||
  6492. (res.length === 1 && res[0].isComment) // #9658
  6493. ) ? undefined
  6494. : res
  6495. };
  6496. // this is a slot using the new v-slot syntax without scope. although it is
  6497. // compiled as a scoped slot, render fn users would expect it to be present
  6498. // on this.$slots because the usage is semantically a normal slot.
  6499. if (fn.proxy) {
  6500. Object.defineProperty(normalSlots, key, {
  6501. get: normalized,
  6502. enumerable: true,
  6503. configurable: true
  6504. });
  6505. }
  6506. return normalized
  6507. }
  6508. function proxyNormalSlot(slots, key) {
  6509. return function () { return slots[key]; }
  6510. }
  6511. /* */
  6512. /**
  6513. * Runtime helper for rendering v-for lists.
  6514. */
  6515. function renderList (
  6516. val,
  6517. render
  6518. ) {
  6519. var ret, i, l, keys, key;
  6520. if (Array.isArray(val) || typeof val === 'string') {
  6521. ret = new Array(val.length);
  6522. for (i = 0, l = val.length; i < l; i++) {
  6523. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6524. }
  6525. } else if (typeof val === 'number') {
  6526. ret = new Array(val);
  6527. for (i = 0; i < val; i++) {
  6528. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6529. }
  6530. } else if (isObject(val)) {
  6531. if (hasSymbol && val[Symbol.iterator]) {
  6532. ret = [];
  6533. var iterator = val[Symbol.iterator]();
  6534. var result = iterator.next();
  6535. while (!result.done) {
  6536. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6537. result = iterator.next();
  6538. }
  6539. } else {
  6540. keys = Object.keys(val);
  6541. ret = new Array(keys.length);
  6542. for (i = 0, l = keys.length; i < l; i++) {
  6543. key = keys[i];
  6544. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6545. }
  6546. }
  6547. }
  6548. if (!isDef(ret)) {
  6549. ret = [];
  6550. }
  6551. (ret)._isVList = true;
  6552. return ret
  6553. }
  6554. /* */
  6555. /**
  6556. * Runtime helper for rendering <slot>
  6557. */
  6558. function renderSlot (
  6559. name,
  6560. fallback,
  6561. props,
  6562. bindObject
  6563. ) {
  6564. var scopedSlotFn = this.$scopedSlots[name];
  6565. var nodes;
  6566. if (scopedSlotFn) { // scoped slot
  6567. props = props || {};
  6568. if (bindObject) {
  6569. if ( true && !isObject(bindObject)) {
  6570. warn(
  6571. 'slot v-bind without argument expects an Object',
  6572. this
  6573. );
  6574. }
  6575. props = extend(extend({}, bindObject), props);
  6576. }
  6577. // fixed by xxxxxx app-plus scopedSlot
  6578. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6579. } else {
  6580. nodes = this.$slots[name] || fallback;
  6581. }
  6582. var target = props && props.slot;
  6583. if (target) {
  6584. return this.$createElement('template', { slot: target }, nodes)
  6585. } else {
  6586. return nodes
  6587. }
  6588. }
  6589. /* */
  6590. /**
  6591. * Runtime helper for resolving filters
  6592. */
  6593. function resolveFilter (id) {
  6594. return resolveAsset(this.$options, 'filters', id, true) || identity
  6595. }
  6596. /* */
  6597. function isKeyNotMatch (expect, actual) {
  6598. if (Array.isArray(expect)) {
  6599. return expect.indexOf(actual) === -1
  6600. } else {
  6601. return expect !== actual
  6602. }
  6603. }
  6604. /**
  6605. * Runtime helper for checking keyCodes from config.
  6606. * exposed as Vue.prototype._k
  6607. * passing in eventKeyName as last argument separately for backwards compat
  6608. */
  6609. function checkKeyCodes (
  6610. eventKeyCode,
  6611. key,
  6612. builtInKeyCode,
  6613. eventKeyName,
  6614. builtInKeyName
  6615. ) {
  6616. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6617. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6618. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6619. } else if (mappedKeyCode) {
  6620. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6621. } else if (eventKeyName) {
  6622. return hyphenate(eventKeyName) !== key
  6623. }
  6624. }
  6625. /* */
  6626. /**
  6627. * Runtime helper for merging v-bind="object" into a VNode's data.
  6628. */
  6629. function bindObjectProps (
  6630. data,
  6631. tag,
  6632. value,
  6633. asProp,
  6634. isSync
  6635. ) {
  6636. if (value) {
  6637. if (!isObject(value)) {
  6638. true && warn(
  6639. 'v-bind without argument expects an Object or Array value',
  6640. this
  6641. );
  6642. } else {
  6643. if (Array.isArray(value)) {
  6644. value = toObject(value);
  6645. }
  6646. var hash;
  6647. var loop = function ( key ) {
  6648. if (
  6649. key === 'class' ||
  6650. key === 'style' ||
  6651. isReservedAttribute(key)
  6652. ) {
  6653. hash = data;
  6654. } else {
  6655. var type = data.attrs && data.attrs.type;
  6656. hash = asProp || config.mustUseProp(tag, type, key)
  6657. ? data.domProps || (data.domProps = {})
  6658. : data.attrs || (data.attrs = {});
  6659. }
  6660. var camelizedKey = camelize(key);
  6661. var hyphenatedKey = hyphenate(key);
  6662. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6663. hash[key] = value[key];
  6664. if (isSync) {
  6665. var on = data.on || (data.on = {});
  6666. on[("update:" + key)] = function ($event) {
  6667. value[key] = $event;
  6668. };
  6669. }
  6670. }
  6671. };
  6672. for (var key in value) loop( key );
  6673. }
  6674. }
  6675. return data
  6676. }
  6677. /* */
  6678. /**
  6679. * Runtime helper for rendering static trees.
  6680. */
  6681. function renderStatic (
  6682. index,
  6683. isInFor
  6684. ) {
  6685. var cached = this._staticTrees || (this._staticTrees = []);
  6686. var tree = cached[index];
  6687. // if has already-rendered static tree and not inside v-for,
  6688. // we can reuse the same tree.
  6689. if (tree && !isInFor) {
  6690. return tree
  6691. }
  6692. // otherwise, render a fresh tree.
  6693. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6694. this._renderProxy,
  6695. null,
  6696. this // for render fns generated for functional component templates
  6697. );
  6698. markStatic(tree, ("__static__" + index), false);
  6699. return tree
  6700. }
  6701. /**
  6702. * Runtime helper for v-once.
  6703. * Effectively it means marking the node as static with a unique key.
  6704. */
  6705. function markOnce (
  6706. tree,
  6707. index,
  6708. key
  6709. ) {
  6710. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6711. return tree
  6712. }
  6713. function markStatic (
  6714. tree,
  6715. key,
  6716. isOnce
  6717. ) {
  6718. if (Array.isArray(tree)) {
  6719. for (var i = 0; i < tree.length; i++) {
  6720. if (tree[i] && typeof tree[i] !== 'string') {
  6721. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6722. }
  6723. }
  6724. } else {
  6725. markStaticNode(tree, key, isOnce);
  6726. }
  6727. }
  6728. function markStaticNode (node, key, isOnce) {
  6729. node.isStatic = true;
  6730. node.key = key;
  6731. node.isOnce = isOnce;
  6732. }
  6733. /* */
  6734. function bindObjectListeners (data, value) {
  6735. if (value) {
  6736. if (!isPlainObject(value)) {
  6737. true && warn(
  6738. 'v-on without argument expects an Object value',
  6739. this
  6740. );
  6741. } else {
  6742. var on = data.on = data.on ? extend({}, data.on) : {};
  6743. for (var key in value) {
  6744. var existing = on[key];
  6745. var ours = value[key];
  6746. on[key] = existing ? [].concat(existing, ours) : ours;
  6747. }
  6748. }
  6749. }
  6750. return data
  6751. }
  6752. /* */
  6753. function resolveScopedSlots (
  6754. fns, // see flow/vnode
  6755. res,
  6756. // the following are added in 2.6
  6757. hasDynamicKeys,
  6758. contentHashKey
  6759. ) {
  6760. res = res || { $stable: !hasDynamicKeys };
  6761. for (var i = 0; i < fns.length; i++) {
  6762. var slot = fns[i];
  6763. if (Array.isArray(slot)) {
  6764. resolveScopedSlots(slot, res, hasDynamicKeys);
  6765. } else if (slot) {
  6766. // marker for reverse proxying v-slot without scope on this.$slots
  6767. if (slot.proxy) {
  6768. slot.fn.proxy = true;
  6769. }
  6770. res[slot.key] = slot.fn;
  6771. }
  6772. }
  6773. if (contentHashKey) {
  6774. (res).$key = contentHashKey;
  6775. }
  6776. return res
  6777. }
  6778. /* */
  6779. function bindDynamicKeys (baseObj, values) {
  6780. for (var i = 0; i < values.length; i += 2) {
  6781. var key = values[i];
  6782. if (typeof key === 'string' && key) {
  6783. baseObj[values[i]] = values[i + 1];
  6784. } else if ( true && key !== '' && key !== null) {
  6785. // null is a special value for explicitly removing a binding
  6786. warn(
  6787. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6788. this
  6789. );
  6790. }
  6791. }
  6792. return baseObj
  6793. }
  6794. // helper to dynamically append modifier runtime markers to event names.
  6795. // ensure only append when value is already string, otherwise it will be cast
  6796. // to string and cause the type check to miss.
  6797. function prependModifier (value, symbol) {
  6798. return typeof value === 'string' ? symbol + value : value
  6799. }
  6800. /* */
  6801. function installRenderHelpers (target) {
  6802. target._o = markOnce;
  6803. target._n = toNumber;
  6804. target._s = toString;
  6805. target._l = renderList;
  6806. target._t = renderSlot;
  6807. target._q = looseEqual;
  6808. target._i = looseIndexOf;
  6809. target._m = renderStatic;
  6810. target._f = resolveFilter;
  6811. target._k = checkKeyCodes;
  6812. target._b = bindObjectProps;
  6813. target._v = createTextVNode;
  6814. target._e = createEmptyVNode;
  6815. target._u = resolveScopedSlots;
  6816. target._g = bindObjectListeners;
  6817. target._d = bindDynamicKeys;
  6818. target._p = prependModifier;
  6819. }
  6820. /* */
  6821. function FunctionalRenderContext (
  6822. data,
  6823. props,
  6824. children,
  6825. parent,
  6826. Ctor
  6827. ) {
  6828. var this$1 = this;
  6829. var options = Ctor.options;
  6830. // ensure the createElement function in functional components
  6831. // gets a unique context - this is necessary for correct named slot check
  6832. var contextVm;
  6833. if (hasOwn(parent, '_uid')) {
  6834. contextVm = Object.create(parent);
  6835. // $flow-disable-line
  6836. contextVm._original = parent;
  6837. } else {
  6838. // the context vm passed in is a functional context as well.
  6839. // in this case we want to make sure we are able to get a hold to the
  6840. // real context instance.
  6841. contextVm = parent;
  6842. // $flow-disable-line
  6843. parent = parent._original;
  6844. }
  6845. var isCompiled = isTrue(options._compiled);
  6846. var needNormalization = !isCompiled;
  6847. this.data = data;
  6848. this.props = props;
  6849. this.children = children;
  6850. this.parent = parent;
  6851. this.listeners = data.on || emptyObject;
  6852. this.injections = resolveInject(options.inject, parent);
  6853. this.slots = function () {
  6854. if (!this$1.$slots) {
  6855. normalizeScopedSlots(
  6856. data.scopedSlots,
  6857. this$1.$slots = resolveSlots(children, parent)
  6858. );
  6859. }
  6860. return this$1.$slots
  6861. };
  6862. Object.defineProperty(this, 'scopedSlots', ({
  6863. enumerable: true,
  6864. get: function get () {
  6865. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6866. }
  6867. }));
  6868. // support for compiled functional template
  6869. if (isCompiled) {
  6870. // exposing $options for renderStatic()
  6871. this.$options = options;
  6872. // pre-resolve slots for renderSlot()
  6873. this.$slots = this.slots();
  6874. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6875. }
  6876. if (options._scopeId) {
  6877. this._c = function (a, b, c, d) {
  6878. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6879. if (vnode && !Array.isArray(vnode)) {
  6880. vnode.fnScopeId = options._scopeId;
  6881. vnode.fnContext = parent;
  6882. }
  6883. return vnode
  6884. };
  6885. } else {
  6886. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6887. }
  6888. }
  6889. installRenderHelpers(FunctionalRenderContext.prototype);
  6890. function createFunctionalComponent (
  6891. Ctor,
  6892. propsData,
  6893. data,
  6894. contextVm,
  6895. children
  6896. ) {
  6897. var options = Ctor.options;
  6898. var props = {};
  6899. var propOptions = options.props;
  6900. if (isDef(propOptions)) {
  6901. for (var key in propOptions) {
  6902. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6903. }
  6904. } else {
  6905. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6906. if (isDef(data.props)) { mergeProps(props, data.props); }
  6907. }
  6908. var renderContext = new FunctionalRenderContext(
  6909. data,
  6910. props,
  6911. children,
  6912. contextVm,
  6913. Ctor
  6914. );
  6915. var vnode = options.render.call(null, renderContext._c, renderContext);
  6916. if (vnode instanceof VNode) {
  6917. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6918. } else if (Array.isArray(vnode)) {
  6919. var vnodes = normalizeChildren(vnode) || [];
  6920. var res = new Array(vnodes.length);
  6921. for (var i = 0; i < vnodes.length; i++) {
  6922. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6923. }
  6924. return res
  6925. }
  6926. }
  6927. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6928. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6929. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6930. // that should not be matched to match.
  6931. var clone = cloneVNode(vnode);
  6932. clone.fnContext = contextVm;
  6933. clone.fnOptions = options;
  6934. if (true) {
  6935. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6936. }
  6937. if (data.slot) {
  6938. (clone.data || (clone.data = {})).slot = data.slot;
  6939. }
  6940. return clone
  6941. }
  6942. function mergeProps (to, from) {
  6943. for (var key in from) {
  6944. to[camelize(key)] = from[key];
  6945. }
  6946. }
  6947. /* */
  6948. /* */
  6949. /* */
  6950. /* */
  6951. // inline hooks to be invoked on component VNodes during patch
  6952. var componentVNodeHooks = {
  6953. init: function init (vnode, hydrating) {
  6954. if (
  6955. vnode.componentInstance &&
  6956. !vnode.componentInstance._isDestroyed &&
  6957. vnode.data.keepAlive
  6958. ) {
  6959. // kept-alive components, treat as a patch
  6960. var mountedNode = vnode; // work around flow
  6961. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6962. } else {
  6963. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6964. vnode,
  6965. activeInstance
  6966. );
  6967. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6968. }
  6969. },
  6970. prepatch: function prepatch (oldVnode, vnode) {
  6971. var options = vnode.componentOptions;
  6972. var child = vnode.componentInstance = oldVnode.componentInstance;
  6973. updateChildComponent(
  6974. child,
  6975. options.propsData, // updated props
  6976. options.listeners, // updated listeners
  6977. vnode, // new parent vnode
  6978. options.children // new children
  6979. );
  6980. },
  6981. insert: function insert (vnode) {
  6982. var context = vnode.context;
  6983. var componentInstance = vnode.componentInstance;
  6984. if (!componentInstance._isMounted) {
  6985. callHook(componentInstance, 'onServiceCreated');
  6986. callHook(componentInstance, 'onServiceAttached');
  6987. componentInstance._isMounted = true;
  6988. callHook(componentInstance, 'mounted');
  6989. }
  6990. if (vnode.data.keepAlive) {
  6991. if (context._isMounted) {
  6992. // vue-router#1212
  6993. // During updates, a kept-alive component's child components may
  6994. // change, so directly walking the tree here may call activated hooks
  6995. // on incorrect children. Instead we push them into a queue which will
  6996. // be processed after the whole patch process ended.
  6997. queueActivatedComponent(componentInstance);
  6998. } else {
  6999. activateChildComponent(componentInstance, true /* direct */);
  7000. }
  7001. }
  7002. },
  7003. destroy: function destroy (vnode) {
  7004. var componentInstance = vnode.componentInstance;
  7005. if (!componentInstance._isDestroyed) {
  7006. if (!vnode.data.keepAlive) {
  7007. componentInstance.$destroy();
  7008. } else {
  7009. deactivateChildComponent(componentInstance, true /* direct */);
  7010. }
  7011. }
  7012. }
  7013. };
  7014. var hooksToMerge = Object.keys(componentVNodeHooks);
  7015. function createComponent (
  7016. Ctor,
  7017. data,
  7018. context,
  7019. children,
  7020. tag
  7021. ) {
  7022. if (isUndef(Ctor)) {
  7023. return
  7024. }
  7025. var baseCtor = context.$options._base;
  7026. // plain options object: turn it into a constructor
  7027. if (isObject(Ctor)) {
  7028. Ctor = baseCtor.extend(Ctor);
  7029. }
  7030. // if at this stage it's not a constructor or an async component factory,
  7031. // reject.
  7032. if (typeof Ctor !== 'function') {
  7033. if (true) {
  7034. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7035. }
  7036. return
  7037. }
  7038. // async component
  7039. var asyncFactory;
  7040. if (isUndef(Ctor.cid)) {
  7041. asyncFactory = Ctor;
  7042. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7043. if (Ctor === undefined) {
  7044. // return a placeholder node for async component, which is rendered
  7045. // as a comment node but preserves all the raw information for the node.
  7046. // the information will be used for async server-rendering and hydration.
  7047. return createAsyncPlaceholder(
  7048. asyncFactory,
  7049. data,
  7050. context,
  7051. children,
  7052. tag
  7053. )
  7054. }
  7055. }
  7056. data = data || {};
  7057. // resolve constructor options in case global mixins are applied after
  7058. // component constructor creation
  7059. resolveConstructorOptions(Ctor);
  7060. // transform component v-model data into props & events
  7061. if (isDef(data.model)) {
  7062. transformModel(Ctor.options, data);
  7063. }
  7064. // extract props
  7065. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7066. // functional component
  7067. if (isTrue(Ctor.options.functional)) {
  7068. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7069. }
  7070. // extract listeners, since these needs to be treated as
  7071. // child component listeners instead of DOM listeners
  7072. var listeners = data.on;
  7073. // replace with listeners with .native modifier
  7074. // so it gets processed during parent component patch.
  7075. data.on = data.nativeOn;
  7076. if (isTrue(Ctor.options.abstract)) {
  7077. // abstract components do not keep anything
  7078. // other than props & listeners & slot
  7079. // work around flow
  7080. var slot = data.slot;
  7081. data = {};
  7082. if (slot) {
  7083. data.slot = slot;
  7084. }
  7085. }
  7086. // install component management hooks onto the placeholder node
  7087. installComponentHooks(data);
  7088. // return a placeholder vnode
  7089. var name = Ctor.options.name || tag;
  7090. var vnode = new VNode(
  7091. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7092. data, undefined, undefined, undefined, context,
  7093. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7094. asyncFactory
  7095. );
  7096. return vnode
  7097. }
  7098. function createComponentInstanceForVnode (
  7099. vnode, // we know it's MountedComponentVNode but flow doesn't
  7100. parent // activeInstance in lifecycle state
  7101. ) {
  7102. var options = {
  7103. _isComponent: true,
  7104. _parentVnode: vnode,
  7105. parent: parent
  7106. };
  7107. // check inline-template render functions
  7108. var inlineTemplate = vnode.data.inlineTemplate;
  7109. if (isDef(inlineTemplate)) {
  7110. options.render = inlineTemplate.render;
  7111. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7112. }
  7113. return new vnode.componentOptions.Ctor(options)
  7114. }
  7115. function installComponentHooks (data) {
  7116. var hooks = data.hook || (data.hook = {});
  7117. for (var i = 0; i < hooksToMerge.length; i++) {
  7118. var key = hooksToMerge[i];
  7119. var existing = hooks[key];
  7120. var toMerge = componentVNodeHooks[key];
  7121. if (existing !== toMerge && !(existing && existing._merged)) {
  7122. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7123. }
  7124. }
  7125. }
  7126. function mergeHook$1 (f1, f2) {
  7127. var merged = function (a, b) {
  7128. // flow complains about extra args which is why we use any
  7129. f1(a, b);
  7130. f2(a, b);
  7131. };
  7132. merged._merged = true;
  7133. return merged
  7134. }
  7135. // transform component v-model info (value and callback) into
  7136. // prop and event handler respectively.
  7137. function transformModel (options, data) {
  7138. var prop = (options.model && options.model.prop) || 'value';
  7139. var event = (options.model && options.model.event) || 'input'
  7140. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7141. var on = data.on || (data.on = {});
  7142. var existing = on[event];
  7143. var callback = data.model.callback;
  7144. if (isDef(existing)) {
  7145. if (
  7146. Array.isArray(existing)
  7147. ? existing.indexOf(callback) === -1
  7148. : existing !== callback
  7149. ) {
  7150. on[event] = [callback].concat(existing);
  7151. }
  7152. } else {
  7153. on[event] = callback;
  7154. }
  7155. }
  7156. /* */
  7157. var SIMPLE_NORMALIZE = 1;
  7158. var ALWAYS_NORMALIZE = 2;
  7159. // wrapper function for providing a more flexible interface
  7160. // without getting yelled at by flow
  7161. function createElement (
  7162. context,
  7163. tag,
  7164. data,
  7165. children,
  7166. normalizationType,
  7167. alwaysNormalize
  7168. ) {
  7169. if (Array.isArray(data) || isPrimitive(data)) {
  7170. normalizationType = children;
  7171. children = data;
  7172. data = undefined;
  7173. }
  7174. if (isTrue(alwaysNormalize)) {
  7175. normalizationType = ALWAYS_NORMALIZE;
  7176. }
  7177. return _createElement(context, tag, data, children, normalizationType)
  7178. }
  7179. function _createElement (
  7180. context,
  7181. tag,
  7182. data,
  7183. children,
  7184. normalizationType
  7185. ) {
  7186. if (isDef(data) && isDef((data).__ob__)) {
  7187. true && warn(
  7188. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7189. 'Always create fresh vnode data objects in each render!',
  7190. context
  7191. );
  7192. return createEmptyVNode()
  7193. }
  7194. // object syntax in v-bind
  7195. if (isDef(data) && isDef(data.is)) {
  7196. tag = data.is;
  7197. }
  7198. if (!tag) {
  7199. // in case of component :is set to falsy value
  7200. return createEmptyVNode()
  7201. }
  7202. // warn against non-primitive key
  7203. if ( true &&
  7204. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7205. ) {
  7206. {
  7207. warn(
  7208. 'Avoid using non-primitive value as key, ' +
  7209. 'use string/number value instead.',
  7210. context
  7211. );
  7212. }
  7213. }
  7214. // support single function children as default scoped slot
  7215. if (Array.isArray(children) &&
  7216. typeof children[0] === 'function'
  7217. ) {
  7218. data = data || {};
  7219. data.scopedSlots = { default: children[0] };
  7220. children.length = 0;
  7221. }
  7222. if (normalizationType === ALWAYS_NORMALIZE) {
  7223. children = normalizeChildren(children);
  7224. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7225. children = simpleNormalizeChildren(children);
  7226. }
  7227. var vnode, ns;
  7228. if (typeof tag === 'string') {
  7229. var Ctor;
  7230. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7231. if (config.isReservedTag(tag)) {
  7232. // platform built-in elements
  7233. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7234. warn(
  7235. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7236. context
  7237. );
  7238. }
  7239. vnode = new VNode(
  7240. config.parsePlatformTagName(tag), data, children,
  7241. undefined, undefined, context
  7242. );
  7243. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7244. // component
  7245. vnode = createComponent(Ctor, data, context, children, tag);
  7246. } else {
  7247. // unknown or unlisted namespaced elements
  7248. // check at runtime because it may get assigned a namespace when its
  7249. // parent normalizes children
  7250. vnode = new VNode(
  7251. tag, data, children,
  7252. undefined, undefined, context
  7253. );
  7254. }
  7255. } else {
  7256. // direct component options / constructor
  7257. vnode = createComponent(tag, data, context, children);
  7258. }
  7259. if (Array.isArray(vnode)) {
  7260. return vnode
  7261. } else if (isDef(vnode)) {
  7262. if (isDef(ns)) { applyNS(vnode, ns); }
  7263. if (isDef(data)) { registerDeepBindings(data); }
  7264. return vnode
  7265. } else {
  7266. return createEmptyVNode()
  7267. }
  7268. }
  7269. function applyNS (vnode, ns, force) {
  7270. vnode.ns = ns;
  7271. if (vnode.tag === 'foreignObject') {
  7272. // use default namespace inside foreignObject
  7273. ns = undefined;
  7274. force = true;
  7275. }
  7276. if (isDef(vnode.children)) {
  7277. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7278. var child = vnode.children[i];
  7279. if (isDef(child.tag) && (
  7280. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7281. applyNS(child, ns, force);
  7282. }
  7283. }
  7284. }
  7285. }
  7286. // ref #5318
  7287. // necessary to ensure parent re-render when deep bindings like :style and
  7288. // :class are used on slot nodes
  7289. function registerDeepBindings (data) {
  7290. if (isObject(data.style)) {
  7291. traverse(data.style);
  7292. }
  7293. if (isObject(data.class)) {
  7294. traverse(data.class);
  7295. }
  7296. }
  7297. /* */
  7298. function initRender (vm) {
  7299. vm._vnode = null; // the root of the child tree
  7300. vm._staticTrees = null; // v-once cached trees
  7301. var options = vm.$options;
  7302. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7303. var renderContext = parentVnode && parentVnode.context;
  7304. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7305. vm.$scopedSlots = emptyObject;
  7306. // bind the createElement fn to this instance
  7307. // so that we get proper render context inside it.
  7308. // args order: tag, data, children, normalizationType, alwaysNormalize
  7309. // internal version is used by render functions compiled from templates
  7310. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7311. // normalization is always applied for the public version, used in
  7312. // user-written render functions.
  7313. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7314. // $attrs & $listeners are exposed for easier HOC creation.
  7315. // they need to be reactive so that HOCs using them are always updated
  7316. var parentData = parentVnode && parentVnode.data;
  7317. /* istanbul ignore else */
  7318. if (true) {
  7319. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7320. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7321. }, true);
  7322. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7323. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7324. }, true);
  7325. } else {}
  7326. }
  7327. var currentRenderingInstance = null;
  7328. function renderMixin (Vue) {
  7329. // install runtime convenience helpers
  7330. installRenderHelpers(Vue.prototype);
  7331. Vue.prototype.$nextTick = function (fn) {
  7332. return nextTick(fn, this)
  7333. };
  7334. Vue.prototype._render = function () {
  7335. var vm = this;
  7336. var ref = vm.$options;
  7337. var render = ref.render;
  7338. var _parentVnode = ref._parentVnode;
  7339. if (_parentVnode) {
  7340. vm.$scopedSlots = normalizeScopedSlots(
  7341. _parentVnode.data.scopedSlots,
  7342. vm.$slots,
  7343. vm.$scopedSlots
  7344. );
  7345. }
  7346. // set parent vnode. this allows render functions to have access
  7347. // to the data on the placeholder node.
  7348. vm.$vnode = _parentVnode;
  7349. // render self
  7350. var vnode;
  7351. try {
  7352. // There's no need to maintain a stack because all render fns are called
  7353. // separately from one another. Nested component's render fns are called
  7354. // when parent component is patched.
  7355. currentRenderingInstance = vm;
  7356. vnode = render.call(vm._renderProxy, vm.$createElement);
  7357. } catch (e) {
  7358. handleError(e, vm, "render");
  7359. // return error render result,
  7360. // or previous vnode to prevent render error causing blank component
  7361. /* istanbul ignore else */
  7362. if ( true && vm.$options.renderError) {
  7363. try {
  7364. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7365. } catch (e) {
  7366. handleError(e, vm, "renderError");
  7367. vnode = vm._vnode;
  7368. }
  7369. } else {
  7370. vnode = vm._vnode;
  7371. }
  7372. } finally {
  7373. currentRenderingInstance = null;
  7374. }
  7375. // if the returned array contains only a single node, allow it
  7376. if (Array.isArray(vnode) && vnode.length === 1) {
  7377. vnode = vnode[0];
  7378. }
  7379. // return empty vnode in case the render function errored out
  7380. if (!(vnode instanceof VNode)) {
  7381. if ( true && Array.isArray(vnode)) {
  7382. warn(
  7383. 'Multiple root nodes returned from render function. Render function ' +
  7384. 'should return a single root node.',
  7385. vm
  7386. );
  7387. }
  7388. vnode = createEmptyVNode();
  7389. }
  7390. // set parent
  7391. vnode.parent = _parentVnode;
  7392. return vnode
  7393. };
  7394. }
  7395. /* */
  7396. function ensureCtor (comp, base) {
  7397. if (
  7398. comp.__esModule ||
  7399. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7400. ) {
  7401. comp = comp.default;
  7402. }
  7403. return isObject(comp)
  7404. ? base.extend(comp)
  7405. : comp
  7406. }
  7407. function createAsyncPlaceholder (
  7408. factory,
  7409. data,
  7410. context,
  7411. children,
  7412. tag
  7413. ) {
  7414. var node = createEmptyVNode();
  7415. node.asyncFactory = factory;
  7416. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7417. return node
  7418. }
  7419. function resolveAsyncComponent (
  7420. factory,
  7421. baseCtor
  7422. ) {
  7423. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7424. return factory.errorComp
  7425. }
  7426. if (isDef(factory.resolved)) {
  7427. return factory.resolved
  7428. }
  7429. var owner = currentRenderingInstance;
  7430. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7431. // already pending
  7432. factory.owners.push(owner);
  7433. }
  7434. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7435. return factory.loadingComp
  7436. }
  7437. if (owner && !isDef(factory.owners)) {
  7438. var owners = factory.owners = [owner];
  7439. var sync = true;
  7440. var timerLoading = null;
  7441. var timerTimeout = null
  7442. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7443. var forceRender = function (renderCompleted) {
  7444. for (var i = 0, l = owners.length; i < l; i++) {
  7445. (owners[i]).$forceUpdate();
  7446. }
  7447. if (renderCompleted) {
  7448. owners.length = 0;
  7449. if (timerLoading !== null) {
  7450. clearTimeout(timerLoading);
  7451. timerLoading = null;
  7452. }
  7453. if (timerTimeout !== null) {
  7454. clearTimeout(timerTimeout);
  7455. timerTimeout = null;
  7456. }
  7457. }
  7458. };
  7459. var resolve = once(function (res) {
  7460. // cache resolved
  7461. factory.resolved = ensureCtor(res, baseCtor);
  7462. // invoke callbacks only if this is not a synchronous resolve
  7463. // (async resolves are shimmed as synchronous during SSR)
  7464. if (!sync) {
  7465. forceRender(true);
  7466. } else {
  7467. owners.length = 0;
  7468. }
  7469. });
  7470. var reject = once(function (reason) {
  7471. true && warn(
  7472. "Failed to resolve async component: " + (String(factory)) +
  7473. (reason ? ("\nReason: " + reason) : '')
  7474. );
  7475. if (isDef(factory.errorComp)) {
  7476. factory.error = true;
  7477. forceRender(true);
  7478. }
  7479. });
  7480. var res = factory(resolve, reject);
  7481. if (isObject(res)) {
  7482. if (isPromise(res)) {
  7483. // () => Promise
  7484. if (isUndef(factory.resolved)) {
  7485. res.then(resolve, reject);
  7486. }
  7487. } else if (isPromise(res.component)) {
  7488. res.component.then(resolve, reject);
  7489. if (isDef(res.error)) {
  7490. factory.errorComp = ensureCtor(res.error, baseCtor);
  7491. }
  7492. if (isDef(res.loading)) {
  7493. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7494. if (res.delay === 0) {
  7495. factory.loading = true;
  7496. } else {
  7497. timerLoading = setTimeout(function () {
  7498. timerLoading = null;
  7499. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7500. factory.loading = true;
  7501. forceRender(false);
  7502. }
  7503. }, res.delay || 200);
  7504. }
  7505. }
  7506. if (isDef(res.timeout)) {
  7507. timerTimeout = setTimeout(function () {
  7508. timerTimeout = null;
  7509. if (isUndef(factory.resolved)) {
  7510. reject(
  7511. true
  7512. ? ("timeout (" + (res.timeout) + "ms)")
  7513. : undefined
  7514. );
  7515. }
  7516. }, res.timeout);
  7517. }
  7518. }
  7519. }
  7520. sync = false;
  7521. // return in case resolved synchronously
  7522. return factory.loading
  7523. ? factory.loadingComp
  7524. : factory.resolved
  7525. }
  7526. }
  7527. /* */
  7528. function isAsyncPlaceholder (node) {
  7529. return node.isComment && node.asyncFactory
  7530. }
  7531. /* */
  7532. function getFirstComponentChild (children) {
  7533. if (Array.isArray(children)) {
  7534. for (var i = 0; i < children.length; i++) {
  7535. var c = children[i];
  7536. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7537. return c
  7538. }
  7539. }
  7540. }
  7541. }
  7542. /* */
  7543. /* */
  7544. function initEvents (vm) {
  7545. vm._events = Object.create(null);
  7546. vm._hasHookEvent = false;
  7547. // init parent attached events
  7548. var listeners = vm.$options._parentListeners;
  7549. if (listeners) {
  7550. updateComponentListeners(vm, listeners);
  7551. }
  7552. }
  7553. var target;
  7554. function add (event, fn) {
  7555. target.$on(event, fn);
  7556. }
  7557. function remove$1 (event, fn) {
  7558. target.$off(event, fn);
  7559. }
  7560. function createOnceHandler (event, fn) {
  7561. var _target = target;
  7562. return function onceHandler () {
  7563. var res = fn.apply(null, arguments);
  7564. if (res !== null) {
  7565. _target.$off(event, onceHandler);
  7566. }
  7567. }
  7568. }
  7569. function updateComponentListeners (
  7570. vm,
  7571. listeners,
  7572. oldListeners
  7573. ) {
  7574. target = vm;
  7575. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7576. target = undefined;
  7577. }
  7578. function eventsMixin (Vue) {
  7579. var hookRE = /^hook:/;
  7580. Vue.prototype.$on = function (event, fn) {
  7581. var vm = this;
  7582. if (Array.isArray(event)) {
  7583. for (var i = 0, l = event.length; i < l; i++) {
  7584. vm.$on(event[i], fn);
  7585. }
  7586. } else {
  7587. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7588. // optimize hook:event cost by using a boolean flag marked at registration
  7589. // instead of a hash lookup
  7590. if (hookRE.test(event)) {
  7591. vm._hasHookEvent = true;
  7592. }
  7593. }
  7594. return vm
  7595. };
  7596. Vue.prototype.$once = function (event, fn) {
  7597. var vm = this;
  7598. function on () {
  7599. vm.$off(event, on);
  7600. fn.apply(vm, arguments);
  7601. }
  7602. on.fn = fn;
  7603. vm.$on(event, on);
  7604. return vm
  7605. };
  7606. Vue.prototype.$off = function (event, fn) {
  7607. var vm = this;
  7608. // all
  7609. if (!arguments.length) {
  7610. vm._events = Object.create(null);
  7611. return vm
  7612. }
  7613. // array of events
  7614. if (Array.isArray(event)) {
  7615. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7616. vm.$off(event[i$1], fn);
  7617. }
  7618. return vm
  7619. }
  7620. // specific event
  7621. var cbs = vm._events[event];
  7622. if (!cbs) {
  7623. return vm
  7624. }
  7625. if (!fn) {
  7626. vm._events[event] = null;
  7627. return vm
  7628. }
  7629. // specific handler
  7630. var cb;
  7631. var i = cbs.length;
  7632. while (i--) {
  7633. cb = cbs[i];
  7634. if (cb === fn || cb.fn === fn) {
  7635. cbs.splice(i, 1);
  7636. break
  7637. }
  7638. }
  7639. return vm
  7640. };
  7641. Vue.prototype.$emit = function (event) {
  7642. var vm = this;
  7643. if (true) {
  7644. var lowerCaseEvent = event.toLowerCase();
  7645. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7646. tip(
  7647. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7648. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7649. "Note that HTML attributes are case-insensitive and you cannot use " +
  7650. "v-on to listen to camelCase events when using in-DOM templates. " +
  7651. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7652. );
  7653. }
  7654. }
  7655. var cbs = vm._events[event];
  7656. if (cbs) {
  7657. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7658. var args = toArray(arguments, 1);
  7659. var info = "event handler for \"" + event + "\"";
  7660. for (var i = 0, l = cbs.length; i < l; i++) {
  7661. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7662. }
  7663. }
  7664. return vm
  7665. };
  7666. }
  7667. /* */
  7668. var activeInstance = null;
  7669. var isUpdatingChildComponent = false;
  7670. function setActiveInstance(vm) {
  7671. var prevActiveInstance = activeInstance;
  7672. activeInstance = vm;
  7673. return function () {
  7674. activeInstance = prevActiveInstance;
  7675. }
  7676. }
  7677. function initLifecycle (vm) {
  7678. var options = vm.$options;
  7679. // locate first non-abstract parent
  7680. var parent = options.parent;
  7681. if (parent && !options.abstract) {
  7682. while (parent.$options.abstract && parent.$parent) {
  7683. parent = parent.$parent;
  7684. }
  7685. parent.$children.push(vm);
  7686. }
  7687. vm.$parent = parent;
  7688. vm.$root = parent ? parent.$root : vm;
  7689. vm.$children = [];
  7690. vm.$refs = {};
  7691. vm._watcher = null;
  7692. vm._inactive = null;
  7693. vm._directInactive = false;
  7694. vm._isMounted = false;
  7695. vm._isDestroyed = false;
  7696. vm._isBeingDestroyed = false;
  7697. }
  7698. function lifecycleMixin (Vue) {
  7699. Vue.prototype._update = function (vnode, hydrating) {
  7700. var vm = this;
  7701. var prevEl = vm.$el;
  7702. var prevVnode = vm._vnode;
  7703. var restoreActiveInstance = setActiveInstance(vm);
  7704. vm._vnode = vnode;
  7705. // Vue.prototype.__patch__ is injected in entry points
  7706. // based on the rendering backend used.
  7707. if (!prevVnode) {
  7708. // initial render
  7709. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7710. } else {
  7711. // updates
  7712. vm.$el = vm.__patch__(prevVnode, vnode);
  7713. }
  7714. restoreActiveInstance();
  7715. // update __vue__ reference
  7716. if (prevEl) {
  7717. prevEl.__vue__ = null;
  7718. }
  7719. if (vm.$el) {
  7720. vm.$el.__vue__ = vm;
  7721. }
  7722. // if parent is an HOC, update its $el as well
  7723. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7724. vm.$parent.$el = vm.$el;
  7725. }
  7726. // updated hook is called by the scheduler to ensure that children are
  7727. // updated in a parent's updated hook.
  7728. };
  7729. Vue.prototype.$forceUpdate = function () {
  7730. var vm = this;
  7731. if (vm._watcher) {
  7732. vm._watcher.update();
  7733. }
  7734. };
  7735. Vue.prototype.$destroy = function () {
  7736. var vm = this;
  7737. if (vm._isBeingDestroyed) {
  7738. return
  7739. }
  7740. callHook(vm, 'beforeDestroy');
  7741. vm._isBeingDestroyed = true;
  7742. // remove self from parent
  7743. var parent = vm.$parent;
  7744. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7745. remove(parent.$children, vm);
  7746. }
  7747. // teardown watchers
  7748. if (vm._watcher) {
  7749. vm._watcher.teardown();
  7750. }
  7751. var i = vm._watchers.length;
  7752. while (i--) {
  7753. vm._watchers[i].teardown();
  7754. }
  7755. // remove reference from data ob
  7756. // frozen object may not have observer.
  7757. if (vm._data.__ob__) {
  7758. vm._data.__ob__.vmCount--;
  7759. }
  7760. // call the last hook...
  7761. vm._isDestroyed = true;
  7762. // invoke destroy hooks on current rendered tree
  7763. vm.__patch__(vm._vnode, null);
  7764. // fire destroyed hook
  7765. callHook(vm, 'destroyed');
  7766. // turn off all instance listeners.
  7767. vm.$off();
  7768. // remove __vue__ reference
  7769. if (vm.$el) {
  7770. vm.$el.__vue__ = null;
  7771. }
  7772. // release circular reference (#6759)
  7773. if (vm.$vnode) {
  7774. vm.$vnode.parent = null;
  7775. }
  7776. };
  7777. }
  7778. function updateChildComponent (
  7779. vm,
  7780. propsData,
  7781. listeners,
  7782. parentVnode,
  7783. renderChildren
  7784. ) {
  7785. if (true) {
  7786. isUpdatingChildComponent = true;
  7787. }
  7788. // determine whether component has slot children
  7789. // we need to do this before overwriting $options._renderChildren.
  7790. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7791. // dynamic slot names). Static scoped slots compiled from template has the
  7792. // "$stable" marker.
  7793. var newScopedSlots = parentVnode.data.scopedSlots;
  7794. var oldScopedSlots = vm.$scopedSlots;
  7795. var hasDynamicScopedSlot = !!(
  7796. (newScopedSlots && !newScopedSlots.$stable) ||
  7797. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7798. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7799. );
  7800. // Any static slot children from the parent may have changed during parent's
  7801. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7802. // update is necessary to ensure correctness.
  7803. var needsForceUpdate = !!(
  7804. renderChildren || // has new static slots
  7805. vm.$options._renderChildren || // has old static slots
  7806. hasDynamicScopedSlot
  7807. );
  7808. vm.$options._parentVnode = parentVnode;
  7809. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7810. if (vm._vnode) { // update child tree's parent
  7811. vm._vnode.parent = parentVnode;
  7812. }
  7813. vm.$options._renderChildren = renderChildren;
  7814. // update $attrs and $listeners hash
  7815. // these are also reactive so they may trigger child update if the child
  7816. // used them during render
  7817. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7818. vm.$listeners = listeners || emptyObject;
  7819. // update props
  7820. if (propsData && vm.$options.props) {
  7821. toggleObserving(false);
  7822. var props = vm._props;
  7823. var propKeys = vm.$options._propKeys || [];
  7824. for (var i = 0; i < propKeys.length; i++) {
  7825. var key = propKeys[i];
  7826. var propOptions = vm.$options.props; // wtf flow?
  7827. props[key] = validateProp(key, propOptions, propsData, vm);
  7828. }
  7829. toggleObserving(true);
  7830. // keep a copy of raw propsData
  7831. vm.$options.propsData = propsData;
  7832. }
  7833. // fixed by xxxxxx update properties(mp runtime)
  7834. vm._$updateProperties && vm._$updateProperties(vm);
  7835. // update listeners
  7836. listeners = listeners || emptyObject;
  7837. var oldListeners = vm.$options._parentListeners;
  7838. vm.$options._parentListeners = listeners;
  7839. updateComponentListeners(vm, listeners, oldListeners);
  7840. // resolve slots + force update if has children
  7841. if (needsForceUpdate) {
  7842. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7843. vm.$forceUpdate();
  7844. }
  7845. if (true) {
  7846. isUpdatingChildComponent = false;
  7847. }
  7848. }
  7849. function isInInactiveTree (vm) {
  7850. while (vm && (vm = vm.$parent)) {
  7851. if (vm._inactive) { return true }
  7852. }
  7853. return false
  7854. }
  7855. function activateChildComponent (vm, direct) {
  7856. if (direct) {
  7857. vm._directInactive = false;
  7858. if (isInInactiveTree(vm)) {
  7859. return
  7860. }
  7861. } else if (vm._directInactive) {
  7862. return
  7863. }
  7864. if (vm._inactive || vm._inactive === null) {
  7865. vm._inactive = false;
  7866. for (var i = 0; i < vm.$children.length; i++) {
  7867. activateChildComponent(vm.$children[i]);
  7868. }
  7869. callHook(vm, 'activated');
  7870. }
  7871. }
  7872. function deactivateChildComponent (vm, direct) {
  7873. if (direct) {
  7874. vm._directInactive = true;
  7875. if (isInInactiveTree(vm)) {
  7876. return
  7877. }
  7878. }
  7879. if (!vm._inactive) {
  7880. vm._inactive = true;
  7881. for (var i = 0; i < vm.$children.length; i++) {
  7882. deactivateChildComponent(vm.$children[i]);
  7883. }
  7884. callHook(vm, 'deactivated');
  7885. }
  7886. }
  7887. function callHook (vm, hook) {
  7888. // #7573 disable dep collection when invoking lifecycle hooks
  7889. pushTarget();
  7890. var handlers = vm.$options[hook];
  7891. var info = hook + " hook";
  7892. if (handlers) {
  7893. for (var i = 0, j = handlers.length; i < j; i++) {
  7894. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7895. }
  7896. }
  7897. if (vm._hasHookEvent) {
  7898. vm.$emit('hook:' + hook);
  7899. }
  7900. popTarget();
  7901. }
  7902. /* */
  7903. var MAX_UPDATE_COUNT = 100;
  7904. var queue = [];
  7905. var activatedChildren = [];
  7906. var has = {};
  7907. var circular = {};
  7908. var waiting = false;
  7909. var flushing = false;
  7910. var index = 0;
  7911. /**
  7912. * Reset the scheduler's state.
  7913. */
  7914. function resetSchedulerState () {
  7915. index = queue.length = activatedChildren.length = 0;
  7916. has = {};
  7917. if (true) {
  7918. circular = {};
  7919. }
  7920. waiting = flushing = false;
  7921. }
  7922. // Async edge case #6566 requires saving the timestamp when event listeners are
  7923. // attached. However, calling performance.now() has a perf overhead especially
  7924. // if the page has thousands of event listeners. Instead, we take a timestamp
  7925. // every time the scheduler flushes and use that for all event listeners
  7926. // attached during that flush.
  7927. var currentFlushTimestamp = 0;
  7928. // Async edge case fix requires storing an event listener's attach timestamp.
  7929. var getNow = Date.now;
  7930. // Determine what event timestamp the browser is using. Annoyingly, the
  7931. // timestamp can either be hi-res (relative to page load) or low-res
  7932. // (relative to UNIX epoch), so in order to compare time we have to use the
  7933. // same timestamp type when saving the flush timestamp.
  7934. // All IE versions use low-res event timestamps, and have problematic clock
  7935. // implementations (#9632)
  7936. if (inBrowser && !isIE) {
  7937. var performance = window.performance;
  7938. if (
  7939. performance &&
  7940. typeof performance.now === 'function' &&
  7941. getNow() > document.createEvent('Event').timeStamp
  7942. ) {
  7943. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7944. // smaller than it, it means the event is using a hi-res timestamp,
  7945. // and we need to use the hi-res version for event listener timestamps as
  7946. // well.
  7947. getNow = function () { return performance.now(); };
  7948. }
  7949. }
  7950. /**
  7951. * Flush both queues and run the watchers.
  7952. */
  7953. function flushSchedulerQueue () {
  7954. currentFlushTimestamp = getNow();
  7955. flushing = true;
  7956. var watcher, id;
  7957. // Sort queue before flush.
  7958. // This ensures that:
  7959. // 1. Components are updated from parent to child. (because parent is always
  7960. // created before the child)
  7961. // 2. A component's user watchers are run before its render watcher (because
  7962. // user watchers are created before the render watcher)
  7963. // 3. If a component is destroyed during a parent component's watcher run,
  7964. // its watchers can be skipped.
  7965. queue.sort(function (a, b) { return a.id - b.id; });
  7966. // do not cache length because more watchers might be pushed
  7967. // as we run existing watchers
  7968. for (index = 0; index < queue.length; index++) {
  7969. watcher = queue[index];
  7970. if (watcher.before) {
  7971. watcher.before();
  7972. }
  7973. id = watcher.id;
  7974. has[id] = null;
  7975. watcher.run();
  7976. // in dev build, check and stop circular updates.
  7977. if ( true && has[id] != null) {
  7978. circular[id] = (circular[id] || 0) + 1;
  7979. if (circular[id] > MAX_UPDATE_COUNT) {
  7980. warn(
  7981. 'You may have an infinite update loop ' + (
  7982. watcher.user
  7983. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7984. : "in a component render function."
  7985. ),
  7986. watcher.vm
  7987. );
  7988. break
  7989. }
  7990. }
  7991. }
  7992. // keep copies of post queues before resetting state
  7993. var activatedQueue = activatedChildren.slice();
  7994. var updatedQueue = queue.slice();
  7995. resetSchedulerState();
  7996. // call component updated and activated hooks
  7997. callActivatedHooks(activatedQueue);
  7998. callUpdatedHooks(updatedQueue);
  7999. // devtool hook
  8000. /* istanbul ignore if */
  8001. if (devtools && config.devtools) {
  8002. devtools.emit('flush');
  8003. }
  8004. }
  8005. function callUpdatedHooks (queue) {
  8006. var i = queue.length;
  8007. while (i--) {
  8008. var watcher = queue[i];
  8009. var vm = watcher.vm;
  8010. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8011. callHook(vm, 'updated');
  8012. }
  8013. }
  8014. }
  8015. /**
  8016. * Queue a kept-alive component that was activated during patch.
  8017. * The queue will be processed after the entire tree has been patched.
  8018. */
  8019. function queueActivatedComponent (vm) {
  8020. // setting _inactive to false here so that a render function can
  8021. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8022. vm._inactive = false;
  8023. activatedChildren.push(vm);
  8024. }
  8025. function callActivatedHooks (queue) {
  8026. for (var i = 0; i < queue.length; i++) {
  8027. queue[i]._inactive = true;
  8028. activateChildComponent(queue[i], true /* true */);
  8029. }
  8030. }
  8031. /**
  8032. * Push a watcher into the watcher queue.
  8033. * Jobs with duplicate IDs will be skipped unless it's
  8034. * pushed when the queue is being flushed.
  8035. */
  8036. function queueWatcher (watcher) {
  8037. var id = watcher.id;
  8038. if (has[id] == null) {
  8039. has[id] = true;
  8040. if (!flushing) {
  8041. queue.push(watcher);
  8042. } else {
  8043. // if already flushing, splice the watcher based on its id
  8044. // if already past its id, it will be run next immediately.
  8045. var i = queue.length - 1;
  8046. while (i > index && queue[i].id > watcher.id) {
  8047. i--;
  8048. }
  8049. queue.splice(i + 1, 0, watcher);
  8050. }
  8051. // queue the flush
  8052. if (!waiting) {
  8053. waiting = true;
  8054. if ( true && !config.async) {
  8055. flushSchedulerQueue();
  8056. return
  8057. }
  8058. nextTick(flushSchedulerQueue);
  8059. }
  8060. }
  8061. }
  8062. /* */
  8063. var uid$2 = 0;
  8064. /**
  8065. * A watcher parses an expression, collects dependencies,
  8066. * and fires callback when the expression value changes.
  8067. * This is used for both the $watch() api and directives.
  8068. */
  8069. var Watcher = function Watcher (
  8070. vm,
  8071. expOrFn,
  8072. cb,
  8073. options,
  8074. isRenderWatcher
  8075. ) {
  8076. this.vm = vm;
  8077. if (isRenderWatcher) {
  8078. vm._watcher = this;
  8079. }
  8080. vm._watchers.push(this);
  8081. // options
  8082. if (options) {
  8083. this.deep = !!options.deep;
  8084. this.user = !!options.user;
  8085. this.lazy = !!options.lazy;
  8086. this.sync = !!options.sync;
  8087. this.before = options.before;
  8088. } else {
  8089. this.deep = this.user = this.lazy = this.sync = false;
  8090. }
  8091. this.cb = cb;
  8092. this.id = ++uid$2; // uid for batching
  8093. this.active = true;
  8094. this.dirty = this.lazy; // for lazy watchers
  8095. this.deps = [];
  8096. this.newDeps = [];
  8097. this.depIds = new _Set();
  8098. this.newDepIds = new _Set();
  8099. this.expression = true
  8100. ? expOrFn.toString()
  8101. : undefined;
  8102. // parse expression for getter
  8103. if (typeof expOrFn === 'function') {
  8104. this.getter = expOrFn;
  8105. } else {
  8106. this.getter = parsePath(expOrFn);
  8107. if (!this.getter) {
  8108. this.getter = noop;
  8109. true && warn(
  8110. "Failed watching path: \"" + expOrFn + "\" " +
  8111. 'Watcher only accepts simple dot-delimited paths. ' +
  8112. 'For full control, use a function instead.',
  8113. vm
  8114. );
  8115. }
  8116. }
  8117. this.value = this.lazy
  8118. ? undefined
  8119. : this.get();
  8120. };
  8121. /**
  8122. * Evaluate the getter, and re-collect dependencies.
  8123. */
  8124. Watcher.prototype.get = function get () {
  8125. pushTarget(this);
  8126. var value;
  8127. var vm = this.vm;
  8128. try {
  8129. value = this.getter.call(vm, vm);
  8130. } catch (e) {
  8131. if (this.user) {
  8132. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8133. } else {
  8134. throw e
  8135. }
  8136. } finally {
  8137. // "touch" every property so they are all tracked as
  8138. // dependencies for deep watching
  8139. if (this.deep) {
  8140. traverse(value);
  8141. }
  8142. popTarget();
  8143. this.cleanupDeps();
  8144. }
  8145. return value
  8146. };
  8147. /**
  8148. * Add a dependency to this directive.
  8149. */
  8150. Watcher.prototype.addDep = function addDep (dep) {
  8151. var id = dep.id;
  8152. if (!this.newDepIds.has(id)) {
  8153. this.newDepIds.add(id);
  8154. this.newDeps.push(dep);
  8155. if (!this.depIds.has(id)) {
  8156. dep.addSub(this);
  8157. }
  8158. }
  8159. };
  8160. /**
  8161. * Clean up for dependency collection.
  8162. */
  8163. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8164. var i = this.deps.length;
  8165. while (i--) {
  8166. var dep = this.deps[i];
  8167. if (!this.newDepIds.has(dep.id)) {
  8168. dep.removeSub(this);
  8169. }
  8170. }
  8171. var tmp = this.depIds;
  8172. this.depIds = this.newDepIds;
  8173. this.newDepIds = tmp;
  8174. this.newDepIds.clear();
  8175. tmp = this.deps;
  8176. this.deps = this.newDeps;
  8177. this.newDeps = tmp;
  8178. this.newDeps.length = 0;
  8179. };
  8180. /**
  8181. * Subscriber interface.
  8182. * Will be called when a dependency changes.
  8183. */
  8184. Watcher.prototype.update = function update () {
  8185. /* istanbul ignore else */
  8186. if (this.lazy) {
  8187. this.dirty = true;
  8188. } else if (this.sync) {
  8189. this.run();
  8190. } else {
  8191. queueWatcher(this);
  8192. }
  8193. };
  8194. /**
  8195. * Scheduler job interface.
  8196. * Will be called by the scheduler.
  8197. */
  8198. Watcher.prototype.run = function run () {
  8199. if (this.active) {
  8200. var value = this.get();
  8201. if (
  8202. value !== this.value ||
  8203. // Deep watchers and watchers on Object/Arrays should fire even
  8204. // when the value is the same, because the value may
  8205. // have mutated.
  8206. isObject(value) ||
  8207. this.deep
  8208. ) {
  8209. // set new value
  8210. var oldValue = this.value;
  8211. this.value = value;
  8212. if (this.user) {
  8213. try {
  8214. this.cb.call(this.vm, value, oldValue);
  8215. } catch (e) {
  8216. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8217. }
  8218. } else {
  8219. this.cb.call(this.vm, value, oldValue);
  8220. }
  8221. }
  8222. }
  8223. };
  8224. /**
  8225. * Evaluate the value of the watcher.
  8226. * This only gets called for lazy watchers.
  8227. */
  8228. Watcher.prototype.evaluate = function evaluate () {
  8229. this.value = this.get();
  8230. this.dirty = false;
  8231. };
  8232. /**
  8233. * Depend on all deps collected by this watcher.
  8234. */
  8235. Watcher.prototype.depend = function depend () {
  8236. var i = this.deps.length;
  8237. while (i--) {
  8238. this.deps[i].depend();
  8239. }
  8240. };
  8241. /**
  8242. * Remove self from all dependencies' subscriber list.
  8243. */
  8244. Watcher.prototype.teardown = function teardown () {
  8245. if (this.active) {
  8246. // remove self from vm's watcher list
  8247. // this is a somewhat expensive operation so we skip it
  8248. // if the vm is being destroyed.
  8249. if (!this.vm._isBeingDestroyed) {
  8250. remove(this.vm._watchers, this);
  8251. }
  8252. var i = this.deps.length;
  8253. while (i--) {
  8254. this.deps[i].removeSub(this);
  8255. }
  8256. this.active = false;
  8257. }
  8258. };
  8259. /* */
  8260. var sharedPropertyDefinition = {
  8261. enumerable: true,
  8262. configurable: true,
  8263. get: noop,
  8264. set: noop
  8265. };
  8266. function proxy (target, sourceKey, key) {
  8267. sharedPropertyDefinition.get = function proxyGetter () {
  8268. return this[sourceKey][key]
  8269. };
  8270. sharedPropertyDefinition.set = function proxySetter (val) {
  8271. this[sourceKey][key] = val;
  8272. };
  8273. Object.defineProperty(target, key, sharedPropertyDefinition);
  8274. }
  8275. function initState (vm) {
  8276. vm._watchers = [];
  8277. var opts = vm.$options;
  8278. if (opts.props) { initProps(vm, opts.props); }
  8279. if (opts.methods) { initMethods(vm, opts.methods); }
  8280. if (opts.data) {
  8281. initData(vm);
  8282. } else {
  8283. observe(vm._data = {}, true /* asRootData */);
  8284. }
  8285. if (opts.computed) { initComputed(vm, opts.computed); }
  8286. if (opts.watch && opts.watch !== nativeWatch) {
  8287. initWatch(vm, opts.watch);
  8288. }
  8289. }
  8290. function initProps (vm, propsOptions) {
  8291. var propsData = vm.$options.propsData || {};
  8292. var props = vm._props = {};
  8293. // cache prop keys so that future props updates can iterate using Array
  8294. // instead of dynamic object key enumeration.
  8295. var keys = vm.$options._propKeys = [];
  8296. var isRoot = !vm.$parent;
  8297. // root instance props should be converted
  8298. if (!isRoot) {
  8299. toggleObserving(false);
  8300. }
  8301. var loop = function ( key ) {
  8302. keys.push(key);
  8303. var value = validateProp(key, propsOptions, propsData, vm);
  8304. /* istanbul ignore else */
  8305. if (true) {
  8306. var hyphenatedKey = hyphenate(key);
  8307. if (isReservedAttribute(hyphenatedKey) ||
  8308. config.isReservedAttr(hyphenatedKey)) {
  8309. warn(
  8310. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8311. vm
  8312. );
  8313. }
  8314. defineReactive$$1(props, key, value, function () {
  8315. if (!isRoot && !isUpdatingChildComponent) {
  8316. {
  8317. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  8318. return
  8319. }
  8320. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8321. if(
  8322. key === 'value' &&
  8323. Array.isArray(vm.$options.behaviors) &&
  8324. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8325. ){
  8326. return
  8327. }
  8328. if(vm._getFormData){
  8329. return
  8330. }
  8331. var $parent = vm.$parent;
  8332. while($parent){
  8333. if($parent.__next_tick_pending){
  8334. return
  8335. }
  8336. $parent = $parent.$parent;
  8337. }
  8338. }
  8339. warn(
  8340. "Avoid mutating a prop directly since the value will be " +
  8341. "overwritten whenever the parent component re-renders. " +
  8342. "Instead, use a data or computed property based on the prop's " +
  8343. "value. Prop being mutated: \"" + key + "\"",
  8344. vm
  8345. );
  8346. }
  8347. });
  8348. } else {}
  8349. // static props are already proxied on the component's prototype
  8350. // during Vue.extend(). We only need to proxy props defined at
  8351. // instantiation here.
  8352. if (!(key in vm)) {
  8353. proxy(vm, "_props", key);
  8354. }
  8355. };
  8356. for (var key in propsOptions) loop( key );
  8357. toggleObserving(true);
  8358. }
  8359. function initData (vm) {
  8360. var data = vm.$options.data;
  8361. data = vm._data = typeof data === 'function'
  8362. ? getData(data, vm)
  8363. : data || {};
  8364. if (!isPlainObject(data)) {
  8365. data = {};
  8366. true && warn(
  8367. 'data functions should return an object:\n' +
  8368. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8369. vm
  8370. );
  8371. }
  8372. // proxy data on instance
  8373. var keys = Object.keys(data);
  8374. var props = vm.$options.props;
  8375. var methods = vm.$options.methods;
  8376. var i = keys.length;
  8377. while (i--) {
  8378. var key = keys[i];
  8379. if (true) {
  8380. if (methods && hasOwn(methods, key)) {
  8381. warn(
  8382. ("Method \"" + key + "\" has already been defined as a data property."),
  8383. vm
  8384. );
  8385. }
  8386. }
  8387. if (props && hasOwn(props, key)) {
  8388. true && warn(
  8389. "The data property \"" + key + "\" is already declared as a prop. " +
  8390. "Use prop default value instead.",
  8391. vm
  8392. );
  8393. } else if (!isReserved(key)) {
  8394. proxy(vm, "_data", key);
  8395. }
  8396. }
  8397. // observe data
  8398. observe(data, true /* asRootData */);
  8399. }
  8400. function getData (data, vm) {
  8401. // #7573 disable dep collection when invoking data getters
  8402. pushTarget();
  8403. try {
  8404. return data.call(vm, vm)
  8405. } catch (e) {
  8406. handleError(e, vm, "data()");
  8407. return {}
  8408. } finally {
  8409. popTarget();
  8410. }
  8411. }
  8412. var computedWatcherOptions = { lazy: true };
  8413. function initComputed (vm, computed) {
  8414. // $flow-disable-line
  8415. var watchers = vm._computedWatchers = Object.create(null);
  8416. // computed properties are just getters during SSR
  8417. var isSSR = isServerRendering();
  8418. for (var key in computed) {
  8419. var userDef = computed[key];
  8420. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8421. if ( true && getter == null) {
  8422. warn(
  8423. ("Getter is missing for computed property \"" + key + "\"."),
  8424. vm
  8425. );
  8426. }
  8427. if (!isSSR) {
  8428. // create internal watcher for the computed property.
  8429. watchers[key] = new Watcher(
  8430. vm,
  8431. getter || noop,
  8432. noop,
  8433. computedWatcherOptions
  8434. );
  8435. }
  8436. // component-defined computed properties are already defined on the
  8437. // component prototype. We only need to define computed properties defined
  8438. // at instantiation here.
  8439. if (!(key in vm)) {
  8440. defineComputed(vm, key, userDef);
  8441. } else if (true) {
  8442. if (key in vm.$data) {
  8443. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8444. } else if (vm.$options.props && key in vm.$options.props) {
  8445. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8446. }
  8447. }
  8448. }
  8449. }
  8450. function defineComputed (
  8451. target,
  8452. key,
  8453. userDef
  8454. ) {
  8455. var shouldCache = !isServerRendering();
  8456. if (typeof userDef === 'function') {
  8457. sharedPropertyDefinition.get = shouldCache
  8458. ? createComputedGetter(key)
  8459. : createGetterInvoker(userDef);
  8460. sharedPropertyDefinition.set = noop;
  8461. } else {
  8462. sharedPropertyDefinition.get = userDef.get
  8463. ? shouldCache && userDef.cache !== false
  8464. ? createComputedGetter(key)
  8465. : createGetterInvoker(userDef.get)
  8466. : noop;
  8467. sharedPropertyDefinition.set = userDef.set || noop;
  8468. }
  8469. if ( true &&
  8470. sharedPropertyDefinition.set === noop) {
  8471. sharedPropertyDefinition.set = function () {
  8472. warn(
  8473. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8474. this
  8475. );
  8476. };
  8477. }
  8478. Object.defineProperty(target, key, sharedPropertyDefinition);
  8479. }
  8480. function createComputedGetter (key) {
  8481. return function computedGetter () {
  8482. var watcher = this._computedWatchers && this._computedWatchers[key];
  8483. if (watcher) {
  8484. if (watcher.dirty) {
  8485. watcher.evaluate();
  8486. }
  8487. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8488. watcher.depend();
  8489. }
  8490. return watcher.value
  8491. }
  8492. }
  8493. }
  8494. function createGetterInvoker(fn) {
  8495. return function computedGetter () {
  8496. return fn.call(this, this)
  8497. }
  8498. }
  8499. function initMethods (vm, methods) {
  8500. var props = vm.$options.props;
  8501. for (var key in methods) {
  8502. if (true) {
  8503. if (typeof methods[key] !== 'function') {
  8504. warn(
  8505. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8506. "Did you reference the function correctly?",
  8507. vm
  8508. );
  8509. }
  8510. if (props && hasOwn(props, key)) {
  8511. warn(
  8512. ("Method \"" + key + "\" has already been defined as a prop."),
  8513. vm
  8514. );
  8515. }
  8516. if ((key in vm) && isReserved(key)) {
  8517. warn(
  8518. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8519. "Avoid defining component methods that start with _ or $."
  8520. );
  8521. }
  8522. }
  8523. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8524. }
  8525. }
  8526. function initWatch (vm, watch) {
  8527. for (var key in watch) {
  8528. var handler = watch[key];
  8529. if (Array.isArray(handler)) {
  8530. for (var i = 0; i < handler.length; i++) {
  8531. createWatcher(vm, key, handler[i]);
  8532. }
  8533. } else {
  8534. createWatcher(vm, key, handler);
  8535. }
  8536. }
  8537. }
  8538. function createWatcher (
  8539. vm,
  8540. expOrFn,
  8541. handler,
  8542. options
  8543. ) {
  8544. if (isPlainObject(handler)) {
  8545. options = handler;
  8546. handler = handler.handler;
  8547. }
  8548. if (typeof handler === 'string') {
  8549. handler = vm[handler];
  8550. }
  8551. return vm.$watch(expOrFn, handler, options)
  8552. }
  8553. function stateMixin (Vue) {
  8554. // flow somehow has problems with directly declared definition object
  8555. // when using Object.defineProperty, so we have to procedurally build up
  8556. // the object here.
  8557. var dataDef = {};
  8558. dataDef.get = function () { return this._data };
  8559. var propsDef = {};
  8560. propsDef.get = function () { return this._props };
  8561. if (true) {
  8562. dataDef.set = function () {
  8563. warn(
  8564. 'Avoid replacing instance root $data. ' +
  8565. 'Use nested data properties instead.',
  8566. this
  8567. );
  8568. };
  8569. propsDef.set = function () {
  8570. warn("$props is readonly.", this);
  8571. };
  8572. }
  8573. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8574. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8575. Vue.prototype.$set = set;
  8576. Vue.prototype.$delete = del;
  8577. Vue.prototype.$watch = function (
  8578. expOrFn,
  8579. cb,
  8580. options
  8581. ) {
  8582. var vm = this;
  8583. if (isPlainObject(cb)) {
  8584. return createWatcher(vm, expOrFn, cb, options)
  8585. }
  8586. options = options || {};
  8587. options.user = true;
  8588. var watcher = new Watcher(vm, expOrFn, cb, options);
  8589. if (options.immediate) {
  8590. try {
  8591. cb.call(vm, watcher.value);
  8592. } catch (error) {
  8593. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8594. }
  8595. }
  8596. return function unwatchFn () {
  8597. watcher.teardown();
  8598. }
  8599. };
  8600. }
  8601. /* */
  8602. var uid$3 = 0;
  8603. function initMixin (Vue) {
  8604. Vue.prototype._init = function (options) {
  8605. var vm = this;
  8606. // a uid
  8607. vm._uid = uid$3++;
  8608. var startTag, endTag;
  8609. /* istanbul ignore if */
  8610. if ( true && config.performance && mark) {
  8611. startTag = "vue-perf-start:" + (vm._uid);
  8612. endTag = "vue-perf-end:" + (vm._uid);
  8613. mark(startTag);
  8614. }
  8615. // a flag to avoid this being observed
  8616. vm._isVue = true;
  8617. // merge options
  8618. if (options && options._isComponent) {
  8619. // optimize internal component instantiation
  8620. // since dynamic options merging is pretty slow, and none of the
  8621. // internal component options needs special treatment.
  8622. initInternalComponent(vm, options);
  8623. } else {
  8624. vm.$options = mergeOptions(
  8625. resolveConstructorOptions(vm.constructor),
  8626. options || {},
  8627. vm
  8628. );
  8629. }
  8630. /* istanbul ignore else */
  8631. if (true) {
  8632. initProxy(vm);
  8633. } else {}
  8634. // expose real self
  8635. vm._self = vm;
  8636. initLifecycle(vm);
  8637. initEvents(vm);
  8638. initRender(vm);
  8639. callHook(vm, 'beforeCreate');
  8640. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8641. initState(vm);
  8642. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8643. !vm._$fallback && callHook(vm, 'created');
  8644. /* istanbul ignore if */
  8645. if ( true && config.performance && mark) {
  8646. vm._name = formatComponentName(vm, false);
  8647. mark(endTag);
  8648. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8649. }
  8650. if (vm.$options.el) {
  8651. vm.$mount(vm.$options.el);
  8652. }
  8653. };
  8654. }
  8655. function initInternalComponent (vm, options) {
  8656. var opts = vm.$options = Object.create(vm.constructor.options);
  8657. // doing this because it's faster than dynamic enumeration.
  8658. var parentVnode = options._parentVnode;
  8659. opts.parent = options.parent;
  8660. opts._parentVnode = parentVnode;
  8661. var vnodeComponentOptions = parentVnode.componentOptions;
  8662. opts.propsData = vnodeComponentOptions.propsData;
  8663. opts._parentListeners = vnodeComponentOptions.listeners;
  8664. opts._renderChildren = vnodeComponentOptions.children;
  8665. opts._componentTag = vnodeComponentOptions.tag;
  8666. if (options.render) {
  8667. opts.render = options.render;
  8668. opts.staticRenderFns = options.staticRenderFns;
  8669. }
  8670. }
  8671. function resolveConstructorOptions (Ctor) {
  8672. var options = Ctor.options;
  8673. if (Ctor.super) {
  8674. var superOptions = resolveConstructorOptions(Ctor.super);
  8675. var cachedSuperOptions = Ctor.superOptions;
  8676. if (superOptions !== cachedSuperOptions) {
  8677. // super option changed,
  8678. // need to resolve new options.
  8679. Ctor.superOptions = superOptions;
  8680. // check if there are any late-modified/attached options (#4976)
  8681. var modifiedOptions = resolveModifiedOptions(Ctor);
  8682. // update base extend options
  8683. if (modifiedOptions) {
  8684. extend(Ctor.extendOptions, modifiedOptions);
  8685. }
  8686. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8687. if (options.name) {
  8688. options.components[options.name] = Ctor;
  8689. }
  8690. }
  8691. }
  8692. return options
  8693. }
  8694. function resolveModifiedOptions (Ctor) {
  8695. var modified;
  8696. var latest = Ctor.options;
  8697. var sealed = Ctor.sealedOptions;
  8698. for (var key in latest) {
  8699. if (latest[key] !== sealed[key]) {
  8700. if (!modified) { modified = {}; }
  8701. modified[key] = latest[key];
  8702. }
  8703. }
  8704. return modified
  8705. }
  8706. function Vue (options) {
  8707. if ( true &&
  8708. !(this instanceof Vue)
  8709. ) {
  8710. warn('Vue is a constructor and should be called with the `new` keyword');
  8711. }
  8712. this._init(options);
  8713. }
  8714. initMixin(Vue);
  8715. stateMixin(Vue);
  8716. eventsMixin(Vue);
  8717. lifecycleMixin(Vue);
  8718. renderMixin(Vue);
  8719. /* */
  8720. function initUse (Vue) {
  8721. Vue.use = function (plugin) {
  8722. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8723. if (installedPlugins.indexOf(plugin) > -1) {
  8724. return this
  8725. }
  8726. // additional parameters
  8727. var args = toArray(arguments, 1);
  8728. args.unshift(this);
  8729. if (typeof plugin.install === 'function') {
  8730. plugin.install.apply(plugin, args);
  8731. } else if (typeof plugin === 'function') {
  8732. plugin.apply(null, args);
  8733. }
  8734. installedPlugins.push(plugin);
  8735. return this
  8736. };
  8737. }
  8738. /* */
  8739. function initMixin$1 (Vue) {
  8740. Vue.mixin = function (mixin) {
  8741. this.options = mergeOptions(this.options, mixin);
  8742. return this
  8743. };
  8744. }
  8745. /* */
  8746. function initExtend (Vue) {
  8747. /**
  8748. * Each instance constructor, including Vue, has a unique
  8749. * cid. This enables us to create wrapped "child
  8750. * constructors" for prototypal inheritance and cache them.
  8751. */
  8752. Vue.cid = 0;
  8753. var cid = 1;
  8754. /**
  8755. * Class inheritance
  8756. */
  8757. Vue.extend = function (extendOptions) {
  8758. extendOptions = extendOptions || {};
  8759. var Super = this;
  8760. var SuperId = Super.cid;
  8761. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8762. if (cachedCtors[SuperId]) {
  8763. return cachedCtors[SuperId]
  8764. }
  8765. var name = extendOptions.name || Super.options.name;
  8766. if ( true && name) {
  8767. validateComponentName(name);
  8768. }
  8769. var Sub = function VueComponent (options) {
  8770. this._init(options);
  8771. };
  8772. Sub.prototype = Object.create(Super.prototype);
  8773. Sub.prototype.constructor = Sub;
  8774. Sub.cid = cid++;
  8775. Sub.options = mergeOptions(
  8776. Super.options,
  8777. extendOptions
  8778. );
  8779. Sub['super'] = Super;
  8780. // For props and computed properties, we define the proxy getters on
  8781. // the Vue instances at extension time, on the extended prototype. This
  8782. // avoids Object.defineProperty calls for each instance created.
  8783. if (Sub.options.props) {
  8784. initProps$1(Sub);
  8785. }
  8786. if (Sub.options.computed) {
  8787. initComputed$1(Sub);
  8788. }
  8789. // allow further extension/mixin/plugin usage
  8790. Sub.extend = Super.extend;
  8791. Sub.mixin = Super.mixin;
  8792. Sub.use = Super.use;
  8793. // create asset registers, so extended classes
  8794. // can have their private assets too.
  8795. ASSET_TYPES.forEach(function (type) {
  8796. Sub[type] = Super[type];
  8797. });
  8798. // enable recursive self-lookup
  8799. if (name) {
  8800. Sub.options.components[name] = Sub;
  8801. }
  8802. // keep a reference to the super options at extension time.
  8803. // later at instantiation we can check if Super's options have
  8804. // been updated.
  8805. Sub.superOptions = Super.options;
  8806. Sub.extendOptions = extendOptions;
  8807. Sub.sealedOptions = extend({}, Sub.options);
  8808. // cache constructor
  8809. cachedCtors[SuperId] = Sub;
  8810. return Sub
  8811. };
  8812. }
  8813. function initProps$1 (Comp) {
  8814. var props = Comp.options.props;
  8815. for (var key in props) {
  8816. proxy(Comp.prototype, "_props", key);
  8817. }
  8818. }
  8819. function initComputed$1 (Comp) {
  8820. var computed = Comp.options.computed;
  8821. for (var key in computed) {
  8822. defineComputed(Comp.prototype, key, computed[key]);
  8823. }
  8824. }
  8825. /* */
  8826. function initAssetRegisters (Vue) {
  8827. /**
  8828. * Create asset registration methods.
  8829. */
  8830. ASSET_TYPES.forEach(function (type) {
  8831. Vue[type] = function (
  8832. id,
  8833. definition
  8834. ) {
  8835. if (!definition) {
  8836. return this.options[type + 's'][id]
  8837. } else {
  8838. /* istanbul ignore if */
  8839. if ( true && type === 'component') {
  8840. validateComponentName(id);
  8841. }
  8842. if (type === 'component' && isPlainObject(definition)) {
  8843. definition.name = definition.name || id;
  8844. definition = this.options._base.extend(definition);
  8845. }
  8846. if (type === 'directive' && typeof definition === 'function') {
  8847. definition = { bind: definition, update: definition };
  8848. }
  8849. this.options[type + 's'][id] = definition;
  8850. return definition
  8851. }
  8852. };
  8853. });
  8854. }
  8855. /* */
  8856. function getComponentName (opts) {
  8857. return opts && (opts.Ctor.options.name || opts.tag)
  8858. }
  8859. function matches (pattern, name) {
  8860. if (Array.isArray(pattern)) {
  8861. return pattern.indexOf(name) > -1
  8862. } else if (typeof pattern === 'string') {
  8863. return pattern.split(',').indexOf(name) > -1
  8864. } else if (isRegExp(pattern)) {
  8865. return pattern.test(name)
  8866. }
  8867. /* istanbul ignore next */
  8868. return false
  8869. }
  8870. function pruneCache (keepAliveInstance, filter) {
  8871. var cache = keepAliveInstance.cache;
  8872. var keys = keepAliveInstance.keys;
  8873. var _vnode = keepAliveInstance._vnode;
  8874. for (var key in cache) {
  8875. var cachedNode = cache[key];
  8876. if (cachedNode) {
  8877. var name = getComponentName(cachedNode.componentOptions);
  8878. if (name && !filter(name)) {
  8879. pruneCacheEntry(cache, key, keys, _vnode);
  8880. }
  8881. }
  8882. }
  8883. }
  8884. function pruneCacheEntry (
  8885. cache,
  8886. key,
  8887. keys,
  8888. current
  8889. ) {
  8890. var cached$$1 = cache[key];
  8891. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8892. cached$$1.componentInstance.$destroy();
  8893. }
  8894. cache[key] = null;
  8895. remove(keys, key);
  8896. }
  8897. var patternTypes = [String, RegExp, Array];
  8898. var KeepAlive = {
  8899. name: 'keep-alive',
  8900. abstract: true,
  8901. props: {
  8902. include: patternTypes,
  8903. exclude: patternTypes,
  8904. max: [String, Number]
  8905. },
  8906. created: function created () {
  8907. this.cache = Object.create(null);
  8908. this.keys = [];
  8909. },
  8910. destroyed: function destroyed () {
  8911. for (var key in this.cache) {
  8912. pruneCacheEntry(this.cache, key, this.keys);
  8913. }
  8914. },
  8915. mounted: function mounted () {
  8916. var this$1 = this;
  8917. this.$watch('include', function (val) {
  8918. pruneCache(this$1, function (name) { return matches(val, name); });
  8919. });
  8920. this.$watch('exclude', function (val) {
  8921. pruneCache(this$1, function (name) { return !matches(val, name); });
  8922. });
  8923. },
  8924. render: function render () {
  8925. var slot = this.$slots.default;
  8926. var vnode = getFirstComponentChild(slot);
  8927. var componentOptions = vnode && vnode.componentOptions;
  8928. if (componentOptions) {
  8929. // check pattern
  8930. var name = getComponentName(componentOptions);
  8931. var ref = this;
  8932. var include = ref.include;
  8933. var exclude = ref.exclude;
  8934. if (
  8935. // not included
  8936. (include && (!name || !matches(include, name))) ||
  8937. // excluded
  8938. (exclude && name && matches(exclude, name))
  8939. ) {
  8940. return vnode
  8941. }
  8942. var ref$1 = this;
  8943. var cache = ref$1.cache;
  8944. var keys = ref$1.keys;
  8945. var key = vnode.key == null
  8946. // same constructor may get registered as different local components
  8947. // so cid alone is not enough (#3269)
  8948. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8949. : vnode.key;
  8950. if (cache[key]) {
  8951. vnode.componentInstance = cache[key].componentInstance;
  8952. // make current key freshest
  8953. remove(keys, key);
  8954. keys.push(key);
  8955. } else {
  8956. cache[key] = vnode;
  8957. keys.push(key);
  8958. // prune oldest entry
  8959. if (this.max && keys.length > parseInt(this.max)) {
  8960. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8961. }
  8962. }
  8963. vnode.data.keepAlive = true;
  8964. }
  8965. return vnode || (slot && slot[0])
  8966. }
  8967. };
  8968. var builtInComponents = {
  8969. KeepAlive: KeepAlive
  8970. };
  8971. /* */
  8972. function initGlobalAPI (Vue) {
  8973. // config
  8974. var configDef = {};
  8975. configDef.get = function () { return config; };
  8976. if (true) {
  8977. configDef.set = function () {
  8978. warn(
  8979. 'Do not replace the Vue.config object, set individual fields instead.'
  8980. );
  8981. };
  8982. }
  8983. Object.defineProperty(Vue, 'config', configDef);
  8984. // exposed util methods.
  8985. // NOTE: these are not considered part of the public API - avoid relying on
  8986. // them unless you are aware of the risk.
  8987. Vue.util = {
  8988. warn: warn,
  8989. extend: extend,
  8990. mergeOptions: mergeOptions,
  8991. defineReactive: defineReactive$$1
  8992. };
  8993. Vue.set = set;
  8994. Vue.delete = del;
  8995. Vue.nextTick = nextTick;
  8996. // 2.6 explicit observable API
  8997. Vue.observable = function (obj) {
  8998. observe(obj);
  8999. return obj
  9000. };
  9001. Vue.options = Object.create(null);
  9002. ASSET_TYPES.forEach(function (type) {
  9003. Vue.options[type + 's'] = Object.create(null);
  9004. });
  9005. // this is used to identify the "base" constructor to extend all plain-object
  9006. // components with in Weex's multi-instance scenarios.
  9007. Vue.options._base = Vue;
  9008. extend(Vue.options.components, builtInComponents);
  9009. initUse(Vue);
  9010. initMixin$1(Vue);
  9011. initExtend(Vue);
  9012. initAssetRegisters(Vue);
  9013. }
  9014. initGlobalAPI(Vue);
  9015. Object.defineProperty(Vue.prototype, '$isServer', {
  9016. get: isServerRendering
  9017. });
  9018. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9019. get: function get () {
  9020. /* istanbul ignore next */
  9021. return this.$vnode && this.$vnode.ssrContext
  9022. }
  9023. });
  9024. // expose FunctionalRenderContext for ssr runtime helper installation
  9025. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9026. value: FunctionalRenderContext
  9027. });
  9028. Vue.version = '2.6.11';
  9029. /**
  9030. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9031. */
  9032. var ARRAYTYPE = '[object Array]';
  9033. var OBJECTTYPE = '[object Object]';
  9034. var NULLTYPE = '[object Null]';
  9035. var UNDEFINEDTYPE = '[object Undefined]';
  9036. // const FUNCTIONTYPE = '[object Function]'
  9037. function diff(current, pre) {
  9038. var result = {};
  9039. syncKeys(current, pre);
  9040. _diff(current, pre, '', result);
  9041. return result
  9042. }
  9043. function syncKeys(current, pre) {
  9044. if (current === pre) { return }
  9045. var rootCurrentType = type(current);
  9046. var rootPreType = type(pre);
  9047. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9048. if(Object.keys(current).length >= Object.keys(pre).length){
  9049. for (var key in pre) {
  9050. var currentValue = current[key];
  9051. if (currentValue === undefined) {
  9052. current[key] = null;
  9053. } else {
  9054. syncKeys(currentValue, pre[key]);
  9055. }
  9056. }
  9057. }
  9058. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9059. if (current.length >= pre.length) {
  9060. pre.forEach(function (item, index) {
  9061. syncKeys(current[index], item);
  9062. });
  9063. }
  9064. }
  9065. }
  9066. function nullOrUndefined(currentType, preType) {
  9067. if(
  9068. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  9069. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  9070. ) {
  9071. return false
  9072. }
  9073. return true
  9074. }
  9075. function _diff(current, pre, path, result) {
  9076. if (current === pre) { return }
  9077. var rootCurrentType = type(current);
  9078. var rootPreType = type(pre);
  9079. if (rootCurrentType == OBJECTTYPE) {
  9080. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9081. setResult(result, path, current);
  9082. } else {
  9083. var loop = function ( key ) {
  9084. var currentValue = current[key];
  9085. var preValue = pre[key];
  9086. var currentType = type(currentValue);
  9087. var preType = type(preValue);
  9088. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9089. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  9090. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9091. }
  9092. } else if (currentType == ARRAYTYPE) {
  9093. if (preType != ARRAYTYPE) {
  9094. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9095. } else {
  9096. if (currentValue.length < preValue.length) {
  9097. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9098. } else {
  9099. currentValue.forEach(function (item, index) {
  9100. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9101. });
  9102. }
  9103. }
  9104. } else if (currentType == OBJECTTYPE) {
  9105. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9106. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9107. } else {
  9108. for (var subKey in currentValue) {
  9109. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9110. }
  9111. }
  9112. }
  9113. };
  9114. for (var key in current) loop( key );
  9115. }
  9116. } else if (rootCurrentType == ARRAYTYPE) {
  9117. if (rootPreType != ARRAYTYPE) {
  9118. setResult(result, path, current);
  9119. } else {
  9120. if (current.length < pre.length) {
  9121. setResult(result, path, current);
  9122. } else {
  9123. current.forEach(function (item, index) {
  9124. _diff(item, pre[index], path + '[' + index + ']', result);
  9125. });
  9126. }
  9127. }
  9128. } else {
  9129. setResult(result, path, current);
  9130. }
  9131. }
  9132. function setResult(result, k, v) {
  9133. // if (type(v) != FUNCTIONTYPE) {
  9134. result[k] = v;
  9135. // }
  9136. }
  9137. function type(obj) {
  9138. return Object.prototype.toString.call(obj)
  9139. }
  9140. /* */
  9141. function flushCallbacks$1(vm) {
  9142. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9143. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9144. var mpInstance = vm.$scope;
  9145. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9146. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9147. }
  9148. var copies = vm.__next_tick_callbacks.slice(0);
  9149. vm.__next_tick_callbacks.length = 0;
  9150. for (var i = 0; i < copies.length; i++) {
  9151. copies[i]();
  9152. }
  9153. }
  9154. }
  9155. function hasRenderWatcher(vm) {
  9156. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9157. }
  9158. function nextTick$1(vm, cb) {
  9159. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9160. //2.nextTick 之前存在 render watcher
  9161. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9162. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9163. var mpInstance = vm.$scope;
  9164. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9165. ']:nextVueTick');
  9166. }
  9167. return nextTick(cb, vm)
  9168. }else{
  9169. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9170. var mpInstance$1 = vm.$scope;
  9171. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9172. ']:nextMPTick');
  9173. }
  9174. }
  9175. var _resolve;
  9176. if (!vm.__next_tick_callbacks) {
  9177. vm.__next_tick_callbacks = [];
  9178. }
  9179. vm.__next_tick_callbacks.push(function () {
  9180. if (cb) {
  9181. try {
  9182. cb.call(vm);
  9183. } catch (e) {
  9184. handleError(e, vm, 'nextTick');
  9185. }
  9186. } else if (_resolve) {
  9187. _resolve(vm);
  9188. }
  9189. });
  9190. // $flow-disable-line
  9191. if (!cb && typeof Promise !== 'undefined') {
  9192. return new Promise(function (resolve) {
  9193. _resolve = resolve;
  9194. })
  9195. }
  9196. }
  9197. /* */
  9198. function clearInstance(key, value) {
  9199. // 简易去除 Vue 和小程序组件实例
  9200. if (value) {
  9201. if (value._isVue || value.__v_isMPComponent) {
  9202. return {}
  9203. }
  9204. }
  9205. return value
  9206. }
  9207. function cloneWithData(vm) {
  9208. // 确保当前 vm 所有数据被同步
  9209. var ret = Object.create(null);
  9210. var dataKeys = [].concat(
  9211. Object.keys(vm._data || {}),
  9212. Object.keys(vm._computedWatchers || {}));
  9213. dataKeys.reduce(function(ret, key) {
  9214. ret[key] = vm[key];
  9215. return ret
  9216. }, ret);
  9217. // vue-composition-api
  9218. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9219. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9220. if (rawBindings) {
  9221. Object.keys(rawBindings).forEach(function (key) {
  9222. ret[key] = vm[key];
  9223. });
  9224. }
  9225. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9226. Object.assign(ret, vm.$mp.data || {});
  9227. if (
  9228. Array.isArray(vm.$options.behaviors) &&
  9229. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9230. ) { //form-field
  9231. ret['name'] = vm.name;
  9232. ret['value'] = vm.value;
  9233. }
  9234. return JSON.parse(JSON.stringify(ret, clearInstance))
  9235. }
  9236. var patch = function(oldVnode, vnode) {
  9237. var this$1 = this;
  9238. if (vnode === null) { //destroy
  9239. return
  9240. }
  9241. if (this.mpType === 'page' || this.mpType === 'component') {
  9242. var mpInstance = this.$scope;
  9243. var data = Object.create(null);
  9244. try {
  9245. data = cloneWithData(this);
  9246. } catch (err) {
  9247. console.error(err);
  9248. }
  9249. data.__webviewId__ = mpInstance.data.__webviewId__;
  9250. var mpData = Object.create(null);
  9251. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9252. mpData[key] = mpInstance.data[key];
  9253. });
  9254. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9255. if (Object.keys(diffData).length) {
  9256. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9257. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9258. ']差量更新',
  9259. JSON.stringify(diffData));
  9260. }
  9261. this.__next_tick_pending = true;
  9262. mpInstance.setData(diffData, function () {
  9263. this$1.__next_tick_pending = false;
  9264. flushCallbacks$1(this$1);
  9265. });
  9266. } else {
  9267. flushCallbacks$1(this);
  9268. }
  9269. }
  9270. };
  9271. /* */
  9272. function createEmptyRender() {
  9273. }
  9274. function mountComponent$1(
  9275. vm,
  9276. el,
  9277. hydrating
  9278. ) {
  9279. if (!vm.mpType) {//main.js 中的 new Vue
  9280. return vm
  9281. }
  9282. if (vm.mpType === 'app') {
  9283. vm.$options.render = createEmptyRender;
  9284. }
  9285. if (!vm.$options.render) {
  9286. vm.$options.render = createEmptyRender;
  9287. if (true) {
  9288. /* istanbul ignore if */
  9289. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9290. vm.$options.el || el) {
  9291. warn(
  9292. 'You are using the runtime-only build of Vue where the template ' +
  9293. 'compiler is not available. Either pre-compile the templates into ' +
  9294. 'render functions, or use the compiler-included build.',
  9295. vm
  9296. );
  9297. } else {
  9298. warn(
  9299. 'Failed to mount component: template or render function not defined.',
  9300. vm
  9301. );
  9302. }
  9303. }
  9304. }
  9305. !vm._$fallback && callHook(vm, 'beforeMount');
  9306. var updateComponent = function () {
  9307. vm._update(vm._render(), hydrating);
  9308. };
  9309. // we set this to vm._watcher inside the watcher's constructor
  9310. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9311. // component's mounted hook), which relies on vm._watcher being already defined
  9312. new Watcher(vm, updateComponent, noop, {
  9313. before: function before() {
  9314. if (vm._isMounted && !vm._isDestroyed) {
  9315. callHook(vm, 'beforeUpdate');
  9316. }
  9317. }
  9318. }, true /* isRenderWatcher */);
  9319. hydrating = false;
  9320. return vm
  9321. }
  9322. /* */
  9323. function renderClass (
  9324. staticClass,
  9325. dynamicClass
  9326. ) {
  9327. if (isDef(staticClass) || isDef(dynamicClass)) {
  9328. return concat(staticClass, stringifyClass(dynamicClass))
  9329. }
  9330. /* istanbul ignore next */
  9331. return ''
  9332. }
  9333. function concat (a, b) {
  9334. return a ? b ? (a + ' ' + b) : a : (b || '')
  9335. }
  9336. function stringifyClass (value) {
  9337. if (Array.isArray(value)) {
  9338. return stringifyArray(value)
  9339. }
  9340. if (isObject(value)) {
  9341. return stringifyObject(value)
  9342. }
  9343. if (typeof value === 'string') {
  9344. return value
  9345. }
  9346. /* istanbul ignore next */
  9347. return ''
  9348. }
  9349. function stringifyArray (value) {
  9350. var res = '';
  9351. var stringified;
  9352. for (var i = 0, l = value.length; i < l; i++) {
  9353. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9354. if (res) { res += ' '; }
  9355. res += stringified;
  9356. }
  9357. }
  9358. return res
  9359. }
  9360. function stringifyObject (value) {
  9361. var res = '';
  9362. for (var key in value) {
  9363. if (value[key]) {
  9364. if (res) { res += ' '; }
  9365. res += key;
  9366. }
  9367. }
  9368. return res
  9369. }
  9370. /* */
  9371. var parseStyleText = cached(function (cssText) {
  9372. var res = {};
  9373. var listDelimiter = /;(?![^(]*\))/g;
  9374. var propertyDelimiter = /:(.+)/;
  9375. cssText.split(listDelimiter).forEach(function (item) {
  9376. if (item) {
  9377. var tmp = item.split(propertyDelimiter);
  9378. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9379. }
  9380. });
  9381. return res
  9382. });
  9383. // normalize possible array / string values into Object
  9384. function normalizeStyleBinding (bindingStyle) {
  9385. if (Array.isArray(bindingStyle)) {
  9386. return toObject(bindingStyle)
  9387. }
  9388. if (typeof bindingStyle === 'string') {
  9389. return parseStyleText(bindingStyle)
  9390. }
  9391. return bindingStyle
  9392. }
  9393. /* */
  9394. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9395. function getTarget(obj, path) {
  9396. var parts = path.split('.');
  9397. var key = parts[0];
  9398. if (key.indexOf('__$n') === 0) { //number index
  9399. key = parseInt(key.replace('__$n', ''));
  9400. }
  9401. if (parts.length === 1) {
  9402. return obj[key]
  9403. }
  9404. return getTarget(obj[key], parts.slice(1).join('.'))
  9405. }
  9406. function internalMixin(Vue) {
  9407. Vue.config.errorHandler = function(err, vm, info) {
  9408. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9409. console.error(err);
  9410. /* eslint-disable no-undef */
  9411. var app = typeof getApp === 'function' && getApp();
  9412. if (app && app.onError) {
  9413. app.onError(err);
  9414. }
  9415. };
  9416. var oldEmit = Vue.prototype.$emit;
  9417. Vue.prototype.$emit = function(event) {
  9418. if (this.$scope && event) {
  9419. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9420. if (triggerEvent) {
  9421. try {
  9422. triggerEvent.call(this.$scope, event, {
  9423. __args__: toArray(arguments, 1)
  9424. });
  9425. } catch (error) {
  9426. }
  9427. }
  9428. }
  9429. return oldEmit.apply(this, arguments)
  9430. };
  9431. Vue.prototype.$nextTick = function(fn) {
  9432. return nextTick$1(this, fn)
  9433. };
  9434. MP_METHODS.forEach(function (method) {
  9435. Vue.prototype[method] = function(args) {
  9436. if (this.$scope && this.$scope[method]) {
  9437. return this.$scope[method](args)
  9438. }
  9439. // mp-alipay
  9440. if (typeof my === 'undefined') {
  9441. return
  9442. }
  9443. if (method === 'createSelectorQuery') {
  9444. /* eslint-disable no-undef */
  9445. return my.createSelectorQuery(args)
  9446. } else if (method === 'createIntersectionObserver') {
  9447. /* eslint-disable no-undef */
  9448. return my.createIntersectionObserver(args)
  9449. }
  9450. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9451. };
  9452. });
  9453. Vue.prototype.__init_provide = initProvide;
  9454. Vue.prototype.__init_injections = initInjections;
  9455. Vue.prototype.__call_hook = function(hook, args) {
  9456. var vm = this;
  9457. // #7573 disable dep collection when invoking lifecycle hooks
  9458. pushTarget();
  9459. var handlers = vm.$options[hook];
  9460. var info = hook + " hook";
  9461. var ret;
  9462. if (handlers) {
  9463. for (var i = 0, j = handlers.length; i < j; i++) {
  9464. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9465. }
  9466. }
  9467. if (vm._hasHookEvent) {
  9468. vm.$emit('hook:' + hook, args);
  9469. }
  9470. popTarget();
  9471. return ret
  9472. };
  9473. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9474. if (Array.isArray(modifiers)) {
  9475. if (modifiers.indexOf('trim') !== -1) {
  9476. value = value.trim();
  9477. }
  9478. if (modifiers.indexOf('number') !== -1) {
  9479. value = this._n(value);
  9480. }
  9481. }
  9482. if (!target) {
  9483. target = this;
  9484. }
  9485. // 解决动态属性添加
  9486. Vue.set(target, key, value);
  9487. };
  9488. Vue.prototype.__set_sync = function(target, key, value) {
  9489. if (!target) {
  9490. target = this;
  9491. }
  9492. // 解决动态属性添加
  9493. Vue.set(target, key, value);
  9494. };
  9495. Vue.prototype.__get_orig = function(item) {
  9496. if (isPlainObject(item)) {
  9497. return item['$orig'] || item
  9498. }
  9499. return item
  9500. };
  9501. Vue.prototype.__get_value = function(dataPath, target) {
  9502. return getTarget(target || this, dataPath)
  9503. };
  9504. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9505. return renderClass(staticClass, dynamicClass)
  9506. };
  9507. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9508. if (!dynamicStyle && !staticStyle) {
  9509. return ''
  9510. }
  9511. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9512. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9513. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9514. };
  9515. Vue.prototype.__map = function(val, iteratee) {
  9516. //TODO 暂不考虑 string
  9517. var ret, i, l, keys, key;
  9518. if (Array.isArray(val)) {
  9519. ret = new Array(val.length);
  9520. for (i = 0, l = val.length; i < l; i++) {
  9521. ret[i] = iteratee(val[i], i);
  9522. }
  9523. return ret
  9524. } else if (isObject(val)) {
  9525. keys = Object.keys(val);
  9526. ret = Object.create(null);
  9527. for (i = 0, l = keys.length; i < l; i++) {
  9528. key = keys[i];
  9529. ret[key] = iteratee(val[key], key, i);
  9530. }
  9531. return ret
  9532. } else if (typeof val === 'number') {
  9533. ret = new Array(val);
  9534. for (i = 0, l = val; i < l; i++) {
  9535. // 第一个参数暂时仍和小程序一致
  9536. ret[i] = iteratee(i, i);
  9537. }
  9538. return ret
  9539. }
  9540. return []
  9541. };
  9542. }
  9543. /* */
  9544. var LIFECYCLE_HOOKS$1 = [
  9545. //App
  9546. 'onLaunch',
  9547. 'onShow',
  9548. 'onHide',
  9549. 'onUniNViewMessage',
  9550. 'onPageNotFound',
  9551. 'onThemeChange',
  9552. 'onError',
  9553. 'onUnhandledRejection',
  9554. //Page
  9555. 'onInit',
  9556. 'onLoad',
  9557. // 'onShow',
  9558. 'onReady',
  9559. // 'onHide',
  9560. 'onUnload',
  9561. 'onPullDownRefresh',
  9562. 'onReachBottom',
  9563. 'onTabItemTap',
  9564. 'onAddToFavorites',
  9565. 'onShareTimeline',
  9566. 'onShareAppMessage',
  9567. 'onResize',
  9568. 'onPageScroll',
  9569. 'onNavigationBarButtonTap',
  9570. 'onBackPress',
  9571. 'onNavigationBarSearchInputChanged',
  9572. 'onNavigationBarSearchInputConfirmed',
  9573. 'onNavigationBarSearchInputClicked',
  9574. //Component
  9575. // 'onReady', // 兼容旧版本,应该移除该事件
  9576. 'onPageShow',
  9577. 'onPageHide',
  9578. 'onPageResize',
  9579. 'onUploadDouyinVideo'
  9580. ];
  9581. function lifecycleMixin$1(Vue) {
  9582. //fixed vue-class-component
  9583. var oldExtend = Vue.extend;
  9584. Vue.extend = function(extendOptions) {
  9585. extendOptions = extendOptions || {};
  9586. var methods = extendOptions.methods;
  9587. if (methods) {
  9588. Object.keys(methods).forEach(function (methodName) {
  9589. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9590. extendOptions[methodName] = methods[methodName];
  9591. delete methods[methodName];
  9592. }
  9593. });
  9594. }
  9595. return oldExtend.call(this, extendOptions)
  9596. };
  9597. var strategies = Vue.config.optionMergeStrategies;
  9598. var mergeHook = strategies.created;
  9599. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9600. strategies[hook] = mergeHook;
  9601. });
  9602. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9603. }
  9604. /* */
  9605. // install platform patch function
  9606. Vue.prototype.__patch__ = patch;
  9607. // public mount method
  9608. Vue.prototype.$mount = function(
  9609. el ,
  9610. hydrating
  9611. ) {
  9612. return mountComponent$1(this, el, hydrating)
  9613. };
  9614. lifecycleMixin$1(Vue);
  9615. internalMixin(Vue);
  9616. /* */
  9617. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9618. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9619. /***/ }),
  9620. /***/ 26:
  9621. /*!********************************!*\
  9622. !*** E:/work/mdapp/pages.json ***!
  9623. \********************************/
  9624. /*! no static exports found */
  9625. /***/ (function(module, exports) {
  9626. /***/ }),
  9627. /***/ 295:
  9628. /*!**************************************************!*\
  9629. !*** E:/work/mdapp/pages/estate/img/i_house.png ***!
  9630. \**************************************************/
  9631. /*! no static exports found */
  9632. /***/ (function(module, exports) {
  9633. 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="
  9634. /***/ }),
  9635. /***/ 296:
  9636. /*!************************************************!*\
  9637. !*** E:/work/mdapp/pages/estate/img/i_pos.png ***!
  9638. \************************************************/
  9639. /*! no static exports found */
  9640. /***/ (function(module, exports) {
  9641. 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"
  9642. /***/ }),
  9643. /***/ 3:
  9644. /*!***********************************!*\
  9645. !*** (webpack)/buildin/global.js ***!
  9646. \***********************************/
  9647. /*! no static exports found */
  9648. /***/ (function(module, exports) {
  9649. var g;
  9650. // This works in non-strict mode
  9651. g = (function() {
  9652. return this;
  9653. })();
  9654. try {
  9655. // This works if eval is allowed (see CSP)
  9656. g = g || new Function("return this")();
  9657. } catch (e) {
  9658. // This works if the window reference is available
  9659. if (typeof window === "object") g = window;
  9660. }
  9661. // g can still be undefined, but nothing to do about it...
  9662. // We return undefined, instead of nothing here, so it's
  9663. // easier to handle this case. if(!global) { ...}
  9664. module.exports = g;
  9665. /***/ }),
  9666. /***/ 32:
  9667. /*!**********************************************************************************************************!*\
  9668. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  9669. \**********************************************************************************************************/
  9670. /*! exports provided: default */
  9671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9672. "use strict";
  9673. __webpack_require__.r(__webpack_exports__);
  9674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  9675. /* globals __VUE_SSR_CONTEXT__ */
  9676. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  9677. // This module is a runtime utility for cleaner component module output and will
  9678. // be included in the final webpack user bundle.
  9679. function normalizeComponent (
  9680. scriptExports,
  9681. render,
  9682. staticRenderFns,
  9683. functionalTemplate,
  9684. injectStyles,
  9685. scopeId,
  9686. moduleIdentifier, /* server only */
  9687. shadowMode, /* vue-cli only */
  9688. components, // fixed by xxxxxx auto components
  9689. renderjs // fixed by xxxxxx renderjs
  9690. ) {
  9691. // Vue.extend constructor export interop
  9692. var options = typeof scriptExports === 'function'
  9693. ? scriptExports.options
  9694. : scriptExports
  9695. // fixed by xxxxxx auto components
  9696. if (components) {
  9697. if (!options.components) {
  9698. options.components = {}
  9699. }
  9700. var hasOwn = Object.prototype.hasOwnProperty
  9701. for (var name in components) {
  9702. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  9703. options.components[name] = components[name]
  9704. }
  9705. }
  9706. }
  9707. // fixed by xxxxxx renderjs
  9708. if (renderjs) {
  9709. if(typeof renderjs.beforeCreate === 'function'){
  9710. renderjs.beforeCreate = [renderjs.beforeCreate]
  9711. }
  9712. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  9713. this[renderjs.__module] = this
  9714. });
  9715. (options.mixins || (options.mixins = [])).push(renderjs)
  9716. }
  9717. // render functions
  9718. if (render) {
  9719. options.render = render
  9720. options.staticRenderFns = staticRenderFns
  9721. options._compiled = true
  9722. }
  9723. // functional template
  9724. if (functionalTemplate) {
  9725. options.functional = true
  9726. }
  9727. // scopedId
  9728. if (scopeId) {
  9729. options._scopeId = 'data-v-' + scopeId
  9730. }
  9731. var hook
  9732. if (moduleIdentifier) { // server build
  9733. hook = function (context) {
  9734. // 2.3 injection
  9735. context =
  9736. context || // cached call
  9737. (this.$vnode && this.$vnode.ssrContext) || // stateful
  9738. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  9739. // 2.2 with runInNewContext: true
  9740. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  9741. context = __VUE_SSR_CONTEXT__
  9742. }
  9743. // inject component styles
  9744. if (injectStyles) {
  9745. injectStyles.call(this, context)
  9746. }
  9747. // register component module identifier for async chunk inferrence
  9748. if (context && context._registeredComponents) {
  9749. context._registeredComponents.add(moduleIdentifier)
  9750. }
  9751. }
  9752. // used by ssr in case component is cached and beforeCreate
  9753. // never gets called
  9754. options._ssrRegister = hook
  9755. } else if (injectStyles) {
  9756. hook = shadowMode
  9757. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  9758. : injectStyles
  9759. }
  9760. if (hook) {
  9761. if (options.functional) {
  9762. // for template-only hot-reload because in that case the render fn doesn't
  9763. // go through the normalizer
  9764. options._injectStyles = hook
  9765. // register for functioal component in vue file
  9766. var originalRender = options.render
  9767. options.render = function renderWithStyleInjection (h, context) {
  9768. hook.call(context)
  9769. return originalRender(h, context)
  9770. }
  9771. } else {
  9772. // inject component registration as beforeCreate hook
  9773. var existing = options.beforeCreate
  9774. options.beforeCreate = existing
  9775. ? [].concat(existing, hook)
  9776. : [hook]
  9777. }
  9778. }
  9779. return {
  9780. exports: scriptExports,
  9781. options: options
  9782. }
  9783. }
  9784. /***/ }),
  9785. /***/ 33:
  9786. /*!******************************************************!*\
  9787. !*** E:/work/mdapp/uni_modules/vk-uview-ui/index.js ***!
  9788. \******************************************************/
  9789. /*! no static exports found */
  9790. /***/ (function(module, exports, __webpack_require__) {
  9791. "use strict";
  9792. /* WEBPACK VAR INJECTION */(function(uni) {
  9793. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9794. Object.defineProperty(exports, "__esModule", {
  9795. value: true
  9796. });
  9797. exports.default = void 0;
  9798. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 34));
  9799. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 35));
  9800. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 39));
  9801. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 40));
  9802. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 44));
  9803. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 45));
  9804. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 46));
  9805. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 47));
  9806. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 48));
  9807. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 49));
  9808. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 50));
  9809. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 37));
  9810. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 36));
  9811. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 51));
  9812. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 38));
  9813. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 52));
  9814. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 53));
  9815. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 54));
  9816. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 55));
  9817. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 56));
  9818. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 57);
  9819. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 58));
  9820. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 59));
  9821. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 60));
  9822. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 61));
  9823. // 引入全局mixin
  9824. // 引入关于是否mixin集成小程序分享的配置
  9825. // import wxshare from './libs/mixin/mpShare.js'
  9826. // 全局挂载引入http相关请求拦截插件
  9827. function wranning(str) {
  9828. // 开发环境进行信息输出,主要是一些报错信息
  9829. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  9830. // 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
  9831. if (true) {
  9832. console.warn(str);
  9833. }
  9834. }
  9835. // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  9836. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  9837. // let vuexStore = {};
  9838. // try {
  9839. // vuexStore = require("@/store/$u.mixin.js");
  9840. // } catch (e) {
  9841. // //TODO handle the exception
  9842. // }
  9843. // post类型对象参数转为get类型url参数
  9844. var $u = {
  9845. queryParams: _queryParams.default,
  9846. route: _route.default,
  9847. timeFormat: _timeFormat.default,
  9848. date: _timeFormat.default,
  9849. // 另名date
  9850. timeFrom: _timeFrom.default,
  9851. colorGradient: _colorGradient.default.colorGradient,
  9852. colorToRgba: _colorGradient.default.colorToRgba,
  9853. guid: _guid.default,
  9854. color: _color.default,
  9855. sys: _sys.sys,
  9856. os: _sys.os,
  9857. type2icon: _type2icon.default,
  9858. randomArray: _randomArray.default,
  9859. wranning: wranning,
  9860. get: _request.default.get,
  9861. post: _request.default.post,
  9862. put: _request.default.put,
  9863. 'delete': _request.default.delete,
  9864. hexToRgb: _colorGradient.default.hexToRgb,
  9865. rgbToHex: _colorGradient.default.rgbToHex,
  9866. test: _test.default,
  9867. random: _random.default,
  9868. deepClone: _deepClone.default,
  9869. deepMerge: _deepMerge.default,
  9870. getParent: _getParent.default,
  9871. $parent: _$parent.default,
  9872. addUnit: _addUnit.default,
  9873. trim: _trim.default,
  9874. type: ['primary', 'success', 'error', 'warning', 'info'],
  9875. http: _request.default,
  9876. toast: _toast.default,
  9877. config: _config.default,
  9878. // uView配置信息相关,比如版本号
  9879. zIndex: _zIndex.default,
  9880. debounce: _debounce.default,
  9881. throttle: _throttle.default
  9882. };
  9883. // $u挂载到uni对象上
  9884. uni.$u = $u;
  9885. var install = function install(Vue) {
  9886. Vue.mixin(_mixin.default);
  9887. if (Vue.prototype.openShare) {
  9888. Vue.mixin(mpShare);
  9889. }
  9890. // Vue.mixin(vuexStore);
  9891. // 时间格式化,同时两个名称,date和timeFormat
  9892. Vue.filter('timeFormat', function (timestamp, format) {
  9893. return (0, _timeFormat.default)(timestamp, format);
  9894. });
  9895. Vue.filter('date', function (timestamp, format) {
  9896. return (0, _timeFormat.default)(timestamp, format);
  9897. });
  9898. // 将多久以前的方法,注入到全局过滤器
  9899. Vue.filter('timeFrom', function (timestamp, format) {
  9900. return (0, _timeFrom.default)(timestamp, format);
  9901. });
  9902. Vue.prototype.$u = $u;
  9903. };
  9904. var _default = {
  9905. install: install
  9906. };
  9907. exports.default = _default;
  9908. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9909. /***/ }),
  9910. /***/ 34:
  9911. /*!*****************************************************************!*\
  9912. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  9913. \*****************************************************************/
  9914. /*! no static exports found */
  9915. /***/ (function(module, exports, __webpack_require__) {
  9916. "use strict";
  9917. /* WEBPACK VAR INJECTION */(function(uni) {
  9918. Object.defineProperty(exports, "__esModule", {
  9919. value: true
  9920. });
  9921. exports.default = void 0;
  9922. var _default = {
  9923. data: function data() {
  9924. return {};
  9925. },
  9926. onLoad: function onLoad() {
  9927. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  9928. this.$u.getRect = this.$uGetRect;
  9929. },
  9930. methods: {
  9931. // 查询节点信息
  9932. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  9933. // 解决办法为在组件根部再套一个没有任何作用的view元素
  9934. $uGetRect: function $uGetRect(selector, all) {
  9935. var _this = this;
  9936. return new Promise(function (resolve) {
  9937. uni.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  9938. if (all && Array.isArray(rect) && rect.length) {
  9939. resolve(rect);
  9940. }
  9941. if (!all && rect) {
  9942. resolve(rect);
  9943. }
  9944. }).exec();
  9945. });
  9946. },
  9947. getParentData: function getParentData() {
  9948. var _this2 = this;
  9949. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  9950. // 避免在created中去定义parent变量
  9951. if (!this.parent) this.parent = false;
  9952. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  9953. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  9954. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  9955. this.parent = this.$u.$parent.call(this, parentName);
  9956. if (this.parent) {
  9957. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  9958. Object.keys(this.parentData).map(function (key) {
  9959. _this2.parentData[key] = _this2.parent[key];
  9960. });
  9961. }
  9962. },
  9963. // 阻止事件冒泡
  9964. preventEvent: function preventEvent(e) {
  9965. e && e.stopPropagation && e.stopPropagation();
  9966. }
  9967. },
  9968. onReachBottom: function onReachBottom() {
  9969. uni.$emit('uOnReachBottom');
  9970. },
  9971. beforeDestroy: function beforeDestroy() {
  9972. var _this3 = this;
  9973. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  9974. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  9975. if (this.parent && uni.$u.test.array(this.parent.children)) {
  9976. // 组件销毁时,移除父组件中的children数组中对应的实例
  9977. var childrenList = this.parent.children;
  9978. childrenList.map(function (child, index) {
  9979. // 如果相等,则移除
  9980. if (child === _this3) {
  9981. childrenList.splice(index, 1);
  9982. }
  9983. });
  9984. }
  9985. }
  9986. };
  9987. exports.default = _default;
  9988. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9989. /***/ }),
  9990. /***/ 35:
  9991. /*!*******************************************************************!*\
  9992. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  9993. \*******************************************************************/
  9994. /*! no static exports found */
  9995. /***/ (function(module, exports, __webpack_require__) {
  9996. "use strict";
  9997. /* WEBPACK VAR INJECTION */(function(uni) {
  9998. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9999. Object.defineProperty(exports, "__esModule", {
  10000. value: true
  10001. });
  10002. exports.default = void 0;
  10003. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10004. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10005. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 36));
  10006. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 38));
  10007. var Request = /*#__PURE__*/function () {
  10008. function Request() {
  10009. var _this = this;
  10010. (0, _classCallCheck2.default)(this, Request);
  10011. this.config = {
  10012. baseUrl: '',
  10013. // 请求的根域名
  10014. // 默认的请求头
  10015. header: {},
  10016. method: 'POST',
  10017. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  10018. dataType: 'json',
  10019. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  10020. responseType: 'text',
  10021. showLoading: true,
  10022. // 是否显示请求中的loading
  10023. loadingText: '请求中...',
  10024. loadingTime: 800,
  10025. // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  10026. timer: null,
  10027. // 定时器
  10028. originalData: false,
  10029. // 是否在拦截器中返回服务端的原始数据,见文档说明
  10030. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  10031. };
  10032. // 拦截器
  10033. this.interceptor = {
  10034. // 请求前的拦截
  10035. request: null,
  10036. // 请求后的拦截
  10037. response: null
  10038. };
  10039. // get请求
  10040. this.get = function (url) {
  10041. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10042. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10043. return _this.request({
  10044. method: 'GET',
  10045. url: url,
  10046. header: header,
  10047. data: data
  10048. });
  10049. };
  10050. // post请求
  10051. this.post = function (url) {
  10052. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10053. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10054. return _this.request({
  10055. url: url,
  10056. method: 'POST',
  10057. header: header,
  10058. data: data
  10059. });
  10060. };
  10061. // put请求,不支持支付宝小程序(HX2.6.15)
  10062. this.put = function (url) {
  10063. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10064. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10065. return _this.request({
  10066. url: url,
  10067. method: 'PUT',
  10068. header: header,
  10069. data: data
  10070. });
  10071. };
  10072. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  10073. this.delete = function (url) {
  10074. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10075. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10076. return _this.request({
  10077. url: url,
  10078. method: 'DELETE',
  10079. header: header,
  10080. data: data
  10081. });
  10082. };
  10083. }
  10084. (0, _createClass2.default)(Request, [{
  10085. key: "setConfig",
  10086. value:
  10087. // 设置全局默认配置
  10088. function setConfig(customConfig) {
  10089. // 深度合并对象,否则会造成对象深层属性丢失
  10090. this.config = (0, _deepMerge.default)(this.config, customConfig);
  10091. }
  10092. // 主要请求部分
  10093. }, {
  10094. key: "request",
  10095. value: function request() {
  10096. var _this2 = this;
  10097. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10098. // 检查请求拦截
  10099. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  10100. var tmpConfig = {};
  10101. var interceptorRequest = this.interceptor.request(options);
  10102. if (interceptorRequest === false) {
  10103. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  10104. return new Promise(function () {});
  10105. }
  10106. this.options = interceptorRequest;
  10107. }
  10108. options.dataType = options.dataType || this.config.dataType;
  10109. options.responseType = options.responseType || this.config.responseType;
  10110. options.url = options.url || '';
  10111. options.params = options.params || {};
  10112. options.header = Object.assign({}, this.config.header, options.header);
  10113. options.method = options.method || this.config.method;
  10114. return new Promise(function (resolve, reject) {
  10115. options.complete = function (response) {
  10116. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  10117. uni.hideLoading();
  10118. // 清除定时器,如果请求回来了,就无需loading
  10119. clearTimeout(_this2.config.timer);
  10120. _this2.config.timer = null;
  10121. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  10122. if (_this2.config.originalData) {
  10123. // 判断是否存在拦截器
  10124. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10125. var resInterceptors = _this2.interceptor.response(response);
  10126. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  10127. if (resInterceptors !== false) {
  10128. resolve(resInterceptors);
  10129. } else {
  10130. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  10131. reject(response);
  10132. }
  10133. } else {
  10134. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  10135. resolve(response);
  10136. }
  10137. } else {
  10138. if (response.statusCode == 200) {
  10139. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10140. var _resInterceptors = _this2.interceptor.response(response.data);
  10141. if (_resInterceptors !== false) {
  10142. resolve(_resInterceptors);
  10143. } else {
  10144. reject(response.data);
  10145. }
  10146. } else {
  10147. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  10148. resolve(response.data);
  10149. }
  10150. } else {
  10151. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  10152. // if(response.errMsg) {
  10153. // uni.showModal({
  10154. // title: response.errMsg
  10155. // });
  10156. // }
  10157. reject(response);
  10158. }
  10159. }
  10160. };
  10161. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  10162. options.url = _test.default.url(options.url) ? options.url : _this2.config.baseUrl + (options.url.indexOf('/') == 0 ? options.url : '/' + options.url);
  10163. // 是否显示loading
  10164. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  10165. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  10166. if (_this2.config.showLoading && !_this2.config.timer) {
  10167. _this2.config.timer = setTimeout(function () {
  10168. uni.showLoading({
  10169. title: _this2.config.loadingText,
  10170. mask: _this2.config.loadingMask
  10171. });
  10172. _this2.config.timer = null;
  10173. }, _this2.config.loadingTime);
  10174. }
  10175. uni.request(options);
  10176. });
  10177. // .catch(res => {
  10178. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  10179. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  10180. // return new Promise(()=>{});
  10181. // })
  10182. }
  10183. }]);
  10184. return Request;
  10185. }();
  10186. var _default = new Request();
  10187. exports.default = _default;
  10188. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10189. /***/ }),
  10190. /***/ 36:
  10191. /*!************************************************************************!*\
  10192. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  10193. \************************************************************************/
  10194. /*! no static exports found */
  10195. /***/ (function(module, exports, __webpack_require__) {
  10196. "use strict";
  10197. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10198. Object.defineProperty(exports, "__esModule", {
  10199. value: true
  10200. });
  10201. exports.default = void 0;
  10202. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10203. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 37));
  10204. // JS对象深度合并
  10205. function deepMerge() {
  10206. var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10207. var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10208. target = (0, _deepClone.default)(target);
  10209. if ((0, _typeof2.default)(target) !== 'object' || (0, _typeof2.default)(source) !== 'object') return false;
  10210. for (var prop in source) {
  10211. if (!source.hasOwnProperty(prop)) continue;
  10212. if (prop in target) {
  10213. if ((0, _typeof2.default)(target[prop]) !== 'object') {
  10214. target[prop] = source[prop];
  10215. } else {
  10216. if ((0, _typeof2.default)(source[prop]) !== 'object') {
  10217. target[prop] = source[prop];
  10218. } else {
  10219. if (target[prop].concat && source[prop].concat) {
  10220. target[prop] = target[prop].concat(source[prop]);
  10221. } else {
  10222. target[prop] = deepMerge(target[prop], source[prop]);
  10223. }
  10224. }
  10225. }
  10226. } else {
  10227. target[prop] = source[prop];
  10228. }
  10229. }
  10230. return target;
  10231. }
  10232. var _default = deepMerge;
  10233. exports.default = _default;
  10234. /***/ }),
  10235. /***/ 37:
  10236. /*!************************************************************************!*\
  10237. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  10238. \************************************************************************/
  10239. /*! no static exports found */
  10240. /***/ (function(module, exports, __webpack_require__) {
  10241. "use strict";
  10242. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10243. Object.defineProperty(exports, "__esModule", {
  10244. value: true
  10245. });
  10246. exports.default = void 0;
  10247. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10248. // 判断arr是否为一个数组,返回一个bool值
  10249. function isArray(arr) {
  10250. return Object.prototype.toString.call(arr) === '[object Array]';
  10251. }
  10252. // 深度克隆
  10253. function deepClone(obj) {
  10254. // 对常见的“非”值,直接返回原来值
  10255. if ([null, undefined, NaN, false].includes(obj)) return obj;
  10256. if ((0, _typeof2.default)(obj) !== "object" && typeof obj !== 'function') {
  10257. //原始类型直接返回
  10258. return obj;
  10259. }
  10260. var o = isArray(obj) ? [] : {};
  10261. for (var i in obj) {
  10262. if (obj.hasOwnProperty(i)) {
  10263. o[i] = (0, _typeof2.default)(obj[i]) === "object" ? deepClone(obj[i]) : obj[i];
  10264. }
  10265. }
  10266. return o;
  10267. }
  10268. var _default = deepClone;
  10269. exports.default = _default;
  10270. /***/ }),
  10271. /***/ 38:
  10272. /*!*******************************************************************!*\
  10273. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  10274. \*******************************************************************/
  10275. /*! no static exports found */
  10276. /***/ (function(module, exports, __webpack_require__) {
  10277. "use strict";
  10278. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10279. Object.defineProperty(exports, "__esModule", {
  10280. value: true
  10281. });
  10282. exports.default = void 0;
  10283. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10284. /**
  10285. * 验证电子邮箱格式
  10286. */
  10287. function email(value) {
  10288. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  10289. }
  10290. /**
  10291. * 验证手机格式
  10292. */
  10293. function mobile(value) {
  10294. return /^1[23456789]\d{9}$/.test(value);
  10295. }
  10296. /**
  10297. * 验证URL格式
  10298. */
  10299. function url(value) {
  10300. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  10301. }
  10302. /**
  10303. * 验证日期格式
  10304. */
  10305. function date(value) {
  10306. return !/Invalid|NaN/.test(new Date(value).toString());
  10307. }
  10308. /**
  10309. * 验证ISO类型的日期格式
  10310. */
  10311. function dateISO(value) {
  10312. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  10313. }
  10314. /**
  10315. * 验证十进制数字
  10316. */
  10317. function number(value) {
  10318. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  10319. }
  10320. /**
  10321. * 验证整数
  10322. */
  10323. function digits(value) {
  10324. return /^\d+$/.test(value);
  10325. }
  10326. /**
  10327. * 验证身份证号码
  10328. */
  10329. function idCard(value) {
  10330. 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);
  10331. }
  10332. /**
  10333. * 是否车牌号
  10334. */
  10335. function carNo(value) {
  10336. // 新能源车牌
  10337. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  10338. // 旧车牌
  10339. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  10340. if (value.length === 7) {
  10341. return creg.test(value);
  10342. } else if (value.length === 8) {
  10343. return xreg.test(value);
  10344. } else {
  10345. return false;
  10346. }
  10347. }
  10348. /**
  10349. * 金额,只允许2位小数
  10350. */
  10351. function amount(value) {
  10352. //金额,只允许保留两位小数
  10353. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  10354. }
  10355. /**
  10356. * 中文
  10357. */
  10358. function chinese(value) {
  10359. var reg = /^[\u4e00-\u9fa5]+$/gi;
  10360. return reg.test(value);
  10361. }
  10362. /**
  10363. * 只能输入字母
  10364. */
  10365. function letter(value) {
  10366. return /^[a-zA-Z]*$/.test(value);
  10367. }
  10368. /**
  10369. * 只能是字母或者数字
  10370. */
  10371. function enOrNum(value) {
  10372. //英文或者数字
  10373. var reg = /^[0-9a-zA-Z]*$/g;
  10374. return reg.test(value);
  10375. }
  10376. /**
  10377. * 验证是否包含某个值
  10378. */
  10379. function contains(value, param) {
  10380. return value.indexOf(param) >= 0;
  10381. }
  10382. /**
  10383. * 验证一个值范围[min, max]
  10384. */
  10385. function range(value, param) {
  10386. return value >= param[0] && value <= param[1];
  10387. }
  10388. /**
  10389. * 验证一个长度范围[min, max]
  10390. */
  10391. function rangeLength(value, param) {
  10392. return value.length >= param[0] && value.length <= param[1];
  10393. }
  10394. /**
  10395. * 是否固定电话
  10396. */
  10397. function landline(value) {
  10398. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  10399. return reg.test(value);
  10400. }
  10401. /**
  10402. * 判断是否为空
  10403. */
  10404. function empty(value) {
  10405. switch ((0, _typeof2.default)(value)) {
  10406. case 'undefined':
  10407. return true;
  10408. case 'string':
  10409. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  10410. break;
  10411. case 'boolean':
  10412. if (!value) return true;
  10413. break;
  10414. case 'number':
  10415. if (0 === value || isNaN(value)) return true;
  10416. break;
  10417. case 'object':
  10418. if (null === value || value.length === 0) return true;
  10419. for (var i in value) {
  10420. return false;
  10421. }
  10422. return true;
  10423. }
  10424. return false;
  10425. }
  10426. /**
  10427. * 是否json字符串
  10428. */
  10429. function jsonString(value) {
  10430. if (typeof value == 'string') {
  10431. try {
  10432. var obj = JSON.parse(value);
  10433. if ((0, _typeof2.default)(obj) == 'object' && obj) {
  10434. return true;
  10435. } else {
  10436. return false;
  10437. }
  10438. } catch (e) {
  10439. return false;
  10440. }
  10441. }
  10442. return false;
  10443. }
  10444. /**
  10445. * 是否数组
  10446. */
  10447. function array(value) {
  10448. if (typeof Array.isArray === "function") {
  10449. return Array.isArray(value);
  10450. } else {
  10451. return Object.prototype.toString.call(value) === "[object Array]";
  10452. }
  10453. }
  10454. /**
  10455. * 是否对象
  10456. */
  10457. function object(value) {
  10458. return Object.prototype.toString.call(value) === '[object Object]';
  10459. }
  10460. /**
  10461. * 是否短信验证码
  10462. */
  10463. function code(value) {
  10464. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  10465. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  10466. }
  10467. var _default = {
  10468. email: email,
  10469. mobile: mobile,
  10470. url: url,
  10471. date: date,
  10472. dateISO: dateISO,
  10473. number: number,
  10474. digits: digits,
  10475. idCard: idCard,
  10476. carNo: carNo,
  10477. amount: amount,
  10478. chinese: chinese,
  10479. letter: letter,
  10480. enOrNum: enOrNum,
  10481. contains: contains,
  10482. range: range,
  10483. rangeLength: rangeLength,
  10484. empty: empty,
  10485. isEmpty: empty,
  10486. jsonString: jsonString,
  10487. landline: landline,
  10488. object: object,
  10489. array: array,
  10490. code: code
  10491. };
  10492. exports.default = _default;
  10493. /***/ }),
  10494. /***/ 39:
  10495. /*!**************************************************************************!*\
  10496. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  10497. \**************************************************************************/
  10498. /*! no static exports found */
  10499. /***/ (function(module, exports, __webpack_require__) {
  10500. "use strict";
  10501. Object.defineProperty(exports, "__esModule", {
  10502. value: true
  10503. });
  10504. exports.default = void 0;
  10505. /**
  10506. * 对象转url参数
  10507. * @param {*} data,对象
  10508. * @param {*} isPrefix,是否自动加上"?"
  10509. */
  10510. function queryParams() {
  10511. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10512. var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  10513. var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  10514. var prefix = isPrefix ? '?' : '';
  10515. var _result = [];
  10516. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
  10517. var _loop = function _loop(key) {
  10518. var value = data[key];
  10519. // 去掉为空的参数
  10520. if (['', undefined, null].indexOf(value) >= 0) {
  10521. return "continue";
  10522. }
  10523. // 如果值为数组,另行处理
  10524. if (value.constructor === Array) {
  10525. // e.g. {ids: [1, 2, 3]}
  10526. switch (arrayFormat) {
  10527. case 'indices':
  10528. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  10529. for (var i = 0; i < value.length; i++) {
  10530. _result.push(key + '[' + i + ']=' + value[i]);
  10531. }
  10532. break;
  10533. case 'brackets':
  10534. // 结果: ids[]=1&ids[]=2&ids[]=3
  10535. value.forEach(function (_value) {
  10536. _result.push(key + '[]=' + _value);
  10537. });
  10538. break;
  10539. case 'repeat':
  10540. // 结果: ids=1&ids=2&ids=3
  10541. value.forEach(function (_value) {
  10542. _result.push(key + '=' + _value);
  10543. });
  10544. break;
  10545. case 'comma':
  10546. // 结果: ids=1,2,3
  10547. var commaStr = "";
  10548. value.forEach(function (_value) {
  10549. commaStr += (commaStr ? "," : "") + _value;
  10550. });
  10551. _result.push(key + '=' + commaStr);
  10552. break;
  10553. default:
  10554. value.forEach(function (_value) {
  10555. _result.push(key + '[]=' + _value);
  10556. });
  10557. }
  10558. } else {
  10559. _result.push(key + '=' + value);
  10560. }
  10561. };
  10562. for (var key in data) {
  10563. var _ret = _loop(key);
  10564. if (_ret === "continue") continue;
  10565. }
  10566. return _result.length ? prefix + _result.join('&') : '';
  10567. }
  10568. var _default = queryParams;
  10569. exports.default = _default;
  10570. /***/ }),
  10571. /***/ 4:
  10572. /*!**********************************************************************!*\
  10573. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  10574. \**********************************************************************/
  10575. /*! no static exports found */
  10576. /***/ (function(module, exports) {
  10577. function _interopRequireDefault(obj) {
  10578. return obj && obj.__esModule ? obj : {
  10579. "default": obj
  10580. };
  10581. }
  10582. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10583. /***/ }),
  10584. /***/ 40:
  10585. /*!********************************************************************!*\
  10586. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  10587. \********************************************************************/
  10588. /*! no static exports found */
  10589. /***/ (function(module, exports, __webpack_require__) {
  10590. "use strict";
  10591. /* WEBPACK VAR INJECTION */(function(uni) {
  10592. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10593. Object.defineProperty(exports, "__esModule", {
  10594. value: true
  10595. });
  10596. exports.default = void 0;
  10597. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  10598. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  10599. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10600. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10601. /**
  10602. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  10603. * 并且带有路由拦截功能
  10604. */
  10605. var Router = /*#__PURE__*/function () {
  10606. function Router() {
  10607. (0, _classCallCheck2.default)(this, Router);
  10608. // 原始属性定义
  10609. this.config = {
  10610. type: 'navigateTo',
  10611. url: '',
  10612. delta: 1,
  10613. // navigateBack页面后退时,回退的层数
  10614. params: {},
  10615. // 传递的参数
  10616. animationType: 'pop-in',
  10617. // 窗口动画,只在APP有效
  10618. animationDuration: 300,
  10619. // 窗口动画持续时间,单位毫秒,只在APP有效
  10620. intercept: false // 是否需要拦截
  10621. };
  10622. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  10623. // 这里在构造函数中进行this绑定
  10624. this.route = this.route.bind(this);
  10625. }
  10626. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  10627. (0, _createClass2.default)(Router, [{
  10628. key: "addRootPath",
  10629. value: function addRootPath(url) {
  10630. return url[0] === '/' ? url : "/".concat(url);
  10631. }
  10632. // 整合路由参数
  10633. }, {
  10634. key: "mixinParam",
  10635. value: function mixinParam(url, params) {
  10636. url = url && this.addRootPath(url);
  10637. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  10638. // 如果有url中有get参数,转换后无需带上"?"
  10639. var query = '';
  10640. if (/.*\/.*\?.*=.*/.test(url)) {
  10641. // object对象转为get类型的参数
  10642. query = uni.$u.queryParams(params, false);
  10643. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10644. return url += "&" + query;
  10645. } else {
  10646. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  10647. query = uni.$u.queryParams(params);
  10648. return url += query;
  10649. }
  10650. }
  10651. // 对外的方法名称
  10652. }, {
  10653. key: "route",
  10654. value: function () {
  10655. var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  10656. var options,
  10657. params,
  10658. mergeConfig,
  10659. isNext,
  10660. _args = arguments;
  10661. return _regenerator.default.wrap(function _callee$(_context) {
  10662. while (1) {
  10663. switch (_context.prev = _context.next) {
  10664. case 0:
  10665. options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
  10666. params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  10667. // 合并用户的配置和内部的默认配置
  10668. mergeConfig = {};
  10669. if (typeof options === 'string') {
  10670. // 如果options为字符串,则为route(url, params)的形式
  10671. mergeConfig.url = this.mixinParam(options, params);
  10672. mergeConfig.type = 'navigateTo';
  10673. } else {
  10674. mergeConfig = uni.$u.deepClone(options, this.config);
  10675. // 否则正常使用mergeConfig中的url和params进行拼接
  10676. mergeConfig.url = this.mixinParam(options.url, options.params);
  10677. }
  10678. if (params.intercept) {
  10679. this.config.intercept = params.intercept;
  10680. }
  10681. // params参数也带给拦截器
  10682. mergeConfig.params = params;
  10683. // 合并内外部参数
  10684. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  10685. // 判断用户是否定义了拦截器
  10686. if (!(typeof uni.$u.routeIntercept === 'function')) {
  10687. _context.next = 14;
  10688. break;
  10689. }
  10690. _context.next = 10;
  10691. return new Promise(function (resolve, reject) {
  10692. uni.$u.routeIntercept(mergeConfig, resolve);
  10693. });
  10694. case 10:
  10695. isNext = _context.sent;
  10696. // 如果isNext为true,则执行路由跳转
  10697. isNext && this.openPage(mergeConfig);
  10698. _context.next = 15;
  10699. break;
  10700. case 14:
  10701. this.openPage(mergeConfig);
  10702. case 15:
  10703. case "end":
  10704. return _context.stop();
  10705. }
  10706. }
  10707. }, _callee, this);
  10708. }));
  10709. function route() {
  10710. return _route.apply(this, arguments);
  10711. }
  10712. return route;
  10713. }() // 执行路由跳转
  10714. }, {
  10715. key: "openPage",
  10716. value: function openPage(config) {
  10717. // 解构参数
  10718. var url = config.url,
  10719. type = config.type,
  10720. delta = config.delta,
  10721. animationType = config.animationType,
  10722. animationDuration = config.animationDuration;
  10723. if (config.type == 'navigateTo' || config.type == 'to') {
  10724. uni.navigateTo({
  10725. url: url,
  10726. animationType: animationType,
  10727. animationDuration: animationDuration
  10728. });
  10729. }
  10730. if (config.type == 'redirectTo' || config.type == 'redirect') {
  10731. uni.redirectTo({
  10732. url: url
  10733. });
  10734. }
  10735. if (config.type == 'switchTab' || config.type == 'tab') {
  10736. uni.switchTab({
  10737. url: url
  10738. });
  10739. }
  10740. if (config.type == 'reLaunch' || config.type == 'launch') {
  10741. uni.reLaunch({
  10742. url: url
  10743. });
  10744. }
  10745. if (config.type == 'navigateBack' || config.type == 'back') {
  10746. uni.navigateBack({
  10747. delta: delta
  10748. });
  10749. }
  10750. }
  10751. }]);
  10752. return Router;
  10753. }();
  10754. var _default = new Router().route;
  10755. exports.default = _default;
  10756. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10757. /***/ }),
  10758. /***/ 400:
  10759. /*!*************************************************************************************!*\
  10760. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  10761. \*************************************************************************************/
  10762. /*! no static exports found */
  10763. /***/ (function(module, exports, __webpack_require__) {
  10764. "use strict";
  10765. /* WEBPACK VAR INJECTION */(function(uni) {
  10766. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10767. Object.defineProperty(exports, "__esModule", {
  10768. value: true
  10769. });
  10770. exports.default = void 0;
  10771. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 401));
  10772. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 402));
  10773. /**
  10774. * html 解析器
  10775. * @tutorial https://github.com/jin-yufeng/Parser
  10776. * @version 20201029
  10777. * @author JinYufeng
  10778. * @listens MIT
  10779. */
  10780. var blankChar = _config.default.blankChar;
  10781. var windowWidth = uni.getSystemInfoSync().windowWidth;
  10782. var emoji;
  10783. function MpHtmlParser(data) {
  10784. var _this = this;
  10785. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10786. this.attrs = {};
  10787. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  10788. this.data = data;
  10789. this.domain = options.domain;
  10790. this.DOM = [];
  10791. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  10792. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  10793. this.options = options;
  10794. this.state = this.Text;
  10795. this.STACK = [];
  10796. // 工具函数
  10797. this.bubble = function () {
  10798. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  10799. if (_config.default.richOnlyTags[item.name]) return false;
  10800. item.c = 1;
  10801. }
  10802. return true;
  10803. };
  10804. this.decode = function (val, amp) {
  10805. var i = -1,
  10806. j,
  10807. en;
  10808. while (1) {
  10809. if ((i = val.indexOf('&', i + 1)) == -1) break;
  10810. if ((j = val.indexOf(';', i + 2)) == -1) break;
  10811. if (val[i + 1] == '#') {
  10812. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  10813. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  10814. } else {
  10815. en = val.substring(i + 1, j);
  10816. if (_config.default.entities[en] || en == amp) val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  10817. }
  10818. }
  10819. return val;
  10820. };
  10821. this.getUrl = function (url) {
  10822. if (url[0] == '/') {
  10823. if (url[1] == '/') url = _this.options.prot + ':' + url;else if (_this.domain) url = _this.domain + url;
  10824. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://')) url = _this.domain + '/' + url;
  10825. return url;
  10826. };
  10827. this.isClose = function () {
  10828. return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';
  10829. };
  10830. this.section = function () {
  10831. return _this.data.substring(_this.start, _this.i);
  10832. };
  10833. this.parent = function () {
  10834. return _this.STACK[_this.STACK.length - 1];
  10835. };
  10836. this.siblings = function () {
  10837. return _this.STACK.length ? _this.parent().children : _this.DOM;
  10838. };
  10839. }
  10840. MpHtmlParser.prototype.parse = function () {
  10841. if (emoji) this.data = emoji.parseEmoji(this.data);
  10842. for (var c; c = this.data[this.i]; this.i++) {
  10843. this.state(c);
  10844. }
  10845. if (this.state == this.Text) this.setText();
  10846. while (this.STACK.length) {
  10847. this.popNode(this.STACK.pop());
  10848. }
  10849. return this.DOM;
  10850. };
  10851. // 设置属性
  10852. MpHtmlParser.prototype.setAttr = function () {
  10853. var name = this.attrName.toLowerCase(),
  10854. val = this.attrVal;
  10855. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else if (val) {
  10856. 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;
  10857. }
  10858. this.attrVal = '';
  10859. while (blankChar[this.data[this.i]]) {
  10860. this.i++;
  10861. }
  10862. if (this.isClose()) this.setNode();else {
  10863. this.start = this.i;
  10864. this.state = this.AttrName;
  10865. }
  10866. };
  10867. // 设置文本节点
  10868. MpHtmlParser.prototype.setText = function () {
  10869. var back,
  10870. text = this.section();
  10871. if (!text) return;
  10872. text = _config.default.onText && _config.default.onText(text, function () {
  10873. return back = true;
  10874. }) || text;
  10875. if (back) {
  10876. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  10877. var j = this.start + text.length;
  10878. for (this.i = this.start; this.i < j; this.i++) {
  10879. this.state(this.data[this.i]);
  10880. }
  10881. return;
  10882. }
  10883. if (!this.pre) {
  10884. // 合并空白符
  10885. var flag,
  10886. tmp = [];
  10887. for (var i = text.length, c; c = text[--i];) {
  10888. if (!blankChar[c]) {
  10889. tmp.unshift(c);
  10890. if (!flag) flag = 1;
  10891. } else {
  10892. if (tmp[0] != ' ') tmp.unshift(' ');
  10893. if (c == '\n' && flag == void 0) flag = 0;
  10894. }
  10895. }
  10896. if (flag == 0) return;
  10897. text = tmp.join('');
  10898. }
  10899. this.siblings().push({
  10900. type: 'text',
  10901. text: this.decode(text)
  10902. });
  10903. };
  10904. // 设置元素节点
  10905. MpHtmlParser.prototype.setNode = function () {
  10906. var node = {
  10907. name: this.tagName.toLowerCase(),
  10908. attrs: this.attrs
  10909. },
  10910. close = _config.default.selfClosingTags[node.name];
  10911. if (this.options.nodes.length) node.type = 'node';
  10912. this.attrs = {};
  10913. if (!_config.default.ignoreTags[node.name]) {
  10914. // 处理属性
  10915. var attrs = node.attrs,
  10916. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  10917. styleObj = {};
  10918. if (attrs.id) {
  10919. if (this.options.compress & 1) attrs.id = void 0;else if (this.options.useAnchor) this.bubble();
  10920. }
  10921. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  10922. switch (node.name) {
  10923. case 'a':
  10924. case 'ad':
  10925. this.bubble();
  10926. break;
  10927. case 'font':
  10928. if (attrs.color) {
  10929. styleObj['color'] = attrs.color;
  10930. attrs.color = void 0;
  10931. }
  10932. if (attrs.face) {
  10933. styleObj['font-family'] = attrs.face;
  10934. attrs.face = void 0;
  10935. }
  10936. if (attrs.size) {
  10937. var size = parseInt(attrs.size);
  10938. if (size < 1) size = 1;else if (size > 7) size = 7;
  10939. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  10940. styleObj['font-size'] = map[size - 1];
  10941. attrs.size = void 0;
  10942. }
  10943. break;
  10944. case 'embed':
  10945. var src = node.attrs.src || '',
  10946. type = node.attrs.type || '';
  10947. 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;
  10948. if (node.attrs.autostart) node.attrs.autoplay = 'T';
  10949. node.attrs.controls = 'T';
  10950. case 'video':
  10951. case 'audio':
  10952. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else this["".concat(node.name, "Num")]++;
  10953. if (node.name == 'video') {
  10954. if (this.videoNum > 3) node.lazyLoad = 1;
  10955. if (attrs.width) {
  10956. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  10957. attrs.width = void 0;
  10958. }
  10959. if (attrs.height) {
  10960. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  10961. attrs.height = void 0;
  10962. }
  10963. }
  10964. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  10965. attrs.source = [];
  10966. if (attrs.src) {
  10967. attrs.source.push(attrs.src);
  10968. attrs.src = void 0;
  10969. }
  10970. this.bubble();
  10971. break;
  10972. case 'td':
  10973. case 'th':
  10974. if (attrs.colspan || attrs.rowspan) for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  10975. if (item.name == 'table') {
  10976. item.flag = 1;
  10977. break;
  10978. }
  10979. }
  10980. }
  10981. if (attrs.align) {
  10982. if (node.name == 'table') {
  10983. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else styleObj['float'] = attrs.align;
  10984. } else styleObj['text-align'] = attrs.align;
  10985. attrs.align = void 0;
  10986. }
  10987. // 压缩 style
  10988. var styles = style.split(';');
  10989. style = '';
  10990. for (var i = 0, len = styles.length; i < len; i++) {
  10991. var info = styles[i].split(':');
  10992. if (info.length < 2) continue;
  10993. var _key = info[0].trim().toLowerCase(),
  10994. _value = info.slice(1).join(':').trim();
  10995. 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;
  10996. }
  10997. if (node.name == 'img') {
  10998. if (attrs.src && !attrs.ignore) {
  10999. if (this.bubble()) attrs.i = (this.imgNum++).toString();else attrs.ignore = 'T';
  11000. }
  11001. if (attrs.ignore) {
  11002. style += ';-webkit-touch-callout:none';
  11003. styleObj['max-width'] = '100%';
  11004. }
  11005. var width;
  11006. if (styleObj.width) width = styleObj.width;else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  11007. if (width) {
  11008. styleObj.width = width;
  11009. attrs.width = '100%';
  11010. if (parseInt(width) > windowWidth) {
  11011. styleObj.height = '';
  11012. if (attrs.height) attrs.height = void 0;
  11013. }
  11014. }
  11015. if (styleObj.height) {
  11016. attrs.height = styleObj.height;
  11017. styleObj.height = '';
  11018. } else if (attrs.height && !attrs.height.includes('%')) attrs.height = parseFloat(attrs.height) + 'px';
  11019. }
  11020. for (var key in styleObj) {
  11021. var value = styleObj[key];
  11022. if (!value) continue;
  11023. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  11024. // 填充链接
  11025. if (value.includes('url')) {
  11026. var j = value.indexOf('(');
  11027. if (j++ != -1) {
  11028. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {
  11029. j++;
  11030. }
  11031. value = value.substr(0, j) + this.getUrl(value.substr(j));
  11032. }
  11033. }
  11034. // 转换 rpx
  11035. else if (value.includes('rpx')) value = value.replace(/[0-9.]+\s*rpx/g, function ($) {
  11036. return parseFloat($) * windowWidth / 750 + 'px';
  11037. });else if (key == 'white-space' && value.includes('pre') && !close) this.pre = node.pre = true;
  11038. style += ";".concat(key, ":").concat(value);
  11039. }
  11040. style = style.substr(1);
  11041. if (style) attrs.style = style;
  11042. if (!close) {
  11043. node.children = [];
  11044. if (node.name == 'pre' && _config.default.highlight) {
  11045. this.remove(node);
  11046. this.pre = node.pre = true;
  11047. }
  11048. this.siblings().push(node);
  11049. this.STACK.push(node);
  11050. } else if (!_config.default.filter || _config.default.filter(node, this) != false) this.siblings().push(node);
  11051. } else {
  11052. if (!close) this.remove(node);else if (node.name == 'source') {
  11053. var parent = this.parent();
  11054. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src) parent.attrs.source.push(node.attrs.src);
  11055. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  11056. }
  11057. if (this.data[this.i] == '/') this.i++;
  11058. this.start = this.i + 1;
  11059. this.state = this.Text;
  11060. };
  11061. // 移除标签
  11062. MpHtmlParser.prototype.remove = function (node) {
  11063. var _this2 = this;
  11064. var name = node.name,
  11065. j = this.i;
  11066. // 处理 svg
  11067. var handleSvg = function handleSvg() {
  11068. var src = _this2.data.substring(j, _this2.i + 1);
  11069. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  11070. for (var key in node.attrs) {
  11071. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  11072. }
  11073. src = '<svg' + src;
  11074. var parent = _this2.parent();
  11075. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline')) parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  11076. _this2.siblings().push({
  11077. name: 'img',
  11078. attrs: {
  11079. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  11080. style: node.attrs.style,
  11081. ignore: 'T'
  11082. }
  11083. });
  11084. };
  11085. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  11086. while (1) {
  11087. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  11088. if (name == 'pre' || name == 'svg') this.i = j;else this.i = this.data.length;
  11089. return;
  11090. }
  11091. this.start = this.i += 2;
  11092. while (!blankChar[this.data[this.i]] && !this.isClose()) {
  11093. this.i++;
  11094. }
  11095. if (this.section().toLowerCase() == name) {
  11096. // 代码块高亮
  11097. if (name == 'pre') {
  11098. 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);
  11099. return this.i = j;
  11100. } 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);
  11101. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  11102. if (name == 'svg') handleSvg();
  11103. return;
  11104. }
  11105. }
  11106. };
  11107. // 节点出栈处理
  11108. MpHtmlParser.prototype.popNode = function (node) {
  11109. // 空白符处理
  11110. if (node.pre) {
  11111. node.pre = this.pre = void 0;
  11112. for (var i = this.STACK.length; i--;) {
  11113. if (this.STACK[i].pre) this.pre = true;
  11114. }
  11115. }
  11116. var siblings = this.siblings(),
  11117. len = siblings.length,
  11118. childs = node.children;
  11119. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false) return siblings.pop();
  11120. var attrs = node.attrs;
  11121. // 替换一些标签名
  11122. if (_config.default.blockTags[node.name]) node.name = 'div';else if (!_config.default.trustTags[node.name]) node.name = 'span';
  11123. // 处理列表
  11124. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  11125. if ((node.attrs.style || '').includes('list-style:none')) {
  11126. for (var _i = 0, child; child = childs[_i++];) {
  11127. if (child.name == 'li') child.name = 'div';
  11128. }
  11129. } else if (node.name == 'ul') {
  11130. var floor = 1;
  11131. for (var _i2 = this.STACK.length; _i2--;) {
  11132. if (this.STACK[_i2].name == 'ul') floor++;
  11133. }
  11134. if (floor != 1) for (var _i3 = childs.length; _i3--;) {
  11135. childs[_i3].floor = floor;
  11136. }
  11137. } else {
  11138. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  11139. if (_child.name == 'li') {
  11140. _child.type = 'ol';
  11141. _child.num = function (num, type) {
  11142. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  11143. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  11144. if (type == 'i' || type == 'I') {
  11145. num = (num - 1) % 99 + 1;
  11146. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  11147. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  11148. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  11149. if (type == 'i') return res.toLowerCase();
  11150. return res;
  11151. }
  11152. return num;
  11153. }(num++, attrs.type) + '.';
  11154. }
  11155. }
  11156. }
  11157. }
  11158. // 处理表格
  11159. if (node.name == 'table') {
  11160. var padding = parseFloat(attrs.cellpadding),
  11161. spacing = parseFloat(attrs.cellspacing),
  11162. border = parseFloat(attrs.border);
  11163. if (node.c) {
  11164. if (isNaN(padding)) padding = 2;
  11165. if (isNaN(spacing)) spacing = 2;
  11166. }
  11167. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  11168. if (node.flag && node.c) {
  11169. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  11170. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  11171. var row = 1,
  11172. col = 1,
  11173. colNum,
  11174. trs = [],
  11175. children = [],
  11176. map = {};
  11177. (function f(ns) {
  11178. for (var i = 0; i < ns.length; i++) {
  11179. if (ns[i].name == 'tr') trs.push(ns[i]);else f(ns[i].children || []);
  11180. }
  11181. })(node.children);
  11182. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  11183. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  11184. if (td.name == 'td' || td.name == 'th') {
  11185. while (map[row + '.' + col]) {
  11186. col++;
  11187. }
  11188. var cell = {
  11189. name: 'div',
  11190. c: 1,
  11191. attrs: {
  11192. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' : ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '')
  11193. },
  11194. children: td.children
  11195. };
  11196. if (td.attrs.colspan) {
  11197. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  11198. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  11199. col += parseInt(td.attrs.colspan) - 1;
  11200. }
  11201. if (td.attrs.rowspan) {
  11202. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  11203. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  11204. for (var k = 1; k < td.attrs.rowspan; k++) {
  11205. map[row + k + '.' + col] = 1;
  11206. }
  11207. }
  11208. children.push(cell);
  11209. col++;
  11210. }
  11211. }
  11212. if (!colNum) {
  11213. colNum = col - 1;
  11214. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  11215. }
  11216. col = 1;
  11217. row++;
  11218. }
  11219. node.children = children;
  11220. } else {
  11221. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  11222. if (border || padding) (function f(ns) {
  11223. for (var i = 0, n; n = ns[i]; i++) {
  11224. if (n.name == 'th' || n.name == 'td') {
  11225. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  11226. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  11227. } else f(n.children || []);
  11228. }
  11229. })(childs);
  11230. }
  11231. if (this.options.autoscroll) {
  11232. var table = Object.assign({}, node);
  11233. node.name = 'div';
  11234. node.attrs = {
  11235. style: 'overflow:scroll'
  11236. };
  11237. node.children = [table];
  11238. }
  11239. }
  11240. this.CssHandler.pop && this.CssHandler.pop(node);
  11241. // 自动压缩
  11242. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div') siblings[len - 1] = childs[0];
  11243. };
  11244. // 状态机
  11245. MpHtmlParser.prototype.Text = function (c) {
  11246. if (c == '<') {
  11247. var next = this.data[this.i + 1],
  11248. isLetter = function isLetter(c) {
  11249. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  11250. };
  11251. if (isLetter(next)) {
  11252. this.setText();
  11253. this.start = this.i + 1;
  11254. this.state = this.TagName;
  11255. } else if (next == '/') {
  11256. this.setText();
  11257. if (isLetter(this.data[++this.i + 1])) {
  11258. this.start = this.i + 1;
  11259. this.state = this.EndTag;
  11260. } else this.Comment();
  11261. } else if (next == '!' || next == '?') {
  11262. this.setText();
  11263. this.Comment();
  11264. }
  11265. }
  11266. };
  11267. MpHtmlParser.prototype.Comment = function () {
  11268. var key;
  11269. 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 = '>';
  11270. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else this.i += key.length - 1;
  11271. this.start = this.i + 1;
  11272. this.state = this.Text;
  11273. };
  11274. MpHtmlParser.prototype.TagName = function (c) {
  11275. if (blankChar[c]) {
  11276. this.tagName = this.section();
  11277. while (blankChar[this.data[this.i]]) {
  11278. this.i++;
  11279. }
  11280. if (this.isClose()) this.setNode();else {
  11281. this.start = this.i;
  11282. this.state = this.AttrName;
  11283. }
  11284. } else if (this.isClose()) {
  11285. this.tagName = this.section();
  11286. this.setNode();
  11287. }
  11288. };
  11289. MpHtmlParser.prototype.AttrName = function (c) {
  11290. if (c == '=' || blankChar[c] || this.isClose()) {
  11291. this.attrName = this.section();
  11292. if (blankChar[c]) while (blankChar[this.data[++this.i]]) {
  11293. ;
  11294. }
  11295. if (this.data[this.i] == '=') {
  11296. while (blankChar[this.data[++this.i]]) {
  11297. ;
  11298. }
  11299. this.start = this.i--;
  11300. this.state = this.AttrValue;
  11301. } else this.setAttr();
  11302. }
  11303. };
  11304. MpHtmlParser.prototype.AttrValue = function (c) {
  11305. if (c == '"' || c == "'") {
  11306. this.start++;
  11307. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  11308. this.attrVal = this.section();
  11309. this.i++;
  11310. } else {
  11311. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {
  11312. ;
  11313. }
  11314. this.attrVal = this.section();
  11315. }
  11316. this.setAttr();
  11317. };
  11318. MpHtmlParser.prototype.EndTag = function (c) {
  11319. if (blankChar[c] || c == '>' || c == '/') {
  11320. var name = this.section().toLowerCase();
  11321. for (var i = this.STACK.length; i--;) {
  11322. if (this.STACK[i].name == name) break;
  11323. }
  11324. if (i != -1) {
  11325. var node;
  11326. while ((node = this.STACK.pop()).name != name) {
  11327. this.popNode(node);
  11328. }
  11329. this.popNode(node);
  11330. } else if (name == 'p' || name == 'br') this.siblings().push({
  11331. name: name,
  11332. attrs: {}
  11333. });
  11334. this.i = this.data.indexOf('>', this.i);
  11335. this.start = this.i + 1;
  11336. if (this.i == -1) this.i = this.data.length;else this.state = this.Text;
  11337. }
  11338. };
  11339. var _default = MpHtmlParser;
  11340. exports.default = _default;
  11341. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11342. /***/ }),
  11343. /***/ 401:
  11344. /*!*******************************************************************************!*\
  11345. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  11346. \*******************************************************************************/
  11347. /*! no static exports found */
  11348. /***/ (function(module, exports, __webpack_require__) {
  11349. "use strict";
  11350. /* WEBPACK VAR INJECTION */(function(wx) {
  11351. Object.defineProperty(exports, "__esModule", {
  11352. value: true
  11353. });
  11354. exports.default = void 0;
  11355. /* 配置文件 */
  11356. var cfg = {
  11357. // 出错占位图
  11358. errorImg: null,
  11359. // 过滤器函数
  11360. filter: null,
  11361. // 代码高亮函数
  11362. highlight: null,
  11363. // 文本处理函数
  11364. onText: null,
  11365. // 实体编码列表
  11366. entities: {
  11367. quot: '"',
  11368. apos: "'",
  11369. semi: ';',
  11370. nbsp: '\xA0',
  11371. ensp: "\u2002",
  11372. emsp: "\u2003",
  11373. ndash: '–',
  11374. mdash: '—',
  11375. middot: '·',
  11376. lsquo: '‘',
  11377. rsquo: '’',
  11378. ldquo: '“',
  11379. rdquo: '”',
  11380. bull: '•',
  11381. hellip: '…'
  11382. },
  11383. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  11384. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  11385. // 块级标签,将被转为 div
  11386. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  11387. // 将被移除的标签
  11388. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  11389. // 只能被 rich-text 显示的标签
  11390. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  11391. // 自闭合的标签
  11392. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  11393. // 信任的标签
  11394. 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'),
  11395. // 默认的标签样式
  11396. userAgentStyles: {
  11397. address: 'font-style:italic',
  11398. big: 'display:inline;font-size:1.2em',
  11399. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  11400. caption: 'display:table-caption;text-align:center',
  11401. center: 'text-align:center',
  11402. cite: 'font-style:italic',
  11403. dd: 'margin-left:40px',
  11404. mark: 'background-color:yellow',
  11405. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  11406. s: 'text-decoration:line-through',
  11407. small: 'display:inline;font-size:0.8em',
  11408. u: 'text-decoration:underline'
  11409. }
  11410. };
  11411. function makeMap(str) {
  11412. var map = Object.create(null),
  11413. list = str.split(',');
  11414. for (var i = list.length; i--;) {
  11415. map[list[i]] = true;
  11416. }
  11417. return map;
  11418. }
  11419. if (wx.canIUse('editor')) {
  11420. cfg.blockTags.pre = void 0;
  11421. cfg.ignoreTags.rp = true;
  11422. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  11423. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  11424. }
  11425. var _default = cfg;
  11426. exports.default = _default;
  11427. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  11428. /***/ }),
  11429. /***/ 402:
  11430. /*!***********************************************************************************!*\
  11431. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  11432. \***********************************************************************************/
  11433. /*! no static exports found */
  11434. /***/ (function(module, exports, __webpack_require__) {
  11435. "use strict";
  11436. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11437. Object.defineProperty(exports, "__esModule", {
  11438. value: true
  11439. });
  11440. exports.default = void 0;
  11441. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 401));
  11442. var isLetter = function isLetter(c) {
  11443. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  11444. };
  11445. function CssHandler(tagStyle) {
  11446. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  11447. for (var item in tagStyle) {
  11448. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
  11449. }
  11450. this.styles = styles;
  11451. }
  11452. CssHandler.prototype.getStyle = function (data) {
  11453. this.styles = new parser(data, this.styles).parse();
  11454. };
  11455. CssHandler.prototype.match = function (name, attrs) {
  11456. var tmp,
  11457. matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  11458. if (attrs.class) {
  11459. var items = attrs.class.split(' ');
  11460. for (var i = 0, item; item = items[i]; i++) {
  11461. if (tmp = this.styles['.' + item]) matched += tmp + ';';
  11462. }
  11463. }
  11464. if (tmp = this.styles['#' + attrs.id]) matched += tmp + ';';
  11465. return matched;
  11466. };
  11467. var _default = CssHandler;
  11468. exports.default = _default;
  11469. function parser(data, init) {
  11470. this.data = data;
  11471. this.floor = 0;
  11472. this.i = 0;
  11473. this.list = [];
  11474. this.res = init;
  11475. this.state = this.Space;
  11476. }
  11477. parser.prototype.parse = function () {
  11478. for (var c; c = this.data[this.i]; this.i++) {
  11479. this.state(c);
  11480. }
  11481. return this.res;
  11482. };
  11483. parser.prototype.section = function () {
  11484. return this.data.substring(this.start, this.i);
  11485. };
  11486. // 状态机
  11487. parser.prototype.Space = function (c) {
  11488. if (c == '.' || c == '#' || isLetter(c)) {
  11489. this.start = this.i;
  11490. this.state = this.Name;
  11491. } else if (c == '/' && this.data[this.i + 1] == '*') this.Comment();else if (!_config.default.blankChar[c] && c != ';') this.state = this.Ignore;
  11492. };
  11493. parser.prototype.Comment = function () {
  11494. this.i = this.data.indexOf('*/', this.i) + 1;
  11495. if (!this.i) this.i = this.data.length;
  11496. this.state = this.Space;
  11497. };
  11498. parser.prototype.Ignore = function (c) {
  11499. if (c == '{') this.floor++;else if (c == '}' && ! --this.floor) {
  11500. this.list = [];
  11501. this.state = this.Space;
  11502. }
  11503. };
  11504. parser.prototype.Name = function (c) {
  11505. if (_config.default.blankChar[c]) {
  11506. this.list.push(this.section());
  11507. this.state = this.NameSpace;
  11508. } else if (c == '{') {
  11509. this.list.push(this.section());
  11510. this.Content();
  11511. } else if (c == ',') {
  11512. this.list.push(this.section());
  11513. this.Comma();
  11514. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_') this.state = this.Ignore;
  11515. };
  11516. parser.prototype.NameSpace = function (c) {
  11517. if (c == '{') this.Content();else if (c == ',') this.Comma();else if (!_config.default.blankChar[c]) this.state = this.Ignore;
  11518. };
  11519. parser.prototype.Comma = function () {
  11520. while (_config.default.blankChar[this.data[++this.i]]) {
  11521. ;
  11522. }
  11523. if (this.data[this.i] == '{') this.Content();else {
  11524. this.start = this.i--;
  11525. this.state = this.Name;
  11526. }
  11527. };
  11528. parser.prototype.Content = function () {
  11529. this.start = ++this.i;
  11530. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  11531. var content = this.section();
  11532. for (var i = 0, item; item = this.list[i++];) {
  11533. if (this.res[item]) this.res[item] += ';' + content;else this.res[item] = content;
  11534. }
  11535. this.list = [];
  11536. this.state = this.Space;
  11537. };
  11538. /***/ }),
  11539. /***/ 41:
  11540. /*!************************************************************************************************!*\
  11541. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  11542. \************************************************************************************************/
  11543. /*! no static exports found */
  11544. /***/ (function(module, exports, __webpack_require__) {
  11545. // TODO(Babel 8): Remove this file.
  11546. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 42)();
  11547. module.exports = runtime;
  11548. /***/ }),
  11549. /***/ 42:
  11550. /*!*******************************************************************!*\
  11551. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  11552. \*******************************************************************/
  11553. /*! no static exports found */
  11554. /***/ (function(module, exports, __webpack_require__) {
  11555. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  11556. function _regeneratorRuntime() {
  11557. "use strict";
  11558. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  11559. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  11560. return exports;
  11561. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11562. var exports = {},
  11563. Op = Object.prototype,
  11564. hasOwn = Op.hasOwnProperty,
  11565. defineProperty = Object.defineProperty || function (obj, key, desc) {
  11566. obj[key] = desc.value;
  11567. },
  11568. $Symbol = "function" == typeof Symbol ? Symbol : {},
  11569. iteratorSymbol = $Symbol.iterator || "@@iterator",
  11570. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  11571. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  11572. function define(obj, key, value) {
  11573. return Object.defineProperty(obj, key, {
  11574. value: value,
  11575. enumerable: !0,
  11576. configurable: !0,
  11577. writable: !0
  11578. }), obj[key];
  11579. }
  11580. try {
  11581. define({}, "");
  11582. } catch (err) {
  11583. define = function define(obj, key, value) {
  11584. return obj[key] = value;
  11585. };
  11586. }
  11587. function wrap(innerFn, outerFn, self, tryLocsList) {
  11588. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  11589. generator = Object.create(protoGenerator.prototype),
  11590. context = new Context(tryLocsList || []);
  11591. return defineProperty(generator, "_invoke", {
  11592. value: makeInvokeMethod(innerFn, self, context)
  11593. }), generator;
  11594. }
  11595. function tryCatch(fn, obj, arg) {
  11596. try {
  11597. return {
  11598. type: "normal",
  11599. arg: fn.call(obj, arg)
  11600. };
  11601. } catch (err) {
  11602. return {
  11603. type: "throw",
  11604. arg: err
  11605. };
  11606. }
  11607. }
  11608. exports.wrap = wrap;
  11609. var ContinueSentinel = {};
  11610. function Generator() {}
  11611. function GeneratorFunction() {}
  11612. function GeneratorFunctionPrototype() {}
  11613. var IteratorPrototype = {};
  11614. define(IteratorPrototype, iteratorSymbol, function () {
  11615. return this;
  11616. });
  11617. var getProto = Object.getPrototypeOf,
  11618. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  11619. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  11620. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  11621. function defineIteratorMethods(prototype) {
  11622. ["next", "throw", "return"].forEach(function (method) {
  11623. define(prototype, method, function (arg) {
  11624. return this._invoke(method, arg);
  11625. });
  11626. });
  11627. }
  11628. function AsyncIterator(generator, PromiseImpl) {
  11629. function invoke(method, arg, resolve, reject) {
  11630. var record = tryCatch(generator[method], generator, arg);
  11631. if ("throw" !== record.type) {
  11632. var result = record.arg,
  11633. value = result.value;
  11634. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  11635. invoke("next", value, resolve, reject);
  11636. }, function (err) {
  11637. invoke("throw", err, resolve, reject);
  11638. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  11639. result.value = unwrapped, resolve(result);
  11640. }, function (error) {
  11641. return invoke("throw", error, resolve, reject);
  11642. });
  11643. }
  11644. reject(record.arg);
  11645. }
  11646. var previousPromise;
  11647. defineProperty(this, "_invoke", {
  11648. value: function value(method, arg) {
  11649. function callInvokeWithMethodAndArg() {
  11650. return new PromiseImpl(function (resolve, reject) {
  11651. invoke(method, arg, resolve, reject);
  11652. });
  11653. }
  11654. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  11655. }
  11656. });
  11657. }
  11658. function makeInvokeMethod(innerFn, self, context) {
  11659. var state = "suspendedStart";
  11660. return function (method, arg) {
  11661. if ("executing" === state) throw new Error("Generator is already running");
  11662. if ("completed" === state) {
  11663. if ("throw" === method) throw arg;
  11664. return doneResult();
  11665. }
  11666. for (context.method = method, context.arg = arg;;) {
  11667. var delegate = context.delegate;
  11668. if (delegate) {
  11669. var delegateResult = maybeInvokeDelegate(delegate, context);
  11670. if (delegateResult) {
  11671. if (delegateResult === ContinueSentinel) continue;
  11672. return delegateResult;
  11673. }
  11674. }
  11675. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  11676. if ("suspendedStart" === state) throw state = "completed", context.arg;
  11677. context.dispatchException(context.arg);
  11678. } else "return" === context.method && context.abrupt("return", context.arg);
  11679. state = "executing";
  11680. var record = tryCatch(innerFn, self, context);
  11681. if ("normal" === record.type) {
  11682. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  11683. return {
  11684. value: record.arg,
  11685. done: context.done
  11686. };
  11687. }
  11688. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  11689. }
  11690. };
  11691. }
  11692. function maybeInvokeDelegate(delegate, context) {
  11693. var methodName = context.method,
  11694. method = delegate.iterator[methodName];
  11695. 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;
  11696. var record = tryCatch(method, delegate.iterator, context.arg);
  11697. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  11698. var info = record.arg;
  11699. 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);
  11700. }
  11701. function pushTryEntry(locs) {
  11702. var entry = {
  11703. tryLoc: locs[0]
  11704. };
  11705. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  11706. }
  11707. function resetTryEntry(entry) {
  11708. var record = entry.completion || {};
  11709. record.type = "normal", delete record.arg, entry.completion = record;
  11710. }
  11711. function Context(tryLocsList) {
  11712. this.tryEntries = [{
  11713. tryLoc: "root"
  11714. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  11715. }
  11716. function values(iterable) {
  11717. if (iterable) {
  11718. var iteratorMethod = iterable[iteratorSymbol];
  11719. if (iteratorMethod) return iteratorMethod.call(iterable);
  11720. if ("function" == typeof iterable.next) return iterable;
  11721. if (!isNaN(iterable.length)) {
  11722. var i = -1,
  11723. next = function next() {
  11724. for (; ++i < iterable.length;) {
  11725. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  11726. }
  11727. return next.value = undefined, next.done = !0, next;
  11728. };
  11729. return next.next = next;
  11730. }
  11731. }
  11732. return {
  11733. next: doneResult
  11734. };
  11735. }
  11736. function doneResult() {
  11737. return {
  11738. value: undefined,
  11739. done: !0
  11740. };
  11741. }
  11742. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  11743. value: GeneratorFunctionPrototype,
  11744. configurable: !0
  11745. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  11746. value: GeneratorFunction,
  11747. configurable: !0
  11748. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  11749. var ctor = "function" == typeof genFun && genFun.constructor;
  11750. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  11751. }, exports.mark = function (genFun) {
  11752. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  11753. }, exports.awrap = function (arg) {
  11754. return {
  11755. __await: arg
  11756. };
  11757. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  11758. return this;
  11759. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  11760. void 0 === PromiseImpl && (PromiseImpl = Promise);
  11761. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  11762. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  11763. return result.done ? result.value : iter.next();
  11764. });
  11765. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  11766. return this;
  11767. }), define(Gp, "toString", function () {
  11768. return "[object Generator]";
  11769. }), exports.keys = function (val) {
  11770. var object = Object(val),
  11771. keys = [];
  11772. for (var key in object) {
  11773. keys.push(key);
  11774. }
  11775. return keys.reverse(), function next() {
  11776. for (; keys.length;) {
  11777. var key = keys.pop();
  11778. if (key in object) return next.value = key, next.done = !1, next;
  11779. }
  11780. return next.done = !0, next;
  11781. };
  11782. }, exports.values = values, Context.prototype = {
  11783. constructor: Context,
  11784. reset: function reset(skipTempReset) {
  11785. 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) {
  11786. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  11787. }
  11788. },
  11789. stop: function stop() {
  11790. this.done = !0;
  11791. var rootRecord = this.tryEntries[0].completion;
  11792. if ("throw" === rootRecord.type) throw rootRecord.arg;
  11793. return this.rval;
  11794. },
  11795. dispatchException: function dispatchException(exception) {
  11796. if (this.done) throw exception;
  11797. var context = this;
  11798. function handle(loc, caught) {
  11799. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  11800. }
  11801. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11802. var entry = this.tryEntries[i],
  11803. record = entry.completion;
  11804. if ("root" === entry.tryLoc) return handle("end");
  11805. if (entry.tryLoc <= this.prev) {
  11806. var hasCatch = hasOwn.call(entry, "catchLoc"),
  11807. hasFinally = hasOwn.call(entry, "finallyLoc");
  11808. if (hasCatch && hasFinally) {
  11809. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11810. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11811. } else if (hasCatch) {
  11812. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11813. } else {
  11814. if (!hasFinally) throw new Error("try statement without catch or finally");
  11815. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11816. }
  11817. }
  11818. }
  11819. },
  11820. abrupt: function abrupt(type, arg) {
  11821. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11822. var entry = this.tryEntries[i];
  11823. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  11824. var finallyEntry = entry;
  11825. break;
  11826. }
  11827. }
  11828. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  11829. var record = finallyEntry ? finallyEntry.completion : {};
  11830. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  11831. },
  11832. complete: function complete(record, afterLoc) {
  11833. if ("throw" === record.type) throw record.arg;
  11834. 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;
  11835. },
  11836. finish: function finish(finallyLoc) {
  11837. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11838. var entry = this.tryEntries[i];
  11839. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  11840. }
  11841. },
  11842. "catch": function _catch(tryLoc) {
  11843. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11844. var entry = this.tryEntries[i];
  11845. if (entry.tryLoc === tryLoc) {
  11846. var record = entry.completion;
  11847. if ("throw" === record.type) {
  11848. var thrown = record.arg;
  11849. resetTryEntry(entry);
  11850. }
  11851. return thrown;
  11852. }
  11853. }
  11854. throw new Error("illegal catch attempt");
  11855. },
  11856. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  11857. return this.delegate = {
  11858. iterator: values(iterable),
  11859. resultName: resultName,
  11860. nextLoc: nextLoc
  11861. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  11862. }
  11863. }, exports;
  11864. }
  11865. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11866. /***/ }),
  11867. /***/ 43:
  11868. /*!*****************************************************************!*\
  11869. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  11870. \*****************************************************************/
  11871. /*! no static exports found */
  11872. /***/ (function(module, exports) {
  11873. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  11874. try {
  11875. var info = gen[key](arg);
  11876. var value = info.value;
  11877. } catch (error) {
  11878. reject(error);
  11879. return;
  11880. }
  11881. if (info.done) {
  11882. resolve(value);
  11883. } else {
  11884. Promise.resolve(value).then(_next, _throw);
  11885. }
  11886. }
  11887. function _asyncToGenerator(fn) {
  11888. return function () {
  11889. var self = this,
  11890. args = arguments;
  11891. return new Promise(function (resolve, reject) {
  11892. var gen = fn.apply(self, args);
  11893. function _next(value) {
  11894. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  11895. }
  11896. function _throw(err) {
  11897. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  11898. }
  11899. _next(undefined);
  11900. });
  11901. };
  11902. }
  11903. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11904. /***/ }),
  11905. /***/ 438:
  11906. /*!******************************************************************!*\
  11907. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  11908. \******************************************************************/
  11909. /*! no static exports found */
  11910. /***/ (function(module, exports, __webpack_require__) {
  11911. "use strict";
  11912. Object.defineProperty(exports, "__esModule", {
  11913. value: true
  11914. });
  11915. exports.default = void 0;
  11916. /**
  11917. * 递归使用 call 方式this指向
  11918. * @param componentName // 需要找的组件的名称
  11919. * @param eventName // 事件名称
  11920. * @param params // 需要传递的参数
  11921. */
  11922. function _broadcast(componentName, eventName, params) {
  11923. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  11924. var $children;
  11925. $children = this.$children;
  11926. $children.map(function (child) {
  11927. if (componentName === child.$options.name) {
  11928. child.$emit.apply(child, [eventName].concat(params));
  11929. } else {
  11930. _broadcast.apply(child, [componentName, eventName].concat(params));
  11931. }
  11932. });
  11933. }
  11934. var _default = {
  11935. methods: {
  11936. /**
  11937. * 派发 (向上查找) (一个)
  11938. * @param componentName // 需要找的组件的名称
  11939. * @param eventName // 事件名称
  11940. * @param params // 需要传递的参数
  11941. */
  11942. dispatch: function dispatch(componentName, eventName, params) {
  11943. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  11944. var name = parent.$options.name; // 获取当前组件实例的name
  11945. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  11946. // 循环出当前名称的一样的组件实例
  11947. while (parent && (!name || name !== componentName)) {
  11948. parent = parent.$parent;
  11949. if (parent) {
  11950. name = parent.$options.name;
  11951. }
  11952. }
  11953. // 有节点表示当前找到了name一样的实例
  11954. if (parent) {
  11955. parent.$emit.apply(parent, [eventName].concat(params));
  11956. }
  11957. },
  11958. /**
  11959. * 广播 (向下查找) (广播多个)
  11960. * @param componentName // 需要找的组件的名称
  11961. * @param eventName // 事件名称
  11962. * @param params // 需要传递的参数
  11963. */
  11964. broadcast: function broadcast(componentName, eventName, params) {
  11965. _broadcast.call(this, componentName, eventName, params);
  11966. }
  11967. }
  11968. };
  11969. exports.default = _default;
  11970. /***/ }),
  11971. /***/ 439:
  11972. /*!**************************************************************************!*\
  11973. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  11974. \**************************************************************************/
  11975. /*! no static exports found */
  11976. /***/ (function(module, exports, __webpack_require__) {
  11977. "use strict";
  11978. /* WEBPACK VAR INJECTION */(function(process) {
  11979. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11980. Object.defineProperty(exports, "__esModule", {
  11981. value: true
  11982. });
  11983. exports.default = void 0;
  11984. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11985. function _extends() {
  11986. _extends = Object.assign || function (target) {
  11987. for (var i = 1; i < arguments.length; i++) {
  11988. var source = arguments[i];
  11989. for (var key in source) {
  11990. if (Object.prototype.hasOwnProperty.call(source, key)) {
  11991. target[key] = source[key];
  11992. }
  11993. }
  11994. }
  11995. return target;
  11996. };
  11997. return _extends.apply(this, arguments);
  11998. }
  11999. /* eslint no-console:0 */
  12000. var formatRegExp = /%[sdj%]/g;
  12001. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  12002. if (typeof process !== 'undefined' && Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
  12003. warning = function warning(type, errors) {
  12004. if (typeof console !== 'undefined' && console.warn) {
  12005. if (errors.every(function (e) {
  12006. return typeof e === 'string';
  12007. })) {
  12008. console.warn(type, errors);
  12009. }
  12010. }
  12011. };
  12012. }
  12013. function convertFieldsError(errors) {
  12014. if (!errors || !errors.length) return null;
  12015. var fields = {};
  12016. errors.forEach(function (error) {
  12017. var field = error.field;
  12018. fields[field] = fields[field] || [];
  12019. fields[field].push(error);
  12020. });
  12021. return fields;
  12022. }
  12023. function format() {
  12024. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  12025. args[_key] = arguments[_key];
  12026. }
  12027. var i = 1;
  12028. var f = args[0];
  12029. var len = args.length;
  12030. if (typeof f === 'function') {
  12031. return f.apply(null, args.slice(1));
  12032. }
  12033. if (typeof f === 'string') {
  12034. var str = String(f).replace(formatRegExp, function (x) {
  12035. if (x === '%%') {
  12036. return '%';
  12037. }
  12038. if (i >= len) {
  12039. return x;
  12040. }
  12041. switch (x) {
  12042. case '%s':
  12043. return String(args[i++]);
  12044. case '%d':
  12045. return Number(args[i++]);
  12046. case '%j':
  12047. try {
  12048. return JSON.stringify(args[i++]);
  12049. } catch (_) {
  12050. return '[Circular]';
  12051. }
  12052. break;
  12053. default:
  12054. return x;
  12055. }
  12056. });
  12057. for (var arg = args[i]; i < len; arg = args[++i]) {
  12058. str += " " + arg;
  12059. }
  12060. return str;
  12061. }
  12062. return f;
  12063. }
  12064. function isNativeStringType(type) {
  12065. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  12066. }
  12067. function isEmptyValue(value, type) {
  12068. if (value === undefined || value === null) {
  12069. return true;
  12070. }
  12071. if (type === 'array' && Array.isArray(value) && !value.length) {
  12072. return true;
  12073. }
  12074. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  12075. return true;
  12076. }
  12077. return false;
  12078. }
  12079. function asyncParallelArray(arr, func, callback) {
  12080. var results = [];
  12081. var total = 0;
  12082. var arrLength = arr.length;
  12083. function count(errors) {
  12084. results.push.apply(results, errors);
  12085. total++;
  12086. if (total === arrLength) {
  12087. callback(results);
  12088. }
  12089. }
  12090. arr.forEach(function (a) {
  12091. func(a, count);
  12092. });
  12093. }
  12094. function asyncSerialArray(arr, func, callback) {
  12095. var index = 0;
  12096. var arrLength = arr.length;
  12097. function next(errors) {
  12098. if (errors && errors.length) {
  12099. callback(errors);
  12100. return;
  12101. }
  12102. var original = index;
  12103. index = index + 1;
  12104. if (original < arrLength) {
  12105. func(arr[original], next);
  12106. } else {
  12107. callback([]);
  12108. }
  12109. }
  12110. next([]);
  12111. }
  12112. function flattenObjArr(objArr) {
  12113. var ret = [];
  12114. Object.keys(objArr).forEach(function (k) {
  12115. ret.push.apply(ret, objArr[k]);
  12116. });
  12117. return ret;
  12118. }
  12119. function asyncMap(objArr, option, func, callback) {
  12120. if (option.first) {
  12121. var _pending = new Promise(function (resolve, reject) {
  12122. var next = function next(errors) {
  12123. callback(errors);
  12124. return errors.length ? reject({
  12125. errors: errors,
  12126. fields: convertFieldsError(errors)
  12127. }) : resolve();
  12128. };
  12129. var flattenArr = flattenObjArr(objArr);
  12130. asyncSerialArray(flattenArr, func, next);
  12131. });
  12132. _pending["catch"](function (e) {
  12133. return e;
  12134. });
  12135. return _pending;
  12136. }
  12137. var firstFields = option.firstFields || [];
  12138. if (firstFields === true) {
  12139. firstFields = Object.keys(objArr);
  12140. }
  12141. var objArrKeys = Object.keys(objArr);
  12142. var objArrLength = objArrKeys.length;
  12143. var total = 0;
  12144. var results = [];
  12145. var pending = new Promise(function (resolve, reject) {
  12146. var next = function next(errors) {
  12147. results.push.apply(results, errors);
  12148. total++;
  12149. if (total === objArrLength) {
  12150. callback(results);
  12151. return results.length ? reject({
  12152. errors: results,
  12153. fields: convertFieldsError(results)
  12154. }) : resolve();
  12155. }
  12156. };
  12157. if (!objArrKeys.length) {
  12158. callback(results);
  12159. resolve();
  12160. }
  12161. objArrKeys.forEach(function (key) {
  12162. var arr = objArr[key];
  12163. if (firstFields.indexOf(key) !== -1) {
  12164. asyncSerialArray(arr, func, next);
  12165. } else {
  12166. asyncParallelArray(arr, func, next);
  12167. }
  12168. });
  12169. });
  12170. pending["catch"](function (e) {
  12171. return e;
  12172. });
  12173. return pending;
  12174. }
  12175. function complementError(rule) {
  12176. return function (oe) {
  12177. if (oe && oe.message) {
  12178. oe.field = oe.field || rule.fullField;
  12179. return oe;
  12180. }
  12181. return {
  12182. message: typeof oe === 'function' ? oe() : oe,
  12183. field: oe.field || rule.fullField
  12184. };
  12185. };
  12186. }
  12187. function deepMerge(target, source) {
  12188. if (source) {
  12189. for (var s in source) {
  12190. if (source.hasOwnProperty(s)) {
  12191. var value = source[s];
  12192. if ((0, _typeof2.default)(value) === 'object' && (0, _typeof2.default)(target[s]) === 'object') {
  12193. target[s] = _extends({}, target[s], {}, value);
  12194. } else {
  12195. target[s] = value;
  12196. }
  12197. }
  12198. }
  12199. }
  12200. return target;
  12201. }
  12202. /**
  12203. * Rule for validating required fields.
  12204. *
  12205. * @param rule The validation rule.
  12206. * @param value The value of the field on the source object.
  12207. * @param source The source object being validated.
  12208. * @param errors An array of errors that this rule may add
  12209. * validation errors to.
  12210. * @param options The validation options.
  12211. * @param options.messages The validation messages.
  12212. */
  12213. function required(rule, value, source, errors, options, type) {
  12214. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  12215. errors.push(format(options.messages.required, rule.fullField));
  12216. }
  12217. }
  12218. /**
  12219. * Rule for validating whitespace.
  12220. *
  12221. * @param rule The validation rule.
  12222. * @param value The value of the field on the source object.
  12223. * @param source The source object being validated.
  12224. * @param errors An array of errors that this rule may add
  12225. * validation errors to.
  12226. * @param options The validation options.
  12227. * @param options.messages The validation messages.
  12228. */
  12229. function whitespace(rule, value, source, errors, options) {
  12230. if (/^\s+$/.test(value) || value === '') {
  12231. errors.push(format(options.messages.whitespace, rule.fullField));
  12232. }
  12233. }
  12234. /* eslint max-len:0 */
  12235. var pattern = {
  12236. // http://emailregex.com/
  12237. 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,}))$/,
  12238. 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'),
  12239. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  12240. };
  12241. var types = {
  12242. integer: function integer(value) {
  12243. return types.number(value) && parseInt(value, 10) === value;
  12244. },
  12245. "float": function float(value) {
  12246. return types.number(value) && !types.integer(value);
  12247. },
  12248. array: function array(value) {
  12249. return Array.isArray(value);
  12250. },
  12251. regexp: function regexp(value) {
  12252. if (value instanceof RegExp) {
  12253. return true;
  12254. }
  12255. try {
  12256. return !!new RegExp(value);
  12257. } catch (e) {
  12258. return false;
  12259. }
  12260. },
  12261. date: function date(value) {
  12262. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
  12263. },
  12264. number: function number(value) {
  12265. if (isNaN(value)) {
  12266. return false;
  12267. }
  12268. // 修改源码,将字符串数值先转为数值
  12269. return typeof +value === 'number';
  12270. },
  12271. object: function object(value) {
  12272. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  12273. },
  12274. method: function method(value) {
  12275. return typeof value === 'function';
  12276. },
  12277. email: function email(value) {
  12278. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  12279. },
  12280. url: function url(value) {
  12281. return typeof value === 'string' && !!value.match(pattern.url);
  12282. },
  12283. hex: function hex(value) {
  12284. return typeof value === 'string' && !!value.match(pattern.hex);
  12285. }
  12286. };
  12287. /**
  12288. * Rule for validating the type of a value.
  12289. *
  12290. * @param rule The validation rule.
  12291. * @param value The value of the field on the source object.
  12292. * @param source The source object being validated.
  12293. * @param errors An array of errors that this rule may add
  12294. * validation errors to.
  12295. * @param options The validation options.
  12296. * @param options.messages The validation messages.
  12297. */
  12298. function type(rule, value, source, errors, options) {
  12299. if (rule.required && value === undefined) {
  12300. required(rule, value, source, errors, options);
  12301. return;
  12302. }
  12303. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  12304. var ruleType = rule.type;
  12305. if (custom.indexOf(ruleType) > -1) {
  12306. if (!types[ruleType](value)) {
  12307. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  12308. } // straight typeof check
  12309. } else if (ruleType && (0, _typeof2.default)(value) !== rule.type) {
  12310. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  12311. }
  12312. }
  12313. /**
  12314. * Rule for validating minimum and maximum allowed values.
  12315. *
  12316. * @param rule The validation rule.
  12317. * @param value The value of the field on the source object.
  12318. * @param source The source object being validated.
  12319. * @param errors An array of errors that this rule may add
  12320. * validation errors to.
  12321. * @param options The validation options.
  12322. * @param options.messages The validation messages.
  12323. */
  12324. function range(rule, value, source, errors, options) {
  12325. var len = typeof rule.len === 'number';
  12326. var min = typeof rule.min === 'number';
  12327. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  12328. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  12329. var val = value;
  12330. var key = null;
  12331. var num = typeof value === 'number';
  12332. var str = typeof value === 'string';
  12333. var arr = Array.isArray(value);
  12334. if (num) {
  12335. key = 'number';
  12336. } else if (str) {
  12337. key = 'string';
  12338. } else if (arr) {
  12339. key = 'array';
  12340. } // if the value is not of a supported type for range validation
  12341. // the validation rule rule should use the
  12342. // type property to also test for a particular type
  12343. if (!key) {
  12344. return false;
  12345. }
  12346. if (arr) {
  12347. val = value.length;
  12348. }
  12349. if (str) {
  12350. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  12351. val = value.replace(spRegexp, '_').length;
  12352. }
  12353. if (len) {
  12354. if (val !== rule.len) {
  12355. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  12356. }
  12357. } else if (min && !max && val < rule.min) {
  12358. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  12359. } else if (max && !min && val > rule.max) {
  12360. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  12361. } else if (min && max && (val < rule.min || val > rule.max)) {
  12362. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  12363. }
  12364. }
  12365. var ENUM = 'enum';
  12366. /**
  12367. * Rule for validating a value exists in an enumerable list.
  12368. *
  12369. * @param rule The validation rule.
  12370. * @param value The value of the field on the source object.
  12371. * @param source The source object being validated.
  12372. * @param errors An array of errors that this rule may add
  12373. * validation errors to.
  12374. * @param options The validation options.
  12375. * @param options.messages The validation messages.
  12376. */
  12377. function enumerable(rule, value, source, errors, options) {
  12378. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  12379. if (rule[ENUM].indexOf(value) === -1) {
  12380. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  12381. }
  12382. }
  12383. /**
  12384. * Rule for validating a regular expression pattern.
  12385. *
  12386. * @param rule The validation rule.
  12387. * @param value The value of the field on the source object.
  12388. * @param source The source object being validated.
  12389. * @param errors An array of errors that this rule may add
  12390. * validation errors to.
  12391. * @param options The validation options.
  12392. * @param options.messages The validation messages.
  12393. */
  12394. function pattern$1(rule, value, source, errors, options) {
  12395. if (rule.pattern) {
  12396. if (rule.pattern instanceof RegExp) {
  12397. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  12398. // flag is accidentally set to `true`, which in a validation scenario
  12399. // is not necessary and the result might be misleading
  12400. rule.pattern.lastIndex = 0;
  12401. if (!rule.pattern.test(value)) {
  12402. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12403. }
  12404. } else if (typeof rule.pattern === 'string') {
  12405. var _pattern = new RegExp(rule.pattern);
  12406. if (!_pattern.test(value)) {
  12407. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12408. }
  12409. }
  12410. }
  12411. }
  12412. var rules = {
  12413. required: required,
  12414. whitespace: whitespace,
  12415. type: type,
  12416. range: range,
  12417. "enum": enumerable,
  12418. pattern: pattern$1
  12419. };
  12420. /**
  12421. * Performs validation for string types.
  12422. *
  12423. * @param rule The validation rule.
  12424. * @param value The value of the field on the source object.
  12425. * @param callback The callback function.
  12426. * @param source The source object being validated.
  12427. * @param options The validation options.
  12428. * @param options.messages The validation messages.
  12429. */
  12430. function string(rule, value, callback, source, options) {
  12431. var errors = [];
  12432. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12433. if (validate) {
  12434. if (isEmptyValue(value, 'string') && !rule.required) {
  12435. return callback();
  12436. }
  12437. rules.required(rule, value, source, errors, options, 'string');
  12438. if (!isEmptyValue(value, 'string')) {
  12439. rules.type(rule, value, source, errors, options);
  12440. rules.range(rule, value, source, errors, options);
  12441. rules.pattern(rule, value, source, errors, options);
  12442. if (rule.whitespace === true) {
  12443. rules.whitespace(rule, value, source, errors, options);
  12444. }
  12445. }
  12446. }
  12447. callback(errors);
  12448. }
  12449. /**
  12450. * Validates a function.
  12451. *
  12452. * @param rule The validation rule.
  12453. * @param value The value of the field on the source object.
  12454. * @param callback The callback function.
  12455. * @param source The source object being validated.
  12456. * @param options The validation options.
  12457. * @param options.messages The validation messages.
  12458. */
  12459. function method(rule, value, callback, source, options) {
  12460. var errors = [];
  12461. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12462. if (validate) {
  12463. if (isEmptyValue(value) && !rule.required) {
  12464. return callback();
  12465. }
  12466. rules.required(rule, value, source, errors, options);
  12467. if (value !== undefined) {
  12468. rules.type(rule, value, source, errors, options);
  12469. }
  12470. }
  12471. callback(errors);
  12472. }
  12473. /**
  12474. * Validates a number.
  12475. *
  12476. * @param rule The validation rule.
  12477. * @param value The value of the field on the source object.
  12478. * @param callback The callback function.
  12479. * @param source The source object being validated.
  12480. * @param options The validation options.
  12481. * @param options.messages The validation messages.
  12482. */
  12483. function number(rule, value, callback, source, options) {
  12484. var errors = [];
  12485. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12486. if (validate) {
  12487. if (value === '') {
  12488. value = undefined;
  12489. }
  12490. if (isEmptyValue(value) && !rule.required) {
  12491. return callback();
  12492. }
  12493. rules.required(rule, value, source, errors, options);
  12494. if (value !== undefined) {
  12495. rules.type(rule, value, source, errors, options);
  12496. rules.range(rule, value, source, errors, options);
  12497. }
  12498. }
  12499. callback(errors);
  12500. }
  12501. /**
  12502. * Validates a boolean.
  12503. *
  12504. * @param rule The validation rule.
  12505. * @param value The value of the field on the source object.
  12506. * @param callback The callback function.
  12507. * @param source The source object being validated.
  12508. * @param options The validation options.
  12509. * @param options.messages The validation messages.
  12510. */
  12511. function _boolean(rule, value, callback, source, options) {
  12512. var errors = [];
  12513. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12514. if (validate) {
  12515. if (isEmptyValue(value) && !rule.required) {
  12516. return callback();
  12517. }
  12518. rules.required(rule, value, source, errors, options);
  12519. if (value !== undefined) {
  12520. rules.type(rule, value, source, errors, options);
  12521. }
  12522. }
  12523. callback(errors);
  12524. }
  12525. /**
  12526. * Validates the regular expression type.
  12527. *
  12528. * @param rule The validation rule.
  12529. * @param value The value of the field on the source object.
  12530. * @param callback The callback function.
  12531. * @param source The source object being validated.
  12532. * @param options The validation options.
  12533. * @param options.messages The validation messages.
  12534. */
  12535. function regexp(rule, value, callback, source, options) {
  12536. var errors = [];
  12537. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12538. if (validate) {
  12539. if (isEmptyValue(value) && !rule.required) {
  12540. return callback();
  12541. }
  12542. rules.required(rule, value, source, errors, options);
  12543. if (!isEmptyValue(value)) {
  12544. rules.type(rule, value, source, errors, options);
  12545. }
  12546. }
  12547. callback(errors);
  12548. }
  12549. /**
  12550. * Validates a number is an integer.
  12551. *
  12552. * @param rule The validation rule.
  12553. * @param value The value of the field on the source object.
  12554. * @param callback The callback function.
  12555. * @param source The source object being validated.
  12556. * @param options The validation options.
  12557. * @param options.messages The validation messages.
  12558. */
  12559. function integer(rule, value, callback, source, options) {
  12560. var errors = [];
  12561. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12562. if (validate) {
  12563. if (isEmptyValue(value) && !rule.required) {
  12564. return callback();
  12565. }
  12566. rules.required(rule, value, source, errors, options);
  12567. if (value !== undefined) {
  12568. rules.type(rule, value, source, errors, options);
  12569. rules.range(rule, value, source, errors, options);
  12570. }
  12571. }
  12572. callback(errors);
  12573. }
  12574. /**
  12575. * Validates a number is a floating point number.
  12576. *
  12577. * @param rule The validation rule.
  12578. * @param value The value of the field on the source object.
  12579. * @param callback The callback function.
  12580. * @param source The source object being validated.
  12581. * @param options The validation options.
  12582. * @param options.messages The validation messages.
  12583. */
  12584. function floatFn(rule, value, callback, source, options) {
  12585. var errors = [];
  12586. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12587. if (validate) {
  12588. if (isEmptyValue(value) && !rule.required) {
  12589. return callback();
  12590. }
  12591. rules.required(rule, value, source, errors, options);
  12592. if (value !== undefined) {
  12593. rules.type(rule, value, source, errors, options);
  12594. rules.range(rule, value, source, errors, options);
  12595. }
  12596. }
  12597. callback(errors);
  12598. }
  12599. /**
  12600. * Validates an array.
  12601. *
  12602. * @param rule The validation rule.
  12603. * @param value The value of the field on the source object.
  12604. * @param callback The callback function.
  12605. * @param source The source object being validated.
  12606. * @param options The validation options.
  12607. * @param options.messages The validation messages.
  12608. */
  12609. function array(rule, value, callback, source, options) {
  12610. var errors = [];
  12611. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12612. if (validate) {
  12613. if (isEmptyValue(value, 'array') && !rule.required) {
  12614. return callback();
  12615. }
  12616. rules.required(rule, value, source, errors, options, 'array');
  12617. if (!isEmptyValue(value, 'array')) {
  12618. rules.type(rule, value, source, errors, options);
  12619. rules.range(rule, value, source, errors, options);
  12620. }
  12621. }
  12622. callback(errors);
  12623. }
  12624. /**
  12625. * Validates an object.
  12626. *
  12627. * @param rule The validation rule.
  12628. * @param value The value of the field on the source object.
  12629. * @param callback The callback function.
  12630. * @param source The source object being validated.
  12631. * @param options The validation options.
  12632. * @param options.messages The validation messages.
  12633. */
  12634. function object(rule, value, callback, source, options) {
  12635. var errors = [];
  12636. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12637. if (validate) {
  12638. if (isEmptyValue(value) && !rule.required) {
  12639. return callback();
  12640. }
  12641. rules.required(rule, value, source, errors, options);
  12642. if (value !== undefined) {
  12643. rules.type(rule, value, source, errors, options);
  12644. }
  12645. }
  12646. callback(errors);
  12647. }
  12648. var ENUM$1 = 'enum';
  12649. /**
  12650. * Validates an enumerable list.
  12651. *
  12652. * @param rule The validation rule.
  12653. * @param value The value of the field on the source object.
  12654. * @param callback The callback function.
  12655. * @param source The source object being validated.
  12656. * @param options The validation options.
  12657. * @param options.messages The validation messages.
  12658. */
  12659. function enumerable$1(rule, value, callback, source, options) {
  12660. var errors = [];
  12661. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12662. if (validate) {
  12663. if (isEmptyValue(value) && !rule.required) {
  12664. return callback();
  12665. }
  12666. rules.required(rule, value, source, errors, options);
  12667. if (value !== undefined) {
  12668. rules[ENUM$1](rule, value, source, errors, options);
  12669. }
  12670. }
  12671. callback(errors);
  12672. }
  12673. /**
  12674. * Validates a regular expression pattern.
  12675. *
  12676. * Performs validation when a rule only contains
  12677. * a pattern property but is not declared as a string type.
  12678. *
  12679. * @param rule The validation rule.
  12680. * @param value The value of the field on the source object.
  12681. * @param callback The callback function.
  12682. * @param source The source object being validated.
  12683. * @param options The validation options.
  12684. * @param options.messages The validation messages.
  12685. */
  12686. function pattern$2(rule, value, callback, source, options) {
  12687. var errors = [];
  12688. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12689. if (validate) {
  12690. if (isEmptyValue(value, 'string') && !rule.required) {
  12691. return callback();
  12692. }
  12693. rules.required(rule, value, source, errors, options);
  12694. if (!isEmptyValue(value, 'string')) {
  12695. rules.pattern(rule, value, source, errors, options);
  12696. }
  12697. }
  12698. callback(errors);
  12699. }
  12700. function date(rule, value, callback, source, options) {
  12701. var errors = [];
  12702. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12703. if (validate) {
  12704. if (isEmptyValue(value) && !rule.required) {
  12705. return callback();
  12706. }
  12707. rules.required(rule, value, source, errors, options);
  12708. if (!isEmptyValue(value)) {
  12709. var dateObject;
  12710. if (typeof value === 'number') {
  12711. dateObject = new Date(value);
  12712. } else {
  12713. dateObject = value;
  12714. }
  12715. rules.type(rule, dateObject, source, errors, options);
  12716. if (dateObject) {
  12717. rules.range(rule, dateObject.getTime(), source, errors, options);
  12718. }
  12719. }
  12720. }
  12721. callback(errors);
  12722. }
  12723. function required$1(rule, value, callback, source, options) {
  12724. var errors = [];
  12725. var type = Array.isArray(value) ? 'array' : (0, _typeof2.default)(value);
  12726. rules.required(rule, value, source, errors, options, type);
  12727. callback(errors);
  12728. }
  12729. function type$1(rule, value, callback, source, options) {
  12730. var ruleType = rule.type;
  12731. var errors = [];
  12732. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12733. if (validate) {
  12734. if (isEmptyValue(value, ruleType) && !rule.required) {
  12735. return callback();
  12736. }
  12737. rules.required(rule, value, source, errors, options, ruleType);
  12738. if (!isEmptyValue(value, ruleType)) {
  12739. rules.type(rule, value, source, errors, options);
  12740. }
  12741. }
  12742. callback(errors);
  12743. }
  12744. /**
  12745. * Performs validation for any type.
  12746. *
  12747. * @param rule The validation rule.
  12748. * @param value The value of the field on the source object.
  12749. * @param callback The callback function.
  12750. * @param source The source object being validated.
  12751. * @param options The validation options.
  12752. * @param options.messages The validation messages.
  12753. */
  12754. function any(rule, value, callback, source, options) {
  12755. var errors = [];
  12756. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12757. if (validate) {
  12758. if (isEmptyValue(value) && !rule.required) {
  12759. return callback();
  12760. }
  12761. rules.required(rule, value, source, errors, options);
  12762. }
  12763. callback(errors);
  12764. }
  12765. var validators = {
  12766. string: string,
  12767. method: method,
  12768. number: number,
  12769. "boolean": _boolean,
  12770. regexp: regexp,
  12771. integer: integer,
  12772. "float": floatFn,
  12773. array: array,
  12774. object: object,
  12775. "enum": enumerable$1,
  12776. pattern: pattern$2,
  12777. date: date,
  12778. url: type$1,
  12779. hex: type$1,
  12780. email: type$1,
  12781. required: required$1,
  12782. any: any
  12783. };
  12784. function newMessages() {
  12785. return {
  12786. "default": 'Validation error on field %s',
  12787. required: '%s is required',
  12788. "enum": '%s must be one of %s',
  12789. whitespace: '%s cannot be empty',
  12790. date: {
  12791. format: '%s date %s is invalid for format %s',
  12792. parse: '%s date could not be parsed, %s is invalid ',
  12793. invalid: '%s date %s is invalid'
  12794. },
  12795. types: {
  12796. string: '%s is not a %s',
  12797. method: '%s is not a %s (function)',
  12798. array: '%s is not an %s',
  12799. object: '%s is not an %s',
  12800. number: '%s is not a %s',
  12801. date: '%s is not a %s',
  12802. "boolean": '%s is not a %s',
  12803. integer: '%s is not an %s',
  12804. "float": '%s is not a %s',
  12805. regexp: '%s is not a valid %s',
  12806. email: '%s is not a valid %s',
  12807. url: '%s is not a valid %s',
  12808. hex: '%s is not a valid %s'
  12809. },
  12810. string: {
  12811. len: '%s must be exactly %s characters',
  12812. min: '%s must be at least %s characters',
  12813. max: '%s cannot be longer than %s characters',
  12814. range: '%s must be between %s and %s characters'
  12815. },
  12816. number: {
  12817. len: '%s must equal %s',
  12818. min: '%s cannot be less than %s',
  12819. max: '%s cannot be greater than %s',
  12820. range: '%s must be between %s and %s'
  12821. },
  12822. array: {
  12823. len: '%s must be exactly %s in length',
  12824. min: '%s cannot be less than %s in length',
  12825. max: '%s cannot be greater than %s in length',
  12826. range: '%s must be between %s and %s in length'
  12827. },
  12828. pattern: {
  12829. mismatch: '%s value %s does not match pattern %s'
  12830. },
  12831. clone: function clone() {
  12832. var cloned = JSON.parse(JSON.stringify(this));
  12833. cloned.clone = this.clone;
  12834. return cloned;
  12835. }
  12836. };
  12837. }
  12838. var messages = newMessages();
  12839. /**
  12840. * Encapsulates a validation schema.
  12841. *
  12842. * @param descriptor An object declaring validation rules
  12843. * for this schema.
  12844. */
  12845. function Schema(descriptor) {
  12846. this.rules = null;
  12847. this._messages = messages;
  12848. this.define(descriptor);
  12849. }
  12850. Schema.prototype = {
  12851. messages: function messages(_messages) {
  12852. if (_messages) {
  12853. this._messages = deepMerge(newMessages(), _messages);
  12854. }
  12855. return this._messages;
  12856. },
  12857. define: function define(rules) {
  12858. if (!rules) {
  12859. throw new Error('Cannot configure a schema with no rules');
  12860. }
  12861. if ((0, _typeof2.default)(rules) !== 'object' || Array.isArray(rules)) {
  12862. throw new Error('Rules must be an object');
  12863. }
  12864. this.rules = {};
  12865. var z;
  12866. var item;
  12867. for (z in rules) {
  12868. if (rules.hasOwnProperty(z)) {
  12869. item = rules[z];
  12870. this.rules[z] = Array.isArray(item) ? item : [item];
  12871. }
  12872. }
  12873. },
  12874. validate: function validate(source_, o, oc) {
  12875. var _this = this;
  12876. if (o === void 0) {
  12877. o = {};
  12878. }
  12879. if (oc === void 0) {
  12880. oc = function oc() {};
  12881. }
  12882. var source = source_;
  12883. var options = o;
  12884. var callback = oc;
  12885. if (typeof options === 'function') {
  12886. callback = options;
  12887. options = {};
  12888. }
  12889. if (!this.rules || Object.keys(this.rules).length === 0) {
  12890. if (callback) {
  12891. callback();
  12892. }
  12893. return Promise.resolve();
  12894. }
  12895. function complete(results) {
  12896. var i;
  12897. var errors = [];
  12898. var fields = {};
  12899. function add(e) {
  12900. if (Array.isArray(e)) {
  12901. var _errors;
  12902. errors = (_errors = errors).concat.apply(_errors, e);
  12903. } else {
  12904. errors.push(e);
  12905. }
  12906. }
  12907. for (i = 0; i < results.length; i++) {
  12908. add(results[i]);
  12909. }
  12910. if (!errors.length) {
  12911. errors = null;
  12912. fields = null;
  12913. } else {
  12914. fields = convertFieldsError(errors);
  12915. }
  12916. callback(errors, fields);
  12917. }
  12918. if (options.messages) {
  12919. var messages$1 = this.messages();
  12920. if (messages$1 === messages) {
  12921. messages$1 = newMessages();
  12922. }
  12923. deepMerge(messages$1, options.messages);
  12924. options.messages = messages$1;
  12925. } else {
  12926. options.messages = this.messages();
  12927. }
  12928. var arr;
  12929. var value;
  12930. var series = {};
  12931. var keys = options.keys || Object.keys(this.rules);
  12932. keys.forEach(function (z) {
  12933. arr = _this.rules[z];
  12934. value = source[z];
  12935. arr.forEach(function (r) {
  12936. var rule = r;
  12937. if (typeof rule.transform === 'function') {
  12938. if (source === source_) {
  12939. source = _extends({}, source);
  12940. }
  12941. value = source[z] = rule.transform(value);
  12942. }
  12943. if (typeof rule === 'function') {
  12944. rule = {
  12945. validator: rule
  12946. };
  12947. } else {
  12948. rule = _extends({}, rule);
  12949. }
  12950. rule.validator = _this.getValidationMethod(rule);
  12951. rule.field = z;
  12952. rule.fullField = rule.fullField || z;
  12953. rule.type = _this.getType(rule);
  12954. if (!rule.validator) {
  12955. return;
  12956. }
  12957. series[z] = series[z] || [];
  12958. series[z].push({
  12959. rule: rule,
  12960. value: value,
  12961. source: source,
  12962. field: z
  12963. });
  12964. });
  12965. });
  12966. var errorFields = {};
  12967. return asyncMap(series, options, function (data, doIt) {
  12968. var rule = data.rule;
  12969. var deep = (rule.type === 'object' || rule.type === 'array') && ((0, _typeof2.default)(rule.fields) === 'object' || (0, _typeof2.default)(rule.defaultField) === 'object');
  12970. deep = deep && (rule.required || !rule.required && data.value);
  12971. rule.field = data.field;
  12972. function addFullfield(key, schema) {
  12973. return _extends({}, schema, {
  12974. fullField: rule.fullField + "." + key
  12975. });
  12976. }
  12977. function cb(e) {
  12978. if (e === void 0) {
  12979. e = [];
  12980. }
  12981. var errors = e;
  12982. if (!Array.isArray(errors)) {
  12983. errors = [errors];
  12984. }
  12985. if (!options.suppressWarning && errors.length) {
  12986. Schema.warning('async-validator:', errors);
  12987. }
  12988. if (errors.length && rule.message) {
  12989. errors = [].concat(rule.message);
  12990. }
  12991. errors = errors.map(complementError(rule));
  12992. if (options.first && errors.length) {
  12993. errorFields[rule.field] = 1;
  12994. return doIt(errors);
  12995. }
  12996. if (!deep) {
  12997. doIt(errors);
  12998. } else {
  12999. // if rule is required but the target object
  13000. // does not exist fail at the rule level and don't
  13001. // go deeper
  13002. if (rule.required && !data.value) {
  13003. if (rule.message) {
  13004. errors = [].concat(rule.message).map(complementError(rule));
  13005. } else if (options.error) {
  13006. errors = [options.error(rule, format(options.messages.required, rule.field))];
  13007. } else {
  13008. errors = [];
  13009. }
  13010. return doIt(errors);
  13011. }
  13012. var fieldsSchema = {};
  13013. if (rule.defaultField) {
  13014. for (var k in data.value) {
  13015. if (data.value.hasOwnProperty(k)) {
  13016. fieldsSchema[k] = rule.defaultField;
  13017. }
  13018. }
  13019. }
  13020. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  13021. for (var f in fieldsSchema) {
  13022. if (fieldsSchema.hasOwnProperty(f)) {
  13023. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  13024. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  13025. }
  13026. }
  13027. var schema = new Schema(fieldsSchema);
  13028. schema.messages(options.messages);
  13029. if (data.rule.options) {
  13030. data.rule.options.messages = options.messages;
  13031. data.rule.options.error = options.error;
  13032. }
  13033. schema.validate(data.value, data.rule.options || options, function (errs) {
  13034. var finalErrors = [];
  13035. if (errors && errors.length) {
  13036. finalErrors.push.apply(finalErrors, errors);
  13037. }
  13038. if (errs && errs.length) {
  13039. finalErrors.push.apply(finalErrors, errs);
  13040. }
  13041. doIt(finalErrors.length ? finalErrors : null);
  13042. });
  13043. }
  13044. }
  13045. var res;
  13046. if (rule.asyncValidator) {
  13047. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  13048. } else if (rule.validator) {
  13049. res = rule.validator(rule, data.value, cb, data.source, options);
  13050. if (res === true) {
  13051. cb();
  13052. } else if (res === false) {
  13053. cb(rule.message || rule.field + " fails");
  13054. } else if (res instanceof Array) {
  13055. cb(res);
  13056. } else if (res instanceof Error) {
  13057. cb(res.message);
  13058. }
  13059. }
  13060. if (res && res.then) {
  13061. res.then(function () {
  13062. return cb();
  13063. }, function (e) {
  13064. return cb(e);
  13065. });
  13066. }
  13067. }, function (results) {
  13068. complete(results);
  13069. });
  13070. },
  13071. getType: function getType(rule) {
  13072. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  13073. rule.type = 'pattern';
  13074. }
  13075. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  13076. throw new Error(format('Unknown rule type %s', rule.type));
  13077. }
  13078. return rule.type || 'string';
  13079. },
  13080. getValidationMethod: function getValidationMethod(rule) {
  13081. if (typeof rule.validator === 'function') {
  13082. return rule.validator;
  13083. }
  13084. var keys = Object.keys(rule);
  13085. var messageIndex = keys.indexOf('message');
  13086. if (messageIndex !== -1) {
  13087. keys.splice(messageIndex, 1);
  13088. }
  13089. if (keys.length === 1 && keys[0] === 'required') {
  13090. return validators.required;
  13091. }
  13092. return validators[this.getType(rule)] || false;
  13093. }
  13094. };
  13095. Schema.register = function register(type, validator) {
  13096. if (typeof validator !== 'function') {
  13097. throw new Error('Cannot register a validator by type, validator is not a function');
  13098. }
  13099. validators[type] = validator;
  13100. };
  13101. Schema.warning = warning;
  13102. Schema.messages = messages;
  13103. var _default = Schema;
  13104. exports.default = _default;
  13105. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 440)))
  13106. /***/ }),
  13107. /***/ 44:
  13108. /*!*************************************************************************!*\
  13109. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  13110. \*************************************************************************/
  13111. /*! no static exports found */
  13112. /***/ (function(module, exports, __webpack_require__) {
  13113. "use strict";
  13114. Object.defineProperty(exports, "__esModule", {
  13115. value: true
  13116. });
  13117. exports.default = void 0;
  13118. // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  13119. // 所以这里做一个兼容polyfill的兼容处理
  13120. if (!String.prototype.padStart) {
  13121. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  13122. String.prototype.padStart = function (maxLength) {
  13123. var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  13124. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError('fillString must be String');
  13125. var str = this;
  13126. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  13127. if (str.length >= maxLength) return String(str);
  13128. var fillLength = maxLength - str.length,
  13129. times = Math.ceil(fillLength / fillString.length);
  13130. while (times >>= 1) {
  13131. fillString += fillString;
  13132. if (times === 1) {
  13133. fillString += fillString;
  13134. }
  13135. }
  13136. return fillString.slice(0, fillLength) + str;
  13137. };
  13138. }
  13139. // 其他更多是格式化有如下:
  13140. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  13141. function timeFormat() {
  13142. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  13143. var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  13144. // 如果为null,则格式化当前时间
  13145. if (!dateTime) dateTime = Number(new Date());
  13146. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  13147. if (dateTime.toString().length == 10) dateTime *= 1000;
  13148. var date = new Date(dateTime);
  13149. var ret;
  13150. var opt = {
  13151. "y+": date.getFullYear().toString(),
  13152. // 年
  13153. "m+": (date.getMonth() + 1).toString(),
  13154. // 月
  13155. "d+": date.getDate().toString(),
  13156. // 日
  13157. "h+": date.getHours().toString(),
  13158. // 时
  13159. "M+": date.getMinutes().toString(),
  13160. // 分
  13161. "s+": date.getSeconds().toString() // 秒
  13162. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  13163. };
  13164. for (var k in opt) {
  13165. ret = new RegExp("(" + k + ")").exec(fmt);
  13166. if (ret) {
  13167. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  13168. }
  13169. ;
  13170. }
  13171. ;
  13172. return fmt;
  13173. }
  13174. var _default = timeFormat;
  13175. exports.default = _default;
  13176. /***/ }),
  13177. /***/ 440:
  13178. /*!********************************************************!*\
  13179. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  13180. \********************************************************/
  13181. /*! no static exports found */
  13182. /***/ (function(module, exports, __webpack_require__) {
  13183. exports.nextTick = function nextTick(fn) {
  13184. var args = Array.prototype.slice.call(arguments);
  13185. args.shift();
  13186. setTimeout(function () {
  13187. fn.apply(null, args);
  13188. }, 0);
  13189. };
  13190. exports.platform = exports.arch =
  13191. exports.execPath = exports.title = 'browser';
  13192. exports.pid = 1;
  13193. exports.browser = true;
  13194. exports.env = {};
  13195. exports.argv = [];
  13196. exports.binding = function (name) {
  13197. throw new Error('No such module. (Possibly not yet loaded)')
  13198. };
  13199. (function () {
  13200. var cwd = '/';
  13201. var path;
  13202. exports.cwd = function () { return cwd };
  13203. exports.chdir = function (dir) {
  13204. if (!path) path = __webpack_require__(/*! path */ 441);
  13205. cwd = path.resolve(dir, cwd);
  13206. };
  13207. })();
  13208. exports.exit = exports.kill =
  13209. exports.umask = exports.dlopen =
  13210. exports.uptime = exports.memoryUsage =
  13211. exports.uvCounters = function() {};
  13212. exports.features = {};
  13213. /***/ }),
  13214. /***/ 441:
  13215. /*!***********************************************!*\
  13216. !*** ./node_modules/path-browserify/index.js ***!
  13217. \***********************************************/
  13218. /*! no static exports found */
  13219. /***/ (function(module, exports, __webpack_require__) {
  13220. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  13221. // backported and transplited with Babel, with backwards-compat fixes
  13222. // Copyright Joyent, Inc. and other Node contributors.
  13223. //
  13224. // Permission is hereby granted, free of charge, to any person obtaining a
  13225. // copy of this software and associated documentation files (the
  13226. // "Software"), to deal in the Software without restriction, including
  13227. // without limitation the rights to use, copy, modify, merge, publish,
  13228. // distribute, sublicense, and/or sell copies of the Software, and to permit
  13229. // persons to whom the Software is furnished to do so, subject to the
  13230. // following conditions:
  13231. //
  13232. // The above copyright notice and this permission notice shall be included
  13233. // in all copies or substantial portions of the Software.
  13234. //
  13235. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13236. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13237. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  13238. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13239. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  13240. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  13241. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  13242. // resolves . and .. elements in a path array with directory names there
  13243. // must be no slashes, empty elements, or device names (c:\) in the array
  13244. // (so also no leading and trailing slashes - it does not distinguish
  13245. // relative and absolute paths)
  13246. function normalizeArray(parts, allowAboveRoot) {
  13247. // if the path tries to go above the root, `up` ends up > 0
  13248. var up = 0;
  13249. for (var i = parts.length - 1; i >= 0; i--) {
  13250. var last = parts[i];
  13251. if (last === '.') {
  13252. parts.splice(i, 1);
  13253. } else if (last === '..') {
  13254. parts.splice(i, 1);
  13255. up++;
  13256. } else if (up) {
  13257. parts.splice(i, 1);
  13258. up--;
  13259. }
  13260. }
  13261. // if the path is allowed to go above the root, restore leading ..s
  13262. if (allowAboveRoot) {
  13263. for (; up--; up) {
  13264. parts.unshift('..');
  13265. }
  13266. }
  13267. return parts;
  13268. }
  13269. // path.resolve([from ...], to)
  13270. // posix version
  13271. exports.resolve = function() {
  13272. var resolvedPath = '',
  13273. resolvedAbsolute = false;
  13274. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  13275. var path = (i >= 0) ? arguments[i] : process.cwd();
  13276. // Skip empty and invalid entries
  13277. if (typeof path !== 'string') {
  13278. throw new TypeError('Arguments to path.resolve must be strings');
  13279. } else if (!path) {
  13280. continue;
  13281. }
  13282. resolvedPath = path + '/' + resolvedPath;
  13283. resolvedAbsolute = path.charAt(0) === '/';
  13284. }
  13285. // At this point the path should be resolved to a full absolute path, but
  13286. // handle relative paths to be safe (might happen when process.cwd() fails)
  13287. // Normalize the path
  13288. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  13289. return !!p;
  13290. }), !resolvedAbsolute).join('/');
  13291. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  13292. };
  13293. // path.normalize(path)
  13294. // posix version
  13295. exports.normalize = function(path) {
  13296. var isAbsolute = exports.isAbsolute(path),
  13297. trailingSlash = substr(path, -1) === '/';
  13298. // Normalize the path
  13299. path = normalizeArray(filter(path.split('/'), function(p) {
  13300. return !!p;
  13301. }), !isAbsolute).join('/');
  13302. if (!path && !isAbsolute) {
  13303. path = '.';
  13304. }
  13305. if (path && trailingSlash) {
  13306. path += '/';
  13307. }
  13308. return (isAbsolute ? '/' : '') + path;
  13309. };
  13310. // posix version
  13311. exports.isAbsolute = function(path) {
  13312. return path.charAt(0) === '/';
  13313. };
  13314. // posix version
  13315. exports.join = function() {
  13316. var paths = Array.prototype.slice.call(arguments, 0);
  13317. return exports.normalize(filter(paths, function(p, index) {
  13318. if (typeof p !== 'string') {
  13319. throw new TypeError('Arguments to path.join must be strings');
  13320. }
  13321. return p;
  13322. }).join('/'));
  13323. };
  13324. // path.relative(from, to)
  13325. // posix version
  13326. exports.relative = function(from, to) {
  13327. from = exports.resolve(from).substr(1);
  13328. to = exports.resolve(to).substr(1);
  13329. function trim(arr) {
  13330. var start = 0;
  13331. for (; start < arr.length; start++) {
  13332. if (arr[start] !== '') break;
  13333. }
  13334. var end = arr.length - 1;
  13335. for (; end >= 0; end--) {
  13336. if (arr[end] !== '') break;
  13337. }
  13338. if (start > end) return [];
  13339. return arr.slice(start, end - start + 1);
  13340. }
  13341. var fromParts = trim(from.split('/'));
  13342. var toParts = trim(to.split('/'));
  13343. var length = Math.min(fromParts.length, toParts.length);
  13344. var samePartsLength = length;
  13345. for (var i = 0; i < length; i++) {
  13346. if (fromParts[i] !== toParts[i]) {
  13347. samePartsLength = i;
  13348. break;
  13349. }
  13350. }
  13351. var outputParts = [];
  13352. for (var i = samePartsLength; i < fromParts.length; i++) {
  13353. outputParts.push('..');
  13354. }
  13355. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  13356. return outputParts.join('/');
  13357. };
  13358. exports.sep = '/';
  13359. exports.delimiter = ':';
  13360. exports.dirname = function (path) {
  13361. if (typeof path !== 'string') path = path + '';
  13362. if (path.length === 0) return '.';
  13363. var code = path.charCodeAt(0);
  13364. var hasRoot = code === 47 /*/*/;
  13365. var end = -1;
  13366. var matchedSlash = true;
  13367. for (var i = path.length - 1; i >= 1; --i) {
  13368. code = path.charCodeAt(i);
  13369. if (code === 47 /*/*/) {
  13370. if (!matchedSlash) {
  13371. end = i;
  13372. break;
  13373. }
  13374. } else {
  13375. // We saw the first non-path separator
  13376. matchedSlash = false;
  13377. }
  13378. }
  13379. if (end === -1) return hasRoot ? '/' : '.';
  13380. if (hasRoot && end === 1) {
  13381. // return '//';
  13382. // Backwards-compat fix:
  13383. return '/';
  13384. }
  13385. return path.slice(0, end);
  13386. };
  13387. function basename(path) {
  13388. if (typeof path !== 'string') path = path + '';
  13389. var start = 0;
  13390. var end = -1;
  13391. var matchedSlash = true;
  13392. var i;
  13393. for (i = path.length - 1; i >= 0; --i) {
  13394. if (path.charCodeAt(i) === 47 /*/*/) {
  13395. // If we reached a path separator that was not part of a set of path
  13396. // separators at the end of the string, stop now
  13397. if (!matchedSlash) {
  13398. start = i + 1;
  13399. break;
  13400. }
  13401. } else if (end === -1) {
  13402. // We saw the first non-path separator, mark this as the end of our
  13403. // path component
  13404. matchedSlash = false;
  13405. end = i + 1;
  13406. }
  13407. }
  13408. if (end === -1) return '';
  13409. return path.slice(start, end);
  13410. }
  13411. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  13412. // in new Node.js versions, so only basename() above is backported here
  13413. exports.basename = function (path, ext) {
  13414. var f = basename(path);
  13415. if (ext && f.substr(-1 * ext.length) === ext) {
  13416. f = f.substr(0, f.length - ext.length);
  13417. }
  13418. return f;
  13419. };
  13420. exports.extname = function (path) {
  13421. if (typeof path !== 'string') path = path + '';
  13422. var startDot = -1;
  13423. var startPart = 0;
  13424. var end = -1;
  13425. var matchedSlash = true;
  13426. // Track the state of characters (if any) we see before our first dot and
  13427. // after any path separator we find
  13428. var preDotState = 0;
  13429. for (var i = path.length - 1; i >= 0; --i) {
  13430. var code = path.charCodeAt(i);
  13431. if (code === 47 /*/*/) {
  13432. // If we reached a path separator that was not part of a set of path
  13433. // separators at the end of the string, stop now
  13434. if (!matchedSlash) {
  13435. startPart = i + 1;
  13436. break;
  13437. }
  13438. continue;
  13439. }
  13440. if (end === -1) {
  13441. // We saw the first non-path separator, mark this as the end of our
  13442. // extension
  13443. matchedSlash = false;
  13444. end = i + 1;
  13445. }
  13446. if (code === 46 /*.*/) {
  13447. // If this is our first dot, mark it as the start of our extension
  13448. if (startDot === -1)
  13449. startDot = i;
  13450. else if (preDotState !== 1)
  13451. preDotState = 1;
  13452. } else if (startDot !== -1) {
  13453. // We saw a non-dot and non-path separator before our dot, so we should
  13454. // have a good chance at having a non-empty extension
  13455. preDotState = -1;
  13456. }
  13457. }
  13458. if (startDot === -1 || end === -1 ||
  13459. // We saw a non-dot character immediately before the dot
  13460. preDotState === 0 ||
  13461. // The (right-most) trimmed path component is exactly '..'
  13462. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  13463. return '';
  13464. }
  13465. return path.slice(startDot, end);
  13466. };
  13467. function filter (xs, f) {
  13468. if (xs.filter) return xs.filter(f);
  13469. var res = [];
  13470. for (var i = 0; i < xs.length; i++) {
  13471. if (f(xs[i], i, xs)) res.push(xs[i]);
  13472. }
  13473. return res;
  13474. }
  13475. // String.prototype.substr - negative index don't work in IE8
  13476. var substr = 'ab'.substr(-1) === 'b'
  13477. ? function (str, start, len) { return str.substr(start, len) }
  13478. : function (str, start, len) {
  13479. if (start < 0) start = str.length + start;
  13480. return str.substr(start, len);
  13481. }
  13482. ;
  13483. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 440)))
  13484. /***/ }),
  13485. /***/ 45:
  13486. /*!***********************************************************************!*\
  13487. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  13488. \***********************************************************************/
  13489. /*! no static exports found */
  13490. /***/ (function(module, exports, __webpack_require__) {
  13491. "use strict";
  13492. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13493. Object.defineProperty(exports, "__esModule", {
  13494. value: true
  13495. });
  13496. exports.default = void 0;
  13497. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 44));
  13498. /**
  13499. * 时间戳转为多久之前
  13500. * @param String timestamp 时间戳
  13501. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  13502. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  13503. */
  13504. function timeFrom() {
  13505. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  13506. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  13507. // 如果为null,则格式化当前时间
  13508. if (!dateTime) dateTime = Number(new Date());
  13509. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  13510. if (dateTime.toString().length == 10) dateTime *= 1000;
  13511. var timestamp = +new Date(Number(dateTime));
  13512. var timer = (Number(new Date()) - timestamp) / 1000;
  13513. // 如果小于5分钟,则返回"刚刚",其他以此类推
  13514. var tips = '';
  13515. switch (true) {
  13516. case timer < 300:
  13517. tips = '刚刚';
  13518. break;
  13519. case timer >= 300 && timer < 3600:
  13520. tips = parseInt(timer / 60) + '分钟前';
  13521. break;
  13522. case timer >= 3600 && timer < 86400:
  13523. tips = parseInt(timer / 3600) + '小时前';
  13524. break;
  13525. case timer >= 86400 && timer < 2592000:
  13526. tips = parseInt(timer / 86400) + '天前';
  13527. break;
  13528. default:
  13529. // 如果format为false,则无论什么时间戳,都显示xx之前
  13530. if (format === false) {
  13531. if (timer >= 2592000 && timer < 365 * 86400) {
  13532. tips = parseInt(timer / (86400 * 30)) + '个月前';
  13533. } else {
  13534. tips = parseInt(timer / (86400 * 365)) + '年前';
  13535. }
  13536. } else {
  13537. tips = (0, _timeFormat.default)(timestamp, format);
  13538. }
  13539. }
  13540. return tips;
  13541. }
  13542. var _default = timeFrom;
  13543. exports.default = _default;
  13544. /***/ }),
  13545. /***/ 46:
  13546. /*!****************************************************************************!*\
  13547. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  13548. \****************************************************************************/
  13549. /*! no static exports found */
  13550. /***/ (function(module, exports, __webpack_require__) {
  13551. "use strict";
  13552. Object.defineProperty(exports, "__esModule", {
  13553. value: true
  13554. });
  13555. exports.default = void 0;
  13556. /**
  13557. * 求两个颜色之间的渐变值
  13558. * @param {string} startColor 开始的颜色
  13559. * @param {string} endColor 结束的颜色
  13560. * @param {number} step 颜色等分的份额
  13561. * */
  13562. function colorGradient() {
  13563. var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
  13564. var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
  13565. var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  13566. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  13567. var startR = startRGB[0];
  13568. var startG = startRGB[1];
  13569. var startB = startRGB[2];
  13570. var endRGB = hexToRgb(endColor, false);
  13571. var endR = endRGB[0];
  13572. var endG = endRGB[1];
  13573. var endB = endRGB[2];
  13574. var sR = (endR - startR) / step; //总差值
  13575. var sG = (endG - startG) / step;
  13576. var sB = (endB - startB) / step;
  13577. var colorArr = [];
  13578. for (var i = 0; i < step; i++) {
  13579. //计算每一步的hex值
  13580. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB * i + startB) + ')');
  13581. colorArr.push(hex);
  13582. }
  13583. return colorArr;
  13584. }
  13585. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  13586. function hexToRgb(sColor) {
  13587. var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13588. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13589. sColor = sColor.toLowerCase();
  13590. if (sColor && reg.test(sColor)) {
  13591. if (sColor.length === 4) {
  13592. var sColorNew = "#";
  13593. for (var i = 1; i < 4; i += 1) {
  13594. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  13595. }
  13596. sColor = sColorNew;
  13597. }
  13598. //处理六位的颜色值
  13599. var sColorChange = [];
  13600. for (var _i = 1; _i < 7; _i += 2) {
  13601. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  13602. }
  13603. if (!str) {
  13604. return sColorChange;
  13605. } else {
  13606. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  13607. }
  13608. } else if (/^(rgb|RGB)/.test(sColor)) {
  13609. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  13610. return arr.map(function (val) {
  13611. return Number(val);
  13612. });
  13613. } else {
  13614. return sColor;
  13615. }
  13616. }
  13617. ;
  13618. // 将rgb表示方式转换为hex表示方式
  13619. function rgbToHex(rgb) {
  13620. var _this = rgb;
  13621. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13622. if (/^(rgb|RGB)/.test(_this)) {
  13623. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  13624. var strHex = "#";
  13625. for (var i = 0; i < aColor.length; i++) {
  13626. var hex = Number(aColor[i]).toString(16);
  13627. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  13628. if (hex === "0") {
  13629. hex += hex;
  13630. }
  13631. strHex += hex;
  13632. }
  13633. if (strHex.length !== 7) {
  13634. strHex = _this;
  13635. }
  13636. return strHex;
  13637. } else if (reg.test(_this)) {
  13638. var aNum = _this.replace(/#/, "").split("");
  13639. if (aNum.length === 6) {
  13640. return _this;
  13641. } else if (aNum.length === 3) {
  13642. var numHex = "#";
  13643. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  13644. numHex += aNum[_i2] + aNum[_i2];
  13645. }
  13646. return numHex;
  13647. }
  13648. } else {
  13649. return _this;
  13650. }
  13651. }
  13652. /**
  13653. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  13654. * sHex为传入的十六进制的色值
  13655. * alpha为rgba的透明度
  13656. */
  13657. function colorToRgba(color) {
  13658. var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  13659. color = rgbToHex(color);
  13660. // 十六进制颜色值的正则表达式
  13661. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  13662. /* 16进制颜色转为RGB格式 */
  13663. var sColor = color.toLowerCase();
  13664. if (sColor && reg.test(sColor)) {
  13665. if (sColor.length === 4) {
  13666. var sColorNew = '#';
  13667. for (var i = 1; i < 4; i += 1) {
  13668. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  13669. }
  13670. sColor = sColorNew;
  13671. }
  13672. // 处理六位的颜色值
  13673. var sColorChange = [];
  13674. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  13675. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  13676. }
  13677. // return sColorChange.join(',')
  13678. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  13679. } else {
  13680. return sColor;
  13681. }
  13682. }
  13683. var _default = {
  13684. colorGradient: colorGradient,
  13685. hexToRgb: hexToRgb,
  13686. rgbToHex: rgbToHex,
  13687. colorToRgba: colorToRgba
  13688. };
  13689. exports.default = _default;
  13690. /***/ }),
  13691. /***/ 47:
  13692. /*!*******************************************************************!*\
  13693. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  13694. \*******************************************************************/
  13695. /*! no static exports found */
  13696. /***/ (function(module, exports, __webpack_require__) {
  13697. "use strict";
  13698. Object.defineProperty(exports, "__esModule", {
  13699. value: true
  13700. });
  13701. exports.default = void 0;
  13702. /**
  13703. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  13704. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  13705. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  13706. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  13707. * v-for的时候,推荐使用后端返回的id而不是循环的index
  13708. * @param {Number} len uuid的长度
  13709. * @param {Boolean} firstU 将返回的首字母置为"u"
  13710. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  13711. */
  13712. function guid() {
  13713. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  13714. var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13715. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  13716. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  13717. var uuid = [];
  13718. radix = radix || chars.length;
  13719. if (len) {
  13720. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  13721. for (var i = 0; i < len; i++) {
  13722. uuid[i] = chars[0 | Math.random() * radix];
  13723. }
  13724. } else {
  13725. var r;
  13726. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  13727. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  13728. uuid[14] = '4';
  13729. for (var _i = 0; _i < 36; _i++) {
  13730. if (!uuid[_i]) {
  13731. r = 0 | Math.random() * 16;
  13732. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  13733. }
  13734. }
  13735. }
  13736. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  13737. if (firstU) {
  13738. uuid.shift();
  13739. return 'u' + uuid.join('');
  13740. } else {
  13741. return uuid.join('');
  13742. }
  13743. }
  13744. var _default = guid;
  13745. exports.default = _default;
  13746. /***/ }),
  13747. /***/ 48:
  13748. /*!********************************************************************!*\
  13749. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  13750. \********************************************************************/
  13751. /*! no static exports found */
  13752. /***/ (function(module, exports, __webpack_require__) {
  13753. "use strict";
  13754. Object.defineProperty(exports, "__esModule", {
  13755. value: true
  13756. });
  13757. exports.default = void 0;
  13758. // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  13759. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  13760. var color = {
  13761. primary: "#2979ff",
  13762. primaryDark: "#2b85e4",
  13763. primaryDisabled: "#a0cfff",
  13764. primaryLight: "#ecf5ff",
  13765. bgColor: "#f3f4f6",
  13766. info: "#909399",
  13767. infoDark: "#82848a",
  13768. infoDisabled: "#c8c9cc",
  13769. infoLight: "#f4f4f5",
  13770. warning: "#ff9900",
  13771. warningDark: "#f29100",
  13772. warningDisabled: "#fcbd71",
  13773. warningLight: "#fdf6ec",
  13774. error: "#fa3534",
  13775. errorDark: "#dd6161",
  13776. errorDisabled: "#fab6b6",
  13777. errorLight: "#fef0f0",
  13778. success: "#19be6b",
  13779. successDark: "#18b566",
  13780. successDisabled: "#71d5a1",
  13781. successLight: "#dbf1e1",
  13782. mainColor: "#303133",
  13783. contentColor: "#606266",
  13784. tipsColor: "#909399",
  13785. lightColor: "#c0c4cc",
  13786. borderColor: "#e4e7ed"
  13787. };
  13788. var _default = color;
  13789. exports.default = _default;
  13790. /***/ }),
  13791. /***/ 49:
  13792. /*!************************************************************************!*\
  13793. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  13794. \************************************************************************/
  13795. /*! no static exports found */
  13796. /***/ (function(module, exports, __webpack_require__) {
  13797. "use strict";
  13798. Object.defineProperty(exports, "__esModule", {
  13799. value: true
  13800. });
  13801. exports.default = void 0;
  13802. /**
  13803. * 根据主题type值,获取对应的图标
  13804. * @param String type 主题名称,primary|info|error|warning|success
  13805. * @param String fill 是否使用fill填充实体的图标
  13806. */
  13807. function type2icon() {
  13808. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
  13809. var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13810. // 如果非预置值,默认为success
  13811. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  13812. var iconName = '';
  13813. // 目前(2019-12-12),info和primary使用同一个图标
  13814. switch (type) {
  13815. case 'primary':
  13816. iconName = 'info-circle';
  13817. break;
  13818. case 'info':
  13819. iconName = 'info-circle';
  13820. break;
  13821. case 'error':
  13822. iconName = 'close-circle';
  13823. break;
  13824. case 'warning':
  13825. iconName = 'error-circle';
  13826. break;
  13827. case 'success':
  13828. iconName = 'checkmark-circle';
  13829. break;
  13830. default:
  13831. iconName = 'checkmark-circle';
  13832. }
  13833. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  13834. if (fill) iconName += '-fill';
  13835. return iconName;
  13836. }
  13837. var _default = type2icon;
  13838. exports.default = _default;
  13839. /***/ }),
  13840. /***/ 5:
  13841. /*!**************************************************************!*\
  13842. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  13843. \**************************************************************/
  13844. /*! no static exports found */
  13845. /***/ (function(module, exports, __webpack_require__) {
  13846. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  13847. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  13848. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  13849. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  13850. function _slicedToArray(arr, i) {
  13851. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  13852. }
  13853. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13854. /***/ }),
  13855. /***/ 50:
  13856. /*!**************************************************************************!*\
  13857. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  13858. \**************************************************************************/
  13859. /*! no static exports found */
  13860. /***/ (function(module, exports, __webpack_require__) {
  13861. "use strict";
  13862. Object.defineProperty(exports, "__esModule", {
  13863. value: true
  13864. });
  13865. exports.default = void 0;
  13866. // 打乱数组
  13867. function randomArray() {
  13868. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  13869. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  13870. return array.sort(function () {
  13871. return Math.random() - 0.5;
  13872. });
  13873. }
  13874. var _default = randomArray;
  13875. exports.default = _default;
  13876. /***/ }),
  13877. /***/ 51:
  13878. /*!**********************************************************************!*\
  13879. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  13880. \**********************************************************************/
  13881. /*! no static exports found */
  13882. /***/ (function(module, exports, __webpack_require__) {
  13883. "use strict";
  13884. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13885. Object.defineProperty(exports, "__esModule", {
  13886. value: true
  13887. });
  13888. exports.default = addUnit;
  13889. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 38));
  13890. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  13891. function addUnit() {
  13892. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
  13893. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  13894. value = String(value);
  13895. // 用uView内置验证规则中的number判断是否为数值
  13896. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  13897. }
  13898. /***/ }),
  13899. /***/ 52:
  13900. /*!*********************************************************************!*\
  13901. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  13902. \*********************************************************************/
  13903. /*! no static exports found */
  13904. /***/ (function(module, exports, __webpack_require__) {
  13905. "use strict";
  13906. Object.defineProperty(exports, "__esModule", {
  13907. value: true
  13908. });
  13909. exports.default = void 0;
  13910. function random(min, max) {
  13911. if (min >= 0 && max > 0 && max >= min) {
  13912. var gab = max - min + 1;
  13913. return Math.floor(Math.random() * gab + min);
  13914. } else {
  13915. return 0;
  13916. }
  13917. }
  13918. var _default = random;
  13919. exports.default = _default;
  13920. /***/ }),
  13921. /***/ 53:
  13922. /*!*******************************************************************!*\
  13923. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  13924. \*******************************************************************/
  13925. /*! no static exports found */
  13926. /***/ (function(module, exports, __webpack_require__) {
  13927. "use strict";
  13928. Object.defineProperty(exports, "__esModule", {
  13929. value: true
  13930. });
  13931. exports.default = void 0;
  13932. function trim(str) {
  13933. var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  13934. if (pos == 'both') {
  13935. return str.replace(/^\s+|\s+$/g, "");
  13936. } else if (pos == "left") {
  13937. return str.replace(/^\s*/, '');
  13938. } else if (pos == 'right') {
  13939. return str.replace(/(\s*$)/g, "");
  13940. } else if (pos == 'all') {
  13941. return str.replace(/\s+/g, "");
  13942. } else {
  13943. return str;
  13944. }
  13945. }
  13946. var _default = trim;
  13947. exports.default = _default;
  13948. /***/ }),
  13949. /***/ 54:
  13950. /*!********************************************************************!*\
  13951. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  13952. \********************************************************************/
  13953. /*! no static exports found */
  13954. /***/ (function(module, exports, __webpack_require__) {
  13955. "use strict";
  13956. /* WEBPACK VAR INJECTION */(function(uni) {
  13957. Object.defineProperty(exports, "__esModule", {
  13958. value: true
  13959. });
  13960. exports.default = void 0;
  13961. function toast(title) {
  13962. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  13963. uni.showToast({
  13964. title: title,
  13965. icon: 'none',
  13966. duration: duration
  13967. });
  13968. }
  13969. var _default = toast;
  13970. exports.default = _default;
  13971. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  13972. /***/ }),
  13973. /***/ 55:
  13974. /*!************************************************************************!*\
  13975. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  13976. \************************************************************************/
  13977. /*! no static exports found */
  13978. /***/ (function(module, exports, __webpack_require__) {
  13979. "use strict";
  13980. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13981. Object.defineProperty(exports, "__esModule", {
  13982. value: true
  13983. });
  13984. exports.default = getParent;
  13985. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  13986. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  13987. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  13988. function getParent(name, keys) {
  13989. var parent = this.$parent;
  13990. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  13991. while (parent) {
  13992. // 父组件
  13993. if (parent.$options.name !== name) {
  13994. // 如果组件的name不相等,继续上一级寻找
  13995. parent = parent.$parent;
  13996. } else {
  13997. var _ret = function () {
  13998. var data = {};
  13999. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  14000. if (Array.isArray(keys)) {
  14001. keys.map(function (val) {
  14002. data[val] = parent[val] ? parent[val] : '';
  14003. });
  14004. } else {
  14005. // 历遍传过来的对象参数
  14006. for (var i in keys) {
  14007. // 如果子组件有此值则用,无此值则用父组件的值
  14008. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  14009. if (Array.isArray(keys[i])) {
  14010. if (keys[i].length) {
  14011. data[i] = keys[i];
  14012. } else {
  14013. data[i] = parent[i];
  14014. }
  14015. } else if (keys[i].constructor === Object) {
  14016. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  14017. if (Object.keys(keys[i]).length) {
  14018. data[i] = keys[i];
  14019. } else {
  14020. data[i] = parent[i];
  14021. }
  14022. } else {
  14023. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  14024. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  14025. }
  14026. }
  14027. }
  14028. return {
  14029. v: data
  14030. };
  14031. }();
  14032. if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
  14033. }
  14034. }
  14035. return {};
  14036. }
  14037. /***/ }),
  14038. /***/ 56:
  14039. /*!**********************************************************************!*\
  14040. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  14041. \**********************************************************************/
  14042. /*! no static exports found */
  14043. /***/ (function(module, exports, __webpack_require__) {
  14044. "use strict";
  14045. Object.defineProperty(exports, "__esModule", {
  14046. value: true
  14047. });
  14048. exports.default = $parent;
  14049. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  14050. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  14051. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  14052. // 值(默认为undefined),就是查找最顶层的$parent
  14053. function $parent() {
  14054. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  14055. var parent = this.$parent;
  14056. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  14057. while (parent) {
  14058. // 父组件
  14059. if (parent.$options && parent.$options.name !== name) {
  14060. // 如果组件的name不相等,继续上一级寻找
  14061. parent = parent.$parent;
  14062. } else {
  14063. return parent;
  14064. }
  14065. }
  14066. return false;
  14067. }
  14068. /***/ }),
  14069. /***/ 57:
  14070. /*!******************************************************************!*\
  14071. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  14072. \******************************************************************/
  14073. /*! no static exports found */
  14074. /***/ (function(module, exports, __webpack_require__) {
  14075. "use strict";
  14076. /* WEBPACK VAR INJECTION */(function(uni) {
  14077. Object.defineProperty(exports, "__esModule", {
  14078. value: true
  14079. });
  14080. exports.os = os;
  14081. exports.sys = sys;
  14082. function os() {
  14083. return uni.getSystemInfoSync().platform;
  14084. }
  14085. ;
  14086. function sys() {
  14087. return uni.getSystemInfoSync();
  14088. }
  14089. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14090. /***/ }),
  14091. /***/ 58:
  14092. /*!***********************************************************************!*\
  14093. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  14094. \***********************************************************************/
  14095. /*! no static exports found */
  14096. /***/ (function(module, exports, __webpack_require__) {
  14097. "use strict";
  14098. Object.defineProperty(exports, "__esModule", {
  14099. value: true
  14100. });
  14101. exports.default = void 0;
  14102. var timeout = null;
  14103. /**
  14104. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  14105. *
  14106. * @param {Function} func 要执行的回调函数
  14107. * @param {Number} wait 延时的时间
  14108. * @param {Boolean} immediate 是否立即执行
  14109. * @return null
  14110. */
  14111. function debounce(func) {
  14112. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14113. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14114. // 清除定时器
  14115. if (timeout !== null) clearTimeout(timeout);
  14116. // 立即执行,此类情况一般用不到
  14117. if (immediate) {
  14118. var callNow = !timeout;
  14119. timeout = setTimeout(function () {
  14120. timeout = null;
  14121. }, wait);
  14122. if (callNow) typeof func === 'function' && func();
  14123. } else {
  14124. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  14125. timeout = setTimeout(function () {
  14126. typeof func === 'function' && func();
  14127. }, wait);
  14128. }
  14129. }
  14130. var _default = debounce;
  14131. exports.default = _default;
  14132. /***/ }),
  14133. /***/ 59:
  14134. /*!***********************************************************************!*\
  14135. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  14136. \***********************************************************************/
  14137. /*! no static exports found */
  14138. /***/ (function(module, exports, __webpack_require__) {
  14139. "use strict";
  14140. Object.defineProperty(exports, "__esModule", {
  14141. value: true
  14142. });
  14143. exports.default = void 0;
  14144. var timeoutArr = [];
  14145. var flagArr = [];
  14146. /**
  14147. * 节流函数
  14148. * 节流原理:在一定时间内,只能触发一次
  14149. * @param {Function} fn 要执行的回调函数
  14150. * @param {Number} time 延时的时间
  14151. * @param {Boolean} isImmediate 是否立即执行
  14152. * @param {String} timeoutName 定时器ID
  14153. * @return null
  14154. */
  14155. function throttle(fn) {
  14156. var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14157. var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  14158. var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  14159. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  14160. if (isImmediate) {
  14161. if (!flagArr[timeoutName]) {
  14162. flagArr[timeoutName] = true;
  14163. // 如果是立即执行,则在time毫秒内开始时执行
  14164. if (typeof fn === 'function') fn();
  14165. timeoutArr[timeoutName] = setTimeout(function () {
  14166. flagArr[timeoutName] = false;
  14167. }, time);
  14168. }
  14169. } else {
  14170. if (!flagArr[timeoutName]) {
  14171. flagArr[timeoutName] = true;
  14172. // 如果是非立即执行,则在time毫秒内的结束处执行
  14173. timeoutArr[timeoutName] = setTimeout(function () {
  14174. flagArr[timeoutName] = false;
  14175. if (typeof fn === 'function') fn();
  14176. }, time);
  14177. }
  14178. }
  14179. }
  14180. ;
  14181. var _default = throttle;
  14182. exports.default = _default;
  14183. /***/ }),
  14184. /***/ 6:
  14185. /*!***************************************************************!*\
  14186. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  14187. \***************************************************************/
  14188. /*! no static exports found */
  14189. /***/ (function(module, exports) {
  14190. function _arrayWithHoles(arr) {
  14191. if (Array.isArray(arr)) return arr;
  14192. }
  14193. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14194. /***/ }),
  14195. /***/ 60:
  14196. /*!*******************************************************************!*\
  14197. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/config/config.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. // 第一版 1.10.1 版本发布于2021-11-18
  14207. var version = '1.10.1';
  14208. var _default = {
  14209. v: version,
  14210. version: version,
  14211. // 主题名称
  14212. type: ['primary', 'success', 'info', 'error', 'warning']
  14213. };
  14214. exports.default = _default;
  14215. /***/ }),
  14216. /***/ 61:
  14217. /*!*******************************************************************!*\
  14218. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  14219. \*******************************************************************/
  14220. /*! no static exports found */
  14221. /***/ (function(module, exports, __webpack_require__) {
  14222. "use strict";
  14223. Object.defineProperty(exports, "__esModule", {
  14224. value: true
  14225. });
  14226. exports.default = void 0;
  14227. // uniapp在H5中各API的z-index值如下:
  14228. /**
  14229. * actionsheet: 999
  14230. * modal: 999
  14231. * navigate: 998
  14232. * tabbar: 998
  14233. * toast: 999
  14234. */
  14235. var _default = {
  14236. toast: 10090,
  14237. noNetwork: 10080,
  14238. // popup包含popup,actionsheet,keyboard,picker的值
  14239. popup: 10075,
  14240. mask: 10070,
  14241. navbar: 980,
  14242. topTips: 975,
  14243. sticky: 970,
  14244. indexListSticky: 965
  14245. };
  14246. exports.default = _default;
  14247. /***/ }),
  14248. /***/ 62:
  14249. /*!**********************************!*\
  14250. !*** E:/work/mdapp/api/index.js ***!
  14251. \**********************************/
  14252. /*! no static exports found */
  14253. /***/ (function(module, exports, __webpack_require__) {
  14254. "use strict";
  14255. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14256. Object.defineProperty(exports, "__esModule", {
  14257. value: true
  14258. });
  14259. exports.default = void 0;
  14260. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 63));
  14261. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 66));
  14262. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 67));
  14263. var _default = {
  14264. base: _base.default,
  14265. estate: _estate.default,
  14266. cust: _cust.default
  14267. };
  14268. exports.default = _default;
  14269. /***/ }),
  14270. /***/ 63:
  14271. /*!*********************************!*\
  14272. !*** E:/work/mdapp/api/base.js ***!
  14273. \*********************************/
  14274. /*! no static exports found */
  14275. /***/ (function(module, exports, __webpack_require__) {
  14276. "use strict";
  14277. Object.defineProperty(exports, "__esModule", {
  14278. value: true
  14279. });
  14280. exports.default = void 0;
  14281. var _http = __webpack_require__(/*! @/utils/http */ 64);
  14282. var _default = {
  14283. apilogin: function apilogin(params) {
  14284. // 登录
  14285. return (0, _http.request)('api/login', params, 'loading');
  14286. },
  14287. apiregister: function apiregister(params) {
  14288. // 注册
  14289. return (0, _http.request)('api/register', params, 'loading');
  14290. },
  14291. apisendsms: function apisendsms(params) {
  14292. // 发送短信
  14293. return (0, _http.request)('api/send/sms', params, 'loading');
  14294. },
  14295. apicaptcha: function apicaptcha(params) {
  14296. // 验证码图片
  14297. return (0, _http.request)('api/captcha', params, 'loading');
  14298. },
  14299. apicheckcaptcha: function apicheckcaptcha(params) {
  14300. // 检查手机号
  14301. return (0, _http.request)('api/check/captcha', params);
  14302. },
  14303. apiwxlogin: function apiwxlogin(params) {
  14304. // 微信登录
  14305. return (0, _http.request)('api/wx/login', params, 'loading');
  14306. },
  14307. apiwxautologin: function apiwxautologin(params) {
  14308. // 微信登录 自动
  14309. return (0, _http.request)('api/wx/autologin', params, 'loading');
  14310. },
  14311. apiuserinfo: function apiuserinfo(params) {
  14312. // 用户信息
  14313. return (0, _http.request)('api/user/info', params, 'loading');
  14314. },
  14315. apiuseredit: function apiuseredit(params) {
  14316. // 用户编辑
  14317. return (0, _http.request)('api/user/edit', params, 'loading');
  14318. },
  14319. apiuserbindwechat: function apiuserbindwechat(params) {
  14320. // 绑定微信
  14321. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  14322. },
  14323. apiuserauthadd: function apiuserauthadd(params) {
  14324. // 用户认证 - 提交认证
  14325. return (0, _http.request)('api/user/auth/add', params, 'loading');
  14326. },
  14327. apiuserauthinfo: function apiuserauthinfo(params) {
  14328. // 用户认证 - 认证详情
  14329. return (0, _http.request)('api/user/auth/info', params, 'loading');
  14330. },
  14331. apiuploadcloudpiv: function apiuploadcloudpiv(params) {
  14332. // 图片上传云接口
  14333. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  14334. },
  14335. apidicttree: function apidicttree(params) {
  14336. // 字典
  14337. return (0, _http.request)('api/dict/tree', params, 'loading');
  14338. },
  14339. apiuserauthlist: function apiuserauthlist(params) {
  14340. // 认证列表
  14341. return (0, _http.request)('api/user/auth/list', params, 'loading');
  14342. },
  14343. apiuserauthedit: function apiuserauthedit(params) {
  14344. // 认证 审核 中介
  14345. return (0, _http.request)('api/user/auth/edit', params, 'loading');
  14346. },
  14347. apideptauthedit: function apideptauthedit(params) {
  14348. // 认证 审核 渠道
  14349. return (0, _http.request)('api/dept/auth/edit', params, 'loading');
  14350. },
  14351. apiuserreferreredit: function apiuserreferreredit(params) {
  14352. // 修改推荐人
  14353. return (0, _http.request)('api/user/referrer/edit', params, 'loading');
  14354. },
  14355. apiusernoticeopen: function apiusernoticeopen(params) {
  14356. // 公众号 推送 打开
  14357. return (0, _http.request)('api/user/notice/open', params, 'loading');
  14358. },
  14359. apiusernoticeclose: function apiusernoticeclose(params) {
  14360. // 公众号 推送 关闭
  14361. return (0, _http.request)('api/user/notice/close', params, 'loading');
  14362. }
  14363. };
  14364. exports.default = _default;
  14365. /***/ }),
  14366. /***/ 64:
  14367. /*!***********************************!*\
  14368. !*** E:/work/mdapp/utils/http.js ***!
  14369. \***********************************/
  14370. /*! no static exports found */
  14371. /***/ (function(module, exports, __webpack_require__) {
  14372. "use strict";
  14373. /* WEBPACK VAR INJECTION */(function(uni) {
  14374. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14375. Object.defineProperty(exports, "__esModule", {
  14376. value: true
  14377. });
  14378. exports.request = request;
  14379. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  14380. var _utils = __webpack_require__(/*! @utils */ 65);
  14381. 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; }
  14382. 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; }
  14383. var Http = function Http() {
  14384. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  14385. data: {}
  14386. };
  14387. return new Promise(function (resolve, reject) {
  14388. if (options.loadingStr === 'loading') {
  14389. uni.showLoading({
  14390. mask: true,
  14391. title: '加载中..'
  14392. });
  14393. }
  14394. var token = uni.getStorageSync('MD_token') || '';
  14395. var header = {
  14396. 'Content-Type': 'application/json',
  14397. 'token': token
  14398. // 'Content-Type': 'application/x-www-form-urlencoded'
  14399. };
  14400. var params = _objectSpread({}, options.data);
  14401. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  14402. for (var key in options.data) {
  14403. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  14404. params[key] = '';
  14405. }
  14406. }
  14407. var url = uni.baseUrl + options.url;
  14408. // let url = options.url
  14409. if (options.queryData) {
  14410. var qStr = '';
  14411. for (var k in options.queryData) {
  14412. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  14413. }
  14414. qStr = qStr.substr(0, qStr.length - 1);
  14415. url += "?".concat(qStr);
  14416. }
  14417. uni.request({
  14418. url: url,
  14419. data: _objectSpread({}, params),
  14420. header: header,
  14421. method: options.method || 'POST',
  14422. complete: function complete(res) {
  14423. if (options.loadingStr === 'loading') {
  14424. uni.hideLoading();
  14425. }
  14426. },
  14427. success: function success(res) {
  14428. var cData = res.data;
  14429. var code = cData.errno;
  14430. switch (code) {
  14431. case 0:
  14432. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  14433. break;
  14434. case 401:
  14435. case 404:
  14436. case 405:
  14437. uni.removeStorageSync('MD_userInfo');
  14438. var u2 = uni.getStorageSync('MD_userInfo2');
  14439. if (u2.bind_wechat === '1' && uni.getStorageSync('MD_token')) {
  14440. uni.login({
  14441. success: function success(res) {
  14442. if (res.code) {
  14443. uni.api.base.apiwxautologin({
  14444. code: res.code
  14445. }).then(function (cData) {
  14446. if (cData.token === 'error') {
  14447. uni.removeStorageSync('MD_token');
  14448. } else {
  14449. uni.setStorageSync('MD_userInfo', cData);
  14450. uni.setStorageSync('MD_token', cData.token);
  14451. uni.api.base.apidicttree().then(function (res) {
  14452. var cObj = res || {};
  14453. var newDict = {};
  14454. for (var _k in cObj) {
  14455. var cArr = cObj[_k].map(function (item) {
  14456. return _objectSpread(_objectSpread({}, item), {}, {
  14457. key: item.dict_label,
  14458. val: item.dict_value
  14459. });
  14460. });
  14461. newDict[_k] = cArr;
  14462. }
  14463. uni.setStorageSync('MD_dict', newDict);
  14464. });
  14465. uni.api.base.apiuserinfo().then(function (res2) {
  14466. uni.setStorageSync('MD_userInfo2', res2);
  14467. uni.reLaunch({
  14468. url: '/pages/index/index'
  14469. });
  14470. });
  14471. }
  14472. });
  14473. }
  14474. }
  14475. });
  14476. } else {
  14477. uni.showToast({
  14478. title: "\u8BF7\u5148\u767B\u5F55~",
  14479. icon: 'none'
  14480. });
  14481. uni.navigateTo({
  14482. url: '/pages/user/login/login'
  14483. });
  14484. }
  14485. break;
  14486. default:
  14487. uni.showModal({
  14488. title: '提示',
  14489. content: "".concat(cData.errmsg, "(").concat(code, ")")
  14490. });
  14491. return reject(cData);
  14492. }
  14493. // resolve()
  14494. },
  14495. fail: function fail(err) {
  14496. console.log(err);
  14497. reject(err);
  14498. }
  14499. });
  14500. });
  14501. };
  14502. // export default Http
  14503. function request(url, data, loadingStr, queryData) {
  14504. return Http({
  14505. url: url,
  14506. data: data,
  14507. loadingStr: loadingStr,
  14508. queryData: queryData
  14509. });
  14510. }
  14511. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14512. /***/ }),
  14513. /***/ 65:
  14514. /*!************************************!*\
  14515. !*** E:/work/mdapp/utils/index.js ***!
  14516. \************************************/
  14517. /*! no static exports found */
  14518. /***/ (function(module, exports, __webpack_require__) {
  14519. "use strict";
  14520. Object.defineProperty(exports, "__esModule", {
  14521. value: true
  14522. });
  14523. exports.arrToObj = arrToObj;
  14524. exports.comGetTime = comGetTime;
  14525. exports.noEmpty = noEmpty;
  14526. exports.numFormat3 = numFormat3;
  14527. exports.strTrim = strTrim;
  14528. /**
  14529. * @param {string} str
  14530. * @returns {string}
  14531. */
  14532. function strTrim(str) {
  14533. return str.replace(/(^\s*)|(\s*$)/g, '');
  14534. }
  14535. /**
  14536. * @param {Number} num
  14537. * @returns {string}
  14538. */
  14539. function numFormat3(num) {
  14540. var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14541. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  14542. var arr = numArr[0].split('').reverse();
  14543. var res = [];
  14544. for (var i = 0; i < arr.length; i++) {
  14545. if (i % 3 === 0 && i !== 0) {
  14546. res.push(',');
  14547. }
  14548. res.push(arr[i]);
  14549. }
  14550. res.reverse();
  14551. if (numArr[1]) {
  14552. res = res.join('').concat('.' + numArr[1]);
  14553. } else {
  14554. res = res.join('');
  14555. }
  14556. // let res = num.toString().replace(/\d+/, function(n){
  14557. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  14558. // return $1 + ","
  14559. // })
  14560. // })
  14561. // toLocaleString()
  14562. return res;
  14563. }
  14564. /**
  14565. * @param {Array} arr
  14566. * @returns {Object}
  14567. */
  14568. function arrToObj(arr) {
  14569. var obj = {};
  14570. if (Object.prototype.toString.call(arr) === '[object Array]') {
  14571. if (arr.length > 0) {
  14572. arr.forEach(function (item) {
  14573. obj[item.val] = item.key;
  14574. });
  14575. }
  14576. }
  14577. return obj;
  14578. }
  14579. /**
  14580. * @param {any} val
  14581. * @returns {Boolean}
  14582. */
  14583. function noEmpty(val) {
  14584. if (val === null || val === undefined || val === '') {
  14585. return false;
  14586. } else {
  14587. return true;
  14588. }
  14589. }
  14590. /**
  14591. * @param {Number} date
  14592. * @param {Boolean} onlyDate
  14593. * @returns {String}
  14594. * function time(time = +new Date()) {
  14595. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  14596. return date.toJSON().substr(0, 19).replace('T', ' ');
  14597. }
  14598. */
  14599. function comGetTime() {
  14600. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
  14601. var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  14602. var year = date.getFullYear();
  14603. var month = date.getMonth() + 1;
  14604. month = month > 9 ? month : '0' + month;
  14605. var day = date.getDate();
  14606. day = day > 9 ? day : '0' + day;
  14607. var hour = date.getHours();
  14608. hour = hour > 9 ? hour : '0' + hour;
  14609. var minute = date.getMinutes();
  14610. minute = minute > 9 ? minute : '0' + minute;
  14611. var second = date.getSeconds();
  14612. second = second > 9 ? second : '0' + second;
  14613. var milli = date.getMilliseconds();
  14614. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  14615. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  14616. }
  14617. /***/ }),
  14618. /***/ 66:
  14619. /*!***********************************!*\
  14620. !*** E:/work/mdapp/api/estate.js ***!
  14621. \***********************************/
  14622. /*! no static exports found */
  14623. /***/ (function(module, exports, __webpack_require__) {
  14624. "use strict";
  14625. Object.defineProperty(exports, "__esModule", {
  14626. value: true
  14627. });
  14628. exports.default = void 0;
  14629. var _http = __webpack_require__(/*! @/utils/http */ 64);
  14630. var _default = {
  14631. apiestatelist: function apiestatelist(params) {
  14632. // 楼盘列表
  14633. return (0, _http.request)('api/estate/list', params, 'loading');
  14634. },
  14635. apiestatecontentdetail: function apiestatecontentdetail(params) {
  14636. // 楼盘 介绍详情
  14637. return (0, _http.request)('api/estate/content/detail', params, 'loading');
  14638. },
  14639. apireportadd: function apireportadd(params) {
  14640. // 报备 - 添加报备
  14641. return (0, _http.request)('api/report/add', params, 'loading');
  14642. },
  14643. apireportlist: function apireportlist(params) {
  14644. // 报备 - 报备列表
  14645. return (0, _http.request)('api/report/list', params, 'loading');
  14646. },
  14647. apireportdetail: function apireportdetail(params) {
  14648. // 报备 - 报备详情
  14649. return (0, _http.request)('api/report/detail', params, 'loading');
  14650. },
  14651. apireport2detail: function apireport2detail(params) {
  14652. // 报备 - 报备详情2 普通的报备详情
  14653. return (0, _http.request)('api/report2/detail', params, 'loading');
  14654. },
  14655. apigoverndetail: function apigoverndetail(params) {
  14656. // 报备 - 报备详情 /govern/detail
  14657. return (0, _http.request)('api/govern/detail', params, 'loading');
  14658. },
  14659. apireportsite: function apireportsite(params) {
  14660. // 案场 - 报备详情
  14661. return (0, _http.request)('api/report/site', params, 'loading');
  14662. },
  14663. apireportconfirm: function apireportconfirm(params) {
  14664. // 报备 - 报备确认
  14665. return (0, _http.request)('api/report/confirm', params, 'loading');
  14666. },
  14667. apireportcount: function apireportcount(params) {
  14668. // 报备 - 报备统计
  14669. return (0, _http.request)('api/report/count', params, 'loading');
  14670. },
  14671. apireportgroupcount: function apireportgroupcount(params) {
  14672. // 报备 - 报备分组统计
  14673. return (0, _http.request)('api/report/group/count', params, 'loading');
  14674. },
  14675. apiestateinfodetail: function apiestateinfodetail(params) {
  14676. // 楼盘一页纸
  14677. return (0, _http.request)('api/estate/info/detail', params, 'loading');
  14678. },
  14679. apiestatedetail: function apiestatedetail(params) {
  14680. // 楼盘详情 copy plus
  14681. return (0, _http.request)('api/estate/detail', params, 'loading');
  14682. },
  14683. apigovernlist: function apigovernlist(params) {
  14684. // 案场缺课列表
  14685. return (0, _http.request)('api/govern/list', params, 'loading');
  14686. },
  14687. apireportedit: function apireportedit(params) {
  14688. // 报备修改 接口
  14689. return (0, _http.request)('api/report/edit', params, 'loading');
  14690. },
  14691. apireportsubscrlist: function apireportsubscrlist(params) {
  14692. // 认购审核列表
  14693. return (0, _http.request)('api/report/subscr/list', params, 'loading');
  14694. },
  14695. apireportsubscrDeal: function apireportsubscrDeal(params) {
  14696. // 已认购审核
  14697. return (0, _http.request)('api/report/subscr', params, 'loading');
  14698. },
  14699. apireportsignupDeal: function apireportsignupDeal(params) {
  14700. // 已签约审核
  14701. return (0, _http.request)('api/report/signup', params, 'loading');
  14702. },
  14703. apiestateliblist: function apiestateliblist(params) {
  14704. // 内部 各楼盘各平台佣金汇集
  14705. return (0, _http.request)('api/estate/lib/list', params, 'loading');
  14706. },
  14707. apiestatelibdetail: function apiestatelibdetail(params) {
  14708. // 内部 各楼盘各平台佣金汇集 详情
  14709. return (0, _http.request)('api/estate/lib/detail', params, 'loading');
  14710. }
  14711. };
  14712. exports.default = _default;
  14713. /***/ }),
  14714. /***/ 67:
  14715. /*!*********************************!*\
  14716. !*** E:/work/mdapp/api/cust.js ***!
  14717. \*********************************/
  14718. /*! no static exports found */
  14719. /***/ (function(module, exports, __webpack_require__) {
  14720. "use strict";
  14721. Object.defineProperty(exports, "__esModule", {
  14722. value: true
  14723. });
  14724. exports.default = void 0;
  14725. var _http = __webpack_require__(/*! @/utils/http */ 64);
  14726. var _default = {
  14727. apicustomerlist: function apicustomerlist(params) {
  14728. // 客户 列表
  14729. return (0, _http.request)('api/customer/list', params);
  14730. },
  14731. apicustomeradd: function apicustomeradd(params) {
  14732. // 客户 添加
  14733. return (0, _http.request)('api/customer/add', params, 'loading');
  14734. },
  14735. apicustomeredit: function apicustomeredit(params) {
  14736. // 客户 编辑
  14737. return (0, _http.request)('api/customer/edit', params, 'loading');
  14738. },
  14739. apicustomerdel: function apicustomerdel(params) {
  14740. // 客户 删除
  14741. return (0, _http.request)('api/customer/del', params, 'loading');
  14742. },
  14743. apicustomerdetail: function apicustomerdetail(params) {
  14744. // 客户 详情
  14745. return (0, _http.request)('api/customer/detail', params, 'loading');
  14746. },
  14747. apireportvisitchange: function apireportvisitchange(params) {
  14748. // 到访材料添加
  14749. return (0, _http.request)('api/report/visit/change', params, 'loading');
  14750. },
  14751. apireportvisitdetail: function apireportvisitdetail(params) {
  14752. // 到访材料详情
  14753. return (0, _http.request)('api/report/visit/detail', params, 'loading');
  14754. },
  14755. apireportvisit: function apireportvisit(params) {
  14756. // 报备到访
  14757. return (0, _http.request)('api/report/visit', params, 'loading');
  14758. },
  14759. apireportverify: function apireportverify(params) {
  14760. // 报备审核
  14761. return (0, _http.request)('api/report/verify', params, 'loading');
  14762. },
  14763. apideptuserlist: function apideptuserlist(params) {
  14764. // 我的门店下级人员
  14765. return (0, _http.request)('api/dept/user/list', params, 'loading');
  14766. },
  14767. apiprivatecustomerlist: function apiprivatecustomerlist(params) {
  14768. // 内部客户 列表
  14769. return (0, _http.request)('api/private/customer/list', params);
  14770. },
  14771. apiprivatecustomeradd: function apiprivatecustomeradd(params) {
  14772. // 内部客户 添加
  14773. return (0, _http.request)('api/private/customer/add', params, 'loading');
  14774. },
  14775. apiprivatecustomeredit: function apiprivatecustomeredit(params) {
  14776. // 内部客户 编辑
  14777. return (0, _http.request)('api/private/customer/edit', params, 'loading');
  14778. },
  14779. apiprivatecustomerdel: function apiprivatecustomerdel(params) {
  14780. // 内部客户 删除
  14781. return (0, _http.request)('api/private/customer/del', params, 'loading');
  14782. },
  14783. apiprivatecustomerdetail: function apiprivatecustomerdetail(params) {
  14784. // 内部客户 详情
  14785. return (0, _http.request)('api/private/customer/detail', params, 'loading');
  14786. },
  14787. apiprivaterecordlist: function apiprivaterecordlist(params) {
  14788. // 内部客户 - 跟进记录 - 列表
  14789. return (0, _http.request)('api/private/record/list', params);
  14790. },
  14791. apiprivaterecordadd: function apiprivaterecordadd(params) {
  14792. // 内部客户 - 跟进记录 - 添加
  14793. return (0, _http.request)('api/private/record/add', params, 'loading');
  14794. },
  14795. apiprivaterecordedit: function apiprivaterecordedit(params) {
  14796. // 内部客户 - 跟进记录 - 编辑
  14797. return (0, _http.request)('api/private/record/edit', params, 'loading');
  14798. },
  14799. apiprivaterecorddel: function apiprivaterecorddel(params) {
  14800. // 内部客户 - 跟进记录 - 删除
  14801. return (0, _http.request)('api/private/record/del', params, 'loading');
  14802. },
  14803. apirecordremindcount: function apirecordremindcount(params) {
  14804. // 内部客户 - 跟进记录 - 数量统计
  14805. return (0, _http.request)('api/record/remind/count', params, 'loading');
  14806. }
  14807. };
  14808. exports.default = _default;
  14809. /***/ }),
  14810. /***/ 68:
  14811. /*!***********************************!*\
  14812. !*** E:/work/mdapp/utils/tool.js ***!
  14813. \***********************************/
  14814. /*! no static exports found */
  14815. /***/ (function(module, exports, __webpack_require__) {
  14816. "use strict";
  14817. /* WEBPACK VAR INJECTION */(function(uni) {
  14818. Object.defineProperty(exports, "__esModule", {
  14819. value: true
  14820. });
  14821. exports.msgBase = exports.getRandomNum = exports.confirmMsgFn = void 0;
  14822. var getRandomNum = function getRandomNum(len, radix) {
  14823. // getRandomNum(24, 16)
  14824. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  14825. var uuid = [];
  14826. radix = radix || chars.length;
  14827. if (len) {
  14828. // Compact form
  14829. for (var i = 0; i < len; i++) {
  14830. uuid[i] = chars[0 | Math.random() * radix];
  14831. }
  14832. } else {
  14833. // rfc4122, version 4 form
  14834. var r;
  14835. // rfc4122 requires these characters
  14836. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  14837. uuid[14] = '4';
  14838. // Fill in random data.  At i==19 set the high bits of clock sequence as
  14839. // per rfc4122, sec. 4.1.5
  14840. for (var _i = 0; _i < 36; _i++) {
  14841. if (!uuid[_i]) {
  14842. r = 0 | Math.random() * 16;
  14843. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  14844. }
  14845. }
  14846. }
  14847. return uuid.join('') + new Date().getTime();
  14848. };
  14849. exports.getRandomNum = getRandomNum;
  14850. var msgBase = function msgBase(msgText, bc) {
  14851. uni.showToast({
  14852. title: msgText,
  14853. icon: 'none',
  14854. duration: 2000
  14855. }).then(function () {
  14856. if (bc) bc();
  14857. });
  14858. };
  14859. exports.msgBase = msgBase;
  14860. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {
  14861. var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  14862. uni.showModal({
  14863. title: title,
  14864. content: msgText,
  14865. success: function success(res) {
  14866. if (res.confirm) {
  14867. if (successBc) successBc();
  14868. } else if (res.cancel) {
  14869. if (errorBc) errorBc();
  14870. }
  14871. }
  14872. });
  14873. };
  14874. exports.confirmMsgFn = confirmMsgFn;
  14875. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14876. /***/ }),
  14877. /***/ 7:
  14878. /*!*********************************************************************!*\
  14879. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  14880. \*********************************************************************/
  14881. /*! no static exports found */
  14882. /***/ (function(module, exports) {
  14883. function _iterableToArrayLimit(arr, i) {
  14884. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  14885. if (null != _i) {
  14886. var _s,
  14887. _e,
  14888. _x,
  14889. _r,
  14890. _arr = [],
  14891. _n = !0,
  14892. _d = !1;
  14893. try {
  14894. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  14895. if (Object(_i) !== _i) return;
  14896. _n = !1;
  14897. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  14898. ;
  14899. }
  14900. } catch (err) {
  14901. _d = !0, _e = err;
  14902. } finally {
  14903. try {
  14904. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  14905. } finally {
  14906. if (_d) throw _e;
  14907. }
  14908. }
  14909. return _arr;
  14910. }
  14911. }
  14912. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14913. /***/ }),
  14914. /***/ 8:
  14915. /*!***************************************************************************!*\
  14916. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  14917. \***************************************************************************/
  14918. /*! no static exports found */
  14919. /***/ (function(module, exports, __webpack_require__) {
  14920. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  14921. function _unsupportedIterableToArray(o, minLen) {
  14922. if (!o) return;
  14923. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  14924. var n = Object.prototype.toString.call(o).slice(8, -1);
  14925. if (n === "Object" && o.constructor) n = o.constructor.name;
  14926. if (n === "Map" || n === "Set") return Array.from(o);
  14927. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  14928. }
  14929. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14930. /***/ }),
  14931. /***/ 9:
  14932. /*!*****************************************************************!*\
  14933. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  14934. \*****************************************************************/
  14935. /*! no static exports found */
  14936. /***/ (function(module, exports) {
  14937. function _arrayLikeToArray(arr, len) {
  14938. if (len == null || len > arr.length) len = arr.length;
  14939. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  14940. arr2[i] = arr[i];
  14941. }
  14942. return arr2;
  14943. }
  14944. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14945. /***/ })
  14946. }]);
  14947. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map