Files
xiaokuaisong-paotui/distribution/unpackage/cache/wgt/__UNI__2011CFE/app-service.js
2025-08-18 09:57:10 +08:00

2 lines
184 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

if("undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((n=>t.resolve(e()).then((()=>n))),(n=>t.resolve(e()).then((()=>{throw n}))))}),"undefined"!=typeof uni&&uni&&uni.requireGlobal){const e=uni.requireGlobal();ArrayBuffer=e.ArrayBuffer,Int8Array=e.Int8Array,Uint8Array=e.Uint8Array,Uint8ClampedArray=e.Uint8ClampedArray,Int16Array=e.Int16Array,Uint16Array=e.Uint16Array,Int32Array=e.Int32Array,Uint32Array=e.Uint32Array,Float32Array=e.Float32Array,Float64Array=e.Float64Array,BigInt64Array=e.BigInt64Array,BigUint64Array=e.BigUint64Array}uni.restoreGlobal&&uni.restoreGlobal(Vue,weex,plus,setTimeout,clearTimeout,setInterval,clearInterval),function(e){"use strict";function t(e,t,...n){uni.__log__?uni.__log__(e,t,...n):console[e].apply(console,[...n,t])}function n(e,t){return"string"==typeof e?t:e}const s=(t=>(n,s=e.getCurrentInstance())=>{!e.isInSSRComponentSetup&&e.injectHook(t,n,s)})("onShow"),o=[{font_class:"arrow-down",unicode:""},{font_class:"arrow-left",unicode:""},{font_class:"arrow-right",unicode:""},{font_class:"arrow-up",unicode:""},{font_class:"auth",unicode:""},{font_class:"auth-filled",unicode:""},{font_class:"back",unicode:""},{font_class:"bars",unicode:""},{font_class:"calendar",unicode:""},{font_class:"calendar-filled",unicode:""},{font_class:"camera",unicode:""},{font_class:"camera-filled",unicode:""},{font_class:"cart",unicode:""},{font_class:"cart-filled",unicode:""},{font_class:"chat",unicode:""},{font_class:"chat-filled",unicode:""},{font_class:"chatboxes",unicode:""},{font_class:"chatboxes-filled",unicode:""},{font_class:"chatbubble",unicode:""},{font_class:"chatbubble-filled",unicode:""},{font_class:"checkbox",unicode:""},{font_class:"checkbox-filled",unicode:""},{font_class:"checkmarkempty",unicode:""},{font_class:"circle",unicode:""},{font_class:"circle-filled",unicode:""},{font_class:"clear",unicode:""},{font_class:"close",unicode:""},{font_class:"closeempty",unicode:""},{font_class:"cloud-download",unicode:""},{font_class:"cloud-download-filled",unicode:""},{font_class:"cloud-upload",unicode:""},{font_class:"cloud-upload-filled",unicode:""},{font_class:"color",unicode:""},{font_class:"color-filled",unicode:""},{font_class:"compose",unicode:""},{font_class:"contact",unicode:""},{font_class:"contact-filled",unicode:""},{font_class:"down",unicode:""},{font_class:"bottom",unicode:""},{font_class:"download",unicode:""},{font_class:"download-filled",unicode:""},{font_class:"email",unicode:""},{font_class:"email-filled",unicode:""},{font_class:"eye",unicode:""},{font_class:"eye-filled",unicode:""},{font_class:"eye-slash",unicode:""},{font_class:"eye-slash-filled",unicode:""},{font_class:"fire",unicode:""},{font_class:"fire-filled",unicode:""},{font_class:"flag",unicode:""},{font_class:"flag-filled",unicode:""},{font_class:"folder-add",unicode:""},{font_class:"folder-add-filled",unicode:""},{font_class:"font",unicode:""},{font_class:"forward",unicode:""},{font_class:"gear",unicode:""},{font_class:"gear-filled",unicode:""},{font_class:"gift",unicode:""},{font_class:"gift-filled",unicode:""},{font_class:"hand-down",unicode:""},{font_class:"hand-down-filled",unicode:""},{font_class:"hand-up",unicode:""},{font_class:"hand-up-filled",unicode:""},{font_class:"headphones",unicode:""},{font_class:"heart",unicode:""},{font_class:"heart-filled",unicode:""},{font_class:"help",unicode:""},{font_class:"help-filled",unicode:""},{font_class:"home",unicode:""},{font_class:"home-filled",unicode:""},{font_class:"image",unicode:""},{font_class:"image-filled",unicode:""},{font_class:"images",unicode:""},{font_class:"images-filled",unicode:""},{font_class:"info",unicode:""},{font_class:"info-filled",unicode:""},{font_class:"left",unicode:""},{font_class:"link",unicode:""},{font_class:"list",unicode:""},{font_class:"location",unicode:""},{font_class:"location-filled",unicode:""},{font_class:"locked",unicode:""},{font_class:"locked-filled",unicode:""},{font_class:"loop",unicode:""},{font_class:"mail-open",unicode:""},{font_class:"mail-open-filled",unicode:""},{font_class:"map",unicode:""},{font_class:"map-filled",unicode:""},{font_class:"map-pin",unicode:""},{font_class:"map-pin-ellipse",unicode:""},{font_class:"medal",unicode:""},{font_class:"medal-filled",unicode:""},{font_class:"mic",unicode:""},{font_class:"mic-filled",unicode:""},{font_class:"micoff",unicode:""},{font_class:"micoff-filled",unicode:""},{font_class:"minus",unicode:""},{font_class:"minus-filled",unicode:""},{font_class:"more",unicode:""},{font_class:"more-filled",unicode:""},{font_class:"navigate",unicode:""},{font_class:"navigate-filled",unicode:""},{font_class:"notification",unicode:""},{font_class:"notification-filled",unicode:""},{font_class:"paperclip",unicode:""},{font_class:"paperplane",unicode:""},{font_class:"paperplane-filled",unicode:""},{font_class:"person",unicode:""},{font_class:"person-filled",unicode:""},{font_class:"personadd",unicode:""},{font_class:"personadd-filled",unicode:""},{font_class:"personadd-filled-copy",unicode:""},{font_class:"phone",unicode:""},{font_class:"phone-filled",unicode:""},{font_class:"plus",unicode:""},{font_class:"plus-filled",unicode:""},{font_class:"plusempty",unicode:""},{font_class:"pulldown",unicode:""},{font_class:"pyq",unicode:""},{font_class:"qq",unicode:""},{font_class:"redo",unicode:""},{font_class:"redo-filled",unicode:""},{font_class:"refresh",unicode:""},{font_class:"refresh-filled",unicode:""},{font_class:"refreshempty",unicode:""},{font_class:"reload",unicode:""},{font_class:"right",unicode:""},{font_class:"scan",unicode:""},{font_class:"search",unicode:""},{font_class:"settings",unicode:""},{font_class:"settings-filled",unicode:""},{font_class:"shop",unicode:""},{font_class:"shop-filled",unicode:""},{font_class:"smallcircle",unicode:""},{font_class:"smallcircle-filled",unicode:""},{font_class:"sound",unicode:""},{font_class:"sound-filled",unicode:""},{font_class:"spinner-cycle",unicode:""},{font_class:"staff",unicode:""},{font_class:"staff-filled",unicode:""},{font_class:"star",unicode:""},{font_class:"star-filled",unicode:""},{font_class:"starhalf",unicode:""},{font_class:"trash",unicode:""},{font_class:"trash-filled",unicode:""},{font_class:"tune",unicode:""},{font_class:"tune-filled",unicode:""},{font_class:"undo",unicode:""},{font_class:"undo-filled",unicode:""},{font_class:"up",unicode:""},{font_class:"top",unicode:""},{font_class:"upload",unicode:""},{font_class:"upload-filled",unicode:""},{font_class:"videocam",unicode:""},{font_class:"videocam-filled",unicode:""},{font_class:"vip",unicode:""},{font_class:"vip-filled",unicode:""},{font_class:"wallet",unicode:""},{font_class:"wallet-filled",unicode:""},{font_class:"weibo",unicode:""},{font_class:"weixin",unicode:""}],i=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n};const a=i({name:"UniIcons",emits:["click"],props:{type:{type:String,default:""},color:{type:String,default:"#333333"},size:{type:[Number,String],default:16},customPrefix:{type:String,default:""},fontFamily:{type:String,default:""}},data:()=>({icons:o}),computed:{unicode(){let e=this.icons.find((e=>e.font_class===this.type));return e?e.unicode:""},iconSize(){return"number"==typeof(e=this.size)||/^[0-9]*$/g.test(e)?e+"px":e;var e},styleObj(){return""!==this.fontFamily?`color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`:`color: ${this.color}; font-size: ${this.iconSize};`}},methods:{_onClick(){this.$emit("click")}}},[["render",function(t,n,s,o,i,a){return e.openBlock(),e.createElementBlock("text",{style:e.normalizeStyle(a.styleObj),class:e.normalizeClass(["uni-icons",["uniui-"+s.type,s.customPrefix,s.customPrefix?s.type:""]]),onClick:n[0]||(n[0]=(...e)=>a._onClick&&a._onClick(...e))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],6)}],["__scopeId","data-v-5610c8db"]]);const r=i({name:"UniNoticeBar",emits:["click","getmore","close"],props:{text:{type:String,default:""},moreText:{type:String,default:""},backgroundColor:{type:String,default:"#FFF9EA"},speed:{type:Number,default:100},color:{type:String,default:"#FF9A43"},fontSize:{type:Number,default:14},moreColor:{type:String,default:"#FF9A43"},single:{type:[Boolean,String],default:!1},scrollable:{type:[Boolean,String],default:!1},showIcon:{type:[Boolean,String],default:!1},showGetMore:{type:[Boolean,String],default:!1},showClose:{type:[Boolean,String],default:!1}},data:()=>({textWidth:0,boxWidth:0,wrapWidth:"",webviewHide:!1,elId:`Uni_${Math.ceil(1e6*Math.random()).toString(36)}`,elIdBox:`Uni_${Math.ceil(1e6*Math.random()).toString(36)}`,show:!0,animationDuration:"none",animationPlayState:"paused",animationDelay:"0s"}),watch:{text:function(e,t){this.initSize()}},computed:{isShowGetMore(){return!0===this.showGetMore||"true"===this.showGetMore},isShowClose(){return!(!0!==this.showClose&&"true"!==this.showClose||!1!==this.showGetMore&&"false"!==this.showGetMore)}},mounted(){var e=getCurrentPages(),t=e[e.length-1].$getAppWebview();t.addEventListener("hide",(()=>{this.webviewHide=!0})),t.addEventListener("show",(()=>{this.webviewHide=!1})),this.$nextTick((()=>{this.initSize()}))},methods:{initSize(){if(this.scrollable){let e=[],t=new Promise(((e,t)=>{uni.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((t=>{this.textWidth=t[0].width,e()}))})),n=new Promise(((e,t)=>{uni.createSelectorQuery().in(this).select(`#${this.elIdBox}`).boundingClientRect().exec((t=>{this.boxWidth=t[0].width,e()}))}));e.push(t),e.push(n),Promise.all(e).then((()=>{this.animationDuration=this.textWidth/this.speed+"s",this.animationDelay=`-${this.boxWidth/this.speed}s`,setTimeout((()=>{this.animationPlayState="running"}),1e3)}))}},loopAnimation(){},clickMore(){this.$emit("getmore")},close(){this.show=!1,this.$emit("close")},onClick(){this.$emit("click")}}},[["render",function(t,s,o,i,r,l){const c=n(e.resolveDynamicComponent("uni-icons"),a);return r.show?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-noticebar",style:e.normalizeStyle({backgroundColor:o.backgroundColor}),onClick:s[1]||(s[1]=(...e)=>l.onClick&&l.onClick(...e))},[!0===o.showIcon||"true"===o.showIcon?(e.openBlock(),e.createBlock(c,{key:0,class:"uni-noticebar-icon",type:"sound",color:o.color,size:1.5*o.fontSize},null,8,["color","size"])):e.createCommentVNode("",!0),e.createElementVNode("view",{ref:"textBox",class:e.normalizeClass(["uni-noticebar__content-wrapper",{"uni-noticebar__content-wrapper--scrollable":o.scrollable,"uni-noticebar__content-wrapper--single":!o.scrollable&&(o.single||o.moreText)}]),style:e.normalizeStyle({height:o.scrollable?1.5*o.fontSize+"px":"auto"})},[e.createElementVNode("view",{id:r.elIdBox,class:e.normalizeClass(["uni-noticebar__content",{"uni-noticebar__content--scrollable":o.scrollable,"uni-noticebar__content--single":!o.scrollable&&(o.single||o.moreText)}])},[e.createElementVNode("text",{id:r.elId,ref:"animationEle",class:e.normalizeClass(["uni-noticebar__content-text",{"uni-noticebar__content-text--scrollable":o.scrollable,"uni-noticebar__content-text--single":!o.scrollable&&(o.single||o.showGetMore)}]),style:e.normalizeStyle({color:o.color,fontSize:o.fontSize+"px",lineHeight:1.5*o.fontSize+"px",width:r.wrapWidth+"px",animationDuration:r.animationDuration,"-webkit-animationDuration":r.animationDuration,animationPlayState:r.webviewHide?"paused":r.animationPlayState,"-webkit-animationPlayState":r.webviewHide?"paused":r.animationPlayState,animationDelay:r.animationDelay,"-webkit-animationDelay":r.animationDelay})},e.toDisplayString(o.text),15,["id"])],10,["id"])],6),l.isShowGetMore?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-noticebar__more uni-cursor-point",onClick:s[0]||(s[0]=(...e)=>l.clickMore&&l.clickMore(...e))},[o.moreText.length>0?(e.openBlock(),e.createElementBlock("text",{key:0,style:e.normalizeStyle({color:o.moreColor,fontSize:o.fontSize+"px"})},e.toDisplayString(o.moreText),5)):(e.openBlock(),e.createBlock(c,{key:1,type:"right",color:o.moreColor,size:1.1*o.fontSize},null,8,["color","size"]))])):e.createCommentVNode("",!0),l.isShowClose?(e.openBlock(),e.createElementBlock("view",{key:2,class:"uni-noticebar-close uni-cursor-point"},[e.createVNode(c,{type:"closeempty",color:o.color,size:1.1*o.fontSize,onClick:l.close},null,8,["color","size","onClick"])])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)}],["__scopeId","data-v-a43ccb02"]]);class l{constructor(e,t){this.options=e,this.animation=uni.createAnimation({...e}),this.currentStepAnimates={},this.next=0,this.$=t}_nvuePushAnimates(e,t){let n=this.currentStepAnimates[this.next],s={};if(s=n||{styles:{},config:{}},c.includes(e)){s.styles.transform||(s.styles.transform="");let n="";"rotate"===e&&(n="deg"),s.styles.transform+=`${e}(${t+n}) `}else s.styles[e]=`${t}`;this.currentStepAnimates[this.next]=s}_animateRun(e={},t={}){let n=this.$.$refs.ani.ref;if(n)return new Promise(((s,o)=>{nvueAnimation.transition(n,{styles:e,...t},(e=>{s()}))}))}_nvueNextAnimate(e,t=0,n){let s=e[t];if(s){let{styles:o,config:i}=s;this._animateRun(o,i).then((()=>{t+=1,this._nvueNextAnimate(e,t,n)}))}else this.currentStepAnimates={},"function"==typeof n&&n(),this.isEnd=!0}step(e={}){return this.animation.step(e),this}run(e){this.$.animationData=this.animation.export(),this.$.timer=setTimeout((()=>{"function"==typeof e&&e()}),this.$.durationTime)}}const c=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function d(e,t){if(t)return clearTimeout(t.timer),new l(e,t)}c.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((e=>{l.prototype[e]=function(...t){return this.animation[e](...t),this}}));const u=i({name:"uniTransition",emits:["click","change"],props:{show:{type:Boolean,default:!1},modeClass:{type:[Array,String],default:()=>"fade"},duration:{type:Number,default:300},styles:{type:Object,default:()=>({})},customClass:{type:String,default:""},onceRender:{type:Boolean,default:!1}},data:()=>({isShow:!1,transform:"",opacity:1,animationData:{},durationTime:300,config:{}}),watch:{show:{handler(e){e?this.open():this.isShow&&this.close()},immediate:!0}},computed:{stylesObject(){let e={...this.styles,"transition-duration":this.duration/1e3+"s"},t="";for(let n in e){t+=this.toLine(n)+":"+e[n]+";"}return t},transformStyles(){return"transform:"+this.transform+";opacity:"+this.opacity+";"+this.stylesObject}},created(){this.config={duration:this.duration,timingFunction:"ease",transformOrigin:"50% 50%",delay:0},this.durationTime=this.duration},methods:{init(e={}){e.duration&&(this.durationTime=e.duration),this.animation=d(Object.assign(this.config,e),this)},onClick(){this.$emit("click",{detail:this.isShow})},step(e,n={}){if(this.animation){for(let n in e)try{"object"==typeof e[n]?this.animation[n](...e[n]):this.animation[n](e[n])}catch(Ve){t("error","at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148",`方法 ${n} 不存在`)}return this.animation.step(n),this}},run(e){this.animation&&this.animation.run(e)},open(){clearTimeout(this.timer),this.transform="",this.isShow=!0;let{opacity:e,transform:t}=this.styleInit(!1);void 0!==e&&(this.opacity=e),this.transform=t,this.$nextTick((()=>{this.timer=setTimeout((()=>{this.animation=d(this.config,this),this.tranfromInit(!1).step(),this.animation.run(),this.$emit("change",{detail:this.isShow})}),20)}))},close(e){this.animation&&this.tranfromInit(!0).step().run((()=>{this.isShow=!1,this.animationData=null,this.animation=null;let{opacity:e,transform:t}=this.styleInit(!1);this.opacity=e||1,this.transform=t,this.$emit("change",{detail:this.isShow})}))},styleInit(e){let t={transform:""},n=(e,n)=>{"fade"===n?t.opacity=this.animationType(e)[n]:t.transform+=this.animationType(e)[n]+" "};return"string"==typeof this.modeClass?n(e,this.modeClass):this.modeClass.forEach((t=>{n(e,t)})),t},tranfromInit(e){let t=(e,t)=>{let n=null;"fade"===t?n=e?0:1:(n=e?"-100%":"0","zoom-in"===t&&(n=e?.8:1),"zoom-out"===t&&(n=e?1.2:1),"slide-right"===t&&(n=e?"100%":"0"),"slide-bottom"===t&&(n=e?"100%":"0")),this.animation[this.animationMode()[t]](n)};return"string"==typeof this.modeClass?t(e,this.modeClass):this.modeClass.forEach((n=>{t(e,n)})),this.animation},animationType:e=>({fade:e?0:1,"slide-top":`translateY(${e?"0":"-100%"})`,"slide-right":`translateX(${e?"0":"100%"})`,"slide-bottom":`translateY(${e?"0":"100%"})`,"slide-left":`translateX(${e?"0":"-100%"})`,"zoom-in":`scaleX(${e?1:.8}) scaleY(${e?1:.8})`,"zoom-out":`scaleX(${e?1:1.2}) scaleY(${e?1:1.2})`}),animationMode:()=>({fade:"opacity","slide-top":"translateY","slide-right":"translateX","slide-bottom":"translateY","slide-left":"translateX","zoom-in":"scale","zoom-out":"scale"}),toLine:e=>e.replace(/([A-Z])/g,"-$1").toLowerCase()}},[["render",function(t,n,s,o,i,a){return e.withDirectives((e.openBlock(),e.createElementBlock("view",{ref:"ani",animation:i.animationData,class:e.normalizeClass(s.customClass),style:e.normalizeStyle(a.transformStyles),onClick:n[0]||(n[0]=(...e)=>a.onClick&&a.onClick(...e))},[e.renderSlot(t.$slots,"default")],14,["animation"])),[[e.vShow,i.isShow]])}]]),h={name:"uniPopup",components:{},emits:["change","maskClick"],props:{animation:{type:Boolean,default:!0},type:{type:String,default:"center"},isMaskClick:{type:Boolean,default:null},maskClick:{type:Boolean,default:null},backgroundColor:{type:String,default:"none"},safeArea:{type:Boolean,default:!0},maskBackgroundColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},borderRadius:{type:String}},watch:{type:{handler:function(e){this.config[e]&&this[this.config[e]](!0)},immediate:!0},isDesktop:{handler:function(e){this.config[e]&&this[this.config[this.type]](!0)},immediate:!0},maskClick:{handler:function(e){this.mkclick=e},immediate:!0},isMaskClick:{handler:function(e){this.mkclick=e},immediate:!0},showPopup(e){}},data(){return{duration:300,ani:[],showPopup:!1,showTrans:!1,popupWidth:0,popupHeight:0,config:{top:"top",bottom:"bottom",center:"center",left:"left",right:"right",message:"top",dialog:"center",share:"bottom"},maskClass:{position:"fixed",bottom:0,top:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.4)"},transClass:{backgroundColor:"transparent",borderRadius:this.borderRadius||"0",position:"fixed",left:0,right:0},maskShow:!0,mkclick:!0,popupstyle:"top"}},computed:{getStyles(){let e={backgroundColor:this.bg};return this.borderRadius,e=Object.assign(e,{borderRadius:this.borderRadius}),e},isDesktop(){return this.popupWidth>=500&&this.popupHeight>=500},bg(){return""===this.backgroundColor||"none"===this.backgroundColor?"transparent":this.backgroundColor}},mounted(){(()=>{const{windowWidth:e,windowHeight:t,windowTop:n,safeArea:s,screenHeight:o,safeAreaInsets:i}=uni.getSystemInfoSync();this.popupWidth=e,this.popupHeight=t+(n||0),s&&this.safeArea?this.safeAreaInsets=i.bottom:this.safeAreaInsets=0})()},unmounted(){this.setH5Visible()},activated(){this.setH5Visible(!this.showPopup)},deactivated(){this.setH5Visible(!0)},created(){null===this.isMaskClick&&null===this.maskClick?this.mkclick=!0:this.mkclick=null!==this.isMaskClick?this.isMaskClick:this.maskClick,this.animation?this.duration=300:this.duration=0,this.messageChild=null,this.clearPropagation=!1,this.maskClass.backgroundColor=this.maskBackgroundColor},methods:{setH5Visible(e=!0){},closeMask(){this.maskShow=!1},disableMask(){this.mkclick=!1},clear(e){e.stopPropagation(),this.clearPropagation=!0},open(e){if(this.showPopup)return;e&&-1!==["top","center","bottom","left","right","message","dialog","share"].indexOf(e)||(e=this.type),this.config[e]?(this[this.config[e]](),this.$emit("change",{show:!0,type:e})):t("error","at uni_modules/uni-popup/components/uni-popup/uni-popup.vue:310","缺少类型:",e)},close(e){this.showTrans=!1,this.$emit("change",{show:!1,type:this.type}),clearTimeout(this.timer),this.timer=setTimeout((()=>{this.showPopup=!1}),300)},touchstart(){this.clearPropagation=!1},onTap(){this.clearPropagation?this.clearPropagation=!1:(this.$emit("maskClick"),this.mkclick&&this.close())},top(e){this.popupstyle=this.isDesktop?"fixforpc-top":"top",this.ani=["slide-top"],this.transClass={position:"fixed",left:0,right:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},e||(this.showPopup=!0,this.showTrans=!0,this.$nextTick((()=>{this.showPoptrans(),this.messageChild&&"message"===this.type&&this.messageChild.timerClose()})))},bottom(e){this.popupstyle="bottom",this.ani=["slide-bottom"],this.transClass={position:"fixed",left:0,right:0,bottom:0,paddingBottom:this.safeAreaInsets+"px",backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},e||this.showPoptrans()},center(e){this.popupstyle="center",this.ani=["zoom-out","fade"],this.transClass={position:"fixed",display:"flex",flexDirection:"column",bottom:0,left:0,right:0,top:0,justifyContent:"center",alignItems:"center",borderRadius:this.borderRadius||"0"},e||this.showPoptrans()},left(e){this.popupstyle="left",this.ani=["slide-left"],this.transClass={position:"fixed",left:0,bottom:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},e||this.showPoptrans()},right(e){this.popupstyle="right",this.ani=["slide-right"],this.transClass={position:"fixed",bottom:0,right:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},e||this.showPoptrans()},showPoptrans(){this.$nextTick((()=>{this.showPopup=!0,this.showTrans=!0}))}}};const p=i(h,[["render",function(t,s,o,i,a,r){const l=n(e.resolveDynamicComponent("uni-transition"),u);return a.showPopup?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass(["uni-popup",[a.popupstyle,r.isDesktop?"fixforpc-z-index":""]])},[e.createElementVNode("view",{onTouchstart:s[1]||(s[1]=(...e)=>r.touchstart&&r.touchstart(...e))},[a.maskShow?(e.openBlock(),e.createBlock(l,{key:"1",name:"mask","mode-class":"fade",styles:a.maskClass,duration:a.duration,show:a.showTrans,onClick:r.onTap},null,8,["styles","duration","show","onClick"])):e.createCommentVNode("",!0),e.createVNode(l,{key:"2","mode-class":a.ani,name:"content",styles:a.transClass,duration:a.duration,show:a.showTrans,onClick:r.onTap},{default:e.withCtx((()=>[e.createElementVNode("view",{class:e.normalizeClass(["uni-popup__wrapper",[a.popupstyle]]),style:e.normalizeStyle(r.getStyles),onClick:s[0]||(s[0]=(...e)=>r.clear&&r.clear(...e))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],6)])),_:3},8,["mode-class","styles","duration","show","onClick"])],32)],2)):e.createCommentVNode("",!0)}],["__scopeId","data-v-73d3b141"]]),m="https://xiaokuaisong.shop",f={__name:"index",setup(o){const i=e.ref(uni.getStorageSync("currentUser.distributionScope")),l=e.ref(0),c=[{name:"待抢单"},{name:"待取货"},{name:"待送达"}],d=e=>{h.value=e},u=e.ref("center"),h=e.ref(0),f=e.ref(null),g=e.ref(null),y=e.ref(["1公寓","2公寓","3公寓","4公寓","5公寓","6公寓","7公寓","8公寓","9公寓","10公寓","11公寓","12公寓","育才大厦"]);e.ref(0);const v=e.ref(["考核时间从多到少","运单金额从高到低","配送距离从近到远","取货距离从近到远","推荐排序"]),w=e.ref(["新单置顶","已抢商户置顶"]),_=e=>{t("log","at pages/index/index.vue:223","当前模式:"+e.type+",状态:"+e.show)},k=()=>{uni.navigateTo({url:"/pages/map/map"})},b=e=>{t("log","at pages/index/index.vue:243","picker发送选择改变携带值为",e.detail.value);const n=y.value[e.detail.value];i.value=n;const s={distributionScope:n,errandName:C.value.errandName,errandPhone:C.value.errandPhone,gender:C.value.gender,id:C.value.id,state:C.value.state};uni.request({url:m+"/api/errand/update/my",method:"POST",data:s,header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success(e){t("log","at pages/index/index.vue:267","配送范围更新成功:",e),t("log","at pages/index/index.vue:268",e.data.code),50001===e.data.code?uni.showToast({title:"还有未送达订单",icon:"fail"}):0===e.data.code&&(uni.showToast({title:"配送范围已更新",icon:"success"}),x())},fail(e){t("error","at pages/index/index.vue:285","配送范围更新失败:",e),uni.showToast({title:"更新失败,请重试",icon:"none"})}})},S=e=>{f.value=e},x=()=>{const e=[1,2,3][l.value]||1;N(e)};e.onMounted((()=>{N(1)}));let E=e.ref([]);const N=e=>{if("number"!=typeof e||isNaN(e))return void t("error","at pages/index/index.vue:318","Invalid errandState value:",e);const n=`errandState=${encodeURIComponent(e.toString())}`;uni.request({url:m+"/api/errand/list/order",method:"POST",header:{"Content-Type":"application/x-www-form-urlencoded",cookie:uni.getStorageSync("cookie")||""},data:n,success(e){t("log","at pages/index/index.vue:334","请求成功:",e),0!==e.data.code?uni.showToast({title:`请求失败:${e.data.message}`,icon:"none"}):(t("log","at pages/index/index.vue:342",e.data.data),E.value=e.data.data,t("log","at pages/index/index.vue:344","Updated errandOrder:",E.value))},fail(e){t("log","at pages/index/index.vue:348","请求失败:",e)}})};let C=e.ref({});const T=()=>{uni.request({url:m+"/api/errand/get/current",method:"POST",header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")},success(e){if(t("log","at pages/index/index.vue:485",e),0===e.data.code){const n=e.data.data;C.value=n,y.value.includes(n.distributionScope)?i.value=n.distributionScope:t("warn","at pages/index/index.vue:493","用户的配送范围不在预设的选项中")}},fail(e){t("error","at pages/index/index.vue:499","请求失败:",e)}})};e.onMounted((()=>{N(1),T()})),s((()=>{T(),N(1)}));const P=e=>e?e.slice(5,10)+" "+e.slice(11,19):"";return uni.$on("refresh-delivery-list",(()=>{this.robOrder(3)})),(s,o)=>{const C=n(e.resolveDynamicComponent("uni-notice-bar"),r),T=n(e.resolveDynamicComponent("uni-icons"),a),I=n(e.resolveDynamicComponent("uni-popup"),p);return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("view",{class:"tab-menu"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,((t,n)=>e.createElementVNode("view",{key:t.name,class:e.normalizeClass(["tab-item",{active:l.value===n}]),onClick:e=>(e=>{l.value=e;const t=[1,2,3];e>=0&&e<t.length&&N(t[e])})(n)},e.toDisplayString(t.name),11,["onClick"]))),64))]),e.createVNode(C,{"show-icon":"",scrollable:"",text:"今日放假"}),e.createElementVNode("view",{class:"content"},[0===l.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(E),((n,s)=>{var o;return e.openBlock(),e.createElementBlock("view",{class:"order-card",key:s},[e.createElementVNode("view",{class:"delivery-info"},[e.createElementVNode("view",{class:"time-id"},"#"+e.toDisplayString(n.id),1),e.createElementVNode("view",{class:"price"},"¥1.7")]),e.createElementVNode("view",{class:"delivery-info"},[e.createElementVNode("view",{class:"time"},e.toDisplayString(P(n.pickupEndTime))+"内送达",1)]),e.createElementVNode("view",{class:"address-info"},[e.createElementVNode("view",{class:"address-item"},[e.createElementVNode("view",{class:"circle"},"取"),e.createElementVNode("view",{class:"distance"},"1km"),e.createElementVNode("view",{class:"address-name"},e.toDisplayString(n.address)+"·"+e.toDisplayString(null==(o=n.businessVO)?void 0:o.businessName),1)]),e.createElementVNode("view",{class:"address-item"},[e.createElementVNode("view",{class:"circle"},"送"),e.createElementVNode("view",{class:"distance"},"1.5km"),e.createElementVNode("view",{class:"address-name"},e.toDisplayString(n.location),1)])]),e.createElementVNode("view",{class:"button-container"},[e.createElementVNode("view",{class:"order-button",onClick:e=>{return t("log","at pages/index/index.vue:354",s=n.id),void uni.request({url:m+"/api/errand/get/order",method:"POST",data:{id:s},header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success:e=>{t("log","at pages/index/index.vue:366",e),0===e.data.code?uni.showToast({title:"抢单成功",icon:"success",success:()=>{const e=[1,2,3][l.value];N(e),0===l.value&&N(2)}}):uni.showToast({title:e.data.message||"抢单失败",icon:"none"})},fail:e=>{t("log","at pages/index/index.vue:391",e),uni.showToast({title:"网络错误,请重试",icon:"none"})}});var s}},"抢单",8,["onClick"])])])})),128)):e.createCommentVNode("",!0),1===l.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(E),((n,s)=>{var o;return e.openBlock(),e.createElementBlock("view",{class:"order-card",key:s,onClick:e.withModifiers((e=>(e=>{uni.setStorageSync("orderDetail",e),uni.navigateTo({url:"/pages/orderDetail/orderDetail"})})(n)),["stop"])},[e.createElementVNode("view",{class:"delivery-info"},[e.createElementVNode("view",{class:"time-id"},"#"+e.toDisplayString(n.id),1),e.createElementVNode("view",{class:"price"},"¥1.7")]),e.createElementVNode("view",{class:"delivery-info"},[e.createElementVNode("view",{class:"time"},e.toDisplayString(P(n.pickupEndTime))+"内送达",1)]),e.createElementVNode("view",{class:"address-info"},[e.createElementVNode("view",{class:"address-item"},[e.createElementVNode("view",{class:"circle"},"取"),e.createElementVNode("view",{class:"distance"},"1km"),e.createElementVNode("view",{class:"address-name"},e.toDisplayString(n.address)+"·"+e.toDisplayString(null==(o=n.businessVO)?void 0:o.businessName),1)]),e.createElementVNode("view",{class:"address-item"},[e.createElementVNode("view",{class:"circle"},"送"),e.createElementVNode("view",{class:"distance"},"1.5km"),e.createElementVNode("view",{class:"address-name"},e.toDisplayString(n.location),1)])]),e.createElementVNode("view",{class:"button-container",onClick:e.withModifiers((e=>{return s=n.id,void uni.request({url:m+"/api/errand/update/state",method:"POST",data:{errandsState:3,orderId:s},header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success:e=>{t("log","at pages/index/index.vue:413",e),0===e.data.code?uni.showToast({title:"取货成功",icon:"success",success:()=>{N(2),N(3)}}):uni.showToast({title:e.data.description||"取货失败",icon:"none"})},fail:e=>{t("log","at pages/index/index.vue:433",e),uni.showToast({title:"网络异常,请检查连接",icon:"none"})}});var s}),["stop"])},[e.createElementVNode("view",{class:"order-button"},"确认取货")],8,["onClick"])],8,["onClick"])})),128)):e.createCommentVNode("",!0),2===l.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(e.unref(E),((n,s)=>{var o;return e.openBlock(),e.createElementBlock("view",{class:"order-card",key:s,onClick:e.withModifiers((e=>(e=>{t("log","at pages/index/index.vue:521","4567845678945678900"),t("log","at pages/index/index.vue:522",e),uni.setStorageSync("orderDetail",e),uni.navigateTo({url:"/pages/deliveryDetail/deliveryDetail"})})(n)),["stop"])},[e.createElementVNode("view",{class:"delivery-info"},[e.createElementVNode("view",{class:"time-id"},"#"+e.toDisplayString(n.id),1),e.createElementVNode("view",{class:"price"},"¥1.7")]),e.createElementVNode("view",{class:"delivery-info"},[e.createElementVNode("view",{class:"time"},e.toDisplayString(P(n.pickupEndTime))+"内送达",1)]),e.createElementVNode("view",{class:"address-info"},[e.createElementVNode("view",{class:"address-item"},[e.createElementVNode("view",{class:"circle"},"取"),e.createElementVNode("view",{class:"distance"},"1km"),e.createElementVNode("view",{class:"address-name"},e.toDisplayString(n.address)+"·"+e.toDisplayString(null==(o=n.businessVO)?void 0:o.businessName),1)]),e.createElementVNode("view",{class:"address-item"},[e.createElementVNode("view",{class:"circle"},"送"),e.createElementVNode("view",{class:"distance"},"1.5km"),e.createElementVNode("view",{class:"address-name"},e.toDisplayString(n.location),1)])]),e.createElementVNode("view",{class:"button-container"},[e.createElementVNode("view",{class:"order-button"},"确认送达")])],8,["onClick"])})),128)):e.createCommentVNode("",!0)]),e.createElementVNode("view",{class:"fixed-buttons"},[e.createElementVNode("view",{class:"button-container",onClick:o[0]||(o[0]=e=>{return t="bottom",u.value=t,void g.value.open(t);var t})},[e.createVNode(T,{type:"gear-filled",size:"24"}),e.createElementVNode("text",{class:"fixed-font"},"跑单设置")]),e.createElementVNode("view",{class:"button-container",onClick:k},[e.createVNode(T,{type:"location-filled",size:"24"}),e.createElementVNode("text",{class:"fixed-font"},"配送范围")]),e.createElementVNode("button",{onClick:x,class:"refresh-button"},"刷新订单")]),e.createVNode(I,{ref_key:"popupRef",ref:g,"background-color":"#fff",onChange:_},{default:e.withCtx((()=>[e.createElementVNode("view",{class:e.normalizeClass(["popup-content",{"popup-height":"left"===u.value||"right"===u.value}])},[e.createElementVNode("view",{class:"modal-header"},[e.createElementVNode("button",{class:e.normalizeClass(["tab-button",{active:0===h.value}]),onClick:o[1]||(o[1]=e=>d(0))},"跑单设置",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-button",{active:1===h.value}]),onClick:o[2]||(o[2]=e=>d(1))},"运单排序",2)]),e.createElementVNode("view",{class:"modal-body"},[0===h.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",{class:"modal-item"},[e.createElementVNode("text",{class:"modal-label"},"配送区域"),e.createElementVNode("picker",{value:y.value.indexOf(i.value.value),range:y.value,onChange:b,class:"modal-value"},[e.createElementVNode("view",null,e.toDisplayString(i.value.value||"修改配送区域"),1)],40,["value","range"])]),e.createElementVNode("view",{class:"modal-item"},[e.createElementVNode("text",{class:"modal-label"},"同时接单量"),e.createElementVNode("text",{class:"modal-value"},"15个")])])):e.createCommentVNode("",!0),1===h.value?(e.openBlock(),e.createElementBlock("view",{key:1},[e.createElementVNode("view",{class:"modal-item"},[e.createElementVNode("text",{class:"modal-label"},"智能排序"),e.createElementVNode("view",{class:"modal-value"},[e.createElementVNode("text",null,"未设置"),e.createElementVNode("text",{class:"arrow"},">")])]),e.createElementVNode("view",{class:"modal-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,((t,n)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["item",{selected:f.value===t}]),onClick:e=>S(t),key:n},e.toDisplayString(t),11,["onClick"])))),128))]),e.createElementVNode("view",{class:"modal-item"},[e.createElementVNode("text",{class:"modal-label"},"置顶"),e.createElementVNode("view",{class:"modal-value"},[e.createElementVNode("switch",{color:"#FFCC33",style:{transform:"scale(0.7)"}})])]),e.createElementVNode("text",{class:"tips"},"关闭之后,订单将按默认顺序排序"),e.createElementVNode("view",{class:"modal-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,((t,n)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["item",{selected:f.value===t}]),onClick:e=>S(t),key:n},e.toDisplayString(t),11,["onClick"])))),128))])])):e.createCommentVNode("",!0)])],2)])),_:1},512)],64)}}},g=i(f,[["__scopeId","data-v-61e7937c"]]),y={data:()=>({items:[{label:"我的订单"},{label:"收入查询"},{label:"我的钱包"},{label:"身份认证"},{label:"申诉中心"},{label:"服务评价"}]})},v=i(Object.assign(y,{__name:"my",setup(o){uni.getStorageSync("userInfo");const i=()=>{uni.request({url:m+"/api/user/logout",method:"POST",success(e){t("log","at pages/my/my.vue:102",e),uni.removeStorageSync("userInfo"),uni.removeStorageSync("currentUser"),uni.reLaunch({url:"/pages/login/login"})},fail(e){t("log","at pages/my/my.vue:110",e)}})},r=()=>{uni.showModal({title:"是否注销账号",content:"注销账号后将无法再次登录",showCancel:!0,success:function(e){e.confirm?(t("log","at pages/my/my.vue:121","点击了确定按钮"),uni.request({url:m+"/api/errand/delete",method:"POST",success(e){t("log","at pages/my/my.vue:126",e),uni.reLaunch({url:"/pages/login/login"})},fail(e){t("log","at pages/my/my.vue:132",e)}})):e.cancel&&t("log","at pages/my/my.vue:136","点击了取消按钮")}})},l=()=>{uni.navigateTo({url:"/pages/changeUserMessage/changeUserMessage"})},c=()=>{uni.navigateTo({url:"/pages/order/order"})},d=e.ref("敬请期待"),u=()=>{d.value.open(),setTimeout((()=>{d.value.close()}),1e3)},h=()=>{uni.navigateTo({url:"/pages/authentication/authentication"})},f=()=>{uni.navigateTo({url:"/pages/appeal/appeal"})},g=()=>{uni.navigateTo({url:"/pages/serviceEvaluation/serviceEvaluation"})},y=e.ref({username:"未登录"}),v=e.ref({loginName:"去登录"});s((()=>{uni.request({url:m+"/api/errand/get/current",method:"POST",header:{cookie:uni.getStorageSync("cookie")},success(e){t("log","at pages/my/my.vue:197",e),0===e.data.code?(uni.setStorageSync("currentUser",e.data.data),y.value=e.data.data,v.value={loginName:"退出登录"}):y.value={username:"未登录"}},fail(e){t("error","at pages/my/my.vue:207","请求失败:",e),y.value={username:"未登录"}}}),_(),b(),x(),N()}));const w=e.ref(0),_=()=>{uni.request({url:m+"/api/errandIncome/count/number",method:"POST",success(e){t("log","at pages/my/my.vue:227",e.data.data),w.value=e.data.data},fail(e){t("log","at pages/my/my.vue:231",e)}})},k=e.ref(0),b=()=>{uni.request({url:m+"/api/errandIncome/count/money",method:"POST",success(e){t("log","at pages/my/my.vue:241",e),k.value=e.data.data},fail(e){t("log","at pages/my/my.vue:245",e)}})},S=e.ref(0),x=()=>{uni.request({url:m+"/api/errandIncome/count/money/no",method:"POST",success(e){t("log","at pages/my/my.vue:255",e),S.value=e.data.data},fail(e){t("log","at pages/my/my.vue:259",e)}})},E=e.ref(0),N=()=>{uni.request({url:m+"/api/errandIncome/count/money/no",method:"POST",success(e){t("log","at pages/my/my.vue:270",e),E.value=e.data.data},fail(e){t("log","at pages/my/my.vue:274",e)}})};return(t,s)=>{const o=n(e.resolveDynamicComponent("uni-icons"),a),m=n(e.resolveDynamicComponent("uni-popup"),p);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"header"},[e.createElementVNode("image",{src:y.value.errandAvatarUrl||"../../static/logo.png",class:"user-icon",onClick:l},null,8,["src"]),e.createElementVNode("view",{class:"user-info"},[e.createElementVNode("text",{class:"name"},e.toDisplayString(y.value.errandName||"未登录"),1),e.createElementVNode("text",{class:"rating"},"快送员星级 ★★★★")]),e.createElementVNode("view",{class:"settings"},[e.createElementVNode("text",{class:"rule"},"快送员评分规则"),e.createVNode(o,{type:"right",size:"16",class:"settings-icon"})])]),e.createElementVNode("view",{class:"summary"},[e.createElementVNode("view",{class:"summary-item"},[e.createElementVNode("text",{class:"summary-value"},e.toDisplayString(E.value),1),e.createElementVNode("text",{class:"summary-label"},"总收入"),e.createElementVNode("text",{class:"summary-detail"},"总金额>")]),e.createElementVNode("view",{class:"summary-item",onClick:c},[e.createElementVNode("text",{class:"summary-value"},e.toDisplayString(w.value),1),e.createElementVNode("text",{class:"summary-label"},"今日完成"),e.createElementVNode("text",{class:"summary-detail"},"完成订单数>")]),e.createElementVNode("view",{class:"summary-item",onClick:u},[e.createElementVNode("text",{class:"summary-value"},e.toDisplayString(k.value),1),e.createElementVNode("text",{class:"summary-label"},"已结算"),e.createElementVNode("text",{class:"summary-detail"},"用户已确认>")]),e.createElementVNode("view",{class:"summary-item"},[e.createElementVNode("text",{class:"summary-value"},e.toDisplayString(S.value),1),e.createElementVNode("text",{class:"summary-label"},"待结算"),e.createElementVNode("text",{class:"summary-detail"},"等待用户确认>")])]),e.createElementVNode("view",{class:"menu"},[e.createElementVNode("view",{class:"menu-item",onClick:c},[e.createElementVNode("text",null,"我的订单"),e.createVNode(o,{type:"right",size:"16",class:"arrow-icon"})]),e.createElementVNode("view",null,[e.createElementVNode("view",{class:"menu-item",onClick:u},[e.createElementVNode("text",null,"我的钱包"),e.createVNode(o,{type:"right",size:"25",class:"arrow-icon"})]),e.createVNode(m,{ref_key:"popupRef",ref:d,type:"center","background-color":"#fff"},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"popup-content"},[e.createElementVNode("text",{class:"popup-text",style:{}},"敬请期待")])])),_:1},512)]),e.createElementVNode("view",{class:"menu-item",onClick:h},[e.createElementVNode("text",null,"身份认证"),e.createVNode(o,{type:"right",size:"16",class:"arrow-icon"})]),e.createElementVNode("view",{class:"menu-item",onClick:f},[e.createElementVNode("text",null,"申诉中心"),e.createVNode(o,{type:"right",size:"16",class:"arrow-icon"})]),e.createElementVNode("view",{class:"menu-item",onClick:g},[e.createElementVNode("text",null,"服务评价"),e.createVNode(o,{type:"right",size:"16",class:"arrow-icon"})]),e.createElementVNode("view",{class:"menu-item",onClick:r},[e.createElementVNode("text",null,"注销账户"),e.createVNode(o,{type:"right",size:"16",class:"arrow-icon"})]),e.createElementVNode("view",{class:"menu-item",onClick:i},[e.createElementVNode("text",null,e.toDisplayString(v.value.loginName),1),e.createVNode(o,{type:"right",size:"16",class:"arrow-icon"})])])])}}}),[["__scopeId","data-v-3979a8de"]]),w=i({__name:"orderList",setup(n){const s=e.ref([]);return e.onMounted((()=>{uni.request({url:m+"/api/bill/list",method:"POST",header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success(e){t("log","at pages/orderList/orderList.vue:37",e),0===e.data.code&&(t("log","at pages/orderList/orderList.vue:39",e.data.data),s.value=e.data.data)},fail(e){t("log","at pages/orderList/orderList.vue:44",e)}})})),(t,n)=>(e.openBlock(),e.createElementBlock("view",{class:"order-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,((t,n)=>(e.openBlock(),e.createElementBlock("view",{key:n,class:"order-details"},[e.createElementVNode("view",{class:"left-column"},[e.createElementVNode("view",{class:"userName"},"订单派送-"+e.toDisplayString(t.username),1),e.createElementVNode("view",{class:"orderTime"},e.toDisplayString(t.orderStartTime.slice(0,10)),1)]),e.createElementVNode("view",{class:"right-column"},[e.createElementVNode("view",{class:"orderMoney"}," +"+e.toDisplayString(t.income),1),e.createElementVNode("view",{class:"orderState",style:e.normalizeStyle({color:0===t.errandState?"#ff9900":"#00cc66"})},e.toDisplayString(0===t.errandState?"待结算":"已结算"),5)])])))),128))]))}},[["__scopeId","data-v-40243718"]]),_={__name:"test",setup(n){const s=()=>{uni.chooseLocation({success:e=>{t("log","at pages/test/test.vue:8",e),t("log","at pages/test/test.vue:9","位置名称:"+e.name),t("log","at pages/test/test.vue:10","详细地址:"+e.address),t("log","at pages/test/test.vue:11","纬度:"+e.latitude),t("log","at pages/test/test.vue:12","经度:"+e.longitude)}})};return(t,n)=>(e.openBlock(),e.createElementBlock("button",{onClick:s},"获取定位"))}},k={__name:"map",setup(t){const n=()=>{uni.chooseLocation({success:e=>{location.value={name:e.name,address:e.address,latitude:e.latitude,longitude:e.longitude}}})};return(t,s)=>(e.openBlock(),e.createElementBlock("view",null,[e.createElementVNode("button",{onClick:n},"获取定位")]))}},b={pages:[{path:"pages/index/index",style:{navigationBarTitleText:"首页",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/my/my",style:{navigationBarTitleText:"我的",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/orderList/orderList",style:{navigationBarTitleText:"历史订单查询",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/test/test",style:{navigationBarTitleText:"测试",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/map/map",style:{navigationBarTitleText:"配送范围",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/takePhoto/takePhoto",style:{navigationBarTitleText:"拍照",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/purse/purse",style:{navigationBarTitleText:"我的钱包",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/login/login",style:{navigationBarTitleText:"登录",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/register/register",style:{navigationBarTitleText:"注册",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/authentication/authentication",style:{navigationBarTitleText:"身份认证",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/changeUserMessage/changeUserMessage",style:{navigationBarTitleText:"修改用户信息",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/orderDetail/orderDetail",style:{navigationBarTitleText:"订单详情",navigationBarBackgroundColor:"#5e7dec"}},{path:"pages/deliveryDetail/deliveryDetail",style:{navigationBarTitleText:"订单详情",navigationBarBackgroundColor:"#5e7dec"}}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},tabBar:{color:"#B4BCC6",selectedColor:"#2588FF",list:[{pagePath:"pages/index/index",iconPath:"static/tabbar/index.png",selectedIconPath:"static/tabbar/index1.png",text:"首页"},{pagePath:"pages/orderList/orderList",iconPath:"static/tabbar/order.png",selectedIconPath:"static/tabbar/order1.png",text:"订单"},{pagePath:"pages/my/my",iconPath:"static/tabbar/my.png",selectedIconPath:"static/tabbar/my1.png",text:"我的"}]},uniIdRouter:{},easycom:{autoscan:!0,custom:{"^mo-(.*)":"@/pagesA/components/mo-$1/mo-$1.vue"}}};function S(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var x=S((function(e,t){var n;e.exports=(n=n||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},o=s.lib={},i=o.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,s=this.sigBytes,o=e.sigBytes;if(this.clamp(),s%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[s+i>>>2]|=a<<24-(s+i)%4*8}else for(i=0;i<o;i+=4)t[s+i>>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,s=[],o=function(t){var n=987654321,s=4294967295;return function(){var o=((n=36969*(65535&n)+(n>>16)&s)<<16)+(t=18e3*(65535&t)+(t>>16)&s)&s;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},i=0;i<t;i+=4){var r=o(4294967296*(n||e.random()));n=987654071*r(),s.push(4294967296*r()|0)}return new a.init(s,t)}}),r=s.enc={},l=r.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;s.push((i>>>4).toString(16)),s.push((15&i).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s+=2)n[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new a.init(n,t/2)}},c=r.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;s.push(String.fromCharCode(i))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s++)n[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new a.init(n,t)}},d=r.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},u=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,s=n.words,o=n.sigBytes,i=this.blockSize,r=o/(4*i),l=(r=t?e.ceil(r):e.max((0|r)-this._minBufferSize,0))*i,c=e.min(4*l,o);if(l){for(var d=0;d<l;d+=i)this._doProcessBlock(s,d);var u=s.splice(0,l);n.sigBytes-=c}return new a.init(u,c)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=u.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=s.algo={};return s}(Math),n)})),E=x,N=(S((function(e,t){var n;e.exports=(n=E,function(e){var t=n,s=t.lib,o=s.WordArray,i=s.Hasher,a=t.algo,r=[];!function(){for(var t=0;t<64;t++)r[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var s=t+n,o=e[s];e[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],l=e[t+1],p=e[t+2],m=e[t+3],f=e[t+4],g=e[t+5],y=e[t+6],v=e[t+7],w=e[t+8],_=e[t+9],k=e[t+10],b=e[t+11],S=e[t+12],x=e[t+13],E=e[t+14],N=e[t+15],C=i[0],T=i[1],P=i[2],I=i[3];C=c(C,T,P,I,a,7,r[0]),I=c(I,C,T,P,l,12,r[1]),P=c(P,I,C,T,p,17,r[2]),T=c(T,P,I,C,m,22,r[3]),C=c(C,T,P,I,f,7,r[4]),I=c(I,C,T,P,g,12,r[5]),P=c(P,I,C,T,y,17,r[6]),T=c(T,P,I,C,v,22,r[7]),C=c(C,T,P,I,w,7,r[8]),I=c(I,C,T,P,_,12,r[9]),P=c(P,I,C,T,k,17,r[10]),T=c(T,P,I,C,b,22,r[11]),C=c(C,T,P,I,S,7,r[12]),I=c(I,C,T,P,x,12,r[13]),P=c(P,I,C,T,E,17,r[14]),C=d(C,T=c(T,P,I,C,N,22,r[15]),P,I,l,5,r[16]),I=d(I,C,T,P,y,9,r[17]),P=d(P,I,C,T,b,14,r[18]),T=d(T,P,I,C,a,20,r[19]),C=d(C,T,P,I,g,5,r[20]),I=d(I,C,T,P,k,9,r[21]),P=d(P,I,C,T,N,14,r[22]),T=d(T,P,I,C,f,20,r[23]),C=d(C,T,P,I,_,5,r[24]),I=d(I,C,T,P,E,9,r[25]),P=d(P,I,C,T,m,14,r[26]),T=d(T,P,I,C,w,20,r[27]),C=d(C,T,P,I,x,5,r[28]),I=d(I,C,T,P,p,9,r[29]),P=d(P,I,C,T,v,14,r[30]),C=u(C,T=d(T,P,I,C,S,20,r[31]),P,I,g,4,r[32]),I=u(I,C,T,P,w,11,r[33]),P=u(P,I,C,T,b,16,r[34]),T=u(T,P,I,C,E,23,r[35]),C=u(C,T,P,I,l,4,r[36]),I=u(I,C,T,P,f,11,r[37]),P=u(P,I,C,T,v,16,r[38]),T=u(T,P,I,C,k,23,r[39]),C=u(C,T,P,I,x,4,r[40]),I=u(I,C,T,P,a,11,r[41]),P=u(P,I,C,T,m,16,r[42]),T=u(T,P,I,C,y,23,r[43]),C=u(C,T,P,I,_,4,r[44]),I=u(I,C,T,P,S,11,r[45]),P=u(P,I,C,T,N,16,r[46]),C=h(C,T=u(T,P,I,C,p,23,r[47]),P,I,a,6,r[48]),I=h(I,C,T,P,v,10,r[49]),P=h(P,I,C,T,E,15,r[50]),T=h(T,P,I,C,g,21,r[51]),C=h(C,T,P,I,S,6,r[52]),I=h(I,C,T,P,m,10,r[53]),P=h(P,I,C,T,k,15,r[54]),T=h(T,P,I,C,l,21,r[55]),C=h(C,T,P,I,w,6,r[56]),I=h(I,C,T,P,N,10,r[57]),P=h(P,I,C,T,y,15,r[58]),T=h(T,P,I,C,x,21,r[59]),C=h(C,T,P,I,f,6,r[60]),I=h(I,C,T,P,b,10,r[61]),P=h(P,I,C,T,p,15,r[62]),T=h(T,P,I,C,_,21,r[63]),i[0]=i[0]+C|0,i[1]=i[1]+T|0,i[2]=i[2]+P|0,i[3]=i[3]+I|0},_doFinalize:function(){var t=this._data,n=t.words,s=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(s/4294967296),a=s;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var r=this._hash,l=r.words,c=0;c<4;c++){var d=l[c];l[c]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return r},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,s,o,i,a){var r=e+(t&n|~t&s)+o+a;return(r<<i|r>>>32-i)+t}function d(e,t,n,s,o,i,a){var r=e+(t&s|n&~s)+o+a;return(r<<i|r>>>32-i)+t}function u(e,t,n,s,o,i,a){var r=e+(t^n^s)+o+a;return(r<<i|r>>>32-i)+t}function h(e,t,n,s,o,i,a){var r=e+(n^(t|~s))+o+a;return(r<<i|r>>>32-i)+t}t.MD5=i._createHelper(l),t.HmacMD5=i._createHmacHelper(l)}(Math),n.MD5)})),S((function(e,t){var n,s,o;e.exports=(s=(n=E).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=s.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,s=4*n;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),r=i.words,l=a.words,c=0;c<n;c++)r[c]^=1549556828,l[c]^=909522486;i.sigBytes=a.sigBytes=s,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),S((function(e,t){e.exports=E.HmacMD5}))),C=S((function(e,t){e.exports=E.enc.Utf8})),T=S((function(e,t){var n,s,o;e.exports=(o=(s=n=E).lib.WordArray,s.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,s=this._map;e.clamp();for(var o=[],i=0;i<n;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,r=0;r<4&&i+.75*r<n;r++)o.push(s.charAt(a>>>6*(3-r)&63));var l=s.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var i=0;i<n.length;i++)s[n.charCodeAt(i)]=i}var a=n.charAt(64);if(a){var r=e.indexOf(a);-1!==r&&(t=r)}return function(e,t,n){for(var s=[],i=0,a=0;a<t;a++)if(a%4){var r=n[e.charCodeAt(a-1)]<<a%4*2,l=n[e.charCodeAt(a)]>>>6-a%4*2;s[i>>>2]|=(r|l)<<24-i%4*8,i++}return o.create(s,i)}(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)}));const P="FUNCTION",I="pending",V="rejected";function A(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function D(e){return"object"===A(e)}function O(e){return"function"==typeof e}function B(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const L="REJECTED",F="NOT_PENDING";class U{constructor({createPromise:e,retryRule:t=L}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case L:return this.status===V;case F:return this.status!==I}}exec(){return this.needRetry?(this.status=I,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=V,Promise.reject(e)))),this.promise):this.promise}}function M(e){return e&&"string"==typeof e?JSON.parse(e):e}const R=M([]);M("");const $=M("[]")||[];let q="";try{q="__UNI__2011CFE"}catch(Ve){}let j,z={};function K(e,t={}){var n,s;return n=z,s=e,Object.prototype.hasOwnProperty.call(n,s)||(z[e]=t),z[e]}z=uni._globalUniCloudObj?uni._globalUniCloudObj:uni._globalUniCloudObj={};const H=["invoke","success","fail","complete"],W=K("_globalUniCloudInterceptor");function J(e,t){W[e]||(W[e]={}),D(t)&&Object.keys(t).forEach((n=>{H.indexOf(n)>-1&&function(e,t,n){let s=W[e][t];s||(s=W[e][t]=[]),-1===s.indexOf(n)&&O(n)&&s.push(n)}(e,n,t[n])}))}function G(e,t){W[e]||(W[e]={}),D(t)?Object.keys(t).forEach((n=>{H.indexOf(n)>-1&&function(e,t,n){const s=W[e][t];if(!s)return;const o=s.indexOf(n);o>-1&&s.splice(o,1)}(e,n,t[n])})):delete W[e]}function Y(e,t){return e&&0!==e.length?e.reduce(((e,n)=>e.then((()=>n(t)))),Promise.resolve()):Promise.resolve()}function Q(e,t){return W[e]&&W[e][t]||[]}function X(e){J("callObject",e)}const Z=K("_globalUniCloudListener"),ee="response",te="needLogin",ne="refreshToken",se="clientdb",oe="cloudfunction",ie="cloudobject";function ae(e){return Z[e]||(Z[e]=[]),Z[e]}function re(e,t){const n=ae(e);n.includes(t)||n.push(t)}function le(e,t){const n=ae(e),s=n.indexOf(t);-1!==s&&n.splice(s,1)}function ce(e,t){const n=ae(e);for(let s=0;s<n.length;s++)(0,n[s])(t)}let de,ue=!1;function he(){return de||(de=new Promise((e=>{ue&&e(),function t(){if("function"==typeof getCurrentPages){const t=getCurrentPages();t&&t[0]&&(ue=!0,e())}ue||setTimeout((()=>{t()}),30)}()})),de)}function pe(e){const t={};for(const n in e){const s=e[n];O(s)&&(t[n]=B(s))}return t}class me extends Error{constructor(e){super(e.message),this.errMsg=e.message||e.errMsg||"unknown system error",this.code=this.errCode=e.code||e.errCode||"SYSTEM_ERROR",this.errSubject=this.subject=e.subject||e.errSubject,this.cause=e.cause,this.requestId=e.requestId}toJson(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJson?this.cause.toJson(e):this.cause}}}var fe={request:e=>uni.request(e),uploadFile:e=>uni.uploadFile(e),setStorageSync:(e,t)=>uni.setStorageSync(e,t),getStorageSync:e=>uni.getStorageSync(e),removeStorageSync:e=>uni.removeStorageSync(e),clearStorageSync:()=>uni.clearStorageSync(),connectSocket:e=>uni.connectSocket(e)};function ge(e){return e&&ge(e.__v_raw)||e}function ye(){return{token:fe.getStorageSync("uni_id_token")||fe.getStorageSync("uniIdToken"),tokenExpired:fe.getStorageSync("uni_id_token_expired")}}function ve({token:e,tokenExpired:t}={}){e&&fe.setStorageSync("uni_id_token",e),t&&fe.setStorageSync("uni_id_token_expired",t)}let we,_e;function ke(){return we||(we=uni.getSystemInfoSync()),we}function be(){let e,t;try{if(uni.getLaunchOptionsSync){if(uni.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:n,channel:s}=uni.getLaunchOptionsSync();e=s,t=n}}catch(n){}return{channel:e,scene:t}}let Se={};function xe(){const e=uni.getLocale&&uni.getLocale()||"en";if(_e)return{...Se,..._e,locale:e,LOCALE:e};const t=ke(),{deviceId:n,osName:s,uniPlatform:o,appId:i}=t,a=["appId","appLanguage","appName","appVersion","appVersionCode","appWgtVersion","browserName","browserVersion","deviceBrand","deviceId","deviceModel","deviceType","osName","osVersion","romName","romVersion","ua","hostName","hostVersion","uniPlatform","uniRuntimeVersion","uniRuntimeVersionCode","uniCompilerVersion","uniCompilerVersionCode"];for(const r in t)Object.hasOwnProperty.call(t,r)&&-1===a.indexOf(r)&&delete t[r];return _e={PLATFORM:o,OS:s,APPID:i,DEVICEID:n,...be(),...t},{...Se,..._e,locale:e,LOCALE:e}}var Ee=function(e,t){let n="";return Object.keys(e).sort().forEach((function(t){e[t]&&(n=n+"&"+t+"="+e[t])})),n=n.slice(1),N(n,t).toString()},Ne=function(e,t){return new Promise(((n,s)=>{t(Object.assign(e,{complete(e){e||(e={});const t=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400){const n=e.data&&e.data.error&&e.data.error.code||"SYS_ERR",o=e.data&&e.data.error&&e.data.error.message||e.errMsg||"request:fail";return s(new me({code:n,message:o,requestId:t}))}const o=e.data;if(o.error)return s(new me({code:o.error.code,message:o.error.message,requestId:t}));o.result=o.data,o.requestId=t,delete o.data,n(o)}}))}))},Ce=function(e){return T.stringify(C.parse(e))},Te={init(e){const t=new class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),this.config=Object.assign({},{endpoint:0===e.spaceId.indexOf("mp-")?"https://api.next.bspapp.com":"https://api.bspapp.com"},e),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=fe,this._getAccessTokenPromiseHub=new U({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new me({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:F})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return Ne(e,this.adapter.request)}requestAuth(e){return this.requestWrapped(e)}request(e,t){return Promise.resolve().then((()=>this.hasAccessToken?t?this.requestWrapped(e):this.requestWrapped(e).catch((t=>new Promise(((e,n)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?n(t):e()})).then((()=>this.getAccessToken())).then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)})))):this.getAccessToken().then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)}))))}rebuildRequest(e){const t=Object.assign({},e);return t.data.token=this.accessToken,t.header["x-basement-token"]=this.accessToken,t.header["x-serverless-sign"]=Ee(t.data,this.config.clientSecret),t}setupRequest(e,t){const n=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),s={"Content-Type":"application/json"};return"auth"!==t&&(n.token=this.accessToken,s["x-basement-token"]=this.accessToken),s["x-serverless-sign"]=Ee(n,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:n,dataType:"json",header:s}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request({...this.setupRequest(t),timeout:e.timeout})}getOSSUploadOptionsFromPath(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:n,filePath:s,fileType:o,onUploadProgress:i}){return new Promise(((a,r)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:n,filePath:s,fileType:o,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?a(e):r(new me({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){r(new me({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof i&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{i({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}reportOSSUpload(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}async uploadFile({filePath:e,cloudPath:t,fileType:n="image",cloudPathAsRealPath:s=!1,onUploadProgress:o,config:i}){if("string"!==A(t))throw new me({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new me({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new me({code:"INVALID_PARAM",message:"cloudPath不合法"});const a=i&&i.envType||this.config.envType;if(s&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new me({code:"INVALID_PARAM",message:"使用cloudPath作为路径时cloudPath不可包含“\\”"});const r=(await this.getOSSUploadOptionsFromPath({env:a,filename:s?t.split("/").pop():t,fileId:s?t:void 0})).result,l="https://"+r.cdnDomain+"/"+r.ossPath,{securityToken:c,accessKeyId:d,signature:u,host:h,ossPath:p,id:m,policy:f,ossCallbackUrl:g}=r,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:d,Signature:u,host:h,id:m,key:p,policy:f,success_action_status:200};if(c&&(y["x-oss-security-token"]=c),g){const e=JSON.stringify({callbackUrl:g,callbackBody:JSON.stringify({fileId:m,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=Ce(e)}const v={url:"https://"+r.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:n};if(await this.uploadFileToOSS(Object.assign({},v,{onUploadProgress:o})),g)return{success:!0,filePath:e,fileID:l};if((await this.reportOSSUpload({id:m})).success)return{success:!0,filePath:e,fileID:l};throw new me({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,n)=>{Array.isArray(e)&&0!==e.length||n(new me({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),t({fileList:e.map((e=>({fileID:e,tempFileURL:e})))})}))}async getFileInfo({fileList:e}={}){if(!Array.isArray(e)||0===e.length)throw new me({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.info",params:JSON.stringify({id:e.map((e=>e.split("?")[0])).join(",")})};return{fileList:(await this.request(this.setupRequest(t))).result}}}(e),n={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return n},t.customAuth=t.auth,t}};const Pe="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var Ie,Ve;(Ve=Ie||(Ie={})).local="local",Ve.none="none",Ve.session="session";var Ae=function(){},De=S((function(e,t){var n;e.exports=(n=E,function(e){var t=n,s=t.lib,o=s.WordArray,i=s.Hasher,a=t.algo,r=[],l=[];!function(){function t(t){for(var n=e.sqrt(t),s=2;s<=n;s++)if(!(t%s))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var s=2,o=0;o<64;)t(s)&&(o<8&&(r[o]=n(e.pow(s,.5))),l[o]=n(e.pow(s,1/3)),o++),s++}();var c=[],d=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(r.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,s=n[0],o=n[1],i=n[2],a=n[3],r=n[4],d=n[5],u=n[6],h=n[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var m=c[p-15],f=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,g=c[p-2],y=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[p]=f+c[p-7]+y+c[p-16]}var v=s&o^s&i^o&i,w=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),_=h+((r<<26|r>>>6)^(r<<21|r>>>11)^(r<<7|r>>>25))+(r&d^~r&u)+l[p]+c[p];h=u,u=d,d=r,r=a+_|0,a=i,i=o,o=s,s=_+(w+v)|0}n[0]=n[0]+s|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+r|0,n[5]=n[5]+d|0,n[6]=n[6]+u|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,s=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(s/4294967296),n[15+(o+64>>>9<<4)]=s,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(d),t.HmacSHA256=i._createHmacHelper(d)}(Math),n.SHA256)})),Oe=De,Be=S((function(e,t){e.exports=E.HmacSHA256}));const Le=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new me({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}const t=new Promise(((t,n)=>{e=(e,s)=>e?n(e):t(s)}));return e.promise=t,e};function Fe(e){return void 0===e}function Ue(e){return"[object Null]"===Object.prototype.toString.call(e)}function Me(e=""){return e.replace(/([\s\S]+)\s+(请前往云开发AI小助手查看问题.*)/,"$1")}var Re;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(Re||(Re={}));const $e={adapter:null,runtime:void 0},qe=["anonymousUuidKey"];class je extends Ae{constructor(){super(),$e.adapter.root.tcbObject||($e.adapter.root.tcbObject={})}setItem(e,t){$e.adapter.root.tcbObject[e]=t}getItem(e){return $e.adapter.root.tcbObject[e]}removeItem(e){delete $e.adapter.root.tcbObject[e]}clear(){delete $e.adapter.root.tcbObject}}function ze(e,t){switch(e){case"local":return t.localStorage||new je;case"none":return new je;default:return t.sessionStorage||new je}}class Ke{constructor(e){if(!this._storage){this._persistence=$e.adapter.primaryStorage||e.persistence,this._storage=ze(this._persistence,$e.adapter);const t=`access_token_${e.env}`,n=`access_token_expire_${e.env}`,s=`refresh_token_${e.env}`,o=`anonymous_uuid_${e.env}`,i=`login_type_${e.env}`,a=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s,anonymousUuidKey:o,loginTypeKey:i,userInfoKey:a}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const n=ze(e,$e.adapter);for(const s in this.keys){const e=this.keys[s];if(t&&qe.includes(s))continue;const o=this._storage.getItem(e);Fe(o)||Ue(o)||(n.setItem(e,o),this._storage.removeItem(e))}this._storage=n}setStore(e,t,n){if(!this._storage)return;const s={version:n||"localCachev1",content:t},o=JSON.stringify(s);try{this._storage.setItem(e,o)}catch(i){throw i}}getStore(e,t){try{if(!this._storage)return}catch(s){return""}t=t||"localCachev1";const n=this._storage.getItem(e);return n&&n.indexOf(t)>=0?JSON.parse(n).content:""}removeStore(e){this._storage.removeItem(e)}}const He={},We={};function Je(e){return He[e]}class Ge{constructor(e,t){this.data=t||null,this.name=e}}class Ye extends Ge{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const Qe=new class{constructor(){this._listeners={}}on(e,t){return n=e,s=t,(o=this._listeners)[n]=o[n]||[],o[n].push(s),this;var n,s,o}off(e,t){return function(e,t,n){if(n&&n[e]){const s=n[e].indexOf(t);-1!==s&&n[e].splice(s,1)}}(e,t,this._listeners),this}fire(e,t){if(e instanceof Ye)return console.error(e.error),this;const n="string"==typeof e?new Ge(e,t||{}):e,s=n.name;if(this._listens(s)){n.target=this;const e=this._listeners[s]?[...this._listeners[s]]:[];for(const t of e)t.call(this,n)}return this}_listens(e){return this._listeners[e]&&this._listeners[e].length>0}};function Xe(e,t){Qe.on(e,t)}function Ze(e,t={}){Qe.fire(e,t)}function et(e,t){Qe.off(e,t)}const tt="loginStateChanged",nt="loginStateExpire",st="loginTypeChanged",ot="anonymousConverted",it="refreshAccessToken";var at;!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL"}(at||(at={}));const rt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],lt={"X-SDK-Version":"1.3.5"};function ct(e,t,n){const s=e[t];e[t]=function(t){const o={},i={};n.forEach((n=>{const{data:s,headers:a}=n.call(e,t);Object.assign(o,s),Object.assign(i,a)}));const a=t.data;return a&&(()=>{var e;if(e=a,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...a,...o};else for(const t in o)a.append(t,o[t])})(),t.headers={...t.headers||{},...i},s.call(e,t)}}function dt(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...lt,"x-seqid":e}}}class ut{constructor(e={}){var t;this.config=e,this._reqClass=new $e.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成已中断`,restrictedMethods:["post"]}),this._cache=Je(this.config.env),this._localCache=(t=this.config.env,We[t]),ct(this._reqClass,"post",[dt]),ct(this._reqClass,"upload",[dt]),ct(this._reqClass,"download",[dt])}async post(e){return await this._reqClass.post(e)}async upload(e){return await this._reqClass.upload(e)}async download(e){return await this._reqClass.download(e)}async refreshAccessToken(){let e,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=await this._refreshAccessTokenPromise}catch(n){t=n}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n,loginTypeKey:s,anonymousUuidKey:o}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let i=this._cache.getStore(n);if(!i)throw new me({message:"未登录CloudBase"});const a={refresh_token:i},r=await this.request("auth.fetchAccessTokenWithRefreshToken",a);if(r.data.code){const{code:e}=r.data;if("SIGN_PARAM_INVALID"===e||"REFRESH_TOKEN_EXPIRED"===e||"INVALID_REFRESH_TOKEN"===e){if(this._cache.getStore(s)===at.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(o),t=this._cache.getStore(n),s=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(s.refresh_token),this._refreshAccessToken()}Ze(nt),this._cache.removeStore(n)}throw new me({code:r.data.code,message:`刷新access token失败${r.data.code}`})}if(r.data.access_token)return Ze(it),this._cache.setStore(e,r.data.access_token),this._cache.setStore(t,r.data.access_token_expire+Date.now()),{accessToken:r.data.access_token,accessTokenExpire:r.data.access_token_expire};r.data.refresh_token&&(this._cache.removeStore(n),this._cache.setStore(n,r.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n}=this._cache.keys;if(!this._cache.getStore(n))throw new me({message:"refresh token不存在登录状态异常"});let s=this._cache.getStore(e),o=this._cache.getStore(t),i=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(s,o))&&(i=!1),(!s||!o||o<Date.now())&&i?this.refreshAccessToken():{accessToken:s,accessTokenExpire:o}}async request(e,t,n){const s=`x-tcb-trace_${this.config.env}`;let o="application/x-www-form-urlencoded";const i={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===rt.indexOf(e)){const{refreshTokenKey:e}=this._cache.keys;this._cache.getStore(e)&&(i.access_token=(await this.getAccessToken()).accessToken)}let a;if("storage.uploadFile"===e){a=new FormData;for(let e in a)a.hasOwnProperty(e)&&void 0!==a[e]&&a.append(e,i[e]);o="multipart/form-data"}else{o="application/json",a={};for(let e in i)void 0!==i[e]&&(a[e]=i[e])}let r={headers:{"content-type":o}};n&&n.timeout&&(r.timeout=n.timeout),n&&n.onUploadProgress&&(r.onUploadProgress=n.onUploadProgress);const l=this._localCache.getStore(s);l&&(r.headers["X-TCB-Trace"]=l);const{parse:c,inQuery:d,search:u}=t;let h={env:this.config.env};c&&(h.parse=!0),d&&(h={...d,...h});let p=function(e,t,n={}){const s=/\?/.test(t);let o="";for(let i in n)""===o?!s&&(t+="?"):o+="&",o+=`${i}=${encodeURIComponent(n[i])}`;return/^http(s)?\:\/\//.test(t+=o)?t:`${e}${t}`}(Pe,"//tcb-api.tencentcloudapi.com/web",h);u&&(p+=u);const m=await this.post({url:p,data:a,...r}),f=m.header&&m.header["x-tcb-trace"];if(f&&this._localCache.setStore(s,f),200!==Number(m.status)&&200!==Number(m.statusCode)||!m.data)throw new me({code:"NETWORK_ERROR",message:"network request error"});return m}async send(e,t={},n={}){const s=await this.request(e,t,{...n,onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===s.data.code&&-1===rt.indexOf(e)){await this.refreshAccessToken();const s=await this.request(e,t,{...n,onUploadProgress:t.onUploadProgress});if(s.data.code)throw new me({code:s.data.code,message:Me(s.data.message)});return s.data}if(s.data.code)throw new me({code:s.data.code,message:Me(s.data.message)});return s.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}}const ht={};function pt(e){return ht[e]}class mt{constructor(e){this.config=e,this._cache=Je(e.env),this._request=pt(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}setAccessToken(e,t){const{accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys;this._cache.setStore(n,e),this._cache.setStore(s,t)}async refreshUserInfo(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}class ft{constructor(e){if(!e)throw new me({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=Je(this._envId),this._request=pt(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeof e)throw new me({code:"PARAM_ERROR",message:"ticket must be string"});return this._request.send("auth.linkWithTicket",{ticket:e})}linkWithRedirect(e){e.signInWithRedirect()}updatePassword(e,t){return this._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})}updateEmail(e){return this._request.send("auth.updateEmail",{newEmail:e})}updateUsername(e){if("string"!=typeof e)throw new me({code:"PARAM_ERROR",message:"username must be a string"});return this._request.send("auth.updateUsername",{username:e})}async getLinkedUidList(){const{data:e}=await this._request.send("auth.getLinkedUidList",{});let t=!1;const{users:n}=e;return n.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:n,hasPrimaryUid:t}}setPrimaryUid(e){return this._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){return this._request.send("auth.unlink",{platform:e})}async update(e){const{nickName:t,gender:n,avatarUrl:s,province:o,country:i,city:a}=e,{data:r}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:n,avatarUrl:s,province:o,country:i,city:a});this.setLocalUserInfo(r)}async refresh(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setUserInfo(){const{userInfoKey:e}=this._cache.keys,t=this._cache.getStore(e);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl"].forEach((e=>{this[e]=t[e]})),this.location={country:t.country,province:t.province,city:t.city}}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e),this.setUserInfo()}}class gt{constructor(e){if(!e)throw new me({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=Je(e);const{refreshTokenKey:t,accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys,o=this._cache.getStore(t),i=this._cache.getStore(n),a=this._cache.getStore(s);this.credential={refreshToken:o,accessToken:i,accessTokenExpire:a},this.user=new ft(e)}get isAnonymousAuth(){return this.loginType===at.ANONYMOUS}get isCustomAuth(){return this.loginType===at.CUSTOM}get isWeixinAuth(){return this.loginType===at.WECHAT||this.loginType===at.WECHAT_OPEN||this.loginType===at.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class yt extends mt{async signIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,n=this._cache.getStore(e)||void 0,s=this._cache.getStore(t)||void 0,o=await this._request.send("auth.signInAnonymously",{anonymous_uuid:n,refresh_token:s});if(o.uuid&&o.refresh_token){this._setAnonymousUUID(o.uuid),this.setRefreshToken(o.refresh_token),await this._request.refreshAccessToken(),Ze(tt),Ze(st,{env:this.config.env,loginType:at.ANONYMOUS,persistence:"local"});const e=new gt(this.config.env);return await e.user.refresh(),e}throw new me({message:"匿名登录失败"})}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:n}=this._cache.keys,s=this._cache.getStore(t),o=this._cache.getStore(n),i=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:s,refresh_token:o,ticket:e});if(i.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(i.refresh_token),await this._request.refreshAccessToken(),Ze(ot,{env:this.config.env}),Ze(st,{loginType:at.CUSTOM,persistence:"local"}),{credential:{refreshToken:i.refresh_token}};throw new me({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(n,at.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class vt extends mt{async signIn(e){if("string"!=typeof e)throw new me({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,n=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(n.refresh_token)return this.setRefreshToken(n.refresh_token),await this._request.refreshAccessToken(),Ze(tt),Ze(st,{env:this.config.env,loginType:at.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new gt(this.config.env);throw new me({message:"自定义登录失败"})}}class wt extends mt{async signIn(e,t){if("string"!=typeof e)throw new me({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:n}=this._cache.keys,s=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:o,access_token:i,access_token_expire:a}=s;if(o)return this.setRefreshToken(o),i&&a?this.setAccessToken(i,a):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ze(tt),Ze(st,{env:this.config.env,loginType:at.EMAIL,persistence:this.config.persistence}),new gt(this.config.env);throw s.code?new me({code:s.code,message:`邮箱登录失败: ${s.message}`}):new me({message:"邮箱登录失败"})}async activate(e){return this._request.send("auth.activateEndUserMail",{token:e})}async resetPasswordWithToken(e,t){return this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}class _t extends mt{async signIn(e,t){if("string"!=typeof e)throw new me({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeof t&&(t="",console.warn("password is empty"));const{refreshTokenKey:n}=this._cache.keys,s=await this._request.send("auth.signIn",{loginType:at.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:o,access_token_expire:i,access_token:a}=s;if(o)return this.setRefreshToken(o),a&&i?this.setAccessToken(a,i):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ze(tt),Ze(st,{env:this.config.env,loginType:at.USERNAME,persistence:this.config.persistence}),new gt(this.config.env);throw s.code?new me({code:s.code,message:`用户名密码登录失败: ${s.message}`}):new me({message:"用户名密码登录失败"})}}class kt{constructor(e){this.config=e,this._cache=Je(e.env),this._request=pt(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),Xe(st,this._onLoginTypeChanged)}get currentUser(){const e=this.hasLoginState();return e&&e.user||null}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){return new yt(this.config)}customAuthProvider(){return new vt(this.config)}emailAuthProvider(){return new wt(this.config)}usernameAuthProvider(){return new _t(this.config)}async signInAnonymously(){return new yt(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new wt(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new _t(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new yt(this.config)),Xe(ot,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===at.ANONYMOUS)throw new me({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:n}=this._cache.keys,s=this._cache.getStore(e);if(!s)return;const o=await this._request.send("auth.logout",{refresh_token:s});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(n),Ze(tt),Ze(st,{env:this.config.env,loginType:at.NULL,persistence:this.config.persistence}),o}async signUpWithEmailAndPassword(e,t){return this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}async sendPasswordResetEmail(e){return this._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){Xe(tt,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){Xe(nt,e.bind(this))}onAccessTokenRefreshed(e){Xe(it,e.bind(this))}onAnonymousConverted(e){Xe(ot,e.bind(this))}onLoginTypeChanged(e){Xe(st,(()=>{const t=this.hasLoginState();e.call(this,t)}))}async getAccessToken(){return{accessToken:(await this._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{refreshTokenKey:e}=this._cache.keys;return this._cache.getStore(e)?new gt(this.config.env):null}async isUsernameRegistered(e){if("string"!=typeof e)throw new me({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=await this._request.send("auth.isUsernameRegistered",{username:e});return t&&t.isRegistered}getLoginState(){return Promise.resolve(this.hasLoginState())}async signInWithTicket(e){return new vt(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){return this._request.send("auth.getUserInfo",{}).then((e=>e.code?e:{...e.data,requestId:e.seqId}))}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,n=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+n}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:n,env:s}=e.data;s===this.config.env&&(this._cache.updatePersistence(n),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const bt=function(e,t){t=t||Le();const n=pt(this.config.env),{cloudPath:s,filePath:o,onUploadProgress:i,fileType:a="image"}=e;return n.send("storage.getUploadMetadata",{path:s}).then((e=>{const{data:{url:r,authorization:l,token:c,fileId:d,cosFileId:u},requestId:h}=e,p={key:s,signature:l,"x-cos-meta-fileid":u,success_action_status:"201","x-cos-security-token":c};n.upload({url:r,data:p,file:o,name:s,fileType:a,onUploadProgress:i}).then((e=>{201===e.statusCode?t(null,{fileID:d,requestId:h}):t(new me({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},St=function(e,t){t=t||Le();const n=pt(this.config.env),{cloudPath:s}=e;return n.send("storage.getUploadMetadata",{path:s}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},xt=function({fileList:e},t){if(t=t||Le(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let s of e)if(!s||"string"!=typeof s)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const n={fileid_list:e};return pt(this.config.env).send("storage.batchDeleteFile",n).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Et=function({fileList:e},t){t=t||Le(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let n=[];for(let o of e)"object"==typeof o?(o.hasOwnProperty("fileID")&&o.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),n.push({fileid:o.fileID,max_age:o.maxAge})):"string"==typeof o?n.push({fileid:o}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const s={file_list:n};return pt(this.config.env).send("storage.batchGetDownloadUrl",s).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Nt=async function({fileID:e},t){const n=(await Et.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==n.code)return t?t(n):new Promise((e=>{e(n)}));const s=pt(this.config.env);let o=n.download_url;if(o=encodeURI(o),!t)return s.download({url:o});t(await s.download({url:o}))},Ct=function({name:e,data:t,query:n,parse:s,search:o,timeout:i},a){const r=a||Le();let l;try{l=t?JSON.stringify(t):""}catch(d){return Promise.reject(d)}if(!e)return Promise.reject(new me({code:"PARAM_ERROR",message:"函数名不能为空"}));const c={inQuery:n,parse:s,search:o,function_name:e,request_data:l};return pt(this.config.env).send("functions.invokeFunction",c,{timeout:i}).then((e=>{if(e.code)r(null,e);else{let n=e.data.response_data;if(s)r(null,{result:n,requestId:e.requestId});else try{n=JSON.parse(e.data.response_data),r(null,{result:n,requestId:e.requestId})}catch(t){r(new me({message:"response data must be json"}))}}return r.promise})).catch((e=>{r(e)})),r.promise},Tt={timeout:15e3,persistence:"session"},Pt={};class It{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch($e.adapter||(this.requestClient=new $e.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成已中断`})),this.config={...Tt,...e},!0){case this.config.timeout>6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=6e5;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new It(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||$e.adapter.primaryStorage||Tt.persistence;var n;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;He[t]=new Ke(e),We[t]=new Ke({...e,persistence:"local"})}(this.config),n=this.config,ht[n.env]=new ut(n),this.authObj=new kt(this.config),this.authObj}on(e,t){return Xe.apply(this,[e,t])}off(e,t){return et.apply(this,[e,t])}callFunction(e,t){return Ct.apply(this,[e,t])}deleteFile(e,t){return xt.apply(this,[e,t])}getTempFileURL(e,t){return Et.apply(this,[e,t])}downloadFile(e,t){return Nt.apply(this,[e,t])}uploadFile(e,t){return bt.apply(this,[e,t])}getUploadMetadata(e,t){return St.apply(this,[e,t])}registerExtension(e){Pt[e.name]=e}async invokeExtension(e,t){const n=Pt[e];if(!n)throw new me({message:`扩展${e} 必须先注册`});return await n.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:n}=function(e){const t=(n=e,"[object Array]"===Object.prototype.toString.call(n)?e:[e]);var n;for(const s of t){const{isMatch:e,genAdapter:t,runtime:n}=s;if(e())return{adapter:t(),runtime:n}}}(e)||{};t&&($e.adapter=t),n&&($e.runtime=n)}}var Vt=new It;function At(e,t,n){void 0===n&&(n={});var s=/\?/.test(t),o="";for(var i in n)""===o?!s&&(t+="?"):o+="&",o+=i+"="+encodeURIComponent(n[i]);return/^http(s)?:\/\//.test(t+=o)?t:""+e+t}class Dt{post(e){const{url:t,data:n,headers:s,timeout:o}=e;return new Promise(((e,i)=>{fe.request({url:At("https:",t),data:n,method:"POST",header:s,timeout:o,success(t){e(t)},fail(e){i(e)}})}))}upload(e){return new Promise(((t,n)=>{const{url:s,file:o,data:i,headers:a,fileType:r}=e,l=fe.uploadFile({url:At("https:",s),name:"file",formData:Object.assign({},i),filePath:o,fileType:r,header:a,success(e){const n={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&i.success_action_status&&(n.statusCode=parseInt(i.success_action_status,10)),t(n)},fail(e){n(new Error(e.errMsg||"uploadFile:fail"))}});"function"==typeof e.onUploadProgress&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((t=>{e.onUploadProgress({loaded:t.totalBytesSent,total:t.totalBytesExpectedToSend})}))}))}}const Ot={setItem(e,t){fe.setStorageSync(e,t)},getItem:e=>fe.getStorageSync(e),removeItem(e){fe.removeStorageSync(e)},clear(){fe.clearStorageSync()}};var Bt={genAdapter:function(){return{root:{},reqClass:Dt,localStorage:Ot,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};Vt.useAdapters(Bt);const Lt=Vt,Ft=Lt.init;Lt.init=function(e){e.env=e.spaceId;const t=Ft.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;const n=t.auth;return t.auth=function(e){const t=n.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{var n;t[e]=(n=t[e],function(e){e=e||{};const{success:t,fail:s,complete:o}=pe(e);if(!(t||s||o))return n.call(this,e);n.call(this,e).then((e=>{t&&t(e),o&&o(e)}),(e=>{s&&s(e),o&&o(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var Ut=Lt;async function Mt(e,t){const n=`http://${e}:${t}/system/ping`;try{const e=await(s={url:n,timeout:500},new Promise(((e,t)=>{fe.request({...s,success(t){e(t)},fail(e){t(e)}})})));return!(!e.data||0!==e.data.code)}catch(o){return!1}var s}const Rt={"serverless.file.resource.generateProximalSign":"storage/generate-proximal-sign","serverless.file.resource.report":"storage/report","serverless.file.resource.delete":"storage/delete","serverless.file.resource.getTempFileURL":"storage/get-temp-file-url"};var $t={init(e){const t=new class{constructor(e){if(["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),!e.endpoint)throw new Error("集群空间未配置ApiEndpoint配置后需要重新关联服务空间后生效");this.config=Object.assign({},e),this.config.provider="dcloud",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.adapter=fe}async request(e,t=!0){return e=this.setupRequest(e),Promise.resolve().then((()=>Ne(e,this.adapter.request)))}requestLocal(e){return new Promise(((t,n)=>{this.adapter.request(Object.assign(e,{complete(e){if(e||(e={}),!e.statusCode||e.statusCode>=400){const t=e.data&&e.data.code||"SYS_ERR",s=e.data&&e.data.message||"request:fail";return n(new me({code:t,message:s}))}t({success:!0,result:e.data})}}))}))}setupRequest(e){const t=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};n["x-serverless-sign"]=Ee(t,this.config.clientSecret);const s=xe();n["x-client-info"]=encodeURIComponent(JSON.stringify(s));const{token:o}=ye();return n["x-client-token"]=o,{url:this.config.requestUrl,method:"POST",data:t,dataType:"json",header:JSON.parse(JSON.stringify(n))}}async setupLocalRequest(e){const t=xe(),{token:n}=ye(),s=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now(),clientInfo:t,token:n}),{address:o,servePort:i}=this.__dev__&&this.__dev__.debugInfo||{},{address:a}=await async function(e,t){let n;for(let s=0;s<e.length;s++){const o=e[s];if(await Mt(o,t)){n=o;break}}return{address:n,port:t}}(o,i);return{url:`http://${a}:${i}/${Rt[e.method]}`,method:"POST",data:s,dataType:"json",header:JSON.parse(JSON.stringify({"Content-Type":"application/json"}))}}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request(t,!1)}getUploadFileOptions(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(t)}reportUploadFile(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(t)}uploadFile({filePath:e,cloudPath:t,fileType:n="image",onUploadProgress:s}){if(!t)throw new me({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let o;return this.getUploadFileOptions({cloudPath:t}).then((t=>{const{url:i,formData:a,name:r}=t.result;return o=t.result.fileUrl,new Promise(((t,o)=>{const l=this.adapter.uploadFile({url:i,formData:a,name:r,filePath:e,fileType:n,success(e){e&&e.statusCode<400?t(e):o(new me({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){o(new me({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof s&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{s({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))})).then((()=>this.reportUploadFile({cloudPath:t}))).then((t=>new Promise(((n,s)=>{t.success?n({success:!0,filePath:e,fileID:o}):s(new me({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){const t={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};return this.request(t).then((e=>{if(e.success)return e.result;throw new me({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e,maxAge:t}={}){if(!Array.isArray(e)||0===e.length)throw new me({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const n={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e,maxAge:t})};return this.request(n).then((e=>{if(e.success)return{fileList:e.result.fileList.map((e=>({fileID:e.fileID,tempFileURL:e.tempFileURL})))};throw new me({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})}))}}(e),n={signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return n},t.customAuth=t.auth,t}},qt=S((function(e,t){e.exports=E.enc.Hex}));function jt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function zt(e="",t={}){const{data:n,functionName:s,method:o,headers:i,signHeaderKeys:a=[],config:r}=t,l=Date.now(),c=jt(),d=Object.assign({},i,{"x-from-app-id":r.spaceAppId,"x-from-env-id":r.spaceId,"x-to-env-id":r.spaceId,"x-from-instance-id":l,"x-from-function-name":s,"x-client-timestamp":l,"x-alipay-source":"client","x-request-id":c,"x-alipay-callid":c,"x-trace-id":c}),u=["x-from-app-id","x-from-env-id","x-to-env-id","x-from-instance-id","x-from-function-name","x-client-timestamp"].concat(a),[h="",p=""]=e.split("?")||[],m=function(e){const t=e.signedHeaders.join(";"),n=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),s=Oe(e.body).toString(qt),o=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${n}\n${t}\n${s}\n`,i=Oe(o).toString(qt),a=`HMAC-SHA256\n${e.timestamp}\n${i}\n`,r=Be(a,e.secretKey).toString(qt);return`HMAC-SHA256 Credential=${e.secretId}, SignedHeaders=${t}, Signature=${r}`}({path:h,query:p,method:o,headers:d,timestamp:l,body:JSON.stringify(n),secretId:r.accessKey,secretKey:r.secretKey,signedHeaders:u.sort()});return{url:`${r.endpoint}${e}`,headers:Object.assign({},d,{Authorization:m})}}function Kt({url:e,data:t,method:n="POST",headers:s={},timeout:o}){return new Promise(((i,a)=>{fe.request({url:e,method:n,data:"object"==typeof t?JSON.stringify(t):t,header:s,dataType:"json",timeout:o,complete:(e={})=>{const t=s["x-trace-id"]||"";if(!e.statusCode||e.statusCode>=400){const{message:n,errMsg:s,trace_id:o}=e.data||{};return a(new me({code:"SYS_ERR",message:n||s||"request:fail",requestId:o||t}))}i({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function Ht(e,t){const{path:n,data:s,method:o="GET"}=e,{url:i,headers:a}=zt(n,{functionName:"",data:s,method:o,headers:{"x-alipay-cloud-mode":"oss","x-data-api-type":"oss","x-expire-timestamp":Date.now()+6e4},signHeaderKeys:["x-data-api-type","x-expire-timestamp"],config:t});return Kt({url:i,data:s,method:o,headers:a}).then((e=>{const t=e.data||{};if(!t.success)throw new me({code:e.errCode,message:e.errMsg,requestId:e.requestId});return t.data||{}})).catch((e=>{throw new me({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}function Wt(e=""){const t=e.trim().replace(/^cloud:\/\//,""),n=t.indexOf("/");if(n<=0)throw new me({code:"INVALID_PARAM",message:"fileID不合法"});const s=t.substring(0,n),o=t.substring(n+1);return s!==this.config.spaceId&&console.warn("file ".concat(e," does not belong to env ").concat(this.config.spaceId)),o}function Jt(e=""){return"cloud://".concat(this.config.spaceId,"/").concat(e.replace(/^\/+/,""))}class Gt{constructor(e){this.config=e}signedURL(e,t={}){const n=`/ws/function/${e}`,s=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),o=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:jt(),timestamp:""+Date.now()}),i=[n,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map((function(e){return o[e]?"".concat(e,"=").concat(o[e]):null})).filter(Boolean).join("&"),`host:${s}`].join("\n"),a=["HMAC-SHA256",Oe(i).toString(qt)].join("\n"),r=Be(a,this.config.secretKey).toString(qt),l=Object.keys(o).map((e=>`${e}=${encodeURIComponent(o[e])}`)).join("&");return`${this.config.wsEndpoint}${n}?${l}&signature=${r}`}}var Yt={init:e=>{e.provider="alipay";const t=new class{constructor(e){if(["spaceId","spaceAppId","accessKey","secretKey"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),e.endpoint){if("string"!=typeof e.endpoint)throw new Error("endpoint must be string");if(!/^https:\/\//.test(e.endpoint))throw new Error("endpoint must start with https://");e.endpoint=e.endpoint.replace(/\/$/,"")}this.config=Object.assign({},e,{endpoint:e.endpoint||`https://${e.spaceId}.api-hz.cloudbasefunction.cn`,wsEndpoint:e.wsEndpoint||`wss://${e.spaceId}.api-hz.cloudbasefunction.cn`}),this._websocket=new Gt(this.config)}callFunction(e){return function(e,t){const{name:n,data:s,async:o=!1,timeout:i}=e,a="POST",r={"x-to-function-name":n};o&&(r["x-function-invoke-type"]="async");const{url:l,headers:c}=zt("/functions/invokeFunction",{functionName:n,data:s,method:a,headers:r,signHeaderKeys:["x-to-function-name"],config:t});return Kt({url:l,data:s,method:a,headers:c,timeout:i}).then((e=>{let t=0;if(o){const n=e.data||{};t="200"===n.errCode?0:n.errCode,e.data=n.data||{},e.errMsg=n.errMsg}if(0!==t)throw new me({code:t,message:e.errMsg,requestId:e.requestId});return{errCode:t,success:0===t,requestId:e.requestId,result:e.data}})).catch((e=>{throw new me({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}(e,this.config)}uploadFileToOSS({url:e,filePath:t,fileType:n,formData:s,onUploadProgress:o}){return new Promise(((i,a)=>{const r=fe.uploadFile({url:e,filePath:t,fileType:n,formData:s,name:"file",success(e){e&&e.statusCode<400?i(e):a(new me({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(new me({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof o&&r&&"function"==typeof r.onProgressUpdate&&r.onProgressUpdate((e=>{o({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}async uploadFile({filePath:e,cloudPath:t="",fileType:n="image",onUploadProgress:s}){if("string"!==A(t))throw new me({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new me({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new me({code:"INVALID_PARAM",message:"cloudPath不合法"});const o=await Ht({path:"/".concat(t.replace(/^\//,""),"?post_url")},this.config),{file_id:i,upload_url:a,form_data:r}=o,l=r&&r.reduce(((e,t)=>(e[t.key]=t.value,e)),{});return this.uploadFileToOSS({url:a,filePath:e,fileType:n,formData:l,onUploadProgress:s}).then((()=>({fileID:i})))}async getTempFileURL({fileList:e}){return new Promise(((t,n)=>{(!e||e.length<0)&&t({code:"INVALID_PARAM",message:"fileList不能为空数组"}),e.length>50&&t({code:"INVALID_PARAM",message:"fileList数组长度不能超过50"});const s=[];for(const i of e){let e;"string"!==A(i)&&t({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});try{e=Wt.call(this,i)}catch(o){console.warn(o.errCode,o.errMsg),e=i}s.push({file_id:e,expire:600})}Ht({path:"/?download_url",data:{file_list:s},method:"POST"},this.config).then((e=>{const{file_list:n=[]}=e;t({fileList:n.map((e=>({fileID:Jt.call(this,e.file_id),tempFileURL:e.download_url})))})})).catch((e=>n(e)))}))}async connectWebSocket(e){const{name:t,query:n}=e;return fe.connectSocket({url:this._websocket.signedURL(t,n),complete:()=>{}})}}(e);return t.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},t}};function Qt({data:e}){let t;t=xe();const n=JSON.parse(JSON.stringify(e||{}));if(Object.assign(n,{clientInfo:t}),!n.uniIdToken){const{token:e}=ye();e&&(n.uniIdToken=e)}return n}const Xt=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Zt=/[\\^$.*+?()[\]{}|]/g,en=RegExp(Zt.source);function tn(e,t,n){return e.replace(new RegExp((s=t)&&en.test(s)?s.replace(Zt,"\\$&"):s,"g"),n);var s}const nn=2e4,sn={code:20101,message:"Invalid client"};function on(e){const{errSubject:t,subject:n,errCode:s,errMsg:o,code:i,message:a,cause:r}=e||{};return new me({subject:t||n||"uni-secure-network",code:s||i||nn,message:o||a,cause:r})}let an;function rn({secretType:e}={}){return"request"===e||"response"===e||"both"===e}function ln({name:e,data:t={}}={}){return"DCloud-clientDB"===e&&"encryption"===t.redirectTo&&"getAppClientKey"===t.action}function cn({functionName:e,result:t,logPvd:n}){}function dn(e){const t=e.callFunction,n=function(n){const s=n.name;n.data=Qt.call(e,{data:n.data});const o={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],i=rn(n),a=ln(n),r=i||a;return t.call(this,n).then((e=>(e.errCode=0,!r&&cn.call(this,{functionName:s,result:e,logPvd:o}),Promise.resolve(e))),(e=>(!r&&cn.call(this,{functionName:s,result:e,logPvd:o}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:n=[]}={}){for(let s=0;s<n.length;s++){const{rule:o,content:i,mode:a}=n[s],r=e.match(o);if(!r)continue;let l=i;for(let e=1;e<r.length;e++)l=tn(l,`{$${e}}`,r[e]);for(const e in t)l=tn(l,`{${e}}`,t[e]);return"replace"===a?l:e+l}return e}({message:`[${n.name}]: ${e.message}`,formatter:Xt,extraInfo:{functionName:s}})),Promise.reject(e))))};e.callFunction=function(t){const{provider:s,spaceId:o}=e.config,i=t.name;let a,r;return t.data=t.data||{},a=n,a=a.bind(e),r=ln(t)?n.call(e,t):rn(t)?new an({secretType:t.secretType,uniCloudIns:e}).wrapEncryptDataCallFunction(n.bind(e))(t):function({provider:e,spaceId:t,functionName:n}={}){const{appId:s,uniPlatform:o,osName:i}=ke();let a=o;"app"===o&&(a=i);const r=function({provider:e,spaceId:t}={}){const n=R;if(!n)return{};e=function(e){return"tencent"===e?"tcb":e}(e);const s=n.find((n=>n.provider===e&&n.spaceId===t));return s&&s.config}({provider:e,spaceId:t});if(!r||!r.accessControl||!r.accessControl.enable)return!1;const l=r.accessControl.function||{},c=Object.keys(l);if(0===c.length)return!0;const d=function(e,t){let n,s,o;for(let i=0;i<e.length;i++){const a=e[i];a!==t?"*"!==a?a.split(",").map((e=>e.trim())).indexOf(t)>-1&&(s=a):o=a:n=a}return n||s||o}(c,n);if(!d)return!1;if((l[d]||[]).find(((e={})=>e.appId===s&&(e.platform||"").toLowerCase()===a.toLowerCase())))return!0;throw console.error(`此应用[appId: ${s}, platform: ${a}]不在云端配置的允许访问的应用列表内参考https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),on(sn)}({provider:s,spaceId:o,functionName:i})?new an({secretType:t.secretType,uniCloudIns:e}).wrapVerifyClientCallFunction(n.bind(e))(t):a(t),Object.defineProperty(r,"result",{get:()=>(console.warn("当前返回结果为Promise类型不可直接访问其result属性详情请参考https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),r.then((e=>("undefined"!=typeof UTSJSONObject&&(e.result=new UTSJSONObject(e.result)),e)))}}an=class{constructor(){throw on({message:"Platform app is not enabled, please check whether secure network module is enabled in your manifest.json"})}};const un=Symbol("CLIENT_DB_INTERNAL");function hn(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=un,e.inspect=null,e.__v_raw=void 0,new Proxy(e,{get(e,n,s){if("_uniClient"===n)return null;if("symbol"==typeof n)return e[n];if(n in e||"string"!=typeof n){const t=e[n];return"function"==typeof t?t.bind(e):t}return t.get(e,n,s)}})}function pn(e){return{on:(t,n)=>{e[t]=e[t]||[],e[t].indexOf(n)>-1||e[t].push(n)},off:(t,n)=>{e[t]=e[t]||[];const s=e[t].indexOf(n);-1!==s&&e[t].splice(s,1)}}}const mn=["db.Geo","db.command","command.aggregate"];function fn(e,t){return mn.indexOf(`${e}.${t}`)>-1}function gn(e){switch(A(e=ge(e))){case"array":return e.map((e=>gn(e)));case"object":return e._internalType===un||Object.keys(e).forEach((t=>{e[t]=gn(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function yn(e){return e&&e.content&&e.content.$method}class vn{constructor(e,t,n){this.content=e,this.prevStage=t||null,this.udb=null,this._database=n}toJSON(){let e=this;const t=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map((e=>({$method:e.$method,$param:gn(e.$param)})))}}toString(){return JSON.stringify(this.toJSON())}getAction(){const e=this.toJSON().$db.find((e=>"action"===e.$method));return e&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter((e=>"action"!==e.$method))}}get isAggregate(){let e=this;for(;e;){const t=yn(e),n=yn(e.prevStage);if("aggregate"===t&&"collection"===n||"pipeline"===t)return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if("command"===yn(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=yn(e),n=yn(e.prevStage);if("aggregate"===t&&"command"===n)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return wn({$method:e,$param:gn(Array.from(arguments))},t,t._database)}}get count(){return this.isAggregate?this.getNextStageFn("count"):function(){return this._send("count",Array.from(arguments))}}get remove(){return this.isCommand?this.getNextStageFn("remove"):function(){return this._send("remove",Array.from(arguments))}}get(){return this._send("get",Array.from(arguments))}get add(){return this.isCommand?this.getNextStageFn("add"):function(){return this._send("add",Array.from(arguments))}}update(){return this._send("update",Array.from(arguments))}end(){return this._send("end",Array.from(arguments))}get set(){return this.isCommand?this.getNextStageFn("set"):function(){throw new Error("JQL禁止使用set方法")}}_send(e,t){const n=this.getAction(),s=this.getCommand();return s.$db.push({$method:e,$param:gn(t)}),this._database._callCloudFunction({action:n,command:s})}}function wn(e,t,n){return hn(new vn(e,t,n),{get(e,t){let s="db";return e&&e.content&&(s=e.content.$method),fn(s,t)?wn({$method:t},e,n):function(){return wn({$method:t,$param:gn(Array.from(arguments))},e,n)}}})}function _n({path:e,method:t}){return class{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...e.map((e=>({$method:e}))),{$method:t,$param:this.param}]}}toString(){return JSON.stringify(this.toJSON())}}}function kn(e,t={}){return hn(new e(t),{get:(e,t)=>fn("db",t)?wn({$method:t},null,e):function(){return wn({$method:t,$param:gn(Array.from(arguments))},null,e)}})}class bn extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=K("_globalUniCloudDatabaseCallback")),t||(this.auth=pn(this._authCallBacks)),this._isJQL=t,Object.assign(this,pn(this._dbCallBacks)),this.env=hn({},{get:(e,t)=>({$env:t})}),this.Geo=hn({},{get:(e,t)=>_n({path:["Geo"],method:t})}),this.serverDate=_n({path:[],method:"serverDate"}),this.RegExp=_n({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeof e||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const n=this._dbCallBacks;n[e]&&n[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){const n=this._authCallBacks;n[e]&&n[e].forEach((e=>{e(...t)}))}multiSend(){const e=Array.from(arguments),t=e.map((e=>{const t=e.getAction(),n=e.getCommand();if("getTemp"!==n.$db[n.$db.length-1].$method)throw new Error("multiSend只支持子命令内使用getTemp");return{action:t,command:n}}));return this._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:n,queryList:s}){function o(e,t){if(n&&s)for(let n=0;n<s.length;n++){const o=s[n];o.udb&&"function"==typeof o.udb.setResult&&(t?o.udb.setResult(t):o.udb.setResult(e.result.dataList[n]))}}const i=this,a=this._isJQL?"databaseForJQL":"database";function r(e){return i._callback("error",[e]),Y(Q(a,"fail"),e).then((()=>Y(Q(a,"complete"),e))).then((()=>(o(null,e),ce(ee,{type:se,content:e}),Promise.reject(e))))}const l=Y(Q(a,"invoke")),c=this._uniClient;return l.then((()=>c.callFunction({name:"DCloud-clientDB",type:"CLIENT_DB",data:{action:e,command:t,multiCommand:n}}))).then((e=>{const{code:t,message:n,token:s,tokenExpired:l,systemInfo:c=[]}=e.result;if(c)for(let o=0;o<c.length;o++){const{level:e,message:t,detail:n}=c[o],s=console["warn"===e?"error":e]||console.log;let i="[System Info]"+t;n&&(i=`${i}\n详细信息:${n}`),s(i)}if(t)return r(new me({code:t,message:n,requestId:e.requestId}));e.result.errCode=e.result.errCode||e.result.code,e.result.errMsg=e.result.errMsg||e.result.message,s&&l&&(ve({token:s,tokenExpired:l}),this._callbackAuth("refreshToken",[{token:s,tokenExpired:l}]),this._callback("refreshToken",[{token:s,tokenExpired:l}]),ce(ne,{token:s,tokenExpired:l}));const d=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用请使用errCode替代"},{prop:"message",tips:"message不再推荐使用请使用errMsg替代"}];for(let o=0;o<d.length;o++){const{prop:t,tips:n}=d[o];if(t in e.result){const s=e.result[t];Object.defineProperty(e.result,t,{get:()=>(console.warn(n),s)})}}return u=e,Y(Q(a,"success"),u).then((()=>Y(Q(a,"complete"),u))).then((()=>{o(u,null);const e=i._parseResult(u);return ce(ee,{type:se,content:e}),Promise.resolve(e)}));var u}),(e=>(/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化请在web控制台保存一次schema以开启clientDB"),r(new me({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const Sn="token无效跳转登录页面",xn="token过期跳转登录页面",En={TOKEN_INVALID_TOKEN_EXPIRED:xn,TOKEN_INVALID_INVALID_CLIENTID:Sn,TOKEN_INVALID:Sn,TOKEN_INVALID_WRONG_TOKEN:Sn,TOKEN_INVALID_ANONYMOUS_USER:Sn},Nn={"uni-id-token-expired":xn,"uni-id-check-token-failed":Sn,"uni-id-token-not-exist":Sn,"uni-id-check-device-feature-failed":Sn};function Cn(e,t){let n="";return n=e?`${e}/${t}`:t,n.replace(/^\//,"")}function Tn(e=[],t=""){const n=[],s=[];return e.forEach((e=>{!0===e.needLogin?n.push(Cn(t,e.path)):!1===e.needLogin&&s.push(Cn(t,e.path))})),{needLoginPage:n,notNeedLoginPage:s}}function Pn(e){return e.split("?")[0].replace(/^\//,"")}function In(){return function(e){let t=e&&e.$page&&e.$page.fullPath||"";return t?("/"!==t.charAt(0)&&(t="/"+t),t):t}(function(){const e=getCurrentPages();return e[e.length-1]}())}function Vn(){return Pn(In())}function An(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const n=t.list,s=Pn(e);return n.some((e=>e.pagePath===s))}const Dn=!!b.uniIdRouter,{loginPage:On,routerNeedLogin:Bn,resToLogin:Ln,needLoginPage:Fn,notNeedLoginPage:Un,loginPageInTabBar:Mn}=function({pages:e=[],subPackages:t=[],uniIdRouter:n={},tabBar:s={}}=b){const{loginPage:o,needLogin:i=[],resToLogin:a=!0}=n,{needLoginPage:r,notNeedLoginPage:l}=Tn(e),{needLoginPage:c,notNeedLoginPage:d}=function(e=[]){const t=[],n=[];return e.forEach((e=>{const{root:s,pages:o=[]}=e,{needLoginPage:i,notNeedLoginPage:a}=Tn(o,s);t.push(...i),n.push(...a)})),{needLoginPage:t,notNeedLoginPage:n}}(t);return{loginPage:o,routerNeedLogin:i,resToLogin:a,needLoginPage:[...r,...c],notNeedLoginPage:[...l,...d],loginPageInTabBar:An(o,s)}}();if(Fn.indexOf(On)>-1)throw new Error(`Login page [${On}] should not be "needLogin", please check your pages.json`);function Rn(e){const t=Vn();if("/"===e.charAt(0))return e;const[n,s]=e.split("?"),o=n.replace(/^\//,"").split("/"),i=t.split("/");i.pop();for(let a=0;a<o.length;a++){const e=o[a];".."===e?i.pop():"."!==e&&i.push(e)}return""===i[0]&&i.shift(),"/"+i.join("/")+(s?"?"+s:"")}function $n({redirect:e}){const t=Pn(e),n=Pn(On);return Vn()!==n&&t!==n}function qn({api:e,redirect:t}={}){if(!t||!$n({redirect:t}))return;const n=(o=t,"/"!==(s=On).charAt(0)&&(s="/"+s),o?s.indexOf("?")>-1?s+`&uniIdRedirectUrl=${encodeURIComponent(o)}`:s+`?uniIdRedirectUrl=${encodeURIComponent(o)}`:s);var s,o;Mn?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo");const i={navigateTo:uni.navigateTo,redirectTo:uni.redirectTo,switchTab:uni.switchTab,reLaunch:uni.reLaunch};setTimeout((()=>{i[e]({url:n})}),0)}function jn({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},n=function(){const{token:e,tokenExpired:t}=ye();let n;if(e){if(t<Date.now()){const e="uni-id-token-expired";n={errCode:e,errMsg:Nn[e]}}}else{const e="uni-id-check-token-failed";n={errCode:e,errMsg:Nn[e]}}return n}();if(function(e){const t=Pn(Rn(e));return!(Un.indexOf(t)>-1)&&(Fn.indexOf(t)>-1||Bn.some((t=>{return n=e,new RegExp(t).test(n);var n})))}(e)&&n){if(n.uniIdRedirectUrl=e,ae(te).length>0)return setTimeout((()=>{ce(te,n)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function zn(){!function(){const e=In(),{abortLoginPageJump:t,autoToLoginPage:n}=jn({url:e});t||n&&qn({api:"redirectTo",redirect:e})}();const e=["navigateTo","redirectTo","reLaunch","switchTab"];for(let t=0;t<e.length;t++){const n=e[t];uni.addInterceptor(n,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:s}=jn({url:e.url});return t?e:s?(qn({api:n,redirect:Rn(e.url)}),!1):e}})}}function Kn(){this.onResponse((e=>{const{type:t,content:n}=e;let s=!1;switch(t){case"cloudobject":s=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in Nn}(n);break;case"clientdb":s=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in En}(n)}s&&function(e={}){const t=ae(te);he().then((()=>{const n=In();if(n&&$n({redirect:n}))return t.length>0?ce(te,Object.assign({uniIdRedirectUrl:n},e)):void(On&&qn({api:"navigateTo",redirect:n}))}))}(n)}))}function Hn(e){var t;(t=e).onResponse=function(e){re(ee,e)},t.offResponse=function(e){le(ee,e)},function(e){e.onNeedLogin=function(e){re(te,e)},e.offNeedLogin=function(e){le(te,e)},Dn&&(K("_globalUniCloudStatus").needLoginInit||(K("_globalUniCloudStatus").needLoginInit=!0,he().then((()=>{zn.call(e)})),Ln&&Kn.call(e)))}(e),function(e){e.onRefreshToken=function(e){re(ne,e)},e.offRefreshToken=function(e){le(ne,e)}}(e)}let Wn;const Jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Gn=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Yn(){const e=ye().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let n;try{n=JSON.parse((s=t[1],decodeURIComponent(Wn(s).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(o){throw new Error("获取当前用户信息出错,详细错误信息为:"+o.message)}var s;return n.tokenExpired=1e3*n.exp,delete n.exp,delete n.iat,n}Wn="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Gn.test(e))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,s,o="",i=0;i<e.length;)t=Jn.indexOf(e.charAt(i++))<<18|Jn.indexOf(e.charAt(i++))<<12|(n=Jn.indexOf(e.charAt(i++)))<<6|(s=Jn.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===s?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}:atob;var Qn=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n="chooseAndUploadFile:ok",s="chooseAndUploadFile:fail";function o(e,t){return e.tempFiles.forEach(((e,n)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+n+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function i(e,t,{onChooseFile:s,onUploadProgress:o}){return t.then((e=>{if(s){const t=s(e);if(void 0!==t)return Promise.resolve(t).then((t=>void 0===t?e:t))}return e})).then((t=>!1===t?{errMsg:n,tempFilePaths:[],tempFiles:[]}:function(e,t,s=5,o){(t=Object.assign({},t)).errMsg=n;const i=t.tempFiles,a=i.length;let r=0;return new Promise((n=>{for(;r<s;)l();function l(){const s=r++;if(s>=a)return void(!i.find((e=>!e.url&&!e.errMsg))&&n(t));const c=i[s];e.uploadFile({provider:c.provider,filePath:c.path,cloudPath:c.cloudPath,fileType:c.fileType,cloudPathAsRealPath:c.cloudPathAsRealPath,onUploadProgress(e){e.index=s,e.tempFile=c,e.tempFilePath=c.path,o&&o(e)}}).then((e=>{c.url=e.fileID,s<a&&l()})).catch((e=>{c.errMsg=e.errMsg||e.message,s<a&&l()}))}}))}(e,t,5,o)))}t.initChooseAndUploadFile=function(e){return function(t={type:"all"}){return"image"===t.type?i(e,function(e){const{count:t,sizeType:n,sourceType:i=["album","camera"],extension:a}=e;return new Promise(((e,r)=>{uni.chooseImage({count:t,sizeType:n,sourceType:i,extension:a,success(t){e(o(t,"image"))},fail(e){r({errMsg:e.errMsg.replace("chooseImage:fail",s)})}})}))}(t),t):"video"===t.type?i(e,function(e){const{camera:t,compressed:n,maxDuration:i,sourceType:a=["album","camera"],extension:r}=e;return new Promise(((e,l)=>{uni.chooseVideo({camera:t,compressed:n,maxDuration:i,sourceType:a,extension:r,success(t){const{tempFilePath:n,duration:s,size:i,height:a,width:r}=t;e(o({errMsg:"chooseVideo:ok",tempFilePaths:[n],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:n,size:i,type:t.tempFile&&t.tempFile.type||"",width:r,height:a,duration:s,fileType:"video",cloudPath:""}]},"video"))},fail(e){l({errMsg:e.errMsg.replace("chooseVideo:fail",s)})}})}))}(t),t):i(e,function(e){const{count:t,extension:n}=e;return new Promise(((e,i)=>{let a=uni.chooseFile;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(a=wx.chooseMessageFile),"function"!=typeof a)return i({errMsg:s+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});a({type:"all",count:t,extension:n,success(t){e(o(t))},fail(e){i({errMsg:e.errMsg.replace("chooseFile:fail",s)})}})}))}(t),t)}}})));function Xn(e){return{props:{localdata:{type:Array,default:()=>[]},options:{type:[Object,Array],default:()=>({})},spaceInfo:{type:Object,default:()=>({})},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:()=>({mixinDatacomLoading:!1,mixinDatacomHasMore:!1,mixinDatacomResData:[],mixinDatacomErrorMessage:"",mixinDatacomPage:{},mixinDatacomError:null}),created(){this.mixinDatacomPage={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch((()=>{var e=[];return["pageCurrent","pageSize","localdata","collection","action","field","orderby","where","getont","getcount","gettree","groupby","groupField","distinct"].forEach((t=>{e.push(this[t])})),e}),((e,t)=>{if("manual"===this.loadtime)return;let n=!1;const s=[];for(let o=2;o<e.length;o++)e[o]!==t[o]&&(s.push(e[o]),n=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(n,s)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:n}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomError=null,this.mixinDatacomGet().then((n=>{this.mixinDatacomLoading=!1;const{data:s,count:o}=n.result;this.getcount&&(this.mixinDatacomPage.count=o),this.mixinDatacomHasMore=s.length<this.pageSize;const i=e?s.length?s[0]:void 0:s;this.mixinDatacomResData=i,t&&t(i)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,this.mixinDatacomError=e,n&&n(e)})))},mixinDatacomGet(t={}){let n;t=t||{},n="undefined"!=typeof __uniX&&__uniX?e.databaseForJQL(this.spaceInfo):e.database(this.spaceInfo);const s=t.action||this.action;s&&(n=n.action(s));const o=t.collection||this.collection;n=Array.isArray(o)?n.collection(...o):n.collection(o);const i=t.where||this.where;i&&Object.keys(i).length&&(n=n.where(i));const a=t.field||this.field;a&&(n=n.field(a));const r=t.foreignKey||this.foreignKey;r&&(n=n.foreignKey(r));const l=t.groupby||this.groupby;l&&(n=n.groupBy(l));const c=t.groupField||this.groupField;c&&(n=n.groupField(c)),!0===(void 0!==t.distinct?t.distinct:this.distinct)&&(n=n.distinct());const d=t.orderby||this.orderby;d&&(n=n.orderBy(d));const u=void 0!==t.pageCurrent?t.pageCurrent:this.mixinDatacomPage.current,h=void 0!==t.pageSize?t.pageSize:this.mixinDatacomPage.size,p=void 0!==t.getcount?t.getcount:this.getcount,m=void 0!==t.gettree?t.gettree:this.gettree,f=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,g={getCount:p},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return m&&(g.getTree=y),f&&(g.getTreePath=y),n=n.skip(h*(u-1)).limit(h).get(g),n}}}}function Zn(e){return K("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function es({openid:e,callLoginByWeixin:t=!1}={}){throw Zn(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `app`")}async function ts(e){const t=Zn(this);return t.initPromise||(t.initPromise=es.call(this,e).then((e=>e)).catch((e=>{throw delete t.initPromise,e}))),t.initPromise}function ns(e){Se=e}function ss(e){const t={getSystemInfo:uni.getSystemInfo,getPushClientId:uni.getPushClientId};return function(n){return new Promise(((s,o)=>{t[e]({...n,success(e){s(e)},fail(e){o(e)}})}))}}class os extends class{constructor(){this._callback={}}addListener(e,t){this._callback[e]||(this._callback[e]=[]),this._callback[e].push(t)}on(e,t){return this.addListener(e,t)}removeListener(e,t){if(!t)throw new Error('The "listener" argument must be of type function. Received undefined');const n=this._callback[e];if(!n)return;const s=function(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t)return n;return-1}(n,t);n.splice(s,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const n=this._callback[e];if(n)for(let s=0;s<n.length;s++)n[s](...t)}}{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([ss("getSystemInfo")(),ss("getPushClientId")()]).then((([{appId:e}={},{cid:t}={}]=[])=>{if(!e)throw new Error("Invalid appId, please check the manifest.json file");if(!t)throw new Error("Invalid push client id");this._appId=e,this._pushClientId=t,this._seqId=Date.now()+"-"+Math.floor(9e5*Math.random()+1e5),this.emit("open"),this._initMessageListener()}),(e=>{throw this.emit("error",e),this.close(),e}))}async open(){return this.init()}_isUniCloudSSE(e){if("receive"!==e.type)return!1;const t=e&&e.data&&e.data.payload;return!(!t||"UNI_CLOUD_SSE"!==t.channel||t.seqId!==this._seqId)}_receivePushMessage(e){if(!this._isUniCloudSSE(e))return;const t=e&&e.data&&e.data.payload,{action:n,messageId:s,message:o}=t;this._payloadQueue.push({action:n,messageId:s,message:o}),this._consumMessage()}_consumMessage(){for(;;){const e=this._payloadQueue.find((e=>e.messageId===this._currentMessageId+1));if(!e)break;this._currentMessageId++,this._parseMessagePayload(e)}}_parseMessagePayload(e){const{action:t,messageId:n,message:s}=e;"end"===t?this._end({messageId:n,message:s}):"message"===t&&this._appendMessage({messageId:n,message:s})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){uni.onPushMessage(this._uniPushMessageCallback)}_destroy(){uni.offPushMessage(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}const is={tcb:Ut,tencent:Ut,aliyun:Te,private:$t,dcloud:$t,alipay:Yt};let as=new class{init(e){let t={};const n=is[e.provider];if(!n)throw new Error("未提供正确的provider参数");var s;return t=n.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new U({createPromise:function(){let t=Promise.resolve();t=new Promise((e=>{setTimeout((()=>{e()}),1)}));const n=e.auth();return t.then((()=>n.getLoginState())).then((e=>e?Promise.resolve():n.signInAnonymously()))}}))}(t),dn(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(s=t).database=function(e){if(e&&Object.keys(e).length>0)return s.init(e).database();if(this._database)return this._database;const t=kn(bn,{uniClient:s});return this._database=t,t},s.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return s.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=kn(bn,{uniClient:s,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=Yn,e.chooseAndUploadFile=Qn.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return Xn(e)}}),e.SSEChannel=os,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:n=!1}={}){return ts.call(e,{openid:t,callLoginByWeixin:n})}}(e),e.setCustomClientInfo=ns,e.importObject=function(t){return function(n,s={}){s=function(e,t={}){return e.customUI=t.customUI||e.customUI,e.parseSystemError=t.parseSystemError||e.parseSystemError,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeof t.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},s);const{customUI:o,loadingOptions:i,errorOptions:a,parseSystemError:r}=s,l=!o;return new Proxy({},{get(o,c){switch(c){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:e,interceptorName:t,getCallbackArgs:n}={}){return async function(...s){const o=n?n({params:s}):{};let i,a;try{return await Y(Q(t,"invoke"),{...o}),i=await e(...s),await Y(Q(t,"success"),{...o,result:i}),i}catch(r){throw a=r,await Y(Q(t,"fail"),{...o,error:a}),a}finally{await Y(Q(t,"complete"),a?{...o,error:a}:{...o,result:i})}}}({fn:async function o(...d){let u;l&&uni.showLoading({title:i.title,mask:i.mask});const h={name:n,type:"OBJECT",data:{method:c,params:d}};"object"==typeof s.secretMethods&&function(e,t){const n=t.data.method,s=e.secretMethods||{},o=s[n]||s["*"];o&&(t.secretType=o)}(s,h);let p=!1;try{u=await t.callFunction(h)}catch(e){p=!0,u={result:new me(e)}}const{errSubject:m,errCode:f,errMsg:g,newToken:y}=u.result||{};if(l&&uni.hideLoading(),y&&y.token&&y.tokenExpired&&(ve(y),ce(ne,{...y})),f){let e=g;if(p&&r&&(e=(await r({objectName:n,methodName:c,params:d,errSubject:m,errCode:f,errMsg:g})).errMsg||g),l)if("toast"===a.type)uni.showToast({title:e,icon:"none"});else{if("modal"!==a.type)throw new Error(`Invalid errorOptions.type: ${a.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel:n,cancelText:s,confirmText:o}={}){return new Promise(((i,a)=>{uni.showModal({title:e,content:t,showCancel:n,cancelText:s,confirmText:o,success(e){i(e)},fail(){i({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:a.retry,cancelText:"取消",confirmText:a.retry?"重试":"确定"});if(a.retry&&t)return o(...d)}}const t=new me({subject:m,code:f,message:g,requestId:u.requestId});throw t.detail=u.result,ce(ee,{type:ie,content:t}),t}return ce(ee,{type:ie,content:u.result}),u.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:n,methodName:c,params:e}}})}})}}(e)}(t),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;const n=t[e];t[e]=function(){return n.apply(t,Array.from(arguments))},t[e]=function(e,t){return function(n){let s=!1;if("callFunction"===t){const e=n&&n.type||P;s=e!==P}const o="callFunction"===t&&!s,i=this._initPromiseHub.exec();n=n||{};const{success:a,fail:r,complete:l}=pe(n),c=i.then((()=>s?Promise.resolve():Y(Q(t,"invoke"),n))).then((()=>e.call(this,n))).then((e=>s?Promise.resolve(e):Y(Q(t,"success"),e).then((()=>Y(Q(t,"complete"),e))).then((()=>(o&&ce(ee,{type:oe,content:e}),Promise.resolve(e))))),(e=>s?Promise.reject(e):Y(Q(t,"fail"),e).then((()=>Y(Q(t,"complete"),e))).then((()=>(ce(ee,{type:oe,content:e}),Promise.reject(e))))));if(!(a||r||l))return c;c.then((e=>{a&&a(e),l&&l(e),o&&ce(ee,{type:oe,content:e})}),(e=>{r&&r(e),l&&l(e),o&&ce(ee,{type:oe,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=$;let t={};if(e&&1===e.length)t=e[0],as=as.init(t),as._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];let n;n=e&&e.length>0?"应用有多个服务空间请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间请在uniCloud目录右键关联服务空间",t.forEach((e=>{as[e]=function(){return console.error(n),Promise.reject(new me({code:"SYS_ERR",message:n}))}}))}Object.assign(as,{get mixinDatacom(){return Xn(as)}}),Hn(as),as.addInterceptor=J,as.removeInterceptor=G,as.interceptObject=X,uni.__uniCloud=as;{const e=j||(j=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;function e(){return this}return void 0!==e()?e():new Function("return this")()}(),j);e.uniCloud=as,e.UniCloudError=me}})();var rs=as;const ls="chooseAndUploadFile:fail";function cs(e,t){return e.tempFiles.forEach(((e,n)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+n+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function ds(e,t=5,n){const s=(e=JSON.parse(JSON.stringify(e))).length;let o=0,i=this;return new Promise((a=>{for(;o<t;)r();function r(){let t=o++;if(t>=s)return void(!e.find((e=>!e.url&&!e.errMsg))&&a(e));const l=e[t],c=i.files.findIndex((e=>e.uuid===l.uuid));l.url="",delete l.errMsg,rs.uploadFile({filePath:l.path,cloudPath:l.cloudPath,fileType:l.fileType,onUploadProgress:e=>{e.index=c,n&&n(e)}}).then((e=>{l.url=e.fileID,l.index=c,t<s&&r()})).catch((e=>{l.errMsg=e.errMsg||e.message,l.index=c,t<s&&r()}))}}))}function us(e,{onChooseFile:t,onUploadProgress:n}){return e.then((e=>{if(t){const n=t(e);if(void 0!==n)return Promise.resolve(n).then((t=>void 0===t?e:t))}return e})).then((e=>!1===e?{errMsg:"chooseAndUploadFile:ok",tempFilePaths:[],tempFiles:[]}:e))}function hs(e={type:"all"}){return"image"===e.type?us(function(e){const{count:t,sizeType:n=["original","compressed"],sourceType:s,extension:o}=e;return new Promise(((e,i)=>{uni.chooseImage({count:t,sizeType:n,sourceType:s,extension:o,success(t){e(cs(t,"image"))},fail(e){i({errMsg:e.errMsg.replace("chooseImage:fail",ls)})}})}))}(e),e):"video"===e.type?us(function(e){const{count:t,camera:n,compressed:s,maxDuration:o,sourceType:i,extension:a}=e;return new Promise(((e,t)=>{uni.chooseVideo({camera:n,compressed:s,maxDuration:o,sourceType:i,extension:a,success(t){const{tempFilePath:n,duration:s,size:o,height:i,width:a}=t;e(cs({errMsg:"chooseVideo:ok",tempFilePaths:[n],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:n,size:o,type:t.tempFile&&t.tempFile.type||"",width:a,height:i,duration:s,fileType:"video",cloudPath:""}]},"video"))},fail(e){t({errMsg:e.errMsg.replace("chooseVideo:fail",ls)})}})}))}(e),e):us(function(e){const{count:t,extension:n}=e;return new Promise(((e,s)=>{let o=uni.chooseFile;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(o=wx.chooseMessageFile),"function"!=typeof o)return s({errMsg:ls+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});o({type:"all",count:t,extension:n,success(t){e(cs(t))},fail(e){s({errMsg:e.errMsg.replace("chooseFile:fail",ls)})}})}))}(e),e)}const ps=e=>{const t=e.lastIndexOf("."),n=e.length;return{name:e.substring(0,t),ext:e.substring(t+1,n)}},ms=e=>{if(Array.isArray(e))return e;return e.replace(/(\[|\])/g,"").split(",")},fs=async(e,t="image")=>{const n=ps(e.name).ext.toLowerCase();let s={name:e.name,uuid:e.uuid,extname:n||"",cloudPath:e.cloudPath,fileType:e.fileType,thumbTempFilePath:e.thumbTempFilePath,url:e.path||e.path,size:e.size,image:{},path:e.path,video:{}};if("image"===t){const t=await(o=e.path,new Promise(((e,t)=>{uni.getImageInfo({src:o,success(t){e(t)},fail(e){t(e)}})})));delete s.video,s.image.width=t.width,s.image.height=t.height,s.image.location=t.path}else delete s.image;var o;return s};const gs=i({name:"uniFilePicker",components:{uploadImage:i({name:"uploadImage",emits:["uploadFiles","choose","delFile"],props:{filesList:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},disablePreview:{type:Boolean,default:!1},limit:{type:[Number,String],default:9},imageStyles:{type:Object,default:()=>({width:"auto",height:"auto",border:{}})},delIcon:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1}},computed:{styles(){return Object.assign({width:"auto",height:"auto",border:{}},this.imageStyles)},boxStyle(){const{width:e="auto",height:t="auto"}=this.styles;let n={};"auto"===t?"auto"!==e?(n.height=this.value2px(e),n["padding-top"]=0):n.height=0:(n.height=this.value2px(t),n["padding-top"]=0),n.width="auto"===e?"auto"!==t?this.value2px(t):"33.3%":this.value2px(e);let s="";for(let o in n)s+=`${o}:${n[o]};`;return s},borderStyle(){let{border:e}=this.styles,t={};if("boolean"==typeof e)t.border=e?"1px #eee solid":"none";else{let n=e&&e.width||1;n=this.value2px(n);let s=e&&e.radius||3;s=this.value2px(s),t={"border-width":n,"border-style":e&&e.style||"solid","border-color":e&&e.color||"#eee","border-radius":s}}let n="";for(let s in t)n+=`${s}:${t[s]};`;return n}},methods:{uploadFiles(e,t){this.$emit("uploadFiles",e)},choose(){this.$emit("choose")},delFile(e){this.$emit("delFile",e)},prviewImage(e,t){let n=[];1===Number(this.limit)&&this.disablePreview&&!this.disabled&&this.$emit("choose"),this.disablePreview||(this.filesList.forEach((e=>{n.push(e.url)})),uni.previewImage({urls:n,current:t}))},value2px:e=>("number"==typeof e?e+="px":-1===e.indexOf("%")&&(e=-1!==e.indexOf("px")?e:e+"px"),e)}},[["render",function(t,n,s,o,i,a){return e.openBlock(),e.createElementBlock("view",{class:"uni-file-picker__container"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.filesList,((t,n)=>(e.openBlock(),e.createElementBlock("view",{class:"file-picker__box",key:n,style:e.normalizeStyle(a.boxStyle)},[e.createElementVNode("view",{class:"file-picker__box-content",style:e.normalizeStyle(a.borderStyle)},[e.createElementVNode("image",{class:"file-image",src:t.url,mode:"aspectFill",onClick:e.withModifiers((e=>a.prviewImage(t,n)),["stop"])},null,8,["src","onClick"]),s.delIcon&&!s.readonly?(e.openBlock(),e.createElementBlock("view",{key:0,class:"icon-del-box",onClick:e.withModifiers((e=>a.delFile(n)),["stop"])},[e.createElementVNode("view",{class:"icon-del"}),e.createElementVNode("view",{class:"icon-del rotate"})],8,["onClick"])):e.createCommentVNode("",!0),t.progress&&100!==t.progress||0===t.progress?(e.openBlock(),e.createElementBlock("view",{key:1,class:"file-picker__progress"},[e.createElementVNode("progress",{class:"file-picker__progress-item",percent:-1===t.progress?0:t.progress,"stroke-width":"4",backgroundColor:t.errMsg?"#ff5a5f":"#EBEBEB"},null,8,["percent","backgroundColor"])])):e.createCommentVNode("",!0),t.errMsg?(e.openBlock(),e.createElementBlock("view",{key:2,class:"file-picker__mask",onClick:e.withModifiers((e=>a.uploadFiles(t,n)),["stop"])}," 点击重试 ",8,["onClick"])):e.createCommentVNode("",!0)],4)],4)))),128)),s.filesList.length<s.limit&&!s.readonly?(e.openBlock(),e.createElementBlock("view",{key:0,class:"file-picker__box",style:e.normalizeStyle(a.boxStyle)},[e.createElementVNode("view",{class:"file-picker__box-content is-add",style:e.normalizeStyle(a.borderStyle),onClick:n[0]||(n[0]=(...e)=>a.choose&&a.choose(...e))},[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("view",{class:"icon-add"}),e.createElementVNode("view",{class:"icon-add rotate"})]),!0)],4)],4)):e.createCommentVNode("",!0)])}],["__scopeId","data-v-86b162f5"]]),uploadFile:i({name:"uploadFile",emits:["uploadFiles","choose","delFile"],props:{filesList:{type:Array,default:()=>[]},delIcon:{type:Boolean,default:!0},limit:{type:[Number,String],default:9},showType:{type:String,default:""},listStyles:{type:Object,default:()=>({border:!0,dividline:!0,borderStyle:{}})},readonly:{type:Boolean,default:!1}},computed:{list(){let e=[];return this.filesList.forEach((t=>{e.push(t)})),e},styles(){return Object.assign({border:!0,dividline:!0,"border-style":{}},this.listStyles)},borderStyle(){let{borderStyle:e,border:t}=this.styles,n={};if(t){let t=e&&e.width||1;t=this.value2px(t);let s=e&&e.radius||5;s=this.value2px(s),n={"border-width":t,"border-style":e&&e.style||"solid","border-color":e&&e.color||"#eee","border-radius":s}}else n.border="none";let s="";for(let o in n)s+=`${o}:${n[o]};`;return s},borderLineStyle(){let e={},{borderStyle:t}=this.styles;if(t&&t.color&&(e["border-color"]=t.color),t&&t.width){let n=t&&t.width||1,s=t&&t.style||0;"number"==typeof n?n+="px":n=n.indexOf("px")?n:n+"px",e["border-width"]=n,"number"==typeof s?s+="px":s=s.indexOf("px")?s:s+"px",e["border-top-style"]=s}let n="";for(let s in e)n+=`${s}:${e[s]};`;return n}},methods:{uploadFiles(e,t){this.$emit("uploadFiles",{item:e,index:t})},choose(){this.$emit("choose")},delFile(e){this.$emit("delFile",e)},value2px:e=>("number"==typeof e?e+="px":e=-1!==e.indexOf("px")?e:e+"px",e)}},[["render",function(t,n,s,o,i,a){return e.openBlock(),e.createElementBlock("view",{class:"uni-file-picker__files"},[s.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("view",{key:0,class:"files-button",onClick:n[0]||(n[0]=(...e)=>a.choose&&a.choose(...e))},[e.renderSlot(t.$slots,"default",{},void 0,!0)])),a.list.length>0?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-file-picker__lists is-text-box",style:e.normalizeStyle(a.borderStyle)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.list,((t,n)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["uni-file-picker__lists-box",{"files-border":0!==n&&a.styles.dividline}]),key:n,style:e.normalizeStyle(0!==n&&a.styles.dividline&&a.borderLineStyle)},[e.createElementVNode("view",{class:"uni-file-picker__item"},[e.createElementVNode("view",{class:"files__name"},e.toDisplayString(t.name),1),s.delIcon&&!s.readonly?(e.openBlock(),e.createElementBlock("view",{key:0,class:"icon-del-box icon-files",onClick:e=>a.delFile(n)},[e.createElementVNode("view",{class:"icon-del icon-files"}),e.createElementVNode("view",{class:"icon-del rotate"})],8,["onClick"])):e.createCommentVNode("",!0)]),t.progress&&100!==t.progress||0===t.progress?(e.openBlock(),e.createElementBlock("view",{key:0,class:"file-picker__progress"},[e.createElementVNode("progress",{class:"file-picker__progress-item",percent:-1===t.progress?0:t.progress,"stroke-width":"4",backgroundColor:t.errMsg?"#ff5a5f":"#EBEBEB"},null,8,["percent","backgroundColor"])])):e.createCommentVNode("",!0),"error"===t.status?(e.openBlock(),e.createElementBlock("view",{key:1,class:"file-picker__mask",onClick:e.withModifiers((e=>a.uploadFiles(t,n)),["stop"])}," 点击重试 ",8,["onClick"])):e.createCommentVNode("",!0)],6)))),128))],4)):e.createCommentVNode("",!0)])}],["__scopeId","data-v-e61666c7"]])},options:{virtualHost:!0},emits:["select","success","fail","progress","delete","update:modelValue","input"],props:{modelValue:{type:[Array,Object],default:()=>[]},value:{type:[Array,Object],default:()=>[]},disabled:{type:Boolean,default:!1},disablePreview:{type:Boolean,default:!1},delIcon:{type:Boolean,default:!0},autoUpload:{type:Boolean,default:!0},limit:{type:[Number,String],default:9},mode:{type:String,default:"grid"},fileMediatype:{type:String,default:"image"},fileExtname:{type:[Array,String],default:()=>[]},title:{type:String,default:""},listStyles:{type:Object,default:()=>({border:!0,dividline:!0,borderStyle:{}})},imageStyles:{type:Object,default:()=>({width:"auto",height:"auto"})},readonly:{type:Boolean,default:!1},returnType:{type:String,default:"array"},sizeType:{type:Array,default:()=>["original","compressed"]},sourceType:{type:Array,default:()=>["album","camera"]},provider:{type:String,default:""}},data:()=>({files:[],localValue:[]}),watch:{value:{handler(e,t){this.setValue(e,t)},immediate:!0},modelValue:{handler(e,t){this.setValue(e,t)},immediate:!0}},computed:{filesList(){let e=[];return this.files.forEach((t=>{e.push(t)})),e},showType(){return"image"===this.fileMediatype?this.mode:"list"},limitLength(){return"object"===this.returnType?1:this.limit?this.limit>=9?9:this.limit:1}},created(){rs.config&&rs.config.provider||(this.noSpace=!0,rs.chooseAndUploadFile=hs),this.form=this.getForm("uniForms"),this.formItem=this.getForm("uniFormsItem"),this.form&&this.formItem&&this.formItem.name&&(this.rename=this.formItem.name,this.form.inputChildrens.push(this))},methods:{clearFiles(e){0===e||e?this.files.splice(e,1):(this.files=[],this.$nextTick((()=>{this.setEmit()}))),this.$nextTick((()=>{this.setEmit()}))},upload(){let e=[];return this.files.forEach(((t,n)=>{"ready"!==t.status&&"error"!==t.status||e.push(Object.assign({},t))})),this.uploadFiles(e)},async setValue(e,t){const n=async e=>{let t="";return t=e.fileID?e.fileID:e.url,/cloud:\/\/([\w.]+\/?)\S*/.test(t)&&(e.fileID=t,e.url=await this.getTempFileURL(t)),e.url&&(e.path=e.url),e};if("object"===this.returnType)e?await n(e):e={};else{e||(e=[]);for(let t=0;t<e.length;t++){let s=e[t];await n(s)}}this.localValue=e,this.form&&this.formItem&&!this.is_reset&&(this.is_reset=!1,this.formItem.setValue(this.localValue));let s=Object.keys(e).length>0?e:[];this.files=[].concat(s)},choose(){this.disabled||(this.files.length>=Number(this.limitLength)&&"grid"!==this.showType&&"array"===this.returnType?uni.showToast({title:`您最多选择 ${this.limitLength} 个文件`,icon:"none"}):this.chooseFiles())},chooseFiles(){const e=ms(this.fileExtname);rs.chooseAndUploadFile({type:this.fileMediatype,compressed:!1,sizeType:this.sizeType,sourceType:this.sourceType,extension:e.length>0?e:void 0,count:this.limitLength-this.files.length,onChooseFile:this.chooseFileCallback,onUploadProgress:e=>{this.setProgress(e,e.index)}}).then((e=>{this.setSuccessAndError(e.tempFiles)})).catch((e=>{t("log","at uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue:364","选择失败",e)}))},async chooseFileCallback(e){const t=ms(this.fileExtname);(1===Number(this.limitLength)&&this.disablePreview&&!this.disabled||"object"===this.returnType)&&(this.files=[]);let{filePaths:n,files:s}=((e,t)=>{let n=[],s=[];return t&&0!==t.length?(e.tempFiles.forEach((e=>{const o=ps(e.name).ext.toLowerCase();-1!==t.indexOf(o)&&(s.push(e),n.push(e.path))})),s.length!==e.tempFiles.length&&uni.showToast({title:`当前选择了${e.tempFiles.length}个文件 ${e.tempFiles.length-s.length} 个文件格式不正确`,icon:"none",duration:5e3}),{filePaths:n,files:s}):{filePaths:n,files:s}})(e,t);t&&t.length>0||(n=e.tempFilePaths,s=e.tempFiles);let o=[];for(let i=0;i<s.length&&!(this.limitLength-this.files.length<=0);i++){s[i].uuid=Date.now();let e=await fs(s[i],this.fileMediatype);e.progress=0,e.status="ready",this.files.push(e),o.push({...e,file:s[i]})}this.$emit("select",{tempFiles:o,tempFilePaths:n}),e.tempFiles=s,this.autoUpload&&!this.noSpace||(e.tempFiles=[]),e.tempFiles.forEach(((e,t)=>{this.provider&&(e.provider=this.provider);const n=e.name.split("."),s=n.pop(),o=n.join(".").replace(/[\s\/\?<>\\:\*\|":]/g,"_");e.cloudPath=o+"_"+Date.now()+"_"+t+"."+s}))},uploadFiles(e){return e=[].concat(e),ds.call(this,e,5,(e=>{this.setProgress(e,e.index,!0)})).then((e=>(this.setSuccessAndError(e),e))).catch((e=>{t("log","at uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue:437",e)}))},async setSuccessAndError(e,t){let n=[],s=[],o=[],i=[];for(let a=0;a<e.length;a++){const t=e[a],r=t.uuid?this.files.findIndex((e=>e.uuid===t.uuid)):t.index;if(-1===r||!this.files)break;if("request:fail"===t.errMsg)this.files[r].url=t.path,this.files[r].status="error",this.files[r].errMsg=t.errMsg,s.push(this.files[r]),i.push(this.files[r].url);else{this.files[r].errMsg="",this.files[r].fileID=t.url;/cloud:\/\/([\w.]+\/?)\S*/.test(t.url)?this.files[r].url=await this.getTempFileURL(t.url):this.files[r].url=t.url,this.files[r].status="success",this.files[r].progress+=1,n.push(this.files[r]),o.push(this.files[r].fileID)}}n.length>0&&(this.setEmit(),this.$emit("success",{tempFiles:this.backObject(n),tempFilePaths:o})),s.length>0&&this.$emit("fail",{tempFiles:this.backObject(s),tempFilePaths:i})},setProgress(e,t,n){this.files.length;const s=Math.round(100*e.loaded/e.total);let o=t;n||(o=this.files.findIndex((t=>t.uuid===e.tempFile.uuid))),-1!==o&&this.files[o]&&(this.files[o].progress=s-1,this.$emit("progress",{index:o,progress:parseInt(s),tempFile:this.files[o]}))},delFile(e){this.$emit("delete",{index:e,tempFile:this.files[e],tempFilePath:this.files[e].url}),this.files.splice(e,1),this.$nextTick((()=>{this.setEmit()}))},getFileExt(e){const t=e.lastIndexOf("."),n=e.length;return{name:e.substring(0,t),ext:e.substring(t+1,n)}},setEmit(){let e=[];"object"===this.returnType?(e=this.backObject(this.files)[0],this.localValue=e||null):(e=this.backObject(this.files),this.localValue||(this.localValue=[]),this.localValue=[...e]),this.$emit("update:modelValue",this.localValue)},backObject(e){let t=[];return e.forEach((e=>{t.push({extname:e.extname,fileType:e.fileType,image:e.image,name:e.name,path:e.path,size:e.size,fileID:e.fileID,url:e.url,uuid:e.uuid,status:e.status,cloudPath:e.cloudPath})})),t},async getTempFileURL(e){e={fileList:[].concat(e)};return(await rs.getTempFileURL(e)).fileList[0].tempFileURL||""},getForm(e="uniForms"){let t=this.$parent,n=t.$options.name;for(;n!==e;){if(t=t.$parent,!t)return!1;n=t.$options.name}return t}}},[["render",function(t,n,s,o,i,a){const r=e.resolveComponent("upload-image"),l=e.resolveComponent("upload-file");return e.openBlock(),e.createElementBlock("view",{class:"uni-file-picker"},[s.title?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-file-picker__header"},[e.createElementVNode("text",{class:"file-title"},e.toDisplayString(s.title),1),e.createElementVNode("text",{class:"file-count"},e.toDisplayString(a.filesList.length)+"/"+e.toDisplayString(a.limitLength),1)])):e.createCommentVNode("",!0),"image"===s.fileMediatype&&"grid"===a.showType?(e.openBlock(),e.createBlock(r,{key:1,readonly:s.readonly,"image-styles":s.imageStyles,"files-list":a.filesList,limit:a.limitLength,disablePreview:s.disablePreview,delIcon:s.delIcon,onUploadFiles:a.uploadFiles,onChoose:a.choose,onDelFile:a.delFile},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("view",{class:"is-add"},[e.createElementVNode("view",{class:"icon-add"}),e.createElementVNode("view",{class:"icon-add rotate"})])]),!0)])),_:3},8,["readonly","image-styles","files-list","limit","disablePreview","delIcon","onUploadFiles","onChoose","onDelFile"])):e.createCommentVNode("",!0),"image"!==s.fileMediatype||"grid"!==a.showType?(e.openBlock(),e.createBlock(l,{key:2,readonly:s.readonly,"list-styles":s.listStyles,"files-list":a.filesList,showType:a.showType,delIcon:s.delIcon,onUploadFiles:a.uploadFiles,onChoose:a.choose,onDelFile:a.delFile},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("button",{type:"primary",size:"mini"},"选择文件")]),!0)])),_:3},8,["readonly","list-styles","files-list","showType","delIcon","onUploadFiles","onChoose","onDelFile"])):e.createCommentVNode("",!0)])}],["__scopeId","data-v-086f9922"]]);const ys=i({},[["render",function(t,s){const o=n(e.resolveDynamicComponent("uni-file-picker"),gs);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"example-body"},[e.createVNode(o,{limit:"9",title:"最多选择9张图片"})])])}]]),vs=i({__name:"purse",setup(s){const o=e.ref(0);e.onMounted((()=>{i()}));const i=()=>{uni.request({url:m+"/api/errandIncome/count/money",method:"POST",header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success:e=>{t("log","at pages/purse/purse.vue:94","接口返回:",e),0===e.data.code&&null!=e.data.data?o.value=e.data.data:uni.showToast({title:e.data.message||"获取数据失败",icon:"none"})},fail:e=>{t("error","at pages/purse/purse.vue:105","请求失败:",e),uni.showToast({title:"网络错误,请检查连接",icon:"none"})}})};return(t,s)=>{const i=n(e.resolveDynamicComponent("uni-icons"),a);return e.openBlock(),e.createElementBlock("view",{class:"wallet-page"},[e.createElementVNode("view",{class:"balance-section"},[e.createElementVNode("text",{class:"balance-label"},"钱包余额(元)"),e.createElementVNode("view",{class:"balance-amount"},[e.createElementVNode("text",{class:"amount"},"¥"+e.toDisplayString(o.value.toFixed(2)),1),e.createElementVNode("button",{class:"view-detail",onClick:s[0]||(s[0]=(...e)=>t.viewDetail&&t.viewDetail(...e))},"去提现")]),e.createElementVNode("view",{class:"transactions-section"},[e.createElementVNode("view",{class:"transaction-item"},[e.createElementVNode("text",{class:"transaction-label"},"未到账0.00 >"),e.createElementVNode("text",{class:"transaction-label"},"可提现0.00 >")]),e.createElementVNode("view",{class:"transaction-item"},[e.createElementVNode("text",{class:"transaction-label"},"已冻结0.00 >")])])]),e.createElementVNode("view",{class:"menu-section"},[e.createElementVNode("view",{class:"menu-item"},[e.createElementVNode("view",null,[e.createElementVNode("text",{class:"menu-title"},"慧民贷款"),e.createElementVNode("view",{class:"subtitles-container"},[e.createElementVNode("text",{class:"menu-subtitle"},[e.createTextVNode("余额 "),e.createElementVNode("text",{style:{color:"#3292bc"}},"0.00")]),e.createElementVNode("text",{class:"menu-subtitle"},[e.createTextVNode("未到账 "),e.createElementVNode("text",{style:{color:"#3292bc"}},"0.00")])])]),e.createVNode(i,{type:"angle-right",size:"24",class:"menu-icon"})]),e.createElementVNode("view",{class:"menu-item"},[e.createElementVNode("text",{class:"menu-title"},"保证金"),e.createVNode(i,{type:"angle-right",size:"24",class:"menu-icon"})]),e.createElementVNode("view",{class:"menu-item today-bill"},[e.createElementVNode("view",null,[e.createElementVNode("text",{class:"menu-title"},"今日账单"),e.createElementVNode("view",{class:"subtitles-container"},[e.createElementVNode("text",{class:"menu-subtitle"},[e.createTextVNode("收入 "),e.createElementVNode("text",{style:{color:"#3292bc"}},"0.00")]),e.createElementVNode("text",{class:"menu-subtitle"},[e.createTextVNode("支出 "),e.createElementVNode("text",{style:{color:"#3292bc"}},"0.00")])])]),e.createElementVNode("text",{class:"menu-subtitle view-history"},[e.createTextVNode("查看历史账单 "),e.createVNode(i,{type:"right",size:"16"})]),e.createVNode(i,{type:"angle-right",size:"24",class:"menu-icon"})])]),e.createElementVNode("view",{class:"no-bill-message"},[e.createElementVNode("text",null,"今天还没有账单哦")])])}}},[["__scopeId","data-v-74c730d3"]]);const ws=i({data:()=>({loginForm:{userAccount:"",userPassword:""},apiImageUrl:"https://xiaokuaisong.shop"}),methods:{handleLogin(){t("log","at pages/login/login.vue:99","userAccount:",this.loginForm.userAccount),t("log","at pages/login/login.vue:100","userPassword:",this.loginForm.userPassword),uni.showLoading({title:"正在登录...",mask:!0}),uni.request({url:this.apiImageUrl+"/api/user/login",method:"POST",data:{appName:"errand",userAccount:this.loginForm.userAccount,userPassword:this.loginForm.userPassword},header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success:e=>{t("log","at pages/login/login.vue:120","Response Data:",e),200===e.statusCode&&0===e.data.code?(uni.showToast({title:"登录成功",duration:2e3}),uni.removeStorageSync("cookie"),uni.setStorageSync("userInfo",e.data.data),e.header&&e.header["Set-Cookie"]&&uni.setStorageSync("cookie",e.header["Set-Cookie"]),uni.switchTab({url:"/pages/index/index"})):uni.showToast({icon:"error",title:"登录失败,请联系管理员"})},fail:e=>{t("error","at pages/login/login.vue:146","Request failed:",e),uni.showToast({icon:"error",title:"网络请求失败,请重试"})},complete:()=>{uni.hideLoading()}})},goLogin(){uni.navigateTo({url:"/pages/register/register"})}}},[["render",function(t,n,s,o,i,a){return e.openBlock(),e.createElementBlock("view",{class:"normal-login-container"},[e.createElementVNode("view",{class:"logo-content align-center justify-center flex"},[e.createElementVNode("image",{class:"img-a",src:i.apiImageUrl+"/static/images/b-1.png"},null,8,["src"]),e.createElementVNode("image",{class:"img-b",src:i.apiImageUrl+"/static/images/b-2.png"},null,8,["src"]),e.createElementVNode("view",{class:"text"},[e.createElementVNode("view",{class:"t-b"},"校食通快送端"),e.createElementVNode("view",{class:"t-b2"},"一款专为在校同学开发的配送app")])]),e.createElementVNode("view",{class:"login-form-content"},[e.createElementVNode("view",{class:"input-item flex align-center"},[e.createElementVNode("view",{class:"iconfont icon-user icon"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=e=>i.loginForm.userAccount=e),class:"input",type:"text",placeholder:"请输入账号",maxlength:"30"},null,512),[[e.vModelText,i.loginForm.userAccount]])]),e.createElementVNode("view",{class:"input-item flex align-center"},[e.createElementVNode("view",{class:"iconfont icon-password icon"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[1]||(n[1]=e=>i.loginForm.userPassword=e),type:"password",class:"input",placeholder:"请输入密码",maxlength:"20"},null,512),[[e.vModelText,i.loginForm.userPassword]])]),e.createElementVNode("view",{class:"action-btn"},[e.createElementVNode("button",{onClick:n[2]||(n[2]=(...e)=>a.handleLogin&&a.handleLogin(...e)),class:"login-btn cu-btn block bg-blue lg round"},"登录")]),e.createElementVNode("p",{onClick:n[3]||(n[3]=(...e)=>a.goLogin&&a.goLogin(...e)),class:"goLogin"},"去注册")])])}]]);const _s=i({name:"uni-data-select",mixins:[rs.mixinDatacom||{}],props:{localdata:{type:Array,default:()=>[]},value:{type:[String,Number],default:""},modelValue:{type:[String,Number],default:""},label:{type:String,default:""},placeholder:{type:String,default:"请选择"},emptyTips:{type:String,default:"无选项"},clear:{type:Boolean,default:!0},defItem:{type:Number,default:0},disabled:{type:Boolean,default:!1},format:{type:String,default:""},placement:{type:String,default:"bottom"}},data:()=>({showSelector:!1,current:"",mixinDatacomResData:[],apps:[],channels:[],cacheKey:"uni-data-select-lastSelectedValue"}),created(){this.debounceGet=this.debounce((()=>{this.query()}),300),this.collection&&!this.localdata.length&&this.debounceGet()},computed:{typePlaceholder(){const e=this.placeholder,t={"opendb-stat-app-versions":"版本","opendb-app-channels":"渠道","opendb-app-list":"应用"}[this.collection];return t?e+t:e},valueCom(){return this.modelValue},textShow(){let e=this.current;return e.length>10?e.slice(0,25)+"...":e},getOffsetByPlacement(){switch(this.placement){case"top":return"bottom:calc(100% + 12px);";case"bottom":return"top:calc(100% + 12px);"}}},watch:{localdata:{immediate:!0,handler(e,t){Array.isArray(e)&&t!==e&&(this.mixinDatacomResData=e)}},valueCom(e,t){this.initDefVal()},mixinDatacomResData:{immediate:!0,handler(e){e.length&&this.initDefVal()}}},methods:{debounce(e,t=100){let n=null;return function(...s){n&&clearTimeout(n),n=setTimeout((()=>{e.apply(this,s)}),t)}},query(){this.mixinDatacomEasyGet()},onMixinDatacomPropsChange(){this.collection&&this.debounceGet()},initDefVal(){let e="";if(!this.valueCom&&0!==this.valueCom||this.isDisabled(this.valueCom)){let t;if(this.collection&&(t=this.getCache()),t||0===t)e=t;else{let t="";this.defItem>0&&this.defItem<=this.mixinDatacomResData.length&&(t=this.mixinDatacomResData[this.defItem-1].value),e=t}(e||0===e)&&this.emit(e)}else e=this.valueCom;const t=this.mixinDatacomResData.find((t=>t.value===e));this.current=t?this.formatItemName(t):""},isDisabled(e){let t=!1;return this.mixinDatacomResData.forEach((n=>{n.value===e&&(t=n.disable)})),t},clearVal(){this.emit(""),this.collection&&this.removeCache()},change(e){e.disable||(this.showSelector=!1,this.current=this.formatItemName(e),this.emit(e.value))},emit(e){this.$emit("input",e),this.$emit("update:modelValue",e),this.$emit("change",e),this.collection&&this.setCache(e)},toggleSelector(){this.disabled||(this.showSelector=!this.showSelector)},formatItemName(e){let{text:t,value:n,channel_code:s}=e;if(s=s?`(${s})`:"",this.format){let t="";t=this.format;for(let n in e)t=t.replace(new RegExp(`{${n}}`,"g"),e[n]);return t}return this.collection.indexOf("app-list")>0?`${t}(${n})`:t||`未命名${s}`},getLoadData(){return this.mixinDatacomResData},getCurrentCacheKey(){return this.collection},getCache(e=this.getCurrentCacheKey()){return(uni.getStorageSync(this.cacheKey)||{})[e]},setCache(e,t=this.getCurrentCacheKey()){let n=uni.getStorageSync(this.cacheKey)||{};n[t]=e,uni.setStorageSync(this.cacheKey,n)},removeCache(e=this.getCurrentCacheKey()){let t=uni.getStorageSync(this.cacheKey)||{};delete t[e],uni.setStorageSync(this.cacheKey,t)}}},[["render",function(t,s,o,i,r,l){const c=n(e.resolveDynamicComponent("uni-icons"),a);return e.openBlock(),e.createElementBlock("view",{class:"uni-stat__select"},[o.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:"uni-label-text hide-on-phone"},e.toDisplayString(o.label+""),1)):e.createCommentVNode("",!0),e.createElementVNode("view",{class:e.normalizeClass(["uni-stat-box",{"uni-stat__actived":r.current}])},[e.createElementVNode("view",{class:e.normalizeClass(["uni-select",{"uni-select--disabled":o.disabled}])},[e.createElementVNode("view",{class:"uni-select__input-box",onClick:s[1]||(s[1]=(...e)=>l.toggleSelector&&l.toggleSelector(...e))},[r.current?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select__input-text"},e.toDisplayString(l.textShow),1)):(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__input-text uni-select__input-placeholder"},e.toDisplayString(l.typePlaceholder),1)),r.current&&o.clear&&!o.disabled?(e.openBlock(),e.createElementBlock("view",{key:2,onClick:s[0]||(s[0]=e.withModifiers(((...e)=>l.clearVal&&l.clearVal(...e)),["stop"]))},[e.createVNode(c,{type:"clear",color:"#c0c4cc",size:"24"})])):(e.openBlock(),e.createElementBlock("view",{key:3},[e.createVNode(c,{type:r.showSelector?"top":"bottom",size:"14",color:"#999"},null,8,["type"])]))]),r.showSelector?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select--mask",onClick:s[2]||(s[2]=(...e)=>l.toggleSelector&&l.toggleSelector(...e))})):e.createCommentVNode("",!0),r.showSelector?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__selector",style:e.normalizeStyle(l.getOffsetByPlacement)},[e.createElementVNode("view",{class:e.normalizeClass("bottom"==o.placement?"uni-popper__arrow_bottom":"uni-popper__arrow_top")},null,2),e.createElementVNode("scroll-view",{"scroll-y":"true",class:"uni-select__selector-scroll"},[0===r.mixinDatacomResData.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select__selector-empty"},[e.createElementVNode("text",null,e.toDisplayString(o.emptyTips),1)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(r.mixinDatacomResData,((t,n)=>(e.openBlock(),e.createElementBlock("view",{class:"uni-select__selector-item",key:n,onClick:e=>l.change(t)},[e.createElementVNode("text",{class:e.normalizeClass({"uni-select__selector__disabled":t.disable})},e.toDisplayString(l.formatItemName(t)),3)],8,["onClick"])))),128))])],4)):e.createCommentVNode("",!0)],2)],2)])}],["__scopeId","data-v-6d601b46"]]),ks={data:()=>({formData:{checkPassword:"",distributionScope:"",errandName:"",errandPhone:"",gender:"",userAccount:"",userPassword:""},range:[{value:"1公寓",text:"1公寓"},{value:"2公寓",text:"2公寓"},{value:"3公寓",text:"3公寓"},{value:"4公寓",text:"4公寓"},{value:"5公寓",text:"5公寓"},{value:"6公寓",text:"6公寓"},{value:"7公寓",text:"7公寓"},{value:"8公寓",text:"8公寓"},{value:"9公寓",text:"9公寓"},{value:"10公寓",text:"10公寓"},{value:"11公寓",text:"11公寓"},{value:"12公寓",text:"12公寓"},{value:"育才大厦",text:"育才大厦"}],fields:[{label:"账户",model:"userAccount",placeholder:"请输入账户"},{label:"密码",model:"userPassword",placeholder:"请输入密码"},{label:"确认密码",model:"checkPassword",placeholder:"请再次输入密码"},{label:"用户名称",model:"errandName",placeholder:"请输入用户名称"},{label:"手机号",model:"errandPhone",placeholder:"请输入手机号"},{label:"性别",model:"gender",placeholder:"请选择性别"},{label:"配送范围",model:"distributionScope",placeholder:"请选择配送范围"}]}),methods:{handleGenderChange(e){this.formData.gender="男"===e.detail.value?0:1},saveAddress(){if(!this.validateForm())return;const e={checkPassword:this.formData.checkPassword,distributionScope:this.formData.distributionScope,errandName:this.formData.errandName,errandPhone:this.formData.errandPhone,gender:this.formData.gender,userAccount:this.formData.userAccount,userPassword:this.formData.userPassword};uni.request({url:"https://xiaokuaisong.shop/api/errand/add",method:"POST",data:e,header:{"Content-Type":"application/json"},success(e){t("log","at pages/register/register.vue:188",e.data),0===e.data.code?(uni.showToast({title:"注册成功!",duration:2e3,icon:"success"}),uni.reLaunch({url:"/pages/login/login"})):4e4===e.data.code&&uni.showToast({title:e.data.description,duration:2e3,icon:"fail"})},fail(e){t("error","at pages/register/register.vue:207",e),uni.showModal({title:"注册失败",content:"请重新输入"})}})},validateForm(){return this.formData.userAccount?this.formData.userPassword?this.formData.userPassword.length<8?(uni.showToast({title:"密码过短至少8位",icon:"none"}),!1):this.formData.checkPassword?this.formData.userPassword!==this.formData.checkPassword?(uni.showToast({title:"两次密码不一致",icon:"none"}),!1):this.formData.errandName?this.formData.errandPhone?this.formData.gender?!!this.formData.distributionScope||(uni.showToast({title:"请选择配送范围",icon:"none"}),!1):(uni.showToast({title:"请选择性别",icon:"none"}),!1):(uni.showToast({title:"请输入手机号",icon:"none"}),!1):(uni.showToast({title:"请输入用户名称",icon:"none"}),!1):(uni.showToast({title:"请输入确认密码",icon:"none"}),!1):(uni.showToast({title:"请输入密码",icon:"none"}),!1):(uni.showToast({title:"请输入账户",icon:"none"}),!1)}}};const bs=i(ks,[["render",function(t,s,o,i,a,r){const l=n(e.resolveDynamicComponent("uni-data-select"),_s);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"header"},[e.createElementVNode("view",{class:"title"},"跑腿注册")]),e.createElementVNode("view",{class:"form"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.fields,((t,n)=>(e.openBlock(),e.createElementBlock("view",{class:"input-group",key:n},[e.createElementVNode("view",{class:"label"},e.toDisplayString(t.label),1),e.createElementVNode("view",{class:"input"},["gender"===t.model?(e.openBlock(),e.createElementBlock("radio-group",{key:0,value:a.formData.gender,onChange:s[0]||(s[0]=(...e)=>r.handleGenderChange&&r.handleGenderChange(...e)),class:"radio-group"},[e.createElementVNode("label",{class:"radio-label"},[e.createElementVNode("view",{class:"radio-wrapper"},[e.createElementVNode("radio",{value:"男",color:"#5e7dec"})]),e.createTextVNode(" 男 ")]),e.createElementVNode("label",{class:"radio-label"},[e.createElementVNode("view",{class:"radio-wrapper"},[e.createElementVNode("radio",{value:"女",color:"#5e7dec"})]),e.createTextVNode(" 女 ")])],40,["value"])):"distributionScope"===t.model?(e.openBlock(),e.createBlock(l,{key:1,modelValue:a.formData.distributionScope,"onUpdate:modelValue":s[1]||(s[1]=e=>a.formData.distributionScope=e),localdata:a.range,clear:!1,class:"distribution-select"},null,8,["modelValue","localdata"])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":e=>a.formData[t.model]=e,placeholder:t.placeholder,class:"styled-input"},null,8,["onUpdate:modelValue","placeholder"])),[[e.vModelText,a.formData[t.model]]])])])))),128)),e.createElementVNode("view",{class:"button"},[e.createElementVNode("button",{onClick:s[2]||(s[2]=(...e)=>r.saveAddress&&r.saveAddress(...e)),class:"styled-button"},"点击注册")])])])}],["__scopeId","data-v-2a39d174"]]);const Ss=i({data:()=>({photoSrcFront:"",photoSrcBack:"",bankCard:"",submitRecord:{},currentUser:uni.getStorageSync("currentUser")}),onLoad(){this.getAuditRecords()},methods:{takePhoto(e){const t=this;uni.chooseImage({count:1,sourceType:["camera"],success(n){"front"===e?(t.photoSrcFront=n.tempFilePaths[0],t.uploadPhoto(n.tempFilePaths[0],"front")):"back"===e&&(t.photoSrcBack=n.tempFilePaths[0],t.uploadPhoto(n.tempFilePaths[0],"back"))}})},uploadPhoto(e,n){uni.uploadFile({url:m+"/api/file/upload/server",filePath:e,name:"file",formData:{biz:"card"},success:e=>{t("log","at pages/authentication/authentication.vue:101","上传成功:",e)},fail:e=>{t("error","at pages/authentication/authentication.vue:105","上传失败:",e)}})},submit(){const e={backIdCard:this.photoSrcBack,bankCard:this.bankCard,errandId:this.currentUser.id,frontIdCard:this.photoSrcFront};uni.request({url:m+"/api/errandAuth/add",method:"POST",data:e,header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success:e=>{t("log","at pages/authentication/authentication.vue:126","提交成功:",e),4e4===e.data.code?uni.showToast({title:e.data.description,icon:"fail",duration:2e3}):0===e.data.code&&uni.showToast({title:"提交成功",icon:"success",duration:2e3})},fail:e=>{t("error","at pages/authentication/authentication.vue:144","提交失败:",e)}})},getAuditRecords(){uni.request({url:m+"/api/errandAuth/get/my",method:"POST",header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success:e=>{t("log","at pages/authentication/authentication.vue:157",e),0===e.data.code&&e.data.data&&(this.submitRecord=e.data.data)},fail:e=>{t("error","at pages/authentication/authentication.vue:163","获取审核记录失败:",e)}})}}},[["render",function(t,s,o,i,r,l){const c=n(e.resolveDynamicComponent("uni-icons"),a);return e.openBlock(),e.createElementBlock("view",{class:"page"},[e.createElementVNode("view",{class:"form-item"},[e.createElementVNode("view",{class:"label"},"银行卡号"),e.createElementVNode("view",{class:"value"},[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=e=>r.bankCard=e),placeholder:"请输入银行卡号"},null,512),[[e.vModelText,r.bankCard]])])]),e.createElementVNode("view",{class:"upload-section"},[e.createElementVNode("view",{class:"upload-item",onClick:s[1]||(s[1]=e=>l.takePhoto("front"))},[r.photoSrcFront?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("view",{key:0,class:"upload-icon-text"},[e.createVNode(c,{type:"plusempty",size:"30",color:"#6a7cbf"}),e.createElementVNode("view",{class:"upload-text"},"点击上传身份证国徽面")])),r.photoSrcFront?(e.openBlock(),e.createElementBlock("image",{key:1,src:r.photoSrcFront},null,8,["src"])):e.createCommentVNode("",!0)]),e.createElementVNode("view",{class:"upload-item",onClick:s[2]||(s[2]=e=>l.takePhoto("back"))},[r.photoSrcBack?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("view",{key:0,class:"upload-icon-text"},[e.createVNode(c,{type:"plusempty",size:"30",color:"#6a7cbf"}),e.createElementVNode("view",{class:"upload-text"},"点击上传身份证人像面")])),r.photoSrcBack?(e.openBlock(),e.createElementBlock("image",{key:1,src:r.photoSrcBack},null,8,["src"])):e.createCommentVNode("",!0)])]),e.createElementVNode("button",{class:"submit-button",onClick:s[3]||(s[3]=(...e)=>l.submit&&l.submit(...e))},"提交"),r.submitRecord?(e.openBlock(),e.createElementBlock("view",{key:0,class:"submit"},[e.createElementVNode("view",{class:"submit-title"}," 提交记录 "),e.createElementVNode("view",{class:"submit-bankCard"},e.toDisplayString(r.submitRecord.bankCard),1),e.createElementVNode("view",{class:"submit-frontIdCard"},[e.createElementVNode("view",{class:"submit-title"}," 身份证正面 "),e.createElementVNode("image",{src:r.submitRecord.frontIdCard,mode:"widthFix"},null,8,["src"])]),e.createElementVNode("view",{class:"submit-backIdCard"},[e.createElementVNode("view",{class:"submit-title"}," 身份证背面 "),e.createElementVNode("image",{src:r.submitRecord.backIdCard,mode:"widthFix"},null,8,["src"])])])):e.createCommentVNode("",!0)])}],["__scopeId","data-v-32c07d63"]]),xs=i({__name:"changeUserMessage",setup(n){const o=e.ref({errandName:"未登录",errandAvatarUrl:"",gender:"",errandPhone:"",distributionScope:""}),i=e.ref(""),a=()=>{uni.request({url:m+"/api/errand/get/current",method:"POST",header:{cookie:uni.getStorageSync("cookie")},success(e){t("log","at pages/changeUserMessage/changeUserMessage.vue:62",e),0===e.data.code&&e.data.data&&Object.assign(o.value,e.data.data)},fail(e){t("error","at pages/changeUserMessage/changeUserMessage.vue:68","请求失败:",e)}})};s((()=>{a()})),e.onMounted((()=>{a()}));const r=()=>{uni.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:e=>{const t=e.tempFilePaths;i.value=t[0],l(t[0])}})},l=e=>{uni.uploadFile({url:m+"/api/file/upload/server",filePath:e,name:"file",formData:{biz:"user_avatar"},success:e=>{const t=JSON.parse(e.data);0===t.code&&(o.value.errandAvatarUrl=t.data.url,i.value="")},fail:e=>{t("error","at pages/changeUserMessage/changeUserMessage.vue:114","上传失败:",e)}})},c=()=>{const e={distributionScope:o.value.distributionScope,errandName:o.value.errandName,errandPhone:o.value.errandPhone,gender:o.value.gender,id:o.value.id,state:0};uni.request({url:m+"/api/errand/update/my",method:"POST",data:e,header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")},success(e){0===e.data.code?(uni.showToast({title:"更新成功",icon:"success"}),a()):uni.showToast({title:"更新失败",icon:"none"})},fail(e){t("error","at pages/changeUserMessage/changeUserMessage.vue:154","请求失败:",e)}})};return(t,n)=>(e.openBlock(),e.createElementBlock("view",{class:"user-profile"},[e.createElementVNode("view",{class:"avatar-container"},[e.createElementVNode("image",{src:i.value||o.value.errandAvatarUrl||"../../static/logo.png",mode:"aspectFill",class:"avatar",onClick:r},null,8,["src"]),e.createElementVNode("text",{class:"edit-text"},"点击修改头像")]),e.createElementVNode("view",{class:"form-container"},[e.createElementVNode("view",{class:"form-item"},[e.createElementVNode("text",{class:"label"},"昵称"),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[0]||(n[0]=e=>o.value.errandName=e),class:"input-field"},null,512),[[e.vModelText,o.value.errandName]])]),e.createElementVNode("view",{class:"form-item gender-item"},[e.createElementVNode("text",{class:"label"},"性别"),e.createElementVNode("radio-group",{class:"gender-container"},[e.createElementVNode("label",null,[e.createElementVNode("radio",{checked:0===o.value.gender,value:"male",onClick:n[1]||(n[1]=e=>o.value.gender=0)},null,8,["checked"]),e.createElementVNode("text",null,"男")]),e.createElementVNode("label",null,[e.createElementVNode("radio",{checked:1===o.value.gender,value:"female",onClick:n[2]||(n[2]=e=>o.value.gender=1)},null,8,["checked"]),e.createElementVNode("text",null,"女")])])]),e.createElementVNode("view",{class:"form-item"},[e.createElementVNode("text",{class:"label"},"手机"),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[3]||(n[3]=e=>o.value.errandPhone=e),class:"input-field"},null,512),[[e.vModelText,o.value.errandPhone]])]),e.createElementVNode("view",{class:"form-item"},[e.createElementVNode("text",{class:"label"},"范围"),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[4]||(n[4]=e=>o.value.distributionScope=e),class:"input-field"},null,512),[[e.vModelText,o.value.distributionScope]])])]),e.createElementVNode("button",{class:"save-button",onClick:c},"保 存")]))}},[["__scopeId","data-v-578b272a"]]),Es=i({__name:"orderDetail",setup(s){const o=e.ref(uni.getStorageSync("orderDetail")),i={"1公寓":{latitude:45.878148,longitude:126.542369},"2公寓":{latitude:45.878016,longitude:126.542924},"3公寓":{latitude:45.878117,longitude:126.543476},"4公寓":{latitude:45.878118,longitude:126.54415},"5公寓":{latitude:45.878978,longitude:126.54127},"6公寓":{latitude:45.878982,longitude:126.541879},"9公寓":{latitude:45.878435,longitude:126.544863},"10公寓":{latitude:45.879196,longitude:126.543891},"11公寓":{latitude:45.879157,longitude:126.542722},"12公寓":{latitude:45.875638,longitude:126.540502},"育才大厦":{latitude:45.875638,longitude:126.540502}},r=e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`},l=e.ref(""),c=e.ref(""),d=e.ref([]),u=e.ref([]);return e.onMounted((()=>{uni.getLocation({type:"gcj02",success(e){if(t("log","at pages/orderDetail/orderDetail.vue:89","当前位置的经度:"+e.longitude),t("log","at pages/orderDetail/orderDetail.vue:90","当前位置的纬度:"+e.latitude),l.value=e.latitude,c.value=e.longitude,function(e,t,n,s,o){const i={id:n,latitude:e,longitude:t,iconPath:o,width:30,height:30,title:s},a=u.value.findIndex((e=>e.id===i.id));-1!==a?u.value[a]=i:u.value.push(i)}(e.latitude,e.longitude,2,"我的位置","/static/logo.png"),o.value.location in i){const t=i[o.value.location];d.value=[{latitude:t.latitude,longitude:t.longitude},{latitude:e.latitude,longitude:e.longitude}]}else t("warn","at pages/orderDetail/orderDetail.vue:109",`未找到名为"${o.value.location}"的公寓位置`)},fail(e){t("error","at pages/orderDetail/orderDetail.vue:113","获取位置失败",e)}})})),(s,i)=>{const h=n(e.resolveDynamicComponent("uni-icons"),a);return e.openBlock(),e.createElementBlock("view",{class:"page"},[e.createElementVNode("view",null,[e.createElementVNode("map",{style:{width:"100%",height:"300px"},latitude:l.value,longitude:c.value,markers:u.value,"include-points":d.value},null,8,["latitude","longitude","markers","include-points"])]),e.createElementVNode("view",{class:"header"},[e.createElementVNode("text",{class:"location"},"取"),e.createElementVNode("text",{class:"distance"},"1km"),e.createElementVNode("text",{class:"store-name"},e.toDisplayString(o.value.address),1)]),e.createElementVNode("view",{class:"header"},[e.createElementVNode("text",{class:"location"},"送"),e.createElementVNode("text",{class:"distance"},"1km"),e.createElementVNode("text",{class:"store-name"},e.toDisplayString(o.value.location),1)]),e.createElementVNode("view",{class:"buttons"},[e.createElementVNode("view",{class:"icon-container"},[e.createElementVNode("view",{class:"icon-wrapper",onClick:i[0]||(i[0]=e=>{var t,n;return n=null==(t=o.value.businessVO)?void 0:t.businessPhone,void uni.makePhoneCall({phoneNumber:n})})},[e.createVNode(h,{type:"phone",size:"30"}),e.createElementVNode("text",null,"联系商家")]),e.createElementVNode("view",{class:"icon-wrapper",onClick:i[1]||(i[1]=e=>{return t=o.value.phone,void uni.makePhoneCall({phoneNumber:t});var t})},[e.createVNode(h,{type:"phone-filled",size:"30"}),e.createElementVNode("text",null,"联系用户")]),e.createElementVNode("view",{class:"icon-wrapper"},[e.createVNode(h,{type:"camera",size:"30",onClick:i[2]||(i[2]=e=>{return t("log","at pages/orderDetail/orderDetail.vue:38",n=o.value.id),void uni.request({url:m+"/api/errand/update/state",method:"POST",data:{errandsState:3,orderId:n},success(e){t("log","at pages/orderDetail/orderDetail.vue:47",e),uni.navigateBack({delta:1,animationType:"pop-out",animationDuration:200})},fail(e){t("log","at pages/orderDetail/orderDetail.vue:55",e)}});var n})}),e.createElementVNode("text",null,"拍照取到")])])]),e.createElementVNode("view",{class:"order-details"},[e.createElementVNode("text",{class:"title"},"跑单详情"),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"取餐地址:"),e.createElementVNode("text",null,e.toDisplayString(o.value.address),1)]),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"下单时间:"),e.createElementVNode("text",null,e.toDisplayString(r(o.value.createTime)),1)]),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"送达时间:"),e.createElementVNode("text",{style:{color:"red"}},e.toDisplayString(r(o.value.pickupEndTime)),1)]),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"送达地址:"),e.createElementVNode("text",null,e.toDisplayString(o.value.location),1)])])])}}},[["__scopeId","data-v-ea813443"]]),Ns=i({__name:"deliveryDetail",setup(s){const o=e.ref(uni.getStorageSync("orderDetail")),i={"1公寓":{latitude:45.878148,longitude:126.542369},"2公寓":{latitude:45.878016,longitude:126.542924},"3公寓":{latitude:45.878117,longitude:126.543476},"4公寓":{latitude:45.878118,longitude:126.54415},"5公寓":{latitude:45.878978,longitude:126.54127},"6公寓":{latitude:45.878982,longitude:126.541879},"9公寓":{latitude:45.878435,longitude:126.544863},"10公寓":{latitude:45.879196,longitude:126.543891},"11公寓":{latitude:45.879157,longitude:126.542722},"12公寓":{latitude:45.875638,longitude:126.540502},"育才大厦":{latitude:45.875638,longitude:126.540502}},r=e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`},l=e.ref(""),c=e.ref(""),d=e.ref([]),u=e.ref([]);function h(e,t,n,s,o){const i={id:n,latitude:e,longitude:t,iconPath:o,width:30,height:30,title:s},a=u.value.findIndex((e=>e.id===i.id));-1!==a?u.value[a]=i:u.value.push(i)}e.onMounted((()=>{uni.getLocation({type:"gcj02",success(e){if(t("log","at pages/deliveryDetail/deliveryDetail.vue:170","当前位置的经度:"+e.longitude),t("log","at pages/deliveryDetail/deliveryDetail.vue:171","当前位置的纬度:"+e.latitude),l.value=e.latitude,c.value=e.longitude,h(e.latitude,e.longitude,2,"我的位置","/static/logo.png"),o.value.location in i){const t=i[o.value.location];h(t.latitude,t.longitude,1,o.value.location,"/static/errand.jpg"),d.value=[{latitude:t.latitude,longitude:t.longitude},{latitude:e.latitude,longitude:e.longitude}]}else t("warn","at pages/deliveryDetail/deliveryDetail.vue:197",`未找到名为"${o.value.location}"的公寓位置`)},fail(e){t("error","at pages/deliveryDetail/deliveryDetail.vue:201","获取位置失败",e)}})}));const p=e=>{uni.uploadFile({url:`${m}/api/file/upload/server`,filePath:e,name:"file",formData:{biz:"takeout"},header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success(e){t("log","at pages/deliveryDetail/deliveryDetail.vue:255","上传成功",e);const n=JSON.parse(e.data).data;((e,n)=>{uni.showLoading({title:"提交中...",mask:!0}),uni.request({url:m+"/api/errand/update/state",method:"POST",data:{errandsState:4,orderId:e,imageAddress:n},header:{"Content-Type":"application/json",cookie:uni.getStorageSync("cookie")||""},success(e){t("log","at pages/deliveryDetail/deliveryDetail.vue:95",e),uni.hideLoading(),0===e.data.code?uni.showToast({title:"成功送达",icon:"none",duration:2e3,success:()=>{const e=getCurrentPages(),t=e[e.length-3];t&&t.robOrder&&t.robOrder(3),uni.navigateBack({delta:2,success:()=>{uni.$emit("refresh-delivery-list")}})}}):uni.showToast({title:e.data.message||"送达失败",icon:"none"})},fail(e){t("log","at pages/deliveryDetail/deliveryDetail.vue:131",e),uni.showToast({title:"网络异常,请检查连接",icon:"none"})}})})(o.value.id,n)},fail(e){t("error","at pages/deliveryDetail/deliveryDetail.vue:260","上传失败",e)}})};return(s,i)=>{const h=n(e.resolveDynamicComponent("uni-icons"),a);return e.openBlock(),e.createElementBlock("view",{class:"page"},[e.createElementVNode("view",null,[e.createElementVNode("map",{style:{width:"100%",height:"300px"},latitude:l.value,longitude:c.value,markers:u.value,"include-points":d.value},null,8,["latitude","longitude","markers","include-points"])]),e.createElementVNode("view",{class:"header"},[e.createElementVNode("text",{class:"location"},"取"),e.createElementVNode("text",{class:"distance"},"1km"),e.createElementVNode("text",{class:"store-name"},e.toDisplayString(o.value.address),1)]),e.createElementVNode("view",{class:"header"},[e.createElementVNode("text",{class:"location"},"送"),e.createElementVNode("text",{class:"distance"},"1km"),e.createElementVNode("text",{class:"store-name"},e.toDisplayString(o.value.location),1)]),e.createElementVNode("view",{class:"buttons"},[e.createElementVNode("view",{class:"icon-container"},[e.createElementVNode("view",{class:"icon-wrapper",onClick:i[0]||(i[0]=e=>{var n,s;return t("log","at pages/deliveryDetail/deliveryDetail.vue:148",s=null==(n=o.value.businessVO)?void 0:n.businessPhone),void uni.makePhoneCall({phoneNumber:s})})},[e.createVNode(h,{type:"phone",size:"30"}),e.createElementVNode("text",null,"联系商家")]),e.createElementVNode("view",{class:"icon-wrapper",onClick:i[1]||(i[1]=e=>{return t=o.value.phone,void uni.makePhoneCall({phoneNumber:t});var t})},[e.createVNode(h,{type:"phone-filled",size:"30"}),e.createElementVNode("text",null,"联系用户")]),e.createElementVNode("view",{class:"icon-wrapper"},[e.createVNode(h,{type:"camera",size:"30",onClick:i[2]||(i[2]=e=>(o.value.id,void uni.chooseImage({count:1,sizeType:["compressed"],sourceType:["camera"],success:function(e){const t=e.tempFilePaths;p(t[0])}})))}),e.createElementVNode("text",null,"拍照送达")])])]),e.createElementVNode("view",{class:"order-details"},[e.createElementVNode("text",{class:"title"},"跑单详情"),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"取餐地址:"),e.createElementVNode("text",null,e.toDisplayString(o.value.address),1)]),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"下单时间:"),e.createElementVNode("text",null,e.toDisplayString(r(o.value.createTime)),1)]),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"送达时间:"),e.createElementVNode("text",{style:{color:"red"}},e.toDisplayString(r(o.value.pickupEndTime)),1)]),e.createElementVNode("view",{class:"detail"},[e.createElementVNode("text",null,"送达地址:"),e.createElementVNode("text",null,e.toDisplayString(o.value.location),1)])])])}}},[["__scopeId","data-v-b22de759"]]);__definePage("pages/index/index",g),__definePage("pages/my/my",v),__definePage("pages/orderList/orderList",w),__definePage("pages/test/test",_),__definePage("pages/map/map",k),__definePage("pages/takePhoto/takePhoto",ys),__definePage("pages/purse/purse",vs),__definePage("pages/login/login",ws),__definePage("pages/register/register",bs),__definePage("pages/authentication/authentication",Ss),__definePage("pages/changeUserMessage/changeUserMessage",xs),__definePage("pages/orderDetail/orderDetail",Es),__definePage("pages/deliveryDetail/deliveryDetail",Ns);const Cs={onLaunch:function(){t("log","at App.vue:4","App Launch")},onShow:function(){t("log","at App.vue:7","App Show")},onHide:function(){t("log","at App.vue:10","App Hide")}};const{app:Ts,Vuex:Ps,Pinia:Is}={app:e.createVueApp(Cs)};uni.Vuex=Ps,uni.Pinia=Is,Ts.provide("__globalStyles",__uniConfig.styles),Ts._component.mpType="app",Ts._component.render=()=>{},Ts.mount("#app")}(Vue);