app-service.js 284 KB

1
  1. if("undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((a=>t.resolve(e()).then((()=>a))),(a=>t.resolve(e()).then((()=>{throw a}))))}),"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,...a){uni.__log__?uni.__log__(e,t,...a):console[e].apply(console,[...a,t])}function a(e,t){return"string"==typeof e?t:e}const n=t=>(a,n=e.getCurrentInstance())=>{!e.isInSSRComponentSetup&&e.injectHook(t,a,n)},o=n("onShow"),s=n("onHide"),i=n("onLoad"),r=n("onUnload"),l=n("onBackPress"),c=n("onNavigationBarButtonTap"),u=(e,t)=>{const a=e.__vccOpts||e;for(const[n,o]of t)a[n]=o;return a};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,a,n,o,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&&n.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:a[0]||(a[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,a)=>{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,a,n,o,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":n.showBorder}]),style:e.normalizeStyle({"border-left-color":n.borderColor})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],14,["id"])])}],["__scopeId","data-v-a6acbddc"]]),p=e.defineComponent({__name:"index",setup(n){const s=e.ref(null),i=e.ref(null),r=e.ref([{url:"/pages/inbound/index",src:"/static/inbound.png",text:"入库"},{url:"/pages/weigh/index",src:"/static/weigh.png",text:"称重"},{url:"/pages/outbound/index",src:"/static/outbound.png",text:"出库"},{url:"/pages/warehouseScan/index",src:"/static/houscan.png",text:"仓库扫描"},{url:"/pages/printer/index",src:"/static/print.png",text:"打印"},{url:"/pages/scanLotno/index",src:"/static/link.png",text:"托盘/批次"},{url:"/pages/waybillNo/index",src:"/static/link.png",text:"库位绑定"}]);o((()=>{s.value=uni.getStorageSync("token"),i.value=uni.getStorageSync("user"),t("log","at pages/home/index.vue:67","show---",{token:s.value,user:i.value})}));const l=()=>{};return(n,o)=>{const i=a(e.resolveDynamicComponent("uni-grid-item"),d),c=a(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,((a,n)=>(e.openBlock(),e.createBlock(i,{index:n,key:n},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"grid-item-box",onClick:e=>{return t("log","at pages/home/index.vue:70",n=a.url),void(s.value?uni.navigateTo({url:n}):uni.navigateTo({url:"/pages/login/index"}));var n}},[e.createElementVNode("image",{class:"image",src:a.src,mode:"aspectFill"},null,8,["src"]),e.createElementVNode("text",{class:"text"},e.toDisplayString(a.text),1)],8,["onClick"])])),_:2},1032,["index"])))),128))])),_:1})])}}}),f=[{font_class:"arrow-down",unicode:""},{font_class:"arrow-left",unicode:""},{font_class:"arrow-right",unicode:""},{font_class:"arrow-up",unicode:""},{font_class:"auth",unicode:""},{font_class:"auth-filled",unicode:""},{font_class:"back",unicode:""},{font_class:"bars",unicode:""},{font_class:"calendar",unicode:""},{font_class:"calendar-filled",unicode:""},{font_class:"camera",unicode:""},{font_class:"camera-filled",unicode:""},{font_class:"cart",unicode:""},{font_class:"cart-filled",unicode:""},{font_class:"chat",unicode:""},{font_class:"chat-filled",unicode:""},{font_class:"chatboxes",unicode:""},{font_class:"chatboxes-filled",unicode:""},{font_class:"chatbubble",unicode:""},{font_class:"chatbubble-filled",unicode:""},{font_class:"checkbox",unicode:""},{font_class:"checkbox-filled",unicode:""},{font_class:"checkmarkempty",unicode:""},{font_class:"circle",unicode:""},{font_class:"circle-filled",unicode:""},{font_class:"clear",unicode:""},{font_class:"close",unicode:""},{font_class:"closeempty",unicode:""},{font_class:"cloud-download",unicode:""},{font_class:"cloud-download-filled",unicode:""},{font_class:"cloud-upload",unicode:""},{font_class:"cloud-upload-filled",unicode:""},{font_class:"color",unicode:""},{font_class:"color-filled",unicode:""},{font_class:"compose",unicode:""},{font_class:"contact",unicode:""},{font_class:"contact-filled",unicode:""},{font_class:"down",unicode:""},{font_class:"bottom",unicode:""},{font_class:"download",unicode:""},{font_class:"download-filled",unicode:""},{font_class:"email",unicode:""},{font_class:"email-filled",unicode:""},{font_class:"eye",unicode:""},{font_class:"eye-filled",unicode:""},{font_class:"eye-slash",unicode:""},{font_class:"eye-slash-filled",unicode:""},{font_class:"fire",unicode:""},{font_class:"fire-filled",unicode:""},{font_class:"flag",unicode:""},{font_class:"flag-filled",unicode:""},{font_class:"folder-add",unicode:""},{font_class:"folder-add-filled",unicode:""},{font_class:"font",unicode:""},{font_class:"forward",unicode:""},{font_class:"gear",unicode:""},{font_class:"gear-filled",unicode:""},{font_class:"gift",unicode:""},{font_class:"gift-filled",unicode:""},{font_class:"hand-down",unicode:""},{font_class:"hand-down-filled",unicode:""},{font_class:"hand-up",unicode:""},{font_class:"hand-up-filled",unicode:""},{font_class:"headphones",unicode:""},{font_class:"heart",unicode:""},{font_class:"heart-filled",unicode:""},{font_class:"help",unicode:""},{font_class:"help-filled",unicode:""},{font_class:"home",unicode:""},{font_class:"home-filled",unicode:""},{font_class:"image",unicode:""},{font_class:"image-filled",unicode:""},{font_class:"images",unicode:""},{font_class:"images-filled",unicode:""},{font_class:"info",unicode:""},{font_class:"info-filled",unicode:""},{font_class:"left",unicode:""},{font_class:"link",unicode:""},{font_class:"list",unicode:""},{font_class:"location",unicode:""},{font_class:"location-filled",unicode:""},{font_class:"locked",unicode:""},{font_class:"locked-filled",unicode:""},{font_class:"loop",unicode:""},{font_class:"mail-open",unicode:""},{font_class:"mail-open-filled",unicode:""},{font_class:"map",unicode:""},{font_class:"map-filled",unicode:""},{font_class:"map-pin",unicode:""},{font_class:"map-pin-ellipse",unicode:""},{font_class:"medal",unicode:""},{font_class:"medal-filled",unicode:""},{font_class:"mic",unicode:""},{font_class:"mic-filled",unicode:""},{font_class:"micoff",unicode:""},{font_class:"micoff-filled",unicode:""},{font_class:"minus",unicode:""},{font_class:"minus-filled",unicode:""},{font_class:"more",unicode:""},{font_class:"more-filled",unicode:""},{font_class:"navigate",unicode:""},{font_class:"navigate-filled",unicode:""},{font_class:"notification",unicode:""},{font_class:"notification-filled",unicode:""},{font_class:"paperclip",unicode:""},{font_class:"paperplane",unicode:""},{font_class:"paperplane-filled",unicode:""},{font_class:"person",unicode:""},{font_class:"person-filled",unicode:""},{font_class:"personadd",unicode:""},{font_class:"personadd-filled",unicode:""},{font_class:"personadd-filled-copy",unicode:""},{font_class:"phone",unicode:""},{font_class:"phone-filled",unicode:""},{font_class:"plus",unicode:""},{font_class:"plus-filled",unicode:""},{font_class:"plusempty",unicode:""},{font_class:"pulldown",unicode:""},{font_class:"pyq",unicode:""},{font_class:"qq",unicode:""},{font_class:"redo",unicode:""},{font_class:"redo-filled",unicode:""},{font_class:"refresh",unicode:""},{font_class:"refresh-filled",unicode:""},{font_class:"refreshempty",unicode:""},{font_class:"reload",unicode:""},{font_class:"right",unicode:""},{font_class:"scan",unicode:""},{font_class:"search",unicode:""},{font_class:"settings",unicode:""},{font_class:"settings-filled",unicode:""},{font_class:"shop",unicode:""},{font_class:"shop-filled",unicode:""},{font_class:"smallcircle",unicode:""},{font_class:"smallcircle-filled",unicode:""},{font_class:"sound",unicode:""},{font_class:"sound-filled",unicode:""},{font_class:"spinner-cycle",unicode:""},{font_class:"staff",unicode:""},{font_class:"staff-filled",unicode:""},{font_class:"star",unicode:""},{font_class:"star-filled",unicode:""},{font_class:"starhalf",unicode:""},{font_class:"trash",unicode:""},{font_class:"trash-filled",unicode:""},{font_class:"tune",unicode:""},{font_class:"tune-filled",unicode:""},{font_class:"undo",unicode:""},{font_class:"undo-filled",unicode:""},{font_class:"up",unicode:""},{font_class:"top",unicode:""},{font_class:"upload",unicode:""},{font_class:"upload-filled",unicode:""},{font_class:"videocam",unicode:""},{font_class:"videocam-filled",unicode:""},{font_class:"vip",unicode:""},{font_class:"vip-filled",unicode:""},{font_class:"wallet",unicode:""},{font_class:"wallet-filled",unicode:""},{font_class:"weibo",unicode:""},{font_class:"weixin",unicode:""}];const g=u({name:"UniIcons",emits:["click"],props:{type:{type:String,default:""},color:{type:String,default:"#333333"},size:{type:[Number,String],default:16},customPrefix:{type:String,default:""},fontFamily:{type:String,default:""}},data:()=>({icons:f}),computed:{unicode(){let e=this.icons.find((e=>e.font_class===this.type));return e?e.unicode:""},iconSize(){return"number"==typeof(e=this.size)||/^[0-9]*$/g.test(e)?e+"px":e;var e},styleObj(){return""!==this.fontFamily?`color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`:`color: ${this.color}; font-size: ${this.iconSize};`}},methods:{_onClick(){this.$emit("click")}}},[["render",function(t,a,n,o,s,i){return e.openBlock(),e.createElementBlock("text",{style:e.normalizeStyle(i.styleObj),class:e.normalizeClass(["uni-icons",["uniui-"+n.type,n.customPrefix,n.customPrefix?n.type:""]]),onClick:a[0]||(a[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 a in e){t+=`${a}:${e[a]};`}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 a in e)e[a]&&(t+=`${a} `);return t}({"is-input-border":this.inputBorder,"is-input-error-border":this.inputBorder&&this.msg,"is-textarea":"textarea"===this.type,"is-disabled":this.disabled,"is-focused":this.focusShow})},inputContentStyle(){const e=this.focusShow?this.primaryColor:this.styles.borderColor;return y({"border-color":(this.inputBorder&&this.msg?"#dd524d":e)||"#e5e5e5","background-color":this.disabled?this.styles.disableColor:this.styles.backgroundColor})},inputStyle(){return y({"padding-right":"password"===this.type||this.clearable||this.prefixIcon?"":"10px","padding-left":this.prefixIcon?"":"10px"})}},watch:{value(e){this.val=e},modelValue(e){this.val=e},focus(e){this.$nextTick((()=>{this.focused=this.focus,this.focusShow=this.focus}))}},created(){this.init(),this.form&&this.formItem&&this.$watch("formItem.errMsg",(e=>{this.localMsg=e}))},mounted(){this.$nextTick((()=>{this.focused=this.focus,this.focusShow=this.focus}))},methods:{init(){this.value||0===this.value?this.val=this.value:this.modelValue||0===this.modelValue||""===this.modelValue?this.val=this.modelValue:this.val=null},onClickIcon(e){this.$emit("iconClick",e)},onEyes(){this.showPassword=!this.showPassword,this.$emit("eyes",this.showPassword)},onInput(e){let t=e.detail.value;this.trim&&("boolean"==typeof this.trim&&this.trim&&(t=this.trimStr(t)),"string"==typeof this.trim&&(t=this.trimStr(t,this.trim))),this.errMsg&&(this.errMsg=""),this.val=t,this.$emit("input",t),this.$emit("update:modelValue",t)},onFocus(){this.$nextTick((()=>{this.focused=!0})),this.$emit("focus",null)},_Focus(e){this.focusShow=!0,this.$emit("focus",e)},onBlur(){this.focused=!1,this.$emit("focus",null)},_Blur(e){if(e.detail.value,this.focusShow=!1,this.$emit("blur",e),!1===this.isEnter&&this.$emit("change",this.val),this.form&&this.formItem){const{validateTrigger:e}=this.form;"blur"===e&&this.formItem.onFieldChange()}},onConfirm(e){this.$emit("confirm",this.val),this.isEnter=!0,this.$emit("change",this.val),this.$nextTick((()=>{this.isEnter=!1}))},onClear(e){this.val="",this.$emit("input",""),this.$emit("update:modelValue",""),this.$emit("clear")},onkeyboardheightchange(e){this.$emit("keyboardheightchange",e)},trimStr:(e,t="both")=>"both"===t?e.trim():"left"===t?e.trimLeft():"right"===t?e.trimRight():"start"===t?e.trimStart():"end"===t?e.trimEnd():"all"===t?e.replace(/\s+/g,""):e}},[["render",function(t,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["uni-easyinput",{"uni-easyinput-error":r.msg}]),style:e.normalizeStyle(r.boxStyle)},[e.createElementVNode("view",{class:e.normalizeClass(["uni-easyinput__content",r.inputContentClass]),style:e.normalizeStyle(r.inputContentStyle)},[o.prefixIcon?(e.openBlock(),e.createBlock(l,{key:0,class:"content-clear-icon",type:o.prefixIcon,color:"#c0c4cc",onClick:n[0]||(n[0]=e=>r.onClickIcon("prefix")),size:"22"},null,8,["type"])):e.createCommentVNode("",!0),"textarea"===o.type?(e.openBlock(),e.createElementBlock("textarea",{key:1,class:e.normalizeClass(["uni-easyinput__content-textarea",{"input-padding":o.inputBorder}]),name:o.name,value:i.val,placeholder:o.placeholder,placeholderStyle:o.placeholderStyle,disabled:o.disabled,"placeholder-class":"uni-easyinput__placeholder-class",maxlength:r.inputMaxlength,focus:i.focused,autoHeight:o.autoHeight,"cursor-spacing":o.cursorSpacing,onInput:n[1]||(n[1]=(...e)=>r.onInput&&r.onInput(...e)),onBlur:n[2]||(n[2]=(...e)=>r._Blur&&r._Blur(...e)),onFocus:n[3]||(n[3]=(...e)=>r._Focus&&r._Focus(...e)),onConfirm:n[4]||(n[4]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:n[5]||(n[5]=(...e)=>r.onkeyboardheightchange&&r.onkeyboardheightchange(...e))},null,42,["name","value","placeholder","placeholderStyle","disabled","maxlength","focus","autoHeight","cursor-spacing"])):(e.openBlock(),e.createElementBlock("input",{key:2,type:"password"===o.type?"text":o.type,class:"uni-easyinput__content-input",style:e.normalizeStyle(r.inputStyle),name:o.name,value:i.val,password:!i.showPassword&&"password"===o.type,placeholder:o.placeholder,placeholderStyle:o.placeholderStyle,"placeholder-class":"uni-easyinput__placeholder-class",disabled:o.disabled,maxlength:r.inputMaxlength,focus:i.focused,confirmType:o.confirmType,"cursor-spacing":o.cursorSpacing,onFocus:n[6]||(n[6]=(...e)=>r._Focus&&r._Focus(...e)),onBlur:n[7]||(n[7]=(...e)=>r._Blur&&r._Blur(...e)),onInput:n[8]||(n[8]=(...e)=>r.onInput&&r.onInput(...e)),onConfirm:n[9]||(n[9]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:n[10]||(n[10]=(...e)=>r.onkeyboardheightchange&&r.onkeyboardheightchange(...e))},null,44,["type","name","value","password","placeholder","placeholderStyle","disabled","maxlength","focus","confirmType","cursor-spacing"])),"password"===o.type&&o.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"===o.type}]),type:i.showPassword?"eye-slash-filled":"eye-filled",size:22,color:i.focusShow?o.primaryColor:"#c0c4cc",onClick:r.onEyes},null,8,["class","type","color","onClick"])):e.createCommentVNode("",!0)],64)):o.suffixIcon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[o.suffixIcon?(e.openBlock(),e.createBlock(l,{key:0,class:"content-clear-icon",type:o.suffixIcon,color:"#c0c4cc",onClick:n[11]||(n[11]=e=>r.onClickIcon("suffix")),size:"22"},null,8,["type"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[o.clearable&&r.isVal&&!o.disabled&&"textarea"!==o.type?(e.openBlock(),e.createBlock(l,{key:0,class:e.normalizeClass(["content-clear-icon",{"is-textarea-icon":"textarea"===o.type}]),type:"clear",size:o.clearSize,color:r.msg?"#dd524d":i.focusShow?o.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:a,localData:n,errShowType:o,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},a),d||void 0!==e&&""!==e||(h=null),h&&h.errorMessage?("undertext"===o&&(this.errMsg=h?h.errorMessage:""),"toast"===o&&uni.showToast({title:h.errorMessage||"校验错误",icon:"none"}),"modal"===o&&uni.showModal({title:"提示",content:h.errorMessage||"校验错误"})):this.errMsg="",s(h||null)):this.errMsg="",h||null},init(e=!1){const{validator:t,formRules:a,childrens:n,formData:o,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&&n.push(this),!t||!a)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 a&&d&&(a[u]={rules:d},t.updateSchema(a));const h=a[u]||{};this.itemRules=h,this.validator=t,this.itemSetValue(l(this.name,s))},unInit(){if(this.form){const{childrens:e,formData:t,_realName:a}=this.form;e.forEach(((e,n)=>{e===this&&(this.form.childrens.splice(n,1),delete t[a(e.name)])}))}},itemSetValue(e){const t=this.form._realName(this.name),a=this.itemRules.rules||[],n=this.form._getValue(t,e,a);return this.form._setDataValue(t,this.form.formData,n),n},clearValidate(){this.errMsg=""},_isRequired(){return this.required},_justifyContent(){if(this.form){const{labelAlign:e}=this.form;let t=this.labelAlign?this.labelAlign:e;if("left"===t)return"flex-start";if("center"===t)return"center";if("right"===t)return"flex-end"}return"flex-start"},_labelWidthUnit(e){return this.num2px(this.labelWidth?this.labelWidth:e||(this.label?70:"auto"))},_labelPosition(){return this.form&&this.form.labelPosition||"left"},isTrigger:(e,t,a)=>"submit"!==e&&e?"bind":void 0===e?"bind"!==t?t?"submit":""===a?"bind":"submit":"bind":"submit",num2px:e=>"number"==typeof e?`${e}px`:e}},[["render",function(t,a,n,o,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":!n.label&&!n.required}]),style:e.normalizeStyle({width:s.localLabelWidth,justifyContent:s.localLabelAlign})},[n.required?(e.openBlock(),e.createElementBlock("text",{key:0,class:"is-required"},"*")):e.createCommentVNode("",!0),e.createElementVNode("text",null,e.toDisplayString(n.label),1)],6)]),!0),e.createElementVNode("view",{class:"uni-forms-item__content"},[e.renderSlot(t.$slots,"default",{},void 0,!0),e.createElementVNode("view",{class:e.normalizeClass(["uni-forms-item__error",{"msg--active":i.msg}])},[e.createElementVNode("text",null,e.toDisplayString(i.msg),1)],2)])],2)}],["__scopeId","data-v-7b97b15c"]]);var w={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 b={int:"integer",bool:"boolean",double:"number",long:"number",password:"string"};function _(e,t=""){["label"].forEach((t=>{void 0===e[t]&&(e[t]="")}));let a=t;for(let n in e){let t=new RegExp("{"+n+"}");a=a.replace(t,e[n])}return a}const x={integer:e=>x.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 x.number(e)&&!x.integer(e)},array:e=>Array.isArray(e),object:e=>"object"==typeof e&&!x.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(w.email)&&e.length<255,url:e=>"string"==typeof e&&!!e.match(w.url),pattern(e,t){try{return new RegExp(e).test(t)}catch(mt){return!1}},method:e=>"function"==typeof e,idcard:e=>"string"==typeof e&&!!e.match(w.idcard),"url-https"(e){return this.url(e)&&e.startsWith("https://")},"url-scheme":e=>e.startsWith("://"),"url-web":e=>!1};const S={required:(e,t,a)=>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)?_(e,e.errorMessage||a.required):null,range(e,t,a){const{range:n,errorMessage:o}=e;let s=new Array(n.length);for(let r=0;r<n.length;r++){const e=n[r];x.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:_(e,o||a.enum)},rangeNumber(e,t,a){if(!x.number(t))return _(e,e.errorMessage||a.pattern.mismatch);let{minimum:n,maximum:o,exclusiveMinimum:s,exclusiveMaximum:i}=e,r=s?t<=n:t<n,l=i?t>=o:t>o;return void 0!==n&&r?_(e,e.errorMessage||a.number[s?"exclusiveMinimum":"minimum"]):void 0!==o&&l?_(e,e.errorMessage||a.number[i?"exclusiveMaximum":"maximum"]):void 0!==n&&void 0!==o&&(r||l)?_(e,e.errorMessage||a.number.range):null},rangeLength(e,t,a){if(!x.string(t)&&!x.array(t))return _(e,e.errorMessage||a.pattern.mismatch);let n=e.minLength,o=e.maxLength,s=t.length;return void 0!==n&&s<n?_(e,e.errorMessage||a.length.minLength):void 0!==o&&s>o?_(e,e.errorMessage||a.length.maxLength):void 0!==n&&void 0!==o&&(s<n||s>o)?_(e,e.errorMessage||a.length.range):null},pattern:(e,t,a)=>x.pattern(e.pattern,t)?null:_(e,e.errorMessage||a.pattern.mismatch),format(e,t,a){var n=Object.keys(x),o=b[e.format]?b[e.format]:e.format||e.arrayType;return n.indexOf(o)>-1&&!x[o](t)?_(e,e.errorMessage||a.typeError):null},arrayTypeFormat(e,t,a){if(!Array.isArray(t))return _(e,e.errorMessage||a.typeError);for(let n=0;n<t.length;n++){const o=t[n];let s=this.format(e,o,a);if(null!==s)return s}return null}};class C extends class{constructor(e){this._message=e}async validateRule(e,t,a,n,o){var s=null;let i=t.rules;if(i.findIndex((e=>e.required))<0){if(null==a)return s;if("string"==typeof a&&!a.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}"]`}),S[u]&&null!=(s=S[u](c,a,r)))break;if(c.validateExpr){let e=Date.now();if(!1===c.validateExpr(a,o,e)){s=this._getMessage(c,c.errorMessage||this._message.default);break}}if(c.validateFunction&&null!==(s=await this.validateFunction(c,a,n,o,u)))break}return null!==s&&(s=r.TAG+s),s}async validateFunction(e,t,a,n,o){let s=null;try{let i=null;const r=await e.validateFunction(e,t,n||a,(e=>{i=e}));(i||"string"==typeof r&&r||!1===r)&&(s=this._getMessage(e,i||r,o))}catch(mt){s=this._getMessage(e,mt.message,o)}return s}_getMessage(e,t,a){return _(e,t||e.errorMessage||this._message[a]||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(C.message),this._schema=e,this._options=t||null}updateSchema(e){this._schema=e}async validate(e,t){let a=this._checkFieldInSchema(e);return a||(a=await this.invokeValidate(e,!1,t)),a.length?a[0]:null}async validateAll(e,t){let a=this._checkFieldInSchema(e);return a||(a=await this.invokeValidate(e,!0,t)),a}async validateUpdate(e,t){let a=this._checkFieldInSchema(e);return a||(a=await this.invokeValidateUpdate(e,!1,t)),a.length?a[0]:null}async invokeValidate(e,t,a){let n=[],o=this._schema;for(let s in o){let i=o[s],r=await this.validateRule(s,i,e[s],e,a);if(null!=r&&(n.push({key:s,errorMessage:r}),!t))break}return n}async invokeValidateUpdate(e,t,a){let n=[];for(let o in e){let s=await this.validateRule(o,this._schema[o],e[o],e,a);if(null!=s&&(n.push({key:o,errorMessage:s}),!t))break}return n}_checkFieldInSchema(e){var t=Object.keys(e),a=Object.keys(this._schema);if(new Set(t.concat(a)).size===a.length)return"";var n=t.filter((e=>a.indexOf(e)<0));return[{key:"invalid",errorMessage:_({field:JSON.stringify(n)},C.message.TAG+C.message.defaultInvalid)}]}}C.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 N=(e,t,a)=>{const n=a.find((e=>{return e.format&&("int"===(t=e.format)||"double"===t||"number"===t||"timestamp"===t);var t})),o=a.find((e=>e.format&&"boolean"===e.format||"bool"===e.format));return n&&(t=t||0===t?A(Number(t))?Number(t):t:null),o&&(t=!!P(t)&&t),t},E=(e,t)=>I(t,e),V=(e,t={})=>{const a=D(e);if("object"==typeof a&&Array.isArray(a)&&a.length>1){return a.reduce(((e,t)=>e+`#${t}`),"_formdata_")}return a[0]||e},T=e=>{let t=e.replace("_formdata_#","");return t=t.split("#").map((e=>A(e)?Number(e):e)),t},B=(e,t,a)=>("object"!=typeof e||D(t).reduce(((e,t,n,o)=>n===o.length-1?(e[t]=a,null):(t in e||(e[t]=/^[0-9]{1,}$/.test(o[n+1])?[]:{}),e[t])),e),e);function D(e){return Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,"").split(".")}const I=(e,t,a="undefined")=>{let n=D(t).reduce(((e,t)=>(e||{})[t]),e);return n&&void 0===n?a:n},A=e=>!isNaN(Number(e)),P=e=>"boolean"==typeof e;const L=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,a,n){if(n)this.$refs[n].setValue(e,a);else{let n;for(let e in this.$refs){const t=this.$refs[e];if(t&&t.$options&&"uniForms"===t.$options.name){n=t;break}}if(!n)return t("error","at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:182","当前 uni-froms 组件缺少 ref 属性");n.setValue(e,a)}}),this.childrens=[],this.inputChildrens=[],this.setRules(this.rules)},methods:{setRules(e){this.formRules=Object.assign({},this.formRules,e),this.validator=new C(e)},setValue(e,t){let a=this.childrens.find((t=>t.name===e));return a?(this.formData[e]=N(0,t,this.formRules[e]&&this.formRules[e].rules||[]),a.onFieldChange(this.formData[e])):null},validate(e,t){return this.checkAll(this.formData,e,t)},validateField(e=[],t){e=[].concat(e);let a={};return this.childrens.forEach((t=>{const n=V(t.name);-1!==e.indexOf(n)&&(a=Object.assign({},a,{[n]:this.formData[n]}))})),this.checkAll(a,[],t)},clearValidate(e=[]){e=[].concat(e),this.childrens.forEach((t=>{if(0===e.length)t.errMsg="";else{const a=V(t.name);-1!==e.indexOf(a)&&(t.errMsg="")}}))},submit(e,a,n){for(let t in this.dataValue){this.childrens.find((e=>e.name===t))&&void 0===this.formData[t]&&(this.formData[t]=this._getValue(t,this.dataValue[t]))}return n||t("warn","at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:289","submit 方法即将废弃,请使用validate方法代替!"),this.checkAll(this.formData,e,a,"submit")},async checkAll(e,t,a,n){if(!this.validator)return;let o,s=[];for(let c in e){const e=this.childrens.find((e=>V(e.name)===c));e&&s.push(e)}a||"function"!=typeof t||(a=t),!a&&"function"!=typeof a&&Promise&&(o=new Promise(((e,t)=>{a=function(a,n){a?t(a):e(n)}})));let i=[],r=JSON.parse(JSON.stringify(e));for(let c in s){const e=s[c];let t=V(e.name);const a=await e.onFieldChange(r[t]);if(a&&(i.push(a),"toast"===this.errShowType||"modal"===this.errShowType))break}Array.isArray(i)&&0===i.length&&(i=null),Array.isArray(t)&&t.forEach((e=>{let t=V(e),a=E(e,this.localData);void 0!==a&&(r[t]=a)})),"submit"===n?this.$emit("submit",{detail:{value:r,errors:i}}):this.$emit("validate",i);let l={};return l=((e={},t)=>{let a=JSON.parse(JSON.stringify(e)),n={};for(let o in a){let e=T(o);B(n,e,a[o])}return n})(r,this.name),a&&"function"==typeof a&&a(i,l),o&&a?o:null},validateCheck(e){this.$emit("validate",e)},_getValue:N,_isRequiredField:e=>{let t=!1;for(let a=0;a<e.length;a++){if(e[a].required){t=!0;break}}return t},_setDataValue:(e,t,a)=>(t[e]=a,a||""),_getDataValue:E,_realName:V,_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 a=toString.call(e);if(a!==toString.call(t))return!1;switch(a){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]"==a){var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!=o.length)return!1;for(var s=0;s<n.length;s++){var i=n[s];if(e[i]!==t[i])return!1}return!0}return"[object Array]"==a?e.toString()==t.toString():void 0}}},[["render",function(t,a,n,o,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"]]),O={data:()=>({}),created(){this.popup=this.getParent()},methods:{getParent(e="uniPopup"){let t=this.$parent,a=t.$options.name;for(;a!==e;){if(t=t.$parent,!t)return!1;a=t.$options.name}return t}}};const M=u({name:"uniPopupMessage",mixins:[O],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,a,n,o,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__"+n.type])},[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("text",{class:e.normalizeClass(["uni-popup-message-text","uni-popup__"+n.type+"-text"])},e.toDisplayString(n.message),3)]),!0)],2)])}],["__scopeId","data-v-d81cfb56"]]);class F{constructor(e,t){this.options=e,this.animation=uni.createAnimation({...e}),this.currentStepAnimates={},this.next=0,this.$=t}_nvuePushAnimates(e,t){let a=this.currentStepAnimates[this.next],n={};if(n=a||{styles:{},config:{}},R.includes(e)){n.styles.transform||(n.styles.transform="");let a="";"rotate"===e&&(a="deg"),n.styles.transform+=`${e}(${t+a}) `}else n.styles[e]=`${t}`;this.currentStepAnimates[this.next]=n}_animateRun(e={},t={}){let a=this.$.$refs.ani.ref;if(a)return new Promise(((n,o)=>{nvueAnimation.transition(a,{styles:e,...t},(e=>{n()}))}))}_nvueNextAnimate(e,t=0,a){let n=e[t];if(n){let{styles:o,config:s}=n;this._animateRun(o,s).then((()=>{t+=1,this._nvueNextAnimate(e,t,a)}))}else this.currentStepAnimates={},"function"==typeof a&&a(),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 R=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function $(e,t){if(t)return clearTimeout(t.timer),new F(e,t)}R.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((e=>{F.prototype[e]=function(...t){return this.animation[e](...t),this}}));const U=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 a in e){t+=this.toLine(a)+":"+e[a]+";"}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=$(Object.assign(this.config,e),this)},onClick(){this.$emit("click",{detail:this.isShow})},step(e,a={}){if(this.animation){for(let a in e)try{"object"==typeof e[a]?this.animation[a](...e[a]):this.animation[a](e[a])}catch(mt){t("error","at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148",`方法 ${a} 不存在`)}return this.animation.step(a),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=$(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:""},a=(e,a)=>{"fade"===a?t.opacity=this.animationType(e)[a]:t.transform+=this.animationType(e)[a]+" "};return"string"==typeof this.modeClass?a(e,this.modeClass):this.modeClass.forEach((t=>{a(e,t)})),t},tranfromInit(e){let t=(e,t)=>{let a=null;"fade"===t?a=e?0:1:(a=e?"-100%":"0","zoom-in"===t&&(a=e?.8:1),"zoom-out"===t&&(a=e?1.2:1),"slide-right"===t&&(a=e?"100%":"0"),"slide-bottom"===t&&(a=e?"100%":"0")),this.animation[this.animationMode()[t]](a)};return"string"==typeof this.modeClass?t(e,this.modeClass):this.modeClass.forEach((a=>{t(e,a)})),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,a,n,o,s,i){return e.withDirectives((e.openBlock(),e.createElementBlock("view",{ref:"ani",animation:s.animationData,class:e.normalizeClass(n.customClass),style:e.normalizeStyle(i.transformStyles),onClick:a[0]||(a[0]=(...e)=>i.onClick&&i.onClick(...e))},[e.renderSlot(t.$slots,"default")],14,["animation"])),[[e.vShow,s.isShow]])}]]),z={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:a,safeArea:n,screenHeight:o,safeAreaInsets:s}=uni.getSystemInfoSync();this.popupWidth=e,this.popupHeight=t+(a||0),n&&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 j=u(z,[["render",function(t,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-transition"),U);return i.showPopup?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass(["uni-popup",[i.popupstyle,r.isDesktop?"fixforpc-z-index":""]])},[e.createElementVNode("view",{onTouchstart:n[1]||(n[1]=(...e)=>r.touchstart&&r.touchstart(...e))},[i.maskShow?(e.openBlock(),e.createBlock(l,{key:"1",name:"mask","mode-class":"fade",styles:i.maskClass,duration:i.duration,show:i.showTrans,onClick:r.onTap},null,8,["styles","duration","show","onClick"])):e.createCommentVNode("",!0),e.createVNode(l,{key:"2","mode-class":i.ani,name:"content",styles:i.transClass,duration:i.duration,show:i.showTrans,onClick:r.onTap},{default:e.withCtx((()=>[e.createElementVNode("view",{class:e.normalizeClass(["uni-popup__wrapper",[i.popupstyle]]),style:e.normalizeStyle({backgroundColor:r.bg}),onClick:n[0]||(n[0]=(...e)=>r.clear&&r.clear(...e))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],6)])),_:3},8,["mode-class","styles","duration","show","onClick"])],32)],2)):e.createCommentVNode("",!0)}],["__scopeId","data-v-27baf609"]]),q=["{","}"];const H=/^(?:\d)+/,W=/^(?:\w)+/;const J="zh-Hans",K="zh-Hant",G="en",Y=Object.prototype.hasOwnProperty,Q=(e,t)=>Y.call(e,t),Z=new class{constructor(){this._caches=Object.create(null)}interpolate(e,t,a=q){if(!t)return[e];let n=this._caches[e];return n||(n=function(e,[t,a]){const n=[];let o=0,s="";for(;o<e.length;){let i=e[o++];if(i===t){s&&n.push({type:"text",value:s}),s="";let t="";for(i=e[o++];void 0!==i&&i!==a;)t+=i,i=e[o++];const r=i===a,l=H.test(t)?"list":r&&W.test(t)?"named":"unknown";n.push({value:t,type:l})}else s+=i}return s&&n.push({type:"text",value:s}),n}(e,a),this._caches[e]=n),function(e,t){const a=[];let n=0;const o=Array.isArray(t)?"list":(s=t,null!==s&&"object"==typeof s?"named":"unknown");var s;if("unknown"===o)return a;for(;n<e.length;){const s=e[n];switch(s.type){case"text":a.push(s.value);break;case"list":a.push(t[parseInt(s.value,10)]);break;case"named":"named"===o&&a.push(t[s.value])}n++}return a}(n,t)}};function X(e,t){if(!e)return;if(e=e.trim().replace(/_/g,"-"),t&&t[e])return e;if("chinese"===(e=e.toLowerCase()))return J;if(0===e.indexOf("zh"))return e.indexOf("-hans")>-1?J:e.indexOf("-hant")>-1?K:(a=e,["-tw","-hk","-mo","-cht"].find((e=>-1!==a.indexOf(e)))?K:J);var a;let n=[G,"fr","es"];t&&Object.keys(t).length>0&&(n=Object.keys(t));const o=function(e,t){return t.find((t=>0===e.indexOf(t)))}(e,n);return o||void 0}class ee{constructor({locale:e,fallbackLocale:t,messages:a,watcher:n,formater:o}){this.locale=G,this.fallbackLocale=G,this.message={},this.messages={},this.watchers=[],t&&(this.fallbackLocale=t),this.formater=o||Z,this.messages=a||{},this.setLocale(e||G),n&&this.watchLocale(n)}setLocale(e){const t=this.locale;this.locale=X(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,a=!0){const n=this.messages[e];n?a?Object.assign(n,t):Object.keys(t).forEach((e=>{Q(n,e)||(n[e]=t[e])})):this.messages[e]=t}f(e,t,a){return this.formater.interpolate(e,t,a).join("")}t(e,t,a){let n=this.message;return"string"==typeof t?(t=X(t,this.messages))&&(n=this.messages[t]):a=t,Q(n,e)?this.formater.interpolate(n[e],a).join(""):(console.warn(`Cannot translate the value of keypath ${e}. Use the value of keypath as default.`),e)}}function te(e,t={},a,n){if("string"!=typeof e){const a=[t,e];e=a[0],t=a[1]}"string"!=typeof e&&(e="undefined"!=typeof uni&&uni.getLocale?uni.getLocale():"undefined"!=typeof global&&global.getLocale?global.getLocale():G),"string"!=typeof a&&(a="undefined"!=typeof __uniConfig&&__uniConfig.fallbackLocale||G);const o=new ee({locale:e,fallbackLocale:a,messages:t,watcher:n});let s=(e,t)=>{if("function"!=typeof getApp)s=function(e,t){return o.t(e,t)};else{let e=!1;s=function(t,a){const n=getApp().$vm;return n&&(n.$locale,e||(e=!0,function(e,t){e.$watchLocale?e.$watchLocale((e=>{t.setLocale(e)})):e.$watch((()=>e.$locale),(e=>{t.setLocale(e)}))}(n,o))),o.t(t,a)}}return s(e,t)};return{i18n:o,f:(e,t,a)=>o.f(e,t,a),t:(e,t)=>s(e,t),add:(e,t,a=!0)=>o.add(e,t,a),watch:e=>o.watchLocale(e),getLocale:()=>o.getLocale(),setLocale:e=>o.setLocale(e)}}const ae={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:ne}=te(ae);const oe=u({name:"uniPopupDialog",mixins:[O],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||ne("uni-popup.ok")},closeText(){return this.cancelText||ne("uni-popup.cancel")},placeholderText(){return this.placeholder||ne("uni-popup.placeholder")},titleText(){return this.title||ne("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,a,n,o,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"===n.mode?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-dialog-content"},[e.renderSlot(t.$slots,"default",{},(()=>[e.createElementVNode("text",{class:"uni-dialog-content-text"},e.toDisplayString(n.content),1)]),!0)])):(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-dialog-content"},[e.renderSlot(t.$slots,"default",{},(()=>[e.withDirectives(e.createElementVNode("input",{class:"uni-dialog-input","onUpdate:modelValue":a[0]||(a[0]=e=>s.val=e),type:n.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:a[1]||(a[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:a[2]||(a[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"]]),se={pages:[{path:"pages/home/index",style:{navigationBarTitleText:"英途仓库"}},{path:"pages/weigh/index",style:{navigationBarTitleText:"称重","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"历史"}],backButton:{background:"#00FF00"}}}}},{path:"pages/weigh/instockLog",style:{navigationBarTitleText:"录入历史"}},{path:"pages/inbound/index",style:{navigationBarTitleText:"入库","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"历史"}],backButton:{background:"#00FF00"}}}}},{path:"pages/inbound/instockLog",style:{navigationBarTitleText:"录入历史"}},{path:"pages/outbound/index",style:{navigationBarTitleText:"出库","app-plus":{bounce:"none",titleNView:{buttons:[{fontSize:"16px",text:"历史"}],backButton:{background:"#00FF00"}}}}},{path:"pages/outbound/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 ie(e,t,a){return e(a={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&a.path)}},a.exports),a.exports}var re=ie((function(e,t){var a;e.exports=(a=a||function(e,t){var a=Object.create||function(){function e(){}return function(t){var a;return e.prototype=t,a=new e,e.prototype=null,a}}(),n={},o=n.lib={},s=o.Base={extend:function(e){var t=a(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=o.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,a=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<o;s++){var i=a[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=i<<24-(n+s)%4*8}else for(s=0;s<o;s+=4)t[n+s>>>2]=a[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,a=this.sigBytes;t[a>>>2]&=4294967295<<32-a%4*8,t.length=e.ceil(a/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var a,n=[],o=function(t){var a=987654321,n=4294967295;return function(){var o=((a=36969*(65535&a)+(a>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},s=0;s<t;s+=4){var r=o(4294967296*(a||e.random()));a=987654071*r(),n.push(4294967296*r()|0)}return new i.init(n,t)}}),r=n.enc={},l=r.Hex={stringify:function(e){for(var t=e.words,a=e.sigBytes,n=[],o=0;o<a;o++){var s=t[o>>>2]>>>24-o%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,a=[],n=0;n<t;n+=2)a[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new i.init(a,t/2)}},c=r.Latin1={stringify:function(e){for(var t=e.words,a=e.sigBytes,n=[],o=0;o<a;o++){var s=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,a=[],n=0;n<t;n++)a[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new i.init(a,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=o.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 a=this._data,n=a.words,o=a.sigBytes,s=this.blockSize,r=o/(4*s),l=(r=t?e.ceil(r):e.max((0|r)-this._minBufferSize,0))*s,c=e.min(4*l,o);if(l){for(var u=0;u<l;u+=s)this._doProcessBlock(n,u);var d=n.splice(0,l);a.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});o.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,a){return new e.init(a).finalize(t)}},_createHmacHelper:function(e){return function(t,a){return new h.HMAC.init(e,a).finalize(t)}}});var h=n.algo={};return n}(Math),a)})),le=re,ce=(ie((function(e,t){var a;e.exports=(a=le,function(e){var t=a,n=t.lib,o=n.WordArray,s=n.Hasher,i=t.algo,r=[];!function(){for(var t=0;t<64;t++)r[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=i.MD5=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var a=0;a<16;a++){var n=t+a,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var s=this._hash.words,i=e[t+0],l=e[t+1],m=e[t+2],p=e[t+3],f=e[t+4],g=e[t+5],y=e[t+6],v=e[t+7],k=e[t+8],w=e[t+9],b=e[t+10],_=e[t+11],x=e[t+12],S=e[t+13],C=e[t+14],N=e[t+15],E=s[0],V=s[1],T=s[2],B=s[3];E=c(E,V,T,B,i,7,r[0]),B=c(B,E,V,T,l,12,r[1]),T=c(T,B,E,V,m,17,r[2]),V=c(V,T,B,E,p,22,r[3]),E=c(E,V,T,B,f,7,r[4]),B=c(B,E,V,T,g,12,r[5]),T=c(T,B,E,V,y,17,r[6]),V=c(V,T,B,E,v,22,r[7]),E=c(E,V,T,B,k,7,r[8]),B=c(B,E,V,T,w,12,r[9]),T=c(T,B,E,V,b,17,r[10]),V=c(V,T,B,E,_,22,r[11]),E=c(E,V,T,B,x,7,r[12]),B=c(B,E,V,T,S,12,r[13]),T=c(T,B,E,V,C,17,r[14]),E=u(E,V=c(V,T,B,E,N,22,r[15]),T,B,l,5,r[16]),B=u(B,E,V,T,y,9,r[17]),T=u(T,B,E,V,_,14,r[18]),V=u(V,T,B,E,i,20,r[19]),E=u(E,V,T,B,g,5,r[20]),B=u(B,E,V,T,b,9,r[21]),T=u(T,B,E,V,N,14,r[22]),V=u(V,T,B,E,f,20,r[23]),E=u(E,V,T,B,w,5,r[24]),B=u(B,E,V,T,C,9,r[25]),T=u(T,B,E,V,p,14,r[26]),V=u(V,T,B,E,k,20,r[27]),E=u(E,V,T,B,S,5,r[28]),B=u(B,E,V,T,m,9,r[29]),T=u(T,B,E,V,v,14,r[30]),E=d(E,V=u(V,T,B,E,x,20,r[31]),T,B,g,4,r[32]),B=d(B,E,V,T,k,11,r[33]),T=d(T,B,E,V,_,16,r[34]),V=d(V,T,B,E,C,23,r[35]),E=d(E,V,T,B,l,4,r[36]),B=d(B,E,V,T,f,11,r[37]),T=d(T,B,E,V,v,16,r[38]),V=d(V,T,B,E,b,23,r[39]),E=d(E,V,T,B,S,4,r[40]),B=d(B,E,V,T,i,11,r[41]),T=d(T,B,E,V,p,16,r[42]),V=d(V,T,B,E,y,23,r[43]),E=d(E,V,T,B,w,4,r[44]),B=d(B,E,V,T,x,11,r[45]),T=d(T,B,E,V,N,16,r[46]),E=h(E,V=d(V,T,B,E,m,23,r[47]),T,B,i,6,r[48]),B=h(B,E,V,T,v,10,r[49]),T=h(T,B,E,V,C,15,r[50]),V=h(V,T,B,E,g,21,r[51]),E=h(E,V,T,B,x,6,r[52]),B=h(B,E,V,T,p,10,r[53]),T=h(T,B,E,V,b,15,r[54]),V=h(V,T,B,E,l,21,r[55]),E=h(E,V,T,B,k,6,r[56]),B=h(B,E,V,T,N,10,r[57]),T=h(T,B,E,V,y,15,r[58]),V=h(V,T,B,E,S,21,r[59]),E=h(E,V,T,B,f,6,r[60]),B=h(B,E,V,T,_,10,r[61]),T=h(T,B,E,V,m,15,r[62]),V=h(V,T,B,E,w,21,r[63]),s[0]=s[0]+E|0,s[1]=s[1]+V|0,s[2]=s[2]+T|0,s[3]=s[3]+B|0},_doFinalize:function(){var t=this._data,a=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;a[o>>>5]|=128<<24-o%32;var s=e.floor(n/4294967296),i=n;a[15+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),a[14+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(a.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,a,n,o,s,i){var r=e+(t&a|~t&n)+o+i;return(r<<s|r>>>32-s)+t}function u(e,t,a,n,o,s,i){var r=e+(t&n|a&~n)+o+i;return(r<<s|r>>>32-s)+t}function d(e,t,a,n,o,s,i){var r=e+(t^a^n)+o+i;return(r<<s|r>>>32-s)+t}function h(e,t,a,n,o,s,i){var r=e+(a^(t|~n))+o+i;return(r<<s|r>>>32-s)+t}t.MD5=s._createHelper(l),t.HmacMD5=s._createHmacHelper(l)}(Math),a.MD5)})),ie((function(e,t){var a,n,o;e.exports=(n=(a=le).lib.Base,o=a.enc.Utf8,void(a.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var a=e.blockSize,n=4*a;t.sigBytes>n&&(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<a;c++)r[c]^=1549556828,l[c]^=909522486;s.sigBytes=i.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,a=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(a))}})))})),ie((function(e,t){e.exports=le.HmacMD5}))),ue=ie((function(e,t){e.exports=le.enc.Utf8})),de=ie((function(e,t){var a,n,o;e.exports=(o=(n=a=le).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,a=e.sigBytes,n=this._map;e.clamp();for(var o=[],s=0;s<a;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<a;r++)o.push(n.charAt(i>>>6*(3-r)&63));var l=n.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(e){var t=e.length,a=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var s=0;s<a.length;s++)n[a.charCodeAt(s)]=s}var i=a.charAt(64);if(i){var r=e.indexOf(i);-1!==r&&(t=r)}return function(e,t,a){for(var n=[],s=0,i=0;i<t;i++)if(i%4){var r=a[e.charCodeAt(i-1)]<<i%4*2,l=a[e.charCodeAt(i)]>>>6-i%4*2;n[s>>>2]|=(r|l)<<24-s%4*8,s++}return o.create(n,s)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},a.enc.Base64)}));const he="FUNCTION",me="pending",pe="rejected";function fe(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function ge(e){return"object"===fe(e)}function ye(e){return"function"==typeof e}function ve(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const ke="REJECTED",we="NOT_PENDING";class be{constructor({createPromise:e,retryRule:t=ke}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case ke:return this.status===pe;case we:return this.status!==me}}exec(){return this.needRetry?(this.status=me,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=pe,Promise.reject(e)))),this.promise):this.promise}}function _e(e){return e&&"string"==typeof e?JSON.parse(e):e}const xe=_e([]);_e("");const Se=_e("[]")||[];let Ce="";try{Ce="__UNI__EE98A34"}catch(mt){}let Ne={};function Ee(e,t={}){var a,n;return a=Ne,n=e,Object.prototype.hasOwnProperty.call(a,n)||(Ne[e]=t),Ne[e]}Ne=uni._globalUniCloudObj?uni._globalUniCloudObj:uni._globalUniCloudObj={};const Ve=["invoke","success","fail","complete"],Te=Ee("_globalUniCloudInterceptor");function Be(e,t){Te[e]||(Te[e]={}),ge(t)&&Object.keys(t).forEach((a=>{Ve.indexOf(a)>-1&&function(e,t,a){let n=Te[e][t];n||(n=Te[e][t]=[]),-1===n.indexOf(a)&&ye(a)&&n.push(a)}(e,a,t[a])}))}function De(e,t){Te[e]||(Te[e]={}),ge(t)?Object.keys(t).forEach((a=>{Ve.indexOf(a)>-1&&function(e,t,a){const n=Te[e][t];if(!n)return;const o=n.indexOf(a);o>-1&&n.splice(o,1)}(e,a,t[a])})):delete Te[e]}function Ie(e,t){return e&&0!==e.length?e.reduce(((e,a)=>e.then((()=>a(t)))),Promise.resolve()):Promise.resolve()}function Ae(e,t){return Te[e]&&Te[e][t]||[]}function Pe(e){Be("callObject",e)}const Le=Ee("_globalUniCloudListener"),Oe="response",Me="needLogin",Fe="refreshToken",Re="clientdb",$e="cloudfunction",Ue="cloudobject";function ze(e){return Le[e]||(Le[e]=[]),Le[e]}function je(e,t){const a=ze(e);a.includes(t)||a.push(t)}function qe(e,t){const a=ze(e),n=a.indexOf(t);-1!==n&&a.splice(n,1)}function He(e,t){const a=ze(e);for(let n=0;n<a.length;n++)(0,a[n])(t)}let We,Je=!1;function Ke(){return We||(We=new Promise((e=>{Je&&e(),function t(){if("function"==typeof getCurrentPages){const t=getCurrentPages();t&&t[0]&&(Je=!0,e())}Je||setTimeout((()=>{t()}),30)}()})),We)}function Ge(e){const t={};for(const a in e){const n=e[a];ye(n)&&(t[a]=ve(n))}return t}class Ye 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 Qe={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 Ze(e){return e&&Ze(e.__v_raw)||e}function Xe(){return{token:Qe.getStorageSync("uni_id_token")||Qe.getStorageSync("uniIdToken"),tokenExpired:Qe.getStorageSync("uni_id_token_expired")}}function et({token:e,tokenExpired:t}={}){e&&Qe.setStorageSync("uni_id_token",e),t&&Qe.setStorageSync("uni_id_token_expired",t)}let tt,at;function nt(){return tt||(tt=uni.getSystemInfoSync()),tt}function ot(){let e,t;try{if(uni.getLaunchOptionsSync){if(uni.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:a,channel:n}=uni.getLaunchOptionsSync();e=n,t=a}}catch(a){}return{channel:e,scene:t}}let st={};function it(){const e=uni.getLocale&&uni.getLocale()||"en";if(at)return{...st,...at,locale:e,LOCALE:e};const t=nt(),{deviceId:a,osName:n,uniPlatform:o,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 at={PLATFORM:o,OS:n,APPID:s,DEVICEID:a,...ot(),...t},{...st,...at,locale:e,LOCALE:e}}var rt=function(e,t){let a="";return Object.keys(e).sort().forEach((function(t){e[t]&&(a=a+"&"+t+"="+e[t])})),a=a.slice(1),ce(a,t).toString()},lt=function(e,t){return new Promise(((a,n)=>{t(Object.assign(e,{complete(e){e||(e={});const t=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400){const a=e.data&&e.data.error&&e.data.error.code||"SYS_ERR",o=e.data&&e.data.error&&e.data.error.message||e.errMsg||"request:fail";return n(new Ye({code:a,message:o,requestId:t}))}const o=e.data;if(o.error)return n(new Ye({code:o.error.code,message:o.error.message,requestId:t}));o.result=o.data,o.requestId=t,delete o.data,a(o)}}))}))},ct=function(e){return de.stringify(ue.parse(e))},ut={init(e){const t=new class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),this.config=Object.assign({},{endpoint:0===e.spaceId.indexOf("mp-")?"https://api.next.bspapp.com":"https://api.bspapp.com"},e),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=Qe,this._getAccessTokenPromiseHub=new be({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new Ye({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:we})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return lt(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,a)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?a(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"]=rt(t.data,this.config.clientSecret),t}setupRequest(e,t){const a=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};return"auth"!==t&&(a.token=this.accessToken,n["x-basement-token"]=this.accessToken),n["x-serverless-sign"]=rt(a,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:a,dataType:"json",header:n}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request({...this.setupRequest(t),timeout:e.timeout})}getOSSUploadOptionsFromPath(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:a,filePath:n,fileType:o,onUploadProgress:s}){return new Promise(((i,r)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:a,filePath:n,fileType:o,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?i(e):r(new Ye({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){r(new Ye({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:a="image",cloudPathAsRealPath:n=!1,onUploadProgress:o,config:s}){if("string"!==fe(t))throw new Ye({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new Ye({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new Ye({code:"INVALID_PARAM",message:"cloudPath不合法"});const i=s&&s.envType||this.config.envType;if(n&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new Ye({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const r=(await this.getOSSUploadOptionsFromPath({env:i,filename:n?t.split("/").pop():t,fileId:n?t:void 0})).result,l="https://"+r.cdnDomain+"/"+r.ossPath,{securityToken:c,accessKeyId:u,signature:d,host:h,ossPath:m,id:p,policy:f,ossCallbackUrl:g}=r,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:u,Signature:d,host:h,id:p,key:m,policy:f,success_action_status:200};if(c&&(y["x-oss-security-token"]=c),g){const e=JSON.stringify({callbackUrl:g,callbackBody:JSON.stringify({fileId:p,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=ct(e)}const v={url:"https://"+r.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:a};if(await this.uploadFileToOSS(Object.assign({},v,{onUploadProgress:o})),g)return{success:!0,filePath:e,fileID:l};if((await this.reportOSSUpload({id:p})).success)return{success:!0,filePath:e,fileID:l};throw new Ye({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,a)=>{Array.isArray(e)&&0!==e.length||a(new Ye({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 Ye({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.info",params:JSON.stringify({id:e.map((e=>e.split("?")[0])).join(",")})};return{fileList:(await this.request(this.setupRequest(t))).result}}}(e),a={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return a},t.customAuth=t.auth,t}};const dt="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var ht,mt;(mt=ht||(ht={})).local="local",mt.none="none",mt.session="session";var pt=function(){},ft=ie((function(e,t){var a;e.exports=(a=le,function(e){var t=a,n=t.lib,o=n.WordArray,s=n.Hasher,i=t.algo,r=[],l=[];!function(){function t(t){for(var a=e.sqrt(t),n=2;n<=a;n++)if(!(t%n))return!1;return!0}function a(e){return 4294967296*(e-(0|e))|0}for(var n=2,o=0;o<64;)t(n)&&(o<8&&(r[o]=a(e.pow(n,.5))),l[o]=a(e.pow(n,1/3)),o++),n++}();var c=[],u=i.SHA256=s.extend({_doReset:function(){this._hash=new o.init(r.slice(0))},_doProcessBlock:function(e,t){for(var a=this._hash.words,n=a[0],o=a[1],s=a[2],i=a[3],r=a[4],u=a[5],d=a[6],h=a[7],m=0;m<64;m++){if(m<16)c[m]=0|e[t+m];else{var p=c[m-15],f=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[m-2],y=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[m]=f+c[m-7]+y+c[m-16]}var v=n&o^n&s^o&s,k=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=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+w|0,i=s,s=o,o=n,n=w+(k+v)|0}a[0]=a[0]+n|0,a[1]=a[1]+o|0,a[2]=a[2]+s|0,a[3]=a[3]+i|0,a[4]=a[4]+r|0,a[5]=a[5]+u|0,a[6]=a[6]+d|0,a[7]=a[7]+h|0},_doFinalize:function(){var t=this._data,a=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return a[o>>>5]|=128<<24-o%32,a[14+(o+64>>>9<<4)]=e.floor(n/4294967296),a[15+(o+64>>>9<<4)]=n,t.sigBytes=4*a.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),a.SHA256)})),gt=ft,yt=ie((function(e,t){e.exports=le.HmacSHA256}));const vt=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new Ye({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,a)=>{e=(e,n)=>e?a(e):t(n)}));return e.promise=t,e};function kt(e){return void 0===e}function wt(e){return"[object Null]"===Object.prototype.toString.call(e)}var bt;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(bt||(bt={}));const _t={adapter:null,runtime:void 0},xt=["anonymousUuidKey"];class St extends pt{constructor(){super(),_t.adapter.root.tcbObject||(_t.adapter.root.tcbObject={})}setItem(e,t){_t.adapter.root.tcbObject[e]=t}getItem(e){return _t.adapter.root.tcbObject[e]}removeItem(e){delete _t.adapter.root.tcbObject[e]}clear(){delete _t.adapter.root.tcbObject}}function Ct(e,t){switch(e){case"local":return t.localStorage||new St;case"none":return new St;default:return t.sessionStorage||new St}}class Nt{constructor(e){if(!this._storage){this._persistence=_t.adapter.primaryStorage||e.persistence,this._storage=Ct(this._persistence,_t.adapter);const t=`access_token_${e.env}`,a=`access_token_expire_${e.env}`,n=`refresh_token_${e.env}`,o=`anonymous_uuid_${e.env}`,s=`login_type_${e.env}`,i=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:a,refreshTokenKey:n,anonymousUuidKey:o,loginTypeKey:s,userInfoKey:i}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const a=Ct(e,_t.adapter);for(const n in this.keys){const e=this.keys[n];if(t&&xt.includes(n))continue;const o=this._storage.getItem(e);kt(o)||wt(o)||(a.setItem(e,o),this._storage.removeItem(e))}this._storage=a}setStore(e,t,a){if(!this._storage)return;const n={version:a||"localCachev1",content:t},o=JSON.stringify(n);try{this._storage.setItem(e,o)}catch(s){throw s}}getStore(e,t){try{if(!this._storage)return}catch(n){return""}t=t||"localCachev1";const a=this._storage.getItem(e);return a&&a.indexOf(t)>=0?JSON.parse(a).content:""}removeStore(e){this._storage.removeItem(e)}}const Et={},Vt={};function Tt(e){return Et[e]}class Bt{constructor(e,t){this.data=t||null,this.name=e}}class Dt extends Bt{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const It=new class{constructor(){this._listeners={}}on(e,t){return a=e,n=t,(o=this._listeners)[a]=o[a]||[],o[a].push(n),this;var a,n,o}off(e,t){return function(e,t,a){if(a&&a[e]){const n=a[e].indexOf(t);-1!==n&&a[e].splice(n,1)}}(e,t,this._listeners),this}fire(e,t){if(e instanceof Dt)return console.error(e.error),this;const a="string"==typeof e?new Bt(e,t||{}):e,n=a.name;if(this._listens(n)){a.target=this;const e=this._listeners[n]?[...this._listeners[n]]:[];for(const t of e)t.call(this,a)}return this}_listens(e){return this._listeners[e]&&this._listeners[e].length>0}};function At(e,t){It.on(e,t)}function Pt(e,t={}){It.fire(e,t)}function Lt(e,t){It.off(e,t)}const Ot="loginStateChanged",Mt="loginStateExpire",Ft="loginTypeChanged",Rt="anonymousConverted",$t="refreshAccessToken";var Ut;!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"}(Ut||(Ut={}));const zt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],jt={"X-SDK-Version":"1.3.5"};function qt(e,t,a){const n=e[t];e[t]=function(t){const o={},s={};a.forEach((a=>{const{data:n,headers:i}=a.call(e,t);Object.assign(o,n),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,...o};else for(const t in o)i.append(t,o[t])})(),t.headers={...t.headers||{},...s},n.call(e,t)}}function Ht(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...jt,"x-seqid":e}}}class Wt{constructor(e={}){var t;this.config=e,this._reqClass=new _t.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=Tt(this.config.env),this._localCache=(t=this.config.env,Vt[t]),qt(this._reqClass,"post",[Ht]),qt(this._reqClass,"upload",[Ht]),qt(this._reqClass,"download",[Ht])}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(a){t=a}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:a,loginTypeKey:n,anonymousUuidKey:o}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let s=this._cache.getStore(a);if(!s)throw new Ye({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(n)===Ut.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(o),t=this._cache.getStore(a),n=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(n.refresh_token),this._refreshAccessToken()}Pt(Mt),this._cache.removeStore(a)}throw new Ye({code:r.data.code,message:`刷新access token失败:${r.data.code}`})}if(r.data.access_token)return Pt($t),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(a),this._cache.setStore(a,r.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:a}=this._cache.keys;if(!this._cache.getStore(a))throw new Ye({message:"refresh token不存在,登录状态异常"});let n=this._cache.getStore(e),o=this._cache.getStore(t),s=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(n,o))&&(s=!1),(!n||!o||o<Date.now())&&s?this.refreshAccessToken():{accessToken:n,accessTokenExpire:o}}async request(e,t,a){const n=`x-tcb-trace_${this.config.env}`;let o="application/x-www-form-urlencoded";const s={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===zt.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]);o="multipart/form-data"}else{o="application/json",i={};for(let e in s)void 0!==s[e]&&(i[e]=s[e])}let r={headers:{"content-type":o}};a&&a.timeout&&(r.timeout=a.timeout),a&&a.onUploadProgress&&(r.onUploadProgress=a.onUploadProgress);const l=this._localCache.getStore(n);l&&(r.headers["X-TCB-Trace"]=l);const{parse:c,inQuery:u,search:d}=t;let h={env:this.config.env};c&&(h.parse=!0),u&&(h={...u,...h});let m=function(e,t,a={}){const n=/\?/.test(t);let o="";for(let s in a)""===o?!n&&(t+="?"):o+="&",o+=`${s}=${encodeURIComponent(a[s])}`;return/^http(s)?\:\/\//.test(t+=o)?t:`${e}${t}`}(dt,"//tcb-api.tencentcloudapi.com/web",h);d&&(m+=d);const p=await this.post({url:m,data:i,...r}),f=p.header&&p.header["x-tcb-trace"];if(f&&this._localCache.setStore(n,f),200!==Number(p.status)&&200!==Number(p.statusCode)||!p.data)throw new Ye({code:"NETWORK_ERROR",message:"network request error"});return p}async send(e,t={},a={}){const n=await this.request(e,t,{...a,onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===n.data.code&&-1===zt.indexOf(e)){await this.refreshAccessToken();const n=await this.request(e,t,{...a,onUploadProgress:t.onUploadProgress});if(n.data.code)throw new Ye({code:n.data.code,message:n.data.message});return n.data}if(n.data.code)throw new Ye({code:n.data.code,message:n.data.message});return n.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:a,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(a),this._cache.setStore(n,e)}}const Jt={};function Kt(e){return Jt[e]}class Gt{constructor(e){this.config=e,this._cache=Tt(e.env),this._request=Kt(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:a,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(a),this._cache.setStore(n,e)}setAccessToken(e,t){const{accessTokenKey:a,accessTokenExpireKey:n}=this._cache.keys;this._cache.setStore(a,e),this._cache.setStore(n,t)}async refreshUserInfo(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}class Yt{constructor(e){if(!e)throw new Ye({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=Tt(this._envId),this._request=Kt(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeof e)throw new Ye({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 Ye({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:a}=e;return a.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:a,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:a,avatarUrl:n,province:o,country:s,city:i}=e,{data:r}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:a,avatarUrl:n,province:o,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 Qt{constructor(e){if(!e)throw new Ye({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=Tt(e);const{refreshTokenKey:t,accessTokenKey:a,accessTokenExpireKey:n}=this._cache.keys,o=this._cache.getStore(t),s=this._cache.getStore(a),i=this._cache.getStore(n);this.credential={refreshToken:o,accessToken:s,accessTokenExpire:i},this.user=new Yt(e)}get isAnonymousAuth(){return this.loginType===Ut.ANONYMOUS}get isCustomAuth(){return this.loginType===Ut.CUSTOM}get isWeixinAuth(){return this.loginType===Ut.WECHAT||this.loginType===Ut.WECHAT_OPEN||this.loginType===Ut.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class Zt extends Gt{async signIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,a=this._cache.getStore(e)||void 0,n=this._cache.getStore(t)||void 0,o=await this._request.send("auth.signInAnonymously",{anonymous_uuid:a,refresh_token:n});if(o.uuid&&o.refresh_token){this._setAnonymousUUID(o.uuid),this.setRefreshToken(o.refresh_token),await this._request.refreshAccessToken(),Pt(Ot),Pt(Ft,{env:this.config.env,loginType:Ut.ANONYMOUS,persistence:"local"});const e=new Qt(this.config.env);return await e.user.refresh(),e}throw new Ye({message:"匿名登录失败"})}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:a}=this._cache.keys,n=this._cache.getStore(t),o=this._cache.getStore(a),s=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:n,refresh_token:o,ticket:e});if(s.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(s.refresh_token),await this._request.refreshAccessToken(),Pt(Rt,{env:this.config.env}),Pt(Ft,{loginType:Ut.CUSTOM,persistence:"local"}),{credential:{refreshToken:s.refresh_token}};throw new Ye({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:a}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(a,Ut.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class Xt extends Gt{async signIn(e){if("string"!=typeof e)throw new Ye({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,a=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(a.refresh_token)return this.setRefreshToken(a.refresh_token),await this._request.refreshAccessToken(),Pt(Ot),Pt(Ft,{env:this.config.env,loginType:Ut.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new Qt(this.config.env);throw new Ye({message:"自定义登录失败"})}}class ea extends Gt{async signIn(e,t){if("string"!=typeof e)throw new Ye({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:a}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(a)||""}),{refresh_token:o,access_token:s,access_token_expire:i}=n;if(o)return this.setRefreshToken(o),s&&i?this.setAccessToken(s,i):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Pt(Ot),Pt(Ft,{env:this.config.env,loginType:Ut.EMAIL,persistence:this.config.persistence}),new Qt(this.config.env);throw n.code?new Ye({code:n.code,message:`邮箱登录失败: ${n.message}`}):new Ye({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 ta extends Gt{async signIn(e,t){if("string"!=typeof e)throw new Ye({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeof t&&(t="",console.warn("password is empty"));const{refreshTokenKey:a}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:Ut.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(a)||""}),{refresh_token:o,access_token_expire:s,access_token:i}=n;if(o)return this.setRefreshToken(o),i&&s?this.setAccessToken(i,s):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Pt(Ot),Pt(Ft,{env:this.config.env,loginType:Ut.USERNAME,persistence:this.config.persistence}),new Qt(this.config.env);throw n.code?new Ye({code:n.code,message:`用户名密码登录失败: ${n.message}`}):new Ye({message:"用户名密码登录失败"})}}class aa{constructor(e){this.config=e,this._cache=Tt(e.env),this._request=Kt(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),At(Ft,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 Zt(this.config)}customAuthProvider(){return new Xt(this.config)}emailAuthProvider(){return new ea(this.config)}usernameAuthProvider(){return new ta(this.config)}async signInAnonymously(){return new Zt(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new ea(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new ta(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new Zt(this.config)),At(Rt,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===Ut.ANONYMOUS)throw new Ye({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:a}=this._cache.keys,n=this._cache.getStore(e);if(!n)return;const o=await this._request.send("auth.logout",{refresh_token:n});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(a),Pt(Ot),Pt(Ft,{env:this.config.env,loginType:Ut.NULL,persistence:this.config.persistence}),o}async signUpWithEmailAndPassword(e,t){return this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}async sendPasswordResetEmail(e){return this._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){At(Ot,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){At(Mt,e.bind(this))}onAccessTokenRefreshed(e){At($t,e.bind(this))}onAnonymousConverted(e){At(Rt,e.bind(this))}onLoginTypeChanged(e){At(Ft,(()=>{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 Qt(this.config.env):null}async isUsernameRegistered(e){if("string"!=typeof e)throw new Ye({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 Xt(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,a=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+a}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:a,env:n}=e.data;n===this.config.env&&(this._cache.updatePersistence(a),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const na=function(e,t){t=t||vt();const a=Kt(this.config.env),{cloudPath:n,filePath:o,onUploadProgress:s,fileType:i="image"}=e;return a.send("storage.getUploadMetadata",{path:n}).then((e=>{const{data:{url:r,authorization:l,token:c,fileId:u,cosFileId:d},requestId:h}=e,m={key:n,signature:l,"x-cos-meta-fileid":d,success_action_status:"201","x-cos-security-token":c};a.upload({url:r,data:m,file:o,name:n,fileType:i,onUploadProgress:s}).then((e=>{201===e.statusCode?t(null,{fileID:u,requestId:h}):t(new Ye({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},oa=function(e,t){t=t||vt();const a=Kt(this.config.env),{cloudPath:n}=e;return a.send("storage.getUploadMetadata",{path:n}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},sa=function({fileList:e},t){if(t=t||vt(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let n of e)if(!n||"string"!=typeof n)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const a={fileid_list:e};return Kt(this.config.env).send("storage.batchDeleteFile",a).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},ia=function({fileList:e},t){t=t||vt(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let a=[];for(let o of e)"object"==typeof o?(o.hasOwnProperty("fileID")&&o.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),a.push({fileid:o.fileID,max_age:o.maxAge})):"string"==typeof o?a.push({fileid:o}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const n={file_list:a};return Kt(this.config.env).send("storage.batchGetDownloadUrl",n).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},ra=async function({fileID:e},t){const a=(await ia.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==a.code)return t?t(a):new Promise((e=>{e(a)}));const n=Kt(this.config.env);let o=a.download_url;if(o=encodeURI(o),!t)return n.download({url:o});t(await n.download({url:o}))},la=function({name:e,data:t,query:a,parse:n,search:o,timeout:s},i){const r=i||vt();let l;try{l=t?JSON.stringify(t):""}catch(u){return Promise.reject(u)}if(!e)return Promise.reject(new Ye({code:"PARAM_ERROR",message:"函数名不能为空"}));const c={inQuery:a,parse:n,search:o,function_name:e,request_data:l};return Kt(this.config.env).send("functions.invokeFunction",c,{timeout:s}).then((e=>{if(e.code)r(null,e);else{let a=e.data.response_data;if(n)r(null,{result:a,requestId:e.requestId});else try{a=JSON.parse(e.data.response_data),r(null,{result:a,requestId:e.requestId})}catch(t){r(new Ye({message:"response data must be json"}))}}return r.promise})).catch((e=>{r(e)})),r.promise},ca={timeout:15e3,persistence:"session"},ua={};class da{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(_t.adapter||(this.requestClient=new _t.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...ca,...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 da(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||_t.adapter.primaryStorage||ca.persistence;var a;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;Et[t]=new Nt(e),Vt[t]=new Nt({...e,persistence:"local"})}(this.config),a=this.config,Jt[a.env]=new Wt(a),this.authObj=new aa(this.config),this.authObj}on(e,t){return At.apply(this,[e,t])}off(e,t){return Lt.apply(this,[e,t])}callFunction(e,t){return la.apply(this,[e,t])}deleteFile(e,t){return sa.apply(this,[e,t])}getTempFileURL(e,t){return ia.apply(this,[e,t])}downloadFile(e,t){return ra.apply(this,[e,t])}uploadFile(e,t){return na.apply(this,[e,t])}getUploadMetadata(e,t){return oa.apply(this,[e,t])}registerExtension(e){ua[e.name]=e}async invokeExtension(e,t){const a=ua[e];if(!a)throw new Ye({message:`扩展${e} 必须先注册`});return await a.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:a}=function(e){const t=(a=e,"[object Array]"===Object.prototype.toString.call(a)?e:[e]);var a;for(const n of t){const{isMatch:e,genAdapter:t,runtime:a}=n;if(e())return{adapter:t(),runtime:a}}}(e)||{};t&&(_t.adapter=t),a&&(_t.runtime=a)}}var ha=new da;function ma(e,t,a){void 0===a&&(a={});var n=/\?/.test(t),o="";for(var s in a)""===o?!n&&(t+="?"):o+="&",o+=s+"="+encodeURIComponent(a[s]);return/^http(s)?:\/\//.test(t+=o)?t:""+e+t}class pa{post(e){const{url:t,data:a,headers:n,timeout:o}=e;return new Promise(((e,s)=>{Qe.request({url:ma("https:",t),data:a,method:"POST",header:n,timeout:o,success(t){e(t)},fail(e){s(e)}})}))}upload(e){return new Promise(((t,a)=>{const{url:n,file:o,data:s,headers:i,fileType:r}=e,l=Qe.uploadFile({url:ma("https:",n),name:"file",formData:Object.assign({},s),filePath:o,fileType:r,header:i,success(e){const a={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&s.success_action_status&&(a.statusCode=parseInt(s.success_action_status,10)),t(a)},fail(e){a(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 fa={setItem(e,t){Qe.setStorageSync(e,t)},getItem:e=>Qe.getStorageSync(e),removeItem(e){Qe.removeStorageSync(e)},clear(){Qe.clearStorageSync()}};var ga={genAdapter:function(){return{root:{},reqClass:pa,localStorage:fa,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};ha.useAdapters(ga);const ya=ha,va=ya.init;ya.init=function(e){e.env=e.spaceId;const t=va.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;const a=t.auth;return t.auth=function(e){const t=a.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{var a;t[e]=(a=t[e],function(e){e=e||{};const{success:t,fail:n,complete:o}=Ge(e);if(!(t||n||o))return a.call(this,e);a.call(this,e).then((e=>{t&&t(e),o&&o(e)}),(e=>{n&&n(e),o&&o(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var ka=ya;async function wa(e,t){const a=`http://${e}:${t}/system/ping`;try{const e=await(n={url:a,timeout:500},new Promise(((e,t)=>{Qe.request({...n,success(t){e(t)},fail(e){t(e)}})})));return!(!e.data||0!==e.data.code)}catch(o){return!1}var n}const ba={"serverless.file.resource.generateProximalSign":"storage/generate-proximal-sign","serverless.file.resource.report":"storage/report","serverless.file.resource.delete":"storage/delete","serverless.file.resource.getTempFileURL":"storage/get-temp-file-url"};var _a={init(e){const t=new class{constructor(e){if(["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),!e.endpoint)throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");this.config=Object.assign({},e),this.config.provider="dcloud",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.adapter=Qe}async request(e,t=!0){return e=this.setupRequest(e),Promise.resolve().then((()=>lt(e,this.adapter.request)))}requestLocal(e){return new Promise(((t,a)=>{this.adapter.request(Object.assign(e,{complete(e){if(e||(e={}),!e.statusCode||e.statusCode>=400){const t=e.data&&e.data.code||"SYS_ERR",n=e.data&&e.data.message||"request:fail";return a(new Ye({code:t,message:n}))}t({success:!0,result:e.data})}}))}))}setupRequest(e){const t=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),a={"Content-Type":"application/json"};a["x-serverless-sign"]=rt(t,this.config.clientSecret);const n=it();a["x-client-info"]=encodeURIComponent(JSON.stringify(n));const{token:o}=Xe();return a["x-client-token"]=o,{url:this.config.requestUrl,method:"POST",data:t,dataType:"json",header:JSON.parse(JSON.stringify(a))}}async setupLocalRequest(e){const t=it(),{token:a}=Xe(),n=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now(),clientInfo:t,token:a}),{address:o,servePort:s}=this.__dev__&&this.__dev__.debugInfo||{},{address:i}=await async function(e,t){let a;for(let n=0;n<e.length;n++){const o=e[n];if(await wa(o,t)){a=o;break}}return{address:a,port:t}}(o,s);return{url:`http://${i}:${s}/${ba[e.method]}`,method:"POST",data:n,dataType:"json",header:JSON.parse(JSON.stringify({"Content-Type":"application/json"}))}}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request(t,!1)}getUploadFileOptions(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(t)}reportUploadFile(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(t)}uploadFile({filePath:e,cloudPath:t,fileType:a="image",onUploadProgress:n}){if(!t)throw new Ye({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let o;return this.getUploadFileOptions({cloudPath:t}).then((t=>{const{url:s,formData:i,name:r}=t.result;return o=t.result.fileUrl,new Promise(((t,o)=>{const l=this.adapter.uploadFile({url:s,formData:i,name:r,filePath:e,fileType:a,success(e){e&&e.statusCode<400?t(e):o(new Ye({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){o(new Ye({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof n&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{n({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))})).then((()=>this.reportUploadFile({cloudPath:t}))).then((t=>new Promise(((a,n)=>{t.success?a({success:!0,filePath:e,fileID:o}):n(new Ye({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){const t={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};return this.request(t).then((e=>{if(e.success)return e.result;throw new Ye({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e,maxAge:t}={}){if(!Array.isArray(e)||0===e.length)throw new Ye({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const a={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e,maxAge:t})};return this.request(a).then((e=>{if(e.success)return{fileList:e.result.fileList.map((e=>({fileID:e.fileID,tempFileURL:e.tempFileURL})))};throw new Ye({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})}))}}(e),a={signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return a},t.customAuth=t.auth,t}},xa=ie((function(e,t){e.exports=le.enc.Hex}));function Sa(){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 Ca(e="",t={}){const{data:a,functionName:n,method:o,headers:s,signHeaderKeys:i=[],config:r}=t,l=Date.now(),c=Sa(),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":n,"x-client-timestamp":l,"x-alipay-source":"client","x-request-id":c,"x-alipay-callid":c,"x-trace-id":c}),d=["x-from-app-id","x-from-env-id","x-to-env-id","x-from-instance-id","x-from-function-name","x-client-timestamp"].concat(i),[h="",m=""]=e.split("?")||[],p=function(e){const t=e.signedHeaders.join(";"),a=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),n=gt(e.body).toString(xa),o=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${a}\n${t}\n${n}\n`,s=gt(o).toString(xa),i=`HMAC-SHA256\n${e.timestamp}\n${s}\n`,r=yt(i,e.secretKey).toString(xa);return`HMAC-SHA256 Credential=${e.secretId}, SignedHeaders=${t}, Signature=${r}`}({path:h,query:m,method:o,headers:u,timestamp:l,body:JSON.stringify(a),secretId:r.accessKey,secretKey:r.secretKey,signedHeaders:d.sort()});return{url:`${r.endpoint}${e}`,headers:Object.assign({},u,{Authorization:p})}}function Na({url:e,data:t,method:a="POST",headers:n={},timeout:o}){return new Promise(((s,i)=>{Qe.request({url:e,method:a,data:"object"==typeof t?JSON.stringify(t):t,header:n,dataType:"json",timeout:o,complete:(e={})=>{const t=n["x-trace-id"]||"";if(!e.statusCode||e.statusCode>=400){const{message:a,errMsg:n,trace_id:o}=e.data||{};return i(new Ye({code:"SYS_ERR",message:a||n||"request:fail",requestId:o||t}))}s({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function Ea(e,t){const{path:a,data:n,method:o="GET"}=e,{url:s,headers:i}=Ca(a,{functionName:"",data:n,method:o,headers:{"x-alipay-cloud-mode":"oss","x-data-api-type":"oss","x-expire-timestamp":Date.now()+6e4},signHeaderKeys:["x-data-api-type","x-expire-timestamp"],config:t});return Na({url:s,data:n,method:o,headers:i}).then((e=>{const t=e.data||{};if(!t.success)throw new Ye({code:e.errCode,message:e.errMsg,requestId:e.requestId});return t.data||{}})).catch((e=>{throw new Ye({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}function Va(e=""){const t=e.trim().replace(/^cloud:\/\//,""),a=t.indexOf("/");if(a<=0)throw new Ye({code:"INVALID_PARAM",message:"fileID不合法"});const n=t.substring(0,a),o=t.substring(a+1);return n!==this.config.spaceId&&console.warn("file ".concat(e," does not belong to env ").concat(this.config.spaceId)),o}function Ta(e=""){return"cloud://".concat(this.config.spaceId,"/").concat(e.replace(/^\/+/,""))}class Ba{constructor(e){this.config=e}signedURL(e,t={}){const a=`/ws/function/${e}`,n=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),o=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:Sa(),timestamp:""+Date.now()}),s=[a,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map((function(e){return o[e]?"".concat(e,"=").concat(o[e]):null})).filter(Boolean).join("&"),`host:${n}`].join("\n"),i=["HMAC-SHA256",gt(s).toString(xa)].join("\n"),r=yt(i,this.config.secretKey).toString(xa),l=Object.keys(o).map((e=>`${e}=${encodeURIComponent(o[e])}`)).join("&");return`${this.config.wsEndpoint}${a}?${l}&signature=${r}`}}var Da={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 Ba(this.config)}callFunction(e){return function(e,t){const{name:a,data:n,async:o=!1,timeout:s}=e,i="POST",r={"x-to-function-name":a};o&&(r["x-function-invoke-type"]="async");const{url:l,headers:c}=Ca("/functions/invokeFunction",{functionName:a,data:n,method:i,headers:r,signHeaderKeys:["x-to-function-name"],config:t});return Na({url:l,data:n,method:i,headers:c,timeout:s}).then((e=>{let t=0;if(o){const a=e.data||{};t="200"===a.errCode?0:a.errCode,e.data=a.data||{},e.errMsg=a.errMsg}if(0!==t)throw new Ye({code:t,message:e.errMsg,requestId:e.requestId});return{errCode:t,success:0===t,requestId:e.requestId,result:e.data}})).catch((e=>{throw new Ye({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}(e,this.config)}uploadFileToOSS({url:e,filePath:t,fileType:a,formData:n,onUploadProgress:o}){return new Promise(((s,i)=>{const r=Qe.uploadFile({url:e,filePath:t,fileType:a,formData:n,name:"file",success(e){e&&e.statusCode<400?s(e):i(new Ye({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){i(new Ye({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof o&&r&&"function"==typeof r.onProgressUpdate&&r.onProgressUpdate((e=>{o({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}async uploadFile({filePath:e,cloudPath:t="",fileType:a="image",onUploadProgress:n}){if("string"!==fe(t))throw new Ye({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new Ye({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new Ye({code:"INVALID_PARAM",message:"cloudPath不合法"});const o=await Ea({path:"/".concat(t.replace(/^\//,""),"?post_url")},this.config),{file_id:s,upload_url:i,form_data:r}=o,l=r&&r.reduce(((e,t)=>(e[t.key]=t.value,e)),{});return this.uploadFileToOSS({url:i,filePath:e,fileType:a,formData:l,onUploadProgress:n}).then((()=>({fileID:s})))}async getTempFileURL({fileList:e}){return new Promise(((t,a)=>{(!e||e.length<0)&&a(new Ye({errCode:"INVALID_PARAM",errMsg:"fileList不能为空数组"})),e.length>50&&a(new Ye({errCode:"INVALID_PARAM",errMsg:"fileList数组长度不能超过50"}));const n=[];for(const o of e){"string"!==fe(o)&&a(new Ye({errCode:"INVALID_PARAM",errMsg:"fileList的元素必须是非空的字符串"}));const e=Va.call(this,o);n.push({file_id:e,expire:600})}Ea({path:"/?download_url",data:{file_list:n},method:"POST"},this.config).then((e=>{const{file_list:a=[]}=e;t({fileList:a.map((e=>({fileID:Ta.call(this,e.file_id),tempFileURL:e.download_url})))})})).catch((e=>a(e)))}))}async connectWebSocket(e){const{name:t,query:a}=e;return Qe.connectSocket({url:this._websocket.signedURL(t,a),complete:()=>{}})}}(e);return t.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},t}};function Ia({data:e}){let t;t=it();const a=JSON.parse(JSON.stringify(e||{}));if(Object.assign(a,{clientInfo:t}),!a.uniIdToken){const{token:e}=Xe();e&&(a.uniIdToken=e)}return a}const Aa=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Pa=/[\\^$.*+?()[\]{}|]/g,La=RegExp(Pa.source);function Oa(e,t,a){return e.replace(new RegExp((n=t)&&La.test(n)?n.replace(Pa,"\\$&"):n,"g"),a);var n}const Ma=2e4,Fa={code:20101,message:"Invalid client"};function Ra(e){const{errSubject:t,subject:a,errCode:n,errMsg:o,code:s,message:i,cause:r}=e||{};return new Ye({subject:t||a||"uni-secure-network",code:n||s||Ma,message:o||i,cause:r})}let $a;function Ua({secretType:e}={}){return"request"===e||"response"===e||"both"===e}function za({name:e,data:t={}}={}){return"DCloud-clientDB"===e&&"encryption"===t.redirectTo&&"getAppClientKey"===t.action}function ja({functionName:e,result:t,logPvd:a}){}function qa(e){const t=e.callFunction,a=function(a){const n=a.name;a.data=Ia.call(e,{data:a.data});const o={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],s=Ua(a),i=za(a),r=s||i;return t.call(this,a).then((e=>(e.errCode=0,!r&&ja.call(this,{functionName:n,result:e,logPvd:o}),Promise.resolve(e))),(e=>(!r&&ja.call(this,{functionName:n,result:e,logPvd:o}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:a=[]}={}){for(let n=0;n<a.length;n++){const{rule:o,content:s,mode:i}=a[n],r=e.match(o);if(!r)continue;let l=s;for(let e=1;e<r.length;e++)l=Oa(l,`{$${e}}`,r[e]);for(const e in t)l=Oa(l,`{${e}}`,t[e]);return"replace"===i?l:e+l}return e}({message:`[${a.name}]: ${e.message}`,formatter:Aa,extraInfo:{functionName:n}})),Promise.reject(e))))};e.callFunction=function(t){const{provider:n,spaceId:o}=e.config,s=t.name;let i,r;return t.data=t.data||{},i=a,i=i.bind(e),r=za(t)?a.call(e,t):Ua(t)?new $a({secretType:t.secretType,uniCloudIns:e}).wrapEncryptDataCallFunction(a.bind(e))(t):function({provider:e,spaceId:t,functionName:a}={}){const{appId:n,uniPlatform:o,osName:s}=nt();let i=o;"app"===o&&(i=s);const r=function({provider:e,spaceId:t}={}){const a=xe;if(!a)return{};e=function(e){return"tencent"===e?"tcb":e}(e);const n=a.find((a=>a.provider===e&&a.spaceId===t));return n&&n.config}({provider:e,spaceId:t});if(!r||!r.accessControl||!r.accessControl.enable)return!1;const l=r.accessControl.function||{},c=Object.keys(l);if(0===c.length)return!0;const u=function(e,t){let a,n,o;for(let s=0;s<e.length;s++){const i=e[s];i!==t?"*"!==i?i.split(",").map((e=>e.trim())).indexOf(t)>-1&&(n=i):o=i:a=i}return a||n||o}(c,a);if(!u)return!1;if((l[u]||[]).find(((e={})=>e.appId===n&&(e.platform||"").toLowerCase()===i.toLowerCase())))return!0;throw console.error(`此应用[appId: ${n}, platform: ${i}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),Ra(Fa)}({provider:n,spaceId:o,functionName:s})?new $a({secretType:t.secretType,uniCloudIns:e}).wrapVerifyClientCallFunction(a.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)))}}$a=class{constructor(){throw Ra({message:"Platform app is not enabled, please check whether secure network module is enabled in your manifest.json"})}};const Ha=Symbol("CLIENT_DB_INTERNAL");function Wa(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=Ha,e.inspect=null,e.__v_raw=void 0,new Proxy(e,{get(e,a,n){if("_uniClient"===a)return null;if("symbol"==typeof a)return e[a];if(a in e||"string"!=typeof a){const t=e[a];return"function"==typeof t?t.bind(e):t}return t.get(e,a,n)}})}function Ja(e){return{on:(t,a)=>{e[t]=e[t]||[],e[t].indexOf(a)>-1||e[t].push(a)},off:(t,a)=>{e[t]=e[t]||[];const n=e[t].indexOf(a);-1!==n&&e[t].splice(n,1)}}}const Ka=["db.Geo","db.command","command.aggregate"];function Ga(e,t){return Ka.indexOf(`${e}.${t}`)>-1}function Ya(e){switch(fe(e=Ze(e))){case"array":return e.map((e=>Ya(e)));case"object":return e._internalType===Ha||Object.keys(e).forEach((t=>{e[t]=Ya(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function Qa(e){return e&&e.content&&e.content.$method}class Za{constructor(e,t,a){this.content=e,this.prevStage=t||null,this.udb=null,this._database=a}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:Ya(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=Qa(e),a=Qa(e.prevStage);if("aggregate"===t&&"collection"===a||"pipeline"===t)return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if("command"===Qa(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=Qa(e),a=Qa(e.prevStage);if("aggregate"===t&&"command"===a)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return Xa({$method:e,$param:Ya(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 a=this.getAction(),n=this.getCommand();return n.$db.push({$method:e,$param:Ya(t)}),this._database._callCloudFunction({action:a,command:n})}}function Xa(e,t,a){return Wa(new Za(e,t,a),{get(e,t){let n="db";return e&&e.content&&(n=e.content.$method),Ga(n,t)?Xa({$method:t},e,a):function(){return Xa({$method:t,$param:Ya(Array.from(arguments))},e,a)}}})}function en({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 tn(e,t={}){return Wa(new e(t),{get:(e,t)=>Ga("db",t)?Xa({$method:t},null,e):function(){return Xa({$method:t,$param:Ya(Array.from(arguments))},null,e)}})}class an extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=Ee("_globalUniCloudDatabaseCallback")),t||(this.auth=Ja(this._authCallBacks)),this._isJQL=t,Object.assign(this,Ja(this._dbCallBacks)),this.env=Wa({},{get:(e,t)=>({$env:t})}),this.Geo=Wa({},{get:(e,t)=>en({path:["Geo"],method:t})}),this.serverDate=en({path:[],method:"serverDate"}),this.RegExp=en({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeof e||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const a=this._dbCallBacks;a[e]&&a[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){const a=this._authCallBacks;a[e]&&a[e].forEach((e=>{e(...t)}))}multiSend(){const e=Array.from(arguments),t=e.map((e=>{const t=e.getAction(),a=e.getCommand();if("getTemp"!==a.$db[a.$db.length-1].$method)throw new Error("multiSend只支持子命令内使用getTemp");return{action:t,command:a}}));return this._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:a,queryList:n}){function o(e,t){if(a&&n)for(let a=0;a<n.length;a++){const o=n[a];o.udb&&"function"==typeof o.udb.setResult&&(t?o.udb.setResult(t):o.udb.setResult(e.result.dataList[a]))}}const s=this,i=this._isJQL?"databaseForJQL":"database";function r(e){return s._callback("error",[e]),Ie(Ae(i,"fail"),e).then((()=>Ie(Ae(i,"complete"),e))).then((()=>(o(null,e),He(Oe,{type:Re,content:e}),Promise.reject(e))))}const l=Ie(Ae(i,"invoke")),c=this._uniClient;return l.then((()=>c.callFunction({name:"DCloud-clientDB",type:"CLIENT_DB",data:{action:e,command:t,multiCommand:a}}))).then((e=>{const{code:t,message:a,token:n,tokenExpired:l,systemInfo:c=[]}=e.result;if(c)for(let o=0;o<c.length;o++){const{level:e,message:t,detail:a}=c[o],n=console["warn"===e?"error":e]||console.log;let s="[System Info]"+t;a&&(s=`${s}\n详细信息:${a}`),n(s)}if(t)return r(new Ye({code:t,message:a,requestId:e.requestId}));e.result.errCode=e.result.errCode||e.result.code,e.result.errMsg=e.result.errMsg||e.result.message,n&&l&&(et({token:n,tokenExpired:l}),this._callbackAuth("refreshToken",[{token:n,tokenExpired:l}]),this._callback("refreshToken",[{token:n,tokenExpired:l}]),He(Fe,{token:n,tokenExpired:l}));const u=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(let o=0;o<u.length;o++){const{prop:t,tips:a}=u[o];if(t in e.result){const n=e.result[t];Object.defineProperty(e.result,t,{get:()=>(console.warn(a),n)})}}return d=e,Ie(Ae(i,"success"),d).then((()=>Ie(Ae(i,"complete"),d))).then((()=>{o(d,null);const e=s._parseResult(d);return He(Oe,{type:Re,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 Ye({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const nn="token无效,跳转登录页面",on="token过期,跳转登录页面",sn={TOKEN_INVALID_TOKEN_EXPIRED:on,TOKEN_INVALID_INVALID_CLIENTID:nn,TOKEN_INVALID:nn,TOKEN_INVALID_WRONG_TOKEN:nn,TOKEN_INVALID_ANONYMOUS_USER:nn},rn={"uni-id-token-expired":on,"uni-id-check-token-failed":nn,"uni-id-token-not-exist":nn,"uni-id-check-device-feature-failed":nn};function ln(e,t){let a="";return a=e?`${e}/${t}`:t,a.replace(/^\//,"")}function cn(e=[],t=""){const a=[],n=[];return e.forEach((e=>{!0===e.needLogin?a.push(ln(t,e.path)):!1===e.needLogin&&n.push(ln(t,e.path))})),{needLoginPage:a,notNeedLoginPage:n}}function un(e){return e.split("?")[0].replace(/^\//,"")}function dn(){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 hn(){return un(dn())}function mn(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const a=t.list,n=un(e);return a.some((e=>e.pagePath===n))}const pn=!!se.uniIdRouter,{loginPage:fn,routerNeedLogin:gn,resToLogin:yn,needLoginPage:vn,notNeedLoginPage:kn,loginPageInTabBar:wn}=function({pages:e=[],subPackages:t=[],uniIdRouter:a={},tabBar:n={}}=se){const{loginPage:o,needLogin:s=[],resToLogin:i=!0}=a,{needLoginPage:r,notNeedLoginPage:l}=cn(e),{needLoginPage:c,notNeedLoginPage:u}=function(e=[]){const t=[],a=[];return e.forEach((e=>{const{root:n,pages:o=[]}=e,{needLoginPage:s,notNeedLoginPage:i}=cn(o,n);t.push(...s),a.push(...i)})),{needLoginPage:t,notNeedLoginPage:a}}(t);return{loginPage:o,routerNeedLogin:s,resToLogin:i,needLoginPage:[...r,...c],notNeedLoginPage:[...l,...u],loginPageInTabBar:mn(o,n)}}();if(vn.indexOf(fn)>-1)throw new Error(`Login page [${fn}] should not be "needLogin", please check your pages.json`);function bn(e){const t=hn();if("/"===e.charAt(0))return e;const[a,n]=e.split("?"),o=a.replace(/^\//,"").split("/"),s=t.split("/");s.pop();for(let i=0;i<o.length;i++){const e=o[i];".."===e?s.pop():"."!==e&&s.push(e)}return""===s[0]&&s.shift(),"/"+s.join("/")+(n?"?"+n:"")}function _n({redirect:e}){const t=un(e),a=un(fn);return hn()!==a&&t!==a}function xn({api:e,redirect:t}={}){if(!t||!_n({redirect:t}))return;const a=(o=t,"/"!==(n=fn).charAt(0)&&(n="/"+n),o?n.indexOf("?")>-1?n+`&uniIdRedirectUrl=${encodeURIComponent(o)}`:n+`?uniIdRedirectUrl=${encodeURIComponent(o)}`:n);var n,o;wn?"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:a})}),0)}function Sn({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},a=function(){const{token:e,tokenExpired:t}=Xe();let a;if(e){if(t<Date.now()){const e="uni-id-token-expired";a={errCode:e,errMsg:rn[e]}}}else{const e="uni-id-check-token-failed";a={errCode:e,errMsg:rn[e]}}return a}();if(function(e){const t=un(bn(e));return!(kn.indexOf(t)>-1)&&(vn.indexOf(t)>-1||gn.some((t=>{return a=e,new RegExp(t).test(a);var a})))}(e)&&a){if(a.uniIdRedirectUrl=e,ze(Me).length>0)return setTimeout((()=>{He(Me,a)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function Cn(){!function(){const e=dn(),{abortLoginPageJump:t,autoToLoginPage:a}=Sn({url:e});t||a&&xn({api:"redirectTo",redirect:e})}();const e=["navigateTo","redirectTo","reLaunch","switchTab"];for(let t=0;t<e.length;t++){const a=e[t];uni.addInterceptor(a,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:n}=Sn({url:e.url});return t?e:n?(xn({api:a,redirect:bn(e.url)}),!1):e}})}}function Nn(){this.onResponse((e=>{const{type:t,content:a}=e;let n=!1;switch(t){case"cloudobject":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in rn}(a);break;case"clientdb":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in sn}(a)}n&&function(e={}){const t=ze(Me);Ke().then((()=>{const a=dn();if(a&&_n({redirect:a}))return t.length>0?He(Me,Object.assign({uniIdRedirectUrl:a},e)):void(fn&&xn({api:"navigateTo",redirect:a}))}))}(a)}))}function En(e){var t;(t=e).onResponse=function(e){je(Oe,e)},t.offResponse=function(e){qe(Oe,e)},function(e){e.onNeedLogin=function(e){je(Me,e)},e.offNeedLogin=function(e){qe(Me,e)},pn&&(Ee("_globalUniCloudStatus").needLoginInit||(Ee("_globalUniCloudStatus").needLoginInit=!0,Ke().then((()=>{Cn.call(e)})),yn&&Nn.call(e)))}(e),function(e){e.onRefreshToken=function(e){je(Fe,e)},e.offRefreshToken=function(e){qe(Fe,e)}}(e)}let Vn;const Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Bn=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Dn(){const e=Xe().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let a;try{a=JSON.parse((n=t[1],decodeURIComponent(Vn(n).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(o){throw new Error("获取当前用户信息出错,详细错误信息为:"+o.message)}var n;return a.tokenExpired=1e3*a.exp,delete a.exp,delete a.iat,a}Vn="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Bn.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 a,n,o="",s=0;s<e.length;)t=Tn.indexOf(e.charAt(s++))<<18|Tn.indexOf(e.charAt(s++))<<12|(a=Tn.indexOf(e.charAt(s++)))<<6|(n=Tn.indexOf(e.charAt(s++))),o+=64===a?String.fromCharCode(t>>16&255):64===n?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}:atob;var In=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(ie((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a="chooseAndUploadFile:ok",n="chooseAndUploadFile:fail";function o(e,t){return e.tempFiles.forEach(((e,a)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+a+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function s(e,t,{onChooseFile:n,onUploadProgress:o}){return t.then((e=>{if(n){const t=n(e);if(void 0!==t)return Promise.resolve(t).then((t=>void 0===t?e:t))}return e})).then((t=>!1===t?{errMsg:a,tempFilePaths:[],tempFiles:[]}:function(e,t,n=5,o){(t=Object.assign({},t)).errMsg=a;const s=t.tempFiles,i=s.length;let r=0;return new Promise((a=>{for(;r<n;)l();function l(){const n=r++;if(n>=i)return void(!s.find((e=>!e.url&&!e.errMsg))&&a(t));const c=s[n];e.uploadFile({provider:c.provider,filePath:c.path,cloudPath:c.cloudPath,fileType:c.fileType,cloudPathAsRealPath:c.cloudPathAsRealPath,onUploadProgress(e){e.index=n,e.tempFile=c,e.tempFilePath=c.path,o&&o(e)}}).then((e=>{c.url=e.fileID,n<i&&l()})).catch((e=>{c.errMsg=e.errMsg||e.message,n<i&&l()}))}}))}(e,t,5,o)))}t.initChooseAndUploadFile=function(e){return function(t={type:"all"}){return"image"===t.type?s(e,function(e){const{count:t,sizeType:a,sourceType:s=["album","camera"],extension:i}=e;return new Promise(((e,r)=>{uni.chooseImage({count:t,sizeType:a,sourceType:s,extension:i,success(t){e(o(t,"image"))},fail(e){r({errMsg:e.errMsg.replace("chooseImage:fail",n)})}})}))}(t),t):"video"===t.type?s(e,function(e){const{camera:t,compressed:a,maxDuration:s,sourceType:i=["album","camera"],extension:r}=e;return new Promise(((e,l)=>{uni.chooseVideo({camera:t,compressed:a,maxDuration:s,sourceType:i,extension:r,success(t){const{tempFilePath:a,duration:n,size:s,height:i,width:r}=t;e(o({errMsg:"chooseVideo:ok",tempFilePaths:[a],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:a,size:s,type:t.tempFile&&t.tempFile.type||"",width:r,height:i,duration:n,fileType:"video",cloudPath:""}]},"video"))},fail(e){l({errMsg:e.errMsg.replace("chooseVideo:fail",n)})}})}))}(t),t):s(e,function(e){const{count:t,extension:a}=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:n+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});i({type:"all",count:t,extension:a,success(t){e(o(t))},fail(e){s({errMsg:e.errMsg.replace("chooseFile:fail",n)})}})}))}(t),t)}}})));function An(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 a=!1;const n=[];for(let o=2;o<e.length;o++)e[o]!==t[o]&&(n.push(e[o]),a=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(a,n)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:a}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomError=null,this.mixinDatacomGet().then((a=>{this.mixinDatacomLoading=!1;const{data:n,count:o}=a.result;this.getcount&&(this.mixinDatacomPage.count=o),this.mixinDatacomHasMore=n.length<this.pageSize;const s=e?n.length?n[0]:void 0:n;this.mixinDatacomResData=s,t&&t(s)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,this.mixinDatacomError=e,a&&a(e)})))},mixinDatacomGet(t={}){let a;t=t||{},a="undefined"!=typeof __uniX&&__uniX?e.databaseForJQL(this.spaceInfo):e.database(this.spaceInfo);const n=t.action||this.action;n&&(a=a.action(n));const o=t.collection||this.collection;a=Array.isArray(o)?a.collection(...o):a.collection(o);const s=t.where||this.where;s&&Object.keys(s).length&&(a=a.where(s));const i=t.field||this.field;i&&(a=a.field(i));const r=t.foreignKey||this.foreignKey;r&&(a=a.foreignKey(r));const l=t.groupby||this.groupby;l&&(a=a.groupBy(l));const c=t.groupField||this.groupField;c&&(a=a.groupField(c)),!0===(void 0!==t.distinct?t.distinct:this.distinct)&&(a=a.distinct());const u=t.orderby||this.orderby;u&&(a=a.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,f=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,g={getCount:m},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return p&&(g.getTree=y),f&&(g.getTreePath=y),a=a.skip(h*(d-1)).limit(h).get(g),a}}}}function Pn(e){return Ee("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function Ln({openid:e,callLoginByWeixin:t=!1}={}){throw Pn(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `app`")}async function On(e){const t=Pn(this);return t.initPromise||(t.initPromise=Ln.call(this,e).then((e=>e)).catch((e=>{throw delete t.initPromise,e}))),t.initPromise}function Mn(e){st=e}function Fn(e){const t={getSystemInfo:uni.getSystemInfo,getPushClientId:uni.getPushClientId};return function(a){return new Promise(((n,o)=>{t[e]({...a,success(e){n(e)},fail(e){o(e)}})}))}}class Rn 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 a=this._callback[e];if(!a)return;const n=function(e,t){for(let a=e.length-1;a>=0;a--)if(e[a]===t)return a;return-1}(a,t);a.splice(n,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const a=this._callback[e];if(a)for(let n=0;n<a.length;n++)a[n](...t)}}{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([Fn("getSystemInfo")(),Fn("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:a,messageId:n,message:o}=t;this._payloadQueue.push({action:a,messageId:n,message:o}),this._consumMessage()}_consumMessage(){for(;;){const e=this._payloadQueue.find((e=>e.messageId===this._currentMessageId+1));if(!e)break;this._currentMessageId++,this._parseMessagePayload(e)}}_parseMessagePayload(e){const{action:t,messageId:a,message:n}=e;"end"===t?this._end({messageId:a,message:n}):"message"===t&&this._appendMessage({messageId:a,message:n})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){uni.onPushMessage(this._uniPushMessageCallback)}_destroy(){uni.offPushMessage(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}const $n={tcb:ka,tencent:ka,aliyun:ut,private:_a,dcloud:_a,alipay:Da};let Un=new class{init(e){let t={};const a=$n[e.provider];if(!a)throw new Error("未提供正确的provider参数");var n;return t=a.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new be({createPromise:function(){let t=Promise.resolve();t=new Promise((e=>{setTimeout((()=>{e()}),1)}));const a=e.auth();return t.then((()=>a.getLoginState())).then((e=>e?Promise.resolve():a.signInAnonymously()))}}))}(t),qa(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(n=t).database=function(e){if(e&&Object.keys(e).length>0)return n.init(e).database();if(this._database)return this._database;const t=tn(an,{uniClient:n});return this._database=t,t},n.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return n.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=tn(an,{uniClient:n,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=Dn,e.chooseAndUploadFile=In.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return An(e)}}),e.SSEChannel=Rn,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:a=!1}={}){return On.call(e,{openid:t,callLoginByWeixin:a})}}(e),e.setCustomClientInfo=Mn,e.importObject=function(t){return function(a,n={}){n=function(e,t={}){return e.customUI=t.customUI||e.customUI,e.parseSystemError=t.parseSystemError||e.parseSystemError,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeof t.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},n);const{customUI:o,loadingOptions:s,errorOptions:i,parseSystemError:r}=n,l=!o;return new Proxy({},{get(o,c){switch(c){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:e,interceptorName:t,getCallbackArgs:a}={}){return async function(...n){const o=a?a({params:n}):{};let s,i;try{return await Ie(Ae(t,"invoke"),{...o}),s=await e(...n),await Ie(Ae(t,"success"),{...o,result:s}),s}catch(r){throw i=r,await Ie(Ae(t,"fail"),{...o,error:i}),i}finally{await Ie(Ae(t,"complete"),i?{...o,error:i}:{...o,result:s})}}}({fn:async function o(...u){let d;l&&uni.showLoading({title:s.title,mask:s.mask});const h={name:a,type:"OBJECT",data:{method:c,params:u}};"object"==typeof n.secretMethods&&function(e,t){const a=t.data.method,n=e.secretMethods||{},o=n[a]||n["*"];o&&(t.secretType=o)}(n,h);let m=!1;try{d=await t.callFunction(h)}catch(e){m=!0,d={result:new Ye(e)}}const{errSubject:p,errCode:f,errMsg:g,newToken:y}=d.result||{};if(l&&uni.hideLoading(),y&&y.token&&y.tokenExpired&&(et(y),He(Fe,{...y})),f){let e=g;if(m&&r&&(e=(await r({objectName:a,methodName:c,params:u,errSubject:p,errCode:f,errMsg:g})).errMsg||g),l)if("toast"===i.type)uni.showToast({title:e,icon:"none"});else{if("modal"!==i.type)throw new Error(`Invalid errorOptions.type: ${i.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel:a,cancelText:n,confirmText:o}={}){return new Promise(((s,i)=>{uni.showModal({title:e,content:t,showCancel:a,cancelText:n,confirmText:o,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 o(...u)}}const t=new Ye({subject:p,code:f,message:g,requestId:d.requestId});throw t.detail=d.result,He(Oe,{type:Ue,content:t}),t}return He(Oe,{type:Ue,content:d.result}),d.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:a,methodName:c,params:e}}})}})}}(e)}(t),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;const a=t[e];t[e]=function(){return a.apply(t,Array.from(arguments))},t[e]=function(e,t){return function(a){let n=!1;if("callFunction"===t){const e=a&&a.type||he;n=e!==he}const o="callFunction"===t&&!n,s=this._initPromiseHub.exec();a=a||{};const{success:i,fail:r,complete:l}=Ge(a),c=s.then((()=>n?Promise.resolve():Ie(Ae(t,"invoke"),a))).then((()=>e.call(this,a))).then((e=>n?Promise.resolve(e):Ie(Ae(t,"success"),e).then((()=>Ie(Ae(t,"complete"),e))).then((()=>(o&&He(Oe,{type:$e,content:e}),Promise.resolve(e))))),(e=>n?Promise.reject(e):Ie(Ae(t,"fail"),e).then((()=>Ie(Ae(t,"complete"),e))).then((()=>(He(Oe,{type:$e,content:e}),Promise.reject(e))))));if(!(i||r||l))return c;c.then((e=>{i&&i(e),l&&l(e),o&&He(Oe,{type:$e,content:e})}),(e=>{r&&r(e),l&&l(e),o&&He(Oe,{type:$e,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=Se;let t={};if(e&&1===e.length)t=e[0],Un=Un.init(t),Un._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];let a;a=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",t.forEach((e=>{Un[e]=function(){return console.error(a),Promise.reject(new Ye({code:"SYS_ERR",message:a}))}}))}Object.assign(Un,{get mixinDatacom(){return An(Un)}}),En(Un),Un.addInterceptor=Be,Un.removeInterceptor=De,Un.interceptObject=Pe})();var zn=Un;const jn={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 qn;setTimeout((()=>{qn=uni.getSystemInfoSync().platform}),16);const{t:Hn}=te(jn);const Wn=u({name:"UniLoadMore",emits:["clickLoadMore"],props:{status:{type:String,default:"more"},showIcon:{type:Boolean,default:!0},iconType:{type:String,default:"auto"},iconSize:{type:Number,default:24},color:{type:String,default:"#777777"},contentText:{type:Object,default:()=>({contentdown:"",contentrefresh:"",contentnomore:""})},showText:{type:Boolean,default:!0}},data:()=>({webviewHide:!1,platform:qn,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||Hn("uni-load-more.contentdown")},contentrefreshText(){return this.contentText.contentrefresh||Hn("uni-load-more.contentrefresh")},contentnomoreText(){return this.contentText.contentnomore||Hn("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,a,n,o,s,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-load-more",onClick:a[0]||(a[0]=(...e)=>i.onClick&&i.onClick(...e))},[!s.webviewHide&&("circle"===n.iconType||"auto"===n.iconType&&"android"===s.platform)&&"loading"===n.status&&n.showIcon?(e.openBlock(),e.createElementBlock("view",{key:0,style:e.normalizeStyle({width:n.iconSize+"px",height:n.iconSize+"px"}),class:"uni-load-more__img uni-load-more__img--android-MP"},[e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:n.color,borderTopWidth:n.iconSize/12})},null,4),e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:n.color,borderTopWidth:n.iconSize/12})},null,4),e.createElementVNode("view",{class:"uni-load-more__img-icon",style:e.normalizeStyle({borderTopColor:n.color,borderTopWidth:n.iconSize/12})},null,4)],4)):!s.webviewHide&&"loading"===n.status&&n.showIcon?(e.openBlock(),e.createElementBlock("view",{key:1,style:e.normalizeStyle({width:n.iconSize+"px",height:n.iconSize+"px"}),class:"uni-load-more__img uni-load-more__img--ios-H5"},[e.createElementVNode("image",{src:s.imgBase64,mode:"widthFix"},null,8,["src"])],4)):e.createCommentVNode("",!0),n.showText?(e.openBlock(),e.createElementBlock("text",{key:2,class:"uni-load-more__text",style:e.normalizeStyle({color:n.color})},e.toDisplayString("more"===n.status?i.contentdownText:"loading"===n.status?i.contentrefreshText:i.contentnomoreText),5)):e.createCommentVNode("",!0)])}],["__scopeId","data-v-a7e112cc"]]),Jn={name:"uniDataChecklist",mixins:[zn.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,a=t.$options.name;for(;a!==e;){if(t=t.$parent,!t)return!1;a=t.$options.name}return t},change(e){const t=e.detail.value;let a={value:[],data:[]};if(this.multiple)this.range.forEach((e=>{t.includes(e[this.map.value]+"")&&(a.value.push(e[this.map.value]),a.data.push(e))}));else{const e=this.range.find((e=>e[this.map.value]+""===t));e&&(a={value:e[this.map.value],data:e})}this.$emit("input",a.value),this.$emit("update:modelValue",a.value),this.$emit("change",{detail:a}),this.multiple?this.dataList=this.getDataList(a.value,!0):this.dataList=this.getDataList(a.value)},getDataList(e){let t=JSON.parse(JSON.stringify(this.range)),a=[];return this.multiple&&(Array.isArray(e)||(e=[])),t.forEach(((t,n)=>{if(t.disabled=t.disable||t.disabled||!1,this.multiple)if(e.length>0){let a=e.find((e=>e===t[this.map.value]));t.selected=void 0!==a}else t.selected=!1;else t.selected=e===t[this.map.value];a.push(t)})),this.setRange(a)},setRange(e){let t=e.filter((e=>e.selected)),a=Number(this.min)||0,n=Number(this.max)||"";return e.forEach(((o,s)=>{if(this.multiple){if(t.length<=a){void 0!==t.find((e=>e[this.map.value]===o[this.map.value]))&&(o.disabled=!0)}if(t.length>=n&&""!==n){void 0===t.find((e=>e[this.map.value]===o[this.map.value]))&&(o.disabled=!0)}}this.setStyles(o,s),e[s]=o})),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={},a=this.selectedColor?this.selectedColor:"#2979ff";this.selectedColor&&("list"!==this.mode&&(t["border-color"]=e.selected?a:"#DCDFE6"),"tag"===this.mode&&(t["background-color"]=e.selected?a:"#f5f5f5"));let n="";for(let o in t)n+=`${o}:${t[o]};`;return n},setStyleIcon(e){let t={},a="";if(this.selectedColor){let a=this.selectedColor?this.selectedColor:"#2979ff";t["background-color"]=e.selected?a:"#fff",t["border-color"]=e.selected?a:"#DCDFE6",!e.selected&&e.disabled&&(t["background-color"]="#F2F6FC",t["border-color"]=e.selected?a:"#DCDFE6")}for(let n in t)a+=`${n}:${t[n]};`;return a},setStyleIconText(e){let t={},a="";if(this.selectedColor){let a=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:a:"#666",!e.selected&&e.disabled&&(t.color="#999")}for(let n in t)a+=`${n}:${t[n]};`;return a},setStyleRightIcon(e){let t={},a="";"list"===this.mode&&(t["border-color"]=e.selected?this.styles.selectedColor:"#DCDFE6");for(let n in t)a+=`${n}:${t[n]};`;return a}}};const Kn=u(Jn,[["render",function(t,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-load-more"),Wn);return e.openBlock(),e.createElementBlock("view",{class:"uni-data-checklist",style:e.normalizeStyle({"margin-top":i.isTop+"px"})},[i.isLocal?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.multiple?(e.openBlock(),e.createElementBlock("checkbox-group",{key:0,class:e.normalizeClass(["checklist-group",{"is-list":"list"===o.mode||o.wrap}]),onChange:n[0]||(n[0]=(...e)=>r.change&&r.change(...e))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,((t,a)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["checklist-box",["is--"+o.mode,t.selected?"is-checked":"",o.disabled||t.disabled?"is-disable":"",0!==a&&"list"===o.mode?"is-list-border":""]]),style:e.normalizeStyle(t.styleBackgroud),key:a},[e.createElementVNode("checkbox",{class:"hidden",hidden:"",disabled:o.disabled||!!t.disabled,value:t[o.map.value]+"",checked:t.selected},null,8,["disabled","value","checked"]),"tag"!==o.mode&&"list"!==o.mode||"list"===o.mode&&"left"===o.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"===o.mode&&"left"===o.icon}])},[e.createElementVNode("text",{class:"checklist-text",style:e.normalizeStyle(t.styleIconText)},e.toDisplayString(t[o.map.text]),5),"list"===o.mode&&"right"===o.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"===o.mode,"is-wrap":o.wrap}]),onChange:n[1]||(n[1]=(...e)=>r.change&&r.change(...e))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,((t,a)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["checklist-box",["is--"+o.mode,t.selected?"is-checked":"",o.disabled||t.disabled?"is-disable":"",0!==a&&"list"===o.mode?"is-list-border":""]]),style:e.normalizeStyle(t.styleBackgroud),key:a},[e.createElementVNode("radio",{class:"hidden",hidden:"",disabled:o.disabled||t.disabled,value:t[o.map.value]+"",checked:t.selected},null,8,["disabled","value","checked"]),"tag"!==o.mode&&"list"!==o.mode||"list"===o.mode&&"left"===o.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"===o.mode&&"left"===o.icon}])},[e.createElementVNode("text",{class:"checklist-text",style:e.normalizeStyle(t.styleIconText)},e.toDisplayString(t[o.map.text]),5),"list"===o.mode&&"right"===o.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"]]);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Gn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yn={exports:{}};Yn.exports=function(){var e=1e3,t=6e4,a=36e5,n="millisecond",o="second",s="minute",i="hour",r="day",l="week",c="month",u="quarter",d="year",h="date",m="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],a=e%100;return"["+e+(t[(a-20)%10]||t[a]||t[0])+"]"}},y=function(e,t,a){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(a)+e},v={s:y,z:function(e){var t=-e.utcOffset(),a=Math.abs(t),n=Math.floor(a/60),o=a%60;return(t<=0?"+":"-")+y(n,2,"0")+":"+y(o,2,"0")},m:function e(t,a){if(t.date()<a.date())return-e(a,t);var n=12*(a.year()-t.year())+(a.month()-t.month()),o=t.clone().add(n,c),s=a-o<0,i=t.clone().add(n+(s?-1:1),c);return+(-(n+(a-o)/(s?o-i:i-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:l,d:r,D:h,h:i,m:s,s:o,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},k="en",w={};w[k]=g;var b="$isDayjsObject",_=function(e){return e instanceof N||!(!e||!e[b])},x=function e(t,a,n){var o;if(!t)return k;if("string"==typeof t){var s=t.toLowerCase();w[s]&&(o=s),a&&(w[s]=a,o=s);var i=t.split("-");if(!o&&i.length>1)return e(i[0])}else{var r=t.name;w[r]=t,o=r}return!n&&o&&(k=o),o||!n&&k},S=function(e,t){if(_(e))return e.clone();var a="object"==typeof t?t:{};return a.date=e,a.args=arguments,new N(a)},C=v;C.l=x,C.i=_,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var N=function(){function g(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,a=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var o=n[2]-1||0,s=(n[7]||"0").substring(0,3);return a?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return C},y.isValid=function(){return!(this.$d.toString()===m)},y.isSame=function(e,t){var a=S(e);return this.startOf(t)<=a&&a<=this.endOf(t)},y.isAfter=function(e,t){return S(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<S(e)},y.$g=function(e,t,a){return C.u(e)?this[t]:this.set(a,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var a=this,n=!!C.u(t)||t,u=C.p(e),m=function(e,t){var o=C.w(a.$u?Date.UTC(a.$y,t,e):new Date(a.$y,t,e),a);return n?o:o.endOf(r)},p=function(e,t){return C.w(a.toDate()[e].apply(a.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),a)},f=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(u){case d:return n?m(1,0):m(31,11);case c:return n?m(1,g):m(0,g+1);case l:var k=this.$locale().weekStart||0,w=(f<k?f+7:f)-k;return m(n?y-w:y+(6-w),g);case r:case h:return p(v+"Hours",0);case i:return p(v+"Minutes",1);case s:return p(v+"Seconds",2);case o:return p(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var a,l=C.p(e),u="set"+(this.$u?"UTC":""),m=(a={},a[r]=u+"Date",a[h]=u+"Date",a[c]=u+"Month",a[d]=u+"FullYear",a[i]=u+"Hours",a[s]=u+"Minutes",a[o]=u+"Seconds",a[n]=u+"Milliseconds",a)[l],p=l===r?this.$D+(t-this.$W):t;if(l===c||l===d){var f=this.clone().set(h,1);f.$d[m](p),f.init(),this.$d=f.set(h,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[C.p(e)]()},y.add=function(n,u){var h,m=this;n=Number(n);var p=C.p(u),f=function(e){var t=S(m);return C.w(t.date(t.date()+Math.round(e*n)),m)};if(p===c)return this.set(c,this.$M+n);if(p===d)return this.set(d,this.$y+n);if(p===r)return f(1);if(p===l)return f(7);var g=(h={},h[s]=t,h[i]=a,h[o]=e,h)[p]||1,y=this.$d.getTime()+n*g;return C.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,a=this.$locale();if(!this.isValid())return a.invalidDate||m;var n=e||"YYYY-MM-DDTHH:mm:ssZ",o=C.z(this),s=this.$H,i=this.$m,r=this.$M,l=a.weekdays,c=a.months,u=a.meridiem,d=function(e,a,o,s){return e&&(e[a]||e(t,n))||o[a].slice(0,s)},h=function(e){return C.s(s%12||12,e,"0")},p=u||function(e,t,a){var n=e<12?"AM":"PM";return a?n.toLowerCase():n};return n.replace(f,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return C.s(t.$y,4,"0");case"M":return r+1;case"MM":return C.s(r+1,2,"0");case"MMM":return d(a.monthsShort,r,c,3);case"MMMM":return d(c,r);case"D":return t.$D;case"DD":return C.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(a.weekdaysMin,t.$W,l,2);case"ddd":return d(a.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(s);case"HH":return C.s(s,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return p(s,i,!0);case"A":return p(s,i,!1);case"m":return String(i);case"mm":return C.s(i,2,"0");case"s":return String(t.$s);case"ss":return C.s(t.$s,2,"0");case"SSS":return C.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,h,m){var p,f=this,g=C.p(h),y=S(n),v=(y.utcOffset()-this.utcOffset())*t,k=this-y,w=function(){return C.m(f,y)};switch(g){case d:p=w()/12;break;case c:p=w();break;case u:p=w()/3;break;case l:p=(k-v)/6048e5;break;case r:p=(k-v)/864e5;break;case i:p=k/a;break;case s:p=k/t;break;case o:p=k/e;break;default:p=k}return m?p:C.a(p)},y.daysInMonth=function(){return this.endOf(c).$D},y.$locale=function(){return w[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var a=this.clone(),n=x(e,t,!0);return n&&(a.$L=n),a},y.clone=function(){return C.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),E=N.prototype;return S.prototype=E,[["$ms",n],["$s",o],["$m",s],["$H",i],["$W",r],["$M",c],["$y",d],["$D",h]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,N,S),e.$i=!0),S},S.locale=x,S.isDayjs=_,S.unix=function(e){return S(1e3*e)},S.en=w[k],S.Ls=w,S.p={},S}();const Qn=Gn(Yn.exports);var Zn;const Xn={get isIOS(){return"boolean"==typeof Zn?Zn:Zn="ios"===uni.getSystemInfoSync().platform},requestIOS:function(e){return new Promise(((a,n)=>{switch(e){case"push":a(function(){var e=0,a=plus.ios.import("UIApplication"),n=a.sharedApplication();if(n.currentUserNotificationSettings){var o=n.currentUserNotificationSettings();0==o.plusGetAttribute("types")?(e=0,t("log","at common/permission.js:63","推送权限没有开启")):(e=1,t("log","at common/permission.js:66","已经开启推送功能!")),plus.ios.deleteObject(o)}else 0==n.enabledRemoteNotificationTypes()?(e=3,t("log","at common/permission.js:73","推送权限没有开启!")):(e=4,t("log","at common/permission.js:76","已经开启推送功能!"));return plus.ios.deleteObject(n),plus.ios.deleteObject(a),e}());break;case"location":a((o=0,s=plus.ios.import("CLLocationManager"),i=s.locationServicesEnabled(),r=s.authorizationStatus(),o=i?0===r?null:3===r||4===r?1:0:2,plus.ios.deleteObject(s),o));break;case"record":a(function(){var e=null,a=plus.ios.import("AVAudioSession"),n=a.sharedInstance().recordPermission();return t("log","at common/permission.js:104","permissionStatus:"+n),e=1970168948===n?null:1735552628===n?1:0,plus.ios.deleteObject(a),e}());break;case"camera":a(function(){var e=0,t=plus.ios.import("AVCaptureDevice"),a=t.authorizationStatusForMediaType("vide");return e=0===a?null:3==a?1:0,plus.ios.deleteObject(t),e}());break;case"album":a(function(){var e=0,t=plus.ios.import("PHPhotoLibrary"),a=t.authorizationStatus();return e=0===a?null:3==a?1:0,plus.ios.deleteObject(t),e}());break;case"contact":a(function(){var e=0,t=plus.ios.import("CNContactStore"),a=t.authorizationStatusForEntityType(0);return e=0===a?null:3==a?1:0,plus.ios.deleteObject(t),e}());break;case"calendar":a(function(){var e=null,a=plus.ios.import("EKEventStore");return 3==a.authorizationStatusForEntityType(0)?(e=1,t("log","at common/permission.js:122","日历权限已经开启")):t("log","at common/permission.js:124","日历权限没有开启"),plus.ios.deleteObject(a),e}());break;case"memo":a(function(){var e=null,a=plus.ios.import("EKEventStore");return 3==a.authorizationStatusForEntityType(1)?(e=1,t("log","at common/permission.js:136","备忘录权限已经开启")):t("log","at common/permission.js:138","备忘录权限没有开启"),plus.ios.deleteObject(a),e}());break;default:a(0)}var o,s,i,r}))},requestAndroid:function(e){return new Promise(((a,n)=>{plus.android.requestPermissions([e],(function(e){for(var n=0,o=0;o<e.granted.length;o++){t("log","at common/permission.js:187","已获取的权限:"+e.granted[o]),n=1}for(o=0;o<e.deniedPresent.length;o++){t("log","at common/permission.js:192","拒绝本次申请的权限:"+e.deniedPresent[o]),n=0}for(o=0;o<e.deniedAlways.length;o++){t("log","at common/permission.js:197","永久拒绝申请的权限:"+e.deniedAlways[o]),n=-1}a(n)}),(function(e){t("log","at common/permission.js:203","result error: "+e.message),a({code:e.code,message:e.message})}))}))},gotoAppSetting:function(){if(Xn.isIOS){var e=plus.ios.import("UIApplication").sharedApplication(),t=plus.ios.import("NSURL"),a=t.URLWithString("app-settings:");e.openURL(a),plus.ios.deleteObject(a),plus.ios.deleteObject(t),plus.ios.deleteObject(e)}else{var n=plus.android.importClass("android.content.Intent"),o=plus.android.importClass("android.provider.Settings"),s=plus.android.importClass("android.net.Uri"),i=plus.android.runtimeMainActivity(),r=new n;r.setAction(o.ACTION_APPLICATION_DETAILS_SETTINGS);var l=s.fromParts("package",i.getPackageName(),null);r.setData(l),i.startActivity(r)}}},eo="http://dsg.tms.api.aibasil.cn",to=eo+"/admin/order.ScanOrder/getWarehouseSpace",ao=eo+"/admin/order.scanOrder/getBindParams",no=eo+"/admin/printer//getPrinterList",oo=eo+"/admin/order.ScanOrder/printWaybillLabel",so=eo+"/admin/Config/getAliyunOssSignature",io=[];for(let Zo=0;Zo<=15;Zo++)io[Zo]=Zo.toString(16);function ro(){let e="";for(let t=1;t<=36;t++)e+=9===t||14===t||19===t||24===t?"-":15===t?4:20===t?io[4*Math.random()|8]:io[16*Math.random()|0];return e}const lo=e.defineComponent({__name:"index",setup(n){const i=e.ref(),r=e.ref(),l=e.ref(),u=e.ref(),d=e.ref(null),h=e.ref(null),m=e.ref(!1),p=e.ref([]),f=e.ref(""),y=e.ref(""),w=e.ref([]),b=e.ref([]),_=e.ref(null),x=e.ref(6),S=e.ref({}),C=e.ref([]),N=e.ref([]),E=e.ref([1]),V=e.ref(0),T=e.ref(!1),B=e.ref(!0),D=e.ref(),I=e.reactive({images:[],orderNum:"",batch_number:"",space_code:"",weight:"",typing:!0}),A=e.computed((()=>({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]},weight:{rules:[{required:!0,errorMessage:"重量不能为空"},{format:"number",errorMessage:"重量只能输入数字"}]}}))),P=e.computed((()=>{try{const e=b.value.find((e=>e.value===I.space_code));return null==e?void 0:e.text}catch(mt){return t("log","at pages/weigh/index.vue:201",mt),""}}));o((()=>{B.value=!0,m.value=!1,d.value=uni.getStorageSync("token"),h.value=uni.getStorageSync("user"),O(),F(),R()})),s((()=>{B.value=!1,m.value=!1})),c((e=>{0===e.index&&uni.navigateTo({url:"/pages/weigh/instockLog"})}));const O=()=>{uni.request({url:to,method:"POST",header:{batoken:d.value},data:{code:""},success:e=>{1===e.data.code&&(b.value=e.data.data.spaces.map((e=>({text:e.name,value:e.code}))))}})},F=()=>{uni.request({url:ao,method:"GET",header:{batoken:d.value},success:e=>{1===e.data.code&&(w.value=e.data.data.batch_number.map((e=>({text:e.name,value:e.id}))))},fail(e){t("log","at pages/weigh/index.vue:267","fail--",e)}})},R=()=>{uni.request({url:no,method:"GET",header:{batoken:d.value},success:e=>{1===e.data.code&&(S.value=e.data.data.printers,N.value=Object.values(S.value).map((e=>({text:e.name,value:e.value}))))},fail(e){t("log","at pages/weigh/index.vue:291","fail--",e)}})},$=()=>{m.value=!1,B.value=!1,p.value=[],I.orderNum="",I.batch_number="",I.weight="",I.typing=!0,e.nextTick((()=>{B.value=!0}))},U=async()=>{1===await z()&&uni.scanCode({success:e=>{D.value=e.result,I.orderNum=e.result},fail:e=>{}})},z=async()=>{let e=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e};let q;const H=async()=>{m.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.scanOrder/checkWaybillGoods",method:"POST",header:{batoken:d.value},data:{order_no:I.orderNum},success:e=>{1===e.data.code&&e.data.data.is_goods_empty?i.value.open():W(0)}})},W=e=>{const a=ee();t("log","at pages/weigh/index.vue:376","images--",a);let n=!0;for(var o=0;o<a.length;o++)a[o].savePath||(n=!1);if(!n)return f.value="error",y.value="图片还没上传完毕,请稍后...",r.value.open(),void(m.value=!1);uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.ScanOrder/weigh",method:"POST",header:{batoken:d.value},data:{order_no:I.orderNum,weight:I.weight,is_save_goods:e,images:a},success:e=>{if(m.value=!1,1==e.data.code){f.value="success",y.value=e.data.msg,r.value.open(),t("log","at pages/weigh/index.vue:408","res.data.data---",e.data.data);const a={orderNum:I.orderNum,createTime:new Date,space:P.value,type:"称重",status:!0};C.value.unshift(a),uni.setStorageSync("weighHistory",C.value),X(),e.data.data.express_label?(t("log","at pages/weigh/index.vue:422","有打印面单"),V.value=E.value.length>0?N.value[0].value:0,u.value.open()):q=setTimeout((()=>{$(),q&&clearTimeout(q)}),1e3)}else{f.value="error",y.value=e.data.msg,r.value.open();const t={orderNum:I.orderNum,createTime:new Date,space:P.value,type:"称重",status:!1};C.value.unshift(t),uni.setStorageSync("weighHistory",C.value),X(),q=setTimeout((()=>{$(),q&&clearTimeout(q)}),1e3)}}})},J=()=>{u.value.close(),q=setTimeout((()=>{$(),q&&clearTimeout(q)}),700)},K=()=>{W(1)},G=()=>{W(0)},Y=e=>{!e.detail.value.length>0?V.value=0:V.value=N.value[0].value},Q=()=>{T.value=!0,uni.request({url:oo,method:"POST",header:{batoken:d.value},data:{order_no:I.orderNum,printer_code:V},success:e=>{J(),T.value=!1,t("log","at pages/weigh/index.vue:490","打印成功",e),f.value="success",y.value="打印成功",r.value.open()}})},Z=()=>{l.value.validate().then((e=>{(async()=>{q&&clearTimeout(q),await H()})()})).catch((e=>{t("log","at pages/weigh/index.vue:504","err",e)}))},X=()=>{C.value=uni.getStorageSync("weighHistory")},ee=()=>{const e=p.value.map((e=>({name:e.name,savePath:e.serverUrl,fileSize:e.size,mimeType:e.type})));return t("log","at pages/weigh/index.vue:519","res22 ",e),e},te=(e,a)=>{const n={policy:e.policy,signature:e.signature,ossaccessKeyId:e.ossAccessKeyId,key:e.dir+Qn().format("YYYYMMDD")+"/"+ro()+"_"+a.name,dir:e.dir,host:e.host,file:a.file};return new Promise(((o,s)=>{let i=a.name;i="file";uni.uploadFile({url:e.host,filePath:a.path,name:"file",formData:n,success:e=>{204===e.statusCode||200===e.statusCode?(a.serverUrl=n.key,o(e)):s(e)},fail:e=>{t("log","at pages/weigh/index.vue:588","error++",e),s(e)},complete:()=>{t("log","at pages/weigh/index.vue:593","complete---"),a.progress=100}}).onProgressUpdate((e=>{a.progress=e.progress}))}))},ae=()=>{uni.chooseImage({count:x.value-p.value.length,success:a=>{p.value=p.value.concat(a.tempFiles.map((e=>{const t={size:e.size,path:e.path,name:e.name,type:e.type,progress:0,file:e},a=e.path.substring(e.path.lastIndexOf(".")+1),n=e.path.substring(e.path.lastIndexOf("/")+1);return t.name=n,t.type=a,t})));const n=p.value.filter((e=>0===e.progress));e.nextTick((()=>{var e;e=n,uni.request({url:so,method:"GET",header:{batoken:d.value},success:({data:a})=>{const n=a.data.signature,o=e.map((e=>te(n,e)));Promise.all(o).then((e=>{t("log","at pages/weigh/index.vue:540","所有图片加载成功:",e),uni.showToast({title:"加载成功",icon:"success"})})).catch((e=>{t("error","at pages/weigh/index.vue:547","加载失败:",e),uni.showToast({title:"加载失败",icon:"none"})}))},fail:e=>{t("log","at pages/weigh/index.vue:555",e)}})}))},fail:e=>{t("error","at pages/weigh/index.vue:638",e)}})},ne=()=>{_.value=null};return(t,n)=>{const o=a(e.resolveDynamicComponent("uni-easyinput"),v),s=a(e.resolveDynamicComponent("uni-forms-item"),k),c=a(e.resolveDynamicComponent("uni-icons"),g),d=a(e.resolveDynamicComponent("uni-forms"),L),h=a(e.resolveDynamicComponent("uni-popup-message"),M),w=a(e.resolveDynamicComponent("uni-popup"),j),b=a(e.resolveDynamicComponent("uni-popup-dialog"),oe),D=a(e.resolveDynamicComponent("uni-data-checkbox"),Kn);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"example"},[e.createVNode(d,{ref_key:"valiForm",ref:l,"label-align":"right",rules:A.value,modelValue:I},{default:e.withCtx((()=>[e.createVNode(s,{label:"单号",required:!0,name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:I.orderNum,"onUpdate:modelValue":n[0]||(n[0]=e=>I.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:B.value,onIconClick:U},null,8,["modelValue","focus"])])),_:1}),e.createVNode(s,{label:"重量",required:"",name:"weight"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:I.weight,"onUpdate:modelValue":n[1]||(n[1]=e=>I.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:"images"},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"upload-container"},[e.createElementVNode("view",{class:"preview"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,((t,a)=>(e.openBlock(),e.createElementBlock("view",{key:a,class:"image-container"},[e.createElementVNode("image",{src:t.path,class:"preview-image",mode:"aspectFill",onClick:e=>{return a=t.path,void(_.value=a);var a}},null,8,["src","onClick"]),e.createElementVNode("progress",{percent:t.progress||0,activeColor:100===Number(t.progress||0)?"#00ff00":"#10AEFF","stroke-width":"3"},null,8,["percent","activeColor"]),"success"===t.status?(e.openBlock(),e.createElementBlock("text",{key:0},"1")):e.createCommentVNode("",!0),e.createVNode(c,{class:"delete-icon",onClick:e=>(e=>{p.value.splice(e,1)})(a),type:"clear",size:"20",color:"red"},null,8,["onClick"])])))),128)),p.value.length<x.value?(e.openBlock(),e.createElementBlock("view",{key:0,class:"choose-image-container",onClick:ae},[e.createVNode(c,{type:"plusempty",size:"40",color:"#ccc"})])):e.createCommentVNode("",!0)]),e.createElementVNode("text",{style:{"padding-top":"8px"}},"最多选择6张图片"),_.value?(e.openBlock(),e.createElementBlock("view",{key:0,class:"preview-modal",onClick:ne},[e.createElementVNode("image",{src:_.value,class:"preview-large",mode:"aspectFit",onClick:e.withModifiers(ne,["stop"])},null,8,["src"])])):e.createCommentVNode("",!0)])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:$},"重置"),e.createElementVNode("button",{type:"primary",onClick:Z,loading:m.value},[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{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(C.value.slice(0,5),((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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(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(w,{ref_key:"message",ref:r,type:"message"},{default:e.withCtx((()=>[e.createVNode(h,{type:f.value,message:y.value,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(w,{ref_key:"alertDialog",ref:i,type:"dialog"},{default:e.withCtx((()=>[e.createVNode(b,{type:"info",cancelText:"否",confirmText:"是",title:"提示",content:"是否按默认申报(默认申报为:衣服,10件,单价1)",onConfirm:K,onClose:G})])),_:1},512),e.createVNode(w,{ref_key:"printerDialog",ref:u,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,[S.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(D,{multiple:"",modelValue:E.value,"onUpdate:modelValue":n[2]||(n[2]=e=>E.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:Y},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(D,{disabled:0===E.value.length,modelValue:V.value,"onUpdate:modelValue":n[3]||(n[3]=e=>V.value=e),localdata:N.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:J,style:{width:"35%"}},"关闭"),e.createElementVNode("button",{onClick:Q,"hover-stay-time":500,loading:T.value,disabled:0===E.value.length||T.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),co=u(lo,[["__scopeId","data-v-bb460855"]]),uo=u(e.defineComponent({__name:"instockLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("weighHistory")})),(t,o)=>{const s=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,a)=>(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===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-f1ac4be4"]]);const ho=u({name:"uni-data-select",mixins:[zn.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 a=null;return function(...n){a&&clearTimeout(a),a=setTimeout((()=>{e.apply(this,n)}),t)}},query(){this.mixinDatacomEasyGet()},onMixinDatacomPropsChange(){this.collection&&this.debounceGet()},initDefVal(){let e="";if(!this.valueCom&&0!==this.valueCom||this.isDisabled(this.valueCom)){let t;if(this.collection&&(t=this.getCache()),t||0===t)e=t;else{let t="";this.defItem>0&&this.defItem<=this.mixinDatacomResData.length&&(t=this.mixinDatacomResData[this.defItem-1].value),e=t}(e||0===e)&&this.emit(e)}else e=this.valueCom;const t=this.mixinDatacomResData.find((t=>t.value===e));this.current=t?this.formatItemName(t):""},isDisabled(e){let t=!1;return this.mixinDatacomResData.forEach((a=>{a.value===e&&(t=a.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:a,channel_code:n}=e;if(n=n?`(${n})`:"",this.format){let t="";t=this.format;for(let a in e)t=t.replace(new RegExp(`{${a}}`,"g"),e[a]);return t}return this.collection.indexOf("app-list")>0?`${t}(${a})`:t||`未命名${n}`},getLoadData(){return this.mixinDatacomResData},getCurrentCacheKey(){return this.collection},getCache(e=this.getCurrentCacheKey()){return(uni.getStorageSync(this.cacheKey)||{})[e]},setCache(e,t=this.getCurrentCacheKey()){let a=uni.getStorageSync(this.cacheKey)||{};a[t]=e,uni.setStorageSync(this.cacheKey,a)},removeCache(e=this.getCurrentCacheKey()){let t=uni.getStorageSync(this.cacheKey)||{};delete t[e],uni.setStorageSync(this.cacheKey,t)}}},[["render",function(t,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"uni-stat__select"},[o.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:"uni-label-text hide-on-phone"},e.toDisplayString(o.label+":"),1)):e.createCommentVNode("",!0),e.createElementVNode("view",{class:e.normalizeClass(["uni-stat-box",{"uni-stat__actived":i.current}])},[e.createElementVNode("view",{class:e.normalizeClass(["uni-select",{"uni-select--disabled":o.disabled}])},[e.createElementVNode("view",{class:"uni-select__input-box",onClick:n[1]||(n[1]=(...e)=>r.toggleSelector&&r.toggleSelector(...e))},[i.current?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select__input-text"},e.toDisplayString(r.textShow),1)):(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__input-text uni-select__input-placeholder"},e.toDisplayString(r.typePlaceholder),1)),i.current&&o.clear&&!o.disabled?(e.openBlock(),e.createElementBlock("view",{key:2,onClick:n[0]||(n[0]=e.withModifiers(((...e)=>r.clearVal&&r.clearVal(...e)),["stop"]))},[e.createVNode(l,{type:"clear",color:"#c0c4cc",size:"24"})])):(e.openBlock(),e.createElementBlock("view",{key:3},[e.createVNode(l,{type:i.showSelector?"top":"bottom",size:"14",color:"#999"},null,8,["type"])]))]),i.showSelector?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select--mask",onClick:n[2]||(n[2]=(...e)=>r.toggleSelector&&r.toggleSelector(...e))})):e.createCommentVNode("",!0),i.showSelector?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__selector",style:e.normalizeStyle(r.getOffsetByPlacement)},[e.createElementVNode("view",{class:e.normalizeClass("bottom"==o.placement?"uni-popper__arrow_bottom":"uni-popper__arrow_top")},null,2),e.createElementVNode("scroll-view",{"scroll-y":"true",class:"uni-select__selector-scroll"},[0===i.mixinDatacomResData.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select__selector-empty"},[e.createElementVNode("text",null,e.toDisplayString(o.emptyTips),1)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(i.mixinDatacomResData,((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"uni-select__selector-item",key:a,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"]]),mo=e.defineComponent({__name:"index",setup(n){const i=e.ref(),r=e.ref(),l=e.ref(),u=e.ref(null),d=e.ref(null),h=e.ref(!1),m=e.ref([]),p=e.ref(""),f=e.ref(""),y=e.ref([]),w=e.ref([]),b=e.ref(null),_=e.ref(6),x=e.ref({}),S=e.ref([]),C=e.ref([]),N=e.ref([1]),E=e.ref(0),V=e.ref(!1),T=e.ref(!0),B=e.ref(),D=e.reactive({images:[],orderNum:"",batch_number:"",space_code:"",weight:"",search_pkg:!0,typing:!0,search_order:!0,search_order_choice:1}),I=e.computed((()=>({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]},weight:{rules:[{required:!0,errorMessage:"重量不能为空"},{format:"number",errorMessage:"重量只能输入数字"}]}}))),A=e.computed((()=>{try{const e=w.value.find((e=>e.value===D.space_code));return null==e?void 0:e.text}catch(mt){return t("log","at pages/inbound/index.vue:182",mt),""}}));o((()=>{T.value=!0,h.value=!1,u.value=uni.getStorageSync("token"),d.value=uni.getStorageSync("user"),P(),O(),F()})),s((()=>{T.value=!1,h.value=!1})),c((e=>{0===e.index&&uni.navigateTo({url:"/pages/inbound/instockLog"})}));const P=()=>{uni.request({url:to,method:"POST",header:{batoken:u.value},data:{code:""},success:e=>{1===e.data.code&&(w.value=e.data.data.spaces.map((e=>({text:e.name,value:e.code}))))}})},O=()=>{uni.request({url:ao,method:"GET",header:{batoken:u.value},success:e=>{1===e.data.code&&(y.value=e.data.data.batch_number.map((e=>({text:e.name,value:e.id}))))},fail(e){t("log","at pages/inbound/index.vue:248","fail--",e)}})},F=()=>{uni.request({url:no,method:"GET",header:{batoken:u.value},success:e=>{1===e.data.code&&(x.value=e.data.data.printers,C.value=Object.values(x.value).map((e=>({text:e.name,value:e.value}))))},fail(e){t("log","at pages/inbound/index.vue:272","fail--",e)}})},R=()=>{h.value=!1,T.value=!1,m.value=[],D.orderNum="",D.batch_number="",D.weight="",D.search_pkg=!0,D.typing=!0,D.search_order=!0,e.nextTick((()=>{T.value=!0}))},$=async()=>{1===await U()&&uni.scanCode({success:e=>{B.value=e.result,D.orderNum=e.result},fail:e=>{}})},U=async()=>{let e=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e};let z;const q=()=>{const e=Y();t("log","at pages/inbound/index.vue:339","images--",e);let a=!0;for(var n=0;n<e.length;n++)e[n].savePath||(a=!1);if(!a)return p.value="error",f.value="图片还没上传完毕,请稍后...",i.value.open(),void(h.value=!1);uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.ScanOrder/instock",method:"POST",header:{batoken:u.value},data:{order_no:D.orderNum,space_code:D.space_code,images:e},success:e=>{if(h.value=!1,1==e.data.code){p.value="success",f.value=e.data.msg,i.value.open(),t("log","at pages/inbound/index.vue:370","res.data.data---",e.data.data);const a={orderNum:D.orderNum,createTime:new Date,space:A.value,type:"入库",status:!0};S.value.unshift(a),uni.setStorageSync("inboundHistory",S.value),G(),e.data.data.express_label?(t("log","at pages/inbound/index.vue:384","有打印面单"),E.value=N.value.length>0?C.value[0].value:0,l.value.open()):z=setTimeout((()=>{R(),z&&clearTimeout(z)}),1e3)}else{p.value="error",f.value=e.data.msg,i.value.open();const t={orderNum:D.orderNum,createTime:new Date,space:A.value,type:"入库",status:!1};S.value.unshift(t),uni.setStorageSync("inboundHistory",S.value),G(),z=setTimeout((()=>{R(),z&&clearTimeout(z)}),1e3)}}})},H=()=>{l.value.close(),z=setTimeout((()=>{R(),z&&clearTimeout(z)}),700)},W=e=>{!e.detail.value.length>0?E.value=0:E.value=C.value[0].value},J=()=>{V.value=!0,uni.request({url:oo,method:"POST",header:{batoken:u.value},data:{order_no:D.orderNum,printer_code:E},success:e=>{H(),V.value=!1,t("log","at pages/inbound/index.vue:446","打印成功",e),p.value="success",f.value="打印成功",i.value.open()}})},K=()=>{r.value.validate().then((e=>{(async()=>{z&&clearTimeout(z),q()})()})).catch((e=>{t("log","at pages/inbound/index.vue:460","err",e)}))},G=()=>{S.value=uni.getStorageSync("inboundHistory")},Y=()=>{const e=m.value.map((e=>({name:e.name,savePath:e.serverUrl,fileSize:e.size,mimeType:e.type})));return t("log","at pages/inbound/index.vue:475","res22 ",e),e},Q=(e,a)=>{const n={policy:e.policy,signature:e.signature,ossaccessKeyId:e.ossAccessKeyId,key:e.dir+Qn().format("YYYYMMDD")+"/"+ro()+"_"+a.name,dir:e.dir,host:e.host,file:a.file};return new Promise(((o,s)=>{let i=a.name;i="file";uni.uploadFile({url:e.host,filePath:a.path,name:"file",formData:n,success:e=>{204===e.statusCode||200===e.statusCode?(a.serverUrl=n.key,o(e)):s(e)},fail:e=>{t("log","at pages/inbound/index.vue:544","error++",e),s(e)},complete:()=>{t("log","at pages/inbound/index.vue:549","complete---"),a.progress=100}}).onProgressUpdate((e=>{a.progress=e.progress}))}))},Z=()=>{uni.chooseImage({count:_.value-m.value.length,success:a=>{m.value=m.value.concat(a.tempFiles.map((e=>{const t={size:e.size,path:e.path,name:e.name,type:e.type,progress:0,file:e},a=e.path.substring(e.path.lastIndexOf(".")+1),n=e.path.substring(e.path.lastIndexOf("/")+1);return t.name=n,t.type=a,t})));const n=m.value.filter((e=>0===e.progress));e.nextTick((()=>{var e;e=n,uni.request({url:so,method:"GET",header:{batoken:u.value},success:({data:a})=>{const n=a.data.signature,o=e.map((e=>Q(n,e)));Promise.all(o).then((e=>{t("log","at pages/inbound/index.vue:496","所有图片加载成功:",e),uni.showToast({title:"加载成功",icon:"success"})})).catch((e=>{t("error","at pages/inbound/index.vue:503","加载失败:",e),uni.showToast({title:"加载失败",icon:"none"})}))},fail:e=>{t("log","at pages/inbound/index.vue:511",e)}})}))},fail:e=>{t("error","at pages/inbound/index.vue:594",e)}})},X=()=>{b.value=null};return(t,n)=>{const o=a(e.resolveDynamicComponent("uni-easyinput"),v),s=a(e.resolveDynamicComponent("uni-forms-item"),k),c=a(e.resolveDynamicComponent("uni-data-select"),ho),u=a(e.resolveDynamicComponent("uni-icons"),g),d=a(e.resolveDynamicComponent("uni-forms"),L),y=a(e.resolveDynamicComponent("uni-popup-message"),M),B=a(e.resolveDynamicComponent("uni-popup"),j),A=a(e.resolveDynamicComponent("uni-data-checkbox"),Kn);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"example"},[e.createVNode(d,{ref_key:"valiForm",ref:r,"label-align":"right",rules:I.value,modelValue:D},{default:e.withCtx((()=>[e.createVNode(s,{label:"单号",required:!0,name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:D.orderNum,"onUpdate:modelValue":n[0]||(n[0]=e=>D.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:T.value,onIconClick:$},null,8,["modelValue","focus"])])),_:1}),e.createVNode(s,{label:"仓位编码",name:"space_code"},{default:e.withCtx((()=>[e.createVNode(c,{modelValue:D.space_code,"onUpdate:modelValue":n[1]||(n[1]=e=>D.space_code=e),localdata:w.value,placeholder:"请选择仓位编码"},null,8,["modelValue","localdata"])])),_:1}),e.createVNode(s,{label:"图片",name:"images"},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"upload-container"},[e.createElementVNode("view",{class:"preview"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,((t,a)=>(e.openBlock(),e.createElementBlock("view",{key:a,class:"image-container"},[e.createElementVNode("image",{src:t.path,class:"preview-image",mode:"aspectFill",onClick:e=>{return a=t.path,void(b.value=a);var a}},null,8,["src","onClick"]),e.createElementVNode("progress",{percent:t.progress||0,activeColor:100===Number(t.progress||0)?"#00ff00":"#10AEFF","stroke-width":"3"},null,8,["percent","activeColor"]),"success"===t.status?(e.openBlock(),e.createElementBlock("text",{key:0},"1")):e.createCommentVNode("",!0),e.createVNode(u,{class:"delete-icon",onClick:e=>(e=>{m.value.splice(e,1)})(a),type:"clear",size:"20",color:"red"},null,8,["onClick"])])))),128)),m.value.length<_.value?(e.openBlock(),e.createElementBlock("view",{key:0,class:"choose-image-container",onClick:Z},[e.createVNode(u,{type:"plusempty",size:"40",color:"#ccc"})])):e.createCommentVNode("",!0)]),e.createElementVNode("text",{style:{"padding-top":"8px"}},"最多选择6张图片"),b.value?(e.openBlock(),e.createElementBlock("view",{key:0,class:"preview-modal",onClick:X},[e.createElementVNode("image",{src:b.value,class:"preview-large",mode:"aspectFit",onClick:e.withModifiers(X,["stop"])},null,8,["src"])])):e.createCommentVNode("",!0)])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:R},"重置"),e.createElementVNode("button",{type:"primary",onClick:K,loading:h.value},[h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(u,{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(S.value.slice(0,5),((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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(u,{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(B,{ref_key:"message",ref:i,type:"message"},{default:e.withCtx((()=>[e.createVNode(y,{type:p.value,message:f.value,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(B,{ref_key:"printerDialog",ref:l,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,[x.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(A,{multiple:"",modelValue:N.value,"onUpdate:modelValue":n[2]||(n[2]=e=>N.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:W},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(A,{disabled:0===N.value.length,modelValue:E.value,"onUpdate:modelValue":n[3]||(n[3]=e=>E.value=e),localdata:C.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:H,style:{width:"35%"}},"关闭"),e.createElementVNode("button",{onClick:J,"hover-stay-time":500,loading:V.value,disabled:0===N.value.length||V.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),po=u(mo,[["__scopeId","data-v-bb6fe5b6"]]),fo=u(e.defineComponent({__name:"instockLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("inboundHistory")})),(t,o)=>{const s=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,a)=>(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===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-2a21c641"]]),go=e.defineComponent({__name:"index",setup(n){const i=e.ref(),r=e.ref(),l=e.ref(),u=e.ref(null),d=e.ref(null),h=e.ref(!1),m=e.ref(""),p=e.ref(""),f=e.ref([]),y=e.ref({}),w=e.ref([]),b=e.ref([]),_=e.ref([1]),x=e.ref(0),S=e.ref(!1),C=e.ref(!0),N=e.ref(),E=e.reactive({orderNum:"",batch_number:"",weight:"",typing:!0}),V=e.computed((()=>({orderNum:{rules:[{required:!1,errorMessage:"单号不能为空"}]},weight:{rules:[{required:!0,errorMessage:"重量不能为空"},{format:"number",errorMessage:"重量只能输入数字"}]}})));o((()=>{C.value=!0,h.value=!1,u.value=uni.getStorageSync("token"),d.value=uni.getStorageSync("user"),T(),B()})),s((()=>{C.value=!1,h.value=!1})),c((e=>{0===e.index&&uni.navigateTo({url:"/pages/outbound/instockLog"})}));const T=()=>{uni.request({url:ao,method:"GET",header:{batoken:u.value},success:e=>{1===e.data.code&&(f.value=e.data.data.batch_number.map((e=>({text:e.name,value:e.id}))))},fail(e){t("log","at pages/outbound/index.vue:185","fail--",e)}})},B=()=>{uni.request({url:no,method:"GET",header:{batoken:u.value},success:e=>{1===e.data.code&&(y.value=e.data.data.printers,b.value=Object.values(y.value).map((e=>({text:e.name,value:e.value}))))},fail(e){t("log","at pages/outbound/index.vue:209","fail--",e)}})},D=e=>{var t;return null==(t=f.value.find((t=>t.value===e)))?void 0:t.text},I=()=>{h.value=!1,C.value=!1,E.orderNum="",E.batch_number="",E.weight="",E.typing=!0,e.nextTick((()=>{C.value=!0}))},A=async()=>{1===await P()&&uni.scanCode({success:e=>{N.value=e.result,E.orderNum=e.result},fail:e=>{}})},P=async()=>{let e=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e};let O;const F=()=>{if(t("log","at pages/outbound/index.vue:274",E.orderNum,E.batch_number),0===E.orderNum.length&&0===E.batch_number.length)return m.value="error",p.value="单号或批次号至少填一个",void i.value.open();h.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.scanOrder/outStock",method:"POST",header:{batoken:u.value},data:{order_no:E.orderNum,batch_number:E.batch_number},success:e=>{if(h.value=!1,1==e.data.code){m.value="success",p.value=e.data.msg,i.value.open();const a={orderNum:E.orderNum,batch_text:D(E.batch_number),createTime:new Date,type:"出库",status:!0};w.value.unshift(a),w.value.length>10&&(w.value.length=10),uni.setStorageSync("outboundHistory",w.value),q(),e.data.data.labels&&e.data.data.labels.length>0?(t("log","at pages/outbound/index.vue:311","有打印面单"),x.value=_.value.length>0?b.value[0].value:0,l.value.open()):O=setTimeout((()=>{I(),O&&clearTimeout(O)}),700)}else{m.value="error",p.value=e.data.msg,i.value.open();const t={orderNum:E.orderNum,batch_text:D(E.batch_number),createTime:new Date,type:"出库",status:!1};w.value.unshift(t),w.value.length>10&&(w.value.length=10),uni.setStorageSync("outboundHistory",w.value),q(),O=setTimeout((()=>{I(),O&&clearTimeout(O)}),700)}}})},R=()=>{l.value.close(),O=setTimeout((()=>{I(),O&&clearTimeout(O)}),700)},$=e=>{!e.detail.value.length>0?x.value=0:x.value=b.value[0].value},U=()=>{S.value=!0,uni.request({url:oo,method:"POST",header:{batoken:u.value},data:{order_no:E.orderNum,printer_code:x},success:e=>{R(),S.value=!1,t("log","at pages/outbound/index.vue:374","打印成功",e),m.value="success",p.value="打印成功",i.value.open()}})},z=()=>{r.value.validate().then((e=>{(async()=>{O&&clearTimeout(O),F()})()})).catch((e=>{t("log","at pages/outbound/index.vue:388","err",e)}))},q=()=>{w.value=uni.getStorageSync("outboundHistory")};return(t,n)=>{const o=a(e.resolveDynamicComponent("uni-easyinput"),v),s=a(e.resolveDynamicComponent("uni-forms-item"),k),c=a(e.resolveDynamicComponent("uni-data-select"),ho),u=a(e.resolveDynamicComponent("uni-forms"),L),d=a(e.resolveDynamicComponent("uni-icons"),g),N=a(e.resolveDynamicComponent("uni-popup-message"),M),T=a(e.resolveDynamicComponent("uni-popup"),j),B=a(e.resolveDynamicComponent("uni-data-checkbox"),Kn);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"example"},[e.createVNode(u,{ref_key:"valiForm",ref:r,"label-align":"right",rules:V.value,modelValue:E},{default:e.withCtx((()=>[e.createVNode(s,{label:"单号",required:!1,name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:E.orderNum,"onUpdate:modelValue":n[0]||(n[0]=e=>E.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:C.value,onIconClick:A},null,8,["modelValue","focus"])])),_:1}),e.createVNode(s,{label:"批次号",name:"batch_number"},{default:e.withCtx((()=>[e.createVNode(c,{modelValue:E.batch_number,"onUpdate:modelValue":n[1]||(n[1]=e=>E.batch_number=e),localdata:f.value,placeholder:"请选择批次号"},null,8,["modelValue","localdata"])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:I},"重置"),e.createElementVNode("button",{type:"primary",onClick:z,loading:h.value},[h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(d,{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(w.value.slice(0,5),((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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(d,{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(T,{ref_key:"message",ref:i,type:"message"},{default:e.withCtx((()=>[e.createVNode(N,{type:m.value,message:p.value,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(T,{ref_key:"printerDialog",ref:l,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,[y.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(B,{multiple:"",modelValue:_.value,"onUpdate:modelValue":n[2]||(n[2]=e=>_.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:$},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(B,{disabled:0===_.value.length,modelValue:x.value,"onUpdate:modelValue":n[3]||(n[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:R,style:{width:"35%"}},"关闭"),e.createElementVNode("button",{onClick:U,"hover-stay-time":500,loading:S.value,disabled:0===_.value.length||S.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),yo=u(go,[["__scopeId","data-v-9036600a"]]),vo=u(e.defineComponent({__name:"instockLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("outboundHistory")})),(t,o)=>{const s=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,a)=>(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===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-eab10630"]]);const ko=u({data:()=>({token:e.ref(null),user:e.ref(null)}),onLoad(){},onShow(){this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user")},methods:{avatarClick(){this.token||uni.navigateTo({url:"/pages/login/index"})},logout(){uni.removeStorageSync("token"),uni.removeStorageSync("user"),this.token=uni.getStorageSync("token"),this.user=uni.getStorageSync("user")},dialogToggle(){this.$refs.alertDialog.open()}}},[["render",function(t,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-popup-dialog"),oe),c=a(e.resolveDynamicComponent("uni-popup"),j);return e.openBlock(),e.createElementBlock("view",{class:"content"},[e.createElementVNode("view",{class:"user-v",onClick:n[0]||(n[0]=(...e)=>r.avatarClick&&r.avatarClick(...e))},[i.user.avatar?(e.openBlock(),e.createElementBlock("image",{key:1,class:"user-icon",src:i.user.avatar},null,8,["src"])):(e.openBlock(),e.createElementBlock("image",{key:0,class:"user-icon",src:"/static/user.png"}))]),e.createElementVNode("view",{class:"text-area"},[e.createElementVNode("text",{class:"title"},e.toDisplayString(i.user.username),1)]),e.createElementVNode("view",{class:"login-btn"},[i.token?(e.openBlock(),e.createElementBlock("button",{key:1,type:"default",plain:"true",size:"mini",onClick:n[2]||(n[2]=(...e)=>r.dialogToggle&&r.dialogToggle(...e))},"注销")):(e.openBlock(),e.createElementBlock("button",{key:0,type:"primary",plain:"true",size:"mini",onClick:n[1]||(n[1]=(...e)=>r.avatarClick&&r.avatarClick(...e))},"登录"))]),e.createVNode(c,{ref:"alertDialog",type:"dialog"},{default:e.withCtx((()=>[e.createVNode(l,{type:"info",cancelText:"取消",confirmText:"注销",title:"注销",content:"确定是要注销吗?",onConfirm:r.logout},null,8,["onConfirm"])])),_:1},512)])}]]);const wo=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),a="data:image/png;base64,"+uni.arrayBufferToBase64(t);this.verifyCodeImg=a,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,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-icons"),g),c=a(e.resolveDynamicComponent("uni-easyinput"),v),u=a(e.resolveDynamicComponent("uni-forms"),L),d=a(e.resolveDynamicComponent("uni-popup-message"),M),h=a(e.resolveDynamicComponent("uni-popup"),j);return e.openBlock(),e.createElementBlock("view",{class:"contaier"},[e.createElementVNode("view",{class:"top-bg"},[e.createElementVNode("image",{class:"logo-icon",src:"/static/logo.png"})]),e.createElementVNode("view",{class:"input-box padding-lr"},[e.createVNode(u,{ref:"valiForm",rules:i.rules,modelValue:i.valiFormData},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"cu-form-group margin-top"},[e.createVNode(l,{class:"uni-icon",type:"person",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"账号",modelValue:i.valiFormData.account,"onUpdate:modelValue":n[0]||(n[0]=e=>i.valiFormData.account=e)},null,8,["modelValue"])]),e.createElementVNode("view",{class:"cu-form-group"},[e.createVNode(l,{class:"uni-icon",type:"locked",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"密码",type:"password",modelValue:i.valiFormData.password,"onUpdate:modelValue":n[1]||(n[1]=e=>i.valiFormData.password=e)},null,8,["modelValue"])]),e.createElementVNode("view",{class:"cu-form-group solid-bottom"},[e.createVNode(l,{class:"uni-icon",type:"more-filled",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"验证码",modelValue:i.valiFormData.captcha,"onUpdate:modelValue":n[2]||(n[2]=e=>i.valiFormData.captcha=e)},null,8,["modelValue"]),e.createElementVNode("image",{class:"cu-btn captchaImg",src:i.verifyCodeImg,onClick:n[3]||(n[3]=(...e)=>r.getVerifyCodeImg&&r.getVerifyCodeImg(...e))},null,8,["src"])])])),_:1},8,["rules","modelValue"])]),e.createElementVNode("view",{class:"padding-lr margin-top-xs"},[e.createElementVNode("button",{class:"cu-btn block round bg-login-zl margin-tb-sm lg",onClick:n[4]||(n[4]=e=>r.formSubmit("valiForm"))},"立即登录")]),e.createVNode(h,{ref:"message",type:"message"},{default:e.withCtx((()=>[e.createVNode(d,{type:"error",message:i.messageText,duration:2e3},null,8,["message"])])),_:1},512)])}],["__scopeId","data-v-5016fb04"]]);const bo=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,o,s,i){return e.openBlock(),e.createElementBlock("view",{class:"content"})}]]),_o={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 a=2;a<e.length&&e[a]==t[a];a++);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(mt){this.errorMessage=mt}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(mt){this.errorMessage=mt}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(mt){this.errorMessage=mt}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=zn.database(this.spaceInfo);const a=e.action||this.action;a&&(t=t.action(a));const n=e.collection||this.collection;t=t.collection(n);const o=e.where||this.where;o&&Object.keys(o).length&&(t=t.where(o));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,a=this.parentField;if(a&&e.push(`${a} == null || ${a} == ""`),t.length)for(var n=0;n<t.length-1;n++)e.push(`${a} == '${t[n].value}'`);let o=[];return this.where&&o.push(`(${this.where})`),e.length&&o.push(`(${e.join(" || ")})`),o.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 a=0;a<e.length;a++){const n=e[a].split("as");if(!(n.length<2)&&"value"===n[1].trim()){t=n[0].trim();break}}return t},_updateBindData(e){const{dataList:t,hasNodes:a}=this._filterData(this._treeData,this.selected);let n=!1===this._stepSearh&&!a;return e&&(e.isleaf=n),this.dataList=t,this.selectedIndex=t.length-1,!n&&this.selected.length<t.length&&this.selected.push({value:null,text:"请选择"}),{isleaf:n,hasNodes:a}},_updateSelected(){let e=this.dataList,t=this.selected,a=this.map.text,n=this.map.value;for(let o=0;o<t.length;o++){let s=t[o].value,i=e[o];for(let e=0;e<i.length;e++){let r=i[e];if(r[n]===s){t[o].text=r[a];break}}}},_filterData(e,t){let a=[],n=!0;a.push(e.filter((e=>null===e.parent_value||void 0===e.parent_value||""===e.parent_value)));for(let o=0;o<t.length;o++){let s=t[o].value,i=e.filter((e=>e.parent_value===s));i.length?a.push(i):n=!1}return{dataList:a,hasNodes:n}},_extractTree(e,t,a){let n=this.map.value;for(let o=0;o<e.length;o++){let s=e[o],i={};for(let e in s)"children"!==e&&(i[e]=s[e]);null!=a&&""!==a&&(i.parent_value=a),t.push(i);let r=s.children;r&&this._extractTree(r,t,s[n])}},_extractTreePath(e,t){for(let a=0;a<e.length;a++){let n=e[a],o={};for(let e in n)"children"!==e&&(o[e]=n[e]);t.push(o);let s=n.children;s&&this._extractTreePath(s,t)}},_findNodePath(e,t,a=[]){let n=this.map.text,o=this.map.value;for(let s=0;s<t.length;s++){let i=t[s],r=i.children,l=i[n],c=i[o];if(a.push({value:c,text:l}),c===e)return a;if(r){const t=this._findNodePath(e,r,a);if(t.length)return t}a.pop()}return[]}}};const xo={name:"UniDataPicker",emits:["popupopened","popupclosed","nodeclick","input","change","update:modelValue","inputclick"],mixins:[_o],components:{DataPickerView:u({name:"UniDataPickerView",emits:["nodeclick","change","datachange","update:modelValue"],mixins:[_o],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,a){if(e.disable)return;const n=this.dataList[t][a],o=n[this.map.text],s=n[this.map.value];if(t<this.selected.length-1?(this.selected.splice(t,this.selected.length-t),this.selected.push({text:o,value:s})):t===this.selected.length-1&&this.selected.splice(t,1,{text:o,value:s}),n.isleaf)return void this.onSelectedChange(n,n.isleaf);const{isleaf:i,hasNodes:r}=this._updateBindData();this.isLocalData?this.onSelectedChange(n,!r||i):this.isCloudDataList?this.onSelectedChange(n,!0):this.isCloudDataTree&&(i?this.onSelectedChange(n,n.isleaf):r||this.loadCloudDataNode((e=>{e.length?(this._treeData.push(...e),this._updateBindData(n)):n.isleaf=!0,this.onSelectedChange(n,n.isleaf)})))},updateData(e){this._treeData=e.treeData,this.selected=e.selected,this._treeData.length?this._updateBindData():this.loadData()},onDataChange(){this.$emit("datachange")},onSelectedChange(e,t){t&&this._dispatchEvent(),e&&this.$emit("nodeclick",e)},_dispatchEvent(){this.$emit("change",this.selected.slice(0))}}},[["render",function(t,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-load-more"),Wn);return e.openBlock(),e.createElementBlock("view",{class:"uni-data-pickerview"},[t.isCloudDataList?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("scroll-view",{key:0,class:"selected-area","scroll-x":"true"},[e.createElementVNode("view",{class:"selected-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.selected,((a,n)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["selected-item",{"selected-item-active":n==t.selectedIndex}]),key:n,onClick:e=>r.handleSelect(n)},[e.createElementVNode("text",null,e.toDisplayString(a.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],((a,n)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["item",{"is-disabled":!!a.disable}]),key:n,onClick:e=>r.handleNodeClick(a,t.selectedIndex,n)},[e.createElementVNode("text",{class:"item-text"},e.toDisplayString(a[t.map.text]),1),t.selected.length>t.selectedIndex&&a[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 a=[];for(let s=0;s<t.length;s++){var n=t[s],o=e.find((e=>e.value==n));o&&a.push(o)}a.length&&(this.inputSelected=a)},_filterForArray(e,t){var a=[];for(let s=0;s<t.length;s++){var n=t[s],o=e.find((e=>e.value==n));o&&a.push(o)}return a},_dispatchEvent(e){let t={};if(e.length){for(var a=new Array(e.length),n=0;n<e.length;n++)a[n]=e[n].value;t=e[e.length-1]}else t.value="";this.formItem&&this.formItem.setValue(t.value),this.$emit("input",t.value),this.$emit("update:modelValue",t.value),this.$emit("change",{detail:{value:e}})}}};const So=u(xo,[["render",function(t,n,o,s,i,r){const l=a(e.resolveDynamicComponent("uni-load-more"),Wn),c=a(e.resolveDynamicComponent("uni-icons"),g),u=e.resolveComponent("data-picker-view");return e.openBlock(),e.createElementBlock("view",{class:"uni-data-tree"},[e.createElementVNode("view",{class:"uni-data-tree-input",onClick:n[1]||(n[1]=(...e)=>r.handleInput&&r.handleInput(...e))},[e.renderSlot(t.$slots,"default",{options:o.options,data:i.inputSelected,error:t.errorMessage},(()=>[e.createElementVNode("view",{class:e.normalizeClass(["input-value",{"input-value-border":o.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,a)=>(e.openBlock(),e.createElementBlock("view",{class:"selected-item",key:a},[e.createElementVNode("text",{class:"text-color"},e.toDisplayString(t.text),1),a<i.inputSelected.length-1?(e.openBlock(),e.createElementBlock("text",{key:0,class:"input-split-line"},e.toDisplayString(o.split),1)):e.createCommentVNode("",!0)])))),128))])])):(e.openBlock(),e.createElementBlock("text",{key:3,class:"selected-area placeholder"},e.toDisplayString(o.placeholder),1)),o.clearIcon&&!o.readonly&&i.inputSelected.length?(e.openBlock(),e.createElementBlock("view",{key:4,class:"icon-clear",onClick:n[0]||(n[0]=e.withModifiers(((...e)=>r.clear&&r.clear(...e)),["stop"]))},[e.createVNode(c,{type:"clear",color:"#c0c4cc",size:"24"})])):e.createCommentVNode("",!0),o.clearIcon&&i.inputSelected.length||o.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("view",{key:5,class:"arrow-area"},[e.createElementVNode("view",{class:"input-arrow"})]))],2)]),!0)]),i.isOpened?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-data-tree-cover",onClick:n[2]||(n[2]=(...e)=>r.handleClose&&r.handleClose(...e))})):e.createCommentVNode("",!0),i.isOpened?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-data-tree-dialog"},[e.createElementVNode("view",{class:"uni-popper__arrow"}),e.createElementVNode("view",{class:"dialog-caption"},[e.createElementVNode("view",{class:"title-area"},[e.createElementVNode("text",{class:"dialog-title"},e.toDisplayString(o.popupTitle),1)]),e.createElementVNode("view",{class:"dialog-close",onClick:n[3]||(n[3]=(...e)=>r.handleClose&&r.handleClose(...e))},[e.createElementVNode("view",{class:"dialog-close-plus","data-id":"close"}),e.createElementVNode("view",{class:"dialog-close-plus dialog-close-rotate","data-id":"close"})])]),e.createVNode(u,{class:"picker-view",ref:"pickerView",modelValue:t.dataValue,"onUpdate:modelValue":n[4]||(n[4]=e=>t.dataValue=e),localdata:t.localdata,preload:t.preload,collection:t.collection,field:t.field,orderby:t.orderby,where:t.where,"step-searh":t.stepSearh,"self-field":t.selfField,"parent-field":t.parentField,"managed-mode":!0,map:t.map,ellipsis:o.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"]]),Co=e.defineComponent({__name:"index",setup(n){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref(!1),f=e.ref(!1),y=e.ref([]),w=e.ref(),b=e.ref(),_=e.ref();let x;const S=e.ref({orderNum:"",weight:"",batchNum:"",palletNum:""}),C=e.reactive({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]}}),N=e.reactive({batch:[],pallet:[]}),E=()=>{},V=()=>{},T=()=>{},B=()=>{},D=async()=>{1===await(async()=>{let e=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{S.value.orderNum=e.result},fail:e=>{}})},I=()=>{d.value=!1,S.value.orderNum="",S.value.weight=""},A=()=>{S.value.batchNum?p.value=!0:(b.value="error",_.value="请选择批次号",w.value.open())},P=e.computed((()=>{const e=N.batch.find((e=>e.value===S.value.batchNum));return null==e?void 0:e.text})),O=()=>{S.value.palletNum?f.value=!0:(b.value="error",_.value="请选择托盘号",w.value.open())},F=e.computed((()=>{const e=function e(t,a){for(let n of t){if(n.value===a)return n.text;if(n.children&&n.children.length>0){const t=e(n.children,a);if(t)return`${n.text}/${t}`}}return null}(N.pallet,S.value.palletNum);return e})),R=()=>{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:S.value.orderNum,batch_number:S.value.batchNum,pallet_number:S.value.palletNum?$(N.pallet,S.value.palletNum):""},success:e=>{d.value=!1,1==e.data.code?(b.value="success",_.value=e.data.msg,w.value.open(),uni.setStorageSync("waybills",e.data.data.waybills),uni.navigateTo({url:"/pages/scanLotno/waybillsList"})):(b.value="error",_.value=e.data.msg,w.value.open())}})},$=(e,t)=>{for(let a=0;a<e.length;a++){const n=e[a];if(n.id===t||n.value===t)return[n.id];if(n.children&&n.children.length>0){const e=$(n.children,t);if(null!==e)return e}}return null},U=()=>{x&&clearTimeout(x),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:S.value.orderNum,reweighting:S.value.weight,batch_number:S.value.batchNum,pallet_number:S.value.palletNum?$(N.pallet,S.value.palletNum):""},success:e=>{if(d.value=!1,1==e.data.code){b.value="success",_.value=e.data.msg,w.value.open(),e.data.data.labels&&e.data.data.labels.length>0&&t("log","at pages/scanLotno/index.vue:278","有打印面单");const a={orderNum:S.value.orderNum,createTime:new Date,type:S.value.batchNum?"绑定批次":"绑定托盘",status:!0};t("log","at pages/scanLotno/index.vue:290","lotnoLogHistory--",y),y.value.unshift(a),uni.setStorageSync("lotnoLogHistory",y.value),z()}else{b.value="error",_.value=e.data.msg,w.value.open();const t={orderNum:S.value.orderNum,createTime:new Date,type:S.value.batchNum?"绑定批次":"绑定托盘",status:!1};y.value.unshift(t),uni.setStorageSync("lotnoLogHistory",y.value),z()}x=setTimeout((()=>{I(),H(),x&&clearTimeout(x)}),1e3)}})},z=()=>{y.value=uni.getStorageSync("lotnoLogHistory")||[]},q=e=>{t("log","at pages/scanLotno/index.vue:321",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&U()};i((()=>{plus.key.addEventListener("keyup",q)})),r((()=>{plus.key.removeEventListener("keyup",q)})),s((()=>{h.value=!0,plus.key.removeEventListener("keyup",q)})),l((()=>{plus.key.removeEventListener("keyup",q)})),o((()=>{h.value=!1,u.value=uni.getStorageSync("token"),W(),z()}));const H=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},W=()=>{uni.request({url:ao,method:"GET",header:{batoken:u.value},success:e=>{if(1===e.data.code){let t=function(e){return e.map((e=>{const{id:a,value:n,label:o,...s}=e;return{id:a||n,value:n,text:o,...s,children:e.children?t(e.children):[]}}))};N.batch=e.data.data.batch_number.map((e=>({text:e.name,value:e.id})));const a=t(e.data.data.shipping);N.pallet=a}},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,n)=>{const o=a(e.resolveDynamicComponent("uni-easyinput"),v),s=a(e.resolveDynamicComponent("uni-forms-item"),k),i=a(e.resolveDynamicComponent("uni-data-select"),ho),r=a(e.resolveDynamicComponent("uni-data-picker"),So),l=a(e.resolveDynamicComponent("uni-forms"),L),c=a(e.resolveDynamicComponent("uni-icons"),g),u=a(e.resolveDynamicComponent("uni-popup-message"),M),h=a(e.resolveDynamicComponent("uni-popup"),j);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(l,{ref:"valiForm","label-align":"right","label-width":80,rules:C,modelValue:S.value},{default:e.withCtx((()=>[e.createVNode(s,{label:"运单号码",required:"",name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:S.value.orderNum,"onUpdate:modelValue":n[0]||(n[0]=e=>S.value.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:m.value,onIconClick:D},null,8,["modelValue","focus"])])),_:1}),e.createVNode(s,{label:"复称重量",name:"weight"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:S.value.weight,"onUpdate:modelValue":n[1]||(n[1]=e=>S.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:S.value.batchNum,"onUpdate:modelValue":n[2]||(n[2]=e=>S.value.batchNum=e),placeholder:"请选择批次号",localdata:N.batch,clear:!1},null,8,["modelValue","localdata"])),p.value?(e.openBlock(),e.createBlock(o,{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:n[3]||(n[3]=e=>p.value=!1)},"修改")):e.createCommentVNode("",!0)])),_:1}),e.createVNode(s,{label:"绑定托盘号",name:"palletNum",class:"select-item"},{default:e.withCtx((()=>[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r,{key:0,placeholder:"请选择托盘号","popup-title":"绑定托盘号",localdata:N.pallet,modelValue:S.value.palletNum,"onUpdate:modelValue":n[4]||(n[4]=e=>S.value.palletNum=e),onChange:B,onNodeclick:E,onPopupopened:V,onPopupclosed:T},null,8,["localdata","modelValue"])),f.value?(e.openBlock(),e.createBlock(o,{key:1,value:F.value,disabled:f.value},null,8,["value","disabled"])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"primary",onClick:O},"确认")),f.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"primary",onClick:n[5]||(n[5]=e=>f.value=!1)},"修改")):e.createCommentVNode("",!0)])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:I},"重置"),e.createElementVNode("button",{type:"default",onClick:R,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:U,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,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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:w,type:"message"},{default:e.withCtx((()=>[e.createVNode(u,{type:b.value,message:_.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),No=u(e.defineComponent({__name:"lotnoLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("lotnoLogHistory")})),(t,o)=>{const s=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-cdf76154"]]);const Eo=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,a,n,o,s,i){return e.openBlock(),e.createElementBlock("view",{class:"uni-section"},[e.createElementVNode("view",{class:"uni-section-header",onClick:a[0]||(a[0]=(...e)=>i.onClick&&i.onClick(...e))},[n.type?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass(["uni-section-header__decoration",n.type])},null,2)):e.renderSlot(t.$slots,"decoration",{key:1},void 0,!0),e.createElementVNode("view",{class:"uni-section-header__content"},[e.createElementVNode("text",{style:e.normalizeStyle({"font-size":n.titleFontSize,color:n.titleColor}),class:e.normalizeClass(["uni-section__content-title",{distraction:!n.subTitle}])},e.toDisplayString(n.title),7),n.subTitle?(e.openBlock(),e.createElementBlock("text",{key:0,style:e.normalizeStyle({"font-size":n.subTitleFontSize,color:n.subTitleColor}),class:"uni-section-header__content-sub"},e.toDisplayString(n.subTitle),5)):e.createCommentVNode("",!0)]),e.createElementVNode("view",{class:"uni-section-header__slot-right"},[e.renderSlot(t.$slots,"right",{},void 0,!0)])]),e.createElementVNode("view",{class:"uni-section-content",style:e.normalizeStyle({padding:i._padding})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4)])}],["__scopeId","data-v-0a8818d5"]]),Vo=u(e.defineComponent({__name:"waybillsList",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("waybills")})),(t,o)=>{const s=a(e.resolveDynamicComponent("uni-section"),Eo);return e.openBlock(),e.createElementBlock("view",{class:"history"},[e.createVNode(s,{title:"数量: "+n.value.length},null,8,["title"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[e.createElementVNode("text",{class:"code",style:{color:"#666"}},e.toDisplayString(t.order_box_no),1),e.createElementVNode("text",{class:"type"},"重量: "+e.toDisplayString(t.weight)+"KG",1),e.createElementVNode("view",{class:"sub-items"},[e.createElementVNode("view",{class:"sub-item"},[e.createElementVNode("text",{class:"type"},"批次/船航/托盘"),e.createElementVNode("text",{class:"type"},e.toDisplayString(t.batch_shipping_pallet),1)]),e.createElementVNode("view",{class:"sub-item"},[e.createElementVNode("text",{class:"type"},"末公里运单号"),e.createElementVNode("text",{class:"type"},e.toDisplayString(t.tracking_number||"无"),1)])])])))),128)),0===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无运单")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-2aaa63ed"]]),To=e.defineComponent({__name:"index",setup(n){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref([]),f=e.ref(),y=e.ref(),w=e.ref();let b;const _=e.ref({order_code:""}),x=e.reactive({order_code:{rules:[{required:!0,errorMessage:"单据编号不能为空"}]}}),S=async()=>{1===await(async()=>{let e=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{_.value.order_code=e.result,E()},fail:e=>{}})},C=()=>{d.value=!1,_.value.order_code=""},N=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},E=()=>{b&&clearTimeout(b),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:_.value.order_code},success:e=>{if(d.value=!1,1==e.data.code){y.value="success",w.value=e.data.msg,f.value.open();const t={order_code:_.value.order_code,createTime:new Date,type:"单据扫描",status:!0};p.value.unshift(t),uni.setStorageSync("warehouseLogHistory",p.value),V()}else{y.value="error",w.value=e.data.msg,f.value.open();const t={order_code:_.value.order_code,createTime:new Date,type:"单据扫描",status:!1};p.value.unshift(t),uni.setStorageSync("warehouseLogHistory",p.value),V()}b=setTimeout((()=>{C(),b&&clearTimeout(b)}),1e3)}})},V=()=>{p.value=uni.getStorageSync("warehouseLogHistory")||[]},T=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",T)})),r((()=>{plus.key.removeEventListener("keyup",T)})),s((()=>{h.value=!0,plus.key.removeEventListener("keyup",T)})),l((()=>{plus.key.removeEventListener("keyup",T)})),o((()=>{u.value=uni.getStorageSync("token"),h.value=!1,V()})),c((e=>{0===e.index&&uni.navigateTo({url:"/pages/warehouseScan/warehouseLog"})})),(t,n)=>{const o=a(e.resolveDynamicComponent("uni-easyinput"),v),s=a(e.resolveDynamicComponent("uni-forms-item"),k),i=a(e.resolveDynamicComponent("uni-forms"),L),r=a(e.resolveDynamicComponent("uni-icons"),g),l=a(e.resolveDynamicComponent("uni-popup-message"),M),c=a(e.resolveDynamicComponent("uni-popup"),j);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(i,{ref:"valiForm","label-align":"right","label-width":80,rules:x,modelValue:_.value},{default:e.withCtx((()=>[e.createVNode(s,{label:"单据编号",required:"",name:"order_code"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:_.value.order_code,"onUpdate:modelValue":n[0]||(n[0]=e=>_.value.order_code=e),placeholder:"请输入单据编号",suffixIcon:"scan",focus:m.value,onIconClick:S,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,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[e.createElementVNode("text",{class:"code",style:e.normalizeStyle({color:t.status?"green":"#666"})},e.toDisplayString(t.order_code),5),t.status?(e.openBlock(),e.createBlock(r,{key:0,type:"checkmarkempty",class:"status",size:"16",color:"green"})):(e.openBlock(),e.createElementBlock("text",{key:1,class:"status fail"},"F")),e.createElementVNode("text",{style:{"margin-left":"10rpx","font-weight":"300"}},e.toDisplayString("\r\n"+t.createTime),1)])))),128))]),e.createVNode(c,{ref_key:"messageRef",ref:f,type:"message"},{default:e.withCtx((()=>[e.createVNode(l,{type:y.value,message:w.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),Bo=u(To,[["__scopeId","data-v-de7cb1d5"]]),Do=u(e.defineComponent({__name:"warehouseLog",setup(t){const n=e.ref([]);return i((()=>{n.value=uni.getStorageSync("warehouseLogHistory")})),(t,o)=>{const s=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-14053095"]]),Io=e.defineComponent({__name:"index",setup(n){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!1),p=e.ref(!0),f=e.ref([]),y=e.ref(),k=e.ref(),w=e.ref();let b;const _=e.ref({code:"",space_id:""}),x=e.reactive({code:{rules:[{required:!0,errorMessage:"单号不能为空"}]}}),S=e.reactive({space:[]}),C=async()=>{1===await(async()=>{let e=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{_.value.code=e.result},fail:e=>{}})},N=()=>{h.value=!1,_.value.code=""},E=()=>{_.value.space_id?(d.value=!0,A()):(k.value="error",w.value="请选择库位",y.value.open())},V=e.computed((()=>{const e=S.space.find((e=>e.value===_.value.space_id));return null==e?void 0:e.text})),T=()=>{_.value.space_id&&_.value.code?(b&&clearTimeout(b),h.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/warehouse.waybillNo/add",method:"POST",header:{batoken:u.value},data:{code:_.value.code,space_id:_.value.space_id},success:e=>{h.value=!1;const t=S.space.find((e=>e.value===_.value.space_id));if(1==e.data.code){k.value="success",w.value=e.data.msg,y.value.open();const a={code:_.value.code,createTime:new Date,type:"运单号",space:t.text,status:!0};f.value.unshift(a),uni.setStorageSync("waybillNoHistory",f.value),B()}else{k.value="error",w.value=e.data.msg,y.value.open();const a={code:_.value.code,createTime:new Date,type:"运单号",space:t.text,status:!1};f.value.unshift(a),uni.setStorageSync("waybillNoHistory",f.value),B()}b=setTimeout((()=>{N(),A(),b&&clearTimeout(b)}),1e3)}})):(_.value.space_id||(k.value="error",w.value="请选择库位",y.value.open()),_.value.code||(k.value="error",w.value="请填写运单号",y.value.open()))},B=()=>{f.value=uni.getStorageSync("waybillNoHistory")||[]},D=e=>{t("log","at pages/waybillNo/index.vue:240",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&T()};i((()=>{plus.key.addEventListener("keyup",D)})),r((()=>{plus.key.removeEventListener("keyup",D)})),s((()=>{m.value=!0,plus.key.removeEventListener("keyup",D)})),l((()=>{plus.key.removeEventListener("keyup",D)})),o((()=>{m.value=!1,u.value=uni.getStorageSync("token"),I(),B()}));const I=()=>{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)&&S.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,n)=>{const o=a(e.resolveDynamicComponent("uni-data-select"),ho),s=a(e.resolveDynamicComponent("uni-easyinput"),v),i=a(e.resolveDynamicComponent("uni-forms"),L),r=a(e.resolveDynamicComponent("uni-icons"),g),l=a(e.resolveDynamicComponent("uni-popup-message"),M),c=a(e.resolveDynamicComponent("uni-popup"),j);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(i,{ref:"valiForm","label-align":"right","label-width":80,rules:x,modelValue:_.value},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"space-select"},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(o,{key:0,modelValue:_.value.space_id,"onUpdate:modelValue":n[0]||(n[0]=e=>_.value.space_id=e),placeholder:"请选择库位",localdata:S.space,clear:!1},null,8,["modelValue","localdata"])),d.value?(e.openBlock(),e.createBlock(s,{key:1,value:V.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:n[1]||(n[1]=e=>d.value=!1)},"修改")):e.createCommentVNode("",!0)]),e.createElementVNode("view",null,[e.createVNode(s,{modelValue:_.value.code,"onUpdate:modelValue":n[2]||(n[2]=e=>_.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:T,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"])]),f.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(f.value.slice(0,5),((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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:w.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),Ao=u(e.defineComponent({__name:"waybillNoLog",setup(t){const n=e.ref([]);return i((async()=>{await(async()=>{n.value=await uni.getStorageSync("waybillNoHistory")})()})),(t,o)=>{const s=a(e.resolveDynamicComponent("uni-icons"),g);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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===n.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-bf1fa5d7"]]);const Po=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,a){this[e]=a,this.watchTimer&&clearTimeout(this.watchTimer),this.watchTimer=setTimeout((()=>{this[t]=a,this.$emit("change",a)}),a?50:300)}}},[["render",function(t,a,n,o,s,i){return s.visibleSync?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass([{"uni-drawer--visible":s.showDrawer},"uni-drawer"]),onTouchmove:a[1]||(a[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&&n.mask}]),onClick:a[0]||(a[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"]]),Lo="/static/copy.png",Oo=u(e.defineComponent({__name:"index",setup(n){const o=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(),f=()=>{},g=()=>{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=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{},fail:e=>{}})},w=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()}})},b=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()}})},_=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()}})},x=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()}})},S=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"),o.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/index",method:"GET",header:{batoken:r.value},success:({data:e})=>{o.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=>{o.value=!1}})})),c((e=>{0===e.index&&p.value.open()})),(n,o)=>{const s=a(e.resolveDynamicComponent("uni-easyinput"),v),i=a(e.resolveDynamicComponent("uni-popup-message"),M),r=a(e.resolveDynamicComponent("uni-popup"),j),c=a(e.resolveDynamicComponent("uni-drawer"),Po);return e.openBlock(),e.createElementBlock("view",{class:"list"},[e.createVNode(s,{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[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,((a,n)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:n,onClick:e=>(e=>{uni.setStorageSync("selectItem",e),uni.navigateTo({url:"/pages/waybillDeliveryOrder/orderInfo?id="+e.id})})(a)},[e.createElementVNode("view",{class:"order-no"},[e.createElementVNode("text",null," 派送单号: "+e.toDisplayString(a.order_no),1),e.createElementVNode("image",{onClick:e=>y(a.order_no),class:"icon",src:Lo,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(a.address.first_name+" "+a.address.last_name)+" "+e.toDisplayString("+"+a.address.mobile_code+" "+a.address.mobile),1),e.createElementVNode("image",{onClick:e=>{return t("log","at pages/waybillDeliveryOrder/index.vue:91",n=a.address.mobile_code+" "+a.address.mobile),void uni.makePhoneCall({phoneNumber:n,success:function(){t("log","at pages/waybillDeliveryOrder/index.vue:96","拨打电话成功!")},fail:function(){t("log","at pages/waybillDeliveryOrder/index.vue:99","拨打电话失败!")}});var n},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(a.address.city),1),e.createTextVNode(" "+e.toDisplayString(a.address.zip_code),1)]),e.createElementVNode("image",{onClick:e=>y(a.address.zip_code),class:"icon",src:Lo,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(a.operations,((t,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e=>(async(e,t)=>{"send_out"===t?w({id:e.id}):"delivered"===t?b({id:e.id}):"refuse"===t?_({id:e.id}):"create_track_pod"===t?x({id:e.id}):"edit"===t||"generate_label"===t||"fedex_appointment_pick_up"===t||"print_get_back_label"===t||"fedex_cancel_pick_up"===t&&S({id:e.id})})(a,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:f,type:"info"},"重置"),e.createElementVNode("button",{onClick:g,type:"primary"},"确认")])])])),_:1},512)])}}}),[["__scopeId","data-v-76324b89"]]);const Mo=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,a,n,o,s,i){return e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass([["text"===n.styleType?"segmented-control--text":"segmented-control--button"],"segmented-control"]),style:e.normalizeStyle({borderColor:"text"===n.styleType?"":n.activeColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.values,((t,a)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass([["text"===n.styleType?"":"segmented-control__item--button",0===a&&"button"===n.styleType?"segmented-control__item--button--first":"",a===n.values.length-1&&"button"===n.styleType?"segmented-control__item--button--last":""],"segmented-control__item"]),key:a,style:e.normalizeStyle({backgroundColor:a===s.currentIndex&&"button"===n.styleType?n.activeColor:"button"===n.styleType?n.inActiveColor:"transparent",borderColor:a===s.currentIndex&&"text"===n.styleType||"button"===n.styleType?n.activeColor:n.inActiveColor}),onClick:e=>i._onClick(a)},[e.createElementVNode("view",null,[e.createElementVNode("text",{style:e.normalizeStyle({color:a===s.currentIndex?"text"===n.styleType?n.activeColor:"#fff":"text"===n.styleType?"#000":n.activeColor}),class:e.normalizeClass(["segmented-control__text","text"===n.styleType&&a===s.currentIndex?"segmented-control__item--text":""])},e.toDisplayString(t),7)])],14,["onClick"])))),128))],6)}],["__scopeId","data-v-409bd450"]]);const Fo=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:a,circle:n,mark:o,size:s,isTrue:i}=this;return["uni-tag--"+e,"uni-tag--"+s,i(t)?"uni-tag--disabled":"",i(a)?"uni-tag--"+e+"--inverted":"",i(n)?"uni-tag--circle":"",i(o)?"uni-tag--mark":"",i(a)?"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,a,n,o,s,i){return n.text?(e.openBlock(),e.createElementBlock("text",{key:0,class:e.normalizeClass(["uni-tag",i.classes]),style:e.normalizeStyle(n.customStyle),onClick:a[0]||(a[0]=(...e)=>i.onClick&&i.onClick(...e))},e.toDisplayString(n.text),7)):e.createCommentVNode("",!0)}],["__scopeId","data-v-c3d81dd8"]]);function Ro(e,t=2){for(e+="";e.length<t;)e="0"+e;return e.slice(-t)}const $o={yyyy:e=>Ro(e.year,4),yy:e=>Ro(e.year),MM:e=>Ro(e.month),M:e=>e.month,dd:e=>Ro(e.day),d:e=>e.day,hh:e=>Ro(e.hour),h:e=>e.hour,mm:e=>Ro(e.minute),m:e=>e.minute,ss:e=>Ro(e.second),s:e=>e.second,SSS:e=>Ro(e.millisecond,3),S:e=>e.millisecond};function Uo(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 zo(e,{locale:t="zh",threshold:a=[6e4,36e5],format:n="yyyy/MM/dd hh:mm:ss"}){if("-"===e)return e;if(!e&&0!==e)return"";const o={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=o[t]||o.zh;let i,r,l=Uo(e),c=l.getTime()-Date.now(),u=Math.abs(c);if(u<a[0])return c<0?s.justNow:s.soon;if(u>=a[1])return function(e,t="yyyy/MM/dd hh:mm:ss"){if(!e&&0!==e)return"";const a={year:(e=Uo(e)).getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()},n=/yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/;let o=!0,s=t;for(;o;)o=!1,s=s.replace(n,(function(e){return o=!0,$o[e](a)}));return s}(l,n);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),f=Math.floor(p/24),g=Math.floor(f/30),y=Math.floor(g/12);switch(!0){case y>0:i=y,r=s.year;break;case g>0:i=g,r=s.month;break;case f>0:i=f,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 jo=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,zo(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,a,n,o,s,i){return e.openBlock(),e.createElementBlock("text",null,e.toDisplayString(i.dateShow),1)}]]),qo=e.defineComponent({__name:"orderInfo",setup(n){const o=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=>{o.value!=e.currentIndex&&(o.value=e.currentIndex)};return(n,i)=>{const r=a(e.resolveDynamicComponent("uni-segmented-control"),Mo),f=a(e.resolveDynamicComponent("uni-tag"),Fo),g=a(e.resolveDynamicComponent("uni-dateformat"),jo),y=a(e.resolveDynamicComponent("uni-popup-message"),M),v=a(e.resolveDynamicComponent("uni-popup"),j);return e.openBlock(),e.createElementBlock("view",{class:"info"},[e.createVNode(r,{current:o.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 a=d.value.order_no,void uni.setClipboardData({data:a,success:function(){uni.showToast({title:"复制成功",icon:"success",duration:2e3})},fail:function(){t("log","at pages/waybillDeliveryOrder/orderInfo.vue:149","复制失败")}});var a}),class:"icon",src:Lo,mode:"aspectFill"})]),e.createVNode(f,{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(g,{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(f,{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(f,{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===o.value]]),e.withDirectives(e.createElementVNode("view",null," 选项卡2的内容 ",512),[[e.vShow,1===o.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)])}}}),Ho=u(qo,[["__scopeId","data-v-7d603f2a"]]),Wo=e.defineComponent({__name:"index",setup(n){const u=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref(1),f=e.ref([{text:"打印尾程面单",value:1},{text:"打印客户联(详细)",value:2},{text:"打印客户联(简单)",value:3}]),y=e.ref(),w=e.ref(!1),b=e.ref([]),_=e.ref([]);e.ref([]);const x=e.ref([1]),S=e.ref(0),C=e.ref([]),N=e.ref(),E=e.ref(),V=e.ref();let T;const B=e.ref({order_code:""}),D=e.reactive({order_code:{rules:[{required:!0,errorMessage:"单据编号不能为空"}]}}),I=async()=>{1===await(async()=>{let e=Xn.isIOS?await Xn.requestIOS("camera"):await Xn.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&Xn.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{B.value.order_code=e.result,$()},fail:e=>{}})},A=()=>{d.value=!1,B.value.order_code=""},P=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},O=()=>{y.value.close(),T=setTimeout((()=>{A(),T&&clearTimeout(T)}),700)},F=e=>{0===e.detail.value.length?S.value=0:S.value=_.value[0].value},R=()=>{w.value=!0;const e=1===p.value?oo:"http://dsg.tms.api.aibasil.cn/admin/order.ScanOrder/printCustomerLabel";let a={order_no:B.value.order_code,printer_code:S.value},n="尾程面单打印";2===p.value&&(a.style="detail",n="打印客户联(详细)"),3===p.value&&(a.style="simple",n="打印客户联(简单)"),uni.request({url:e,method:"POST",header:{batoken:u.value},data:a,success:e=>{w.value=!1,t("log","at pages/printer/index.vue:233","打印成功",e),E.value=e.data.code?"success":"error",V.value=e.data.msg,N.value.open();const a={order_code:B.value.order_code,createTime:new Date,type:n,status:e.data.code};C.value.unshift(a),uni.setStorageSync("printLogHistory",C.value),U(),O()},fail:e=>{w.value=!1,t("log","at pages/printer/index.vue:251","打印失败",e),E.value="error",V.value="打印失败",N.value.open();const a={order_code:B.value.order_code,createTime:new Date,type:n,status:!1};C.value.unshift(a),uni.setStorageSync("printLogHistory",C.value),U(),O()}})},$=()=>{B.value.order_code?(d.value=!0,T&&clearTimeout(T),S.value=x.value.length>0?_.value[0].value:0,y.value.open(),d.value=!1):(E.value="error",V.value="请填写运单号",N.value.open())},U=()=>{C.value=uni.getStorageSync("printLogHistory")||[]},z=e=>{t("log","at pages/printer/index.vue:311",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&$()};return i((()=>{plus.key.addEventListener("keyup",z)})),r((()=>{plus.key.removeEventListener("keyup",z)})),s((()=>{h.value=!0,plus.key.removeEventListener("keyup",z)})),l((()=>{plus.key.removeEventListener("keyup",z)})),o((()=>{u.value=uni.getStorageSync("token"),h.value=!1,U(),uni.request({url:no,method:"GET",header:{batoken:u.value},success:e=>{1===e.data.code&&(b.value=e.data.data.printers,_.value=Object.values(b.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,n)=>{const o=a(e.resolveDynamicComponent("uni-data-checkbox"),Kn),s=a(e.resolveDynamicComponent("uni-easyinput"),v),i=a(e.resolveDynamicComponent("uni-forms-item"),k),r=a(e.resolveDynamicComponent("uni-forms"),L),l=a(e.resolveDynamicComponent("uni-icons"),g),c=a(e.resolveDynamicComponent("uni-popup-message"),M),u=a(e.resolveDynamicComponent("uni-popup"),j);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createElementVNode("view",{class:"checkbox"},[e.createVNode(o,{modelValue:p.value,"onUpdate:modelValue":n[0]||(n[0]=e=>p.value=e),localdata:f.value},null,8,["modelValue","localdata"])]),e.createVNode(r,{ref:"valiForm","label-align":"right","label-width":80,rules:D,modelValue:B.value},{default:e.withCtx((()=>[e.createVNode(i,{label:"单据编号",required:"",name:"order_code"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:B.value.order_code,"onUpdate:modelValue":n[1]||(n[1]=e=>B.value.order_code=e),placeholder:"请输入单据编号",suffixIcon:"scan",focus:m.value,onIconClick:I,onBlur:P,onConfirm:$},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:$,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,a)=>(e.openBlock(),e.createElementBlock("view",{class:"item",key:a},[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:V.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,[b.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(o,{multiple:"",modelValue:x.value,"onUpdate:modelValue":n[2]||(n[2]=e=>x.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:F},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(o,{disabled:0===x.value.length,modelValue:S.value,"onUpdate:modelValue":n[3]||(n[3]=e=>S.value=e),localdata:_.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:O,style:{width:"35%"}},"关闭"),e.createElementVNode("button",{onClick:R,"hover-stay-time":500,loading:w.value,disabled:0===x.value.length||w.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),Jo=u(Wo,[["__scopeId","data-v-87149d31"]]);__definePage("pages/home/index",p),__definePage("pages/weigh/index",co),__definePage("pages/weigh/instockLog",uo),__definePage("pages/inbound/index",po),__definePage("pages/inbound/instockLog",fo),__definePage("pages/outbound/index",yo),__definePage("pages/outbound/instockLog",vo),__definePage("pages/profile/index",ko),__definePage("pages/login/index",wo),__definePage("pages/order/index",bo),__definePage("pages/scanLotno/index",Co),__definePage("pages/scanLotno/lotnoLog",No),__definePage("pages/scanLotno/waybillsList",Vo),__definePage("pages/warehouseScan/index",Bo),__definePage("pages/warehouseScan/warehouseLog",Do),__definePage("pages/waybillNo/index",Io),__definePage("pages/waybillNo/waybillNoLog",Ao),__definePage("pages/waybillDeliveryOrder/index",Oo),__definePage("pages/waybillDeliveryOrder/orderInfo",Ho),__definePage("pages/printer/index",Jo);const Ko={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:Go,Vuex:Yo,Pinia:Qo}={app:e.createVueApp(Ko)};uni.Vuex=Yo,uni.Pinia=Qo,Go.provide("__globalStyles",__uniConfig.styles),Go._component.mpType="app",Go._component.render=()=>{},Go.mount("#app")}(Vue);