@52css/mp-vue3
Advanced tools
@@ -15,2 +15,2 @@ "use strict"; | ||
| /* istanbul ignore next -- @preserve */function yt(e){return Object.prototype.toString.call(e).slice(8,-1)}function wt(e){return"function"==typeof e}var bt,mt=!1;!function(e){e[e.QUEUED=1]="QUEUED",e[e.ALLOW_RECURSE=4]="ALLOW_RECURSE"}(bt||(bt={}));let St=!1,Rt=!1;const Et=[];let $t=0;const Ot=[];let Pt=null,Dt=0;const kt=Promise.resolve();function jt(e){e.flags&bt.QUEUED||(Et.push(e),e.flags|=bt.QUEUED,St||Rt||(Rt=!0,kt.then(Ut)))}function Tt(){if(Ot.length>0){for(Pt=[...new Set(Ot)],Ot.length=0,Dt=0;Dt<Pt.length;Dt++){const e=Pt[Dt];e.flags&bt.ALLOW_RECURSE&&(e.flags&=~bt.QUEUED),e(),e.flags&=~bt.QUEUED}Pt=null,Dt=0}}function Ut(e){Rt=!1,St=!0;const t=/* istanbul ignore next -- @preserve */gt;try{for($t=0;$t<Et.length;$t++){const e=Et[$t]; | ||
| /* istanbul ignore if -- @preserve */mt&&t(e),e.flags&bt.ALLOW_RECURSE&&(e.flags&=~bt.QUEUED),e(),e.flags&bt.ALLOW_RECURSE||(e.flags&=~bt.QUEUED)}}finally{for(;$t<Et.length;$t++){Et[$t].flags&=~bt.QUEUED}$t=0,Et.length=0,St=!1}}function Lt(e,t,s=vt){const{immediate:n,deep:r,flush:o,once:i}=s,c=xt({},s);"post"===o?c.scheduler=e=>{!function(e){e.flags&bt.QUEUED||(Ot.push(e),e.flags|=bt.QUEUED)}(e)}:"sync"!==o&&(c.scheduler=(e,t)=>{t?e():jt(e)}),c.augmentJob=e=>{t&&(e.flags|=bt.ALLOW_RECURSE)};return ft(e,t,c)}function At(e){if(function(e){const t=new Set(["undefined","boolean","number","string"]);return null===e||t.has(typeof e)}(e)||wt(e))return e;if(Ye(e))return At(e.value);if(Je(e))return At(Ke(e));if(_t(e))return e.map((e=>At(e)));if(function(e){return"Object"===yt(e)}(e)){const t={};return Object.keys(e).forEach((s=>{t[s]=At(e[s])})),t}throw new TypeError(`${yt(e)} value is not supported`)}function It(e,t,s){var n;null!==(n=s)&&"object"==typeof n&&ft(Ye(s)?s:()=>s,(()=>{e.setData({[t]:At(s)},Tt)}),{deep:!0})}exports._instance=null;const qt=e=>{exports._instance=e},Ct=(e,t,s,...n)=>{if(t&&t[s]&&t[s].apply(e,n),!e[`$${s}`])return;const r={onLoad:"onUnload",onShow:"onHide",attached:"detached",show:"hide"}[s];e[`$${s}`].forEach((t=>{if(r){const s=e[`$${r}`]&&e[`$${r}`].find((e=>e.front===t));s&&s()}const s=t.apply(e,n);if(r&&"function"==typeof s){e[`$${r}`]&&e[`$${r}`].find((e=>e.front===t))||(s.front,e[`$${r}`]||(e[`$${r}`]=[]),e[`$${r}`].push(s))}}))},zt=(e,t,s,...n)=>{if(t&&t[s])return t[s].apply(e,n);if(e[`$${s}`]){if(e[`$${s}`].length)throw new Error(`一个page只能配置一个${s}`);return e[`$${s}`][0].apply(e,n)}},Nt=(e,t,s)=>{e&&(e[`$${t}`]||(e[`$${t}`]=[]),e[`$${t}`].push(s.bind(e)))};exports.launchPromise=Promise.resolve(!0);const Wt=e=>e?Object.keys(e).map((t=>{let s=e[t];return"object"==typeof e[t]&&(s=encodeURIComponent(JSON.stringify(e[t]))),`${t}=${s}`})).join("&"):"";exports._queries={};const Mt=e=>{exports._queries=e},Qt=(e,t)=>{if(!t)return e;let s={};for(let n in e)if(n in t){const r=e[n],o=t[n];if(!o){s[n]=r;break}const i=o.type||o,c=e=>"formatter"in o&&void 0!==o.formatter?o.formatter(e):i===Boolean?!!e:i===Number?Number(e):i===Object?e?JSON.parse(decodeURIComponent(e)):{}:i===Array?e?JSON.parse(decodeURIComponent(e)):[]:(null===i||i===String||console.error("未知的·type·",i),e);s[n]=c(r)}else s[n]=e[n];return s};function Vt(e){exports.activePinia=e}exports.activePinia=void 0;const Bt=new class{constructor(){this.defaultOptions={header:{"Content-Type":"application/json"}},this.baseUrl="/api"}setBaseUrl(e){this.baseUrl=e}setRequestInterceptor(e){this.requestInterceptor=e}setResponseInterceptor(e){this.responseInterceptor=e}async request(e){const t=/^http/.test(e.url)?e.url:this.baseUrl.endsWith("/")||e.url.startsWith("/")?`${this.baseUrl}${e.url}`:`${this.baseUrl}/${e.url}`;let s={...this.defaultOptions,...e,url:t};return this.requestInterceptor&&(s=await this.requestInterceptor(s)),new Promise(((e,t)=>{const{success:n,fail:r,complete:o,...i}=s;wx.request({...i,success:async s=>{try{if(this.responseInterceptor&&(s=await this.responseInterceptor(s)),s.statusCode>=200&&s.statusCode<300)"function"==typeof n&&n(s),e(s);else{const e=new Error(`请求失败,状态码:${s.statusCode}`);"function"==typeof r&&r(e),t(e)}}catch(e){"function"==typeof r&&r(e),t(e)}},fail:e=>{"function"==typeof r&&r(e),t(e)},complete:e=>{"function"==typeof o&&o(e)}})}))}serializeParams(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}get(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"GET",url:n})}post(e,t,s){return this.request({...s,method:"POST",url:e,data:t})}options(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"OPTIONS",url:n})}head(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"HEAD",url:n})}put(e,t,s){return this.request({...s,method:"PUT",url:e,data:t})}delete(e,t,s){return this.request({...s,method:"DELETE",url:e,data:t})}trace(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"TRACE",url:n})}connect(e,t,s){return this.request({...s,method:"CONNECT",url:e,data:t})}};exports.ReactiveEffect=E,exports.attached=e=>Nt(exports._instance,"attached",e),exports.computed=function(e,t,s=!1){let n,r;return l(e)?n=e:(n=e.get,r=e.set),new ut(n,r,s)},exports.createApp=e=>{if(!e)return App({});let t={};if("function"!=typeof e){const{setup:s,...n}=e;t=n,e=s}return e?App({...t,onLaunch(s){exports.launchPromise=new Promise((async n=>{qt(this);const r=await e.call(this,s);void 0!==r&&Object.keys(r).forEach((e=>{this[e]=r[e]})),Ct(this,t,"onLaunch",s),qt(null),n(!0)}))},onShow(e){Ct(this,t,"onShow",e)},onHide(){Ct(this,t,"onHide")},onError(e){Ct(this,t,"onError",e)},onPageNotFound(e){Ct(this,t,"onPageNotFound",e)},onUnhandledRejection(e){Ct(this,t,"onUnhandledRejection",e)},onThemeChange(e){Ct(this,t,"onThemeChange",e)}}):App(t)},exports.createPinia=function(){const e=m(!0),t=e.run((()=>Ze({}))),s={install(){Vt(s)},scope:e,state:t,stores:{}};return s},exports.createQuery=Qt,exports.customRef=function(e){return new rt(e)},exports.deepToRaw=At,exports.deepWatch=It,exports.defineComponent=e=>{if(!e)return Component({});let t={};if("function"!=typeof e){const{setup:s,...n}=e;t=n,e=s}if(!e)return Component(t);let s=null;return t.properties&&(s=Object.keys(t.properties)),s&&s.forEach((e=>{void 0===t.observers&&(t.observers={});const s=t.observers[e];t.observers[e]=function(t){this.$props&&(this.$props[e]=t),void 0!==s&&s.call(this,t)}})),Component({...t,lifetimes:{attached(){exports.launchPromise.then((()=>{qt(this),this.$scope=m();const n={};s&&s.forEach((e=>{n[e]=this.data[e]})),this.$props=Me(n),this.$context={emit:(e,...t)=>{this.triggerEvent(e,{value:t[0]})}},this.$scope.run((()=>{const s=e.call(this,this.$props,this.$context);void 0!==s&&Object.keys(s).forEach((e=>{const t=s[e];wt(t)?this[e]=t:(this.setData({[e]:At(t)}),It(this,e,t))})),Ct(this,t,"attached")})),qt(null)}))},ready(){Ct(this,t,"ready")},moved(){Ct(this,t,"moved")},detached(){Ct(this,t,"detached"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},error(e){Ct(this,t,"error",e)}},pageLifetimes:{show(){Ct(this,t,"show")},hide(){Ct(this,t,"hide")},resize(e){Ct(this,t,"resize",e)},routeDone(){Ct(this,t,"routeDone")}}})},exports.definePage=e=>{if(!e)return Page({});let t={};if("function"!=typeof e){const{setup:s,...n}=e;t=n||{},e=s}if(!e)return Page(t);const{queries:s,...n}=t;return Page({...n,onLoad(n){exports.launchPromise.then((()=>{qt(this),Mt(s),this.$scope=m(),this.$query=Qt(n,s),this.$context={},this.$scope.run((()=>{const s=e.call(this,this.$query,this.$context);void 0!==s&&Object.keys(s).forEach((e=>{const t=s[e];wt(t)?this[e]=t:(this.setData({[e]:At(t)}),It(this,e,t))})),Ct(this,t,"onLoad",n)})),Mt({}),qt(null)}))},onShow(){Ct(this,t,"onShow")},onReady(){Ct(this,t,"onReady")},onHide(){Ct(this,t,"onHide")},onUnload(){Ct(this,t,"onUnload"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},onRouteDone(){Ct(this,t,"onRouteDone")},onPullDownRefresh(){Ct(this,t,"onPullDownRefresh")},onReachBottom(){Ct(this,t,"onReachBottom")},onPageScroll(e){Ct(this,t,"onPageScroll",e)},onAddToFavorites(e){return zt(this,t,"onAddToFavorites",e)},onShareAppMessage(e){return zt(this,t,"onShareAppMessage",e)},onShareTimeline(){return zt(this,t,"onShareTimeline")},onResize(e){Ct(this,t,"onResize",e)},onTabItemTap(e){Ct(this,t,"onTabItemTap",e)},onSaveExitState(){Ct(this,t,"onSaveExitState")}})},exports.defineStore=function(e,t,s){return function(n){if(n&&Vt(n),!(n=exports.activePinia))throw new Error("no active pinia");return n.stores[e]||function(e,t,s,n){const r={},o=e.scope.run(s);Object.assign(r,o),e.stores[t]=r;const i="PINIA_"+t;n&&n.persist&&n.persist.forEach((s=>{const n=`${i}_${s}`,r=wx.getStorageSync(n),o=wx.getStorageInfoSync().keys.includes(n);e.stores[t][s]&&o&&(Ye(e.stores[t][s])?e.stores[t][s].value=r:Object.keys(r).forEach((n=>{e.stores[t][s][n]=r[n]}))),ft(Ye(e.stores[t][s])?e.stores[t][s]:()=>e.stores[t][s],(e=>{wx.setStorageSync(n,e)}),{deep:!0})}))}(n,e,t,s),n.stores[e]}},exports.detached=e=>Nt(exports._instance,"detached",e),exports.effect=function(e,t){e.effect instanceof E&&(e=e.effect.fn);const s=new E(e);t&&n(s,t);try{s.run()}catch(e){throw s.stop(),e}const r=s.run.bind(s);return r.effect=s,r},exports.effectScope=m,exports.error=e=>Nt(exports._instance,"error",e),exports.getCurrentPage=()=>{const e=getCurrentPages();return e&&e[e.length-1]},exports.getCurrentScope=S,exports.hide=e=>Nt(exports._instance,"hide",e),exports.isProxy=Je,exports.isReactive=Be,exports.isReadonly=Fe,exports.isRef=Ye,exports.isShallow=He,exports.lifetimeEmit=Ct,exports.lifetimeEmitOnce=zt,exports.lifetimeOn=Nt,exports.markRaw=function(e){return Object.isExtensible(e)&&((e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})})(e,"__v_skip",!0),e},exports.moved=e=>Nt(exports._instance,"moved",e),exports.onAddToFavorites=e=>Nt(exports._instance,"onAddToFavorites",e),exports.onError=e=>Nt(exports._instance,"onError",e),exports.onHide=e=>Nt(exports._instance,"onHide",e),exports.onLaunch=e=>Nt(exports._instance,"onLaunch",e),exports.onLoad=e=>Nt(exports._instance,"onLoad",e),exports.onPageNotFound=e=>Nt(exports._instance,"onPageNotFound",e),exports.onPageScroll=e=>Nt(exports._instance,"onPageScroll",e),exports.onPullDownRefresh=e=>Nt(exports._instance,"onPullDownRefresh",e),exports.onReachBottom=e=>Nt(exports._instance,"onReachBottom",e),exports.onReady=e=>Nt(exports._instance,"onReady",e),exports.onResize=e=>Nt(exports._instance,"onResize",e),exports.onRouteDone=e=>Nt(exports._instance,"onRouteDone",e),exports.onSaveExitState=e=>Nt(exports._instance,"onSaveExitState",e),exports.onScopeDispose=function(e,t=!1){y&&y.cleanups.push(e)},exports.onShareAppMessage=e=>Nt(exports._instance,"onShareAppMessage",e),exports.onShareTimeline=e=>Nt(exports._instance,"onShareTimeline",e),exports.onShow=e=>Nt(exports._instance,"onShow",e),exports.onTabItemTap=e=>Nt(exports._instance,"onTabItemTap",e),exports.onThemeChange=e=>Nt(exports._instance,"onThemeChange",e),exports.onUnhandledRejection=e=>Nt(exports._instance,"onUnhandledRejection",e),exports.onUnload=e=>Nt(exports._instance,"onUnload",e),exports.proxyRefs=function(e){return Be(e)?e:new Proxy(e,nt)},exports.reactive=We,exports.readonly=Qe,exports.ready=e=>Nt(exports._instance,"ready",e),exports.ref=Ze,exports.request=Bt,exports.resize=e=>Nt(exports._instance,"resize",e),exports.routeDone=e=>Nt(exports._instance,"routeDone",e),exports.setActivatePinia=Vt,exports.setInstance=qt,exports.setQueries=Mt,exports.shallowReactive=Me,exports.shallowReadonly=function(e){return Ve(e,!0,de,Ie,Ne)},exports.shallowRef=function(e){return et(e,!0)},exports.show=e=>Nt(exports._instance,"show",e),exports.stop=function(e){e.effect.stop()},exports.storeToRefs=function(e){e=Ke(e);const t={};for(const s in e){const n=e[s];(Ye(n)||Be(n))&&(t[s]=ct(e,s))}return t},exports.toRaw=Ke,exports.toRef=ct,exports.toRefs=function(e){const t=c(e)?new Array(e.length):{};for(const s in e)t[s]=at(e,s);return t},exports.toValue=function(e){return l(e)?e():st(e)},exports.triggerRef=function(e){e.dep.trigger()},exports.unref=st,exports.useInstance=()=>exports._instance,exports.useRoute=()=>{const e=getCurrentPages(),t=e[e.length-1];return{path:t.route,query:Qt(t.options,exports._queries)}},exports.useRouter=()=>({push:e=>{if("string"==typeof e)return wx.navigateTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.navigateTo({url:t,...e})},replace:e=>{if("string"==typeof e)return wx.redirectTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.redirectTo({url:t,...e})},go:e=>{if(!(e>0))return wx.navigateBack({delta:Math.abs(e)});console.warn("微信小程序不支持前进历史记录")},back:e=>wx.navigateBack(e),switchTab:e=>{if("string"==typeof e)return wx.switchTab({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.switchTab({url:t,...e})},reLaunch:e=>{if("string"==typeof e)return wx.reLaunch({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.reLaunch({url:t,...e})}}),exports.watch=function(e,t,s){return Lt(e,t,s)},exports.watchEffect=function(e,t){return Lt(e,null,t)},exports.watchPostEffect=function(e,t){return Lt(e,null,/* istanbul ignore next -- @preserve */{flush:"post"})},exports.watchSyncEffect=function(e,t){return Lt(e,null,/* istanbul ignore next -- @preserve */{flush:"sync"})}; | ||
| /* istanbul ignore if -- @preserve */mt&&t(e),e.flags&bt.ALLOW_RECURSE&&(e.flags&=~bt.QUEUED),e(),e.flags&bt.ALLOW_RECURSE||(e.flags&=~bt.QUEUED)}}finally{for(;$t<Et.length;$t++){Et[$t].flags&=~bt.QUEUED}$t=0,Et.length=0,St=!1}}function Lt(e,t,s=vt){const{immediate:n,deep:r,flush:o,once:i}=s,c=xt({},s);"post"===o?c.scheduler=e=>{!function(e){e.flags&bt.QUEUED||(Ot.push(e),e.flags|=bt.QUEUED)}(e)}:"sync"!==o&&(c.scheduler=(e,t)=>{t?e():jt(e)}),c.augmentJob=e=>{t&&(e.flags|=bt.ALLOW_RECURSE)};return ft(e,t,c)}function At(e){if(function(e){const t=new Set(["undefined","boolean","number","string"]);return null===e||t.has(typeof e)}(e)||wt(e))return e;if(Ye(e))return At(e.value);if(Je(e))return At(Ke(e));if(_t(e))return e.map((e=>At(e)));if(function(e){return"Object"===yt(e)}(e)){const t={};return Object.keys(e).forEach((s=>{t[s]=At(e[s])})),t}throw new TypeError(`${yt(e)} value is not supported`)}function It(e,t){var s;null!==(s=t)&&"object"==typeof s&&ft(Ye(t)?t:()=>t,(()=>{this.setData({[e]:At(t)},Tt)}),{deep:!0})}exports._instance=null;const qt=e=>{exports._instance=e},Ct=(e,t,s,...n)=>{if(t&&t[s]&&t[s].apply(e,n),!e[`$${s}`])return;const r={onLoad:"onUnload",onShow:"onHide",attached:"detached",show:"hide"}[s];e[`$${s}`].forEach((t=>{if(r){const s=e[`$${r}`]&&e[`$${r}`].find((e=>e.front===t));s&&s()}const s=t.apply(e,n);if(r&&"function"==typeof s){e[`$${r}`]&&e[`$${r}`].find((e=>e.front===t))||(s.front,e[`$${r}`]||(e[`$${r}`]=[]),e[`$${r}`].push(s))}}))},zt=(e,t,s,...n)=>{if(t&&t[s])return t[s].apply(e,n);if(e[`$${s}`]){if(e[`$${s}`].length)throw new Error(`一个page只能配置一个${s}`);return e[`$${s}`][0].apply(e,n)}},Nt=(e,t,s)=>{e&&(e[`$${t}`]||(e[`$${t}`]=[]),e[`$${t}`].push(s.bind(e)))};exports.launchPromise=Promise.resolve(!0);const Wt=e=>e?Object.keys(e).map((t=>{let s=e[t];return"object"==typeof e[t]&&(s=encodeURIComponent(JSON.stringify(e[t]))),`${t}=${s}`})).join("&"):"";exports._queries={};const Mt=e=>{exports._queries=e},Qt=(e,t)=>{if(!t)return e;let s={};for(let n in e)if(n in t){const r=e[n],o=t[n];if(!o){s[n]=r;break}const i=o.type||o,c=e=>"formatter"in o&&void 0!==o.formatter?o.formatter(e):i===Boolean?!!e:i===Number?Number(e):i===Object?e?JSON.parse(decodeURIComponent(e)):{}:i===Array?e?JSON.parse(decodeURIComponent(e)):[]:(null===i||i===String||console.error("未知的·type·",i),e);s[n]=c(r)}else s[n]=e[n];return s};function Vt(e){exports.activePinia=e}exports.activePinia=void 0;const Bt=new class{constructor(){this.defaultOptions={header:{"Content-Type":"application/json"}},this.baseUrl="/api"}setBaseUrl(e){this.baseUrl=e}setRequestInterceptor(e){this.requestInterceptor=e}setResponseInterceptor(e){this.responseInterceptor=e}async request(e){const t=/^http/.test(e.url)?e.url:this.baseUrl.endsWith("/")||e.url.startsWith("/")?`${this.baseUrl}${e.url}`:`${this.baseUrl}/${e.url}`;let s={...this.defaultOptions,...e,url:t};return this.requestInterceptor&&(s=await this.requestInterceptor(s)),new Promise(((e,t)=>{const{success:n,fail:r,complete:o,...i}=s;wx.request({...i,success:async s=>{try{if(this.responseInterceptor&&(s=await this.responseInterceptor(s)),s.statusCode>=200&&s.statusCode<300)"function"==typeof n&&n(s),e(s);else{const e=new Error(`请求失败,状态码:${s.statusCode}`);"function"==typeof r&&r(e),t(e)}}catch(e){"function"==typeof r&&r(e),t(e)}},fail:e=>{"function"==typeof r&&r(e),t(e)},complete:e=>{"function"==typeof o&&o(e)}})}))}serializeParams(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}get(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"GET",url:n})}post(e,t,s){return this.request({...s,method:"POST",url:e,data:t})}options(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"OPTIONS",url:n})}head(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"HEAD",url:n})}put(e,t,s){return this.request({...s,method:"PUT",url:e,data:t})}delete(e,t,s){return this.request({...s,method:"DELETE",url:e,data:t})}trace(e,t,s){let n=e;if(t&&Object.keys(t).length>0){const s=this.serializeParams(t);n+=e.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"TRACE",url:n})}connect(e,t,s){return this.request({...s,method:"CONNECT",url:e,data:t})}};exports.ReactiveEffect=E,exports.attached=e=>Nt(exports._instance,"attached",e),exports.computed=function(e,t,s=!1){let n,r;return l(e)?n=e:(n=e.get,r=e.set),new ut(n,r,s)},exports.createApp=e=>{if(!e)return App({});let t={};if("function"!=typeof e){const{setup:s,...n}=e;t=n,e=s}return e?App({...t,onLaunch(s){exports.launchPromise=new Promise((async n=>{qt(this);const r=await e.call(this,s);void 0!==r&&Object.keys(r).forEach((e=>{this[e]=r[e]})),Ct(this,t,"onLaunch",s),qt(null),n(!0)}))},onShow(e){Ct(this,t,"onShow",e)},onHide(){Ct(this,t,"onHide")},onError(e){Ct(this,t,"onError",e)},onPageNotFound(e){Ct(this,t,"onPageNotFound",e)},onUnhandledRejection(e){Ct(this,t,"onUnhandledRejection",e)},onThemeChange(e){Ct(this,t,"onThemeChange",e)}}):App(t)},exports.createPinia=function(){const e=m(!0),t=e.run((()=>Ze({}))),s={install(){Vt(s)},scope:e,state:t,stores:{}};return s},exports.createQuery=Qt,exports.customRef=function(e){return new rt(e)},exports.deepToRaw=At,exports.deepWatch=It,exports.defineComponent=e=>{if(!e)return Component({});let t={};if("function"!=typeof e){const{setup:s,...n}=e;t=n,e=s}if(!e)return Component(t);let s=null;return t.properties&&(s=Object.keys(t.properties)),s&&s.forEach((e=>{void 0===t.observers&&(t.observers={});const s=t.observers[e];t.observers[e]=function(t){this.$props&&(this.$props[e]=t),void 0!==s&&s.call(this,t)}})),Component({...t,lifetimes:{attached(){exports.launchPromise.then((()=>{qt(this),this.$scope=m();const n={};s&&s.forEach((e=>{n[e]=this.data[e]})),this.$props=Me(n),this.$context={emit:(e,...t)=>{this.triggerEvent(e,{value:t[0]})}},this.$scope.run((()=>{const s=e.call(this,this.$props,this.$context);if(void 0!==s){let e;Object.keys(s).forEach((t=>{const n=s[t];wt(n)?this[t]=n:(e=e||{},e[t]=At(n),It.call(this,t,n))})),void 0!==e&&this.setData(e,Tt)}Ct(this,t,"attached")})),qt(null)}))},ready(){Ct(this,t,"ready")},moved(){Ct(this,t,"moved")},detached(){Ct(this,t,"detached"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},error(e){Ct(this,t,"error",e)}},pageLifetimes:{show(){Ct(this,t,"show")},hide(){Ct(this,t,"hide")},resize(e){Ct(this,t,"resize",e)},routeDone(){Ct(this,t,"routeDone")}}})},exports.definePage=e=>{if(!e)return Page({});let t={};if("function"!=typeof e){const{setup:s,...n}=e;t=n||{},e=s}if(!e)return Page(t);const{queries:s,...n}=t;return Page({...n,onLoad(n){exports.launchPromise.then((()=>{qt(this),Mt(s),this.$scope=m(),this.$query=Qt(n,s),this.$context={},this.$scope.run((()=>{const s=e.call(this,this.$query,this.$context);if(void 0!==s){let e;Object.keys(s).forEach((t=>{const n=s[t];wt(n)?this[t]=n:(e=e||{},e[t]=At(n),It.call(this,t,n))})),void 0!==e&&this.setData(e,Tt)}Ct(this,t,"onLoad",n)})),Mt({}),qt(null)}))},onShow(){Ct(this,t,"onShow")},onReady(){Ct(this,t,"onReady")},onHide(){Ct(this,t,"onHide")},onUnload(){Ct(this,t,"onUnload"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},onRouteDone(){Ct(this,t,"onRouteDone")},onPullDownRefresh(){Ct(this,t,"onPullDownRefresh")},onReachBottom(){Ct(this,t,"onReachBottom")},onPageScroll(e){Ct(this,t,"onPageScroll",e)},onAddToFavorites(e){return zt(this,t,"onAddToFavorites",e)},onShareAppMessage(e){return zt(this,t,"onShareAppMessage",e)},onShareTimeline(){return zt(this,t,"onShareTimeline")},onResize(e){Ct(this,t,"onResize",e)},onTabItemTap(e){Ct(this,t,"onTabItemTap",e)},onSaveExitState(){Ct(this,t,"onSaveExitState")}})},exports.defineStore=function(e,t,s){return function(n){if(n&&Vt(n),!(n=exports.activePinia))throw new Error("no active pinia");return n.stores[e]||function(e,t,s,n){const r={},o=e.scope.run(s);Object.assign(r,o),e.stores[t]=r;const i="PINIA_"+t;n&&n.persist&&n.persist.forEach((s=>{const n=`${i}_${s}`,r=wx.getStorageSync(n),o=wx.getStorageInfoSync().keys.includes(n);e.stores[t][s]&&o&&(Ye(e.stores[t][s])?e.stores[t][s].value=r:Object.keys(r).forEach((n=>{e.stores[t][s][n]=r[n]}))),ft(Ye(e.stores[t][s])?e.stores[t][s]:()=>e.stores[t][s],(e=>{wx.setStorageSync(n,e)}),{deep:!0})}))}(n,e,t,s),n.stores[e]}},exports.detached=e=>Nt(exports._instance,"detached",e),exports.effect=function(e,t){e.effect instanceof E&&(e=e.effect.fn);const s=new E(e);t&&n(s,t);try{s.run()}catch(e){throw s.stop(),e}const r=s.run.bind(s);return r.effect=s,r},exports.effectScope=m,exports.error=e=>Nt(exports._instance,"error",e),exports.getCurrentPage=()=>{const e=getCurrentPages();return e&&e[e.length-1]},exports.getCurrentScope=S,exports.hide=e=>Nt(exports._instance,"hide",e),exports.isProxy=Je,exports.isReactive=Be,exports.isReadonly=Fe,exports.isRef=Ye,exports.isShallow=He,exports.lifetimeEmit=Ct,exports.lifetimeEmitOnce=zt,exports.lifetimeOn=Nt,exports.markRaw=function(e){return Object.isExtensible(e)&&((e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})})(e,"__v_skip",!0),e},exports.moved=e=>Nt(exports._instance,"moved",e),exports.onAddToFavorites=e=>Nt(exports._instance,"onAddToFavorites",e),exports.onError=e=>Nt(exports._instance,"onError",e),exports.onHide=e=>Nt(exports._instance,"onHide",e),exports.onLaunch=e=>Nt(exports._instance,"onLaunch",e),exports.onLoad=e=>Nt(exports._instance,"onLoad",e),exports.onPageNotFound=e=>Nt(exports._instance,"onPageNotFound",e),exports.onPageScroll=e=>Nt(exports._instance,"onPageScroll",e),exports.onPullDownRefresh=e=>Nt(exports._instance,"onPullDownRefresh",e),exports.onReachBottom=e=>Nt(exports._instance,"onReachBottom",e),exports.onReady=e=>Nt(exports._instance,"onReady",e),exports.onResize=e=>Nt(exports._instance,"onResize",e),exports.onRouteDone=e=>Nt(exports._instance,"onRouteDone",e),exports.onSaveExitState=e=>Nt(exports._instance,"onSaveExitState",e),exports.onScopeDispose=function(e,t=!1){y&&y.cleanups.push(e)},exports.onShareAppMessage=e=>Nt(exports._instance,"onShareAppMessage",e),exports.onShareTimeline=e=>Nt(exports._instance,"onShareTimeline",e),exports.onShow=e=>Nt(exports._instance,"onShow",e),exports.onTabItemTap=e=>Nt(exports._instance,"onTabItemTap",e),exports.onThemeChange=e=>Nt(exports._instance,"onThemeChange",e),exports.onUnhandledRejection=e=>Nt(exports._instance,"onUnhandledRejection",e),exports.onUnload=e=>Nt(exports._instance,"onUnload",e),exports.proxyRefs=function(e){return Be(e)?e:new Proxy(e,nt)},exports.reactive=We,exports.readonly=Qe,exports.ready=e=>Nt(exports._instance,"ready",e),exports.ref=Ze,exports.request=Bt,exports.resize=e=>Nt(exports._instance,"resize",e),exports.routeDone=e=>Nt(exports._instance,"routeDone",e),exports.setActivatePinia=Vt,exports.setInstance=qt,exports.setQueries=Mt,exports.shallowReactive=Me,exports.shallowReadonly=function(e){return Ve(e,!0,de,Ie,Ne)},exports.shallowRef=function(e){return et(e,!0)},exports.show=e=>Nt(exports._instance,"show",e),exports.stop=function(e){e.effect.stop()},exports.storeToRefs=function(e){e=Ke(e);const t={};for(const s in e){const n=e[s];(Ye(n)||Be(n))&&(t[s]=ct(e,s))}return t},exports.toRaw=Ke,exports.toRef=ct,exports.toRefs=function(e){const t=c(e)?new Array(e.length):{};for(const s in e)t[s]=at(e,s);return t},exports.toValue=function(e){return l(e)?e():st(e)},exports.triggerRef=function(e){e.dep.trigger()},exports.unref=st,exports.useInstance=()=>exports._instance,exports.useRoute=()=>{const e=getCurrentPages(),t=e[e.length-1];return{path:t.route,query:Qt(t.options,exports._queries)}},exports.useRouter=()=>({push:e=>{if("string"==typeof e)return wx.navigateTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.navigateTo({url:t,...e})},replace:e=>{if("string"==typeof e)return wx.redirectTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.redirectTo({url:t,...e})},go:e=>{if(!(e>0))return wx.navigateBack({delta:Math.abs(e)});console.warn("微信小程序不支持前进历史记录")},back:e=>wx.navigateBack(e),switchTab:e=>{if("string"==typeof e)return wx.switchTab({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.switchTab({url:t,...e})},reLaunch:e=>{if("string"==typeof e)return wx.reLaunch({url:e});let t;return t="path"in e?e.query?`${e.path}?${Wt(e.query)}`:e.path:e.url,wx.reLaunch({url:t,...e})}}),exports.watch=function(e,t,s){return Lt(e,t,s)},exports.watchEffect=function(e,t){return Lt(e,null,t)},exports.watchPostEffect=function(e,t){return Lt(e,null,/* istanbul ignore next -- @preserve */{flush:"post"})},exports.watchSyncEffect=function(e,t){return Lt(e,null,/* istanbul ignore next -- @preserve */{flush:"sync"})}; |
@@ -15,2 +15,2 @@ /** | ||
| /* istanbul ignore next -- @preserve */function Ue(t){return Object.prototype.toString.call(t).slice(8,-1)}function Pe(t){return"function"==typeof t}var Te,Le=!1;!function(t){t[t.QUEUED=1]="QUEUED",t[t.ALLOW_RECURSE=4]="ALLOW_RECURSE"}(Te||(Te={}));let Ae=!1,Ie=!1;const qe=[];let Ce=0;const ze=[];let Ne=null,We=0;const Me=Promise.resolve();function Qe(t){t.flags&Te.QUEUED||(qe.push(t),t.flags|=Te.QUEUED,Ae||Ie||(Ie=!0,Me.then(Be)))}function Ve(){if(ze.length>0){for(Ne=[...new Set(ze)],ze.length=0,We=0;We<Ne.length;We++){const t=Ne[We];t.flags&Te.ALLOW_RECURSE&&(t.flags&=~Te.QUEUED),t(),t.flags&=~Te.QUEUED}Ne=null,We=0}}function Be(t){Ie=!1,Ae=!0;const e=/* istanbul ignore next -- @preserve */ke;try{for(Ce=0;Ce<qe.length;Ce++){const t=qe[Ce]; | ||
| /* istanbul ignore if -- @preserve */Le&&e(t),t.flags&Te.ALLOW_RECURSE&&(t.flags&=~Te.QUEUED),t(),t.flags&Te.ALLOW_RECURSE||(t.flags&=~Te.QUEUED)}}finally{for(;Ce<qe.length;Ce++){qe[Ce].flags&=~Te.QUEUED}Ce=0,qe.length=0,Ae=!1}}function He(t,e){return Ge(t,null,e)}function Fe(t,e){return Ge(t,null,/* istanbul ignore next -- @preserve */{flush:"post"})}function Je(t,e){return Ge(t,null,/* istanbul ignore next -- @preserve */{flush:"sync"})}function Ke(t,e,s){return Ge(t,e,s)}function Ge(t,e,s=Oe){const{immediate:n,deep:r,flush:i,once:o}=s,c=je({},s);"post"===i?c.scheduler=t=>{!function(t){t.flags&Te.QUEUED||(ze.push(t),t.flags|=Te.QUEUED)}(t)}:"sync"!==i&&(c.scheduler=(t,e)=>{e?t():Qe(t)}),c.augmentJob=t=>{e&&(t.flags|=Te.ALLOW_RECURSE)};return Re(t,e,c)}function Xe(t){if(function(t){const e=new Set(["undefined","boolean","number","string"]);return null===t||e.has(typeof t)}(t)||Pe(t))return t;if(ne(t))return Xe(t.value);if(Yt(t))return Xe(Zt(t));if(De(t))return t.map((t=>Xe(t)));if(function(t){return"Object"===Ue(t)}(t)){const e={};return Object.keys(t).forEach((s=>{e[s]=Xe(t[s])})),e}throw new TypeError(`${Ue(t)} value is not supported`)}function Ye(t,e,s){var n;null!==(n=s)&&"object"==typeof n&&Re(ne(s)?s:()=>s,(()=>{t.setData({[e]:Xe(s)},Ve)}),{deep:!0})}let Ze=null;const ts=()=>Ze,es=t=>{Ze=t},ss=(t,e,s,...n)=>{if(e&&e[s]&&e[s].apply(t,n),!t[`$${s}`])return;const r={onLoad:"onUnload",onShow:"onHide",attached:"detached",show:"hide"}[s];t[`$${s}`].forEach((e=>{if(r){const s=t[`$${r}`]&&t[`$${r}`].find((t=>t.front===e));s&&s()}const s=e.apply(t,n);if(r&&"function"==typeof s){t[`$${r}`]&&t[`$${r}`].find((t=>t.front===e))||(s.front,t[`$${r}`]||(t[`$${r}`]=[]),t[`$${r}`].push(s))}}))},ns=(t,e,s,...n)=>{if(e&&e[s])return e[s].apply(t,n);if(t[`$${s}`]){if(t[`$${s}`].length)throw new Error(`一个page只能配置一个${s}`);return t[`$${s}`][0].apply(t,n)}},rs=(t,e,s)=>{t&&(t[`$${e}`]||(t[`$${e}`]=[]),t[`$${e}`].push(s.bind(t)))},is=t=>rs(Ze,"onLoad",t),os=t=>rs(Ze,"onShow",t),cs=t=>rs(Ze,"onReady",t),us=t=>rs(Ze,"onHide",t),as=t=>rs(Ze,"onUnload",t),ls=t=>rs(Ze,"onRouteDone",t),hs=t=>rs(Ze,"onPullDownRefresh",t),fs=t=>rs(Ze,"onReachBottom",t),ps=t=>rs(Ze,"onPageScroll",t),ds=t=>rs(Ze,"onAddToFavorites",t),vs=t=>rs(Ze,"onShareAppMessage",t),gs=t=>rs(Ze,"onShareTimeline",t),_s=t=>rs(Ze,"onResize",t),ys=t=>rs(Ze,"onTabItemTap",t),bs=t=>rs(Ze,"onSaveExitState",t),ws=t=>rs(Ze,"attached",t),ms=t=>rs(Ze,"ready",t),Ss=t=>rs(Ze,"moved",t),Es=t=>rs(Ze,"detached",t),$s=t=>rs(Ze,"error",t),Rs=t=>rs(Ze,"show",t),xs=t=>rs(Ze,"hide",t),Os=t=>rs(Ze,"resize",t),ks=t=>rs(Ze,"routeDone",t),Ds=t=>rs(Ze,"onLaunch",t),js=t=>rs(Ze,"onError",t),Us=t=>rs(Ze,"onPageNotFound",t),Ps=t=>rs(Ze,"onUnhandledRejection",t),Ts=t=>rs(Ze,"onThemeChange",t);let Ls=Promise.resolve(!0);const As=t=>{if(!t)return App({});let e={};if("function"!=typeof t){const{setup:s,...n}=t;e=n,t=s}return t?App({...e,onLaunch(s){Ls=new Promise((async n=>{es(this);const r=await t.call(this,s);void 0!==r&&Object.keys(r).forEach((t=>{this[t]=r[t]})),ss(this,e,"onLaunch",s),es(null),n(!0)}))},onShow(t){ss(this,e,"onShow",t)},onHide(){ss(this,e,"onHide")},onError(t){ss(this,e,"onError",t)},onPageNotFound(t){ss(this,e,"onPageNotFound",t)},onUnhandledRejection(t){ss(this,e,"onUnhandledRejection",t)},onThemeChange(t){ss(this,e,"onThemeChange",t)}}):App(e)},Is=t=>{if(!t)return Component({});let e={};if("function"!=typeof t){const{setup:s,...n}=t;e=n,t=s}if(!t)return Component(e);let s=null;return e.properties&&(s=Object.keys(e.properties)),s&&s.forEach((t=>{void 0===e.observers&&(e.observers={});const s=e.observers[t];e.observers[t]=function(e){this.$props&&(this.$props[t]=e),void 0!==s&&s.call(this,e)}})),Component({...e,lifetimes:{attached(){Ls.then((()=>{es(this),this.$scope=S();const n={};s&&s.forEach((t=>{n[t]=this.data[t]})),this.$props=Bt(n),this.$context={emit:(t,...e)=>{this.triggerEvent(t,{value:e[0]})}},this.$scope.run((()=>{const s=t.call(this,this.$props,this.$context);void 0!==s&&Object.keys(s).forEach((t=>{const e=s[t];Pe(e)?this[t]=e:(this.setData({[t]:Xe(e)}),Ye(this,t,e))})),ss(this,e,"attached")})),es(null)}))},ready(){ss(this,e,"ready")},moved(){ss(this,e,"moved")},detached(){ss(this,e,"detached"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((t=>{try{/^$/.test(t)&&delete this[t]}catch(t){console.error("销毁异常",t)}}))},error(t){ss(this,e,"error",t)}},pageLifetimes:{show(){ss(this,e,"show")},hide(){ss(this,e,"hide")},resize(t){ss(this,e,"resize",t)},routeDone(){ss(this,e,"routeDone")}}})},qs=t=>t?Object.keys(t).map((e=>{let s=t[e];return"object"==typeof t[e]&&(s=encodeURIComponent(JSON.stringify(t[e]))),`${e}=${s}`})).join("&"):"",Cs=()=>({push:t=>{if("string"==typeof t)return wx.navigateTo({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.navigateTo({url:e,...t})},replace:t=>{if("string"==typeof t)return wx.redirectTo({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.redirectTo({url:e,...t})},go:t=>{if(!(t>0))return wx.navigateBack({delta:Math.abs(t)});console.warn("微信小程序不支持前进历史记录")},back:t=>wx.navigateBack(t),switchTab:t=>{if("string"==typeof t)return wx.switchTab({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.switchTab({url:e,...t})},reLaunch:t=>{if("string"==typeof t)return wx.reLaunch({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.reLaunch({url:e,...t})}}),zs=()=>{const t=getCurrentPages(),e=t[t.length-1];return{path:e.route,query:Ms(e.options,Ns)}};let Ns={};const Ws=t=>{Ns=t},Ms=(t,e)=>{if(!e)return t;let s={};for(let n in t)if(n in e){const r=t[n],i=e[n];if(!i){s[n]=r;break}const o=i.type||i,c=t=>"formatter"in i&&void 0!==i.formatter?i.formatter(t):o===Boolean?!!t:o===Number?Number(t):o===Object?t?JSON.parse(decodeURIComponent(t)):{}:o===Array?t?JSON.parse(decodeURIComponent(t)):[]:(null===o||o===String||console.error("未知的·type·",o),t);s[n]=c(r)}else s[n]=t[n];return s},Qs=t=>{if(!t)return Page({});let e={};if("function"!=typeof t){const{setup:s,...n}=t;e=n||{},t=s}if(!t)return Page(e);const{queries:s,...n}=e;return Page({...n,onLoad(n){Ls.then((()=>{es(this),Ws(s),this.$scope=S(),this.$query=Ms(n,s),this.$context={},this.$scope.run((()=>{const s=t.call(this,this.$query,this.$context);void 0!==s&&Object.keys(s).forEach((t=>{const e=s[t];Pe(e)?this[t]=e:(this.setData({[t]:Xe(e)}),Ye(this,t,e))})),ss(this,e,"onLoad",n)})),Ws({}),es(null)}))},onShow(){ss(this,e,"onShow")},onReady(){ss(this,e,"onReady")},onHide(){ss(this,e,"onHide")},onUnload(){ss(this,e,"onUnload"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((t=>{try{/^$/.test(t)&&delete this[t]}catch(t){console.error("销毁异常",t)}}))},onRouteDone(){ss(this,e,"onRouteDone")},onPullDownRefresh(){ss(this,e,"onPullDownRefresh")},onReachBottom(){ss(this,e,"onReachBottom")},onPageScroll(t){ss(this,e,"onPageScroll",t)},onAddToFavorites(t){return ns(this,e,"onAddToFavorites",t)},onShareAppMessage(t){return ns(this,e,"onShareAppMessage",t)},onShareTimeline(){return ns(this,e,"onShareTimeline")},onResize(t){ss(this,e,"onResize",t)},onTabItemTap(t){ss(this,e,"onTabItemTap",t)},onSaveExitState(){ss(this,e,"onSaveExitState")}})},Vs=()=>{const t=getCurrentPages();return t&&t[t.length-1]};let Bs;function Hs(t){Bs=t}function Fs(){const t=S(!0),e=t.run((()=>re({}))),s={install(){Hs(s)},scope:t,state:e,stores:{}};return s}function Js(t,e,s){return function(n){if(n&&Hs(n),!(n=Bs))throw new Error("no active pinia");return n.stores[t]||function(t,e,s,n){const r={},i=t.scope.run(s);Object.assign(r,i),t.stores[e]=r;const o="PINIA_"+e;n&&n.persist&&n.persist.forEach((s=>{const n=`${o}_${s}`,r=wx.getStorageSync(n),i=wx.getStorageInfoSync().keys.includes(n);t.stores[e][s]&&i&&(ne(t.stores[e][s])?t.stores[e][s].value=r:Object.keys(r).forEach((n=>{t.stores[e][s][n]=r[n]}))),Re(ne(t.stores[e][s])?t.stores[e][s]:()=>t.stores[e][s],(t=>{wx.setStorageSync(n,t)}),{deep:!0})}))}(n,t,e,s),n.stores[t]}}function Ks(t){t=Zt(t);const e={};for(const s in t){const n=t[s];(ne(n)||Kt(n))&&(e[s]=ye(t,s))}return e}const Gs=new class{constructor(){this.defaultOptions={header:{"Content-Type":"application/json"}},this.baseUrl="/api"}setBaseUrl(t){this.baseUrl=t}setRequestInterceptor(t){this.requestInterceptor=t}setResponseInterceptor(t){this.responseInterceptor=t}async request(t){const e=/^http/.test(t.url)?t.url:this.baseUrl.endsWith("/")||t.url.startsWith("/")?`${this.baseUrl}${t.url}`:`${this.baseUrl}/${t.url}`;let s={...this.defaultOptions,...t,url:e};return this.requestInterceptor&&(s=await this.requestInterceptor(s)),new Promise(((t,e)=>{const{success:n,fail:r,complete:i,...o}=s;wx.request({...o,success:async s=>{try{if(this.responseInterceptor&&(s=await this.responseInterceptor(s)),s.statusCode>=200&&s.statusCode<300)"function"==typeof n&&n(s),t(s);else{const t=new Error(`请求失败,状态码:${s.statusCode}`);"function"==typeof r&&r(t),e(t)}}catch(t){"function"==typeof r&&r(t),e(t)}},fail:t=>{"function"==typeof r&&r(t),e(t)},complete:t=>{"function"==typeof i&&i(t)}})}))}serializeParams(t){return Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")}get(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"GET",url:n})}post(t,e,s){return this.request({...s,method:"POST",url:t,data:e})}options(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"OPTIONS",url:n})}head(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"HEAD",url:n})}put(t,e,s){return this.request({...s,method:"PUT",url:t,data:e})}delete(t,e,s){return this.request({...s,method:"DELETE",url:t,data:e})}trace(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"TRACE",url:n})}connect(t,e,s){return this.request({...s,method:"CONNECT",url:t,data:e})}};export{x as ReactiveEffect,Ze as _instance,Ns as _queries,Bs as activePinia,ws as attached,me as computed,As as createApp,Fs as createPinia,Ms as createQuery,de as customRef,Xe as deepToRaw,Ye as deepWatch,Is as defineComponent,Qs as definePage,Js as defineStore,Es as detached,q as effect,S as effectScope,$s as error,Vs as getCurrentPage,E as getCurrentScope,xs as hide,Yt as isProxy,Kt as isReactive,Gt as isReadonly,ne as isRef,Xt as isShallow,Ls as launchPromise,ss as lifetimeEmit,ns as lifetimeEmitOnce,rs as lifetimeOn,te as markRaw,Ss as moved,ds as onAddToFavorites,js as onError,us as onHide,Ds as onLaunch,is as onLoad,Us as onPageNotFound,ps as onPageScroll,hs as onPullDownRefresh,fs as onReachBottom,cs as onReady,_s as onResize,ls as onRouteDone,bs as onSaveExitState,$ as onScopeDispose,vs as onShareAppMessage,gs as onShareTimeline,os as onShow,ys as onTabItemTap,Ts as onThemeChange,Ps as onUnhandledRejection,as as onUnload,fe as proxyRefs,Vt as reactive,Ht as readonly,ms as ready,re as ref,Gs as request,Os as resize,ks as routeDone,Hs as setActivatePinia,es as setInstance,Ws as setQueries,Bt as shallowReactive,Ft as shallowReadonly,ie as shallowRef,Rs as show,C as stop,Ks as storeToRefs,Zt as toRaw,ye as toRef,ve as toRefs,le as toValue,ue as triggerRef,ae as unref,ts as useInstance,zs as useRoute,Cs as useRouter,Ke as watch,He as watchEffect,Fe as watchPostEffect,Je as watchSyncEffect}; | ||
| /* istanbul ignore if -- @preserve */Le&&e(t),t.flags&Te.ALLOW_RECURSE&&(t.flags&=~Te.QUEUED),t(),t.flags&Te.ALLOW_RECURSE||(t.flags&=~Te.QUEUED)}}finally{for(;Ce<qe.length;Ce++){qe[Ce].flags&=~Te.QUEUED}Ce=0,qe.length=0,Ae=!1}}function He(t,e){return Ge(t,null,e)}function Fe(t,e){return Ge(t,null,/* istanbul ignore next -- @preserve */{flush:"post"})}function Je(t,e){return Ge(t,null,/* istanbul ignore next -- @preserve */{flush:"sync"})}function Ke(t,e,s){return Ge(t,e,s)}function Ge(t,e,s=Oe){const{immediate:n,deep:r,flush:i,once:o}=s,c=je({},s);"post"===i?c.scheduler=t=>{!function(t){t.flags&Te.QUEUED||(ze.push(t),t.flags|=Te.QUEUED)}(t)}:"sync"!==i&&(c.scheduler=(t,e)=>{e?t():Qe(t)}),c.augmentJob=t=>{e&&(t.flags|=Te.ALLOW_RECURSE)};return Re(t,e,c)}function Xe(t){if(function(t){const e=new Set(["undefined","boolean","number","string"]);return null===t||e.has(typeof t)}(t)||Pe(t))return t;if(ne(t))return Xe(t.value);if(Yt(t))return Xe(Zt(t));if(De(t))return t.map((t=>Xe(t)));if(function(t){return"Object"===Ue(t)}(t)){const e={};return Object.keys(t).forEach((s=>{e[s]=Xe(t[s])})),e}throw new TypeError(`${Ue(t)} value is not supported`)}function Ye(t,e){var s;null!==(s=e)&&"object"==typeof s&&Re(ne(e)?e:()=>e,(()=>{this.setData({[t]:Xe(e)},Ve)}),{deep:!0})}let Ze=null;const ts=()=>Ze,es=t=>{Ze=t},ss=(t,e,s,...n)=>{if(e&&e[s]&&e[s].apply(t,n),!t[`$${s}`])return;const r={onLoad:"onUnload",onShow:"onHide",attached:"detached",show:"hide"}[s];t[`$${s}`].forEach((e=>{if(r){const s=t[`$${r}`]&&t[`$${r}`].find((t=>t.front===e));s&&s()}const s=e.apply(t,n);if(r&&"function"==typeof s){t[`$${r}`]&&t[`$${r}`].find((t=>t.front===e))||(s.front,t[`$${r}`]||(t[`$${r}`]=[]),t[`$${r}`].push(s))}}))},ns=(t,e,s,...n)=>{if(e&&e[s])return e[s].apply(t,n);if(t[`$${s}`]){if(t[`$${s}`].length)throw new Error(`一个page只能配置一个${s}`);return t[`$${s}`][0].apply(t,n)}},rs=(t,e,s)=>{t&&(t[`$${e}`]||(t[`$${e}`]=[]),t[`$${e}`].push(s.bind(t)))},is=t=>rs(Ze,"onLoad",t),os=t=>rs(Ze,"onShow",t),cs=t=>rs(Ze,"onReady",t),us=t=>rs(Ze,"onHide",t),as=t=>rs(Ze,"onUnload",t),ls=t=>rs(Ze,"onRouteDone",t),hs=t=>rs(Ze,"onPullDownRefresh",t),fs=t=>rs(Ze,"onReachBottom",t),ps=t=>rs(Ze,"onPageScroll",t),ds=t=>rs(Ze,"onAddToFavorites",t),vs=t=>rs(Ze,"onShareAppMessage",t),gs=t=>rs(Ze,"onShareTimeline",t),_s=t=>rs(Ze,"onResize",t),ys=t=>rs(Ze,"onTabItemTap",t),bs=t=>rs(Ze,"onSaveExitState",t),ws=t=>rs(Ze,"attached",t),ms=t=>rs(Ze,"ready",t),Ss=t=>rs(Ze,"moved",t),Es=t=>rs(Ze,"detached",t),$s=t=>rs(Ze,"error",t),Rs=t=>rs(Ze,"show",t),xs=t=>rs(Ze,"hide",t),Os=t=>rs(Ze,"resize",t),ks=t=>rs(Ze,"routeDone",t),Ds=t=>rs(Ze,"onLaunch",t),js=t=>rs(Ze,"onError",t),Us=t=>rs(Ze,"onPageNotFound",t),Ps=t=>rs(Ze,"onUnhandledRejection",t),Ts=t=>rs(Ze,"onThemeChange",t);let Ls=Promise.resolve(!0);const As=t=>{if(!t)return App({});let e={};if("function"!=typeof t){const{setup:s,...n}=t;e=n,t=s}return t?App({...e,onLaunch(s){Ls=new Promise((async n=>{es(this);const r=await t.call(this,s);void 0!==r&&Object.keys(r).forEach((t=>{this[t]=r[t]})),ss(this,e,"onLaunch",s),es(null),n(!0)}))},onShow(t){ss(this,e,"onShow",t)},onHide(){ss(this,e,"onHide")},onError(t){ss(this,e,"onError",t)},onPageNotFound(t){ss(this,e,"onPageNotFound",t)},onUnhandledRejection(t){ss(this,e,"onUnhandledRejection",t)},onThemeChange(t){ss(this,e,"onThemeChange",t)}}):App(e)},Is=t=>{if(!t)return Component({});let e={};if("function"!=typeof t){const{setup:s,...n}=t;e=n,t=s}if(!t)return Component(e);let s=null;return e.properties&&(s=Object.keys(e.properties)),s&&s.forEach((t=>{void 0===e.observers&&(e.observers={});const s=e.observers[t];e.observers[t]=function(e){this.$props&&(this.$props[t]=e),void 0!==s&&s.call(this,e)}})),Component({...e,lifetimes:{attached(){Ls.then((()=>{es(this),this.$scope=S();const n={};s&&s.forEach((t=>{n[t]=this.data[t]})),this.$props=Bt(n),this.$context={emit:(t,...e)=>{this.triggerEvent(t,{value:e[0]})}},this.$scope.run((()=>{const s=t.call(this,this.$props,this.$context);if(void 0!==s){let t;Object.keys(s).forEach((e=>{const n=s[e];Pe(n)?this[e]=n:(t=t||{},t[e]=Xe(n),Ye.call(this,e,n))})),void 0!==t&&this.setData(t,Ve)}ss(this,e,"attached")})),es(null)}))},ready(){ss(this,e,"ready")},moved(){ss(this,e,"moved")},detached(){ss(this,e,"detached"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((t=>{try{/^$/.test(t)&&delete this[t]}catch(t){console.error("销毁异常",t)}}))},error(t){ss(this,e,"error",t)}},pageLifetimes:{show(){ss(this,e,"show")},hide(){ss(this,e,"hide")},resize(t){ss(this,e,"resize",t)},routeDone(){ss(this,e,"routeDone")}}})},qs=t=>t?Object.keys(t).map((e=>{let s=t[e];return"object"==typeof t[e]&&(s=encodeURIComponent(JSON.stringify(t[e]))),`${e}=${s}`})).join("&"):"",Cs=()=>({push:t=>{if("string"==typeof t)return wx.navigateTo({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.navigateTo({url:e,...t})},replace:t=>{if("string"==typeof t)return wx.redirectTo({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.redirectTo({url:e,...t})},go:t=>{if(!(t>0))return wx.navigateBack({delta:Math.abs(t)});console.warn("微信小程序不支持前进历史记录")},back:t=>wx.navigateBack(t),switchTab:t=>{if("string"==typeof t)return wx.switchTab({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.switchTab({url:e,...t})},reLaunch:t=>{if("string"==typeof t)return wx.reLaunch({url:t});let e;return e="path"in t?t.query?`${t.path}?${qs(t.query)}`:t.path:t.url,wx.reLaunch({url:e,...t})}}),zs=()=>{const t=getCurrentPages(),e=t[t.length-1];return{path:e.route,query:Ms(e.options,Ns)}};let Ns={};const Ws=t=>{Ns=t},Ms=(t,e)=>{if(!e)return t;let s={};for(let n in t)if(n in e){const r=t[n],i=e[n];if(!i){s[n]=r;break}const o=i.type||i,c=t=>"formatter"in i&&void 0!==i.formatter?i.formatter(t):o===Boolean?!!t:o===Number?Number(t):o===Object?t?JSON.parse(decodeURIComponent(t)):{}:o===Array?t?JSON.parse(decodeURIComponent(t)):[]:(null===o||o===String||console.error("未知的·type·",o),t);s[n]=c(r)}else s[n]=t[n];return s},Qs=t=>{if(!t)return Page({});let e={};if("function"!=typeof t){const{setup:s,...n}=t;e=n||{},t=s}if(!t)return Page(e);const{queries:s,...n}=e;return Page({...n,onLoad(n){Ls.then((()=>{es(this),Ws(s),this.$scope=S(),this.$query=Ms(n,s),this.$context={},this.$scope.run((()=>{const s=t.call(this,this.$query,this.$context);if(void 0!==s){let t;Object.keys(s).forEach((e=>{const n=s[e];Pe(n)?this[e]=n:(t=t||{},t[e]=Xe(n),Ye.call(this,e,n))})),void 0!==t&&this.setData(t,Ve)}ss(this,e,"onLoad",n)})),Ws({}),es(null)}))},onShow(){ss(this,e,"onShow")},onReady(){ss(this,e,"onReady")},onHide(){ss(this,e,"onHide")},onUnload(){ss(this,e,"onUnload"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((t=>{try{/^$/.test(t)&&delete this[t]}catch(t){console.error("销毁异常",t)}}))},onRouteDone(){ss(this,e,"onRouteDone")},onPullDownRefresh(){ss(this,e,"onPullDownRefresh")},onReachBottom(){ss(this,e,"onReachBottom")},onPageScroll(t){ss(this,e,"onPageScroll",t)},onAddToFavorites(t){return ns(this,e,"onAddToFavorites",t)},onShareAppMessage(t){return ns(this,e,"onShareAppMessage",t)},onShareTimeline(){return ns(this,e,"onShareTimeline")},onResize(t){ss(this,e,"onResize",t)},onTabItemTap(t){ss(this,e,"onTabItemTap",t)},onSaveExitState(){ss(this,e,"onSaveExitState")}})},Vs=()=>{const t=getCurrentPages();return t&&t[t.length-1]};let Bs;function Hs(t){Bs=t}function Fs(){const t=S(!0),e=t.run((()=>re({}))),s={install(){Hs(s)},scope:t,state:e,stores:{}};return s}function Js(t,e,s){return function(n){if(n&&Hs(n),!(n=Bs))throw new Error("no active pinia");return n.stores[t]||function(t,e,s,n){const r={},i=t.scope.run(s);Object.assign(r,i),t.stores[e]=r;const o="PINIA_"+e;n&&n.persist&&n.persist.forEach((s=>{const n=`${o}_${s}`,r=wx.getStorageSync(n),i=wx.getStorageInfoSync().keys.includes(n);t.stores[e][s]&&i&&(ne(t.stores[e][s])?t.stores[e][s].value=r:Object.keys(r).forEach((n=>{t.stores[e][s][n]=r[n]}))),Re(ne(t.stores[e][s])?t.stores[e][s]:()=>t.stores[e][s],(t=>{wx.setStorageSync(n,t)}),{deep:!0})}))}(n,t,e,s),n.stores[t]}}function Ks(t){t=Zt(t);const e={};for(const s in t){const n=t[s];(ne(n)||Kt(n))&&(e[s]=ye(t,s))}return e}const Gs=new class{constructor(){this.defaultOptions={header:{"Content-Type":"application/json"}},this.baseUrl="/api"}setBaseUrl(t){this.baseUrl=t}setRequestInterceptor(t){this.requestInterceptor=t}setResponseInterceptor(t){this.responseInterceptor=t}async request(t){const e=/^http/.test(t.url)?t.url:this.baseUrl.endsWith("/")||t.url.startsWith("/")?`${this.baseUrl}${t.url}`:`${this.baseUrl}/${t.url}`;let s={...this.defaultOptions,...t,url:e};return this.requestInterceptor&&(s=await this.requestInterceptor(s)),new Promise(((t,e)=>{const{success:n,fail:r,complete:i,...o}=s;wx.request({...o,success:async s=>{try{if(this.responseInterceptor&&(s=await this.responseInterceptor(s)),s.statusCode>=200&&s.statusCode<300)"function"==typeof n&&n(s),t(s);else{const t=new Error(`请求失败,状态码:${s.statusCode}`);"function"==typeof r&&r(t),e(t)}}catch(t){"function"==typeof r&&r(t),e(t)}},fail:t=>{"function"==typeof r&&r(t),e(t)},complete:t=>{"function"==typeof i&&i(t)}})}))}serializeParams(t){return Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")}get(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"GET",url:n})}post(t,e,s){return this.request({...s,method:"POST",url:t,data:e})}options(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"OPTIONS",url:n})}head(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"HEAD",url:n})}put(t,e,s){return this.request({...s,method:"PUT",url:t,data:e})}delete(t,e,s){return this.request({...s,method:"DELETE",url:t,data:e})}trace(t,e,s){let n=t;if(e&&Object.keys(e).length>0){const s=this.serializeParams(e);n+=t.includes("?")?`&${s}`:`?${s}`}return this.request({...s,method:"TRACE",url:n})}connect(t,e,s){return this.request({...s,method:"CONNECT",url:t,data:e})}};export{x as ReactiveEffect,Ze as _instance,Ns as _queries,Bs as activePinia,ws as attached,me as computed,As as createApp,Fs as createPinia,Ms as createQuery,de as customRef,Xe as deepToRaw,Ye as deepWatch,Is as defineComponent,Qs as definePage,Js as defineStore,Es as detached,q as effect,S as effectScope,$s as error,Vs as getCurrentPage,E as getCurrentScope,xs as hide,Yt as isProxy,Kt as isReactive,Gt as isReadonly,ne as isRef,Xt as isShallow,Ls as launchPromise,ss as lifetimeEmit,ns as lifetimeEmitOnce,rs as lifetimeOn,te as markRaw,Ss as moved,ds as onAddToFavorites,js as onError,us as onHide,Ds as onLaunch,is as onLoad,Us as onPageNotFound,ps as onPageScroll,hs as onPullDownRefresh,fs as onReachBottom,cs as onReady,_s as onResize,ls as onRouteDone,bs as onSaveExitState,$ as onScopeDispose,vs as onShareAppMessage,gs as onShareTimeline,os as onShow,ys as onTabItemTap,Ts as onThemeChange,Ps as onUnhandledRejection,as as onUnload,fe as proxyRefs,Vt as reactive,Ht as readonly,ms as ready,re as ref,Gs as request,Os as resize,ks as routeDone,Hs as setActivatePinia,es as setInstance,Ws as setQueries,Bt as shallowReactive,Ft as shallowReadonly,ie as shallowRef,Rs as show,C as stop,Ks as storeToRefs,Zt as toRaw,ye as toRef,ve as toRefs,le as toValue,ue as triggerRef,ae as unref,ts as useInstance,zs as useRoute,Cs as useRouter,Ke as watch,He as watchEffect,Fe as watchPostEffect,Je as watchSyncEffect}; |
@@ -15,2 +15,2 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MpVue3={})}(this,(function(e){"use strict"; | ||
| /* istanbul ignore next -- @preserve */function bt(e){return Object.prototype.toString.call(e).slice(8,-1)}function mt(e){return"function"==typeof e}var St,Rt=!1;!function(e){e[e.QUEUED=1]="QUEUED",e[e.ALLOW_RECURSE=4]="ALLOW_RECURSE"}(St||(St={}));let Et=!1,$t=!1;const xt=[];let Ot=0;const Pt=[];let Dt=null,kt=0;const jt=Promise.resolve();function Tt(e){e.flags&St.QUEUED||(xt.push(e),e.flags|=St.QUEUED,Et||$t||($t=!0,jt.then(Lt)))}function Ut(){if(Pt.length>0){for(Dt=[...new Set(Pt)],Pt.length=0,kt=0;kt<Dt.length;kt++){const e=Dt[kt];e.flags&St.ALLOW_RECURSE&&(e.flags&=~St.QUEUED),e(),e.flags&=~St.QUEUED}Dt=null,kt=0}}function Lt(e){$t=!1,Et=!0;const t=/* istanbul ignore next -- @preserve */_t;try{for(Ot=0;Ot<xt.length;Ot++){const e=xt[Ot]; | ||
| /* istanbul ignore if -- @preserve */Rt&&t(e),e.flags&St.ALLOW_RECURSE&&(e.flags&=~St.QUEUED),e(),e.flags&St.ALLOW_RECURSE||(e.flags&=~St.QUEUED)}}finally{for(;Ot<xt.length;Ot++){xt[Ot].flags&=~St.QUEUED}Ot=0,xt.length=0,Et=!1}}function At(e,t,n=gt){const{immediate:s,deep:i,flush:r,once:o}=n,c=wt({},n);"post"===r?c.scheduler=e=>{!function(e){e.flags&St.QUEUED||(Pt.push(e),e.flags|=St.QUEUED)}(e)}:"sync"!==r&&(c.scheduler=(e,t)=>{t?e():Tt(e)}),c.augmentJob=e=>{t&&(e.flags|=St.ALLOW_RECURSE)};return dt(e,t,c)}function It(e){if(function(e){const t=new Set(["undefined","boolean","number","string"]);return null===e||t.has(typeof e)}(e)||mt(e))return e;if(Ze(e))return It(e.value);if(Ke(e))return It(Ge(e));if(yt(e))return e.map((e=>It(e)));if(function(e){return"Object"===bt(e)}(e)){const t={};return Object.keys(e).forEach((n=>{t[n]=It(e[n])})),t}throw new TypeError(`${bt(e)} value is not supported`)}function qt(e,t,n){var s;null!==(s=n)&&"object"==typeof s&&dt(Ze(n)?n:()=>n,(()=>{e.setData({[t]:It(n)},Ut)}),{deep:!0})}e._instance=null;const Ct=t=>{e._instance=t},zt=(e,t,n,...s)=>{if(t&&t[n]&&t[n].apply(e,s),!e[`$${n}`])return;const i={onLoad:"onUnload",onShow:"onHide",attached:"detached",show:"hide"}[n];e[`$${n}`].forEach((t=>{if(i){const n=e[`$${i}`]&&e[`$${i}`].find((e=>e.front===t));n&&n()}const n=t.apply(e,s);if(i&&"function"==typeof n){e[`$${i}`]&&e[`$${i}`].find((e=>e.front===t))||(n.front,e[`$${i}`]||(e[`$${i}`]=[]),e[`$${i}`].push(n))}}))},Nt=(e,t,n,...s)=>{if(t&&t[n])return t[n].apply(e,s);if(e[`$${n}`]){if(e[`$${n}`].length)throw new Error(`一个page只能配置一个${n}`);return e[`$${n}`][0].apply(e,s)}},Wt=(e,t,n)=>{e&&(e[`$${t}`]||(e[`$${t}`]=[]),e[`$${t}`].push(n.bind(e)))};e.launchPromise=Promise.resolve(!0);const Mt=e=>e?Object.keys(e).map((t=>{let n=e[t];return"object"==typeof e[t]&&(n=encodeURIComponent(JSON.stringify(e[t]))),`${t}=${n}`})).join("&"):"";e._queries={};const Qt=t=>{e._queries=t},Vt=(e,t)=>{if(!t)return e;let n={};for(let s in e)if(s in t){const i=e[s],r=t[s];if(!r){n[s]=i;break}const o=r.type||r,c=e=>"formatter"in r&&void 0!==r.formatter?r.formatter(e):o===Boolean?!!e:o===Number?Number(e):o===Object?e?JSON.parse(decodeURIComponent(e)):{}:o===Array?e?JSON.parse(decodeURIComponent(e)):[]:(null===o||o===String||console.error("未知的·type·",o),e);n[s]=c(i)}else n[s]=e[s];return n};function Bt(t){e.activePinia=t}e.activePinia=void 0;const Ft=new class{constructor(){this.defaultOptions={header:{"Content-Type":"application/json"}},this.baseUrl="/api"}setBaseUrl(e){this.baseUrl=e}setRequestInterceptor(e){this.requestInterceptor=e}setResponseInterceptor(e){this.responseInterceptor=e}async request(e){const t=/^http/.test(e.url)?e.url:this.baseUrl.endsWith("/")||e.url.startsWith("/")?`${this.baseUrl}${e.url}`:`${this.baseUrl}/${e.url}`;let n={...this.defaultOptions,...e,url:t};return this.requestInterceptor&&(n=await this.requestInterceptor(n)),new Promise(((e,t)=>{const{success:s,fail:i,complete:r,...o}=n;wx.request({...o,success:async n=>{try{if(this.responseInterceptor&&(n=await this.responseInterceptor(n)),n.statusCode>=200&&n.statusCode<300)"function"==typeof s&&s(n),e(n);else{const e=new Error(`请求失败,状态码:${n.statusCode}`);"function"==typeof i&&i(e),t(e)}}catch(e){"function"==typeof i&&i(e),t(e)}},fail:e=>{"function"==typeof i&&i(e),t(e)},complete:e=>{"function"==typeof r&&r(e)}})}))}serializeParams(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}get(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"GET",url:s})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}options(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"OPTIONS",url:s})}head(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"HEAD",url:s})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}delete(e,t,n){return this.request({...n,method:"DELETE",url:e,data:t})}trace(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"TRACE",url:s})}connect(e,t,n){return this.request({...n,method:"CONNECT",url:e,data:t})}};e.ReactiveEffect=x,e.attached=t=>Wt(e._instance,"attached",t),e.computed=function(e,t,n=!1){let s,i;return h(e)?s=e:(s=e.get,i=e.set),new lt(s,i,n)},e.createApp=t=>{if(!t)return App({});let n={};if("function"!=typeof t){const{setup:e,...s}=t;n=s,t=e}return t?App({...n,onLaunch(s){e.launchPromise=new Promise((async e=>{Ct(this);const i=await t.call(this,s);void 0!==i&&Object.keys(i).forEach((e=>{this[e]=i[e]})),zt(this,n,"onLaunch",s),Ct(null),e(!0)}))},onShow(e){zt(this,n,"onShow",e)},onHide(){zt(this,n,"onHide")},onError(e){zt(this,n,"onError",e)},onPageNotFound(e){zt(this,n,"onPageNotFound",e)},onUnhandledRejection(e){zt(this,n,"onUnhandledRejection",e)},onThemeChange(e){zt(this,n,"onThemeChange",e)}}):App(n)},e.createPinia=function(){const e=R(!0),t=e.run((()=>et({}))),n={install(){Bt(n)},scope:e,state:t,stores:{}};return n},e.createQuery=Vt,e.customRef=function(e){return new rt(e)},e.deepToRaw=It,e.deepWatch=qt,e.defineComponent=t=>{if(!t)return Component({});let n={};if("function"!=typeof t){const{setup:e,...s}=t;n=s,t=e}if(!t)return Component(n);let s=null;return n.properties&&(s=Object.keys(n.properties)),s&&s.forEach((e=>{void 0===n.observers&&(n.observers={});const t=n.observers[e];n.observers[e]=function(n){this.$props&&(this.$props[e]=n),void 0!==t&&t.call(this,n)}})),Component({...n,lifetimes:{attached(){e.launchPromise.then((()=>{Ct(this),this.$scope=R();const e={};s&&s.forEach((t=>{e[t]=this.data[t]})),this.$props=Qe(e),this.$context={emit:(e,...t)=>{this.triggerEvent(e,{value:t[0]})}},this.$scope.run((()=>{const e=t.call(this,this.$props,this.$context);void 0!==e&&Object.keys(e).forEach((t=>{const n=e[t];mt(n)?this[t]=n:(this.setData({[t]:It(n)}),qt(this,t,n))})),zt(this,n,"attached")})),Ct(null)}))},ready(){zt(this,n,"ready")},moved(){zt(this,n,"moved")},detached(){zt(this,n,"detached"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},error(e){zt(this,n,"error",e)}},pageLifetimes:{show(){zt(this,n,"show")},hide(){zt(this,n,"hide")},resize(e){zt(this,n,"resize",e)},routeDone(){zt(this,n,"routeDone")}}})},e.definePage=t=>{if(!t)return Page({});let n={};if("function"!=typeof t){const{setup:e,...s}=t;n=s||{},t=e}if(!t)return Page(n);const{queries:s,...i}=n;return Page({...i,onLoad(i){e.launchPromise.then((()=>{Ct(this),Qt(s),this.$scope=R(),this.$query=Vt(i,s),this.$context={},this.$scope.run((()=>{const e=t.call(this,this.$query,this.$context);void 0!==e&&Object.keys(e).forEach((t=>{const n=e[t];mt(n)?this[t]=n:(this.setData({[t]:It(n)}),qt(this,t,n))})),zt(this,n,"onLoad",i)})),Qt({}),Ct(null)}))},onShow(){zt(this,n,"onShow")},onReady(){zt(this,n,"onReady")},onHide(){zt(this,n,"onHide")},onUnload(){zt(this,n,"onUnload"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},onRouteDone(){zt(this,n,"onRouteDone")},onPullDownRefresh(){zt(this,n,"onPullDownRefresh")},onReachBottom(){zt(this,n,"onReachBottom")},onPageScroll(e){zt(this,n,"onPageScroll",e)},onAddToFavorites(e){return Nt(this,n,"onAddToFavorites",e)},onShareAppMessage(e){return Nt(this,n,"onShareAppMessage",e)},onShareTimeline(){return Nt(this,n,"onShareTimeline")},onResize(e){zt(this,n,"onResize",e)},onTabItemTap(e){zt(this,n,"onTabItemTap",e)},onSaveExitState(){zt(this,n,"onSaveExitState")}})},e.defineStore=function(t,n,s){return function(i){if(i&&Bt(i),!(i=e.activePinia))throw new Error("no active pinia");return i.stores[t]||function(e,t,n,s){const i={},r=e.scope.run(n);Object.assign(i,r),e.stores[t]=i;const o="PINIA_"+t;s&&s.persist&&s.persist.forEach((n=>{const s=`${o}_${n}`,i=wx.getStorageSync(s),r=wx.getStorageInfoSync().keys.includes(s);e.stores[t][n]&&r&&(Ze(e.stores[t][n])?e.stores[t][n].value=i:Object.keys(i).forEach((s=>{e.stores[t][n][s]=i[s]}))),dt(Ze(e.stores[t][n])?e.stores[t][n]:()=>e.stores[t][n],(e=>{wx.setStorageSync(s,e)}),{deep:!0})}))}(i,t,n,s),i.stores[t]}},e.detached=t=>Wt(e._instance,"detached",t),e.effect=function(e,t){e.effect instanceof x&&(e=e.effect.fn);const n=new x(e);t&&i(n,t);try{n.run()}catch(e){throw n.stop(),e}const s=n.run.bind(n);return s.effect=n,s},e.effectScope=R,e.error=t=>Wt(e._instance,"error",t),e.getCurrentPage=()=>{const e=getCurrentPages();return e&&e[e.length-1]},e.getCurrentScope=E,e.hide=t=>Wt(e._instance,"hide",t),e.isProxy=Ke,e.isReactive=Fe,e.isReadonly=He,e.isRef=Ze,e.isShallow=Je,e.lifetimeEmit=zt,e.lifetimeEmitOnce=Nt,e.lifetimeOn=Wt,e.markRaw=function(e){return Object.isExtensible(e)&&((e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})})(e,"__v_skip",!0),e},e.moved=t=>Wt(e._instance,"moved",t),e.onAddToFavorites=t=>Wt(e._instance,"onAddToFavorites",t),e.onError=t=>Wt(e._instance,"onError",t),e.onHide=t=>Wt(e._instance,"onHide",t),e.onLaunch=t=>Wt(e._instance,"onLaunch",t),e.onLoad=t=>Wt(e._instance,"onLoad",t),e.onPageNotFound=t=>Wt(e._instance,"onPageNotFound",t),e.onPageScroll=t=>Wt(e._instance,"onPageScroll",t),e.onPullDownRefresh=t=>Wt(e._instance,"onPullDownRefresh",t),e.onReachBottom=t=>Wt(e._instance,"onReachBottom",t),e.onReady=t=>Wt(e._instance,"onReady",t),e.onResize=t=>Wt(e._instance,"onResize",t),e.onRouteDone=t=>Wt(e._instance,"onRouteDone",t),e.onSaveExitState=t=>Wt(e._instance,"onSaveExitState",t),e.onScopeDispose=function(e,t=!1){b&&b.cleanups.push(e)},e.onShareAppMessage=t=>Wt(e._instance,"onShareAppMessage",t),e.onShareTimeline=t=>Wt(e._instance,"onShareTimeline",t),e.onShow=t=>Wt(e._instance,"onShow",t),e.onTabItemTap=t=>Wt(e._instance,"onTabItemTap",t),e.onThemeChange=t=>Wt(e._instance,"onThemeChange",t),e.onUnhandledRejection=t=>Wt(e._instance,"onUnhandledRejection",t),e.onUnload=t=>Wt(e._instance,"onUnload",t),e.proxyRefs=function(e){return Fe(e)?e:new Proxy(e,it)},e.reactive=Me,e.readonly=Ve,e.ready=t=>Wt(e._instance,"ready",t),e.ref=et,e.request=Ft,e.resize=t=>Wt(e._instance,"resize",t),e.routeDone=t=>Wt(e._instance,"routeDone",t),e.setActivatePinia=Bt,e.setInstance=Ct,e.setQueries=Qt,e.shallowReactive=Qe,e.shallowReadonly=function(e){return Be(e,!0,ve,qe,We)},e.shallowRef=function(e){return tt(e,!0)},e.show=t=>Wt(e._instance,"show",t),e.stop=function(e){e.effect.stop()},e.storeToRefs=function(e){e=Ge(e);const t={};for(const n in e){const s=e[n];(Ze(s)||Fe(s))&&(t[n]=at(e,n))}return t},e.toRaw=Ge,e.toRef=at,e.toRefs=function(e){const t=a(e)?new Array(e.length):{};for(const n in e)t[n]=ut(e,n);return t},e.toValue=function(e){return h(e)?e():st(e)},e.triggerRef=function(e){e.dep.trigger()},e.unref=st,e.useInstance=()=>e._instance,e.useRoute=()=>{const t=getCurrentPages(),n=t[t.length-1];return{path:n.route,query:Vt(n.options,e._queries)}},e.useRouter=()=>({push:e=>{if("string"==typeof e)return wx.navigateTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.navigateTo({url:t,...e})},replace:e=>{if("string"==typeof e)return wx.redirectTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.redirectTo({url:t,...e})},go:e=>{if(!(e>0))return wx.navigateBack({delta:Math.abs(e)});console.warn("微信小程序不支持前进历史记录")},back:e=>wx.navigateBack(e),switchTab:e=>{if("string"==typeof e)return wx.switchTab({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.switchTab({url:t,...e})},reLaunch:e=>{if("string"==typeof e)return wx.reLaunch({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.reLaunch({url:t,...e})}}),e.watch=function(e,t,n){return At(e,t,n)},e.watchEffect=function(e,t){return At(e,null,t)},e.watchPostEffect=function(e,t){return At(e,null,/* istanbul ignore next -- @preserve */{flush:"post"})},e.watchSyncEffect=function(e,t){return At(e,null,/* istanbul ignore next -- @preserve */{flush:"sync"})}})); | ||
| /* istanbul ignore if -- @preserve */Rt&&t(e),e.flags&St.ALLOW_RECURSE&&(e.flags&=~St.QUEUED),e(),e.flags&St.ALLOW_RECURSE||(e.flags&=~St.QUEUED)}}finally{for(;Ot<xt.length;Ot++){xt[Ot].flags&=~St.QUEUED}Ot=0,xt.length=0,Et=!1}}function At(e,t,n=gt){const{immediate:s,deep:i,flush:r,once:o}=n,c=wt({},n);"post"===r?c.scheduler=e=>{!function(e){e.flags&St.QUEUED||(Pt.push(e),e.flags|=St.QUEUED)}(e)}:"sync"!==r&&(c.scheduler=(e,t)=>{t?e():Tt(e)}),c.augmentJob=e=>{t&&(e.flags|=St.ALLOW_RECURSE)};return dt(e,t,c)}function It(e){if(function(e){const t=new Set(["undefined","boolean","number","string"]);return null===e||t.has(typeof e)}(e)||mt(e))return e;if(Ze(e))return It(e.value);if(Ke(e))return It(Ge(e));if(yt(e))return e.map((e=>It(e)));if(function(e){return"Object"===bt(e)}(e)){const t={};return Object.keys(e).forEach((n=>{t[n]=It(e[n])})),t}throw new TypeError(`${bt(e)} value is not supported`)}function qt(e,t){var n;null!==(n=t)&&"object"==typeof n&&dt(Ze(t)?t:()=>t,(()=>{this.setData({[e]:It(t)},Ut)}),{deep:!0})}e._instance=null;const Ct=t=>{e._instance=t},zt=(e,t,n,...s)=>{if(t&&t[n]&&t[n].apply(e,s),!e[`$${n}`])return;const i={onLoad:"onUnload",onShow:"onHide",attached:"detached",show:"hide"}[n];e[`$${n}`].forEach((t=>{if(i){const n=e[`$${i}`]&&e[`$${i}`].find((e=>e.front===t));n&&n()}const n=t.apply(e,s);if(i&&"function"==typeof n){e[`$${i}`]&&e[`$${i}`].find((e=>e.front===t))||(n.front,e[`$${i}`]||(e[`$${i}`]=[]),e[`$${i}`].push(n))}}))},Nt=(e,t,n,...s)=>{if(t&&t[n])return t[n].apply(e,s);if(e[`$${n}`]){if(e[`$${n}`].length)throw new Error(`一个page只能配置一个${n}`);return e[`$${n}`][0].apply(e,s)}},Wt=(e,t,n)=>{e&&(e[`$${t}`]||(e[`$${t}`]=[]),e[`$${t}`].push(n.bind(e)))};e.launchPromise=Promise.resolve(!0);const Mt=e=>e?Object.keys(e).map((t=>{let n=e[t];return"object"==typeof e[t]&&(n=encodeURIComponent(JSON.stringify(e[t]))),`${t}=${n}`})).join("&"):"";e._queries={};const Qt=t=>{e._queries=t},Vt=(e,t)=>{if(!t)return e;let n={};for(let s in e)if(s in t){const i=e[s],r=t[s];if(!r){n[s]=i;break}const o=r.type||r,c=e=>"formatter"in r&&void 0!==r.formatter?r.formatter(e):o===Boolean?!!e:o===Number?Number(e):o===Object?e?JSON.parse(decodeURIComponent(e)):{}:o===Array?e?JSON.parse(decodeURIComponent(e)):[]:(null===o||o===String||console.error("未知的·type·",o),e);n[s]=c(i)}else n[s]=e[s];return n};function Bt(t){e.activePinia=t}e.activePinia=void 0;const Ft=new class{constructor(){this.defaultOptions={header:{"Content-Type":"application/json"}},this.baseUrl="/api"}setBaseUrl(e){this.baseUrl=e}setRequestInterceptor(e){this.requestInterceptor=e}setResponseInterceptor(e){this.responseInterceptor=e}async request(e){const t=/^http/.test(e.url)?e.url:this.baseUrl.endsWith("/")||e.url.startsWith("/")?`${this.baseUrl}${e.url}`:`${this.baseUrl}/${e.url}`;let n={...this.defaultOptions,...e,url:t};return this.requestInterceptor&&(n=await this.requestInterceptor(n)),new Promise(((e,t)=>{const{success:s,fail:i,complete:r,...o}=n;wx.request({...o,success:async n=>{try{if(this.responseInterceptor&&(n=await this.responseInterceptor(n)),n.statusCode>=200&&n.statusCode<300)"function"==typeof s&&s(n),e(n);else{const e=new Error(`请求失败,状态码:${n.statusCode}`);"function"==typeof i&&i(e),t(e)}}catch(e){"function"==typeof i&&i(e),t(e)}},fail:e=>{"function"==typeof i&&i(e),t(e)},complete:e=>{"function"==typeof r&&r(e)}})}))}serializeParams(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}get(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"GET",url:s})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}options(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"OPTIONS",url:s})}head(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"HEAD",url:s})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}delete(e,t,n){return this.request({...n,method:"DELETE",url:e,data:t})}trace(e,t,n){let s=e;if(t&&Object.keys(t).length>0){const n=this.serializeParams(t);s+=e.includes("?")?`&${n}`:`?${n}`}return this.request({...n,method:"TRACE",url:s})}connect(e,t,n){return this.request({...n,method:"CONNECT",url:e,data:t})}};e.ReactiveEffect=x,e.attached=t=>Wt(e._instance,"attached",t),e.computed=function(e,t,n=!1){let s,i;return h(e)?s=e:(s=e.get,i=e.set),new lt(s,i,n)},e.createApp=t=>{if(!t)return App({});let n={};if("function"!=typeof t){const{setup:e,...s}=t;n=s,t=e}return t?App({...n,onLaunch(s){e.launchPromise=new Promise((async e=>{Ct(this);const i=await t.call(this,s);void 0!==i&&Object.keys(i).forEach((e=>{this[e]=i[e]})),zt(this,n,"onLaunch",s),Ct(null),e(!0)}))},onShow(e){zt(this,n,"onShow",e)},onHide(){zt(this,n,"onHide")},onError(e){zt(this,n,"onError",e)},onPageNotFound(e){zt(this,n,"onPageNotFound",e)},onUnhandledRejection(e){zt(this,n,"onUnhandledRejection",e)},onThemeChange(e){zt(this,n,"onThemeChange",e)}}):App(n)},e.createPinia=function(){const e=R(!0),t=e.run((()=>et({}))),n={install(){Bt(n)},scope:e,state:t,stores:{}};return n},e.createQuery=Vt,e.customRef=function(e){return new rt(e)},e.deepToRaw=It,e.deepWatch=qt,e.defineComponent=t=>{if(!t)return Component({});let n={};if("function"!=typeof t){const{setup:e,...s}=t;n=s,t=e}if(!t)return Component(n);let s=null;return n.properties&&(s=Object.keys(n.properties)),s&&s.forEach((e=>{void 0===n.observers&&(n.observers={});const t=n.observers[e];n.observers[e]=function(n){this.$props&&(this.$props[e]=n),void 0!==t&&t.call(this,n)}})),Component({...n,lifetimes:{attached(){e.launchPromise.then((()=>{Ct(this),this.$scope=R();const e={};s&&s.forEach((t=>{e[t]=this.data[t]})),this.$props=Qe(e),this.$context={emit:(e,...t)=>{this.triggerEvent(e,{value:t[0]})}},this.$scope.run((()=>{const e=t.call(this,this.$props,this.$context);if(void 0!==e){let t;Object.keys(e).forEach((n=>{const s=e[n];mt(s)?this[n]=s:(t=t||{},t[n]=It(s),qt.call(this,n,s))})),void 0!==t&&this.setData(t,Ut)}zt(this,n,"attached")})),Ct(null)}))},ready(){zt(this,n,"ready")},moved(){zt(this,n,"moved")},detached(){zt(this,n,"detached"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},error(e){zt(this,n,"error",e)}},pageLifetimes:{show(){zt(this,n,"show")},hide(){zt(this,n,"hide")},resize(e){zt(this,n,"resize",e)},routeDone(){zt(this,n,"routeDone")}}})},e.definePage=t=>{if(!t)return Page({});let n={};if("function"!=typeof t){const{setup:e,...s}=t;n=s||{},t=e}if(!t)return Page(n);const{queries:s,...i}=n;return Page({...i,onLoad(i){e.launchPromise.then((()=>{Ct(this),Qt(s),this.$scope=R(),this.$query=Vt(i,s),this.$context={},this.$scope.run((()=>{const e=t.call(this,this.$query,this.$context);if(void 0!==e){let t;Object.keys(e).forEach((n=>{const s=e[n];mt(s)?this[n]=s:(t=t||{},t[n]=It(s),qt.call(this,n,s))})),void 0!==t&&this.setData(t,Ut)}zt(this,n,"onLoad",i)})),Qt({}),Ct(null)}))},onShow(){zt(this,n,"onShow")},onReady(){zt(this,n,"onReady")},onHide(){zt(this,n,"onHide")},onUnload(){zt(this,n,"onUnload"),this.$scope&&this.$scope.stop(),Object.keys(this).forEach((e=>{try{/^$/.test(e)&&delete this[e]}catch(e){console.error("销毁异常",e)}}))},onRouteDone(){zt(this,n,"onRouteDone")},onPullDownRefresh(){zt(this,n,"onPullDownRefresh")},onReachBottom(){zt(this,n,"onReachBottom")},onPageScroll(e){zt(this,n,"onPageScroll",e)},onAddToFavorites(e){return Nt(this,n,"onAddToFavorites",e)},onShareAppMessage(e){return Nt(this,n,"onShareAppMessage",e)},onShareTimeline(){return Nt(this,n,"onShareTimeline")},onResize(e){zt(this,n,"onResize",e)},onTabItemTap(e){zt(this,n,"onTabItemTap",e)},onSaveExitState(){zt(this,n,"onSaveExitState")}})},e.defineStore=function(t,n,s){return function(i){if(i&&Bt(i),!(i=e.activePinia))throw new Error("no active pinia");return i.stores[t]||function(e,t,n,s){const i={},r=e.scope.run(n);Object.assign(i,r),e.stores[t]=i;const o="PINIA_"+t;s&&s.persist&&s.persist.forEach((n=>{const s=`${o}_${n}`,i=wx.getStorageSync(s),r=wx.getStorageInfoSync().keys.includes(s);e.stores[t][n]&&r&&(Ze(e.stores[t][n])?e.stores[t][n].value=i:Object.keys(i).forEach((s=>{e.stores[t][n][s]=i[s]}))),dt(Ze(e.stores[t][n])?e.stores[t][n]:()=>e.stores[t][n],(e=>{wx.setStorageSync(s,e)}),{deep:!0})}))}(i,t,n,s),i.stores[t]}},e.detached=t=>Wt(e._instance,"detached",t),e.effect=function(e,t){e.effect instanceof x&&(e=e.effect.fn);const n=new x(e);t&&i(n,t);try{n.run()}catch(e){throw n.stop(),e}const s=n.run.bind(n);return s.effect=n,s},e.effectScope=R,e.error=t=>Wt(e._instance,"error",t),e.getCurrentPage=()=>{const e=getCurrentPages();return e&&e[e.length-1]},e.getCurrentScope=E,e.hide=t=>Wt(e._instance,"hide",t),e.isProxy=Ke,e.isReactive=Fe,e.isReadonly=He,e.isRef=Ze,e.isShallow=Je,e.lifetimeEmit=zt,e.lifetimeEmitOnce=Nt,e.lifetimeOn=Wt,e.markRaw=function(e){return Object.isExtensible(e)&&((e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})})(e,"__v_skip",!0),e},e.moved=t=>Wt(e._instance,"moved",t),e.onAddToFavorites=t=>Wt(e._instance,"onAddToFavorites",t),e.onError=t=>Wt(e._instance,"onError",t),e.onHide=t=>Wt(e._instance,"onHide",t),e.onLaunch=t=>Wt(e._instance,"onLaunch",t),e.onLoad=t=>Wt(e._instance,"onLoad",t),e.onPageNotFound=t=>Wt(e._instance,"onPageNotFound",t),e.onPageScroll=t=>Wt(e._instance,"onPageScroll",t),e.onPullDownRefresh=t=>Wt(e._instance,"onPullDownRefresh",t),e.onReachBottom=t=>Wt(e._instance,"onReachBottom",t),e.onReady=t=>Wt(e._instance,"onReady",t),e.onResize=t=>Wt(e._instance,"onResize",t),e.onRouteDone=t=>Wt(e._instance,"onRouteDone",t),e.onSaveExitState=t=>Wt(e._instance,"onSaveExitState",t),e.onScopeDispose=function(e,t=!1){b&&b.cleanups.push(e)},e.onShareAppMessage=t=>Wt(e._instance,"onShareAppMessage",t),e.onShareTimeline=t=>Wt(e._instance,"onShareTimeline",t),e.onShow=t=>Wt(e._instance,"onShow",t),e.onTabItemTap=t=>Wt(e._instance,"onTabItemTap",t),e.onThemeChange=t=>Wt(e._instance,"onThemeChange",t),e.onUnhandledRejection=t=>Wt(e._instance,"onUnhandledRejection",t),e.onUnload=t=>Wt(e._instance,"onUnload",t),e.proxyRefs=function(e){return Fe(e)?e:new Proxy(e,it)},e.reactive=Me,e.readonly=Ve,e.ready=t=>Wt(e._instance,"ready",t),e.ref=et,e.request=Ft,e.resize=t=>Wt(e._instance,"resize",t),e.routeDone=t=>Wt(e._instance,"routeDone",t),e.setActivatePinia=Bt,e.setInstance=Ct,e.setQueries=Qt,e.shallowReactive=Qe,e.shallowReadonly=function(e){return Be(e,!0,ve,qe,We)},e.shallowRef=function(e){return tt(e,!0)},e.show=t=>Wt(e._instance,"show",t),e.stop=function(e){e.effect.stop()},e.storeToRefs=function(e){e=Ge(e);const t={};for(const n in e){const s=e[n];(Ze(s)||Fe(s))&&(t[n]=at(e,n))}return t},e.toRaw=Ge,e.toRef=at,e.toRefs=function(e){const t=a(e)?new Array(e.length):{};for(const n in e)t[n]=ut(e,n);return t},e.toValue=function(e){return h(e)?e():st(e)},e.triggerRef=function(e){e.dep.trigger()},e.unref=st,e.useInstance=()=>e._instance,e.useRoute=()=>{const t=getCurrentPages(),n=t[t.length-1];return{path:n.route,query:Vt(n.options,e._queries)}},e.useRouter=()=>({push:e=>{if("string"==typeof e)return wx.navigateTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.navigateTo({url:t,...e})},replace:e=>{if("string"==typeof e)return wx.redirectTo({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.redirectTo({url:t,...e})},go:e=>{if(!(e>0))return wx.navigateBack({delta:Math.abs(e)});console.warn("微信小程序不支持前进历史记录")},back:e=>wx.navigateBack(e),switchTab:e=>{if("string"==typeof e)return wx.switchTab({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.switchTab({url:t,...e})},reLaunch:e=>{if("string"==typeof e)return wx.reLaunch({url:e});let t;return t="path"in e?e.query?`${e.path}?${Mt(e.query)}`:e.path:e.url,wx.reLaunch({url:t,...e})}}),e.watch=function(e,t,n){return At(e,t,n)},e.watchEffect=function(e,t){return At(e,null,t)},e.watchPostEffect=function(e,t){return At(e,null,/* istanbul ignore next -- @preserve */{flush:"post"})},e.watchSyncEffect=function(e,t){return At(e,null,/* istanbul ignore next -- @preserve */{flush:"sync"})}})); |
+1
-1
| { | ||
| "name": "@52css/mp-vue3", | ||
| "version": "1.1.5", | ||
| "version": "1.1.6", | ||
| "description": "基于 Vue 3 的小程序框架:轻松构建高效应用", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -6,5 +6,5 @@ import { type PageInstance } from "./page"; | ||
| export declare function deepToRaw(x: unknown): unknown; | ||
| export declare function deepWatch(instance: Pick<WechatMiniprogram.Component.InstanceMethods<Record<string, unknown>>, "setData">, key: string, value: unknown): void; | ||
| export declare function deepWatch(this: Pick<WechatMiniprogram.Component.InstanceMethods<Record<string, unknown>>, "setData">, key: string, value: unknown): void; | ||
| export declare let _instance: PageInstance | ComponentInstance | AppInstance | null; | ||
| export declare const useInstance: () => PageInstance | ComponentInstance | AppInstance | null; | ||
| export declare const setInstance: (newInstance: PageInstance | ComponentInstance | AppInstance | null) => void; |
959677
0.02%788
0.13%