app-service.js 257 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 a=t=>(o,a=e.getCurrentInstance())=>{!e.isInSSRComponentSetup&&e.injectHook(t,o,a)},n=a("onShow"),s=a("onHide"),i=a("onLoad"),r=a("onUnload"),l=a("onBackPress"),c=a("onNavigationBarButtonTap"),u=(e,t)=>{const o=e.__vccOpts||e;for(const[a,n]of t)o[a]=n;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,a,n,s,i){return s.width?(e.openBlock(),e.createElementBlock("view",{key:0,style:e.normalizeStyle("width:"+s.width+";"+(s.square?"height:"+s.width:"")),class:"uni-grid-item"},[e.createElementVNode("view",{class:e.normalizeClass([{"uni-grid-item--border":s.showBorder,"uni-grid-item--border-top":s.showBorder&&a.index<s.column,"uni-highlight":s.highlight},"uni-grid-item__box"]),style:e.normalizeStyle({"border-right-color":s.borderColor,"border-bottom-color":s.borderColor,"border-top-color":s.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 m=u(h,[["render",function(t,o,a,n,s,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-grid-wrap"},[e.createElementVNode("view",{id:s.elId,ref:"uni-grid",class:e.normalizeClass(["uni-grid",{"uni-grid--border":a.showBorder}]),style:e.normalizeStyle({"border-left-color":a.borderColor})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],14,["id"])])}],["__scopeId","data-v-a6acbddc"]]),p=e.defineComponent({__name:"index",setup(a){const s=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/printer/index",src:"/static/houscan.png",text:"打印"},{url:"/pages/scanLotno/index",src:"/static/link.png",text:"托盘/批次"},{url:"/pages/waybillNo/index",src:"/static/link.png",text:"库位绑定"},{url:"/pages/waybillDeliveryOrder/index",src:"/static/dispatch.png",text:"派送单"}]);n((()=>{s.value=uni.getStorageSync("token"),i.value=uni.getStorageSync("user"),t("log","at pages/home/index.vue:60","show---",{token:s.value,user:i.value})}));const l=()=>{};return(a,n)=>{const i=o(e.resolveDynamicComponent("uni-grid-item"),d),c=o(e.resolveDynamicComponent("uni-grid"),m);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,a)=>(e.openBlock(),e.createBlock(i,{index:a,key:a},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"grid-item-box",onClick:e=>{return t("log","at pages/home/index.vue:63",a=o.url),void(s.value?uni.navigateTo({url:a}):uni.navigateTo({url:"/pages/login/index"}));var a}},[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})])}}}),g=[{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 f=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:g}),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,a,n,s,i){return e.openBlock(),e.createElementBlock("text",{style:e.normalizeStyle(i.styleObj),class:e.normalizeClass(["uni-icons",["uniui-"+a.type,a.customPrefix,a.customPrefix?a.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 v=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,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-icons"),f);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)},[n.prefixIcon?(e.openBlock(),e.createBlock(l,{key:0,class:"content-clear-icon",type:n.prefixIcon,color:"#c0c4cc",onClick:a[0]||(a[0]=e=>r.onClickIcon("prefix")),size:"22"},null,8,["type"])):e.createCommentVNode("",!0),"textarea"===n.type?(e.openBlock(),e.createElementBlock("textarea",{key:1,class:e.normalizeClass(["uni-easyinput__content-textarea",{"input-padding":n.inputBorder}]),name:n.name,value:i.val,placeholder:n.placeholder,placeholderStyle:n.placeholderStyle,disabled:n.disabled,"placeholder-class":"uni-easyinput__placeholder-class",maxlength:r.inputMaxlength,focus:i.focused,autoHeight:n.autoHeight,"cursor-spacing":n.cursorSpacing,onInput:a[1]||(a[1]=(...e)=>r.onInput&&r.onInput(...e)),onBlur:a[2]||(a[2]=(...e)=>r._Blur&&r._Blur(...e)),onFocus:a[3]||(a[3]=(...e)=>r._Focus&&r._Focus(...e)),onConfirm:a[4]||(a[4]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:a[5]||(a[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"===n.type?"text":n.type,class:"uni-easyinput__content-input",style:e.normalizeStyle(r.inputStyle),name:n.name,value:i.val,password:!i.showPassword&&"password"===n.type,placeholder:n.placeholder,placeholderStyle:n.placeholderStyle,"placeholder-class":"uni-easyinput__placeholder-class",disabled:n.disabled,maxlength:r.inputMaxlength,focus:i.focused,confirmType:n.confirmType,"cursor-spacing":n.cursorSpacing,onFocus:a[6]||(a[6]=(...e)=>r._Focus&&r._Focus(...e)),onBlur:a[7]||(a[7]=(...e)=>r._Blur&&r._Blur(...e)),onInput:a[8]||(a[8]=(...e)=>r.onInput&&r.onInput(...e)),onConfirm:a[9]||(a[9]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:a[10]||(a[10]=(...e)=>r.onkeyboardheightchange&&r.onkeyboardheightchange(...e))},null,44,["type","name","value","password","placeholder","placeholderStyle","disabled","maxlength","focus","confirmType","cursor-spacing"])),"password"===n.type&&n.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"===n.type}]),type:i.showPassword?"eye-slash-filled":"eye-filled",size:22,color:i.focusShow?n.primaryColor:"#c0c4cc",onClick:r.onEyes},null,8,["class","type","color","onClick"])):e.createCommentVNode("",!0)],64)):n.suffixIcon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[n.suffixIcon?(e.openBlock(),e.createBlock(l,{key:0,class:"content-clear-icon",type:n.suffixIcon,color:"#c0c4cc",onClick:a[11]||(a[11]=e=>r.onClickIcon("suffix")),size:"22"},null,8,["type"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[n.clearable&&r.isVal&&!n.disabled&&"textarea"!==n.type?(e.openBlock(),e.createBlock(l,{key:0,class:e.normalizeClass(["content-clear-icon",{"is-textarea-icon":"textarea"===n.type}]),type:"clear",size:n.clearSize,color:r.msg?"#dd524d":i.focusShow?n.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 k=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:a,errShowType:n,validateCheck:s,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"===n&&(this.errMsg=h?h.errorMessage:""),"toast"===n&&uni.showToast({title:h.errorMessage||"校验错误",icon:"none"}),"modal"===n&&uni.showModal({title:"提示",content:h.errorMessage||"校验错误"})):this.errMsg="",s(h||null)):this.errMsg="",h||null},init(e=!1){const{validator:t,formRules:o,childrens:a,formData:n,localData:s,_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&&a.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,s))},unInit(){if(this.form){const{childrens:e,formData:t,_realName:o}=this.form;e.forEach(((e,a)=>{e===this&&(this.form.childrens.splice(a,1),delete t[o(e.name)])}))}},itemSetValue(e){const t=this.form._realName(this.name),o=this.itemRules.rules||[],a=this.form._getValue(t,e,o);return this.form._setDataValue(t,this.form.formData,a),a},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,a,n,s,i){return e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["uni-forms-item",["is-direction-"+s.localLabelPos,s.border?"uni-forms-item--border":"",s.border&&s.isFirstBorder?"is-first-border":""]])},[e.renderSlot(t.$slots,"label",{},(()=>[e.createElementVNode("view",{class:e.normalizeClass(["uni-forms-item__label",{"no-label":!a.label&&!a.required}]),style:e.normalizeStyle({width:s.localLabelWidth,justifyContent:s.localLabelAlign})},[a.required?(e.openBlock(),e.createElementBlock("text",{key:0,class:"is-required"},"*")):e.createCommentVNode("",!0),e.createElementVNode("text",null,e.toDisplayString(a.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/waybillNo/index",style:{navigationBarTitleText:"库位绑定","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"历史"}],backButton:{background:"#00FF00"}}}}},{path:"pages/waybillNo/waybillNoLog",style:{navigationBarTitleText:"录入历史"}},{path:"pages/waybillDeliveryOrder/index",style:{navigationBarTitleText:"派送单","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"筛选"}],backButton:{background:"#00FF00"}}}}},{path:"pages/waybillDeliveryOrder/orderInfo",style:{navigationBarTitleText:"派送详情"}},{path:"pages/printer/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}}(),a={},n=a.lib={},s=n.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=n.WordArray=s.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,a=this.sigBytes,n=e.sigBytes;if(this.clamp(),a%4)for(var s=0;s<n;s++){var i=o[s>>>2]>>>24-s%4*8&255;t[a+s>>>2]|=i<<24-(a+s)%4*8}else for(s=0;s<n;s+=4)t[a+s>>>2]=o[s>>>2];return this.sigBytes+=n,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=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var o,a=[],n=function(t){var o=987654321,a=4294967295;return function(){var n=((o=36969*(65535&o)+(o>>16)&a)<<16)+(t=18e3*(65535&t)+(t>>16)&a)&a;return n/=4294967296,(n+=.5)*(e.random()>.5?1:-1)}},s=0;s<t;s+=4){var r=n(4294967296*(o||e.random()));o=987654071*r(),a.push(4294967296*r()|0)}return new i.init(a,t)}}),r=a.enc={},l=r.Hex={stringify:function(e){for(var t=e.words,o=e.sigBytes,a=[],n=0;n<o;n++){var s=t[n>>>2]>>>24-n%4*8&255;a.push((s>>>4).toString(16)),a.push((15&s).toString(16))}return a.join("")},parse:function(e){for(var t=e.length,o=[],a=0;a<t;a+=2)o[a>>>3]|=parseInt(e.substr(a,2),16)<<24-a%8*4;return new i.init(o,t/2)}},c=r.Latin1={stringify:function(e){for(var t=e.words,o=e.sigBytes,a=[],n=0;n<o;n++){var s=t[n>>>2]>>>24-n%4*8&255;a.push(String.fromCharCode(s))}return a.join("")},parse:function(e){for(var t=e.length,o=[],a=0;a<t;a++)o[a>>>2]|=(255&e.charCodeAt(a))<<24-a%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=n.BufferedBlockAlgorithm=s.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,a=o.words,n=o.sigBytes,s=this.blockSize,r=n/(4*s),l=(r=t?e.ceil(r):e.max((0|r)-this._minBufferSize,0))*s,c=e.min(4*l,n);if(l){for(var u=0;u<l;u+=s)this._doProcessBlock(a,u);var d=a.splice(0,l);o.sigBytes-=c}return new i.init(d,c)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=d.extend({cfg:s.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=a.algo={};return a}(Math),o)})),S=b,x=(w((function(e,t){var o;e.exports=(o=S,function(e){var t=o,a=t.lib,n=a.WordArray,s=a.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=s.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var a=t+o,n=e[a];e[a]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var s=this._hash.words,i=e[t+0],l=e[t+1],m=e[t+2],p=e[t+3],g=e[t+4],f=e[t+5],y=e[t+6],v=e[t+7],k=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],N=e[t+15],E=s[0],T=s[1],D=s[2],V=s[3];E=c(E,T,D,V,i,7,r[0]),V=c(V,E,T,D,l,12,r[1]),D=c(D,V,E,T,m,17,r[2]),T=c(T,D,V,E,p,22,r[3]),E=c(E,T,D,V,g,7,r[4]),V=c(V,E,T,D,f,12,r[5]),D=c(D,V,E,T,y,17,r[6]),T=c(T,D,V,E,v,22,r[7]),E=c(E,T,D,V,k,7,r[8]),V=c(V,E,T,D,_,12,r[9]),D=c(D,V,E,T,w,17,r[10]),T=c(T,D,V,E,b,22,r[11]),E=c(E,T,D,V,S,7,r[12]),V=c(V,E,T,D,x,12,r[13]),D=c(D,V,E,T,C,17,r[14]),E=u(E,T=c(T,D,V,E,N,22,r[15]),D,V,l,5,r[16]),V=u(V,E,T,D,y,9,r[17]),D=u(D,V,E,T,b,14,r[18]),T=u(T,D,V,E,i,20,r[19]),E=u(E,T,D,V,f,5,r[20]),V=u(V,E,T,D,w,9,r[21]),D=u(D,V,E,T,N,14,r[22]),T=u(T,D,V,E,g,20,r[23]),E=u(E,T,D,V,_,5,r[24]),V=u(V,E,T,D,C,9,r[25]),D=u(D,V,E,T,p,14,r[26]),T=u(T,D,V,E,k,20,r[27]),E=u(E,T,D,V,x,5,r[28]),V=u(V,E,T,D,m,9,r[29]),D=u(D,V,E,T,v,14,r[30]),E=d(E,T=u(T,D,V,E,S,20,r[31]),D,V,f,4,r[32]),V=d(V,E,T,D,k,11,r[33]),D=d(D,V,E,T,b,16,r[34]),T=d(T,D,V,E,C,23,r[35]),E=d(E,T,D,V,l,4,r[36]),V=d(V,E,T,D,g,11,r[37]),D=d(D,V,E,T,v,16,r[38]),T=d(T,D,V,E,w,23,r[39]),E=d(E,T,D,V,x,4,r[40]),V=d(V,E,T,D,i,11,r[41]),D=d(D,V,E,T,p,16,r[42]),T=d(T,D,V,E,y,23,r[43]),E=d(E,T,D,V,_,4,r[44]),V=d(V,E,T,D,S,11,r[45]),D=d(D,V,E,T,N,16,r[46]),E=h(E,T=d(T,D,V,E,m,23,r[47]),D,V,i,6,r[48]),V=h(V,E,T,D,v,10,r[49]),D=h(D,V,E,T,C,15,r[50]),T=h(T,D,V,E,f,21,r[51]),E=h(E,T,D,V,S,6,r[52]),V=h(V,E,T,D,p,10,r[53]),D=h(D,V,E,T,w,15,r[54]),T=h(T,D,V,E,l,21,r[55]),E=h(E,T,D,V,k,6,r[56]),V=h(V,E,T,D,N,10,r[57]),D=h(D,V,E,T,y,15,r[58]),T=h(T,D,V,E,x,21,r[59]),E=h(E,T,D,V,g,6,r[60]),V=h(V,E,T,D,b,10,r[61]),D=h(D,V,E,T,m,15,r[62]),T=h(T,D,V,E,_,21,r[63]),s[0]=s[0]+E|0,s[1]=s[1]+T|0,s[2]=s[2]+D|0,s[3]=s[3]+V|0},_doFinalize:function(){var t=this._data,o=t.words,a=8*this._nDataBytes,n=8*t.sigBytes;o[n>>>5]|=128<<24-n%32;var s=e.floor(a/4294967296),i=a;o[15+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),o[14+(n+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=s.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,o,a,n,s,i){var r=e+(t&o|~t&a)+n+i;return(r<<s|r>>>32-s)+t}function u(e,t,o,a,n,s,i){var r=e+(t&a|o&~a)+n+i;return(r<<s|r>>>32-s)+t}function d(e,t,o,a,n,s,i){var r=e+(t^o^a)+n+i;return(r<<s|r>>>32-s)+t}function h(e,t,o,a,n,s,i){var r=e+(o^(t|~a))+n+i;return(r<<s|r>>>32-s)+t}t.MD5=s._createHelper(l),t.HmacMD5=s._createHmacHelper(l)}(Math),o.MD5)})),w((function(e,t){var o,a,n;e.exports=(a=(o=S).lib.Base,n=o.enc.Utf8,void(o.algo.HMAC=a.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var o=e.blockSize,a=4*o;t.sigBytes>a&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),i=this._iKey=t.clone(),r=s.words,l=i.words,c=0;c<o;c++)r[c]^=1549556828,l[c]^=909522486;s.sigBytes=i.sigBytes=a,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})),N=w((function(e,t){var o,a,n;e.exports=(n=(a=o=S).lib.WordArray,a.enc.Base64={stringify:function(e){var t=e.words,o=e.sigBytes,a=this._map;e.clamp();for(var n=[],s=0;s<o;s+=3)for(var i=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,r=0;r<4&&s+.75*r<o;r++)n.push(a.charAt(i>>>6*(3-r)&63));var l=a.charAt(64);if(l)for(;n.length%4;)n.push(l);return n.join("")},parse:function(e){var t=e.length,o=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var s=0;s<o.length;s++)a[o.charCodeAt(s)]=s}var i=o.charAt(64);if(i){var r=e.indexOf(i);-1!==r&&(t=r)}return function(e,t,o){for(var a=[],s=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;a[s>>>2]|=(r|l)<<24-s%4*8,s++}return n.create(a,s)}(e,t,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)}));const E="FUNCTION",T="pending",D="rejected";function V(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function I(e){return"object"===V(e)}function B(e){return"function"==typeof e}function A(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const P="REJECTED",L="NOT_PENDING";class O{constructor({createPromise:e,retryRule:t=P}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case P:return this.status===D;case L:return this.status!==T}}exec(){return this.needRetry?(this.status=T,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=D,Promise.reject(e)))),this.promise):this.promise}}function F(e){return e&&"string"==typeof e?JSON.parse(e):e}const M=F([]);F("");const R=F("[]")||[];let U="";try{U="__UNI__EE98A34"}catch(De){}let j={};function z(e,t={}){var o,a;return o=j,a=e,Object.prototype.hasOwnProperty.call(o,a)||(j[e]=t),j[e]}j=uni._globalUniCloudObj?uni._globalUniCloudObj:uni._globalUniCloudObj={};const $=["invoke","success","fail","complete"],q=z("_globalUniCloudInterceptor");function H(e,t){q[e]||(q[e]={}),I(t)&&Object.keys(t).forEach((o=>{$.indexOf(o)>-1&&function(e,t,o){let a=q[e][t];a||(a=q[e][t]=[]),-1===a.indexOf(o)&&B(o)&&a.push(o)}(e,o,t[o])}))}function W(e,t){q[e]||(q[e]={}),I(t)?Object.keys(t).forEach((o=>{$.indexOf(o)>-1&&function(e,t,o){const a=q[e][t];if(!a)return;const n=a.indexOf(o);n>-1&&a.splice(n,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=z("_globalUniCloudListener"),Q="response",Z="needLogin",X="refreshToken",ee="clientdb",te="cloudfunction",oe="cloudobject";function ae(e){return Y[e]||(Y[e]=[]),Y[e]}function ne(e,t){const o=ae(e);o.includes(t)||o.push(t)}function se(e,t){const o=ae(e),a=o.indexOf(t);-1!==a&&o.splice(a,1)}function ie(e,t){const o=ae(e);for(let a=0;a<o.length;a++)(0,o[a])(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 a=e[o];B(a)&&(t[o]=A(a))}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 me(e){return e&&me(e.__v_raw)||e}function pe(){return{token:he.getStorageSync("uni_id_token")||he.getStorageSync("uniIdToken"),tokenExpired:he.getStorageSync("uni_id_token_expired")}}function ge({token:e,tokenExpired:t}={}){e&&he.setStorageSync("uni_id_token",e),t&&he.setStorageSync("uni_id_token_expired",t)}let fe,ye;function ve(){return fe||(fe=uni.getSystemInfoSync()),fe}function ke(){let e,t;try{if(uni.getLaunchOptionsSync){if(uni.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:o,channel:a}=uni.getLaunchOptionsSync();e=a,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=ve(),{deviceId:o,osName:a,uniPlatform:n,appId:s}=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:n,OS:a,APPID:s,DEVICEID:o,...ke(),...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,a)=>{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",n=e.data&&e.data.error&&e.data.error.message||e.errMsg||"request:fail";return a(new de({code:o,message:n,requestId:t}))}const n=e.data;if(n.error)return a(new de({code:n.error.code,message:n.error.message,requestId:t}));n.result=n.data,n.requestId=t,delete n.data,o(n)}}))}))},xe=function(e){return N.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()}),a={"Content-Type":"application/json"};return"auth"!==t&&(o.token=this.accessToken,a["x-basement-token"]=this.accessToken),a["x-serverless-sign"]=be(o,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:o,dataType:"json",header:a}}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:a,fileType:n,onUploadProgress:s}){return new Promise(((i,r)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:o,filePath:a,fileType:n,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 s&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{s({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:a=!1,onUploadProgress:n,config:s}){if("string"!==V(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=s&&s.envType||this.config.envType;if(a&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new de({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const r=(await this.getOSSUploadOptionsFromPath({env:i,filename:a?t.split("/").pop():t,fileId:a?t:void 0})).result,l="https://"+r.cdnDomain+"/"+r.ossPath,{securityToken:c,accessKeyId:u,signature:d,host:h,ossPath:m,id:p,policy:g,ossCallbackUrl:f}=r,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:u,Signature:d,host:h,id:p,key:m,policy:g,success_action_status:200};if(c&&(y["x-oss-security-token"]=c),f){const e=JSON.stringify({callbackUrl:f,callbackBody:JSON.stringify({fileId:p,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=xe(e)}const v={url:"https://"+r.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:o};if(await this.uploadFileToOSS(Object.assign({},v,{onUploadProgress:n})),f)return{success:!0,filePath:e,fileID:l};if((await this.reportOSSUpload({id:p})).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}}},Ne={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 Te,De;(De=Te||(Te={})).local="local",De.none="none",De.session="session";var Ve=function(){},Ie=w((function(e,t){var o;e.exports=(o=S,function(e){var t=o,a=t.lib,n=a.WordArray,s=a.Hasher,i=t.algo,r=[],l=[];!function(){function t(t){for(var o=e.sqrt(t),a=2;a<=o;a++)if(!(t%a))return!1;return!0}function o(e){return 4294967296*(e-(0|e))|0}for(var a=2,n=0;n<64;)t(a)&&(n<8&&(r[n]=o(e.pow(a,.5))),l[n]=o(e.pow(a,1/3)),n++),a++}();var c=[],u=i.SHA256=s.extend({_doReset:function(){this._hash=new n.init(r.slice(0))},_doProcessBlock:function(e,t){for(var o=this._hash.words,a=o[0],n=o[1],s=o[2],i=o[3],r=o[4],u=o[5],d=o[6],h=o[7],m=0;m<64;m++){if(m<16)c[m]=0|e[t+m];else{var p=c[m-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,f=c[m-2],y=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[m]=g+c[m-7]+y+c[m-16]}var v=a&n^a&s^n&s,k=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),_=h+((r<<26|r>>>6)^(r<<21|r>>>11)^(r<<7|r>>>25))+(r&u^~r&d)+l[m]+c[m];h=d,d=u,u=r,r=i+_|0,i=s,s=n,n=a,a=_+(k+v)|0}o[0]=o[0]+a|0,o[1]=o[1]+n|0,o[2]=o[2]+s|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,a=8*this._nDataBytes,n=8*t.sigBytes;return o[n>>>5]|=128<<24-n%32,o[14+(n+64>>>9<<4)]=e.floor(a/4294967296),o[15+(n+64>>>9<<4)]=a,t.sigBytes=4*o.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=s._createHelper(u),t.HmacSHA256=s._createHmacHelper(u)}(Math),o.SHA256)})),Be=Ie,Ae=w((function(e,t){e.exports=S.HmacSHA256}));const Pe=()=>{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,a)=>e?o(e):t(a)}));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 Me={adapter:null,runtime:void 0},Re=["anonymousUuidKey"];class Ue extends Ve{constructor(){super(),Me.adapter.root.tcbObject||(Me.adapter.root.tcbObject={})}setItem(e,t){Me.adapter.root.tcbObject[e]=t}getItem(e){return Me.adapter.root.tcbObject[e]}removeItem(e){delete Me.adapter.root.tcbObject[e]}clear(){delete Me.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 ze{constructor(e){if(!this._storage){this._persistence=Me.adapter.primaryStorage||e.persistence,this._storage=je(this._persistence,Me.adapter);const t=`access_token_${e.env}`,o=`access_token_expire_${e.env}`,a=`refresh_token_${e.env}`,n=`anonymous_uuid_${e.env}`,s=`login_type_${e.env}`,i=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:o,refreshTokenKey:a,anonymousUuidKey:n,loginTypeKey:s,userInfoKey:i}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const o=je(e,Me.adapter);for(const a in this.keys){const e=this.keys[a];if(t&&Re.includes(a))continue;const n=this._storage.getItem(e);Le(n)||Oe(n)||(o.setItem(e,n),this._storage.removeItem(e))}this._storage=o}setStore(e,t,o){if(!this._storage)return;const a={version:o||"localCachev1",content:t},n=JSON.stringify(a);try{this._storage.setItem(e,n)}catch(s){throw s}}getStore(e,t){try{if(!this._storage)return}catch(a){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 $e={},qe={};function He(e){return $e[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,a=t,(n=this._listeners)[o]=n[o]||[],n[o].push(a),this;var o,a,n}off(e,t){return function(e,t,o){if(o&&o[e]){const a=o[e].indexOf(t);-1!==a&&o[e].splice(a,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,a=o.name;if(this._listens(a)){o.target=this;const e=this._listeners[a]?[...this._listeners[a]]:[];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 at;!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL"}(at||(at={}));const nt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],st={"X-SDK-Version":"1.3.5"};function it(e,t,o){const a=e[t];e[t]=function(t){const n={},s={};o.forEach((o=>{const{data:a,headers:i}=o.call(e,t);Object.assign(n,a),Object.assign(s,i)}));const i=t.data;return i&&(()=>{var e;if(e=i,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...i,...n};else for(const t in n)i.append(t,n[t])})(),t.headers={...t.headers||{},...s},a.call(e,t)}}function rt(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...st,"x-seqid":e}}}class lt{constructor(e={}){var t;this.config=e,this._reqClass=new Me.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:a,anonymousUuidKey:n}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let s=this._cache.getStore(o);if(!s)throw new de({message:"未登录CloudBase"});const i={refresh_token:s},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(a)===at.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(n),t=this._cache.getStore(o),a=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(a.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 a=this._cache.getStore(e),n=this._cache.getStore(t),s=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(a,n))&&(s=!1),(!a||!n||n<Date.now())&&s?this.refreshAccessToken():{accessToken:a,accessTokenExpire:n}}async request(e,t,o){const a=`x-tcb-trace_${this.config.env}`;let n="application/x-www-form-urlencoded";const s={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===nt.indexOf(e)){const{refreshTokenKey:e}=this._cache.keys;this._cache.getStore(e)&&(s.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,s[e]);n="multipart/form-data"}else{n="application/json",i={};for(let e in s)void 0!==s[e]&&(i[e]=s[e])}let r={headers:{"content-type":n}};o&&o.onUploadProgress&&(r.onUploadProgress=o.onUploadProgress);const l=this._localCache.getStore(a);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 m=function(e,t,o={}){const a=/\?/.test(t);let n="";for(let s in o)""===n?!a&&(t+="?"):n+="&",n+=`${s}=${encodeURIComponent(o[s])}`;return/^http(s)?\:\/\//.test(t+=n)?t:`${e}${t}`}(Ee,"//tcb-api.tencentcloudapi.com/web",h);d&&(m+=d);const p=await this.post({url:m,data:i,...r}),g=p.header&&p.header["x-tcb-trace"];if(g&&this._localCache.setStore(a,g),200!==Number(p.status)&&200!==Number(p.statusCode)||!p.data)throw new de({code:"NETWORK_ERROR",message:"network request error"});return p}async send(e,t={}){const o=await this.request(e,t,{onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===o.data.code&&-1===nt.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:a}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(o),this._cache.setStore(a,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:a}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(o),this._cache.setStore(a,e)}setAccessToken(e,t){const{accessTokenKey:o,accessTokenExpireKey:a}=this._cache.keys;this._cache.setStore(o,e),this._cache.setStore(a,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:a,province:n,country:s,city:i}=e,{data:r}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:o,avatarUrl:a,province:n,country:s,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 mt{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:a}=this._cache.keys,n=this._cache.getStore(t),s=this._cache.getStore(o),i=this._cache.getStore(a);this.credential={refreshToken:n,accessToken:s,accessTokenExpire:i},this.user=new ht(e)}get isAnonymousAuth(){return this.loginType===at.ANONYMOUS}get isCustomAuth(){return this.loginType===at.CUSTOM}get isWeixinAuth(){return this.loginType===at.WECHAT||this.loginType===at.WECHAT_OPEN||this.loginType===at.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class pt extends dt{async signIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,o=this._cache.getStore(e)||void 0,a=this._cache.getStore(t)||void 0,n=await this._request.send("auth.signInAnonymously",{anonymous_uuid:o,refresh_token:a});if(n.uuid&&n.refresh_token){this._setAnonymousUUID(n.uuid),this.setRefreshToken(n.refresh_token),await this._request.refreshAccessToken(),Ye(Ze),Ye(et,{env:this.config.env,loginType:at.ANONYMOUS,persistence:"local"});const e=new mt(this.config.env);return await e.user.refresh(),e}throw new de({message:"匿名登录失败"})}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:o}=this._cache.keys,a=this._cache.getStore(t),n=this._cache.getStore(o),s=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:a,refresh_token:n,ticket:e});if(s.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(s.refresh_token),await this._request.refreshAccessToken(),Ye(tt,{env:this.config.env}),Ye(et,{loginType:at.CUSTOM,persistence:"local"}),{credential:{refreshToken:s.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,at.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class gt 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:at.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new mt(this.config.env);throw new de({message:"自定义登录失败"})}}class ft 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,a=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(o)||""}),{refresh_token:n,access_token:s,access_token_expire:i}=a;if(n)return this.setRefreshToken(n),s&&i?this.setAccessToken(s,i):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ye(Ze),Ye(et,{env:this.config.env,loginType:at.EMAIL,persistence:this.config.persistence}),new mt(this.config.env);throw a.code?new de({code:a.code,message:`邮箱登录失败: ${a.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,a=await this._request.send("auth.signIn",{loginType:at.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(o)||""}),{refresh_token:n,access_token_expire:s,access_token:i}=a;if(n)return this.setRefreshToken(n),i&&s?this.setAccessToken(i,s):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ye(Ze),Ye(et,{env:this.config.env,loginType:at.USERNAME,persistence:this.config.persistence}),new mt(this.config.env);throw a.code?new de({code:a.code,message:`用户名密码登录失败: ${a.message}`}):new de({message:"用户名密码登录失败"})}}class vt{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 pt(this.config)}customAuthProvider(){return new gt(this.config)}emailAuthProvider(){return new ft(this.config)}usernameAuthProvider(){return new yt(this.config)}async signInAnonymously(){return new pt(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new ft(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 pt(this.config)),Ge(tt,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===at.ANONYMOUS)throw new de({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:o}=this._cache.keys,a=this._cache.getStore(e);if(!a)return;const n=await this._request.send("auth.logout",{refresh_token:a});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(o),Ye(Ze),Ye(et,{env:this.config.env,loginType:at.NULL,persistence:this.config.persistence}),n}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 mt(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 gt(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:a}=e.data;a===this.config.env&&(this._cache.updatePersistence(o),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const kt=function(e,t){t=t||Pe();const o=ut(this.config.env),{cloudPath:a,filePath:n,onUploadProgress:s,fileType:i="image"}=e;return o.send("storage.getUploadMetadata",{path:a}).then((e=>{const{data:{url:r,authorization:l,token:c,fileId:u,cosFileId:d},requestId:h}=e,m={key:a,signature:l,"x-cos-meta-fileid":d,success_action_status:"201","x-cos-security-token":c};o.upload({url:r,data:m,file:n,name:a,fileType:i,onUploadProgress:s}).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||Pe();const o=ut(this.config.env),{cloudPath:a}=e;return o.send("storage.getUploadMetadata",{path:a}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},wt=function({fileList:e},t){if(t=t||Pe(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let a of e)if(!a||"string"!=typeof a)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||Pe(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let o=[];for(let n of e)"object"==typeof n?(n.hasOwnProperty("fileID")&&n.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),o.push({fileid:n.fileID,max_age:n.maxAge})):"string"==typeof n?o.push({fileid:n}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const a={file_list:o};return ut(this.config.env).send("storage.batchGetDownloadUrl",a).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 a=ut(this.config.env);let n=o.download_url;if(n=encodeURI(n),!t)return a.download({url:n});t(await a.download({url:n}))},xt=function({name:e,data:t,query:o,parse:a,search:n},s){const i=s||Pe();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:a,search:n,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(a)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"},Nt={};class Et{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(Me.adapter||(this.requestClient=new Me.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||Me.adapter.primaryStorage||Ct.persistence;var o;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;$e[t]=new ze(e),qe[t]=new ze({...e,persistence:"local"})}(this.config),o=this.config,ct[o.env]=new lt(o),this.authObj=new vt(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 kt.apply(this,[e,t])}getUploadMetadata(e,t){return _t.apply(this,[e,t])}registerExtension(e){Nt[e.name]=e}async invokeExtension(e,t){const o=Nt[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 a of t){const{isMatch:e,genAdapter:t,runtime:o}=a;if(e())return{adapter:t(),runtime:o}}}(e)||{};t&&(Me.adapter=t),o&&(Me.runtime=o)}}var Tt=new Et;function Dt(e,t,o){void 0===o&&(o={});var a=/\?/.test(t),n="";for(var s in o)""===n?!a&&(t+="?"):n+="&",n+=s+"="+encodeURIComponent(o[s]);return/^http(s)?:\/\//.test(t+=n)?t:""+e+t}class Vt{post(e){const{url:t,data:o,headers:a}=e;return new Promise(((e,n)=>{he.request({url:Dt("https:",t),data:o,method:"POST",header:a,success(t){e(t)},fail(e){n(e)}})}))}upload(e){return new Promise(((t,o)=>{const{url:a,file:n,data:s,headers:i,fileType:r}=e,l=he.uploadFile({url:Dt("https:",a),name:"file",formData:Object.assign({},s),filePath:n,fileType:r,header:i,success(e){const o={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&s.success_action_status&&(o.statusCode=parseInt(s.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 It={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:Vt,localStorage:It,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};Tt.useAdapters(Bt);const At=Tt,Pt=At.init;At.init=function(e){e.env=e.spaceId;const t=Pt.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:a,complete:n}=ue(e);if(!(t||a||n))return o.call(this,e);o.call(this,e).then((e=>{t&&t(e),n&&n(e)}),(e=>{a&&a(e),n&&n(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var Lt=At,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()}),a={"Content-Type":"application/json"};"auth"!==t&&(o.token=this.accessToken,a["x-basement-token"]=this.accessToken),a["x-serverless-sign"]=be(o,this.config.clientSecret);const n=we();a["x-client-info"]=encodeURIComponent(JSON.stringify(n));const{token:s}=pe();return a["x-client-token"]=s,{url:this.config.requestUrl,method:"POST",data:o,dataType:"json",header:JSON.parse(JSON.stringify(a))}}uploadFileToOSS({url:e,formData:t,name:o,filePath:a,fileType:n,onUploadProgress:s}){return new Promise(((i,r)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:o,filePath:a,fileType:n,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 s&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{s({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}uploadFile({filePath:e,cloudPath:t,fileType:o="image",onUploadProgress:a}){if(!t)throw new de({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let n;return this.getOSSUploadOptionsFromPath({cloudPath:t}).then((t=>{const{url:s,formData:i,name:r}=t.result;n=t.result.fileUrl;const l={url:s,formData:i,name:r,filePath:e,fileType:o};return this.uploadFileToOSS(Object.assign({},l,{onUploadProgress:a}))})).then((()=>this.reportOSSUpload({cloudPath:t}))).then((t=>new Promise(((o,a)=>{t.success?o({success:!0,filePath:e,fileID:n}):a(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}},Mt=w((function(e,t){e.exports=S.enc.Hex}));function Rt(){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:a,method:n,headers:s,signHeaderKeys:i=[],config:r}=t,l=Date.now(),c=Rt(),u=Object.assign({},s,{"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":a,"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="",m=""]=e.split("?")||[],p=function(e){const t=e.signedHeaders.join(";"),o=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),a=Be(e.body).toString(Mt),n=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${o}\n${t}\n${a}\n`,s=Be(n).toString(Mt),i=`HMAC-SHA256\n${e.timestamp}\n${s}\n`,r=Ae(i,e.secretKey).toString(Mt);return`HMAC-SHA256 Credential=${e.secretId}, SignedHeaders=${t}, Signature=${r}`}({path:h,query:m,method:n,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:p})}}function jt({url:e,data:t,method:o="POST",headers:a={}}){return new Promise(((n,s)=>{he.request({url:e,method:o,data:"object"==typeof t?JSON.stringify(t):t,header:a,dataType:"json",complete:(e={})=>{const t=a["x-trace-id"]||"";if(!e.statusCode||e.statusCode>=400){const{message:o,errMsg:a,trace_id:n}=e.data||{};return s(new de({code:"SYS_ERR",message:o||a||"request:fail",requestId:n||t}))}n({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function zt(e,t){const{path:o,data:a,method:n="GET"}=e,{url:s,headers:i}=Ut(o,{functionName:"",data:a,method:n,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:s,data:a,method:n,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 $t(e=""){const t=e.trim().replace(/^cloud:\/\//,""),o=t.indexOf("/");if(o<=0)throw new de({code:"INVALID_PARAM",message:"fileID不合法"});const a=t.substring(0,o),n=t.substring(o+1);return a!==this.config.spaceId&&console.warn("file ".concat(e," does not belong to env ").concat(this.config.spaceId)),n}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}`,a=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),n=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:Rt(),timestamp:""+Date.now()}),s=[o,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map((function(e){return n[e]?"".concat(e,"=").concat(n[e]):null})).filter(Boolean).join("&"),`host:${a}`].join("\n"),i=["HMAC-SHA256",Be(s).toString(Mt)].join("\n"),r=Ae(i,this.config.secretKey).toString(Mt),l=Object.keys(n).map((e=>`${e}=${encodeURIComponent(n[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:a,async:n=!1}=e,s="POST",i={"x-to-function-name":o};n&&(i["x-function-invoke-type"]="async");const{url:r,headers:l}=Ut("/functions/invokeFunction",{functionName:o,data:a,method:s,headers:i,signHeaderKeys:["x-to-function-name"],config:t});return jt({url:r,data:a,method:s,headers:l}).then((e=>{let t=0;if(n){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:a,onUploadProgress:n}){return new Promise(((s,i)=>{const r=he.uploadFile({url:e,filePath:t,fileType:o,formData:a,name:"file",success(e){e&&e.statusCode<400?s(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 n&&r&&"function"==typeof r.onProgressUpdate&&r.onProgressUpdate((e=>{n({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}async uploadFile({filePath:e,cloudPath:t="",fileType:o="image",onUploadProgress:a}){if("string"!==V(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 n=await zt({path:"/".concat(t.replace(/^\//,""),"?post_url")},this.config),{file_id:s,upload_url:i,form_data:r}=n,l=r&&r.reduce(((e,t)=>(e[t.key]=t.value,e)),{});return this.uploadFileToOSS({url:i,filePath:e,fileType:o,formData:l,onUploadProgress:a}).then((()=>({fileID:s})))}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 a=[];for(const n of e){"string"!==V(n)&&o(new de({errCode:"INVALID_PARAM",errMsg:"fileList的元素必须是非空的字符串"}));const e=$t.call(this,n);a.push({file_id:e,expire:600})}zt({path:"/?download_url",data:{file_list:a},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}=pe();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((a=t)&&Yt.test(a)?a.replace(Gt,"\\$&"):a,"g"),o);var a}const Zt=2e4,Xt={code:20101,message:"Invalid client"};function eo(e){const{errSubject:t,subject:o,errCode:a,errMsg:n,code:s,message:i,cause:r}=e||{};return new de({subject:t||o||"uni-secure-network",code:a||s||Zt,message:n||i,cause:r})}let to;function oo({secretType:e}={}){return"request"===e||"response"===e||"both"===e}function ao({name:e,data:t={}}={}){return"DCloud-clientDB"===e&&"encryption"===t.redirectTo&&"getAppClientKey"===t.action}function no({functionName:e,result:t,logPvd:o}){}function so(e){const t=e.callFunction,o=function(o){const a=o.name;o.data=Jt.call(e,{data:o.data});const n={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay"}[this.config.provider],s=oo(o),i=ao(o),r=s||i;return t.call(this,o).then((e=>(e.errCode=0,!r&&no.call(this,{functionName:a,result:e,logPvd:n}),Promise.resolve(e))),(e=>(!r&&no.call(this,{functionName:a,result:e,logPvd:n}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:o=[]}={}){for(let a=0;a<o.length;a++){const{rule:n,content:s,mode:i}=o[a],r=e.match(n);if(!r)continue;let l=s;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:a}})),Promise.reject(e))))};e.callFunction=function(t){const{provider:a,spaceId:n}=e.config,s=t.name;let i,r;return t.data=t.data||{},i=o,i=i.bind(e),r=ao(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:a,uniPlatform:n,osName:s}=ve();let i=n;"app"===n&&(i=s);const r=function({provider:e,spaceId:t}={}){const o=M;if(!o)return{};e=function(e){return"tencent"===e?"tcb":e}(e);const a=o.find((o=>o.provider===e&&o.spaceId===t));return a&&a.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,a,n;for(let s=0;s<e.length;s++){const i=e[s];i!==t?"*"!==i?i.split(",").map((e=>e.trim())).indexOf(t)>-1&&(a=i):n=i:o=i}return o||a||n}(c,o);if(!u)return!1;if((l[u]||[]).find(((e={})=>e.appId===a&&(e.platform||"").toLowerCase()===i.toLowerCase())))return!0;throw console.error(`此应用[appId: ${a}, platform: ${i}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),eo(Xt)}({provider:a,spaceId:n,functionName:s})?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,a){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,a)}})}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 a=e[t].indexOf(o);-1!==a&&e[t].splice(a,1)}}}const co=["db.Geo","db.command","command.aggregate"];function uo(e,t){return co.indexOf(`${e}.${t}`)>-1}function ho(e){switch(V(e=me(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 mo(e){return e&&e.content&&e.content.$method}class po{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=mo(e),o=mo(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"===mo(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=mo(e),o=mo(e.prevStage);if("aggregate"===t&&"command"===o)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return go({$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(),a=this.getCommand();return a.$db.push({$method:e,$param:ho(t)}),this._database._callCloudFunction({action:o,command:a})}}function go(e,t,o){return ro(new po(e,t,o),{get(e,t){let a="db";return e&&e.content&&(a=e.content.$method),uo(a,t)?go({$method:t},e,o):function(){return go({$method:t,$param:ho(Array.from(arguments))},e,o)}}})}function fo({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)?go({$method:t},null,e):function(){return go({$method:t,$param:ho(Array.from(arguments))},null,e)}})}class vo extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=z("_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)=>fo({path:["Geo"],method:t})}),this.serverDate=fo({path:[],method:"serverDate"}),this.RegExp=fo({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:a}){function n(e,t){if(o&&a)for(let o=0;o<a.length;o++){const n=a[o];n.udb&&"function"==typeof n.udb.setResult&&(t?n.udb.setResult(t):n.udb.setResult(e.result.dataList[o]))}}const s=this,i=this._isJQL?"databaseForJQL":"database";function r(e){return s._callback("error",[e]),J(K(i,"fail"),e).then((()=>J(K(i,"complete"),e))).then((()=>(n(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:a,tokenExpired:l,systemInfo:c=[]}=e.result;if(c)for(let n=0;n<c.length;n++){const{level:e,message:t,detail:o}=c[n],a=console["warn"===e?"error":e]||console.log;let s="[System Info]"+t;o&&(s=`${s}\n详细信息:${o}`),a(s)}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,a&&l&&(ge({token:a,tokenExpired:l}),this._callbackAuth("refreshToken",[{token:a,tokenExpired:l}]),this._callback("refreshToken",[{token:a,tokenExpired:l}]),ie(X,{token:a,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 n=0;n<u.length;n++){const{prop:t,tips:o}=u[n];if(t in e.result){const a=e.result[t];Object.defineProperty(e.result,t,{get:()=>(console.warn(o),a)})}}return d=e,J(K(i,"success"),d).then((()=>J(K(i,"complete"),d))).then((()=>{n(d,null);const e=s._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 ko="token无效,跳转登录页面",_o="token过期,跳转登录页面",wo={TOKEN_INVALID_TOKEN_EXPIRED:_o,TOKEN_INVALID_INVALID_CLIENTID:ko,TOKEN_INVALID:ko,TOKEN_INVALID_WRONG_TOKEN:ko,TOKEN_INVALID_ANONYMOUS_USER:ko},bo={"uni-id-token-expired":_o,"uni-id-check-token-failed":ko,"uni-id-token-not-exist":ko,"uni-id-check-device-feature-failed":ko};function So(e,t){let o="";return o=e?`${e}/${t}`:t,o.replace(/^\//,"")}function xo(e=[],t=""){const o=[],a=[];return e.forEach((e=>{!0===e.needLogin?o.push(So(t,e.path)):!1===e.needLogin&&a.push(So(t,e.path))})),{needLoginPage:o,notNeedLoginPage:a}}function Co(e){return e.split("?")[0].replace(/^\//,"")}function No(){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(No())}function To(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const o=t.list,a=Co(e);return o.some((e=>e.pagePath===a))}const Do=!!_.uniIdRouter,{loginPage:Vo,routerNeedLogin:Io,resToLogin:Bo,needLoginPage:Ao,notNeedLoginPage:Po,loginPageInTabBar:Lo}=function({pages:e=[],subPackages:t=[],uniIdRouter:o={},tabBar:a={}}=_){const{loginPage:n,needLogin:s=[],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:a,pages:n=[]}=e,{needLoginPage:s,notNeedLoginPage:i}=xo(n,a);t.push(...s),o.push(...i)})),{needLoginPage:t,notNeedLoginPage:o}}(t);return{loginPage:n,routerNeedLogin:s,resToLogin:i,needLoginPage:[...r,...c],notNeedLoginPage:[...l,...u],loginPageInTabBar:To(n,a)}}();if(Ao.indexOf(Vo)>-1)throw new Error(`Login page [${Vo}] should not be "needLogin", please check your pages.json`);function Oo(e){const t=Eo();if("/"===e.charAt(0))return e;const[o,a]=e.split("?"),n=o.replace(/^\//,"").split("/"),s=t.split("/");s.pop();for(let i=0;i<n.length;i++){const e=n[i];".."===e?s.pop():"."!==e&&s.push(e)}return""===s[0]&&s.shift(),"/"+s.join("/")+(a?"?"+a:"")}function Fo({redirect:e}){const t=Co(e),o=Co(Vo);return Eo()!==o&&t!==o}function Mo({api:e,redirect:t}={}){if(!t||!Fo({redirect:t}))return;const o=(n=t,"/"!==(a=Vo).charAt(0)&&(a="/"+a),n?a.indexOf("?")>-1?a+`&uniIdRedirectUrl=${encodeURIComponent(n)}`:a+`?uniIdRedirectUrl=${encodeURIComponent(n)}`:a);var a,n;Lo?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo");const s={navigateTo:uni.navigateTo,redirectTo:uni.redirectTo,switchTab:uni.switchTab,reLaunch:uni.reLaunch};setTimeout((()=>{s[e]({url:o})}),0)}function Ro({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},o=function(){const{token:e,tokenExpired:t}=pe();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!(Po.indexOf(t)>-1)&&(Ao.indexOf(t)>-1||Io.some((t=>{return o=e,new RegExp(t).test(o);var o})))}(e)&&o){if(o.uniIdRedirectUrl=e,ae(Z).length>0)return setTimeout((()=>{ie(Z,o)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function Uo(){!function(){const e=No(),{abortLoginPageJump:t,autoToLoginPage:o}=Ro({url:e});t||o&&Mo({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:a}=Ro({url:e.url});return t?e:a?(Mo({api:o,redirect:Oo(e.url)}),!1):e}})}}function jo(){this.onResponse((e=>{const{type:t,content:o}=e;let a=!1;switch(t){case"cloudobject":a=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in bo}(o);break;case"clientdb":a=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in wo}(o)}a&&function(e={}){const t=ae(Z);ce().then((()=>{const o=No();if(o&&Fo({redirect:o}))return t.length>0?ie(Z,Object.assign({uniIdRedirectUrl:o},e)):void(Vo&&Mo({api:"navigateTo",redirect:o}))}))}(o)}))}function zo(e){var t;(t=e).onResponse=function(e){ne(Q,e)},t.offResponse=function(e){se(Q,e)},function(e){e.onNeedLogin=function(e){ne(Z,e)},e.offNeedLogin=function(e){se(Z,e)},Do&&(z("_globalUniCloudStatus").needLoginInit||(z("_globalUniCloudStatus").needLoginInit=!0,ce().then((()=>{Uo.call(e)})),Bo&&jo.call(e)))}(e),function(e){e.onRefreshToken=function(e){ne(X,e)},e.offRefreshToken=function(e){se(X,e)}}(e)}let $o;const qo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ho=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Wo(){const e=pe().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let o;try{o=JSON.parse((a=t[1],decodeURIComponent($o(a).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(n){throw new Error("获取当前用户信息出错,详细错误信息为:"+n.message)}var a;return o.tokenExpired=1e3*o.exp,delete o.exp,delete o.iat,o}$o="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,a,n="",s=0;s<e.length;)t=qo.indexOf(e.charAt(s++))<<18|qo.indexOf(e.charAt(s++))<<12|(o=qo.indexOf(e.charAt(s++)))<<6|(a=qo.indexOf(e.charAt(s++))),n+=64===o?String.fromCharCode(t>>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return n}: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",a="chooseAndUploadFile:fail";function n(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 s(e,t,{onChooseFile:a,onUploadProgress:n}){return t.then((e=>{if(a){const t=a(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,a=5,n){(t=Object.assign({},t)).errMsg=o;const s=t.tempFiles,i=s.length;let r=0;return new Promise((o=>{for(;r<a;)l();function l(){const a=r++;if(a>=i)return void(!s.find((e=>!e.url&&!e.errMsg))&&o(t));const c=s[a];e.uploadFile({provider:c.provider,filePath:c.path,cloudPath:c.cloudPath,fileType:c.fileType,cloudPathAsRealPath:c.cloudPathAsRealPath,onUploadProgress(e){e.index=a,e.tempFile=c,e.tempFilePath=c.path,n&&n(e)}}).then((e=>{c.url=e.fileID,a<i&&l()})).catch((e=>{c.errMsg=e.errMsg||e.message,a<i&&l()}))}}))}(e,t,5,n)))}t.initChooseAndUploadFile=function(e){return function(t={type:"all"}){return"image"===t.type?s(e,function(e){const{count:t,sizeType:o,sourceType:s=["album","camera"],extension:i}=e;return new Promise(((e,r)=>{uni.chooseImage({count:t,sizeType:o,sourceType:s,extension:i,success(t){e(n(t,"image"))},fail(e){r({errMsg:e.errMsg.replace("chooseImage:fail",a)})}})}))}(t),t):"video"===t.type?s(e,function(e){const{camera:t,compressed:o,maxDuration:s,sourceType:i=["album","camera"],extension:r}=e;return new Promise(((e,l)=>{uni.chooseVideo({camera:t,compressed:o,maxDuration:s,sourceType:i,extension:r,success(t){const{tempFilePath:o,duration:a,size:s,height:i,width:r}=t;e(n({errMsg:"chooseVideo:ok",tempFilePaths:[o],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:o,size:s,type:t.tempFile&&t.tempFile.type||"",width:r,height:i,duration:a,fileType:"video",cloudPath:""}]},"video"))},fail(e){l({errMsg:e.errMsg.replace("chooseVideo:fail",a)})}})}))}(t),t):s(e,function(e){const{count:t,extension:o}=e;return new Promise(((e,s)=>{let i=uni.chooseFile;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(i=wx.chooseMessageFile),"function"!=typeof i)return s({errMsg:a+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});i({type:"all",count:t,extension:o,success(t){e(n(t))},fail(e){s({errMsg:e.errMsg.replace("chooseFile:fail",a)})}})}))}(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 a=[];for(let n=2;n<e.length;n++)e[n]!==t[n]&&(a.push(e[n]),o=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(o,a)}))},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:a,count:n}=o.result;this.getcount&&(this.mixinDatacomPage.count=n),this.mixinDatacomHasMore=a.length<this.pageSize;const s=e?a.length?a[0]:void 0:a;this.mixinDatacomResData=s,t&&t(s)})).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 a=t.action||this.action;a&&(o=o.action(a));const n=t.collection||this.collection;o=Array.isArray(n)?o.collection(...n):o.collection(n);const s=t.where||this.where;s&&Object.keys(s).length&&(o=o.where(s));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,m=void 0!==t.getcount?t.getcount:this.getcount,p=void 0!==t.gettree?t.gettree:this.gettree,g=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,f={getCount:m},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return p&&(f.getTree=y),g&&(f.getTreePath=y),o=o.skip(h*(d-1)).limit(h).get(f),o}}}}function Go(e){return z("_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(((a,n)=>{t[e]({...o,success(e){a(e)},fail(e){n(e)}})}))}}class ea 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 a=function(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]===t)return o;return-1}(o,t);o.splice(a,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 a=0;a<o.length;a++)o[a](...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:a,message:n}=t;this._payloadQueue.push({action:o,messageId:a,message:n}),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:a}=e;"end"===t?this._end({messageId:o,message:a}):"message"===t&&this._appendMessage({messageId:o,message:a})}_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 ta={tcb:Lt,tencent:Lt,aliyun:Ne,private:Ft,alipay:Wt};let oa=new class{init(e){let t={};const o=ta[e.provider];if(!o)throw new Error("未提供正确的provider参数");var a;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),so(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(a=t).database=function(e){if(e&&Object.keys(e).length>0)return a.init(e).database();if(this._database)return this._database;const t=yo(vo,{uniClient:a});return this._database=t,t},a.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return a.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=yo(vo,{uniClient:a,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=ea,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,a={}){a=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}},a);const{customUI:n,loadingOptions:s,errorOptions:i,parseSystemError:r}=a,l=!n;return new Proxy({},{get(n,c){switch(c){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:e,interceptorName:t,getCallbackArgs:o}={}){return async function(...a){const n=o?o({params:a}):{};let s,i;try{return await J(K(t,"invoke"),{...n}),s=await e(...a),await J(K(t,"success"),{...n,result:s}),s}catch(r){throw i=r,await J(K(t,"fail"),{...n,error:i}),i}finally{await J(K(t,"complete"),i?{...n,error:i}:{...n,result:s})}}}({fn:async function n(...u){let d;l&&uni.showLoading({title:s.title,mask:s.mask});const h={name:o,type:"OBJECT",data:{method:c,params:u}};"object"==typeof a.secretMethods&&function(e,t){const o=t.data.method,a=e.secretMethods||{},n=a[o]||a["*"];n&&(t.secretType=n)}(a,h);let m=!1;try{d=await t.callFunction(h)}catch(e){m=!0,d={result:new de(e)}}const{errSubject:p,errCode:g,errMsg:f,newToken:y}=d.result||{};if(l&&uni.hideLoading(),y&&y.token&&y.tokenExpired&&(ge(y),ie(X,{...y})),g){let e=f;if(m&&r&&(e=(await r({objectName:o,methodName:c,params:u,errSubject:p,errCode:g,errMsg:f})).errMsg||f),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:a,confirmText:n}={}){return new Promise(((s,i)=>{uni.showModal({title:e,content:t,showCancel:o,cancelText:a,confirmText:n,success(e){s(e)},fail(){s({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:i.retry,cancelText:"取消",confirmText:i.retry?"重试":"确定"});if(i.retry&&t)return n(...u)}}const t=new de({subject:p,code:g,message:f,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 a=!1;if("callFunction"===t){const e=o&&o.type||E;a=e!==E}const n="callFunction"===t&&!a,s=this._initPromiseHub.exec();o=o||{};const{success:i,fail:r,complete:l}=ue(o),c=s.then((()=>a?Promise.resolve():J(K(t,"invoke"),o))).then((()=>e.call(this,o))).then((e=>a?Promise.resolve(e):J(K(t,"success"),e).then((()=>J(K(t,"complete"),e))).then((()=>(n&&ie(Q,{type:te,content:e}),Promise.resolve(e))))),(e=>a?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),n&&ie(Q,{type:te,content:e})}),(e=>{r&&r(e),l&&l(e),n&&ie(Q,{type:te,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=R;let t={};if(e&&1===e.length)t=e[0],oa=oa.init(t),oa._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=>{oa[e]=function(){return console.error(o),Promise.reject(new de({code:"SYS_ERR",message:o}))}}))}Object.assign(oa,{get mixinDatacom(){return Ko(oa)}}),zo(oa),oa.addInterceptor=H,oa.removeInterceptor=W,oa.interceptObject=G})();var aa=oa;const na=u({name:"uni-data-select",mixins:[aa.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(...a){o&&clearTimeout(o),o=setTimeout((()=>{e.apply(this,a)}),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:a}=e;if(a=a?`(${a})`:"",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||`未命名${a}`},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,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-icons"),f);return e.openBlock(),e.createElementBlock("view",{class:"uni-stat__select"},[n.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:"uni-label-text hide-on-phone"},e.toDisplayString(n.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":n.disabled}])},[e.createElementVNode("view",{class:"uni-select__input-box",onClick:a[1]||(a[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&&n.clear&&!n.disabled?(e.openBlock(),e.createElementBlock("view",{key:2,onClick:a[0]||(a[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:a[2]||(a[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"==n.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(n.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"]]),sa=["{","}"];const ia=/^(?:\d)+/,ra=/^(?:\w)+/;const la="zh-Hans",ca="zh-Hant",ua="en",da=Object.prototype.hasOwnProperty,ha=(e,t)=>da.call(e,t),ma=new class{constructor(){this._caches=Object.create(null)}interpolate(e,t,o=sa){if(!t)return[e];let a=this._caches[e];return a||(a=function(e,[t,o]){const a=[];let n=0,s="";for(;n<e.length;){let i=e[n++];if(i===t){s&&a.push({type:"text",value:s}),s="";let t="";for(i=e[n++];void 0!==i&&i!==o;)t+=i,i=e[n++];const r=i===o,l=ia.test(t)?"list":r&&ra.test(t)?"named":"unknown";a.push({value:t,type:l})}else s+=i}return s&&a.push({type:"text",value:s}),a}(e,o),this._caches[e]=a),function(e,t){const o=[];let a=0;const n=Array.isArray(t)?"list":(s=t,null!==s&&"object"==typeof s?"named":"unknown");var s;if("unknown"===n)return o;for(;a<e.length;){const s=e[a];switch(s.type){case"text":o.push(s.value);break;case"list":o.push(t[parseInt(s.value,10)]);break;case"named":"named"===n&&o.push(t[s.value])}a++}return o}(a,t)}};function pa(e,t){if(!e)return;if(e=e.trim().replace(/_/g,"-"),t&&t[e])return e;if("chinese"===(e=e.toLowerCase()))return la;if(0===e.indexOf("zh"))return e.indexOf("-hans")>-1?la:e.indexOf("-hant")>-1?ca:(o=e,["-tw","-hk","-mo","-cht"].find((e=>-1!==o.indexOf(e)))?ca:la);var o;let a=[ua,"fr","es"];t&&Object.keys(t).length>0&&(a=Object.keys(t));const n=function(e,t){return t.find((t=>0===e.indexOf(t)))}(e,a);return n||void 0}class ga{constructor({locale:e,fallbackLocale:t,messages:o,watcher:a,formater:n}){this.locale=ua,this.fallbackLocale=ua,this.message={},this.messages={},this.watchers=[],t&&(this.fallbackLocale=t),this.formater=n||ma,this.messages=o||{},this.setLocale(e||ua),a&&this.watchLocale(a)}setLocale(e){const t=this.locale;this.locale=pa(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 a=this.messages[e];a?o?Object.assign(a,t):Object.keys(t).forEach((e=>{ha(a,e)||(a[e]=t[e])})):this.messages[e]=t}f(e,t,o){return this.formater.interpolate(e,t,o).join("")}t(e,t,o){let a=this.message;return"string"==typeof t?(t=pa(t,this.messages))&&(a=this.messages[t]):o=t,ha(a,e)?this.formater.interpolate(a[e],o).join(""):(console.warn(`Cannot translate the value of keypath ${e}. Use the value of keypath as default.`),e)}}function fa(e,t={},o,a){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():ua),"string"!=typeof o&&(o="undefined"!=typeof __uniConfig&&__uniConfig.fallbackLocale||ua);const n=new ga({locale:e,fallbackLocale:o,messages:t,watcher:a});let s=(e,t)=>{if("function"!=typeof getApp)s=function(e,t){return n.t(e,t)};else{let e=!1;s=function(t,o){const a=getApp().$vm;return a&&(a.$locale,e||(e=!0,function(e,t){e.$watchLocale?e.$watchLocale((e=>{t.setLocale(e)})):e.$watch((()=>e.$locale),(e=>{t.setLocale(e)}))}(a,n))),n.t(t,o)}}return s(e,t)};return{i18n:n,f:(e,t,o)=>n.f(e,t,o),t:(e,t)=>s(e,t),add:(e,t,o=!0)=>n.add(e,t,o),watch:e=>n.watchLocale(e),getLocale:()=>n.getLocale(),setLocale:e=>n.setLocale(e)}}const ya={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 va;setTimeout((()=>{va=uni.getSystemInfoSync().platform}),16);const{t:ka}=fa(ya);const _a=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:va,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||ka("uni-load-more.contentdown")},contentrefreshText(){return this.contentText.contentrefresh||ka("uni-load-more.contentrefresh")},contentnomoreText(){return this.contentText.contentnomore||ka("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,a,n,s,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-load-more",onClick:o[0]||(o[0]=(...e)=>i.onClick&&i.onClick(...e))},[!s.webviewHide&&("circle"===a.iconType||"auto"===a.iconType&&"android"===s.platform)&&"loading"===a.status&&a.showIcon?(e.openBlock(),e.createElementBlock("view",{key:0,style:e.normalizeStyle({width:a.iconSize+"px",height:a.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:a.color,borderTopWidth:a.iconSize/12})},null,4),e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:a.color,borderTopWidth:a.iconSize/12})},null,4),e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:a.color,borderTopWidth:a.iconSize/12})},null,4)],4)):!s.webviewHide&&"loading"===a.status&&a.showIcon?(e.openBlock(),e.createElementBlock("view",{key:1,style:e.normalizeStyle({width:a.iconSize+"px",height:a.iconSize+"px"}),class:"uni-load-more__img uni-load-more__img--ios-H5"},[e.createElementVNode("image",{src:s.imgBase64,mode:"widthFix"},null,8,["src"])],4)):e.createCommentVNode("",!0),a.showText?(e.openBlock(),e.createElementBlock("text",{key:2,class:"uni-load-more__text",style:e.normalizeStyle({color:a.color})},e.toDisplayString("more"===a.status?i.contentdownText:"loading"===a.status?i.contentrefreshText:i.contentnomoreText),5)):e.createCommentVNode("",!0)])}],["__scopeId","data-v-a7e112cc"]]),wa={name:"uniDataChecklist",mixins:[aa.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,a)=>{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,a=Number(this.max)||"";return e.forEach(((n,s)=>{if(this.multiple){if(t.length<=o){void 0!==t.find((e=>e[this.map.value]===n[this.map.value]))&&(n.disabled=!0)}if(t.length>=a&&""!==a){void 0===t.find((e=>e[this.map.value]===n[this.map.value]))&&(n.disabled=!0)}}this.setStyles(n,s),e[s]=n})),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 a="";for(let n in t)a+=`${n}:${t[n]};`;return a},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 a in t)o+=`${a}:${t[a]};`;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 a in t)o+=`${a}:${t[a]};`;return o},setStyleRightIcon(e){let t={},o="";"list"===this.mode&&(t["border-color"]=e.selected?this.styles.selectedColor:"#DCDFE6");for(let a in t)o+=`${a}:${t[a]};`;return o}}};const ba=u(wa,[["render",function(t,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-load-more"),_a);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},[n.multiple?(e.openBlock(),e.createElementBlock("checkbox-group",{key:0,class:e.normalizeClass(["checklist-group",{"is-list":"list"===n.mode||n.wrap}]),onChange:a[0]||(a[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--"+n.mode,t.selected?"is-checked":"",n.disabled||t.disabled?"is-disable":"",0!==o&&"list"===n.mode?"is-list-border":""]]),style:e.normalizeStyle(t.styleBackgroud),key:o},[e.createElementVNode("checkbox",{class:"hidden",hidden:"",disabled:n.disabled||!!t.disabled,value:t[n.map.value]+"",checked:t.selected},null,8,["disabled","value","checked"]),"tag"!==n.mode&&"list"!==n.mode||"list"===n.mode&&"left"===n.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"===n.mode&&"left"===n.icon}])},[e.createElementVNode("text",{class:"checklist-text",style:e.normalizeStyle(t.styleIconText)},e.toDisplayString(t[n.map.text]),5),"list"===n.mode&&"right"===n.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"===n.mode,"is-wrap":n.wrap}]),onChange:a[1]||(a[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--"+n.mode,t.selected?"is-checked":"",n.disabled||t.disabled?"is-disable":"",0!==o&&"list"===n.mode?"is-list-border":""]]),style:e.normalizeStyle(t.styleBackgroud),key:o},[e.createElementVNode("radio",{class:"hidden",hidden:"",disabled:n.disabled||t.disabled,value:t[n.map.value]+"",checked:t.selected},null,8,["disabled","value","checked"]),"tag"!==n.mode&&"list"!==n.mode||"list"===n.mode&&"left"===n.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"===n.mode&&"left"===n.icon}])},[e.createElementVNode("text",{class:"checklist-text",style:e.normalizeStyle(t.styleIconText)},e.toDisplayString(t[n.map.text]),5),"list"===n.mode&&"right"===n.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 Sa={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 xa={int:"integer",bool:"boolean",double:"number",long:"number",password:"string"};function Ca(e,t=""){["label"].forEach((t=>{void 0===e[t]&&(e[t]="")}));let o=t;for(let a in e){let t=new RegExp("{"+a+"}");o=o.replace(t,e[a])}return o}const Na={integer:e=>Na.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 Na.number(e)&&!Na.integer(e)},array:e=>Array.isArray(e),object:e=>"object"==typeof e&&!Na.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(Sa.email)&&e.length<255,url:e=>"string"==typeof e&&!!e.match(Sa.url),pattern(e,t){try{return new RegExp(e).test(t)}catch(De){return!1}},method:e=>"function"==typeof e,idcard:e=>"string"==typeof e&&!!e.match(Sa.idcard),"url-https"(e){return this.url(e)&&e.startsWith("https://")},"url-scheme":e=>e.startsWith("://"),"url-web":e=>!1};const Ea={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)?Ca(e,e.errorMessage||o.required):null,range(e,t,o){const{range:a,errorMessage:n}=e;let s=new Array(a.length);for(let r=0;r<a.length;r++){const e=a[r];Na.object(e)&&void 0!==e.value?s[r]=e.value:s[r]=e}let i=!1;return Array.isArray(t)?i=new Set(t.concat(s)).size===s.length:s.indexOf(t)>-1&&(i=!0),i?null:Ca(e,n||o.enum)},rangeNumber(e,t,o){if(!Na.number(t))return Ca(e,e.errorMessage||o.pattern.mismatch);let{minimum:a,maximum:n,exclusiveMinimum:s,exclusiveMaximum:i}=e,r=s?t<=a:t<a,l=i?t>=n:t>n;return void 0!==a&&r?Ca(e,e.errorMessage||o.number[s?"exclusiveMinimum":"minimum"]):void 0!==n&&l?Ca(e,e.errorMessage||o.number[i?"exclusiveMaximum":"maximum"]):void 0!==a&&void 0!==n&&(r||l)?Ca(e,e.errorMessage||o.number.range):null},rangeLength(e,t,o){if(!Na.string(t)&&!Na.array(t))return Ca(e,e.errorMessage||o.pattern.mismatch);let a=e.minLength,n=e.maxLength,s=t.length;return void 0!==a&&s<a?Ca(e,e.errorMessage||o.length.minLength):void 0!==n&&s>n?Ca(e,e.errorMessage||o.length.maxLength):void 0!==a&&void 0!==n&&(s<a||s>n)?Ca(e,e.errorMessage||o.length.range):null},pattern:(e,t,o)=>Na.pattern(e.pattern,t)?null:Ca(e,e.errorMessage||o.pattern.mismatch),format(e,t,o){var a=Object.keys(Na),n=xa[e.format]?xa[e.format]:e.format||e.arrayType;return a.indexOf(n)>-1&&!Na[n](t)?Ca(e,e.errorMessage||o.typeError):null},arrayTypeFormat(e,t,o){if(!Array.isArray(t))return Ca(e,e.errorMessage||o.typeError);for(let a=0;a<t.length;a++){const n=t[a];let s=this.format(e,n,o);if(null!==s)return s}return null}};class Ta extends class{constructor(e){this._message=e}async validateRule(e,t,o,a,n){var s=null;let i=t.rules;if(i.findIndex((e=>e.required))<0){if(null==o)return s;if("string"==typeof o&&!o.length)return s}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}"]`}),Ea[u]&&null!=(s=Ea[u](c,o,r)))break;if(c.validateExpr){let e=Date.now();if(!1===c.validateExpr(o,n,e)){s=this._getMessage(c,c.errorMessage||this._message.default);break}}if(c.validateFunction&&null!==(s=await this.validateFunction(c,o,a,n,u)))break}return null!==s&&(s=r.TAG+s),s}async validateFunction(e,t,o,a,n){let s=null;try{let i=null;const r=await e.validateFunction(e,t,a||o,(e=>{i=e}));(i||"string"==typeof r&&r||!1===r)&&(s=this._getMessage(e,i||r,n))}catch(De){s=this._getMessage(e,De.message,n)}return s}_getMessage(e,t,o){return Ca(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(Ta.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 a=[],n=this._schema;for(let s in n){let i=n[s],r=await this.validateRule(s,i,e[s],e,o);if(null!=r&&(a.push({key:s,errorMessage:r}),!t))break}return a}async invokeValidateUpdate(e,t,o){let a=[];for(let n in e){let s=await this.validateRule(n,this._schema[n],e[n],e,o);if(null!=s&&(a.push({key:n,errorMessage:s}),!t))break}return a}_checkFieldInSchema(e){var t=Object.keys(e),o=Object.keys(this._schema);if(new Set(t.concat(o)).size===o.length)return"";var a=t.filter((e=>o.indexOf(e)<0));return[{key:"invalid",errorMessage:Ca({field:JSON.stringify(a)},Ta.message.TAG+Ta.message.defaultInvalid)}]}}Ta.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 Da=(e,t,o)=>{const a=o.find((e=>{return e.format&&("int"===(t=e.format)||"double"===t||"number"===t||"timestamp"===t);var t})),n=o.find((e=>e.format&&"boolean"===e.format||"bool"===e.format));return a&&(t=t||0===t?Oa(Number(t))?Number(t):t:null),n&&(t=!!Fa(t)&&t),t},Va=(e,t)=>La(t,e),Ia=(e,t={})=>{const o=Pa(e);if("object"==typeof o&&Array.isArray(o)&&o.length>1){return o.reduce(((e,t)=>e+`#${t}`),"_formdata_")}return o[0]||e},Ba=e=>{let t=e.replace("_formdata_#","");return t=t.split("#").map((e=>Oa(e)?Number(e):e)),t},Aa=(e,t,o)=>("object"!=typeof e||Pa(t).reduce(((e,t,a,n)=>a===n.length-1?(e[t]=o,null):(t in e||(e[t]=/^[0-9]{1,}$/.test(n[a+1])?[]:{}),e[t])),e),e);function Pa(e){return Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,"").split(".")}const La=(e,t,o="undefined")=>{let a=Pa(t).reduce(((e,t)=>(e||{})[t]),e);return a&&void 0===a?o:a},Oa=e=>!isNaN(Number(e)),Fa=e=>"boolean"==typeof e;const Ma=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,a){if(a)this.$refs[a].setValue(e,o);else{let a;for(let e in this.$refs){const t=this.$refs[e];if(t&&t.$options&&"uniForms"===t.$options.name){a=t;break}}if(!a)return t("error","at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:182","当前 uni-froms 组件缺少 ref 属性");a.setValue(e,o)}}),this.childrens=[],this.inputChildrens=[],this.setRules(this.rules)},methods:{setRules(e){this.formRules=Object.assign({},this.formRules,e),this.validator=new Ta(e)},setValue(e,t){let o=this.childrens.find((t=>t.name===e));return o?(this.formData[e]=Da(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 a=Ia(t.name);-1!==e.indexOf(a)&&(o=Object.assign({},o,{[a]:this.formData[a]}))})),this.checkAll(o,[],t)},clearValidate(e=[]){e=[].concat(e),this.childrens.forEach((t=>{if(0===e.length)t.errMsg="";else{const o=Ia(t.name);-1!==e.indexOf(o)&&(t.errMsg="")}}))},submit(e,o,a){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 a||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,a){if(!this.validator)return;let n,s=[];for(let c in e){const e=this.childrens.find((e=>Ia(e.name)===c));e&&s.push(e)}o||"function"!=typeof t||(o=t),!o&&"function"!=typeof o&&Promise&&(n=new Promise(((e,t)=>{o=function(o,a){o?t(o):e(a)}})));let i=[],r=JSON.parse(JSON.stringify(e));for(let c in s){const e=s[c];let t=Ia(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=Ia(e),o=Va(e,this.localData);void 0!==o&&(r[t]=o)})),"submit"===a?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)),a={};for(let n in o){let e=Ba(n);Aa(a,e,o[n])}return a})(r,this.name),o&&"function"==typeof o&&o(i,l),n&&o?n:null},validateCheck(e){this.$emit("validate",e)},_getValue:Da,_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:Va,_realName:Ia,_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 a=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(a.length!=n.length)return!1;for(var s=0;s<a.length;s++){var i=a[s];if(e[i]!==t[i])return!1}return!0}return"[object Array]"==o?e.toString()==t.toString():void 0}}},[["render",function(t,o,a,n,s,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"]]),Ra={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 Ua=u({name:"uniPopupMessage",mixins:[Ra],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,a,n,s,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__"+a.type])},[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("text",{class:e.normalizeClass(["uni-popup-message-text","uni-popup__"+a.type+"-text"])},e.toDisplayString(a.message),3)]),!0)],2)])}],["__scopeId","data-v-d81cfb56"]]);class ja{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],a={};if(a=o||{styles:{},config:{}},za.includes(e)){a.styles.transform||(a.styles.transform="");let o="";"rotate"===e&&(o="deg"),a.styles.transform+=`${e}(${t+o}) `}else a.styles[e]=`${t}`;this.currentStepAnimates[this.next]=a}_animateRun(e={},t={}){let o=this.$.$refs.ani.ref;if(o)return new Promise(((a,n)=>{nvueAnimation.transition(o,{styles:e,...t},(e=>{a()}))}))}_nvueNextAnimate(e,t=0,o){let a=e[t];if(a){let{styles:n,config:s}=a;this._animateRun(n,s).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 za=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function $a(e,t){if(t)return clearTimeout(t.timer),new ja(e,t)}za.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((e=>{ja.prototype[e]=function(...t){return this.animation[e](...t),this}}));const qa=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=$a(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(De){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=$a(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,a,n,s,i){return e.withDirectives((e.openBlock(),e.createElementBlock("view",{ref:"ani",animation:s.animationData,class:e.normalizeClass(a.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,s.isShow]])}]]),Ha={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:a,screenHeight:n,safeAreaInsets:s}=uni.getSystemInfoSync();this.popupWidth=e,this.popupHeight=t+(o||0),a&&this.safeArea?this.safeAreaInsets=s.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 Wa=u(Ha,[["render",function(t,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-transition"),qa);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:a[1]||(a[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:a[0]||(a[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"]]),Ja={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:Ka}=fa(Ja);const Ga=u({name:"uniPopupDialog",mixins:[Ra],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||Ka("uni-popup.ok")},closeText(){return this.cancelText||Ka("uni-popup.cancel")},placeholderText(){return this.placeholder||Ka("uni-popup.placeholder")},titleText(){return this.title||Ka("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,a,n,s,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__"+s.dialogType]])},e.toDisplayString(i.titleText),3)]),"base"===a.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(a.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=>s.val=e),type:a.inputType,placeholder:i.placeholderText,focus:s.focus},null,8,["type","placeholder","focus"]),[[e.vModelDynamic,s.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 Ya;const Qa={get isIOS(){return"boolean"==typeof Ya?Ya:Ya="ios"===uni.getSystemInfoSync().platform},requestIOS:function(e){return new Promise(((o,a)=>{switch(e){case"push":o(function(){var e=0,o=plus.ios.import("UIApplication"),a=o.sharedApplication();if(a.currentUserNotificationSettings){var n=a.currentUserNotificationSettings();0==n.plusGetAttribute("types")?(e=0,t("log","at common/permission.js:63","推送权限没有开启")):(e=1,t("log","at common/permission.js:66","已经开启推送功能!")),plus.ios.deleteObject(n)}else 0==a.enabledRemoteNotificationTypes()?(e=3,t("log","at common/permission.js:73","推送权限没有开启!")):(e=4,t("log","at common/permission.js:76","已经开启推送功能!"));return plus.ios.deleteObject(a),plus.ios.deleteObject(o),e}());break;case"location":o((n=0,s=plus.ios.import("CLLocationManager"),i=s.locationServicesEnabled(),r=s.authorizationStatus(),n=i?0===r?null:3===r||4===r?1:0:2,plus.ios.deleteObject(s),n));break;case"record":o(function(){var e=null,o=plus.ios.import("AVAudioSession"),a=o.sharedInstance().recordPermission();return t("log","at common/permission.js:104","permissionStatus:"+a),e=1970168948===a?null:1735552628===a?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 n,s,i,r}))},requestAndroid:function(e){return new Promise(((o,a)=>{plus.android.requestPermissions([e],(function(e){for(var a=0,n=0;n<e.granted.length;n++){t("log","at common/permission.js:187","已获取的权限:"+e.granted[n]),a=1}for(n=0;n<e.deniedPresent.length;n++){t("log","at common/permission.js:192","拒绝本次申请的权限:"+e.deniedPresent[n]),a=0}for(n=0;n<e.deniedAlways.length;n++){t("log","at common/permission.js:197","永久拒绝申请的权限:"+e.deniedAlways[n]),a=-1}o(a)}),(function(e){t("log","at common/permission.js:203","result error: "+e.message),o({code:e.code,message:e.message})}))}))},gotoAppSetting:function(){if(Qa.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 a=plus.android.importClass("android.content.Intent"),n=plus.android.importClass("android.provider.Settings"),s=plus.android.importClass("android.net.Uri"),i=plus.android.runtimeMainActivity(),r=new a;r.setAction(n.ACTION_APPLICATION_DETAILS_SETTINGS);var l=s.fromParts("package",i.getPackageName(),null);r.setData(l),i.startActivity(r)}}},Za="http://dsg.tms.api.aibasil.cn",Xa=Za+"/admin/order.scanOrder/getBindParams",en=Za+"/admin/printer//getPrinterList",tn=Za+"/admin/order.ScanOrder/printWaybillLabel",on={data:()=>({token:e.ref(null),user:e.ref(null),messageType:"",messageText:"",batchOptions:[],spaces:[],printerList:{},instockHistory:[],printers:[],downloadFile:[],sendToPeinter:[1],selectPrinter:0,subLoading:!1,focusType:!0,loading:e.ref(!1),valiFormData:{orderNum:"",batch_number:"",space_code:"",weight:"",search_pkg:!0,typing:!0,search_order:!0,search_order_choice:1},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:"重量只能输入数字"}]}}},spaceRes:function(){try{const e=this.spaces.find((e=>e.value===this.valiFormData.space_code));return null==e?void 0:e.text}catch(De){return t("log","at pages/instock/index.vue:240",De),""}}},onShow(){this.focusType=!0,this.loading=!1,this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user"),this.getWarehouseSpace(),this.getBindParams(),this.getPrinterList()},onHide(){this.focusType=!1,this.loading=!1},onReady(){},onNavigationBarButtonTap(e){0===e.index&&uni.navigateTo({url:"/pages/instock/instockLog"})},methods:{getWarehouseSpace(){uni.request({url:"http://dsg.tms.api.aibasil.cn/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:Xa,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:307","fail--",e)}})},getPrinterList(){uni.request({url:en,method:"GET",header:{batoken:this.token},success:e=>{1===e.data.code&&(this.printerList=e.data.data.printers,this.printers=Object.values(this.printerList).map((e=>({text:e.name,value:e.value}))))},fail(e){t("log","at pages/instock/index.vue:330","fail--",e)}})},batchText(e){var t;return null==(t=this.batchOptions.find((t=>t.value===e)))?void 0:t.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:"",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=Qa.isIOS?await Qa.requestIOS("camera"):await Qa.requestAndroid("android.permission.CAMERA");return null===t||1===t?t=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Qa.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:"http://dsg.tms.api.aibasil.cn/admin/order.scanOrder/checkWaybillGoods",method:"POST",header:{batoken:this.token},data:{order_no:this.valiFormData.orderNum},success:e=>{1===e.data.code&&e.data.data.is_goods_empty?this.$refs.alertDialog.open():this.instockScan(0)}})},instockScan(e){uni.request({url:"http://dsg.tms.api.aibasil.cn/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(),t("log","at pages/instock/index.vue:451","res.data.data---",e.data.data);const o={orderNum:this.valiFormData.orderNum,createTime:new Date,space:this.spaceRes,type:"入库",status:!0};this.instockHistory.unshift(o),uni.setStorageSync("instockHistory",this.instockHistory),this.getHistory(),e.data.data.express_label?(t("log","at pages/instock/index.vue:465","有打印面单"),this.selectPrinter=this.sendToPeinter.length>0?this.printers[0].value:0,this.$refs.printerDialog.open()):this.st=setTimeout((()=>{this.reset(),this.st&&clearTimeout(this.st)}),1e3)}else{this.messageType="error",this.messageText=e.data.msg,this.$refs.message.open();const t={orderNum:this.valiFormData.orderNum,createTime:new Date,space:this.spaceRes,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:497",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:"http://dsg.tms.api.aibasil.cn/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();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(),e.data.data.labels&&e.data.data.labels.length>0?(t("log","at pages/instock/index.vue:534","有打印面单"),this.selectPrinter=this.sendToPeinter.length>0?this.printers[0].value:0,this.$refs.printerDialog.open()):this.st=setTimeout((()=>{this.reset(),this.st&&clearTimeout(this.st)}),700)}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)}),700)}}})},weighScan(){this.loading=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/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)}),700)}})},isNotGoods(){this.instockScan(0)},close(){this.$refs.printerDialog.close(),this.st=setTimeout((()=>{this.reset(),this.st&&clearTimeout(this.st)}),700)},dialogConfirm(){this.instockScan(1)},dialogClose(){this.instockScan(0)},sendToPeinterFun(e){!e.detail.value.length>0?this.selectPrinter=0:this.selectPrinter=this.printers[0].value},printConfirm(){this.subLoading=!0,uni.request({url:tn,method:"POST",header:{batoken:this.token},data:{order_no:this.valiFormData.orderNum,printer_code:this.selectPrinter},success:e=>{this.close(),this.subLoading=!1,t("log","at pages/instock/index.vue:654","打印成功",e),this.messageType="success",this.messageText="打印成功",this.$refs.message.open()}})},onsubmit(){this.$refs.valiForm.validate().then((e=>{this.warehouseScan()})).catch((e=>{t("log","at pages/instock/index.vue:668","err",e)}))},getHistory(){}}};const an=u(on,[["render",function(t,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-easyinput"),v),c=o(e.resolveDynamicComponent("uni-forms-item"),k),u=o(e.resolveDynamicComponent("uni-data-select"),na),d=o(e.resolveDynamicComponent("uni-data-checkbox"),ba),h=o(e.resolveDynamicComponent("uni-forms"),Ma),m=o(e.resolveDynamicComponent("uni-icons"),f),p=o(e.resolveDynamicComponent("uni-popup-message"),Ua),g=o(e.resolveDynamicComponent("uni-popup"),Wa),y=o(e.resolveDynamicComponent("uni-popup-dialog"),Ga);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":a[0]||(a[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":a[1]||(a[1]=e=>i.valiFormData.batch_number=e),localdata:i.batchOptions,placeholder:"请选择批次号"},null,8,["modelValue","localdata"])])),_:1})):e.createCommentVNode("",!0),1===i.valiFormData.search_order_choice?(e.openBlock(),e.createBlock(c,{key:1,label:"仓位编码",name:"space_code"},{default:e.withCtx((()=>[e.createVNode(u,{modelValue:i.valiFormData.space_code,"onUpdate:modelValue":a[2]||(a[2]=e=>i.valiFormData.space_code=e),localdata:i.spaces,placeholder:"请选择仓位编码"},null,8,["modelValue","localdata"])])),_:1})):e.createCommentVNode("",!0),2!==i.valiFormData.search_order_choice?(e.openBlock(),e.createBlock(c,{key:2,label:"重量",required:"",name:"weight"},{default:e.withCtx((()=>[e.createVNode(l,{modelValue:i.valiFormData.weight,"onUpdate:modelValue":a[3]||(a[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:a[5]||(a[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:a[4]||(a[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:a[6]||(a[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:a[8]||(a[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:a[7]||(a[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":a[9]||(a[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:a[10]||(a[10]=(...e)=>r.reset&&r.reset(...e))},"重置"),e.createElementVNode("button",{type:"primary",onClick:a[11]||(a[11]=(...e)=>r.onsubmit&&r.onsubmit(...e)),loading:i.loading},[i.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{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),t.space?(e.openBlock(),e.createElementBlock("text",{key:1},"仓位编码: "+e.toDisplayString(t.space),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.type),1)],4),t.status?(e.openBlock(),e.createBlock(m,{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(g,{ref:"message",type:"message"},{default:e.withCtx((()=>[e.createVNode(p,{type:i.messageType,message:i.messageText,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(g,{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),e.createVNode(g,{ref:"printerDialog",type:"dialog","is-mask-click":!1},{default:e.withCtx((()=>[e.createElementVNode("view",{style:{width:"90%",margin:"0 auto","min-height":"250px","background-color":"#fff","border-radius":"5px"}},[e.createElementVNode("view",{class:"",style:{"font-size":"20px","border-bottom":"1px solid #e1e1e1",padding:"15px 10px"}},[e.createElementVNode("view",null,[e.createElementVNode("view",{style:{"margin-bottom":"20px"}},[e.createElementVNode("text",null,"打印尾程面单")]),e.createElementVNode("view",null,[i.printerList?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(d,{multiple:"",modelValue:i.sendToPeinter,"onUpdate:modelValue":a[12]||(a[12]=e=>i.sendToPeinter=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:r.sendToPeinterFun},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue","onChange"]),e.createVNode(d,{disabled:0===i.sendToPeinter.length,modelValue:i.selectPrinter,"onUpdate:modelValue":a[13]||(a[13]=e=>i.selectPrinter=e),localdata:i.printers},null,8,["disabled","modelValue","localdata"])])])):e.createCommentVNode("",!0)])]),e.createElementVNode("view",{style:{"text-align":"center",position:"absolute",bottom:"10px",width:"90%",display:"flex",margin:"0 auto",left:"0",right:"0"}},[e.createElementVNode("button",{onClick:a[14]||(a[14]=(...e)=>r.close&&r.close(...e)),style:{width:"35%"}},"关闭"),e.createElementVNode("button",{onClick:a[15]||(a[15]=(...e)=>r.printConfirm&&r.printConfirm(...e)),"hover-stay-time":500,loading:i.subLoading,disabled:0===i.sendToPeinter.length||i.subLoading,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}]]),nn=u(e.defineComponent({__name:"instockLog",setup(t){const a=e.ref([]);return i((()=>{a.value=uni.getStorageSync("instockHistory")})),(t,n)=>{const s=o(e.resolveDynamicComponent("uni-icons"),f);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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),t.space?(e.openBlock(),e.createElementBlock("text",{key:1},"仓位编码: "+e.toDisplayString(t.space),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.type),1)],4),t.status?(e.openBlock(),e.createBlock(s,{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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-bb159e83"]]);const sn=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,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-popup-dialog"),Ga),c=o(e.resolveDynamicComponent("uni-popup"),Wa);return e.openBlock(),e.createElementBlock("view",{class:"content"},[e.createElementVNode("view",{class:"user-v",onClick:a[0]||(a[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:a[2]||(a[2]=(...e)=>r.dialogToggle&&r.dialogToggle(...e))},"注销")):(e.openBlock(),e.createElementBlock("button",{key:0,type:"primary",plain:"true",size:"mini",onClick:a[1]||(a[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 rn=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:`http://dsg.tms.api.aibasil.cn/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:"http://dsg.tms.api.aibasil.cn/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,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-icons"),f),c=o(e.resolveDynamicComponent("uni-easyinput"),v),u=o(e.resolveDynamicComponent("uni-forms"),Ma),d=o(e.resolveDynamicComponent("uni-popup-message"),Ua),h=o(e.resolveDynamicComponent("uni-popup"),Wa);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":a[0]||(a[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":a[1]||(a[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":a[2]||(a[2]=e=>i.valiFormData.captcha=e)},null,8,["modelValue"]),e.createElementVNode("image",{class:"cu-btn captchaImg",src:i.verifyCodeImg,onClick:a[3]||(a[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:a[4]||(a[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 ln=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,a,n,s,i){return e.openBlock(),e.createElementBlock("view",{class:"content"})}]]),cn={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(De){this.errorMessage=De}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(De){this.errorMessage=De}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(De){this.errorMessage=De}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=aa.database(this.spaceInfo);const o=e.action||this.action;o&&(t=t.action(o));const a=e.collection||this.collection;t=t.collection(a);const n=e.where||this.where;n&&Object.keys(n).length&&(t=t.where(n));const s=e.field||this.field;s&&(t=t.field(s));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 a=0;a<t.length-1;a++)e.push(`${o} == '${t[a].value}'`);let n=[];return this.where&&n.push(`(${this.where})`),e.length&&n.push(`(${e.join(" || ")})`),n.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 a=e[o].split("as");if(!(a.length<2)&&"value"===a[1].trim()){t=a[0].trim();break}}return t},_updateBindData(e){const{dataList:t,hasNodes:o}=this._filterData(this._treeData,this.selected);let a=!1===this._stepSearh&&!o;return e&&(e.isleaf=a),this.dataList=t,this.selectedIndex=t.length-1,!a&&this.selected.length<t.length&&this.selected.push({value:null,text:"请选择"}),{isleaf:a,hasNodes:o}},_updateSelected(){let e=this.dataList,t=this.selected,o=this.map.text,a=this.map.value;for(let n=0;n<t.length;n++){let s=t[n].value,i=e[n];for(let e=0;e<i.length;e++){let r=i[e];if(r[a]===s){t[n].text=r[o];break}}}},_filterData(e,t){let o=[],a=!0;o.push(e.filter((e=>null===e.parent_value||void 0===e.parent_value||""===e.parent_value)));for(let n=0;n<t.length;n++){let s=t[n].value,i=e.filter((e=>e.parent_value===s));i.length?o.push(i):a=!1}return{dataList:o,hasNodes:a}},_extractTree(e,t,o){let a=this.map.value;for(let n=0;n<e.length;n++){let s=e[n],i={};for(let e in s)"children"!==e&&(i[e]=s[e]);null!=o&&""!==o&&(i.parent_value=o),t.push(i);let r=s.children;r&&this._extractTree(r,t,s[a])}},_extractTreePath(e,t){for(let o=0;o<e.length;o++){let a=e[o],n={};for(let e in a)"children"!==e&&(n[e]=a[e]);t.push(n);let s=a.children;s&&this._extractTreePath(s,t)}},_findNodePath(e,t,o=[]){let a=this.map.text,n=this.map.value;for(let s=0;s<t.length;s++){let i=t[s],r=i.children,l=i[a],c=i[n];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 un={name:"UniDataPicker",emits:["popupopened","popupclosed","nodeclick","input","change","update:modelValue","inputclick"],mixins:[cn],components:{DataPickerView:u({name:"UniDataPickerView",emits:["nodeclick","change","datachange","update:modelValue"],mixins:[cn],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 a=this.dataList[t][o],n=a[this.map.text],s=a[this.map.value];if(t<this.selected.length-1?(this.selected.splice(t,this.selected.length-t),this.selected.push({text:n,value:s})):t===this.selected.length-1&&this.selected.splice(t,1,{text:n,value:s}),a.isleaf)return void this.onSelectedChange(a,a.isleaf);const{isleaf:i,hasNodes:r}=this._updateBindData();this.isLocalData?this.onSelectedChange(a,!r||i):this.isCloudDataList?this.onSelectedChange(a,!0):this.isCloudDataTree&&(i?this.onSelectedChange(a,a.isleaf):r||this.loadCloudDataNode((e=>{e.length?(this._treeData.push(...e),this._updateBindData(a)):a.isleaf=!0,this.onSelectedChange(a,a.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,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-load-more"),_a);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,a)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["selected-item",{"selected-item-active":a==t.selectedIndex}]),key:a,onClick:e=>r.handleSelect(a)},[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,a)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["item",{"is-disabled":!!o.disable}]),key:a,onClick:e=>r.handleNodeClick(o,t.selectedIndex,a)},[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 s=0;s<t.length;s++){var a=t[s],n=e.find((e=>e.value==a));n&&o.push(n)}o.length&&(this.inputSelected=o)},_filterForArray(e,t){var o=[];for(let s=0;s<t.length;s++){var a=t[s],n=e.find((e=>e.value==a));n&&o.push(n)}return o},_dispatchEvent(e){let t={};if(e.length){for(var o=new Array(e.length),a=0;a<e.length;a++)o[a]=e[a].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 dn=u(un,[["render",function(t,a,n,s,i,r){const l=o(e.resolveDynamicComponent("uni-load-more"),_a),c=o(e.resolveDynamicComponent("uni-icons"),f),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:a[1]||(a[1]=(...e)=>r.handleInput&&r.handleInput(...e))},[e.renderSlot(t.$slots,"default",{options:n.options,data:i.inputSelected,error:t.errorMessage},(()=>[e.createElementVNode("view",{class:e.normalizeClass(["input-value",{"input-value-border":n.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(n.split),1)):e.createCommentVNode("",!0)])))),128))])])):(e.openBlock(),e.createElementBlock("text",{key:3,class:"selected-area placeholder"},e.toDisplayString(n.placeholder),1)),n.clearIcon&&!n.readonly&&i.inputSelected.length?(e.openBlock(),e.createElementBlock("view",{key:4,class:"icon-clear",onClick:a[0]||(a[0]=e.withModifiers(((...e)=>r.clear&&r.clear(...e)),["stop"]))},[e.createVNode(c,{type:"clear",color:"#c0c4cc",size:"24"})])):e.createCommentVNode("",!0),n.clearIcon&&i.inputSelected.length||n.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:a[2]||(a[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(n.popupTitle),1)]),e.createElementVNode("view",{class:"dialog-close",onClick:a[3]||(a[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":a[4]||(a[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:n.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"]]),hn=e.defineComponent({__name:"index",setup(a){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref(!1),g=e.ref(!1),y=e.ref([]),_=e.ref(),w=e.ref(),b=e.ref();let S;const x=e.ref({orderNum:"",weight:"",batchNum:"",palletNum:""}),C=e.reactive({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]}}),N=e.reactive({batch:[],pallet:[]}),E=()=>{},T=()=>{},D=()=>{},V=()=>{},I=async()=>{1===await(async()=>{let e=Qa.isIOS?await Qa.requestIOS("camera"):await Qa.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Qa.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{x.value.orderNum=e.result},fail:e=>{}})},B=()=>{d.value=!1,x.value.orderNum="",x.value.weight=""},A=()=>{x.value.batchNum?p.value=!0:(w.value="error",b.value="请选择批次号",_.value.open())},P=e.computed((()=>{const e=N.batch.find((e=>e.value===x.value.batchNum));return null==e?void 0:e.text})),L=()=>{x.value.palletNum?g.value=!0:(w.value="error",b.value="请选择托盘号",_.value.open())},O=e.computed((()=>{const e=function e(t,o){for(let a of t){if(a.value===o)return a.text;if(a.children&&a.children.length>0){const t=e(a.children,o);if(t)return`${a.text}/${t}`}}return null}(N.pallet,x.value.palletNum);return e})),F=()=>{d.value=!0,uni.setStorageSync("waybills",[]),uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.scanOrder/getWaybills",method:"POST",header:{batoken:u.value},data:{order_no:x.value.orderNum,batch_number:x.value.batchNum,pallet_number:x.value.palletNum?M(N.pallet,x.value.palletNum):""},success:e=>{d.value=!1,1==e.data.code?(w.value="success",b.value=e.data.msg,_.value.open(),uni.setStorageSync("waybills",e.data.data.waybills),uni.navigateTo({url:"/pages/scanLotno/waybillsList"})):(w.value="error",b.value=e.data.msg,_.value.open())}})},M=(e,t)=>{for(let o=0;o<e.length;o++){const a=e[o];if(a.id===t||a.value===t)return[a.id];if(a.children&&a.children.length>0){const e=M(a.children,t);if(null!==e)return e}}return null},R=()=>{S&&clearTimeout(S),d.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.scanOrder/bindShipping",method:"POST",header:{batoken:u.value},data:{order_no:x.value.orderNum,reweighting:x.value.weight,batch_number:x.value.batchNum,pallet_number:x.value.palletNum?M(N.pallet,x.value.palletNum):""},success:e=>{if(d.value=!1,1==e.data.code){w.value="success",b.value=e.data.msg,_.value.open(),e.data.data.labels&&e.data.data.labels.length>0&&t("log","at pages/scanLotno/index.vue:278","有打印面单");const o={orderNum:x.value.orderNum,createTime:new Date,type:x.value.batchNum?"绑定批次":"绑定托盘",status:!0};t("log","at pages/scanLotno/index.vue:290","lotnoLogHistory--",y),y.value.unshift(o),uni.setStorageSync("lotnoLogHistory",y.value),U()}else{w.value="error",b.value=e.data.msg,_.value.open();const t={orderNum:x.value.orderNum,createTime:new Date,type:x.value.batchNum?"绑定批次":"绑定托盘",status:!1};y.value.unshift(t),uni.setStorageSync("lotnoLogHistory",y.value),U()}S=setTimeout((()=>{B(),z(),S&&clearTimeout(S)}),1e3)}})},U=()=>{y.value=uni.getStorageSync("lotnoLogHistory")||[]},j=e=>{t("log","at pages/scanLotno/index.vue:321",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&R()};i((()=>{plus.key.addEventListener("keyup",j)})),r((()=>{plus.key.removeEventListener("keyup",j)})),s((()=>{h.value=!0,plus.key.removeEventListener("keyup",j)})),l((()=>{plus.key.removeEventListener("keyup",j)})),n((()=>{h.value=!1,u.value=uni.getStorageSync("token"),$(),U()}));const z=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},$=()=>{uni.request({url:Xa,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:a,label:n,...s}=e;return{id:o||a,value:a,text:n,...s,children:e.children?t(e.children):[]}}))};N.batch=e.data.data.batch_number.map((e=>({text:e.name,value:e.id})));const o=t(e.data.data.shipping);N.pallet=o}},fail(e){t("log","at pages/scanLotno/index.vue:411","fail--",e)}})};return c((e=>{0===e.index&&uni.navigateTo({url:"/pages/scanLotno/lotnoLog"})})),(t,a)=>{const n=o(e.resolveDynamicComponent("uni-easyinput"),v),s=o(e.resolveDynamicComponent("uni-forms-item"),k),i=o(e.resolveDynamicComponent("uni-data-select"),na),r=o(e.resolveDynamicComponent("uni-data-picker"),dn),l=o(e.resolveDynamicComponent("uni-forms"),Ma),c=o(e.resolveDynamicComponent("uni-icons"),f),u=o(e.resolveDynamicComponent("uni-popup-message"),Ua),h=o(e.resolveDynamicComponent("uni-popup"),Wa);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(l,{ref:"valiForm","label-align":"right","label-width":80,rules:C,modelValue:x.value},{default:e.withCtx((()=>[e.createVNode(s,{label:"运单号码",required:"",name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(n,{modelValue:x.value.orderNum,"onUpdate:modelValue":a[0]||(a[0]=e=>x.value.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:m.value,onIconClick:I},null,8,["modelValue","focus"])])),_:1}),e.createVNode(s,{label:"复称重量",name:"weight"},{default:e.withCtx((()=>[e.createVNode(n,{modelValue:x.value.weight,"onUpdate:modelValue":a[1]||(a[1]=e=>x.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(s,{label:"绑定批次号",name:"batchNum",class:"select-item"},{default:e.withCtx((()=>[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:0,modelValue:x.value.batchNum,"onUpdate:modelValue":a[2]||(a[2]=e=>x.value.batchNum=e),placeholder:"请选择批次号",localdata:N.batch,clear:!1},null,8,["modelValue","localdata"])),p.value?(e.openBlock(),e.createBlock(n,{key:1,value:P.value,disabled:p.value},null,8,["value","disabled"])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"primary",onClick:A},"确认")),p.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"primary",onClick:a[3]||(a[3]=e=>p.value=!1)},"修改")):e.createCommentVNode("",!0)])),_:1}),e.createVNode(s,{label:"绑定托盘号",name:"palletNum",class:"select-item"},{default:e.withCtx((()=>[g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r,{key:0,placeholder:"请选择托盘号","popup-title":"绑定托盘号",localdata:N.pallet,modelValue:x.value.palletNum,"onUpdate:modelValue":a[4]||(a[4]=e=>x.value.palletNum=e),onChange:V,onNodeclick:E,onPopupopened:T,onPopupclosed:D},null,8,["localdata","modelValue"])),g.value?(e.openBlock(),e.createBlock(n,{key:1,value:O.value,disabled:g.value},null,8,["value","disabled"])):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"primary",onClick:L},"确认")),g.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"primary",onClick:a[5]||(a[5]=e=>g.value=!1)},"修改")):e.createCommentVNode("",!0)])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:B},"重置"),e.createElementVNode("button",{type:"default",onClick:F,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:R,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"])]),y.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(y.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:_,type:"message"},{default:e.withCtx((()=>[e.createVNode(u,{type:w.value,message:b.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),mn=u(e.defineComponent({__name:"lotnoLog",setup(t){const a=e.ref([]);return i((()=>{a.value=uni.getStorageSync("lotnoLogHistory")})),(t,n)=>{const s=o(e.resolveDynamicComponent("uni-icons"),f);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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(s,{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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-cdf76154"]]);const pn=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,a,n,s,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))},[a.type?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass(["uni-section-header__decoration",a.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":a.titleFontSize,color:a.titleColor}),class:e.normalizeClass(["uni-section__content-title",{distraction:!a.subTitle}])},e.toDisplayString(a.title),7),a.subTitle?(e.openBlock(),e.createElementBlock("text",{key:0,style:e.normalizeStyle({"font-size":a.subTitleFontSize,color:a.subTitleColor}),class:"uni-section-header__content-sub"},e.toDisplayString(a.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"]]),gn=u(e.defineComponent({__name:"waybillsList",setup(t){const a=e.ref([]);return i((()=>{a.value=uni.getStorageSync("waybills")})),(t,n)=>{const s=o(e.resolveDynamicComponent("uni-section"),pn);return e.openBlock(),e.createElementBlock("view",{class:"history"},[e.createVNode(s,{title:"数量: "+a.value.length},null,8,["title"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无运单")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-2aaa63ed"]]),fn=e.defineComponent({__name:"index",setup(a){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref([]),g=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=Qa.isIOS?await Qa.requestIOS("camera"):await Qa.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Qa.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{b.value.order_code=e.result,E()},fail:e=>{}})},C=()=>{d.value=!1,b.value.order_code=""},N=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},E=()=>{w&&clearTimeout(w),d.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/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,g.value.open();const t={order_code:b.value.order_code,createTime:new Date,type:"单据扫描",status:!0};p.value.unshift(t),uni.setStorageSync("warehouseLogHistory",p.value),T()}else{y.value="error",_.value=e.data.msg,g.value.open();const t={order_code:b.value.order_code,createTime:new Date,type:"单据扫描",status:!1};p.value.unshift(t),uni.setStorageSync("warehouseLogHistory",p.value),T()}w=setTimeout((()=>{C(),w&&clearTimeout(w)}),1e3)}})},T=()=>{p.value=uni.getStorageSync("warehouseLogHistory")||[]},D=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",D)})),r((()=>{plus.key.removeEventListener("keyup",D)})),s((()=>{h.value=!0,plus.key.removeEventListener("keyup",D)})),l((()=>{plus.key.removeEventListener("keyup",D)})),n((()=>{u.value=uni.getStorageSync("token"),h.value=!1,T()})),c((e=>{0===e.index&&uni.navigateTo({url:"/pages/warehouseScan/warehouseLog"})})),(t,a)=>{const n=o(e.resolveDynamicComponent("uni-easyinput"),v),s=o(e.resolveDynamicComponent("uni-forms-item"),k),i=o(e.resolveDynamicComponent("uni-forms"),Ma),r=o(e.resolveDynamicComponent("uni-icons"),f),l=o(e.resolveDynamicComponent("uni-popup-message"),Ua),c=o(e.resolveDynamicComponent("uni-popup"),Wa);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(s,{label:"单据编号",required:"",name:"order_code"},{default:e.withCtx((()=>[e.createVNode(n,{modelValue:b.value.order_code,"onUpdate:modelValue":a[0]||(a[0]=e=>b.value.order_code=e),placeholder:"请输入单据编号",suffixIcon:"scan",focus:m.value,onIconClick:x,onBlur:N,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"])]),p.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(p.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:g,type:"message"},{default:e.withCtx((()=>[e.createVNode(l,{type:y.value,message:_.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),yn=u(fn,[["__scopeId","data-v-de7cb1d5"]]),vn=u(e.defineComponent({__name:"warehouseLog",setup(t){const a=e.ref([]);return i((()=>{a.value=uni.getStorageSync("warehouseLogHistory")})),(t,n)=>{const s=o(e.resolveDynamicComponent("uni-icons"),f);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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(s,{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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-14053095"]]),kn=e.defineComponent({__name:"index",setup(a){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!1),p=e.ref(!0),g=e.ref([]),y=e.ref(),k=e.ref(),_=e.ref();let w;const b=e.ref({code:"",space_id:""}),S=e.reactive({code:{rules:[{required:!0,errorMessage:"单号不能为空"}]}}),x=e.reactive({space:[]}),C=async()=>{1===await(async()=>{let e=Qa.isIOS?await Qa.requestIOS("camera"):await Qa.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Qa.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{b.value.code=e.result},fail:e=>{}})},N=()=>{h.value=!1,b.value.code=""},E=()=>{b.value.space_id?(d.value=!0,A()):(k.value="error",_.value="请选择库位",y.value.open())},T=e.computed((()=>{const e=x.space.find((e=>e.value===b.value.space_id));return null==e?void 0:e.text})),D=()=>{b.value.space_id&&b.value.code?(w&&clearTimeout(w),h.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/warehouse.waybillNo/add",method:"POST",header:{batoken:u.value},data:{code:b.value.code,space_id:b.value.space_id},success:e=>{h.value=!1;const t=x.space.find((e=>e.value===b.value.space_id));if(1==e.data.code){k.value="success",_.value=e.data.msg,y.value.open();const o={code:b.value.code,createTime:new Date,type:"运单号",space:t.text,status:!0};g.value.unshift(o),uni.setStorageSync("waybillNoHistory",g.value),V()}else{k.value="error",_.value=e.data.msg,y.value.open();const o={code:b.value.code,createTime:new Date,type:"运单号",space:t.text,status:!1};g.value.unshift(o),uni.setStorageSync("waybillNoHistory",g.value),V()}w=setTimeout((()=>{N(),A(),w&&clearTimeout(w)}),1e3)}})):(b.value.space_id||(k.value="error",_.value="请选择库位",y.value.open()),b.value.code||(k.value="error",_.value="请填写运单号",y.value.open()))},V=()=>{g.value=uni.getStorageSync("waybillNoHistory")||[]},I=e=>{t("log","at pages/waybillNo/index.vue:240",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&D()};i((()=>{plus.key.addEventListener("keyup",I)})),r((()=>{plus.key.removeEventListener("keyup",I)})),s((()=>{m.value=!0,plus.key.removeEventListener("keyup",I)})),l((()=>{plus.key.removeEventListener("keyup",I)})),n((()=>{m.value=!1,u.value=uni.getStorageSync("token"),B(),V()}));const B=()=>{uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/warehouse.waybillNo/getOptions",method:"GET",header:{batoken:u.value},success:e=>{if(t("log","at pages/waybillNo/index.vue:300",e),1===e.data.code)for(let t in e.data.data.space_id)e.data.data.space_id.hasOwnProperty(t)&&x.space.push({text:e.data.data.space_id[t],value:t})},fail(e){t("log","at pages/waybillNo/index.vue:310","fail--",e)}})},A=()=>{m.value||(p.value=!1,e.nextTick((()=>{p.value=!0})))};return c((e=>{0===e.index&&uni.navigateTo({url:"/pages/waybillNo/waybillNoLog"})})),(t,a)=>{const n=o(e.resolveDynamicComponent("uni-data-select"),na),s=o(e.resolveDynamicComponent("uni-easyinput"),v),i=o(e.resolveDynamicComponent("uni-forms"),Ma),r=o(e.resolveDynamicComponent("uni-icons"),f),l=o(e.resolveDynamicComponent("uni-popup-message"),Ua),c=o(e.resolveDynamicComponent("uni-popup"),Wa);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.createElementVNode("view",{class:"space-select"},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(n,{key:0,modelValue:b.value.space_id,"onUpdate:modelValue":a[0]||(a[0]=e=>b.value.space_id=e),placeholder:"请选择库位",localdata:x.space,clear:!1},null,8,["modelValue","localdata"])),d.value?(e.openBlock(),e.createBlock(s,{key:1,value:T.value,disabled:d.value},null,8,["value","disabled"])):e.createCommentVNode("",!0),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"primary",onClick:E},"确认")),d.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"primary",onClick:a[1]||(a[1]=e=>d.value=!1)},"修改")):e.createCommentVNode("",!0)]),e.createElementVNode("view",null,[e.createVNode(s,{modelValue:b.value.code,"onUpdate:modelValue":a[2]||(a[2]=e=>b.value.code=e),placeholder:"请输入运单号",suffixIcon:"scan",focus:p.value,onIconClick:C},null,8,["modelValue","focus"])])])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:N},"重置"),e.createElementVNode("button",{type:"primary",onClick:D,loading:h.value},[h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r,{key:0,type:"checkmarkempty",size:"18",color:"white"})),e.createTextVNode(" 提交 ")],8,["loading"])]),g.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(g.value.slice(0,5),((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("view",null,[e.createElementVNode("view",null,[e.createElementVNode("text",{class:"type"},"库位"),e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.space),5)]),e.createElementVNode("view",null,[e.createElementVNode("text",{class:"type"},"单号"),e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.code),5)]),e.createElementVNode("view",{class:"space-time"},[e.createElementVNode("text",null,e.toDisplayString(t.createTime),1)])]),e.createElementVNode("view",null,[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"))])])))),128))]),e.createVNode(c,{ref_key:"messageRef",ref:y,type:"message"},{default:e.withCtx((()=>[e.createVNode(l,{type:k.value,message:_.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),_n=u(e.defineComponent({__name:"waybillNoLog",setup(t){const a=e.ref([]);return i((async()=>{await(async()=>{a.value=await uni.getStorageSync("waybillNoHistory")})()})),(t,n)=>{const s=o(e.resolveDynamicComponent("uni-icons"),f);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:o},[e.createElementVNode("view",null,[e.createElementVNode("view",null,[e.createElementVNode("text",{class:"type"},"库位"),e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.space),5)]),e.createElementVNode("view",null,[e.createElementVNode("text",{class:"type"},"单号"),e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.code),5)]),e.createElementVNode("view",{class:"space-time"},[e.createElementVNode("text",null,e.toDisplayString(t.createTime),1)])]),e.createElementVNode("view",null,[t.status?(e.openBlock(),e.createBlock(s,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F"))])])))),128)),0===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-bf1fa5d7"]]);const wn=u({name:"UniDrawer",components:{},emits:["change"],props:{mode:{type:String,default:""},mask:{type:Boolean,default:!0},maskClick:{type:Boolean,default:!0},width:{type:Number,default:220}},data:()=>({visibleSync:!1,showDrawer:!1,rightMode:!1,watchTimer:null,drawerWidth:220}),created(){this.drawerWidth=this.width,this.rightMode="right"===this.mode},methods:{clear(){},close(e){("mask"!==e||this.maskClick)&&this.visibleSync&&this._change("showDrawer","visibleSync",!1)},open(){this.visibleSync||this._change("visibleSync","showDrawer",!0)},_change(e,t,o){this[e]=o,this.watchTimer&&clearTimeout(this.watchTimer),this.watchTimer=setTimeout((()=>{this[t]=o,this.$emit("change",o)}),o?50:300)}}},[["render",function(t,o,a,n,s,i){return s.visibleSync?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass([{"uni-drawer--visible":s.showDrawer},"uni-drawer"]),onTouchmove:o[1]||(o[1]=e.withModifiers(((...e)=>i.clear&&i.clear(...e)),["stop","prevent"]))},[e.createElementVNode("view",{class:e.normalizeClass(["uni-drawer__mask",{"uni-drawer__mask--visible":s.showDrawer&&a.mask}]),onClick:o[0]||(o[0]=e=>i.close("mask"))},null,2),e.createElementVNode("view",{class:e.normalizeClass(["uni-drawer__content",{"uni-drawer--right":s.rightMode,"uni-drawer--left":!s.rightMode,"uni-drawer__content--visible":s.showDrawer}]),style:e.normalizeStyle({width:s.drawerWidth+"px"})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],6)],34)):e.createCommentVNode("",!0)}],["__scopeId","data-v-8b8b609c"]]),bn="/static/copy.png",Sn=u(e.defineComponent({__name:"index",setup(a){const n=e.ref(!1),s=e.ref(!1),r=e.ref(),l=e.ref(),u=e.ref([]),d=e.ref(),h=e.ref(),m=e.ref(),p=e.ref(),g=()=>{},f=()=>{p.value.close()},y=e=>{uni.setClipboardData({data:e,success:function(){uni.showToast({title:"复制成功",icon:"success",duration:2e3})},fail:function(){t("log","at pages/waybillDeliveryOrder/index.vue:85","复制失败")}})},k=async()=>{1===await(async()=>{let e=Qa.isIOS?await Qa.requestIOS("camera"):await Qa.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Qa.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{},fail:e=>{}})},_=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/sendOut",method:"POST",header:{batoken:r.value},data:e,success:({data:e})=>{s.value=!1,d.value="success",h.value="发出成功",m.value.open()},fail:e=>{s.value=!1,d.value="error",h.value="发出失败,请稍后重试",m.value.open()}})},w=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/delivered",method:"POST",header:{batoken:r.value},data:e,success:({data:e})=>{s.value=!1,d.value="success",h.value="确认送达成功",m.value.open()},fail:e=>{s.value=!1,d.value="error",h.value="确认送达失败,请稍后重试",m.value.open()}})},b=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/refuse",method:"POST",header:{batoken:r.value},data:e,success:({data:e})=>{s.value=!1,d.value="success",h.value="已拒绝签收",m.value.open()},fail:e=>{s.value=!1,d.value="error",h.value="修改失败,请稍后重试",m.value.open()}})},S=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/createTrackPod",method:"POST",header:{batoken:r.value},data:e,success:({data:e})=>{s.value=!1,d.value="success",h.value="同步成功",m.value.open()},fail:e=>{s.value=!1,d.value="error",h.value="同步失败,请稍后重试",m.value.open()}})},x=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/cancelFedExPickUp",method:"POST",header:{batoken:r.value},data:e,success:({data:e})=>{s.value=!1,d.value="success",h.value="操作成功",m.value.open()},fail:e=>{s.value=!1,d.value="error",h.value="操作失败,请稍后重试",m.value.open()}})};return i((()=>{r.value=uni.getStorageSync("token"),n.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/index",method:"GET",header:{batoken:r.value},success:({data:e})=>{n.value=!1,t("log","at pages/waybillDeliveryOrder/index.vue:319",e),1==e.code?u.value=e.data.list:(d.value="error",h.value=e.msg,m.value.open())},fail:e=>{n.value=!1}})})),c((e=>{0===e.index&&p.value.open()})),(a,n)=>{const s=o(e.resolveDynamicComponent("uni-easyinput"),v),i=o(e.resolveDynamicComponent("uni-popup-message"),Ua),r=o(e.resolveDynamicComponent("uni-popup"),Wa),c=o(e.resolveDynamicComponent("uni-drawer"),wn);return e.openBlock(),e.createElementBlock("view",{class:"list"},[e.createVNode(s,{modelValue:l.value,"onUpdate:modelValue":n[0]||(n[0]=e=>l.value=e),placeholder:"请输入单号",suffixIcon:"scan",onIconClick:k},null,8,["modelValue"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,((o,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a,onClick:e=>(e=>{uni.setStorageSync("selectItem",e),uni.navigateTo({url:"/pages/waybillDeliveryOrder/orderInfo?id="+e.id})})(o)},[e.createElementVNode("view",{class:"order-no"},[e.createElementVNode("text",null," 派送单号: "+e.toDisplayString(o.order_no),1),e.createElementVNode("image",{onClick:e=>y(o.order_no),class:"icon",src:bn,mode:"aspectFill"},null,8,["onClick"])]),e.createElementVNode("view",{class:"address-info"},[e.createElementVNode("view",{class:"info"},[e.createElementVNode("view",{class:"user"},[e.createElementVNode("text",null,e.toDisplayString(o.address.first_name+" "+o.address.last_name)+" "+e.toDisplayString("+"+o.address.mobile_code+" "+o.address.mobile),1),e.createElementVNode("image",{onClick:e=>{return t("log","at pages/waybillDeliveryOrder/index.vue:91",a=o.address.mobile_code+" "+o.address.mobile),void uni.makePhoneCall({phoneNumber:a,success:function(){t("log","at pages/waybillDeliveryOrder/index.vue:96","拨打电话成功!")},fail:function(){t("log","at pages/waybillDeliveryOrder/index.vue:99","拨打电话失败!")}});var a},class:"icon",src:"/static/call.png",mode:"aspectFill"},null,8,["onClick"])]),e.createElementVNode("view",null,[e.createElementVNode("text",{class:"address"},[e.createElementVNode("text",{class:"city"},e.toDisplayString(o.address.city),1),e.createTextVNode(" "+e.toDisplayString(o.address.zip_code),1)]),e.createElementVNode("image",{onClick:e=>y(o.address.zip_code),class:"icon",src:bn,mode:"aspectFill"},null,8,["onClick"])])]),e.createElementVNode("view",{class:"info"})]),e.createElementVNode("view"),e.createElementVNode("view",{class:"operations"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.operations,((t,a)=>(e.openBlock(),e.createElementBlock("button",{key:a,onClick:e=>(async(e,t)=>{"send_out"===t?_({id:e.id}):"delivered"===t?w({id:e.id}):"refuse"===t?b({id:e.id}):"create_track_pod"===t?S({id:e.id}):"edit"===t||"generate_label"===t||"fedex_appointment_pick_up"===t||"print_get_back_label"===t||"fedex_cancel_pick_up"===t&&x({id:e.id})})(o,t.value),type:"info",size:"mini"},e.toDisplayString(t.text),9,["onClick"])))),128))])],8,["onClick"])))),128)),0===u.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无派送单")):e.createCommentVNode("",!0),e.createVNode(r,{ref_key:"messageRef",ref:m,type:"message"},{default:e.withCtx((()=>[e.createVNode(i,{type:d.value,message:h.value,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(c,{ref_key:"showRightRef",ref:p,mode:"right","mask-click":!0},{default:e.withCtx((()=>[e.createElementVNode("scroll-view",{style:{height:"100%"},"scroll-y":"true"},[e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{onClick:g,type:"info"},"重置"),e.createElementVNode("button",{onClick:f,type:"primary"},"确认")])])])),_:1},512)])}}}),[["__scopeId","data-v-76324b89"]]);const xn=u({name:"UniSegmentedControl",emits:["clickItem"],props:{current:{type:Number,default:0},values:{type:Array,default:()=>[]},activeColor:{type:String,default:"#2979FF"},inActiveColor:{type:String,default:"transparent"},styleType:{type:String,default:"button"}},data:()=>({currentIndex:0}),watch:{current(e){e!==this.currentIndex&&(this.currentIndex=e)}},computed:{},created(){this.currentIndex=this.current},methods:{_onClick(e){this.currentIndex!==e&&(this.currentIndex=e,this.$emit("clickItem",{currentIndex:e}))}}},[["render",function(t,o,a,n,s,i){return e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass([["text"===a.styleType?"segmented-control--text":"segmented-control--button"],"segmented-control"]),style:e.normalizeStyle({borderColor:"text"===a.styleType?"":a.activeColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.values,((t,o)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass([["text"===a.styleType?"":"segmented-control__item--button",0===o&&"button"===a.styleType?"segmented-control__item--button--first":"",o===a.values.length-1&&"button"===a.styleType?"segmented-control__item--button--last":""],"segmented-control__item"]),key:o,style:e.normalizeStyle({backgroundColor:o===s.currentIndex&&"button"===a.styleType?a.activeColor:"button"===a.styleType?a.inActiveColor:"transparent",borderColor:o===s.currentIndex&&"text"===a.styleType||"button"===a.styleType?a.activeColor:a.inActiveColor}),onClick:e=>i._onClick(o)},[e.createElementVNode("view",null,[e.createElementVNode("text",{style:e.normalizeStyle({color:o===s.currentIndex?"text"===a.styleType?a.activeColor:"#fff":"text"===a.styleType?"#000":a.activeColor}),class:e.normalizeClass(["segmented-control__text","text"===a.styleType&&o===s.currentIndex?"segmented-control__item--text":""])},e.toDisplayString(t),7)])],14,["onClick"])))),128))],6)}],["__scopeId","data-v-409bd450"]]);const Cn=u({name:"UniTag",emits:["click"],props:{type:{type:String,default:"default"},size:{type:String,default:"normal"},text:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},inverted:{type:[Boolean,String],default:!1},circle:{type:[Boolean,String],default:!1},mark:{type:[Boolean,String],default:!1},customStyle:{type:String,default:""}},computed:{classes(){const{type:e,disabled:t,inverted:o,circle:a,mark:n,size:s,isTrue:i}=this;return["uni-tag--"+e,"uni-tag--"+s,i(t)?"uni-tag--disabled":"",i(o)?"uni-tag--"+e+"--inverted":"",i(a)?"uni-tag--circle":"",i(n)?"uni-tag--mark":"",i(o)?"uni-tag--inverted uni-tag-text--"+e:"","small"===s?"uni-tag-text--small":""].join(" ")}},methods:{isTrue:e=>!0===e||"true"===e,onClick(){this.isTrue(this.disabled)||this.$emit("click")}}},[["render",function(t,o,a,n,s,i){return a.text?(e.openBlock(),e.createElementBlock("text",{key:0,class:e.normalizeClass(["uni-tag",i.classes]),style:e.normalizeStyle(a.customStyle),onClick:o[0]||(o[0]=(...e)=>i.onClick&&i.onClick(...e))},e.toDisplayString(a.text),7)):e.createCommentVNode("",!0)}],["__scopeId","data-v-c3d81dd8"]]);function Nn(e,t=2){for(e+="";e.length<t;)e="0"+e;return e.slice(-t)}const En={yyyy:e=>Nn(e.year,4),yy:e=>Nn(e.year),MM:e=>Nn(e.month),M:e=>e.month,dd:e=>Nn(e.day),d:e=>e.day,hh:e=>Nn(e.hour),h:e=>e.hour,mm:e=>Nn(e.minute),m:e=>e.minute,ss:e=>Nn(e.second),s:e=>e.second,SSS:e=>Nn(e.millisecond,3),S:e=>e.millisecond};function Tn(e){return e instanceof Date?e:"string"==typeof e?e.indexOf("T")>-1?new Date(e):new Date(e.replace(/-/g,"/")):new Date(e)}function Dn(e,{locale:t="zh",threshold:o=[6e4,36e5],format:a="yyyy/MM/dd hh:mm:ss"}){if("-"===e)return e;if(!e&&0!==e)return"";const n={zh:{year:"年",month:"月",day:"天",hour:"小时",minute:"分钟",second:"秒",ago:"前",later:"后",justNow:"刚刚",soon:"马上",template:"{num}{unit}{suffix}"},en:{year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",ago:"ago",later:"later",justNow:"just now",soon:"soon",template:"{num} {unit} {suffix}"}},s=n[t]||n.zh;let i,r,l=Tn(e),c=l.getTime()-Date.now(),u=Math.abs(c);if(u<o[0])return c<0?s.justNow:s.soon;if(u>=o[1])return function(e,t="yyyy/MM/dd hh:mm:ss"){if(!e&&0!==e)return"";const o={year:(e=Tn(e)).getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()},a=/yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/;let n=!0,s=t;for(;n;)n=!1,s=s.replace(a,(function(e){return n=!0,En[e](o)}));return s}(l,a);let d=s.later;c<0&&(d=s.ago,c=-c);const h=Math.floor(c/1e3),m=Math.floor(h/60),p=Math.floor(m/60),g=Math.floor(p/24),f=Math.floor(g/30),y=Math.floor(f/12);switch(!0){case y>0:i=y,r=s.year;break;case f>0:i=f,r=s.month;break;case g>0:i=g,r=s.day;break;case p>0:i=p,r=s.hour;break;case m>0:i=m,r=s.minute;break;default:i=h,r=s.second}return"en"===t&&(1===i?i="a":r+="s"),s.template.replace(/{\s*num\s*}/g,i+"").replace(/{\s*unit\s*}/g,r).replace(/{\s*suffix\s*}/g,d)}const Vn=u({name:"uniDateformat",props:{date:{type:[Object,String,Number],default:()=>"-"},locale:{type:String,default:"zh"},threshold:{type:Array,default:()=>[0,0]},format:{type:String,default:"yyyy/MM/dd hh:mm:ss"},refreshRate:{type:[Number,String],default:0}},data:()=>({refreshMark:0}),computed:{dateShow(){return this.refreshMark,Dn(this.date,{locale:this.locale,threshold:this.threshold,format:this.format})}},watch:{refreshRate:{handler(){this.setAutoRefresh()},immediate:!0}},methods:{refresh(){this.refreshMark++},setAutoRefresh(){clearInterval(this.refreshInterval),this.refreshRate&&(this.refreshInterval=setInterval((()=>{this.refresh()}),parseInt(this.refreshRate)))}}},[["render",function(t,o,a,n,s,i){return e.openBlock(),e.createElementBlock("text",null,e.toDisplayString(i.dateShow),1)}]]),In=e.defineComponent({__name:"orderInfo",setup(a){const n=e.ref(0),s=e.ref(["基本信息","运单详情"]);e.ref(!1);const r=e.ref();e.ref([]);const l=e.ref(),c=e.ref(),u=e.ref(),d=e.ref(),h=e.ref({}),m=e.ref({1:"英途派送",2:"第三方物流"});i((e=>{r.value=uni.getStorageSync("token"),d.value=uni.getStorageSync("selectItem"),h.value=uni.getStorageSync("deliveryOrderOptions"),t("log","at pages/waybillDeliveryOrder/orderInfo.vue:128",d.value)}));const p=e=>{n.value!=e.currentIndex&&(n.value=e.currentIndex)};return(a,i)=>{const r=o(e.resolveDynamicComponent("uni-segmented-control"),xn),g=o(e.resolveDynamicComponent("uni-tag"),Cn),f=o(e.resolveDynamicComponent("uni-dateformat"),Vn),y=o(e.resolveDynamicComponent("uni-popup-message"),Ua),v=o(e.resolveDynamicComponent("uni-popup"),Wa);return e.openBlock(),e.createElementBlock("view",{class:"info"},[e.createVNode(r,{current:n.value,values:s.value,onClickItem:p,styleType:"text",activeColor:"#007aff"},null,8,["current","values"]),e.createElementVNode("view",{class:"content"},[e.withDirectives(e.createElementVNode("view",null,[e.createElementVNode("view",{class:"order-no"},[e.createElementVNode("view",null,[e.createElementVNode("text",null,"派送单号: "+e.toDisplayString(d.value.order_no),1),e.createElementVNode("image",{onClick:i[0]||(i[0]=e=>{return o=d.value.order_no,void uni.setClipboardData({data:o,success:function(){uni.showToast({title:"复制成功",icon:"success",duration:2e3})},fail:function(){t("log","at pages/waybillDeliveryOrder/orderInfo.vue:149","复制失败")}});var o}),class:"icon",src:bn,mode:"aspectFill"})]),e.createVNode(g,{text:d.value.status_text,type:"primary",circle:""},null,8,["text"])]),e.createElementVNode("view",{class:"box-card"},[e.createElementVNode("view",{class:"label-icon"},[e.createElementVNode("text",{class:"label-title"},"地址信息")]),e.createElementVNode("view",{class:"label-content"},[e.createElementVNode("text",null,e.toDisplayString(d.value.address.first_name+" "+d.value.address.last_name),1),d.value.address.mobile?(e.openBlock(),e.createElementBlock("text",{key:0},[e.createTextVNode(" +"+e.toDisplayString(d.value.address.mobile_code+" "+d.value.address.mobile)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),d.value.address.email?(e.openBlock(),e.createElementBlock("text",{key:1},[e.createTextVNode(e.toDisplayString(d.value.address.email)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.address_line_1)+" ",1),e.createElementVNode("br")]),d.value.address.address_line_2?(e.openBlock(),e.createElementBlock("text",{key:2},[e.createTextVNode(e.toDisplayString(d.value.address.address_line_2)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),d.value.address.address_line_3?(e.openBlock(),e.createElementBlock("text",{key:3},[e.createTextVNode(e.toDisplayString(d.value.address.address_line_3)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.city+" "+d.value.address.district)+" ",1),e.createElementVNode("br")]),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.province)+" ",1),e.createElementVNode("br")]),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.zip_code)+" ",1),e.createElementVNode("br")])])]),e.createElementVNode("view",{class:"box-card"},[e.createElementVNode("text",null,[e.createTextVNode("客户派送日期: "),d.value.delivery_date?(e.openBlock(),e.createBlock(f,{key:0,date:d.value.delivery_date,format:"yyyy-MM-dd"},null,8,["date"])):(e.openBlock(),e.createElementBlock("text",{key:1},"无")),e.createElementVNode("br")]),e.createElementVNode("text",null,"备注: "+e.toDisplayString(d.value.remark||"无"),1)]),e.createElementVNode("view",{class:"box-card"},[e.createElementVNode("view",{class:"label-icon"},[e.createElementVNode("text",{class:"label-title"},"物流信息")]),e.createElementVNode("view",{class:"label-content"},[e.createElementVNode("text",null,[e.createTextVNode("派送渠道类型: "),e.createVNode(g,{text:m.value[d.value.delivery_type],type:"primary"},null,8,["text"]),e.createElementVNode("br")]),1===Number(d.value.delivery_type)?(e.openBlock(),e.createElementBlock("text",{key:0},[e.createTextVNode("司机: "+e.toDisplayString(h.value.driver_id[d.value.driver_id]||"无")+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),2===Number(d.value.delivery_type)?(e.openBlock(),e.createElementBlock("text",{key:1},[e.createTextVNode("快递公司: "),e.createVNode(g,{text:d.value.express.name||"无",type:"success",size:"small",circle:""},null,8,["text"]),e.createElementVNode("br")])):e.createCommentVNode("",!0),e.createElementVNode("text",null,[e.createTextVNode("物流单号: "+e.toDisplayString(d.value.express_no||"无")+" ",1),e.createElementVNode("br")]),e.createElementVNode("text",null,"追踪单号: "+e.toDisplayString(d.value.express_tracking_number||"无"),1)])])],512),[[e.vShow,0===n.value]]),e.withDirectives(e.createElementVNode("view",null," 选项卡2的内容 ",512),[[e.vShow,1===n.value]])]),e.createVNode(v,{ref_key:"messageRef",ref:u,type:"message"},{default:e.withCtx((()=>[e.createVNode(y,{type:l.value,message:c.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),Bn=u(In,[["__scopeId","data-v-7d603f2a"]]),An=e.defineComponent({__name:"index",setup(a){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref(1),g=e.ref([{text:"打印尾程面单",value:1},{text:"打印客户联(详细)",value:2},{text:"打印客户联(简单)",value:3}]),y=e.ref(),_=e.ref(!1),w=e.ref([]),b=e.ref([]);e.ref([]);const S=e.ref([1]),x=e.ref(0),C=e.ref([]),N=e.ref(),E=e.ref(),T=e.ref();let D;const V=e.ref({order_code:""}),I=e.reactive({order_code:{rules:[{required:!0,errorMessage:"单据编号不能为空"}]}}),B=async()=>{1===await(async()=>{let e=Qa.isIOS?await Qa.requestIOS("camera"):await Qa.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Qa.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{V.value.order_code=e.result,M()},fail:e=>{}})},A=()=>{d.value=!1,V.value.order_code=""},P=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},L=()=>{y.value.close(),D=setTimeout((()=>{A(),D&&clearTimeout(D)}),700)},O=e=>{0===e.detail.value.length?x.value=0:x.value=b.value[0].value},F=()=>{_.value=!0;const e=1===p.value?tn:"http://dsg.tms.api.aibasil.cn/admin/order.ScanOrder/printCustomerLabel";let o={order_no:V.value.order_code,printer_code:x.value},a="尾程面单打印";2===p.value&&(o.style="detail",a="打印客户联(详细)"),3===p.value&&(o.style="simple",a="打印客户联(简单)"),uni.request({url:e,method:"POST",header:{batoken:u.value},data:o,success:e=>{_.value=!1,t("log","at pages/printer/index.vue:233","打印成功",e),E.value=e.data.code?"success":"error",T.value=e.data.msg,N.value.open();const o={order_code:V.value.order_code,createTime:new Date,type:a,status:e.data.code};C.value.unshift(o),uni.setStorageSync("printLogHistory",C.value),R(),L()},fail:e=>{_.value=!1,t("log","at pages/printer/index.vue:251","打印失败",e),E.value="error",T.value="打印失败",N.value.open();const o={order_code:V.value.order_code,createTime:new Date,type:a,status:!1};C.value.unshift(o),uni.setStorageSync("printLogHistory",C.value),R(),L()}})},M=()=>{V.value.order_code?(d.value=!0,D&&clearTimeout(D),x.value=S.value.length>0?b.value[0].value:0,y.value.open(),d.value=!1):(E.value="error",T.value="请填写运单号",N.value.open())},R=()=>{C.value=uni.getStorageSync("printLogHistory")||[]},U=e=>{t("log","at pages/printer/index.vue:311",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&M()};return i((()=>{plus.key.addEventListener("keyup",U)})),r((()=>{plus.key.removeEventListener("keyup",U)})),s((()=>{h.value=!0,plus.key.removeEventListener("keyup",U)})),l((()=>{plus.key.removeEventListener("keyup",U)})),n((()=>{u.value=uni.getStorageSync("token"),h.value=!1,R(),uni.request({url:en,method:"GET",header:{batoken:u.value},success:e=>{1===e.data.code&&(w.value=e.data.data.printers,b.value=Object.values(w.value).map((e=>({text:e.name,value:e.value}))))},fail(e){t("log","at pages/printer/index.vue:288","fail--",e)}})})),c((e=>{0===e.index&&uni.navigateTo({url:"/pages/warehouseScan/warehouseLog"})})),(t,a)=>{const n=o(e.resolveDynamicComponent("uni-data-checkbox"),ba),s=o(e.resolveDynamicComponent("uni-easyinput"),v),i=o(e.resolveDynamicComponent("uni-forms-item"),k),r=o(e.resolveDynamicComponent("uni-forms"),Ma),l=o(e.resolveDynamicComponent("uni-icons"),f),c=o(e.resolveDynamicComponent("uni-popup-message"),Ua),u=o(e.resolveDynamicComponent("uni-popup"),Wa);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"checkbox"},[e.createVNode(n,{modelValue:p.value,"onUpdate:modelValue":a[0]||(a[0]=e=>p.value=e),localdata:g.value},null,8,["modelValue","localdata"])]),e.createVNode(r,{ref:"valiForm","label-align":"right","label-width":80,rules:I,modelValue:V.value},{default:e.withCtx((()=>[e.createVNode(i,{label:"单据编号",required:"",name:"order_code"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:V.value.order_code,"onUpdate:modelValue":a[1]||(a[1]=e=>V.value.order_code=e),placeholder:"请输入单据编号",suffixIcon:"scan",focus:m.value,onIconClick:B,onBlur:P,onConfirm:M},null,8,["modelValue","focus"])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:A},"重置"),e.createElementVNode("button",{type:"primary",onClick:M,loading:d.value},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(l,{key:0,type:"checkmarkempty",size:"18",color:"white"})),e.createTextVNode(" 打印 ")],8,["loading"])]),C.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(C.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.type)+" "+e.toDisplayString(t.order_code),5),t.status?(e.openBlock(),e.createBlock(l,{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(u,{ref_key:"messageRef",ref:N,type:"message"},{default:e.withCtx((()=>[e.createVNode(c,{type:E.value,message:T.value,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(u,{ref_key:"printerDialog",ref:y,type:"dialog","is-mask-click":!1},{default:e.withCtx((()=>[e.createElementVNode("view",{style:{width:"90%",margin:"0 auto","min-height":"250px","background-color":"#fff","border-radius":"5px"}},[e.createElementVNode("view",{class:"",style:{"font-size":"20px","border-bottom":"1px solid #e1e1e1",padding:"15px 10px"}},[e.createElementVNode("view",null,[e.createElementVNode("view",{style:{"margin-bottom":"20px"}},[e.createElementVNode("text",null,"打印尾程面单")]),e.createElementVNode("view",null,[w.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(n,{multiple:"",modelValue:S.value,"onUpdate:modelValue":a[2]||(a[2]=e=>S.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:O},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(n,{disabled:0===S.value.length,modelValue:x.value,"onUpdate:modelValue":a[3]||(a[3]=e=>x.value=e),localdata:b.value},null,8,["disabled","modelValue","localdata"])])])):e.createCommentVNode("",!0)])]),e.createElementVNode("view",{style:{"text-align":"center",position:"absolute",bottom:"10px",width:"90%",display:"flex",margin:"0 auto",left:"0",right:"0"}},[e.createElementVNode("button",{onClick:L,style:{width:"35%"}},"关闭"),e.createElementVNode("button",{onClick:F,"hover-stay-time":500,loading:_.value,disabled:0===S.value.length||_.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),Pn=u(An,[["__scopeId","data-v-87149d31"]]);__definePage("pages/home/index",p),__definePage("pages/instock/index",an),__definePage("pages/instock/instockLog",nn),__definePage("pages/profile/index",sn),__definePage("pages/login/index",rn),__definePage("pages/order/index",ln),__definePage("pages/scanLotno/index",hn),__definePage("pages/scanLotno/lotnoLog",mn),__definePage("pages/scanLotno/waybillsList",gn),__definePage("pages/warehouseScan/index",yn),__definePage("pages/warehouseScan/warehouseLog",vn),__definePage("pages/waybillNo/index",kn),__definePage("pages/waybillNo/waybillNoLog",_n),__definePage("pages/waybillDeliveryOrder/index",Sn),__definePage("pages/waybillDeliveryOrder/orderInfo",Bn),__definePage("pages/printer/index",Pn);const Ln={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:On,Vuex:Fn,Pinia:Mn}={app:e.createVueApp(Ln)};uni.Vuex=Fn,uni.Pinia=Mn,On.provide("__globalStyles",__uniConfig.styles),On._component.mpType="app",On._component.render=()=>{},On.mount("#app")}(Vue);