app-service.js 218 KB

1
  1. if("undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((o=>t.resolve(e()).then((()=>o))),(o=>t.resolve(e()).then((()=>{throw o}))))}),"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,...o){uni.__log__?uni.__log__(e,t,...o):console[e].apply(console,[...o,t])}function o(e,t){return"string"==typeof e?t:e}const n=t=>(o,n=e.getCurrentInstance())=>{!e.isInSSRComponentSetup&&e.injectHook(t,o,n)},s=n("onShow"),a=n("onHide"),i=n("onLoad"),r=n("onUnload"),l=n("onBackPress"),c=n("onNavigationBarButtonTap"),u=(e,t)=>{const o=e.__vccOpts||e;for(const[n,s]of t)o[n]=s;return o};const d=u({name:"UniGridItem",inject:["grid"],props:{index:{type:Number,default:0}},data:()=>({column:0,showBorder:!0,square:!0,highlight:!0,left:0,top:0,openNum:2,width:0,borderColor:"#e5e5e5"}),created(){this.column=this.grid.column,this.showBorder=this.grid.showBorder,this.square=this.grid.square,this.highlight=this.grid.highlight,this.top=0===this.hor?this.grid.hor:this.hor,this.left=0===this.ver?this.grid.ver:this.ver,this.borderColor=this.grid.borderColor,this.grid.children.push(this),this.width=this.grid.width},beforeDestroy(){this.grid.children.forEach(((e,t)=>{e===this&&this.grid.children.splice(t,1)}))},methods:{_onClick(){this.grid.change({detail:{index:this.index}})}}},[["render",function(t,o,n,s,a,i){return a.width?(e.openBlock(),e.createElementBlock("view",{key:0,style:e.normalizeStyle("width:"+a.width+";"+(a.square?"height:"+a.width:"")),class:"uni-grid-item"},[e.createElementVNode("view",{class:e.normalizeClass([{"uni-grid-item--border":a.showBorder,"uni-grid-item--border-top":a.showBorder&&n.index<a.column,"uni-highlight":a.highlight},"uni-grid-item__box"]),style:e.normalizeStyle({"border-right-color":a.borderColor,"border-bottom-color":a.borderColor,"border-top-color":a.borderColor}),onClick:o[0]||(o[0]=(...e)=>i._onClick&&i._onClick(...e))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],6)],4)):e.createCommentVNode("",!0)}],["__scopeId","data-v-2511947d"]]),h={name:"UniGrid",emits:["change"],props:{column:{type:Number,default:3},showBorder:{type:Boolean,default:!0},borderColor:{type:String,default:"#D2D2D2"},square:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0}},provide(){return{grid:this}},data:()=>({elId:`Uni_${Math.ceil(1e6*Math.random()).toString(36)}`,width:0}),created(){this.children=[]},mounted(){this.$nextTick((()=>{this.init()}))},methods:{init(){setTimeout((()=>{this._getSize((e=>{this.children.forEach(((t,o)=>{t.width=e}))}))}),50)},change(e){this.$emit("change",e)},_getSize(e){uni.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((t=>{this.width=parseInt((t[0].width-1)/this.column)+"px",e(this.width)}))}}};const p=u(h,[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-grid-wrap"},[e.createElementVNode("view",{id:a.elId,ref:"uni-grid",class:e.normalizeClass(["uni-grid",{"uni-grid--border":n.showBorder}]),style:e.normalizeStyle({"border-left-color":n.borderColor})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],14,["id"])])}],["__scopeId","data-v-a6acbddc"]]),m=e.defineComponent({__name:"index",setup(n){const a=e.ref(null),i=e.ref(null),r=e.ref([{url:"/pages/instock/index",src:"/static/weigh_fill.png",text:"称重"},{url:"/pages/warehouseScan/index",src:"/static/houscan.png",text:"仓库扫描"},{url:"/pages/scanLotno/index",src:"/static/link.png",text:"托盘/批次"}]);s((()=>{a.value=uni.getStorageSync("token"),i.value=uni.getStorageSync("user"),t("log","at pages/home/index.vue:50","show---",{token:a.value,user:i.value})}));const l=()=>{};return(n,s)=>{const i=o(e.resolveDynamicComponent("uni-grid-item"),d),c=o(e.resolveDynamicComponent("uni-grid"),p);return e.openBlock(),e.createElementBlock("view",{class:"warp"},[e.createVNode(c,{class:"grid",column:3,"show-border":!1,square:!1,onChange:l},{default:e.withCtx((()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,((o,n)=>(e.openBlock(),e.createBlock(i,{index:n,key:n},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"grid-item-box",onClick:e=>{return t("log","at pages/home/index.vue:53",n=o.url),void(a.value?uni.navigateTo({url:n}):uni.navigateTo({url:"/pages/login/index"}));var n}},[e.createElementVNode("image",{class:"image",src:o.src,mode:"aspectFill"},null,8,["src"]),e.createElementVNode("text",{class:"text"},e.toDisplayString(o.text),1)],8,["onClick"])])),_:2},1032,["index"])))),128))])),_:1})])}}}),f=[{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:""}];const g=u({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:f}),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,o,n,s,a,i){return e.openBlock(),e.createElementBlock("text",{style:e.normalizeStyle(i.styleObj),class:e.normalizeClass(["uni-icons",["uniui-"+n.type,n.customPrefix,n.customPrefix?n.type:""]]),onClick:o[0]||(o[0]=(...e)=>i._onClick&&i._onClick(...e))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],6)}],["__scopeId","data-v-5610c8db"]]);function y(e){let t="";for(let o in e){t+=`${o}:${e[o]};`}return t}const k=u({name:"uni-easyinput",emits:["click","iconClick","update:modelValue","input","focus","blur","confirm","clear","eyes","change","keyboardheightchange"],model:{prop:"modelValue",event:"update:modelValue"},options:{virtualHost:!0},inject:{form:{from:"uniForm",default:null},formItem:{from:"uniFormItem",default:null}},props:{name:String,value:[Number,String],modelValue:[Number,String],type:{type:String,default:"text"},clearable:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},placeholder:{type:String,default:" "},placeholderStyle:String,focus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},maxlength:{type:[Number,String],default:140},confirmType:{type:String,default:"done"},clearSize:{type:[Number,String],default:24},inputBorder:{type:Boolean,default:!0},prefixIcon:{type:String,default:""},suffixIcon:{type:String,default:""},trim:{type:[Boolean,String],default:!1},cursorSpacing:{type:Number,default:0},passwordIcon:{type:Boolean,default:!0},primaryColor:{type:String,default:"#2979ff"},styles:{type:Object,default:()=>({color:"#333",backgroundColor:"#fff",disableColor:"#F7F6F6",borderColor:"#e5e5e5"})},errorMessage:{type:[String,Boolean],default:""}},data:()=>({focused:!1,val:"",showMsg:"",border:!1,isFirstBorder:!1,showClearIcon:!1,showPassword:!1,focusShow:!1,localMsg:"",isEnter:!1}),computed:{isVal(){const e=this.val;return!(!e&&0!==e)},msg(){return this.localMsg||this.errorMessage},inputMaxlength(){return Number(this.maxlength)},boxStyle(){return`color:${this.inputBorder&&this.msg?"#e43d33":this.styles.color};`},inputContentClass(){return function(e){let t="";for(let o in e)e[o]&&(t+=`${o} `);return t}({"is-input-border":this.inputBorder,"is-input-error-border":this.inputBorder&&this.msg,"is-textarea":"textarea"===this.type,"is-disabled":this.disabled,"is-focused":this.focusShow})},inputContentStyle(){const e=this.focusShow?this.primaryColor:this.styles.borderColor;return y({"border-color":(this.inputBorder&&this.msg?"#dd524d":e)||"#e5e5e5","background-color":this.disabled?this.styles.disableColor:this.styles.backgroundColor})},inputStyle(){return y({"padding-right":"password"===this.type||this.clearable||this.prefixIcon?"":"10px","padding-left":this.prefixIcon?"":"10px"})}},watch:{value(e){this.val=e},modelValue(e){this.val=e},focus(e){this.$nextTick((()=>{this.focused=this.focus,this.focusShow=this.focus}))}},created(){this.init(),this.form&&this.formItem&&this.$watch("formItem.errMsg",(e=>{this.localMsg=e}))},mounted(){this.$nextTick((()=>{this.focused=this.focus,this.focusShow=this.focus}))},methods:{init(){this.value||0===this.value?this.val=this.value:this.modelValue||0===this.modelValue||""===this.modelValue?this.val=this.modelValue:this.val=null},onClickIcon(e){this.$emit("iconClick",e)},onEyes(){this.showPassword=!this.showPassword,this.$emit("eyes",this.showPassword)},onInput(e){let t=e.detail.value;this.trim&&("boolean"==typeof this.trim&&this.trim&&(t=this.trimStr(t)),"string"==typeof this.trim&&(t=this.trimStr(t,this.trim))),this.errMsg&&(this.errMsg=""),this.val=t,this.$emit("input",t),this.$emit("update:modelValue",t)},onFocus(){this.$nextTick((()=>{this.focused=!0})),this.$emit("focus",null)},_Focus(e){this.focusShow=!0,this.$emit("focus",e)},onBlur(){this.focused=!1,this.$emit("focus",null)},_Blur(e){if(e.detail.value,this.focusShow=!1,this.$emit("blur",e),!1===this.isEnter&&this.$emit("change",this.val),this.form&&this.formItem){const{validateTrigger:e}=this.form;"blur"===e&&this.formItem.onFieldChange()}},onConfirm(e){this.$emit("confirm",this.val),this.isEnter=!0,this.$emit("change",this.val),this.$nextTick((()=>{this.isEnter=!1}))},onClear(e){this.val="",this.$emit("input",""),this.$emit("update:modelValue",""),this.$emit("clear")},onkeyboardheightchange(e){this.$emit("keyboardheightchange",e)},trimStr:(e,t="both")=>"both"===t?e.trim():"left"===t?e.trimLeft():"right"===t?e.trimRight():"start"===t?e.trimStart():"end"===t?e.trimEnd():"all"===t?e.replace(/\s+/g,""):e}},[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["uni-easyinput",{"uni-easyinput-error":r.msg}]),style:e.normalizeStyle(r.boxStyle)},[e.createElementVNode("view",{class:e.normalizeClass(["uni-easyinput__content",r.inputContentClass]),style:e.normalizeStyle(r.inputContentStyle)},[s.prefixIcon?(e.openBlock(),e.createBlock(l,{key:0,class:"content-clear-icon",type:s.prefixIcon,color:"#c0c4cc",onClick:n[0]||(n[0]=e=>r.onClickIcon("prefix")),size:"22"},null,8,["type"])):e.createCommentVNode("",!0),"textarea"===s.type?(e.openBlock(),e.createElementBlock("textarea",{key:1,class:e.normalizeClass(["uni-easyinput__content-textarea",{"input-padding":s.inputBorder}]),name:s.name,value:i.val,placeholder:s.placeholder,placeholderStyle:s.placeholderStyle,disabled:s.disabled,"placeholder-class":"uni-easyinput__placeholder-class",maxlength:r.inputMaxlength,focus:i.focused,autoHeight:s.autoHeight,"cursor-spacing":s.cursorSpacing,onInput:n[1]||(n[1]=(...e)=>r.onInput&&r.onInput(...e)),onBlur:n[2]||(n[2]=(...e)=>r._Blur&&r._Blur(...e)),onFocus:n[3]||(n[3]=(...e)=>r._Focus&&r._Focus(...e)),onConfirm:n[4]||(n[4]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:n[5]||(n[5]=(...e)=>r.onkeyboardheightchange&&r.onkeyboardheightchange(...e))},null,42,["name","value","placeholder","placeholderStyle","disabled","maxlength","focus","autoHeight","cursor-spacing"])):(e.openBlock(),e.createElementBlock("input",{key:2,type:"password"===s.type?"text":s.type,class:"uni-easyinput__content-input",style:e.normalizeStyle(r.inputStyle),name:s.name,value:i.val,password:!i.showPassword&&"password"===s.type,placeholder:s.placeholder,placeholderStyle:s.placeholderStyle,"placeholder-class":"uni-easyinput__placeholder-class",disabled:s.disabled,maxlength:r.inputMaxlength,focus:i.focused,confirmType:s.confirmType,"cursor-spacing":s.cursorSpacing,onFocus:n[6]||(n[6]=(...e)=>r._Focus&&r._Focus(...e)),onBlur:n[7]||(n[7]=(...e)=>r._Blur&&r._Blur(...e)),onInput:n[8]||(n[8]=(...e)=>r.onInput&&r.onInput(...e)),onConfirm:n[9]||(n[9]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:n[10]||(n[10]=(...e)=>r.onkeyboardheightchange&&r.onkeyboardheightchange(...e))},null,44,["type","name","value","password","placeholder","placeholderStyle","disabled","maxlength","focus","confirmType","cursor-spacing"])),"password"===s.type&&s.passwordIcon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.isVal?(e.openBlock(),e.createBlock(l,{key:0,class:e.normalizeClass(["content-clear-icon",{"is-textarea-icon":"textarea"===s.type}]),type:i.showPassword?"eye-slash-filled":"eye-filled",size:22,color:i.focusShow?s.primaryColor:"#c0c4cc",onClick:r.onEyes},null,8,["class","type","color","onClick"])):e.createCommentVNode("",!0)],64)):s.suffixIcon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[s.suffixIcon?(e.openBlock(),e.createBlock(l,{key:0,class:"content-clear-icon",type:s.suffixIcon,color:"#c0c4cc",onClick:n[11]||(n[11]=e=>r.onClickIcon("suffix")),size:"22"},null,8,["type"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[s.clearable&&r.isVal&&!s.disabled&&"textarea"!==s.type?(e.openBlock(),e.createBlock(l,{key:0,class:e.normalizeClass(["content-clear-icon",{"is-textarea-icon":"textarea"===s.type}]),type:"clear",size:s.clearSize,color:r.msg?"#dd524d":i.focusShow?s.primaryColor:"#c0c4cc",onClick:r.onClear},null,8,["class","size","color","onClick"])):e.createCommentVNode("",!0)],64)),e.renderSlot(t.$slots,"right",{},void 0,!0)],6)],6)}],["__scopeId","data-v-f388a24f"]]);const v=u({name:"uniFormsItem",options:{virtualHost:!0},provide(){return{uniFormItem:this}},inject:{form:{from:"uniForm",default:null}},props:{rules:{type:Array,default:()=>null},name:{type:[String,Array],default:""},required:{type:Boolean,default:!1},label:{type:String,default:""},labelWidth:{type:[String,Number],default:""},labelAlign:{type:String,default:""},errorMessage:{type:[String,Boolean],default:""},leftIcon:String,iconColor:{type:String,default:"#606266"}},data:()=>({errMsg:"",userRules:null,localLabelAlign:"left",localLabelWidth:"70px",localLabelPos:"left",border:!1,isFirstBorder:!1}),computed:{msg(){return this.errorMessage||this.errMsg}},watch:{"form.formRules"(e){this.init()},"form.labelWidth"(e){this.localLabelWidth=this._labelWidthUnit(e)},"form.labelPosition"(e){this.localLabelPos=this._labelPosition()},"form.labelAlign"(e){}},created(){this.init(!0),this.name&&this.form&&this.$watch((()=>this.form._getDataValue(this.name,this.form.localData)),((e,t)=>{if(!this.form._isEqual(e,t)){const t=this.itemSetValue(e);this.onFieldChange(t,!1)}}),{immediate:!1})},unmounted(){this.__isUnmounted=!0,this.unInit()},methods:{setRules(e=null){this.userRules=e,this.init(!1)},setValue(){},async onFieldChange(e,t=!0){const{formData:o,localData:n,errShowType:s,validateCheck:a,validateTrigger:i,_isRequiredField:r,_realName:l}=this.form,c=l(this.name);e||(e=this.form.formData[c]);const u=this.itemRules.rules&&this.itemRules.rules.length;if(!this.validator||!u||0===u)return;const d=r(this.itemRules.rules||[]);let h=null;return"bind"===i||t?(h=await this.validator.validateUpdate({[c]:e},o),d||void 0!==e&&""!==e||(h=null),h&&h.errorMessage?("undertext"===s&&(this.errMsg=h?h.errorMessage:""),"toast"===s&&uni.showToast({title:h.errorMessage||"校验错误",icon:"none"}),"modal"===s&&uni.showModal({title:"提示",content:h.errorMessage||"校验错误"})):this.errMsg="",a(h||null)):this.errMsg="",h||null},init(e=!1){const{validator:t,formRules:o,childrens:n,formData:s,localData:a,_realName:i,labelWidth:r,_getDataValue:l,_setDataValue:c}=this.form||{};if(this.localLabelAlign=this._justifyContent(),this.localLabelWidth=this._labelWidthUnit(r),this.localLabelPos=this._labelPosition(),this.form&&e&&n.push(this),!t||!o)return;this.form.isFirstBorder||(this.form.isFirstBorder=!0,this.isFirstBorder=!0),this.group&&(this.group.isFirstBorder||(this.group.isFirstBorder=!0,this.isFirstBorder=!0)),this.border=this.form.border;const u=i(this.name),d=this.userRules||this.rules;"object"==typeof o&&d&&(o[u]={rules:d},t.updateSchema(o));const h=o[u]||{};this.itemRules=h,this.validator=t,this.itemSetValue(l(this.name,a))},unInit(){if(this.form){const{childrens:e,formData:t,_realName:o}=this.form;e.forEach(((e,n)=>{e===this&&(this.form.childrens.splice(n,1),delete t[o(e.name)])}))}},itemSetValue(e){const t=this.form._realName(this.name),o=this.itemRules.rules||[],n=this.form._getValue(t,e,o);return this.form._setDataValue(t,this.form.formData,n),n},clearValidate(){this.errMsg=""},_isRequired(){return this.required},_justifyContent(){if(this.form){const{labelAlign:e}=this.form;let t=this.labelAlign?this.labelAlign:e;if("left"===t)return"flex-start";if("center"===t)return"center";if("right"===t)return"flex-end"}return"flex-start"},_labelWidthUnit(e){return this.num2px(this.labelWidth?this.labelWidth:e||(this.label?70:"auto"))},_labelPosition(){return this.form&&this.form.labelPosition||"left"},isTrigger:(e,t,o)=>"submit"!==e&&e?"bind":void 0===e?"bind"!==t?t?"submit":""===o?"bind":"submit":"bind":"submit",num2px:e=>"number"==typeof e?`${e}px`:e}},[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["uni-forms-item",["is-direction-"+a.localLabelPos,a.border?"uni-forms-item--border":"",a.border&&a.isFirstBorder?"is-first-border":""]])},[e.renderSlot(t.$slots,"label",{},(()=>[e.createElementVNode("view",{class:e.normalizeClass(["uni-forms-item__label",{"no-label":!n.label&&!n.required}]),style:e.normalizeStyle({width:a.localLabelWidth,justifyContent:a.localLabelAlign})},[n.required?(e.openBlock(),e.createElementBlock("text",{key:0,class:"is-required"},"*")):e.createCommentVNode("",!0),e.createElementVNode("text",null,e.toDisplayString(n.label),1)],6)]),!0),e.createElementVNode("view",{class:"uni-forms-item__content"},[e.renderSlot(t.$slots,"default",{},void 0,!0),e.createElementVNode("view",{class:e.normalizeClass(["uni-forms-item__error",{"msg--active":i.msg}])},[e.createElementVNode("text",null,e.toDisplayString(i.msg),1)],2)])],2)}],["__scopeId","data-v-7b97b15c"]]),_={pages:[{path:"pages/home/index",style:{navigationBarTitleText:"英途仓库"}},{path:"pages/instock/index",style:{navigationBarTitleText:"称重","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"历史"}],backButton:{background:"#00FF00"}}}}},{path:"pages/instock/instockLog",style:{navigationBarTitleText:"录入历史"}},{path:"pages/profile/index",style:{navigationBarTitleText:"我的"}},{path:"pages/login/index",style:{navigationBarTitleText:"登录"}},{path:"pages/order/index",style:{navigationBarTitleText:"ORDER"}},{path:"pages/scanLotno/index",style:{navigationBarTitleText:"托盘/批次","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"历史"}],backButton:{background:"#00FF00"}}}}},{path:"pages/scanLotno/lotnoLog",style:{navigationBarTitleText:"录入历史"}},{path:"pages/scanLotno/waybillsList",style:{navigationBarTitleText:"运单列表"}},{path:"pages/warehouseScan/index",style:{navigationBarTitleText:"仓库扫描","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"历史"}],backButton:{background:"#00FF00"}}}}},{path:"pages/warehouseScan/warehouseLog",style:{navigationBarTitleText:"录入历史"}},{path:"pages/waybillDeliveryOrder/index",style:{navigationBarTitleText:"派送单"}}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},tabBar:{color:"#7A7E83",selectedColor:"#007AFF",borderStyle:"black",backgroundColor:"#F8F8F8",list:[{pagePath:"pages/home/index",iconPath:"static/home.png",selectedIconPath:"static/home_fill.png",text:"首页"},{pagePath:"pages/profile/index",iconPath:"static/people.png",selectedIconPath:"static/people_fill.png",text:"我的"}]},uniIdRouter:{}};function w(e,t,o){return e(o={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&o.path)}},o.exports),o.exports}var b=w((function(e,t){var o;e.exports=(o=o||function(e,t){var o=Object.create||function(){function e(){}return function(t){var o;return e.prototype=t,o=new e,e.prototype=null,o}}(),n={},s=n.lib={},a=s.Base={extend:function(e){var t=o(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)}},i=s.WordArray=a.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,o=e.words,n=this.sigBytes,s=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<s;a++){var i=o[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=i<<24-(n+a)%4*8}else for(a=0;a<s;a+=4)t[n+a>>>2]=o[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,o=this.sigBytes;t[o>>>2]&=4294967295<<32-o%4*8,t.length=e.ceil(o/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var o,n=[],s=function(t){var o=987654321,n=4294967295;return function(){var s=((o=36969*(65535&o)+(o>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return s/=4294967296,(s+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var r=s(4294967296*(o||e.random()));o=987654071*r(),n.push(4294967296*r()|0)}return new i.init(n,t)}}),r=n.enc={},l=r.Hex={stringify:function(e){for(var t=e.words,o=e.sigBytes,n=[],s=0;s<o;s++){var a=t[s>>>2]>>>24-s%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,o=[],n=0;n<t;n+=2)o[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new i.init(o,t/2)}},c=r.Latin1={stringify:function(e){for(var t=e.words,o=e.sigBytes,n=[],s=0;s<o;s++){var a=t[s>>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,o=[],n=0;n<t;n++)o[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new i.init(o,t)}},u=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)))}},d=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var o=this._data,n=o.words,s=o.sigBytes,a=this.blockSize,r=s/(4*a),l=(r=t?e.ceil(r):e.max((0|r)-this._minBufferSize,0))*a,c=e.min(4*l,s);if(l){for(var u=0;u<l;u+=a)this._doProcessBlock(n,u);var d=n.splice(0,l);o.sigBytes-=c}return new i.init(d,c)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.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,o){return new e.init(o).finalize(t)}},_createHmacHelper:function(e){return function(t,o){return new h.HMAC.init(e,o).finalize(t)}}});var h=n.algo={};return n}(Math),o)})),S=b,x=(w((function(e,t){var o;e.exports=(o=S,function(e){var t=o,n=t.lib,s=n.WordArray,a=n.Hasher,i=t.algo,r=[];!function(){for(var t=0;t<64;t++)r[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=i.MD5=a.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var n=t+o,s=e[n];e[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var a=this._hash.words,i=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],k=e[t+7],v=e[t+8],_=e[t+9],w=e[t+10],b=e[t+11],S=e[t+12],x=e[t+13],C=e[t+14],T=e[t+15],E=a[0],D=a[1],N=a[2],I=a[3];E=c(E,D,N,I,i,7,r[0]),I=c(I,E,D,N,l,12,r[1]),N=c(N,I,E,D,p,17,r[2]),D=c(D,N,I,E,m,22,r[3]),E=c(E,D,N,I,f,7,r[4]),I=c(I,E,D,N,g,12,r[5]),N=c(N,I,E,D,y,17,r[6]),D=c(D,N,I,E,k,22,r[7]),E=c(E,D,N,I,v,7,r[8]),I=c(I,E,D,N,_,12,r[9]),N=c(N,I,E,D,w,17,r[10]),D=c(D,N,I,E,b,22,r[11]),E=c(E,D,N,I,S,7,r[12]),I=c(I,E,D,N,x,12,r[13]),N=c(N,I,E,D,C,17,r[14]),E=u(E,D=c(D,N,I,E,T,22,r[15]),N,I,l,5,r[16]),I=u(I,E,D,N,y,9,r[17]),N=u(N,I,E,D,b,14,r[18]),D=u(D,N,I,E,i,20,r[19]),E=u(E,D,N,I,g,5,r[20]),I=u(I,E,D,N,w,9,r[21]),N=u(N,I,E,D,T,14,r[22]),D=u(D,N,I,E,f,20,r[23]),E=u(E,D,N,I,_,5,r[24]),I=u(I,E,D,N,C,9,r[25]),N=u(N,I,E,D,m,14,r[26]),D=u(D,N,I,E,v,20,r[27]),E=u(E,D,N,I,x,5,r[28]),I=u(I,E,D,N,p,9,r[29]),N=u(N,I,E,D,k,14,r[30]),E=d(E,D=u(D,N,I,E,S,20,r[31]),N,I,g,4,r[32]),I=d(I,E,D,N,v,11,r[33]),N=d(N,I,E,D,b,16,r[34]),D=d(D,N,I,E,C,23,r[35]),E=d(E,D,N,I,l,4,r[36]),I=d(I,E,D,N,f,11,r[37]),N=d(N,I,E,D,k,16,r[38]),D=d(D,N,I,E,w,23,r[39]),E=d(E,D,N,I,x,4,r[40]),I=d(I,E,D,N,i,11,r[41]),N=d(N,I,E,D,m,16,r[42]),D=d(D,N,I,E,y,23,r[43]),E=d(E,D,N,I,_,4,r[44]),I=d(I,E,D,N,S,11,r[45]),N=d(N,I,E,D,T,16,r[46]),E=h(E,D=d(D,N,I,E,p,23,r[47]),N,I,i,6,r[48]),I=h(I,E,D,N,k,10,r[49]),N=h(N,I,E,D,C,15,r[50]),D=h(D,N,I,E,g,21,r[51]),E=h(E,D,N,I,S,6,r[52]),I=h(I,E,D,N,m,10,r[53]),N=h(N,I,E,D,w,15,r[54]),D=h(D,N,I,E,l,21,r[55]),E=h(E,D,N,I,v,6,r[56]),I=h(I,E,D,N,T,10,r[57]),N=h(N,I,E,D,y,15,r[58]),D=h(D,N,I,E,x,21,r[59]),E=h(E,D,N,I,f,6,r[60]),I=h(I,E,D,N,b,10,r[61]),N=h(N,I,E,D,p,15,r[62]),D=h(D,N,I,E,_,21,r[63]),a[0]=a[0]+E|0,a[1]=a[1]+D|0,a[2]=a[2]+N|0,a[3]=a[3]+I|0},_doFinalize:function(){var t=this._data,o=t.words,n=8*this._nDataBytes,s=8*t.sigBytes;o[s>>>5]|=128<<24-s%32;var a=e.floor(n/4294967296),i=n;o[15+(s+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o[14+(s+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(o.length+1),this._process();for(var r=this._hash,l=r.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return r},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,o,n,s,a,i){var r=e+(t&o|~t&n)+s+i;return(r<<a|r>>>32-a)+t}function u(e,t,o,n,s,a,i){var r=e+(t&n|o&~n)+s+i;return(r<<a|r>>>32-a)+t}function d(e,t,o,n,s,a,i){var r=e+(t^o^n)+s+i;return(r<<a|r>>>32-a)+t}function h(e,t,o,n,s,a,i){var r=e+(o^(t|~n))+s+i;return(r<<a|r>>>32-a)+t}t.MD5=a._createHelper(l),t.HmacMD5=a._createHmacHelper(l)}(Math),o.MD5)})),w((function(e,t){var o,n,s;e.exports=(n=(o=S).lib.Base,s=o.enc.Utf8,void(o.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));var o=e.blockSize,n=4*o;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),i=this._iKey=t.clone(),r=a.words,l=i.words,c=0;c<o;c++)r[c]^=1549556828,l[c]^=909522486;a.sigBytes=i.sigBytes=n,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,o=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(o))}})))})),w((function(e,t){e.exports=S.HmacMD5}))),C=w((function(e,t){e.exports=S.enc.Utf8})),T=w((function(e,t){var o,n,s;e.exports=(s=(n=o=S).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,o=e.sigBytes,n=this._map;e.clamp();for(var s=[],a=0;a<o;a+=3)for(var i=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,r=0;r<4&&a+.75*r<o;r++)s.push(n.charAt(i>>>6*(3-r)&63));var l=n.charAt(64);if(l)for(;s.length%4;)s.push(l);return s.join("")},parse:function(e){var t=e.length,o=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var a=0;a<o.length;a++)n[o.charCodeAt(a)]=a}var i=o.charAt(64);if(i){var r=e.indexOf(i);-1!==r&&(t=r)}return function(e,t,o){for(var n=[],a=0,i=0;i<t;i++)if(i%4){var r=o[e.charCodeAt(i-1)]<<i%4*2,l=o[e.charCodeAt(i)]>>>6-i%4*2;n[a>>>2]|=(r|l)<<24-a%4*8,a++}return s.create(n,a)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)}));const E="FUNCTION",D="pending",N="rejected";function I(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function A(e){return"object"===I(e)}function B(e){return"function"==typeof e}function P(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const V="REJECTED",L="NOT_PENDING";class O{constructor({createPromise:e,retryRule:t=V}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case V:return this.status===N;case L:return this.status!==D}}exec(){return this.needRetry?(this.status=D,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=N,Promise.reject(e)))),this.promise):this.promise}}function F(e){return e&&"string"==typeof e?JSON.parse(e):e}const R=F([]);F("");const M=F("[]")||[];let U="";try{U="__UNI__EE98A34"}catch(Ne){}let j={};function $(e,t={}){var o,n;return o=j,n=e,Object.prototype.hasOwnProperty.call(o,n)||(j[e]=t),j[e]}j=uni._globalUniCloudObj?uni._globalUniCloudObj:uni._globalUniCloudObj={};const z=["invoke","success","fail","complete"],q=$("_globalUniCloudInterceptor");function H(e,t){q[e]||(q[e]={}),A(t)&&Object.keys(t).forEach((o=>{z.indexOf(o)>-1&&function(e,t,o){let n=q[e][t];n||(n=q[e][t]=[]),-1===n.indexOf(o)&&B(o)&&n.push(o)}(e,o,t[o])}))}function W(e,t){q[e]||(q[e]={}),A(t)?Object.keys(t).forEach((o=>{z.indexOf(o)>-1&&function(e,t,o){const n=q[e][t];if(!n)return;const s=n.indexOf(o);s>-1&&n.splice(s,1)}(e,o,t[o])})):delete q[e]}function J(e,t){return e&&0!==e.length?e.reduce(((e,o)=>e.then((()=>o(t)))),Promise.resolve()):Promise.resolve()}function K(e,t){return q[e]&&q[e][t]||[]}function G(e){H("callObject",e)}const Y=$("_globalUniCloudListener"),Q="response",Z="needLogin",X="refreshToken",ee="clientdb",te="cloudfunction",oe="cloudobject";function ne(e){return Y[e]||(Y[e]=[]),Y[e]}function se(e,t){const o=ne(e);o.includes(t)||o.push(t)}function ae(e,t){const o=ne(e),n=o.indexOf(t);-1!==n&&o.splice(n,1)}function ie(e,t){const o=ne(e);for(let n=0;n<o.length;n++)(0,o[n])(t)}let re,le=!1;function ce(){return re||(re=new Promise((e=>{le&&e(),function t(){if("function"==typeof getCurrentPages){const t=getCurrentPages();t&&t[0]&&(le=!0,e())}le||setTimeout((()=>{t()}),30)}()})),re)}function ue(e){const t={};for(const o in e){const n=e[o];B(n)&&(t[o]=P(n))}return t}class de 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 he={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 pe(e){return e&&pe(e.__v_raw)||e}function me(){return{token:he.getStorageSync("uni_id_token")||he.getStorageSync("uniIdToken"),tokenExpired:he.getStorageSync("uni_id_token_expired")}}function fe({token:e,tokenExpired:t}={}){e&&he.setStorageSync("uni_id_token",e),t&&he.setStorageSync("uni_id_token_expired",t)}let ge,ye;function ke(){return ge||(ge=uni.getSystemInfoSync()),ge}function ve(){let e,t;try{if(uni.getLaunchOptionsSync){if(uni.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:o,channel:n}=uni.getLaunchOptionsSync();e=n,t=o}}catch(o){}return{channel:e,scene:t}}let _e={};function we(){const e=uni.getLocale&&uni.getLocale()||"en";if(ye)return{..._e,...ye,locale:e,LOCALE:e};const t=ke(),{deviceId:o,osName:n,uniPlatform:s,appId:a}=t,i=["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===i.indexOf(r)&&delete t[r];return ye={PLATFORM:s,OS:n,APPID:a,DEVICEID:o,...ve(),...t},{..._e,...ye,locale:e,LOCALE:e}}var be=function(e,t){let o="";return Object.keys(e).sort().forEach((function(t){e[t]&&(o=o+"&"+t+"="+e[t])})),o=o.slice(1),x(o,t).toString()},Se=function(e,t){return new Promise(((o,n)=>{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 o=e.data&&e.data.error&&e.data.error.code||"SYS_ERR",s=e.data&&e.data.error&&e.data.error.message||e.errMsg||"request:fail";return n(new de({code:o,message:s,requestId:t}))}const s=e.data;if(s.error)return n(new de({code:s.error.code,message:s.error.message,requestId:t}));s.result=s.data,s.requestId=t,delete s.data,o(s)}}))}))},xe=function(e){return T.stringify(C.parse(e))},Ce=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=he,this._getAccessTokenPromiseHub=new O({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new de({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:L})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return Se(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,o)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?o(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"]=be(t.data,this.config.clientSecret),t}setupRequest(e,t){const o=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};return"auth"!==t&&(o.token=this.accessToken,n["x-basement-token"]=this.accessToken),n["x-serverless-sign"]=be(o,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:o,dataType:"json",header:n}}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))}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:o,filePath:n,fileType:s,onUploadProgress:a}){return new Promise(((i,r)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:o,filePath:n,fileType:s,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?i(e):r(new de({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){r(new de({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof a&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{a({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:o="image",cloudPathAsRealPath:n=!1,onUploadProgress:s,config:a}){if("string"!==I(t))throw new de({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new de({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new de({code:"INVALID_PARAM",message:"cloudPath不合法"});const i=a&&a.envType||this.config.envType;if(n&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new de({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const r=(await this.getOSSUploadOptionsFromPath({env:i,filename:n?t.split("/").pop():t,fileId:n?t:void 0})).result,l="https://"+r.cdnDomain+"/"+r.ossPath,{securityToken:c,accessKeyId:u,signature:d,host:h,ossPath:p,id:m,policy:f,ossCallbackUrl:g}=r,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:u,Signature:d,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=xe(e)}const k={url:"https://"+r.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:o};if(await this.uploadFileToOSS(Object.assign({},k,{onUploadProgress:s})),g)return{success:!0,filePath:e,fileID:l};if((await this.reportOSSUpload({id:m})).success)return{success:!0,filePath:e,fileID:l};throw new de({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,o)=>{Array.isArray(e)&&0!==e.length||o(new de({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 de({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}}},Te={init(e){const t=new Ce(e),o={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return o},t.customAuth=t.auth,t}};const Ee="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var De,Ne;(Ne=De||(De={})).local="local",Ne.none="none",Ne.session="session";var Ie=function(){},Ae=w((function(e,t){var o;e.exports=(o=S,function(e){var t=o,n=t.lib,s=n.WordArray,a=n.Hasher,i=t.algo,r=[],l=[];!function(){function t(t){for(var o=e.sqrt(t),n=2;n<=o;n++)if(!(t%n))return!1;return!0}function o(e){return 4294967296*(e-(0|e))|0}for(var n=2,s=0;s<64;)t(n)&&(s<8&&(r[s]=o(e.pow(n,.5))),l[s]=o(e.pow(n,1/3)),s++),n++}();var c=[],u=i.SHA256=a.extend({_doReset:function(){this._hash=new s.init(r.slice(0))},_doProcessBlock:function(e,t){for(var o=this._hash.words,n=o[0],s=o[1],a=o[2],i=o[3],r=o[4],u=o[5],d=o[6],h=o[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 k=n&s^n&a^s&a,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=h+((r<<26|r>>>6)^(r<<21|r>>>11)^(r<<7|r>>>25))+(r&u^~r&d)+l[p]+c[p];h=d,d=u,u=r,r=i+_|0,i=a,a=s,s=n,n=_+(v+k)|0}o[0]=o[0]+n|0,o[1]=o[1]+s|0,o[2]=o[2]+a|0,o[3]=o[3]+i|0,o[4]=o[4]+r|0,o[5]=o[5]+u|0,o[6]=o[6]+d|0,o[7]=o[7]+h|0},_doFinalize:function(){var t=this._data,o=t.words,n=8*this._nDataBytes,s=8*t.sigBytes;return o[s>>>5]|=128<<24-s%32,o[14+(s+64>>>9<<4)]=e.floor(n/4294967296),o[15+(s+64>>>9<<4)]=n,t.sigBytes=4*o.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(u),t.HmacSHA256=a._createHmacHelper(u)}(Math),o.SHA256)})),Be=Ae,Pe=w((function(e,t){e.exports=S.HmacSHA256}));const Ve=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new de({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,o)=>{e=(e,n)=>e?o(e):t(n)}));return e.promise=t,e};function Le(e){return void 0===e}function Oe(e){return"[object Null]"===Object.prototype.toString.call(e)}var Fe;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(Fe||(Fe={}));const Re={adapter:null,runtime:void 0},Me=["anonymousUuidKey"];class Ue extends Ie{constructor(){super(),Re.adapter.root.tcbObject||(Re.adapter.root.tcbObject={})}setItem(e,t){Re.adapter.root.tcbObject[e]=t}getItem(e){return Re.adapter.root.tcbObject[e]}removeItem(e){delete Re.adapter.root.tcbObject[e]}clear(){delete Re.adapter.root.tcbObject}}function je(e,t){switch(e){case"local":return t.localStorage||new Ue;case"none":return new Ue;default:return t.sessionStorage||new Ue}}class $e{constructor(e){if(!this._storage){this._persistence=Re.adapter.primaryStorage||e.persistence,this._storage=je(this._persistence,Re.adapter);const t=`access_token_${e.env}`,o=`access_token_expire_${e.env}`,n=`refresh_token_${e.env}`,s=`anonymous_uuid_${e.env}`,a=`login_type_${e.env}`,i=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:o,refreshTokenKey:n,anonymousUuidKey:s,loginTypeKey:a,userInfoKey:i}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const o=je(e,Re.adapter);for(const n in this.keys){const e=this.keys[n];if(t&&Me.includes(n))continue;const s=this._storage.getItem(e);Le(s)||Oe(s)||(o.setItem(e,s),this._storage.removeItem(e))}this._storage=o}setStore(e,t,o){if(!this._storage)return;const n={version:o||"localCachev1",content:t},s=JSON.stringify(n);try{this._storage.setItem(e,s)}catch(a){throw a}}getStore(e,t){try{if(!this._storage)return}catch(n){return""}t=t||"localCachev1";const o=this._storage.getItem(e);return o&&o.indexOf(t)>=0?JSON.parse(o).content:""}removeStore(e){this._storage.removeItem(e)}}const ze={},qe={};function He(e){return ze[e]}class We{constructor(e,t){this.data=t||null,this.name=e}}class Je extends We{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const Ke=new class{constructor(){this._listeners={}}on(e,t){return o=e,n=t,(s=this._listeners)[o]=s[o]||[],s[o].push(n),this;var o,n,s}off(e,t){return function(e,t,o){if(o&&o[e]){const n=o[e].indexOf(t);-1!==n&&o[e].splice(n,1)}}(e,t,this._listeners),this}fire(e,t){if(e instanceof Je)return console.error(e.error),this;const o="string"==typeof e?new We(e,t||{}):e,n=o.name;if(this._listens(n)){o.target=this;const e=this._listeners[n]?[...this._listeners[n]]:[];for(const t of e)t.call(this,o)}return this}_listens(e){return this._listeners[e]&&this._listeners[e].length>0}};function Ge(e,t){Ke.on(e,t)}function Ye(e,t={}){Ke.fire(e,t)}function Qe(e,t){Ke.off(e,t)}const Ze="loginStateChanged",Xe="loginStateExpire",et="loginTypeChanged",tt="anonymousConverted",ot="refreshAccessToken";var nt;!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"}(nt||(nt={}));const st=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],at={"X-SDK-Version":"1.3.5"};function it(e,t,o){const n=e[t];e[t]=function(t){const s={},a={};o.forEach((o=>{const{data:n,headers:i}=o.call(e,t);Object.assign(s,n),Object.assign(a,i)}));const i=t.data;return i&&(()=>{var e;if(e=i,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...i,...s};else for(const t in s)i.append(t,s[t])})(),t.headers={...t.headers||{},...a},n.call(e,t)}}function rt(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...at,"x-seqid":e}}}class lt{constructor(e={}){var t;this.config=e,this._reqClass=new Re.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=He(this.config.env),this._localCache=(t=this.config.env,qe[t]),it(this._reqClass,"post",[rt]),it(this._reqClass,"upload",[rt]),it(this._reqClass,"download",[rt])}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(o){t=o}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:o,loginTypeKey:n,anonymousUuidKey:s}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let a=this._cache.getStore(o);if(!a)throw new de({message:"未登录CloudBase"});const i={refresh_token:a},r=await this.request("auth.fetchAccessTokenWithRefreshToken",i);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(n)===nt.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(s),t=this._cache.getStore(o),n=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(n.refresh_token),this._refreshAccessToken()}Ye(Xe),this._cache.removeStore(o)}throw new de({code:r.data.code,message:`刷新access token失败:${r.data.code}`})}if(r.data.access_token)return Ye(ot),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(o),this._cache.setStore(o,r.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:o}=this._cache.keys;if(!this._cache.getStore(o))throw new de({message:"refresh token不存在,登录状态异常"});let n=this._cache.getStore(e),s=this._cache.getStore(t),a=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(n,s))&&(a=!1),(!n||!s||s<Date.now())&&a?this.refreshAccessToken():{accessToken:n,accessTokenExpire:s}}async request(e,t,o){const n=`x-tcb-trace_${this.config.env}`;let s="application/x-www-form-urlencoded";const a={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===st.indexOf(e)){const{refreshTokenKey:e}=this._cache.keys;this._cache.getStore(e)&&(a.access_token=(await this.getAccessToken()).accessToken)}let i;if("storage.uploadFile"===e){i=new FormData;for(let e in i)i.hasOwnProperty(e)&&void 0!==i[e]&&i.append(e,a[e]);s="multipart/form-data"}else{s="application/json",i={};for(let e in a)void 0!==a[e]&&(i[e]=a[e])}let r={headers:{"content-type":s}};o&&o.onUploadProgress&&(r.onUploadProgress=o.onUploadProgress);const l=this._localCache.getStore(n);l&&(r.headers["X-TCB-Trace"]=l);const{parse:c,inQuery:u,search:d}=t;let h={env:this.config.env};c&&(h.parse=!0),u&&(h={...u,...h});let p=function(e,t,o={}){const n=/\?/.test(t);let s="";for(let a in o)""===s?!n&&(t+="?"):s+="&",s+=`${a}=${encodeURIComponent(o[a])}`;return/^http(s)?\:\/\//.test(t+=s)?t:`${e}${t}`}(Ee,"//tcb-api.tencentcloudapi.com/web",h);d&&(p+=d);const m=await this.post({url:p,data:i,...r}),f=m.header&&m.header["x-tcb-trace"];if(f&&this._localCache.setStore(n,f),200!==Number(m.status)&&200!==Number(m.statusCode)||!m.data)throw new de({code:"NETWORK_ERROR",message:"network request error"});return m}async send(e,t={}){const o=await this.request(e,t,{onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===o.data.code&&-1===st.indexOf(e)){await this.refreshAccessToken();const o=await this.request(e,t,{onUploadProgress:t.onUploadProgress});if(o.data.code)throw new de({code:o.data.code,message:o.data.message});return o.data}if(o.data.code)throw new de({code:o.data.code,message:o.data.message});return o.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:o,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(o),this._cache.setStore(n,e)}}const ct={};function ut(e){return ct[e]}class dt{constructor(e){this.config=e,this._cache=He(e.env),this._request=ut(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:o,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(o),this._cache.setStore(n,e)}setAccessToken(e,t){const{accessTokenKey:o,accessTokenExpireKey:n}=this._cache.keys;this._cache.setStore(o,e),this._cache.setStore(n,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 ht{constructor(e){if(!e)throw new de({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=He(this._envId),this._request=ut(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeof e)throw new de({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 de({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:o}=e;return o.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:o,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:o,avatarUrl:n,province:s,country:a,city:i}=e,{data:r}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:o,avatarUrl:n,province:s,country:a,city:i});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 pt{constructor(e){if(!e)throw new de({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=He(e);const{refreshTokenKey:t,accessTokenKey:o,accessTokenExpireKey:n}=this._cache.keys,s=this._cache.getStore(t),a=this._cache.getStore(o),i=this._cache.getStore(n);this.credential={refreshToken:s,accessToken:a,accessTokenExpire:i},this.user=new ht(e)}get isAnonymousAuth(){return this.loginType===nt.ANONYMOUS}get isCustomAuth(){return this.loginType===nt.CUSTOM}get isWeixinAuth(){return this.loginType===nt.WECHAT||this.loginType===nt.WECHAT_OPEN||this.loginType===nt.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class mt extends dt{async signIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,o=this._cache.getStore(e)||void 0,n=this._cache.getStore(t)||void 0,s=await this._request.send("auth.signInAnonymously",{anonymous_uuid:o,refresh_token:n});if(s.uuid&&s.refresh_token){this._setAnonymousUUID(s.uuid),this.setRefreshToken(s.refresh_token),await this._request.refreshAccessToken(),Ye(Ze),Ye(et,{env:this.config.env,loginType:nt.ANONYMOUS,persistence:"local"});const e=new pt(this.config.env);return await e.user.refresh(),e}throw new de({message:"匿名登录失败"})}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:o}=this._cache.keys,n=this._cache.getStore(t),s=this._cache.getStore(o),a=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:n,refresh_token:s,ticket:e});if(a.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(a.refresh_token),await this._request.refreshAccessToken(),Ye(tt,{env:this.config.env}),Ye(et,{loginType:nt.CUSTOM,persistence:"local"}),{credential:{refreshToken:a.refresh_token}};throw new de({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:o}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(o,nt.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class ft extends dt{async signIn(e){if("string"!=typeof e)throw new de({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,o=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(o.refresh_token)return this.setRefreshToken(o.refresh_token),await this._request.refreshAccessToken(),Ye(Ze),Ye(et,{env:this.config.env,loginType:nt.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new pt(this.config.env);throw new de({message:"自定义登录失败"})}}class gt extends dt{async signIn(e,t){if("string"!=typeof e)throw new de({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:o}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(o)||""}),{refresh_token:s,access_token:a,access_token_expire:i}=n;if(s)return this.setRefreshToken(s),a&&i?this.setAccessToken(a,i):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ye(Ze),Ye(et,{env:this.config.env,loginType:nt.EMAIL,persistence:this.config.persistence}),new pt(this.config.env);throw n.code?new de({code:n.code,message:`邮箱登录失败: ${n.message}`}):new de({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 yt extends dt{async signIn(e,t){if("string"!=typeof e)throw new de({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeof t&&(t="",console.warn("password is empty"));const{refreshTokenKey:o}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:nt.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(o)||""}),{refresh_token:s,access_token_expire:a,access_token:i}=n;if(s)return this.setRefreshToken(s),i&&a?this.setAccessToken(i,a):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ye(Ze),Ye(et,{env:this.config.env,loginType:nt.USERNAME,persistence:this.config.persistence}),new pt(this.config.env);throw n.code?new de({code:n.code,message:`用户名密码登录失败: ${n.message}`}):new de({message:"用户名密码登录失败"})}}class kt{constructor(e){this.config=e,this._cache=He(e.env),this._request=ut(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),Ge(et,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 mt(this.config)}customAuthProvider(){return new ft(this.config)}emailAuthProvider(){return new gt(this.config)}usernameAuthProvider(){return new yt(this.config)}async signInAnonymously(){return new mt(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new gt(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new yt(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new mt(this.config)),Ge(tt,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===nt.ANONYMOUS)throw new de({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:o}=this._cache.keys,n=this._cache.getStore(e);if(!n)return;const s=await this._request.send("auth.logout",{refresh_token:n});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(o),Ye(Ze),Ye(et,{env:this.config.env,loginType:nt.NULL,persistence:this.config.persistence}),s}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){Ge(Ze,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){Ge(Xe,e.bind(this))}onAccessTokenRefreshed(e){Ge(ot,e.bind(this))}onAnonymousConverted(e){Ge(tt,e.bind(this))}onLoginTypeChanged(e){Ge(et,(()=>{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 pt(this.config.env):null}async isUsernameRegistered(e){if("string"!=typeof e)throw new de({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 ft(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,o=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+o}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:o,env:n}=e.data;n===this.config.env&&(this._cache.updatePersistence(o),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const vt=function(e,t){t=t||Ve();const o=ut(this.config.env),{cloudPath:n,filePath:s,onUploadProgress:a,fileType:i="image"}=e;return o.send("storage.getUploadMetadata",{path:n}).then((e=>{const{data:{url:r,authorization:l,token:c,fileId:u,cosFileId:d},requestId:h}=e,p={key:n,signature:l,"x-cos-meta-fileid":d,success_action_status:"201","x-cos-security-token":c};o.upload({url:r,data:p,file:s,name:n,fileType:i,onUploadProgress:a}).then((e=>{201===e.statusCode?t(null,{fileID:u,requestId:h}):t(new de({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},_t=function(e,t){t=t||Ve();const o=ut(this.config.env),{cloudPath:n}=e;return o.send("storage.getUploadMetadata",{path:n}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},wt=function({fileList:e},t){if(t=t||Ve(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let n of e)if(!n||"string"!=typeof n)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const o={fileid_list:e};return ut(this.config.env).send("storage.batchDeleteFile",o).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},bt=function({fileList:e},t){t=t||Ve(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let o=[];for(let s of e)"object"==typeof s?(s.hasOwnProperty("fileID")&&s.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),o.push({fileid:s.fileID,max_age:s.maxAge})):"string"==typeof s?o.push({fileid:s}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const n={file_list:o};return ut(this.config.env).send("storage.batchGetDownloadUrl",n).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},St=async function({fileID:e},t){const o=(await bt.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==o.code)return t?t(o):new Promise((e=>{e(o)}));const n=ut(this.config.env);let s=o.download_url;if(s=encodeURI(s),!t)return n.download({url:s});t(await n.download({url:s}))},xt=function({name:e,data:t,query:o,parse:n,search:s},a){const i=a||Ve();let r;try{r=t?JSON.stringify(t):""}catch(c){return Promise.reject(c)}if(!e)return Promise.reject(new de({code:"PARAM_ERROR",message:"函数名不能为空"}));const l={inQuery:o,parse:n,search:s,function_name:e,request_data:r};return ut(this.config.env).send("functions.invokeFunction",l).then((e=>{if(e.code)i(null,e);else{let o=e.data.response_data;if(n)i(null,{result:o,requestId:e.requestId});else try{o=JSON.parse(e.data.response_data),i(null,{result:o,requestId:e.requestId})}catch(t){i(new de({message:"response data must be json"}))}}return i.promise})).catch((e=>{i(e)})),i.promise},Ct={timeout:15e3,persistence:"session"},Tt={};class Et{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(Re.adapter||(this.requestClient=new Re.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...Ct,...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 Et(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||Re.adapter.primaryStorage||Ct.persistence;var o;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;ze[t]=new $e(e),qe[t]=new $e({...e,persistence:"local"})}(this.config),o=this.config,ct[o.env]=new lt(o),this.authObj=new kt(this.config),this.authObj}on(e,t){return Ge.apply(this,[e,t])}off(e,t){return Qe.apply(this,[e,t])}callFunction(e,t){return xt.apply(this,[e,t])}deleteFile(e,t){return wt.apply(this,[e,t])}getTempFileURL(e,t){return bt.apply(this,[e,t])}downloadFile(e,t){return St.apply(this,[e,t])}uploadFile(e,t){return vt.apply(this,[e,t])}getUploadMetadata(e,t){return _t.apply(this,[e,t])}registerExtension(e){Tt[e.name]=e}async invokeExtension(e,t){const o=Tt[e];if(!o)throw new de({message:`扩展${e} 必须先注册`});return await o.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:o}=function(e){const t=(o=e,"[object Array]"===Object.prototype.toString.call(o)?e:[e]);var o;for(const n of t){const{isMatch:e,genAdapter:t,runtime:o}=n;if(e())return{adapter:t(),runtime:o}}}(e)||{};t&&(Re.adapter=t),o&&(Re.runtime=o)}}var Dt=new Et;function Nt(e,t,o){void 0===o&&(o={});var n=/\?/.test(t),s="";for(var a in o)""===s?!n&&(t+="?"):s+="&",s+=a+"="+encodeURIComponent(o[a]);return/^http(s)?:\/\//.test(t+=s)?t:""+e+t}class It{post(e){const{url:t,data:o,headers:n}=e;return new Promise(((e,s)=>{he.request({url:Nt("https:",t),data:o,method:"POST",header:n,success(t){e(t)},fail(e){s(e)}})}))}upload(e){return new Promise(((t,o)=>{const{url:n,file:s,data:a,headers:i,fileType:r}=e,l=he.uploadFile({url:Nt("https:",n),name:"file",formData:Object.assign({},a),filePath:s,fileType:r,header:i,success(e){const o={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&a.success_action_status&&(o.statusCode=parseInt(a.success_action_status,10)),t(o)},fail(e){o(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 At={setItem(e,t){he.setStorageSync(e,t)},getItem:e=>he.getStorageSync(e),removeItem(e){he.removeStorageSync(e)},clear(){he.clearStorageSync()}};var Bt={genAdapter:function(){return{root:{},reqClass:It,localStorage:At,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};Dt.useAdapters(Bt);const Pt=Dt,Vt=Pt.init;Pt.init=function(e){e.env=e.spaceId;const t=Vt.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;const o=t.auth;return t.auth=function(e){const t=o.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{var o;t[e]=(o=t[e],function(e){e=e||{};const{success:t,fail:n,complete:s}=ue(e);if(!(t||n||s))return o.call(this,e);o.call(this,e).then((e=>{t&&t(e),s&&s(e)}),(e=>{n&&n(e),s&&s(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var Lt=Pt,Ot=class extends Ce{getAccessToken(){return new Promise(((e,t)=>{const o="Anonymous_Access_token";this.setAccessToken(o),e(o)}))}setupRequest(e,t){const o=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};"auth"!==t&&(o.token=this.accessToken,n["x-basement-token"]=this.accessToken),n["x-serverless-sign"]=be(o,this.config.clientSecret);const s=we();n["x-client-info"]=encodeURIComponent(JSON.stringify(s));const{token:a}=me();return n["x-client-token"]=a,{url:this.config.requestUrl,method:"POST",data:o,dataType:"json",header:JSON.parse(JSON.stringify(n))}}uploadFileToOSS({url:e,formData:t,name:o,filePath:n,fileType:s,onUploadProgress:a}){return new Promise(((i,r)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:o,filePath:n,fileType:s,success(e){e&&e.statusCode<400?i(e):r(new de({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){r(new de({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof a&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{a({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}uploadFile({filePath:e,cloudPath:t,fileType:o="image",onUploadProgress:n}){if(!t)throw new de({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let s;return this.getOSSUploadOptionsFromPath({cloudPath:t}).then((t=>{const{url:a,formData:i,name:r}=t.result;s=t.result.fileUrl;const l={url:a,formData:i,name:r,filePath:e,fileType:o};return this.uploadFileToOSS(Object.assign({},l,{onUploadProgress:n}))})).then((()=>this.reportOSSUpload({cloudPath:t}))).then((t=>new Promise(((o,n)=>{t.success?o({success:!0,filePath:e,fileID:s}):n(new de({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){const t={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};return this.request(this.setupRequest(t)).then((e=>{if(e.success)return e.result;throw new de({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e,maxAge:t}={}){if(!Array.isArray(e)||0===e.length)throw new de({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const o={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e,maxAge:t})};return this.request(this.setupRequest(o)).then((e=>{if(e.success)return{fileList:e.result.fileList.map((e=>({fileID:e.fileID,tempFileURL:e.tempFileURL})))};throw new de({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})}))}},Ft={init(e){const t=new Ot(e),o={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return o},t.customAuth=t.auth,t}},Rt=w((function(e,t){e.exports=S.enc.Hex}));function Mt(){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 Ut(e="",t={}){const{data:o,functionName:n,method:s,headers:a,signHeaderKeys:i=[],config:r}=t,l=Date.now(),c=Mt(),u=Object.assign({},a,{"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":n,"x-client-timestamp":l,"x-alipay-source":"client","x-request-id":c,"x-alipay-callid":c,"x-trace-id":c}),d=["x-from-app-id","x-from-env-id","x-to-env-id","x-from-instance-id","x-from-function-name","x-client-timestamp"].concat(i),[h="",p=""]=e.split("?")||[],m=function(e){const t=e.signedHeaders.join(";"),o=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),n=Be(e.body).toString(Rt),s=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${o}\n${t}\n${n}\n`,a=Be(s).toString(Rt),i=`HMAC-SHA256\n${e.timestamp}\n${a}\n`,r=Pe(i,e.secretKey).toString(Rt);return`HMAC-SHA256 Credential=${e.secretId}, SignedHeaders=${t}, Signature=${r}`}({path:h,query:p,method:s,headers:u,timestamp:l,body:JSON.stringify(o),secretId:r.accessKey,secretKey:r.secretKey,signedHeaders:d.sort()});return{url:`${r.endpoint}${e}`,headers:Object.assign({},u,{Authorization:m})}}function jt({url:e,data:t,method:o="POST",headers:n={}}){return new Promise(((s,a)=>{he.request({url:e,method:o,data:"object"==typeof t?JSON.stringify(t):t,header:n,dataType:"json",complete:(e={})=>{const t=n["x-trace-id"]||"";if(!e.statusCode||e.statusCode>=400){const{message:o,errMsg:n,trace_id:s}=e.data||{};return a(new de({code:"SYS_ERR",message:o||n||"request:fail",requestId:s||t}))}s({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function $t(e,t){const{path:o,data:n,method:s="GET"}=e,{url:a,headers:i}=Ut(o,{functionName:"",data:n,method:s,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 jt({url:a,data:n,method:s,headers:i}).then((e=>{const t=e.data||{};if(!t.success)throw new de({code:e.errCode,message:e.errMsg,requestId:e.requestId});return t.data||{}})).catch((e=>{throw new de({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}function zt(e=""){const t=e.trim().replace(/^cloud:\/\//,""),o=t.indexOf("/");if(o<=0)throw new de({code:"INVALID_PARAM",message:"fileID不合法"});const n=t.substring(0,o),s=t.substring(o+1);return n!==this.config.spaceId&&console.warn("file ".concat(e," does not belong to env ").concat(this.config.spaceId)),s}function qt(e=""){return"cloud://".concat(this.config.spaceId,"/").concat(e.replace(/^\/+/,""))}class Ht{constructor(e){this.config=e}signedURL(e,t={}){const o=`/ws/function/${e}`,n=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),s=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:Mt(),timestamp:""+Date.now()}),a=[o,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map((function(e){return s[e]?"".concat(e,"=").concat(s[e]):null})).filter(Boolean).join("&"),`host:${n}`].join("\n"),i=["HMAC-SHA256",Be(a).toString(Rt)].join("\n"),r=Pe(i,this.config.secretKey).toString(Rt),l=Object.keys(s).map((e=>`${e}=${encodeURIComponent(s[e])}`)).join("&");return`${this.config.wsEndpoint}${o}?${l}&signature=${r}`}}var Wt={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 Ht(this.config)}callFunction(e){return function(e,t){const{name:o,data:n,async:s=!1}=e,a="POST",i={"x-to-function-name":o};s&&(i["x-function-invoke-type"]="async");const{url:r,headers:l}=Ut("/functions/invokeFunction",{functionName:o,data:n,method:a,headers:i,signHeaderKeys:["x-to-function-name"],config:t});return jt({url:r,data:n,method:a,headers:l}).then((e=>{let t=0;if(s){const o=e.data||{};t="200"===o.errCode?0:o.errCode,e.data=o.data||{},e.errMsg=o.errMsg}if(0!==t)throw new de({code:t,message:e.errMsg,requestId:e.requestId});return{errCode:t,success:0===t,requestId:e.requestId,result:e.data}})).catch((e=>{throw new de({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}(e,this.config)}uploadFileToOSS({url:e,filePath:t,fileType:o,formData:n,onUploadProgress:s}){return new Promise(((a,i)=>{const r=he.uploadFile({url:e,filePath:t,fileType:o,formData:n,name:"file",success(e){e&&e.statusCode<400?a(e):i(new de({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){i(new de({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof s&&r&&"function"==typeof r.onProgressUpdate&&r.onProgressUpdate((e=>{s({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}async uploadFile({filePath:e,cloudPath:t="",fileType:o="image",onUploadProgress:n}){if("string"!==I(t))throw new de({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new de({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new de({code:"INVALID_PARAM",message:"cloudPath不合法"});const s=await $t({path:"/".concat(t.replace(/^\//,""),"?post_url")},this.config),{file_id:a,upload_url:i,form_data:r}=s,l=r&&r.reduce(((e,t)=>(e[t.key]=t.value,e)),{});return this.uploadFileToOSS({url:i,filePath:e,fileType:o,formData:l,onUploadProgress:n}).then((()=>({fileID:a})))}async getTempFileURL({fileList:e}){return new Promise(((t,o)=>{(!e||e.length<0)&&o(new de({errCode:"INVALID_PARAM",errMsg:"fileList不能为空数组"})),e.length>50&&o(new de({errCode:"INVALID_PARAM",errMsg:"fileList数组长度不能超过50"}));const n=[];for(const s of e){"string"!==I(s)&&o(new de({errCode:"INVALID_PARAM",errMsg:"fileList的元素必须是非空的字符串"}));const e=zt.call(this,s);n.push({file_id:e,expire:600})}$t({path:"/?download_url",data:{file_list:n},method:"POST"},this.config).then((e=>{const{file_list:o=[]}=e;t({fileList:o.map((e=>({fileID:qt.call(this,e.file_id),tempFileURL:e.download_url})))})})).catch((e=>o(e)))}))}async connectWebSocket(e){const{name:t,query:o}=e;return he.connectSocket({url:this._websocket.signedURL(t,o),complete:()=>{}})}}(e);return t.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},t}};function Jt({data:e}){let t;t=we();const o=JSON.parse(JSON.stringify(e||{}));if(Object.assign(o,{clientInfo:t}),!o.uniIdToken){const{token:e}=me();e&&(o.uniIdToken=e)}return o}const Kt=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Gt=/[\\^$.*+?()[\]{}|]/g,Yt=RegExp(Gt.source);function Qt(e,t,o){return e.replace(new RegExp((n=t)&&Yt.test(n)?n.replace(Gt,"\\$&"):n,"g"),o);var n}const Zt=2e4,Xt={code:20101,message:"Invalid client"};function eo(e){const{errSubject:t,subject:o,errCode:n,errMsg:s,code:a,message:i,cause:r}=e||{};return new de({subject:t||o||"uni-secure-network",code:n||a||Zt,message:s||i,cause:r})}let to;function oo({secretType:e}={}){return"request"===e||"response"===e||"both"===e}function no({name:e,data:t={}}={}){return"DCloud-clientDB"===e&&"encryption"===t.redirectTo&&"getAppClientKey"===t.action}function so({functionName:e,result:t,logPvd:o}){}function ao(e){const t=e.callFunction,o=function(o){const n=o.name;o.data=Jt.call(e,{data:o.data});const s={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay"}[this.config.provider],a=oo(o),i=no(o),r=a||i;return t.call(this,o).then((e=>(e.errCode=0,!r&&so.call(this,{functionName:n,result:e,logPvd:s}),Promise.resolve(e))),(e=>(!r&&so.call(this,{functionName:n,result:e,logPvd:s}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:o=[]}={}){for(let n=0;n<o.length;n++){const{rule:s,content:a,mode:i}=o[n],r=e.match(s);if(!r)continue;let l=a;for(let e=1;e<r.length;e++)l=Qt(l,`{$${e}}`,r[e]);for(const e in t)l=Qt(l,`{${e}}`,t[e]);return"replace"===i?l:e+l}return e}({message:`[${o.name}]: ${e.message}`,formatter:Kt,extraInfo:{functionName:n}})),Promise.reject(e))))};e.callFunction=function(t){const{provider:n,spaceId:s}=e.config,a=t.name;let i,r;return t.data=t.data||{},i=o,i=i.bind(e),r=no(t)?o.call(e,t):oo(t)?new to({secretType:t.secretType,uniCloudIns:e}).wrapEncryptDataCallFunction(o.bind(e))(t):function({provider:e,spaceId:t,functionName:o}={}){const{appId:n,uniPlatform:s,osName:a}=ke();let i=s;"app"===s&&(i=a);const r=function({provider:e,spaceId:t}={}){const o=R;if(!o)return{};e=function(e){return"tencent"===e?"tcb":e}(e);const n=o.find((o=>o.provider===e&&o.spaceId===t));return n&&n.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 u=function(e,t){let o,n,s;for(let a=0;a<e.length;a++){const i=e[a];i!==t?"*"!==i?i.split(",").map((e=>e.trim())).indexOf(t)>-1&&(n=i):s=i:o=i}return o||n||s}(c,o);if(!u)return!1;if((l[u]||[]).find(((e={})=>e.appId===n&&(e.platform||"").toLowerCase()===i.toLowerCase())))return!0;throw console.error(`此应用[appId: ${n}, platform: ${i}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),eo(Xt)}({provider:n,spaceId:s,functionName:a})?new to({secretType:t.secretType,uniCloudIns:e}).wrapVerifyClientCallFunction(o.bind(e))(t):i(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)))}}to=class{constructor(){throw eo({message:"Platform app is not enabled, please check whether secure network module is enabled in your manifest.json"})}};const io=Symbol("CLIENT_DB_INTERNAL");function ro(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=io,e.inspect=null,e.__v_raw=void 0,new Proxy(e,{get(e,o,n){if("_uniClient"===o)return null;if("symbol"==typeof o)return e[o];if(o in e||"string"!=typeof o){const t=e[o];return"function"==typeof t?t.bind(e):t}return t.get(e,o,n)}})}function lo(e){return{on:(t,o)=>{e[t]=e[t]||[],e[t].indexOf(o)>-1||e[t].push(o)},off:(t,o)=>{e[t]=e[t]||[];const n=e[t].indexOf(o);-1!==n&&e[t].splice(n,1)}}}const co=["db.Geo","db.command","command.aggregate"];function uo(e,t){return co.indexOf(`${e}.${t}`)>-1}function ho(e){switch(I(e=pe(e))){case"array":return e.map((e=>ho(e)));case"object":return e._internalType===io||Object.keys(e).forEach((t=>{e[t]=ho(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function po(e){return e&&e.content&&e.content.$method}class mo{constructor(e,t,o){this.content=e,this.prevStage=t||null,this.udb=null,this._database=o}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:ho(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=po(e),o=po(e.prevStage);if("aggregate"===t&&"collection"===o||"pipeline"===t)return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if("command"===po(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=po(e),o=po(e.prevStage);if("aggregate"===t&&"command"===o)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return fo({$method:e,$param:ho(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 o=this.getAction(),n=this.getCommand();return n.$db.push({$method:e,$param:ho(t)}),this._database._callCloudFunction({action:o,command:n})}}function fo(e,t,o){return ro(new mo(e,t,o),{get(e,t){let n="db";return e&&e.content&&(n=e.content.$method),uo(n,t)?fo({$method:t},e,o):function(){return fo({$method:t,$param:ho(Array.from(arguments))},e,o)}}})}function go({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 yo(e,t={}){return ro(new e(t),{get:(e,t)=>uo("db",t)?fo({$method:t},null,e):function(){return fo({$method:t,$param:ho(Array.from(arguments))},null,e)}})}class ko extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=$("_globalUniCloudDatabaseCallback")),t||(this.auth=lo(this._authCallBacks)),this._isJQL=t,Object.assign(this,lo(this._dbCallBacks)),this.env=ro({},{get:(e,t)=>({$env:t})}),this.Geo=ro({},{get:(e,t)=>go({path:["Geo"],method:t})}),this.serverDate=go({path:[],method:"serverDate"}),this.RegExp=go({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeof e||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const o=this._dbCallBacks;o[e]&&o[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){const o=this._authCallBacks;o[e]&&o[e].forEach((e=>{e(...t)}))}multiSend(){const e=Array.from(arguments),t=e.map((e=>{const t=e.getAction(),o=e.getCommand();if("getTemp"!==o.$db[o.$db.length-1].$method)throw new Error("multiSend只支持子命令内使用getTemp");return{action:t,command:o}}));return this._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:o,queryList:n}){function s(e,t){if(o&&n)for(let o=0;o<n.length;o++){const s=n[o];s.udb&&"function"==typeof s.udb.setResult&&(t?s.udb.setResult(t):s.udb.setResult(e.result.dataList[o]))}}const a=this,i=this._isJQL?"databaseForJQL":"database";function r(e){return a._callback("error",[e]),J(K(i,"fail"),e).then((()=>J(K(i,"complete"),e))).then((()=>(s(null,e),ie(Q,{type:ee,content:e}),Promise.reject(e))))}const l=J(K(i,"invoke")),c=this._uniClient;return l.then((()=>c.callFunction({name:"DCloud-clientDB",type:"CLIENT_DB",data:{action:e,command:t,multiCommand:o}}))).then((e=>{const{code:t,message:o,token:n,tokenExpired:l,systemInfo:c=[]}=e.result;if(c)for(let s=0;s<c.length;s++){const{level:e,message:t,detail:o}=c[s],n=console["warn"===e?"error":e]||console.log;let a="[System Info]"+t;o&&(a=`${a}\n详细信息:${o}`),n(a)}if(t)return r(new de({code:t,message:o,requestId:e.requestId}));e.result.errCode=e.result.errCode||e.result.code,e.result.errMsg=e.result.errMsg||e.result.message,n&&l&&(fe({token:n,tokenExpired:l}),this._callbackAuth("refreshToken",[{token:n,tokenExpired:l}]),this._callback("refreshToken",[{token:n,tokenExpired:l}]),ie(X,{token:n,tokenExpired:l}));const u=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(let s=0;s<u.length;s++){const{prop:t,tips:o}=u[s];if(t in e.result){const n=e.result[t];Object.defineProperty(e.result,t,{get:()=>(console.warn(o),n)})}}return d=e,J(K(i,"success"),d).then((()=>J(K(i,"complete"),d))).then((()=>{s(d,null);const e=a._parseResult(d);return ie(Q,{type:ee,content:e}),Promise.resolve(e)}));var d}),(e=>(/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"),r(new de({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const vo="token无效,跳转登录页面",_o="token过期,跳转登录页面",wo={TOKEN_INVALID_TOKEN_EXPIRED:_o,TOKEN_INVALID_INVALID_CLIENTID:vo,TOKEN_INVALID:vo,TOKEN_INVALID_WRONG_TOKEN:vo,TOKEN_INVALID_ANONYMOUS_USER:vo},bo={"uni-id-token-expired":_o,"uni-id-check-token-failed":vo,"uni-id-token-not-exist":vo,"uni-id-check-device-feature-failed":vo};function So(e,t){let o="";return o=e?`${e}/${t}`:t,o.replace(/^\//,"")}function xo(e=[],t=""){const o=[],n=[];return e.forEach((e=>{!0===e.needLogin?o.push(So(t,e.path)):!1===e.needLogin&&n.push(So(t,e.path))})),{needLoginPage:o,notNeedLoginPage:n}}function Co(e){return e.split("?")[0].replace(/^\//,"")}function To(){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 Eo(){return Co(To())}function Do(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const o=t.list,n=Co(e);return o.some((e=>e.pagePath===n))}const No=!!_.uniIdRouter,{loginPage:Io,routerNeedLogin:Ao,resToLogin:Bo,needLoginPage:Po,notNeedLoginPage:Vo,loginPageInTabBar:Lo}=function({pages:e=[],subPackages:t=[],uniIdRouter:o={},tabBar:n={}}=_){const{loginPage:s,needLogin:a=[],resToLogin:i=!0}=o,{needLoginPage:r,notNeedLoginPage:l}=xo(e),{needLoginPage:c,notNeedLoginPage:u}=function(e=[]){const t=[],o=[];return e.forEach((e=>{const{root:n,pages:s=[]}=e,{needLoginPage:a,notNeedLoginPage:i}=xo(s,n);t.push(...a),o.push(...i)})),{needLoginPage:t,notNeedLoginPage:o}}(t);return{loginPage:s,routerNeedLogin:a,resToLogin:i,needLoginPage:[...r,...c],notNeedLoginPage:[...l,...u],loginPageInTabBar:Do(s,n)}}();if(Po.indexOf(Io)>-1)throw new Error(`Login page [${Io}] should not be "needLogin", please check your pages.json`);function Oo(e){const t=Eo();if("/"===e.charAt(0))return e;const[o,n]=e.split("?"),s=o.replace(/^\//,"").split("/"),a=t.split("/");a.pop();for(let i=0;i<s.length;i++){const e=s[i];".."===e?a.pop():"."!==e&&a.push(e)}return""===a[0]&&a.shift(),"/"+a.join("/")+(n?"?"+n:"")}function Fo({redirect:e}){const t=Co(e),o=Co(Io);return Eo()!==o&&t!==o}function Ro({api:e,redirect:t}={}){if(!t||!Fo({redirect:t}))return;const o=(s=t,"/"!==(n=Io).charAt(0)&&(n="/"+n),s?n.indexOf("?")>-1?n+`&uniIdRedirectUrl=${encodeURIComponent(s)}`:n+`?uniIdRedirectUrl=${encodeURIComponent(s)}`:n);var n,s;Lo?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo");const a={navigateTo:uni.navigateTo,redirectTo:uni.redirectTo,switchTab:uni.switchTab,reLaunch:uni.reLaunch};setTimeout((()=>{a[e]({url:o})}),0)}function Mo({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},o=function(){const{token:e,tokenExpired:t}=me();let o;if(e){if(t<Date.now()){const e="uni-id-token-expired";o={errCode:e,errMsg:bo[e]}}}else{const e="uni-id-check-token-failed";o={errCode:e,errMsg:bo[e]}}return o}();if(function(e){const t=Co(Oo(e));return!(Vo.indexOf(t)>-1)&&(Po.indexOf(t)>-1||Ao.some((t=>{return o=e,new RegExp(t).test(o);var o})))}(e)&&o){if(o.uniIdRedirectUrl=e,ne(Z).length>0)return setTimeout((()=>{ie(Z,o)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function Uo(){!function(){const e=To(),{abortLoginPageJump:t,autoToLoginPage:o}=Mo({url:e});t||o&&Ro({api:"redirectTo",redirect:e})}();const e=["navigateTo","redirectTo","reLaunch","switchTab"];for(let t=0;t<e.length;t++){const o=e[t];uni.addInterceptor(o,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:n}=Mo({url:e.url});return t?e:n?(Ro({api:o,redirect:Oo(e.url)}),!1):e}})}}function jo(){this.onResponse((e=>{const{type:t,content:o}=e;let n=!1;switch(t){case"cloudobject":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in bo}(o);break;case"clientdb":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in wo}(o)}n&&function(e={}){const t=ne(Z);ce().then((()=>{const o=To();if(o&&Fo({redirect:o}))return t.length>0?ie(Z,Object.assign({uniIdRedirectUrl:o},e)):void(Io&&Ro({api:"navigateTo",redirect:o}))}))}(o)}))}function $o(e){var t;(t=e).onResponse=function(e){se(Q,e)},t.offResponse=function(e){ae(Q,e)},function(e){e.onNeedLogin=function(e){se(Z,e)},e.offNeedLogin=function(e){ae(Z,e)},No&&($("_globalUniCloudStatus").needLoginInit||($("_globalUniCloudStatus").needLoginInit=!0,ce().then((()=>{Uo.call(e)})),Bo&&jo.call(e)))}(e),function(e){e.onRefreshToken=function(e){se(X,e)},e.offRefreshToken=function(e){ae(X,e)}}(e)}let zo;const qo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ho=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Wo(){const e=me().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let o;try{o=JSON.parse((n=t[1],decodeURIComponent(zo(n).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(s){throw new Error("获取当前用户信息出错,详细错误信息为:"+s.message)}var n;return o.tokenExpired=1e3*o.exp,delete o.exp,delete o.iat,o}zo="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Ho.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 o,n,s="",a=0;a<e.length;)t=qo.indexOf(e.charAt(a++))<<18|qo.indexOf(e.charAt(a++))<<12|(o=qo.indexOf(e.charAt(a++)))<<6|(n=qo.indexOf(e.charAt(a++))),s+=64===o?String.fromCharCode(t>>16&255):64===n?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}:atob;var Jo=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const o="chooseAndUploadFile:ok",n="chooseAndUploadFile:fail";function s(e,t){return e.tempFiles.forEach(((e,o)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+o+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function a(e,t,{onChooseFile:n,onUploadProgress:s}){return t.then((e=>{if(n){const t=n(e);if(void 0!==t)return Promise.resolve(t).then((t=>void 0===t?e:t))}return e})).then((t=>!1===t?{errMsg:o,tempFilePaths:[],tempFiles:[]}:function(e,t,n=5,s){(t=Object.assign({},t)).errMsg=o;const a=t.tempFiles,i=a.length;let r=0;return new Promise((o=>{for(;r<n;)l();function l(){const n=r++;if(n>=i)return void(!a.find((e=>!e.url&&!e.errMsg))&&o(t));const c=a[n];e.uploadFile({provider:c.provider,filePath:c.path,cloudPath:c.cloudPath,fileType:c.fileType,cloudPathAsRealPath:c.cloudPathAsRealPath,onUploadProgress(e){e.index=n,e.tempFile=c,e.tempFilePath=c.path,s&&s(e)}}).then((e=>{c.url=e.fileID,n<i&&l()})).catch((e=>{c.errMsg=e.errMsg||e.message,n<i&&l()}))}}))}(e,t,5,s)))}t.initChooseAndUploadFile=function(e){return function(t={type:"all"}){return"image"===t.type?a(e,function(e){const{count:t,sizeType:o,sourceType:a=["album","camera"],extension:i}=e;return new Promise(((e,r)=>{uni.chooseImage({count:t,sizeType:o,sourceType:a,extension:i,success(t){e(s(t,"image"))},fail(e){r({errMsg:e.errMsg.replace("chooseImage:fail",n)})}})}))}(t),t):"video"===t.type?a(e,function(e){const{camera:t,compressed:o,maxDuration:a,sourceType:i=["album","camera"],extension:r}=e;return new Promise(((e,l)=>{uni.chooseVideo({camera:t,compressed:o,maxDuration:a,sourceType:i,extension:r,success(t){const{tempFilePath:o,duration:n,size:a,height:i,width:r}=t;e(s({errMsg:"chooseVideo:ok",tempFilePaths:[o],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:o,size:a,type:t.tempFile&&t.tempFile.type||"",width:r,height:i,duration:n,fileType:"video",cloudPath:""}]},"video"))},fail(e){l({errMsg:e.errMsg.replace("chooseVideo:fail",n)})}})}))}(t),t):a(e,function(e){const{count:t,extension:o}=e;return new Promise(((e,a)=>{let i=uni.chooseFile;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(i=wx.chooseMessageFile),"function"!=typeof i)return a({errMsg:n+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});i({type:"all",count:t,extension:o,success(t){e(s(t))},fail(e){a({errMsg:e.errMsg.replace("chooseFile:fail",n)})}})}))}(t),t)}}})));function Ko(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 o=!1;const n=[];for(let s=2;s<e.length;s++)e[s]!==t[s]&&(n.push(e[s]),o=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(o,n)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:o}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomError=null,this.mixinDatacomGet().then((o=>{this.mixinDatacomLoading=!1;const{data:n,count:s}=o.result;this.getcount&&(this.mixinDatacomPage.count=s),this.mixinDatacomHasMore=n.length<this.pageSize;const a=e?n.length?n[0]:void 0:n;this.mixinDatacomResData=a,t&&t(a)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,this.mixinDatacomError=e,o&&o(e)})))},mixinDatacomGet(t={}){let o;t=t||{},o="undefined"!=typeof __uniX&&__uniX?e.databaseForJQL(this.spaceInfo):e.database(this.spaceInfo);const n=t.action||this.action;n&&(o=o.action(n));const s=t.collection||this.collection;o=Array.isArray(s)?o.collection(...s):o.collection(s);const a=t.where||this.where;a&&Object.keys(a).length&&(o=o.where(a));const i=t.field||this.field;i&&(o=o.field(i));const r=t.foreignKey||this.foreignKey;r&&(o=o.foreignKey(r));const l=t.groupby||this.groupby;l&&(o=o.groupBy(l));const c=t.groupField||this.groupField;c&&(o=o.groupField(c)),!0===(void 0!==t.distinct?t.distinct:this.distinct)&&(o=o.distinct());const u=t.orderby||this.orderby;u&&(o=o.orderBy(u));const d=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),o=o.skip(h*(d-1)).limit(h).get(g),o}}}}function Go(e){return $("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function Yo({openid:e,callLoginByWeixin:t=!1}={}){throw Go(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `app`")}async function Qo(e){const t=Go(this);return t.initPromise||(t.initPromise=Yo.call(this,e).then((e=>e)).catch((e=>{throw delete t.initPromise,e}))),t.initPromise}function Zo(e){_e=e}function Xo(e){const t={getSystemInfo:uni.getSystemInfo,getPushClientId:uni.getPushClientId};return function(o){return new Promise(((n,s)=>{t[e]({...o,success(e){n(e)},fail(e){s(e)}})}))}}class en 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 o=this._callback[e];if(!o)return;const n=function(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]===t)return o;return-1}(o,t);o.splice(n,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const o=this._callback[e];if(o)for(let n=0;n<o.length;n++)o[n](...t)}}{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([Xo("getSystemInfo")(),Xo("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:o,messageId:n,message:s}=t;this._payloadQueue.push({action:o,messageId:n,message:s}),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:o,message:n}=e;"end"===t?this._end({messageId:o,message:n}):"message"===t&&this._appendMessage({messageId:o,message:n})}_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 tn={tcb:Lt,tencent:Lt,aliyun:Te,private:Ft,alipay:Wt};let on=new class{init(e){let t={};const o=tn[e.provider];if(!o)throw new Error("未提供正确的provider参数");var n;return t=o.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new O({createPromise:function(){let t=Promise.resolve();t=new Promise((e=>{setTimeout((()=>{e()}),1)}));const o=e.auth();return t.then((()=>o.getLoginState())).then((e=>e?Promise.resolve():o.signInAnonymously()))}}))}(t),ao(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(n=t).database=function(e){if(e&&Object.keys(e).length>0)return n.init(e).database();if(this._database)return this._database;const t=yo(ko,{uniClient:n});return this._database=t,t},n.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return n.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=yo(ko,{uniClient:n,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=Wo,e.chooseAndUploadFile=Jo.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return Ko(e)}}),e.SSEChannel=en,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:o=!1}={}){return Qo.call(e,{openid:t,callLoginByWeixin:o})}}(e),e.setCustomClientInfo=Zo,e.importObject=function(t){return function(o,n={}){n=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}},n);const{customUI:s,loadingOptions:a,errorOptions:i,parseSystemError:r}=n,l=!s;return new Proxy({},{get(s,c){switch(c){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:e,interceptorName:t,getCallbackArgs:o}={}){return async function(...n){const s=o?o({params:n}):{};let a,i;try{return await J(K(t,"invoke"),{...s}),a=await e(...n),await J(K(t,"success"),{...s,result:a}),a}catch(r){throw i=r,await J(K(t,"fail"),{...s,error:i}),i}finally{await J(K(t,"complete"),i?{...s,error:i}:{...s,result:a})}}}({fn:async function s(...u){let d;l&&uni.showLoading({title:a.title,mask:a.mask});const h={name:o,type:"OBJECT",data:{method:c,params:u}};"object"==typeof n.secretMethods&&function(e,t){const o=t.data.method,n=e.secretMethods||{},s=n[o]||n["*"];s&&(t.secretType=s)}(n,h);let p=!1;try{d=await t.callFunction(h)}catch(e){p=!0,d={result:new de(e)}}const{errSubject:m,errCode:f,errMsg:g,newToken:y}=d.result||{};if(l&&uni.hideLoading(),y&&y.token&&y.tokenExpired&&(fe(y),ie(X,{...y})),f){let e=g;if(p&&r&&(e=(await r({objectName:o,methodName:c,params:u,errSubject:m,errCode:f,errMsg:g})).errMsg||g),l)if("toast"===i.type)uni.showToast({title:e,icon:"none"});else{if("modal"!==i.type)throw new Error(`Invalid errorOptions.type: ${i.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel:o,cancelText:n,confirmText:s}={}){return new Promise(((a,i)=>{uni.showModal({title:e,content:t,showCancel:o,cancelText:n,confirmText:s,success(e){a(e)},fail(){a({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:i.retry,cancelText:"取消",confirmText:i.retry?"重试":"确定"});if(i.retry&&t)return s(...u)}}const t=new de({subject:m,code:f,message:g,requestId:d.requestId});throw t.detail=d.result,ie(Q,{type:oe,content:t}),t}return ie(Q,{type:oe,content:d.result}),d.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:o,methodName:c,params:e}}})}})}}(e)}(t),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;const o=t[e];t[e]=function(){return o.apply(t,Array.from(arguments))},t[e]=function(e,t){return function(o){let n=!1;if("callFunction"===t){const e=o&&o.type||E;n=e!==E}const s="callFunction"===t&&!n,a=this._initPromiseHub.exec();o=o||{};const{success:i,fail:r,complete:l}=ue(o),c=a.then((()=>n?Promise.resolve():J(K(t,"invoke"),o))).then((()=>e.call(this,o))).then((e=>n?Promise.resolve(e):J(K(t,"success"),e).then((()=>J(K(t,"complete"),e))).then((()=>(s&&ie(Q,{type:te,content:e}),Promise.resolve(e))))),(e=>n?Promise.reject(e):J(K(t,"fail"),e).then((()=>J(K(t,"complete"),e))).then((()=>(ie(Q,{type:te,content:e}),Promise.reject(e))))));if(!(i||r||l))return c;c.then((e=>{i&&i(e),l&&l(e),s&&ie(Q,{type:te,content:e})}),(e=>{r&&r(e),l&&l(e),s&&ie(Q,{type:te,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=M;let t={};if(e&&1===e.length)t=e[0],on=on.init(t),on._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];let o;o=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",t.forEach((e=>{on[e]=function(){return console.error(o),Promise.reject(new de({code:"SYS_ERR",message:o}))}}))}Object.assign(on,{get mixinDatacom(){return Ko(on)}}),$o(on),on.addInterceptor=H,on.removeInterceptor=W,on.interceptObject=G})();var nn=on;const sn=u({name:"uni-data-select",mixins:[nn.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 o=null;return function(...n){o&&clearTimeout(o),o=setTimeout((()=>{e.apply(this,n)}),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((o=>{o.value===e&&(t=o.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:o,channel_code:n}=e;if(n=n?`(${n})`:"",this.format){let t="";t=this.format;for(let o in e)t=t.replace(new RegExp(`{${o}}`,"g"),e[o]);return t}return this.collection.indexOf("app-list")>0?`${t}(${o})`:t||`未命名${n}`},getLoadData(){return this.mixinDatacomResData},getCurrentCacheKey(){return this.collection},getCache(e=this.getCurrentCacheKey()){return(uni.getStorageSync(this.cacheKey)||{})[e]},setCache(e,t=this.getCurrentCacheKey()){let o=uni.getStorageSync(this.cacheKey)||{};o[t]=e,uni.setStorageSync(this.cacheKey,o)},removeCache(e=this.getCurrentCacheKey()){let t=uni.getStorageSync(this.cacheKey)||{};delete t[e],uni.setStorageSync(this.cacheKey,t)}}},[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"uni-stat__select"},[s.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:"uni-label-text hide-on-phone"},e.toDisplayString(s.label+":"),1)):e.createCommentVNode("",!0),e.createElementVNode("view",{class:e.normalizeClass(["uni-stat-box",{"uni-stat__actived":i.current}])},[e.createElementVNode("view",{class:e.normalizeClass(["uni-select",{"uni-select--disabled":s.disabled}])},[e.createElementVNode("view",{class:"uni-select__input-box",onClick:n[1]||(n[1]=(...e)=>r.toggleSelector&&r.toggleSelector(...e))},[i.current?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select__input-text"},e.toDisplayString(r.textShow),1)):(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__input-text uni-select__input-placeholder"},e.toDisplayString(r.typePlaceholder),1)),i.current&&s.clear&&!s.disabled?(e.openBlock(),e.createElementBlock("view",{key:2,onClick:n[0]||(n[0]=e.withModifiers(((...e)=>r.clearVal&&r.clearVal(...e)),["stop"]))},[e.createVNode(l,{type:"clear",color:"#c0c4cc",size:"24"})])):(e.openBlock(),e.createElementBlock("view",{key:3},[e.createVNode(l,{type:i.showSelector?"top":"bottom",size:"14",color:"#999"},null,8,["type"])]))]),i.showSelector?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select--mask",onClick:n[2]||(n[2]=(...e)=>r.toggleSelector&&r.toggleSelector(...e))})):e.createCommentVNode("",!0),i.showSelector?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__selector",style:e.normalizeStyle(r.getOffsetByPlacement)},[e.createElementVNode("view",{class:e.normalizeClass("bottom"==s.placement?"uni-popper__arrow_bottom":"uni-popper__arrow_top")},null,2),e.createElementVNode("scroll-view",{"scroll-y":"true",class:"uni-select__selector-scroll"},[0===i.mixinDatacomResData.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select__selector-empty"},[e.createElementVNode("text",null,e.toDisplayString(s.emptyTips),1)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(i.mixinDatacomResData,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"uni-select__selector-item",key:o,onClick:e=>r.change(t)},[e.createElementVNode("text",{class:e.normalizeClass({"uni-select__selector__disabled":t.disable})},e.toDisplayString(r.formatItemName(t)),3)],8,["onClick"])))),128))])],4)):e.createCommentVNode("",!0)],2)],2)])}],["__scopeId","data-v-6d601b46"]]),an=["{","}"];const rn=/^(?:\d)+/,ln=/^(?:\w)+/;const cn="zh-Hans",un="zh-Hant",dn="en",hn=Object.prototype.hasOwnProperty,pn=(e,t)=>hn.call(e,t),mn=new class{constructor(){this._caches=Object.create(null)}interpolate(e,t,o=an){if(!t)return[e];let n=this._caches[e];return n||(n=function(e,[t,o]){const n=[];let s=0,a="";for(;s<e.length;){let i=e[s++];if(i===t){a&&n.push({type:"text",value:a}),a="";let t="";for(i=e[s++];void 0!==i&&i!==o;)t+=i,i=e[s++];const r=i===o,l=rn.test(t)?"list":r&&ln.test(t)?"named":"unknown";n.push({value:t,type:l})}else a+=i}return a&&n.push({type:"text",value:a}),n}(e,o),this._caches[e]=n),function(e,t){const o=[];let n=0;const s=Array.isArray(t)?"list":(a=t,null!==a&&"object"==typeof a?"named":"unknown");var a;if("unknown"===s)return o;for(;n<e.length;){const a=e[n];switch(a.type){case"text":o.push(a.value);break;case"list":o.push(t[parseInt(a.value,10)]);break;case"named":"named"===s&&o.push(t[a.value])}n++}return o}(n,t)}};function fn(e,t){if(!e)return;if(e=e.trim().replace(/_/g,"-"),t&&t[e])return e;if("chinese"===(e=e.toLowerCase()))return cn;if(0===e.indexOf("zh"))return e.indexOf("-hans")>-1?cn:e.indexOf("-hant")>-1?un:(o=e,["-tw","-hk","-mo","-cht"].find((e=>-1!==o.indexOf(e)))?un:cn);var o;let n=[dn,"fr","es"];t&&Object.keys(t).length>0&&(n=Object.keys(t));const s=function(e,t){return t.find((t=>0===e.indexOf(t)))}(e,n);return s||void 0}class gn{constructor({locale:e,fallbackLocale:t,messages:o,watcher:n,formater:s}){this.locale=dn,this.fallbackLocale=dn,this.message={},this.messages={},this.watchers=[],t&&(this.fallbackLocale=t),this.formater=s||mn,this.messages=o||{},this.setLocale(e||dn),n&&this.watchLocale(n)}setLocale(e){const t=this.locale;this.locale=fn(e,this.messages)||this.fallbackLocale,this.messages[this.locale]||(this.messages[this.locale]={}),this.message=this.messages[this.locale],t!==this.locale&&this.watchers.forEach((e=>{e(this.locale,t)}))}getLocale(){return this.locale}watchLocale(e){const t=this.watchers.push(e)-1;return()=>{this.watchers.splice(t,1)}}add(e,t,o=!0){const n=this.messages[e];n?o?Object.assign(n,t):Object.keys(t).forEach((e=>{pn(n,e)||(n[e]=t[e])})):this.messages[e]=t}f(e,t,o){return this.formater.interpolate(e,t,o).join("")}t(e,t,o){let n=this.message;return"string"==typeof t?(t=fn(t,this.messages))&&(n=this.messages[t]):o=t,pn(n,e)?this.formater.interpolate(n[e],o).join(""):(console.warn(`Cannot translate the value of keypath ${e}. Use the value of keypath as default.`),e)}}function yn(e,t={},o,n){if("string"!=typeof e){const o=[t,e];e=o[0],t=o[1]}"string"!=typeof e&&(e="undefined"!=typeof uni&&uni.getLocale?uni.getLocale():"undefined"!=typeof global&&global.getLocale?global.getLocale():dn),"string"!=typeof o&&(o="undefined"!=typeof __uniConfig&&__uniConfig.fallbackLocale||dn);const s=new gn({locale:e,fallbackLocale:o,messages:t,watcher:n});let a=(e,t)=>{if("function"!=typeof getApp)a=function(e,t){return s.t(e,t)};else{let e=!1;a=function(t,o){const n=getApp().$vm;return n&&(n.$locale,e||(e=!0,function(e,t){e.$watchLocale?e.$watchLocale((e=>{t.setLocale(e)})):e.$watch((()=>e.$locale),(e=>{t.setLocale(e)}))}(n,s))),s.t(t,o)}}return a(e,t)};return{i18n:s,f:(e,t,o)=>s.f(e,t,o),t:(e,t)=>a(e,t),add:(e,t,o=!0)=>s.add(e,t,o),watch:e=>s.watchLocale(e),getLocale:()=>s.getLocale(),setLocale:e=>s.setLocale(e)}}const kn={en:{"uni-load-more.contentdown":"Pull up to show more","uni-load-more.contentrefresh":"loading...","uni-load-more.contentnomore":"No more data"},"zh-Hans":{"uni-load-more.contentdown":"上拉显示更多","uni-load-more.contentrefresh":"正在加载...","uni-load-more.contentnomore":"没有更多数据了"},"zh-Hant":{"uni-load-more.contentdown":"上拉顯示更多","uni-load-more.contentrefresh":"正在加載...","uni-load-more.contentnomore":"沒有更多數據了"}};let vn;setTimeout((()=>{vn=uni.getSystemInfoSync().platform}),16);const{t:_n}=yn(kn);const wn=u({name:"UniLoadMore",emits:["clickLoadMore"],props:{status:{type:String,default:"more"},showIcon:{type:Boolean,default:!0},iconType:{type:String,default:"auto"},iconSize:{type:Number,default:24},color:{type:String,default:"#777777"},contentText:{type:Object,default:()=>({contentdown:"",contentrefresh:"",contentnomore:""})},showText:{type:Boolean,default:!0}},data:()=>({webviewHide:!1,platform:vn,imgBase64:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzlBMzU3OTlEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzlBMzU3OUFEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOUEzNTc5N0Q5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOUEzNTc5OEQ5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pt+ALSwAAA6CSURBVHja1FsLkFZVHb98LM+F5bHL8khA1iSeiyQBCRM+YGqKUnnJTDLGI0BGZlKDIU2MMglUiDApEZvSsZnQtBRJtKwQNKQMFYeRDR10WOLd8ljYXdh+v8v5fR3Od+797t1dnOnO/Ofce77z+J//+b/P+ZqtXbs2sJ9MJhNUV1cHJ06cCJo3bx7EPc2aNcvpy7pWrVoF+/fvDyoqKoI2bdoE9fX1F7TjN8a+EXBn/fkfvw942Tf+wYMHg9mzZwfjxo0LDhw4EPa1x2MbFw/fOGfPng1qa2tzcCkILsLDydq2bRsunpOTMM7TD/W/tZDZhPdeKD+yGxHhdu3aBV27dg3OnDlzMVANMheLAO3btw8KCwuDmpoaX5OxbgUIMEq7K8IcPnw4KCsrC/r37x8cP378/4cAXAB3vqSkJMuiDhTkw+XcuXNhOWbMmKBly5YhUT8xArhyFvP0BfwRsAuwxJZJsm/nzp2DTp06he/OU+cZ64K6o0ePBkOHDg2GDx8e6gEbJ5Q/NHNuAJQ1hgBeHUDlR7nVTkY8rQAvAi4z34vR/mPs1FoRsaCgIJThI0eOBC1atEiFGGV+5MiRoS45efJkqFjJFXV1dQuA012m2WcwTw98fy6CqBdsaiIO4CScrGPHjvk4odhavPquRtFWXEC25VgkREKOCh/qDSq+vn37htzD/mZTOmOc5U7zKzBPEedygWshcDyWvs30igAbU+6oyMgJBCFhwQE0fccxN60Ay9iebbjoDh06hMowjQxT4fXq1SskArmHZpkArvixp/kWzHdMeArExSJEaiXIjjRjRJ4DaAGWpibLzXN3Fm1vA5teBgh3j1Rv3bp1YgKwPdmf2p9zcyNYYgPKMfY0T5f5nNYdw158nJ8QawW4CLKwiOBSEgO/hok2eBydR+3dYH+PLxA5J8Vv0KBBwenTp0P2JWAx6+yFEBfs8lMY+y0SWMBNI9E4ThKi58VKTg3FQZS1RQF1cz27eC0QHMu+3E0SkUowjhVt5VdaWhp07949ZHv2Qd1EjDXM2cla1M0nl3GxAs3J9yREzyTdFVKVFOaE9qRA8GM0WebRuo9JGZKA7Mv2SeS/Z8+eoQ9BArMfFrLGo6jvxbhHbJZnKX2Rzz1O7QhJJ9Cs2ZMaWIyq/zhdeqPNfIoHd58clIQD+JSXl4dKlyIAuBdVXZwFVWKspSSoxE++h8x4k3uCnEhE4I5KwRiFWGOU0QWKiCYLbdoRMRKAu2kQ9vkfLU6dOhX06NEjlH+yMRZSinnuyWnYosVcji8CEA/6Cg2JF+IIUBqnGKUTCNwtwBN4f89RiK1R96DEgO2o0NDmtEdvVFdVVYV+P3UAPUEs6GFwV3PHmXkD4vh74iDFJysVI/MlaQhwKeBNTLYX5VuA8T4/gZxA4MRGFxDB6R7OmYPfyykGRJbyie+XnGYnQIC/coH9+vULiYrxrkL9ZA9+0ykaHIfEpM7ge8TiJ2CsHYwyMfafAF1yCGBHYIbCVDjDjKt7BeB51D+LgQa6OkG7IDYEEtvQ7lnXLKLtLdLuJBpE4gPUXcW2+PkZwOex+4cGDhwYDBkyRL7/HFcEwUGPo/8uWRUpYnfxGHco8HkewLHLyYmAawAPuIFZxhOpDfJQ8gbUv41yORAptMWBNr6oqMhWird5+u+iHmBb2nhjDV7HWBNQTgK8y11l5NetWzc5ULscAtSj7nbNI0skhWeUZCc0W4nyH/jO4Vz0u1IeYhbk4AiwM6tjxIWByHsoZ9qcIBPJd/y+DwPfBESOmCa/QF3WiZHucLlEDpNxcNhmheEOPgdQNx6/VZFQzFZ5TN08AHXQt2Ii3EdyFuUsPtTcGPhW5iMiCNELvz+Gdn9huG4HUJaW/w3g0wxV0XaG7arG2WeKiUWYM4Y7GO5ezshTARbbWGw/DvXkpp/ivVvE0JVoMxN4rpGzJMhE5Pl+xlATsDIqikP9F9D2z3h9nOksEUFhK+qO4rcPkoalMQ/HqJLIyb3F3JdjrCcw1yZ8joyJLR5gCo54etlag7qIoeNh1N1BRYj3DTFJ0elotxPlVzkGuYAmL0VSJVGAJA41c4Z6A3BzTLfn0HYwYKEI6CUAMzZEWvLsIcQOo1AmmyyM72nHJCfYsogflGV6jEk9vyQZXSuq6w4c16NsGcGZbwOPr+H1RkOk2LEzjNepxQkihHSCQ4ynAYNRx2zMKV92CQMWqj8J0BRE8EShxRFN6YrfCRhC0x3r/Zm4IbQCcmJoV0kMamllccR6FjHqUC5F2R/wS2dcymOlfAKOS4KmzQb5cpNC2MC7JhVn5wjXoJ44rYhLh8n0eXOCorJxa7POjbSlCGVczr34/RsAmrcvo9s+wGp3tzVhntxiXiJ4nvEYb4FJkf0O8HocAePmLvCxnL0AORraVekJk6TYjDabRVXfRE2lCN1h6ZQRN1+InUbsCpKwoBZHh0dODN9JBCUffItXxEavTQkUtnfTVAplCWL3JISz29h4NjotnuSsQKJCk8dF+kJR6RARjrqFVmfPnj3ZbK8cIJ0msd6jgHPGtfVTQ8VLmlvh4mct9sobRmPic0DyDQQnx/NlfYUgyz59+oScsH379pAwXABD32nTpoUHIToESeI5mnbE/UqDdyLcafEBf2MCqgC7NwxIbMREJQ0g4D4sfJwnD+AmRrII05cfMWJE+L1169bQr+fip06dGp4oJ83lmYd5wj/EmMa4TaHivo4EeCguYZBnkB5g2aWA69OIEnUHOaGysjIYMGBAMGnSpODYsWPZwCpFmm4lNq+4gSLQA7jcX8DwtjEyRC8wjabnXEx9kfWnTJkSJkAo90xpJVV+FmcVNeYAF5zWngS4C4O91MBxmAv8blLEpbjI5sz9MTdAhcgkCT1RO8mZkAjfiYpTEvStAS53Uw1vAiUGgZ3GpuQEYvoiBqlIan7kSDHnTwJQFNiPu0+5VxCVYhcZIjNrdXUDdp+Eq5AZ3Gkg8QAyVZRZIk4Tl4QAbF9cXJxNYZMAtAokgs4BrNxEpCtteXg7DDTMDKYNSuQdKsnJBek7HxewvxaosWxLYXtw+cJp18217wql4aKCfBNoEu0O5VU+PhctJ0YeXD4C6JQpyrlpSLTojpGGGN5YwNziChdIZLk4lvLcFJ9jMX3QdiImY9bmGQU+TRUL5CHITTRlgF8D9ouD1MfmLoEPl5xokIumZ2cfgMpHt47IW9N64Hsh7wQYYjyIugWuF5fCqYncXRd5vPMWyizzvhi/32+nvG0dZc9vR6fZOu0md5e+uC408FvKSIOZwXlGvxPv95izA2Vtvg1xKFWARI+vMX66HUhpQQb643uW1bSjuTWyw2SBvDrBvjFic1eGGlz5esq3ko9uSIlBRqPuFcCv8F4WIcN12nVaBd0SaYwI6PDDImR11JkqgHcPmQssjxIn6bUshygDFJUTxPMpHk+jfjPgupgdnYV2R/g7xSjtpah8RJBewhwf0gGK6XI92u4wXFEU40afJ4DN4h5LcAd+40HI3JgJecuT0c062W0i2hQJUTcxan3/CMW1PF2K6bbA+Daz4xRs1D3Br1Cm0OihKCqizW78/nXAF/G5TXrEcVzaNMH6CyMswqsAHqDyDLEyou8lwOXnKF8DjI6KjV3KzMBiXkDH8ij/H214J5A596ekrZ3F0zXlWeL7+P5eUrNo3/QwC15uxthuzidy7DzKRwEDaAViiDgKbTbz7CJnzo0bN7pIfIiid8SuPwn25o3QCmpnyjlZkyxPP8EomCJzrGb7GJMx7tNsq4MT2xMUYaiErZOluTzKsnz3gwCeCZyVRZJfYplNEokEjwrPtxlxjeYAk+F1F74VAzPxQRNYYdtpOUvWs8J1sGhBJMNsb7igN8plJs1eSmLIhLKE4rvaCX27gOhLpLOsIzJ7qn/i+wZzcvSOZ23/du8TZjwV8zHIXoP4R3ifBxiFz1dcVpa3aPntPE+c6TmIWE9EtcMmAcPdWAhYhAXxcLOQi9L1WhD1Sc8p1d2oL7XGiRKp8F4A2i8K/nfI+y/gsTDJ/YC/8+AD5Uh04KHiGl+cIFPnBDDrPMjwRGkLXyxO4VGbfQWnDH2v0bVWE3C9QOXlepbgjEfIJQI6XDG3z5ahD9cw2pS78ipB85wyScNTvsVzlzzhL8/jRrnmVjfFJK/m3m4nj9vbgQTguT8XZTjsm672R5uJKEaQmBI/c58gyus8ZDagLpEVSJBIyHp4jn++xqPV71OgQgJYEWOtZ/haxRtKmWOBu8xdBLftWltsY84zE6WIEy/eIOWL+BaayMx+KHtL7EAkqdNDLiEXmEMUHniedtJqg9HmZtfvt26vNi0BdG3Ft3g8ZOf7PAu59TxtzivLNIekyi+wD1i8CuUiD9FXAa8C+/xS3JPmZnomyc7H+fb4/Se0bk41Fel621r4cgVxbq91V4jVqwB7HTe2M7jgB+QWHavZkDRPmZcASoZEmBx6i75bGjPcMdL4/VKGFAGWZkGzPG0XAbdL9A81G5LOmUnC9hHKJeO7dcUMjblSl12867ElFTtaGl20xvvLGPdVz/8TVuU7y0x1PG7vtNg24oz9Uo/Z412++VFWI7Fcog9tu9Lm6gvRmIPv9x1xmQAu6RDkXtbOtlGEmpgD5Nvnyc0dcv0EE6cfdi1HmhMf9wDF3k3gtRvEedhxjpgfqPb9PU9iEJHnyOUA7bQUXh6kq/D7l2iTjWv7XOD530BDr8jIrus+srXjt4MzumJMHuTsBa63YKE1+RR5lBjEikCCnWKWiHdzOgKO+nRIBAF88za/IFmJ3eMZov4CYxGBabcpGL8EYx+SeMXJeRwHNsV/h+vdxeuhEpN3ZyNY78Gm2fknJxVGhyjixPiQvVkNzT1elD9Py/aTAL64Hb9vcYmC9zfdXdT/C1LeGbg4rnBaAihDFJH12W5ulfNCNe/xTsP3bp8ikzJs5BF+5PNfAQYAPaseTdsEcaYAAAAASUVORK5CYII="}),computed:{iconSnowWidth(){return 2*(Math.floor(this.iconSize/24)||1)},contentdownText(){return this.contentText.contentdown||_n("uni-load-more.contentdown")},contentrefreshText(){return this.contentText.contentrefresh||_n("uni-load-more.contentrefresh")},contentnomoreText(){return this.contentText.contentnomore||_n("uni-load-more.contentnomore")}},mounted(){var e=getCurrentPages(),t=e[e.length-1].$getAppWebview();t.addEventListener("hide",(()=>{this.webviewHide=!0})),t.addEventListener("show",(()=>{this.webviewHide=!1}))},methods:{onClick(){this.$emit("clickLoadMore",{detail:{status:this.status}})}}},[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-load-more",onClick:o[0]||(o[0]=(...e)=>i.onClick&&i.onClick(...e))},[!a.webviewHide&&("circle"===n.iconType||"auto"===n.iconType&&"android"===a.platform)&&"loading"===n.status&&n.showIcon?(e.openBlock(),e.createElementBlock("view",{key:0,style:e.normalizeStyle({width:n.iconSize+"px",height:n.iconSize+"px"}),class:"uni-load-more__img uni-load-more__img--android-MP"},[e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:n.color,borderTopWidth:n.iconSize/12})},null,4),e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:n.color,borderTopWidth:n.iconSize/12})},null,4),e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:n.color,borderTopWidth:n.iconSize/12})},null,4)],4)):!a.webviewHide&&"loading"===n.status&&n.showIcon?(e.openBlock(),e.createElementBlock("view",{key:1,style:e.normalizeStyle({width:n.iconSize+"px",height:n.iconSize+"px"}),class:"uni-load-more__img uni-load-more__img--ios-H5"},[e.createElementVNode("image",{src:a.imgBase64,mode:"widthFix"},null,8,["src"])],4)):e.createCommentVNode("",!0),n.showText?(e.openBlock(),e.createElementBlock("text",{key:2,class:"uni-load-more__text",style:e.normalizeStyle({color:n.color})},e.toDisplayString("more"===n.status?i.contentdownText:"loading"===n.status?i.contentrefreshText:i.contentnomoreText),5)):e.createCommentVNode("",!0)])}],["__scopeId","data-v-a7e112cc"]]),bn={name:"uniDataChecklist",mixins:[nn.mixinDatacom||{}],emits:["input","update:modelValue","change"],props:{mode:{type:String,default:"default"},multiple:{type:Boolean,default:!1},value:{type:[Array,String,Number],default:()=>""},modelValue:{type:[Array,String,Number],default:()=>""},localdata:{type:Array,default:()=>[]},min:{type:[Number,String],default:""},max:{type:[Number,String],default:""},wrap:{type:Boolean,default:!1},icon:{type:String,default:"left"},selectedColor:{type:String,default:""},selectedTextColor:{type:String,default:""},emptyText:{type:String,default:"暂无数据"},disabled:{type:Boolean,default:!1},map:{type:Object,default:()=>({text:"text",value:"value"})}},watch:{localdata:{handler(e){this.range=e,this.dataList=this.getDataList(this.getSelectedValue(e))},deep:!0},mixinDatacomResData(e){this.range=e,this.dataList=this.getDataList(this.getSelectedValue(e))},value(e){this.dataList=this.getDataList(e)},modelValue(e){this.dataList=this.getDataList(e)}},data:()=>({dataList:[],range:[],contentText:{contentdown:"查看更多",contentrefresh:"加载中",contentnomore:"没有更多"},isLocal:!0,styles:{selectedColor:"#2979ff",selectedTextColor:"#666"},isTop:0}),computed:{dataValue(){return""===this.value?this.modelValue:(this.modelValue,this.value)}},created(){this.localdata&&0!==this.localdata.length?(this.isLocal=!0,this.range=this.localdata,this.dataList=this.getDataList(this.getSelectedValue(this.range))):this.collection&&(this.isLocal=!1,this.loadData())},methods:{loadData(){this.mixinDatacomGet().then((e=>{this.mixinDatacomResData=e.result.data,0===this.mixinDatacomResData.length?(this.isLocal=!1,this.mixinDatacomErrorMessage=this.emptyText):this.isLocal=!0})).catch((e=>{this.mixinDatacomErrorMessage=e.message}))},getForm(e="uniForms"){let t=this.$parent,o=t.$options.name;for(;o!==e;){if(t=t.$parent,!t)return!1;o=t.$options.name}return t},change(e){const t=e.detail.value;let o={value:[],data:[]};if(this.multiple)this.range.forEach((e=>{t.includes(e[this.map.value]+"")&&(o.value.push(e[this.map.value]),o.data.push(e))}));else{const e=this.range.find((e=>e[this.map.value]+""===t));e&&(o={value:e[this.map.value],data:e})}this.$emit("input",o.value),this.$emit("update:modelValue",o.value),this.$emit("change",{detail:o}),this.multiple?this.dataList=this.getDataList(o.value,!0):this.dataList=this.getDataList(o.value)},getDataList(e){let t=JSON.parse(JSON.stringify(this.range)),o=[];return this.multiple&&(Array.isArray(e)||(e=[])),t.forEach(((t,n)=>{if(t.disabled=t.disable||t.disabled||!1,this.multiple)if(e.length>0){let o=e.find((e=>e===t[this.map.value]));t.selected=void 0!==o}else t.selected=!1;else t.selected=e===t[this.map.value];o.push(t)})),this.setRange(o)},setRange(e){let t=e.filter((e=>e.selected)),o=Number(this.min)||0,n=Number(this.max)||"";return e.forEach(((s,a)=>{if(this.multiple){if(t.length<=o){void 0!==t.find((e=>e[this.map.value]===s[this.map.value]))&&(s.disabled=!0)}if(t.length>=n&&""!==n){void 0===t.find((e=>e[this.map.value]===s[this.map.value]))&&(s.disabled=!0)}}this.setStyles(s,a),e[a]=s})),e},setStyles(e,t){e.styleBackgroud=this.setStyleBackgroud(e),e.styleIcon=this.setStyleIcon(e),e.styleIconText=this.setStyleIconText(e),e.styleRightIcon=this.setStyleRightIcon(e)},getSelectedValue(e){if(!this.multiple)return this.dataValue;let t=[];return e.forEach((e=>{e.selected&&t.push(e[this.map.value])})),this.dataValue.length>0?this.dataValue:t},setStyleBackgroud(e){let t={},o=this.selectedColor?this.selectedColor:"#2979ff";this.selectedColor&&("list"!==this.mode&&(t["border-color"]=e.selected?o:"#DCDFE6"),"tag"===this.mode&&(t["background-color"]=e.selected?o:"#f5f5f5"));let n="";for(let s in t)n+=`${s}:${t[s]};`;return n},setStyleIcon(e){let t={},o="";if(this.selectedColor){let o=this.selectedColor?this.selectedColor:"#2979ff";t["background-color"]=e.selected?o:"#fff",t["border-color"]=e.selected?o:"#DCDFE6",!e.selected&&e.disabled&&(t["background-color"]="#F2F6FC",t["border-color"]=e.selected?o:"#DCDFE6")}for(let n in t)o+=`${n}:${t[n]};`;return o},setStyleIconText(e){let t={},o="";if(this.selectedColor){let o=this.selectedColor?this.selectedColor:"#2979ff";"tag"===this.mode?t.color=e.selected?this.selectedTextColor?this.selectedTextColor:"#fff":"#666":t.color=e.selected?this.selectedTextColor?this.selectedTextColor:o:"#666",!e.selected&&e.disabled&&(t.color="#999")}for(let n in t)o+=`${n}:${t[n]};`;return o},setStyleRightIcon(e){let t={},o="";"list"===this.mode&&(t["border-color"]=e.selected?this.styles.selectedColor:"#DCDFE6");for(let n in t)o+=`${n}:${t[n]};`;return o}}};const Sn=u(bn,[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-load-more"),wn);return e.openBlock(),e.createElementBlock("view",{class:"uni-data-checklist",style:e.normalizeStyle({"margin-top":i.isTop+"px"})},[i.isLocal?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.multiple?(e.openBlock(),e.createElementBlock("checkbox-group",{key:0,class:e.normalizeClass(["checklist-group",{"is-list":"list"===s.mode||s.wrap}]),onChange:n[0]||(n[0]=(...e)=>r.change&&r.change(...e))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,((t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["checklist-box",["is--"+s.mode,t.selected?"is-checked":"",s.disabled||t.disabled?"is-disable":"",0!==o&&"list"===s.mode?"is-list-border":""]]),style:e.normalizeStyle(t.styleBackgroud),key:o},[e.createElementVNode("checkbox",{class:"hidden",hidden:"",disabled:s.disabled||!!t.disabled,value:t[s.map.value]+"",checked:t.selected},null,8,["disabled","value","checked"]),"tag"!==s.mode&&"list"!==s.mode||"list"===s.mode&&"left"===s.icon?(e.openBlock(),e.createElementBlock("view",{key:0,class:"checkbox__inner",style:e.normalizeStyle(t.styleIcon)},[e.createElementVNode("view",{class:"checkbox__inner-icon"})],4)):e.createCommentVNode("",!0),e.createElementVNode("view",{class:e.normalizeClass(["checklist-content",{"list-content":"list"===s.mode&&"left"===s.icon}])},[e.createElementVNode("text",{class:"checklist-text",style:e.normalizeStyle(t.styleIconText)},e.toDisplayString(t[s.map.text]),5),"list"===s.mode&&"right"===s.icon?(e.openBlock(),e.createElementBlock("view",{key:0,class:"checkobx__list",style:e.normalizeStyle(t.styleBackgroud)},null,4)):e.createCommentVNode("",!0)],2)],6)))),128))],34)):(e.openBlock(),e.createElementBlock("radio-group",{key:1,class:e.normalizeClass(["checklist-group",{"is-list":"list"===s.mode,"is-wrap":s.wrap}]),onChange:n[1]||(n[1]=(...e)=>r.change&&r.change(...e))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,((t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["checklist-box",["is--"+s.mode,t.selected?"is-checked":"",s.disabled||t.disabled?"is-disable":"",0!==o&&"list"===s.mode?"is-list-border":""]]),style:e.normalizeStyle(t.styleBackgroud),key:o},[e.createElementVNode("radio",{class:"hidden",hidden:"",disabled:s.disabled||t.disabled,value:t[s.map.value]+"",checked:t.selected},null,8,["disabled","value","checked"]),"tag"!==s.mode&&"list"!==s.mode||"list"===s.mode&&"left"===s.icon?(e.openBlock(),e.createElementBlock("view",{key:0,class:"radio__inner",style:e.normalizeStyle(t.styleBackgroud)},[e.createElementVNode("view",{class:"radio__inner-icon",style:e.normalizeStyle(t.styleIcon)},null,4)],4)):e.createCommentVNode("",!0),e.createElementVNode("view",{class:e.normalizeClass(["checklist-content",{"list-content":"list"===s.mode&&"left"===s.icon}])},[e.createElementVNode("text",{class:"checklist-text",style:e.normalizeStyle(t.styleIconText)},e.toDisplayString(t[s.map.text]),5),"list"===s.mode&&"right"===s.icon?(e.openBlock(),e.createElementBlock("view",{key:0,style:e.normalizeStyle(t.styleRightIcon),class:"checkobx__list"},null,4)):e.createCommentVNode("",!0)],2)],6)))),128))],34))],64)):(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-data-loading"},[t.mixinDatacomErrorMessage?(e.openBlock(),e.createElementBlock("text",{key:1},e.toDisplayString(t.mixinDatacomErrorMessage),1)):(e.openBlock(),e.createBlock(l,{key:0,status:"loading",iconType:"snow",iconSize:18,"content-text":i.contentText},null,8,["content-text"]))]))],4)}],["__scopeId","data-v-aad1fd27"]]);var xn={email:/^\S+?@\S+?\.\S+?$/,idcard:/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i")};const Cn={int:"integer",bool:"boolean",double:"number",long:"number",password:"string"};function Tn(e,t=""){["label"].forEach((t=>{void 0===e[t]&&(e[t]="")}));let o=t;for(let n in e){let t=new RegExp("{"+n+"}");o=o.replace(t,e[n])}return o}const En={integer:e=>En.number(e)&&parseInt(e,10)===e,string:e=>"string"==typeof e,number:e=>!isNaN(e)&&"number"==typeof e,boolean:function(e){return"boolean"==typeof e},float:function(e){return En.number(e)&&!En.integer(e)},array:e=>Array.isArray(e),object:e=>"object"==typeof e&&!En.array(e),date:e=>e instanceof Date,timestamp(e){return!(!this.integer(e)||Math.abs(e).toString().length>16)},file:e=>"string"==typeof e.url,email:e=>"string"==typeof e&&!!e.match(xn.email)&&e.length<255,url:e=>"string"==typeof e&&!!e.match(xn.url),pattern(e,t){try{return new RegExp(e).test(t)}catch(Ne){return!1}},method:e=>"function"==typeof e,idcard:e=>"string"==typeof e&&!!e.match(xn.idcard),"url-https"(e){return this.url(e)&&e.startsWith("https://")},"url-scheme":e=>e.startsWith("://"),"url-web":e=>!1};const Dn={required:(e,t,o)=>e.required&&function(e,t){return null==e||"string"==typeof e&&!e||!(!Array.isArray(e)||e.length)||"object"===t&&!Object.keys(e).length}(t,e.format||typeof t)?Tn(e,e.errorMessage||o.required):null,range(e,t,o){const{range:n,errorMessage:s}=e;let a=new Array(n.length);for(let r=0;r<n.length;r++){const e=n[r];En.object(e)&&void 0!==e.value?a[r]=e.value:a[r]=e}let i=!1;return Array.isArray(t)?i=new Set(t.concat(a)).size===a.length:a.indexOf(t)>-1&&(i=!0),i?null:Tn(e,s||o.enum)},rangeNumber(e,t,o){if(!En.number(t))return Tn(e,e.errorMessage||o.pattern.mismatch);let{minimum:n,maximum:s,exclusiveMinimum:a,exclusiveMaximum:i}=e,r=a?t<=n:t<n,l=i?t>=s:t>s;return void 0!==n&&r?Tn(e,e.errorMessage||o.number[a?"exclusiveMinimum":"minimum"]):void 0!==s&&l?Tn(e,e.errorMessage||o.number[i?"exclusiveMaximum":"maximum"]):void 0!==n&&void 0!==s&&(r||l)?Tn(e,e.errorMessage||o.number.range):null},rangeLength(e,t,o){if(!En.string(t)&&!En.array(t))return Tn(e,e.errorMessage||o.pattern.mismatch);let n=e.minLength,s=e.maxLength,a=t.length;return void 0!==n&&a<n?Tn(e,e.errorMessage||o.length.minLength):void 0!==s&&a>s?Tn(e,e.errorMessage||o.length.maxLength):void 0!==n&&void 0!==s&&(a<n||a>s)?Tn(e,e.errorMessage||o.length.range):null},pattern:(e,t,o)=>En.pattern(e.pattern,t)?null:Tn(e,e.errorMessage||o.pattern.mismatch),format(e,t,o){var n=Object.keys(En),s=Cn[e.format]?Cn[e.format]:e.format||e.arrayType;return n.indexOf(s)>-1&&!En[s](t)?Tn(e,e.errorMessage||o.typeError):null},arrayTypeFormat(e,t,o){if(!Array.isArray(t))return Tn(e,e.errorMessage||o.typeError);for(let n=0;n<t.length;n++){const s=t[n];let a=this.format(e,s,o);if(null!==a)return a}return null}};class Nn extends class{constructor(e){this._message=e}async validateRule(e,t,o,n,s){var a=null;let i=t.rules;if(i.findIndex((e=>e.required))<0){if(null==o)return a;if("string"==typeof o&&!o.length)return a}var r=this._message;if(void 0===i)return r.default;for(var l=0;l<i.length;l++){let c=i[l],u=this._getValidateType(c);if(Object.assign(c,{label:t.label||`["${e}"]`}),Dn[u]&&null!=(a=Dn[u](c,o,r)))break;if(c.validateExpr){let e=Date.now();if(!1===c.validateExpr(o,s,e)){a=this._getMessage(c,c.errorMessage||this._message.default);break}}if(c.validateFunction&&null!==(a=await this.validateFunction(c,o,n,s,u)))break}return null!==a&&(a=r.TAG+a),a}async validateFunction(e,t,o,n,s){let a=null;try{let i=null;const r=await e.validateFunction(e,t,n||o,(e=>{i=e}));(i||"string"==typeof r&&r||!1===r)&&(a=this._getMessage(e,i||r,s))}catch(Ne){a=this._getMessage(e,Ne.message,s)}return a}_getMessage(e,t,o){return Tn(e,t||e.errorMessage||this._message[o]||t.default)}_getValidateType(e){var t="";return e.required?t="required":e.format?t="format":e.arrayType?t="arrayTypeFormat":e.range?t="range":void 0!==e.maximum||void 0!==e.minimum?t="rangeNumber":void 0!==e.maxLength||void 0!==e.minLength?t="rangeLength":e.pattern?t="pattern":e.validateFunction&&(t="validateFunction"),t}}{constructor(e,t){super(Nn.message),this._schema=e,this._options=t||null}updateSchema(e){this._schema=e}async validate(e,t){let o=this._checkFieldInSchema(e);return o||(o=await this.invokeValidate(e,!1,t)),o.length?o[0]:null}async validateAll(e,t){let o=this._checkFieldInSchema(e);return o||(o=await this.invokeValidate(e,!0,t)),o}async validateUpdate(e,t){let o=this._checkFieldInSchema(e);return o||(o=await this.invokeValidateUpdate(e,!1,t)),o.length?o[0]:null}async invokeValidate(e,t,o){let n=[],s=this._schema;for(let a in s){let i=s[a],r=await this.validateRule(a,i,e[a],e,o);if(null!=r&&(n.push({key:a,errorMessage:r}),!t))break}return n}async invokeValidateUpdate(e,t,o){let n=[];for(let s in e){let a=await this.validateRule(s,this._schema[s],e[s],e,o);if(null!=a&&(n.push({key:s,errorMessage:a}),!t))break}return n}_checkFieldInSchema(e){var t=Object.keys(e),o=Object.keys(this._schema);if(new Set(t.concat(o)).size===o.length)return"";var n=t.filter((e=>o.indexOf(e)<0));return[{key:"invalid",errorMessage:Tn({field:JSON.stringify(n)},Nn.message.TAG+Nn.message.defaultInvalid)}]}}Nn.message=new function(){return{TAG:"",default:"验证错误",defaultInvalid:"提交的字段{field}在数据库中并不存在",validateFunction:"验证无效",required:"{label}必填",enum:"{label}超出范围",timestamp:"{label}格式无效",whitespace:"{label}不能为空",typeError:"{label}类型无效",date:{format:"{label}日期{value}格式无效",parse:"{label}日期无法解析,{value}无效",invalid:"{label}日期{value}无效"},length:{minLength:"{label}长度不能少于{minLength}",maxLength:"{label}长度不能超过{maxLength}",range:"{label}必须介于{minLength}和{maxLength}之间"},number:{minimum:"{label}不能小于{minimum}",maximum:"{label}不能大于{maximum}",exclusiveMinimum:"{label}不能小于等于{minimum}",exclusiveMaximum:"{label}不能大于等于{maximum}",range:"{label}必须介于{minimum}and{maximum}之间"},pattern:{mismatch:"{label}格式不匹配"}}};const In=(e,t,o)=>{const n=o.find((e=>{return e.format&&("int"===(t=e.format)||"double"===t||"number"===t||"timestamp"===t);var t})),s=o.find((e=>e.format&&"boolean"===e.format||"bool"===e.format));return n&&(t=t||0===t?Fn(Number(t))?Number(t):t:null),s&&(t=!!Rn(t)&&t),t},An=(e,t)=>On(t,e),Bn=(e,t={})=>{const o=Ln(e);if("object"==typeof o&&Array.isArray(o)&&o.length>1){return o.reduce(((e,t)=>e+`#${t}`),"_formdata_")}return o[0]||e},Pn=e=>{let t=e.replace("_formdata_#","");return t=t.split("#").map((e=>Fn(e)?Number(e):e)),t},Vn=(e,t,o)=>("object"!=typeof e||Ln(t).reduce(((e,t,n,s)=>n===s.length-1?(e[t]=o,null):(t in e||(e[t]=/^[0-9]{1,}$/.test(s[n+1])?[]:{}),e[t])),e),e);function Ln(e){return Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,"").split(".")}const On=(e,t,o="undefined")=>{let n=Ln(t).reduce(((e,t)=>(e||{})[t]),e);return n&&void 0===n?o:n},Fn=e=>!isNaN(Number(e)),Rn=e=>"boolean"==typeof e;const Mn=u({name:"uniForms",emits:["validate","submit"],options:{virtualHost:!0},props:{value:{type:Object,default:()=>null},modelValue:{type:Object,default:()=>null},model:{type:Object,default:()=>null},rules:{type:Object,default:()=>({})},errShowType:{type:String,default:"undertext"},validateTrigger:{type:String,default:"submit"},labelPosition:{type:String,default:"left"},labelWidth:{type:[String,Number],default:""},labelAlign:{type:String,default:"left"},border:{type:Boolean,default:!1}},provide(){return{uniForm:this}},data:()=>({formData:{},formRules:{}}),computed:{localData(){const e=this.model||this.modelValue||this.value;return e?(t=e,JSON.parse(JSON.stringify(t))):{};var t}},watch:{rules:{handler:function(e,t){this.setRules(e)},deep:!0,immediate:!0}},created(){getApp().$vm.$.appContext.config.globalProperties.binddata||(getApp().$vm.$.appContext.config.globalProperties.binddata=function(e,o,n){if(n)this.$refs[n].setValue(e,o);else{let n;for(let e in this.$refs){const t=this.$refs[e];if(t&&t.$options&&"uniForms"===t.$options.name){n=t;break}}if(!n)return t("error","at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:182","当前 uni-froms 组件缺少 ref 属性");n.setValue(e,o)}}),this.childrens=[],this.inputChildrens=[],this.setRules(this.rules)},methods:{setRules(e){this.formRules=Object.assign({},this.formRules,e),this.validator=new Nn(e)},setValue(e,t){let o=this.childrens.find((t=>t.name===e));return o?(this.formData[e]=In(0,t,this.formRules[e]&&this.formRules[e].rules||[]),o.onFieldChange(this.formData[e])):null},validate(e,t){return this.checkAll(this.formData,e,t)},validateField(e=[],t){e=[].concat(e);let o={};return this.childrens.forEach((t=>{const n=Bn(t.name);-1!==e.indexOf(n)&&(o=Object.assign({},o,{[n]:this.formData[n]}))})),this.checkAll(o,[],t)},clearValidate(e=[]){e=[].concat(e),this.childrens.forEach((t=>{if(0===e.length)t.errMsg="";else{const o=Bn(t.name);-1!==e.indexOf(o)&&(t.errMsg="")}}))},submit(e,o,n){for(let t in this.dataValue){this.childrens.find((e=>e.name===t))&&void 0===this.formData[t]&&(this.formData[t]=this._getValue(t,this.dataValue[t]))}return n||t("warn","at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:289","submit 方法即将废弃,请使用validate方法代替!"),this.checkAll(this.formData,e,o,"submit")},async checkAll(e,t,o,n){if(!this.validator)return;let s,a=[];for(let c in e){const e=this.childrens.find((e=>Bn(e.name)===c));e&&a.push(e)}o||"function"!=typeof t||(o=t),!o&&"function"!=typeof o&&Promise&&(s=new Promise(((e,t)=>{o=function(o,n){o?t(o):e(n)}})));let i=[],r=JSON.parse(JSON.stringify(e));for(let c in a){const e=a[c];let t=Bn(e.name);const o=await e.onFieldChange(r[t]);if(o&&(i.push(o),"toast"===this.errShowType||"modal"===this.errShowType))break}Array.isArray(i)&&0===i.length&&(i=null),Array.isArray(t)&&t.forEach((e=>{let t=Bn(e),o=An(e,this.localData);void 0!==o&&(r[t]=o)})),"submit"===n?this.$emit("submit",{detail:{value:r,errors:i}}):this.$emit("validate",i);let l={};return l=((e={},t)=>{let o=JSON.parse(JSON.stringify(e)),n={};for(let s in o){let e=Pn(s);Vn(n,e,o[s])}return n})(r,this.name),o&&"function"==typeof o&&o(i,l),s&&o?s:null},validateCheck(e){this.$emit("validate",e)},_getValue:In,_isRequiredField:e=>{let t=!1;for(let o=0;o<e.length;o++){if(e[o].required){t=!0;break}}return t},_setDataValue:(e,t,o)=>(t[e]=o,o||""),_getDataValue:An,_realName:Bn,_isRealName:e=>/^_formdata_#*/.test(e),_isEqual:(e,t)=>{if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;var o=toString.call(e);if(o!==toString.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t}if("[object Object]"==o){var n=Object.getOwnPropertyNames(e),s=Object.getOwnPropertyNames(t);if(n.length!=s.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(e[i]!==t[i])return!1}return!0}return"[object Array]"==o?e.toString()==t.toString():void 0}}},[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-forms"},[e.createElementVNode("form",null,[e.renderSlot(t.$slots,"default",{},void 0,!0)])])}],["__scopeId","data-v-bdc00db0"]]),Un={data:()=>({}),created(){this.popup=this.getParent()},methods:{getParent(e="uniPopup"){let t=this.$parent,o=t.$options.name;for(;o!==e;){if(t=t.$parent,!t)return!1;o=t.$options.name}return t}}};const jn=u({name:"uniPopupMessage",mixins:[Un],props:{type:{type:String,default:"success"},message:{type:String,default:""},duration:{type:Number,default:3e3},maskShow:{type:Boolean,default:!1}},data:()=>({}),created(){this.popup.maskShow=this.maskShow,this.popup.messageChild=this},methods:{timerClose(){0!==this.duration&&(clearTimeout(this.timer),this.timer=setTimeout((()=>{this.popup.close()}),this.duration))}}},[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-popup-message"},[e.createElementVNode("view",{class:e.normalizeClass(["uni-popup-message__box fixforpc-width","uni-popup__"+n.type])},[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("text",{class:e.normalizeClass(["uni-popup-message-text","uni-popup__"+n.type+"-text"])},e.toDisplayString(n.message),3)]),!0)],2)])}],["__scopeId","data-v-d81cfb56"]]);class $n{constructor(e,t){this.options=e,this.animation=uni.createAnimation({...e}),this.currentStepAnimates={},this.next=0,this.$=t}_nvuePushAnimates(e,t){let o=this.currentStepAnimates[this.next],n={};if(n=o||{styles:{},config:{}},zn.includes(e)){n.styles.transform||(n.styles.transform="");let o="";"rotate"===e&&(o="deg"),n.styles.transform+=`${e}(${t+o}) `}else n.styles[e]=`${t}`;this.currentStepAnimates[this.next]=n}_animateRun(e={},t={}){let o=this.$.$refs.ani.ref;if(o)return new Promise(((n,s)=>{nvueAnimation.transition(o,{styles:e,...t},(e=>{n()}))}))}_nvueNextAnimate(e,t=0,o){let n=e[t];if(n){let{styles:s,config:a}=n;this._animateRun(s,a).then((()=>{t+=1,this._nvueNextAnimate(e,t,o)}))}else this.currentStepAnimates={},"function"==typeof o&&o(),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 zn=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function qn(e,t){if(t)return clearTimeout(t.timer),new $n(e,t)}zn.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((e=>{$n.prototype[e]=function(...t){return this.animation[e](...t),this}}));const Hn=u({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 o in e){t+=this.toLine(o)+":"+e[o]+";"}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=qn(Object.assign(this.config,e),this)},onClick(){this.$emit("click",{detail:this.isShow})},step(e,o={}){if(this.animation){for(let o in e)try{"object"==typeof e[o]?this.animation[o](...e[o]):this.animation[o](e[o])}catch(Ne){t("error","at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148",`方法 ${o} 不存在`)}return this.animation.step(o),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=qn(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:""},o=(e,o)=>{"fade"===o?t.opacity=this.animationType(e)[o]:t.transform+=this.animationType(e)[o]+" "};return"string"==typeof this.modeClass?o(e,this.modeClass):this.modeClass.forEach((t=>{o(e,t)})),t},tranfromInit(e){let t=(e,t)=>{let o=null;"fade"===t?o=e?0:1:(o=e?"-100%":"0","zoom-in"===t&&(o=e?.8:1),"zoom-out"===t&&(o=e?1.2:1),"slide-right"===t&&(o=e?"100%":"0"),"slide-bottom"===t&&(o=e?"100%":"0")),this.animation[this.animationMode()[t]](o)};return"string"==typeof this.modeClass?t(e,this.modeClass):this.modeClass.forEach((o=>{t(e,o)})),this.animation},animationType:e=>({fade:e?1:0,"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,o,n,s,a,i){return e.withDirectives((e.openBlock(),e.createElementBlock("view",{ref:"ani",animation:a.animationData,class:e.normalizeClass(n.customClass),style:e.normalizeStyle(i.transformStyles),onClick:o[0]||(o[0]=(...e)=>i.onClick&&i.onClick(...e))},[e.renderSlot(t.$slots,"default")],14,["animation"])),[[e.vShow,a.isShow]])}]]),Wn={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)"}},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:()=>({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:{position:"fixed",left:0,right:0},maskShow:!0,mkclick:!0,popupstyle:"top"}),computed:{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:o,safeArea:n,screenHeight:s,safeAreaInsets:a}=uni.getSystemInfoSync();this.popupWidth=e,this.popupHeight=t+(o||0),n&&this.safeArea?this.safeAreaInsets=a.bottom:this.safeAreaInsets=0})()},unmounted(){this.setH5Visible()},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(){},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:279","缺少类型:",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},e||(this.showPopup=!0,this.showTrans=!0,this.$nextTick((()=>{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},e||(this.showPopup=!0,this.showTrans=!0)},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"},e||(this.showPopup=!0,this.showTrans=!0)},left(e){this.popupstyle="left",this.ani=["slide-left"],this.transClass={position:"fixed",left:0,bottom:0,top:0,backgroundColor:this.bg,display:"flex",flexDirection:"column"},e||(this.showPopup=!0,this.showTrans=!0)},right(e){this.popupstyle="right",this.ani=["slide-right"],this.transClass={position:"fixed",bottom:0,right:0,top:0,backgroundColor:this.bg,display:"flex",flexDirection:"column"},e||(this.showPopup=!0,this.showTrans=!0)}}};const Jn=u(Wn,[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-transition"),Hn);return i.showPopup?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass(["uni-popup",[i.popupstyle,r.isDesktop?"fixforpc-z-index":""]])},[e.createElementVNode("view",{onTouchstart:n[1]||(n[1]=(...e)=>r.touchstart&&r.touchstart(...e))},[i.maskShow?(e.openBlock(),e.createBlock(l,{key:"1",name:"mask","mode-class":"fade",styles:i.maskClass,duration:i.duration,show:i.showTrans,onClick:r.onTap},null,8,["styles","duration","show","onClick"])):e.createCommentVNode("",!0),e.createVNode(l,{key:"2","mode-class":i.ani,name:"content",styles:i.transClass,duration:i.duration,show:i.showTrans,onClick:r.onTap},{default:e.withCtx((()=>[e.createElementVNode("view",{class:e.normalizeClass(["uni-popup__wrapper",[i.popupstyle]]),style:e.normalizeStyle({backgroundColor:r.bg}),onClick:n[0]||(n[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-27baf609"]]),Kn={en:{"uni-popup.cancel":"cancel","uni-popup.ok":"ok","uni-popup.placeholder":"pleace enter","uni-popup.title":"Hint","uni-popup.shareTitle":"Share to"},"zh-Hans":{"uni-popup.cancel":"取消","uni-popup.ok":"确定","uni-popup.placeholder":"请输入","uni-popup.title":"提示","uni-popup.shareTitle":"分享到"},"zh-Hant":{"uni-popup.cancel":"取消","uni-popup.ok":"確定","uni-popup.placeholder":"請輸入","uni-popup.title":"提示","uni-popup.shareTitle":"分享到"}},{t:Gn}=yn(Kn);const Yn=u({name:"uniPopupDialog",mixins:[Un],emits:["confirm","close"],props:{inputType:{type:String,default:"text"},value:{type:[String,Number],default:""},placeholder:{type:[String,Number],default:""},type:{type:String,default:"error"},mode:{type:String,default:"base"},title:{type:String,default:""},content:{type:String,default:""},beforeClose:{type:Boolean,default:!1},cancelText:{type:String,default:""},confirmText:{type:String,default:""}},data:()=>({dialogType:"error",focus:!1,val:""}),computed:{okText(){return this.confirmText||Gn("uni-popup.ok")},closeText(){return this.cancelText||Gn("uni-popup.cancel")},placeholderText(){return this.placeholder||Gn("uni-popup.placeholder")},titleText(){return this.title||Gn("uni-popup.title")}},watch:{type(e){this.dialogType=e},mode(e){"input"===e&&(this.dialogType="info")},value(e){this.val=e}},created(){this.popup.disableMask(),"input"===this.mode?(this.dialogType="info",this.val=this.value):this.dialogType=this.type},mounted(){this.focus=!0},methods:{onOk(){"input"===this.mode?this.$emit("confirm",this.val):this.$emit("confirm"),this.beforeClose||this.popup.close()},closeDialog(){this.$emit("close"),this.beforeClose||this.popup.close()},close(){this.popup.close()}}},[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-popup-dialog"},[e.createElementVNode("view",{class:"uni-dialog-title"},[e.createElementVNode("text",{class:e.normalizeClass(["uni-dialog-title-text",["uni-popup__"+a.dialogType]])},e.toDisplayString(i.titleText),3)]),"base"===n.mode?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-dialog-content"},[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("text",{class:"uni-dialog-content-text"},e.toDisplayString(n.content),1)]),!0)])):(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-dialog-content"},[e.renderSlot(t.$slots,"default",{},(()=>[e.withDirectives(e.createElementVNode("input",{class:"uni-dialog-input","onUpdate:modelValue":o[0]||(o[0]=e=>a.val=e),type:n.inputType,placeholder:i.placeholderText,focus:a.focus},null,8,["type","placeholder","focus"]),[[e.vModelDynamic,a.val]])]),!0)])),e.createElementVNode("view",{class:"uni-dialog-button-group"},[e.createElementVNode("view",{class:"uni-dialog-button",onClick:o[1]||(o[1]=(...e)=>i.closeDialog&&i.closeDialog(...e))},[e.createElementVNode("text",{class:"uni-dialog-button-text"},e.toDisplayString(i.closeText),1)]),e.createElementVNode("view",{class:"uni-dialog-button uni-border-left",onClick:o[2]||(o[2]=(...e)=>i.onOk&&i.onOk(...e))},[e.createElementVNode("text",{class:"uni-dialog-button-text uni-button-color"},e.toDisplayString(i.okText),1)])])])}],["__scopeId","data-v-b888b3dc"]]);var Qn;const Zn={get isIOS(){return"boolean"==typeof Qn?Qn:Qn="ios"===uni.getSystemInfoSync().platform},requestIOS:function(e){return new Promise(((o,n)=>{switch(e){case"push":o(function(){var e=0,o=plus.ios.import("UIApplication"),n=o.sharedApplication();if(n.currentUserNotificationSettings){var s=n.currentUserNotificationSettings();0==s.plusGetAttribute("types")?(e=0,t("log","at common/permission.js:63","推送权限没有开启")):(e=1,t("log","at common/permission.js:66","已经开启推送功能!")),plus.ios.deleteObject(s)}else 0==n.enabledRemoteNotificationTypes()?(e=3,t("log","at common/permission.js:73","推送权限没有开启!")):(e=4,t("log","at common/permission.js:76","已经开启推送功能!"));return plus.ios.deleteObject(n),plus.ios.deleteObject(o),e}());break;case"location":o((s=0,a=plus.ios.import("CLLocationManager"),i=a.locationServicesEnabled(),r=a.authorizationStatus(),s=i?0===r?null:3===r||4===r?1:0:2,plus.ios.deleteObject(a),s));break;case"record":o(function(){var e=null,o=plus.ios.import("AVAudioSession"),n=o.sharedInstance().recordPermission();return t("log","at common/permission.js:104","permissionStatus:"+n),e=1970168948===n?null:1735552628===n?1:0,plus.ios.deleteObject(o),e}());break;case"camera":o(function(){var e=0,t=plus.ios.import("AVCaptureDevice"),o=t.authorizationStatusForMediaType("vide");return e=0===o?null:3==o?1:0,plus.ios.deleteObject(t),e}());break;case"album":o(function(){var e=0,t=plus.ios.import("PHPhotoLibrary"),o=t.authorizationStatus();return e=0===o?null:3==o?1:0,plus.ios.deleteObject(t),e}());break;case"contact":o(function(){var e=0,t=plus.ios.import("CNContactStore"),o=t.authorizationStatusForEntityType(0);return e=0===o?null:3==o?1:0,plus.ios.deleteObject(t),e}());break;case"calendar":o(function(){var e=null,o=plus.ios.import("EKEventStore");return 3==o.authorizationStatusForEntityType(0)?(e=1,t("log","at common/permission.js:122","日历权限已经开启")):t("log","at common/permission.js:124","日历权限没有开启"),plus.ios.deleteObject(o),e}());break;case"memo":o(function(){var e=null,o=plus.ios.import("EKEventStore");return 3==o.authorizationStatusForEntityType(1)?(e=1,t("log","at common/permission.js:136","备忘录权限已经开启")):t("log","at common/permission.js:138","备忘录权限没有开启"),plus.ios.deleteObject(o),e}());break;default:o(0)}var s,a,i,r}))},requestAndroid:function(e){return new Promise(((o,n)=>{plus.android.requestPermissions([e],(function(e){for(var n=0,s=0;s<e.granted.length;s++){t("log","at common/permission.js:187","已获取的权限:"+e.granted[s]),n=1}for(s=0;s<e.deniedPresent.length;s++){t("log","at common/permission.js:192","拒绝本次申请的权限:"+e.deniedPresent[s]),n=0}for(s=0;s<e.deniedAlways.length;s++){t("log","at common/permission.js:197","永久拒绝申请的权限:"+e.deniedAlways[s]),n=-1}o(n)}),(function(e){t("log","at common/permission.js:203","result error: "+e.message),o({code:e.code,message:e.message})}))}))},gotoAppSetting:function(){if(Zn.isIOS){var e=plus.ios.import("UIApplication").sharedApplication(),t=plus.ios.import("NSURL"),o=t.URLWithString("app-settings:");e.openURL(o),plus.ios.deleteObject(o),plus.ios.deleteObject(t),plus.ios.deleteObject(e)}else{var n=plus.android.importClass("android.content.Intent"),s=plus.android.importClass("android.provider.Settings"),a=plus.android.importClass("android.net.Uri"),i=plus.android.runtimeMainActivity(),r=new n;r.setAction(s.ACTION_APPLICATION_DETAILS_SETTINGS);var l=a.fromParts("package",i.getPackageName(),null);r.setData(l),i.startActivity(r)}}},Xn="https://api.ytdeals.co.uk",es=Xn+"/admin/order.scanOrder/getBindParams",ts={data:()=>({token:e.ref(null),user:e.ref(null),messageType:"",messageText:"",batchOptions:[],spaces:[],instockHistory:[],focusType:!0,loading:e.ref(!1),valiFormData:{orderNum:"",batch_number:"",space_code:"",weight:"",search_pkg:!0,typing:!0,search_order:!0,search_order_choice:3},searchOrderChoice:[{text:"更新为已入库,状态为【已入库】",value:1},{text:"更新为已出库,状态为【已出库】",value:2},{text:"称重计费",value:3}]}),computed:{rules:function(){return{orderNum:{rules:[{required:2!==this.valiFormData.search_order_choice,errorMessage:"单号不能为空"}]},weight:{rules:[{required:!0,errorMessage:"重量不能为空"},{format:"number",errorMessage:"重量只能输入数字"}]}}}},onShow(){this.focusType=!0,this.loading=!1,this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user"),this.getWarehouseSpace(),this.getBindParams()},onHide(){this.focusType=!1,this.loading=!1},onReady(){},onNavigationBarButtonTap(e){0===e.index&&uni.navigateTo({url:"/pages/instock/instockLog"})},methods:{getWarehouseSpace(){uni.request({url:"https://api.ytdeals.co.uk/admin/order.ScanOrder/getWarehouseSpace",method:"POST",header:{batoken:this.token},data:{code:""},success:e=>{1===e.data.code&&(this.spaces=e.data.data.spaces.map((e=>({text:e.name,value:e.code}))))}})},getBindParams(){uni.request({url:es,method:"GET",header:{batoken:this.token},success:e=>{1===e.data.code&&(this.batchOptions=e.data.data.batch_number.map((e=>({text:e.name,value:e.id}))))},fail(e){t("log","at pages/instock/index.vue:232","fail--",e)}})},batchText(e){return this.batchOptions.find((t=>t.value===e)).text},searchPkgChange(){this.valiFormData.search_pkg=!this.valiFormData.search_pkg,this.valiFormData.typing=this.valiFormData.search_pkg},searchOrderChoiceChange(){this.valiFormData.search_order=!this.valiFormData.search_order,this.valiFormData.search_order_choice=this.valiFormData.search_order?3:""},reset(){this.loading=!1,this.focusType=!1,this.valiFormData={...this.valiFormData,orderNum:"",space_code:"",batch_number:"",weight:"",search_pkg:!0,typing:!0,search_order:!0},e.nextTick((()=>{this.focusType=!0}))},async scan(){1===await this.checkPermission()&&uni.scanCode({success:e=>{this.result=e.result,this.valiFormData.orderNum=e.result},fail:e=>{}})},async checkPermission(e){let t=Zn.isIOS?await Zn.requestIOS("camera"):await Zn.requestAndroid("android.permission.CAMERA");return null===t||1===t?t=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Zn.gotoAppSetting()}}),t},async warehouseScan(){this.st&&clearTimeout(this.st),1===this.valiFormData.search_order_choice?await this.checkWaybillGoods():2===this.valiFormData.search_order_choice?await this.scanOutstock():3===this.valiFormData.search_order_choice&&await this.weighScan()},async checkWaybillGoods(){this.loading=!0,uni.request({url:"https://api.ytdeals.co.uk/admin/order.scanOrder/checkWaybillGoods",method:"POST",header:{batoken:this.token},data:{order_no:this.valiFormData.orderNum},success:e=>{this.loading=!1,1===e.data.code&&e.data.data.is_goods_empty?this.$refs.alertDialog.open():this.instockScan(0)}})},instockScan(e){uni.request({url:"https://api.ytdeals.co.uk/admin/order.scanOrder/instock",method:"POST",header:{batoken:this.token},data:{order_no:this.valiFormData.orderNum,weight:this.valiFormData.weight,space_code:this.valiFormData.space_code,is_save_goods:e},success:e=>{if(this.loading=!1,1==e.data.code){this.messageType="success",this.messageText=e.data.msg,this.$refs.message.open(),e.data.data.labels&&e.data.data.labels.length>0&&t("log","at pages/instock/index.vue:357","有打印面单");const o={orderNum:this.valiFormData.orderNum,createTime:new Date,type:"入库",status:!0};this.instockHistory.unshift(o),uni.setStorageSync("instockHistory",this.instockHistory),this.getHistory()}else{this.messageType="error",this.messageText=e.data.msg,this.$refs.message.open();const t={orderNum:this.valiFormData.orderNum,createTime:new Date,type:"入库",status:!1};this.instockHistory.unshift(t),uni.setStorageSync("instockHistory",this.instockHistory),this.getHistory()}this.st=setTimeout((()=>{this.reset(),this.st&&clearTimeout(this.st)}),1e3)}})},scanOutstock(){if(t("log","at pages/instock/index.vue:394",this.valiFormData.orderNum,this.valiFormData.batch_number),0===this.valiFormData.orderNum.length&&0===this.valiFormData.batch_number.length)return this.messageType="error",this.messageText="单号或批次号至少填一个",void this.$refs.message.open();this.loading=!0,uni.request({url:"https://api.ytdeals.co.uk/admin/order.scanOrder/outStock",method:"POST",header:{batoken:this.token},data:{order_no:this.valiFormData.orderNum,batch_number:this.valiFormData.batch_number},success:e=>{if(this.loading=!1,1==e.data.code){this.messageType="success",this.messageText=e.data.msg,this.$refs.message.open(),e.data.data.labels&&e.data.data.labels.length>0&&t("log","at pages/instock/index.vue:420","有打印面单");const o={orderNum:this.valiFormData.orderNum,batch_text:this.batchText(this.valiFormData.batch_number),createTime:new Date,type:"出库",status:!0};this.instockHistory.unshift(o),this.instockHistory.length>10&&(this.instockHistory.length=10),uni.setStorageSync("instockHistory",this.instockHistory),this.getHistory()}else{this.messageType="error",this.messageText=e.data.msg,this.$refs.message.open();const t={orderNum:this.valiFormData.orderNum,batch_text:this.batchText(this.valiFormData.batch_number),createTime:new Date,type:"出库",status:!1};this.instockHistory.unshift(t),this.instockHistory.length>10&&(this.instockHistory.length=10),uni.setStorageSync("instockHistory",this.instockHistory),this.getHistory()}this.st=setTimeout((()=>{this.reset(),this.st&&clearTimeout(this.st)}),1e3)}})},weighScan(){this.loading=!0,uni.request({url:"https://api.ytdeals.co.uk/admin/order.scanOrder/weigh",method:"POST",header:{batoken:this.token},data:{order_no:this.valiFormData.orderNum,weight:this.valiFormData.weight},success:e=>{if(this.loading=!1,1==e.data.code){this.messageType="success",this.messageText=e.data.msg,this.$refs.message.open();const t={orderNum:this.valiFormData.orderNum,createTime:new Date,type:"称重",status:!0};this.instockHistory.unshift(t),this.instockHistory.length>10&&(this.instockHistory.length=10),uni.setStorageSync("instockHistory",this.instockHistory),this.getHistory()}else{this.messageType="error",this.messageText=e.data.msg,this.$refs.message.open();const t={orderNum:this.valiFormData.orderNum,createTime:new Date,type:"称重",status:!1};this.instockHistory.unshift(t),this.instockHistory.length>10&&(this.instockHistory.length=10),uni.setStorageSync("instockHistory",this.instockHistory),this.getHistory()}this.st=setTimeout((()=>{this.reset(),this.st&&clearTimeout(this.st)}),1e3)}})},isNotGoods(){this.instockScan(0)},dialogConfirm(){t("log","at pages/instock/index.vue:514","点击确认"),this.instockScan(1)},dialogClose(){this.instockScan(0)},onsubmit(){this.$refs.valiForm.validate().then((e=>{this.warehouseScan()})).catch((e=>{t("log","at pages/instock/index.vue:527","err",e)}))},getHistory(){}}};const os=u(ts,[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-easyinput"),k),c=o(e.resolveDynamicComponent("uni-forms-item"),v),u=o(e.resolveDynamicComponent("uni-data-select"),sn),d=o(e.resolveDynamicComponent("uni-data-checkbox"),Sn),h=o(e.resolveDynamicComponent("uni-forms"),Mn),p=o(e.resolveDynamicComponent("uni-icons"),g),m=o(e.resolveDynamicComponent("uni-popup-message"),jn),f=o(e.resolveDynamicComponent("uni-popup"),Jn),y=o(e.resolveDynamicComponent("uni-popup-dialog"),Yn);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"example"},[e.createVNode(h,{ref:"valiForm","label-align":"right",rules:r.rules,modelValue:i.valiFormData},{default:e.withCtx((()=>[e.createVNode(c,{label:"单号",required:2!==i.valiFormData.search_order_choice,name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(l,{modelValue:i.valiFormData.orderNum,"onUpdate:modelValue":n[0]||(n[0]=e=>i.valiFormData.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:i.focusType,onIconClick:r.scan},null,8,["modelValue","focus","onIconClick"])])),_:1},8,["required"]),2===i.valiFormData.search_order_choice?(e.openBlock(),e.createBlock(c,{key:0,label:"批次号",name:"batch_number"},{default:e.withCtx((()=>[e.createVNode(u,{modelValue:i.valiFormData.batch_number,"onUpdate:modelValue":n[1]||(n[1]=e=>i.valiFormData.batch_number=e),localdata:i.batchOptions,placeholder:"请选择批次号"},null,8,["modelValue","localdata"])])),_:1})):e.createCommentVNode("",!0),e.createVNode(c,{label:"仓位编码",name:"space_code"},{default:e.withCtx((()=>[e.createVNode(u,{modelValue:i.valiFormData.space_code,"onUpdate:modelValue":n[2]||(n[2]=e=>i.valiFormData.space_code=e),localdata:i.spaces,placeholder:"请选择仓位编码"},null,8,["modelValue","localdata"])])),_:1}),2!==i.valiFormData.search_order_choice?(e.openBlock(),e.createBlock(c,{key:1,label:"重量",required:"",name:"weight"},{default:e.withCtx((()=>[e.createVNode(l,{modelValue:i.valiFormData.weight,"onUpdate:modelValue":n[3]||(n[3]=e=>i.valiFormData.weight=e),placeholder:"请输入重量",oninput:"value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"},{right:e.withCtx((()=>[e.createElementVNode("view",{class:"weight-right"},"KG")])),_:1},8,["modelValue"])])),_:1})):e.createCommentVNode("",!0),e.createVNode(c,null,{default:e.withCtx((()=>[e.createElementVNode("view",{onClick:n[5]||(n[5]=(...e)=>r.searchPkgChange&&r.searchPkgChange(...e)),class:"checkbox-cum",style:e.normalizeStyle({color:i.valiFormData.search_pkg?"#007AFF":"gray"})},[e.createElementVNode("checkbox",{checked:i.valiFormData.search_pkg,onClick:n[4]||(n[4]=(...e)=>r.searchPkgChange&&r.searchPkgChange(...e))},null,8,["checked"]),e.createTextVNode(" 搜索寄存包裹 ")],4),e.createElementVNode("view",{class:"sub-choice"},[e.createElementVNode("checkbox",{disabled:!i.valiFormData.search_pkg,checked:i.valiFormData.typing},null,8,["disabled","checked"]),e.createElementVNode("text",{onClick:n[6]||(n[6]=()=>{i.valiFormData.search_pkg&&(i.valiFormData.typing=!i.valiFormData.typing)}),style:e.normalizeStyle({color:i.valiFormData.search_pkg&&i.valiFormData.typing?"#007AFF":"gray"})}," 包裹寄存、代购、运单都找不到时手工添加包裹 ",4)]),e.createElementVNode("view",{onClick:n[8]||(n[8]=(...e)=>r.searchOrderChoiceChange&&r.searchOrderChoiceChange(...e)),class:"checkbox-cum",style:e.normalizeStyle({color:i.valiFormData.search_order?"#007AFF":"gray"})},[e.createElementVNode("checkbox",{checked:i.valiFormData.search_order,onClick:n[7]||(n[7]=(...e)=>r.searchOrderChoiceChange&&r.searchOrderChoiceChange(...e))},null,8,["checked"]),e.createTextVNode(" 搜索运单 ")],4),e.createElementVNode("view",null,[e.createVNode(d,{disabled:!i.valiFormData.search_order,modelValue:i.valiFormData.search_order_choice,"onUpdate:modelValue":n[9]||(n[9]=e=>i.valiFormData.search_order_choice=e),localdata:i.searchOrderChoice},null,8,["disabled","modelValue","localdata"])])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:n[10]||(n[10]=(...e)=>r.reset&&r.reset(...e))},"重置"),e.createElementVNode("button",{type:"primary",onClick:n[11]||(n[11]=(...e)=>r.onsubmit&&r.onsubmit(...e)),loading:i.loading},[i.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(p,{key:0,type:"checkmarkempty",size:"18",color:"white"})),e.createTextVNode(" 提交 ")],8,["loading"])])]),e.createElementVNode("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.instockHistory.slice(0,5),((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},[e.createTextVNode(e.toDisplayString(t.orderNum)+" ",1),t.batch_text?(e.openBlock(),e.createElementBlock("text",{key:0},"批次号: "+e.toDisplayString(t.batch_text),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.type),1)],4),t.status?(e.openBlock(),e.createBlock(p,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),128))]),e.createVNode(f,{ref:"message",type:"message"},{default:e.withCtx((()=>[e.createVNode(m,{type:i.messageType,message:i.messageText,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(f,{ref:"alertDialog",type:"dialog"},{default:e.withCtx((()=>[e.createVNode(y,{type:"info",cancelText:"否",confirmText:"是",title:"提示",content:"是否按默认申报(默认申报为:衣服,10件,单价1)",onConfirm:r.dialogConfirm,onClose:r.dialogClose},null,8,["onConfirm","onClose"])])),_:1},512)])}]]),ns=u(e.defineComponent({__name:"instockLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("instockHistory")})),(t,s)=>{const a=o(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item"},[e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},[e.createTextVNode(e.toDisplayString(t.orderNum)+" ",1),t.batch_text?(e.openBlock(),e.createElementBlock("text",{key:0},"批次号: "+e.toDisplayString(t.batch_text),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.type),1)],4),t.status?(e.openBlock(),e.createBlock(a,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),256)),0===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-0a925c76"]]);const ss=u({data:()=>({token:e.ref(null),user:e.ref(null)}),onLoad(){},onShow(){this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user")},methods:{avatarClick(){this.token||uni.navigateTo({url:"/pages/login/index"})},logout(){uni.removeStorageSync("token"),uni.removeStorageSync("user"),this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user")},dialogToggle(){this.$refs.alertDialog.open()}}},[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-popup-dialog"),Yn),c=o(e.resolveDynamicComponent("uni-popup"),Jn);return e.openBlock(),e.createElementBlock("view",{class:"content"},[e.createElementVNode("view",{class:"user-v",onClick:n[0]||(n[0]=(...e)=>r.avatarClick&&r.avatarClick(...e))},[i.user.avatar?(e.openBlock(),e.createElementBlock("image",{key:1,class:"user-icon",src:i.user.avatar},null,8,["src"])):(e.openBlock(),e.createElementBlock("image",{key:0,class:"user-icon",src:"/static/user.png"}))]),e.createElementVNode("view",{class:"text-area"},[e.createElementVNode("text",{class:"title"},e.toDisplayString(i.user.username),1)]),e.createElementVNode("view",{class:"login-btn"},[i.token?(e.openBlock(),e.createElementBlock("button",{key:1,type:"default",plain:"true",size:"mini",onClick:n[2]||(n[2]=(...e)=>r.dialogToggle&&r.dialogToggle(...e))},"注销")):(e.openBlock(),e.createElementBlock("button",{key:0,type:"primary",plain:"true",size:"mini",onClick:n[1]||(n[1]=(...e)=>r.avatarClick&&r.avatarClick(...e))},"登录"))]),e.createVNode(c,{ref:"alertDialog",type:"dialog"},{default:e.withCtx((()=>[e.createVNode(l,{type:"info",cancelText:"取消",confirmText:"注销",title:"注销",content:"确定是要注销吗?",onConfirm:r.logout},null,8,["onConfirm"])])),_:1},512)])}]]);const as=u({data:()=>({messageText:"",captcha_id:"f2dd39ce-0d3e-4c1e-916c-b50090a7590s",verifyCodeImg:"",verifyCodeToken:"",isVerifyCodeTure:!1,valiFormData:{account:"",password:"",captcha:""},rules:{name:{rules:[{required:!0,errorMessage:"姓名不能为空"}]}}}),onLoad(){this.getVerifyCodeImg()},methods:{getVerifyCodeImg(){uni.request({url:`https://api.ytdeals.co.uk/api/common/captcha?server=1&id=${this.captcha_id}&m=`+Math.random(),method:"GET",responseType:"arraybuffer",success:e=>{const t=new Uint8Array(e.data),o="data:image/png;base64,"+uni.arrayBufferToBase64(t);this.verifyCodeImg=o,this.verifyCodeToken=e.header["Set-Cookie"]}})},formSubmit(){uni.request({url:"https://api.ytdeals.co.uk/admin/index/login",data:{username:this.valiFormData.account,password:this.valiFormData.password,captcha:this.valiFormData.captcha,keep:!1,loading:!0,captcha_id:this.captcha_id},method:"POST",success:e=>{if(t("log","at pages/login/index.vue:100",e),1==e.data.code){const t=e.data.data.userInfo;uni.setStorage({key:"token",data:t.token,success(){uni.setStorage({key:"user",data:t,success(){uni.navigateBack()}})}})}else t("log","at pages/login/index.vue:120",e),this.messageText=e.data.msg,this.$refs.message.open()}})}}},[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-icons"),g),c=o(e.resolveDynamicComponent("uni-easyinput"),k),u=o(e.resolveDynamicComponent("uni-forms"),Mn),d=o(e.resolveDynamicComponent("uni-popup-message"),jn),h=o(e.resolveDynamicComponent("uni-popup"),Jn);return e.openBlock(),e.createElementBlock("view",{class:"contaier"},[e.createElementVNode("view",{class:"top-bg"},[e.createElementVNode("image",{class:"logo-icon",src:"/static/logo.png"})]),e.createElementVNode("view",{class:"input-box padding-lr"},[e.createVNode(u,{ref:"valiForm",rules:i.rules,modelValue:i.valiFormData},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"cu-form-group margin-top"},[e.createVNode(l,{class:"uni-icon",type:"person",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"账号",modelValue:i.valiFormData.account,"onUpdate:modelValue":n[0]||(n[0]=e=>i.valiFormData.account=e)},null,8,["modelValue"])]),e.createElementVNode("view",{class:"cu-form-group"},[e.createVNode(l,{class:"uni-icon",type:"locked",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"密码",type:"password",modelValue:i.valiFormData.password,"onUpdate:modelValue":n[1]||(n[1]=e=>i.valiFormData.password=e)},null,8,["modelValue"])]),e.createElementVNode("view",{class:"cu-form-group solid-bottom"},[e.createVNode(l,{class:"uni-icon",type:"more-filled",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"验证码",modelValue:i.valiFormData.captcha,"onUpdate:modelValue":n[2]||(n[2]=e=>i.valiFormData.captcha=e)},null,8,["modelValue"]),e.createElementVNode("image",{class:"cu-btn captchaImg",src:i.verifyCodeImg,onClick:n[3]||(n[3]=(...e)=>r.getVerifyCodeImg&&r.getVerifyCodeImg(...e))},null,8,["src"])])])),_:1},8,["rules","modelValue"])]),e.createElementVNode("view",{class:"padding-lr margin-top-xs"},[e.createElementVNode("button",{class:"cu-btn block round bg-login-zl margin-tb-sm lg",onClick:n[4]||(n[4]=e=>r.formSubmit("valiForm"))},"立即登录")]),e.createVNode(h,{ref:"message",type:"message"},{default:e.withCtx((()=>[e.createVNode(d,{type:"error",message:i.messageText,duration:2e3},null,8,["message"])])),_:1},512)])}],["__scopeId","data-v-5016fb04"]]);const is=u({data:()=>({token:e.ref(null),user:e.ref(null)}),onLoad(){},onShow(){this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user")},methods:{avatarClick(){this.token||uni.navigateTo({url:"/pages/login/index"})},logout(){uni.removeStorageSync("token"),uni.removeStorageSync("user"),this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user")},dialogToggle(){this.$refs.alertDialog.open()}}},[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:"content"})}]]),rs={props:{localdata:{type:[Array,Object],default:()=>[]},spaceInfo:{type:Object,default:()=>({})},collection:{type:String,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:500},getcount:{type:[Boolean,String],default:!1},getone:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},manual:{type:Boolean,default:!1},value:{type:[Array,String,Number],default:()=>[]},modelValue:{type:[Array,String,Number],default:()=>[]},preload:{type:Boolean,default:!1},stepSearh:{type:Boolean,default:!0},selfField:{type:String,default:""},parentField:{type:String,default:""},multiple:{type:Boolean,default:!1},map:{type:Object,default:()=>({text:"text",value:"value"})}},data(){return{loading:!1,errorMessage:"",loadMore:{contentdown:"",contentrefresh:"",contentnomore:""},dataList:[],selected:[],selectedIndex:0,page:{current:this.pageCurrent,size:this.pageSize,count:0}}},computed:{isLocalData(){return!this.collection.length},isCloudData(){return this.collection.length>0},isCloudDataList(){return this.isCloudData&&!this.parentField&&!this.selfField},isCloudDataTree(){return this.isCloudData&&this.parentField&&this.selfField},dataValue(){return(Array.isArray(this.modelValue)?this.modelValue.length>0:null!==this.modelValue||void 0!==this.modelValue)?this.modelValue:this.value},hasValue(){return"number"==typeof this.dataValue||null!=this.dataValue&&this.dataValue.length>0}},created(){this.$watch((()=>{var e=[];return["pageCurrent","pageSize","spaceInfo","value","modelValue","localdata","collection","action","field","orderby","where","getont","getcount","gettree"].forEach((t=>{e.push(this[t])})),e}),((e,t)=>{for(let o=2;o<e.length&&e[o]==t[o];o++);e[0]!=t[0]&&(this.page.current=this.pageCurrent),this.page.size=this.pageSize,this.onPropsChange()})),this._treeData=[]},methods:{onPropsChange(){this._treeData=[]},async loadData(){this.isLocalData?this.loadLocalData():this.isCloudDataList?this.loadCloudDataList():this.isCloudDataTree&&this.loadCloudDataTree()},async loadLocalData(){this._treeData=[],this._extractTree(this.localdata,this._treeData);let e=this.dataValue;void 0!==e&&(Array.isArray(e)&&(e=e[e.length-1],"object"==typeof e&&e[this.map.value]&&(e=e[this.map.value])),this.selected=this._findNodePath(e,this.localdata))},async loadCloudDataList(){if(!this.loading){this.loading=!0;try{let e=(await this.getCommand()).result.data;this._treeData=e,this._updateBindData(),this._updateSelected(),this.onDataChange()}catch(Ne){this.errorMessage=Ne}finally{this.loading=!1}}},async loadCloudDataTree(){if(!this.loading){this.loading=!0;try{let e={field:this._cloudDataPostField(),where:this._cloudDataTreeWhere()};this.gettree&&(e.startwith=`${this.selfField}=='${this.dataValue}'`);let t=(await this.getCommand(e)).result.data;this._treeData=t,this._updateBindData(),this._updateSelected(),this.onDataChange()}catch(Ne){this.errorMessage=Ne}finally{this.loading=!1}}},async loadCloudDataNode(e){if(!this.loading){this.loading=!0;try{let t={field:this._cloudDataPostField(),where:this._cloudDataNodeWhere()};e((await this.getCommand(t)).result.data)}catch(Ne){this.errorMessage=Ne}finally{this.loading=!1}}},getCloudDataValue(){return this.isCloudDataList?this.getCloudDataListValue():this.isCloudDataTree?this.getCloudDataTreeValue():void 0},getCloudDataListValue(){let e=[],t=this._getForeignKeyByField();return t&&e.push(`${t} == '${this.dataValue}'`),e=e.join(" || "),this.where&&(e=`(${this.where}) && (${e})`),this.getCommand({field:this._cloudDataPostField(),where:e}).then((e=>(this.selected=e.result.data,e.result.data)))},getCloudDataTreeValue(){return this.getCommand({field:this._cloudDataPostField(),getTreePath:{startWith:`${this.selfField}=='${this.dataValue}'`}}).then((e=>{let t=[];return this._extractTreePath(e.result.data,t),this.selected=t,t}))},getCommand(e={}){let t=nn.database(this.spaceInfo);const o=e.action||this.action;o&&(t=t.action(o));const n=e.collection||this.collection;t=t.collection(n);const s=e.where||this.where;s&&Object.keys(s).length&&(t=t.where(s));const a=e.field||this.field;a&&(t=t.field(a));const i=e.orderby||this.orderby;i&&(t=t.orderBy(i));const r=void 0!==e.pageCurrent?e.pageCurrent:this.page.current,l=void 0!==e.pageSize?e.pageSize:this.page.size,c={getCount:void 0!==e.getcount?e.getcount:this.getcount,getTree:void 0!==e.gettree?e.gettree:this.gettree};return e.getTreePath&&(c.getTreePath=e.getTreePath),t=t.skip(l*(r-1)).limit(l).get(c),t},_cloudDataPostField(){let e=[this.field];return this.parentField&&e.push(`${this.parentField} as parent_value`),e.join(",")},_cloudDataTreeWhere(){let e=[],t=this.selected,o=this.parentField;if(o&&e.push(`${o} == null || ${o} == ""`),t.length)for(var n=0;n<t.length-1;n++)e.push(`${o} == '${t[n].value}'`);let s=[];return this.where&&s.push(`(${this.where})`),e.length&&s.push(`(${e.join(" || ")})`),s.join(" && ")},_cloudDataNodeWhere(){let e=[],t=this.selected;return t.length&&e.push(`${this.parentField} == '${t[t.length-1].value}'`),e=e.join(" || "),this.where?`(${this.where}) && (${e})`:e},_getWhereByForeignKey(){let e=[],t=this._getForeignKeyByField();return t&&e.push(`${t} == '${this.dataValue}'`),this.where?`(${this.where}) && (${e.join(" || ")})`:e.join(" || ")},_getForeignKeyByField(){let e=this.field.split(","),t=null;for(let o=0;o<e.length;o++){const n=e[o].split("as");if(!(n.length<2)&&"value"===n[1].trim()){t=n[0].trim();break}}return t},_updateBindData(e){const{dataList:t,hasNodes:o}=this._filterData(this._treeData,this.selected);let n=!1===this._stepSearh&&!o;return e&&(e.isleaf=n),this.dataList=t,this.selectedIndex=t.length-1,!n&&this.selected.length<t.length&&this.selected.push({value:null,text:"请选择"}),{isleaf:n,hasNodes:o}},_updateSelected(){let e=this.dataList,t=this.selected,o=this.map.text,n=this.map.value;for(let s=0;s<t.length;s++){let a=t[s].value,i=e[s];for(let e=0;e<i.length;e++){let r=i[e];if(r[n]===a){t[s].text=r[o];break}}}},_filterData(e,t){let o=[],n=!0;o.push(e.filter((e=>null===e.parent_value||void 0===e.parent_value||""===e.parent_value)));for(let s=0;s<t.length;s++){let a=t[s].value,i=e.filter((e=>e.parent_value===a));i.length?o.push(i):n=!1}return{dataList:o,hasNodes:n}},_extractTree(e,t,o){let n=this.map.value;for(let s=0;s<e.length;s++){let a=e[s],i={};for(let e in a)"children"!==e&&(i[e]=a[e]);null!=o&&""!==o&&(i.parent_value=o),t.push(i);let r=a.children;r&&this._extractTree(r,t,a[n])}},_extractTreePath(e,t){for(let o=0;o<e.length;o++){let n=e[o],s={};for(let e in n)"children"!==e&&(s[e]=n[e]);t.push(s);let a=n.children;a&&this._extractTreePath(a,t)}},_findNodePath(e,t,o=[]){let n=this.map.text,s=this.map.value;for(let a=0;a<t.length;a++){let i=t[a],r=i.children,l=i[n],c=i[s];if(o.push({value:c,text:l}),c===e)return o;if(r){const t=this._findNodePath(e,r,o);if(t.length)return t}o.pop()}return[]}}};const ls={name:"UniDataPicker",emits:["popupopened","popupclosed","nodeclick","input","change","update:modelValue","inputclick"],mixins:[rs],components:{DataPickerView:u({name:"UniDataPickerView",emits:["nodeclick","change","datachange","update:modelValue"],mixins:[rs],props:{managedMode:{type:Boolean,default:!1},ellipsis:{type:Boolean,default:!0}},created(){this.managedMode||this.$nextTick((()=>{this.loadData()}))},methods:{onPropsChange(){this._treeData=[],this.selectedIndex=0,this.$nextTick((()=>{this.loadData()}))},handleSelect(e){this.selectedIndex=e},handleNodeClick(e,t,o){if(e.disable)return;const n=this.dataList[t][o],s=n[this.map.text],a=n[this.map.value];if(t<this.selected.length-1?(this.selected.splice(t,this.selected.length-t),this.selected.push({text:s,value:a})):t===this.selected.length-1&&this.selected.splice(t,1,{text:s,value:a}),n.isleaf)return void this.onSelectedChange(n,n.isleaf);const{isleaf:i,hasNodes:r}=this._updateBindData();this.isLocalData?this.onSelectedChange(n,!r||i):this.isCloudDataList?this.onSelectedChange(n,!0):this.isCloudDataTree&&(i?this.onSelectedChange(n,n.isleaf):r||this.loadCloudDataNode((e=>{e.length?(this._treeData.push(...e),this._updateBindData(n)):n.isleaf=!0,this.onSelectedChange(n,n.isleaf)})))},updateData(e){this._treeData=e.treeData,this.selected=e.selected,this._treeData.length?this._updateBindData():this.loadData()},onDataChange(){this.$emit("datachange")},onSelectedChange(e,t){t&&this._dispatchEvent(),e&&this.$emit("nodeclick",e)},_dispatchEvent(){this.$emit("change",this.selected.slice(0))}}},[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-load-more"),wn);return e.openBlock(),e.createElementBlock("view",{class:"uni-data-pickerview"},[t.isCloudDataList?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("scroll-view",{key:0,class:"selected-area","scroll-x":"true"},[e.createElementVNode("view",{class:"selected-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.selected,((o,n)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["selected-item",{"selected-item-active":n==t.selectedIndex}]),key:n,onClick:e=>r.handleSelect(n)},[e.createElementVNode("text",null,e.toDisplayString(o.text||""),1)],10,["onClick"])))),128))])])),e.createElementVNode("view",{class:"tab-c"},[e.createElementVNode("scroll-view",{class:"list","scroll-y":!0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataList[t.selectedIndex],((o,n)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["item",{"is-disabled":!!o.disable}]),key:n,onClick:e=>r.handleNodeClick(o,t.selectedIndex,n)},[e.createElementVNode("text",{class:"item-text"},e.toDisplayString(o[t.map.text]),1),t.selected.length>t.selectedIndex&&o[t.map.value]==t.selected[t.selectedIndex].value?(e.openBlock(),e.createElementBlock("view",{key:0,class:"check"})):e.createCommentVNode("",!0)],10,["onClick"])))),128))]),t.loading?(e.openBlock(),e.createElementBlock("view",{key:0,class:"loading-cover"},[e.createVNode(l,{class:"load-more",contentText:t.loadMore,status:"loading"},null,8,["contentText"])])):e.createCommentVNode("",!0),t.errorMessage?(e.openBlock(),e.createElementBlock("view",{key:1,class:"error-message"},[e.createElementVNode("text",{class:"error-text"},e.toDisplayString(t.errorMessage),1)])):e.createCommentVNode("",!0)])])}],["__scopeId","data-v-c0c521c5"]])},props:{options:{type:[Object,Array],default:()=>({})},popupTitle:{type:String,default:"请选择"},placeholder:{type:String,default:"请选择"},heightMobile:{type:String,default:""},readonly:{type:Boolean,default:!1},clearIcon:{type:Boolean,default:!0},border:{type:Boolean,default:!0},split:{type:String,default:"/"},ellipsis:{type:Boolean,default:!0}},data:()=>({isOpened:!1,inputSelected:[]}),created(){this.$nextTick((()=>{this.load()}))},watch:{localdata:{handler(){this.load()},deep:!0}},methods:{clear(){this._dispatchEvent([])},onPropsChange(){this._treeData=[],this.selectedIndex=0,this.load()},load(){this.readonly?this._processReadonly(this.localdata,this.dataValue):this.isLocalData?(this.loadData(),this.inputSelected=this.selected.slice(0)):(this.isCloudDataList||this.isCloudDataTree)&&(this.loading=!0,this.getCloudDataValue().then((e=>{this.loading=!1,this.inputSelected=e})).catch((e=>{this.loading=!1,this.errorMessage=e})))},show(){this.isOpened=!0,setTimeout((()=>{this.$refs.pickerView.updateData({treeData:this._treeData,selected:this.selected,selectedIndex:this.selectedIndex})}),200),this.$emit("popupopened")},hide(){this.isOpened=!1,this.$emit("popupclosed")},handleInput(){this.readonly?this.$emit("inputclick"):this.show()},handleClose(e){this.hide()},onnodeclick(e){this.$emit("nodeclick",e)},ondatachange(e){this._treeData=this.$refs.pickerView._treeData},onchange(e){this.hide(),this.$nextTick((()=>{this.inputSelected=e})),this._dispatchEvent(e)},_processReadonly(e,t){if(e.findIndex((e=>e.children))>-1){let e;return Array.isArray(t)?(e=t[t.length-1],"object"==typeof e&&e.value&&(e=e.value)):e=t,void(this.inputSelected=this._findNodePath(e,this.localdata))}if(!this.hasValue)return void(this.inputSelected=[]);let o=[];for(let a=0;a<t.length;a++){var n=t[a],s=e.find((e=>e.value==n));s&&o.push(s)}o.length&&(this.inputSelected=o)},_filterForArray(e,t){var o=[];for(let a=0;a<t.length;a++){var n=t[a],s=e.find((e=>e.value==n));s&&o.push(s)}return o},_dispatchEvent(e){let t={};if(e.length){for(var o=new Array(e.length),n=0;n<e.length;n++)o[n]=e[n].value;t=e[e.length-1]}else t.value="";this.formItem&&this.formItem.setValue(t.value),this.$emit("input",t.value),this.$emit("update:modelValue",t.value),this.$emit("change",{detail:{value:e}})}}};const cs=u(ls,[["render",function(t,n,s,a,i,r){const l=o(e.resolveDynamicComponent("uni-load-more"),wn),c=o(e.resolveDynamicComponent("uni-icons"),g),u=e.resolveComponent("data-picker-view");return e.openBlock(),e.createElementBlock("view",{class:"uni-data-tree"},[e.createElementVNode("view",{class:"uni-data-tree-input",onClick:n[1]||(n[1]=(...e)=>r.handleInput&&r.handleInput(...e))},[e.renderSlot(t.$slots,"default",{options:s.options,data:i.inputSelected,error:t.errorMessage},(()=>[e.createElementVNode("view",{class:e.normalizeClass(["input-value",{"input-value-border":s.border}])},[t.errorMessage?(e.openBlock(),e.createElementBlock("text",{key:0,class:"selected-area error-text"},e.toDisplayString(t.errorMessage),1)):t.loading&&!i.isOpened?(e.openBlock(),e.createElementBlock("view",{key:1,class:"selected-area"},[e.createVNode(l,{class:"load-more",contentText:t.loadMore,status:"loading"},null,8,["contentText"])])):i.inputSelected.length?(e.openBlock(),e.createElementBlock("scroll-view",{key:2,class:"selected-area","scroll-x":"true"},[e.createElementVNode("view",{class:"selected-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.inputSelected,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"selected-item",key:o},[e.createElementVNode("text",{class:"text-color"},e.toDisplayString(t.text),1),o<i.inputSelected.length-1?(e.openBlock(),e.createElementBlock("text",{key:0,class:"input-split-line"},e.toDisplayString(s.split),1)):e.createCommentVNode("",!0)])))),128))])])):(e.openBlock(),e.createElementBlock("text",{key:3,class:"selected-area placeholder"},e.toDisplayString(s.placeholder),1)),s.clearIcon&&!s.readonly&&i.inputSelected.length?(e.openBlock(),e.createElementBlock("view",{key:4,class:"icon-clear",onClick:n[0]||(n[0]=e.withModifiers(((...e)=>r.clear&&r.clear(...e)),["stop"]))},[e.createVNode(c,{type:"clear",color:"#c0c4cc",size:"24"})])):e.createCommentVNode("",!0),s.clearIcon&&i.inputSelected.length||s.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("view",{key:5,class:"arrow-area"},[e.createElementVNode("view",{class:"input-arrow"})]))],2)]),!0)]),i.isOpened?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-data-tree-cover",onClick:n[2]||(n[2]=(...e)=>r.handleClose&&r.handleClose(...e))})):e.createCommentVNode("",!0),i.isOpened?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-data-tree-dialog"},[e.createElementVNode("view",{class:"uni-popper__arrow"}),e.createElementVNode("view",{class:"dialog-caption"},[e.createElementVNode("view",{class:"title-area"},[e.createElementVNode("text",{class:"dialog-title"},e.toDisplayString(s.popupTitle),1)]),e.createElementVNode("view",{class:"dialog-close",onClick:n[3]||(n[3]=(...e)=>r.handleClose&&r.handleClose(...e))},[e.createElementVNode("view",{class:"dialog-close-plus","data-id":"close"}),e.createElementVNode("view",{class:"dialog-close-plus dialog-close-rotate","data-id":"close"})])]),e.createVNode(u,{class:"picker-view",ref:"pickerView",modelValue:t.dataValue,"onUpdate:modelValue":n[4]||(n[4]=e=>t.dataValue=e),localdata:t.localdata,preload:t.preload,collection:t.collection,field:t.field,orderby:t.orderby,where:t.where,"step-searh":t.stepSearh,"self-field":t.selfField,"parent-field":t.parentField,"managed-mode":!0,map:t.map,ellipsis:s.ellipsis,onChange:r.onchange,onDatachange:r.ondatachange,onNodeclick:r.onnodeclick},null,8,["modelValue","localdata","preload","collection","field","orderby","where","step-searh","self-field","parent-field","map","ellipsis","onChange","onDatachange","onNodeclick"])])):e.createCommentVNode("",!0)])}],["__scopeId","data-v-2015cfd3"]]),us=e.defineComponent({__name:"index",setup(n){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),p=e.ref(!0),m=e.ref([]),f=e.ref(),y=e.ref(),_=e.ref();let w;const b=e.ref({orderNum:"",weight:"",batchNum:"",palletNum:""}),S=e.reactive({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]}}),x=e.reactive({batch:[],pallet:[]}),C=()=>{},T=()=>{},E=()=>{},D=()=>{},N=async()=>{1===await(async()=>{let e=Zn.isIOS?await Zn.requestIOS("camera"):await Zn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Zn.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{b.value.orderNum=e.result},fail:e=>{}})},I=()=>{d.value=!1,b.value.orderNum="",b.value.weight="",b.value.batchNum="",b.value.palletNum=""},A=()=>{d.value=!0,uni.setStorageSync("waybills",[]),uni.request({url:"https://api.ytdeals.co.uk/admin/order.scanOrder/getWaybills",method:"POST",header:{batoken:u.value},data:{order_no:b.value.orderNum,batch_number:b.value.batchNum,pallet_number:b.value.palletNum?B(x.pallet,b.value.palletNum):""},success:e=>{d.value=!1,1==e.data.code?(y.value="success",_.value=e.data.msg,f.value.open(),uni.setStorageSync("waybills",e.data.data.waybills),uni.navigateTo({url:"/pages/scanLotno/waybillsList"})):(y.value="error",_.value=e.data.msg,f.value.open())}})},B=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.id===t||n.value===t)return[n.id];if(n.children&&n.children.length>0){const e=B(n.children,t);if(null!==e)return e}}return null},P=()=>{w&&clearTimeout(w),d.value=!0,uni.request({url:"https://api.ytdeals.co.uk/admin/order.scanOrder/bindShipping",method:"POST",header:{batoken:u.value},data:{order_no:b.value.orderNum,reweighting:b.value.weight,batch_number:b.value.batchNum,pallet_number:b.value.palletNum?B(x.pallet,b.value.palletNum):""},success:e=>{if(d.value=!1,1==e.data.code){y.value="success",_.value=e.data.msg,f.value.open(),e.data.data.labels&&e.data.data.labels.length>0&&t("log","at pages/scanLotno/index.vue:226","有打印面单");const o={orderNum:b.value.orderNum,createTime:new Date,type:b.value.batchNum?"绑定批次":"绑定托盘",status:!0};t("log","at pages/scanLotno/index.vue:238","lotnoLogHistory--",m),m.value.unshift(o),uni.setStorageSync("lotnoLogHistory",m.value),V()}else{y.value="error",_.value=e.data.msg,f.value.open();const t={orderNum:b.value.orderNum,createTime:new Date,type:b.value.batchNum?"绑定批次":"绑定托盘",status:!1};m.value.unshift(t),uni.setStorageSync("lotnoLogHistory",m.value),V()}w=setTimeout((()=>{I(),w&&clearTimeout(w)}),1e3)}})},V=()=>{m.value=uni.getStorageSync("lotnoLogHistory")||[]},L=e=>{t("log","at pages/scanLotno/index.vue:268",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&P()};i((()=>{plus.key.addEventListener("keyup",L)})),r((()=>{plus.key.removeEventListener("keyup",L)})),a((()=>{h.value=!0,plus.key.removeEventListener("keyup",L)})),l((()=>{plus.key.removeEventListener("keyup",L)})),s((()=>{u.value=uni.getStorageSync("token"),O(),V()}));const O=()=>{uni.request({url:es,method:"GET",header:{batoken:u.value},success:e=>{if(1===e.data.code){let t=function(e){return e.map((e=>{const{id:o,value:n,label:s,...a}=e;return{id:o||n,value:n,text:s,...a,children:e.children?t(e.children):[]}}))};x.batch=e.data.data.batch_number.map((e=>({text:e.name,value:e.id})));const o=t(e.data.data.shipping);x.pallet=o}},fail(e){t("log","at pages/scanLotno/index.vue:349","fail--",e)}})};return c((e=>{0===e.index&&uni.navigateTo({url:"/pages/scanLotno/lotnoLog"})})),(t,n)=>{const s=o(e.resolveDynamicComponent("uni-easyinput"),k),a=o(e.resolveDynamicComponent("uni-forms-item"),v),i=o(e.resolveDynamicComponent("uni-data-select"),sn),r=o(e.resolveDynamicComponent("uni-data-picker"),cs),l=o(e.resolveDynamicComponent("uni-forms"),Mn),c=o(e.resolveDynamicComponent("uni-icons"),g),u=o(e.resolveDynamicComponent("uni-popup-message"),jn),h=o(e.resolveDynamicComponent("uni-popup"),Jn);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(l,{ref:"valiForm","label-align":"right","label-width":80,rules:S,modelValue:b.value},{default:e.withCtx((()=>[e.createVNode(a,{label:"运单号码",required:"",name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:b.value.orderNum,"onUpdate:modelValue":n[0]||(n[0]=e=>b.value.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:p.value,onIconClick:N},null,8,["modelValue","focus"])])),_:1}),e.createVNode(a,{label:"复称重量",name:"weight"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:b.value.weight,"onUpdate:modelValue":n[1]||(n[1]=e=>b.value.weight=e),placeholder:"请输入复称重量",oninput:"value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"},{right:e.withCtx((()=>[e.createElementVNode("view",{class:"weight-right"},"KG")])),_:1},8,["modelValue"])])),_:1}),e.createVNode(a,{label:"绑定批次号",name:"batchNum"},{default:e.withCtx((()=>[e.createVNode(i,{modelValue:b.value.batchNum,"onUpdate:modelValue":n[2]||(n[2]=e=>b.value.batchNum=e),placeholder:"请选择批次号",localdata:x.batch,clear:!1},null,8,["modelValue","localdata"])])),_:1}),e.createVNode(a,{label:"绑定托盘号",name:"palletNum"},{default:e.withCtx((()=>[e.createVNode(r,{placeholder:"请选择托盘号","popup-title":"绑定托盘号",localdata:x.pallet,modelValue:b.value.palletNum,"onUpdate:modelValue":n[3]||(n[3]=e=>b.value.palletNum=e),onChange:D,onNodeclick:C,onPopupopened:T,onPopupclosed:E},null,8,["localdata","modelValue"])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:I},"重置"),e.createElementVNode("button",{type:"default",onClick:A,loading:d.value},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0,type:"search",size:"18"})),e.createTextVNode(" 查看运单 ")],8,["loading"]),e.createElementVNode("button",{type:"primary",onClick:P,loading:d.value},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0,type:"checkmarkempty",size:"18",color:"white"})),e.createTextVNode(" 提交 ")],8,["loading"])]),m.value.length>0?(e.openBlock(),e.createElementBlock("view",{key:0,class:"history"},[e.createElementVNode("text",{class:"title"},"记录(最近5条)")])):e.createCommentVNode("",!0),e.createElementVNode("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value.slice(0,5),((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("text",{class:"type"},e.toDisplayString(t.type),1),e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.orderNum),5),t.status?(e.openBlock(),e.createBlock(c,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),128))]),e.createVNode(h,{ref_key:"messageRef",ref:f,type:"message"},{default:e.withCtx((()=>[e.createVNode(u,{type:y.value,message:_.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),ds=u(e.defineComponent({__name:"lotnoLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("lotnoLogHistory")})),(t,s)=>{const a=o(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("text",{class:"type"},e.toDisplayString(t.type),1),e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.orderNum),5),t.status?(e.openBlock(),e.createBlock(a,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),128)),0===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-cdf76154"]]);const hs=u({name:"UniSection",emits:["click"],props:{type:{type:String,default:""},title:{type:String,required:!0,default:""},titleFontSize:{type:String,default:"14px"},titleColor:{type:String,default:"#333"},subTitle:{type:String,default:""},subTitleFontSize:{type:String,default:"12px"},subTitleColor:{type:String,default:"#999"},padding:{type:[Boolean,String],default:!1}},computed:{_padding(){return"string"==typeof this.padding?this.padding:this.padding?"10px":""}},watch:{title(e){uni.report&&""!==e&&uni.report("title",e)}},methods:{onClick(){this.$emit("click")}}},[["render",function(t,o,n,s,a,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-section"},[e.createElementVNode("view",{class:"uni-section-header",onClick:o[0]||(o[0]=(...e)=>i.onClick&&i.onClick(...e))},[n.type?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass(["uni-section-header__decoration",n.type])},null,2)):e.renderSlot(t.$slots,"decoration",{key:1},void 0,!0),e.createElementVNode("view",{class:"uni-section-header__content"},[e.createElementVNode("text",{style:e.normalizeStyle({"font-size":n.titleFontSize,color:n.titleColor}),class:e.normalizeClass(["uni-section__content-title",{distraction:!n.subTitle}])},e.toDisplayString(n.title),7),n.subTitle?(e.openBlock(),e.createElementBlock("text",{key:0,style:e.normalizeStyle({"font-size":n.subTitleFontSize,color:n.subTitleColor}),class:"uni-section-header__content-sub"},e.toDisplayString(n.subTitle),5)):e.createCommentVNode("",!0)]),e.createElementVNode("view",{class:"uni-section-header__slot-right"},[e.renderSlot(t.$slots,"right",{},void 0,!0)])]),e.createElementVNode("view",{class:"uni-section-content",style:e.normalizeStyle({padding:i._padding})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4)])}],["__scopeId","data-v-0a8818d5"]]),ps=u(e.defineComponent({__name:"waybillsList",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("waybills")})),(t,s)=>{const a=o(e.resolveDynamicComponent("uni-section"),hs);return e.openBlock(),e.createElementBlock("view",{class:"history"},[e.createVNode(a,{title:"数量: "+n.value.length},null,8,["title"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("text",{class:"code",style:{color:"#666"}},e.toDisplayString(t.order_box_no),1),e.createElementVNode("text",{class:"type"},"重量: "+e.toDisplayString(t.weight)+"KG",1),e.createElementVNode("view",{class:"sub-items"},[e.createElementVNode("view",{class:"sub-item"},[e.createElementVNode("text",{class:"type"},"批次/船航/托盘"),e.createElementVNode("text",{class:"type"},e.toDisplayString(t.batch_shipping_pallet),1)]),e.createElementVNode("view",{class:"sub-item"},[e.createElementVNode("text",{class:"type"},"末公里运单号"),e.createElementVNode("text",{class:"type"},e.toDisplayString(t.tracking_number||"无"),1)])])])))),128)),0===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无运单")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-2aaa63ed"]]),ms=e.defineComponent({__name:"index",setup(n){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),p=e.ref(!0),m=e.ref([]),f=e.ref(),y=e.ref(),_=e.ref();let w;const b=e.ref({order_code:""}),S=e.reactive({order_code:{rules:[{required:!0,errorMessage:"单据编号不能为空"}]}}),x=async()=>{1===await(async()=>{let e=Zn.isIOS?await Zn.requestIOS("camera"):await Zn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Zn.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{b.value.order_code=e.result,E()},fail:e=>{}})},C=()=>{d.value=!1,b.value.order_code=""},T=()=>{h.value||(p.value=!1,e.nextTick((()=>{p.value=!0})))},E=()=>{w&&clearTimeout(w),d.value=!0,uni.request({url:"https://api.ytdeals.co.uk/admin/order.sheetOrder/warehouseScan",method:"POST",header:{batoken:u.value},data:{order_code:b.value.order_code},success:e=>{if(d.value=!1,1==e.data.code){y.value="success",_.value=e.data.msg,f.value.open();const t={order_code:b.value.order_code,createTime:new Date,type:"单据扫描",status:!0};m.value.unshift(t),uni.setStorageSync("warehouseLogHistory",m.value),D()}else{y.value="error",_.value=e.data.msg,f.value.open();const t={order_code:b.value.order_code,createTime:new Date,type:"单据扫描",status:!1};m.value.unshift(t),uni.setStorageSync("warehouseLogHistory",m.value),D()}w=setTimeout((()=>{C(),w&&clearTimeout(w)}),1e3)}})},D=()=>{m.value=uni.getStorageSync("warehouseLogHistory")||[]},N=e=>{t("log","at pages/warehouseScan/index.vue:179",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&E()};return i((()=>{plus.key.addEventListener("keyup",N)})),r((()=>{plus.key.removeEventListener("keyup",N)})),a((()=>{h.value=!0,plus.key.removeEventListener("keyup",N)})),l((()=>{plus.key.removeEventListener("keyup",N)})),s((()=>{u.value=uni.getStorageSync("token"),h.value=!1,D()})),c((e=>{0===e.index&&uni.navigateTo({url:"/pages/warehouseScan/warehouseLog"})})),(t,n)=>{const s=o(e.resolveDynamicComponent("uni-easyinput"),k),a=o(e.resolveDynamicComponent("uni-forms-item"),v),i=o(e.resolveDynamicComponent("uni-forms"),Mn),r=o(e.resolveDynamicComponent("uni-icons"),g),l=o(e.resolveDynamicComponent("uni-popup-message"),jn),c=o(e.resolveDynamicComponent("uni-popup"),Jn);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(i,{ref:"valiForm","label-align":"right","label-width":80,rules:S,modelValue:b.value},{default:e.withCtx((()=>[e.createVNode(a,{label:"单据编号",required:"",name:"order_code"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:b.value.order_code,"onUpdate:modelValue":n[0]||(n[0]=e=>b.value.order_code=e),placeholder:"请输入单据编号",suffixIcon:"scan",focus:p.value,onIconClick:x,onBlur:T,onConfirm:E},null,8,["modelValue","focus"])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:C},"重置"),e.createElementVNode("button",{type:"primary",onClick:E,loading:d.value},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r,{key:0,type:"checkmarkempty",size:"18",color:"white"})),e.createTextVNode(" 提交 ")],8,["loading"])]),m.value.length>0?(e.openBlock(),e.createElementBlock("view",{key:0,class:"history"},[e.createElementVNode("text",{class:"title"},"记录(最近5条)")])):e.createCommentVNode("",!0),e.createElementVNode("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value.slice(0,5),((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.order_code),5),t.status?(e.openBlock(),e.createBlock(r,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),128))]),e.createVNode(c,{ref_key:"messageRef",ref:f,type:"message"},{default:e.withCtx((()=>[e.createVNode(l,{type:y.value,message:_.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),fs=u(ms,[["__scopeId","data-v-de7cb1d5"]]),gs=u(e.defineComponent({__name:"warehouseLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("warehouseLogHistory")})),(t,s)=>{const a=o(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("text",{class:"type"},e.toDisplayString(t.type),1),e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.order_code),5),t.status?(e.openBlock(),e.createBlock(a,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),128)),0===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-14053095"]]),ys=u(e.defineComponent({__name:"index",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("instockHistory")})),(t,s)=>{const a=o(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item"},[e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.orderNum)+" "+e.toDisplayString(t.type),5),t.status?(e.openBlock(),e.createBlock(a,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),256)),0===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-89bb5a47"]]);__definePage("pages/home/index",m),__definePage("pages/instock/index",os),__definePage("pages/instock/instockLog",ns),__definePage("pages/profile/index",ss),__definePage("pages/login/index",as),__definePage("pages/order/index",is),__definePage("pages/scanLotno/index",us),__definePage("pages/scanLotno/lotnoLog",ds),__definePage("pages/scanLotno/waybillsList",ps),__definePage("pages/warehouseScan/index",fs),__definePage("pages/warehouseScan/warehouseLog",gs),__definePage("pages/waybillDeliveryOrder/index",ys);const ks={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:vs,Vuex:_s,Pinia:ws}={app:e.createVueApp(ks)};uni.Vuex=_s,uni.Pinia=ws,vs.provide("__globalStyles",__uniConfig.styles),vs._component.mpType="app",vs._component.render=()=>{},vs.mount("#app")}(Vue);