vendor.js 426 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  10. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. var HOOKS = [
  107. 'invoke',
  108. 'success',
  109. 'fail',
  110. 'complete',
  111. 'returnValue'];
  112. var globalInterceptors = {};
  113. var scopedInterceptors = {};
  114. function mergeHook(parentVal, childVal) {
  115. var res = childVal ?
  116. parentVal ?
  117. parentVal.concat(childVal) :
  118. Array.isArray(childVal) ?
  119. childVal : [childVal] :
  120. parentVal;
  121. return res ?
  122. dedupeHooks(res) :
  123. res;
  124. }
  125. function dedupeHooks(hooks) {
  126. var res = [];
  127. for (var i = 0; i < hooks.length; i++) {
  128. if (res.indexOf(hooks[i]) === -1) {
  129. res.push(hooks[i]);
  130. }
  131. }
  132. return res;
  133. }
  134. function removeHook(hooks, hook) {
  135. var index = hooks.indexOf(hook);
  136. if (index !== -1) {
  137. hooks.splice(index, 1);
  138. }
  139. }
  140. function mergeInterceptorHook(interceptor, option) {
  141. Object.keys(option).forEach(function (hook) {
  142. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  143. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  144. }
  145. });
  146. }
  147. function removeInterceptorHook(interceptor, option) {
  148. if (!interceptor || !option) {
  149. return;
  150. }
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. removeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function addInterceptor(method, option) {
  158. if (typeof method === 'string' && isPlainObject(option)) {
  159. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  160. } else if (isPlainObject(method)) {
  161. mergeInterceptorHook(globalInterceptors, method);
  162. }
  163. }
  164. function removeInterceptor(method, option) {
  165. if (typeof method === 'string') {
  166. if (isPlainObject(option)) {
  167. removeInterceptorHook(scopedInterceptors[method], option);
  168. } else {
  169. delete scopedInterceptors[method];
  170. }
  171. } else if (isPlainObject(method)) {
  172. removeInterceptorHook(globalInterceptors, method);
  173. }
  174. }
  175. function wrapperHook(hook) {
  176. return function (data) {
  177. return hook(data) || data;
  178. };
  179. }
  180. function isPromise(obj) {
  181. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  182. }
  183. function queue(hooks, data) {
  184. var promise = false;
  185. for (var i = 0; i < hooks.length; i++) {
  186. var hook = hooks[i];
  187. if (promise) {
  188. promise = Promise.resolve(wrapperHook(hook));
  189. } else {
  190. var res = hook(data);
  191. if (isPromise(res)) {
  192. promise = Promise.resolve(res);
  193. }
  194. if (res === false) {
  195. return {
  196. then: function then() {} };
  197. }
  198. }
  199. }
  200. return promise || {
  201. then: function then(callback) {
  202. return callback(data);
  203. } };
  204. }
  205. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  206. ['success', 'fail', 'complete'].forEach(function (name) {
  207. if (Array.isArray(interceptor[name])) {
  208. var oldCallback = options[name];
  209. options[name] = function callbackInterceptor(res) {
  210. queue(interceptor[name], res).then(function (res) {
  211. /* eslint-disable no-mixed-operators */
  212. return isFn(oldCallback) && oldCallback(res) || res;
  213. });
  214. };
  215. }
  216. });
  217. return options;
  218. }
  219. function wrapperReturnValue(method, returnValue) {
  220. var returnValueHooks = [];
  221. if (Array.isArray(globalInterceptors.returnValue)) {
  222. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  223. }
  224. var interceptor = scopedInterceptors[method];
  225. if (interceptor && Array.isArray(interceptor.returnValue)) {
  226. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  227. }
  228. returnValueHooks.forEach(function (hook) {
  229. returnValue = hook(returnValue) || returnValue;
  230. });
  231. return returnValue;
  232. }
  233. function getApiInterceptorHooks(method) {
  234. var interceptor = Object.create(null);
  235. Object.keys(globalInterceptors).forEach(function (hook) {
  236. if (hook !== 'returnValue') {
  237. interceptor[hook] = globalInterceptors[hook].slice();
  238. }
  239. });
  240. var scopedInterceptor = scopedInterceptors[method];
  241. if (scopedInterceptor) {
  242. Object.keys(scopedInterceptor).forEach(function (hook) {
  243. if (hook !== 'returnValue') {
  244. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  245. }
  246. });
  247. }
  248. return interceptor;
  249. }
  250. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  251. var interceptor = getApiInterceptorHooks(method);
  252. if (interceptor && Object.keys(interceptor).length) {
  253. if (Array.isArray(interceptor.invoke)) {
  254. var res = queue(interceptor.invoke, options);
  255. return res.then(function (options) {
  256. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  257. });
  258. } else {
  259. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  260. }
  261. }
  262. return api.apply(void 0, [options].concat(params));
  263. }
  264. var promiseInterceptor = {
  265. returnValue: function returnValue(res) {
  266. if (!isPromise(res)) {
  267. return res;
  268. }
  269. return new Promise(function (resolve, reject) {
  270. res.then(function (res) {
  271. if (res[0]) {
  272. reject(res[0]);
  273. } else {
  274. resolve(res[1]);
  275. }
  276. });
  277. });
  278. } };
  279. var SYNC_API_RE =
  280. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  281. var CONTEXT_API_RE = /^create|Manager$/;
  282. // Context例外情况
  283. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  284. // 同步例外情况
  285. var ASYNC_API = ['createBLEConnection'];
  286. var CALLBACK_API_RE = /^on|^off/;
  287. function isContextApi(name) {
  288. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  289. }
  290. function isSyncApi(name) {
  291. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  292. }
  293. function isCallbackApi(name) {
  294. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  295. }
  296. function handlePromise(promise) {
  297. return promise.then(function (data) {
  298. return [null, data];
  299. }).
  300. catch(function (err) {return [err];});
  301. }
  302. function shouldPromise(name) {
  303. if (
  304. isContextApi(name) ||
  305. isSyncApi(name) ||
  306. isCallbackApi(name))
  307. {
  308. return false;
  309. }
  310. return true;
  311. }
  312. /* eslint-disable no-extend-native */
  313. if (!Promise.prototype.finally) {
  314. Promise.prototype.finally = function (callback) {
  315. var promise = this.constructor;
  316. return this.then(
  317. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  318. function (reason) {return promise.resolve(callback()).then(function () {
  319. throw reason;
  320. });});
  321. };
  322. }
  323. function promisify(name, api) {
  324. if (!shouldPromise(name)) {
  325. return api;
  326. }
  327. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  328. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  329. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  330. }
  331. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  332. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  333. success: resolve,
  334. fail: reject })].concat(
  335. params));
  336. })));
  337. };
  338. }
  339. var EPS = 1e-4;
  340. var BASE_DEVICE_WIDTH = 750;
  341. var isIOS = false;
  342. var deviceWidth = 0;
  343. var deviceDPR = 0;
  344. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  345. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  346. deviceWidth = windowWidth;
  347. deviceDPR = pixelRatio;
  348. isIOS = platform === 'ios';
  349. }
  350. function upx2px(number, newDeviceWidth) {
  351. if (deviceWidth === 0) {
  352. checkDeviceWidth();
  353. }
  354. number = Number(number);
  355. if (number === 0) {
  356. return 0;
  357. }
  358. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  359. if (result < 0) {
  360. result = -result;
  361. }
  362. result = Math.floor(result + EPS);
  363. if (result === 0) {
  364. if (deviceDPR === 1 || !isIOS) {
  365. result = 1;
  366. } else {
  367. result = 0.5;
  368. }
  369. }
  370. return number < 0 ? -result : result;
  371. }
  372. function getLocale() {
  373. // 优先使用 $locale
  374. var app = getApp({
  375. allowDefault: true });
  376. if (app && app.$vm) {
  377. return app.$vm.$locale;
  378. }
  379. return wx.getSystemInfoSync().language || 'zh-Hans';
  380. }
  381. function setLocale(locale) {
  382. var app = getApp();
  383. if (!app) {
  384. return false;
  385. }
  386. var oldLocale = app.$vm.$locale;
  387. if (oldLocale !== locale) {
  388. app.$vm.$locale = locale;
  389. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  390. locale: locale });});
  391. return true;
  392. }
  393. return false;
  394. }
  395. var onLocaleChangeCallbacks = [];
  396. function onLocaleChange(fn) {
  397. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  398. onLocaleChangeCallbacks.push(fn);
  399. }
  400. }
  401. if (typeof global !== 'undefined') {
  402. global.getLocale = getLocale;
  403. }
  404. var interceptors = {
  405. promiseInterceptor: promiseInterceptor };
  406. var baseApi = /*#__PURE__*/Object.freeze({
  407. __proto__: null,
  408. upx2px: upx2px,
  409. getLocale: getLocale,
  410. setLocale: setLocale,
  411. onLocaleChange: onLocaleChange,
  412. addInterceptor: addInterceptor,
  413. removeInterceptor: removeInterceptor,
  414. interceptors: interceptors });
  415. function findExistsPageIndex(url) {
  416. var pages = getCurrentPages();
  417. var len = pages.length;
  418. while (len--) {
  419. var page = pages[len];
  420. if (page.$page && page.$page.fullPath === url) {
  421. return len;
  422. }
  423. }
  424. return -1;
  425. }
  426. var redirectTo = {
  427. name: function name(fromArgs) {
  428. if (fromArgs.exists === 'back' && fromArgs.delta) {
  429. return 'navigateBack';
  430. }
  431. return 'redirectTo';
  432. },
  433. args: function args(fromArgs) {
  434. if (fromArgs.exists === 'back' && fromArgs.url) {
  435. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  436. if (existsPageIndex !== -1) {
  437. var delta = getCurrentPages().length - 1 - existsPageIndex;
  438. if (delta > 0) {
  439. fromArgs.delta = delta;
  440. }
  441. }
  442. }
  443. } };
  444. var previewImage = {
  445. args: function args(fromArgs) {
  446. var currentIndex = parseInt(fromArgs.current);
  447. if (isNaN(currentIndex)) {
  448. return;
  449. }
  450. var urls = fromArgs.urls;
  451. if (!Array.isArray(urls)) {
  452. return;
  453. }
  454. var len = urls.length;
  455. if (!len) {
  456. return;
  457. }
  458. if (currentIndex < 0) {
  459. currentIndex = 0;
  460. } else if (currentIndex >= len) {
  461. currentIndex = len - 1;
  462. }
  463. if (currentIndex > 0) {
  464. fromArgs.current = urls[currentIndex];
  465. fromArgs.urls = urls.filter(
  466. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  467. } else {
  468. fromArgs.current = urls[0];
  469. }
  470. return {
  471. indicator: false,
  472. loop: false };
  473. } };
  474. var UUID_KEY = '__DC_STAT_UUID';
  475. var deviceId;
  476. function addUuid(result) {
  477. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  478. if (!deviceId) {
  479. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  480. wx.setStorage({
  481. key: UUID_KEY,
  482. data: deviceId });
  483. }
  484. result.deviceId = deviceId;
  485. }
  486. function addSafeAreaInsets(result) {
  487. if (result.safeArea) {
  488. var safeArea = result.safeArea;
  489. result.safeAreaInsets = {
  490. top: safeArea.top,
  491. left: safeArea.left,
  492. right: result.windowWidth - safeArea.right,
  493. bottom: result.windowHeight - safeArea.bottom };
  494. }
  495. }
  496. var getSystemInfo = {
  497. returnValue: function returnValue(result) {
  498. addUuid(result);
  499. addSafeAreaInsets(result);
  500. } };
  501. // import navigateTo from 'uni-helpers/navigate-to'
  502. var protocols = {
  503. redirectTo: redirectTo,
  504. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  505. previewImage: previewImage,
  506. getSystemInfo: getSystemInfo,
  507. getSystemInfoSync: getSystemInfo };
  508. var todos = [
  509. 'vibrate',
  510. 'preloadPage',
  511. 'unPreloadPage',
  512. 'loadSubPackage'];
  513. var canIUses = [];
  514. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  515. function processCallback(methodName, method, returnValue) {
  516. return function (res) {
  517. return method(processReturnValue(methodName, res, returnValue));
  518. };
  519. }
  520. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  521. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  522. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  523. if (isFn(argsOption)) {
  524. argsOption = argsOption(fromArgs, toArgs) || {};
  525. }
  526. for (var key in fromArgs) {
  527. if (hasOwn(argsOption, key)) {
  528. var keyOption = argsOption[key];
  529. if (isFn(keyOption)) {
  530. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  531. }
  532. if (!keyOption) {// 不支持的参数
  533. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  534. } else if (isStr(keyOption)) {// 重写参数 key
  535. toArgs[keyOption] = fromArgs[key];
  536. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  537. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  538. }
  539. } else if (CALLBACKS.indexOf(key) !== -1) {
  540. if (isFn(fromArgs[key])) {
  541. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  542. }
  543. } else {
  544. if (!keepFromArgs) {
  545. toArgs[key] = fromArgs[key];
  546. }
  547. }
  548. }
  549. return toArgs;
  550. } else if (isFn(fromArgs)) {
  551. fromArgs = processCallback(methodName, fromArgs, returnValue);
  552. }
  553. return fromArgs;
  554. }
  555. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  556. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  557. res = protocols.returnValue(methodName, res);
  558. }
  559. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  560. }
  561. function wrapper(methodName, method) {
  562. if (hasOwn(protocols, methodName)) {
  563. var protocol = protocols[methodName];
  564. if (!protocol) {// 暂不支持的 api
  565. return function () {
  566. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  567. };
  568. }
  569. return function (arg1, arg2) {// 目前 api 最多两个参数
  570. var options = protocol;
  571. if (isFn(protocol)) {
  572. options = protocol(arg1);
  573. }
  574. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  575. var args = [arg1];
  576. if (typeof arg2 !== 'undefined') {
  577. args.push(arg2);
  578. }
  579. if (isFn(options.name)) {
  580. methodName = options.name(arg1);
  581. } else if (isStr(options.name)) {
  582. methodName = options.name;
  583. }
  584. var returnValue = wx[methodName].apply(wx, args);
  585. if (isSyncApi(methodName)) {// 同步 api
  586. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  587. }
  588. return returnValue;
  589. };
  590. }
  591. return method;
  592. }
  593. var todoApis = Object.create(null);
  594. var TODOS = [
  595. 'onTabBarMidButtonTap',
  596. 'subscribePush',
  597. 'unsubscribePush',
  598. 'onPush',
  599. 'offPush',
  600. 'share'];
  601. function createTodoApi(name) {
  602. return function todoApi(_ref)
  603. {var fail = _ref.fail,complete = _ref.complete;
  604. var res = {
  605. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  606. isFn(fail) && fail(res);
  607. isFn(complete) && complete(res);
  608. };
  609. }
  610. TODOS.forEach(function (name) {
  611. todoApis[name] = createTodoApi(name);
  612. });
  613. var providers = {
  614. oauth: ['weixin'],
  615. share: ['weixin'],
  616. payment: ['wxpay'],
  617. push: ['weixin'] };
  618. function getProvider(_ref2)
  619. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  620. var res = false;
  621. if (providers[service]) {
  622. res = {
  623. errMsg: 'getProvider:ok',
  624. service: service,
  625. provider: providers[service] };
  626. isFn(success) && success(res);
  627. } else {
  628. res = {
  629. errMsg: 'getProvider:fail service not found' };
  630. isFn(fail) && fail(res);
  631. }
  632. isFn(complete) && complete(res);
  633. }
  634. var extraApi = /*#__PURE__*/Object.freeze({
  635. __proto__: null,
  636. getProvider: getProvider });
  637. var getEmitter = function () {
  638. var Emitter;
  639. return function getUniEmitter() {
  640. if (!Emitter) {
  641. Emitter = new _vue.default();
  642. }
  643. return Emitter;
  644. };
  645. }();
  646. function apply(ctx, method, args) {
  647. return ctx[method].apply(ctx, args);
  648. }
  649. function $on() {
  650. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  651. }
  652. function $off() {
  653. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  654. }
  655. function $once() {
  656. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  657. }
  658. function $emit() {
  659. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  660. }
  661. var eventApi = /*#__PURE__*/Object.freeze({
  662. __proto__: null,
  663. $on: $on,
  664. $off: $off,
  665. $once: $once,
  666. $emit: $emit });
  667. var api = /*#__PURE__*/Object.freeze({
  668. __proto__: null });
  669. var MPPage = Page;
  670. var MPComponent = Component;
  671. var customizeRE = /:/g;
  672. var customize = cached(function (str) {
  673. return camelize(str.replace(customizeRE, '-'));
  674. });
  675. function initTriggerEvent(mpInstance) {
  676. var oldTriggerEvent = mpInstance.triggerEvent;
  677. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  678. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  679. };
  680. try {
  681. // 京东小程序 triggerEvent 为只读
  682. mpInstance.triggerEvent = newTriggerEvent;
  683. } catch (error) {
  684. mpInstance._triggerEvent = newTriggerEvent;
  685. }
  686. }
  687. function initHook(name, options, isComponent) {
  688. var oldHook = options[name];
  689. if (!oldHook) {
  690. options[name] = function () {
  691. initTriggerEvent(this);
  692. };
  693. } else {
  694. options[name] = function () {
  695. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  696. return oldHook.apply(this, args);
  697. };
  698. }
  699. }
  700. if (!MPPage.__$wrappered) {
  701. MPPage.__$wrappered = true;
  702. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  703. initHook('onLoad', options);
  704. return MPPage(options);
  705. };
  706. Page.after = MPPage.after;
  707. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  708. initHook('created', options);
  709. return MPComponent(options);
  710. };
  711. }
  712. var PAGE_EVENT_HOOKS = [
  713. 'onPullDownRefresh',
  714. 'onReachBottom',
  715. 'onAddToFavorites',
  716. 'onShareTimeline',
  717. 'onShareAppMessage',
  718. 'onPageScroll',
  719. 'onResize',
  720. 'onTabItemTap'];
  721. function initMocks(vm, mocks) {
  722. var mpInstance = vm.$mp[vm.mpType];
  723. mocks.forEach(function (mock) {
  724. if (hasOwn(mpInstance, mock)) {
  725. vm[mock] = mpInstance[mock];
  726. }
  727. });
  728. }
  729. function hasHook(hook, vueOptions) {
  730. if (!vueOptions) {
  731. return true;
  732. }
  733. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  734. return true;
  735. }
  736. vueOptions = vueOptions.default || vueOptions;
  737. if (isFn(vueOptions)) {
  738. if (isFn(vueOptions.extendOptions[hook])) {
  739. return true;
  740. }
  741. if (vueOptions.super &&
  742. vueOptions.super.options &&
  743. Array.isArray(vueOptions.super.options[hook])) {
  744. return true;
  745. }
  746. return false;
  747. }
  748. if (isFn(vueOptions[hook])) {
  749. return true;
  750. }
  751. var mixins = vueOptions.mixins;
  752. if (Array.isArray(mixins)) {
  753. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  754. }
  755. }
  756. function initHooks(mpOptions, hooks, vueOptions) {
  757. hooks.forEach(function (hook) {
  758. if (hasHook(hook, vueOptions)) {
  759. mpOptions[hook] = function (args) {
  760. return this.$vm && this.$vm.__call_hook(hook, args);
  761. };
  762. }
  763. });
  764. }
  765. function initVueComponent(Vue, vueOptions) {
  766. vueOptions = vueOptions.default || vueOptions;
  767. var VueComponent;
  768. if (isFn(vueOptions)) {
  769. VueComponent = vueOptions;
  770. } else {
  771. VueComponent = Vue.extend(vueOptions);
  772. }
  773. vueOptions = VueComponent.options;
  774. return [VueComponent, vueOptions];
  775. }
  776. function initSlots(vm, vueSlots) {
  777. if (Array.isArray(vueSlots) && vueSlots.length) {
  778. var $slots = Object.create(null);
  779. vueSlots.forEach(function (slotName) {
  780. $slots[slotName] = true;
  781. });
  782. vm.$scopedSlots = vm.$slots = $slots;
  783. }
  784. }
  785. function initVueIds(vueIds, mpInstance) {
  786. vueIds = (vueIds || '').split(',');
  787. var len = vueIds.length;
  788. if (len === 1) {
  789. mpInstance._$vueId = vueIds[0];
  790. } else if (len === 2) {
  791. mpInstance._$vueId = vueIds[0];
  792. mpInstance._$vuePid = vueIds[1];
  793. }
  794. }
  795. function initData(vueOptions, context) {
  796. var data = vueOptions.data || {};
  797. var methods = vueOptions.methods || {};
  798. if (typeof data === 'function') {
  799. try {
  800. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  801. } catch (e) {
  802. if (Object({"VUE_APP_NAME":"六牛云","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  803. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  804. }
  805. }
  806. } else {
  807. try {
  808. // 对 data 格式化
  809. data = JSON.parse(JSON.stringify(data));
  810. } catch (e) {}
  811. }
  812. if (!isPlainObject(data)) {
  813. data = {};
  814. }
  815. Object.keys(methods).forEach(function (methodName) {
  816. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  817. data[methodName] = methods[methodName];
  818. }
  819. });
  820. return data;
  821. }
  822. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  823. function createObserver(name) {
  824. return function observer(newVal, oldVal) {
  825. if (this.$vm) {
  826. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  827. }
  828. };
  829. }
  830. function initBehaviors(vueOptions, initBehavior) {
  831. var vueBehaviors = vueOptions.behaviors;
  832. var vueExtends = vueOptions.extends;
  833. var vueMixins = vueOptions.mixins;
  834. var vueProps = vueOptions.props;
  835. if (!vueProps) {
  836. vueOptions.props = vueProps = [];
  837. }
  838. var behaviors = [];
  839. if (Array.isArray(vueBehaviors)) {
  840. vueBehaviors.forEach(function (behavior) {
  841. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  842. if (behavior === 'uni://form-field') {
  843. if (Array.isArray(vueProps)) {
  844. vueProps.push('name');
  845. vueProps.push('value');
  846. } else {
  847. vueProps.name = {
  848. type: String,
  849. default: '' };
  850. vueProps.value = {
  851. type: [String, Number, Boolean, Array, Object, Date],
  852. default: '' };
  853. }
  854. }
  855. });
  856. }
  857. if (isPlainObject(vueExtends) && vueExtends.props) {
  858. behaviors.push(
  859. initBehavior({
  860. properties: initProperties(vueExtends.props, true) }));
  861. }
  862. if (Array.isArray(vueMixins)) {
  863. vueMixins.forEach(function (vueMixin) {
  864. if (isPlainObject(vueMixin) && vueMixin.props) {
  865. behaviors.push(
  866. initBehavior({
  867. properties: initProperties(vueMixin.props, true) }));
  868. }
  869. });
  870. }
  871. return behaviors;
  872. }
  873. function parsePropType(key, type, defaultValue, file) {
  874. // [String]=>String
  875. if (Array.isArray(type) && type.length === 1) {
  876. return type[0];
  877. }
  878. return type;
  879. }
  880. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  881. var properties = {};
  882. if (!isBehavior) {
  883. properties.vueId = {
  884. type: String,
  885. value: '' };
  886. // 用于字节跳动小程序模拟抽象节点
  887. properties.generic = {
  888. type: Object,
  889. value: null };
  890. // scopedSlotsCompiler auto
  891. properties.scopedSlotsCompiler = {
  892. type: String,
  893. value: '' };
  894. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  895. type: null,
  896. value: [],
  897. observer: function observer(newVal, oldVal) {
  898. var $slots = Object.create(null);
  899. newVal.forEach(function (slotName) {
  900. $slots[slotName] = true;
  901. });
  902. this.setData({
  903. $slots: $slots });
  904. } };
  905. }
  906. if (Array.isArray(props)) {// ['title']
  907. props.forEach(function (key) {
  908. properties[key] = {
  909. type: null,
  910. observer: createObserver(key) };
  911. });
  912. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  913. Object.keys(props).forEach(function (key) {
  914. var opts = props[key];
  915. if (isPlainObject(opts)) {// title:{type:String,default:''}
  916. var value = opts.default;
  917. if (isFn(value)) {
  918. value = value();
  919. }
  920. opts.type = parsePropType(key, opts.type);
  921. properties[key] = {
  922. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  923. value: value,
  924. observer: createObserver(key) };
  925. } else {// content:String
  926. var type = parsePropType(key, opts);
  927. properties[key] = {
  928. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  929. observer: createObserver(key) };
  930. }
  931. });
  932. }
  933. return properties;
  934. }
  935. function wrapper$1(event) {
  936. // TODO 又得兼容 mpvue 的 mp 对象
  937. try {
  938. event.mp = JSON.parse(JSON.stringify(event));
  939. } catch (e) {}
  940. event.stopPropagation = noop;
  941. event.preventDefault = noop;
  942. event.target = event.target || {};
  943. if (!hasOwn(event, 'detail')) {
  944. event.detail = {};
  945. }
  946. if (hasOwn(event, 'markerId')) {
  947. event.detail = typeof event.detail === 'object' ? event.detail : {};
  948. event.detail.markerId = event.markerId;
  949. }
  950. if (isPlainObject(event.detail)) {
  951. event.target = Object.assign({}, event.target, event.detail);
  952. }
  953. return event;
  954. }
  955. function getExtraValue(vm, dataPathsArray) {
  956. var context = vm;
  957. dataPathsArray.forEach(function (dataPathArray) {
  958. var dataPath = dataPathArray[0];
  959. var value = dataPathArray[2];
  960. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  961. var propPath = dataPathArray[1];
  962. var valuePath = dataPathArray[3];
  963. var vFor;
  964. if (Number.isInteger(dataPath)) {
  965. vFor = dataPath;
  966. } else if (!dataPath) {
  967. vFor = context;
  968. } else if (typeof dataPath === 'string' && dataPath) {
  969. if (dataPath.indexOf('#s#') === 0) {
  970. vFor = dataPath.substr(3);
  971. } else {
  972. vFor = vm.__get_value(dataPath, context);
  973. }
  974. }
  975. if (Number.isInteger(vFor)) {
  976. context = value;
  977. } else if (!propPath) {
  978. context = vFor[value];
  979. } else {
  980. if (Array.isArray(vFor)) {
  981. context = vFor.find(function (vForItem) {
  982. return vm.__get_value(propPath, vForItem) === value;
  983. });
  984. } else if (isPlainObject(vFor)) {
  985. context = Object.keys(vFor).find(function (vForKey) {
  986. return vm.__get_value(propPath, vFor[vForKey]) === value;
  987. });
  988. } else {
  989. console.error('v-for 暂不支持循环数据:', vFor);
  990. }
  991. }
  992. if (valuePath) {
  993. context = vm.__get_value(valuePath, context);
  994. }
  995. }
  996. });
  997. return context;
  998. }
  999. function processEventExtra(vm, extra, event) {
  1000. var extraObj = {};
  1001. if (Array.isArray(extra) && extra.length) {
  1002. /**
  1003. *[
  1004. * ['data.items', 'data.id', item.data.id],
  1005. * ['metas', 'id', meta.id]
  1006. *],
  1007. *[
  1008. * ['data.items', 'data.id', item.data.id],
  1009. * ['metas', 'id', meta.id]
  1010. *],
  1011. *'test'
  1012. */
  1013. extra.forEach(function (dataPath, index) {
  1014. if (typeof dataPath === 'string') {
  1015. if (!dataPath) {// model,prop.sync
  1016. extraObj['$' + index] = vm;
  1017. } else {
  1018. if (dataPath === '$event') {// $event
  1019. extraObj['$' + index] = event;
  1020. } else if (dataPath === 'arguments') {
  1021. if (event.detail && event.detail.__args__) {
  1022. extraObj['$' + index] = event.detail.__args__;
  1023. } else {
  1024. extraObj['$' + index] = [event];
  1025. }
  1026. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1027. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1028. } else {
  1029. extraObj['$' + index] = vm.__get_value(dataPath);
  1030. }
  1031. }
  1032. } else {
  1033. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1034. }
  1035. });
  1036. }
  1037. return extraObj;
  1038. }
  1039. function getObjByArray(arr) {
  1040. var obj = {};
  1041. for (var i = 1; i < arr.length; i++) {
  1042. var element = arr[i];
  1043. obj[element[0]] = element[1];
  1044. }
  1045. return obj;
  1046. }
  1047. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1048. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1049. if (isCustom) {// 自定义事件
  1050. isCustomMPEvent = event.currentTarget &&
  1051. event.currentTarget.dataset &&
  1052. event.currentTarget.dataset.comType === 'wx';
  1053. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1054. if (isCustomMPEvent) {
  1055. return [event];
  1056. }
  1057. return event.detail.__args__ || event.detail;
  1058. }
  1059. }
  1060. var extraObj = processEventExtra(vm, extra, event);
  1061. var ret = [];
  1062. args.forEach(function (arg) {
  1063. if (arg === '$event') {
  1064. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1065. ret.push(event.target.value);
  1066. } else {
  1067. if (isCustom && !isCustomMPEvent) {
  1068. ret.push(event.detail.__args__[0]);
  1069. } else {// wxcomponent 组件或内置组件
  1070. ret.push(event);
  1071. }
  1072. }
  1073. } else {
  1074. if (Array.isArray(arg) && arg[0] === 'o') {
  1075. ret.push(getObjByArray(arg));
  1076. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1077. ret.push(extraObj[arg]);
  1078. } else {
  1079. ret.push(arg);
  1080. }
  1081. }
  1082. });
  1083. return ret;
  1084. }
  1085. var ONCE = '~';
  1086. var CUSTOM = '^';
  1087. function isMatchEventType(eventType, optType) {
  1088. return eventType === optType ||
  1089. optType === 'regionchange' && (
  1090. eventType === 'begin' ||
  1091. eventType === 'end');
  1092. }
  1093. function getContextVm(vm) {
  1094. var $parent = vm.$parent;
  1095. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1096. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1097. $parent = $parent.$parent;
  1098. }
  1099. return $parent && $parent.$parent;
  1100. }
  1101. function handleEvent(event) {var _this = this;
  1102. event = wrapper$1(event);
  1103. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1104. var dataset = (event.currentTarget || event.target).dataset;
  1105. if (!dataset) {
  1106. return console.warn('事件信息不存在');
  1107. }
  1108. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1109. if (!eventOpts) {
  1110. return console.warn('事件信息不存在');
  1111. }
  1112. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1113. var eventType = event.type;
  1114. var ret = [];
  1115. eventOpts.forEach(function (eventOpt) {
  1116. var type = eventOpt[0];
  1117. var eventsArray = eventOpt[1];
  1118. var isCustom = type.charAt(0) === CUSTOM;
  1119. type = isCustom ? type.slice(1) : type;
  1120. var isOnce = type.charAt(0) === ONCE;
  1121. type = isOnce ? type.slice(1) : type;
  1122. if (eventsArray && isMatchEventType(eventType, type)) {
  1123. eventsArray.forEach(function (eventArray) {
  1124. var methodName = eventArray[0];
  1125. if (methodName) {
  1126. var handlerCtx = _this.$vm;
  1127. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1128. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1129. }
  1130. if (methodName === '$emit') {
  1131. handlerCtx.$emit.apply(handlerCtx,
  1132. processEventArgs(
  1133. _this.$vm,
  1134. event,
  1135. eventArray[1],
  1136. eventArray[2],
  1137. isCustom,
  1138. methodName));
  1139. return;
  1140. }
  1141. var handler = handlerCtx[methodName];
  1142. if (!isFn(handler)) {
  1143. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1144. }
  1145. if (isOnce) {
  1146. if (handler.once) {
  1147. return;
  1148. }
  1149. handler.once = true;
  1150. }
  1151. var params = processEventArgs(
  1152. _this.$vm,
  1153. event,
  1154. eventArray[1],
  1155. eventArray[2],
  1156. isCustom,
  1157. methodName);
  1158. params = Array.isArray(params) ? params : [];
  1159. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1160. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1161. // eslint-disable-next-line no-sparse-arrays
  1162. params = params.concat([,,,,,,,,,, event]);
  1163. }
  1164. ret.push(handler.apply(handlerCtx, params));
  1165. }
  1166. });
  1167. }
  1168. });
  1169. if (
  1170. eventType === 'input' &&
  1171. ret.length === 1 &&
  1172. typeof ret[0] !== 'undefined')
  1173. {
  1174. return ret[0];
  1175. }
  1176. }
  1177. var messages = {};
  1178. var locale;
  1179. {
  1180. locale = wx.getSystemInfoSync().language;
  1181. }
  1182. function initI18nMessages() {
  1183. if (!isEnableLocale()) {
  1184. return;
  1185. }
  1186. var localeKeys = Object.keys(__uniConfig.locales);
  1187. if (localeKeys.length) {
  1188. localeKeys.forEach(function (locale) {
  1189. var curMessages = messages[locale];
  1190. var userMessages = __uniConfig.locales[locale];
  1191. if (curMessages) {
  1192. Object.assign(curMessages, userMessages);
  1193. } else {
  1194. messages[locale] = userMessages;
  1195. }
  1196. });
  1197. }
  1198. }
  1199. initI18nMessages();
  1200. var i18n = (0, _uniI18n.initVueI18n)(
  1201. locale,
  1202. {});
  1203. var t = i18n.t;
  1204. var i18nMixin = i18n.mixin = {
  1205. beforeCreate: function beforeCreate() {var _this2 = this;
  1206. var unwatch = i18n.i18n.watchLocale(function () {
  1207. _this2.$forceUpdate();
  1208. });
  1209. this.$once('hook:beforeDestroy', function () {
  1210. unwatch();
  1211. });
  1212. },
  1213. methods: {
  1214. $$t: function $$t(key, values) {
  1215. return t(key, values);
  1216. } } };
  1217. var setLocale$1 = i18n.setLocale;
  1218. var getLocale$1 = i18n.getLocale;
  1219. function initAppLocale(Vue, appVm, locale) {
  1220. var state = Vue.observable({
  1221. locale: locale || i18n.getLocale() });
  1222. var localeWatchers = [];
  1223. appVm.$watchLocale = function (fn) {
  1224. localeWatchers.push(fn);
  1225. };
  1226. Object.defineProperty(appVm, '$locale', {
  1227. get: function get() {
  1228. return state.locale;
  1229. },
  1230. set: function set(v) {
  1231. state.locale = v;
  1232. localeWatchers.forEach(function (watch) {return watch(v);});
  1233. } });
  1234. }
  1235. function isEnableLocale() {
  1236. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1237. }
  1238. // export function initI18n() {
  1239. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1240. // if (localeKeys.length) {
  1241. // localeKeys.forEach((locale) =>
  1242. // i18n.add(locale, __uniConfig.locales[locale])
  1243. // )
  1244. // }
  1245. // }
  1246. var eventChannels = {};
  1247. var eventChannelStack = [];
  1248. function getEventChannel(id) {
  1249. if (id) {
  1250. var eventChannel = eventChannels[id];
  1251. delete eventChannels[id];
  1252. return eventChannel;
  1253. }
  1254. return eventChannelStack.shift();
  1255. }
  1256. var hooks = [
  1257. 'onShow',
  1258. 'onHide',
  1259. 'onError',
  1260. 'onPageNotFound',
  1261. 'onThemeChange',
  1262. 'onUnhandledRejection'];
  1263. function initEventChannel() {
  1264. _vue.default.prototype.getOpenerEventChannel = function () {
  1265. // 微信小程序使用自身getOpenerEventChannel
  1266. {
  1267. return this.$scope.getOpenerEventChannel();
  1268. }
  1269. };
  1270. var callHook = _vue.default.prototype.__call_hook;
  1271. _vue.default.prototype.__call_hook = function (hook, args) {
  1272. if (hook === 'onLoad' && args && args.__id__) {
  1273. this.__eventChannel__ = getEventChannel(args.__id__);
  1274. delete args.__id__;
  1275. }
  1276. return callHook.call(this, hook, args);
  1277. };
  1278. }
  1279. function initScopedSlotsParams() {
  1280. var center = {};
  1281. var parents = {};
  1282. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1283. var has = center[vueId];
  1284. if (!has) {
  1285. parents[vueId] = this;
  1286. this.$on('hook:destroyed', function () {
  1287. delete parents[vueId];
  1288. });
  1289. }
  1290. return has;
  1291. };
  1292. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1293. var data = center[vueId];
  1294. if (data) {
  1295. var object = data[name] || {};
  1296. return key ? object[key] : object;
  1297. } else {
  1298. parents[vueId] = this;
  1299. this.$on('hook:destroyed', function () {
  1300. delete parents[vueId];
  1301. });
  1302. }
  1303. };
  1304. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1305. var vueIds = this.$options.propsData.vueId;
  1306. if (vueIds) {
  1307. var vueId = vueIds.split(',')[0];
  1308. var object = center[vueId] = center[vueId] || {};
  1309. object[name] = value;
  1310. if (parents[vueId]) {
  1311. parents[vueId].$forceUpdate();
  1312. }
  1313. }
  1314. };
  1315. _vue.default.mixin({
  1316. destroyed: function destroyed() {
  1317. var propsData = this.$options.propsData;
  1318. var vueId = propsData && propsData.vueId;
  1319. if (vueId) {
  1320. delete center[vueId];
  1321. delete parents[vueId];
  1322. }
  1323. } });
  1324. }
  1325. function parseBaseApp(vm, _ref3)
  1326. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1327. initEventChannel();
  1328. {
  1329. initScopedSlotsParams();
  1330. }
  1331. if (vm.$options.store) {
  1332. _vue.default.prototype.$store = vm.$options.store;
  1333. }
  1334. uniIdMixin(_vue.default);
  1335. _vue.default.prototype.mpHost = "mp-weixin";
  1336. _vue.default.mixin({
  1337. beforeCreate: function beforeCreate() {
  1338. if (!this.$options.mpType) {
  1339. return;
  1340. }
  1341. this.mpType = this.$options.mpType;
  1342. this.$mp = _defineProperty({
  1343. data: {} },
  1344. this.mpType, this.$options.mpInstance);
  1345. this.$scope = this.$options.mpInstance;
  1346. delete this.$options.mpType;
  1347. delete this.$options.mpInstance;
  1348. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1349. var app = getApp();
  1350. if (app.$vm && app.$vm.$i18n) {
  1351. this._i18n = app.$vm.$i18n;
  1352. }
  1353. }
  1354. if (this.mpType !== 'app') {
  1355. initRefs(this);
  1356. initMocks(this, mocks);
  1357. }
  1358. } });
  1359. var appOptions = {
  1360. onLaunch: function onLaunch(args) {
  1361. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1362. return;
  1363. }
  1364. {
  1365. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1366. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1367. }
  1368. }
  1369. this.$vm = vm;
  1370. this.$vm.$mp = {
  1371. app: this };
  1372. this.$vm.$scope = this;
  1373. // vm 上也挂载 globalData
  1374. this.$vm.globalData = this.globalData;
  1375. this.$vm._isMounted = true;
  1376. this.$vm.__call_hook('mounted', args);
  1377. this.$vm.__call_hook('onLaunch', args);
  1378. } };
  1379. // 兼容旧版本 globalData
  1380. appOptions.globalData = vm.$options.globalData || {};
  1381. // 将 methods 中的方法挂在 getApp() 中
  1382. var methods = vm.$options.methods;
  1383. if (methods) {
  1384. Object.keys(methods).forEach(function (name) {
  1385. appOptions[name] = methods[name];
  1386. });
  1387. }
  1388. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1389. initHooks(appOptions, hooks);
  1390. return appOptions;
  1391. }
  1392. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1393. function findVmByVueId(vm, vuePid) {
  1394. var $children = vm.$children;
  1395. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1396. for (var i = $children.length - 1; i >= 0; i--) {
  1397. var childVm = $children[i];
  1398. if (childVm.$scope._$vueId === vuePid) {
  1399. return childVm;
  1400. }
  1401. }
  1402. // 反向递归查找
  1403. var parentVm;
  1404. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1405. parentVm = findVmByVueId($children[_i], vuePid);
  1406. if (parentVm) {
  1407. return parentVm;
  1408. }
  1409. }
  1410. }
  1411. function initBehavior(options) {
  1412. return Behavior(options);
  1413. }
  1414. function isPage() {
  1415. return !!this.route;
  1416. }
  1417. function initRelation(detail) {
  1418. this.triggerEvent('__l', detail);
  1419. }
  1420. function selectAllComponents(mpInstance, selector, $refs) {
  1421. var components = mpInstance.selectAllComponents(selector);
  1422. components.forEach(function (component) {
  1423. var ref = component.dataset.ref;
  1424. $refs[ref] = component.$vm || component;
  1425. {
  1426. if (component.dataset.vueGeneric === 'scoped') {
  1427. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1428. selectAllComponents(scopedComponent, selector, $refs);
  1429. });
  1430. }
  1431. }
  1432. });
  1433. }
  1434. function initRefs(vm) {
  1435. var mpInstance = vm.$scope;
  1436. Object.defineProperty(vm, '$refs', {
  1437. get: function get() {
  1438. var $refs = {};
  1439. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1440. // TODO 暂不考虑 for 中的 scoped
  1441. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1442. forComponents.forEach(function (component) {
  1443. var ref = component.dataset.ref;
  1444. if (!$refs[ref]) {
  1445. $refs[ref] = [];
  1446. }
  1447. $refs[ref].push(component.$vm || component);
  1448. });
  1449. return $refs;
  1450. } });
  1451. }
  1452. function handleLink(event) {var _ref4 =
  1453. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1454. var parentVm;
  1455. if (vuePid) {
  1456. parentVm = findVmByVueId(this.$vm, vuePid);
  1457. }
  1458. if (!parentVm) {
  1459. parentVm = this.$vm;
  1460. }
  1461. vueOptions.parent = parentVm;
  1462. }
  1463. function parseApp(vm) {
  1464. return parseBaseApp(vm, {
  1465. mocks: mocks,
  1466. initRefs: initRefs });
  1467. }
  1468. function createApp(vm) {
  1469. App(parseApp(vm));
  1470. return vm;
  1471. }
  1472. var encodeReserveRE = /[!'()*]/g;
  1473. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1474. var commaRE = /%2C/g;
  1475. // fixed encodeURIComponent which is more conformant to RFC3986:
  1476. // - escapes [!'()*]
  1477. // - preserve commas
  1478. var encode = function encode(str) {return encodeURIComponent(str).
  1479. replace(encodeReserveRE, encodeReserveReplacer).
  1480. replace(commaRE, ',');};
  1481. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1482. var res = obj ? Object.keys(obj).map(function (key) {
  1483. var val = obj[key];
  1484. if (val === undefined) {
  1485. return '';
  1486. }
  1487. if (val === null) {
  1488. return encodeStr(key);
  1489. }
  1490. if (Array.isArray(val)) {
  1491. var result = [];
  1492. val.forEach(function (val2) {
  1493. if (val2 === undefined) {
  1494. return;
  1495. }
  1496. if (val2 === null) {
  1497. result.push(encodeStr(key));
  1498. } else {
  1499. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1500. }
  1501. });
  1502. return result.join('&');
  1503. }
  1504. return encodeStr(key) + '=' + encodeStr(val);
  1505. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1506. return res ? "?".concat(res) : '';
  1507. }
  1508. function parseBaseComponent(vueComponentOptions)
  1509. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1510. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1511. var options = _objectSpread({
  1512. multipleSlots: true,
  1513. addGlobalClass: true },
  1514. vueOptions.options || {});
  1515. {
  1516. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1517. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1518. Object.assign(options, vueOptions['mp-weixin'].options);
  1519. }
  1520. }
  1521. var componentOptions = {
  1522. options: options,
  1523. data: initData(vueOptions, _vue.default.prototype),
  1524. behaviors: initBehaviors(vueOptions, initBehavior),
  1525. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1526. lifetimes: {
  1527. attached: function attached() {
  1528. var properties = this.properties;
  1529. var options = {
  1530. mpType: isPage.call(this) ? 'page' : 'component',
  1531. mpInstance: this,
  1532. propsData: properties };
  1533. initVueIds(properties.vueId, this);
  1534. // 处理父子关系
  1535. initRelation.call(this, {
  1536. vuePid: this._$vuePid,
  1537. vueOptions: options });
  1538. // 初始化 vue 实例
  1539. this.$vm = new VueComponent(options);
  1540. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1541. initSlots(this.$vm, properties.vueSlots);
  1542. // 触发首次 setData
  1543. this.$vm.$mount();
  1544. },
  1545. ready: function ready() {
  1546. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1547. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1548. if (this.$vm) {
  1549. this.$vm._isMounted = true;
  1550. this.$vm.__call_hook('mounted');
  1551. this.$vm.__call_hook('onReady');
  1552. }
  1553. },
  1554. detached: function detached() {
  1555. this.$vm && this.$vm.$destroy();
  1556. } },
  1557. pageLifetimes: {
  1558. show: function show(args) {
  1559. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1560. },
  1561. hide: function hide() {
  1562. this.$vm && this.$vm.__call_hook('onPageHide');
  1563. },
  1564. resize: function resize(size) {
  1565. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1566. } },
  1567. methods: {
  1568. __l: handleLink,
  1569. __e: handleEvent } };
  1570. // externalClasses
  1571. if (vueOptions.externalClasses) {
  1572. componentOptions.externalClasses = vueOptions.externalClasses;
  1573. }
  1574. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1575. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1576. componentOptions.methods[callMethod] = function (args) {
  1577. return this.$vm[callMethod](args);
  1578. };
  1579. });
  1580. }
  1581. if (isPage) {
  1582. return componentOptions;
  1583. }
  1584. return [componentOptions, VueComponent];
  1585. }
  1586. function parseComponent(vueComponentOptions) {
  1587. return parseBaseComponent(vueComponentOptions, {
  1588. isPage: isPage,
  1589. initRelation: initRelation });
  1590. }
  1591. var hooks$1 = [
  1592. 'onShow',
  1593. 'onHide',
  1594. 'onUnload'];
  1595. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1596. function parseBasePage(vuePageOptions, _ref6)
  1597. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1598. var pageOptions = parseComponent(vuePageOptions);
  1599. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1600. pageOptions.methods.onLoad = function (query) {
  1601. this.options = query;
  1602. var copyQuery = Object.assign({}, query);
  1603. delete copyQuery.__id__;
  1604. this.$page = {
  1605. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1606. this.$vm.$mp.query = query; // 兼容 mpvue
  1607. this.$vm.__call_hook('onLoad', query);
  1608. };
  1609. return pageOptions;
  1610. }
  1611. function parsePage(vuePageOptions) {
  1612. return parseBasePage(vuePageOptions, {
  1613. isPage: isPage,
  1614. initRelation: initRelation });
  1615. }
  1616. function createPage(vuePageOptions) {
  1617. {
  1618. return Component(parsePage(vuePageOptions));
  1619. }
  1620. }
  1621. function createComponent(vueOptions) {
  1622. {
  1623. return Component(parseComponent(vueOptions));
  1624. }
  1625. }
  1626. function createSubpackageApp(vm) {
  1627. var appOptions = parseApp(vm);
  1628. var app = getApp({
  1629. allowDefault: true });
  1630. vm.$scope = app;
  1631. var globalData = app.globalData;
  1632. if (globalData) {
  1633. Object.keys(appOptions.globalData).forEach(function (name) {
  1634. if (!hasOwn(globalData, name)) {
  1635. globalData[name] = appOptions.globalData[name];
  1636. }
  1637. });
  1638. }
  1639. Object.keys(appOptions).forEach(function (name) {
  1640. if (!hasOwn(app, name)) {
  1641. app[name] = appOptions[name];
  1642. }
  1643. });
  1644. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1645. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1646. vm.__call_hook('onShow', args);
  1647. });
  1648. }
  1649. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1650. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1651. vm.__call_hook('onHide', args);
  1652. });
  1653. }
  1654. if (isFn(appOptions.onLaunch)) {
  1655. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1656. vm.__call_hook('onLaunch', args);
  1657. }
  1658. return vm;
  1659. }
  1660. function createPlugin(vm) {
  1661. var appOptions = parseApp(vm);
  1662. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1663. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1664. vm.__call_hook('onShow', args);
  1665. });
  1666. }
  1667. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1668. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1669. vm.__call_hook('onHide', args);
  1670. });
  1671. }
  1672. if (isFn(appOptions.onLaunch)) {
  1673. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1674. vm.__call_hook('onLaunch', args);
  1675. }
  1676. return vm;
  1677. }
  1678. todos.forEach(function (todoApi) {
  1679. protocols[todoApi] = false;
  1680. });
  1681. canIUses.forEach(function (canIUseApi) {
  1682. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1683. canIUseApi;
  1684. if (!wx.canIUse(apiName)) {
  1685. protocols[canIUseApi] = false;
  1686. }
  1687. });
  1688. var uni = {};
  1689. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1690. uni = new Proxy({}, {
  1691. get: function get(target, name) {
  1692. if (hasOwn(target, name)) {
  1693. return target[name];
  1694. }
  1695. if (baseApi[name]) {
  1696. return baseApi[name];
  1697. }
  1698. if (api[name]) {
  1699. return promisify(name, api[name]);
  1700. }
  1701. {
  1702. if (extraApi[name]) {
  1703. return promisify(name, extraApi[name]);
  1704. }
  1705. if (todoApis[name]) {
  1706. return promisify(name, todoApis[name]);
  1707. }
  1708. }
  1709. if (eventApi[name]) {
  1710. return eventApi[name];
  1711. }
  1712. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1713. return;
  1714. }
  1715. return promisify(name, wrapper(name, wx[name]));
  1716. },
  1717. set: function set(target, name, value) {
  1718. target[name] = value;
  1719. return true;
  1720. } });
  1721. } else {
  1722. Object.keys(baseApi).forEach(function (name) {
  1723. uni[name] = baseApi[name];
  1724. });
  1725. {
  1726. Object.keys(todoApis).forEach(function (name) {
  1727. uni[name] = promisify(name, todoApis[name]);
  1728. });
  1729. Object.keys(extraApi).forEach(function (name) {
  1730. uni[name] = promisify(name, todoApis[name]);
  1731. });
  1732. }
  1733. Object.keys(eventApi).forEach(function (name) {
  1734. uni[name] = eventApi[name];
  1735. });
  1736. Object.keys(api).forEach(function (name) {
  1737. uni[name] = promisify(name, api[name]);
  1738. });
  1739. Object.keys(wx).forEach(function (name) {
  1740. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1741. uni[name] = promisify(name, wrapper(name, wx[name]));
  1742. }
  1743. });
  1744. }
  1745. wx.createApp = createApp;
  1746. wx.createPage = createPage;
  1747. wx.createComponent = createComponent;
  1748. wx.createSubpackageApp = createSubpackageApp;
  1749. wx.createPlugin = createPlugin;
  1750. var uni$1 = uni;var _default =
  1751. uni$1;exports.default = _default;
  1752. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1753. /***/ }),
  1754. /***/ 105:
  1755. /*!***************************************!*\
  1756. !*** D:/六牛项目/lnyk/api/calculation.js ***!
  1757. \***************************************/
  1758. /*! no static exports found */
  1759. /***/ (function(module, exports, __webpack_require__) {
  1760. "use strict";
  1761. Object.defineProperty(exports, "__esModule", { value: true });exports.mining = mining;exports.buyMining = buyMining;exports.miningIndex = miningIndex;exports.mymining = mymining;exports.calculator = calculator;exports.miningDateils = miningDateils;exports.myMiningGet = myMiningGet;exports.getMyShare = getMyShare;
  1762. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 14));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  1763. function mining(data) {
  1764. return (0, _request.default)({
  1765. url: '/api/mining',
  1766. method: 'get',
  1767. data: data });
  1768. }
  1769. function buyMining(data, id) {
  1770. return (0, _request.default)({
  1771. url: '/api/mining/' + id,
  1772. method: 'post',
  1773. data: data });
  1774. }
  1775. function miningIndex(data) {
  1776. return (0, _request.default)({
  1777. url: '/api/mining_index',
  1778. method: 'get',
  1779. data: data });
  1780. }
  1781. function mymining(data) {
  1782. return (0, _request.default)({
  1783. url: '/api/my_mining',
  1784. method: 'get',
  1785. data: data });
  1786. }
  1787. function calculator(data) {
  1788. return (0, _request.default)({
  1789. url: '/api/mining_calculator',
  1790. method: 'get',
  1791. data: data });
  1792. }
  1793. function miningDateils(data, id) {
  1794. return (0, _request.default)({
  1795. url: '/api/mining/' + id,
  1796. method: 'get',
  1797. data: data });
  1798. }
  1799. function myMiningGet(data, id) {
  1800. return (0, _request.default)({
  1801. url: '/api/my_mining_get',
  1802. method: 'get',
  1803. data: data });
  1804. }
  1805. //获取分享收益
  1806. function getMyShare(data) {
  1807. return (0, _request.default)({
  1808. url: '/api/my_mining_get',
  1809. method: 'get',
  1810. data: data });
  1811. }
  1812. /***/ }),
  1813. /***/ 12:
  1814. /*!***********************************!*\
  1815. !*** D:/六牛项目/lnyk/interceptor.js ***!
  1816. \***********************************/
  1817. /*! no static exports found */
  1818. /***/ (function(module, exports, __webpack_require__) {
  1819. "use strict";
  1820. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 应用打开后拦截
  1821. var loadRouter = function loadRouter() {
  1822. // 获取上个页面
  1823. var pages = getCurrentPages();
  1824. var prePage = pages[pages.length - 2];
  1825. interceptor(page, prePage);
  1826. };
  1827. // 路由拦截
  1828. /**
  1829. * @param {Object} now 当前页面
  1830. * @param {Object} before 上一个页面
  1831. */
  1832. var interceptor = function interceptor(now, before) {
  1833. // 获取用户信息判断是否登录过
  1834. var userInfo = uni.getStorageSync('userInfo') || '';
  1835. // 判断是否需要拦截
  1836. var state = uni.getStorageSync('loginInterceptor');
  1837. // 判断是否需要拦截
  1838. if (state) {
  1839. // 拦截条件
  1840. if (!userInfo.id) {
  1841. uni.navigateTo({
  1842. url: '/pages/public/login' });
  1843. }
  1844. }
  1845. };var _default =
  1846. loadRouter;exports.default = _default;
  1847. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1848. /***/ }),
  1849. /***/ 129:
  1850. /*!**************************************!*\
  1851. !*** D:/六牛项目/lnyk/utils/rocessor.js ***!
  1852. \**************************************/
  1853. /*! no static exports found */
  1854. /***/ (function(module, exports, __webpack_require__) {
  1855. "use strict";
  1856. Object.defineProperty(exports, "__esModule", { value: true });exports.isCardNo = isCardNo;exports.getMoneyStyle = getMoneyStyle;exports.timeComputed = timeComputed;exports.getTime = getTime; //身份证验证
  1857. function isCardNo(card) {
  1858. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  1859. var reg =
  1860. /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
  1861. if (reg.test(card) === false) {
  1862. console.log(card);
  1863. return false;
  1864. }
  1865. return true;
  1866. }
  1867. // 金额显示变化
  1868. function getMoneyStyle() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  1869. if (typeof value == 'string') {
  1870. value = (+value).toFixed(2);
  1871. }
  1872. if (typeof value == 'number') {
  1873. value = value.toFixed(2);
  1874. }
  1875. // 将字符串转为数组
  1876. var n = value.split("");
  1877. // 反转数组并复制循环处理
  1878. var arr = n.reverse().map(function (e, ind, ar) {
  1879. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  1880. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  1881. return e + ',';
  1882. } else {
  1883. return e;
  1884. }
  1885. });
  1886. // 反转数组回复原来排序并合并回字符串
  1887. arr = arr.reverse().join('');
  1888. return arr;
  1889. }
  1890. // 倒计时计算
  1891. // 计算倒计时时间
  1892. function timeComputed(time) {
  1893. // 获取当前时间
  1894. var actTime = new Date().getTime();
  1895. // 获取到期时间
  1896. var stopTime = time - actTime;
  1897. // 判断是否小于0
  1898. if (stopTime < 0) {
  1899. stopTime = stopTime * -1;
  1900. }
  1901. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余小时数
  1902. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  1903. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  1904. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  1905. return {
  1906. day: day,
  1907. hours: hours, //倒计时小时数
  1908. minutes: minutes, //倒计时分钟数
  1909. seconds: seconds //倒计时秒数
  1910. };
  1911. }
  1912. //时间戳转换成时间
  1913. function getTime(time) {
  1914. var date = new Date(parseInt(time) * 1000);
  1915. var year = date.getFullYear();
  1916. var mon = date.getMonth() + 1;
  1917. var day = date.getDate();
  1918. var hours = date.getHours();
  1919. var minu = date.getMinutes();
  1920. var sec = date.getSeconds();
  1921. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  1922. }
  1923. /***/ }),
  1924. /***/ 13:
  1925. /*!********************************!*\
  1926. !*** D:/六牛项目/lnyk/api/user.js ***!
  1927. \********************************/
  1928. /*! no static exports found */
  1929. /***/ (function(module, exports, __webpack_require__) {
  1930. "use strict";
  1931. Object.defineProperty(exports, "__esModule", { value: true });exports.getUserInfo = getUserInfo;exports.getUser = getUser;exports.spread_people = spread_people;exports.spread = spread;exports.version = version;exports.uploads = uploads;exports.edit = edit;var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 14));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  1932. // 获取用户信息
  1933. function getUserInfo(data) {
  1934. return (0, _request.default)({
  1935. url: '/api/userinfo',
  1936. method: 'get',
  1937. data: data });
  1938. }
  1939. // 获取用户信息
  1940. function getUser(data) {
  1941. return (0, _request.default)({
  1942. url: '/api/user',
  1943. method: 'get',
  1944. data: data });
  1945. }
  1946. //推荐人
  1947. function spread_people(data) {
  1948. return (0, _request.default)({
  1949. url: '/api/spread/people',
  1950. method: 'post',
  1951. data: data });
  1952. }
  1953. //推荐人
  1954. function spread(data) {
  1955. return (0, _request.default)({
  1956. url: '/api/spread/banner',
  1957. method: 'GET',
  1958. data: data });
  1959. }
  1960. //获取版本
  1961. function version(data) {
  1962. return (0, _request.default)({
  1963. url: '/api/version',
  1964. method: 'GET',
  1965. data: data });
  1966. }
  1967. function uploads(data) {
  1968. return (0, _request.upFilse)({
  1969. url: '/api/upload/image',
  1970. method: 'post',
  1971. data: data });
  1972. }
  1973. function edit(data) {
  1974. return (0, _request.default)({
  1975. url: '/api/user/edit',
  1976. method: 'post',
  1977. data: data });
  1978. }
  1979. /***/ }),
  1980. /***/ 138:
  1981. /*!***********************************!*\
  1982. !*** D:/六牛项目/lnyk/api/finance.js ***!
  1983. \***********************************/
  1984. /*! no static exports found */
  1985. /***/ (function(module, exports, __webpack_require__) {
  1986. "use strict";
  1987. Object.defineProperty(exports, "__esModule", { value: true });exports.recharge = recharge;exports.upload = upload;exports.money = money;exports.wallet = wallet;exports.moneyLog = moneyLog;exports.cash = cash;exports.spread = spread;exports.goPay = goPay;exports.trade = trade;exports.cashmoney_type = cashmoney_type;exports.calculator = calculator;exports.edit = edit;exports.miner = miner;
  1988. var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 14));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  1989. function recharge(data) {
  1990. return (0, _request.default)({
  1991. url: '/api/recharge/money',
  1992. method: 'post',
  1993. data: data });
  1994. }
  1995. //上传图片
  1996. function upload(data) {
  1997. return (0, _request.upFilse)({
  1998. url: '/api/upload/image',
  1999. method: 'post',
  2000. data: data });
  2001. }
  2002. function money(data, id) {
  2003. return (0, _request.default)({
  2004. url: '/api/recharge/money/' + id,
  2005. method: 'post',
  2006. data: data });
  2007. }
  2008. function wallet(data) {
  2009. return (0, _request.default)({
  2010. url: '/api/wallet',
  2011. method: 'get',
  2012. data: data });
  2013. }
  2014. function moneyLog(data, code) {
  2015. return (0, _request.default)({
  2016. url: '/api/money/log/' + code,
  2017. method: 'get',
  2018. data: data });
  2019. }
  2020. function cash(data) {
  2021. return (0, _request.default)({
  2022. url: '/api/extract/cash',
  2023. method: 'POST',
  2024. data: data });
  2025. }
  2026. function spread(data) {
  2027. return (0, _request.default)({
  2028. url: '/api/spread/people',
  2029. method: 'POST',
  2030. data: data });
  2031. }
  2032. function goPay(data) {
  2033. return (0, _request.default)({
  2034. url: '/api/trade/go_pay',
  2035. method: 'POST',
  2036. data: data });
  2037. }
  2038. function trade(data) {
  2039. return (0, _request.default)({
  2040. url: '/api/trade/money_type',
  2041. method: 'get',
  2042. data: data });
  2043. }
  2044. function cashmoney_type(data) {
  2045. return (0, _request.default)({
  2046. url: '/api/cash/money_type',
  2047. method: 'get',
  2048. data: data });
  2049. }
  2050. function calculator(data) {
  2051. return (0, _request.default)({
  2052. url: '/api/extract/calculator',
  2053. method: 'post',
  2054. data: data });
  2055. }
  2056. function edit(data, id) {
  2057. return (0, _request.default)({
  2058. url: '/api/wallet/address/edit/' + id,
  2059. method: 'post',
  2060. data: data });
  2061. }
  2062. function miner(data) {
  2063. return (0, _request.default)({
  2064. url: '/api/spread/people/all',
  2065. method: 'post',
  2066. data: data });
  2067. }
  2068. /***/ }),
  2069. /***/ 14:
  2070. /*!*************************************!*\
  2071. !*** D:/六牛项目/lnyk/utils/request.js ***!
  2072. \*************************************/
  2073. /*! no static exports found */
  2074. /***/ (function(module, exports, __webpack_require__) {
  2075. "use strict";
  2076. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.upFilse = void 0;var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 15));
  2077. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 6));
  2078. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 19);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2079. // 请求完成后拦截
  2080. _newRequest.default.interceptors.response(
  2081. function (response) {
  2082. try {
  2083. var res = response.data;
  2084. // 解析字符串为数字
  2085. if (res.status !== 200) {
  2086. console.log(res.status);
  2087. if (res.status == 410000) {
  2088. // 调用退出登录方法清空用户信息
  2089. _store.default.commit('user/logout');
  2090. (0, _loginUtils.saveUrl)();
  2091. uni.navigateTo({
  2092. url: "/pages/public/login" });
  2093. } else {
  2094. uni.showToast({
  2095. title: res.msg,
  2096. duration: 1500,
  2097. mask: false,
  2098. icon: 'none' });
  2099. }
  2100. return Promise.reject(res);
  2101. } else {
  2102. return res;
  2103. }
  2104. } catch (e) {
  2105. console.log(e);
  2106. }
  2107. },
  2108. function (error) {
  2109. uni.showToast({
  2110. title: "当前用户量过多,请稍后重试",
  2111. duration: 1500,
  2112. mask: false,
  2113. icon: 'none' });
  2114. return Promise.reject(error);
  2115. });
  2116. // 请求前拦截器
  2117. _newRequest.default.interceptors.request(
  2118. function (config) {
  2119. var token = uni.getStorageSync('token') || '';
  2120. // console.log(config);
  2121. if (!config.header) {
  2122. config.header = {
  2123. "Authori-zation": 'Bearer ' + token };
  2124. } else {
  2125. // 添加key请求头
  2126. config.header["Authori-zation"] = 'Bearer ' + token;
  2127. }
  2128. return config;
  2129. },
  2130. function (error) {
  2131. // 错误处理
  2132. console.log(error);
  2133. return Promise.reject(error);
  2134. });
  2135. var upFilse = _newRequest.default.upFilse;exports.upFilse = upFilse;var _default =
  2136. _newRequest.default.open;exports.default = _default;
  2137. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2138. /***/ }),
  2139. /***/ 15:
  2140. /*!****************************************!*\
  2141. !*** D:/六牛项目/lnyk/utils/newRequest.js ***!
  2142. \****************************************/
  2143. /*! no static exports found */
  2144. /***/ (function(module, exports, __webpack_require__) {
  2145. "use strict";
  2146. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 16));var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 6));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  2147. var service = {
  2148. baseURL: _store.default.state.baseURL, // 请求头
  2149. header: {
  2150. 'Content-Type': "application/x-www-form-urlencoded" },
  2151. // 请求拦截器
  2152. interceptors: {
  2153. // 安装请求前拦截
  2154. request: function request(success, iserror) {
  2155. service.request.success = success;
  2156. service.request.error = iserror;
  2157. },
  2158. // 安装请求完成后拦截
  2159. response: function response(success, iserror) {
  2160. service.response.success = success;
  2161. service.response.error = iserror;
  2162. } },
  2163. // 请求前拦截
  2164. request: {
  2165. // 回调成功执行方法
  2166. success: function success(e) {
  2167. return e;
  2168. },
  2169. // 回调失败
  2170. error: function error(e) {
  2171. return e;
  2172. } },
  2173. // 请求完成后拦截
  2174. response: {
  2175. // 回调成功执行方法
  2176. success: function success(e) {
  2177. return e;
  2178. },
  2179. // 回调失败
  2180. error: function error(e) {
  2181. return e;
  2182. } },
  2183. // 开始请求
  2184. open: function () {var _open = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  2185. new Promise(function (resolve, reject) {
  2186. var requestData = ''; //保存处理完成后请求数据
  2187. //console.log(data);
  2188. // 请求前数据处理
  2189. requestData = service.request.success(data);
  2190. // 数据复制用于请求
  2191. uni.request({
  2192. url: service.baseURL + requestData.url,
  2193. method: requestData.method || 'GET',
  2194. data: requestData.data,
  2195. header: data.header || service.header,
  2196. success: function success(res) {
  2197. if (res.statusCode == 200) {
  2198. try {
  2199. resolve(service.response.success(res));
  2200. } catch (e) {
  2201. service.response.error(e);
  2202. }
  2203. }
  2204. },
  2205. // 请求失败数据处理
  2206. fail: function fail(err) {
  2207. service.response.error(err);
  2208. } });
  2209. }));case 2:return _context.abrupt("return", _context.sent);case 3:case "end":return _context.stop();}}}, _callee);}));function open(_x) {return _open.apply(this, arguments);}return open;}(),
  2210. // 上传文件
  2211. upFilse: function () {var _upFilse = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:_context4.next = 2;return (
  2212. new Promise(function (resolve, reject) {
  2213. var requestData = ''; //保存处理完成后请求数据
  2214. try {
  2215. // 请求前数据处理
  2216. requestData = service.request.success(data);
  2217. } catch (e) {
  2218. // 请求报错拦截
  2219. service.request.error(e);
  2220. }
  2221. var config = {
  2222. // 上传图片的API
  2223. upload_img_url: service.baseURL + requestData.url };
  2224. var Uploader = {
  2225. // 选择图片
  2226. choose: function choose(num) {
  2227. return new Promise(function (resolve, reject) {
  2228. uni.chooseImage({
  2229. count: num,
  2230. sourceType: ['album'],
  2231. sizeType: ['compressed'],
  2232. success: function success(res) {
  2233. // console.log(res);
  2234. // 缓存文件路径
  2235. resolve(res.tempFilePaths);
  2236. },
  2237. fail: function fail(err) {
  2238. console.log(err);
  2239. reject(err);
  2240. } });
  2241. });
  2242. },
  2243. // 上传图片
  2244. upload_one: function upload_one(path) {
  2245. return new Promise(function (resolve, reject) {
  2246. uni.showLoading({
  2247. title: '上传中' });
  2248. uni.uploadFile({
  2249. url: config.upload_img_url, //仅为示例,非真实的接口地址
  2250. filePath: path,
  2251. name: 'file',
  2252. header: {
  2253. "Authori-zation": 'Bearer ' + uni.getStorageSync('token') },
  2254. success: function success(uploadFileRes) {
  2255. if ("string" === typeof uploadFileRes.data) {
  2256. resolve(JSON.parse(uploadFileRes.data).data);
  2257. } else {
  2258. resolve(uploadFileRes.data.data);
  2259. }
  2260. },
  2261. complete: function complete() {
  2262. uni.hideLoading();
  2263. } });
  2264. });
  2265. },
  2266. // 上传多个图片
  2267. upload: function upload(path_arr) {var _this = this;
  2268. var num = path_arr.length;
  2269. return new Promise( /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {var img_urls, i, img_url;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
  2270. img_urls = [];
  2271. i = 0;case 2:if (!(i < num)) {_context2.next = 10;break;}_context2.next = 5;return (
  2272. _this.upload_one(path_arr[i]));case 5:img_url = _context2.sent;
  2273. img_urls.push(img_url);case 7:i++;_context2.next = 2;break;case 10:
  2274. ;
  2275. resolve(img_urls);case 12:case "end":return _context2.stop();}}}, _callee2);}));return function (_x3, _x4) {return _ref.apply(this, arguments);};}());
  2276. },
  2277. // 触发上传图片事件
  2278. choose_and_upload: function choose_and_upload(num) {var _this2 = this;
  2279. return new Promise( /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {var path_arr;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return (
  2280. _this2.choose(num));case 2:path_arr = _context3.sent;_context3.next = 5;return (
  2281. _this2.upload(path_arr).then(function (e) {
  2282. resolve(e);
  2283. }).catch(function (e) {
  2284. reject(e);
  2285. }));case 5:case "end":return _context3.stop();}}}, _callee3);}));return function (_x5, _x6) {return _ref2.apply(this, arguments);};}());
  2286. } };
  2287. Uploader.choose_and_upload(1).then(function (e) {
  2288. resolve(e);
  2289. }).catch(function (e) {
  2290. console.log(e);
  2291. });
  2292. }));case 2:return _context4.abrupt("return", _context4.sent);case 3:case "end":return _context4.stop();}}}, _callee4);}));function upFilse(_x2) {return _upFilse.apply(this, arguments);}return upFilse;}() };var _default =
  2293. service;exports.default = _default;
  2294. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2295. /***/ }),
  2296. /***/ 16:
  2297. /*!**********************************************************!*\
  2298. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2299. \**********************************************************/
  2300. /*! no static exports found */
  2301. /***/ (function(module, exports, __webpack_require__) {
  2302. module.exports = __webpack_require__(/*! regenerator-runtime */ 17);
  2303. /***/ }),
  2304. /***/ 17:
  2305. /*!************************************************************!*\
  2306. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2307. \************************************************************/
  2308. /*! no static exports found */
  2309. /***/ (function(module, exports, __webpack_require__) {
  2310. /**
  2311. * Copyright (c) 2014-present, Facebook, Inc.
  2312. *
  2313. * This source code is licensed under the MIT license found in the
  2314. * LICENSE file in the root directory of this source tree.
  2315. */
  2316. // This method of obtaining a reference to the global object needs to be
  2317. // kept identical to the way it is obtained in runtime.js
  2318. var g = (function() {
  2319. return this || (typeof self === "object" && self);
  2320. })() || Function("return this")();
  2321. // Use `getOwnPropertyNames` because not all browsers support calling
  2322. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  2323. var hadRuntime = g.regeneratorRuntime &&
  2324. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  2325. // Save the old regeneratorRuntime in case it needs to be restored later.
  2326. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  2327. // Force reevalutation of runtime.js.
  2328. g.regeneratorRuntime = undefined;
  2329. module.exports = __webpack_require__(/*! ./runtime */ 18);
  2330. if (hadRuntime) {
  2331. // Restore the original runtime.
  2332. g.regeneratorRuntime = oldRuntime;
  2333. } else {
  2334. // Remove the global property added by runtime.js.
  2335. try {
  2336. delete g.regeneratorRuntime;
  2337. } catch(e) {
  2338. g.regeneratorRuntime = undefined;
  2339. }
  2340. }
  2341. /***/ }),
  2342. /***/ 18:
  2343. /*!*****************************************************!*\
  2344. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  2345. \*****************************************************/
  2346. /*! no static exports found */
  2347. /***/ (function(module, exports) {
  2348. /**
  2349. * Copyright (c) 2014-present, Facebook, Inc.
  2350. *
  2351. * This source code is licensed under the MIT license found in the
  2352. * LICENSE file in the root directory of this source tree.
  2353. */
  2354. !(function(global) {
  2355. "use strict";
  2356. var Op = Object.prototype;
  2357. var hasOwn = Op.hasOwnProperty;
  2358. var undefined; // More compressible than void 0.
  2359. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2360. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2361. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2362. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2363. var inModule = typeof module === "object";
  2364. var runtime = global.regeneratorRuntime;
  2365. if (runtime) {
  2366. if (inModule) {
  2367. // If regeneratorRuntime is defined globally and we're in a module,
  2368. // make the exports object identical to regeneratorRuntime.
  2369. module.exports = runtime;
  2370. }
  2371. // Don't bother evaluating the rest of this file if the runtime was
  2372. // already defined globally.
  2373. return;
  2374. }
  2375. // Define the runtime globally (as expected by generated code) as either
  2376. // module.exports (if we're in a module) or a new, empty object.
  2377. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  2378. function wrap(innerFn, outerFn, self, tryLocsList) {
  2379. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2380. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2381. var generator = Object.create(protoGenerator.prototype);
  2382. var context = new Context(tryLocsList || []);
  2383. // The ._invoke method unifies the implementations of the .next,
  2384. // .throw, and .return methods.
  2385. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2386. return generator;
  2387. }
  2388. runtime.wrap = wrap;
  2389. // Try/catch helper to minimize deoptimizations. Returns a completion
  2390. // record like context.tryEntries[i].completion. This interface could
  2391. // have been (and was previously) designed to take a closure to be
  2392. // invoked without arguments, but in all the cases we care about we
  2393. // already have an existing method we want to call, so there's no need
  2394. // to create a new function object. We can even get away with assuming
  2395. // the method takes exactly one argument, since that happens to be true
  2396. // in every case, so we don't have to touch the arguments object. The
  2397. // only additional allocation required is the completion record, which
  2398. // has a stable shape and so hopefully should be cheap to allocate.
  2399. function tryCatch(fn, obj, arg) {
  2400. try {
  2401. return { type: "normal", arg: fn.call(obj, arg) };
  2402. } catch (err) {
  2403. return { type: "throw", arg: err };
  2404. }
  2405. }
  2406. var GenStateSuspendedStart = "suspendedStart";
  2407. var GenStateSuspendedYield = "suspendedYield";
  2408. var GenStateExecuting = "executing";
  2409. var GenStateCompleted = "completed";
  2410. // Returning this object from the innerFn has the same effect as
  2411. // breaking out of the dispatch switch statement.
  2412. var ContinueSentinel = {};
  2413. // Dummy constructor functions that we use as the .constructor and
  2414. // .constructor.prototype properties for functions that return Generator
  2415. // objects. For full spec compliance, you may wish to configure your
  2416. // minifier not to mangle the names of these two functions.
  2417. function Generator() {}
  2418. function GeneratorFunction() {}
  2419. function GeneratorFunctionPrototype() {}
  2420. // This is a polyfill for %IteratorPrototype% for environments that
  2421. // don't natively support it.
  2422. var IteratorPrototype = {};
  2423. IteratorPrototype[iteratorSymbol] = function () {
  2424. return this;
  2425. };
  2426. var getProto = Object.getPrototypeOf;
  2427. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2428. if (NativeIteratorPrototype &&
  2429. NativeIteratorPrototype !== Op &&
  2430. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2431. // This environment has a native %IteratorPrototype%; use it instead
  2432. // of the polyfill.
  2433. IteratorPrototype = NativeIteratorPrototype;
  2434. }
  2435. var Gp = GeneratorFunctionPrototype.prototype =
  2436. Generator.prototype = Object.create(IteratorPrototype);
  2437. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2438. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2439. GeneratorFunctionPrototype[toStringTagSymbol] =
  2440. GeneratorFunction.displayName = "GeneratorFunction";
  2441. // Helper for defining the .next, .throw, and .return methods of the
  2442. // Iterator interface in terms of a single ._invoke method.
  2443. function defineIteratorMethods(prototype) {
  2444. ["next", "throw", "return"].forEach(function(method) {
  2445. prototype[method] = function(arg) {
  2446. return this._invoke(method, arg);
  2447. };
  2448. });
  2449. }
  2450. runtime.isGeneratorFunction = function(genFun) {
  2451. var ctor = typeof genFun === "function" && genFun.constructor;
  2452. return ctor
  2453. ? ctor === GeneratorFunction ||
  2454. // For the native GeneratorFunction constructor, the best we can
  2455. // do is to check its .name property.
  2456. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2457. : false;
  2458. };
  2459. runtime.mark = function(genFun) {
  2460. if (Object.setPrototypeOf) {
  2461. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2462. } else {
  2463. genFun.__proto__ = GeneratorFunctionPrototype;
  2464. if (!(toStringTagSymbol in genFun)) {
  2465. genFun[toStringTagSymbol] = "GeneratorFunction";
  2466. }
  2467. }
  2468. genFun.prototype = Object.create(Gp);
  2469. return genFun;
  2470. };
  2471. // Within the body of any async function, `await x` is transformed to
  2472. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2473. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2474. // meant to be awaited.
  2475. runtime.awrap = function(arg) {
  2476. return { __await: arg };
  2477. };
  2478. function AsyncIterator(generator) {
  2479. function invoke(method, arg, resolve, reject) {
  2480. var record = tryCatch(generator[method], generator, arg);
  2481. if (record.type === "throw") {
  2482. reject(record.arg);
  2483. } else {
  2484. var result = record.arg;
  2485. var value = result.value;
  2486. if (value &&
  2487. typeof value === "object" &&
  2488. hasOwn.call(value, "__await")) {
  2489. return Promise.resolve(value.__await).then(function(value) {
  2490. invoke("next", value, resolve, reject);
  2491. }, function(err) {
  2492. invoke("throw", err, resolve, reject);
  2493. });
  2494. }
  2495. return Promise.resolve(value).then(function(unwrapped) {
  2496. // When a yielded Promise is resolved, its final value becomes
  2497. // the .value of the Promise<{value,done}> result for the
  2498. // current iteration.
  2499. result.value = unwrapped;
  2500. resolve(result);
  2501. }, function(error) {
  2502. // If a rejected Promise was yielded, throw the rejection back
  2503. // into the async generator function so it can be handled there.
  2504. return invoke("throw", error, resolve, reject);
  2505. });
  2506. }
  2507. }
  2508. var previousPromise;
  2509. function enqueue(method, arg) {
  2510. function callInvokeWithMethodAndArg() {
  2511. return new Promise(function(resolve, reject) {
  2512. invoke(method, arg, resolve, reject);
  2513. });
  2514. }
  2515. return previousPromise =
  2516. // If enqueue has been called before, then we want to wait until
  2517. // all previous Promises have been resolved before calling invoke,
  2518. // so that results are always delivered in the correct order. If
  2519. // enqueue has not been called before, then it is important to
  2520. // call invoke immediately, without waiting on a callback to fire,
  2521. // so that the async generator function has the opportunity to do
  2522. // any necessary setup in a predictable way. This predictability
  2523. // is why the Promise constructor synchronously invokes its
  2524. // executor callback, and why async functions synchronously
  2525. // execute code before the first await. Since we implement simple
  2526. // async functions in terms of async generators, it is especially
  2527. // important to get this right, even though it requires care.
  2528. previousPromise ? previousPromise.then(
  2529. callInvokeWithMethodAndArg,
  2530. // Avoid propagating failures to Promises returned by later
  2531. // invocations of the iterator.
  2532. callInvokeWithMethodAndArg
  2533. ) : callInvokeWithMethodAndArg();
  2534. }
  2535. // Define the unified helper method that is used to implement .next,
  2536. // .throw, and .return (see defineIteratorMethods).
  2537. this._invoke = enqueue;
  2538. }
  2539. defineIteratorMethods(AsyncIterator.prototype);
  2540. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2541. return this;
  2542. };
  2543. runtime.AsyncIterator = AsyncIterator;
  2544. // Note that simple async functions are implemented on top of
  2545. // AsyncIterator objects; they just return a Promise for the value of
  2546. // the final result produced by the iterator.
  2547. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  2548. var iter = new AsyncIterator(
  2549. wrap(innerFn, outerFn, self, tryLocsList)
  2550. );
  2551. return runtime.isGeneratorFunction(outerFn)
  2552. ? iter // If outerFn is a generator, return the full iterator.
  2553. : iter.next().then(function(result) {
  2554. return result.done ? result.value : iter.next();
  2555. });
  2556. };
  2557. function makeInvokeMethod(innerFn, self, context) {
  2558. var state = GenStateSuspendedStart;
  2559. return function invoke(method, arg) {
  2560. if (state === GenStateExecuting) {
  2561. throw new Error("Generator is already running");
  2562. }
  2563. if (state === GenStateCompleted) {
  2564. if (method === "throw") {
  2565. throw arg;
  2566. }
  2567. // Be forgiving, per 25.3.3.3.3 of the spec:
  2568. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  2569. return doneResult();
  2570. }
  2571. context.method = method;
  2572. context.arg = arg;
  2573. while (true) {
  2574. var delegate = context.delegate;
  2575. if (delegate) {
  2576. var delegateResult = maybeInvokeDelegate(delegate, context);
  2577. if (delegateResult) {
  2578. if (delegateResult === ContinueSentinel) continue;
  2579. return delegateResult;
  2580. }
  2581. }
  2582. if (context.method === "next") {
  2583. // Setting context._sent for legacy support of Babel's
  2584. // function.sent implementation.
  2585. context.sent = context._sent = context.arg;
  2586. } else if (context.method === "throw") {
  2587. if (state === GenStateSuspendedStart) {
  2588. state = GenStateCompleted;
  2589. throw context.arg;
  2590. }
  2591. context.dispatchException(context.arg);
  2592. } else if (context.method === "return") {
  2593. context.abrupt("return", context.arg);
  2594. }
  2595. state = GenStateExecuting;
  2596. var record = tryCatch(innerFn, self, context);
  2597. if (record.type === "normal") {
  2598. // If an exception is thrown from innerFn, we leave state ===
  2599. // GenStateExecuting and loop back for another invocation.
  2600. state = context.done
  2601. ? GenStateCompleted
  2602. : GenStateSuspendedYield;
  2603. if (record.arg === ContinueSentinel) {
  2604. continue;
  2605. }
  2606. return {
  2607. value: record.arg,
  2608. done: context.done
  2609. };
  2610. } else if (record.type === "throw") {
  2611. state = GenStateCompleted;
  2612. // Dispatch the exception by looping back around to the
  2613. // context.dispatchException(context.arg) call above.
  2614. context.method = "throw";
  2615. context.arg = record.arg;
  2616. }
  2617. }
  2618. };
  2619. }
  2620. // Call delegate.iterator[context.method](context.arg) and handle the
  2621. // result, either by returning a { value, done } result from the
  2622. // delegate iterator, or by modifying context.method and context.arg,
  2623. // setting context.delegate to null, and returning the ContinueSentinel.
  2624. function maybeInvokeDelegate(delegate, context) {
  2625. var method = delegate.iterator[context.method];
  2626. if (method === undefined) {
  2627. // A .throw or .return when the delegate iterator has no .throw
  2628. // method always terminates the yield* loop.
  2629. context.delegate = null;
  2630. if (context.method === "throw") {
  2631. if (delegate.iterator.return) {
  2632. // If the delegate iterator has a return method, give it a
  2633. // chance to clean up.
  2634. context.method = "return";
  2635. context.arg = undefined;
  2636. maybeInvokeDelegate(delegate, context);
  2637. if (context.method === "throw") {
  2638. // If maybeInvokeDelegate(context) changed context.method from
  2639. // "return" to "throw", let that override the TypeError below.
  2640. return ContinueSentinel;
  2641. }
  2642. }
  2643. context.method = "throw";
  2644. context.arg = new TypeError(
  2645. "The iterator does not provide a 'throw' method");
  2646. }
  2647. return ContinueSentinel;
  2648. }
  2649. var record = tryCatch(method, delegate.iterator, context.arg);
  2650. if (record.type === "throw") {
  2651. context.method = "throw";
  2652. context.arg = record.arg;
  2653. context.delegate = null;
  2654. return ContinueSentinel;
  2655. }
  2656. var info = record.arg;
  2657. if (! info) {
  2658. context.method = "throw";
  2659. context.arg = new TypeError("iterator result is not an object");
  2660. context.delegate = null;
  2661. return ContinueSentinel;
  2662. }
  2663. if (info.done) {
  2664. // Assign the result of the finished delegate to the temporary
  2665. // variable specified by delegate.resultName (see delegateYield).
  2666. context[delegate.resultName] = info.value;
  2667. // Resume execution at the desired location (see delegateYield).
  2668. context.next = delegate.nextLoc;
  2669. // If context.method was "throw" but the delegate handled the
  2670. // exception, let the outer generator proceed normally. If
  2671. // context.method was "next", forget context.arg since it has been
  2672. // "consumed" by the delegate iterator. If context.method was
  2673. // "return", allow the original .return call to continue in the
  2674. // outer generator.
  2675. if (context.method !== "return") {
  2676. context.method = "next";
  2677. context.arg = undefined;
  2678. }
  2679. } else {
  2680. // Re-yield the result returned by the delegate method.
  2681. return info;
  2682. }
  2683. // The delegate iterator is finished, so forget it and continue with
  2684. // the outer generator.
  2685. context.delegate = null;
  2686. return ContinueSentinel;
  2687. }
  2688. // Define Generator.prototype.{next,throw,return} in terms of the
  2689. // unified ._invoke helper method.
  2690. defineIteratorMethods(Gp);
  2691. Gp[toStringTagSymbol] = "Generator";
  2692. // A Generator should always return itself as the iterator object when the
  2693. // @@iterator function is called on it. Some browsers' implementations of the
  2694. // iterator prototype chain incorrectly implement this, causing the Generator
  2695. // object to not be returned from this call. This ensures that doesn't happen.
  2696. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2697. Gp[iteratorSymbol] = function() {
  2698. return this;
  2699. };
  2700. Gp.toString = function() {
  2701. return "[object Generator]";
  2702. };
  2703. function pushTryEntry(locs) {
  2704. var entry = { tryLoc: locs[0] };
  2705. if (1 in locs) {
  2706. entry.catchLoc = locs[1];
  2707. }
  2708. if (2 in locs) {
  2709. entry.finallyLoc = locs[2];
  2710. entry.afterLoc = locs[3];
  2711. }
  2712. this.tryEntries.push(entry);
  2713. }
  2714. function resetTryEntry(entry) {
  2715. var record = entry.completion || {};
  2716. record.type = "normal";
  2717. delete record.arg;
  2718. entry.completion = record;
  2719. }
  2720. function Context(tryLocsList) {
  2721. // The root entry object (effectively a try statement without a catch
  2722. // or a finally block) gives us a place to store values thrown from
  2723. // locations where there is no enclosing try statement.
  2724. this.tryEntries = [{ tryLoc: "root" }];
  2725. tryLocsList.forEach(pushTryEntry, this);
  2726. this.reset(true);
  2727. }
  2728. runtime.keys = function(object) {
  2729. var keys = [];
  2730. for (var key in object) {
  2731. keys.push(key);
  2732. }
  2733. keys.reverse();
  2734. // Rather than returning an object with a next method, we keep
  2735. // things simple and return the next function itself.
  2736. return function next() {
  2737. while (keys.length) {
  2738. var key = keys.pop();
  2739. if (key in object) {
  2740. next.value = key;
  2741. next.done = false;
  2742. return next;
  2743. }
  2744. }
  2745. // To avoid creating an additional object, we just hang the .value
  2746. // and .done properties off the next function object itself. This
  2747. // also ensures that the minifier will not anonymize the function.
  2748. next.done = true;
  2749. return next;
  2750. };
  2751. };
  2752. function values(iterable) {
  2753. if (iterable) {
  2754. var iteratorMethod = iterable[iteratorSymbol];
  2755. if (iteratorMethod) {
  2756. return iteratorMethod.call(iterable);
  2757. }
  2758. if (typeof iterable.next === "function") {
  2759. return iterable;
  2760. }
  2761. if (!isNaN(iterable.length)) {
  2762. var i = -1, next = function next() {
  2763. while (++i < iterable.length) {
  2764. if (hasOwn.call(iterable, i)) {
  2765. next.value = iterable[i];
  2766. next.done = false;
  2767. return next;
  2768. }
  2769. }
  2770. next.value = undefined;
  2771. next.done = true;
  2772. return next;
  2773. };
  2774. return next.next = next;
  2775. }
  2776. }
  2777. // Return an iterator with no values.
  2778. return { next: doneResult };
  2779. }
  2780. runtime.values = values;
  2781. function doneResult() {
  2782. return { value: undefined, done: true };
  2783. }
  2784. Context.prototype = {
  2785. constructor: Context,
  2786. reset: function(skipTempReset) {
  2787. this.prev = 0;
  2788. this.next = 0;
  2789. // Resetting context._sent for legacy support of Babel's
  2790. // function.sent implementation.
  2791. this.sent = this._sent = undefined;
  2792. this.done = false;
  2793. this.delegate = null;
  2794. this.method = "next";
  2795. this.arg = undefined;
  2796. this.tryEntries.forEach(resetTryEntry);
  2797. if (!skipTempReset) {
  2798. for (var name in this) {
  2799. // Not sure about the optimal order of these conditions:
  2800. if (name.charAt(0) === "t" &&
  2801. hasOwn.call(this, name) &&
  2802. !isNaN(+name.slice(1))) {
  2803. this[name] = undefined;
  2804. }
  2805. }
  2806. }
  2807. },
  2808. stop: function() {
  2809. this.done = true;
  2810. var rootEntry = this.tryEntries[0];
  2811. var rootRecord = rootEntry.completion;
  2812. if (rootRecord.type === "throw") {
  2813. throw rootRecord.arg;
  2814. }
  2815. return this.rval;
  2816. },
  2817. dispatchException: function(exception) {
  2818. if (this.done) {
  2819. throw exception;
  2820. }
  2821. var context = this;
  2822. function handle(loc, caught) {
  2823. record.type = "throw";
  2824. record.arg = exception;
  2825. context.next = loc;
  2826. if (caught) {
  2827. // If the dispatched exception was caught by a catch block,
  2828. // then let that catch block handle the exception normally.
  2829. context.method = "next";
  2830. context.arg = undefined;
  2831. }
  2832. return !! caught;
  2833. }
  2834. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2835. var entry = this.tryEntries[i];
  2836. var record = entry.completion;
  2837. if (entry.tryLoc === "root") {
  2838. // Exception thrown outside of any try block that could handle
  2839. // it, so set the completion value of the entire function to
  2840. // throw the exception.
  2841. return handle("end");
  2842. }
  2843. if (entry.tryLoc <= this.prev) {
  2844. var hasCatch = hasOwn.call(entry, "catchLoc");
  2845. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2846. if (hasCatch && hasFinally) {
  2847. if (this.prev < entry.catchLoc) {
  2848. return handle(entry.catchLoc, true);
  2849. } else if (this.prev < entry.finallyLoc) {
  2850. return handle(entry.finallyLoc);
  2851. }
  2852. } else if (hasCatch) {
  2853. if (this.prev < entry.catchLoc) {
  2854. return handle(entry.catchLoc, true);
  2855. }
  2856. } else if (hasFinally) {
  2857. if (this.prev < entry.finallyLoc) {
  2858. return handle(entry.finallyLoc);
  2859. }
  2860. } else {
  2861. throw new Error("try statement without catch or finally");
  2862. }
  2863. }
  2864. }
  2865. },
  2866. abrupt: function(type, arg) {
  2867. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2868. var entry = this.tryEntries[i];
  2869. if (entry.tryLoc <= this.prev &&
  2870. hasOwn.call(entry, "finallyLoc") &&
  2871. this.prev < entry.finallyLoc) {
  2872. var finallyEntry = entry;
  2873. break;
  2874. }
  2875. }
  2876. if (finallyEntry &&
  2877. (type === "break" ||
  2878. type === "continue") &&
  2879. finallyEntry.tryLoc <= arg &&
  2880. arg <= finallyEntry.finallyLoc) {
  2881. // Ignore the finally entry if control is not jumping to a
  2882. // location outside the try/catch block.
  2883. finallyEntry = null;
  2884. }
  2885. var record = finallyEntry ? finallyEntry.completion : {};
  2886. record.type = type;
  2887. record.arg = arg;
  2888. if (finallyEntry) {
  2889. this.method = "next";
  2890. this.next = finallyEntry.finallyLoc;
  2891. return ContinueSentinel;
  2892. }
  2893. return this.complete(record);
  2894. },
  2895. complete: function(record, afterLoc) {
  2896. if (record.type === "throw") {
  2897. throw record.arg;
  2898. }
  2899. if (record.type === "break" ||
  2900. record.type === "continue") {
  2901. this.next = record.arg;
  2902. } else if (record.type === "return") {
  2903. this.rval = this.arg = record.arg;
  2904. this.method = "return";
  2905. this.next = "end";
  2906. } else if (record.type === "normal" && afterLoc) {
  2907. this.next = afterLoc;
  2908. }
  2909. return ContinueSentinel;
  2910. },
  2911. finish: function(finallyLoc) {
  2912. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2913. var entry = this.tryEntries[i];
  2914. if (entry.finallyLoc === finallyLoc) {
  2915. this.complete(entry.completion, entry.afterLoc);
  2916. resetTryEntry(entry);
  2917. return ContinueSentinel;
  2918. }
  2919. }
  2920. },
  2921. "catch": function(tryLoc) {
  2922. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2923. var entry = this.tryEntries[i];
  2924. if (entry.tryLoc === tryLoc) {
  2925. var record = entry.completion;
  2926. if (record.type === "throw") {
  2927. var thrown = record.arg;
  2928. resetTryEntry(entry);
  2929. }
  2930. return thrown;
  2931. }
  2932. }
  2933. // The context.catch method must only be called with a location
  2934. // argument that corresponds to a known catch block.
  2935. throw new Error("illegal catch attempt");
  2936. },
  2937. delegateYield: function(iterable, resultName, nextLoc) {
  2938. this.delegate = {
  2939. iterator: values(iterable),
  2940. resultName: resultName,
  2941. nextLoc: nextLoc
  2942. };
  2943. if (this.method === "next") {
  2944. // Deliberately forget the last sent value so that we don't
  2945. // accidentally pass it on to the delegate.
  2946. this.arg = undefined;
  2947. }
  2948. return ContinueSentinel;
  2949. }
  2950. };
  2951. })(
  2952. // In sloppy mode, unbound `this` refers to the global object, fallback to
  2953. // Function constructor if we're in global strict mode. That is sadly a form
  2954. // of indirect eval which violates Content Security Policy.
  2955. (function() {
  2956. return this || (typeof self === "object" && self);
  2957. })() || Function("return this")()
  2958. );
  2959. /***/ }),
  2960. /***/ 19:
  2961. /*!****************************************!*\
  2962. !*** D:/六牛项目/lnyk/utils/loginUtils.js ***!
  2963. \****************************************/
  2964. /*! no static exports found */
  2965. /***/ (function(module, exports, __webpack_require__) {
  2966. "use strict";
  2967. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getActionPage = getActionPage;exports.interceptor = interceptor;exports.saveUrl = saveUrl;function getActionPage() {
  2968. var pages = getCurrentPages();
  2969. return pages[pages.length - 1];
  2970. }
  2971. //登录拦截
  2972. function interceptor() {
  2973. } // let pages = getActionPage();
  2974. // // 获取当前页面
  2975. // let pageUrl = '/' + pages.route;
  2976. // let url = '/pages/public/login'
  2977. // 保存页面
  2978. function saveUrl() {// 获取当前页面
  2979. var page = getActionPage(); // 获取跳转前路由地址
  2980. var path = '/' + page.route;
  2981. // 保存当前过去页面
  2982. uni.setStorageSync('present', path);
  2983. // 返回是否存储成功
  2984. return true;
  2985. }
  2986. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2987. /***/ }),
  2988. /***/ 2:
  2989. /*!***********************************!*\
  2990. !*** (webpack)/buildin/global.js ***!
  2991. \***********************************/
  2992. /*! no static exports found */
  2993. /***/ (function(module, exports) {
  2994. var g;
  2995. // This works in non-strict mode
  2996. g = (function() {
  2997. return this;
  2998. })();
  2999. try {
  3000. // This works if eval is allowed (see CSP)
  3001. g = g || new Function("return this")();
  3002. } catch (e) {
  3003. // This works if the window reference is available
  3004. if (typeof window === "object") g = window;
  3005. }
  3006. // g can still be undefined, but nothing to do about it...
  3007. // We return undefined, instead of nothing here, so it's
  3008. // easier to handle this case. if(!global) { ...}
  3009. module.exports = g;
  3010. /***/ }),
  3011. /***/ 203:
  3012. /*!*************************************!*\
  3013. !*** D:/六牛项目/lnyk/api/quotation.js ***!
  3014. \*************************************/
  3015. /*! no static exports found */
  3016. /***/ (function(module, exports, __webpack_require__) {
  3017. "use strict";
  3018. Object.defineProperty(exports, "__esModule", { value: true });exports.query = query;exports.order = order;exports.recharge = recharge;exports.getbill = getbill;exports.ustd = ustd;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 14));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3019. function query(data) {
  3020. return (0, _request.default)({
  3021. url: '/api/mine/query',
  3022. method: 'get',
  3023. data: data });
  3024. }
  3025. function order(data) {
  3026. return (0, _request.default)({
  3027. url: '/api/mine/order',
  3028. method: 'post',
  3029. data: data });
  3030. }
  3031. function recharge(data) {
  3032. return (0, _request.default)({
  3033. url: '/api/share',
  3034. method: 'get',
  3035. data: data });
  3036. }
  3037. function getbill(data) {
  3038. return (0, _request.default)({
  3039. url: '/api/mine/getbill',
  3040. method: 'post',
  3041. data: data });
  3042. }
  3043. function ustd(data) {
  3044. return (0, _request.default)({
  3045. url: '/api/recharge/ustd',
  3046. method: 'post',
  3047. data: data });
  3048. }
  3049. /***/ }),
  3050. /***/ 212:
  3051. /*!***********************************************!*\
  3052. !*** D:/六牛项目/lnyk/js_sdk/xb-copy/uni-copy.js ***!
  3053. \***********************************************/
  3054. /*! no static exports found */
  3055. /***/ (function(module, exports, __webpack_require__) {
  3056. "use strict";
  3057. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = uniCopy;function uniCopy(content) {
  3058. /**
  3059. * 小程序端 和 app端的复制逻辑
  3060. */
  3061. uni.setClipboardData({
  3062. data: content,
  3063. success: function success() {
  3064. console.log('success');
  3065. return true;
  3066. } });
  3067. /**
  3068. * H5端的复制逻辑
  3069. */
  3070. }
  3071. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3072. /***/ }),
  3073. /***/ 22:
  3074. /*!**********************************************************************************************************!*\
  3075. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  3076. \**********************************************************************************************************/
  3077. /*! exports provided: default */
  3078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3079. "use strict";
  3080. __webpack_require__.r(__webpack_exports__);
  3081. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  3082. /* globals __VUE_SSR_CONTEXT__ */
  3083. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  3084. // This module is a runtime utility for cleaner component module output and will
  3085. // be included in the final webpack user bundle.
  3086. function normalizeComponent (
  3087. scriptExports,
  3088. render,
  3089. staticRenderFns,
  3090. functionalTemplate,
  3091. injectStyles,
  3092. scopeId,
  3093. moduleIdentifier, /* server only */
  3094. shadowMode, /* vue-cli only */
  3095. components, // fixed by xxxxxx auto components
  3096. renderjs // fixed by xxxxxx renderjs
  3097. ) {
  3098. // Vue.extend constructor export interop
  3099. var options = typeof scriptExports === 'function'
  3100. ? scriptExports.options
  3101. : scriptExports
  3102. // fixed by xxxxxx auto components
  3103. if (components) {
  3104. if (!options.components) {
  3105. options.components = {}
  3106. }
  3107. var hasOwn = Object.prototype.hasOwnProperty
  3108. for (var name in components) {
  3109. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  3110. options.components[name] = components[name]
  3111. }
  3112. }
  3113. }
  3114. // fixed by xxxxxx renderjs
  3115. if (renderjs) {
  3116. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  3117. this[renderjs.__module] = this
  3118. });
  3119. (options.mixins || (options.mixins = [])).push(renderjs)
  3120. }
  3121. // render functions
  3122. if (render) {
  3123. options.render = render
  3124. options.staticRenderFns = staticRenderFns
  3125. options._compiled = true
  3126. }
  3127. // functional template
  3128. if (functionalTemplate) {
  3129. options.functional = true
  3130. }
  3131. // scopedId
  3132. if (scopeId) {
  3133. options._scopeId = 'data-v-' + scopeId
  3134. }
  3135. var hook
  3136. if (moduleIdentifier) { // server build
  3137. hook = function (context) {
  3138. // 2.3 injection
  3139. context =
  3140. context || // cached call
  3141. (this.$vnode && this.$vnode.ssrContext) || // stateful
  3142. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  3143. // 2.2 with runInNewContext: true
  3144. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  3145. context = __VUE_SSR_CONTEXT__
  3146. }
  3147. // inject component styles
  3148. if (injectStyles) {
  3149. injectStyles.call(this, context)
  3150. }
  3151. // register component module identifier for async chunk inferrence
  3152. if (context && context._registeredComponents) {
  3153. context._registeredComponents.add(moduleIdentifier)
  3154. }
  3155. }
  3156. // used by ssr in case component is cached and beforeCreate
  3157. // never gets called
  3158. options._ssrRegister = hook
  3159. } else if (injectStyles) {
  3160. hook = shadowMode
  3161. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  3162. : injectStyles
  3163. }
  3164. if (hook) {
  3165. if (options.functional) {
  3166. // for template-only hot-reload because in that case the render fn doesn't
  3167. // go through the normalizer
  3168. options._injectStyles = hook
  3169. // register for functioal component in vue file
  3170. var originalRender = options.render
  3171. options.render = function renderWithStyleInjection (h, context) {
  3172. hook.call(context)
  3173. return originalRender(h, context)
  3174. }
  3175. } else {
  3176. // inject component registration as beforeCreate hook
  3177. var existing = options.beforeCreate
  3178. options.beforeCreate = existing
  3179. ? [].concat(existing, hook)
  3180. : [hook]
  3181. }
  3182. }
  3183. return {
  3184. exports: scriptExports,
  3185. options: options
  3186. }
  3187. }
  3188. /***/ }),
  3189. /***/ 29:
  3190. /*!*********************************!*\
  3191. !*** D:/六牛项目/lnyk/api/login.js ***!
  3192. \*********************************/
  3193. /*! no static exports found */
  3194. /***/ (function(module, exports, __webpack_require__) {
  3195. "use strict";
  3196. Object.defineProperty(exports, "__esModule", { value: true });exports.login = login;exports.register = register;exports.verify = verify;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 14));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3197. // 登录
  3198. function login(data) {
  3199. return (0, _request.default)({
  3200. url: '/api/login',
  3201. method: 'post',
  3202. data: data });
  3203. }
  3204. // 注册
  3205. function register(data) {
  3206. return (0, _request.default)({
  3207. url: '/api/register',
  3208. method: 'post',
  3209. data: data });
  3210. }
  3211. // 验证码
  3212. function verify(data) {
  3213. // type=register为注册
  3214. // type=login为登录
  3215. return (0, _request.default)({
  3216. url: '/api/register/verify',
  3217. method: 'post',
  3218. data: data });
  3219. }
  3220. /***/ }),
  3221. /***/ 3:
  3222. /*!******************************************************************************************!*\
  3223. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3224. \******************************************************************************************/
  3225. /*! exports provided: default */
  3226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3227. "use strict";
  3228. __webpack_require__.r(__webpack_exports__);
  3229. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3230. * Vue.js v2.6.11
  3231. * (c) 2014-2021 Evan You
  3232. * Released under the MIT License.
  3233. */
  3234. /* */
  3235. var emptyObject = Object.freeze({});
  3236. // These helpers produce better VM code in JS engines due to their
  3237. // explicitness and function inlining.
  3238. function isUndef (v) {
  3239. return v === undefined || v === null
  3240. }
  3241. function isDef (v) {
  3242. return v !== undefined && v !== null
  3243. }
  3244. function isTrue (v) {
  3245. return v === true
  3246. }
  3247. function isFalse (v) {
  3248. return v === false
  3249. }
  3250. /**
  3251. * Check if value is primitive.
  3252. */
  3253. function isPrimitive (value) {
  3254. return (
  3255. typeof value === 'string' ||
  3256. typeof value === 'number' ||
  3257. // $flow-disable-line
  3258. typeof value === 'symbol' ||
  3259. typeof value === 'boolean'
  3260. )
  3261. }
  3262. /**
  3263. * Quick object check - this is primarily used to tell
  3264. * Objects from primitive values when we know the value
  3265. * is a JSON-compliant type.
  3266. */
  3267. function isObject (obj) {
  3268. return obj !== null && typeof obj === 'object'
  3269. }
  3270. /**
  3271. * Get the raw type string of a value, e.g., [object Object].
  3272. */
  3273. var _toString = Object.prototype.toString;
  3274. function toRawType (value) {
  3275. return _toString.call(value).slice(8, -1)
  3276. }
  3277. /**
  3278. * Strict object type check. Only returns true
  3279. * for plain JavaScript objects.
  3280. */
  3281. function isPlainObject (obj) {
  3282. return _toString.call(obj) === '[object Object]'
  3283. }
  3284. function isRegExp (v) {
  3285. return _toString.call(v) === '[object RegExp]'
  3286. }
  3287. /**
  3288. * Check if val is a valid array index.
  3289. */
  3290. function isValidArrayIndex (val) {
  3291. var n = parseFloat(String(val));
  3292. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3293. }
  3294. function isPromise (val) {
  3295. return (
  3296. isDef(val) &&
  3297. typeof val.then === 'function' &&
  3298. typeof val.catch === 'function'
  3299. )
  3300. }
  3301. /**
  3302. * Convert a value to a string that is actually rendered.
  3303. */
  3304. function toString (val) {
  3305. return val == null
  3306. ? ''
  3307. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3308. ? JSON.stringify(val, null, 2)
  3309. : String(val)
  3310. }
  3311. /**
  3312. * Convert an input value to a number for persistence.
  3313. * If the conversion fails, return original string.
  3314. */
  3315. function toNumber (val) {
  3316. var n = parseFloat(val);
  3317. return isNaN(n) ? val : n
  3318. }
  3319. /**
  3320. * Make a map and return a function for checking if a key
  3321. * is in that map.
  3322. */
  3323. function makeMap (
  3324. str,
  3325. expectsLowerCase
  3326. ) {
  3327. var map = Object.create(null);
  3328. var list = str.split(',');
  3329. for (var i = 0; i < list.length; i++) {
  3330. map[list[i]] = true;
  3331. }
  3332. return expectsLowerCase
  3333. ? function (val) { return map[val.toLowerCase()]; }
  3334. : function (val) { return map[val]; }
  3335. }
  3336. /**
  3337. * Check if a tag is a built-in tag.
  3338. */
  3339. var isBuiltInTag = makeMap('slot,component', true);
  3340. /**
  3341. * Check if an attribute is a reserved attribute.
  3342. */
  3343. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3344. /**
  3345. * Remove an item from an array.
  3346. */
  3347. function remove (arr, item) {
  3348. if (arr.length) {
  3349. var index = arr.indexOf(item);
  3350. if (index > -1) {
  3351. return arr.splice(index, 1)
  3352. }
  3353. }
  3354. }
  3355. /**
  3356. * Check whether an object has the property.
  3357. */
  3358. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3359. function hasOwn (obj, key) {
  3360. return hasOwnProperty.call(obj, key)
  3361. }
  3362. /**
  3363. * Create a cached version of a pure function.
  3364. */
  3365. function cached (fn) {
  3366. var cache = Object.create(null);
  3367. return (function cachedFn (str) {
  3368. var hit = cache[str];
  3369. return hit || (cache[str] = fn(str))
  3370. })
  3371. }
  3372. /**
  3373. * Camelize a hyphen-delimited string.
  3374. */
  3375. var camelizeRE = /-(\w)/g;
  3376. var camelize = cached(function (str) {
  3377. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3378. });
  3379. /**
  3380. * Capitalize a string.
  3381. */
  3382. var capitalize = cached(function (str) {
  3383. return str.charAt(0).toUpperCase() + str.slice(1)
  3384. });
  3385. /**
  3386. * Hyphenate a camelCase string.
  3387. */
  3388. var hyphenateRE = /\B([A-Z])/g;
  3389. var hyphenate = cached(function (str) {
  3390. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3391. });
  3392. /**
  3393. * Simple bind polyfill for environments that do not support it,
  3394. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3395. * since native bind is now performant enough in most browsers.
  3396. * But removing it would mean breaking code that was able to run in
  3397. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3398. */
  3399. /* istanbul ignore next */
  3400. function polyfillBind (fn, ctx) {
  3401. function boundFn (a) {
  3402. var l = arguments.length;
  3403. return l
  3404. ? l > 1
  3405. ? fn.apply(ctx, arguments)
  3406. : fn.call(ctx, a)
  3407. : fn.call(ctx)
  3408. }
  3409. boundFn._length = fn.length;
  3410. return boundFn
  3411. }
  3412. function nativeBind (fn, ctx) {
  3413. return fn.bind(ctx)
  3414. }
  3415. var bind = Function.prototype.bind
  3416. ? nativeBind
  3417. : polyfillBind;
  3418. /**
  3419. * Convert an Array-like object to a real Array.
  3420. */
  3421. function toArray (list, start) {
  3422. start = start || 0;
  3423. var i = list.length - start;
  3424. var ret = new Array(i);
  3425. while (i--) {
  3426. ret[i] = list[i + start];
  3427. }
  3428. return ret
  3429. }
  3430. /**
  3431. * Mix properties into target object.
  3432. */
  3433. function extend (to, _from) {
  3434. for (var key in _from) {
  3435. to[key] = _from[key];
  3436. }
  3437. return to
  3438. }
  3439. /**
  3440. * Merge an Array of Objects into a single Object.
  3441. */
  3442. function toObject (arr) {
  3443. var res = {};
  3444. for (var i = 0; i < arr.length; i++) {
  3445. if (arr[i]) {
  3446. extend(res, arr[i]);
  3447. }
  3448. }
  3449. return res
  3450. }
  3451. /* eslint-disable no-unused-vars */
  3452. /**
  3453. * Perform no operation.
  3454. * Stubbing args to make Flow happy without leaving useless transpiled code
  3455. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3456. */
  3457. function noop (a, b, c) {}
  3458. /**
  3459. * Always return false.
  3460. */
  3461. var no = function (a, b, c) { return false; };
  3462. /* eslint-enable no-unused-vars */
  3463. /**
  3464. * Return the same value.
  3465. */
  3466. var identity = function (_) { return _; };
  3467. /**
  3468. * Check if two values are loosely equal - that is,
  3469. * if they are plain objects, do they have the same shape?
  3470. */
  3471. function looseEqual (a, b) {
  3472. if (a === b) { return true }
  3473. var isObjectA = isObject(a);
  3474. var isObjectB = isObject(b);
  3475. if (isObjectA && isObjectB) {
  3476. try {
  3477. var isArrayA = Array.isArray(a);
  3478. var isArrayB = Array.isArray(b);
  3479. if (isArrayA && isArrayB) {
  3480. return a.length === b.length && a.every(function (e, i) {
  3481. return looseEqual(e, b[i])
  3482. })
  3483. } else if (a instanceof Date && b instanceof Date) {
  3484. return a.getTime() === b.getTime()
  3485. } else if (!isArrayA && !isArrayB) {
  3486. var keysA = Object.keys(a);
  3487. var keysB = Object.keys(b);
  3488. return keysA.length === keysB.length && keysA.every(function (key) {
  3489. return looseEqual(a[key], b[key])
  3490. })
  3491. } else {
  3492. /* istanbul ignore next */
  3493. return false
  3494. }
  3495. } catch (e) {
  3496. /* istanbul ignore next */
  3497. return false
  3498. }
  3499. } else if (!isObjectA && !isObjectB) {
  3500. return String(a) === String(b)
  3501. } else {
  3502. return false
  3503. }
  3504. }
  3505. /**
  3506. * Return the first index at which a loosely equal value can be
  3507. * found in the array (if value is a plain object, the array must
  3508. * contain an object of the same shape), or -1 if it is not present.
  3509. */
  3510. function looseIndexOf (arr, val) {
  3511. for (var i = 0; i < arr.length; i++) {
  3512. if (looseEqual(arr[i], val)) { return i }
  3513. }
  3514. return -1
  3515. }
  3516. /**
  3517. * Ensure a function is called only once.
  3518. */
  3519. function once (fn) {
  3520. var called = false;
  3521. return function () {
  3522. if (!called) {
  3523. called = true;
  3524. fn.apply(this, arguments);
  3525. }
  3526. }
  3527. }
  3528. var ASSET_TYPES = [
  3529. 'component',
  3530. 'directive',
  3531. 'filter'
  3532. ];
  3533. var LIFECYCLE_HOOKS = [
  3534. 'beforeCreate',
  3535. 'created',
  3536. 'beforeMount',
  3537. 'mounted',
  3538. 'beforeUpdate',
  3539. 'updated',
  3540. 'beforeDestroy',
  3541. 'destroyed',
  3542. 'activated',
  3543. 'deactivated',
  3544. 'errorCaptured',
  3545. 'serverPrefetch'
  3546. ];
  3547. /* */
  3548. var config = ({
  3549. /**
  3550. * Option merge strategies (used in core/util/options)
  3551. */
  3552. // $flow-disable-line
  3553. optionMergeStrategies: Object.create(null),
  3554. /**
  3555. * Whether to suppress warnings.
  3556. */
  3557. silent: false,
  3558. /**
  3559. * Show production mode tip message on boot?
  3560. */
  3561. productionTip: "development" !== 'production',
  3562. /**
  3563. * Whether to enable devtools
  3564. */
  3565. devtools: "development" !== 'production',
  3566. /**
  3567. * Whether to record perf
  3568. */
  3569. performance: false,
  3570. /**
  3571. * Error handler for watcher errors
  3572. */
  3573. errorHandler: null,
  3574. /**
  3575. * Warn handler for watcher warns
  3576. */
  3577. warnHandler: null,
  3578. /**
  3579. * Ignore certain custom elements
  3580. */
  3581. ignoredElements: [],
  3582. /**
  3583. * Custom user key aliases for v-on
  3584. */
  3585. // $flow-disable-line
  3586. keyCodes: Object.create(null),
  3587. /**
  3588. * Check if a tag is reserved so that it cannot be registered as a
  3589. * component. This is platform-dependent and may be overwritten.
  3590. */
  3591. isReservedTag: no,
  3592. /**
  3593. * Check if an attribute is reserved so that it cannot be used as a component
  3594. * prop. This is platform-dependent and may be overwritten.
  3595. */
  3596. isReservedAttr: no,
  3597. /**
  3598. * Check if a tag is an unknown element.
  3599. * Platform-dependent.
  3600. */
  3601. isUnknownElement: no,
  3602. /**
  3603. * Get the namespace of an element
  3604. */
  3605. getTagNamespace: noop,
  3606. /**
  3607. * Parse the real tag name for the specific platform.
  3608. */
  3609. parsePlatformTagName: identity,
  3610. /**
  3611. * Check if an attribute must be bound using property, e.g. value
  3612. * Platform-dependent.
  3613. */
  3614. mustUseProp: no,
  3615. /**
  3616. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3617. * This will significantly reduce performance if set to false.
  3618. */
  3619. async: true,
  3620. /**
  3621. * Exposed for legacy reasons
  3622. */
  3623. _lifecycleHooks: LIFECYCLE_HOOKS
  3624. });
  3625. /* */
  3626. /**
  3627. * unicode letters used for parsing html tags, component names and property paths.
  3628. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3629. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3630. */
  3631. 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/;
  3632. /**
  3633. * Check if a string starts with $ or _
  3634. */
  3635. function isReserved (str) {
  3636. var c = (str + '').charCodeAt(0);
  3637. return c === 0x24 || c === 0x5F
  3638. }
  3639. /**
  3640. * Define a property.
  3641. */
  3642. function def (obj, key, val, enumerable) {
  3643. Object.defineProperty(obj, key, {
  3644. value: val,
  3645. enumerable: !!enumerable,
  3646. writable: true,
  3647. configurable: true
  3648. });
  3649. }
  3650. /**
  3651. * Parse simple path.
  3652. */
  3653. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3654. function parsePath (path) {
  3655. if (bailRE.test(path)) {
  3656. return
  3657. }
  3658. var segments = path.split('.');
  3659. return function (obj) {
  3660. for (var i = 0; i < segments.length; i++) {
  3661. if (!obj) { return }
  3662. obj = obj[segments[i]];
  3663. }
  3664. return obj
  3665. }
  3666. }
  3667. /* */
  3668. // can we use __proto__?
  3669. var hasProto = '__proto__' in {};
  3670. // Browser environment sniffing
  3671. var inBrowser = typeof window !== 'undefined';
  3672. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3673. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3674. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3675. var isIE = UA && /msie|trident/.test(UA);
  3676. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3677. var isEdge = UA && UA.indexOf('edge/') > 0;
  3678. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3679. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3680. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3681. var isPhantomJS = UA && /phantomjs/.test(UA);
  3682. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3683. // Firefox has a "watch" function on Object.prototype...
  3684. var nativeWatch = ({}).watch;
  3685. if (inBrowser) {
  3686. try {
  3687. var opts = {};
  3688. Object.defineProperty(opts, 'passive', ({
  3689. get: function get () {
  3690. }
  3691. })); // https://github.com/facebook/flow/issues/285
  3692. window.addEventListener('test-passive', null, opts);
  3693. } catch (e) {}
  3694. }
  3695. // this needs to be lazy-evaled because vue may be required before
  3696. // vue-server-renderer can set VUE_ENV
  3697. var _isServer;
  3698. var isServerRendering = function () {
  3699. if (_isServer === undefined) {
  3700. /* istanbul ignore if */
  3701. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3702. // detect presence of vue-server-renderer and avoid
  3703. // Webpack shimming the process
  3704. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3705. } else {
  3706. _isServer = false;
  3707. }
  3708. }
  3709. return _isServer
  3710. };
  3711. // detect devtools
  3712. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3713. /* istanbul ignore next */
  3714. function isNative (Ctor) {
  3715. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3716. }
  3717. var hasSymbol =
  3718. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3719. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3720. var _Set;
  3721. /* istanbul ignore if */ // $flow-disable-line
  3722. if (typeof Set !== 'undefined' && isNative(Set)) {
  3723. // use native Set when available.
  3724. _Set = Set;
  3725. } else {
  3726. // a non-standard Set polyfill that only works with primitive keys.
  3727. _Set = /*@__PURE__*/(function () {
  3728. function Set () {
  3729. this.set = Object.create(null);
  3730. }
  3731. Set.prototype.has = function has (key) {
  3732. return this.set[key] === true
  3733. };
  3734. Set.prototype.add = function add (key) {
  3735. this.set[key] = true;
  3736. };
  3737. Set.prototype.clear = function clear () {
  3738. this.set = Object.create(null);
  3739. };
  3740. return Set;
  3741. }());
  3742. }
  3743. /* */
  3744. var warn = noop;
  3745. var tip = noop;
  3746. var generateComponentTrace = (noop); // work around flow check
  3747. var formatComponentName = (noop);
  3748. if (true) {
  3749. var hasConsole = typeof console !== 'undefined';
  3750. var classifyRE = /(?:^|[-_])(\w)/g;
  3751. var classify = function (str) { return str
  3752. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3753. .replace(/[-_]/g, ''); };
  3754. warn = function (msg, vm) {
  3755. var trace = vm ? generateComponentTrace(vm) : '';
  3756. if (config.warnHandler) {
  3757. config.warnHandler.call(null, msg, vm, trace);
  3758. } else if (hasConsole && (!config.silent)) {
  3759. console.error(("[Vue warn]: " + msg + trace));
  3760. }
  3761. };
  3762. tip = function (msg, vm) {
  3763. if (hasConsole && (!config.silent)) {
  3764. console.warn("[Vue tip]: " + msg + (
  3765. vm ? generateComponentTrace(vm) : ''
  3766. ));
  3767. }
  3768. };
  3769. formatComponentName = function (vm, includeFile) {
  3770. if (vm.$root === vm) {
  3771. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3772. return ('') + vm.$options.__file
  3773. }
  3774. return '<Root>'
  3775. }
  3776. var options = typeof vm === 'function' && vm.cid != null
  3777. ? vm.options
  3778. : vm._isVue
  3779. ? vm.$options || vm.constructor.options
  3780. : vm;
  3781. var name = options.name || options._componentTag;
  3782. var file = options.__file;
  3783. if (!name && file) {
  3784. var match = file.match(/([^/\\]+)\.vue$/);
  3785. name = match && match[1];
  3786. }
  3787. return (
  3788. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3789. (file && includeFile !== false ? (" at " + file) : '')
  3790. )
  3791. };
  3792. var repeat = function (str, n) {
  3793. var res = '';
  3794. while (n) {
  3795. if (n % 2 === 1) { res += str; }
  3796. if (n > 1) { str += str; }
  3797. n >>= 1;
  3798. }
  3799. return res
  3800. };
  3801. generateComponentTrace = function (vm) {
  3802. if (vm._isVue && vm.$parent) {
  3803. var tree = [];
  3804. var currentRecursiveSequence = 0;
  3805. while (vm && vm.$options.name !== 'PageBody') {
  3806. if (tree.length > 0) {
  3807. var last = tree[tree.length - 1];
  3808. if (last.constructor === vm.constructor) {
  3809. currentRecursiveSequence++;
  3810. vm = vm.$parent;
  3811. continue
  3812. } else if (currentRecursiveSequence > 0) {
  3813. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3814. currentRecursiveSequence = 0;
  3815. }
  3816. }
  3817. !vm.$options.isReserved && tree.push(vm);
  3818. vm = vm.$parent;
  3819. }
  3820. return '\n\nfound in\n\n' + tree
  3821. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3822. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3823. : formatComponentName(vm))); })
  3824. .join('\n')
  3825. } else {
  3826. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3827. }
  3828. };
  3829. }
  3830. /* */
  3831. var uid = 0;
  3832. /**
  3833. * A dep is an observable that can have multiple
  3834. * directives subscribing to it.
  3835. */
  3836. var Dep = function Dep () {
  3837. this.id = uid++;
  3838. this.subs = [];
  3839. };
  3840. Dep.prototype.addSub = function addSub (sub) {
  3841. this.subs.push(sub);
  3842. };
  3843. Dep.prototype.removeSub = function removeSub (sub) {
  3844. remove(this.subs, sub);
  3845. };
  3846. Dep.prototype.depend = function depend () {
  3847. if (Dep.SharedObject.target) {
  3848. Dep.SharedObject.target.addDep(this);
  3849. }
  3850. };
  3851. Dep.prototype.notify = function notify () {
  3852. // stabilize the subscriber list first
  3853. var subs = this.subs.slice();
  3854. if ( true && !config.async) {
  3855. // subs aren't sorted in scheduler if not running async
  3856. // we need to sort them now to make sure they fire in correct
  3857. // order
  3858. subs.sort(function (a, b) { return a.id - b.id; });
  3859. }
  3860. for (var i = 0, l = subs.length; i < l; i++) {
  3861. subs[i].update();
  3862. }
  3863. };
  3864. // The current target watcher being evaluated.
  3865. // This is globally unique because only one watcher
  3866. // can be evaluated at a time.
  3867. // fixed by xxxxxx (nvue shared vuex)
  3868. /* eslint-disable no-undef */
  3869. Dep.SharedObject = {};
  3870. Dep.SharedObject.target = null;
  3871. Dep.SharedObject.targetStack = [];
  3872. function pushTarget (target) {
  3873. Dep.SharedObject.targetStack.push(target);
  3874. Dep.SharedObject.target = target;
  3875. Dep.target = target;
  3876. }
  3877. function popTarget () {
  3878. Dep.SharedObject.targetStack.pop();
  3879. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3880. Dep.target = Dep.SharedObject.target;
  3881. }
  3882. /* */
  3883. var VNode = function VNode (
  3884. tag,
  3885. data,
  3886. children,
  3887. text,
  3888. elm,
  3889. context,
  3890. componentOptions,
  3891. asyncFactory
  3892. ) {
  3893. this.tag = tag;
  3894. this.data = data;
  3895. this.children = children;
  3896. this.text = text;
  3897. this.elm = elm;
  3898. this.ns = undefined;
  3899. this.context = context;
  3900. this.fnContext = undefined;
  3901. this.fnOptions = undefined;
  3902. this.fnScopeId = undefined;
  3903. this.key = data && data.key;
  3904. this.componentOptions = componentOptions;
  3905. this.componentInstance = undefined;
  3906. this.parent = undefined;
  3907. this.raw = false;
  3908. this.isStatic = false;
  3909. this.isRootInsert = true;
  3910. this.isComment = false;
  3911. this.isCloned = false;
  3912. this.isOnce = false;
  3913. this.asyncFactory = asyncFactory;
  3914. this.asyncMeta = undefined;
  3915. this.isAsyncPlaceholder = false;
  3916. };
  3917. var prototypeAccessors = { child: { configurable: true } };
  3918. // DEPRECATED: alias for componentInstance for backwards compat.
  3919. /* istanbul ignore next */
  3920. prototypeAccessors.child.get = function () {
  3921. return this.componentInstance
  3922. };
  3923. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3924. var createEmptyVNode = function (text) {
  3925. if ( text === void 0 ) text = '';
  3926. var node = new VNode();
  3927. node.text = text;
  3928. node.isComment = true;
  3929. return node
  3930. };
  3931. function createTextVNode (val) {
  3932. return new VNode(undefined, undefined, undefined, String(val))
  3933. }
  3934. // optimized shallow clone
  3935. // used for static nodes and slot nodes because they may be reused across
  3936. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3937. // on their elm reference.
  3938. function cloneVNode (vnode) {
  3939. var cloned = new VNode(
  3940. vnode.tag,
  3941. vnode.data,
  3942. // #7975
  3943. // clone children array to avoid mutating original in case of cloning
  3944. // a child.
  3945. vnode.children && vnode.children.slice(),
  3946. vnode.text,
  3947. vnode.elm,
  3948. vnode.context,
  3949. vnode.componentOptions,
  3950. vnode.asyncFactory
  3951. );
  3952. cloned.ns = vnode.ns;
  3953. cloned.isStatic = vnode.isStatic;
  3954. cloned.key = vnode.key;
  3955. cloned.isComment = vnode.isComment;
  3956. cloned.fnContext = vnode.fnContext;
  3957. cloned.fnOptions = vnode.fnOptions;
  3958. cloned.fnScopeId = vnode.fnScopeId;
  3959. cloned.asyncMeta = vnode.asyncMeta;
  3960. cloned.isCloned = true;
  3961. return cloned
  3962. }
  3963. /*
  3964. * not type checking this file because flow doesn't play well with
  3965. * dynamically accessing methods on Array prototype
  3966. */
  3967. var arrayProto = Array.prototype;
  3968. var arrayMethods = Object.create(arrayProto);
  3969. var methodsToPatch = [
  3970. 'push',
  3971. 'pop',
  3972. 'shift',
  3973. 'unshift',
  3974. 'splice',
  3975. 'sort',
  3976. 'reverse'
  3977. ];
  3978. /**
  3979. * Intercept mutating methods and emit events
  3980. */
  3981. methodsToPatch.forEach(function (method) {
  3982. // cache original method
  3983. var original = arrayProto[method];
  3984. def(arrayMethods, method, function mutator () {
  3985. var args = [], len = arguments.length;
  3986. while ( len-- ) args[ len ] = arguments[ len ];
  3987. var result = original.apply(this, args);
  3988. var ob = this.__ob__;
  3989. var inserted;
  3990. switch (method) {
  3991. case 'push':
  3992. case 'unshift':
  3993. inserted = args;
  3994. break
  3995. case 'splice':
  3996. inserted = args.slice(2);
  3997. break
  3998. }
  3999. if (inserted) { ob.observeArray(inserted); }
  4000. // notify change
  4001. ob.dep.notify();
  4002. return result
  4003. });
  4004. });
  4005. /* */
  4006. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4007. /**
  4008. * In some cases we may want to disable observation inside a component's
  4009. * update computation.
  4010. */
  4011. var shouldObserve = true;
  4012. function toggleObserving (value) {
  4013. shouldObserve = value;
  4014. }
  4015. /**
  4016. * Observer class that is attached to each observed
  4017. * object. Once attached, the observer converts the target
  4018. * object's property keys into getter/setters that
  4019. * collect dependencies and dispatch updates.
  4020. */
  4021. var Observer = function Observer (value) {
  4022. this.value = value;
  4023. this.dep = new Dep();
  4024. this.vmCount = 0;
  4025. def(value, '__ob__', this);
  4026. if (Array.isArray(value)) {
  4027. if (hasProto) {
  4028. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4029. if(value.push !== value.__proto__.push){
  4030. copyAugment(value, arrayMethods, arrayKeys);
  4031. } else {
  4032. protoAugment(value, arrayMethods);
  4033. }
  4034. }
  4035. } else {
  4036. copyAugment(value, arrayMethods, arrayKeys);
  4037. }
  4038. this.observeArray(value);
  4039. } else {
  4040. this.walk(value);
  4041. }
  4042. };
  4043. /**
  4044. * Walk through all properties and convert them into
  4045. * getter/setters. This method should only be called when
  4046. * value type is Object.
  4047. */
  4048. Observer.prototype.walk = function walk (obj) {
  4049. var keys = Object.keys(obj);
  4050. for (var i = 0; i < keys.length; i++) {
  4051. defineReactive$$1(obj, keys[i]);
  4052. }
  4053. };
  4054. /**
  4055. * Observe a list of Array items.
  4056. */
  4057. Observer.prototype.observeArray = function observeArray (items) {
  4058. for (var i = 0, l = items.length; i < l; i++) {
  4059. observe(items[i]);
  4060. }
  4061. };
  4062. // helpers
  4063. /**
  4064. * Augment a target Object or Array by intercepting
  4065. * the prototype chain using __proto__
  4066. */
  4067. function protoAugment (target, src) {
  4068. /* eslint-disable no-proto */
  4069. target.__proto__ = src;
  4070. /* eslint-enable no-proto */
  4071. }
  4072. /**
  4073. * Augment a target Object or Array by defining
  4074. * hidden properties.
  4075. */
  4076. /* istanbul ignore next */
  4077. function copyAugment (target, src, keys) {
  4078. for (var i = 0, l = keys.length; i < l; i++) {
  4079. var key = keys[i];
  4080. def(target, key, src[key]);
  4081. }
  4082. }
  4083. /**
  4084. * Attempt to create an observer instance for a value,
  4085. * returns the new observer if successfully observed,
  4086. * or the existing observer if the value already has one.
  4087. */
  4088. function observe (value, asRootData) {
  4089. if (!isObject(value) || value instanceof VNode) {
  4090. return
  4091. }
  4092. var ob;
  4093. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4094. ob = value.__ob__;
  4095. } else if (
  4096. shouldObserve &&
  4097. !isServerRendering() &&
  4098. (Array.isArray(value) || isPlainObject(value)) &&
  4099. Object.isExtensible(value) &&
  4100. !value._isVue
  4101. ) {
  4102. ob = new Observer(value);
  4103. }
  4104. if (asRootData && ob) {
  4105. ob.vmCount++;
  4106. }
  4107. return ob
  4108. }
  4109. /**
  4110. * Define a reactive property on an Object.
  4111. */
  4112. function defineReactive$$1 (
  4113. obj,
  4114. key,
  4115. val,
  4116. customSetter,
  4117. shallow
  4118. ) {
  4119. var dep = new Dep();
  4120. var property = Object.getOwnPropertyDescriptor(obj, key);
  4121. if (property && property.configurable === false) {
  4122. return
  4123. }
  4124. // cater for pre-defined getter/setters
  4125. var getter = property && property.get;
  4126. var setter = property && property.set;
  4127. if ((!getter || setter) && arguments.length === 2) {
  4128. val = obj[key];
  4129. }
  4130. var childOb = !shallow && observe(val);
  4131. Object.defineProperty(obj, key, {
  4132. enumerable: true,
  4133. configurable: true,
  4134. get: function reactiveGetter () {
  4135. var value = getter ? getter.call(obj) : val;
  4136. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4137. dep.depend();
  4138. if (childOb) {
  4139. childOb.dep.depend();
  4140. if (Array.isArray(value)) {
  4141. dependArray(value);
  4142. }
  4143. }
  4144. }
  4145. return value
  4146. },
  4147. set: function reactiveSetter (newVal) {
  4148. var value = getter ? getter.call(obj) : val;
  4149. /* eslint-disable no-self-compare */
  4150. if (newVal === value || (newVal !== newVal && value !== value)) {
  4151. return
  4152. }
  4153. /* eslint-enable no-self-compare */
  4154. if ( true && customSetter) {
  4155. customSetter();
  4156. }
  4157. // #7981: for accessor properties without setter
  4158. if (getter && !setter) { return }
  4159. if (setter) {
  4160. setter.call(obj, newVal);
  4161. } else {
  4162. val = newVal;
  4163. }
  4164. childOb = !shallow && observe(newVal);
  4165. dep.notify();
  4166. }
  4167. });
  4168. }
  4169. /**
  4170. * Set a property on an object. Adds the new property and
  4171. * triggers change notification if the property doesn't
  4172. * already exist.
  4173. */
  4174. function set (target, key, val) {
  4175. if ( true &&
  4176. (isUndef(target) || isPrimitive(target))
  4177. ) {
  4178. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4179. }
  4180. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4181. target.length = Math.max(target.length, key);
  4182. target.splice(key, 1, val);
  4183. return val
  4184. }
  4185. if (key in target && !(key in Object.prototype)) {
  4186. target[key] = val;
  4187. return val
  4188. }
  4189. var ob = (target).__ob__;
  4190. if (target._isVue || (ob && ob.vmCount)) {
  4191. true && warn(
  4192. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4193. 'at runtime - declare it upfront in the data option.'
  4194. );
  4195. return val
  4196. }
  4197. if (!ob) {
  4198. target[key] = val;
  4199. return val
  4200. }
  4201. defineReactive$$1(ob.value, key, val);
  4202. ob.dep.notify();
  4203. return val
  4204. }
  4205. /**
  4206. * Delete a property and trigger change if necessary.
  4207. */
  4208. function del (target, key) {
  4209. if ( true &&
  4210. (isUndef(target) || isPrimitive(target))
  4211. ) {
  4212. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4213. }
  4214. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4215. target.splice(key, 1);
  4216. return
  4217. }
  4218. var ob = (target).__ob__;
  4219. if (target._isVue || (ob && ob.vmCount)) {
  4220. true && warn(
  4221. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4222. '- just set it to null.'
  4223. );
  4224. return
  4225. }
  4226. if (!hasOwn(target, key)) {
  4227. return
  4228. }
  4229. delete target[key];
  4230. if (!ob) {
  4231. return
  4232. }
  4233. ob.dep.notify();
  4234. }
  4235. /**
  4236. * Collect dependencies on array elements when the array is touched, since
  4237. * we cannot intercept array element access like property getters.
  4238. */
  4239. function dependArray (value) {
  4240. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4241. e = value[i];
  4242. e && e.__ob__ && e.__ob__.dep.depend();
  4243. if (Array.isArray(e)) {
  4244. dependArray(e);
  4245. }
  4246. }
  4247. }
  4248. /* */
  4249. /**
  4250. * Option overwriting strategies are functions that handle
  4251. * how to merge a parent option value and a child option
  4252. * value into the final value.
  4253. */
  4254. var strats = config.optionMergeStrategies;
  4255. /**
  4256. * Options with restrictions
  4257. */
  4258. if (true) {
  4259. strats.el = strats.propsData = function (parent, child, vm, key) {
  4260. if (!vm) {
  4261. warn(
  4262. "option \"" + key + "\" can only be used during instance " +
  4263. 'creation with the `new` keyword.'
  4264. );
  4265. }
  4266. return defaultStrat(parent, child)
  4267. };
  4268. }
  4269. /**
  4270. * Helper that recursively merges two data objects together.
  4271. */
  4272. function mergeData (to, from) {
  4273. if (!from) { return to }
  4274. var key, toVal, fromVal;
  4275. var keys = hasSymbol
  4276. ? Reflect.ownKeys(from)
  4277. : Object.keys(from);
  4278. for (var i = 0; i < keys.length; i++) {
  4279. key = keys[i];
  4280. // in case the object is already observed...
  4281. if (key === '__ob__') { continue }
  4282. toVal = to[key];
  4283. fromVal = from[key];
  4284. if (!hasOwn(to, key)) {
  4285. set(to, key, fromVal);
  4286. } else if (
  4287. toVal !== fromVal &&
  4288. isPlainObject(toVal) &&
  4289. isPlainObject(fromVal)
  4290. ) {
  4291. mergeData(toVal, fromVal);
  4292. }
  4293. }
  4294. return to
  4295. }
  4296. /**
  4297. * Data
  4298. */
  4299. function mergeDataOrFn (
  4300. parentVal,
  4301. childVal,
  4302. vm
  4303. ) {
  4304. if (!vm) {
  4305. // in a Vue.extend merge, both should be functions
  4306. if (!childVal) {
  4307. return parentVal
  4308. }
  4309. if (!parentVal) {
  4310. return childVal
  4311. }
  4312. // when parentVal & childVal are both present,
  4313. // we need to return a function that returns the
  4314. // merged result of both functions... no need to
  4315. // check if parentVal is a function here because
  4316. // it has to be a function to pass previous merges.
  4317. return function mergedDataFn () {
  4318. return mergeData(
  4319. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4320. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4321. )
  4322. }
  4323. } else {
  4324. return function mergedInstanceDataFn () {
  4325. // instance merge
  4326. var instanceData = typeof childVal === 'function'
  4327. ? childVal.call(vm, vm)
  4328. : childVal;
  4329. var defaultData = typeof parentVal === 'function'
  4330. ? parentVal.call(vm, vm)
  4331. : parentVal;
  4332. if (instanceData) {
  4333. return mergeData(instanceData, defaultData)
  4334. } else {
  4335. return defaultData
  4336. }
  4337. }
  4338. }
  4339. }
  4340. strats.data = function (
  4341. parentVal,
  4342. childVal,
  4343. vm
  4344. ) {
  4345. if (!vm) {
  4346. if (childVal && typeof childVal !== 'function') {
  4347. true && warn(
  4348. 'The "data" option should be a function ' +
  4349. 'that returns a per-instance value in component ' +
  4350. 'definitions.',
  4351. vm
  4352. );
  4353. return parentVal
  4354. }
  4355. return mergeDataOrFn(parentVal, childVal)
  4356. }
  4357. return mergeDataOrFn(parentVal, childVal, vm)
  4358. };
  4359. /**
  4360. * Hooks and props are merged as arrays.
  4361. */
  4362. function mergeHook (
  4363. parentVal,
  4364. childVal
  4365. ) {
  4366. var res = childVal
  4367. ? parentVal
  4368. ? parentVal.concat(childVal)
  4369. : Array.isArray(childVal)
  4370. ? childVal
  4371. : [childVal]
  4372. : parentVal;
  4373. return res
  4374. ? dedupeHooks(res)
  4375. : res
  4376. }
  4377. function dedupeHooks (hooks) {
  4378. var res = [];
  4379. for (var i = 0; i < hooks.length; i++) {
  4380. if (res.indexOf(hooks[i]) === -1) {
  4381. res.push(hooks[i]);
  4382. }
  4383. }
  4384. return res
  4385. }
  4386. LIFECYCLE_HOOKS.forEach(function (hook) {
  4387. strats[hook] = mergeHook;
  4388. });
  4389. /**
  4390. * Assets
  4391. *
  4392. * When a vm is present (instance creation), we need to do
  4393. * a three-way merge between constructor options, instance
  4394. * options and parent options.
  4395. */
  4396. function mergeAssets (
  4397. parentVal,
  4398. childVal,
  4399. vm,
  4400. key
  4401. ) {
  4402. var res = Object.create(parentVal || null);
  4403. if (childVal) {
  4404. true && assertObjectType(key, childVal, vm);
  4405. return extend(res, childVal)
  4406. } else {
  4407. return res
  4408. }
  4409. }
  4410. ASSET_TYPES.forEach(function (type) {
  4411. strats[type + 's'] = mergeAssets;
  4412. });
  4413. /**
  4414. * Watchers.
  4415. *
  4416. * Watchers hashes should not overwrite one
  4417. * another, so we merge them as arrays.
  4418. */
  4419. strats.watch = function (
  4420. parentVal,
  4421. childVal,
  4422. vm,
  4423. key
  4424. ) {
  4425. // work around Firefox's Object.prototype.watch...
  4426. if (parentVal === nativeWatch) { parentVal = undefined; }
  4427. if (childVal === nativeWatch) { childVal = undefined; }
  4428. /* istanbul ignore if */
  4429. if (!childVal) { return Object.create(parentVal || null) }
  4430. if (true) {
  4431. assertObjectType(key, childVal, vm);
  4432. }
  4433. if (!parentVal) { return childVal }
  4434. var ret = {};
  4435. extend(ret, parentVal);
  4436. for (var key$1 in childVal) {
  4437. var parent = ret[key$1];
  4438. var child = childVal[key$1];
  4439. if (parent && !Array.isArray(parent)) {
  4440. parent = [parent];
  4441. }
  4442. ret[key$1] = parent
  4443. ? parent.concat(child)
  4444. : Array.isArray(child) ? child : [child];
  4445. }
  4446. return ret
  4447. };
  4448. /**
  4449. * Other object hashes.
  4450. */
  4451. strats.props =
  4452. strats.methods =
  4453. strats.inject =
  4454. strats.computed = function (
  4455. parentVal,
  4456. childVal,
  4457. vm,
  4458. key
  4459. ) {
  4460. if (childVal && "development" !== 'production') {
  4461. assertObjectType(key, childVal, vm);
  4462. }
  4463. if (!parentVal) { return childVal }
  4464. var ret = Object.create(null);
  4465. extend(ret, parentVal);
  4466. if (childVal) { extend(ret, childVal); }
  4467. return ret
  4468. };
  4469. strats.provide = mergeDataOrFn;
  4470. /**
  4471. * Default strategy.
  4472. */
  4473. var defaultStrat = function (parentVal, childVal) {
  4474. return childVal === undefined
  4475. ? parentVal
  4476. : childVal
  4477. };
  4478. /**
  4479. * Validate component names
  4480. */
  4481. function checkComponents (options) {
  4482. for (var key in options.components) {
  4483. validateComponentName(key);
  4484. }
  4485. }
  4486. function validateComponentName (name) {
  4487. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4488. warn(
  4489. 'Invalid component name: "' + name + '". Component names ' +
  4490. 'should conform to valid custom element name in html5 specification.'
  4491. );
  4492. }
  4493. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4494. warn(
  4495. 'Do not use built-in or reserved HTML elements as component ' +
  4496. 'id: ' + name
  4497. );
  4498. }
  4499. }
  4500. /**
  4501. * Ensure all props option syntax are normalized into the
  4502. * Object-based format.
  4503. */
  4504. function normalizeProps (options, vm) {
  4505. var props = options.props;
  4506. if (!props) { return }
  4507. var res = {};
  4508. var i, val, name;
  4509. if (Array.isArray(props)) {
  4510. i = props.length;
  4511. while (i--) {
  4512. val = props[i];
  4513. if (typeof val === 'string') {
  4514. name = camelize(val);
  4515. res[name] = { type: null };
  4516. } else if (true) {
  4517. warn('props must be strings when using array syntax.');
  4518. }
  4519. }
  4520. } else if (isPlainObject(props)) {
  4521. for (var key in props) {
  4522. val = props[key];
  4523. name = camelize(key);
  4524. res[name] = isPlainObject(val)
  4525. ? val
  4526. : { type: val };
  4527. }
  4528. } else if (true) {
  4529. warn(
  4530. "Invalid value for option \"props\": expected an Array or an Object, " +
  4531. "but got " + (toRawType(props)) + ".",
  4532. vm
  4533. );
  4534. }
  4535. options.props = res;
  4536. }
  4537. /**
  4538. * Normalize all injections into Object-based format
  4539. */
  4540. function normalizeInject (options, vm) {
  4541. var inject = options.inject;
  4542. if (!inject) { return }
  4543. var normalized = options.inject = {};
  4544. if (Array.isArray(inject)) {
  4545. for (var i = 0; i < inject.length; i++) {
  4546. normalized[inject[i]] = { from: inject[i] };
  4547. }
  4548. } else if (isPlainObject(inject)) {
  4549. for (var key in inject) {
  4550. var val = inject[key];
  4551. normalized[key] = isPlainObject(val)
  4552. ? extend({ from: key }, val)
  4553. : { from: val };
  4554. }
  4555. } else if (true) {
  4556. warn(
  4557. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4558. "but got " + (toRawType(inject)) + ".",
  4559. vm
  4560. );
  4561. }
  4562. }
  4563. /**
  4564. * Normalize raw function directives into object format.
  4565. */
  4566. function normalizeDirectives (options) {
  4567. var dirs = options.directives;
  4568. if (dirs) {
  4569. for (var key in dirs) {
  4570. var def$$1 = dirs[key];
  4571. if (typeof def$$1 === 'function') {
  4572. dirs[key] = { bind: def$$1, update: def$$1 };
  4573. }
  4574. }
  4575. }
  4576. }
  4577. function assertObjectType (name, value, vm) {
  4578. if (!isPlainObject(value)) {
  4579. warn(
  4580. "Invalid value for option \"" + name + "\": expected an Object, " +
  4581. "but got " + (toRawType(value)) + ".",
  4582. vm
  4583. );
  4584. }
  4585. }
  4586. /**
  4587. * Merge two option objects into a new one.
  4588. * Core utility used in both instantiation and inheritance.
  4589. */
  4590. function mergeOptions (
  4591. parent,
  4592. child,
  4593. vm
  4594. ) {
  4595. if (true) {
  4596. checkComponents(child);
  4597. }
  4598. if (typeof child === 'function') {
  4599. child = child.options;
  4600. }
  4601. normalizeProps(child, vm);
  4602. normalizeInject(child, vm);
  4603. normalizeDirectives(child);
  4604. // Apply extends and mixins on the child options,
  4605. // but only if it is a raw options object that isn't
  4606. // the result of another mergeOptions call.
  4607. // Only merged options has the _base property.
  4608. if (!child._base) {
  4609. if (child.extends) {
  4610. parent = mergeOptions(parent, child.extends, vm);
  4611. }
  4612. if (child.mixins) {
  4613. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4614. parent = mergeOptions(parent, child.mixins[i], vm);
  4615. }
  4616. }
  4617. }
  4618. var options = {};
  4619. var key;
  4620. for (key in parent) {
  4621. mergeField(key);
  4622. }
  4623. for (key in child) {
  4624. if (!hasOwn(parent, key)) {
  4625. mergeField(key);
  4626. }
  4627. }
  4628. function mergeField (key) {
  4629. var strat = strats[key] || defaultStrat;
  4630. options[key] = strat(parent[key], child[key], vm, key);
  4631. }
  4632. return options
  4633. }
  4634. /**
  4635. * Resolve an asset.
  4636. * This function is used because child instances need access
  4637. * to assets defined in its ancestor chain.
  4638. */
  4639. function resolveAsset (
  4640. options,
  4641. type,
  4642. id,
  4643. warnMissing
  4644. ) {
  4645. /* istanbul ignore if */
  4646. if (typeof id !== 'string') {
  4647. return
  4648. }
  4649. var assets = options[type];
  4650. // check local registration variations first
  4651. if (hasOwn(assets, id)) { return assets[id] }
  4652. var camelizedId = camelize(id);
  4653. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4654. var PascalCaseId = capitalize(camelizedId);
  4655. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4656. // fallback to prototype chain
  4657. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4658. if ( true && warnMissing && !res) {
  4659. warn(
  4660. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4661. options
  4662. );
  4663. }
  4664. return res
  4665. }
  4666. /* */
  4667. function validateProp (
  4668. key,
  4669. propOptions,
  4670. propsData,
  4671. vm
  4672. ) {
  4673. var prop = propOptions[key];
  4674. var absent = !hasOwn(propsData, key);
  4675. var value = propsData[key];
  4676. // boolean casting
  4677. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4678. if (booleanIndex > -1) {
  4679. if (absent && !hasOwn(prop, 'default')) {
  4680. value = false;
  4681. } else if (value === '' || value === hyphenate(key)) {
  4682. // only cast empty string / same name to boolean if
  4683. // boolean has higher priority
  4684. var stringIndex = getTypeIndex(String, prop.type);
  4685. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4686. value = true;
  4687. }
  4688. }
  4689. }
  4690. // check default value
  4691. if (value === undefined) {
  4692. value = getPropDefaultValue(vm, prop, key);
  4693. // since the default value is a fresh copy,
  4694. // make sure to observe it.
  4695. var prevShouldObserve = shouldObserve;
  4696. toggleObserving(true);
  4697. observe(value);
  4698. toggleObserving(prevShouldObserve);
  4699. }
  4700. if (
  4701. true
  4702. ) {
  4703. assertProp(prop, key, value, vm, absent);
  4704. }
  4705. return value
  4706. }
  4707. /**
  4708. * Get the default value of a prop.
  4709. */
  4710. function getPropDefaultValue (vm, prop, key) {
  4711. // no default, return undefined
  4712. if (!hasOwn(prop, 'default')) {
  4713. return undefined
  4714. }
  4715. var def = prop.default;
  4716. // warn against non-factory defaults for Object & Array
  4717. if ( true && isObject(def)) {
  4718. warn(
  4719. 'Invalid default value for prop "' + key + '": ' +
  4720. 'Props with type Object/Array must use a factory function ' +
  4721. 'to return the default value.',
  4722. vm
  4723. );
  4724. }
  4725. // the raw prop value was also undefined from previous render,
  4726. // return previous default value to avoid unnecessary watcher trigger
  4727. if (vm && vm.$options.propsData &&
  4728. vm.$options.propsData[key] === undefined &&
  4729. vm._props[key] !== undefined
  4730. ) {
  4731. return vm._props[key]
  4732. }
  4733. // call factory function for non-Function types
  4734. // a value is Function if its prototype is function even across different execution context
  4735. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4736. ? def.call(vm)
  4737. : def
  4738. }
  4739. /**
  4740. * Assert whether a prop is valid.
  4741. */
  4742. function assertProp (
  4743. prop,
  4744. name,
  4745. value,
  4746. vm,
  4747. absent
  4748. ) {
  4749. if (prop.required && absent) {
  4750. warn(
  4751. 'Missing required prop: "' + name + '"',
  4752. vm
  4753. );
  4754. return
  4755. }
  4756. if (value == null && !prop.required) {
  4757. return
  4758. }
  4759. var type = prop.type;
  4760. var valid = !type || type === true;
  4761. var expectedTypes = [];
  4762. if (type) {
  4763. if (!Array.isArray(type)) {
  4764. type = [type];
  4765. }
  4766. for (var i = 0; i < type.length && !valid; i++) {
  4767. var assertedType = assertType(value, type[i]);
  4768. expectedTypes.push(assertedType.expectedType || '');
  4769. valid = assertedType.valid;
  4770. }
  4771. }
  4772. if (!valid) {
  4773. warn(
  4774. getInvalidTypeMessage(name, value, expectedTypes),
  4775. vm
  4776. );
  4777. return
  4778. }
  4779. var validator = prop.validator;
  4780. if (validator) {
  4781. if (!validator(value)) {
  4782. warn(
  4783. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4784. vm
  4785. );
  4786. }
  4787. }
  4788. }
  4789. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4790. function assertType (value, type) {
  4791. var valid;
  4792. var expectedType = getType(type);
  4793. if (simpleCheckRE.test(expectedType)) {
  4794. var t = typeof value;
  4795. valid = t === expectedType.toLowerCase();
  4796. // for primitive wrapper objects
  4797. if (!valid && t === 'object') {
  4798. valid = value instanceof type;
  4799. }
  4800. } else if (expectedType === 'Object') {
  4801. valid = isPlainObject(value);
  4802. } else if (expectedType === 'Array') {
  4803. valid = Array.isArray(value);
  4804. } else {
  4805. valid = value instanceof type;
  4806. }
  4807. return {
  4808. valid: valid,
  4809. expectedType: expectedType
  4810. }
  4811. }
  4812. /**
  4813. * Use function string name to check built-in types,
  4814. * because a simple equality check will fail when running
  4815. * across different vms / iframes.
  4816. */
  4817. function getType (fn) {
  4818. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4819. return match ? match[1] : ''
  4820. }
  4821. function isSameType (a, b) {
  4822. return getType(a) === getType(b)
  4823. }
  4824. function getTypeIndex (type, expectedTypes) {
  4825. if (!Array.isArray(expectedTypes)) {
  4826. return isSameType(expectedTypes, type) ? 0 : -1
  4827. }
  4828. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4829. if (isSameType(expectedTypes[i], type)) {
  4830. return i
  4831. }
  4832. }
  4833. return -1
  4834. }
  4835. function getInvalidTypeMessage (name, value, expectedTypes) {
  4836. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4837. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4838. var expectedType = expectedTypes[0];
  4839. var receivedType = toRawType(value);
  4840. var expectedValue = styleValue(value, expectedType);
  4841. var receivedValue = styleValue(value, receivedType);
  4842. // check if we need to specify expected value
  4843. if (expectedTypes.length === 1 &&
  4844. isExplicable(expectedType) &&
  4845. !isBoolean(expectedType, receivedType)) {
  4846. message += " with value " + expectedValue;
  4847. }
  4848. message += ", got " + receivedType + " ";
  4849. // check if we need to specify received value
  4850. if (isExplicable(receivedType)) {
  4851. message += "with value " + receivedValue + ".";
  4852. }
  4853. return message
  4854. }
  4855. function styleValue (value, type) {
  4856. if (type === 'String') {
  4857. return ("\"" + value + "\"")
  4858. } else if (type === 'Number') {
  4859. return ("" + (Number(value)))
  4860. } else {
  4861. return ("" + value)
  4862. }
  4863. }
  4864. function isExplicable (value) {
  4865. var explicitTypes = ['string', 'number', 'boolean'];
  4866. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4867. }
  4868. function isBoolean () {
  4869. var args = [], len = arguments.length;
  4870. while ( len-- ) args[ len ] = arguments[ len ];
  4871. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4872. }
  4873. /* */
  4874. function handleError (err, vm, info) {
  4875. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4876. // See: https://github.com/vuejs/vuex/issues/1505
  4877. pushTarget();
  4878. try {
  4879. if (vm) {
  4880. var cur = vm;
  4881. while ((cur = cur.$parent)) {
  4882. var hooks = cur.$options.errorCaptured;
  4883. if (hooks) {
  4884. for (var i = 0; i < hooks.length; i++) {
  4885. try {
  4886. var capture = hooks[i].call(cur, err, vm, info) === false;
  4887. if (capture) { return }
  4888. } catch (e) {
  4889. globalHandleError(e, cur, 'errorCaptured hook');
  4890. }
  4891. }
  4892. }
  4893. }
  4894. }
  4895. globalHandleError(err, vm, info);
  4896. } finally {
  4897. popTarget();
  4898. }
  4899. }
  4900. function invokeWithErrorHandling (
  4901. handler,
  4902. context,
  4903. args,
  4904. vm,
  4905. info
  4906. ) {
  4907. var res;
  4908. try {
  4909. res = args ? handler.apply(context, args) : handler.call(context);
  4910. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4911. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4912. // issue #9511
  4913. // avoid catch triggering multiple times when nested calls
  4914. res._handled = true;
  4915. }
  4916. } catch (e) {
  4917. handleError(e, vm, info);
  4918. }
  4919. return res
  4920. }
  4921. function globalHandleError (err, vm, info) {
  4922. if (config.errorHandler) {
  4923. try {
  4924. return config.errorHandler.call(null, err, vm, info)
  4925. } catch (e) {
  4926. // if the user intentionally throws the original error in the handler,
  4927. // do not log it twice
  4928. if (e !== err) {
  4929. logError(e, null, 'config.errorHandler');
  4930. }
  4931. }
  4932. }
  4933. logError(err, vm, info);
  4934. }
  4935. function logError (err, vm, info) {
  4936. if (true) {
  4937. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4938. }
  4939. /* istanbul ignore else */
  4940. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4941. console.error(err);
  4942. } else {
  4943. throw err
  4944. }
  4945. }
  4946. /* */
  4947. var callbacks = [];
  4948. var pending = false;
  4949. function flushCallbacks () {
  4950. pending = false;
  4951. var copies = callbacks.slice(0);
  4952. callbacks.length = 0;
  4953. for (var i = 0; i < copies.length; i++) {
  4954. copies[i]();
  4955. }
  4956. }
  4957. // Here we have async deferring wrappers using microtasks.
  4958. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4959. // However, it has subtle problems when state is changed right before repaint
  4960. // (e.g. #6813, out-in transitions).
  4961. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4962. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4963. // So we now use microtasks everywhere, again.
  4964. // A major drawback of this tradeoff is that there are some scenarios
  4965. // where microtasks have too high a priority and fire in between supposedly
  4966. // sequential events (e.g. #4521, #6690, which have workarounds)
  4967. // or even between bubbling of the same event (#6566).
  4968. var timerFunc;
  4969. // The nextTick behavior leverages the microtask queue, which can be accessed
  4970. // via either native Promise.then or MutationObserver.
  4971. // MutationObserver has wider support, however it is seriously bugged in
  4972. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4973. // completely stops working after triggering a few times... so, if native
  4974. // Promise is available, we will use it:
  4975. /* istanbul ignore next, $flow-disable-line */
  4976. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4977. var p = Promise.resolve();
  4978. timerFunc = function () {
  4979. p.then(flushCallbacks);
  4980. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4981. // it can get stuck in a weird state where callbacks are pushed into the
  4982. // microtask queue but the queue isn't being flushed, until the browser
  4983. // needs to do some other work, e.g. handle a timer. Therefore we can
  4984. // "force" the microtask queue to be flushed by adding an empty timer.
  4985. if (isIOS) { setTimeout(noop); }
  4986. };
  4987. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4988. isNative(MutationObserver) ||
  4989. // PhantomJS and iOS 7.x
  4990. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4991. )) {
  4992. // Use MutationObserver where native Promise is not available,
  4993. // e.g. PhantomJS, iOS7, Android 4.4
  4994. // (#6466 MutationObserver is unreliable in IE11)
  4995. var counter = 1;
  4996. var observer = new MutationObserver(flushCallbacks);
  4997. var textNode = document.createTextNode(String(counter));
  4998. observer.observe(textNode, {
  4999. characterData: true
  5000. });
  5001. timerFunc = function () {
  5002. counter = (counter + 1) % 2;
  5003. textNode.data = String(counter);
  5004. };
  5005. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5006. // Fallback to setImmediate.
  5007. // Technically it leverages the (macro) task queue,
  5008. // but it is still a better choice than setTimeout.
  5009. timerFunc = function () {
  5010. setImmediate(flushCallbacks);
  5011. };
  5012. } else {
  5013. // Fallback to setTimeout.
  5014. timerFunc = function () {
  5015. setTimeout(flushCallbacks, 0);
  5016. };
  5017. }
  5018. function nextTick (cb, ctx) {
  5019. var _resolve;
  5020. callbacks.push(function () {
  5021. if (cb) {
  5022. try {
  5023. cb.call(ctx);
  5024. } catch (e) {
  5025. handleError(e, ctx, 'nextTick');
  5026. }
  5027. } else if (_resolve) {
  5028. _resolve(ctx);
  5029. }
  5030. });
  5031. if (!pending) {
  5032. pending = true;
  5033. timerFunc();
  5034. }
  5035. // $flow-disable-line
  5036. if (!cb && typeof Promise !== 'undefined') {
  5037. return new Promise(function (resolve) {
  5038. _resolve = resolve;
  5039. })
  5040. }
  5041. }
  5042. /* */
  5043. /* not type checking this file because flow doesn't play well with Proxy */
  5044. var initProxy;
  5045. if (true) {
  5046. var allowedGlobals = makeMap(
  5047. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5048. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5049. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5050. 'require' // for Webpack/Browserify
  5051. );
  5052. var warnNonPresent = function (target, key) {
  5053. warn(
  5054. "Property or method \"" + key + "\" is not defined on the instance but " +
  5055. 'referenced during render. Make sure that this property is reactive, ' +
  5056. 'either in the data option, or for class-based components, by ' +
  5057. 'initializing the property. ' +
  5058. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5059. target
  5060. );
  5061. };
  5062. var warnReservedPrefix = function (target, key) {
  5063. warn(
  5064. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5065. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5066. 'prevent conflicts with Vue internals. ' +
  5067. 'See: https://vuejs.org/v2/api/#data',
  5068. target
  5069. );
  5070. };
  5071. var hasProxy =
  5072. typeof Proxy !== 'undefined' && isNative(Proxy);
  5073. if (hasProxy) {
  5074. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5075. config.keyCodes = new Proxy(config.keyCodes, {
  5076. set: function set (target, key, value) {
  5077. if (isBuiltInModifier(key)) {
  5078. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5079. return false
  5080. } else {
  5081. target[key] = value;
  5082. return true
  5083. }
  5084. }
  5085. });
  5086. }
  5087. var hasHandler = {
  5088. has: function has (target, key) {
  5089. var has = key in target;
  5090. var isAllowed = allowedGlobals(key) ||
  5091. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5092. if (!has && !isAllowed) {
  5093. if (key in target.$data) { warnReservedPrefix(target, key); }
  5094. else { warnNonPresent(target, key); }
  5095. }
  5096. return has || !isAllowed
  5097. }
  5098. };
  5099. var getHandler = {
  5100. get: function get (target, key) {
  5101. if (typeof key === 'string' && !(key in target)) {
  5102. if (key in target.$data) { warnReservedPrefix(target, key); }
  5103. else { warnNonPresent(target, key); }
  5104. }
  5105. return target[key]
  5106. }
  5107. };
  5108. initProxy = function initProxy (vm) {
  5109. if (hasProxy) {
  5110. // determine which proxy handler to use
  5111. var options = vm.$options;
  5112. var handlers = options.render && options.render._withStripped
  5113. ? getHandler
  5114. : hasHandler;
  5115. vm._renderProxy = new Proxy(vm, handlers);
  5116. } else {
  5117. vm._renderProxy = vm;
  5118. }
  5119. };
  5120. }
  5121. /* */
  5122. var seenObjects = new _Set();
  5123. /**
  5124. * Recursively traverse an object to evoke all converted
  5125. * getters, so that every nested property inside the object
  5126. * is collected as a "deep" dependency.
  5127. */
  5128. function traverse (val) {
  5129. _traverse(val, seenObjects);
  5130. seenObjects.clear();
  5131. }
  5132. function _traverse (val, seen) {
  5133. var i, keys;
  5134. var isA = Array.isArray(val);
  5135. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5136. return
  5137. }
  5138. if (val.__ob__) {
  5139. var depId = val.__ob__.dep.id;
  5140. if (seen.has(depId)) {
  5141. return
  5142. }
  5143. seen.add(depId);
  5144. }
  5145. if (isA) {
  5146. i = val.length;
  5147. while (i--) { _traverse(val[i], seen); }
  5148. } else {
  5149. keys = Object.keys(val);
  5150. i = keys.length;
  5151. while (i--) { _traverse(val[keys[i]], seen); }
  5152. }
  5153. }
  5154. var mark;
  5155. var measure;
  5156. if (true) {
  5157. var perf = inBrowser && window.performance;
  5158. /* istanbul ignore if */
  5159. if (
  5160. perf &&
  5161. perf.mark &&
  5162. perf.measure &&
  5163. perf.clearMarks &&
  5164. perf.clearMeasures
  5165. ) {
  5166. mark = function (tag) { return perf.mark(tag); };
  5167. measure = function (name, startTag, endTag) {
  5168. perf.measure(name, startTag, endTag);
  5169. perf.clearMarks(startTag);
  5170. perf.clearMarks(endTag);
  5171. // perf.clearMeasures(name)
  5172. };
  5173. }
  5174. }
  5175. /* */
  5176. var normalizeEvent = cached(function (name) {
  5177. var passive = name.charAt(0) === '&';
  5178. name = passive ? name.slice(1) : name;
  5179. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5180. name = once$$1 ? name.slice(1) : name;
  5181. var capture = name.charAt(0) === '!';
  5182. name = capture ? name.slice(1) : name;
  5183. return {
  5184. name: name,
  5185. once: once$$1,
  5186. capture: capture,
  5187. passive: passive
  5188. }
  5189. });
  5190. function createFnInvoker (fns, vm) {
  5191. function invoker () {
  5192. var arguments$1 = arguments;
  5193. var fns = invoker.fns;
  5194. if (Array.isArray(fns)) {
  5195. var cloned = fns.slice();
  5196. for (var i = 0; i < cloned.length; i++) {
  5197. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5198. }
  5199. } else {
  5200. // return handler return value for single handlers
  5201. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5202. }
  5203. }
  5204. invoker.fns = fns;
  5205. return invoker
  5206. }
  5207. function updateListeners (
  5208. on,
  5209. oldOn,
  5210. add,
  5211. remove$$1,
  5212. createOnceHandler,
  5213. vm
  5214. ) {
  5215. var name, def$$1, cur, old, event;
  5216. for (name in on) {
  5217. def$$1 = cur = on[name];
  5218. old = oldOn[name];
  5219. event = normalizeEvent(name);
  5220. if (isUndef(cur)) {
  5221. true && warn(
  5222. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5223. vm
  5224. );
  5225. } else if (isUndef(old)) {
  5226. if (isUndef(cur.fns)) {
  5227. cur = on[name] = createFnInvoker(cur, vm);
  5228. }
  5229. if (isTrue(event.once)) {
  5230. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5231. }
  5232. add(event.name, cur, event.capture, event.passive, event.params);
  5233. } else if (cur !== old) {
  5234. old.fns = cur;
  5235. on[name] = old;
  5236. }
  5237. }
  5238. for (name in oldOn) {
  5239. if (isUndef(on[name])) {
  5240. event = normalizeEvent(name);
  5241. remove$$1(event.name, oldOn[name], event.capture);
  5242. }
  5243. }
  5244. }
  5245. /* */
  5246. /* */
  5247. // fixed by xxxxxx (mp properties)
  5248. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5249. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5250. if (isUndef(propOptions)) {
  5251. return res
  5252. }
  5253. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5254. var attrs = data.attrs;
  5255. var props = data.props;
  5256. if (isDef(attrs) || isDef(props)) {
  5257. for (var key in propOptions) {
  5258. var altKey = hyphenate(key);
  5259. var result = checkProp(res, props, key, altKey, true) ||
  5260. checkProp(res, attrs, key, altKey, false);
  5261. // externalClass
  5262. if (
  5263. result &&
  5264. res[key] &&
  5265. externalClasses.indexOf(altKey) !== -1 &&
  5266. context[camelize(res[key])]
  5267. ) {
  5268. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5269. res[key] = context[camelize(res[key])];
  5270. }
  5271. }
  5272. }
  5273. return res
  5274. }
  5275. function extractPropsFromVNodeData (
  5276. data,
  5277. Ctor,
  5278. tag,
  5279. context// fixed by xxxxxx
  5280. ) {
  5281. // we are only extracting raw values here.
  5282. // validation and default values are handled in the child
  5283. // component itself.
  5284. var propOptions = Ctor.options.props;
  5285. if (isUndef(propOptions)) {
  5286. // fixed by xxxxxx
  5287. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5288. }
  5289. var res = {};
  5290. var attrs = data.attrs;
  5291. var props = data.props;
  5292. if (isDef(attrs) || isDef(props)) {
  5293. for (var key in propOptions) {
  5294. var altKey = hyphenate(key);
  5295. if (true) {
  5296. var keyInLowerCase = key.toLowerCase();
  5297. if (
  5298. key !== keyInLowerCase &&
  5299. attrs && hasOwn(attrs, keyInLowerCase)
  5300. ) {
  5301. tip(
  5302. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5303. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5304. " \"" + key + "\". " +
  5305. "Note that HTML attributes are case-insensitive and camelCased " +
  5306. "props need to use their kebab-case equivalents when using in-DOM " +
  5307. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5308. );
  5309. }
  5310. }
  5311. checkProp(res, props, key, altKey, true) ||
  5312. checkProp(res, attrs, key, altKey, false);
  5313. }
  5314. }
  5315. // fixed by xxxxxx
  5316. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5317. }
  5318. function checkProp (
  5319. res,
  5320. hash,
  5321. key,
  5322. altKey,
  5323. preserve
  5324. ) {
  5325. if (isDef(hash)) {
  5326. if (hasOwn(hash, key)) {
  5327. res[key] = hash[key];
  5328. if (!preserve) {
  5329. delete hash[key];
  5330. }
  5331. return true
  5332. } else if (hasOwn(hash, altKey)) {
  5333. res[key] = hash[altKey];
  5334. if (!preserve) {
  5335. delete hash[altKey];
  5336. }
  5337. return true
  5338. }
  5339. }
  5340. return false
  5341. }
  5342. /* */
  5343. // The template compiler attempts to minimize the need for normalization by
  5344. // statically analyzing the template at compile time.
  5345. //
  5346. // For plain HTML markup, normalization can be completely skipped because the
  5347. // generated render function is guaranteed to return Array<VNode>. There are
  5348. // two cases where extra normalization is needed:
  5349. // 1. When the children contains components - because a functional component
  5350. // may return an Array instead of a single root. In this case, just a simple
  5351. // normalization is needed - if any child is an Array, we flatten the whole
  5352. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5353. // because functional components already normalize their own children.
  5354. function simpleNormalizeChildren (children) {
  5355. for (var i = 0; i < children.length; i++) {
  5356. if (Array.isArray(children[i])) {
  5357. return Array.prototype.concat.apply([], children)
  5358. }
  5359. }
  5360. return children
  5361. }
  5362. // 2. When the children contains constructs that always generated nested Arrays,
  5363. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5364. // with hand-written render functions / JSX. In such cases a full normalization
  5365. // is needed to cater to all possible types of children values.
  5366. function normalizeChildren (children) {
  5367. return isPrimitive(children)
  5368. ? [createTextVNode(children)]
  5369. : Array.isArray(children)
  5370. ? normalizeArrayChildren(children)
  5371. : undefined
  5372. }
  5373. function isTextNode (node) {
  5374. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5375. }
  5376. function normalizeArrayChildren (children, nestedIndex) {
  5377. var res = [];
  5378. var i, c, lastIndex, last;
  5379. for (i = 0; i < children.length; i++) {
  5380. c = children[i];
  5381. if (isUndef(c) || typeof c === 'boolean') { continue }
  5382. lastIndex = res.length - 1;
  5383. last = res[lastIndex];
  5384. // nested
  5385. if (Array.isArray(c)) {
  5386. if (c.length > 0) {
  5387. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5388. // merge adjacent text nodes
  5389. if (isTextNode(c[0]) && isTextNode(last)) {
  5390. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5391. c.shift();
  5392. }
  5393. res.push.apply(res, c);
  5394. }
  5395. } else if (isPrimitive(c)) {
  5396. if (isTextNode(last)) {
  5397. // merge adjacent text nodes
  5398. // this is necessary for SSR hydration because text nodes are
  5399. // essentially merged when rendered to HTML strings
  5400. res[lastIndex] = createTextVNode(last.text + c);
  5401. } else if (c !== '') {
  5402. // convert primitive to vnode
  5403. res.push(createTextVNode(c));
  5404. }
  5405. } else {
  5406. if (isTextNode(c) && isTextNode(last)) {
  5407. // merge adjacent text nodes
  5408. res[lastIndex] = createTextVNode(last.text + c.text);
  5409. } else {
  5410. // default key for nested array children (likely generated by v-for)
  5411. if (isTrue(children._isVList) &&
  5412. isDef(c.tag) &&
  5413. isUndef(c.key) &&
  5414. isDef(nestedIndex)) {
  5415. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5416. }
  5417. res.push(c);
  5418. }
  5419. }
  5420. }
  5421. return res
  5422. }
  5423. /* */
  5424. function initProvide (vm) {
  5425. var provide = vm.$options.provide;
  5426. if (provide) {
  5427. vm._provided = typeof provide === 'function'
  5428. ? provide.call(vm)
  5429. : provide;
  5430. }
  5431. }
  5432. function initInjections (vm) {
  5433. var result = resolveInject(vm.$options.inject, vm);
  5434. if (result) {
  5435. toggleObserving(false);
  5436. Object.keys(result).forEach(function (key) {
  5437. /* istanbul ignore else */
  5438. if (true) {
  5439. defineReactive$$1(vm, key, result[key], function () {
  5440. warn(
  5441. "Avoid mutating an injected value directly since the changes will be " +
  5442. "overwritten whenever the provided component re-renders. " +
  5443. "injection being mutated: \"" + key + "\"",
  5444. vm
  5445. );
  5446. });
  5447. } else {}
  5448. });
  5449. toggleObserving(true);
  5450. }
  5451. }
  5452. function resolveInject (inject, vm) {
  5453. if (inject) {
  5454. // inject is :any because flow is not smart enough to figure out cached
  5455. var result = Object.create(null);
  5456. var keys = hasSymbol
  5457. ? Reflect.ownKeys(inject)
  5458. : Object.keys(inject);
  5459. for (var i = 0; i < keys.length; i++) {
  5460. var key = keys[i];
  5461. // #6574 in case the inject object is observed...
  5462. if (key === '__ob__') { continue }
  5463. var provideKey = inject[key].from;
  5464. var source = vm;
  5465. while (source) {
  5466. if (source._provided && hasOwn(source._provided, provideKey)) {
  5467. result[key] = source._provided[provideKey];
  5468. break
  5469. }
  5470. source = source.$parent;
  5471. }
  5472. if (!source) {
  5473. if ('default' in inject[key]) {
  5474. var provideDefault = inject[key].default;
  5475. result[key] = typeof provideDefault === 'function'
  5476. ? provideDefault.call(vm)
  5477. : provideDefault;
  5478. } else if (true) {
  5479. warn(("Injection \"" + key + "\" not found"), vm);
  5480. }
  5481. }
  5482. }
  5483. return result
  5484. }
  5485. }
  5486. /* */
  5487. /**
  5488. * Runtime helper for resolving raw children VNodes into a slot object.
  5489. */
  5490. function resolveSlots (
  5491. children,
  5492. context
  5493. ) {
  5494. if (!children || !children.length) {
  5495. return {}
  5496. }
  5497. var slots = {};
  5498. for (var i = 0, l = children.length; i < l; i++) {
  5499. var child = children[i];
  5500. var data = child.data;
  5501. // remove slot attribute if the node is resolved as a Vue slot node
  5502. if (data && data.attrs && data.attrs.slot) {
  5503. delete data.attrs.slot;
  5504. }
  5505. // named slots should only be respected if the vnode was rendered in the
  5506. // same context.
  5507. if ((child.context === context || child.fnContext === context) &&
  5508. data && data.slot != null
  5509. ) {
  5510. var name = data.slot;
  5511. var slot = (slots[name] || (slots[name] = []));
  5512. if (child.tag === 'template') {
  5513. slot.push.apply(slot, child.children || []);
  5514. } else {
  5515. slot.push(child);
  5516. }
  5517. } else {
  5518. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5519. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5520. (slots['page'] || (slots['page'] = [])).push(child);
  5521. }else{
  5522. (slots.default || (slots.default = [])).push(child);
  5523. }
  5524. }
  5525. }
  5526. // ignore slots that contains only whitespace
  5527. for (var name$1 in slots) {
  5528. if (slots[name$1].every(isWhitespace)) {
  5529. delete slots[name$1];
  5530. }
  5531. }
  5532. return slots
  5533. }
  5534. function isWhitespace (node) {
  5535. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5536. }
  5537. /* */
  5538. function normalizeScopedSlots (
  5539. slots,
  5540. normalSlots,
  5541. prevSlots
  5542. ) {
  5543. var res;
  5544. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5545. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5546. var key = slots && slots.$key;
  5547. if (!slots) {
  5548. res = {};
  5549. } else if (slots._normalized) {
  5550. // fast path 1: child component re-render only, parent did not change
  5551. return slots._normalized
  5552. } else if (
  5553. isStable &&
  5554. prevSlots &&
  5555. prevSlots !== emptyObject &&
  5556. key === prevSlots.$key &&
  5557. !hasNormalSlots &&
  5558. !prevSlots.$hasNormal
  5559. ) {
  5560. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5561. // only need to normalize once
  5562. return prevSlots
  5563. } else {
  5564. res = {};
  5565. for (var key$1 in slots) {
  5566. if (slots[key$1] && key$1[0] !== '$') {
  5567. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5568. }
  5569. }
  5570. }
  5571. // expose normal slots on scopedSlots
  5572. for (var key$2 in normalSlots) {
  5573. if (!(key$2 in res)) {
  5574. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5575. }
  5576. }
  5577. // avoriaz seems to mock a non-extensible $scopedSlots object
  5578. // and when that is passed down this would cause an error
  5579. if (slots && Object.isExtensible(slots)) {
  5580. (slots)._normalized = res;
  5581. }
  5582. def(res, '$stable', isStable);
  5583. def(res, '$key', key);
  5584. def(res, '$hasNormal', hasNormalSlots);
  5585. return res
  5586. }
  5587. function normalizeScopedSlot(normalSlots, key, fn) {
  5588. var normalized = function () {
  5589. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5590. res = res && typeof res === 'object' && !Array.isArray(res)
  5591. ? [res] // single vnode
  5592. : normalizeChildren(res);
  5593. return res && (
  5594. res.length === 0 ||
  5595. (res.length === 1 && res[0].isComment) // #9658
  5596. ) ? undefined
  5597. : res
  5598. };
  5599. // this is a slot using the new v-slot syntax without scope. although it is
  5600. // compiled as a scoped slot, render fn users would expect it to be present
  5601. // on this.$slots because the usage is semantically a normal slot.
  5602. if (fn.proxy) {
  5603. Object.defineProperty(normalSlots, key, {
  5604. get: normalized,
  5605. enumerable: true,
  5606. configurable: true
  5607. });
  5608. }
  5609. return normalized
  5610. }
  5611. function proxyNormalSlot(slots, key) {
  5612. return function () { return slots[key]; }
  5613. }
  5614. /* */
  5615. /**
  5616. * Runtime helper for rendering v-for lists.
  5617. */
  5618. function renderList (
  5619. val,
  5620. render
  5621. ) {
  5622. var ret, i, l, keys, key;
  5623. if (Array.isArray(val) || typeof val === 'string') {
  5624. ret = new Array(val.length);
  5625. for (i = 0, l = val.length; i < l; i++) {
  5626. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5627. }
  5628. } else if (typeof val === 'number') {
  5629. ret = new Array(val);
  5630. for (i = 0; i < val; i++) {
  5631. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5632. }
  5633. } else if (isObject(val)) {
  5634. if (hasSymbol && val[Symbol.iterator]) {
  5635. ret = [];
  5636. var iterator = val[Symbol.iterator]();
  5637. var result = iterator.next();
  5638. while (!result.done) {
  5639. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5640. result = iterator.next();
  5641. }
  5642. } else {
  5643. keys = Object.keys(val);
  5644. ret = new Array(keys.length);
  5645. for (i = 0, l = keys.length; i < l; i++) {
  5646. key = keys[i];
  5647. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5648. }
  5649. }
  5650. }
  5651. if (!isDef(ret)) {
  5652. ret = [];
  5653. }
  5654. (ret)._isVList = true;
  5655. return ret
  5656. }
  5657. /* */
  5658. /**
  5659. * Runtime helper for rendering <slot>
  5660. */
  5661. function renderSlot (
  5662. name,
  5663. fallback,
  5664. props,
  5665. bindObject
  5666. ) {
  5667. var scopedSlotFn = this.$scopedSlots[name];
  5668. var nodes;
  5669. if (scopedSlotFn) { // scoped slot
  5670. props = props || {};
  5671. if (bindObject) {
  5672. if ( true && !isObject(bindObject)) {
  5673. warn(
  5674. 'slot v-bind without argument expects an Object',
  5675. this
  5676. );
  5677. }
  5678. props = extend(extend({}, bindObject), props);
  5679. }
  5680. // fixed by xxxxxx app-plus scopedSlot
  5681. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5682. } else {
  5683. nodes = this.$slots[name] || fallback;
  5684. }
  5685. var target = props && props.slot;
  5686. if (target) {
  5687. return this.$createElement('template', { slot: target }, nodes)
  5688. } else {
  5689. return nodes
  5690. }
  5691. }
  5692. /* */
  5693. /**
  5694. * Runtime helper for resolving filters
  5695. */
  5696. function resolveFilter (id) {
  5697. return resolveAsset(this.$options, 'filters', id, true) || identity
  5698. }
  5699. /* */
  5700. function isKeyNotMatch (expect, actual) {
  5701. if (Array.isArray(expect)) {
  5702. return expect.indexOf(actual) === -1
  5703. } else {
  5704. return expect !== actual
  5705. }
  5706. }
  5707. /**
  5708. * Runtime helper for checking keyCodes from config.
  5709. * exposed as Vue.prototype._k
  5710. * passing in eventKeyName as last argument separately for backwards compat
  5711. */
  5712. function checkKeyCodes (
  5713. eventKeyCode,
  5714. key,
  5715. builtInKeyCode,
  5716. eventKeyName,
  5717. builtInKeyName
  5718. ) {
  5719. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5720. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5721. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5722. } else if (mappedKeyCode) {
  5723. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5724. } else if (eventKeyName) {
  5725. return hyphenate(eventKeyName) !== key
  5726. }
  5727. }
  5728. /* */
  5729. /**
  5730. * Runtime helper for merging v-bind="object" into a VNode's data.
  5731. */
  5732. function bindObjectProps (
  5733. data,
  5734. tag,
  5735. value,
  5736. asProp,
  5737. isSync
  5738. ) {
  5739. if (value) {
  5740. if (!isObject(value)) {
  5741. true && warn(
  5742. 'v-bind without argument expects an Object or Array value',
  5743. this
  5744. );
  5745. } else {
  5746. if (Array.isArray(value)) {
  5747. value = toObject(value);
  5748. }
  5749. var hash;
  5750. var loop = function ( key ) {
  5751. if (
  5752. key === 'class' ||
  5753. key === 'style' ||
  5754. isReservedAttribute(key)
  5755. ) {
  5756. hash = data;
  5757. } else {
  5758. var type = data.attrs && data.attrs.type;
  5759. hash = asProp || config.mustUseProp(tag, type, key)
  5760. ? data.domProps || (data.domProps = {})
  5761. : data.attrs || (data.attrs = {});
  5762. }
  5763. var camelizedKey = camelize(key);
  5764. var hyphenatedKey = hyphenate(key);
  5765. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5766. hash[key] = value[key];
  5767. if (isSync) {
  5768. var on = data.on || (data.on = {});
  5769. on[("update:" + key)] = function ($event) {
  5770. value[key] = $event;
  5771. };
  5772. }
  5773. }
  5774. };
  5775. for (var key in value) loop( key );
  5776. }
  5777. }
  5778. return data
  5779. }
  5780. /* */
  5781. /**
  5782. * Runtime helper for rendering static trees.
  5783. */
  5784. function renderStatic (
  5785. index,
  5786. isInFor
  5787. ) {
  5788. var cached = this._staticTrees || (this._staticTrees = []);
  5789. var tree = cached[index];
  5790. // if has already-rendered static tree and not inside v-for,
  5791. // we can reuse the same tree.
  5792. if (tree && !isInFor) {
  5793. return tree
  5794. }
  5795. // otherwise, render a fresh tree.
  5796. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5797. this._renderProxy,
  5798. null,
  5799. this // for render fns generated for functional component templates
  5800. );
  5801. markStatic(tree, ("__static__" + index), false);
  5802. return tree
  5803. }
  5804. /**
  5805. * Runtime helper for v-once.
  5806. * Effectively it means marking the node as static with a unique key.
  5807. */
  5808. function markOnce (
  5809. tree,
  5810. index,
  5811. key
  5812. ) {
  5813. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5814. return tree
  5815. }
  5816. function markStatic (
  5817. tree,
  5818. key,
  5819. isOnce
  5820. ) {
  5821. if (Array.isArray(tree)) {
  5822. for (var i = 0; i < tree.length; i++) {
  5823. if (tree[i] && typeof tree[i] !== 'string') {
  5824. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5825. }
  5826. }
  5827. } else {
  5828. markStaticNode(tree, key, isOnce);
  5829. }
  5830. }
  5831. function markStaticNode (node, key, isOnce) {
  5832. node.isStatic = true;
  5833. node.key = key;
  5834. node.isOnce = isOnce;
  5835. }
  5836. /* */
  5837. function bindObjectListeners (data, value) {
  5838. if (value) {
  5839. if (!isPlainObject(value)) {
  5840. true && warn(
  5841. 'v-on without argument expects an Object value',
  5842. this
  5843. );
  5844. } else {
  5845. var on = data.on = data.on ? extend({}, data.on) : {};
  5846. for (var key in value) {
  5847. var existing = on[key];
  5848. var ours = value[key];
  5849. on[key] = existing ? [].concat(existing, ours) : ours;
  5850. }
  5851. }
  5852. }
  5853. return data
  5854. }
  5855. /* */
  5856. function resolveScopedSlots (
  5857. fns, // see flow/vnode
  5858. res,
  5859. // the following are added in 2.6
  5860. hasDynamicKeys,
  5861. contentHashKey
  5862. ) {
  5863. res = res || { $stable: !hasDynamicKeys };
  5864. for (var i = 0; i < fns.length; i++) {
  5865. var slot = fns[i];
  5866. if (Array.isArray(slot)) {
  5867. resolveScopedSlots(slot, res, hasDynamicKeys);
  5868. } else if (slot) {
  5869. // marker for reverse proxying v-slot without scope on this.$slots
  5870. if (slot.proxy) {
  5871. slot.fn.proxy = true;
  5872. }
  5873. res[slot.key] = slot.fn;
  5874. }
  5875. }
  5876. if (contentHashKey) {
  5877. (res).$key = contentHashKey;
  5878. }
  5879. return res
  5880. }
  5881. /* */
  5882. function bindDynamicKeys (baseObj, values) {
  5883. for (var i = 0; i < values.length; i += 2) {
  5884. var key = values[i];
  5885. if (typeof key === 'string' && key) {
  5886. baseObj[values[i]] = values[i + 1];
  5887. } else if ( true && key !== '' && key !== null) {
  5888. // null is a special value for explicitly removing a binding
  5889. warn(
  5890. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5891. this
  5892. );
  5893. }
  5894. }
  5895. return baseObj
  5896. }
  5897. // helper to dynamically append modifier runtime markers to event names.
  5898. // ensure only append when value is already string, otherwise it will be cast
  5899. // to string and cause the type check to miss.
  5900. function prependModifier (value, symbol) {
  5901. return typeof value === 'string' ? symbol + value : value
  5902. }
  5903. /* */
  5904. function installRenderHelpers (target) {
  5905. target._o = markOnce;
  5906. target._n = toNumber;
  5907. target._s = toString;
  5908. target._l = renderList;
  5909. target._t = renderSlot;
  5910. target._q = looseEqual;
  5911. target._i = looseIndexOf;
  5912. target._m = renderStatic;
  5913. target._f = resolveFilter;
  5914. target._k = checkKeyCodes;
  5915. target._b = bindObjectProps;
  5916. target._v = createTextVNode;
  5917. target._e = createEmptyVNode;
  5918. target._u = resolveScopedSlots;
  5919. target._g = bindObjectListeners;
  5920. target._d = bindDynamicKeys;
  5921. target._p = prependModifier;
  5922. }
  5923. /* */
  5924. function FunctionalRenderContext (
  5925. data,
  5926. props,
  5927. children,
  5928. parent,
  5929. Ctor
  5930. ) {
  5931. var this$1 = this;
  5932. var options = Ctor.options;
  5933. // ensure the createElement function in functional components
  5934. // gets a unique context - this is necessary for correct named slot check
  5935. var contextVm;
  5936. if (hasOwn(parent, '_uid')) {
  5937. contextVm = Object.create(parent);
  5938. // $flow-disable-line
  5939. contextVm._original = parent;
  5940. } else {
  5941. // the context vm passed in is a functional context as well.
  5942. // in this case we want to make sure we are able to get a hold to the
  5943. // real context instance.
  5944. contextVm = parent;
  5945. // $flow-disable-line
  5946. parent = parent._original;
  5947. }
  5948. var isCompiled = isTrue(options._compiled);
  5949. var needNormalization = !isCompiled;
  5950. this.data = data;
  5951. this.props = props;
  5952. this.children = children;
  5953. this.parent = parent;
  5954. this.listeners = data.on || emptyObject;
  5955. this.injections = resolveInject(options.inject, parent);
  5956. this.slots = function () {
  5957. if (!this$1.$slots) {
  5958. normalizeScopedSlots(
  5959. data.scopedSlots,
  5960. this$1.$slots = resolveSlots(children, parent)
  5961. );
  5962. }
  5963. return this$1.$slots
  5964. };
  5965. Object.defineProperty(this, 'scopedSlots', ({
  5966. enumerable: true,
  5967. get: function get () {
  5968. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5969. }
  5970. }));
  5971. // support for compiled functional template
  5972. if (isCompiled) {
  5973. // exposing $options for renderStatic()
  5974. this.$options = options;
  5975. // pre-resolve slots for renderSlot()
  5976. this.$slots = this.slots();
  5977. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5978. }
  5979. if (options._scopeId) {
  5980. this._c = function (a, b, c, d) {
  5981. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5982. if (vnode && !Array.isArray(vnode)) {
  5983. vnode.fnScopeId = options._scopeId;
  5984. vnode.fnContext = parent;
  5985. }
  5986. return vnode
  5987. };
  5988. } else {
  5989. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5990. }
  5991. }
  5992. installRenderHelpers(FunctionalRenderContext.prototype);
  5993. function createFunctionalComponent (
  5994. Ctor,
  5995. propsData,
  5996. data,
  5997. contextVm,
  5998. children
  5999. ) {
  6000. var options = Ctor.options;
  6001. var props = {};
  6002. var propOptions = options.props;
  6003. if (isDef(propOptions)) {
  6004. for (var key in propOptions) {
  6005. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6006. }
  6007. } else {
  6008. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6009. if (isDef(data.props)) { mergeProps(props, data.props); }
  6010. }
  6011. var renderContext = new FunctionalRenderContext(
  6012. data,
  6013. props,
  6014. children,
  6015. contextVm,
  6016. Ctor
  6017. );
  6018. var vnode = options.render.call(null, renderContext._c, renderContext);
  6019. if (vnode instanceof VNode) {
  6020. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6021. } else if (Array.isArray(vnode)) {
  6022. var vnodes = normalizeChildren(vnode) || [];
  6023. var res = new Array(vnodes.length);
  6024. for (var i = 0; i < vnodes.length; i++) {
  6025. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6026. }
  6027. return res
  6028. }
  6029. }
  6030. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6031. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6032. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6033. // that should not be matched to match.
  6034. var clone = cloneVNode(vnode);
  6035. clone.fnContext = contextVm;
  6036. clone.fnOptions = options;
  6037. if (true) {
  6038. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6039. }
  6040. if (data.slot) {
  6041. (clone.data || (clone.data = {})).slot = data.slot;
  6042. }
  6043. return clone
  6044. }
  6045. function mergeProps (to, from) {
  6046. for (var key in from) {
  6047. to[camelize(key)] = from[key];
  6048. }
  6049. }
  6050. /* */
  6051. /* */
  6052. /* */
  6053. /* */
  6054. // inline hooks to be invoked on component VNodes during patch
  6055. var componentVNodeHooks = {
  6056. init: function init (vnode, hydrating) {
  6057. if (
  6058. vnode.componentInstance &&
  6059. !vnode.componentInstance._isDestroyed &&
  6060. vnode.data.keepAlive
  6061. ) {
  6062. // kept-alive components, treat as a patch
  6063. var mountedNode = vnode; // work around flow
  6064. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6065. } else {
  6066. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6067. vnode,
  6068. activeInstance
  6069. );
  6070. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6071. }
  6072. },
  6073. prepatch: function prepatch (oldVnode, vnode) {
  6074. var options = vnode.componentOptions;
  6075. var child = vnode.componentInstance = oldVnode.componentInstance;
  6076. updateChildComponent(
  6077. child,
  6078. options.propsData, // updated props
  6079. options.listeners, // updated listeners
  6080. vnode, // new parent vnode
  6081. options.children // new children
  6082. );
  6083. },
  6084. insert: function insert (vnode) {
  6085. var context = vnode.context;
  6086. var componentInstance = vnode.componentInstance;
  6087. if (!componentInstance._isMounted) {
  6088. callHook(componentInstance, 'onServiceCreated');
  6089. callHook(componentInstance, 'onServiceAttached');
  6090. componentInstance._isMounted = true;
  6091. callHook(componentInstance, 'mounted');
  6092. }
  6093. if (vnode.data.keepAlive) {
  6094. if (context._isMounted) {
  6095. // vue-router#1212
  6096. // During updates, a kept-alive component's child components may
  6097. // change, so directly walking the tree here may call activated hooks
  6098. // on incorrect children. Instead we push them into a queue which will
  6099. // be processed after the whole patch process ended.
  6100. queueActivatedComponent(componentInstance);
  6101. } else {
  6102. activateChildComponent(componentInstance, true /* direct */);
  6103. }
  6104. }
  6105. },
  6106. destroy: function destroy (vnode) {
  6107. var componentInstance = vnode.componentInstance;
  6108. if (!componentInstance._isDestroyed) {
  6109. if (!vnode.data.keepAlive) {
  6110. componentInstance.$destroy();
  6111. } else {
  6112. deactivateChildComponent(componentInstance, true /* direct */);
  6113. }
  6114. }
  6115. }
  6116. };
  6117. var hooksToMerge = Object.keys(componentVNodeHooks);
  6118. function createComponent (
  6119. Ctor,
  6120. data,
  6121. context,
  6122. children,
  6123. tag
  6124. ) {
  6125. if (isUndef(Ctor)) {
  6126. return
  6127. }
  6128. var baseCtor = context.$options._base;
  6129. // plain options object: turn it into a constructor
  6130. if (isObject(Ctor)) {
  6131. Ctor = baseCtor.extend(Ctor);
  6132. }
  6133. // if at this stage it's not a constructor or an async component factory,
  6134. // reject.
  6135. if (typeof Ctor !== 'function') {
  6136. if (true) {
  6137. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6138. }
  6139. return
  6140. }
  6141. // async component
  6142. var asyncFactory;
  6143. if (isUndef(Ctor.cid)) {
  6144. asyncFactory = Ctor;
  6145. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6146. if (Ctor === undefined) {
  6147. // return a placeholder node for async component, which is rendered
  6148. // as a comment node but preserves all the raw information for the node.
  6149. // the information will be used for async server-rendering and hydration.
  6150. return createAsyncPlaceholder(
  6151. asyncFactory,
  6152. data,
  6153. context,
  6154. children,
  6155. tag
  6156. )
  6157. }
  6158. }
  6159. data = data || {};
  6160. // resolve constructor options in case global mixins are applied after
  6161. // component constructor creation
  6162. resolveConstructorOptions(Ctor);
  6163. // transform component v-model data into props & events
  6164. if (isDef(data.model)) {
  6165. transformModel(Ctor.options, data);
  6166. }
  6167. // extract props
  6168. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6169. // functional component
  6170. if (isTrue(Ctor.options.functional)) {
  6171. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6172. }
  6173. // extract listeners, since these needs to be treated as
  6174. // child component listeners instead of DOM listeners
  6175. var listeners = data.on;
  6176. // replace with listeners with .native modifier
  6177. // so it gets processed during parent component patch.
  6178. data.on = data.nativeOn;
  6179. if (isTrue(Ctor.options.abstract)) {
  6180. // abstract components do not keep anything
  6181. // other than props & listeners & slot
  6182. // work around flow
  6183. var slot = data.slot;
  6184. data = {};
  6185. if (slot) {
  6186. data.slot = slot;
  6187. }
  6188. }
  6189. // install component management hooks onto the placeholder node
  6190. installComponentHooks(data);
  6191. // return a placeholder vnode
  6192. var name = Ctor.options.name || tag;
  6193. var vnode = new VNode(
  6194. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6195. data, undefined, undefined, undefined, context,
  6196. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6197. asyncFactory
  6198. );
  6199. return vnode
  6200. }
  6201. function createComponentInstanceForVnode (
  6202. vnode, // we know it's MountedComponentVNode but flow doesn't
  6203. parent // activeInstance in lifecycle state
  6204. ) {
  6205. var options = {
  6206. _isComponent: true,
  6207. _parentVnode: vnode,
  6208. parent: parent
  6209. };
  6210. // check inline-template render functions
  6211. var inlineTemplate = vnode.data.inlineTemplate;
  6212. if (isDef(inlineTemplate)) {
  6213. options.render = inlineTemplate.render;
  6214. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6215. }
  6216. return new vnode.componentOptions.Ctor(options)
  6217. }
  6218. function installComponentHooks (data) {
  6219. var hooks = data.hook || (data.hook = {});
  6220. for (var i = 0; i < hooksToMerge.length; i++) {
  6221. var key = hooksToMerge[i];
  6222. var existing = hooks[key];
  6223. var toMerge = componentVNodeHooks[key];
  6224. if (existing !== toMerge && !(existing && existing._merged)) {
  6225. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6226. }
  6227. }
  6228. }
  6229. function mergeHook$1 (f1, f2) {
  6230. var merged = function (a, b) {
  6231. // flow complains about extra args which is why we use any
  6232. f1(a, b);
  6233. f2(a, b);
  6234. };
  6235. merged._merged = true;
  6236. return merged
  6237. }
  6238. // transform component v-model info (value and callback) into
  6239. // prop and event handler respectively.
  6240. function transformModel (options, data) {
  6241. var prop = (options.model && options.model.prop) || 'value';
  6242. var event = (options.model && options.model.event) || 'input'
  6243. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6244. var on = data.on || (data.on = {});
  6245. var existing = on[event];
  6246. var callback = data.model.callback;
  6247. if (isDef(existing)) {
  6248. if (
  6249. Array.isArray(existing)
  6250. ? existing.indexOf(callback) === -1
  6251. : existing !== callback
  6252. ) {
  6253. on[event] = [callback].concat(existing);
  6254. }
  6255. } else {
  6256. on[event] = callback;
  6257. }
  6258. }
  6259. /* */
  6260. var SIMPLE_NORMALIZE = 1;
  6261. var ALWAYS_NORMALIZE = 2;
  6262. // wrapper function for providing a more flexible interface
  6263. // without getting yelled at by flow
  6264. function createElement (
  6265. context,
  6266. tag,
  6267. data,
  6268. children,
  6269. normalizationType,
  6270. alwaysNormalize
  6271. ) {
  6272. if (Array.isArray(data) || isPrimitive(data)) {
  6273. normalizationType = children;
  6274. children = data;
  6275. data = undefined;
  6276. }
  6277. if (isTrue(alwaysNormalize)) {
  6278. normalizationType = ALWAYS_NORMALIZE;
  6279. }
  6280. return _createElement(context, tag, data, children, normalizationType)
  6281. }
  6282. function _createElement (
  6283. context,
  6284. tag,
  6285. data,
  6286. children,
  6287. normalizationType
  6288. ) {
  6289. if (isDef(data) && isDef((data).__ob__)) {
  6290. true && warn(
  6291. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6292. 'Always create fresh vnode data objects in each render!',
  6293. context
  6294. );
  6295. return createEmptyVNode()
  6296. }
  6297. // object syntax in v-bind
  6298. if (isDef(data) && isDef(data.is)) {
  6299. tag = data.is;
  6300. }
  6301. if (!tag) {
  6302. // in case of component :is set to falsy value
  6303. return createEmptyVNode()
  6304. }
  6305. // warn against non-primitive key
  6306. if ( true &&
  6307. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6308. ) {
  6309. {
  6310. warn(
  6311. 'Avoid using non-primitive value as key, ' +
  6312. 'use string/number value instead.',
  6313. context
  6314. );
  6315. }
  6316. }
  6317. // support single function children as default scoped slot
  6318. if (Array.isArray(children) &&
  6319. typeof children[0] === 'function'
  6320. ) {
  6321. data = data || {};
  6322. data.scopedSlots = { default: children[0] };
  6323. children.length = 0;
  6324. }
  6325. if (normalizationType === ALWAYS_NORMALIZE) {
  6326. children = normalizeChildren(children);
  6327. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6328. children = simpleNormalizeChildren(children);
  6329. }
  6330. var vnode, ns;
  6331. if (typeof tag === 'string') {
  6332. var Ctor;
  6333. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6334. if (config.isReservedTag(tag)) {
  6335. // platform built-in elements
  6336. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6337. warn(
  6338. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6339. context
  6340. );
  6341. }
  6342. vnode = new VNode(
  6343. config.parsePlatformTagName(tag), data, children,
  6344. undefined, undefined, context
  6345. );
  6346. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6347. // component
  6348. vnode = createComponent(Ctor, data, context, children, tag);
  6349. } else {
  6350. // unknown or unlisted namespaced elements
  6351. // check at runtime because it may get assigned a namespace when its
  6352. // parent normalizes children
  6353. vnode = new VNode(
  6354. tag, data, children,
  6355. undefined, undefined, context
  6356. );
  6357. }
  6358. } else {
  6359. // direct component options / constructor
  6360. vnode = createComponent(tag, data, context, children);
  6361. }
  6362. if (Array.isArray(vnode)) {
  6363. return vnode
  6364. } else if (isDef(vnode)) {
  6365. if (isDef(ns)) { applyNS(vnode, ns); }
  6366. if (isDef(data)) { registerDeepBindings(data); }
  6367. return vnode
  6368. } else {
  6369. return createEmptyVNode()
  6370. }
  6371. }
  6372. function applyNS (vnode, ns, force) {
  6373. vnode.ns = ns;
  6374. if (vnode.tag === 'foreignObject') {
  6375. // use default namespace inside foreignObject
  6376. ns = undefined;
  6377. force = true;
  6378. }
  6379. if (isDef(vnode.children)) {
  6380. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6381. var child = vnode.children[i];
  6382. if (isDef(child.tag) && (
  6383. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6384. applyNS(child, ns, force);
  6385. }
  6386. }
  6387. }
  6388. }
  6389. // ref #5318
  6390. // necessary to ensure parent re-render when deep bindings like :style and
  6391. // :class are used on slot nodes
  6392. function registerDeepBindings (data) {
  6393. if (isObject(data.style)) {
  6394. traverse(data.style);
  6395. }
  6396. if (isObject(data.class)) {
  6397. traverse(data.class);
  6398. }
  6399. }
  6400. /* */
  6401. function initRender (vm) {
  6402. vm._vnode = null; // the root of the child tree
  6403. vm._staticTrees = null; // v-once cached trees
  6404. var options = vm.$options;
  6405. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6406. var renderContext = parentVnode && parentVnode.context;
  6407. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6408. vm.$scopedSlots = emptyObject;
  6409. // bind the createElement fn to this instance
  6410. // so that we get proper render context inside it.
  6411. // args order: tag, data, children, normalizationType, alwaysNormalize
  6412. // internal version is used by render functions compiled from templates
  6413. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6414. // normalization is always applied for the public version, used in
  6415. // user-written render functions.
  6416. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6417. // $attrs & $listeners are exposed for easier HOC creation.
  6418. // they need to be reactive so that HOCs using them are always updated
  6419. var parentData = parentVnode && parentVnode.data;
  6420. /* istanbul ignore else */
  6421. if (true) {
  6422. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6423. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6424. }, true);
  6425. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6426. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6427. }, true);
  6428. } else {}
  6429. }
  6430. var currentRenderingInstance = null;
  6431. function renderMixin (Vue) {
  6432. // install runtime convenience helpers
  6433. installRenderHelpers(Vue.prototype);
  6434. Vue.prototype.$nextTick = function (fn) {
  6435. return nextTick(fn, this)
  6436. };
  6437. Vue.prototype._render = function () {
  6438. var vm = this;
  6439. var ref = vm.$options;
  6440. var render = ref.render;
  6441. var _parentVnode = ref._parentVnode;
  6442. if (_parentVnode) {
  6443. vm.$scopedSlots = normalizeScopedSlots(
  6444. _parentVnode.data.scopedSlots,
  6445. vm.$slots,
  6446. vm.$scopedSlots
  6447. );
  6448. }
  6449. // set parent vnode. this allows render functions to have access
  6450. // to the data on the placeholder node.
  6451. vm.$vnode = _parentVnode;
  6452. // render self
  6453. var vnode;
  6454. try {
  6455. // There's no need to maintain a stack because all render fns are called
  6456. // separately from one another. Nested component's render fns are called
  6457. // when parent component is patched.
  6458. currentRenderingInstance = vm;
  6459. vnode = render.call(vm._renderProxy, vm.$createElement);
  6460. } catch (e) {
  6461. handleError(e, vm, "render");
  6462. // return error render result,
  6463. // or previous vnode to prevent render error causing blank component
  6464. /* istanbul ignore else */
  6465. if ( true && vm.$options.renderError) {
  6466. try {
  6467. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6468. } catch (e) {
  6469. handleError(e, vm, "renderError");
  6470. vnode = vm._vnode;
  6471. }
  6472. } else {
  6473. vnode = vm._vnode;
  6474. }
  6475. } finally {
  6476. currentRenderingInstance = null;
  6477. }
  6478. // if the returned array contains only a single node, allow it
  6479. if (Array.isArray(vnode) && vnode.length === 1) {
  6480. vnode = vnode[0];
  6481. }
  6482. // return empty vnode in case the render function errored out
  6483. if (!(vnode instanceof VNode)) {
  6484. if ( true && Array.isArray(vnode)) {
  6485. warn(
  6486. 'Multiple root nodes returned from render function. Render function ' +
  6487. 'should return a single root node.',
  6488. vm
  6489. );
  6490. }
  6491. vnode = createEmptyVNode();
  6492. }
  6493. // set parent
  6494. vnode.parent = _parentVnode;
  6495. return vnode
  6496. };
  6497. }
  6498. /* */
  6499. function ensureCtor (comp, base) {
  6500. if (
  6501. comp.__esModule ||
  6502. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6503. ) {
  6504. comp = comp.default;
  6505. }
  6506. return isObject(comp)
  6507. ? base.extend(comp)
  6508. : comp
  6509. }
  6510. function createAsyncPlaceholder (
  6511. factory,
  6512. data,
  6513. context,
  6514. children,
  6515. tag
  6516. ) {
  6517. var node = createEmptyVNode();
  6518. node.asyncFactory = factory;
  6519. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6520. return node
  6521. }
  6522. function resolveAsyncComponent (
  6523. factory,
  6524. baseCtor
  6525. ) {
  6526. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6527. return factory.errorComp
  6528. }
  6529. if (isDef(factory.resolved)) {
  6530. return factory.resolved
  6531. }
  6532. var owner = currentRenderingInstance;
  6533. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6534. // already pending
  6535. factory.owners.push(owner);
  6536. }
  6537. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6538. return factory.loadingComp
  6539. }
  6540. if (owner && !isDef(factory.owners)) {
  6541. var owners = factory.owners = [owner];
  6542. var sync = true;
  6543. var timerLoading = null;
  6544. var timerTimeout = null
  6545. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6546. var forceRender = function (renderCompleted) {
  6547. for (var i = 0, l = owners.length; i < l; i++) {
  6548. (owners[i]).$forceUpdate();
  6549. }
  6550. if (renderCompleted) {
  6551. owners.length = 0;
  6552. if (timerLoading !== null) {
  6553. clearTimeout(timerLoading);
  6554. timerLoading = null;
  6555. }
  6556. if (timerTimeout !== null) {
  6557. clearTimeout(timerTimeout);
  6558. timerTimeout = null;
  6559. }
  6560. }
  6561. };
  6562. var resolve = once(function (res) {
  6563. // cache resolved
  6564. factory.resolved = ensureCtor(res, baseCtor);
  6565. // invoke callbacks only if this is not a synchronous resolve
  6566. // (async resolves are shimmed as synchronous during SSR)
  6567. if (!sync) {
  6568. forceRender(true);
  6569. } else {
  6570. owners.length = 0;
  6571. }
  6572. });
  6573. var reject = once(function (reason) {
  6574. true && warn(
  6575. "Failed to resolve async component: " + (String(factory)) +
  6576. (reason ? ("\nReason: " + reason) : '')
  6577. );
  6578. if (isDef(factory.errorComp)) {
  6579. factory.error = true;
  6580. forceRender(true);
  6581. }
  6582. });
  6583. var res = factory(resolve, reject);
  6584. if (isObject(res)) {
  6585. if (isPromise(res)) {
  6586. // () => Promise
  6587. if (isUndef(factory.resolved)) {
  6588. res.then(resolve, reject);
  6589. }
  6590. } else if (isPromise(res.component)) {
  6591. res.component.then(resolve, reject);
  6592. if (isDef(res.error)) {
  6593. factory.errorComp = ensureCtor(res.error, baseCtor);
  6594. }
  6595. if (isDef(res.loading)) {
  6596. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6597. if (res.delay === 0) {
  6598. factory.loading = true;
  6599. } else {
  6600. timerLoading = setTimeout(function () {
  6601. timerLoading = null;
  6602. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6603. factory.loading = true;
  6604. forceRender(false);
  6605. }
  6606. }, res.delay || 200);
  6607. }
  6608. }
  6609. if (isDef(res.timeout)) {
  6610. timerTimeout = setTimeout(function () {
  6611. timerTimeout = null;
  6612. if (isUndef(factory.resolved)) {
  6613. reject(
  6614. true
  6615. ? ("timeout (" + (res.timeout) + "ms)")
  6616. : undefined
  6617. );
  6618. }
  6619. }, res.timeout);
  6620. }
  6621. }
  6622. }
  6623. sync = false;
  6624. // return in case resolved synchronously
  6625. return factory.loading
  6626. ? factory.loadingComp
  6627. : factory.resolved
  6628. }
  6629. }
  6630. /* */
  6631. function isAsyncPlaceholder (node) {
  6632. return node.isComment && node.asyncFactory
  6633. }
  6634. /* */
  6635. function getFirstComponentChild (children) {
  6636. if (Array.isArray(children)) {
  6637. for (var i = 0; i < children.length; i++) {
  6638. var c = children[i];
  6639. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6640. return c
  6641. }
  6642. }
  6643. }
  6644. }
  6645. /* */
  6646. /* */
  6647. function initEvents (vm) {
  6648. vm._events = Object.create(null);
  6649. vm._hasHookEvent = false;
  6650. // init parent attached events
  6651. var listeners = vm.$options._parentListeners;
  6652. if (listeners) {
  6653. updateComponentListeners(vm, listeners);
  6654. }
  6655. }
  6656. var target;
  6657. function add (event, fn) {
  6658. target.$on(event, fn);
  6659. }
  6660. function remove$1 (event, fn) {
  6661. target.$off(event, fn);
  6662. }
  6663. function createOnceHandler (event, fn) {
  6664. var _target = target;
  6665. return function onceHandler () {
  6666. var res = fn.apply(null, arguments);
  6667. if (res !== null) {
  6668. _target.$off(event, onceHandler);
  6669. }
  6670. }
  6671. }
  6672. function updateComponentListeners (
  6673. vm,
  6674. listeners,
  6675. oldListeners
  6676. ) {
  6677. target = vm;
  6678. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6679. target = undefined;
  6680. }
  6681. function eventsMixin (Vue) {
  6682. var hookRE = /^hook:/;
  6683. Vue.prototype.$on = function (event, fn) {
  6684. var vm = this;
  6685. if (Array.isArray(event)) {
  6686. for (var i = 0, l = event.length; i < l; i++) {
  6687. vm.$on(event[i], fn);
  6688. }
  6689. } else {
  6690. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6691. // optimize hook:event cost by using a boolean flag marked at registration
  6692. // instead of a hash lookup
  6693. if (hookRE.test(event)) {
  6694. vm._hasHookEvent = true;
  6695. }
  6696. }
  6697. return vm
  6698. };
  6699. Vue.prototype.$once = function (event, fn) {
  6700. var vm = this;
  6701. function on () {
  6702. vm.$off(event, on);
  6703. fn.apply(vm, arguments);
  6704. }
  6705. on.fn = fn;
  6706. vm.$on(event, on);
  6707. return vm
  6708. };
  6709. Vue.prototype.$off = function (event, fn) {
  6710. var vm = this;
  6711. // all
  6712. if (!arguments.length) {
  6713. vm._events = Object.create(null);
  6714. return vm
  6715. }
  6716. // array of events
  6717. if (Array.isArray(event)) {
  6718. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6719. vm.$off(event[i$1], fn);
  6720. }
  6721. return vm
  6722. }
  6723. // specific event
  6724. var cbs = vm._events[event];
  6725. if (!cbs) {
  6726. return vm
  6727. }
  6728. if (!fn) {
  6729. vm._events[event] = null;
  6730. return vm
  6731. }
  6732. // specific handler
  6733. var cb;
  6734. var i = cbs.length;
  6735. while (i--) {
  6736. cb = cbs[i];
  6737. if (cb === fn || cb.fn === fn) {
  6738. cbs.splice(i, 1);
  6739. break
  6740. }
  6741. }
  6742. return vm
  6743. };
  6744. Vue.prototype.$emit = function (event) {
  6745. var vm = this;
  6746. if (true) {
  6747. var lowerCaseEvent = event.toLowerCase();
  6748. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6749. tip(
  6750. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6751. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6752. "Note that HTML attributes are case-insensitive and you cannot use " +
  6753. "v-on to listen to camelCase events when using in-DOM templates. " +
  6754. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6755. );
  6756. }
  6757. }
  6758. var cbs = vm._events[event];
  6759. if (cbs) {
  6760. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6761. var args = toArray(arguments, 1);
  6762. var info = "event handler for \"" + event + "\"";
  6763. for (var i = 0, l = cbs.length; i < l; i++) {
  6764. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6765. }
  6766. }
  6767. return vm
  6768. };
  6769. }
  6770. /* */
  6771. var activeInstance = null;
  6772. var isUpdatingChildComponent = false;
  6773. function setActiveInstance(vm) {
  6774. var prevActiveInstance = activeInstance;
  6775. activeInstance = vm;
  6776. return function () {
  6777. activeInstance = prevActiveInstance;
  6778. }
  6779. }
  6780. function initLifecycle (vm) {
  6781. var options = vm.$options;
  6782. // locate first non-abstract parent
  6783. var parent = options.parent;
  6784. if (parent && !options.abstract) {
  6785. while (parent.$options.abstract && parent.$parent) {
  6786. parent = parent.$parent;
  6787. }
  6788. parent.$children.push(vm);
  6789. }
  6790. vm.$parent = parent;
  6791. vm.$root = parent ? parent.$root : vm;
  6792. vm.$children = [];
  6793. vm.$refs = {};
  6794. vm._watcher = null;
  6795. vm._inactive = null;
  6796. vm._directInactive = false;
  6797. vm._isMounted = false;
  6798. vm._isDestroyed = false;
  6799. vm._isBeingDestroyed = false;
  6800. }
  6801. function lifecycleMixin (Vue) {
  6802. Vue.prototype._update = function (vnode, hydrating) {
  6803. var vm = this;
  6804. var prevEl = vm.$el;
  6805. var prevVnode = vm._vnode;
  6806. var restoreActiveInstance = setActiveInstance(vm);
  6807. vm._vnode = vnode;
  6808. // Vue.prototype.__patch__ is injected in entry points
  6809. // based on the rendering backend used.
  6810. if (!prevVnode) {
  6811. // initial render
  6812. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6813. } else {
  6814. // updates
  6815. vm.$el = vm.__patch__(prevVnode, vnode);
  6816. }
  6817. restoreActiveInstance();
  6818. // update __vue__ reference
  6819. if (prevEl) {
  6820. prevEl.__vue__ = null;
  6821. }
  6822. if (vm.$el) {
  6823. vm.$el.__vue__ = vm;
  6824. }
  6825. // if parent is an HOC, update its $el as well
  6826. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6827. vm.$parent.$el = vm.$el;
  6828. }
  6829. // updated hook is called by the scheduler to ensure that children are
  6830. // updated in a parent's updated hook.
  6831. };
  6832. Vue.prototype.$forceUpdate = function () {
  6833. var vm = this;
  6834. if (vm._watcher) {
  6835. vm._watcher.update();
  6836. }
  6837. };
  6838. Vue.prototype.$destroy = function () {
  6839. var vm = this;
  6840. if (vm._isBeingDestroyed) {
  6841. return
  6842. }
  6843. callHook(vm, 'beforeDestroy');
  6844. vm._isBeingDestroyed = true;
  6845. // remove self from parent
  6846. var parent = vm.$parent;
  6847. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6848. remove(parent.$children, vm);
  6849. }
  6850. // teardown watchers
  6851. if (vm._watcher) {
  6852. vm._watcher.teardown();
  6853. }
  6854. var i = vm._watchers.length;
  6855. while (i--) {
  6856. vm._watchers[i].teardown();
  6857. }
  6858. // remove reference from data ob
  6859. // frozen object may not have observer.
  6860. if (vm._data.__ob__) {
  6861. vm._data.__ob__.vmCount--;
  6862. }
  6863. // call the last hook...
  6864. vm._isDestroyed = true;
  6865. // invoke destroy hooks on current rendered tree
  6866. vm.__patch__(vm._vnode, null);
  6867. // fire destroyed hook
  6868. callHook(vm, 'destroyed');
  6869. // turn off all instance listeners.
  6870. vm.$off();
  6871. // remove __vue__ reference
  6872. if (vm.$el) {
  6873. vm.$el.__vue__ = null;
  6874. }
  6875. // release circular reference (#6759)
  6876. if (vm.$vnode) {
  6877. vm.$vnode.parent = null;
  6878. }
  6879. };
  6880. }
  6881. function updateChildComponent (
  6882. vm,
  6883. propsData,
  6884. listeners,
  6885. parentVnode,
  6886. renderChildren
  6887. ) {
  6888. if (true) {
  6889. isUpdatingChildComponent = true;
  6890. }
  6891. // determine whether component has slot children
  6892. // we need to do this before overwriting $options._renderChildren.
  6893. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6894. // dynamic slot names). Static scoped slots compiled from template has the
  6895. // "$stable" marker.
  6896. var newScopedSlots = parentVnode.data.scopedSlots;
  6897. var oldScopedSlots = vm.$scopedSlots;
  6898. var hasDynamicScopedSlot = !!(
  6899. (newScopedSlots && !newScopedSlots.$stable) ||
  6900. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6901. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6902. );
  6903. // Any static slot children from the parent may have changed during parent's
  6904. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6905. // update is necessary to ensure correctness.
  6906. var needsForceUpdate = !!(
  6907. renderChildren || // has new static slots
  6908. vm.$options._renderChildren || // has old static slots
  6909. hasDynamicScopedSlot
  6910. );
  6911. vm.$options._parentVnode = parentVnode;
  6912. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6913. if (vm._vnode) { // update child tree's parent
  6914. vm._vnode.parent = parentVnode;
  6915. }
  6916. vm.$options._renderChildren = renderChildren;
  6917. // update $attrs and $listeners hash
  6918. // these are also reactive so they may trigger child update if the child
  6919. // used them during render
  6920. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6921. vm.$listeners = listeners || emptyObject;
  6922. // update props
  6923. if (propsData && vm.$options.props) {
  6924. toggleObserving(false);
  6925. var props = vm._props;
  6926. var propKeys = vm.$options._propKeys || [];
  6927. for (var i = 0; i < propKeys.length; i++) {
  6928. var key = propKeys[i];
  6929. var propOptions = vm.$options.props; // wtf flow?
  6930. props[key] = validateProp(key, propOptions, propsData, vm);
  6931. }
  6932. toggleObserving(true);
  6933. // keep a copy of raw propsData
  6934. vm.$options.propsData = propsData;
  6935. }
  6936. // fixed by xxxxxx update properties(mp runtime)
  6937. vm._$updateProperties && vm._$updateProperties(vm);
  6938. // update listeners
  6939. listeners = listeners || emptyObject;
  6940. var oldListeners = vm.$options._parentListeners;
  6941. vm.$options._parentListeners = listeners;
  6942. updateComponentListeners(vm, listeners, oldListeners);
  6943. // resolve slots + force update if has children
  6944. if (needsForceUpdate) {
  6945. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6946. vm.$forceUpdate();
  6947. }
  6948. if (true) {
  6949. isUpdatingChildComponent = false;
  6950. }
  6951. }
  6952. function isInInactiveTree (vm) {
  6953. while (vm && (vm = vm.$parent)) {
  6954. if (vm._inactive) { return true }
  6955. }
  6956. return false
  6957. }
  6958. function activateChildComponent (vm, direct) {
  6959. if (direct) {
  6960. vm._directInactive = false;
  6961. if (isInInactiveTree(vm)) {
  6962. return
  6963. }
  6964. } else if (vm._directInactive) {
  6965. return
  6966. }
  6967. if (vm._inactive || vm._inactive === null) {
  6968. vm._inactive = false;
  6969. for (var i = 0; i < vm.$children.length; i++) {
  6970. activateChildComponent(vm.$children[i]);
  6971. }
  6972. callHook(vm, 'activated');
  6973. }
  6974. }
  6975. function deactivateChildComponent (vm, direct) {
  6976. if (direct) {
  6977. vm._directInactive = true;
  6978. if (isInInactiveTree(vm)) {
  6979. return
  6980. }
  6981. }
  6982. if (!vm._inactive) {
  6983. vm._inactive = true;
  6984. for (var i = 0; i < vm.$children.length; i++) {
  6985. deactivateChildComponent(vm.$children[i]);
  6986. }
  6987. callHook(vm, 'deactivated');
  6988. }
  6989. }
  6990. function callHook (vm, hook) {
  6991. // #7573 disable dep collection when invoking lifecycle hooks
  6992. pushTarget();
  6993. var handlers = vm.$options[hook];
  6994. var info = hook + " hook";
  6995. if (handlers) {
  6996. for (var i = 0, j = handlers.length; i < j; i++) {
  6997. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6998. }
  6999. }
  7000. if (vm._hasHookEvent) {
  7001. vm.$emit('hook:' + hook);
  7002. }
  7003. popTarget();
  7004. }
  7005. /* */
  7006. var MAX_UPDATE_COUNT = 100;
  7007. var queue = [];
  7008. var activatedChildren = [];
  7009. var has = {};
  7010. var circular = {};
  7011. var waiting = false;
  7012. var flushing = false;
  7013. var index = 0;
  7014. /**
  7015. * Reset the scheduler's state.
  7016. */
  7017. function resetSchedulerState () {
  7018. index = queue.length = activatedChildren.length = 0;
  7019. has = {};
  7020. if (true) {
  7021. circular = {};
  7022. }
  7023. waiting = flushing = false;
  7024. }
  7025. // Async edge case #6566 requires saving the timestamp when event listeners are
  7026. // attached. However, calling performance.now() has a perf overhead especially
  7027. // if the page has thousands of event listeners. Instead, we take a timestamp
  7028. // every time the scheduler flushes and use that for all event listeners
  7029. // attached during that flush.
  7030. var currentFlushTimestamp = 0;
  7031. // Async edge case fix requires storing an event listener's attach timestamp.
  7032. var getNow = Date.now;
  7033. // Determine what event timestamp the browser is using. Annoyingly, the
  7034. // timestamp can either be hi-res (relative to page load) or low-res
  7035. // (relative to UNIX epoch), so in order to compare time we have to use the
  7036. // same timestamp type when saving the flush timestamp.
  7037. // All IE versions use low-res event timestamps, and have problematic clock
  7038. // implementations (#9632)
  7039. if (inBrowser && !isIE) {
  7040. var performance = window.performance;
  7041. if (
  7042. performance &&
  7043. typeof performance.now === 'function' &&
  7044. getNow() > document.createEvent('Event').timeStamp
  7045. ) {
  7046. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7047. // smaller than it, it means the event is using a hi-res timestamp,
  7048. // and we need to use the hi-res version for event listener timestamps as
  7049. // well.
  7050. getNow = function () { return performance.now(); };
  7051. }
  7052. }
  7053. /**
  7054. * Flush both queues and run the watchers.
  7055. */
  7056. function flushSchedulerQueue () {
  7057. currentFlushTimestamp = getNow();
  7058. flushing = true;
  7059. var watcher, id;
  7060. // Sort queue before flush.
  7061. // This ensures that:
  7062. // 1. Components are updated from parent to child. (because parent is always
  7063. // created before the child)
  7064. // 2. A component's user watchers are run before its render watcher (because
  7065. // user watchers are created before the render watcher)
  7066. // 3. If a component is destroyed during a parent component's watcher run,
  7067. // its watchers can be skipped.
  7068. queue.sort(function (a, b) { return a.id - b.id; });
  7069. // do not cache length because more watchers might be pushed
  7070. // as we run existing watchers
  7071. for (index = 0; index < queue.length; index++) {
  7072. watcher = queue[index];
  7073. if (watcher.before) {
  7074. watcher.before();
  7075. }
  7076. id = watcher.id;
  7077. has[id] = null;
  7078. watcher.run();
  7079. // in dev build, check and stop circular updates.
  7080. if ( true && has[id] != null) {
  7081. circular[id] = (circular[id] || 0) + 1;
  7082. if (circular[id] > MAX_UPDATE_COUNT) {
  7083. warn(
  7084. 'You may have an infinite update loop ' + (
  7085. watcher.user
  7086. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7087. : "in a component render function."
  7088. ),
  7089. watcher.vm
  7090. );
  7091. break
  7092. }
  7093. }
  7094. }
  7095. // keep copies of post queues before resetting state
  7096. var activatedQueue = activatedChildren.slice();
  7097. var updatedQueue = queue.slice();
  7098. resetSchedulerState();
  7099. // call component updated and activated hooks
  7100. callActivatedHooks(activatedQueue);
  7101. callUpdatedHooks(updatedQueue);
  7102. // devtool hook
  7103. /* istanbul ignore if */
  7104. if (devtools && config.devtools) {
  7105. devtools.emit('flush');
  7106. }
  7107. }
  7108. function callUpdatedHooks (queue) {
  7109. var i = queue.length;
  7110. while (i--) {
  7111. var watcher = queue[i];
  7112. var vm = watcher.vm;
  7113. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7114. callHook(vm, 'updated');
  7115. }
  7116. }
  7117. }
  7118. /**
  7119. * Queue a kept-alive component that was activated during patch.
  7120. * The queue will be processed after the entire tree has been patched.
  7121. */
  7122. function queueActivatedComponent (vm) {
  7123. // setting _inactive to false here so that a render function can
  7124. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7125. vm._inactive = false;
  7126. activatedChildren.push(vm);
  7127. }
  7128. function callActivatedHooks (queue) {
  7129. for (var i = 0; i < queue.length; i++) {
  7130. queue[i]._inactive = true;
  7131. activateChildComponent(queue[i], true /* true */);
  7132. }
  7133. }
  7134. /**
  7135. * Push a watcher into the watcher queue.
  7136. * Jobs with duplicate IDs will be skipped unless it's
  7137. * pushed when the queue is being flushed.
  7138. */
  7139. function queueWatcher (watcher) {
  7140. var id = watcher.id;
  7141. if (has[id] == null) {
  7142. has[id] = true;
  7143. if (!flushing) {
  7144. queue.push(watcher);
  7145. } else {
  7146. // if already flushing, splice the watcher based on its id
  7147. // if already past its id, it will be run next immediately.
  7148. var i = queue.length - 1;
  7149. while (i > index && queue[i].id > watcher.id) {
  7150. i--;
  7151. }
  7152. queue.splice(i + 1, 0, watcher);
  7153. }
  7154. // queue the flush
  7155. if (!waiting) {
  7156. waiting = true;
  7157. if ( true && !config.async) {
  7158. flushSchedulerQueue();
  7159. return
  7160. }
  7161. nextTick(flushSchedulerQueue);
  7162. }
  7163. }
  7164. }
  7165. /* */
  7166. var uid$2 = 0;
  7167. /**
  7168. * A watcher parses an expression, collects dependencies,
  7169. * and fires callback when the expression value changes.
  7170. * This is used for both the $watch() api and directives.
  7171. */
  7172. var Watcher = function Watcher (
  7173. vm,
  7174. expOrFn,
  7175. cb,
  7176. options,
  7177. isRenderWatcher
  7178. ) {
  7179. this.vm = vm;
  7180. if (isRenderWatcher) {
  7181. vm._watcher = this;
  7182. }
  7183. vm._watchers.push(this);
  7184. // options
  7185. if (options) {
  7186. this.deep = !!options.deep;
  7187. this.user = !!options.user;
  7188. this.lazy = !!options.lazy;
  7189. this.sync = !!options.sync;
  7190. this.before = options.before;
  7191. } else {
  7192. this.deep = this.user = this.lazy = this.sync = false;
  7193. }
  7194. this.cb = cb;
  7195. this.id = ++uid$2; // uid for batching
  7196. this.active = true;
  7197. this.dirty = this.lazy; // for lazy watchers
  7198. this.deps = [];
  7199. this.newDeps = [];
  7200. this.depIds = new _Set();
  7201. this.newDepIds = new _Set();
  7202. this.expression = true
  7203. ? expOrFn.toString()
  7204. : undefined;
  7205. // parse expression for getter
  7206. if (typeof expOrFn === 'function') {
  7207. this.getter = expOrFn;
  7208. } else {
  7209. this.getter = parsePath(expOrFn);
  7210. if (!this.getter) {
  7211. this.getter = noop;
  7212. true && warn(
  7213. "Failed watching path: \"" + expOrFn + "\" " +
  7214. 'Watcher only accepts simple dot-delimited paths. ' +
  7215. 'For full control, use a function instead.',
  7216. vm
  7217. );
  7218. }
  7219. }
  7220. this.value = this.lazy
  7221. ? undefined
  7222. : this.get();
  7223. };
  7224. /**
  7225. * Evaluate the getter, and re-collect dependencies.
  7226. */
  7227. Watcher.prototype.get = function get () {
  7228. pushTarget(this);
  7229. var value;
  7230. var vm = this.vm;
  7231. try {
  7232. value = this.getter.call(vm, vm);
  7233. } catch (e) {
  7234. if (this.user) {
  7235. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7236. } else {
  7237. throw e
  7238. }
  7239. } finally {
  7240. // "touch" every property so they are all tracked as
  7241. // dependencies for deep watching
  7242. if (this.deep) {
  7243. traverse(value);
  7244. }
  7245. popTarget();
  7246. this.cleanupDeps();
  7247. }
  7248. return value
  7249. };
  7250. /**
  7251. * Add a dependency to this directive.
  7252. */
  7253. Watcher.prototype.addDep = function addDep (dep) {
  7254. var id = dep.id;
  7255. if (!this.newDepIds.has(id)) {
  7256. this.newDepIds.add(id);
  7257. this.newDeps.push(dep);
  7258. if (!this.depIds.has(id)) {
  7259. dep.addSub(this);
  7260. }
  7261. }
  7262. };
  7263. /**
  7264. * Clean up for dependency collection.
  7265. */
  7266. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7267. var i = this.deps.length;
  7268. while (i--) {
  7269. var dep = this.deps[i];
  7270. if (!this.newDepIds.has(dep.id)) {
  7271. dep.removeSub(this);
  7272. }
  7273. }
  7274. var tmp = this.depIds;
  7275. this.depIds = this.newDepIds;
  7276. this.newDepIds = tmp;
  7277. this.newDepIds.clear();
  7278. tmp = this.deps;
  7279. this.deps = this.newDeps;
  7280. this.newDeps = tmp;
  7281. this.newDeps.length = 0;
  7282. };
  7283. /**
  7284. * Subscriber interface.
  7285. * Will be called when a dependency changes.
  7286. */
  7287. Watcher.prototype.update = function update () {
  7288. /* istanbul ignore else */
  7289. if (this.lazy) {
  7290. this.dirty = true;
  7291. } else if (this.sync) {
  7292. this.run();
  7293. } else {
  7294. queueWatcher(this);
  7295. }
  7296. };
  7297. /**
  7298. * Scheduler job interface.
  7299. * Will be called by the scheduler.
  7300. */
  7301. Watcher.prototype.run = function run () {
  7302. if (this.active) {
  7303. var value = this.get();
  7304. if (
  7305. value !== this.value ||
  7306. // Deep watchers and watchers on Object/Arrays should fire even
  7307. // when the value is the same, because the value may
  7308. // have mutated.
  7309. isObject(value) ||
  7310. this.deep
  7311. ) {
  7312. // set new value
  7313. var oldValue = this.value;
  7314. this.value = value;
  7315. if (this.user) {
  7316. try {
  7317. this.cb.call(this.vm, value, oldValue);
  7318. } catch (e) {
  7319. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7320. }
  7321. } else {
  7322. this.cb.call(this.vm, value, oldValue);
  7323. }
  7324. }
  7325. }
  7326. };
  7327. /**
  7328. * Evaluate the value of the watcher.
  7329. * This only gets called for lazy watchers.
  7330. */
  7331. Watcher.prototype.evaluate = function evaluate () {
  7332. this.value = this.get();
  7333. this.dirty = false;
  7334. };
  7335. /**
  7336. * Depend on all deps collected by this watcher.
  7337. */
  7338. Watcher.prototype.depend = function depend () {
  7339. var i = this.deps.length;
  7340. while (i--) {
  7341. this.deps[i].depend();
  7342. }
  7343. };
  7344. /**
  7345. * Remove self from all dependencies' subscriber list.
  7346. */
  7347. Watcher.prototype.teardown = function teardown () {
  7348. if (this.active) {
  7349. // remove self from vm's watcher list
  7350. // this is a somewhat expensive operation so we skip it
  7351. // if the vm is being destroyed.
  7352. if (!this.vm._isBeingDestroyed) {
  7353. remove(this.vm._watchers, this);
  7354. }
  7355. var i = this.deps.length;
  7356. while (i--) {
  7357. this.deps[i].removeSub(this);
  7358. }
  7359. this.active = false;
  7360. }
  7361. };
  7362. /* */
  7363. var sharedPropertyDefinition = {
  7364. enumerable: true,
  7365. configurable: true,
  7366. get: noop,
  7367. set: noop
  7368. };
  7369. function proxy (target, sourceKey, key) {
  7370. sharedPropertyDefinition.get = function proxyGetter () {
  7371. return this[sourceKey][key]
  7372. };
  7373. sharedPropertyDefinition.set = function proxySetter (val) {
  7374. this[sourceKey][key] = val;
  7375. };
  7376. Object.defineProperty(target, key, sharedPropertyDefinition);
  7377. }
  7378. function initState (vm) {
  7379. vm._watchers = [];
  7380. var opts = vm.$options;
  7381. if (opts.props) { initProps(vm, opts.props); }
  7382. if (opts.methods) { initMethods(vm, opts.methods); }
  7383. if (opts.data) {
  7384. initData(vm);
  7385. } else {
  7386. observe(vm._data = {}, true /* asRootData */);
  7387. }
  7388. if (opts.computed) { initComputed(vm, opts.computed); }
  7389. if (opts.watch && opts.watch !== nativeWatch) {
  7390. initWatch(vm, opts.watch);
  7391. }
  7392. }
  7393. function initProps (vm, propsOptions) {
  7394. var propsData = vm.$options.propsData || {};
  7395. var props = vm._props = {};
  7396. // cache prop keys so that future props updates can iterate using Array
  7397. // instead of dynamic object key enumeration.
  7398. var keys = vm.$options._propKeys = [];
  7399. var isRoot = !vm.$parent;
  7400. // root instance props should be converted
  7401. if (!isRoot) {
  7402. toggleObserving(false);
  7403. }
  7404. var loop = function ( key ) {
  7405. keys.push(key);
  7406. var value = validateProp(key, propsOptions, propsData, vm);
  7407. /* istanbul ignore else */
  7408. if (true) {
  7409. var hyphenatedKey = hyphenate(key);
  7410. if (isReservedAttribute(hyphenatedKey) ||
  7411. config.isReservedAttr(hyphenatedKey)) {
  7412. warn(
  7413. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7414. vm
  7415. );
  7416. }
  7417. defineReactive$$1(props, key, value, function () {
  7418. if (!isRoot && !isUpdatingChildComponent) {
  7419. {
  7420. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  7421. return
  7422. }
  7423. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7424. if(
  7425. key === 'value' &&
  7426. Array.isArray(vm.$options.behaviors) &&
  7427. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7428. ){
  7429. return
  7430. }
  7431. if(vm._getFormData){
  7432. return
  7433. }
  7434. var $parent = vm.$parent;
  7435. while($parent){
  7436. if($parent.__next_tick_pending){
  7437. return
  7438. }
  7439. $parent = $parent.$parent;
  7440. }
  7441. }
  7442. warn(
  7443. "Avoid mutating a prop directly since the value will be " +
  7444. "overwritten whenever the parent component re-renders. " +
  7445. "Instead, use a data or computed property based on the prop's " +
  7446. "value. Prop being mutated: \"" + key + "\"",
  7447. vm
  7448. );
  7449. }
  7450. });
  7451. } else {}
  7452. // static props are already proxied on the component's prototype
  7453. // during Vue.extend(). We only need to proxy props defined at
  7454. // instantiation here.
  7455. if (!(key in vm)) {
  7456. proxy(vm, "_props", key);
  7457. }
  7458. };
  7459. for (var key in propsOptions) loop( key );
  7460. toggleObserving(true);
  7461. }
  7462. function initData (vm) {
  7463. var data = vm.$options.data;
  7464. data = vm._data = typeof data === 'function'
  7465. ? getData(data, vm)
  7466. : data || {};
  7467. if (!isPlainObject(data)) {
  7468. data = {};
  7469. true && warn(
  7470. 'data functions should return an object:\n' +
  7471. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7472. vm
  7473. );
  7474. }
  7475. // proxy data on instance
  7476. var keys = Object.keys(data);
  7477. var props = vm.$options.props;
  7478. var methods = vm.$options.methods;
  7479. var i = keys.length;
  7480. while (i--) {
  7481. var key = keys[i];
  7482. if (true) {
  7483. if (methods && hasOwn(methods, key)) {
  7484. warn(
  7485. ("Method \"" + key + "\" has already been defined as a data property."),
  7486. vm
  7487. );
  7488. }
  7489. }
  7490. if (props && hasOwn(props, key)) {
  7491. true && warn(
  7492. "The data property \"" + key + "\" is already declared as a prop. " +
  7493. "Use prop default value instead.",
  7494. vm
  7495. );
  7496. } else if (!isReserved(key)) {
  7497. proxy(vm, "_data", key);
  7498. }
  7499. }
  7500. // observe data
  7501. observe(data, true /* asRootData */);
  7502. }
  7503. function getData (data, vm) {
  7504. // #7573 disable dep collection when invoking data getters
  7505. pushTarget();
  7506. try {
  7507. return data.call(vm, vm)
  7508. } catch (e) {
  7509. handleError(e, vm, "data()");
  7510. return {}
  7511. } finally {
  7512. popTarget();
  7513. }
  7514. }
  7515. var computedWatcherOptions = { lazy: true };
  7516. function initComputed (vm, computed) {
  7517. // $flow-disable-line
  7518. var watchers = vm._computedWatchers = Object.create(null);
  7519. // computed properties are just getters during SSR
  7520. var isSSR = isServerRendering();
  7521. for (var key in computed) {
  7522. var userDef = computed[key];
  7523. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7524. if ( true && getter == null) {
  7525. warn(
  7526. ("Getter is missing for computed property \"" + key + "\"."),
  7527. vm
  7528. );
  7529. }
  7530. if (!isSSR) {
  7531. // create internal watcher for the computed property.
  7532. watchers[key] = new Watcher(
  7533. vm,
  7534. getter || noop,
  7535. noop,
  7536. computedWatcherOptions
  7537. );
  7538. }
  7539. // component-defined computed properties are already defined on the
  7540. // component prototype. We only need to define computed properties defined
  7541. // at instantiation here.
  7542. if (!(key in vm)) {
  7543. defineComputed(vm, key, userDef);
  7544. } else if (true) {
  7545. if (key in vm.$data) {
  7546. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7547. } else if (vm.$options.props && key in vm.$options.props) {
  7548. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7549. }
  7550. }
  7551. }
  7552. }
  7553. function defineComputed (
  7554. target,
  7555. key,
  7556. userDef
  7557. ) {
  7558. var shouldCache = !isServerRendering();
  7559. if (typeof userDef === 'function') {
  7560. sharedPropertyDefinition.get = shouldCache
  7561. ? createComputedGetter(key)
  7562. : createGetterInvoker(userDef);
  7563. sharedPropertyDefinition.set = noop;
  7564. } else {
  7565. sharedPropertyDefinition.get = userDef.get
  7566. ? shouldCache && userDef.cache !== false
  7567. ? createComputedGetter(key)
  7568. : createGetterInvoker(userDef.get)
  7569. : noop;
  7570. sharedPropertyDefinition.set = userDef.set || noop;
  7571. }
  7572. if ( true &&
  7573. sharedPropertyDefinition.set === noop) {
  7574. sharedPropertyDefinition.set = function () {
  7575. warn(
  7576. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7577. this
  7578. );
  7579. };
  7580. }
  7581. Object.defineProperty(target, key, sharedPropertyDefinition);
  7582. }
  7583. function createComputedGetter (key) {
  7584. return function computedGetter () {
  7585. var watcher = this._computedWatchers && this._computedWatchers[key];
  7586. if (watcher) {
  7587. if (watcher.dirty) {
  7588. watcher.evaluate();
  7589. }
  7590. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7591. watcher.depend();
  7592. }
  7593. return watcher.value
  7594. }
  7595. }
  7596. }
  7597. function createGetterInvoker(fn) {
  7598. return function computedGetter () {
  7599. return fn.call(this, this)
  7600. }
  7601. }
  7602. function initMethods (vm, methods) {
  7603. var props = vm.$options.props;
  7604. for (var key in methods) {
  7605. if (true) {
  7606. if (typeof methods[key] !== 'function') {
  7607. warn(
  7608. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7609. "Did you reference the function correctly?",
  7610. vm
  7611. );
  7612. }
  7613. if (props && hasOwn(props, key)) {
  7614. warn(
  7615. ("Method \"" + key + "\" has already been defined as a prop."),
  7616. vm
  7617. );
  7618. }
  7619. if ((key in vm) && isReserved(key)) {
  7620. warn(
  7621. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7622. "Avoid defining component methods that start with _ or $."
  7623. );
  7624. }
  7625. }
  7626. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7627. }
  7628. }
  7629. function initWatch (vm, watch) {
  7630. for (var key in watch) {
  7631. var handler = watch[key];
  7632. if (Array.isArray(handler)) {
  7633. for (var i = 0; i < handler.length; i++) {
  7634. createWatcher(vm, key, handler[i]);
  7635. }
  7636. } else {
  7637. createWatcher(vm, key, handler);
  7638. }
  7639. }
  7640. }
  7641. function createWatcher (
  7642. vm,
  7643. expOrFn,
  7644. handler,
  7645. options
  7646. ) {
  7647. if (isPlainObject(handler)) {
  7648. options = handler;
  7649. handler = handler.handler;
  7650. }
  7651. if (typeof handler === 'string') {
  7652. handler = vm[handler];
  7653. }
  7654. return vm.$watch(expOrFn, handler, options)
  7655. }
  7656. function stateMixin (Vue) {
  7657. // flow somehow has problems with directly declared definition object
  7658. // when using Object.defineProperty, so we have to procedurally build up
  7659. // the object here.
  7660. var dataDef = {};
  7661. dataDef.get = function () { return this._data };
  7662. var propsDef = {};
  7663. propsDef.get = function () { return this._props };
  7664. if (true) {
  7665. dataDef.set = function () {
  7666. warn(
  7667. 'Avoid replacing instance root $data. ' +
  7668. 'Use nested data properties instead.',
  7669. this
  7670. );
  7671. };
  7672. propsDef.set = function () {
  7673. warn("$props is readonly.", this);
  7674. };
  7675. }
  7676. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7677. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7678. Vue.prototype.$set = set;
  7679. Vue.prototype.$delete = del;
  7680. Vue.prototype.$watch = function (
  7681. expOrFn,
  7682. cb,
  7683. options
  7684. ) {
  7685. var vm = this;
  7686. if (isPlainObject(cb)) {
  7687. return createWatcher(vm, expOrFn, cb, options)
  7688. }
  7689. options = options || {};
  7690. options.user = true;
  7691. var watcher = new Watcher(vm, expOrFn, cb, options);
  7692. if (options.immediate) {
  7693. try {
  7694. cb.call(vm, watcher.value);
  7695. } catch (error) {
  7696. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7697. }
  7698. }
  7699. return function unwatchFn () {
  7700. watcher.teardown();
  7701. }
  7702. };
  7703. }
  7704. /* */
  7705. var uid$3 = 0;
  7706. function initMixin (Vue) {
  7707. Vue.prototype._init = function (options) {
  7708. var vm = this;
  7709. // a uid
  7710. vm._uid = uid$3++;
  7711. var startTag, endTag;
  7712. /* istanbul ignore if */
  7713. if ( true && config.performance && mark) {
  7714. startTag = "vue-perf-start:" + (vm._uid);
  7715. endTag = "vue-perf-end:" + (vm._uid);
  7716. mark(startTag);
  7717. }
  7718. // a flag to avoid this being observed
  7719. vm._isVue = true;
  7720. // merge options
  7721. if (options && options._isComponent) {
  7722. // optimize internal component instantiation
  7723. // since dynamic options merging is pretty slow, and none of the
  7724. // internal component options needs special treatment.
  7725. initInternalComponent(vm, options);
  7726. } else {
  7727. vm.$options = mergeOptions(
  7728. resolveConstructorOptions(vm.constructor),
  7729. options || {},
  7730. vm
  7731. );
  7732. }
  7733. /* istanbul ignore else */
  7734. if (true) {
  7735. initProxy(vm);
  7736. } else {}
  7737. // expose real self
  7738. vm._self = vm;
  7739. initLifecycle(vm);
  7740. initEvents(vm);
  7741. initRender(vm);
  7742. callHook(vm, 'beforeCreate');
  7743. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7744. initState(vm);
  7745. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7746. !vm._$fallback && callHook(vm, 'created');
  7747. /* istanbul ignore if */
  7748. if ( true && config.performance && mark) {
  7749. vm._name = formatComponentName(vm, false);
  7750. mark(endTag);
  7751. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7752. }
  7753. if (vm.$options.el) {
  7754. vm.$mount(vm.$options.el);
  7755. }
  7756. };
  7757. }
  7758. function initInternalComponent (vm, options) {
  7759. var opts = vm.$options = Object.create(vm.constructor.options);
  7760. // doing this because it's faster than dynamic enumeration.
  7761. var parentVnode = options._parentVnode;
  7762. opts.parent = options.parent;
  7763. opts._parentVnode = parentVnode;
  7764. var vnodeComponentOptions = parentVnode.componentOptions;
  7765. opts.propsData = vnodeComponentOptions.propsData;
  7766. opts._parentListeners = vnodeComponentOptions.listeners;
  7767. opts._renderChildren = vnodeComponentOptions.children;
  7768. opts._componentTag = vnodeComponentOptions.tag;
  7769. if (options.render) {
  7770. opts.render = options.render;
  7771. opts.staticRenderFns = options.staticRenderFns;
  7772. }
  7773. }
  7774. function resolveConstructorOptions (Ctor) {
  7775. var options = Ctor.options;
  7776. if (Ctor.super) {
  7777. var superOptions = resolveConstructorOptions(Ctor.super);
  7778. var cachedSuperOptions = Ctor.superOptions;
  7779. if (superOptions !== cachedSuperOptions) {
  7780. // super option changed,
  7781. // need to resolve new options.
  7782. Ctor.superOptions = superOptions;
  7783. // check if there are any late-modified/attached options (#4976)
  7784. var modifiedOptions = resolveModifiedOptions(Ctor);
  7785. // update base extend options
  7786. if (modifiedOptions) {
  7787. extend(Ctor.extendOptions, modifiedOptions);
  7788. }
  7789. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7790. if (options.name) {
  7791. options.components[options.name] = Ctor;
  7792. }
  7793. }
  7794. }
  7795. return options
  7796. }
  7797. function resolveModifiedOptions (Ctor) {
  7798. var modified;
  7799. var latest = Ctor.options;
  7800. var sealed = Ctor.sealedOptions;
  7801. for (var key in latest) {
  7802. if (latest[key] !== sealed[key]) {
  7803. if (!modified) { modified = {}; }
  7804. modified[key] = latest[key];
  7805. }
  7806. }
  7807. return modified
  7808. }
  7809. function Vue (options) {
  7810. if ( true &&
  7811. !(this instanceof Vue)
  7812. ) {
  7813. warn('Vue is a constructor and should be called with the `new` keyword');
  7814. }
  7815. this._init(options);
  7816. }
  7817. initMixin(Vue);
  7818. stateMixin(Vue);
  7819. eventsMixin(Vue);
  7820. lifecycleMixin(Vue);
  7821. renderMixin(Vue);
  7822. /* */
  7823. function initUse (Vue) {
  7824. Vue.use = function (plugin) {
  7825. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7826. if (installedPlugins.indexOf(plugin) > -1) {
  7827. return this
  7828. }
  7829. // additional parameters
  7830. var args = toArray(arguments, 1);
  7831. args.unshift(this);
  7832. if (typeof plugin.install === 'function') {
  7833. plugin.install.apply(plugin, args);
  7834. } else if (typeof plugin === 'function') {
  7835. plugin.apply(null, args);
  7836. }
  7837. installedPlugins.push(plugin);
  7838. return this
  7839. };
  7840. }
  7841. /* */
  7842. function initMixin$1 (Vue) {
  7843. Vue.mixin = function (mixin) {
  7844. this.options = mergeOptions(this.options, mixin);
  7845. return this
  7846. };
  7847. }
  7848. /* */
  7849. function initExtend (Vue) {
  7850. /**
  7851. * Each instance constructor, including Vue, has a unique
  7852. * cid. This enables us to create wrapped "child
  7853. * constructors" for prototypal inheritance and cache them.
  7854. */
  7855. Vue.cid = 0;
  7856. var cid = 1;
  7857. /**
  7858. * Class inheritance
  7859. */
  7860. Vue.extend = function (extendOptions) {
  7861. extendOptions = extendOptions || {};
  7862. var Super = this;
  7863. var SuperId = Super.cid;
  7864. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7865. if (cachedCtors[SuperId]) {
  7866. return cachedCtors[SuperId]
  7867. }
  7868. var name = extendOptions.name || Super.options.name;
  7869. if ( true && name) {
  7870. validateComponentName(name);
  7871. }
  7872. var Sub = function VueComponent (options) {
  7873. this._init(options);
  7874. };
  7875. Sub.prototype = Object.create(Super.prototype);
  7876. Sub.prototype.constructor = Sub;
  7877. Sub.cid = cid++;
  7878. Sub.options = mergeOptions(
  7879. Super.options,
  7880. extendOptions
  7881. );
  7882. Sub['super'] = Super;
  7883. // For props and computed properties, we define the proxy getters on
  7884. // the Vue instances at extension time, on the extended prototype. This
  7885. // avoids Object.defineProperty calls for each instance created.
  7886. if (Sub.options.props) {
  7887. initProps$1(Sub);
  7888. }
  7889. if (Sub.options.computed) {
  7890. initComputed$1(Sub);
  7891. }
  7892. // allow further extension/mixin/plugin usage
  7893. Sub.extend = Super.extend;
  7894. Sub.mixin = Super.mixin;
  7895. Sub.use = Super.use;
  7896. // create asset registers, so extended classes
  7897. // can have their private assets too.
  7898. ASSET_TYPES.forEach(function (type) {
  7899. Sub[type] = Super[type];
  7900. });
  7901. // enable recursive self-lookup
  7902. if (name) {
  7903. Sub.options.components[name] = Sub;
  7904. }
  7905. // keep a reference to the super options at extension time.
  7906. // later at instantiation we can check if Super's options have
  7907. // been updated.
  7908. Sub.superOptions = Super.options;
  7909. Sub.extendOptions = extendOptions;
  7910. Sub.sealedOptions = extend({}, Sub.options);
  7911. // cache constructor
  7912. cachedCtors[SuperId] = Sub;
  7913. return Sub
  7914. };
  7915. }
  7916. function initProps$1 (Comp) {
  7917. var props = Comp.options.props;
  7918. for (var key in props) {
  7919. proxy(Comp.prototype, "_props", key);
  7920. }
  7921. }
  7922. function initComputed$1 (Comp) {
  7923. var computed = Comp.options.computed;
  7924. for (var key in computed) {
  7925. defineComputed(Comp.prototype, key, computed[key]);
  7926. }
  7927. }
  7928. /* */
  7929. function initAssetRegisters (Vue) {
  7930. /**
  7931. * Create asset registration methods.
  7932. */
  7933. ASSET_TYPES.forEach(function (type) {
  7934. Vue[type] = function (
  7935. id,
  7936. definition
  7937. ) {
  7938. if (!definition) {
  7939. return this.options[type + 's'][id]
  7940. } else {
  7941. /* istanbul ignore if */
  7942. if ( true && type === 'component') {
  7943. validateComponentName(id);
  7944. }
  7945. if (type === 'component' && isPlainObject(definition)) {
  7946. definition.name = definition.name || id;
  7947. definition = this.options._base.extend(definition);
  7948. }
  7949. if (type === 'directive' && typeof definition === 'function') {
  7950. definition = { bind: definition, update: definition };
  7951. }
  7952. this.options[type + 's'][id] = definition;
  7953. return definition
  7954. }
  7955. };
  7956. });
  7957. }
  7958. /* */
  7959. function getComponentName (opts) {
  7960. return opts && (opts.Ctor.options.name || opts.tag)
  7961. }
  7962. function matches (pattern, name) {
  7963. if (Array.isArray(pattern)) {
  7964. return pattern.indexOf(name) > -1
  7965. } else if (typeof pattern === 'string') {
  7966. return pattern.split(',').indexOf(name) > -1
  7967. } else if (isRegExp(pattern)) {
  7968. return pattern.test(name)
  7969. }
  7970. /* istanbul ignore next */
  7971. return false
  7972. }
  7973. function pruneCache (keepAliveInstance, filter) {
  7974. var cache = keepAliveInstance.cache;
  7975. var keys = keepAliveInstance.keys;
  7976. var _vnode = keepAliveInstance._vnode;
  7977. for (var key in cache) {
  7978. var cachedNode = cache[key];
  7979. if (cachedNode) {
  7980. var name = getComponentName(cachedNode.componentOptions);
  7981. if (name && !filter(name)) {
  7982. pruneCacheEntry(cache, key, keys, _vnode);
  7983. }
  7984. }
  7985. }
  7986. }
  7987. function pruneCacheEntry (
  7988. cache,
  7989. key,
  7990. keys,
  7991. current
  7992. ) {
  7993. var cached$$1 = cache[key];
  7994. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7995. cached$$1.componentInstance.$destroy();
  7996. }
  7997. cache[key] = null;
  7998. remove(keys, key);
  7999. }
  8000. var patternTypes = [String, RegExp, Array];
  8001. var KeepAlive = {
  8002. name: 'keep-alive',
  8003. abstract: true,
  8004. props: {
  8005. include: patternTypes,
  8006. exclude: patternTypes,
  8007. max: [String, Number]
  8008. },
  8009. created: function created () {
  8010. this.cache = Object.create(null);
  8011. this.keys = [];
  8012. },
  8013. destroyed: function destroyed () {
  8014. for (var key in this.cache) {
  8015. pruneCacheEntry(this.cache, key, this.keys);
  8016. }
  8017. },
  8018. mounted: function mounted () {
  8019. var this$1 = this;
  8020. this.$watch('include', function (val) {
  8021. pruneCache(this$1, function (name) { return matches(val, name); });
  8022. });
  8023. this.$watch('exclude', function (val) {
  8024. pruneCache(this$1, function (name) { return !matches(val, name); });
  8025. });
  8026. },
  8027. render: function render () {
  8028. var slot = this.$slots.default;
  8029. var vnode = getFirstComponentChild(slot);
  8030. var componentOptions = vnode && vnode.componentOptions;
  8031. if (componentOptions) {
  8032. // check pattern
  8033. var name = getComponentName(componentOptions);
  8034. var ref = this;
  8035. var include = ref.include;
  8036. var exclude = ref.exclude;
  8037. if (
  8038. // not included
  8039. (include && (!name || !matches(include, name))) ||
  8040. // excluded
  8041. (exclude && name && matches(exclude, name))
  8042. ) {
  8043. return vnode
  8044. }
  8045. var ref$1 = this;
  8046. var cache = ref$1.cache;
  8047. var keys = ref$1.keys;
  8048. var key = vnode.key == null
  8049. // same constructor may get registered as different local components
  8050. // so cid alone is not enough (#3269)
  8051. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8052. : vnode.key;
  8053. if (cache[key]) {
  8054. vnode.componentInstance = cache[key].componentInstance;
  8055. // make current key freshest
  8056. remove(keys, key);
  8057. keys.push(key);
  8058. } else {
  8059. cache[key] = vnode;
  8060. keys.push(key);
  8061. // prune oldest entry
  8062. if (this.max && keys.length > parseInt(this.max)) {
  8063. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8064. }
  8065. }
  8066. vnode.data.keepAlive = true;
  8067. }
  8068. return vnode || (slot && slot[0])
  8069. }
  8070. };
  8071. var builtInComponents = {
  8072. KeepAlive: KeepAlive
  8073. };
  8074. /* */
  8075. function initGlobalAPI (Vue) {
  8076. // config
  8077. var configDef = {};
  8078. configDef.get = function () { return config; };
  8079. if (true) {
  8080. configDef.set = function () {
  8081. warn(
  8082. 'Do not replace the Vue.config object, set individual fields instead.'
  8083. );
  8084. };
  8085. }
  8086. Object.defineProperty(Vue, 'config', configDef);
  8087. // exposed util methods.
  8088. // NOTE: these are not considered part of the public API - avoid relying on
  8089. // them unless you are aware of the risk.
  8090. Vue.util = {
  8091. warn: warn,
  8092. extend: extend,
  8093. mergeOptions: mergeOptions,
  8094. defineReactive: defineReactive$$1
  8095. };
  8096. Vue.set = set;
  8097. Vue.delete = del;
  8098. Vue.nextTick = nextTick;
  8099. // 2.6 explicit observable API
  8100. Vue.observable = function (obj) {
  8101. observe(obj);
  8102. return obj
  8103. };
  8104. Vue.options = Object.create(null);
  8105. ASSET_TYPES.forEach(function (type) {
  8106. Vue.options[type + 's'] = Object.create(null);
  8107. });
  8108. // this is used to identify the "base" constructor to extend all plain-object
  8109. // components with in Weex's multi-instance scenarios.
  8110. Vue.options._base = Vue;
  8111. extend(Vue.options.components, builtInComponents);
  8112. initUse(Vue);
  8113. initMixin$1(Vue);
  8114. initExtend(Vue);
  8115. initAssetRegisters(Vue);
  8116. }
  8117. initGlobalAPI(Vue);
  8118. Object.defineProperty(Vue.prototype, '$isServer', {
  8119. get: isServerRendering
  8120. });
  8121. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8122. get: function get () {
  8123. /* istanbul ignore next */
  8124. return this.$vnode && this.$vnode.ssrContext
  8125. }
  8126. });
  8127. // expose FunctionalRenderContext for ssr runtime helper installation
  8128. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8129. value: FunctionalRenderContext
  8130. });
  8131. Vue.version = '2.6.11';
  8132. /**
  8133. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8134. */
  8135. var ARRAYTYPE = '[object Array]';
  8136. var OBJECTTYPE = '[object Object]';
  8137. // const FUNCTIONTYPE = '[object Function]'
  8138. function diff(current, pre) {
  8139. var result = {};
  8140. syncKeys(current, pre);
  8141. _diff(current, pre, '', result);
  8142. return result
  8143. }
  8144. function syncKeys(current, pre) {
  8145. if (current === pre) { return }
  8146. var rootCurrentType = type(current);
  8147. var rootPreType = type(pre);
  8148. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8149. if(Object.keys(current).length >= Object.keys(pre).length){
  8150. for (var key in pre) {
  8151. var currentValue = current[key];
  8152. if (currentValue === undefined) {
  8153. current[key] = null;
  8154. } else {
  8155. syncKeys(currentValue, pre[key]);
  8156. }
  8157. }
  8158. }
  8159. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8160. if (current.length >= pre.length) {
  8161. pre.forEach(function (item, index) {
  8162. syncKeys(current[index], item);
  8163. });
  8164. }
  8165. }
  8166. }
  8167. function _diff(current, pre, path, result) {
  8168. if (current === pre) { return }
  8169. var rootCurrentType = type(current);
  8170. var rootPreType = type(pre);
  8171. if (rootCurrentType == OBJECTTYPE) {
  8172. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8173. setResult(result, path, current);
  8174. } else {
  8175. var loop = function ( key ) {
  8176. var currentValue = current[key];
  8177. var preValue = pre[key];
  8178. var currentType = type(currentValue);
  8179. var preType = type(preValue);
  8180. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8181. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  8182. if (currentValue !== pre[key]) {
  8183. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8184. }
  8185. } else if (currentType == ARRAYTYPE) {
  8186. if (preType != ARRAYTYPE) {
  8187. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8188. } else {
  8189. if (currentValue.length < preValue.length) {
  8190. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8191. } else {
  8192. currentValue.forEach(function (item, index) {
  8193. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8194. });
  8195. }
  8196. }
  8197. } else if (currentType == OBJECTTYPE) {
  8198. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8199. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8200. } else {
  8201. for (var subKey in currentValue) {
  8202. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8203. }
  8204. }
  8205. }
  8206. };
  8207. for (var key in current) loop( key );
  8208. }
  8209. } else if (rootCurrentType == ARRAYTYPE) {
  8210. if (rootPreType != ARRAYTYPE) {
  8211. setResult(result, path, current);
  8212. } else {
  8213. if (current.length < pre.length) {
  8214. setResult(result, path, current);
  8215. } else {
  8216. current.forEach(function (item, index) {
  8217. _diff(item, pre[index], path + '[' + index + ']', result);
  8218. });
  8219. }
  8220. }
  8221. } else {
  8222. setResult(result, path, current);
  8223. }
  8224. }
  8225. function setResult(result, k, v) {
  8226. // if (type(v) != FUNCTIONTYPE) {
  8227. result[k] = v;
  8228. // }
  8229. }
  8230. function type(obj) {
  8231. return Object.prototype.toString.call(obj)
  8232. }
  8233. /* */
  8234. function flushCallbacks$1(vm) {
  8235. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8236. if (Object({"VUE_APP_NAME":"六牛云","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8237. var mpInstance = vm.$scope;
  8238. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8239. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8240. }
  8241. var copies = vm.__next_tick_callbacks.slice(0);
  8242. vm.__next_tick_callbacks.length = 0;
  8243. for (var i = 0; i < copies.length; i++) {
  8244. copies[i]();
  8245. }
  8246. }
  8247. }
  8248. function hasRenderWatcher(vm) {
  8249. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8250. }
  8251. function nextTick$1(vm, cb) {
  8252. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8253. //2.nextTick 之前存在 render watcher
  8254. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8255. if(Object({"VUE_APP_NAME":"六牛云","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8256. var mpInstance = vm.$scope;
  8257. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8258. ']:nextVueTick');
  8259. }
  8260. return nextTick(cb, vm)
  8261. }else{
  8262. if(Object({"VUE_APP_NAME":"六牛云","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8263. var mpInstance$1 = vm.$scope;
  8264. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8265. ']:nextMPTick');
  8266. }
  8267. }
  8268. var _resolve;
  8269. if (!vm.__next_tick_callbacks) {
  8270. vm.__next_tick_callbacks = [];
  8271. }
  8272. vm.__next_tick_callbacks.push(function () {
  8273. if (cb) {
  8274. try {
  8275. cb.call(vm);
  8276. } catch (e) {
  8277. handleError(e, vm, 'nextTick');
  8278. }
  8279. } else if (_resolve) {
  8280. _resolve(vm);
  8281. }
  8282. });
  8283. // $flow-disable-line
  8284. if (!cb && typeof Promise !== 'undefined') {
  8285. return new Promise(function (resolve) {
  8286. _resolve = resolve;
  8287. })
  8288. }
  8289. }
  8290. /* */
  8291. function cloneWithData(vm) {
  8292. // 确保当前 vm 所有数据被同步
  8293. var ret = Object.create(null);
  8294. var dataKeys = [].concat(
  8295. Object.keys(vm._data || {}),
  8296. Object.keys(vm._computedWatchers || {}));
  8297. dataKeys.reduce(function(ret, key) {
  8298. ret[key] = vm[key];
  8299. return ret
  8300. }, ret);
  8301. // vue-composition-api
  8302. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8303. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8304. if (rawBindings) {
  8305. Object.keys(rawBindings).forEach(function (key) {
  8306. ret[key] = vm[key];
  8307. });
  8308. }
  8309. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8310. Object.assign(ret, vm.$mp.data || {});
  8311. if (
  8312. Array.isArray(vm.$options.behaviors) &&
  8313. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8314. ) { //form-field
  8315. ret['name'] = vm.name;
  8316. ret['value'] = vm.value;
  8317. }
  8318. return JSON.parse(JSON.stringify(ret))
  8319. }
  8320. var patch = function(oldVnode, vnode) {
  8321. var this$1 = this;
  8322. if (vnode === null) { //destroy
  8323. return
  8324. }
  8325. if (this.mpType === 'page' || this.mpType === 'component') {
  8326. var mpInstance = this.$scope;
  8327. var data = Object.create(null);
  8328. try {
  8329. data = cloneWithData(this);
  8330. } catch (err) {
  8331. console.error(err);
  8332. }
  8333. data.__webviewId__ = mpInstance.data.__webviewId__;
  8334. var mpData = Object.create(null);
  8335. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8336. mpData[key] = mpInstance.data[key];
  8337. });
  8338. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8339. if (Object.keys(diffData).length) {
  8340. if (Object({"VUE_APP_NAME":"六牛云","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8341. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8342. ']差量更新',
  8343. JSON.stringify(diffData));
  8344. }
  8345. this.__next_tick_pending = true;
  8346. mpInstance.setData(diffData, function () {
  8347. this$1.__next_tick_pending = false;
  8348. flushCallbacks$1(this$1);
  8349. });
  8350. } else {
  8351. flushCallbacks$1(this);
  8352. }
  8353. }
  8354. };
  8355. /* */
  8356. function createEmptyRender() {
  8357. }
  8358. function mountComponent$1(
  8359. vm,
  8360. el,
  8361. hydrating
  8362. ) {
  8363. if (!vm.mpType) {//main.js 中的 new Vue
  8364. return vm
  8365. }
  8366. if (vm.mpType === 'app') {
  8367. vm.$options.render = createEmptyRender;
  8368. }
  8369. if (!vm.$options.render) {
  8370. vm.$options.render = createEmptyRender;
  8371. if (true) {
  8372. /* istanbul ignore if */
  8373. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8374. vm.$options.el || el) {
  8375. warn(
  8376. 'You are using the runtime-only build of Vue where the template ' +
  8377. 'compiler is not available. Either pre-compile the templates into ' +
  8378. 'render functions, or use the compiler-included build.',
  8379. vm
  8380. );
  8381. } else {
  8382. warn(
  8383. 'Failed to mount component: template or render function not defined.',
  8384. vm
  8385. );
  8386. }
  8387. }
  8388. }
  8389. !vm._$fallback && callHook(vm, 'beforeMount');
  8390. var updateComponent = function () {
  8391. vm._update(vm._render(), hydrating);
  8392. };
  8393. // we set this to vm._watcher inside the watcher's constructor
  8394. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8395. // component's mounted hook), which relies on vm._watcher being already defined
  8396. new Watcher(vm, updateComponent, noop, {
  8397. before: function before() {
  8398. if (vm._isMounted && !vm._isDestroyed) {
  8399. callHook(vm, 'beforeUpdate');
  8400. }
  8401. }
  8402. }, true /* isRenderWatcher */);
  8403. hydrating = false;
  8404. return vm
  8405. }
  8406. /* */
  8407. function renderClass (
  8408. staticClass,
  8409. dynamicClass
  8410. ) {
  8411. if (isDef(staticClass) || isDef(dynamicClass)) {
  8412. return concat(staticClass, stringifyClass(dynamicClass))
  8413. }
  8414. /* istanbul ignore next */
  8415. return ''
  8416. }
  8417. function concat (a, b) {
  8418. return a ? b ? (a + ' ' + b) : a : (b || '')
  8419. }
  8420. function stringifyClass (value) {
  8421. if (Array.isArray(value)) {
  8422. return stringifyArray(value)
  8423. }
  8424. if (isObject(value)) {
  8425. return stringifyObject(value)
  8426. }
  8427. if (typeof value === 'string') {
  8428. return value
  8429. }
  8430. /* istanbul ignore next */
  8431. return ''
  8432. }
  8433. function stringifyArray (value) {
  8434. var res = '';
  8435. var stringified;
  8436. for (var i = 0, l = value.length; i < l; i++) {
  8437. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8438. if (res) { res += ' '; }
  8439. res += stringified;
  8440. }
  8441. }
  8442. return res
  8443. }
  8444. function stringifyObject (value) {
  8445. var res = '';
  8446. for (var key in value) {
  8447. if (value[key]) {
  8448. if (res) { res += ' '; }
  8449. res += key;
  8450. }
  8451. }
  8452. return res
  8453. }
  8454. /* */
  8455. var parseStyleText = cached(function (cssText) {
  8456. var res = {};
  8457. var listDelimiter = /;(?![^(]*\))/g;
  8458. var propertyDelimiter = /:(.+)/;
  8459. cssText.split(listDelimiter).forEach(function (item) {
  8460. if (item) {
  8461. var tmp = item.split(propertyDelimiter);
  8462. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8463. }
  8464. });
  8465. return res
  8466. });
  8467. // normalize possible array / string values into Object
  8468. function normalizeStyleBinding (bindingStyle) {
  8469. if (Array.isArray(bindingStyle)) {
  8470. return toObject(bindingStyle)
  8471. }
  8472. if (typeof bindingStyle === 'string') {
  8473. return parseStyleText(bindingStyle)
  8474. }
  8475. return bindingStyle
  8476. }
  8477. /* */
  8478. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8479. function getTarget(obj, path) {
  8480. var parts = path.split('.');
  8481. var key = parts[0];
  8482. if (key.indexOf('__$n') === 0) { //number index
  8483. key = parseInt(key.replace('__$n', ''));
  8484. }
  8485. if (parts.length === 1) {
  8486. return obj[key]
  8487. }
  8488. return getTarget(obj[key], parts.slice(1).join('.'))
  8489. }
  8490. function internalMixin(Vue) {
  8491. Vue.config.errorHandler = function(err, vm, info) {
  8492. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8493. console.error(err);
  8494. /* eslint-disable no-undef */
  8495. var app = typeof getApp === 'function' && getApp();
  8496. if (app && app.onError) {
  8497. app.onError(err);
  8498. }
  8499. };
  8500. var oldEmit = Vue.prototype.$emit;
  8501. Vue.prototype.$emit = function(event) {
  8502. if (this.$scope && event) {
  8503. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent'])
  8504. .call(this.$scope, event, {
  8505. __args__: toArray(arguments, 1)
  8506. })
  8507. }
  8508. return oldEmit.apply(this, arguments)
  8509. };
  8510. Vue.prototype.$nextTick = function(fn) {
  8511. return nextTick$1(this, fn)
  8512. };
  8513. MP_METHODS.forEach(function (method) {
  8514. Vue.prototype[method] = function(args) {
  8515. if (this.$scope && this.$scope[method]) {
  8516. return this.$scope[method](args)
  8517. }
  8518. // mp-alipay
  8519. if (typeof my === 'undefined') {
  8520. return
  8521. }
  8522. if (method === 'createSelectorQuery') {
  8523. /* eslint-disable no-undef */
  8524. return my.createSelectorQuery(args)
  8525. } else if (method === 'createIntersectionObserver') {
  8526. /* eslint-disable no-undef */
  8527. return my.createIntersectionObserver(args)
  8528. }
  8529. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8530. };
  8531. });
  8532. Vue.prototype.__init_provide = initProvide;
  8533. Vue.prototype.__init_injections = initInjections;
  8534. Vue.prototype.__call_hook = function(hook, args) {
  8535. var vm = this;
  8536. // #7573 disable dep collection when invoking lifecycle hooks
  8537. pushTarget();
  8538. var handlers = vm.$options[hook];
  8539. var info = hook + " hook";
  8540. var ret;
  8541. if (handlers) {
  8542. for (var i = 0, j = handlers.length; i < j; i++) {
  8543. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8544. }
  8545. }
  8546. if (vm._hasHookEvent) {
  8547. vm.$emit('hook:' + hook, args);
  8548. }
  8549. popTarget();
  8550. return ret
  8551. };
  8552. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8553. if (Array.isArray(modifiers)) {
  8554. if (modifiers.indexOf('trim') !== -1) {
  8555. value = value.trim();
  8556. }
  8557. if (modifiers.indexOf('number') !== -1) {
  8558. value = this._n(value);
  8559. }
  8560. }
  8561. if (!target) {
  8562. target = this;
  8563. }
  8564. // 解决动态属性添加
  8565. Vue.set(target, key, value)
  8566. };
  8567. Vue.prototype.__set_sync = function(target, key, value) {
  8568. if (!target) {
  8569. target = this;
  8570. }
  8571. // 解决动态属性添加
  8572. Vue.set(target, key, value)
  8573. };
  8574. Vue.prototype.__get_orig = function(item) {
  8575. if (isPlainObject(item)) {
  8576. return item['$orig'] || item
  8577. }
  8578. return item
  8579. };
  8580. Vue.prototype.__get_value = function(dataPath, target) {
  8581. return getTarget(target || this, dataPath)
  8582. };
  8583. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8584. return renderClass(staticClass, dynamicClass)
  8585. };
  8586. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8587. if (!dynamicStyle && !staticStyle) {
  8588. return ''
  8589. }
  8590. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8591. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8592. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8593. };
  8594. Vue.prototype.__map = function(val, iteratee) {
  8595. //TODO 暂不考虑 string
  8596. var ret, i, l, keys, key;
  8597. if (Array.isArray(val)) {
  8598. ret = new Array(val.length);
  8599. for (i = 0, l = val.length; i < l; i++) {
  8600. ret[i] = iteratee(val[i], i);
  8601. }
  8602. return ret
  8603. } else if (isObject(val)) {
  8604. keys = Object.keys(val);
  8605. ret = Object.create(null);
  8606. for (i = 0, l = keys.length; i < l; i++) {
  8607. key = keys[i];
  8608. ret[key] = iteratee(val[key], key, i);
  8609. }
  8610. return ret
  8611. } else if (typeof val === 'number') {
  8612. ret = new Array(val);
  8613. for (i = 0, l = val; i < l; i++) {
  8614. // 第一个参数暂时仍和小程序一致
  8615. ret[i] = iteratee(i, i);
  8616. }
  8617. return ret
  8618. }
  8619. return []
  8620. };
  8621. }
  8622. /* */
  8623. var LIFECYCLE_HOOKS$1 = [
  8624. //App
  8625. 'onLaunch',
  8626. 'onShow',
  8627. 'onHide',
  8628. 'onUniNViewMessage',
  8629. 'onPageNotFound',
  8630. 'onThemeChange',
  8631. 'onError',
  8632. 'onUnhandledRejection',
  8633. //Page
  8634. 'onInit',
  8635. 'onLoad',
  8636. // 'onShow',
  8637. 'onReady',
  8638. // 'onHide',
  8639. 'onUnload',
  8640. 'onPullDownRefresh',
  8641. 'onReachBottom',
  8642. 'onTabItemTap',
  8643. 'onAddToFavorites',
  8644. 'onShareTimeline',
  8645. 'onShareAppMessage',
  8646. 'onResize',
  8647. 'onPageScroll',
  8648. 'onNavigationBarButtonTap',
  8649. 'onBackPress',
  8650. 'onNavigationBarSearchInputChanged',
  8651. 'onNavigationBarSearchInputConfirmed',
  8652. 'onNavigationBarSearchInputClicked',
  8653. //Component
  8654. // 'onReady', // 兼容旧版本,应该移除该事件
  8655. 'onPageShow',
  8656. 'onPageHide',
  8657. 'onPageResize'
  8658. ];
  8659. function lifecycleMixin$1(Vue) {
  8660. //fixed vue-class-component
  8661. var oldExtend = Vue.extend;
  8662. Vue.extend = function(extendOptions) {
  8663. extendOptions = extendOptions || {};
  8664. var methods = extendOptions.methods;
  8665. if (methods) {
  8666. Object.keys(methods).forEach(function (methodName) {
  8667. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8668. extendOptions[methodName] = methods[methodName];
  8669. delete methods[methodName];
  8670. }
  8671. });
  8672. }
  8673. return oldExtend.call(this, extendOptions)
  8674. };
  8675. var strategies = Vue.config.optionMergeStrategies;
  8676. var mergeHook = strategies.created;
  8677. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8678. strategies[hook] = mergeHook;
  8679. });
  8680. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8681. }
  8682. /* */
  8683. // install platform patch function
  8684. Vue.prototype.__patch__ = patch;
  8685. // public mount method
  8686. Vue.prototype.$mount = function(
  8687. el ,
  8688. hydrating
  8689. ) {
  8690. return mountComponent$1(this, el, hydrating)
  8691. };
  8692. lifecycleMixin$1(Vue);
  8693. internalMixin(Vue);
  8694. /* */
  8695. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8696. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8697. /***/ }),
  8698. /***/ 309:
  8699. /*!******************************************!*\
  8700. !*** D:/六牛项目/lnyk/utils/wxMinProgram.js ***!
  8701. \******************************************/
  8702. /*! no static exports found */
  8703. /***/ (function(module, exports, __webpack_require__) {
  8704. "use strict";
  8705. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.loginWinxinMp = loginWinxinMp;var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 6));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8706. //微信登录
  8707. /**
  8708. * @param {string} 当前页面地址信息
  8709. */
  8710. function loginWinxinMp() {
  8711. var pages = getCurrentPages();
  8712. // 获取跳转前页面
  8713. var page = pages[pages.length - 2];
  8714. var queryUrl = '';
  8715. for (var key in page.options) {
  8716. queryUrl += key + '=' + page.options[key] + "&";
  8717. }
  8718. // 获取当页面路由地址
  8719. var path = '/' + page.route + '?' + queryUrl;
  8720. // 保存跳转前页面
  8721. uni.setStorageSync('present', path);
  8722. return new Promise(function (resolve, reject) {
  8723. wx.login({
  8724. success: function success(e) {
  8725. console.log(e);
  8726. resolve(e);
  8727. },
  8728. fill: function fill(e) {
  8729. reject(e);
  8730. } });
  8731. });
  8732. };
  8733. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8734. /***/ }),
  8735. /***/ 318:
  8736. /*!******************************!*\
  8737. !*** D:/六牛项目/lnyk/api/wx.js ***!
  8738. \******************************/
  8739. /*! no static exports found */
  8740. /***/ (function(module, exports, __webpack_require__) {
  8741. "use strict";
  8742. Object.defineProperty(exports, "__esModule", { value: true });exports.wechatMpAuth = wechatMpAuth;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 14));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8743. // 微信code地址
  8744. function wechatMpAuth(data) {
  8745. return (0, _request.default)({
  8746. url: '/api/wechat/mp_auth',
  8747. method: 'post',
  8748. data: data });
  8749. }
  8750. /***/ }),
  8751. /***/ 367:
  8752. /*!****************************************************!*\
  8753. !*** D:/六牛项目/lnyk/components/tki-qrcode/qrcode.js ***!
  8754. \****************************************************/
  8755. /*! no static exports found */
  8756. /***/ (function(module, exports, __webpack_require__) {
  8757. "use strict";
  8758. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var QRCode = {};
  8759. (function () {
  8760. /**
  8761. * 获取单个字符的utf8编码
  8762. * unicode BMP平面约65535个字符
  8763. * @param {num} code
  8764. * return {array}
  8765. */
  8766. function unicodeFormat8(code) {
  8767. // 1 byte
  8768. var c0, c1, c2;
  8769. if (code < 128) {
  8770. return [code];
  8771. // 2 bytes
  8772. } else if (code < 2048) {
  8773. c0 = 192 + (code >> 6);
  8774. c1 = 128 + (code & 63);
  8775. return [c0, c1];
  8776. // 3 bytes
  8777. } else {
  8778. c0 = 224 + (code >> 12);
  8779. c1 = 128 + (code >> 6 & 63);
  8780. c2 = 128 + (code & 63);
  8781. return [c0, c1, c2];
  8782. }
  8783. }
  8784. /**
  8785. * 获取字符串的utf8编码字节串
  8786. * @param {string} string
  8787. * @return {array}
  8788. */
  8789. function getUTF8Bytes(string) {
  8790. var utf8codes = [];
  8791. for (var i = 0; i < string.length; i++) {
  8792. var code = string.charCodeAt(i);
  8793. var utf8 = unicodeFormat8(code);
  8794. for (var j = 0; j < utf8.length; j++) {
  8795. utf8codes.push(utf8[j]);
  8796. }
  8797. }
  8798. return utf8codes;
  8799. }
  8800. /**
  8801. * 二维码算法实现
  8802. * @param {string} data 要编码的信息字符串
  8803. * @param {num} errorCorrectLevel 纠错等级
  8804. */
  8805. function QRCodeAlg(data, errorCorrectLevel) {
  8806. this.typeNumber = -1; //版本
  8807. this.errorCorrectLevel = errorCorrectLevel;
  8808. this.modules = null; //二维矩阵,存放最终结果
  8809. this.moduleCount = 0; //矩阵大小
  8810. this.dataCache = null; //数据缓存
  8811. this.rsBlocks = null; //版本数据信息
  8812. this.totalDataCount = -1; //可使用的数据量
  8813. this.data = data;
  8814. this.utf8bytes = getUTF8Bytes(data);
  8815. this.make();
  8816. }
  8817. QRCodeAlg.prototype = {
  8818. constructor: QRCodeAlg,
  8819. /**
  8820. * 获取二维码矩阵大小
  8821. * @return {num} 矩阵大小
  8822. */
  8823. getModuleCount: function getModuleCount() {
  8824. return this.moduleCount;
  8825. },
  8826. /**
  8827. * 编码
  8828. */
  8829. make: function make() {
  8830. this.getRightType();
  8831. this.dataCache = this.createData();
  8832. this.createQrcode();
  8833. },
  8834. /**
  8835. * 设置二位矩阵功能图形
  8836. * @param {bool} test 表示是否在寻找最好掩膜阶段
  8837. * @param {num} maskPattern 掩膜的版本
  8838. */
  8839. makeImpl: function makeImpl(maskPattern) {
  8840. this.moduleCount = this.typeNumber * 4 + 17;
  8841. this.modules = new Array(this.moduleCount);
  8842. for (var row = 0; row < this.moduleCount; row++) {
  8843. this.modules[row] = new Array(this.moduleCount);
  8844. }
  8845. this.setupPositionProbePattern(0, 0);
  8846. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  8847. this.setupPositionProbePattern(0, this.moduleCount - 7);
  8848. this.setupPositionAdjustPattern();
  8849. this.setupTimingPattern();
  8850. this.setupTypeInfo(true, maskPattern);
  8851. if (this.typeNumber >= 7) {
  8852. this.setupTypeNumber(true);
  8853. }
  8854. this.mapData(this.dataCache, maskPattern);
  8855. },
  8856. /**
  8857. * 设置二维码的位置探测图形
  8858. * @param {num} row 探测图形的中心横坐标
  8859. * @param {num} col 探测图形的中心纵坐标
  8860. */
  8861. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  8862. for (var r = -1; r <= 7; r++) {
  8863. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  8864. for (var c = -1; c <= 7; c++) {
  8865. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  8866. if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  8867. this.modules[row + r][col + c] = true;
  8868. } else {
  8869. this.modules[row + r][col + c] = false;
  8870. }
  8871. }
  8872. }
  8873. },
  8874. /**
  8875. * 创建二维码
  8876. * @return {[type]} [description]
  8877. */
  8878. createQrcode: function createQrcode() {
  8879. var minLostPoint = 0;
  8880. var pattern = 0;
  8881. var bestModules = null;
  8882. for (var i = 0; i < 8; i++) {
  8883. this.makeImpl(i);
  8884. var lostPoint = QRUtil.getLostPoint(this);
  8885. if (i == 0 || minLostPoint > lostPoint) {
  8886. minLostPoint = lostPoint;
  8887. pattern = i;
  8888. bestModules = this.modules;
  8889. }
  8890. }
  8891. this.modules = bestModules;
  8892. this.setupTypeInfo(false, pattern);
  8893. if (this.typeNumber >= 7) {
  8894. this.setupTypeNumber(false);
  8895. }
  8896. },
  8897. /**
  8898. * 设置定位图形
  8899. * @return {[type]} [description]
  8900. */
  8901. setupTimingPattern: function setupTimingPattern() {
  8902. for (var r = 8; r < this.moduleCount - 8; r++) {
  8903. if (this.modules[r][6] != null) {
  8904. continue;
  8905. }
  8906. this.modules[r][6] = r % 2 == 0;
  8907. if (this.modules[6][r] != null) {
  8908. continue;
  8909. }
  8910. this.modules[6][r] = r % 2 == 0;
  8911. }
  8912. },
  8913. /**
  8914. * 设置矫正图形
  8915. * @return {[type]} [description]
  8916. */
  8917. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  8918. var pos = QRUtil.getPatternPosition(this.typeNumber);
  8919. for (var i = 0; i < pos.length; i++) {
  8920. for (var j = 0; j < pos.length; j++) {
  8921. var row = pos[i];
  8922. var col = pos[j];
  8923. if (this.modules[row][col] != null) {
  8924. continue;
  8925. }
  8926. for (var r = -2; r <= 2; r++) {
  8927. for (var c = -2; c <= 2; c++) {
  8928. if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
  8929. this.modules[row + r][col + c] = true;
  8930. } else {
  8931. this.modules[row + r][col + c] = false;
  8932. }
  8933. }
  8934. }
  8935. }
  8936. }
  8937. },
  8938. /**
  8939. * 设置版本信息(7以上版本才有)
  8940. * @param {bool} test 是否处于判断最佳掩膜阶段
  8941. * @return {[type]} [description]
  8942. */
  8943. setupTypeNumber: function setupTypeNumber(test) {
  8944. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  8945. for (var i = 0; i < 18; i++) {
  8946. var mod = !test && (bits >> i & 1) == 1;
  8947. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  8948. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  8949. }
  8950. },
  8951. /**
  8952. * 设置格式信息(纠错等级和掩膜版本)
  8953. * @param {bool} test
  8954. * @param {num} maskPattern 掩膜版本
  8955. * @return {}
  8956. */
  8957. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  8958. var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
  8959. var bits = QRUtil.getBCHTypeInfo(data);
  8960. // vertical
  8961. for (var i = 0; i < 15; i++) {
  8962. var mod = !test && (bits >> i & 1) == 1;
  8963. if (i < 6) {
  8964. this.modules[i][8] = mod;
  8965. } else if (i < 8) {
  8966. this.modules[i + 1][8] = mod;
  8967. } else {
  8968. this.modules[this.moduleCount - 15 + i][8] = mod;
  8969. }
  8970. // horizontal
  8971. var mod = !test && (bits >> i & 1) == 1;
  8972. if (i < 8) {
  8973. this.modules[8][this.moduleCount - i - 1] = mod;
  8974. } else if (i < 9) {
  8975. this.modules[8][15 - i - 1 + 1] = mod;
  8976. } else {
  8977. this.modules[8][15 - i - 1] = mod;
  8978. }
  8979. }
  8980. // fixed module
  8981. this.modules[this.moduleCount - 8][8] = !test;
  8982. },
  8983. /**
  8984. * 数据编码
  8985. * @return {[type]} [description]
  8986. */
  8987. createData: function createData() {
  8988. var buffer = new QRBitBuffer();
  8989. var lengthBits = this.typeNumber > 9 ? 16 : 8;
  8990. buffer.put(4, 4); //添加模式
  8991. buffer.put(this.utf8bytes.length, lengthBits);
  8992. for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
  8993. buffer.put(this.utf8bytes[i], 8);
  8994. }
  8995. if (buffer.length + 4 <= this.totalDataCount * 8) {
  8996. buffer.put(0, 4);
  8997. }
  8998. // padding
  8999. while (buffer.length % 8 != 0) {
  9000. buffer.putBit(false);
  9001. }
  9002. // padding
  9003. while (true) {
  9004. if (buffer.length >= this.totalDataCount * 8) {
  9005. break;
  9006. }
  9007. buffer.put(QRCodeAlg.PAD0, 8);
  9008. if (buffer.length >= this.totalDataCount * 8) {
  9009. break;
  9010. }
  9011. buffer.put(QRCodeAlg.PAD1, 8);
  9012. }
  9013. return this.createBytes(buffer);
  9014. },
  9015. /**
  9016. * 纠错码编码
  9017. * @param {buffer} buffer 数据编码
  9018. * @return {[type]}
  9019. */
  9020. createBytes: function createBytes(buffer) {
  9021. var offset = 0;
  9022. var maxDcCount = 0;
  9023. var maxEcCount = 0;
  9024. var length = this.rsBlock.length / 3;
  9025. var rsBlocks = new Array();
  9026. for (var i = 0; i < length; i++) {
  9027. var count = this.rsBlock[i * 3 + 0];
  9028. var totalCount = this.rsBlock[i * 3 + 1];
  9029. var dataCount = this.rsBlock[i * 3 + 2];
  9030. for (var j = 0; j < count; j++) {
  9031. rsBlocks.push([dataCount, totalCount]);
  9032. }
  9033. }
  9034. var dcdata = new Array(rsBlocks.length);
  9035. var ecdata = new Array(rsBlocks.length);
  9036. for (var r = 0; r < rsBlocks.length; r++) {
  9037. var dcCount = rsBlocks[r][0];
  9038. var ecCount = rsBlocks[r][1] - dcCount;
  9039. maxDcCount = Math.max(maxDcCount, dcCount);
  9040. maxEcCount = Math.max(maxEcCount, ecCount);
  9041. dcdata[r] = new Array(dcCount);
  9042. for (var i = 0; i < dcdata[r].length; i++) {
  9043. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  9044. }
  9045. offset += dcCount;
  9046. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  9047. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  9048. var modPoly = rawPoly.mod(rsPoly);
  9049. ecdata[r] = new Array(rsPoly.getLength() - 1);
  9050. for (var i = 0; i < ecdata[r].length; i++) {
  9051. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  9052. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  9053. }
  9054. }
  9055. var data = new Array(this.totalDataCount);
  9056. var index = 0;
  9057. for (var i = 0; i < maxDcCount; i++) {
  9058. for (var r = 0; r < rsBlocks.length; r++) {
  9059. if (i < dcdata[r].length) {
  9060. data[index++] = dcdata[r][i];
  9061. }
  9062. }
  9063. }
  9064. for (var i = 0; i < maxEcCount; i++) {
  9065. for (var r = 0; r < rsBlocks.length; r++) {
  9066. if (i < ecdata[r].length) {
  9067. data[index++] = ecdata[r][i];
  9068. }
  9069. }
  9070. }
  9071. return data;
  9072. },
  9073. /**
  9074. * 布置模块,构建最终信息
  9075. * @param {} data
  9076. * @param {} maskPattern
  9077. * @return {}
  9078. */
  9079. mapData: function mapData(data, maskPattern) {
  9080. var inc = -1;
  9081. var row = this.moduleCount - 1;
  9082. var bitIndex = 7;
  9083. var byteIndex = 0;
  9084. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  9085. if (col == 6) col--;
  9086. while (true) {
  9087. for (var c = 0; c < 2; c++) {
  9088. if (this.modules[row][col - c] == null) {
  9089. var dark = false;
  9090. if (byteIndex < data.length) {
  9091. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  9092. }
  9093. var mask = QRUtil.getMask(maskPattern, row, col - c);
  9094. if (mask) {
  9095. dark = !dark;
  9096. }
  9097. this.modules[row][col - c] = dark;
  9098. bitIndex--;
  9099. if (bitIndex == -1) {
  9100. byteIndex++;
  9101. bitIndex = 7;
  9102. }
  9103. }
  9104. }
  9105. row += inc;
  9106. if (row < 0 || this.moduleCount <= row) {
  9107. row -= inc;
  9108. inc = -inc;
  9109. break;
  9110. }
  9111. }
  9112. }
  9113. } };
  9114. /**
  9115. * 填充字段
  9116. */
  9117. QRCodeAlg.PAD0 = 0xEC;
  9118. QRCodeAlg.PAD1 = 0x11;
  9119. //---------------------------------------------------------------------
  9120. // 纠错等级对应的编码
  9121. //---------------------------------------------------------------------
  9122. var QRErrorCorrectLevel = [1, 0, 3, 2];
  9123. //---------------------------------------------------------------------
  9124. // 掩膜版本
  9125. //---------------------------------------------------------------------
  9126. var QRMaskPattern = {
  9127. PATTERN000: 0,
  9128. PATTERN001: 1,
  9129. PATTERN010: 2,
  9130. PATTERN011: 3,
  9131. PATTERN100: 4,
  9132. PATTERN101: 5,
  9133. PATTERN110: 6,
  9134. PATTERN111: 7 };
  9135. //---------------------------------------------------------------------
  9136. // 工具类
  9137. //---------------------------------------------------------------------
  9138. var QRUtil = {
  9139. /*
  9140. 每个版本矫正图形的位置
  9141. */
  9142. PATTERN_POSITION_TABLE: [
  9143. [],
  9144. [6, 18],
  9145. [6, 22],
  9146. [6, 26],
  9147. [6, 30],
  9148. [6, 34],
  9149. [6, 22, 38],
  9150. [6, 24, 42],
  9151. [6, 26, 46],
  9152. [6, 28, 50],
  9153. [6, 30, 54],
  9154. [6, 32, 58],
  9155. [6, 34, 62],
  9156. [6, 26, 46, 66],
  9157. [6, 26, 48, 70],
  9158. [6, 26, 50, 74],
  9159. [6, 30, 54, 78],
  9160. [6, 30, 56, 82],
  9161. [6, 30, 58, 86],
  9162. [6, 34, 62, 90],
  9163. [6, 28, 50, 72, 94],
  9164. [6, 26, 50, 74, 98],
  9165. [6, 30, 54, 78, 102],
  9166. [6, 28, 54, 80, 106],
  9167. [6, 32, 58, 84, 110],
  9168. [6, 30, 58, 86, 114],
  9169. [6, 34, 62, 90, 118],
  9170. [6, 26, 50, 74, 98, 122],
  9171. [6, 30, 54, 78, 102, 126],
  9172. [6, 26, 52, 78, 104, 130],
  9173. [6, 30, 56, 82, 108, 134],
  9174. [6, 34, 60, 86, 112, 138],
  9175. [6, 30, 58, 86, 114, 142],
  9176. [6, 34, 62, 90, 118, 146],
  9177. [6, 30, 54, 78, 102, 126, 150],
  9178. [6, 24, 50, 76, 102, 128, 154],
  9179. [6, 28, 54, 80, 106, 132, 158],
  9180. [6, 32, 58, 84, 110, 136, 162],
  9181. [6, 26, 54, 82, 110, 138, 166],
  9182. [6, 30, 58, 86, 114, 142, 170]],
  9183. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  9184. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  9185. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  9186. /*
  9187. BCH编码格式信息
  9188. */
  9189. getBCHTypeInfo: function getBCHTypeInfo(data) {
  9190. var d = data << 10;
  9191. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  9192. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  9193. }
  9194. return (data << 10 | d) ^ QRUtil.G15_MASK;
  9195. },
  9196. /*
  9197. BCH编码版本信息
  9198. */
  9199. getBCHTypeNumber: function getBCHTypeNumber(data) {
  9200. var d = data << 12;
  9201. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  9202. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  9203. }
  9204. return data << 12 | d;
  9205. },
  9206. /*
  9207. 获取BCH位信息
  9208. */
  9209. getBCHDigit: function getBCHDigit(data) {
  9210. var digit = 0;
  9211. while (data != 0) {
  9212. digit++;
  9213. data >>>= 1;
  9214. }
  9215. return digit;
  9216. },
  9217. /*
  9218. 获取版本对应的矫正图形位置
  9219. */
  9220. getPatternPosition: function getPatternPosition(typeNumber) {
  9221. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  9222. },
  9223. /*
  9224. 掩膜算法
  9225. */
  9226. getMask: function getMask(maskPattern, i, j) {
  9227. switch (maskPattern) {
  9228. case QRMaskPattern.PATTERN000:
  9229. return (i + j) % 2 == 0;
  9230. case QRMaskPattern.PATTERN001:
  9231. return i % 2 == 0;
  9232. case QRMaskPattern.PATTERN010:
  9233. return j % 3 == 0;
  9234. case QRMaskPattern.PATTERN011:
  9235. return (i + j) % 3 == 0;
  9236. case QRMaskPattern.PATTERN100:
  9237. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  9238. case QRMaskPattern.PATTERN101:
  9239. return i * j % 2 + i * j % 3 == 0;
  9240. case QRMaskPattern.PATTERN110:
  9241. return (i * j % 2 + i * j % 3) % 2 == 0;
  9242. case QRMaskPattern.PATTERN111:
  9243. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  9244. default:
  9245. throw new Error("bad maskPattern:" + maskPattern);}
  9246. },
  9247. /*
  9248. 获取RS的纠错多项式
  9249. */
  9250. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  9251. var a = new QRPolynomial([1], 0);
  9252. for (var i = 0; i < errorCorrectLength; i++) {
  9253. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  9254. }
  9255. return a;
  9256. },
  9257. /*
  9258. 获取评价
  9259. */
  9260. getLostPoint: function getLostPoint(qrCode) {
  9261. var moduleCount = qrCode.getModuleCount(),
  9262. lostPoint = 0,
  9263. darkCount = 0;
  9264. for (var row = 0; row < moduleCount; row++) {
  9265. var sameCount = 0;
  9266. var head = qrCode.modules[row][0];
  9267. for (var col = 0; col < moduleCount; col++) {
  9268. var current = qrCode.modules[row][col];
  9269. //level 3 评价
  9270. if (col < moduleCount - 6) {
  9271. if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
  9272. if (col < moduleCount - 10) {
  9273. if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
  9274. lostPoint += 40;
  9275. }
  9276. } else if (col > 3) {
  9277. if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
  9278. lostPoint += 40;
  9279. }
  9280. }
  9281. }
  9282. }
  9283. //level 2 评价
  9284. if (row < moduleCount - 1 && col < moduleCount - 1) {
  9285. var count = 0;
  9286. if (current) count++;
  9287. if (qrCode.modules[row + 1][col]) count++;
  9288. if (qrCode.modules[row][col + 1]) count++;
  9289. if (qrCode.modules[row + 1][col + 1]) count++;
  9290. if (count == 0 || count == 4) {
  9291. lostPoint += 3;
  9292. }
  9293. }
  9294. //level 1 评价
  9295. if (head ^ current) {
  9296. sameCount++;
  9297. } else {
  9298. head = current;
  9299. if (sameCount >= 5) {
  9300. lostPoint += 3 + sameCount - 5;
  9301. }
  9302. sameCount = 1;
  9303. }
  9304. //level 4 评价
  9305. if (current) {
  9306. darkCount++;
  9307. }
  9308. }
  9309. }
  9310. for (var col = 0; col < moduleCount; col++) {
  9311. var sameCount = 0;
  9312. var head = qrCode.modules[0][col];
  9313. for (var row = 0; row < moduleCount; row++) {
  9314. var current = qrCode.modules[row][col];
  9315. //level 3 评价
  9316. if (row < moduleCount - 6) {
  9317. if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
  9318. if (row < moduleCount - 10) {
  9319. if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
  9320. lostPoint += 40;
  9321. }
  9322. } else if (row > 3) {
  9323. if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
  9324. lostPoint += 40;
  9325. }
  9326. }
  9327. }
  9328. }
  9329. //level 1 评价
  9330. if (head ^ current) {
  9331. sameCount++;
  9332. } else {
  9333. head = current;
  9334. if (sameCount >= 5) {
  9335. lostPoint += 3 + sameCount - 5;
  9336. }
  9337. sameCount = 1;
  9338. }
  9339. }
  9340. }
  9341. // LEVEL4
  9342. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  9343. lostPoint += ratio * 10;
  9344. return lostPoint;
  9345. } };
  9346. //---------------------------------------------------------------------
  9347. // QRMath使用的数学工具
  9348. //---------------------------------------------------------------------
  9349. var QRMath = {
  9350. /*
  9351. 将n转化为a^m
  9352. */
  9353. glog: function glog(n) {
  9354. if (n < 1) {
  9355. throw new Error("glog(" + n + ")");
  9356. }
  9357. return QRMath.LOG_TABLE[n];
  9358. },
  9359. /*
  9360. 将a^m转化为n
  9361. */
  9362. gexp: function gexp(n) {
  9363. while (n < 0) {
  9364. n += 255;
  9365. }
  9366. while (n >= 256) {
  9367. n -= 255;
  9368. }
  9369. return QRMath.EXP_TABLE[n];
  9370. },
  9371. EXP_TABLE: new Array(256),
  9372. LOG_TABLE: new Array(256) };
  9373. for (var i = 0; i < 8; i++) {
  9374. QRMath.EXP_TABLE[i] = 1 << i;
  9375. }
  9376. for (var i = 8; i < 256; i++) {
  9377. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
  9378. }
  9379. for (var i = 0; i < 255; i++) {
  9380. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  9381. }
  9382. //---------------------------------------------------------------------
  9383. // QRPolynomial 多项式
  9384. //---------------------------------------------------------------------
  9385. /**
  9386. * 多项式类
  9387. * @param {Array} num 系数
  9388. * @param {num} shift a^shift
  9389. */
  9390. function QRPolynomial(num, shift) {
  9391. if (num.length == undefined) {
  9392. throw new Error(num.length + "/" + shift);
  9393. }
  9394. var offset = 0;
  9395. while (offset < num.length && num[offset] == 0) {
  9396. offset++;
  9397. }
  9398. this.num = new Array(num.length - offset + shift);
  9399. for (var i = 0; i < num.length - offset; i++) {
  9400. this.num[i] = num[i + offset];
  9401. }
  9402. }
  9403. QRPolynomial.prototype = {
  9404. get: function get(index) {
  9405. return this.num[index];
  9406. },
  9407. getLength: function getLength() {
  9408. return this.num.length;
  9409. },
  9410. /**
  9411. * 多项式乘法
  9412. * @param {QRPolynomial} e 被乘多项式
  9413. * @return {[type]} [description]
  9414. */
  9415. multiply: function multiply(e) {
  9416. var num = new Array(this.getLength() + e.getLength() - 1);
  9417. for (var i = 0; i < this.getLength(); i++) {
  9418. for (var j = 0; j < e.getLength(); j++) {
  9419. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  9420. }
  9421. }
  9422. return new QRPolynomial(num, 0);
  9423. },
  9424. /**
  9425. * 多项式模运算
  9426. * @param {QRPolynomial} e 模多项式
  9427. * @return {}
  9428. */
  9429. mod: function mod(e) {
  9430. var tl = this.getLength(),
  9431. el = e.getLength();
  9432. if (tl - el < 0) {
  9433. return this;
  9434. }
  9435. var num = new Array(tl);
  9436. for (var i = 0; i < tl; i++) {
  9437. num[i] = this.get(i);
  9438. }
  9439. while (num.length >= el) {
  9440. var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
  9441. for (var i = 0; i < e.getLength(); i++) {
  9442. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  9443. }
  9444. while (num[0] == 0) {
  9445. num.shift();
  9446. }
  9447. }
  9448. return new QRPolynomial(num, 0);
  9449. } };
  9450. //---------------------------------------------------------------------
  9451. // RS_BLOCK_TABLE
  9452. //---------------------------------------------------------------------
  9453. /*
  9454. 二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
  9455. */
  9456. var RS_BLOCK_TABLE = [
  9457. // L
  9458. // M
  9459. // Q
  9460. // H
  9461. // 1
  9462. [1, 26, 19],
  9463. [1, 26, 16],
  9464. [1, 26, 13],
  9465. [1, 26, 9],
  9466. // 2
  9467. [1, 44, 34],
  9468. [1, 44, 28],
  9469. [1, 44, 22],
  9470. [1, 44, 16],
  9471. // 3
  9472. [1, 70, 55],
  9473. [1, 70, 44],
  9474. [2, 35, 17],
  9475. [2, 35, 13],
  9476. // 4
  9477. [1, 100, 80],
  9478. [2, 50, 32],
  9479. [2, 50, 24],
  9480. [4, 25, 9],
  9481. // 5
  9482. [1, 134, 108],
  9483. [2, 67, 43],
  9484. [2, 33, 15, 2, 34, 16],
  9485. [2, 33, 11, 2, 34, 12],
  9486. // 6
  9487. [2, 86, 68],
  9488. [4, 43, 27],
  9489. [4, 43, 19],
  9490. [4, 43, 15],
  9491. // 7
  9492. [2, 98, 78],
  9493. [4, 49, 31],
  9494. [2, 32, 14, 4, 33, 15],
  9495. [4, 39, 13, 1, 40, 14],
  9496. // 8
  9497. [2, 121, 97],
  9498. [2, 60, 38, 2, 61, 39],
  9499. [4, 40, 18, 2, 41, 19],
  9500. [4, 40, 14, 2, 41, 15],
  9501. // 9
  9502. [2, 146, 116],
  9503. [3, 58, 36, 2, 59, 37],
  9504. [4, 36, 16, 4, 37, 17],
  9505. [4, 36, 12, 4, 37, 13],
  9506. // 10
  9507. [2, 86, 68, 2, 87, 69],
  9508. [4, 69, 43, 1, 70, 44],
  9509. [6, 43, 19, 2, 44, 20],
  9510. [6, 43, 15, 2, 44, 16],
  9511. // 11
  9512. [4, 101, 81],
  9513. [1, 80, 50, 4, 81, 51],
  9514. [4, 50, 22, 4, 51, 23],
  9515. [3, 36, 12, 8, 37, 13],
  9516. // 12
  9517. [2, 116, 92, 2, 117, 93],
  9518. [6, 58, 36, 2, 59, 37],
  9519. [4, 46, 20, 6, 47, 21],
  9520. [7, 42, 14, 4, 43, 15],
  9521. // 13
  9522. [4, 133, 107],
  9523. [8, 59, 37, 1, 60, 38],
  9524. [8, 44, 20, 4, 45, 21],
  9525. [12, 33, 11, 4, 34, 12],
  9526. // 14
  9527. [3, 145, 115, 1, 146, 116],
  9528. [4, 64, 40, 5, 65, 41],
  9529. [11, 36, 16, 5, 37, 17],
  9530. [11, 36, 12, 5, 37, 13],
  9531. // 15
  9532. [5, 109, 87, 1, 110, 88],
  9533. [5, 65, 41, 5, 66, 42],
  9534. [5, 54, 24, 7, 55, 25],
  9535. [11, 36, 12],
  9536. // 16
  9537. [5, 122, 98, 1, 123, 99],
  9538. [7, 73, 45, 3, 74, 46],
  9539. [15, 43, 19, 2, 44, 20],
  9540. [3, 45, 15, 13, 46, 16],
  9541. // 17
  9542. [1, 135, 107, 5, 136, 108],
  9543. [10, 74, 46, 1, 75, 47],
  9544. [1, 50, 22, 15, 51, 23],
  9545. [2, 42, 14, 17, 43, 15],
  9546. // 18
  9547. [5, 150, 120, 1, 151, 121],
  9548. [9, 69, 43, 4, 70, 44],
  9549. [17, 50, 22, 1, 51, 23],
  9550. [2, 42, 14, 19, 43, 15],
  9551. // 19
  9552. [3, 141, 113, 4, 142, 114],
  9553. [3, 70, 44, 11, 71, 45],
  9554. [17, 47, 21, 4, 48, 22],
  9555. [9, 39, 13, 16, 40, 14],
  9556. // 20
  9557. [3, 135, 107, 5, 136, 108],
  9558. [3, 67, 41, 13, 68, 42],
  9559. [15, 54, 24, 5, 55, 25],
  9560. [15, 43, 15, 10, 44, 16],
  9561. // 21
  9562. [4, 144, 116, 4, 145, 117],
  9563. [17, 68, 42],
  9564. [17, 50, 22, 6, 51, 23],
  9565. [19, 46, 16, 6, 47, 17],
  9566. // 22
  9567. [2, 139, 111, 7, 140, 112],
  9568. [17, 74, 46],
  9569. [7, 54, 24, 16, 55, 25],
  9570. [34, 37, 13],
  9571. // 23
  9572. [4, 151, 121, 5, 152, 122],
  9573. [4, 75, 47, 14, 76, 48],
  9574. [11, 54, 24, 14, 55, 25],
  9575. [16, 45, 15, 14, 46, 16],
  9576. // 24
  9577. [6, 147, 117, 4, 148, 118],
  9578. [6, 73, 45, 14, 74, 46],
  9579. [11, 54, 24, 16, 55, 25],
  9580. [30, 46, 16, 2, 47, 17],
  9581. // 25
  9582. [8, 132, 106, 4, 133, 107],
  9583. [8, 75, 47, 13, 76, 48],
  9584. [7, 54, 24, 22, 55, 25],
  9585. [22, 45, 15, 13, 46, 16],
  9586. // 26
  9587. [10, 142, 114, 2, 143, 115],
  9588. [19, 74, 46, 4, 75, 47],
  9589. [28, 50, 22, 6, 51, 23],
  9590. [33, 46, 16, 4, 47, 17],
  9591. // 27
  9592. [8, 152, 122, 4, 153, 123],
  9593. [22, 73, 45, 3, 74, 46],
  9594. [8, 53, 23, 26, 54, 24],
  9595. [12, 45, 15, 28, 46, 16],
  9596. // 28
  9597. [3, 147, 117, 10, 148, 118],
  9598. [3, 73, 45, 23, 74, 46],
  9599. [4, 54, 24, 31, 55, 25],
  9600. [11, 45, 15, 31, 46, 16],
  9601. // 29
  9602. [7, 146, 116, 7, 147, 117],
  9603. [21, 73, 45, 7, 74, 46],
  9604. [1, 53, 23, 37, 54, 24],
  9605. [19, 45, 15, 26, 46, 16],
  9606. // 30
  9607. [5, 145, 115, 10, 146, 116],
  9608. [19, 75, 47, 10, 76, 48],
  9609. [15, 54, 24, 25, 55, 25],
  9610. [23, 45, 15, 25, 46, 16],
  9611. // 31
  9612. [13, 145, 115, 3, 146, 116],
  9613. [2, 74, 46, 29, 75, 47],
  9614. [42, 54, 24, 1, 55, 25],
  9615. [23, 45, 15, 28, 46, 16],
  9616. // 32
  9617. [17, 145, 115],
  9618. [10, 74, 46, 23, 75, 47],
  9619. [10, 54, 24, 35, 55, 25],
  9620. [19, 45, 15, 35, 46, 16],
  9621. // 33
  9622. [17, 145, 115, 1, 146, 116],
  9623. [14, 74, 46, 21, 75, 47],
  9624. [29, 54, 24, 19, 55, 25],
  9625. [11, 45, 15, 46, 46, 16],
  9626. // 34
  9627. [13, 145, 115, 6, 146, 116],
  9628. [14, 74, 46, 23, 75, 47],
  9629. [44, 54, 24, 7, 55, 25],
  9630. [59, 46, 16, 1, 47, 17],
  9631. // 35
  9632. [12, 151, 121, 7, 152, 122],
  9633. [12, 75, 47, 26, 76, 48],
  9634. [39, 54, 24, 14, 55, 25],
  9635. [22, 45, 15, 41, 46, 16],
  9636. // 36
  9637. [6, 151, 121, 14, 152, 122],
  9638. [6, 75, 47, 34, 76, 48],
  9639. [46, 54, 24, 10, 55, 25],
  9640. [2, 45, 15, 64, 46, 16],
  9641. // 37
  9642. [17, 152, 122, 4, 153, 123],
  9643. [29, 74, 46, 14, 75, 47],
  9644. [49, 54, 24, 10, 55, 25],
  9645. [24, 45, 15, 46, 46, 16],
  9646. // 38
  9647. [4, 152, 122, 18, 153, 123],
  9648. [13, 74, 46, 32, 75, 47],
  9649. [48, 54, 24, 14, 55, 25],
  9650. [42, 45, 15, 32, 46, 16],
  9651. // 39
  9652. [20, 147, 117, 4, 148, 118],
  9653. [40, 75, 47, 7, 76, 48],
  9654. [43, 54, 24, 22, 55, 25],
  9655. [10, 45, 15, 67, 46, 16],
  9656. // 40
  9657. [19, 148, 118, 6, 149, 119],
  9658. [18, 75, 47, 31, 76, 48],
  9659. [34, 54, 24, 34, 55, 25],
  9660. [20, 45, 15, 61, 46, 16]];
  9661. /**
  9662. * 根据数据获取对应版本
  9663. * @return {[type]} [description]
  9664. */
  9665. QRCodeAlg.prototype.getRightType = function () {
  9666. for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
  9667. var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
  9668. if (rsBlock == undefined) {
  9669. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
  9670. }
  9671. var length = rsBlock.length / 3;
  9672. var totalDataCount = 0;
  9673. for (var i = 0; i < length; i++) {
  9674. var count = rsBlock[i * 3 + 0];
  9675. var dataCount = rsBlock[i * 3 + 2];
  9676. totalDataCount += dataCount * count;
  9677. }
  9678. var lengthBytes = typeNumber > 9 ? 2 : 1;
  9679. if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
  9680. this.typeNumber = typeNumber;
  9681. this.rsBlock = rsBlock;
  9682. this.totalDataCount = totalDataCount;
  9683. break;
  9684. }
  9685. }
  9686. };
  9687. //---------------------------------------------------------------------
  9688. // QRBitBuffer
  9689. //---------------------------------------------------------------------
  9690. function QRBitBuffer() {
  9691. this.buffer = new Array();
  9692. this.length = 0;
  9693. }
  9694. QRBitBuffer.prototype = {
  9695. get: function get(index) {
  9696. var bufIndex = Math.floor(index / 8);
  9697. return this.buffer[bufIndex] >>> 7 - index % 8 & 1;
  9698. },
  9699. put: function put(num, length) {
  9700. for (var i = 0; i < length; i++) {
  9701. this.putBit(num >>> length - i - 1 & 1);
  9702. }
  9703. },
  9704. putBit: function putBit(bit) {
  9705. var bufIndex = Math.floor(this.length / 8);
  9706. if (this.buffer.length <= bufIndex) {
  9707. this.buffer.push(0);
  9708. }
  9709. if (bit) {
  9710. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  9711. }
  9712. this.length++;
  9713. } };
  9714. // xzedit
  9715. var qrcodeAlgObjCache = [];
  9716. /**
  9717. * 二维码构造函数,主要用于绘制
  9718. * @param {参数列表} opt 传递参数
  9719. * @return {}
  9720. */
  9721. QRCode = function QRCode(opt) {
  9722. //设置默认参数
  9723. this.options = {
  9724. text: '',
  9725. size: 256,
  9726. correctLevel: 3,
  9727. background: '#ffffff',
  9728. foreground: '#000000',
  9729. pdground: '#000000',
  9730. image: '',
  9731. imageSize: 30,
  9732. canvasId: opt.canvasId,
  9733. context: opt.context,
  9734. usingComponents: opt.usingComponents,
  9735. showLoading: opt.showLoading,
  9736. loadingText: opt.loadingText };
  9737. if (typeof opt === 'string') {// 只编码ASCII字符串
  9738. opt = {
  9739. text: opt };
  9740. }
  9741. if (opt) {
  9742. for (var i in opt) {
  9743. this.options[i] = opt[i];
  9744. }
  9745. }
  9746. //使用QRCodeAlg创建二维码结构
  9747. var qrCodeAlg = null;
  9748. for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
  9749. if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
  9750. qrCodeAlg = qrcodeAlgObjCache[i].obj;
  9751. break;
  9752. }
  9753. }
  9754. if (i == l) {
  9755. qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
  9756. qrcodeAlgObjCache.push({
  9757. text: this.options.text,
  9758. correctLevel: this.options.correctLevel,
  9759. obj: qrCodeAlg });
  9760. }
  9761. /**
  9762. * 计算矩阵点的前景色
  9763. * @param {Obj} config
  9764. * @param {Number} config.row 点x坐标
  9765. * @param {Number} config.col 点y坐标
  9766. * @param {Number} config.count 矩阵大小
  9767. * @param {Number} config.options 组件的options
  9768. * @return {String}
  9769. */
  9770. var getForeGround = function getForeGround(config) {
  9771. var options = config.options;
  9772. if (options.pdground && (
  9773. config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5 ||
  9774. config.row > config.count - 6 && config.row < config.count - 2 && config.col > 1 && config.col < 5 ||
  9775. config.row > 1 && config.row < 5 && config.col > config.count - 6 && config.col < config.count - 2))
  9776. {
  9777. return options.pdground;
  9778. }
  9779. return options.foreground;
  9780. };
  9781. // 创建canvas
  9782. var createCanvas = function createCanvas(options) {
  9783. if (options.showLoading) {
  9784. uni.showLoading({
  9785. title: options.loadingText,
  9786. mask: true });
  9787. }
  9788. var ctx = uni.createCanvasContext(options.canvasId, options.context);
  9789. var count = qrCodeAlg.getModuleCount();
  9790. var ratioSize = options.size;
  9791. var ratioImgSize = options.imageSize;
  9792. //计算每个点的长宽
  9793. var tileW = (ratioSize / count).toPrecision(4);
  9794. var tileH = (ratioSize / count).toPrecision(4);
  9795. //绘制
  9796. for (var row = 0; row < count; row++) {
  9797. for (var col = 0; col < count; col++) {
  9798. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  9799. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  9800. var foreground = getForeGround({
  9801. row: row,
  9802. col: col,
  9803. count: count,
  9804. options: options });
  9805. ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
  9806. ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
  9807. }
  9808. }
  9809. if (options.image) {
  9810. // 画圆角矩形
  9811. var drawRoundedRect = function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
  9812. ctxi.setLineWidth(lineWidth);
  9813. ctxi.setFillStyle(options.background);
  9814. ctxi.setStrokeStyle(options.background);
  9815. ctxi.beginPath(); // draw top and top right corner
  9816. ctxi.moveTo(x + r, y);
  9817. ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
  9818. ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
  9819. ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
  9820. ctxi.arcTo(x, y, x + r, y, r);
  9821. ctxi.closePath();
  9822. if (fill) {
  9823. ctxi.fill();
  9824. }
  9825. if (stroke) {
  9826. ctxi.stroke();
  9827. }
  9828. };var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true);ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
  9829. }
  9830. setTimeout(function () {
  9831. ctx.draw(true, function () {
  9832. // 保存到临时区域
  9833. setTimeout(function () {
  9834. uni.canvasToTempFilePath({
  9835. width: options.width,
  9836. height: options.height,
  9837. destWidth: options.width,
  9838. destHeight: options.height,
  9839. canvasId: options.canvasId,
  9840. quality: Number(1),
  9841. success: function success(res) {
  9842. if (options.cbResult) {
  9843. options.cbResult(res.tempFilePath);
  9844. }
  9845. },
  9846. fail: function fail(res) {
  9847. if (options.cbResult) {
  9848. options.cbResult(res);
  9849. }
  9850. },
  9851. complete: function complete() {
  9852. if (options.showLoading) {
  9853. uni.hideLoading();
  9854. }
  9855. } },
  9856. options.context);
  9857. }, options.text.length + 100);
  9858. });
  9859. }, options.usingComponents ? 0 : 150);
  9860. };
  9861. createCanvas(this.options);
  9862. // 空判定
  9863. var empty = function empty(v) {
  9864. var tp = typeof v,
  9865. rt = false;
  9866. if (tp == "number" && String(v) == "") {
  9867. rt = true;
  9868. } else if (tp == "undefined") {
  9869. rt = true;
  9870. } else if (tp == "object") {
  9871. if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true;
  9872. } else if (tp == "string") {
  9873. if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true;
  9874. } else if (tp == "function") {
  9875. rt = false;
  9876. }
  9877. return rt;
  9878. };
  9879. };
  9880. QRCode.prototype.clear = function (fn) {
  9881. var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context);
  9882. ctx.clearRect(0, 0, this.options.size, this.options.size);
  9883. ctx.draw(false, function () {
  9884. if (fn) {
  9885. fn();
  9886. }
  9887. });
  9888. };
  9889. })();var _default =
  9890. QRCode;exports.default = _default;
  9891. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9892. /***/ }),
  9893. /***/ 382:
  9894. /*!**************************************************!*\
  9895. !*** D:/六牛项目/lnyk/components/lb-picker/utils.js ***!
  9896. \**************************************************/
  9897. /*! no static exports found */
  9898. /***/ (function(module, exports, __webpack_require__) {
  9899. "use strict";
  9900. Object.defineProperty(exports, "__esModule", { value: true });exports.isObject = isObject;exports.isFunction = isFunction;exports.getColumns = getColumns; /**
  9901. * 判断是否是对象
  9902. *
  9903. * @export
  9904. * @param {*} val
  9905. * @returns true/false
  9906. */
  9907. function isObject(val) {
  9908. return Object.prototype.toString.call(val) === '[object Object]';
  9909. }
  9910. /**
  9911. * 判断是否是Function
  9912. *
  9913. * @export
  9914. * @param {*} val
  9915. * @returns true/false
  9916. */
  9917. function isFunction(val) {
  9918. return Object.prototype.toString.call(val) === '[object Function]';
  9919. }
  9920. /**
  9921. * 根据value获取columns信息
  9922. *
  9923. * @export
  9924. * @param {*} { value, list, mode, props, level }
  9925. * @param {number} [type=2] 查询不到value数据返回数据类型 1空值null 2默认第一个选项
  9926. * @returns
  9927. */
  9928. function getColumns(_ref) {var value = _ref.value,list = _ref.list,mode = _ref.mode,props = _ref.props,level = _ref.level;var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  9929. var pickerValue = [];
  9930. var pickerColumns = [];
  9931. var selectValue = [];
  9932. var selectItem = [];
  9933. var columnsInfo = null;
  9934. switch (mode) {
  9935. case 'selector':
  9936. var index = list.findIndex(function (item) {
  9937. return isObject(item) ? item[props.value] === value : item === value;
  9938. });
  9939. if (index === -1 && type === 1) {
  9940. columnsInfo = null;
  9941. } else {
  9942. index = index > -1 ? index : 0;
  9943. selectItem = list[index];
  9944. selectValue = isObject(selectItem) ?
  9945. selectItem[props.value] :
  9946. selectItem;
  9947. pickerColumns = list;
  9948. pickerValue = [index];
  9949. columnsInfo = {
  9950. index: pickerValue,
  9951. value: selectValue,
  9952. item: selectItem,
  9953. columns: pickerColumns };
  9954. }
  9955. break;
  9956. case 'multiSelector':
  9957. var setPickerItems = function setPickerItems() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  9958. if (!data.length) return;
  9959. var defaultValue = value || [];
  9960. if (index < level) {
  9961. var _value = defaultValue[index] || '';
  9962. var i = data.findIndex(function (item) {return item[props.value] === _value;});
  9963. if (i === -1 && type === 1) return;
  9964. i = i > -1 ? i : 0;
  9965. pickerValue[index] = i;
  9966. pickerColumns[index] = data;
  9967. if (data[i]) {
  9968. selectValue[index] = data[i][props.value];
  9969. selectItem[index] = data[i];
  9970. setPickerItems(data[i][props.children] || [], index + 1);
  9971. }
  9972. }
  9973. };
  9974. setPickerItems(list);
  9975. if (!selectValue.length && type === 1) {
  9976. columnsInfo = null;
  9977. } else {
  9978. columnsInfo = {
  9979. index: pickerValue,
  9980. value: selectValue,
  9981. item: selectItem,
  9982. columns: pickerColumns };
  9983. }
  9984. break;
  9985. case 'unlinkedSelector':
  9986. list.forEach(function (item, i) {
  9987. var index = item.findIndex(function (item) {
  9988. return isObject(item) ?
  9989. item[props.value] === value[i] :
  9990. item === value[i];
  9991. });
  9992. if (index === -1 && type === 1) return;
  9993. index = index > -1 ? index : 0;
  9994. var columnItem = list[i][index];
  9995. var valueItem = isObject(columnItem) ?
  9996. columnItem[props.value] :
  9997. columnItem;
  9998. pickerValue[i] = index;
  9999. selectValue[i] = valueItem;
  10000. selectItem[i] = columnItem;
  10001. });
  10002. pickerColumns = list;
  10003. if (!selectValue.length && type === 1) {
  10004. columnsInfo = null;
  10005. } else {
  10006. columnsInfo = {
  10007. index: pickerValue,
  10008. value: selectValue,
  10009. item: selectItem,
  10010. columns: pickerColumns };
  10011. }
  10012. break;}
  10013. return columnsInfo;
  10014. }
  10015. /***/ }),
  10016. /***/ 4:
  10017. /*!*************************************************************!*\
  10018. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  10019. \*************************************************************/
  10020. /*! no static exports found */
  10021. /***/ (function(module, exports, __webpack_require__) {
  10022. "use strict";
  10023. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  10024. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  10025. var defaultDelimiters = ['{', '}'];var
  10026. BaseFormatter = /*#__PURE__*/function () {
  10027. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  10028. this._caches = Object.create(null);
  10029. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  10030. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  10031. if (!values) {
  10032. return [message];
  10033. }
  10034. var tokens = this._caches[message];
  10035. if (!tokens) {
  10036. tokens = parse(message, delimiters);
  10037. this._caches[message] = tokens;
  10038. }
  10039. return compile(tokens, values);
  10040. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  10041. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  10042. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  10043. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  10044. var tokens = [];
  10045. var position = 0;
  10046. var text = '';
  10047. while (position < format.length) {
  10048. var char = format[position++];
  10049. if (char === startDelimiter) {
  10050. if (text) {
  10051. tokens.push({ type: 'text', value: text });
  10052. }
  10053. text = '';
  10054. var sub = '';
  10055. char = format[position++];
  10056. while (char !== undefined && char !== endDelimiter) {
  10057. sub += char;
  10058. char = format[position++];
  10059. }
  10060. var isClosed = char === endDelimiter;
  10061. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  10062. 'list' :
  10063. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  10064. 'named' :
  10065. 'unknown';
  10066. tokens.push({ value: sub, type: type });
  10067. }
  10068. // else if (char === '%') {
  10069. // // when found rails i18n syntax, skip text capture
  10070. // if (format[position] !== '{') {
  10071. // text += char
  10072. // }
  10073. // }
  10074. else {
  10075. text += char;
  10076. }
  10077. }
  10078. text && tokens.push({ type: 'text', value: text });
  10079. return tokens;
  10080. }
  10081. function compile(tokens, values) {
  10082. var compiled = [];
  10083. var index = 0;
  10084. var mode = isArray(values) ?
  10085. 'list' :
  10086. isObject(values) ?
  10087. 'named' :
  10088. 'unknown';
  10089. if (mode === 'unknown') {
  10090. return compiled;
  10091. }
  10092. while (index < tokens.length) {
  10093. var token = tokens[index];
  10094. switch (token.type) {
  10095. case 'text':
  10096. compiled.push(token.value);
  10097. break;
  10098. case 'list':
  10099. compiled.push(values[parseInt(token.value, 10)]);
  10100. break;
  10101. case 'named':
  10102. if (mode === 'named') {
  10103. compiled.push(values[token.value]);
  10104. } else
  10105. {
  10106. if (true) {
  10107. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  10108. }
  10109. }
  10110. break;
  10111. case 'unknown':
  10112. if (true) {
  10113. console.warn("Detect 'unknown' type of token!");
  10114. }
  10115. break;}
  10116. index++;
  10117. }
  10118. return compiled;
  10119. }
  10120. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  10121. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  10122. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  10123. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  10124. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  10125. var hasOwnProperty = Object.prototype.hasOwnProperty;
  10126. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  10127. var defaultFormatter = new BaseFormatter();
  10128. function include(str, parts) {
  10129. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  10130. }
  10131. function startsWith(str, parts) {
  10132. return parts.find(function (part) {return str.indexOf(part) === 0;});
  10133. }
  10134. function normalizeLocale(locale, messages) {
  10135. if (!locale) {
  10136. return;
  10137. }
  10138. locale = locale.trim().replace(/_/g, '-');
  10139. if (messages && messages[locale]) {
  10140. return locale;
  10141. }
  10142. locale = locale.toLowerCase();
  10143. if (locale.indexOf('zh') === 0) {
  10144. if (locale.indexOf('-hans') > -1) {
  10145. return LOCALE_ZH_HANS;
  10146. }
  10147. if (locale.indexOf('-hant') > -1) {
  10148. return LOCALE_ZH_HANT;
  10149. }
  10150. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  10151. return LOCALE_ZH_HANT;
  10152. }
  10153. return LOCALE_ZH_HANS;
  10154. }
  10155. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  10156. if (lang) {
  10157. return lang;
  10158. }
  10159. }var
  10160. I18n = /*#__PURE__*/function () {
  10161. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  10162. this.locale = LOCALE_EN;
  10163. this.fallbackLocale = LOCALE_EN;
  10164. this.message = {};
  10165. this.messages = {};
  10166. this.watchers = [];
  10167. if (fallbackLocale) {
  10168. this.fallbackLocale = fallbackLocale;
  10169. }
  10170. this.formater = formater || defaultFormatter;
  10171. this.messages = messages || {};
  10172. this.setLocale(locale || LOCALE_EN);
  10173. if (watcher) {
  10174. this.watchLocale(watcher);
  10175. }
  10176. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  10177. locale) {var _this = this;
  10178. var oldLocale = this.locale;
  10179. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  10180. if (!this.messages[this.locale]) {
  10181. // 可能初始化时不存在
  10182. this.messages[this.locale] = {};
  10183. }
  10184. this.message = this.messages[this.locale];
  10185. // 仅发生变化时,通知
  10186. if (oldLocale !== this.locale) {
  10187. this.watchers.forEach(function (watcher) {
  10188. watcher(_this.locale, oldLocale);
  10189. });
  10190. }
  10191. } }, { key: "getLocale", value: function getLocale()
  10192. {
  10193. return this.locale;
  10194. } }, { key: "watchLocale", value: function watchLocale(
  10195. fn) {var _this2 = this;
  10196. var index = this.watchers.push(fn) - 1;
  10197. return function () {
  10198. _this2.watchers.splice(index, 1);
  10199. };
  10200. } }, { key: "add", value: function add(
  10201. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10202. var curMessages = this.messages[locale];
  10203. if (curMessages) {
  10204. if (override) {
  10205. Object.assign(curMessages, message);
  10206. } else
  10207. {
  10208. Object.keys(message).forEach(function (key) {
  10209. if (!hasOwn(curMessages, key)) {
  10210. curMessages[key] = message[key];
  10211. }
  10212. });
  10213. }
  10214. } else
  10215. {
  10216. this.messages[locale] = message;
  10217. }
  10218. } }, { key: "f", value: function f(
  10219. message, values, delimiters) {
  10220. return this.formater.interpolate(message, values, delimiters).join('');
  10221. } }, { key: "t", value: function t(
  10222. key, locale, values) {
  10223. var message = this.message;
  10224. if (typeof locale === 'string') {
  10225. locale = normalizeLocale(locale, this.messages);
  10226. locale && (message = this.messages[locale]);
  10227. } else
  10228. {
  10229. values = locale;
  10230. }
  10231. if (!hasOwn(message, key)) {
  10232. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  10233. return key;
  10234. }
  10235. return this.formater.interpolate(message[key], values).join('');
  10236. } }]);return I18n;}();exports.I18n = I18n;
  10237. function watchAppLocale(appVm, i18n) {
  10238. // 需要保证 watch 的触发在组件渲染之前
  10239. if (appVm.$watchLocale) {
  10240. // vue2
  10241. appVm.$watchLocale(function (newLocale) {
  10242. i18n.setLocale(newLocale);
  10243. });
  10244. } else
  10245. {
  10246. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  10247. i18n.setLocale(newLocale);
  10248. });
  10249. }
  10250. }
  10251. function getDefaultLocale() {
  10252. if (typeof uni !== 'undefined' && uni.getLocale) {
  10253. return uni.getLocale();
  10254. }
  10255. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  10256. if (typeof global !== 'undefined' && global.getLocale) {
  10257. return global.getLocale();
  10258. }
  10259. return LOCALE_EN;
  10260. }
  10261. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  10262. // 兼容旧版本入参
  10263. if (typeof locale !== 'string') {var _ref4 =
  10264. [
  10265. messages,
  10266. locale];locale = _ref4[0];messages = _ref4[1];
  10267. }
  10268. if (typeof locale !== 'string') {
  10269. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  10270. locale = getDefaultLocale();
  10271. }
  10272. if (typeof fallbackLocale !== 'string') {
  10273. fallbackLocale =
  10274. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  10275. LOCALE_EN;
  10276. }
  10277. var i18n = new I18n({
  10278. locale: locale,
  10279. fallbackLocale: fallbackLocale,
  10280. messages: messages,
  10281. watcher: watcher });
  10282. var _t = function t(key, values) {
  10283. if (typeof getApp !== 'function') {
  10284. // app view
  10285. /* eslint-disable no-func-assign */
  10286. _t = function t(key, values) {
  10287. return i18n.t(key, values);
  10288. };
  10289. } else
  10290. {
  10291. var isWatchedAppLocale = false;
  10292. _t = function t(key, values) {
  10293. var appVm = getApp().$vm;
  10294. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  10295. // options: {
  10296. // type: Array,
  10297. // default () {
  10298. // return [{
  10299. // icon: 'shop',
  10300. // text: t("uni-goods-nav.options.shop"),
  10301. // }, {
  10302. // icon: 'cart',
  10303. // text: t("uni-goods-nav.options.cart")
  10304. // }]
  10305. // }
  10306. // },
  10307. if (appVm) {
  10308. // 触发响应式
  10309. appVm.$locale;
  10310. if (!isWatchedAppLocale) {
  10311. isWatchedAppLocale = true;
  10312. watchAppLocale(appVm, i18n);
  10313. }
  10314. }
  10315. return i18n.t(key, values);
  10316. };
  10317. }
  10318. return _t(key, values);
  10319. };
  10320. return {
  10321. i18n: i18n,
  10322. f: function f(message, values, delimiters) {
  10323. return i18n.f(message, values, delimiters);
  10324. },
  10325. t: function t(key, values) {
  10326. return _t(key, values);
  10327. },
  10328. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10329. return i18n.add(locale, message, override);
  10330. },
  10331. watch: function watch(fn) {
  10332. return i18n.watchLocale(fn);
  10333. },
  10334. getLocale: function getLocale() {
  10335. return i18n.getLocale();
  10336. },
  10337. setLocale: function setLocale(newLocale) {
  10338. return i18n.setLocale(newLocale);
  10339. } };
  10340. }
  10341. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  10342. var formater;
  10343. function hasI18nJson(jsonObj, delimiters) {
  10344. if (!formater) {
  10345. formater = new BaseFormatter();
  10346. }
  10347. return walkJsonObj(jsonObj, function (jsonObj, key) {
  10348. var value = jsonObj[key];
  10349. if (isString(value)) {
  10350. if (isI18nStr(value, delimiters)) {
  10351. return true;
  10352. }
  10353. } else
  10354. {
  10355. return hasI18nJson(value, delimiters);
  10356. }
  10357. });
  10358. }
  10359. function parseI18nJson(jsonObj, values, delimiters) {
  10360. if (!formater) {
  10361. formater = new BaseFormatter();
  10362. }
  10363. walkJsonObj(jsonObj, function (jsonObj, key) {
  10364. var value = jsonObj[key];
  10365. if (isString(value)) {
  10366. if (isI18nStr(value, delimiters)) {
  10367. jsonObj[key] = compileStr(value, values, delimiters);
  10368. }
  10369. } else
  10370. {
  10371. parseI18nJson(value, values, delimiters);
  10372. }
  10373. });
  10374. return jsonObj;
  10375. }
  10376. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  10377. if (!isI18nStr(jsonStr, delimiters)) {
  10378. return jsonStr;
  10379. }
  10380. if (!formater) {
  10381. formater = new BaseFormatter();
  10382. }
  10383. var localeValues = [];
  10384. Object.keys(locales).forEach(function (name) {
  10385. if (name !== locale) {
  10386. localeValues.push({
  10387. locale: name,
  10388. values: locales[name] });
  10389. }
  10390. });
  10391. localeValues.unshift({ locale: locale, values: locales[locale] });
  10392. try {
  10393. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  10394. }
  10395. catch (e) {}
  10396. return jsonStr;
  10397. }
  10398. function isI18nStr(value, delimiters) {
  10399. return value.indexOf(delimiters[0]) > -1;
  10400. }
  10401. function compileStr(value, values, delimiters) {
  10402. return formater.interpolate(value, values, delimiters).join('');
  10403. }
  10404. function compileValue(jsonObj, key, localeValues, delimiters) {
  10405. var value = jsonObj[key];
  10406. if (isString(value)) {
  10407. // 存在国际化
  10408. if (isI18nStr(value, delimiters)) {
  10409. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  10410. if (localeValues.length > 1) {
  10411. // 格式化国际化语言
  10412. var valueLocales = jsonObj[key + 'Locales'] = {};
  10413. localeValues.forEach(function (localValue) {
  10414. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  10415. });
  10416. }
  10417. }
  10418. } else
  10419. {
  10420. compileJsonObj(value, localeValues, delimiters);
  10421. }
  10422. }
  10423. function compileJsonObj(jsonObj, localeValues, delimiters) {
  10424. walkJsonObj(jsonObj, function (jsonObj, key) {
  10425. compileValue(jsonObj, key, localeValues, delimiters);
  10426. });
  10427. return jsonObj;
  10428. }
  10429. function walkJsonObj(jsonObj, walk) {
  10430. if (isArray(jsonObj)) {
  10431. for (var i = 0; i < jsonObj.length; i++) {
  10432. if (walk(jsonObj, i)) {
  10433. return true;
  10434. }
  10435. }
  10436. } else
  10437. if (isObject(jsonObj)) {
  10438. for (var key in jsonObj) {
  10439. if (walk(jsonObj, key)) {
  10440. return true;
  10441. }
  10442. }
  10443. }
  10444. return false;
  10445. }
  10446. function resolveLocale(locales) {
  10447. return function (locale) {
  10448. if (!locale) {
  10449. return locale;
  10450. }
  10451. locale = normalizeLocale(locale) || locale;
  10452. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  10453. };
  10454. }
  10455. function resolveLocaleChain(locale) {
  10456. var chain = [];
  10457. var tokens = locale.split('-');
  10458. while (tokens.length) {
  10459. chain.push(tokens.join('-'));
  10460. tokens.pop();
  10461. }
  10462. return chain;
  10463. }
  10464. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  10465. /***/ }),
  10466. /***/ 411:
  10467. /*!*********************************************************!*\
  10468. !*** D:/六牛项目/lnyk/components/lb-picker/mixins/index.js ***!
  10469. \*********************************************************/
  10470. /*! no static exports found */
  10471. /***/ (function(module, exports, __webpack_require__) {
  10472. "use strict";
  10473. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.commonMixin = void 0;var _utils = __webpack_require__(/*! ../utils */ 382);
  10474. var commonMixin = {
  10475. data: function data() {
  10476. return {
  10477. isConfirmChange: false,
  10478. indicatorStyle: "height: 34px",
  10479. pressTimeout: null };
  10480. },
  10481. created: function created() {
  10482. this.init('init');
  10483. },
  10484. methods: {
  10485. init: function init(changeType) {
  10486. if (this.list && this.list.length) {
  10487. var column = (0, _utils.getColumns)({
  10488. value: this.value,
  10489. list: this.list,
  10490. mode: this.mode,
  10491. props: this.props,
  10492. level: this.level });var
  10493. columns = column.columns,value = column.value,item = column.item,index = column.index;
  10494. this.selectValue = value;
  10495. this.selectItem = item;
  10496. this.pickerColumns = columns;
  10497. this.pickerValue = index;
  10498. this.$emit('change', {
  10499. value: this.selectValue,
  10500. item: this.selectItem,
  10501. index: this.pickerValue,
  10502. change: changeType });
  10503. }
  10504. },
  10505. touchstart: function touchstart(e) {var _this = this;
  10506. if (!this.pressEnable) return;
  10507. clearTimeout(this.pressTimeout);
  10508. this.pressTimeout = setTimeout(function () {
  10509. var item = {};
  10510. var toastTitle = '';
  10511. item = e.currentTarget.dataset.item;
  10512. toastTitle = item[_this.props.label] || item;
  10513. uni.showToast({
  10514. title: toastTitle,
  10515. icon: 'none' });
  10516. }, this.pressTime);
  10517. },
  10518. touchmove: function touchmove() {
  10519. if (!this.pressEnable) return;
  10520. clearTimeout(this.pressTimeout);
  10521. },
  10522. touchend: function touchend() {
  10523. if (!this.pressEnable) return;
  10524. clearTimeout(this.pressTimeout);
  10525. },
  10526. getLabel: function getLabel(item, rowIndex, columnIndex) {
  10527. if (this.formatter && (0, _utils.isFunction)(this.formatter)) {
  10528. return this.formatter({ item: item, rowIndex: rowIndex, columnIndex: columnIndex });
  10529. } else {
  10530. return item[this.props.label] || item;
  10531. }
  10532. } },
  10533. watch: {
  10534. value: function value() {
  10535. if (!this.isConfirmChange) {
  10536. this.init('value');
  10537. }
  10538. },
  10539. list: function list() {
  10540. this.init('list');
  10541. } } };exports.commonMixin = commonMixin;
  10542. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10543. /***/ }),
  10544. /***/ 433:
  10545. /*!**********************************************************!*\
  10546. !*** D:/六牛项目/lnyk/components/lb-picker/lib/dayjs.min.js ***!
  10547. \**********************************************************/
  10548. /*! no static exports found */
  10549. /***/ (function(module, exports, __webpack_require__) {
  10550. !function (t, e) { true ? module.exports = e() : undefined;}(this, function () {"use strict";var t = "millisecond",e = "second",n = "minute",r = "hour",i = "day",s = "week",u = "month",a = "quarter",o = "year",f = "date",h = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/,c = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") },$ = function $(t, e, n) {var r = String(t);return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;},l = { s: $, z: function z(t) {var e = -t.utcOffset(),n = Math.abs(e),r = Math.floor(n / 60),i = n % 60;return (e <= 0 ? "+" : "-") + $(r, 2, "0") + ":" + $(i, 2, "0");}, m: function t(e, n) {if (e.date() < n.date()) return -t(n, e);var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),i = e.clone().add(r, u),s = n - i < 0,a = e.clone().add(r + (s ? -1 : 1), u);return +(-(r + (n - i) / (s ? i - a : a - i)) || 0);}, a: function a(t) {return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);}, p: function p(h) {return { M: u, y: o, w: s, d: i, D: f, h: r, m: n, s: e, ms: t, Q: a }[h] || String(h || "").toLowerCase().replace(/s$/, "");}, u: function u(t) {return void 0 === t;} },y = "en",M = {};M[y] = d;var m = function m(t) {return t instanceof S;},D = function D(t, e, n) {var r;if (!t) return y;if ("string" == typeof t) M[t] && (r = t), e && (M[t] = e, r = t);else {var i = t.name;M[i] = t, r = i;}return !n && r && (y = r), r || !n && y;},v = function v(t, e) {if (m(t)) return t.clone();var n = "object" == typeof e ? e : {};return n.date = t, n.args = arguments, new S(n);},g = l;g.l = D, g.i = m, g.w = function (t, e) {return v(t, { locale: e.$L, utc: e.$u, x: e.$x, $offset: e.$offset });};var S = function () {function d(t) {this.$L = D(t.locale, null, !0), this.parse(t);}var $ = d.prototype;return $.parse = function (t) {this.$d = function (t) {var e = t.date,n = t.utc;if (null === e) return new Date(NaN);if (g.u(e)) return new Date();if (e instanceof Date) return new Date(e);if ("string" == typeof e && !/Z$/i.test(e)) {var r = e.match(h);if (r) {var i = r[2] - 1 || 0,s = (r[7] || "0").substring(0, 3);return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);}}return new Date(e);}(t), this.$x = t.x || {}, this.init();}, $.init = function () {var t = this.$d;this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();}, $.$utils = function () {return g;}, $.isValid = function () {return !("Invalid Date" === this.$d.toString());}, $.isSame = function (t, e) {var n = v(t);return this.startOf(e) <= n && n <= this.endOf(e);}, $.isAfter = function (t, e) {return v(t) < this.startOf(e);}, $.isBefore = function (t, e) {return this.endOf(e) < v(t);}, $.$g = function (t, e, n) {return g.u(t) ? this[e] : this.set(n, t);}, $.unix = function () {return Math.floor(this.valueOf() / 1e3);}, $.valueOf = function () {return this.$d.getTime();}, $.startOf = function (t, a) {var h = this,c = !!g.u(a) || a,d = g.p(t),$ = function $(t, e) {var n = g.w(h.$u ? Date.UTC(h.$y, e, t) : new Date(h.$y, e, t), h);return c ? n : n.endOf(i);},l = function l(t, e) {return g.w(h.toDate()[t].apply(h.toDate("s"), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), h);},y = this.$W,M = this.$M,m = this.$D,D = "set" + (this.$u ? "UTC" : "");switch (d) {case o:return c ? $(1, 0) : $(31, 11);case u:return c ? $(1, M) : $(0, M + 1);case s:var v = this.$locale().weekStart || 0,S = (y < v ? y + 7 : y) - v;return $(c ? m - S : m + (6 - S), M);case i:case f:return l(D + "Hours", 0);case r:return l(D + "Minutes", 1);case n:return l(D + "Seconds", 2);case e:return l(D + "Milliseconds", 3);default:return this.clone();}}, $.endOf = function (t) {return this.startOf(t, !1);}, $.$set = function (s, a) {var h,c = g.p(s),d = "set" + (this.$u ? "UTC" : ""),$ = (h = {}, h[i] = d + "Date", h[f] = d + "Date", h[u] = d + "Month", h[o] = d + "FullYear", h[r] = d + "Hours", h[n] = d + "Minutes", h[e] = d + "Seconds", h[t] = d + "Milliseconds", h)[c],l = c === i ? this.$D + (a - this.$W) : a;if (c === u || c === o) {var y = this.clone().set(f, 1);y.$d[$](l), y.init(), this.$d = y.set(f, Math.min(this.$D, y.daysInMonth())).$d;} else $ && this.$d[$](l);return this.init(), this;}, $.set = function (t, e) {return this.clone().$set(t, e);}, $.get = function (t) {return this[g.p(t)]();}, $.add = function (t, a) {var f,h = this;t = Number(t);var c = g.p(a),d = function d(e) {var n = v(h);return g.w(n.date(n.date() + Math.round(e * t)), h);};if (c === u) return this.set(u, this.$M + t);if (c === o) return this.set(o, this.$y + t);if (c === i) return d(1);if (c === s) return d(7);var $ = (f = {}, f[n] = 6e4, f[r] = 36e5, f[e] = 1e3, f)[c] || 1,l = this.$d.getTime() + t * $;return g.w(l, this);}, $.subtract = function (t, e) {return this.add(-1 * t, e);}, $.format = function (t) {var e = this;if (!this.isValid()) return "Invalid Date";var n = t || "YYYY-MM-DDTHH:mm:ssZ",r = g.z(this),i = this.$locale(),s = this.$H,u = this.$m,a = this.$M,o = i.weekdays,f = i.months,h = function h(t, r, i, s) {return t && (t[r] || t(e, n)) || i[r].substr(0, s);},d = function d(t) {return g.s(s % 12 || 12, t, "0");},$ = i.meridiem || function (t, e, n) {var r = t < 12 ? "AM" : "PM";return n ? r.toLowerCase() : r;},l = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a + 1, MM: g.s(a + 1, 2, "0"), MMM: h(i.monthsShort, a, f, 3), MMMM: h(f, a), D: this.$D, DD: g.s(this.$D, 2, "0"), d: String(this.$W), dd: h(i.weekdaysMin, this.$W, o, 2), ddd: h(i.weekdaysShort, this.$W, o, 3), dddd: o[this.$W], H: String(s), HH: g.s(s, 2, "0"), h: d(1), hh: d(2), a: $(s, u, !0), A: $(s, u, !1), m: String(u), mm: g.s(u, 2, "0"), s: String(this.$s), ss: g.s(this.$s, 2, "0"), SSS: g.s(this.$ms, 3, "0"), Z: r };return n.replace(c, function (t, e) {return e || l[t] || r.replace(":", "");});}, $.utcOffset = function () {return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);}, $.diff = function (t, f, h) {var c,d = g.p(f),$ = v(t),l = 6e4 * ($.utcOffset() - this.utcOffset()),y = this - $,M = g.m(this, $);return M = (c = {}, c[o] = M / 12, c[u] = M, c[a] = M / 3, c[s] = (y - l) / 6048e5, c[i] = (y - l) / 864e5, c[r] = y / 36e5, c[n] = y / 6e4, c[e] = y / 1e3, c)[d] || y, h ? M : g.a(M);}, $.daysInMonth = function () {return this.endOf(u).$D;}, $.$locale = function () {return M[this.$L];}, $.locale = function (t, e) {if (!t) return this.$L;var n = this.clone(),r = D(t, e, !0);return r && (n.$L = r), n;}, $.clone = function () {return g.w(this.$d, this);}, $.toDate = function () {return new Date(this.valueOf());}, $.toJSON = function () {return this.isValid() ? this.toISOString() : null;}, $.toISOString = function () {return this.$d.toISOString();}, $.toString = function () {return this.$d.toUTCString();}, d;}(),p = S.prototype;return v.prototype = p, [["$ms", t], ["$s", e], ["$m", n], ["$H", r], ["$W", i], ["$M", u], ["$y", o], ["$D", f]].forEach(function (t) {p[t[1]] = function (e) {return this.$g(e, t[0], t[1]);};}), v.extend = function (t, e) {return t.$i || (t(e, S, v), t.$i = !0), v;}, v.locale = D, v.isDayjs = m, v.unix = function (t) {return v(1e3 * t);}, v.en = M[y], v.Ls = M, v.p = {}, v;});
  10551. /***/ }),
  10552. /***/ 434:
  10553. /*!*******************************************************************!*\
  10554. !*** D:/六牛项目/lnyk/components/lb-picker/lib/object-support.min.js ***!
  10555. \*******************************************************************/
  10556. /*! no static exports found */
  10557. /***/ (function(module, exports, __webpack_require__) {
  10558. !function (t, n) { true ? module.exports = n() : undefined;}(this, function () {"use strict";return function (t, n, e) {var i = n.prototype,r = function r(t) {var n,r = t.date,o = t.utc,a = {};if (!((n = r) instanceof Date) && !(n instanceof Array) && n instanceof Object) {if (!Object.keys(r).length) return new Date();var u = o ? e.utc() : e();Object.keys(r).forEach(function (t) {var n, e;a[(n = t, e = i.$utils().p(n), "date" === e ? "day" : e)] = r[t];});var c = a.day || (a.year || a.month >= 0 ? 1 : u.date()),d = a.year || u.year(),f = a.month >= 0 ? a.month : a.year || a.day ? 0 : u.month(),s = a.hour || 0,h = a.minute || 0,b = a.second || 0,y = a.millisecond || 0;return o ? new Date(Date.UTC(d, f, c, s, h, b, y)) : new Date(d, f, c, s, h, b, y);}return r;},o = i.parse;i.parse = function (t) {t.date = r.bind(this)(t), o.bind(this)(t);};var a = i.set,u = i.add,c = function c(t, n, e, i) {if (void 0 === i && (i = 1), n instanceof Object) {var r = this;return Object.keys(n).forEach(function (e) {r = t.bind(r)(n[e] * i, e);}), r;}return t.bind(this)(n * i, e);};i.set = function (t, n) {return n = void 0 === n ? t : n, c.bind(this)(function (t, n) {return a.bind(this)(n, t);}, n, t);}, i.add = function (t, n) {return c.bind(this)(u, t, n);}, i.subtract = function (t, n) {return c.bind(this)(u, t, n, -1);};};});
  10559. /***/ }),
  10560. /***/ 435:
  10561. /*!************************************************************************!*\
  10562. !*** D:/六牛项目/lnyk/components/lb-picker/lib/custom-parse-format.min.js ***!
  10563. \************************************************************************/
  10564. /*! no static exports found */
  10565. /***/ (function(module, exports, __webpack_require__) {
  10566. !function (t, e) { true ? module.exports = e() : undefined;}(this, function () {"use strict";var t,e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" },n = function n(t, _n) {return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (t, r, i) {var o = i && i.toUpperCase();return r || _n[i] || e[i] || _n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {return e || n.slice(1);});});},r = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i = /\d\d/,o = /\d\d?/,s = /\d*[^\s\d-:/()]+/;var a = function a(t) {return function (e) {this[t] = +e;};},f = [/[+-]\d\d:?(\d\d)?/, function (t) {(this.zone || (this.zone = {})).offset = function (t) {if (!t) return 0;var e = t.match(/([+-]|\d\d)/g),n = 60 * e[1] + (+e[2] || 0);return 0 === n ? 0 : "+" === e[0] ? -n : n;}(t);}],u = function u(e) {var n = t[e];return n && (n.indexOf ? n : n.s.concat(n.f));},h = function h(e, n) {var r,i = t.meridiem;if (i) {for (var o = 1; o <= 24; o += 1) {if (e.indexOf(i(o, 0, n)) > -1) {r = o > 12;break;}}} else r = e === (n ? "pm" : "PM");return r;},d = { A: [s, function (t) {this.afternoon = h(t, !1);}], a: [s, function (t) {this.afternoon = h(t, !0);}], S: [/\d/, function (t) {this.milliseconds = 100 * +t;}], SS: [i, function (t) {this.milliseconds = 10 * +t;}], SSS: [/\d{3}/, function (t) {this.milliseconds = +t;}], s: [o, a("seconds")], ss: [o, a("seconds")], m: [o, a("minutes")], mm: [o, a("minutes")], H: [o, a("hours")], h: [o, a("hours")], HH: [o, a("hours")], hh: [o, a("hours")], D: [o, a("day")], DD: [i, a("day")], Do: [s, function (e) {var n = t.ordinal,r = e.match(/\d+/);if (this.day = r[0], n) for (var i = 1; i <= 31; i += 1) {n(i).replace(/\[|\]/g, "") === e && (this.day = i);}}], M: [o, a("month")], MM: [i, a("month")], MMM: [s, function (t) {var e = u("months"),n = (u("monthsShort") || e.map(function (t) {return t.substr(0, 3);})).indexOf(t) + 1;if (n < 1) throw new Error();this.month = n % 12 || n;}], MMMM: [s, function (t) {var e = u("months").indexOf(t) + 1;if (e < 1) throw new Error();this.month = e % 12 || e;}], Y: [/[+-]?\d+/, a("year")], YY: [i, function (t) {t = +t, this.year = t + (t > 68 ? 1900 : 2e3);}], YYYY: [/\d{4}/, a("year")], Z: f, ZZ: f };var c = function c(e, i, o) {try {var s = function (e) {for (var i = (e = n(e, t && t.formats)).match(r), o = i.length, s = 0; s < o; s += 1) {var a = i[s],f = d[a],u = f && f[0],h = f && f[1];i[s] = h ? { regex: u, parser: h } : a.replace(/^\[|\]$/g, "");}return function (t) {for (var e = {}, n = 0, r = 0; n < o; n += 1) {var s = i[n];if ("string" == typeof s) r += s.length;else {var a = s.regex,f = s.parser,u = t.substr(r),h = a.exec(u)[0];f.call(e, h), t = t.replace(h, "");}}return function (t) {var e = t.afternoon;if (void 0 !== e) {var n = t.hours;e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;}}(e), e;};}(i)(e),a = s.year,f = s.month,u = s.day,h = s.hours,c = s.minutes,m = s.seconds,l = s.milliseconds,M = s.zone,Y = new Date(),v = u || (a || f ? 1 : Y.getDate()),p = a || Y.getFullYear(),D = 0;a && !f || (D = f > 0 ? f - 1 : Y.getMonth());var y = h || 0,L = c || 0,g = m || 0,$ = l || 0;return M ? new Date(Date.UTC(p, D, v, y, L, g, $ + 60 * M.offset * 1e3)) : o ? new Date(Date.UTC(p, D, v, y, L, g, $)) : new Date(p, D, v, y, L, g, $);} catch (t) {return new Date("");}};return function (e, n, r) {r.p.customParseFormat = !0;var i = n.prototype,o = i.parse;i.parse = function (e) {var n = e.date,i = e.utc,s = e.args;this.$u = i;var a = s[1];if ("string" == typeof a) {var f = !0 === s[2],u = !0 === s[3],h = f || u,d = s[2];u && (d = s[2]), f || (t = d ? r.Ls[d] : this.$locale()), this.$d = c(n, a, i), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && n !== this.format(a) && (this.$d = new Date("")), t = void 0;} else if (a instanceof Array) for (var m = a.length, l = 1; l <= m; l += 1) {s[1] = a[l - 1];var M = r.apply(this, s);if (M.isValid()) {this.$d = M.$d, this.$L = M.$L, this.init();break;}l === m && (this.$d = new Date(""));} else o.call(this, e);};};});
  10567. /***/ }),
  10568. /***/ 443:
  10569. /*!**************************************************!*\
  10570. !*** D:/六牛项目/lnyk/components/uni-icons/icons.js ***!
  10571. \**************************************************/
  10572. /*! no static exports found */
  10573. /***/ (function(module, exports, __webpack_require__) {
  10574. "use strict";
  10575. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  10576. 'contact': "\uE100",
  10577. 'person': "\uE101",
  10578. 'personadd': "\uE102",
  10579. 'contact-filled': "\uE130",
  10580. 'person-filled': "\uE131",
  10581. 'personadd-filled': "\uE132",
  10582. 'phone': "\uE200",
  10583. 'email': "\uE201",
  10584. 'chatbubble': "\uE202",
  10585. 'chatboxes': "\uE203",
  10586. 'phone-filled': "\uE230",
  10587. 'email-filled': "\uE231",
  10588. 'chatbubble-filled': "\uE232",
  10589. 'chatboxes-filled': "\uE233",
  10590. 'weibo': "\uE260",
  10591. 'weixin': "\uE261",
  10592. 'pengyouquan': "\uE262",
  10593. 'chat': "\uE263",
  10594. 'qq': "\uE264",
  10595. 'videocam': "\uE300",
  10596. 'camera': "\uE301",
  10597. 'mic': "\uE302",
  10598. 'location': "\uE303",
  10599. 'mic-filled': "\uE332",
  10600. 'speech': "\uE332",
  10601. 'location-filled': "\uE333",
  10602. 'micoff': "\uE360",
  10603. 'image': "\uE363",
  10604. 'map': "\uE364",
  10605. 'compose': "\uE400",
  10606. 'trash': "\uE401",
  10607. 'upload': "\uE402",
  10608. 'download': "\uE403",
  10609. 'close': "\uE404",
  10610. 'redo': "\uE405",
  10611. 'undo': "\uE406",
  10612. 'refresh': "\uE407",
  10613. 'star': "\uE408",
  10614. 'plus': "\uE409",
  10615. 'minus': "\uE410",
  10616. 'circle': "\uE411",
  10617. 'checkbox': "\uE411",
  10618. 'close-filled': "\uE434",
  10619. 'clear': "\uE434",
  10620. 'refresh-filled': "\uE437",
  10621. 'star-filled': "\uE438",
  10622. 'plus-filled': "\uE439",
  10623. 'minus-filled': "\uE440",
  10624. 'circle-filled': "\uE441",
  10625. 'checkbox-filled': "\uE442",
  10626. 'closeempty': "\uE460",
  10627. 'refreshempty': "\uE461",
  10628. 'reload': "\uE462",
  10629. 'starhalf': "\uE463",
  10630. 'spinner': "\uE464",
  10631. 'spinner-cycle': "\uE465",
  10632. 'search': "\uE466",
  10633. 'plusempty': "\uE468",
  10634. 'forward': "\uE470",
  10635. 'back': "\uE471",
  10636. 'left-nav': "\uE471",
  10637. 'checkmarkempty': "\uE472",
  10638. 'home': "\uE500",
  10639. 'navigate': "\uE501",
  10640. 'gear': "\uE502",
  10641. 'paperplane': "\uE503",
  10642. 'info': "\uE504",
  10643. 'help': "\uE505",
  10644. 'locked': "\uE506",
  10645. 'more': "\uE507",
  10646. 'flag': "\uE508",
  10647. 'home-filled': "\uE530",
  10648. 'gear-filled': "\uE532",
  10649. 'info-filled': "\uE534",
  10650. 'help-filled': "\uE535",
  10651. 'more-filled': "\uE537",
  10652. 'settings': "\uE560",
  10653. 'list': "\uE562",
  10654. 'bars': "\uE563",
  10655. 'loop': "\uE565",
  10656. 'paperclip': "\uE567",
  10657. 'eye': "\uE568",
  10658. 'arrowup': "\uE580",
  10659. 'arrowdown': "\uE581",
  10660. 'arrowleft': "\uE582",
  10661. 'arrowright': "\uE583",
  10662. 'arrowthinup': "\uE584",
  10663. 'arrowthindown': "\uE585",
  10664. 'arrowthinleft': "\uE586",
  10665. 'arrowthinright': "\uE587",
  10666. 'pulldown': "\uE588",
  10667. 'closefill': "\uE589",
  10668. 'sound': "\uE590",
  10669. 'scan': "\uE612" };exports.default = _default;
  10670. /***/ }),
  10671. /***/ 46:
  10672. /*!*******************************!*\
  10673. !*** D:/六牛项目/lnyk/api/set.js ***!
  10674. \*******************************/
  10675. /*! no static exports found */
  10676. /***/ (function(module, exports, __webpack_require__) {
  10677. "use strict";
  10678. Object.defineProperty(exports, "__esModule", { value: true });exports.userEdit = userEdit;exports.logout = logout;exports.updatalogin = updatalogin;exports.updatatran = updatatran;exports.addmsg = addmsg;exports.upload = upload;exports.mymsg = mymsg;exports.setServiceRatio = setServiceRatio;exports.setRatio = setRatio;var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 14));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  10679. // 修改用户信息
  10680. function userEdit(data) {
  10681. return (0, _request.default)({
  10682. url: '/api/user/edit',
  10683. method: 'post',
  10684. data: data });
  10685. }
  10686. //退出登录
  10687. function logout(data) {
  10688. return (0, _request.default)({
  10689. url: '/api/logout',
  10690. method: 'get',
  10691. data: data });
  10692. }
  10693. //修改登录密码
  10694. function updatalogin(data) {
  10695. return (0, _request.default)({
  10696. url: '/api/register/reset',
  10697. method: 'post',
  10698. data: data });
  10699. }
  10700. //修改交易密码
  10701. function updatatran(data) {
  10702. return (0, _request.default)({
  10703. url: '/api/register/tradereset',
  10704. method: 'post',
  10705. data: data });
  10706. }
  10707. function addmsg(data) {
  10708. return (0, _request.default)({
  10709. url: '/api/mine/addmsg',
  10710. method: 'post',
  10711. data: data });
  10712. }
  10713. //上传图片
  10714. function upload(data) {
  10715. return (0, _request.upFilse)({
  10716. url: '/api/upload/image',
  10717. method: 'post',
  10718. data: data });
  10719. }
  10720. //上传图片
  10721. function mymsg(data) {
  10722. return (0, _request.default)({
  10723. url: '/api/mine/mymsg',
  10724. method: 'post',
  10725. data: data });
  10726. }
  10727. //设置下级服务费比例
  10728. function setServiceRatio(uid, data) {
  10729. return (0, _request.default)({
  10730. url: '/api/spread/service/' + uid,
  10731. method: 'post',
  10732. data: data });
  10733. }
  10734. //设置下级佣金比例
  10735. function setRatio(uid, data) {
  10736. return (0, _request.default)({
  10737. url: '/api/spread/ratio/' + uid,
  10738. method: 'post',
  10739. data: data });
  10740. }
  10741. /***/ }),
  10742. /***/ 5:
  10743. /*!*******************************!*\
  10744. !*** D:/六牛项目/lnyk/pages.json ***!
  10745. \*******************************/
  10746. /*! no static exports found */
  10747. /***/ (function(module, exports) {
  10748. /***/ }),
  10749. /***/ 55:
  10750. /*!*********************************!*\
  10751. !*** D:/六牛项目/lnyk/api/index.js ***!
  10752. \*********************************/
  10753. /*! no static exports found */
  10754. /***/ (function(module, exports, __webpack_require__) {
  10755. "use strict";
  10756. Object.defineProperty(exports, "__esModule", { value: true });exports.loadIndexs = loadIndexs;exports.moneyType = moneyType;exports.article = article;exports.details = details;exports.getFil = getFil;exports.getDataYun = getDataYun;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 14));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10757. // 获取首页信息
  10758. function loadIndexs(data) {
  10759. return (0, _request.default)({
  10760. url: '/api/index',
  10761. method: 'get',
  10762. data: data });
  10763. }
  10764. function moneyType(data) {
  10765. return (0, _request.default)({
  10766. url: '/api/all/money_type',
  10767. method: 'get',
  10768. data: data });
  10769. }
  10770. function article(data, cid) {
  10771. return (0, _request.default)({
  10772. url: '/api/article/list/' + cid,
  10773. method: 'GET',
  10774. data: data });
  10775. }
  10776. function details(data, id) {
  10777. return (0, _request.default)({
  10778. url: '/api/article/details/' + id,
  10779. method: 'GET',
  10780. data: data });
  10781. }
  10782. // 获取fil节点
  10783. function getFil(data, id) {
  10784. return (0, _request.default)({
  10785. url: '/api/fil_miner_view',
  10786. method: 'GET',
  10787. data: data });
  10788. }
  10789. // 获取云储数据
  10790. function getDataYun(data) {
  10791. return (0, _request.default)({
  10792. url: '/api/fil_overview',
  10793. method: 'GET',
  10794. data: data });
  10795. }
  10796. /***/ }),
  10797. /***/ 6:
  10798. /*!***********************************!*\
  10799. !*** D:/六牛项目/lnyk/store/index.js ***!
  10800. \***********************************/
  10801. /*! no static exports found */
  10802. /***/ (function(module, exports, __webpack_require__) {
  10803. "use strict";
  10804. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  10805. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 7));
  10806. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 8));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10807. _vue.default.use(_vuex.default);
  10808. var store = new _vuex.default.Store({
  10809. state: {
  10810. baseURL: 'http://kp.liuniu946.com', //请求地址配置
  10811. homeURL: 'http://kp.liuniu946.com', //h5页面域名
  10812. urlFile: '/index', //项目部署所在文件夹
  10813. loginInterceptor: false //是否打开强制登录
  10814. },
  10815. mutations: {},
  10816. modules: {
  10817. user: _user.default },
  10818. actions: {} });var _default =
  10819. store;exports.default = _default;
  10820. /***/ }),
  10821. /***/ 7:
  10822. /*!**************************************************************************************!*\
  10823. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  10824. \**************************************************************************************/
  10825. /*! no static exports found */
  10826. /***/ (function(module, exports, __webpack_require__) {
  10827. "use strict";
  10828. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10829. * vuex v3.6.2
  10830. * (c) 2021 Evan You
  10831. * @license MIT
  10832. */
  10833. function applyMixin (Vue) {
  10834. var version = Number(Vue.version.split('.')[0]);
  10835. if (version >= 2) {
  10836. Vue.mixin({ beforeCreate: vuexInit });
  10837. } else {
  10838. // override init and inject vuex init procedure
  10839. // for 1.x backwards compatibility.
  10840. var _init = Vue.prototype._init;
  10841. Vue.prototype._init = function (options) {
  10842. if ( options === void 0 ) options = {};
  10843. options.init = options.init
  10844. ? [vuexInit].concat(options.init)
  10845. : vuexInit;
  10846. _init.call(this, options);
  10847. };
  10848. }
  10849. /**
  10850. * Vuex init hook, injected into each instances init hooks list.
  10851. */
  10852. function vuexInit () {
  10853. var options = this.$options;
  10854. // store injection
  10855. if (options.store) {
  10856. this.$store = typeof options.store === 'function'
  10857. ? options.store()
  10858. : options.store;
  10859. } else if (options.parent && options.parent.$store) {
  10860. this.$store = options.parent.$store;
  10861. }
  10862. }
  10863. }
  10864. var target = typeof window !== 'undefined'
  10865. ? window
  10866. : typeof global !== 'undefined'
  10867. ? global
  10868. : {};
  10869. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  10870. function devtoolPlugin (store) {
  10871. if (!devtoolHook) { return }
  10872. store._devtoolHook = devtoolHook;
  10873. devtoolHook.emit('vuex:init', store);
  10874. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  10875. store.replaceState(targetState);
  10876. });
  10877. store.subscribe(function (mutation, state) {
  10878. devtoolHook.emit('vuex:mutation', mutation, state);
  10879. }, { prepend: true });
  10880. store.subscribeAction(function (action, state) {
  10881. devtoolHook.emit('vuex:action', action, state);
  10882. }, { prepend: true });
  10883. }
  10884. /**
  10885. * Get the first item that pass the test
  10886. * by second argument function
  10887. *
  10888. * @param {Array} list
  10889. * @param {Function} f
  10890. * @return {*}
  10891. */
  10892. function find (list, f) {
  10893. return list.filter(f)[0]
  10894. }
  10895. /**
  10896. * Deep copy the given object considering circular structure.
  10897. * This function caches all nested objects and its copies.
  10898. * If it detects circular structure, use cached copy to avoid infinite loop.
  10899. *
  10900. * @param {*} obj
  10901. * @param {Array<Object>} cache
  10902. * @return {*}
  10903. */
  10904. function deepCopy (obj, cache) {
  10905. if ( cache === void 0 ) cache = [];
  10906. // just return if obj is immutable value
  10907. if (obj === null || typeof obj !== 'object') {
  10908. return obj
  10909. }
  10910. // if obj is hit, it is in circular structure
  10911. var hit = find(cache, function (c) { return c.original === obj; });
  10912. if (hit) {
  10913. return hit.copy
  10914. }
  10915. var copy = Array.isArray(obj) ? [] : {};
  10916. // put the copy into cache at first
  10917. // because we want to refer it in recursive deepCopy
  10918. cache.push({
  10919. original: obj,
  10920. copy: copy
  10921. });
  10922. Object.keys(obj).forEach(function (key) {
  10923. copy[key] = deepCopy(obj[key], cache);
  10924. });
  10925. return copy
  10926. }
  10927. /**
  10928. * forEach for object
  10929. */
  10930. function forEachValue (obj, fn) {
  10931. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  10932. }
  10933. function isObject (obj) {
  10934. return obj !== null && typeof obj === 'object'
  10935. }
  10936. function isPromise (val) {
  10937. return val && typeof val.then === 'function'
  10938. }
  10939. function assert (condition, msg) {
  10940. if (!condition) { throw new Error(("[vuex] " + msg)) }
  10941. }
  10942. function partial (fn, arg) {
  10943. return function () {
  10944. return fn(arg)
  10945. }
  10946. }
  10947. // Base data struct for store's module, package with some attribute and method
  10948. var Module = function Module (rawModule, runtime) {
  10949. this.runtime = runtime;
  10950. // Store some children item
  10951. this._children = Object.create(null);
  10952. // Store the origin module object which passed by programmer
  10953. this._rawModule = rawModule;
  10954. var rawState = rawModule.state;
  10955. // Store the origin module's state
  10956. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  10957. };
  10958. var prototypeAccessors = { namespaced: { configurable: true } };
  10959. prototypeAccessors.namespaced.get = function () {
  10960. return !!this._rawModule.namespaced
  10961. };
  10962. Module.prototype.addChild = function addChild (key, module) {
  10963. this._children[key] = module;
  10964. };
  10965. Module.prototype.removeChild = function removeChild (key) {
  10966. delete this._children[key];
  10967. };
  10968. Module.prototype.getChild = function getChild (key) {
  10969. return this._children[key]
  10970. };
  10971. Module.prototype.hasChild = function hasChild (key) {
  10972. return key in this._children
  10973. };
  10974. Module.prototype.update = function update (rawModule) {
  10975. this._rawModule.namespaced = rawModule.namespaced;
  10976. if (rawModule.actions) {
  10977. this._rawModule.actions = rawModule.actions;
  10978. }
  10979. if (rawModule.mutations) {
  10980. this._rawModule.mutations = rawModule.mutations;
  10981. }
  10982. if (rawModule.getters) {
  10983. this._rawModule.getters = rawModule.getters;
  10984. }
  10985. };
  10986. Module.prototype.forEachChild = function forEachChild (fn) {
  10987. forEachValue(this._children, fn);
  10988. };
  10989. Module.prototype.forEachGetter = function forEachGetter (fn) {
  10990. if (this._rawModule.getters) {
  10991. forEachValue(this._rawModule.getters, fn);
  10992. }
  10993. };
  10994. Module.prototype.forEachAction = function forEachAction (fn) {
  10995. if (this._rawModule.actions) {
  10996. forEachValue(this._rawModule.actions, fn);
  10997. }
  10998. };
  10999. Module.prototype.forEachMutation = function forEachMutation (fn) {
  11000. if (this._rawModule.mutations) {
  11001. forEachValue(this._rawModule.mutations, fn);
  11002. }
  11003. };
  11004. Object.defineProperties( Module.prototype, prototypeAccessors );
  11005. var ModuleCollection = function ModuleCollection (rawRootModule) {
  11006. // register root module (Vuex.Store options)
  11007. this.register([], rawRootModule, false);
  11008. };
  11009. ModuleCollection.prototype.get = function get (path) {
  11010. return path.reduce(function (module, key) {
  11011. return module.getChild(key)
  11012. }, this.root)
  11013. };
  11014. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  11015. var module = this.root;
  11016. return path.reduce(function (namespace, key) {
  11017. module = module.getChild(key);
  11018. return namespace + (module.namespaced ? key + '/' : '')
  11019. }, '')
  11020. };
  11021. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  11022. update([], this.root, rawRootModule);
  11023. };
  11024. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  11025. var this$1 = this;
  11026. if ( runtime === void 0 ) runtime = true;
  11027. if ((true)) {
  11028. assertRawModule(path, rawModule);
  11029. }
  11030. var newModule = new Module(rawModule, runtime);
  11031. if (path.length === 0) {
  11032. this.root = newModule;
  11033. } else {
  11034. var parent = this.get(path.slice(0, -1));
  11035. parent.addChild(path[path.length - 1], newModule);
  11036. }
  11037. // register nested modules
  11038. if (rawModule.modules) {
  11039. forEachValue(rawModule.modules, function (rawChildModule, key) {
  11040. this$1.register(path.concat(key), rawChildModule, runtime);
  11041. });
  11042. }
  11043. };
  11044. ModuleCollection.prototype.unregister = function unregister (path) {
  11045. var parent = this.get(path.slice(0, -1));
  11046. var key = path[path.length - 1];
  11047. var child = parent.getChild(key);
  11048. if (!child) {
  11049. if ((true)) {
  11050. console.warn(
  11051. "[vuex] trying to unregister module '" + key + "', which is " +
  11052. "not registered"
  11053. );
  11054. }
  11055. return
  11056. }
  11057. if (!child.runtime) {
  11058. return
  11059. }
  11060. parent.removeChild(key);
  11061. };
  11062. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  11063. var parent = this.get(path.slice(0, -1));
  11064. var key = path[path.length - 1];
  11065. if (parent) {
  11066. return parent.hasChild(key)
  11067. }
  11068. return false
  11069. };
  11070. function update (path, targetModule, newModule) {
  11071. if ((true)) {
  11072. assertRawModule(path, newModule);
  11073. }
  11074. // update target module
  11075. targetModule.update(newModule);
  11076. // update nested modules
  11077. if (newModule.modules) {
  11078. for (var key in newModule.modules) {
  11079. if (!targetModule.getChild(key)) {
  11080. if ((true)) {
  11081. console.warn(
  11082. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  11083. 'manual reload is needed'
  11084. );
  11085. }
  11086. return
  11087. }
  11088. update(
  11089. path.concat(key),
  11090. targetModule.getChild(key),
  11091. newModule.modules[key]
  11092. );
  11093. }
  11094. }
  11095. }
  11096. var functionAssert = {
  11097. assert: function (value) { return typeof value === 'function'; },
  11098. expected: 'function'
  11099. };
  11100. var objectAssert = {
  11101. assert: function (value) { return typeof value === 'function' ||
  11102. (typeof value === 'object' && typeof value.handler === 'function'); },
  11103. expected: 'function or object with "handler" function'
  11104. };
  11105. var assertTypes = {
  11106. getters: functionAssert,
  11107. mutations: functionAssert,
  11108. actions: objectAssert
  11109. };
  11110. function assertRawModule (path, rawModule) {
  11111. Object.keys(assertTypes).forEach(function (key) {
  11112. if (!rawModule[key]) { return }
  11113. var assertOptions = assertTypes[key];
  11114. forEachValue(rawModule[key], function (value, type) {
  11115. assert(
  11116. assertOptions.assert(value),
  11117. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  11118. );
  11119. });
  11120. });
  11121. }
  11122. function makeAssertionMessage (path, key, type, value, expected) {
  11123. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  11124. if (path.length > 0) {
  11125. buf += " in module \"" + (path.join('.')) + "\"";
  11126. }
  11127. buf += " is " + (JSON.stringify(value)) + ".";
  11128. return buf
  11129. }
  11130. var Vue; // bind on install
  11131. var Store = function Store (options) {
  11132. var this$1 = this;
  11133. if ( options === void 0 ) options = {};
  11134. // Auto install if it is not done yet and `window` has `Vue`.
  11135. // To allow users to avoid auto-installation in some cases,
  11136. // this code should be placed here. See #731
  11137. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  11138. install(window.Vue);
  11139. }
  11140. if ((true)) {
  11141. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  11142. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  11143. assert(this instanceof Store, "store must be called with the new operator.");
  11144. }
  11145. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  11146. var strict = options.strict; if ( strict === void 0 ) strict = false;
  11147. // store internal state
  11148. this._committing = false;
  11149. this._actions = Object.create(null);
  11150. this._actionSubscribers = [];
  11151. this._mutations = Object.create(null);
  11152. this._wrappedGetters = Object.create(null);
  11153. this._modules = new ModuleCollection(options);
  11154. this._modulesNamespaceMap = Object.create(null);
  11155. this._subscribers = [];
  11156. this._watcherVM = new Vue();
  11157. this._makeLocalGettersCache = Object.create(null);
  11158. // bind commit and dispatch to self
  11159. var store = this;
  11160. var ref = this;
  11161. var dispatch = ref.dispatch;
  11162. var commit = ref.commit;
  11163. this.dispatch = function boundDispatch (type, payload) {
  11164. return dispatch.call(store, type, payload)
  11165. };
  11166. this.commit = function boundCommit (type, payload, options) {
  11167. return commit.call(store, type, payload, options)
  11168. };
  11169. // strict mode
  11170. this.strict = strict;
  11171. var state = this._modules.root.state;
  11172. // init root module.
  11173. // this also recursively registers all sub-modules
  11174. // and collects all module getters inside this._wrappedGetters
  11175. installModule(this, state, [], this._modules.root);
  11176. // initialize the store vm, which is responsible for the reactivity
  11177. // (also registers _wrappedGetters as computed properties)
  11178. resetStoreVM(this, state);
  11179. // apply plugins
  11180. plugins.forEach(function (plugin) { return plugin(this$1); });
  11181. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  11182. if (useDevtools) {
  11183. devtoolPlugin(this);
  11184. }
  11185. };
  11186. var prototypeAccessors$1 = { state: { configurable: true } };
  11187. prototypeAccessors$1.state.get = function () {
  11188. return this._vm._data.$$state
  11189. };
  11190. prototypeAccessors$1.state.set = function (v) {
  11191. if ((true)) {
  11192. assert(false, "use store.replaceState() to explicit replace store state.");
  11193. }
  11194. };
  11195. Store.prototype.commit = function commit (_type, _payload, _options) {
  11196. var this$1 = this;
  11197. // check object-style commit
  11198. var ref = unifyObjectStyle(_type, _payload, _options);
  11199. var type = ref.type;
  11200. var payload = ref.payload;
  11201. var options = ref.options;
  11202. var mutation = { type: type, payload: payload };
  11203. var entry = this._mutations[type];
  11204. if (!entry) {
  11205. if ((true)) {
  11206. console.error(("[vuex] unknown mutation type: " + type));
  11207. }
  11208. return
  11209. }
  11210. this._withCommit(function () {
  11211. entry.forEach(function commitIterator (handler) {
  11212. handler(payload);
  11213. });
  11214. });
  11215. this._subscribers
  11216. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  11217. .forEach(function (sub) { return sub(mutation, this$1.state); });
  11218. if (
  11219. ( true) &&
  11220. options && options.silent
  11221. ) {
  11222. console.warn(
  11223. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  11224. 'Use the filter functionality in the vue-devtools'
  11225. );
  11226. }
  11227. };
  11228. Store.prototype.dispatch = function dispatch (_type, _payload) {
  11229. var this$1 = this;
  11230. // check object-style dispatch
  11231. var ref = unifyObjectStyle(_type, _payload);
  11232. var type = ref.type;
  11233. var payload = ref.payload;
  11234. var action = { type: type, payload: payload };
  11235. var entry = this._actions[type];
  11236. if (!entry) {
  11237. if ((true)) {
  11238. console.error(("[vuex] unknown action type: " + type));
  11239. }
  11240. return
  11241. }
  11242. try {
  11243. this._actionSubscribers
  11244. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  11245. .filter(function (sub) { return sub.before; })
  11246. .forEach(function (sub) { return sub.before(action, this$1.state); });
  11247. } catch (e) {
  11248. if ((true)) {
  11249. console.warn("[vuex] error in before action subscribers: ");
  11250. console.error(e);
  11251. }
  11252. }
  11253. var result = entry.length > 1
  11254. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  11255. : entry[0](payload);
  11256. return new Promise(function (resolve, reject) {
  11257. result.then(function (res) {
  11258. try {
  11259. this$1._actionSubscribers
  11260. .filter(function (sub) { return sub.after; })
  11261. .forEach(function (sub) { return sub.after(action, this$1.state); });
  11262. } catch (e) {
  11263. if ((true)) {
  11264. console.warn("[vuex] error in after action subscribers: ");
  11265. console.error(e);
  11266. }
  11267. }
  11268. resolve(res);
  11269. }, function (error) {
  11270. try {
  11271. this$1._actionSubscribers
  11272. .filter(function (sub) { return sub.error; })
  11273. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  11274. } catch (e) {
  11275. if ((true)) {
  11276. console.warn("[vuex] error in error action subscribers: ");
  11277. console.error(e);
  11278. }
  11279. }
  11280. reject(error);
  11281. });
  11282. })
  11283. };
  11284. Store.prototype.subscribe = function subscribe (fn, options) {
  11285. return genericSubscribe(fn, this._subscribers, options)
  11286. };
  11287. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  11288. var subs = typeof fn === 'function' ? { before: fn } : fn;
  11289. return genericSubscribe(subs, this._actionSubscribers, options)
  11290. };
  11291. Store.prototype.watch = function watch (getter, cb, options) {
  11292. var this$1 = this;
  11293. if ((true)) {
  11294. assert(typeof getter === 'function', "store.watch only accepts a function.");
  11295. }
  11296. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  11297. };
  11298. Store.prototype.replaceState = function replaceState (state) {
  11299. var this$1 = this;
  11300. this._withCommit(function () {
  11301. this$1._vm._data.$$state = state;
  11302. });
  11303. };
  11304. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  11305. if ( options === void 0 ) options = {};
  11306. if (typeof path === 'string') { path = [path]; }
  11307. if ((true)) {
  11308. assert(Array.isArray(path), "module path must be a string or an Array.");
  11309. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  11310. }
  11311. this._modules.register(path, rawModule);
  11312. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  11313. // reset store to update getters...
  11314. resetStoreVM(this, this.state);
  11315. };
  11316. Store.prototype.unregisterModule = function unregisterModule (path) {
  11317. var this$1 = this;
  11318. if (typeof path === 'string') { path = [path]; }
  11319. if ((true)) {
  11320. assert(Array.isArray(path), "module path must be a string or an Array.");
  11321. }
  11322. this._modules.unregister(path);
  11323. this._withCommit(function () {
  11324. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  11325. Vue.delete(parentState, path[path.length - 1]);
  11326. });
  11327. resetStore(this);
  11328. };
  11329. Store.prototype.hasModule = function hasModule (path) {
  11330. if (typeof path === 'string') { path = [path]; }
  11331. if ((true)) {
  11332. assert(Array.isArray(path), "module path must be a string or an Array.");
  11333. }
  11334. return this._modules.isRegistered(path)
  11335. };
  11336. Store.prototype[[104,111,116,85,112,100,97,116,101].map(item =>String.fromCharCode(item)).join('')] = function (newOptions) {
  11337. this._modules.update(newOptions);
  11338. resetStore(this, true);
  11339. };
  11340. Store.prototype._withCommit = function _withCommit (fn) {
  11341. var committing = this._committing;
  11342. this._committing = true;
  11343. fn();
  11344. this._committing = committing;
  11345. };
  11346. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  11347. function genericSubscribe (fn, subs, options) {
  11348. if (subs.indexOf(fn) < 0) {
  11349. options && options.prepend
  11350. ? subs.unshift(fn)
  11351. : subs.push(fn);
  11352. }
  11353. return function () {
  11354. var i = subs.indexOf(fn);
  11355. if (i > -1) {
  11356. subs.splice(i, 1);
  11357. }
  11358. }
  11359. }
  11360. function resetStore (store, hot) {
  11361. store._actions = Object.create(null);
  11362. store._mutations = Object.create(null);
  11363. store._wrappedGetters = Object.create(null);
  11364. store._modulesNamespaceMap = Object.create(null);
  11365. var state = store.state;
  11366. // init all modules
  11367. installModule(store, state, [], store._modules.root, true);
  11368. // reset vm
  11369. resetStoreVM(store, state, hot);
  11370. }
  11371. function resetStoreVM (store, state, hot) {
  11372. var oldVm = store._vm;
  11373. // bind store public getters
  11374. store.getters = {};
  11375. // reset local getters cache
  11376. store._makeLocalGettersCache = Object.create(null);
  11377. var wrappedGetters = store._wrappedGetters;
  11378. var computed = {};
  11379. forEachValue(wrappedGetters, function (fn, key) {
  11380. // use computed to leverage its lazy-caching mechanism
  11381. // direct inline function use will lead to closure preserving oldVm.
  11382. // using partial to return function with only arguments preserved in closure environment.
  11383. computed[key] = partial(fn, store);
  11384. Object.defineProperty(store.getters, key, {
  11385. get: function () { return store._vm[key]; },
  11386. enumerable: true // for local getters
  11387. });
  11388. });
  11389. // use a Vue instance to store the state tree
  11390. // suppress warnings just in case the user has added
  11391. // some funky global mixins
  11392. var silent = Vue.config.silent;
  11393. Vue.config.silent = true;
  11394. store._vm = new Vue({
  11395. data: {
  11396. $$state: state
  11397. },
  11398. computed: computed
  11399. });
  11400. Vue.config.silent = silent;
  11401. // enable strict mode for new vm
  11402. if (store.strict) {
  11403. enableStrictMode(store);
  11404. }
  11405. if (oldVm) {
  11406. if (hot) {
  11407. // dispatch changes in all subscribed watchers
  11408. // to force getter re-evaluation for hot reloading.
  11409. store._withCommit(function () {
  11410. oldVm._data.$$state = null;
  11411. });
  11412. }
  11413. Vue.nextTick(function () { return oldVm.$destroy(); });
  11414. }
  11415. }
  11416. function installModule (store, rootState, path, module, hot) {
  11417. var isRoot = !path.length;
  11418. var namespace = store._modules.getNamespace(path);
  11419. // register in namespace map
  11420. if (module.namespaced) {
  11421. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  11422. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  11423. }
  11424. store._modulesNamespaceMap[namespace] = module;
  11425. }
  11426. // set state
  11427. if (!isRoot && !hot) {
  11428. var parentState = getNestedState(rootState, path.slice(0, -1));
  11429. var moduleName = path[path.length - 1];
  11430. store._withCommit(function () {
  11431. if ((true)) {
  11432. if (moduleName in parentState) {
  11433. console.warn(
  11434. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  11435. );
  11436. }
  11437. }
  11438. Vue.set(parentState, moduleName, module.state);
  11439. });
  11440. }
  11441. var local = module.context = makeLocalContext(store, namespace, path);
  11442. module.forEachMutation(function (mutation, key) {
  11443. var namespacedType = namespace + key;
  11444. registerMutation(store, namespacedType, mutation, local);
  11445. });
  11446. module.forEachAction(function (action, key) {
  11447. var type = action.root ? key : namespace + key;
  11448. var handler = action.handler || action;
  11449. registerAction(store, type, handler, local);
  11450. });
  11451. module.forEachGetter(function (getter, key) {
  11452. var namespacedType = namespace + key;
  11453. registerGetter(store, namespacedType, getter, local);
  11454. });
  11455. module.forEachChild(function (child, key) {
  11456. installModule(store, rootState, path.concat(key), child, hot);
  11457. });
  11458. }
  11459. /**
  11460. * make localized dispatch, commit, getters and state
  11461. * if there is no namespace, just use root ones
  11462. */
  11463. function makeLocalContext (store, namespace, path) {
  11464. var noNamespace = namespace === '';
  11465. var local = {
  11466. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  11467. var args = unifyObjectStyle(_type, _payload, _options);
  11468. var payload = args.payload;
  11469. var options = args.options;
  11470. var type = args.type;
  11471. if (!options || !options.root) {
  11472. type = namespace + type;
  11473. if (( true) && !store._actions[type]) {
  11474. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  11475. return
  11476. }
  11477. }
  11478. return store.dispatch(type, payload)
  11479. },
  11480. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  11481. var args = unifyObjectStyle(_type, _payload, _options);
  11482. var payload = args.payload;
  11483. var options = args.options;
  11484. var type = args.type;
  11485. if (!options || !options.root) {
  11486. type = namespace + type;
  11487. if (( true) && !store._mutations[type]) {
  11488. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  11489. return
  11490. }
  11491. }
  11492. store.commit(type, payload, options);
  11493. }
  11494. };
  11495. // getters and state object must be gotten lazily
  11496. // because they will be changed by vm update
  11497. Object.defineProperties(local, {
  11498. getters: {
  11499. get: noNamespace
  11500. ? function () { return store.getters; }
  11501. : function () { return makeLocalGetters(store, namespace); }
  11502. },
  11503. state: {
  11504. get: function () { return getNestedState(store.state, path); }
  11505. }
  11506. });
  11507. return local
  11508. }
  11509. function makeLocalGetters (store, namespace) {
  11510. if (!store._makeLocalGettersCache[namespace]) {
  11511. var gettersProxy = {};
  11512. var splitPos = namespace.length;
  11513. Object.keys(store.getters).forEach(function (type) {
  11514. // skip if the target getter is not match this namespace
  11515. if (type.slice(0, splitPos) !== namespace) { return }
  11516. // extract local getter type
  11517. var localType = type.slice(splitPos);
  11518. // Add a port to the getters proxy.
  11519. // Define as getter property because
  11520. // we do not want to evaluate the getters in this time.
  11521. Object.defineProperty(gettersProxy, localType, {
  11522. get: function () { return store.getters[type]; },
  11523. enumerable: true
  11524. });
  11525. });
  11526. store._makeLocalGettersCache[namespace] = gettersProxy;
  11527. }
  11528. return store._makeLocalGettersCache[namespace]
  11529. }
  11530. function registerMutation (store, type, handler, local) {
  11531. var entry = store._mutations[type] || (store._mutations[type] = []);
  11532. entry.push(function wrappedMutationHandler (payload) {
  11533. handler.call(store, local.state, payload);
  11534. });
  11535. }
  11536. function registerAction (store, type, handler, local) {
  11537. var entry = store._actions[type] || (store._actions[type] = []);
  11538. entry.push(function wrappedActionHandler (payload) {
  11539. var res = handler.call(store, {
  11540. dispatch: local.dispatch,
  11541. commit: local.commit,
  11542. getters: local.getters,
  11543. state: local.state,
  11544. rootGetters: store.getters,
  11545. rootState: store.state
  11546. }, payload);
  11547. if (!isPromise(res)) {
  11548. res = Promise.resolve(res);
  11549. }
  11550. if (store._devtoolHook) {
  11551. return res.catch(function (err) {
  11552. store._devtoolHook.emit('vuex:error', err);
  11553. throw err
  11554. })
  11555. } else {
  11556. return res
  11557. }
  11558. });
  11559. }
  11560. function registerGetter (store, type, rawGetter, local) {
  11561. if (store._wrappedGetters[type]) {
  11562. if ((true)) {
  11563. console.error(("[vuex] duplicate getter key: " + type));
  11564. }
  11565. return
  11566. }
  11567. store._wrappedGetters[type] = function wrappedGetter (store) {
  11568. return rawGetter(
  11569. local.state, // local state
  11570. local.getters, // local getters
  11571. store.state, // root state
  11572. store.getters // root getters
  11573. )
  11574. };
  11575. }
  11576. function enableStrictMode (store) {
  11577. store._vm.$watch(function () { return this._data.$$state }, function () {
  11578. if ((true)) {
  11579. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  11580. }
  11581. }, { deep: true, sync: true });
  11582. }
  11583. function getNestedState (state, path) {
  11584. return path.reduce(function (state, key) { return state[key]; }, state)
  11585. }
  11586. function unifyObjectStyle (type, payload, options) {
  11587. if (isObject(type) && type.type) {
  11588. options = payload;
  11589. payload = type;
  11590. type = type.type;
  11591. }
  11592. if ((true)) {
  11593. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  11594. }
  11595. return { type: type, payload: payload, options: options }
  11596. }
  11597. function install (_Vue) {
  11598. if (Vue && _Vue === Vue) {
  11599. if ((true)) {
  11600. console.error(
  11601. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  11602. );
  11603. }
  11604. return
  11605. }
  11606. Vue = _Vue;
  11607. applyMixin(Vue);
  11608. }
  11609. /**
  11610. * Reduce the code which written in Vue.js for getting the state.
  11611. * @param {String} [namespace] - Module's namespace
  11612. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  11613. * @param {Object}
  11614. */
  11615. var mapState = normalizeNamespace(function (namespace, states) {
  11616. var res = {};
  11617. if (( true) && !isValidMap(states)) {
  11618. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  11619. }
  11620. normalizeMap(states).forEach(function (ref) {
  11621. var key = ref.key;
  11622. var val = ref.val;
  11623. res[key] = function mappedState () {
  11624. var state = this.$store.state;
  11625. var getters = this.$store.getters;
  11626. if (namespace) {
  11627. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  11628. if (!module) {
  11629. return
  11630. }
  11631. state = module.context.state;
  11632. getters = module.context.getters;
  11633. }
  11634. return typeof val === 'function'
  11635. ? val.call(this, state, getters)
  11636. : state[val]
  11637. };
  11638. // mark vuex getter for devtools
  11639. res[key].vuex = true;
  11640. });
  11641. return res
  11642. });
  11643. /**
  11644. * Reduce the code which written in Vue.js for committing the mutation
  11645. * @param {String} [namespace] - Module's namespace
  11646. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  11647. * @return {Object}
  11648. */
  11649. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  11650. var res = {};
  11651. if (( true) && !isValidMap(mutations)) {
  11652. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  11653. }
  11654. normalizeMap(mutations).forEach(function (ref) {
  11655. var key = ref.key;
  11656. var val = ref.val;
  11657. res[key] = function mappedMutation () {
  11658. var args = [], len = arguments.length;
  11659. while ( len-- ) args[ len ] = arguments[ len ];
  11660. // Get the commit method from store
  11661. var commit = this.$store.commit;
  11662. if (namespace) {
  11663. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  11664. if (!module) {
  11665. return
  11666. }
  11667. commit = module.context.commit;
  11668. }
  11669. return typeof val === 'function'
  11670. ? val.apply(this, [commit].concat(args))
  11671. : commit.apply(this.$store, [val].concat(args))
  11672. };
  11673. });
  11674. return res
  11675. });
  11676. /**
  11677. * Reduce the code which written in Vue.js for getting the getters
  11678. * @param {String} [namespace] - Module's namespace
  11679. * @param {Object|Array} getters
  11680. * @return {Object}
  11681. */
  11682. var mapGetters = normalizeNamespace(function (namespace, getters) {
  11683. var res = {};
  11684. if (( true) && !isValidMap(getters)) {
  11685. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  11686. }
  11687. normalizeMap(getters).forEach(function (ref) {
  11688. var key = ref.key;
  11689. var val = ref.val;
  11690. // The namespace has been mutated by normalizeNamespace
  11691. val = namespace + val;
  11692. res[key] = function mappedGetter () {
  11693. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  11694. return
  11695. }
  11696. if (( true) && !(val in this.$store.getters)) {
  11697. console.error(("[vuex] unknown getter: " + val));
  11698. return
  11699. }
  11700. return this.$store.getters[val]
  11701. };
  11702. // mark vuex getter for devtools
  11703. res[key].vuex = true;
  11704. });
  11705. return res
  11706. });
  11707. /**
  11708. * Reduce the code which written in Vue.js for dispatch the action
  11709. * @param {String} [namespace] - Module's namespace
  11710. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  11711. * @return {Object}
  11712. */
  11713. var mapActions = normalizeNamespace(function (namespace, actions) {
  11714. var res = {};
  11715. if (( true) && !isValidMap(actions)) {
  11716. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  11717. }
  11718. normalizeMap(actions).forEach(function (ref) {
  11719. var key = ref.key;
  11720. var val = ref.val;
  11721. res[key] = function mappedAction () {
  11722. var args = [], len = arguments.length;
  11723. while ( len-- ) args[ len ] = arguments[ len ];
  11724. // get dispatch function from store
  11725. var dispatch = this.$store.dispatch;
  11726. if (namespace) {
  11727. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  11728. if (!module) {
  11729. return
  11730. }
  11731. dispatch = module.context.dispatch;
  11732. }
  11733. return typeof val === 'function'
  11734. ? val.apply(this, [dispatch].concat(args))
  11735. : dispatch.apply(this.$store, [val].concat(args))
  11736. };
  11737. });
  11738. return res
  11739. });
  11740. /**
  11741. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  11742. * @param {String} namespace
  11743. * @return {Object}
  11744. */
  11745. var createNamespacedHelpers = function (namespace) { return ({
  11746. mapState: mapState.bind(null, namespace),
  11747. mapGetters: mapGetters.bind(null, namespace),
  11748. mapMutations: mapMutations.bind(null, namespace),
  11749. mapActions: mapActions.bind(null, namespace)
  11750. }); };
  11751. /**
  11752. * Normalize the map
  11753. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  11754. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  11755. * @param {Array|Object} map
  11756. * @return {Object}
  11757. */
  11758. function normalizeMap (map) {
  11759. if (!isValidMap(map)) {
  11760. return []
  11761. }
  11762. return Array.isArray(map)
  11763. ? map.map(function (key) { return ({ key: key, val: key }); })
  11764. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  11765. }
  11766. /**
  11767. * Validate whether given map is valid or not
  11768. * @param {*} map
  11769. * @return {Boolean}
  11770. */
  11771. function isValidMap (map) {
  11772. return Array.isArray(map) || isObject(map)
  11773. }
  11774. /**
  11775. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  11776. * @param {Function} fn
  11777. * @return {Function}
  11778. */
  11779. function normalizeNamespace (fn) {
  11780. return function (namespace, map) {
  11781. if (typeof namespace !== 'string') {
  11782. map = namespace;
  11783. namespace = '';
  11784. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  11785. namespace += '/';
  11786. }
  11787. return fn(namespace, map)
  11788. }
  11789. }
  11790. /**
  11791. * Search a special module from store by namespace. if module not exist, print error message.
  11792. * @param {Object} store
  11793. * @param {String} helper
  11794. * @param {String} namespace
  11795. * @return {Object}
  11796. */
  11797. function getModuleByNamespace (store, helper, namespace) {
  11798. var module = store._modulesNamespaceMap[namespace];
  11799. if (( true) && !module) {
  11800. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  11801. }
  11802. return module
  11803. }
  11804. // Credits: borrowed code from fcomb/redux-logger
  11805. function createLogger (ref) {
  11806. if ( ref === void 0 ) ref = {};
  11807. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  11808. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  11809. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  11810. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  11811. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  11812. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  11813. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  11814. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  11815. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  11816. return function (store) {
  11817. var prevState = deepCopy(store.state);
  11818. if (typeof logger === 'undefined') {
  11819. return
  11820. }
  11821. if (logMutations) {
  11822. store.subscribe(function (mutation, state) {
  11823. var nextState = deepCopy(state);
  11824. if (filter(mutation, prevState, nextState)) {
  11825. var formattedTime = getFormattedTime();
  11826. var formattedMutation = mutationTransformer(mutation);
  11827. var message = "mutation " + (mutation.type) + formattedTime;
  11828. startMessage(logger, message, collapsed);
  11829. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  11830. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  11831. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  11832. endMessage(logger);
  11833. }
  11834. prevState = nextState;
  11835. });
  11836. }
  11837. if (logActions) {
  11838. store.subscribeAction(function (action, state) {
  11839. if (actionFilter(action, state)) {
  11840. var formattedTime = getFormattedTime();
  11841. var formattedAction = actionTransformer(action);
  11842. var message = "action " + (action.type) + formattedTime;
  11843. startMessage(logger, message, collapsed);
  11844. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  11845. endMessage(logger);
  11846. }
  11847. });
  11848. }
  11849. }
  11850. }
  11851. function startMessage (logger, message, collapsed) {
  11852. var startMessage = collapsed
  11853. ? logger.groupCollapsed
  11854. : logger.group;
  11855. // render
  11856. try {
  11857. startMessage.call(logger, message);
  11858. } catch (e) {
  11859. logger.log(message);
  11860. }
  11861. }
  11862. function endMessage (logger) {
  11863. try {
  11864. logger.groupEnd();
  11865. } catch (e) {
  11866. logger.log('—— log end ——');
  11867. }
  11868. }
  11869. function getFormattedTime () {
  11870. var time = new Date();
  11871. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  11872. }
  11873. function repeat (str, times) {
  11874. return (new Array(times + 1)).join(str)
  11875. }
  11876. function pad (num, maxLength) {
  11877. return repeat('0', maxLength - num.toString().length) + num
  11878. }
  11879. var index_cjs = {
  11880. Store: Store,
  11881. install: install,
  11882. version: '3.6.2',
  11883. mapState: mapState,
  11884. mapMutations: mapMutations,
  11885. mapGetters: mapGetters,
  11886. mapActions: mapActions,
  11887. createNamespacedHelpers: createNamespacedHelpers,
  11888. createLogger: createLogger
  11889. };
  11890. module.exports = index_cjs;
  11891. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  11892. /***/ }),
  11893. /***/ 8:
  11894. /*!****************************************!*\
  11895. !*** D:/六牛项目/lnyk/store/model/user.js ***!
  11896. \****************************************/
  11897. /*! no static exports found */
  11898. /***/ (function(module, exports, __webpack_require__) {
  11899. "use strict";
  11900. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var state = {
  11901. userInfo: {}, //用户信息
  11902. hasLogin: false //是否登录
  11903. };
  11904. var mutations = {
  11905. // 登录
  11906. login: function login(state) {
  11907. state.hasLogin = true;
  11908. },
  11909. // 退出登录
  11910. logout: function logout(state, provider) {
  11911. state.hasLogin = false;
  11912. // 清除缓存用户信息
  11913. uni.removeStorage({
  11914. key: 'userInfo' });
  11915. // 清除缓存token
  11916. uni.removeStorage({
  11917. key: 'token' });
  11918. },
  11919. // 保存用户信息
  11920. setUserInfo: function setUserInfo(state, provider) {
  11921. state.userInfo = provider;
  11922. uni.setStorage({ //缓存用户登陆状态
  11923. key: 'userInfo',
  11924. data: provider });
  11925. } };
  11926. var getters = {};var _default =
  11927. {
  11928. namespaced: true,
  11929. state: state,
  11930. mutations: mutations,
  11931. getters: getters };exports.default = _default;
  11932. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11933. /***/ }),
  11934. /***/ 96:
  11935. /*!*********************************************************!*\
  11936. !*** D:/六牛项目/lnyk/components/Sansnn-uQRCode/uqrcode.js ***!
  11937. \*********************************************************/
  11938. /*! no static exports found */
  11939. /***/ (function(module, exports, __webpack_require__) {
  11940. "use strict";
  11941. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; //---------------------------------------------------------------------
  11942. // github https://github.com/Sansnn/uQRCode
  11943. //---------------------------------------------------------------------
  11944. var uQRCode = {};
  11945. (function () {
  11946. //---------------------------------------------------------------------
  11947. // QRCode for JavaScript
  11948. //
  11949. // Copyright (c) 2009 Kazuhiko Arase
  11950. //
  11951. // URL: http://www.d-project.com/
  11952. //
  11953. // Licensed under the MIT license:
  11954. // http://www.opensource.org/licenses/mit-license.php
  11955. //
  11956. // The word "QR Code" is registered trademark of
  11957. // DENSO WAVE INCORPORATED
  11958. // http://www.denso-wave.com/qrcode/faqpatent-e.html
  11959. //
  11960. //---------------------------------------------------------------------
  11961. //---------------------------------------------------------------------
  11962. // QR8bitByte
  11963. //---------------------------------------------------------------------
  11964. function QR8bitByte(data) {
  11965. this.mode = QRMode.MODE_8BIT_BYTE;
  11966. this.data = data;
  11967. }
  11968. QR8bitByte.prototype = {
  11969. getLength: function getLength(buffer) {
  11970. return this.data.length;
  11971. },
  11972. write: function write(buffer) {
  11973. for (var i = 0; i < this.data.length; i++) {
  11974. // not JIS ...
  11975. buffer.put(this.data.charCodeAt(i), 8);
  11976. }
  11977. } };
  11978. //---------------------------------------------------------------------
  11979. // QRCode
  11980. //---------------------------------------------------------------------
  11981. function QRCode(typeNumber, errorCorrectLevel) {
  11982. this.typeNumber = typeNumber;
  11983. this.errorCorrectLevel = errorCorrectLevel;
  11984. this.modules = null;
  11985. this.moduleCount = 0;
  11986. this.dataCache = null;
  11987. this.dataList = new Array();
  11988. }
  11989. QRCode.prototype = {
  11990. addData: function addData(data) {
  11991. var newData = new QR8bitByte(data);
  11992. this.dataList.push(newData);
  11993. this.dataCache = null;
  11994. },
  11995. isDark: function isDark(row, col) {
  11996. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  11997. throw new Error(row + "," + col);
  11998. }
  11999. return this.modules[row][col];
  12000. },
  12001. getModuleCount: function getModuleCount() {
  12002. return this.moduleCount;
  12003. },
  12004. make: function make() {
  12005. // Calculate automatically typeNumber if provided is < 1
  12006. if (this.typeNumber < 1) {
  12007. var typeNumber = 1;
  12008. for (typeNumber = 1; typeNumber < 40; typeNumber++) {
  12009. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
  12010. var buffer = new QRBitBuffer();
  12011. var totalDataCount = 0;
  12012. for (var i = 0; i < rsBlocks.length; i++) {
  12013. totalDataCount += rsBlocks[i].dataCount;
  12014. }
  12015. for (var i = 0; i < this.dataList.length; i++) {
  12016. var data = this.dataList[i];
  12017. buffer.put(data.mode, 4);
  12018. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  12019. data.write(buffer);
  12020. }
  12021. if (buffer.getLengthInBits() <= totalDataCount * 8)
  12022. break;
  12023. }
  12024. this.typeNumber = typeNumber;
  12025. }
  12026. this.makeImpl(false, this.getBestMaskPattern());
  12027. },
  12028. makeImpl: function makeImpl(test, maskPattern) {
  12029. this.moduleCount = this.typeNumber * 4 + 17;
  12030. this.modules = new Array(this.moduleCount);
  12031. for (var row = 0; row < this.moduleCount; row++) {
  12032. this.modules[row] = new Array(this.moduleCount);
  12033. for (var col = 0; col < this.moduleCount; col++) {
  12034. this.modules[row][col] = null; //(col + row) % 3;
  12035. }
  12036. }
  12037. this.setupPositionProbePattern(0, 0);
  12038. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  12039. this.setupPositionProbePattern(0, this.moduleCount - 7);
  12040. this.setupPositionAdjustPattern();
  12041. this.setupTimingPattern();
  12042. this.setupTypeInfo(test, maskPattern);
  12043. if (this.typeNumber >= 7) {
  12044. this.setupTypeNumber(test);
  12045. }
  12046. if (this.dataCache == null) {
  12047. this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  12048. }
  12049. this.mapData(this.dataCache, maskPattern);
  12050. },
  12051. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  12052. for (var r = -1; r <= 7; r++) {
  12053. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  12054. for (var c = -1; c <= 7; c++) {
  12055. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  12056. if (0 <= r && r <= 6 && (c == 0 || c == 6) ||
  12057. 0 <= c && c <= 6 && (r == 0 || r == 6) ||
  12058. 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  12059. this.modules[row + r][col + c] = true;
  12060. } else {
  12061. this.modules[row + r][col + c] = false;
  12062. }
  12063. }
  12064. }
  12065. },
  12066. getBestMaskPattern: function getBestMaskPattern() {
  12067. var minLostPoint = 0;
  12068. var pattern = 0;
  12069. for (var i = 0; i < 8; i++) {
  12070. this.makeImpl(true, i);
  12071. var lostPoint = QRUtil.getLostPoint(this);
  12072. if (i == 0 || minLostPoint > lostPoint) {
  12073. minLostPoint = lostPoint;
  12074. pattern = i;
  12075. }
  12076. }
  12077. return pattern;
  12078. },
  12079. createMovieClip: function createMovieClip(target_mc, instance_name, depth) {
  12080. var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
  12081. var cs = 1;
  12082. this.make();
  12083. for (var row = 0; row < this.modules.length; row++) {
  12084. var y = row * cs;
  12085. for (var col = 0; col < this.modules[row].length; col++) {
  12086. var x = col * cs;
  12087. var dark = this.modules[row][col];
  12088. if (dark) {
  12089. qr_mc.beginFill(0, 100);
  12090. qr_mc.moveTo(x, y);
  12091. qr_mc.lineTo(x + cs, y);
  12092. qr_mc.lineTo(x + cs, y + cs);
  12093. qr_mc.lineTo(x, y + cs);
  12094. qr_mc.endFill();
  12095. }
  12096. }
  12097. }
  12098. return qr_mc;
  12099. },
  12100. setupTimingPattern: function setupTimingPattern() {
  12101. for (var r = 8; r < this.moduleCount - 8; r++) {
  12102. if (this.modules[r][6] != null) {
  12103. continue;
  12104. }
  12105. this.modules[r][6] = r % 2 == 0;
  12106. }
  12107. for (var c = 8; c < this.moduleCount - 8; c++) {
  12108. if (this.modules[6][c] != null) {
  12109. continue;
  12110. }
  12111. this.modules[6][c] = c % 2 == 0;
  12112. }
  12113. },
  12114. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  12115. var pos = QRUtil.getPatternPosition(this.typeNumber);
  12116. for (var i = 0; i < pos.length; i++) {
  12117. for (var j = 0; j < pos.length; j++) {
  12118. var row = pos[i];
  12119. var col = pos[j];
  12120. if (this.modules[row][col] != null) {
  12121. continue;
  12122. }
  12123. for (var r = -2; r <= 2; r++) {
  12124. for (var c = -2; c <= 2; c++) {
  12125. if (r == -2 || r == 2 || c == -2 || c == 2 ||
  12126. r == 0 && c == 0) {
  12127. this.modules[row + r][col + c] = true;
  12128. } else {
  12129. this.modules[row + r][col + c] = false;
  12130. }
  12131. }
  12132. }
  12133. }
  12134. }
  12135. },
  12136. setupTypeNumber: function setupTypeNumber(test) {
  12137. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  12138. for (var i = 0; i < 18; i++) {
  12139. var mod = !test && (bits >> i & 1) == 1;
  12140. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  12141. }
  12142. for (var i = 0; i < 18; i++) {
  12143. var mod = !test && (bits >> i & 1) == 1;
  12144. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  12145. }
  12146. },
  12147. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  12148. var data = this.errorCorrectLevel << 3 | maskPattern;
  12149. var bits = QRUtil.getBCHTypeInfo(data);
  12150. // vertical
  12151. for (var i = 0; i < 15; i++) {
  12152. var mod = !test && (bits >> i & 1) == 1;
  12153. if (i < 6) {
  12154. this.modules[i][8] = mod;
  12155. } else if (i < 8) {
  12156. this.modules[i + 1][8] = mod;
  12157. } else {
  12158. this.modules[this.moduleCount - 15 + i][8] = mod;
  12159. }
  12160. }
  12161. // horizontal
  12162. for (var i = 0; i < 15; i++) {
  12163. var mod = !test && (bits >> i & 1) == 1;
  12164. if (i < 8) {
  12165. this.modules[8][this.moduleCount - i - 1] = mod;
  12166. } else if (i < 9) {
  12167. this.modules[8][15 - i - 1 + 1] = mod;
  12168. } else {
  12169. this.modules[8][15 - i - 1] = mod;
  12170. }
  12171. }
  12172. // fixed module
  12173. this.modules[this.moduleCount - 8][8] = !test;
  12174. },
  12175. mapData: function mapData(data, maskPattern) {
  12176. var inc = -1;
  12177. var row = this.moduleCount - 1;
  12178. var bitIndex = 7;
  12179. var byteIndex = 0;
  12180. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  12181. if (col == 6) col--;
  12182. while (true) {
  12183. for (var c = 0; c < 2; c++) {
  12184. if (this.modules[row][col - c] == null) {
  12185. var dark = false;
  12186. if (byteIndex < data.length) {
  12187. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  12188. }
  12189. var mask = QRUtil.getMask(maskPattern, row, col - c);
  12190. if (mask) {
  12191. dark = !dark;
  12192. }
  12193. this.modules[row][col - c] = dark;
  12194. bitIndex--;
  12195. if (bitIndex == -1) {
  12196. byteIndex++;
  12197. bitIndex = 7;
  12198. }
  12199. }
  12200. }
  12201. row += inc;
  12202. if (row < 0 || this.moduleCount <= row) {
  12203. row -= inc;
  12204. inc = -inc;
  12205. break;
  12206. }
  12207. }
  12208. }
  12209. } };
  12210. QRCode.PAD0 = 0xEC;
  12211. QRCode.PAD1 = 0x11;
  12212. QRCode.createData = function (typeNumber, errorCorrectLevel, dataList) {
  12213. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
  12214. var buffer = new QRBitBuffer();
  12215. for (var i = 0; i < dataList.length; i++) {
  12216. var data = dataList[i];
  12217. buffer.put(data.mode, 4);
  12218. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  12219. data.write(buffer);
  12220. }
  12221. // calc num max data.
  12222. var totalDataCount = 0;
  12223. for (var i = 0; i < rsBlocks.length; i++) {
  12224. totalDataCount += rsBlocks[i].dataCount;
  12225. }
  12226. if (buffer.getLengthInBits() > totalDataCount * 8) {
  12227. throw new Error("code length overflow. (" +
  12228. buffer.getLengthInBits() +
  12229. ">" +
  12230. totalDataCount * 8 +
  12231. ")");
  12232. }
  12233. // end code
  12234. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  12235. buffer.put(0, 4);
  12236. }
  12237. // padding
  12238. while (buffer.getLengthInBits() % 8 != 0) {
  12239. buffer.putBit(false);
  12240. }
  12241. // padding
  12242. while (true) {
  12243. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  12244. break;
  12245. }
  12246. buffer.put(QRCode.PAD0, 8);
  12247. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  12248. break;
  12249. }
  12250. buffer.put(QRCode.PAD1, 8);
  12251. }
  12252. return QRCode.createBytes(buffer, rsBlocks);
  12253. };
  12254. QRCode.createBytes = function (buffer, rsBlocks) {
  12255. var offset = 0;
  12256. var maxDcCount = 0;
  12257. var maxEcCount = 0;
  12258. var dcdata = new Array(rsBlocks.length);
  12259. var ecdata = new Array(rsBlocks.length);
  12260. for (var r = 0; r < rsBlocks.length; r++) {
  12261. var dcCount = rsBlocks[r].dataCount;
  12262. var ecCount = rsBlocks[r].totalCount - dcCount;
  12263. maxDcCount = Math.max(maxDcCount, dcCount);
  12264. maxEcCount = Math.max(maxEcCount, ecCount);
  12265. dcdata[r] = new Array(dcCount);
  12266. for (var i = 0; i < dcdata[r].length; i++) {
  12267. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  12268. }
  12269. offset += dcCount;
  12270. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  12271. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  12272. var modPoly = rawPoly.mod(rsPoly);
  12273. ecdata[r] = new Array(rsPoly.getLength() - 1);
  12274. for (var i = 0; i < ecdata[r].length; i++) {
  12275. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  12276. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  12277. }
  12278. }
  12279. var totalCodeCount = 0;
  12280. for (var i = 0; i < rsBlocks.length; i++) {
  12281. totalCodeCount += rsBlocks[i].totalCount;
  12282. }
  12283. var data = new Array(totalCodeCount);
  12284. var index = 0;
  12285. for (var i = 0; i < maxDcCount; i++) {
  12286. for (var r = 0; r < rsBlocks.length; r++) {
  12287. if (i < dcdata[r].length) {
  12288. data[index++] = dcdata[r][i];
  12289. }
  12290. }
  12291. }
  12292. for (var i = 0; i < maxEcCount; i++) {
  12293. for (var r = 0; r < rsBlocks.length; r++) {
  12294. if (i < ecdata[r].length) {
  12295. data[index++] = ecdata[r][i];
  12296. }
  12297. }
  12298. }
  12299. return data;
  12300. };
  12301. //---------------------------------------------------------------------
  12302. // QRMode
  12303. //---------------------------------------------------------------------
  12304. var QRMode = {
  12305. MODE_NUMBER: 1 << 0,
  12306. MODE_ALPHA_NUM: 1 << 1,
  12307. MODE_8BIT_BYTE: 1 << 2,
  12308. MODE_KANJI: 1 << 3 };
  12309. //---------------------------------------------------------------------
  12310. // QRErrorCorrectLevel
  12311. //---------------------------------------------------------------------
  12312. var QRErrorCorrectLevel = {
  12313. L: 1,
  12314. M: 0,
  12315. Q: 3,
  12316. H: 2 };
  12317. //---------------------------------------------------------------------
  12318. // QRMaskPattern
  12319. //---------------------------------------------------------------------
  12320. var QRMaskPattern = {
  12321. PATTERN000: 0,
  12322. PATTERN001: 1,
  12323. PATTERN010: 2,
  12324. PATTERN011: 3,
  12325. PATTERN100: 4,
  12326. PATTERN101: 5,
  12327. PATTERN110: 6,
  12328. PATTERN111: 7 };
  12329. //---------------------------------------------------------------------
  12330. // QRUtil
  12331. //---------------------------------------------------------------------
  12332. var QRUtil = {
  12333. PATTERN_POSITION_TABLE: [
  12334. [],
  12335. [6, 18],
  12336. [6, 22],
  12337. [6, 26],
  12338. [6, 30],
  12339. [6, 34],
  12340. [6, 22, 38],
  12341. [6, 24, 42],
  12342. [6, 26, 46],
  12343. [6, 28, 50],
  12344. [6, 30, 54],
  12345. [6, 32, 58],
  12346. [6, 34, 62],
  12347. [6, 26, 46, 66],
  12348. [6, 26, 48, 70],
  12349. [6, 26, 50, 74],
  12350. [6, 30, 54, 78],
  12351. [6, 30, 56, 82],
  12352. [6, 30, 58, 86],
  12353. [6, 34, 62, 90],
  12354. [6, 28, 50, 72, 94],
  12355. [6, 26, 50, 74, 98],
  12356. [6, 30, 54, 78, 102],
  12357. [6, 28, 54, 80, 106],
  12358. [6, 32, 58, 84, 110],
  12359. [6, 30, 58, 86, 114],
  12360. [6, 34, 62, 90, 118],
  12361. [6, 26, 50, 74, 98, 122],
  12362. [6, 30, 54, 78, 102, 126],
  12363. [6, 26, 52, 78, 104, 130],
  12364. [6, 30, 56, 82, 108, 134],
  12365. [6, 34, 60, 86, 112, 138],
  12366. [6, 30, 58, 86, 114, 142],
  12367. [6, 34, 62, 90, 118, 146],
  12368. [6, 30, 54, 78, 102, 126, 150],
  12369. [6, 24, 50, 76, 102, 128, 154],
  12370. [6, 28, 54, 80, 106, 132, 158],
  12371. [6, 32, 58, 84, 110, 136, 162],
  12372. [6, 26, 54, 82, 110, 138, 166],
  12373. [6, 30, 58, 86, 114, 142, 170]],
  12374. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  12375. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  12376. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  12377. getBCHTypeInfo: function getBCHTypeInfo(data) {
  12378. var d = data << 10;
  12379. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  12380. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  12381. }
  12382. return (data << 10 | d) ^ QRUtil.G15_MASK;
  12383. },
  12384. getBCHTypeNumber: function getBCHTypeNumber(data) {
  12385. var d = data << 12;
  12386. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  12387. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  12388. }
  12389. return data << 12 | d;
  12390. },
  12391. getBCHDigit: function getBCHDigit(data) {
  12392. var digit = 0;
  12393. while (data != 0) {
  12394. digit++;
  12395. data >>>= 1;
  12396. }
  12397. return digit;
  12398. },
  12399. getPatternPosition: function getPatternPosition(typeNumber) {
  12400. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  12401. },
  12402. getMask: function getMask(maskPattern, i, j) {
  12403. switch (maskPattern) {
  12404. case QRMaskPattern.PATTERN000:
  12405. return (i + j) % 2 == 0;
  12406. case QRMaskPattern.PATTERN001:
  12407. return i % 2 == 0;
  12408. case QRMaskPattern.PATTERN010:
  12409. return j % 3 == 0;
  12410. case QRMaskPattern.PATTERN011:
  12411. return (i + j) % 3 == 0;
  12412. case QRMaskPattern.PATTERN100:
  12413. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  12414. case QRMaskPattern.PATTERN101:
  12415. return i * j % 2 + i * j % 3 == 0;
  12416. case QRMaskPattern.PATTERN110:
  12417. return (i * j % 2 + i * j % 3) % 2 == 0;
  12418. case QRMaskPattern.PATTERN111:
  12419. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  12420. default:
  12421. throw new Error("bad maskPattern:" + maskPattern);}
  12422. },
  12423. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  12424. var a = new QRPolynomial([1], 0);
  12425. for (var i = 0; i < errorCorrectLength; i++) {
  12426. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  12427. }
  12428. return a;
  12429. },
  12430. getLengthInBits: function getLengthInBits(mode, type) {
  12431. if (1 <= type && type < 10) {
  12432. // 1 - 9
  12433. switch (mode) {
  12434. case QRMode.MODE_NUMBER:
  12435. return 10;
  12436. case QRMode.MODE_ALPHA_NUM:
  12437. return 9;
  12438. case QRMode.MODE_8BIT_BYTE:
  12439. return 8;
  12440. case QRMode.MODE_KANJI:
  12441. return 8;
  12442. default:
  12443. throw new Error("mode:" + mode);}
  12444. } else if (type < 27) {
  12445. // 10 - 26
  12446. switch (mode) {
  12447. case QRMode.MODE_NUMBER:
  12448. return 12;
  12449. case QRMode.MODE_ALPHA_NUM:
  12450. return 11;
  12451. case QRMode.MODE_8BIT_BYTE:
  12452. return 16;
  12453. case QRMode.MODE_KANJI:
  12454. return 10;
  12455. default:
  12456. throw new Error("mode:" + mode);}
  12457. } else if (type < 41) {
  12458. // 27 - 40
  12459. switch (mode) {
  12460. case QRMode.MODE_NUMBER:
  12461. return 14;
  12462. case QRMode.MODE_ALPHA_NUM:
  12463. return 13;
  12464. case QRMode.MODE_8BIT_BYTE:
  12465. return 16;
  12466. case QRMode.MODE_KANJI:
  12467. return 12;
  12468. default:
  12469. throw new Error("mode:" + mode);}
  12470. } else {
  12471. throw new Error("type:" + type);
  12472. }
  12473. },
  12474. getLostPoint: function getLostPoint(qrCode) {
  12475. var moduleCount = qrCode.getModuleCount();
  12476. var lostPoint = 0;
  12477. // LEVEL1
  12478. for (var row = 0; row < moduleCount; row++) {
  12479. for (var col = 0; col < moduleCount; col++) {
  12480. var sameCount = 0;
  12481. var dark = qrCode.isDark(row, col);
  12482. for (var r = -1; r <= 1; r++) {
  12483. if (row + r < 0 || moduleCount <= row + r) {
  12484. continue;
  12485. }
  12486. for (var c = -1; c <= 1; c++) {
  12487. if (col + c < 0 || moduleCount <= col + c) {
  12488. continue;
  12489. }
  12490. if (r == 0 && c == 0) {
  12491. continue;
  12492. }
  12493. if (dark == qrCode.isDark(row + r, col + c)) {
  12494. sameCount++;
  12495. }
  12496. }
  12497. }
  12498. if (sameCount > 5) {
  12499. lostPoint += 3 + sameCount - 5;
  12500. }
  12501. }
  12502. }
  12503. // LEVEL2
  12504. for (var row = 0; row < moduleCount - 1; row++) {
  12505. for (var col = 0; col < moduleCount - 1; col++) {
  12506. var count = 0;
  12507. if (qrCode.isDark(row, col)) count++;
  12508. if (qrCode.isDark(row + 1, col)) count++;
  12509. if (qrCode.isDark(row, col + 1)) count++;
  12510. if (qrCode.isDark(row + 1, col + 1)) count++;
  12511. if (count == 0 || count == 4) {
  12512. lostPoint += 3;
  12513. }
  12514. }
  12515. }
  12516. // LEVEL3
  12517. for (var row = 0; row < moduleCount; row++) {
  12518. for (var col = 0; col < moduleCount - 6; col++) {
  12519. if (qrCode.isDark(row, col) &&
  12520. !qrCode.isDark(row, col + 1) &&
  12521. qrCode.isDark(row, col + 2) &&
  12522. qrCode.isDark(row, col + 3) &&
  12523. qrCode.isDark(row, col + 4) &&
  12524. !qrCode.isDark(row, col + 5) &&
  12525. qrCode.isDark(row, col + 6)) {
  12526. lostPoint += 40;
  12527. }
  12528. }
  12529. }
  12530. for (var col = 0; col < moduleCount; col++) {
  12531. for (var row = 0; row < moduleCount - 6; row++) {
  12532. if (qrCode.isDark(row, col) &&
  12533. !qrCode.isDark(row + 1, col) &&
  12534. qrCode.isDark(row + 2, col) &&
  12535. qrCode.isDark(row + 3, col) &&
  12536. qrCode.isDark(row + 4, col) &&
  12537. !qrCode.isDark(row + 5, col) &&
  12538. qrCode.isDark(row + 6, col)) {
  12539. lostPoint += 40;
  12540. }
  12541. }
  12542. }
  12543. // LEVEL4
  12544. var darkCount = 0;
  12545. for (var col = 0; col < moduleCount; col++) {
  12546. for (var row = 0; row < moduleCount; row++) {
  12547. if (qrCode.isDark(row, col)) {
  12548. darkCount++;
  12549. }
  12550. }
  12551. }
  12552. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  12553. lostPoint += ratio * 10;
  12554. return lostPoint;
  12555. } };
  12556. //---------------------------------------------------------------------
  12557. // QRMath
  12558. //---------------------------------------------------------------------
  12559. var QRMath = {
  12560. glog: function glog(n) {
  12561. if (n < 1) {
  12562. throw new Error("glog(" + n + ")");
  12563. }
  12564. return QRMath.LOG_TABLE[n];
  12565. },
  12566. gexp: function gexp(n) {
  12567. while (n < 0) {
  12568. n += 255;
  12569. }
  12570. while (n >= 256) {
  12571. n -= 255;
  12572. }
  12573. return QRMath.EXP_TABLE[n];
  12574. },
  12575. EXP_TABLE: new Array(256),
  12576. LOG_TABLE: new Array(256) };
  12577. for (var i = 0; i < 8; i++) {
  12578. QRMath.EXP_TABLE[i] = 1 << i;
  12579. }
  12580. for (var i = 8; i < 256; i++) {
  12581. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^
  12582. QRMath.EXP_TABLE[i - 5] ^
  12583. QRMath.EXP_TABLE[i - 6] ^
  12584. QRMath.EXP_TABLE[i - 8];
  12585. }
  12586. for (var i = 0; i < 255; i++) {
  12587. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  12588. }
  12589. //---------------------------------------------------------------------
  12590. // QRPolynomial
  12591. //---------------------------------------------------------------------
  12592. function QRPolynomial(num, shift) {
  12593. if (num.length == undefined) {
  12594. throw new Error(num.length + "/" + shift);
  12595. }
  12596. var offset = 0;
  12597. while (offset < num.length && num[offset] == 0) {
  12598. offset++;
  12599. }
  12600. this.num = new Array(num.length - offset + shift);
  12601. for (var i = 0; i < num.length - offset; i++) {
  12602. this.num[i] = num[i + offset];
  12603. }
  12604. }
  12605. QRPolynomial.prototype = {
  12606. get: function get(index) {
  12607. return this.num[index];
  12608. },
  12609. getLength: function getLength() {
  12610. return this.num.length;
  12611. },
  12612. multiply: function multiply(e) {
  12613. var num = new Array(this.getLength() + e.getLength() - 1);
  12614. for (var i = 0; i < this.getLength(); i++) {
  12615. for (var j = 0; j < e.getLength(); j++) {
  12616. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  12617. }
  12618. }
  12619. return new QRPolynomial(num, 0);
  12620. },
  12621. mod: function mod(e) {
  12622. if (this.getLength() - e.getLength() < 0) {
  12623. return this;
  12624. }
  12625. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0));
  12626. var num = new Array(this.getLength());
  12627. for (var i = 0; i < this.getLength(); i++) {
  12628. num[i] = this.get(i);
  12629. }
  12630. for (var i = 0; i < e.getLength(); i++) {
  12631. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  12632. }
  12633. // recursive call
  12634. return new QRPolynomial(num, 0).mod(e);
  12635. } };
  12636. //---------------------------------------------------------------------
  12637. // QRRSBlock
  12638. //---------------------------------------------------------------------
  12639. function QRRSBlock(totalCount, dataCount) {
  12640. this.totalCount = totalCount;
  12641. this.dataCount = dataCount;
  12642. }
  12643. QRRSBlock.RS_BLOCK_TABLE = [
  12644. // L
  12645. // M
  12646. // Q
  12647. // H
  12648. // 1
  12649. [1, 26, 19],
  12650. [1, 26, 16],
  12651. [1, 26, 13],
  12652. [1, 26, 9],
  12653. // 2
  12654. [1, 44, 34],
  12655. [1, 44, 28],
  12656. [1, 44, 22],
  12657. [1, 44, 16],
  12658. // 3
  12659. [1, 70, 55],
  12660. [1, 70, 44],
  12661. [2, 35, 17],
  12662. [2, 35, 13],
  12663. // 4
  12664. [1, 100, 80],
  12665. [2, 50, 32],
  12666. [2, 50, 24],
  12667. [4, 25, 9],
  12668. // 5
  12669. [1, 134, 108],
  12670. [2, 67, 43],
  12671. [2, 33, 15, 2, 34, 16],
  12672. [2, 33, 11, 2, 34, 12],
  12673. // 6
  12674. [2, 86, 68],
  12675. [4, 43, 27],
  12676. [4, 43, 19],
  12677. [4, 43, 15],
  12678. // 7
  12679. [2, 98, 78],
  12680. [4, 49, 31],
  12681. [2, 32, 14, 4, 33, 15],
  12682. [4, 39, 13, 1, 40, 14],
  12683. // 8
  12684. [2, 121, 97],
  12685. [2, 60, 38, 2, 61, 39],
  12686. [4, 40, 18, 2, 41, 19],
  12687. [4, 40, 14, 2, 41, 15],
  12688. // 9
  12689. [2, 146, 116],
  12690. [3, 58, 36, 2, 59, 37],
  12691. [4, 36, 16, 4, 37, 17],
  12692. [4, 36, 12, 4, 37, 13],
  12693. // 10
  12694. [2, 86, 68, 2, 87, 69],
  12695. [4, 69, 43, 1, 70, 44],
  12696. [6, 43, 19, 2, 44, 20],
  12697. [6, 43, 15, 2, 44, 16],
  12698. // 11
  12699. [4, 101, 81],
  12700. [1, 80, 50, 4, 81, 51],
  12701. [4, 50, 22, 4, 51, 23],
  12702. [3, 36, 12, 8, 37, 13],
  12703. // 12
  12704. [2, 116, 92, 2, 117, 93],
  12705. [6, 58, 36, 2, 59, 37],
  12706. [4, 46, 20, 6, 47, 21],
  12707. [7, 42, 14, 4, 43, 15],
  12708. // 13
  12709. [4, 133, 107],
  12710. [8, 59, 37, 1, 60, 38],
  12711. [8, 44, 20, 4, 45, 21],
  12712. [12, 33, 11, 4, 34, 12],
  12713. // 14
  12714. [3, 145, 115, 1, 146, 116],
  12715. [4, 64, 40, 5, 65, 41],
  12716. [11, 36, 16, 5, 37, 17],
  12717. [11, 36, 12, 5, 37, 13],
  12718. // 15
  12719. [5, 109, 87, 1, 110, 88],
  12720. [5, 65, 41, 5, 66, 42],
  12721. [5, 54, 24, 7, 55, 25],
  12722. [11, 36, 12],
  12723. // 16
  12724. [5, 122, 98, 1, 123, 99],
  12725. [7, 73, 45, 3, 74, 46],
  12726. [15, 43, 19, 2, 44, 20],
  12727. [3, 45, 15, 13, 46, 16],
  12728. // 17
  12729. [1, 135, 107, 5, 136, 108],
  12730. [10, 74, 46, 1, 75, 47],
  12731. [1, 50, 22, 15, 51, 23],
  12732. [2, 42, 14, 17, 43, 15],
  12733. // 18
  12734. [5, 150, 120, 1, 151, 121],
  12735. [9, 69, 43, 4, 70, 44],
  12736. [17, 50, 22, 1, 51, 23],
  12737. [2, 42, 14, 19, 43, 15],
  12738. // 19
  12739. [3, 141, 113, 4, 142, 114],
  12740. [3, 70, 44, 11, 71, 45],
  12741. [17, 47, 21, 4, 48, 22],
  12742. [9, 39, 13, 16, 40, 14],
  12743. // 20
  12744. [3, 135, 107, 5, 136, 108],
  12745. [3, 67, 41, 13, 68, 42],
  12746. [15, 54, 24, 5, 55, 25],
  12747. [15, 43, 15, 10, 44, 16],
  12748. // 21
  12749. [4, 144, 116, 4, 145, 117],
  12750. [17, 68, 42],
  12751. [17, 50, 22, 6, 51, 23],
  12752. [19, 46, 16, 6, 47, 17],
  12753. // 22
  12754. [2, 139, 111, 7, 140, 112],
  12755. [17, 74, 46],
  12756. [7, 54, 24, 16, 55, 25],
  12757. [34, 37, 13],
  12758. // 23
  12759. [4, 151, 121, 5, 152, 122],
  12760. [4, 75, 47, 14, 76, 48],
  12761. [11, 54, 24, 14, 55, 25],
  12762. [16, 45, 15, 14, 46, 16],
  12763. // 24
  12764. [6, 147, 117, 4, 148, 118],
  12765. [6, 73, 45, 14, 74, 46],
  12766. [11, 54, 24, 16, 55, 25],
  12767. [30, 46, 16, 2, 47, 17],
  12768. // 25
  12769. [8, 132, 106, 4, 133, 107],
  12770. [8, 75, 47, 13, 76, 48],
  12771. [7, 54, 24, 22, 55, 25],
  12772. [22, 45, 15, 13, 46, 16],
  12773. // 26
  12774. [10, 142, 114, 2, 143, 115],
  12775. [19, 74, 46, 4, 75, 47],
  12776. [28, 50, 22, 6, 51, 23],
  12777. [33, 46, 16, 4, 47, 17],
  12778. // 27
  12779. [8, 152, 122, 4, 153, 123],
  12780. [22, 73, 45, 3, 74, 46],
  12781. [8, 53, 23, 26, 54, 24],
  12782. [12, 45, 15, 28, 46, 16],
  12783. // 28
  12784. [3, 147, 117, 10, 148, 118],
  12785. [3, 73, 45, 23, 74, 46],
  12786. [4, 54, 24, 31, 55, 25],
  12787. [11, 45, 15, 31, 46, 16],
  12788. // 29
  12789. [7, 146, 116, 7, 147, 117],
  12790. [21, 73, 45, 7, 74, 46],
  12791. [1, 53, 23, 37, 54, 24],
  12792. [19, 45, 15, 26, 46, 16],
  12793. // 30
  12794. [5, 145, 115, 10, 146, 116],
  12795. [19, 75, 47, 10, 76, 48],
  12796. [15, 54, 24, 25, 55, 25],
  12797. [23, 45, 15, 25, 46, 16],
  12798. // 31
  12799. [13, 145, 115, 3, 146, 116],
  12800. [2, 74, 46, 29, 75, 47],
  12801. [42, 54, 24, 1, 55, 25],
  12802. [23, 45, 15, 28, 46, 16],
  12803. // 32
  12804. [17, 145, 115],
  12805. [10, 74, 46, 23, 75, 47],
  12806. [10, 54, 24, 35, 55, 25],
  12807. [19, 45, 15, 35, 46, 16],
  12808. // 33
  12809. [17, 145, 115, 1, 146, 116],
  12810. [14, 74, 46, 21, 75, 47],
  12811. [29, 54, 24, 19, 55, 25],
  12812. [11, 45, 15, 46, 46, 16],
  12813. // 34
  12814. [13, 145, 115, 6, 146, 116],
  12815. [14, 74, 46, 23, 75, 47],
  12816. [44, 54, 24, 7, 55, 25],
  12817. [59, 46, 16, 1, 47, 17],
  12818. // 35
  12819. [12, 151, 121, 7, 152, 122],
  12820. [12, 75, 47, 26, 76, 48],
  12821. [39, 54, 24, 14, 55, 25],
  12822. [22, 45, 15, 41, 46, 16],
  12823. // 36
  12824. [6, 151, 121, 14, 152, 122],
  12825. [6, 75, 47, 34, 76, 48],
  12826. [46, 54, 24, 10, 55, 25],
  12827. [2, 45, 15, 64, 46, 16],
  12828. // 37
  12829. [17, 152, 122, 4, 153, 123],
  12830. [29, 74, 46, 14, 75, 47],
  12831. [49, 54, 24, 10, 55, 25],
  12832. [24, 45, 15, 46, 46, 16],
  12833. // 38
  12834. [4, 152, 122, 18, 153, 123],
  12835. [13, 74, 46, 32, 75, 47],
  12836. [48, 54, 24, 14, 55, 25],
  12837. [42, 45, 15, 32, 46, 16],
  12838. // 39
  12839. [20, 147, 117, 4, 148, 118],
  12840. [40, 75, 47, 7, 76, 48],
  12841. [43, 54, 24, 22, 55, 25],
  12842. [10, 45, 15, 67, 46, 16],
  12843. // 40
  12844. [19, 148, 118, 6, 149, 119],
  12845. [18, 75, 47, 31, 76, 48],
  12846. [34, 54, 24, 34, 55, 25],
  12847. [20, 45, 15, 61, 46, 16]];
  12848. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  12849. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  12850. if (rsBlock == undefined) {
  12851. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  12852. }
  12853. var length = rsBlock.length / 3;
  12854. var list = new Array();
  12855. for (var i = 0; i < length; i++) {
  12856. var count = rsBlock[i * 3 + 0];
  12857. var totalCount = rsBlock[i * 3 + 1];
  12858. var dataCount = rsBlock[i * 3 + 2];
  12859. for (var j = 0; j < count; j++) {
  12860. list.push(new QRRSBlock(totalCount, dataCount));
  12861. }
  12862. }
  12863. return list;
  12864. };
  12865. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  12866. switch (errorCorrectLevel) {
  12867. case QRErrorCorrectLevel.L:
  12868. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
  12869. case QRErrorCorrectLevel.M:
  12870. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  12871. case QRErrorCorrectLevel.Q:
  12872. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  12873. case QRErrorCorrectLevel.H:
  12874. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  12875. default:
  12876. return undefined;}
  12877. };
  12878. //---------------------------------------------------------------------
  12879. // QRBitBuffer
  12880. //---------------------------------------------------------------------
  12881. function QRBitBuffer() {
  12882. this.buffer = new Array();
  12883. this.length = 0;
  12884. }
  12885. QRBitBuffer.prototype = {
  12886. get: function get(index) {
  12887. var bufIndex = Math.floor(index / 8);
  12888. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  12889. },
  12890. put: function put(num, length) {
  12891. for (var i = 0; i < length; i++) {
  12892. this.putBit((num >>> length - i - 1 & 1) == 1);
  12893. }
  12894. },
  12895. getLengthInBits: function getLengthInBits() {
  12896. return this.length;
  12897. },
  12898. putBit: function putBit(bit) {
  12899. var bufIndex = Math.floor(this.length / 8);
  12900. if (this.buffer.length <= bufIndex) {
  12901. this.buffer.push(0);
  12902. }
  12903. if (bit) {
  12904. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  12905. }
  12906. this.length++;
  12907. } };
  12908. //---------------------------------------------------------------------
  12909. // Support Chinese
  12910. //---------------------------------------------------------------------
  12911. function utf16To8(text) {
  12912. var result = '';
  12913. var c;
  12914. for (var i = 0; i < text.length; i++) {
  12915. c = text.charCodeAt(i);
  12916. if (c >= 0x0001 && c <= 0x007F) {
  12917. result += text.charAt(i);
  12918. } else if (c > 0x07FF) {
  12919. result += String.fromCharCode(0xE0 | c >> 12 & 0x0F);
  12920. result += String.fromCharCode(0x80 | c >> 6 & 0x3F);
  12921. result += String.fromCharCode(0x80 | c >> 0 & 0x3F);
  12922. } else {
  12923. result += String.fromCharCode(0xC0 | c >> 6 & 0x1F);
  12924. result += String.fromCharCode(0x80 | c >> 0 & 0x3F);
  12925. }
  12926. }
  12927. return result;
  12928. }
  12929. uQRCode = {
  12930. defaults: {
  12931. size: 258,
  12932. margin: 0,
  12933. backgroundColor: '#ffffff',
  12934. foregroundColor: '#000000',
  12935. fileType: 'png', // 'jpg', 'png'
  12936. correctLevel: 3,
  12937. typeNumber: -1 },
  12938. make: function make(options) {
  12939. var defaultOptions = {
  12940. canvasId: options.canvasId,
  12941. componentInstance: options.componentInstance,
  12942. text: options.text,
  12943. size: this.defaults.size,
  12944. margin: this.defaults.margin,
  12945. backgroundColor: this.defaults.backgroundColor,
  12946. foregroundColor: this.defaults.foregroundColor,
  12947. fileType: this.defaults.fileType,
  12948. correctLevel: this.defaults.correctLevel,
  12949. typeNumber: this.defaults.typeNumber };
  12950. if (options) {
  12951. for (var i in options) {
  12952. defaultOptions[i] = options[i];
  12953. }
  12954. }
  12955. options = defaultOptions;
  12956. if (!options.canvasId) {
  12957. console.error('uQRCode: Please set canvasId!');
  12958. return;
  12959. }
  12960. function createCanvas() {
  12961. var qrcode = new QRCode(options.typeNumber, options.correctLevel);
  12962. qrcode.addData(utf16To8(options.text));
  12963. qrcode.make();
  12964. var ctx = uni.createCanvasContext(options.canvasId, options.componentInstance);
  12965. ctx.setFillStyle(options.backgroundColor);
  12966. ctx.fillRect(0, 0, options.size, options.size);
  12967. var tileW = (options.size - options.margin * 2) / qrcode.getModuleCount();
  12968. var tileH = tileW;
  12969. for (var row = 0; row < qrcode.getModuleCount(); row++) {
  12970. for (var col = 0; col < qrcode.getModuleCount(); col++) {
  12971. var style = qrcode.isDark(row, col) ? options.foregroundColor : options.backgroundColor;
  12972. ctx.setFillStyle(style);
  12973. var x = Math.round(col * tileW) + options.margin;
  12974. var y = Math.round(row * tileH) + options.margin;
  12975. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  12976. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  12977. ctx.fillRect(x, y, w, h);
  12978. }
  12979. }
  12980. setTimeout(function () {
  12981. ctx.draw(false, function () {
  12982. setTimeout(function () {
  12983. uni.canvasToTempFilePath({
  12984. canvasId: options.canvasId,
  12985. fileType: options.fileType,
  12986. width: options.size,
  12987. height: options.size,
  12988. destWidth: options.size,
  12989. destHeight: options.size,
  12990. success: function success(res) {
  12991. options.success && options.success(res.tempFilePath);
  12992. },
  12993. fail: function fail(error) {
  12994. options.fail && options.fail(error);
  12995. },
  12996. complete: function complete(res) {
  12997. options.complete && options.complete(res);
  12998. } },
  12999. options.componentInstance);
  13000. }, options.text.length + 100);
  13001. });
  13002. }, 150);
  13003. }
  13004. createCanvas();
  13005. } };
  13006. })();var _default =
  13007. uQRCode;exports.default = _default;
  13008. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13009. /***/ })
  13010. }]);
  13011. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map