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){return weex.requireModule(e)}function a(e,t,...a){uni.__log__?uni.__log__(e,t,...a):console[e].apply(console,[...a,t])}function n(e,t){return"string"==typeof e?t:e}const o=t=>(a,n=e.getCurrentInstance())=>{!e.isInSSRComponentSetup&&e.injectHook(t,a,n)},s=o("onShow"),i=o("onHide"),r=o("onLoad"),l=o("onUnload"),c=o("onBackPress"),u=o("onNavigationBarButtonTap"),d=(e,t)=>{const a=e.__vccOpts||e;for(const[n,o]of t)a[n]=o;return a};const h=d({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"]]),m={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 p=d(m,[["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"]]),g=e.defineComponent({__name:"index",setup(t){const o=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/label",src:"/static/print.png",text:"打印"},{url:"/pages/scanLotno/index",src:"/static/link.png",text:"托盘/批次"},{url:"/pages/waybillNo/index",src:"/static/link.png",text:"库位绑定"}]);s((()=>{o.value=uni.getStorageSync("token"),i.value=uni.getStorageSync("user"),a("log","at pages/home/index.vue:67","show---",{token:o.value,user:i.value})}));const l=()=>{};return(t,s)=>{const i=n(e.resolveDynamicComponent("uni-grid-item"),h),c=n(e.resolveDynamicComponent("uni-grid"),p);return e.openBlock(),e.createElementBlock("view",{class:"warp"},[e.createVNode(c,{class:"grid",column:3,"show-border":!1,square:!1,onChange:l},{default:e.withCtx((()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,((t,n)=>(e.openBlock(),e.createBlock(i,{index:n,key:n},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"grid-item-box",onClick:e=>{return a("log","at pages/home/index.vue:70",n=t.url),void(o.value?uni.navigateTo({url:n}):uni.navigateTo({url:"/pages/login/index"}));var n}},[e.createElementVNode("image",{class:"image",src:t.src,mode:"aspectFill"},null,8,["src"]),e.createElementVNode("text",{class:"text"},e.toDisplayString(t.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 y=d({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 v(e){let t="";for(let a in e){t+=`${a}:${e[a]};`}return t}const _=d({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 v({"border-color":(this.inputBorder&&this.msg?"#dd524d":e)||"#e5e5e5","background-color":this.disabled?this.styles.disableColor:this.styles.backgroundColor})},inputStyle(){return v({"padding-right":"password"===this.type||this.clearable||this.prefixIcon?"":"10px","padding-left":this.prefixIcon?"":"10px"})}},watch:{value(e){this.val=e},modelValue(e){this.val=e},focus(e){this.$nextTick((()=>{this.focused=this.focus,this.focusShow=this.focus}))}},created(){this.init(),this.form&&this.formItem&&this.$watch("formItem.errMsg",(e=>{this.localMsg=e}))},mounted(){this.$nextTick((()=>{this.focused=this.focus,this.focusShow=this.focus}))},methods:{init(){this.value||0===this.value?this.val=this.value:this.modelValue||0===this.modelValue||""===this.modelValue?this.val=this.modelValue:this.val=null},onClickIcon(e){this.$emit("iconClick",e)},onEyes(){this.showPassword=!this.showPassword,this.$emit("eyes",this.showPassword)},onInput(e){let t=e.detail.value;this.trim&&("boolean"==typeof this.trim&&this.trim&&(t=this.trimStr(t)),"string"==typeof this.trim&&(t=this.trimStr(t,this.trim))),this.errMsg&&(this.errMsg=""),this.val=t,this.$emit("input",t),this.$emit("update:modelValue",t)},onFocus(){this.$nextTick((()=>{this.focused=!0})),this.$emit("focus",null)},_Focus(e){this.focusShow=!0,this.$emit("focus",e)},onBlur(){this.focused=!1,this.$emit("focus",null)},_Blur(e){if(e.detail.value,this.focusShow=!1,this.$emit("blur",e),!1===this.isEnter&&this.$emit("change",this.val),this.form&&this.formItem){const{validateTrigger:e}=this.form;"blur"===e&&this.formItem.onFieldChange()}},onConfirm(e){this.$emit("confirm",this.val),this.isEnter=!0,this.$emit("change",this.val),this.$nextTick((()=>{this.isEnter=!1}))},onClear(e){this.val="",this.$emit("input",""),this.$emit("update:modelValue",""),this.$emit("clear")},onkeyboardheightchange(e){this.$emit("keyboardheightchange",e)},trimStr:(e,t="both")=>"both"===t?e.trim():"left"===t?e.trimLeft():"right"===t?e.trimRight():"start"===t?e.trimStart():"end"===t?e.trimEnd():"all"===t?e.replace(/\s+/g,""):e}},[["render",function(t,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-icons"),y);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:a[0]||(a[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:a[1]||(a[1]=(...e)=>r.onInput&&r.onInput(...e)),onBlur:a[2]||(a[2]=(...e)=>r._Blur&&r._Blur(...e)),onFocus:a[3]||(a[3]=(...e)=>r._Focus&&r._Focus(...e)),onConfirm:a[4]||(a[4]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:a[5]||(a[5]=(...e)=>r.onkeyboardheightchange&&r.onkeyboardheightchange(...e))},null,42,["name","value","placeholder","placeholderStyle","disabled","maxlength","focus","autoHeight","cursor-spacing"])):(e.openBlock(),e.createElementBlock("input",{key:2,type:"password"===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:a[6]||(a[6]=(...e)=>r._Focus&&r._Focus(...e)),onBlur:a[7]||(a[7]=(...e)=>r._Blur&&r._Blur(...e)),onInput:a[8]||(a[8]=(...e)=>r.onInput&&r.onInput(...e)),onConfirm:a[9]||(a[9]=(...e)=>r.onConfirm&&r.onConfirm(...e)),onKeyboardheightchange:a[10]||(a[10]=(...e)=>r.onkeyboardheightchange&&r.onkeyboardheightchange(...e))},null,44,["type","name","value","password","placeholder","placeholderStyle","disabled","maxlength","focus","confirmType","cursor-spacing"])),"password"===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:a[11]||(a[11]=e=>r.onClickIcon("suffix")),size:"22"},null,8,["type"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[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=d({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 b={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 w={int:"integer",bool:"boolean",double:"number",long:"number",password:"string"};function C(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(b.email)&&e.length<255,url:e=>"string"==typeof e&&!!e.match(b.url),pattern(e,t){try{return new RegExp(e).test(t)}catch(_t){return!1}},method:e=>"function"==typeof e,idcard:e=>"string"==typeof e&&!!e.match(b.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)?C(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:C(e,o||a.enum)},rangeNumber(e,t,a){if(!x.number(t))return C(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?C(e,e.errorMessage||a.number[s?"exclusiveMinimum":"minimum"]):void 0!==o&&l?C(e,e.errorMessage||a.number[i?"exclusiveMaximum":"maximum"]):void 0!==n&&void 0!==o&&(r||l)?C(e,e.errorMessage||a.number.range):null},rangeLength(e,t,a){if(!x.string(t)&&!x.array(t))return C(e,e.errorMessage||a.pattern.mismatch);let n=e.minLength,o=e.maxLength,s=t.length;return void 0!==n&&s<n?C(e,e.errorMessage||a.length.minLength):void 0!==o&&s>o?C(e,e.errorMessage||a.length.maxLength):void 0!==n&&void 0!==o&&(s<n||s>o)?C(e,e.errorMessage||a.length.range):null},pattern:(e,t,a)=>x.pattern(e.pattern,t)?null:C(e,e.errorMessage||a.pattern.mismatch),format(e,t,a){var n=Object.keys(x),o=w[e.format]?w[e.format]:e.format||e.arrayType;return n.indexOf(o)>-1&&!x[o](t)?C(e,e.errorMessage||a.typeError):null},arrayTypeFormat(e,t,a){if(!Array.isArray(t))return C(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 N 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(_t){s=this._getMessage(e,_t.message,o)}return s}_getMessage(e,t,a){return C(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(N.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:C({field:JSON.stringify(n)},N.message.TAG+N.message.defaultInvalid)}]}}N.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 P=(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?L(Number(t))?Number(t):t:null),o&&(t=!!A(t)&&t),t},E=(e,t)=>I(t,e),T=(e,t={})=>{const a=B(e);if("object"==typeof a&&Array.isArray(a)&&a.length>1){return a.reduce(((e,t)=>e+`#${t}`),"_formdata_")}return a[0]||e},V=e=>{let t=e.replace("_formdata_#","");return t=t.split("#").map((e=>L(e)?Number(e):e)),t},D=(e,t,a)=>("object"!=typeof e||B(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 B(e){return Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,"").split(".")}const I=(e,t,a="undefined")=>{let n=B(t).reduce(((e,t)=>(e||{})[t]),e);return n&&void 0===n?a:n},L=e=>!isNaN(Number(e)),A=e=>"boolean"==typeof e;const O=d({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,t,n){if(n)this.$refs[n].setValue(e,t);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 a("error","at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:182","当前 uni-froms 组件缺少 ref 属性");n.setValue(e,t)}}),this.childrens=[],this.inputChildrens=[],this.setRules(this.rules)},methods:{setRules(e){this.formRules=Object.assign({},this.formRules,e),this.validator=new N(e)},setValue(e,t){let a=this.childrens.find((t=>t.name===e));return a?(this.formData[e]=P(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=T(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=T(t.name);-1!==e.indexOf(a)&&(t.errMsg="")}}))},submit(e,t,n){for(let a in this.dataValue){this.childrens.find((e=>e.name===a))&&void 0===this.formData[a]&&(this.formData[a]=this._getValue(a,this.dataValue[a]))}return n||a("warn","at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:289","submit 方法即将废弃,请使用validate方法代替!"),this.checkAll(this.formData,e,t,"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=>T(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=T(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=T(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=V(o);D(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:P,_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:T,_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"]]),M={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 F=d({name:"uniPopupMessage",mixins:[M],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 R{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:{}},U.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 U=["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 R(e,t)}U.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((e=>{R.prototype[e]=function(...t){return this.animation[e](...t),this}}));const z=d({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,t={}){if(this.animation){for(let t in e)try{"object"==typeof e[t]?this.animation[t](...e[t]):this.animation[t](e[t])}catch(_t){a("error","at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148",`方法 ${t} 不存在`)}return this.animation.step(t),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]])}]]),j={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})):a("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 q=d(j,[["render",function(t,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-transition"),z);return i.showPopup?(e.openBlock(),e.createElementBlock("view",{key:0,class:e.normalizeClass(["uni-popup",[i.popupstyle,r.isDesktop?"fixforpc-z-index":""]])},[e.createElementVNode("view",{onTouchstart:a[1]||(a[1]=(...e)=>r.touchstart&&r.touchstart(...e))},[i.maskShow?(e.openBlock(),e.createBlock(l,{key:"1",name:"mask","mode-class":"fade",styles:i.maskClass,duration:i.duration,show:i.showTrans,onClick:r.onTap},null,8,["styles","duration","show","onClick"])):e.createCommentVNode("",!0),e.createVNode(l,{key:"2","mode-class":i.ani,name:"content",styles:i.transClass,duration:i.duration,show:i.showTrans,onClick:r.onTap},{default:e.withCtx((()=>[e.createElementVNode("view",{class:e.normalizeClass(["uni-popup__wrapper",[i.popupstyle]]),style:e.normalizeStyle({backgroundColor:r.bg}),onClick:a[0]||(a[0]=(...e)=>r.clear&&r.clear(...e))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],6)])),_:3},8,["mode-class","styles","duration","show","onClick"])],32)],2)):e.createCommentVNode("",!0)}],["__scopeId","data-v-27baf609"]]),H=["{","}"];const K=/^(?:\d)+/,W=/^(?:\w)+/;const J="zh-Hans",G="zh-Hant",Y="en",Q=Object.prototype.hasOwnProperty,Z=(e,t)=>Q.call(e,t),X=new class{constructor(){this._caches=Object.create(null)}interpolate(e,t,a=H){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=K.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 ee(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?G:(a=e,["-tw","-hk","-mo","-cht"].find((e=>-1!==a.indexOf(e)))?G:J);var a;let n=[Y,"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 te{constructor({locale:e,fallbackLocale:t,messages:a,watcher:n,formater:o}){this.locale=Y,this.fallbackLocale=Y,this.message={},this.messages={},this.watchers=[],t&&(this.fallbackLocale=t),this.formater=o||X,this.messages=a||{},this.setLocale(e||Y),n&&this.watchLocale(n)}setLocale(e){const t=this.locale;this.locale=ee(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=>{Z(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=ee(t,this.messages))&&(n=this.messages[t]):a=t,Z(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 ae(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():Y),"string"!=typeof a&&(a="undefined"!=typeof __uniConfig&&__uniConfig.fallbackLocale||Y);const o=new te({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 ne={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:oe}=ae(ne);const se=d({name:"uniPopupDialog",mixins:[M],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||oe("uni-popup.ok")},closeText(){return this.cancelText||oe("uni-popup.cancel")},placeholderText(){return this.placeholder||oe("uni-popup.placeholder")},titleText(){return this.title||oe("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"]]),ie={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/label",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 re(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 le=re((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)})),ce=le,ue=(re((function(e,t){var a;e.exports=(a=ce,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],g=e[t+4],f=e[t+5],y=e[t+6],v=e[t+7],_=e[t+8],k=e[t+9],b=e[t+10],w=e[t+11],C=e[t+12],x=e[t+13],S=e[t+14],N=e[t+15],P=s[0],E=s[1],T=s[2],V=s[3];P=c(P,E,T,V,i,7,r[0]),V=c(V,P,E,T,l,12,r[1]),T=c(T,V,P,E,m,17,r[2]),E=c(E,T,V,P,p,22,r[3]),P=c(P,E,T,V,g,7,r[4]),V=c(V,P,E,T,f,12,r[5]),T=c(T,V,P,E,y,17,r[6]),E=c(E,T,V,P,v,22,r[7]),P=c(P,E,T,V,_,7,r[8]),V=c(V,P,E,T,k,12,r[9]),T=c(T,V,P,E,b,17,r[10]),E=c(E,T,V,P,w,22,r[11]),P=c(P,E,T,V,C,7,r[12]),V=c(V,P,E,T,x,12,r[13]),T=c(T,V,P,E,S,17,r[14]),P=u(P,E=c(E,T,V,P,N,22,r[15]),T,V,l,5,r[16]),V=u(V,P,E,T,y,9,r[17]),T=u(T,V,P,E,w,14,r[18]),E=u(E,T,V,P,i,20,r[19]),P=u(P,E,T,V,f,5,r[20]),V=u(V,P,E,T,b,9,r[21]),T=u(T,V,P,E,N,14,r[22]),E=u(E,T,V,P,g,20,r[23]),P=u(P,E,T,V,k,5,r[24]),V=u(V,P,E,T,S,9,r[25]),T=u(T,V,P,E,p,14,r[26]),E=u(E,T,V,P,_,20,r[27]),P=u(P,E,T,V,x,5,r[28]),V=u(V,P,E,T,m,9,r[29]),T=u(T,V,P,E,v,14,r[30]),P=d(P,E=u(E,T,V,P,C,20,r[31]),T,V,f,4,r[32]),V=d(V,P,E,T,_,11,r[33]),T=d(T,V,P,E,w,16,r[34]),E=d(E,T,V,P,S,23,r[35]),P=d(P,E,T,V,l,4,r[36]),V=d(V,P,E,T,g,11,r[37]),T=d(T,V,P,E,v,16,r[38]),E=d(E,T,V,P,b,23,r[39]),P=d(P,E,T,V,x,4,r[40]),V=d(V,P,E,T,i,11,r[41]),T=d(T,V,P,E,p,16,r[42]),E=d(E,T,V,P,y,23,r[43]),P=d(P,E,T,V,k,4,r[44]),V=d(V,P,E,T,C,11,r[45]),T=d(T,V,P,E,N,16,r[46]),P=h(P,E=d(E,T,V,P,m,23,r[47]),T,V,i,6,r[48]),V=h(V,P,E,T,v,10,r[49]),T=h(T,V,P,E,S,15,r[50]),E=h(E,T,V,P,f,21,r[51]),P=h(P,E,T,V,C,6,r[52]),V=h(V,P,E,T,p,10,r[53]),T=h(T,V,P,E,b,15,r[54]),E=h(E,T,V,P,l,21,r[55]),P=h(P,E,T,V,_,6,r[56]),V=h(V,P,E,T,N,10,r[57]),T=h(T,V,P,E,y,15,r[58]),E=h(E,T,V,P,x,21,r[59]),P=h(P,E,T,V,g,6,r[60]),V=h(V,P,E,T,w,10,r[61]),T=h(T,V,P,E,m,15,r[62]),E=h(E,T,V,P,k,21,r[63]),s[0]=s[0]+P|0,s[1]=s[1]+E|0,s[2]=s[2]+T|0,s[3]=s[3]+V|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)})),re((function(e,t){var a,n,o;e.exports=(n=(a=ce).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))}})))})),re((function(e,t){e.exports=ce.HmacMD5}))),de=re((function(e,t){e.exports=ce.enc.Utf8})),he=re((function(e,t){var a,n,o;e.exports=(o=(n=a=ce).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 me="uni_id_token",pe="uni_id_token_expired",ge="FUNCTION",fe="OBJECT",ye="CLIENT_DB",ve="pending",_e="rejected";function ke(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function be(e){return"object"===ke(e)}function we(e){return"function"==typeof e}function Ce(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const xe="REJECTED",Se="NOT_PENDING";class Ne{constructor({createPromise:e,retryRule:t=xe}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case xe:return this.status===_e;case Se:return this.status!==ve}}exec(){return this.needRetry?(this.status=ve,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=_e,Promise.reject(e)))),this.promise):this.promise}}function Pe(e){return e&&"string"==typeof e?JSON.parse(e):e}const Ee=Pe([]);Pe("");const Te=Pe("[]")||[];let Ve="";try{Ve="__UNI__EE98A34"}catch(_t){}let De,Be={};function Ie(e,t={}){var a,n;return a=Be,n=e,Object.prototype.hasOwnProperty.call(a,n)||(Be[e]=t),Be[e]}Be=uni._globalUniCloudObj?uni._globalUniCloudObj:uni._globalUniCloudObj={};const Le=["invoke","success","fail","complete"],Ae=Ie("_globalUniCloudInterceptor");function Oe(e,t){Ae[e]||(Ae[e]={}),be(t)&&Object.keys(t).forEach((a=>{Le.indexOf(a)>-1&&function(e,t,a){let n=Ae[e][t];n||(n=Ae[e][t]=[]),-1===n.indexOf(a)&&we(a)&&n.push(a)}(e,a,t[a])}))}function Me(e,t){Ae[e]||(Ae[e]={}),be(t)?Object.keys(t).forEach((a=>{Le.indexOf(a)>-1&&function(e,t,a){const n=Ae[e][t];if(!n)return;const o=n.indexOf(a);o>-1&&n.splice(o,1)}(e,a,t[a])})):delete Ae[e]}function Fe(e,t){return e&&0!==e.length?e.reduce(((e,a)=>e.then((()=>a(t)))),Promise.resolve()):Promise.resolve()}function Re(e,t){return Ae[e]&&Ae[e][t]||[]}function Ue(e){Oe("callObject",e)}const $e=Ie("_globalUniCloudListener"),ze="response",je="needLogin",qe="refreshToken",He="clientdb",Ke="cloudfunction",We="cloudobject";function Je(e){return $e[e]||($e[e]=[]),$e[e]}function Ge(e,t){const a=Je(e);a.includes(t)||a.push(t)}function Ye(e,t){const a=Je(e),n=a.indexOf(t);-1!==n&&a.splice(n,1)}function Qe(e,t){const a=Je(e);for(let n=0;n<a.length;n++)(0,a[n])(t)}let Ze,Xe=!1;function et(){return Ze||(Ze=new Promise((e=>{Xe&&e(),function t(){if("function"==typeof getCurrentPages){const t=getCurrentPages();t&&t[0]&&(Xe=!0,e())}Xe||setTimeout((()=>{t()}),30)}()})),Ze)}function tt(e){const t={};for(const a in e){const n=e[a];we(n)&&(t[a]=Ce(n))}return t}class at 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 nt={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 ot(e){return e&&ot(e.__v_raw)||e}function st(){return{token:nt.getStorageSync(me)||nt.getStorageSync("uniIdToken"),tokenExpired:nt.getStorageSync(pe)}}function it({token:e,tokenExpired:t}={}){e&&nt.setStorageSync(me,e),t&&nt.setStorageSync(pe,t)}let rt,lt;function ct(){return rt||(rt=uni.getSystemInfoSync()),rt}function ut(){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 dt={};function ht(){const e=uni.getLocale&&uni.getLocale()||"en";if(lt)return{...dt,...lt,locale:e,LOCALE:e};const t=ct(),{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 lt={PLATFORM:o,OS:n,APPID:s,DEVICEID:a,...ut(),...t},{...dt,...lt,locale:e,LOCALE:e}}var mt=function(e,t){let a="";return Object.keys(e).sort().forEach((function(t){e[t]&&(a=a+"&"+t+"="+e[t])})),a=a.slice(1),ue(a,t).toString()},pt=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 at({code:a,message:o,requestId:t}))}const o=e.data;if(o.error)return n(new at({code:o.error.code,message:o.error.message,requestId:t}));o.result=o.data,o.requestId=t,delete o.data,a(o)}}))}))},gt=function(e){return he.stringify(de.parse(e))},ft={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=nt,this._getAccessTokenPromiseHub=new Ne({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new at({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:Se})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return pt(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"]=mt(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"]=mt(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 at({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){r(new at({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"!==ke(t))throw new at({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new at({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new at({code:"INVALID_PARAM",message:"cloudPath不合法"});const i=s&&s.envType||this.config.envType;if(n&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new at({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:g,ossCallbackUrl:f}=r,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:u,Signature:d,host:h,id:p,key:m,policy:g,success_action_status:200};if(c&&(y["x-oss-security-token"]=c),f){const e=JSON.stringify({callbackUrl:f,callbackBody:JSON.stringify({fileId:p,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=gt(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})),f)return{success:!0,filePath:e,fileID:l};if((await this.reportOSSUpload({id:p})).success)return{success:!0,filePath:e,fileID:l};throw new at({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,a)=>{Array.isArray(e)&&0!==e.length||a(new at({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 at({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 yt="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var vt,_t;(_t=vt||(vt={})).local="local",_t.none="none",_t.session="session";var kt=function(){},bt=re((function(e,t){var a;e.exports=(a=ce,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],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,f=c[m-2],y=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[m]=g+c[m-7]+y+c[m-16]}var v=n&o^n&s^o&s,_=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),k=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+k|0,i=s,s=o,o=n,n=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)})),wt=bt,Ct=re((function(e,t){e.exports=ce.HmacSHA256}));const xt=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new at({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 St(e){return void 0===e}function Nt(e){return"[object Null]"===Object.prototype.toString.call(e)}function Pt(e=""){return e.replace(/([\s\S]+)\s+(请前往云开发AI小助手查看问题:.*)/,"$1")}function Et(e=32){let t="";for(let a=0;a<e;a++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}var Tt;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(Tt||(Tt={}));const Vt={adapter:null,runtime:void 0},Dt=["anonymousUuidKey"];class Bt extends kt{constructor(){super(),Vt.adapter.root.tcbObject||(Vt.adapter.root.tcbObject={})}setItem(e,t){Vt.adapter.root.tcbObject[e]=t}getItem(e){return Vt.adapter.root.tcbObject[e]}removeItem(e){delete Vt.adapter.root.tcbObject[e]}clear(){delete Vt.adapter.root.tcbObject}}function It(e,t){switch(e){case"local":return t.localStorage||new Bt;case"none":return new Bt;default:return t.sessionStorage||new Bt}}class Lt{constructor(e){if(!this._storage){this._persistence=Vt.adapter.primaryStorage||e.persistence,this._storage=It(this._persistence,Vt.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="device_id",r=`token_type_${e.env}`,l=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:a,refreshTokenKey:n,anonymousUuidKey:o,loginTypeKey:s,userInfoKey:l,deviceIdKey:i,tokenTypeKey:r}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const a=It(e,Vt.adapter);for(const n in this.keys){const e=this.keys[n];if(t&&Dt.includes(n))continue;const o=this._storage.getItem(e);St(o)||Nt(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 At={},Ot={};function Mt(e){return At[e]}class Ft{constructor(e,t){this.data=t||null,this.name=e}}class Rt extends Ft{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const Ut=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 Rt)return console.error(e.error),this;const a="string"==typeof e?new Ft(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 $t(e,t){Ut.on(e,t)}function zt(e,t={}){Ut.fire(e,t)}function jt(e,t){Ut.off(e,t)}const qt="loginStateChanged",Ht="loginStateExpire",Kt="loginTypeChanged",Wt="anonymousConverted",Jt="refreshAccessToken";var Gt;!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"}(Gt||(Gt={}));class Yt{constructor(){this._fnPromiseMap=new Map}async run(e,t){let a=this._fnPromiseMap.get(e);return a||(a=new Promise((async(a,n)=>{try{await this._runIdlePromise();const n=t();a(await n)}catch(o){n(o)}finally{this._fnPromiseMap.delete(e)}})),this._fnPromiseMap.set(e,a)),a}_runIdlePromise(){return Promise.resolve()}}class Qt{constructor(e){this._singlePromise=new Yt,this._cache=Mt(e.env),this._baseURL=`https://${e.env}.ap-shanghai.tcb-api.tencentcloudapi.com`,this._reqClass=new Vt.adapter.reqClass({timeout:e.timeout,timeoutMsg:`请求在${e.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]})}_getDeviceId(){if(this._deviceID)return this._deviceID;const{deviceIdKey:e}=this._cache.keys;let t=this._cache.getStore(e);return"string"==typeof t&&t.length>=16&&t.length<=48||(t=Et(),this._cache.setStore(e,t)),this._deviceID=t,t}async _request(e,t,a={}){const n={"x-request-id":Et(),"x-device-id":this._getDeviceId()};if(a.withAccessToken){const{tokenTypeKey:e}=this._cache.keys,t=await this.getAccessToken(),a=this._cache.getStore(e);n.authorization=`${a} ${t}`}return this._reqClass["get"===a.method?"get":"post"]({url:`${this._baseURL}${e}`,data:t,headers:n})}async _fetchAccessToken(){const{loginTypeKey:e,accessTokenKey:t,accessTokenExpireKey:a,tokenTypeKey:n}=this._cache.keys,o=this._cache.getStore(e);if(o&&o!==Gt.ANONYMOUS)throw new at({code:"INVALID_OPERATION",message:"非匿名登录不支持刷新 access token"});const s=await this._singlePromise.run("fetchAccessToken",(async()=>(await this._request("/auth/v1/signin/anonymously",{},{method:"post"})).data)),{access_token:i,expires_in:r,token_type:l}=s;return this._cache.setStore(n,l),this._cache.setStore(t,i),this._cache.setStore(a,Date.now()+1e3*r),i}isAccessTokenExpired(e,t){let a=!0;return e&&t&&(a=t<Date.now()),a}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t}=this._cache.keys,a=this._cache.getStore(e),n=this._cache.getStore(t);return this.isAccessTokenExpired(a,n)?this._fetchAccessToken():a}async refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,loginTypeKey:a}=this._cache.keys;return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.setStore(a,Gt.ANONYMOUS),this.getAccessToken()}async getUserInfo(){return this._singlePromise.run("getUserInfo",(async()=>(await this._request("/auth/v1/user/me",{},{withAccessToken:!0,method:"get"})).data))}}const Zt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],Xt={"X-SDK-Version":"1.3.5"};function ea(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 ta(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...Xt,"x-seqid":e}}}class aa{constructor(e={}){var t;this.config=e,this._reqClass=new Vt.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=Mt(this.config.env),this._localCache=(t=this.config.env,Ot[t]),this.oauth=new Qt(this.config),ea(this._reqClass,"post",[ta]),ea(this._reqClass,"upload",[ta]),ea(this._reqClass,"download",[ta])}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 at({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)===Gt.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()}zt(Ht),this._cache.removeStore(a)}throw new at({code:r.data.code,message:`刷新access token失败:${r.data.code}`})}if(r.data.access_token)return zt(Jt),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 at({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};let i;if(-1===Zt.indexOf(e)&&(this._cache.keys,s.access_token=await this.oauth.getAccessToken()),"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}`}(yt,"//tcb-api.tencentcloudapi.com/web",h);d&&(m+=d);const p=await this.post({url:m,data:i,...r}),g=p.header&&p.header["x-tcb-trace"];if(g&&this._localCache.setStore(n,g),200!==Number(p.status)&&200!==Number(p.statusCode)||!p.data)throw new at({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_DISABLED"===n.data.code||"ACCESS_TOKEN_EXPIRED"===n.data.code)&&-1===Zt.indexOf(e)){await this.oauth.refreshAccessToken();const n=await this.request(e,t,{...a,onUploadProgress:t.onUploadProgress});if(n.data.code)throw new at({code:n.data.code,message:Pt(n.data.message)});return n.data}if(n.data.code)throw new at({code:n.data.code,message:Pt(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 na={};function oa(e){return na[e]}class sa{constructor(e){this.config=e,this._cache=Mt(e.env),this._request=oa(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 ia{constructor(e){if(!e)throw new at({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=Mt(this._envId),this._request=oa(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeof e)throw new at({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 at({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 e=await this._request.oauth.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 ra{constructor(e){if(!e)throw new at({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=Mt(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 ia(e)}get isAnonymousAuth(){return this.loginType===Gt.ANONYMOUS}get isCustomAuth(){return this.loginType===Gt.CUSTOM}get isWeixinAuth(){return this.loginType===Gt.WECHAT||this.loginType===Gt.WECHAT_OPEN||this.loginType===Gt.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class la extends sa{async signIn(){this._cache.updatePersistence("local"),await this._request.oauth.getAccessToken(),zt(qt),zt(Kt,{env:this.config.env,loginType:Gt.ANONYMOUS,persistence:"local"});const e=new ra(this.config.env);return await e.user.refresh(),e}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(),zt(Wt,{env:this.config.env}),zt(Kt,{loginType:Gt.CUSTOM,persistence:"local"}),{credential:{refreshToken:s.refresh_token}};throw new at({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:a}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(a,Gt.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class ca extends sa{async signIn(e){if("string"!=typeof e)throw new at({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(),zt(qt),zt(Kt,{env:this.config.env,loginType:Gt.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new ra(this.config.env);throw new at({message:"自定义登录失败"})}}class ua extends sa{async signIn(e,t){if("string"!=typeof e)throw new at({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(),zt(qt),zt(Kt,{env:this.config.env,loginType:Gt.EMAIL,persistence:this.config.persistence}),new ra(this.config.env);throw n.code?new at({code:n.code,message:`邮箱登录失败: ${n.message}`}):new at({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 da extends sa{async signIn(e,t){if("string"!=typeof e)throw new at({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:Gt.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(),zt(qt),zt(Kt,{env:this.config.env,loginType:Gt.USERNAME,persistence:this.config.persistence}),new ra(this.config.env);throw n.code?new at({code:n.code,message:`用户名密码登录失败: ${n.message}`}):new at({message:"用户名密码登录失败"})}}class ha{constructor(e){this.config=e,this._cache=Mt(e.env),this._request=oa(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),$t(Kt,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 la(this.config)}customAuthProvider(){return new ca(this.config)}emailAuthProvider(){return new ua(this.config)}usernameAuthProvider(){return new da(this.config)}async signInAnonymously(){return new la(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new ua(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new da(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new la(this.config)),$t(Wt,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===Gt.ANONYMOUS)throw new at({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),zt(qt),zt(Kt,{env:this.config.env,loginType:Gt.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){$t(qt,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){$t(Ht,e.bind(this))}onAccessTokenRefreshed(e){$t(Jt,e.bind(this))}onAnonymousConverted(e){$t(Wt,e.bind(this))}onLoginTypeChanged(e){$t(Kt,(()=>{const t=this.hasLoginState();e.call(this,t)}))}async getAccessToken(){return{accessToken:(await this._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{accessTokenKey:e,accessTokenExpireKey:t}=this._cache.keys,a=this._cache.getStore(e),n=this._cache.getStore(t);return this._request.oauth.isAccessTokenExpired(a,n)?null:new ra(this.config.env)}async isUsernameRegistered(e){if("string"!=typeof e)throw new at({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 ca(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 ma=function(e,t){t=t||xt();const a=oa(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 at({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},pa=function(e,t){t=t||xt();const a=oa(this.config.env),{cloudPath:n}=e;return a.send("storage.getUploadMetadata",{path:n}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},ga=function({fileList:e},t){if(t=t||xt(),!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 oa(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},fa=function({fileList:e},t){t=t||xt(),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 oa(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},ya=async function({fileID:e},t){const a=(await fa.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==a.code)return t?t(a):new Promise((e=>{e(a)}));const n=oa(this.config.env);let o=a.download_url;if(o=encodeURI(o),!t)return n.download({url:o});t(await n.download({url:o}))},va=function({name:e,data:t,query:a,parse:n,search:o,timeout:s},i){const r=i||xt();let l;try{l=t?JSON.stringify(t):""}catch(u){return Promise.reject(u)}if(!e)return Promise.reject(new at({code:"PARAM_ERROR",message:"函数名不能为空"}));const c={inQuery:a,parse:n,search:o,function_name:e,request_data:l};return oa(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 at({message:"response data must be json"}))}}return r.promise})).catch((e=>{r(e)})),r.promise},_a={timeout:15e3,persistence:"session"},ka=6e5,ba={};class wa{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(Vt.adapter||(this.requestClient=new Vt.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={..._a,...e},!0){case this.config.timeout>ka:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=ka;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new wa(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||Vt.adapter.primaryStorage||_a.persistence;var a;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;At[t]=new Lt(e),Ot[t]=new Lt({...e,persistence:"local"})}(this.config),a=this.config,na[a.env]=new aa(a),this.authObj=new ha(this.config),this.authObj}on(e,t){return $t.apply(this,[e,t])}off(e,t){return jt.apply(this,[e,t])}callFunction(e,t){return va.apply(this,[e,t])}deleteFile(e,t){return ga.apply(this,[e,t])}getTempFileURL(e,t){return fa.apply(this,[e,t])}downloadFile(e,t){return ya.apply(this,[e,t])}uploadFile(e,t){return ma.apply(this,[e,t])}getUploadMetadata(e,t){return pa.apply(this,[e,t])}registerExtension(e){ba[e.name]=e}async invokeExtension(e,t){const a=ba[e];if(!a)throw new at({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&&(Vt.adapter=t),a&&(Vt.runtime=a)}}var Ca=new wa;function xa(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 Sa{get(e){const{url:t,data:a,headers:n,timeout:o}=e;return new Promise(((e,s)=>{nt.request({url:xa("https:",t),data:a,method:"GET",header:n,timeout:o,success(t){e(t)},fail(e){s(e)}})}))}post(e){const{url:t,data:a,headers:n,timeout:o}=e;return new Promise(((e,s)=>{nt.request({url:xa("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=nt.uploadFile({url:xa("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 Na={setItem(e,t){nt.setStorageSync(e,t)},getItem:e=>nt.getStorageSync(e),removeItem(e){nt.removeStorageSync(e)},clear(){nt.clearStorageSync()}};var Pa={genAdapter:function(){return{root:{},reqClass:Sa,localStorage:Na,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};Ca.useAdapters(Pa);const Ea=Ca,Ta=Ea.init;Ea.init=function(e){e.env=e.spaceId;const t=Ta.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}=tt(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 Va=Ea;async function Da(e,t){const a=`http://${e}:${t}/system/ping`;try{const e=await(n={url:a,timeout:500},new Promise(((e,t)=>{nt.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 Ia={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=nt}async request(e,t=!0){return e=this.setupRequest(e),Promise.resolve().then((()=>pt(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 at({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"]=mt(t,this.config.clientSecret);const n=ht();a["x-client-info"]=encodeURIComponent(JSON.stringify(n));const{token:o}=st();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=ht(),{token:a}=st(),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 Da(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 at({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 at({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){o(new at({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 at({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 at({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e,maxAge:t}={}){if(!Array.isArray(e)||0===e.length)throw new at({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 at({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}},La=re((function(e,t){e.exports=ce.enc.Hex}));function Aa(){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 Oa(e="",t={}){const{data:a,functionName:n,method:o,headers:s,signHeaderKeys:i=[],config:r}=t,l=String(Date.now()),c=Aa(),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="HMAC-SHA256",a=e.signedHeaders.join(";"),n=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),o=wt(e.body).toString(La),s=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${n}\n${a}\n${o}\n`,i=wt(s).toString(La),r=`${t}\n${e.timestamp}\n${i}\n`,l=Ct(r,e.secretKey).toString(La);return`${t} Credential=${e.secretId}, SignedHeaders=${a}, Signature=${l}`}({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 Ma({url:e,data:t,method:a="POST",headers:n={},timeout:o}){return new Promise(((s,i)=>{nt.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 at({code:"SYS_ERR",message:a||n||"request:fail",requestId:o||t}))}s({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function Fa(e,t){const{path:a,data:n,method:o="GET"}=e,{url:s,headers:i}=Oa(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 Ma({url:s,data:n,method:o,headers:i}).then((e=>{const t=e.data||{};if(!t.success)throw new at({code:e.errCode,message:e.errMsg,requestId:e.requestId});return t.data||{}})).catch((e=>{throw new at({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}function Ra(e=""){const t=e.trim().replace(/^cloud:\/\//,""),a=t.indexOf("/");if(a<=0)throw new at({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 Ua(e=""){return"cloud://".concat(this.config.spaceId,"/").concat(e.replace(/^\/+/,""))}class $a{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:Aa(),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",wt(s).toString(La)].join("\n"),r=Ct(i,this.config.secretKey).toString(La),l=Object.keys(o).map((e=>`${e}=${encodeURIComponent(o[e])}`)).join("&");return`${this.config.wsEndpoint}${a}?${l}&signature=${r}`}}var za={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 $a(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}=Oa("/functions/invokeFunction",{functionName:a,data:n,method:i,headers:r,signHeaderKeys:["x-to-function-name"],config:t});return Ma({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 at({code:t,message:e.errMsg,requestId:e.requestId});return{errCode:t,success:0===t,requestId:e.requestId,result:e.data}})).catch((e=>{throw new at({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=nt.uploadFile({url:e,filePath:t,fileType:a,formData:n,name:"file",success(e){e&&e.statusCode<400?s(e):i(new at({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){i(new at({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"!==ke(t))throw new at({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new at({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new at({code:"INVALID_PARAM",message:"cloudPath不合法"});const o=await Fa({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)&&t({code:"INVALID_PARAM",message:"fileList不能为空数组"}),e.length>50&&t({code:"INVALID_PARAM",message:"fileList数组长度不能超过50"});const n=[];for(const s of e){let e;"string"!==ke(s)&&t({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});try{e=Ra.call(this,s)}catch(o){console.warn(o.errCode,o.errMsg),e=s}n.push({file_id:e,expire:600})}Fa({path:"/?download_url",data:{file_list:n},method:"POST"},this.config).then((e=>{const{file_list:a=[]}=e;t({fileList:a.map((e=>({fileID:Ua.call(this,e.file_id),tempFileURL:e.download_url})))})})).catch((e=>a(e)))}))}async connectWebSocket(e){const{name:t,query:a}=e;return nt.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 ja({data:e}){let t;t=ht();const a=JSON.parse(JSON.stringify(e||{}));if(Object.assign(a,{clientInfo:t}),!a.uniIdToken){const{token:e}=st();e&&(a.uniIdToken=e)}return a}const qa=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Ha=/[\\^$.*+?()[\]{}|]/g,Ka=RegExp(Ha.source);function Wa(e,t,a){return e.replace(new RegExp((n=t)&&Ka.test(n)?n.replace(Ha,"\\$&"):n,"g"),a);var n}const Ja="request",Ga="response",Ya="both",Qa="_globalUniCloudStatus",Za={code:2e4,message:"System error"},Xa={code:20101,message:"Invalid client"};function en(e){const{errSubject:t,subject:a,errCode:n,errMsg:o,code:s,message:i,cause:r}=e||{};return new at({subject:t||a||"uni-secure-network",code:n||s||Za.code,message:o||i,cause:r})}let tn;function an({secretType:e}={}){return e===Ja||e===Ga||e===Ya}function nn({name:e,data:t={}}={}){return"DCloud-clientDB"===e&&"encryption"===t.redirectTo&&"getAppClientKey"===t.action}function on({functionName:e,result:t,logPvd:a}){}function sn(e){const t=e.callFunction,a=function(a){const n=a.name;a.data=ja.call(e,{data:a.data});const o={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],s=an(a),i=nn(a),r=s||i;return t.call(this,a).then((e=>(e.errCode=0,!r&&on.call(this,{functionName:n,result:e,logPvd:o}),Promise.resolve(e))),(e=>(!r&&on.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=Wa(l,`{$${e}}`,r[e]);for(const e in t)l=Wa(l,`{${e}}`,t[e]);return"replace"===i?l:e+l}return e}({message:`[${a.name}]: ${e.message}`,formatter:qa,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=nn(t)?a.call(e,t):an(t)?new tn({secretType:t.secretType,uniCloudIns:e}).wrapEncryptDataCallFunction(a.bind(e))(t):function({provider:e,spaceId:t,functionName:a}={}){const{appId:n,uniPlatform:o,osName:s}=ct();let i=o;"app"===o&&(i=s);const r=function({provider:e,spaceId:t}={}){const a=Ee;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`),en(Xa)}({provider:n,spaceId:o,functionName:s})?new tn({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)))}}tn=class{constructor(){throw en({message:"Platform app is not enabled, please check whether secure network module is enabled in your manifest.json"})}};const rn=Symbol("CLIENT_DB_INTERNAL");function ln(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=rn,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 cn(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 un=["db.Geo","db.command","command.aggregate"];function dn(e,t){return un.indexOf(`${e}.${t}`)>-1}function hn(e){switch(ke(e=ot(e))){case"array":return e.map((e=>hn(e)));case"object":return e._internalType===rn||Object.keys(e).forEach((t=>{e[t]=hn(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function mn(e){return e&&e.content&&e.content.$method}class pn{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:hn(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=mn(e),a=mn(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"===mn(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=mn(e),a=mn(e.prevStage);if("aggregate"===t&&"command"===a)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return gn({$method:e,$param:hn(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:hn(t)}),this._database._callCloudFunction({action:a,command:n})}}function gn(e,t,a){return ln(new pn(e,t,a),{get(e,t){let n="db";return e&&e.content&&(n=e.content.$method),dn(n,t)?gn({$method:t},e,a):function(){return gn({$method:t,$param:hn(Array.from(arguments))},e,a)}}})}function fn({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 yn(e,t={}){return ln(new e(t),{get:(e,t)=>dn("db",t)?gn({$method:t},null,e):function(){return gn({$method:t,$param:hn(Array.from(arguments))},null,e)}})}class vn extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=Ie("_globalUniCloudDatabaseCallback")),t||(this.auth=cn(this._authCallBacks)),this._isJQL=t,Object.assign(this,cn(this._dbCallBacks)),this.env=ln({},{get:(e,t)=>({$env:t})}),this.Geo=ln({},{get:(e,t)=>fn({path:["Geo"],method:t})}),this.serverDate=fn({path:[],method:"serverDate"}),this.RegExp=fn({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]),Fe(Re(i,"fail"),e).then((()=>Fe(Re(i,"complete"),e))).then((()=>(o(null,e),Qe(ze,{type:He,content:e}),Promise.reject(e))))}const l=Fe(Re(i,"invoke")),c=this._uniClient;return l.then((()=>c.callFunction({name:"DCloud-clientDB",type:ye,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];let n="[System Info]"+t;a&&(n=`${n}\n详细信息:${a}`),(console["warn"===e?"error":e]||console.log)(n)}if(t)return r(new at({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&&(it({token:n,tokenExpired:l}),this._callbackAuth("refreshToken",[{token:n,tokenExpired:l}]),this._callback("refreshToken",[{token:n,tokenExpired:l}]),Qe(qe,{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,Fe(Re(i,"success"),d).then((()=>Fe(Re(i,"complete"),d))).then((()=>{o(d,null);const e=s._parseResult(d);return Qe(ze,{type:He,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 at({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const _n="token无效,跳转登录页面",kn="token过期,跳转登录页面",bn={TOKEN_INVALID_TOKEN_EXPIRED:kn,TOKEN_INVALID_INVALID_CLIENTID:_n,TOKEN_INVALID:_n,TOKEN_INVALID_WRONG_TOKEN:_n,TOKEN_INVALID_ANONYMOUS_USER:_n},wn={"uni-id-token-expired":kn,"uni-id-check-token-failed":_n,"uni-id-token-not-exist":_n,"uni-id-check-device-feature-failed":_n};function Cn(e,t){let a="";return a=e?`${e}/${t}`:t,a.replace(/^\//,"")}function xn(e=[],t=""){const a=[],n=[];return e.forEach((e=>{!0===e.needLogin?a.push(Cn(t,e.path)):!1===e.needLogin&&n.push(Cn(t,e.path))})),{needLoginPage:a,notNeedLoginPage:n}}function Sn(e){return e.split("?")[0].replace(/^\//,"")}function Nn(){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 Pn(){return Sn(Nn())}function En(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const a=t.list,n=Sn(e);return a.some((e=>e.pagePath===n))}const Tn=!!ie.uniIdRouter,{loginPage:Vn,routerNeedLogin:Dn,resToLogin:Bn,needLoginPage:In,notNeedLoginPage:Ln,loginPageInTabBar:An}=function({pages:e=[],subPackages:t=[],uniIdRouter:a={},tabBar:n={}}=ie){const{loginPage:o,needLogin:s=[],resToLogin:i=!0}=a,{needLoginPage:r,notNeedLoginPage:l}=xn(e),{needLoginPage:c,notNeedLoginPage:u}=function(e=[]){const t=[],a=[];return e.forEach((e=>{const{root:n,pages:o=[]}=e,{needLoginPage:s,notNeedLoginPage:i}=xn(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:En(o,n)}}();if(In.indexOf(Vn)>-1)throw new Error(`Login page [${Vn}] should not be "needLogin", please check your pages.json`);function On(e){const t=Pn();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 Mn({redirect:e}){const t=Sn(e),a=Sn(Vn);return Pn()!==a&&t!==a}function Fn({api:e,redirect:t}={}){if(!t||!Mn({redirect:t}))return;const a=(o=t,"/"!==(n=Vn).charAt(0)&&(n="/"+n),o?n.indexOf("?")>-1?n+`&uniIdRedirectUrl=${encodeURIComponent(o)}`:n+`?uniIdRedirectUrl=${encodeURIComponent(o)}`:n);var n,o;An?"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 Rn({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},a=function(){const{token:e,tokenExpired:t}=st();let a;if(e){if(t<Date.now()){const e="uni-id-token-expired";a={errCode:e,errMsg:wn[e]}}}else{const e="uni-id-check-token-failed";a={errCode:e,errMsg:wn[e]}}return a}();if(function(e){const t=Sn(On(e));return!(Ln.indexOf(t)>-1)&&(In.indexOf(t)>-1||Dn.some((t=>{return a=e,new RegExp(t).test(a);var a})))}(e)&&a){if(a.uniIdRedirectUrl=e,Je(je).length>0)return setTimeout((()=>{Qe(je,a)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function Un(){!function(){const e=Nn(),{abortLoginPageJump:t,autoToLoginPage:a}=Rn({url:e});t||a&&Fn({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}=Rn({url:e.url});return t?e:n?(Fn({api:a,redirect:On(e.url)}),!1):e}})}}function $n(){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 wn}(a);break;case"clientdb":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in bn}(a)}n&&function(e={}){const t=Je(je);et().then((()=>{const a=Nn();if(a&&Mn({redirect:a}))return t.length>0?Qe(je,Object.assign({uniIdRedirectUrl:a},e)):void(Vn&&Fn({api:"navigateTo",redirect:a}))}))}(a)}))}function zn(e){var t;(t=e).onResponse=function(e){Ge(ze,e)},t.offResponse=function(e){Ye(ze,e)},function(e){e.onNeedLogin=function(e){Ge(je,e)},e.offNeedLogin=function(e){Ye(je,e)},Tn&&(Ie(Qa).needLoginInit||(Ie(Qa).needLoginInit=!0,et().then((()=>{Un.call(e)})),Bn&&$n.call(e)))}(e),function(e){e.onRefreshToken=function(e){Ge(qe,e)},e.offRefreshToken=function(e){Ye(qe,e)}}(e)}let jn;const qn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Hn=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Kn(){const e=st().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(jn(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}jn="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Hn.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=qn.indexOf(e.charAt(s++))<<18|qn.indexOf(e.charAt(s++))<<12|(a=qn.indexOf(e.charAt(s++)))<<6|(n=qn.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 Wn=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(re((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)}}})));const Jn="manual";function Gn(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(this.loadtime===Jn)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,g=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,f={getCount:m},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return p&&(f.getTree=y),g&&(f.getTreePath=y),a=a.skip(h*(d-1)).limit(h).get(f),a}}}}function Yn(e){return Ie("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function Qn({openid:e,callLoginByWeixin:t=!1}={}){throw Yn(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `app`")}async function Zn(e){const t=Yn(this);return t.initPromise||(t.initPromise=Qn.call(this,e).then((e=>e)).catch((e=>{throw delete t.initPromise,e}))),t.initPromise}function Xn(e){dt=e}function eo(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 to 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([eo("getSystemInfo")(),eo("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 ao={tcb:Va,tencent:Va,aliyun:ft,private:Ia,dcloud:Ia,alipay:za};let no=new class{init(e){let t={};const a=ao[e.provider];if(!a)throw new Error("未提供正确的provider参数");var n;return t=a.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new Ne({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),sn(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=yn(vn,{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=yn(vn,{uniClient:n,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=Kn,e.chooseAndUploadFile=Wn.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return Gn(e)}}),e.SSEChannel=to,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:a=!1}={}){return Zn.call(e,{openid:t,callLoginByWeixin:a})}}(e),e.setCustomClientInfo=Xn,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 Fe(Re(t,"invoke"),{...o}),s=await e(...n),await Fe(Re(t,"success"),{...o,result:s}),s}catch(r){throw i=r,await Fe(Re(t,"fail"),{...o,error:i}),i}finally{await Fe(Re(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:fe,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 at(e)}}const{errSubject:p,errCode:g,errMsg:f,newToken:y}=d.result||{};if(l&&uni.hideLoading(),y&&y.token&&y.tokenExpired&&(it(y),Qe(qe,{...y})),g){let e=f;if(m&&r&&(e=(await r({objectName:a,methodName:c,params:u,errSubject:p,errCode:g,errMsg:f})).errMsg||f),l)if("toast"===i.type)uni.showToast({title:e,icon:"none"});else{if("modal"!==i.type)throw new Error(`Invalid errorOptions.type: ${i.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel: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 at({subject:p,code:g,message:f,requestId:d.requestId});throw t.detail=d.result,Qe(ze,{type:We,content:t}),t}return Qe(ze,{type:We,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||ge;n=e!==ge}const o="callFunction"===t&&!n,s=this._initPromiseHub.exec();a=a||{};const{success:i,fail:r,complete:l}=tt(a),c=s.then((()=>n?Promise.resolve():Fe(Re(t,"invoke"),a))).then((()=>e.call(this,a))).then((e=>n?Promise.resolve(e):Fe(Re(t,"success"),e).then((()=>Fe(Re(t,"complete"),e))).then((()=>(o&&Qe(ze,{type:Ke,content:e}),Promise.resolve(e))))),(e=>n?Promise.reject(e):Fe(Re(t,"fail"),e).then((()=>Fe(Re(t,"complete"),e))).then((()=>(Qe(ze,{type:Ke,content:e}),Promise.reject(e))))));if(!(i||r||l))return c;c.then((e=>{i&&i(e),l&&l(e),o&&Qe(ze,{type:Ke,content:e})}),(e=>{r&&r(e),l&&l(e),o&&Qe(ze,{type:Ke,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=Te;let t={};if(e&&1===e.length)t=e[0],no=no.init(t),no._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=>{no[e]=function(){return console.error(a),Promise.reject(new at({code:"SYS_ERR",message:a}))}}))}Object.assign(no,{get mixinDatacom(){return Gn(no)}}),zn(no),no.addInterceptor=Oe,no.removeInterceptor=Me,no.interceptObject=Ue,uni.__uniCloud=no;{const e=De||(De=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;function e(){return this}return void 0!==e()?e():new Function("return this")()}(),De);e.uniCloud=no,e.UniCloudError=at}})();var oo=no;const so={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 io;setTimeout((()=>{io=uni.getSystemInfoSync().platform}),16);const{t:ro}=ae(so);const lo=d({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:io,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||ro("uni-load-more.contentdown")},contentrefreshText(){return this.contentText.contentrefresh||ro("uni-load-more.contentrefresh")},contentnomoreText(){return this.contentText.contentnomore||ro("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"]]),co={name:"uniDataChecklist",mixins:[oo.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 uo=d(co,[["render",function(t,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-load-more"),lo);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:a[0]||(a[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:a[1]||(a[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 ho(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mo={exports:{}};mo.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+)?$/,g=/\[([^\]]+)]|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,f={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}},_="en",k={};k[_]=f;var b="$isDayjsObject",w=function(e){return e instanceof N||!(!e||!e[b])},C=function e(t,a,n){var o;if(!t)return _;if("string"==typeof t){var s=t.toLowerCase();k[s]&&(o=s),a&&(k[s]=a,o=s);var i=t.split("-");if(!o&&i.length>1)return e(i[0])}else{var r=t.name;k[r]=t,o=r}return!n&&o&&(_=o),o||!n&&_},x=function(e,t){if(w(e))return e.clone();var a="object"==typeof t?t:{};return a.date=e,a.args=arguments,new N(a)},S=v;S.l=C,S.i=w,S.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var N=function(){function f(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var y=f.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(S.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 S},y.isValid=function(){return!(this.$d.toString()===m)},y.isSame=function(e,t){var a=x(e);return this.startOf(t)<=a&&a<=this.endOf(t)},y.isAfter=function(e,t){return x(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<x(e)},y.$g=function(e,t,a){return S.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=!!S.u(t)||t,u=S.p(e),m=function(e,t){var o=S.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 S.w(a.toDate()[e].apply(a.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),a)},g=this.$W,f=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,f):m(0,f+1);case l:var _=this.$locale().weekStart||0,k=(g<_?g+7:g)-_;return m(n?y-k:y+(6-k),f);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=S.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 g=this.clone().set(h,1);g.$d[m](p),g.init(),this.$d=g.set(h,Math.min(this.$D,g.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[S.p(e)]()},y.add=function(n,u){var h,m=this;n=Number(n);var p=S.p(u),g=function(e){var t=x(m);return S.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 g(1);if(p===l)return g(7);var f=(h={},h[s]=t,h[i]=a,h[o]=e,h)[p]||1,y=this.$d.getTime()+n*f;return S.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=S.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 S.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(g,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return r+1;case"MM":return S.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 S.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 S.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 S.s(i,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.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,g=this,f=S.p(h),y=x(n),v=(y.utcOffset()-this.utcOffset())*t,_=this-y,k=function(){return S.m(g,y)};switch(f){case d:p=k()/12;break;case c:p=k();break;case u:p=k()/3;break;case l:p=(_-v)/6048e5;break;case r:p=(_-v)/864e5;break;case i:p=_/a;break;case s:p=_/t;break;case o:p=_/e;break;default:p=_}return m?p:S.a(p)},y.daysInMonth=function(){return this.endOf(c).$D},y.$locale=function(){return k[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var a=this.clone(),n=C(e,t,!0);return n&&(a.$L=n),a},y.clone=function(){return S.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()},f}(),P=N.prototype;return x.prototype=P,[["$ms",n],["$s",o],["$m",s],["$H",i],["$W",r],["$M",c],["$y",d],["$D",h]].forEach((function(e){P[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),x.extend=function(e,t){return e.$i||(e(t,N,x),e.$i=!0),x},x.locale=C,x.isDayjs=w,x.unix=function(e){return x(1e3*e)},x.en=k[_],x.Ls=k,x.p={},x}();const po=ho(mo.exports);var go;const fo={get isIOS(){return"boolean"==typeof go?go:go="ios"===uni.getSystemInfoSync().platform},requestIOS:function(e){return new Promise(((t,n)=>{switch(e){case"push":t(function(){var e=0,t=plus.ios.import("UIApplication"),n=t.sharedApplication();if(n.currentUserNotificationSettings){var o=n.currentUserNotificationSettings();0==o.plusGetAttribute("types")?(e=0,a("log","at common/permission.js:63","推送权限没有开启")):(e=1,a("log","at common/permission.js:66","已经开启推送功能!")),plus.ios.deleteObject(o)}else 0==n.enabledRemoteNotificationTypes()?(e=3,a("log","at common/permission.js:73","推送权限没有开启!")):(e=4,a("log","at common/permission.js:76","已经开启推送功能!"));return plus.ios.deleteObject(n),plus.ios.deleteObject(t),e}());break;case"location":t((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":t(function(){var e=null,t=plus.ios.import("AVAudioSession"),n=t.sharedInstance().recordPermission();return a("log","at common/permission.js:104","permissionStatus:"+n),e=1970168948===n?null:1735552628===n?1:0,plus.ios.deleteObject(t),e}());break;case"camera":t(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":t(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":t(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":t(function(){var e=null,t=plus.ios.import("EKEventStore");return 3==t.authorizationStatusForEntityType(0)?(e=1,a("log","at common/permission.js:122","日历权限已经开启")):a("log","at common/permission.js:124","日历权限没有开启"),plus.ios.deleteObject(t),e}());break;case"memo":t(function(){var e=null,t=plus.ios.import("EKEventStore");return 3==t.authorizationStatusForEntityType(1)?(e=1,a("log","at common/permission.js:136","备忘录权限已经开启")):a("log","at common/permission.js:138","备忘录权限没有开启"),plus.ios.deleteObject(t),e}());break;default:t(0)}var o,s,i,r}))},requestAndroid:function(e){return new Promise(((t,n)=>{plus.android.requestPermissions([e],(function(e){for(var n=0,o=0;o<e.granted.length;o++){a("log","at common/permission.js:187","已获取的权限:"+e.granted[o]),n=1}for(o=0;o<e.deniedPresent.length;o++){a("log","at common/permission.js:192","拒绝本次申请的权限:"+e.deniedPresent[o]),n=0}for(o=0;o<e.deniedAlways.length;o++){a("log","at common/permission.js:197","永久拒绝申请的权限:"+e.deniedAlways[o]),n=-1}t(n)}),(function(e){a("log","at common/permission.js:203","result error: "+e.message),t({code:e.code,message:e.message})}))}))},gotoAppSetting:function(){if(fo.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)}}},yo="http://dsg.tms.api.aibasil.cn",vo=yo+"/admin/order.ScanOrder/getWarehouseSpace",_o=yo+"/admin/order.scanOrder/getBindParams",ko=yo+"/admin/printer//getPrinterList",bo=yo+"/admin/order.ScanOrder/printWaybillLabel",wo=yo+"/admin/Config/getAliyunOssSignature",Co=[];for(let _s=0;_s<=15;_s++)Co[_s]=_s.toString(16);function xo(){let e="";for(let t=1;t<=36;t++)e+=9===t||14===t||19===t||24===t?"-":15===t?4:20===t?Co[4*Math.random()|8]:Co[16*Math.random()|0];return e}const So=e.defineComponent({__name:"index",setup(t){const o=e.ref(),r=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(null),h=e.ref(null),m=e.ref(!1),p=e.ref([]),g=e.ref(""),f=e.ref(""),v=e.ref([]),b=e.ref([]),w=e.ref(null),C=e.ref(6),x=e.ref({}),S=e.ref([]),N=e.ref([]),P=e.ref([1]),E=e.ref(0),T=e.ref(!1),V=e.ref(!0),D=e.ref(),B=e.reactive({images:[],orderNum:"",batch_number:"",space_code:"",weight:"",typing:!0}),I=e.computed((()=>({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]},weight:{rules:[{required:!0,errorMessage:"重量不能为空"},{format:"number",errorMessage:"重量只能输入数字"}]}}))),L=e.computed((()=>{try{const e=b.value.find((e=>e.value===B.space_code));return null==e?void 0:e.text}catch(_t){return a("log","at pages/weigh/index.vue:201",_t),""}}));s((()=>{V.value=!0,m.value=!1,d.value=uni.getStorageSync("token"),h.value=uni.getStorageSync("user"),A(),M(),R()})),i((()=>{V.value=!1,m.value=!1})),u((e=>{0===e.index&&uni.navigateTo({url:"/pages/weigh/instockLog"})}));const A=()=>{uni.request({url:vo,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}))))}})},M=()=>{uni.request({url:_o,method:"GET",header:{batoken:d.value},success:e=>{1===e.data.code&&(v.value=e.data.data.batch_number.map((e=>({text:e.name,value:e.id}))))},fail(e){a("log","at pages/weigh/index.vue:267","fail--",e)}})},R=()=>{uni.request({url:ko,method:"GET",header:{batoken:d.value},success:e=>{1===e.data.code&&(x.value=e.data.data.printers,N.value=Object.values(x.value).map((e=>({text:e.name,value:e.value}))))},fail(e){a("log","at pages/weigh/index.vue:291","fail--",e)}})},U=()=>{m.value=!1,V.value=!1,p.value=[],B.orderNum="",B.batch_number="",B.weight="",B.typing=!0,e.nextTick((()=>{V.value=!0}))},$=async()=>{1===await z()&&uni.scanCode({success:e=>{D.value=e.result,B.orderNum=e.result},fail:e=>{}})},z=async()=>{let e=fo.isIOS?await fo.requestIOS("camera"):await fo.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&fo.gotoAppSetting()}}),e};let j;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:B.orderNum},success:e=>{1===e.data.code&&e.data.data.is_goods_empty?o.value.open():K(0)}})},K=e=>{const t=ee();a("log","at pages/weigh/index.vue:376","images--",t);let n=!0;for(var o=0;o<t.length;o++)t[o].savePath||(n=!1);if(!n)return g.value="error",f.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:B.orderNum,weight:B.weight,is_save_goods:e,images:t},success:e=>{if(m.value=!1,1==e.data.code){g.value="success",f.value=e.data.msg,r.value.open(),a("log","at pages/weigh/index.vue:408","res.data.data---",e.data.data);const t={orderNum:B.orderNum,createTime:new Date,space:L.value,type:"称重",status:!0};S.value.unshift(t),uni.setStorageSync("weighHistory",S.value),X(),e.data.data.express_label?(a("log","at pages/weigh/index.vue:422","有打印面单"),E.value=P.value.length>0?N.value[0].value:0,c.value.open()):j=setTimeout((()=>{U(),j&&clearTimeout(j)}),1e3)}else{g.value="error",f.value=e.data.msg,r.value.open();const t={orderNum:B.orderNum,createTime:new Date,space:L.value,type:"称重",status:!1};S.value.unshift(t),uni.setStorageSync("weighHistory",S.value),X(),j=setTimeout((()=>{U(),j&&clearTimeout(j)}),1e3)}}})},W=()=>{c.value.close(),j=setTimeout((()=>{U(),j&&clearTimeout(j)}),700)},J=()=>{K(1)},G=()=>{K(0)},Y=e=>{!e.detail.value.length>0?E.value=0:E.value=N.value[0].value},Q=()=>{T.value=!0,uni.request({url:bo,method:"POST",header:{batoken:d.value},data:{order_no:B.orderNum,printer_code:E},success:e=>{W(),T.value=!1,a("log","at pages/weigh/index.vue:490","打印成功",e),g.value="success",f.value="打印成功",r.value.open()}})},Z=()=>{l.value.validate().then((e=>{(async()=>{j&&clearTimeout(j),await H()})()})).catch((e=>{a("log","at pages/weigh/index.vue:504","err",e)}))},X=()=>{S.value=uni.getStorageSync("weighHistory")},ee=()=>{const e=p.value.map((e=>({name:e.name,savePath:e.serverUrl,fileSize:e.size,mimeType:e.type})));return a("log","at pages/weigh/index.vue:519","res22 ",e),e},te=(e,t)=>{const n={policy:e.policy,signature:e.signature,ossaccessKeyId:e.ossAccessKeyId,key:e.dir+po().format("YYYYMMDD")+"/"+xo()+"_"+t.name,dir:e.dir,host:e.host,file:t.file};return new Promise(((o,s)=>{let i=t.name;i="file";uni.uploadFile({url:e.host,filePath:t.path,name:"file",formData:n,success:e=>{204===e.statusCode||200===e.statusCode?(t.serverUrl=n.key,o(e)):s(e)},fail:e=>{a("log","at pages/weigh/index.vue:588","error++",e),s(e)},complete:()=>{a("log","at pages/weigh/index.vue:593","complete---"),t.progress=100}}).onProgressUpdate((e=>{t.progress=e.progress}))}))},ae=()=>{uni.chooseImage({count:C.value-p.value.length,success:t=>{p.value=p.value.concat(t.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:wo,method:"GET",header:{batoken:d.value},success:({data:t})=>{const n=t.data.signature,o=e.map((e=>te(n,e)));Promise.all(o).then((e=>{a("log","at pages/weigh/index.vue:540","所有图片加载成功:",e),uni.showToast({title:"加载成功",icon:"success"})})).catch((e=>{a("error","at pages/weigh/index.vue:547","加载失败:",e),uni.showToast({title:"加载失败",icon:"none"})}))},fail:e=>{a("log","at pages/weigh/index.vue:555",e)}})}))},fail:e=>{a("error","at pages/weigh/index.vue:638",e)}})},ne=()=>{w.value=null};return(t,a)=>{const s=n(e.resolveDynamicComponent("uni-easyinput"),_),i=n(e.resolveDynamicComponent("uni-forms-item"),k),u=n(e.resolveDynamicComponent("uni-icons"),y),d=n(e.resolveDynamicComponent("uni-forms"),O),h=n(e.resolveDynamicComponent("uni-popup-message"),F),v=n(e.resolveDynamicComponent("uni-popup"),q),b=n(e.resolveDynamicComponent("uni-popup-dialog"),se),D=n(e.resolveDynamicComponent("uni-data-checkbox"),uo);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:I.value,modelValue:B},{default:e.withCtx((()=>[e.createVNode(i,{label:"单号",required:!0,name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:B.orderNum,"onUpdate:modelValue":a[0]||(a[0]=e=>B.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:V.value,onIconClick:$},null,8,["modelValue","focus"])])),_:1}),e.createVNode(i,{label:"重量",required:"",name:"weight"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:B.weight,"onUpdate:modelValue":a[1]||(a[1]=e=>B.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(i,{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(w.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=>{p.value.splice(e,1)})(a),type:"clear",size:"20",color:"red"},null,8,["onClick"])])))),128)),p.value.length<C.value?(e.openBlock(),e.createElementBlock("view",{key:0,class:"choose-image-container",onClick:ae},[e.createVNode(u,{type:"plusempty",size:"40",color:"#ccc"})])):e.createCommentVNode("",!0)]),e.createElementVNode("text",{style:{"padding-top":"8px"}},"最多选择6张图片"),w.value?(e.openBlock(),e.createElementBlock("view",{key:0,class:"preview-modal",onClick:ne},[e.createElementVNode("image",{src:w.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:U},"重置"),e.createElementVNode("button",{type:"primary",onClick:Z,loading:m.value},[m.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(v,{ref_key:"message",ref:r,type:"message"},{default:e.withCtx((()=>[e.createVNode(h,{type:g.value,message:f.value,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(v,{ref_key:"alertDialog",ref:o,type:"dialog"},{default:e.withCtx((()=>[e.createVNode(b,{type:"info",cancelText:"否",confirmText:"是",title:"提示",content:"是否按默认申报(默认申报为:衣服,10件,单价1)",onConfirm:J,onClose:G})])),_:1},512),e.createVNode(v,{ref_key:"printerDialog",ref:c,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(D,{multiple:"",modelValue:P.value,"onUpdate:modelValue":a[2]||(a[2]=e=>P.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:Y},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(D,{disabled:0===P.value.length,modelValue:E.value,"onUpdate:modelValue":a[3]||(a[3]=e=>E.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:W,style:{width:"35%"}},"关闭"),e.createElementVNode("button",{onClick:Q,"hover-stay-time":500,loading:T.value,disabled:0===P.value.length||T.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),No=d(So,[["__scopeId","data-v-bb460855"]]),Po=d(e.defineComponent({__name:"instockLog",setup(t){const a=e.ref([]);return r((()=>{a.value=uni.getStorageSync("weighHistory")})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-icons"),y);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-f1ac4be4"]]);const Eo=d({name:"uni-data-select",mixins:[oo.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,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-icons"),y);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:a[1]||(a[1]=(...e)=>r.toggleSelector&&r.toggleSelector(...e))},[i.current?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select__input-text"},e.toDisplayString(r.textShow),1)):(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__input-text uni-select__input-placeholder"},e.toDisplayString(r.typePlaceholder),1)),i.current&&o.clear&&!o.disabled?(e.openBlock(),e.createElementBlock("view",{key:2,onClick:a[0]||(a[0]=e.withModifiers(((...e)=>r.clearVal&&r.clearVal(...e)),["stop"]))},[e.createVNode(l,{type:"clear",color:"#c0c4cc",size:"24"})])):(e.openBlock(),e.createElementBlock("view",{key:3},[e.createVNode(l,{type:i.showSelector?"top":"bottom",size:"14",color:"#999"},null,8,["type"])]))]),i.showSelector?(e.openBlock(),e.createElementBlock("view",{key:0,class:"uni-select--mask",onClick:a[2]||(a[2]=(...e)=>r.toggleSelector&&r.toggleSelector(...e))})):e.createCommentVNode("",!0),i.showSelector?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-select__selector",style:e.normalizeStyle(r.getOffsetByPlacement)},[e.createElementVNode("view",{class:e.normalizeClass("bottom"==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"]]),To=e.defineComponent({__name:"index",setup(t){const o=e.ref(),r=e.ref(),l=e.ref(),c=e.ref(null),d=e.ref(null),h=e.ref(!1),m=e.ref([]),p=e.ref(""),g=e.ref(""),f=e.ref([]),v=e.ref([]),b=e.ref(null),w=e.ref(6),C=e.ref({}),x=e.ref([]),S=e.ref([]),N=e.ref([1]),P=e.ref(0),E=e.ref(!1),T=e.ref(!0),V=e.ref(),D=e.reactive({images:[],orderNum:"",batch_number:"",space_code:"",weight:"",search_pkg:!0,typing:!0,search_order:!0,search_order_choice:1}),B=e.computed((()=>({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]},weight:{rules:[{required:!0,errorMessage:"重量不能为空"},{format:"number",errorMessage:"重量只能输入数字"}]}}))),I=e.computed((()=>{try{const e=v.value.find((e=>e.value===D.space_code));return null==e?void 0:e.text}catch(_t){return a("log","at pages/inbound/index.vue:182",_t),""}}));s((()=>{T.value=!0,h.value=!1,c.value=uni.getStorageSync("token"),d.value=uni.getStorageSync("user"),L(),A(),M()})),i((()=>{T.value=!1,h.value=!1})),u((e=>{0===e.index&&uni.navigateTo({url:"/pages/inbound/instockLog"})}));const L=()=>{uni.request({url:vo,method:"POST",header:{batoken:c.value},data:{code:""},success:e=>{1===e.data.code&&(v.value=e.data.data.spaces.map((e=>({text:e.name,value:e.code}))))}})},A=()=>{uni.request({url:_o,method:"GET",header:{batoken:c.value},success:e=>{1===e.data.code&&(f.value=e.data.data.batch_number.map((e=>({text:e.name,value:e.id}))))},fail(e){a("log","at pages/inbound/index.vue:248","fail--",e)}})},M=()=>{uni.request({url:ko,method:"GET",header:{batoken:c.value},success:e=>{1===e.data.code&&(C.value=e.data.data.printers,S.value=Object.values(C.value).map((e=>({text:e.name,value:e.value}))))},fail(e){a("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}))},U=async()=>{1===await $()&&uni.scanCode({success:e=>{V.value=e.result,D.orderNum=e.result},fail:e=>{}})},$=async()=>{let e=fo.isIOS?await fo.requestIOS("camera"):await fo.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&fo.gotoAppSetting()}}),e};let z;const j=()=>{const e=Y();a("log","at pages/inbound/index.vue:339","images--",e);let t=!0;for(var n=0;n<e.length;n++)e[n].savePath||(t=!1);if(!t)return p.value="error",g.value="图片还没上传完毕,请稍后...",o.value.open(),void(h.value=!1);uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.ScanOrder/instock",method:"POST",header:{batoken:c.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",g.value=e.data.msg,o.value.open(),a("log","at pages/inbound/index.vue:370","res.data.data---",e.data.data);const t={orderNum:D.orderNum,createTime:new Date,space:I.value,type:"入库",status:!0};x.value.unshift(t),uni.setStorageSync("inboundHistory",x.value),G(),e.data.data.express_label?(a("log","at pages/inbound/index.vue:384","有打印面单"),P.value=N.value.length>0?S.value[0].value:0,l.value.open()):z=setTimeout((()=>{R(),z&&clearTimeout(z)}),1e3)}else{p.value="error",g.value=e.data.msg,o.value.open();const t={orderNum:D.orderNum,createTime:new Date,space:I.value,type:"入库",status:!1};x.value.unshift(t),uni.setStorageSync("inboundHistory",x.value),G(),z=setTimeout((()=>{R(),z&&clearTimeout(z)}),1e3)}}})},H=()=>{l.value.close(),z=setTimeout((()=>{R(),z&&clearTimeout(z)}),700)},K=e=>{!e.detail.value.length>0?P.value=0:P.value=S.value[0].value},W=()=>{E.value=!0,uni.request({url:bo,method:"POST",header:{batoken:c.value},data:{order_no:D.orderNum,printer_code:P},success:e=>{H(),E.value=!1,a("log","at pages/inbound/index.vue:446","打印成功",e),p.value="success",g.value="打印成功",o.value.open()}})},J=()=>{r.value.validate().then((e=>{(async()=>{z&&clearTimeout(z),j()})()})).catch((e=>{a("log","at pages/inbound/index.vue:460","err",e)}))},G=()=>{x.value=uni.getStorageSync("inboundHistory")},Y=()=>{const e=m.value.map((e=>({name:e.name,savePath:e.serverUrl,fileSize:e.size,mimeType:e.type})));return a("log","at pages/inbound/index.vue:475","res22 ",e),e},Q=(e,t)=>{const n={policy:e.policy,signature:e.signature,ossaccessKeyId:e.ossAccessKeyId,key:e.dir+po().format("YYYYMMDD")+"/"+xo()+"_"+t.name,dir:e.dir,host:e.host,file:t.file};return new Promise(((o,s)=>{let i=t.name;i="file";uni.uploadFile({url:e.host,filePath:t.path,name:"file",formData:n,success:e=>{204===e.statusCode||200===e.statusCode?(t.serverUrl=n.key,o(e)):s(e)},fail:e=>{a("log","at pages/inbound/index.vue:544","error++",e),s(e)},complete:()=>{a("log","at pages/inbound/index.vue:549","complete---"),t.progress=100}}).onProgressUpdate((e=>{t.progress=e.progress}))}))},Z=()=>{uni.chooseImage({count:w.value-m.value.length,success:t=>{m.value=m.value.concat(t.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:wo,method:"GET",header:{batoken:c.value},success:({data:t})=>{const n=t.data.signature,o=e.map((e=>Q(n,e)));Promise.all(o).then((e=>{a("log","at pages/inbound/index.vue:496","所有图片加载成功:",e),uni.showToast({title:"加载成功",icon:"success"})})).catch((e=>{a("error","at pages/inbound/index.vue:503","加载失败:",e),uni.showToast({title:"加载失败",icon:"none"})}))},fail:e=>{a("log","at pages/inbound/index.vue:511",e)}})}))},fail:e=>{a("error","at pages/inbound/index.vue:594",e)}})},X=()=>{b.value=null};return(t,a)=>{const s=n(e.resolveDynamicComponent("uni-easyinput"),_),i=n(e.resolveDynamicComponent("uni-forms-item"),k),c=n(e.resolveDynamicComponent("uni-data-select"),Eo),u=n(e.resolveDynamicComponent("uni-icons"),y),d=n(e.resolveDynamicComponent("uni-forms"),O),f=n(e.resolveDynamicComponent("uni-popup-message"),F),V=n(e.resolveDynamicComponent("uni-popup"),q),I=n(e.resolveDynamicComponent("uni-data-checkbox"),uo);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:B.value,modelValue:D},{default:e.withCtx((()=>[e.createVNode(i,{label:"单号",required:!0,name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:D.orderNum,"onUpdate:modelValue":a[0]||(a[0]=e=>D.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:T.value,onIconClick:U},null,8,["modelValue","focus"])])),_:1}),e.createVNode(i,{label:"仓位编码",name:"space_code"},{default:e.withCtx((()=>[e.createVNode(c,{modelValue:D.space_code,"onUpdate:modelValue":a[1]||(a[1]=e=>D.space_code=e),localdata:v.value,placeholder:"请选择仓位编码"},null,8,["modelValue","localdata"])])),_:1}),e.createVNode(i,{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<w.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:J,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(x.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(V,{ref_key:"message",ref:o,type:"message"},{default:e.withCtx((()=>[e.createVNode(f,{type:p.value,message:g.value,duration:2e3},null,8,["type","message"])])),_:1},512),e.createVNode(V,{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,[C.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(I,{multiple:"",modelValue:N.value,"onUpdate:modelValue":a[2]||(a[2]=e=>N.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:K},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(I,{disabled:0===N.value.length,modelValue:P.value,"onUpdate:modelValue":a[3]||(a[3]=e=>P.value=e),localdata:S.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:W,"hover-stay-time":500,loading:E.value,disabled:0===N.value.length||E.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),Vo=d(To,[["__scopeId","data-v-bb6fe5b6"]]),Do=d(e.defineComponent({__name:"instockLog",setup(t){const a=e.ref([]);return r((()=>{a.value=uni.getStorageSync("inboundHistory")})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-icons"),y);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-2a21c641"]]),Bo=e.defineComponent({__name:"index",setup(t){const o=e.ref(),r=e.ref(),l=e.ref(),c=e.ref(null),d=e.ref(null),h=e.ref(!1),m=e.ref(""),p=e.ref(""),g=e.ref([]),f=e.ref({}),v=e.ref([]),b=e.ref([]),w=e.ref([1]),C=e.ref(0),x=e.ref(!1),S=e.ref(!0),N=e.ref(),P=e.reactive({orderNum:"",batch_number:"",weight:"",typing:!0}),E=e.computed((()=>({orderNum:{rules:[{required:!1,errorMessage:"单号不能为空"}]},weight:{rules:[{required:!0,errorMessage:"重量不能为空"},{format:"number",errorMessage:"重量只能输入数字"}]}})));s((()=>{S.value=!0,h.value=!1,c.value=uni.getStorageSync("token"),d.value=uni.getStorageSync("user"),T(),V()})),i((()=>{S.value=!1,h.value=!1})),u((e=>{0===e.index&&uni.navigateTo({url:"/pages/outbound/instockLog"})}));const T=()=>{uni.request({url:_o,method:"GET",header:{batoken:c.value},success:e=>{1===e.data.code&&(g.value=e.data.data.batch_number.map((e=>({text:e.name,value:e.id}))))},fail(e){a("log","at pages/outbound/index.vue:185","fail--",e)}})},V=()=>{uni.request({url:ko,method:"GET",header:{batoken:c.value},success:e=>{1===e.data.code&&(f.value=e.data.data.printers,b.value=Object.values(f.value).map((e=>({text:e.name,value:e.value}))))},fail(e){a("log","at pages/outbound/index.vue:209","fail--",e)}})},D=e=>{var t;return null==(t=g.value.find((t=>t.value===e)))?void 0:t.text},B=()=>{h.value=!1,S.value=!1,P.orderNum="",P.batch_number="",P.weight="",P.typing=!0,e.nextTick((()=>{S.value=!0}))},I=async()=>{1===await L()&&uni.scanCode({success:e=>{N.value=e.result,P.orderNum=e.result},fail:e=>{}})},L=async()=>{let e=fo.isIOS?await fo.requestIOS("camera"):await fo.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&fo.gotoAppSetting()}}),e};let A;const M=()=>{if(a("log","at pages/outbound/index.vue:274",P.orderNum,P.batch_number),0===P.orderNum.length&&0===P.batch_number.length)return m.value="error",p.value="单号或批次号至少填一个",void o.value.open();h.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.scanOrder/outStock",method:"POST",header:{batoken:c.value},data:{order_no:P.orderNum,batch_number:P.batch_number},success:e=>{if(h.value=!1,1==e.data.code){m.value="success",p.value=e.data.msg,o.value.open();const t={orderNum:P.orderNum,batch_text:D(P.batch_number),createTime:new Date,type:"出库",status:!0};v.value.unshift(t),v.value.length>10&&(v.value.length=10),uni.setStorageSync("outboundHistory",v.value),j(),e.data.data.labels&&e.data.data.labels.length>0?(a("log","at pages/outbound/index.vue:311","有打印面单"),C.value=w.value.length>0?b.value[0].value:0,l.value.open()):A=setTimeout((()=>{B(),A&&clearTimeout(A)}),700)}else{m.value="error",p.value=e.data.msg,o.value.open();const t={orderNum:P.orderNum,batch_text:D(P.batch_number),createTime:new Date,type:"出库",status:!1};v.value.unshift(t),v.value.length>10&&(v.value.length=10),uni.setStorageSync("outboundHistory",v.value),j(),A=setTimeout((()=>{B(),A&&clearTimeout(A)}),700)}}})},R=()=>{l.value.close(),A=setTimeout((()=>{B(),A&&clearTimeout(A)}),700)},U=e=>{!e.detail.value.length>0?C.value=0:C.value=b.value[0].value},$=()=>{x.value=!0,uni.request({url:bo,method:"POST",header:{batoken:c.value},data:{order_no:P.orderNum,printer_code:C},success:e=>{R(),x.value=!1,a("log","at pages/outbound/index.vue:374","打印成功",e),m.value="success",p.value="打印成功",o.value.open()}})},z=()=>{r.value.validate().then((e=>{(async()=>{A&&clearTimeout(A),M()})()})).catch((e=>{a("log","at pages/outbound/index.vue:388","err",e)}))},j=()=>{v.value=uni.getStorageSync("outboundHistory")};return(t,a)=>{const s=n(e.resolveDynamicComponent("uni-easyinput"),_),i=n(e.resolveDynamicComponent("uni-forms-item"),k),c=n(e.resolveDynamicComponent("uni-data-select"),Eo),u=n(e.resolveDynamicComponent("uni-forms"),O),d=n(e.resolveDynamicComponent("uni-icons"),y),N=n(e.resolveDynamicComponent("uni-popup-message"),F),T=n(e.resolveDynamicComponent("uni-popup"),q),V=n(e.resolveDynamicComponent("uni-data-checkbox"),uo);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:E.value,modelValue:P},{default:e.withCtx((()=>[e.createVNode(i,{label:"单号",required:!1,name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:P.orderNum,"onUpdate:modelValue":a[0]||(a[0]=e=>P.orderNum=e),placeholder:"请输入单号",suffixIcon:"scan",focus:S.value,onIconClick:I},null,8,["modelValue","focus"])])),_:1}),e.createVNode(i,{label:"批次号",name:"batch_number"},{default:e.withCtx((()=>[e.createVNode(c,{modelValue:P.batch_number,"onUpdate:modelValue":a[1]||(a[1]=e=>P.batch_number=e),localdata:g.value,placeholder:"请选择批次号"},null,8,["modelValue","localdata"])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:B},"重置"),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(v.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:o,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,[f.value?(e.openBlock(),e.createElementBlock("view",{key:0},[e.createElementVNode("view",null,[e.createVNode(V,{multiple:"",modelValue:w.value,"onUpdate:modelValue":a[2]||(a[2]=e=>w.value=e),localdata:[{text:"发送到标签打印机打印",value:1}],onChange:U},{default:e.withCtx((()=>[e.createTextVNode(" > ")])),_:1},8,["modelValue"]),e.createVNode(V,{disabled:0===w.value.length,modelValue:C.value,"onUpdate:modelValue":a[3]||(a[3]=e=>C.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:$,"hover-stay-time":500,loading:x.value,disabled:0===w.value.length||x.value,class:"my-bt-bg",style:{width:"35%"}}," 打印 ",8,["loading","disabled"])])])])])),_:1},512)])}}}),Io=d(Bo,[["__scopeId","data-v-9036600a"]]),Lo=d(e.defineComponent({__name:"instockLog",setup(t){const a=e.ref([]);return r((()=>{a.value=uni.getStorageSync("outboundHistory")})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-icons"),y);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-eab10630"]]);const Ao=d({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,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-popup-dialog"),se),c=n(e.resolveDynamicComponent("uni-popup"),q);return e.openBlock(),e.createElementBlock("view",{class:"content"},[e.createElementVNode("view",{class:"user-v",onClick:a[0]||(a[0]=(...e)=>r.avatarClick&&r.avatarClick(...e))},[i.user.avatar?(e.openBlock(),e.createElementBlock("image",{key:1,class:"user-icon",src:i.user.avatar},null,8,["src"])):(e.openBlock(),e.createElementBlock("image",{key:0,class:"user-icon",src:"/static/user.png"}))]),e.createElementVNode("view",{class:"text-area"},[e.createElementVNode("text",{class:"title"},e.toDisplayString(i.user.username),1)]),e.createElementVNode("view",{class:"login-btn"},[i.token?(e.openBlock(),e.createElementBlock("button",{key:1,type:"default",plain:"true",size:"mini",onClick:a[2]||(a[2]=(...e)=>r.dialogToggle&&r.dialogToggle(...e))},"注销")):(e.openBlock(),e.createElementBlock("button",{key:0,type:"primary",plain:"true",size:"mini",onClick:a[1]||(a[1]=(...e)=>r.avatarClick&&r.avatarClick(...e))},"登录"))]),e.createVNode(c,{ref:"alertDialog",type:"dialog"},{default:e.withCtx((()=>[e.createVNode(l,{type:"info",cancelText:"取消",confirmText:"注销",title:"注销",content:"确定是要注销吗?",onConfirm:r.logout},null,8,["onConfirm"])])),_:1},512)])}]]);const Oo=d({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(a("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 a("log","at pages/login/index.vue:120",e),this.messageText=e.data.msg,this.$refs.message.open()}})}}},[["render",function(t,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-icons"),y),c=n(e.resolveDynamicComponent("uni-easyinput"),_),u=n(e.resolveDynamicComponent("uni-forms"),O),d=n(e.resolveDynamicComponent("uni-popup-message"),F),h=n(e.resolveDynamicComponent("uni-popup"),q);return e.openBlock(),e.createElementBlock("view",{class:"contaier"},[e.createElementVNode("view",{class:"top-bg"},[e.createElementVNode("image",{class:"logo-icon",src:"/static/logo.png"})]),e.createElementVNode("view",{class:"input-box padding-lr"},[e.createVNode(u,{ref:"valiForm",rules:i.rules,modelValue:i.valiFormData},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"cu-form-group margin-top"},[e.createVNode(l,{class:"uni-icon",type:"person",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"账号",modelValue:i.valiFormData.account,"onUpdate:modelValue":a[0]||(a[0]=e=>i.valiFormData.account=e)},null,8,["modelValue"])]),e.createElementVNode("view",{class:"cu-form-group"},[e.createVNode(l,{class:"uni-icon",type:"locked",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"密码",type:"password",modelValue:i.valiFormData.password,"onUpdate:modelValue":a[1]||(a[1]=e=>i.valiFormData.password=e)},null,8,["modelValue"])]),e.createElementVNode("view",{class:"cu-form-group solid-bottom"},[e.createVNode(l,{class:"uni-icon",type:"more-filled",size:"30",color:"#999"}),e.createVNode(c,{placeholder:"验证码",modelValue:i.valiFormData.captcha,"onUpdate:modelValue":a[2]||(a[2]=e=>i.valiFormData.captcha=e)},null,8,["modelValue"]),e.createElementVNode("image",{class:"cu-btn captchaImg",src:i.verifyCodeImg,onClick:a[3]||(a[3]=(...e)=>r.getVerifyCodeImg&&r.getVerifyCodeImg(...e))},null,8,["src"])])])),_:1},8,["rules","modelValue"])]),e.createElementVNode("view",{class:"padding-lr margin-top-xs"},[e.createElementVNode("button",{class:"cu-btn block round bg-login-zl margin-tb-sm lg",onClick:a[4]||(a[4]=e=>r.formSubmit("valiForm"))},"立即登录")]),e.createVNode(h,{ref:"message",type:"message"},{default:e.withCtx((()=>[e.createVNode(d,{type:"error",message:i.messageText,duration:2e3},null,8,["message"])])),_:1},512)])}],["__scopeId","data-v-5016fb04"]]);const Mo=d({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"})}]]),Fo={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(_t){this.errorMessage=_t}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(_t){this.errorMessage=_t}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(_t){this.errorMessage=_t}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=oo.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 Ro={name:"UniDataPicker",emits:["popupopened","popupclosed","nodeclick","input","change","update:modelValue","inputclick"],mixins:[Fo],components:{DataPickerView:d({name:"UniDataPickerView",emits:["nodeclick","change","datachange","update:modelValue"],mixins:[Fo],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,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-load-more"),lo);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 Uo=d(Ro,[["render",function(t,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-load-more"),lo),c=n(e.resolveDynamicComponent("uni-icons"),y),u=e.resolveComponent("data-picker-view");return e.openBlock(),e.createElementBlock("view",{class:"uni-data-tree"},[e.createElementVNode("view",{class:"uni-data-tree-input",onClick:a[1]||(a[1]=(...e)=>r.handleInput&&r.handleInput(...e))},[e.renderSlot(t.$slots,"default",{options: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:a[0]||(a[0]=e.withModifiers(((...e)=>r.clear&&r.clear(...e)),["stop"]))},[e.createVNode(c,{type:"clear",color:"#c0c4cc",size:"24"})])):e.createCommentVNode("",!0),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:a[2]||(a[2]=(...e)=>r.handleClose&&r.handleClose(...e))})):e.createCommentVNode("",!0),i.isOpened?(e.openBlock(),e.createElementBlock("view",{key:1,class:"uni-data-tree-dialog"},[e.createElementVNode("view",{class:"uni-popper__arrow"}),e.createElementVNode("view",{class:"dialog-caption"},[e.createElementVNode("view",{class:"title-area"},[e.createElementVNode("text",{class:"dialog-title"},e.toDisplayString(o.popupTitle),1)]),e.createElementVNode("view",{class:"dialog-close",onClick:a[3]||(a[3]=(...e)=>r.handleClose&&r.handleClose(...e))},[e.createElementVNode("view",{class:"dialog-close-plus","data-id":"close"}),e.createElementVNode("view",{class:"dialog-close-plus dialog-close-rotate","data-id":"close"})])]),e.createVNode(u,{class:"picker-view",ref:"pickerView",modelValue:t.dataValue,"onUpdate:modelValue":a[4]||(a[4]=e=>t.dataValue=e),localdata:t.localdata,preload:t.preload,collection:t.collection,field:t.field,orderby:t.orderby,where:t.where,"step-searh":t.stepSearh,"self-field":t.selfField,"parent-field":t.parentField,"managed-mode":!0,map:t.map,ellipsis: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"]]),$o=e.defineComponent({__name:"index",setup(t){const o=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref(!1),g=e.ref(!1),f=e.ref([]),v=e.ref(),b=e.ref(),w=e.ref();let C;const x=e.ref({orderNum:"",weight:"",batchNum:"",palletNum:""}),S=e.reactive({orderNum:{rules:[{required:!0,errorMessage:"单号不能为空"}]}}),N=e.reactive({batch:[],pallet:[]}),P=()=>{},E=()=>{},T=()=>{},V=()=>{},D=async()=>{1===await(async()=>{let e=fo.isIOS?await fo.requestIOS("camera"):await fo.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&fo.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{x.value.orderNum=e.result},fail:e=>{}})},B=()=>{d.value=!1,x.value.orderNum="",x.value.weight=""},I=()=>{x.value.batchNum?p.value=!0:(b.value="error",w.value="请选择批次号",v.value.open())},L=e.computed((()=>{const e=N.batch.find((e=>e.value===x.value.batchNum));return null==e?void 0:e.text})),A=()=>{x.value.palletNum?g.value=!0:(b.value="error",w.value="请选择托盘号",v.value.open())},M=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,x.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:o.value},data:{order_no:x.value.orderNum,batch_number:x.value.batchNum,pallet_number:x.value.palletNum?U(N.pallet,x.value.palletNum):""},success:e=>{d.value=!1,1==e.data.code?(b.value="success",w.value=e.data.msg,v.value.open(),uni.setStorageSync("waybills",e.data.data.waybills),uni.navigateTo({url:"/pages/scanLotno/waybillsList"})):(b.value="error",w.value=e.data.msg,v.value.open())}})},U=(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=U(n.children,t);if(null!==e)return e}}return null},$=()=>{C&&clearTimeout(C),d.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.scanOrder/bindShipping",method:"POST",header:{batoken:o.value},data:{order_no:x.value.orderNum,reweighting:x.value.weight,batch_number:x.value.batchNum,pallet_number:x.value.palletNum?U(N.pallet,x.value.palletNum):""},success:e=>{if(d.value=!1,1==e.data.code){b.value="success",w.value=e.data.msg,v.value.open(),e.data.data.labels&&e.data.data.labels.length>0&&a("log","at pages/scanLotno/index.vue:278","有打印面单");const t={orderNum:x.value.orderNum,createTime:new Date,type:x.value.batchNum?"绑定批次":"绑定托盘",status:!0};a("log","at pages/scanLotno/index.vue:290","lotnoLogHistory--",f),f.value.unshift(t),uni.setStorageSync("lotnoLogHistory",f.value),z()}else{b.value="error",w.value=e.data.msg,v.value.open();const t={orderNum:x.value.orderNum,createTime:new Date,type:x.value.batchNum?"绑定批次":"绑定托盘",status:!1};f.value.unshift(t),uni.setStorageSync("lotnoLogHistory",f.value),z()}C=setTimeout((()=>{B(),H(),C&&clearTimeout(C)}),1e3)}})},z=()=>{f.value=uni.getStorageSync("lotnoLogHistory")||[]},j=e=>{a("log","at pages/scanLotno/index.vue:321",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&$()};r((()=>{plus.key.addEventListener("keyup",j)})),l((()=>{plus.key.removeEventListener("keyup",j)})),i((()=>{h.value=!0,plus.key.removeEventListener("keyup",j)})),c((()=>{plus.key.removeEventListener("keyup",j)})),s((()=>{h.value=!1,o.value=uni.getStorageSync("token"),K(),z()}));const H=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},K=()=>{uni.request({url:_o,method:"GET",header:{batoken:o.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){a("log","at pages/scanLotno/index.vue:411","fail--",e)}})};return u((e=>{0===e.index&&uni.navigateTo({url:"/pages/scanLotno/lotnoLog"})})),(t,a)=>{const o=n(e.resolveDynamicComponent("uni-easyinput"),_),s=n(e.resolveDynamicComponent("uni-forms-item"),k),i=n(e.resolveDynamicComponent("uni-data-select"),Eo),r=n(e.resolveDynamicComponent("uni-data-picker"),Uo),l=n(e.resolveDynamicComponent("uni-forms"),O),c=n(e.resolveDynamicComponent("uni-icons"),y),u=n(e.resolveDynamicComponent("uni-popup-message"),F),h=n(e.resolveDynamicComponent("uni-popup"),q);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(l,{ref:"valiForm","label-align":"right","label-width":80,rules:S,modelValue:x.value},{default:e.withCtx((()=>[e.createVNode(s,{label:"运单号码",required:"",name:"orderNum"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:x.value.orderNum,"onUpdate:modelValue":a[0]||(a[0]=e=>x.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:x.value.weight,"onUpdate:modelValue":a[1]||(a[1]=e=>x.value.weight=e),placeholder:"请输入复称重量",oninput:"value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"},{right:e.withCtx((()=>[e.createElementVNode("view",{class:"weight-right"},"KG")])),_:1},8,["modelValue"])])),_:1}),e.createVNode(s,{label:"绑定批次号",name:"batchNum",class:"select-item"},{default:e.withCtx((()=>[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:0,modelValue:x.value.batchNum,"onUpdate:modelValue":a[2]||(a[2]=e=>x.value.batchNum=e),placeholder:"请选择批次号",localdata:N.batch,clear:!1},null,8,["modelValue","localdata"])),p.value?(e.openBlock(),e.createBlock(o,{key:1,value:L.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:I},"确认")),p.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"primary",onClick:a[3]||(a[3]=e=>p.value=!1)},"修改")):e.createCommentVNode("",!0)])),_:1}),e.createVNode(s,{label:"绑定托盘号",name:"palletNum",class:"select-item"},{default:e.withCtx((()=>[g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r,{key:0,placeholder:"请选择托盘号","popup-title":"绑定托盘号",localdata:N.pallet,modelValue:x.value.palletNum,"onUpdate:modelValue":a[4]||(a[4]=e=>x.value.palletNum=e),onChange:V,onNodeclick:P,onPopupopened:E,onPopupclosed:T},null,8,["localdata","modelValue"])),g.value?(e.openBlock(),e.createBlock(o,{key:1,value:M.value,disabled:g.value},null,8,["value","disabled"])):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"primary",onClick:A},"确认")),g.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"primary",onClick:a[5]||(a[5]=e=>g.value=!1)},"修改")):e.createCommentVNode("",!0)])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:B},"重置"),e.createElementVNode("button",{type:"default",onClick: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:$,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"])]),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("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:v,type:"message"},{default:e.withCtx((()=>[e.createVNode(u,{type:b.value,message:w.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),zo=d(e.defineComponent({__name:"lotnoLog",setup(t){const a=e.ref([]);return r((()=>{a.value=uni.getStorageSync("lotnoLogHistory")})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-icons"),y);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-cdf76154"]]);const jo=d({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"]]),qo=d(e.defineComponent({__name:"waybillsList",setup(t){const a=e.ref([]);return r((()=>{a.value=uni.getStorageSync("waybills")})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-section"),jo);return e.openBlock(),e.createElementBlock("view",{class:"history"},[e.createVNode(s,{title:"数量: "+a.value.length},null,8,["title"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,((t,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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无运单")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-2aaa63ed"]]),Ho=e.defineComponent({__name:"index",setup(t){const o=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!0),p=e.ref([]),g=e.ref(),f=e.ref(),v=e.ref();let b;const w=e.ref({order_code:""}),C=e.reactive({order_code:{rules:[{required:!0,errorMessage:"单据编号不能为空"}]}}),x=async()=>{1===await(async()=>{let e=fo.isIOS?await fo.requestIOS("camera"):await fo.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&fo.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{w.value.order_code=e.result,P()},fail:e=>{}})},S=()=>{d.value=!1,w.value.order_code=""},N=()=>{h.value||(m.value=!1,e.nextTick((()=>{m.value=!0})))},P=()=>{b&&clearTimeout(b),d.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/order.sheetOrder/warehouseScan",method:"POST",header:{batoken:o.value},data:{order_code:w.value.order_code},success:e=>{if(d.value=!1,1==e.data.code){f.value="success",v.value=e.data.msg,g.value.open();const t={order_code:w.value.order_code,createTime:new Date,type:"单据扫描",status:!0};p.value.unshift(t),uni.setStorageSync("warehouseLogHistory",p.value),E()}else{f.value="error",v.value=e.data.msg,g.value.open();const t={order_code:w.value.order_code,createTime:new Date,type:"单据扫描",status:!1};p.value.unshift(t),uni.setStorageSync("warehouseLogHistory",p.value),E()}b=setTimeout((()=>{S(),b&&clearTimeout(b)}),1e3)}})},E=()=>{p.value=uni.getStorageSync("warehouseLogHistory")||[]},T=e=>{a("log","at pages/warehouseScan/index.vue:179",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&P()};return r((()=>{plus.key.addEventListener("keyup",T)})),l((()=>{plus.key.removeEventListener("keyup",T)})),i((()=>{h.value=!0,plus.key.removeEventListener("keyup",T)})),c((()=>{plus.key.removeEventListener("keyup",T)})),s((()=>{o.value=uni.getStorageSync("token"),h.value=!1,E()})),u((e=>{0===e.index&&uni.navigateTo({url:"/pages/warehouseScan/warehouseLog"})})),(t,a)=>{const o=n(e.resolveDynamicComponent("uni-easyinput"),_),s=n(e.resolveDynamicComponent("uni-forms-item"),k),i=n(e.resolveDynamicComponent("uni-forms"),O),r=n(e.resolveDynamicComponent("uni-icons"),y),l=n(e.resolveDynamicComponent("uni-popup-message"),F),c=n(e.resolveDynamicComponent("uni-popup"),q);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(i,{ref:"valiForm","label-align":"right","label-width":80,rules:C,modelValue:w.value},{default:e.withCtx((()=>[e.createVNode(s,{label:"单据编号",required:"",name:"order_code"},{default:e.withCtx((()=>[e.createVNode(o,{modelValue:w.value.order_code,"onUpdate:modelValue":a[0]||(a[0]=e=>w.value.order_code=e),placeholder:"请输入单据编号",suffixIcon:"scan",focus:m.value,onIconClick:x,onBlur:N,onConfirm:P},null,8,["modelValue","focus"])])),_:1})])),_:1},8,["rules","modelValue"]),e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{type:"info",onClick:S},"重置"),e.createElementVNode("button",{type:"primary",onClick:P,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:g,type:"message"},{default:e.withCtx((()=>[e.createVNode(l,{type:f.value,message:v.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),Ko=d(Ho,[["__scopeId","data-v-de7cb1d5"]]),Wo=d(e.defineComponent({__name:"warehouseLog",setup(t){const a=e.ref([]);return r((()=>{a.value=uni.getStorageSync("warehouseLogHistory")})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-icons"),y);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-14053095"]]),Jo=e.defineComponent({__name:"index",setup(t){const o=e.ref(),d=e.ref(!1),h=e.ref(!1),m=e.ref(!1),p=e.ref(!0),g=e.ref([]),f=e.ref(),v=e.ref(),k=e.ref();let b;const w=e.ref({code:"",space_id:""}),C=e.reactive({code:{rules:[{required:!0,errorMessage:"单号不能为空"}]}}),x=e.reactive({space:[]}),S=async()=>{1===await(async()=>{let e=fo.isIOS?await fo.requestIOS("camera"):await fo.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&fo.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{w.value.code=e.result},fail:e=>{}})},N=()=>{h.value=!1,w.value.code=""},P=()=>{w.value.space_id?(d.value=!0,I()):(v.value="error",k.value="请选择库位",f.value.open())},E=e.computed((()=>{const e=x.space.find((e=>e.value===w.value.space_id));return null==e?void 0:e.text})),T=()=>{w.value.space_id&&w.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:o.value},data:{code:w.value.code,space_id:w.value.space_id},success:e=>{h.value=!1;const t=x.space.find((e=>e.value===w.value.space_id));if(1==e.data.code){v.value="success",k.value=e.data.msg,f.value.open();const a={code:w.value.code,createTime:new Date,type:"运单号",space:t.text,status:!0};g.value.unshift(a),uni.setStorageSync("waybillNoHistory",g.value),V()}else{v.value="error",k.value=e.data.msg,f.value.open();const a={code:w.value.code,createTime:new Date,type:"运单号",space:t.text,status:!1};g.value.unshift(a),uni.setStorageSync("waybillNoHistory",g.value),V()}b=setTimeout((()=>{N(),I(),b&&clearTimeout(b)}),1e3)}})):(w.value.space_id||(v.value="error",k.value="请选择库位",f.value.open()),w.value.code||(v.value="error",k.value="请填写运单号",f.value.open()))},V=()=>{g.value=uni.getStorageSync("waybillNoHistory")||[]},D=e=>{a("log","at pages/waybillNo/index.vue:240",e,"按键码"),102===e.keyCode||103===e.keyCode||e.keyCode,66==e.keyCode&&T()};r((()=>{plus.key.addEventListener("keyup",D)})),l((()=>{plus.key.removeEventListener("keyup",D)})),i((()=>{m.value=!0,plus.key.removeEventListener("keyup",D)})),c((()=>{plus.key.removeEventListener("keyup",D)})),s((()=>{m.value=!1,o.value=uni.getStorageSync("token"),B(),V()}));const B=()=>{uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/warehouse.waybillNo/getOptions",method:"GET",header:{batoken:o.value},success:e=>{if(a("log","at pages/waybillNo/index.vue:300",e),1===e.data.code)for(let t in e.data.data.space_id)e.data.data.space_id.hasOwnProperty(t)&&x.space.push({text:e.data.data.space_id[t],value:t})},fail(e){a("log","at pages/waybillNo/index.vue:310","fail--",e)}})},I=()=>{m.value||(p.value=!1,e.nextTick((()=>{p.value=!0})))};return u((e=>{0===e.index&&uni.navigateTo({url:"/pages/waybillNo/waybillNoLog"})})),(t,a)=>{const o=n(e.resolveDynamicComponent("uni-data-select"),Eo),s=n(e.resolveDynamicComponent("uni-easyinput"),_),i=n(e.resolveDynamicComponent("uni-forms"),O),r=n(e.resolveDynamicComponent("uni-icons"),y),l=n(e.resolveDynamicComponent("uni-popup-message"),F),c=n(e.resolveDynamicComponent("uni-popup"),q);return e.openBlock(),e.createElementBlock("view",{class:"container"},[e.createVNode(i,{ref:"valiForm","label-align":"right","label-width":80,rules:C,modelValue:w.value},{default:e.withCtx((()=>[e.createElementVNode("view",{class:"space-select"},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(o,{key:0,modelValue:w.value.space_id,"onUpdate:modelValue":a[0]||(a[0]=e=>w.value.space_id=e),placeholder:"请选择库位",localdata:x.space,clear:!1},null,8,["modelValue","localdata"])),d.value?(e.openBlock(),e.createBlock(s,{key:1,value:E.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:P},"确认")),d.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"primary",onClick:a[1]||(a[1]=e=>d.value=!1)},"修改")):e.createCommentVNode("",!0)]),e.createElementVNode("view",null,[e.createVNode(s,{modelValue:w.value.code,"onUpdate:modelValue":a[2]||(a[2]=e=>w.value.code=e),placeholder:"请输入运单号",suffixIcon:"scan",focus:p.value,onIconClick:S},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"])]),g.value.length>0?(e.openBlock(),e.createElementBlock("view",{key:0,class:"history"},[e.createElementVNode("text",{class:"title"},"记录(最近5条)")])):e.createCommentVNode("",!0),e.createElementVNode("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.slice(0,5),((t,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:f,type:"message"},{default:e.withCtx((()=>[e.createVNode(l,{type:v.value,message:k.value,duration:2e3},null,8,["type","message"])])),_:1},512)])}}}),Go=d(e.defineComponent({__name:"waybillNoLog",setup(t){const a=e.ref([]);return r((async()=>{await(async()=>{a.value=await uni.getStorageSync("waybillNoHistory")})()})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-icons"),y);return e.openBlock(),e.createElementBlock("view",{class:"history"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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===a.value.length?(e.openBlock(),e.createElementBlock("view",{key:0,class:"is-empty"},"暂无历史")):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-bf1fa5d7"]]);const Yo=d({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"]]),Qo="/static/copy.png",Zo=d(e.defineComponent({__name:"index",setup(t){const o=e.ref(!1),s=e.ref(!1),i=e.ref(),l=e.ref(),c=e.ref([]),d=e.ref(),h=e.ref(),m=e.ref(),p=e.ref(),g=()=>{},f=()=>{p.value.close()},y=e=>{uni.setClipboardData({data:e,success:function(){uni.showToast({title:"复制成功",icon:"success",duration:2e3})},fail:function(){a("log","at pages/waybillDeliveryOrder/index.vue:85","复制失败")}})},v=async()=>{1===await(async()=>{let e=fo.isIOS?await fo.requestIOS("camera"):await fo.requestAndroid("android.permission.CAMERA");return null===e||1===e?e=1:uni.showModal({content:"Camera permission required",confirmText:"Setting",success:function(e){e.confirm&&fo.gotoAppSetting()}}),e})()&&uni.scanCode({success:e=>{},fail:e=>{}})},k=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/sendOut",method:"POST",header:{batoken:i.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:i.value},data:e,success:({data:e})=>{s.value=!1,d.value="success",h.value="确认送达成功",m.value.open()},fail:e=>{s.value=!1,d.value="error",h.value="确认送达失败,请稍后重试",m.value.open()}})},w=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/refuse",method:"POST",header:{batoken:i.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()}})},C=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/createTrackPod",method:"POST",header:{batoken:i.value},data:e,success:({data:e})=>{s.value=!1,d.value="success",h.value="同步成功",m.value.open()},fail:e=>{s.value=!1,d.value="error",h.value="同步失败,请稍后重试",m.value.open()}})},x=e=>{s.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/cancelFedExPickUp",method:"POST",header:{batoken:i.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 r((()=>{i.value=uni.getStorageSync("token"),o.value=!0,uni.request({url:"http://dsg.tms.api.aibasil.cn/admin/pickup.waybillDeliveryOrder/index",method:"GET",header:{batoken:i.value},success:({data:e})=>{o.value=!1,a("log","at pages/waybillDeliveryOrder/index.vue:319",e),1==e.code?c.value=e.data.list:(d.value="error",h.value=e.msg,m.value.open())},fail:e=>{o.value=!1}})})),u((e=>{0===e.index&&p.value.open()})),(t,o)=>{const s=n(e.resolveDynamicComponent("uni-easyinput"),_),i=n(e.resolveDynamicComponent("uni-popup-message"),F),r=n(e.resolveDynamicComponent("uni-popup"),q),u=n(e.resolveDynamicComponent("uni-drawer"),Yo);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:v},null,8,["modelValue"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,((t,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})})(t)},[e.createElementVNode("view",{class:"order-no"},[e.createElementVNode("text",null," 派送单号: "+e.toDisplayString(t.order_no),1),e.createElementVNode("image",{onClick:e=>y(t.order_no),class:"icon",src:Qo,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(t.address.first_name+" "+t.address.last_name)+" "+e.toDisplayString("+"+t.address.mobile_code+" "+t.address.mobile),1),e.createElementVNode("image",{onClick:e=>{return a("log","at pages/waybillDeliveryOrder/index.vue:91",n=t.address.mobile_code+" "+t.address.mobile),void uni.makePhoneCall({phoneNumber:n,success:function(){a("log","at pages/waybillDeliveryOrder/index.vue:96","拨打电话成功!")},fail:function(){a("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(t.address.city),1),e.createTextVNode(" "+e.toDisplayString(t.address.zip_code),1)]),e.createElementVNode("image",{onClick:e=>y(t.address.zip_code),class:"icon",src:Qo,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(t.operations,((a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e=>(async(e,t)=>{"send_out"===t?k({id:e.id}):"delivered"===t?b({id:e.id}):"refuse"===t?w({id:e.id}):"create_track_pod"===t?C({id:e.id}):"edit"===t||"generate_label"===t||"fedex_appointment_pick_up"===t||"print_get_back_label"===t||"fedex_cancel_pick_up"===t&&x({id:e.id})})(t,a.value),type:"info",size:"mini"},e.toDisplayString(a.text),9,["onClick"])))),128))])],8,["onClick"])))),128)),0===c.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(u,{ref_key:"showRightRef",ref:p,mode:"right","mask-click":!0},{default:e.withCtx((()=>[e.createElementVNode("scroll-view",{style:{height:"100%"},"scroll-y":"true"},[e.createElementVNode("view",{class:"button-group"},[e.createElementVNode("button",{onClick:g,type:"info"},"重置"),e.createElementVNode("button",{onClick:f,type:"primary"},"确认")])])])),_:1},512)])}}}),[["__scopeId","data-v-76324b89"]]);const Xo=d({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 es=d({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 ts(e,t=2){for(e+="";e.length<t;)e="0"+e;return e.slice(-t)}const as={yyyy:e=>ts(e.year,4),yy:e=>ts(e.year),MM:e=>ts(e.month),M:e=>e.month,dd:e=>ts(e.day),d:e=>e.day,hh:e=>ts(e.hour),h:e=>e.hour,mm:e=>ts(e.minute),m:e=>e.minute,ss:e=>ts(e.second),s:e=>e.second,SSS:e=>ts(e.millisecond,3),S:e=>e.millisecond};function ns(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 os(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=ns(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=ns(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,as[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),g=Math.floor(p/24),f=Math.floor(g/30),y=Math.floor(f/12);switch(!0){case y>0:i=y,r=s.year;break;case f>0:i=f,r=s.month;break;case g>0:i=g,r=s.day;break;case p>0:i=p,r=s.hour;break;case m>0:i=m,r=s.minute;break;default:i=h,r=s.second}return"en"===t&&(1===i?i="a":r+="s"),s.template.replace(/{\s*num\s*}/g,i+"").replace(/{\s*unit\s*}/g,r).replace(/{\s*suffix\s*}/g,d)}const ss=d({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,os(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)}]]),is=e.defineComponent({__name:"orderInfo",setup(t){const o=e.ref(0),s=e.ref(["基本信息","运单详情"]);e.ref(!1);const i=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:"第三方物流"});r((e=>{i.value=uni.getStorageSync("token"),d.value=uni.getStorageSync("selectItem"),h.value=uni.getStorageSync("deliveryOrderOptions"),a("log","at pages/waybillDeliveryOrder/orderInfo.vue:128",d.value)}));const p=e=>{o.value!=e.currentIndex&&(o.value=e.currentIndex)};return(t,i)=>{const r=n(e.resolveDynamicComponent("uni-segmented-control"),Xo),g=n(e.resolveDynamicComponent("uni-tag"),es),f=n(e.resolveDynamicComponent("uni-dateformat"),ss),y=n(e.resolveDynamicComponent("uni-popup-message"),F),v=n(e.resolveDynamicComponent("uni-popup"),q);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 t=d.value.order_no,void uni.setClipboardData({data:t,success:function(){uni.showToast({title:"复制成功",icon:"success",duration:2e3})},fail:function(){a("log","at pages/waybillDeliveryOrder/orderInfo.vue:149","复制失败")}});var t}),class:"icon",src:Qo,mode:"aspectFill"})]),e.createVNode(g,{text:d.value.status_text,type:"primary",circle:""},null,8,["text"])]),e.createElementVNode("view",{class:"box-card"},[e.createElementVNode("view",{class:"label-icon"},[e.createElementVNode("text",{class:"label-title"},"地址信息")]),e.createElementVNode("view",{class:"label-content"},[e.createElementVNode("text",null,e.toDisplayString(d.value.address.first_name+" "+d.value.address.last_name),1),d.value.address.mobile?(e.openBlock(),e.createElementBlock("text",{key:0},[e.createTextVNode(" +"+e.toDisplayString(d.value.address.mobile_code+" "+d.value.address.mobile)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),d.value.address.email?(e.openBlock(),e.createElementBlock("text",{key:1},[e.createTextVNode(e.toDisplayString(d.value.address.email)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.address_line_1)+" ",1),e.createElementVNode("br")]),d.value.address.address_line_2?(e.openBlock(),e.createElementBlock("text",{key:2},[e.createTextVNode(e.toDisplayString(d.value.address.address_line_2)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),d.value.address.address_line_3?(e.openBlock(),e.createElementBlock("text",{key:3},[e.createTextVNode(e.toDisplayString(d.value.address.address_line_3)+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.city+" "+d.value.address.district)+" ",1),e.createElementVNode("br")]),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.province)+" ",1),e.createElementVNode("br")]),e.createElementVNode("text",null,[e.createTextVNode(e.toDisplayString(d.value.address.zip_code)+" ",1),e.createElementVNode("br")])])]),e.createElementVNode("view",{class:"box-card"},[e.createElementVNode("text",null,[e.createTextVNode("客户派送日期: "),d.value.delivery_date?(e.openBlock(),e.createBlock(f,{key:0,date:d.value.delivery_date,format:"yyyy-MM-dd"},null,8,["date"])):(e.openBlock(),e.createElementBlock("text",{key:1},"无")),e.createElementVNode("br")]),e.createElementVNode("text",null,"备注: "+e.toDisplayString(d.value.remark||"无"),1)]),e.createElementVNode("view",{class:"box-card"},[e.createElementVNode("view",{class:"label-icon"},[e.createElementVNode("text",{class:"label-title"},"物流信息")]),e.createElementVNode("view",{class:"label-content"},[e.createElementVNode("text",null,[e.createTextVNode("派送渠道类型: "),e.createVNode(g,{text:m.value[d.value.delivery_type],type:"primary"},null,8,["text"]),e.createElementVNode("br")]),1===Number(d.value.delivery_type)?(e.openBlock(),e.createElementBlock("text",{key:0},[e.createTextVNode("司机: "+e.toDisplayString(h.value.driver_id[d.value.driver_id]||"无")+" ",1),e.createElementVNode("br")])):e.createCommentVNode("",!0),2===Number(d.value.delivery_type)?(e.openBlock(),e.createElementBlock("text",{key:1},[e.createTextVNode("快递公司: "),e.createVNode(g,{text:d.value.express.name||"无",type:"success",size:"small",circle:""},null,8,["text"]),e.createElementVNode("br")])):e.createCommentVNode("",!0),e.createElementVNode("text",null,[e.createTextVNode("物流单号: "+e.toDisplayString(d.value.express_no||"无")+" ",1),e.createElementVNode("br")]),e.createElementVNode("text",null,"追踪单号: "+e.toDisplayString(d.value.express_tracking_number||"无"),1)])])],512),[[e.vShow,0===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)])}}}),rs=d(is,[["__scopeId","data-v-7d603f2a"]]),ls=t("modal");var cs=t("AutoReplyPrintUniModule"),us=0,ds=!1,hs=!1,ms="rbBT2";const ps=d({data:()=>({udsBT2Value:0,udsBT2Range:[],udsNETValue:0,udsNETRange:[],udsUSBValue:0,udsUSBRange:[],udsCOMValue:0,udsCOMRange:[],udsCOMBaudrateValue:9600,udsCOMBaudrateRange:[{text:"9600",value:9600},{text:"19200",value:19200},{text:"38400",value:38400},{text:"57600",value:57600},{text:"115200",value:115200},{text:"230400",value:230400},{text:"256000",value:256e3},{text:"500000",value:5e5}],udsCOMFlowControlValue:0,udsCOMFlowControlRange:[{text:"NoFlowControl",value:0},{text:"Hardware",value:2}],btnOpenPortDisabled:!1,btnClosePortDisabled:!0}),onLoad(){uni.setNavigationBarTitle({title:"SampleLabel "+cs.CP_Library_Version()})},onReady(){},methods:{radioChange:function(e){ms=e.detail.value},enumPort(){var e=new Array,t=cs.CP_Port_EnumCom();if(null!=t)for(var n=0;n<t.length;n++){a("log","at pages/printer/label.vue:173",i={text:t[n],value:n}),e.push(i)}this.udsCOMRange=e;var o=new Array,s=cs.CP_Port_EnumUsb();if(null!=s)for(n=0;n<s.length;n++){var i;a("log","at pages/printer/label.vue:187",i={text:s[n],value:n}),o.push(i)}this.udsUSBRange=o,ds||(ds=!0,a("log","at pages/printer/label.vue:195","isEnumeratingBT2"),cs.CP_Port_EnumBtDevice(12e3,(e=>{for(var t=e.device_address+"("+e.device_name+")",n=0;n<this.udsBT2Range.length;n++)if(this.udsBT2Range[n].text==t)return;var o={text:t,value:this.udsBT2Range.length};a("log","at pages/printer/label.vue:210",o),this.udsBT2Range.push(o)}),(e=>{ds=!1,a("log","at pages/printer/label.vue:215","finishedEnumeratingBT2")}))),hs||(hs=!0,a("log","at pages/printer/label.vue:222","isEnumeratingNET"),cs.CP_Port_EnumNetPrinter(12e3,(e=>{for(var t=e.discovered_ip+"("+e.discovered_name+")",n=0;n<this.udsNETRange.length;n++)if(this.udsNETRange[n].text==t)return;var o={text:t,value:this.udsNETRange.length};a("log","at pages/printer/label.vue:237",o),this.udsNETRange.push(o)}),(e=>{hs=!1,a("log","at pages/printer/label.vue:242","finishedEnumeratingNET")})))},openPort(){if(0==us){if("rbBT2"==ms){var e=(t=this.udsBT2Range[this.udsBT2Value].text).substring(0,t.indexOf("("));ls.toast({message:"Connecting: "+e+" ......",duration:1.5}),a("log","at pages/printer/label.vue:257","Connecting: "+e+" ......"),a("log","at pages/printer/label.vue:259","hPrinter: "+(us=cs.CP_Port_OpenBtSpp(e,1)))}else if("rbNET"==ms){var t,n=(t=this.udsNETRange[this.udsNETValue].text).substring(0,t.indexOf("("));ls.toast({message:"Connecting: "+n+" ......",duration:1.5}),a("log","at pages/printer/label.vue:267","Connecting: "+n+" ......"),a("log","at pages/printer/label.vue:269","hPrinter: "+(us=cs.CP_Port_OpenTcp(null,n,9100,5e3,1)))}else if("rbUSB"==ms){var o=this.udsUSBRange[this.udsUSBValue].text;ls.toast({message:"Connecting: "+o+" ......",duration:1.5}),a("log","at pages/printer/label.vue:276","Connecting: "+o+" ......"),a("log","at pages/printer/label.vue:278","hPrinter: "+(us=cs.CP_Port_OpenUsb(o,1)))}else if("rbCOM"==ms){var s=this.udsCOMRange[this.udsCOMValue].text,i=this.udsCOMBaudrateValue,r=this.udsCOMFlowControlValue;ls.toast({message:"Connecting: "+s+","+i+","+r+" ......",duration:1.5}),a("log","at pages/printer/label.vue:288","Connecting: "+s+","+i+","+r+"......"),a("log","at pages/printer/label.vue:291","hPrinter: "+(us=cs.CP_Port_OpenCom(s,i,8,0,0,r,1)))}ls.toast({message:0!=us?"Connected":"Failed",duration:1.5})}this.btnOpenPortDisabled=0!=us,this.btnClosePortDisabled=0==us},closePort(){0!=us&&(cs.CP_Port_Close(us),us=0),this.btnOpenPortDisabled=0!=us,this.btnClosePortDisabled=0==us},Test_Label_SampleTicket_58MM_1(){cs.CP_Pos_SetMultiByteMode(us),cs.CP_Pos_SetMultiByteEncoding(us,1),cs.CP_Label_PageBegin(us,0,0,384,240,0),cs.CP_Label_DrawText(us,10,10,24,0,"型号:P58A+"),cs.CP_Label_DrawText(us,10,40,24,0,"MFG :00"),cs.CP_Label_DrawBarcode(us,10,70,8,2,60,2,0,"No.123456"),cs.CP_Label_PagePrint(us,1);var e=cs.CP_Pos_QueryPrintResult(us,1e4);ls.toast({message:e?"Print Success":"Print Failed",duration:1.5})},Test_Label_SampleTicket_80MM_1(){cs.CP_Pos_SetMultiByteMode(us),cs.CP_Pos_SetMultiByteEncoding(us,1),cs.CP_Label_PageBegin(us,0,0,576,240,0),cs.CP_Label_DrawText(us,10,10,24,0,"型号:P80A+"),cs.CP_Label_DrawText(us,10,40,24,0,"MFG :00"),cs.CP_Label_DrawBarcode(us,10,70,8,2,60,4,0,"No.123456"),cs.CP_Label_PagePrint(us,1);var e=cs.CP_Pos_QueryPrintResult(us,1e4);ls.toast({message:e?"Print Success":"Print Failed",duration:1.5})},GetPrinterResolutionInfo(){var e=cs.CP_Printer_GetPrinterResolutionInfo(us);ls.toast({message:e,duration:1.5})},GetPrinterFirmwareVersion(){var e=cs.CP_Printer_GetPrinterFirmwareVersion(us);ls.toast({message:e,duration:1.5})},GetPrinterStatusInfo(){var e=cs.CP_Printer_GetPrinterStatusInfo(us),t=new Date(e.timestamp_ms),a=e.printer_error_status,n="";0!=a?(n+="ERROR_OCCURED\n",0!=(1&a)&&(n+="ERROR_CUTTER\n"),0!=(2&a)&&(n+="ERROR_FLASH\n"),0!=(4&a)&&(n+="ERROR_NOPAPER\n"),0!=(8&a)&&(n+="ERROR_VOLTAGE\n"),0!=(16&a)&&(n+="ERROR_MARKER\n"),0!=(32&a)&&(n+="ERROR_ENGINE\n"),0!=(64&a)&&(n+="ERROR_OVERHEAT\n"),0!=(128&a)&&(n+="ERROR_COVERUP\n"),0!=(256&a)&&(n+="ERROR_MOTOR\n")):n+="Status OK\n",ls.toast({message:t+"\n"+n,duration:1.5})},CP_Pos_KickOutDrawer(){var e=cs.CP_Pos_KickOutDrawer(us,0,100,100);ls.toast({message:e,duration:1.5})},CP_Pos_Beep(){var e=cs.CP_Pos_Beep(us,3,500);ls.toast({message:e,duration:1.5})},CP_Pos_PrintSelfTestPage(){var e=cs.CP_Pos_PrintSelfTestPage(us);ls.toast({message:e,duration:1.5})},CP_Pos_ResetPrinter(){var e=cs.CP_Pos_ResetPrinter(us);ls.toast({message:e,duration:1.5})},CP_Pos_SetPrintSpeed_100(){var e=cs.CP_Pos_SetPrintSpeed(us,100);cs.CP_Pos_PrintSelfTestPage(us),ls.toast({message:e,duration:1.5})},CP_Pos_SetPrintSpeed_150(){var e=cs.CP_Pos_SetPrintSpeed(us,150);cs.CP_Pos_PrintSelfTestPage(us),ls.toast({message:e,duration:1.5})},CP_Pos_SetPrintDensity_7(){var e=cs.CP_Pos_SetPrintDensity(us,7);cs.CP_Pos_PrintSelfTestPage(us),ls.toast({message:e,duration:1.5})},CP_Pos_SetPrintDensity_15(){var e=cs.CP_Pos_SetPrintDensity(us,15);cs.CP_Pos_PrintSelfTestPage(us),ls.toast({message:e,duration:1.5})},CP_Label_EnableLabelMode(){var e=cs.CP_Label_EnableLabelMode(us);ls.toast({message:e,duration:1.5})},CP_Label_DisableLabelMode(){var e=cs.CP_Label_DisableLabelMode(us);ls.toast({message:e,duration:1.5})},CP_Label_CalibrateLabel(){var e=cs.CP_Label_CalibrateLabel(us);ls.toast({message:e,duration:1.5})},CP_Label_FeedLabel(){var e=cs.CP_Label_FeedLabel(us);ls.toast({message:e,duration:1.5})},CP_Label_PageBegin(){var e=cs.CP_Label_PageBegin(us,0,0,384,400,0);cs.CP_Label_DrawBox(us,0,0,383,399,1,1),cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_PagePrint(){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_PagePrint(us,1);ls.toast({message:e,duration:1.5})},CP_Label_DrawText(){cs.CP_Pos_SetMultiByteMode(us),cs.CP_Pos_SetMultiByteEncoding(us,1),cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawText(us,10,10,24,0,"$$$123哈哈哈");cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawTextInUTF8(){cs.CP_Pos_SetMultiByteMode(us),cs.CP_Pos_SetMultiByteEncoding(us,1),cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawTextInUTF8(us,10,10,24,0,"$$$123哈哈哈");cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawTextInGBK(){cs.CP_Pos_SetMultiByteMode(us),cs.CP_Pos_SetMultiByteEncoding(us,0),cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawTextInGBK(us,10,10,24,0,"$$$123哈哈哈");cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawBarcode(){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawBarcode(us,10,10,0,2,60,2,0,"01234567890");cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawQRCode(){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawQRCode(us,10,10,0,1,8,0,"Hello 你好");cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawPDF417Code(){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawPDF417Code(us,10,10,3,3,0,3,0,"Hello 你好");cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawImageFromFile(){uni.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album"],success:function(e){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var t=cs.CP_Label_DrawImageFromFile(us,0,0,384,0,e.tempFilePaths[0],2,0);cs.CP_Label_PagePrint(us,1),ls.toast({message:t,duration:1.5})}})},CP_Label_DrawImageFromPixels(){var e=100,t=new Uint8Array(4e4);for(let s=0;s<100;++s)for(let n=0;n<e;++n){var a=s*e*4+4*n;n==s?(t[a]=0,t[a+1]=0,t[a+2]=0,t[a+3]=255):(t[a]=255,t[a+1]=255,t[a+2]=255,t[a+3]=255)}var n=uni.arrayBufferToBase64(t);cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var o=cs.CP_Label_DrawImageFromPixels(us,0,0,n,e,100,400,7,2,0);cs.CP_Label_PagePrint(us,1),ls.toast({message:o,duration:1.5})},CP_Label_DrawLine(){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawLine(us,20,20,100,300,1,1);cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawRect(){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawRect(us,20,20,200,10,1);cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})},CP_Label_DrawBox(){cs.CP_Label_PageBegin(us,0,0,384,400,0),cs.CP_Label_DrawBox(us,0,0,383,399,1,1);var e=cs.CP_Label_DrawBox(us,30,30,300,200,1,1);cs.CP_Label_PagePrint(us,1),ls.toast({message:e,duration:1.5})}}},[["render",function(t,a,o,s,i,r){const l=n(e.resolveDynamicComponent("uni-data-select"),Eo);return e.openBlock(),e.createElementBlock("view",null,[e.createElementVNode("radio-group",{onChange:a[6]||(a[6]=(...e)=>r.radioChange&&r.radioChange(...e))},[e.createElementVNode("label",{class:"uni-list-cell uni-list-cell-pd"},[e.createElementVNode("label",{class:"radio"},[e.createElementVNode("radio",{value:"rbBT2",checked:"true"}),e.createTextVNode("BT2.0 ")]),e.createVNode(l,{modelValue:i.udsBT2Value,"onUpdate:modelValue":a[0]||(a[0]=e=>i.udsBT2Value=e),localdata:i.udsBT2Range},null,8,["modelValue","localdata"])]),e.createElementVNode("label",{class:"uni-list-cell uni-list-cell-pd"},[e.createElementVNode("label",{class:"radio"},[e.createElementVNode("radio",{value:"rbNET"}),e.createTextVNode("NET ")]),e.createVNode(l,{modelValue:i.udsNETValue,"onUpdate:modelValue":a[1]||(a[1]=e=>i.udsNETValue=e),localdata:i.udsNETRange},null,8,["modelValue","localdata"])]),e.createElementVNode("label",{class:"uni-list-cell uni-list-cell-pd"},[e.createElementVNode("label",{class:"radio"},[e.createElementVNode("radio",{value:"rbUSB"}),e.createTextVNode("USB ")]),e.createVNode(l,{modelValue:i.udsUSBValue,"onUpdate:modelValue":a[2]||(a[2]=e=>i.udsUSBValue=e),localdata:i.udsUSBRange},null,8,["modelValue","localdata"])]),e.createElementVNode("label",{class:"uni-list-cell uni-list-cell-pd"},[e.createElementVNode("label",{class:"radio"},[e.createElementVNode("radio",{value:"rbCOM"}),e.createTextVNode("COM ")]),e.createVNode(l,{modelValue:i.udsCOMValue,"onUpdate:modelValue":a[3]||(a[3]=e=>i.udsCOMValue=e),localdata:i.udsCOMRange},null,8,["modelValue","localdata"]),e.createVNode(l,{modelValue:i.udsCOMBaudrateValue,"onUpdate:modelValue":a[4]||(a[4]=e=>i.udsCOMBaudrateValue=e),localdata:i.udsCOMBaudrateRange},null,8,["modelValue","localdata"]),e.createVNode(l,{modelValue:i.udsCOMFlowControlValue,"onUpdate:modelValue":a[5]||(a[5]=e=>i.udsCOMFlowControlValue=e),localdata:i.udsCOMFlowControlRange},null,8,["modelValue","localdata"])])],32),e.createElementVNode("view",{class:"uni-flex uni-row"},[e.createElementVNode("button",{type:"default",onClick:a[7]||(a[7]=(...e)=>r.enumPort&&r.enumPort(...e))},"Enum Port"),e.createElementVNode("button",{type:"default",onClick:a[8]||(a[8]=(...e)=>r.openPort&&r.openPort(...e)),disabled:i.btnOpenPortDisabled},"Open Port",8,["disabled"]),e.createElementVNode("button",{type:"default",onClick:a[9]||(a[9]=(...e)=>r.closePort&&r.closePort(...e)),disabled:i.btnClosePortDisabled},"Close Port",8,["disabled"])]),e.createElementVNode("view",null,[e.createElementVNode("button",{type:"primary",onClick:a[10]||(a[10]=(...e)=>r.Test_Label_SampleTicket_58MM_1&&r.Test_Label_SampleTicket_58MM_1(...e))},"Test_Label_SampleTicket_58MM_1"),e.createElementVNode("button",{type:"primary",onClick:a[11]||(a[11]=(...e)=>r.Test_Label_SampleTicket_80MM_1&&r.Test_Label_SampleTicket_80MM_1(...e))},"Test_Label_SampleTicket_80MM_1"),e.createElementVNode("button",{type:"primary",onClick:a[12]||(a[12]=(...e)=>r.GetPrinterResolutionInfo&&r.GetPrinterResolutionInfo(...e))},"GetPrinterResolutionInfo"),e.createElementVNode("button",{type:"primary",onClick:a[13]||(a[13]=(...e)=>r.GetPrinterFirmwareVersion&&r.GetPrinterFirmwareVersion(...e))},"GetPrinterFirmwareVersion"),e.createElementVNode("button",{type:"primary",onClick:a[14]||(a[14]=(...e)=>r.GetPrinterStatusInfo&&r.GetPrinterStatusInfo(...e))},"GetPrinterStatusInfo"),e.createElementVNode("button",{type:"primary",onClick:a[15]||(a[15]=(...e)=>r.CP_Pos_KickOutDrawer&&r.CP_Pos_KickOutDrawer(...e))},"CP_Pos_KickOutDrawer"),e.createElementVNode("button",{type:"primary",onClick:a[16]||(a[16]=(...e)=>r.CP_Pos_Beep&&r.CP_Pos_Beep(...e))},"CP_Pos_Beep"),e.createElementVNode("button",{type:"primary",onClick:a[17]||(a[17]=(...e)=>r.CP_Pos_PrintSelfTestPage&&r.CP_Pos_PrintSelfTestPage(...e))},"CP_Pos_PrintSelfTestPage"),e.createElementVNode("button",{type:"primary",onClick:a[18]||(a[18]=(...e)=>r.CP_Pos_ResetPrinter&&r.CP_Pos_ResetPrinter(...e))},"CP_Pos_ResetPrinter"),e.createElementVNode("button",{type:"primary",onClick:a[19]||(a[19]=(...e)=>r.CP_Pos_SetPrintSpeed_100&&r.CP_Pos_SetPrintSpeed_100(...e))},"CP_Pos_SetPrintSpeed_100"),e.createElementVNode("button",{type:"primary",onClick:a[20]||(a[20]=(...e)=>r.CP_Pos_SetPrintSpeed_150&&r.CP_Pos_SetPrintSpeed_150(...e))},"CP_Pos_SetPrintSpeed_150"),e.createElementVNode("button",{type:"primary",onClick:a[21]||(a[21]=(...e)=>r.CP_Pos_SetPrintDensity_7&&r.CP_Pos_SetPrintDensity_7(...e))},"CP_Pos_SetPrintDensity_7"),e.createElementVNode("button",{type:"primary",onClick:a[22]||(a[22]=(...e)=>r.CP_Pos_SetPrintDensity_15&&r.CP_Pos_SetPrintDensity_15(...e))},"CP_Pos_SetPrintDensity_15"),e.createElementVNode("button",{type:"primary",onClick:a[23]||(a[23]=(...e)=>r.CP_Label_EnableLabelMode&&r.CP_Label_EnableLabelMode(...e))},"CP_Label_EnableLabelMode"),e.createElementVNode("button",{type:"primary",onClick:a[24]||(a[24]=(...e)=>r.CP_Label_DisableLabelMode&&r.CP_Label_DisableLabelMode(...e))},"CP_Label_DisableLabelMode"),e.createElementVNode("button",{type:"primary",onClick:a[25]||(a[25]=(...e)=>r.CP_Label_CalibrateLabel&&r.CP_Label_CalibrateLabel(...e))},"CP_Label_CalibrateLabel"),e.createElementVNode("button",{type:"primary",onClick:a[26]||(a[26]=(...e)=>r.CP_Label_FeedLabel&&r.CP_Label_FeedLabel(...e))},"CP_Label_FeedLabel"),e.createElementVNode("button",{type:"primary",onClick:a[27]||(a[27]=(...e)=>r.CP_Label_PageBegin&&r.CP_Label_PageBegin(...e))},"CP_Label_PageBegin"),e.createElementVNode("button",{type:"primary",onClick:a[28]||(a[28]=(...e)=>r.CP_Label_PagePrint&&r.CP_Label_PagePrint(...e))},"CP_Label_PagePrint"),e.createElementVNode("button",{type:"primary",onClick:a[29]||(a[29]=(...e)=>r.CP_Label_DrawText&&r.CP_Label_DrawText(...e))},"CP_Label_DrawText"),e.createElementVNode("button",{type:"primary",onClick:a[30]||(a[30]=(...e)=>r.CP_Label_DrawTextInUTF8&&r.CP_Label_DrawTextInUTF8(...e))},"CP_Label_DrawTextInUTF8"),e.createElementVNode("button",{type:"primary",onClick:a[31]||(a[31]=(...e)=>r.CP_Label_DrawTextInGBK&&r.CP_Label_DrawTextInGBK(...e))},"CP_Label_DrawTextInGBK"),e.createElementVNode("button",{type:"primary",onClick:a[32]||(a[32]=(...e)=>r.CP_Label_DrawBarcode&&r.CP_Label_DrawBarcode(...e))},"CP_Label_DrawBarcode"),e.createElementVNode("button",{type:"primary",onClick:a[33]||(a[33]=(...e)=>r.CP_Label_DrawQRCode&&r.CP_Label_DrawQRCode(...e))},"CP_Label_DrawQRCode"),e.createElementVNode("button",{type:"primary",onClick:a[34]||(a[34]=(...e)=>r.CP_Label_DrawPDF417Code&&r.CP_Label_DrawPDF417Code(...e))},"CP_Label_DrawPDF417Code"),e.createElementVNode("button",{type:"primary",onClick:a[35]||(a[35]=(...e)=>r.CP_Label_DrawImageFromFile&&r.CP_Label_DrawImageFromFile(...e))},"CP_Label_DrawImageFromFile"),e.createElementVNode("button",{type:"primary",onClick:a[36]||(a[36]=(...e)=>r.CP_Label_DrawImageFromPixels&&r.CP_Label_DrawImageFromPixels(...e))},"CP_Label_DrawImageFromPixels"),e.createElementVNode("button",{type:"primary",onClick:a[37]||(a[37]=(...e)=>r.CP_Label_DrawLine&&r.CP_Label_DrawLine(...e))},"CP_Label_DrawLine"),e.createElementVNode("button",{type:"primary",onClick:a[38]||(a[38]=(...e)=>r.CP_Label_DrawRect&&r.CP_Label_DrawRect(...e))},"CP_Label_DrawRect"),e.createElementVNode("button",{type:"primary",onClick:a[39]||(a[39]=(...e)=>r.CP_Label_DrawBox&&r.CP_Label_DrawBox(...e))},"CP_Label_DrawBox")])])}]]);__definePage("pages/home/index",g),__definePage("pages/weigh/index",No),__definePage("pages/weigh/instockLog",Po),__definePage("pages/inbound/index",Vo),__definePage("pages/inbound/instockLog",Do),__definePage("pages/outbound/index",Io),__definePage("pages/outbound/instockLog",Lo),__definePage("pages/profile/index",Ao),__definePage("pages/login/index",Oo),__definePage("pages/order/index",Mo),__definePage("pages/scanLotno/index",$o),__definePage("pages/scanLotno/lotnoLog",zo),__definePage("pages/scanLotno/waybillsList",qo),__definePage("pages/warehouseScan/index",Ko),__definePage("pages/warehouseScan/warehouseLog",Wo),__definePage("pages/waybillNo/index",Jo),__definePage("pages/waybillNo/waybillNoLog",Go),__definePage("pages/waybillDeliveryOrder/index",Zo),__definePage("pages/waybillDeliveryOrder/orderInfo",rs),__definePage("pages/printer/label",ps);const gs={onLaunch:function(){a("log","at App.vue:4","App Launch")},onShow:function(){a("log","at App.vue:7","App Show")},onHide:function(){a("log","at App.vue:10","App Hide")}};const{app:fs,Vuex:ys,Pinia:vs}={app:e.createVueApp(gs)};uni.Vuex=ys,uni.Pinia=vs,fs.provide("__globalStyles",__uniConfig.styles),fs._component.mpType="app",fs._component.render=()=>{},fs.mount("#app")}(Vue);
|