1 |
- var e=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},t=(t,a,s)=>(e(t,a,"read from private field"),s?s.call(t):a.get(t));import{aO as a,aP as s,m as l,n as o,f as r,g as n,w as i,k as c,B as u,ah as d,u as h,v as f,i as p,j as m,a3 as g,I as b,z as y,l as v,F as w,r as _,G as x,x as k,s as S,E as P,J as C,c as I,e as A,a0 as B,a2 as T,af as $,aB as V,ag as L,o as M,ae as D,O as U,y as E,aQ as F,aR as O,aS as z,aT as R,H as j,aU as N,Z as H,aV as W,N as q,V as G,W as Q,Q as X,aW as Z,aX as K,t as J,ay as Y,an as ee,ax as te,K as ae,L as se,aY as le,aZ as oe,a_ as re,a$ as ne,b0 as ie,b1 as ce,az as ue,aA as de,b2 as he,a4 as fe,b3 as pe,a7 as me,p as ge}from"./index-ba48620e.js";import{_ as be}from"./_plugin-vue_export-helper.1b428a4d.js";import{e as ye,_ as ve,u as we,g as _e,a as xe,b as ke,d as Se,c as Pe,m as Ce,p as Ie}from"./phone-international-input.dd3ca29e.js";import{p as Ae}from"./useGoods.edb8879f.js";const Be={en:{"uni-search-bar.cancel":"cancel","uni-search-bar.placeholder":"Search enter content"},"zh-Hans":{"uni-search-bar.cancel":"cancel","uni-search-bar.placeholder":"请输入搜索内容"},"zh-Hant":{"uni-search-bar.cancel":"cancel","uni-search-bar.placeholder":"請輸入搜索內容"}},{t:Te}=a(Be);const $e=be({name:"UniSearchBar",emits:["input","update:modelValue","clear","cancel","confirm","blur","focus"],props:{placeholder:{type:String,default:""},radius:{type:[Number,String],default:5},clearButton:{type:String,default:"auto"},cancelButton:{type:String,default:"auto"},cancelText:{type:String,default:"取消"},bgColor:{type:String,default:"#F8F8F8"},maxlength:{type:[Number,String],default:100},value:{type:[Number,String],default:""},modelValue:{type:[Number,String],default:""},focus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},data:()=>({show:!1,showSync:!1,searchVal:""}),computed:{cancelTextI18n(){return this.cancelText||Te("uni-search-bar.cancel")},placeholderText(){return this.placeholder||Te("uni-search-bar.placeholder")}},watch:{modelValue:{immediate:!0,handler(e){this.searchVal=e,e&&(this.show=!0)}},focus:{immediate:!0,handler(e){if(e){if(this.readonly)return;this.show=!0,this.$nextTick((()=>{this.showSync=!0}))}}},searchVal(e,t){this.$emit("input",e),this.$emit("update:modelValue",e)}},methods:{searchClick(){this.readonly||this.show||(this.show=!0,this.$nextTick((()=>{this.showSync=!0})))},clear(){this.$emit("clear",{value:this.searchVal}),this.searchVal=""},cancel(){this.readonly||(this.$emit("cancel",{value:this.searchVal}),this.searchVal="",this.show=!1,this.showSync=!1,s())},confirm(){s(),this.$emit("confirm",{value:this.searchVal})},blur(){s(),this.$emit("blur",{value:this.searchVal})},emitFocus(e){this.$emit("focus",e.detail)}}},[["render",function(e,t,a,s,y,v){const w=l(o("uni-icons"),ye),_=m,x=g,k=b;return r(),n(_,{class:"uni-searchbar"},{default:i((()=>[c(_,{style:u({borderRadius:a.radius+"px",backgroundColor:a.bgColor}),class:"uni-searchbar__box",onClick:v.searchClick},{default:i((()=>[c(_,{class:"uni-searchbar__box-icon-search"},{default:i((()=>[d(e.$slots,"searchIcon",{},(()=>[c(w,{color:"#c0c4cc",size:"18",type:"search"})]),!0)])),_:3}),y.show||y.searchVal?(r(),n(x,{key:0,focus:y.showSync,disabled:a.readonly,placeholder:v.placeholderText,maxlength:a.maxlength,class:"uni-searchbar__box-search-input","confirm-type":"search",type:"text",modelValue:y.searchVal,"onUpdate:modelValue":t[0]||(t[0]=e=>y.searchVal=e),onConfirm:v.confirm,onBlur:v.blur,onFocus:v.emitFocus},null,8,["focus","disabled","placeholder","maxlength","modelValue","onConfirm","onBlur","onFocus"])):(r(),n(k,{key:1,class:"uni-searchbar__text-placeholder"},{default:i((()=>[h(f(a.placeholder),1)])),_:1})),y.show&&("always"===a.clearButton||"auto"===a.clearButton&&""!==y.searchVal)&&!a.readonly?(r(),n(_,{key:2,class:"uni-searchbar__box-icon-clear",onClick:v.clear},{default:i((()=>[d(e.$slots,"clearIcon",{},(()=>[c(w,{color:"#c0c4cc",size:"20",type:"clear"})]),!0)])),_:3},8,["onClick"])):p("",!0)])),_:3},8,["style","onClick"]),"always"===a.cancelButton||y.show&&"auto"===a.cancelButton?(r(),n(k,{key:0,onClick:v.cancel,class:"uni-searchbar__cancel"},{default:i((()=>[h(f(v.cancelTextI18n),1)])),_:1},8,["onClick"])):p("",!0)])),_:3})}],["__scopeId","data-v-d1d127ff"]]),Ve=be({__name:"s-search-block",props:{data:{type:Object,default:()=>({})},elBackground:{type:String,default:""},height:{type:Number,default:36},iconColor:{type:String,default:"#b0b3bf"},fontColor:{type:String,default:"#b0b3bf"},placeholder:{type:String,default:"这是一个搜索框"},radius:{type:Number,default:10},width:{type:String,default:"100%"},navbar:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const a=y({searchVal:""}),s=t,d=e,g=()=>{s("click")};function b(e){e.value&&(S.$router.go("/pages/goods/list",{keyword:e.value}),setTimeout((()=>{a.searchVal=""}),100))}return(t,s)=>{const y=m,I=l(o("uni-search-bar"),$e),A=C;return r(),n(y,{class:P(["search-content ss-flex ss-col-center ss-row-between",[{"border-content":e.navbar}]]),onClick:g,style:u([{borderRadius:e.radius+"px",background:e.elBackground,height:e.height+"px",width:e.width}])},{default:i((()=>[e.navbar?(r(),n(y,{key:0,class:"ss-flex ss-col-center"},{default:i((()=>[c(y,{class:"search-icon _icon-search ss-m-l-10",style:u([{color:d.iconColor}])},null,8,["style"]),c(y,{class:"search-input ss-flex-1 ss-line-1",style:u([{color:e.fontColor,width:e.width}])},{default:i((()=>[h(f(e.placeholder),1)])),_:1},8,["style"])])),_:1})):p("",!0),e.navbar?p("",!0):(r(),n(I,{key:1,class:"ss-flex-1",radius:e.data.borderRadius,placeholder:e.data.placeholder,cancelButton:"none",clearButton:"none",onConfirm:b,modelValue:a.searchVal,"onUpdate:modelValue":s[0]||(s[0]=e=>a.searchVal=e)},null,8,["radius","placeholder","modelValue"])),c(y,{class:"keyword-link ss-flex"},{default:i((()=>[(r(!0),v(w,null,_(e.data.hotKeywords,((t,a)=>(r(),n(y,{key:a},{default:i((()=>[c(y,{class:"ss-m-r-16",style:u([{color:e.data.textColor}]),onClick:x((e=>k(S).$router.go("/pages/goods/list",{keyword:t})),["stop"])},{default:i((()=>[h(f(t),1)])),_:2},1032,["style","onClick"])])),_:2},1024)))),128))])),_:1}),e.data.hotKeywords&&e.data.hotKeywords.length&&e.navbar?(r(),n(y,{key:2,class:"ss-flex"},{default:i((()=>[(r(!0),v(w,null,_(e.data.hotKeywords,((t,a)=>(r(),n(A,{class:"ss-reset-button keyword-btn",key:a,style:u([{color:e.data.textColor,marginRight:"10rpx"}])},{default:i((()=>[h(f(t),1)])),_:2},1032,["style"])))),128))])),_:1})):p("",!0)])),_:1},8,["style","class"])}}},[["__scopeId","data-v-69949848"]]),Le=be({__name:"su-fixed",props:{noNav:{type:Boolean,default:!1},bottom:{type:Boolean,default:!1},bg:{type:String,default:""},bgStyles:{type:Object,default(){}},val:{type:Number,default:0},width:{type:[String,Number],default:0},alway:{type:Boolean,default:!0},opacity:{type:Boolean,default:!1},index:{type:[Number,String],default:0},placeholder:{type:[Boolean],default:!1},sticky:{type:[Boolean],default:!1},noFixed:{type:Boolean,default:!1},ui:{type:String,default:""},clickTo:{type:Boolean,default:!1},isInset:{type:Boolean,default:!0}},setup(e){const{safeAreaInsets:t}=S.$platform.device,a=V(),s=S.$helper.guid(),l=S.$platform.navbar,o=y({content:{},fixed:!0,scrollTop:0,opacityVal:0}),h=I((()=>o.fixed&&f.bottom?f.isInset?f.val+"px":f.val+t.bottom+"px":"auto")),f=e;o.fixed=!k(f.sticky),A((e=>{let t=e.scrollTop;o.scrollTop=t,o.opacityVal=t>S.$platform.navbar?1:.01*t})),B((()=>{T((()=>{g()}))}));const g=()=>{$().in(a).select(`#fixed-${s}`).boundingClientRect((e=>{null!=e&&(o.content=e,k(f.sticky)&&b(o.scrollTop))})).exec()},b=e=>{k(f.bottom)?o.fixed=e>=o.content.bottom-S.$platform.device.windowHeight+o.content.height+k(f.val):o.fixed=e>=o.content.top-(k(f.noNav)?k(f.val):k(f.val)+S.$platform.navbar)},v=()=>{f.hasToTop&&L({scrollTop:o.content.top,duration:100})};return(a,f)=>{const g=m;return r(),n(g,{class:"ui-fixed"},{default:i((()=>[c(g,{class:P(["ui-fixed-box",[{fixed:o.fixed}]]),id:`fixed-${k(s)}`,style:u([{left:e.sticky?"auto":"0px",top:o.fixed&&!e.bottom?(e.noNav?e.val:e.val+k(l))+"px":"auto",bottom:h.value,zIndex:e.index+k(S).$zIndex.navbar},e.alway?"":{opacity:o.opacityVal}])},{default:i((()=>[c(g,{class:"ui-fixed-content",onClick:v,style:u([{zIndex:e.index+k(S).$zIndex.navbar}])},{default:i((()=>[d(a.$slots,"default",{},void 0,!0),k(t).bottom&&e.bottom&&e.isInset?(r(),n(g,{key:0,class:"inset-bottom",style:u([{height:k(t).bottom+"px"}])},null,8,["style"])):p("",!0)])),_:3},8,["style"]),e.bottom?(r(),n(g,{key:0,class:P(["ui-fixed-bottom",[e.bg]])},null,8,["class"])):p("",!0),c(g,{class:P(["ui-fixed-bg",[e.ui,e.bg]]),style:u([{zIndex:e.index+k(S).$zIndex.navbar-1},e.bgStyles,e.opacity?{opacity:o.opacityVal}:""])},null,8,["class","style"])])),_:3},8,["id","class","style"]),(e.sticky||e.placeholder)&&o.fixed?(r(),n(g,{key:0,class:"skeleton",style:u([{height:o.content.height+"px",width:e.width+"px"}])},null,8,["style"])):p("",!0)])),_:3})}}},[["__scopeId","data-v-bb090a1f"]]),Me=be({__name:"su-status-bar",setup(e){const t=S.$platform.device.statusBarHeight+"px";return(e,a)=>{const s=m;return r(),n(s,{style:u({height:t}),class:"uni-status-bar"},{default:i((()=>[d(e.$slots,"default",{},void 0,!0)])),_:3},8,["style"])}}},[["__scopeId","data-v-c47205c9"]]),De=be({__name:"su-navbar",props:{dark:{type:Boolean,default:!1},modelValue:{type:String,default:""},title:{type:String,default:""},titleAlign:{type:String,default:"center"},rightText:{type:String,default:""},leftIcon:{type:String,default:"left"},rightIcon:{type:String,default:""},fixed:{type:[Boolean,String],default:!0},placeholder:{type:[Boolean,String],default:!0},color:{type:String,default:""},backgroundColor:{type:String,default:""},opacity:{type:[Boolean,String],default:!1},opacityBgUi:{type:String,default:"bg-white"},statusBar:{type:[Boolean,String],default:!1},shadow:{type:[Boolean,String],default:!1},border:{type:[Boolean,String],default:!1},height:{type:[Number,String],default:44},leftWidth:{type:[Number,String],default:80},rightWidth:{type:[Number,String],default:0},tools:{type:String,default:"title"},defaultSearch:{type:String,default:""}},emits:["clickLeft","clickRight","clickTitle","search"],setup(e,{emit:t}){const a=e=>"number"==typeof e?e+"px":e,s=t,g=e;I((()=>({width:S.$platform.capsule.width+"px",height:S.$platform.capsule.height+"px",margin:"0 "+(S.$platform.device.windowWidth-S.$platform.capsule.right)+"px"})));const y=I((()=>g.defaultSearch));I((()=>g.dark?g.backgroundColor?g.backgroundColor:g.dark?"#333":"#FFF":g.backgroundColor||"#FFF"));const v=I((()=>g.dark?g.color?g.color:g.dark?"#fff":"#333":g.color||"#333")),w=I((()=>a(g.height))),_=I((()=>a(g.leftWidth)));function x(e){s("search",e.value)}I((()=>a(g.rightWidth))),M((()=>{uni.report&&""!==g.title&&uni.report("title",g.title)}));const C=S.$router.hasHistory();function A(){C?S.$router.back():S.$router.go("/pages/index/index"),s("clickLeft")}function B(){s("clickTitle")}return(t,a)=>{const s=m,g=l(o("su-status-bar"),Me),I=b,T=l(o("uni-search-bar"),$e);return r(),n(s,{class:P(["uni-navbar",{"uni-dark":e.dark}])},{default:i((()=>[c(s,{class:P([{"uni-navbar--fixed":e.fixed,"uni-navbar--shadow":e.shadow,"uni-navbar--border":e.border},"uni-navbar__content"])},{default:i((()=>[c(s,{class:P(["fixed-bg",[e.opacity?"":e.opacityBgUi]])},null,8,["class"]),e.statusBar?(r(),n(g,{key:0})):p("",!0),c(s,{style:u({color:v.value,height:w.value,background:e.backgroundColor}),class:"uni-navbar__header"},{default:i((()=>[c(s,{class:"uni-navbar__header-btns uni-navbar__header-btns-left",style:u({width:_.value})},{default:i((()=>[d(t.$slots,"left",{},(()=>[e.leftIcon.length>0?(r(),n(s,{key:0,class:"uni-navbar__content_view"},{default:i((()=>[c(s,{class:"icon-box ss-flex"},{default:i((()=>[c(s,{class:"icon-button icon-button-left ss-flex ss-row-center",onClick:A},{default:i((()=>[k(C)?(r(),n(I,{key:0,class:"sicon-back"})):(r(),n(I,{key:1,class:"sicon-home"}))])),_:1}),c(s,{class:"line"}),c(s,{class:"icon-button icon-button-right ss-flex ss-row-center",onClick:k(D)},{default:i((()=>[c(I,{class:"sicon-more"})])),_:1},8,["onClick"])])),_:1})])),_:1})):p("",!0),"left"===e.titleAlign&&e.title.length&&"WechatOfficialAccount"!==k(S).$platform.name?(r(),n(s,{key:1,class:P([{"uni-navbar-btn-icon-left":!e.leftIcon.length>0},"uni-navbar-btn-text"])},{default:i((()=>[c(I,{style:u({color:v.value,fontSize:"18px"})},{default:i((()=>[h(f(e.title),1)])),_:1},8,["style"])])),_:1},8,["class"])):p("",!0)]),!0)])),_:3},8,["style"]),"search"===e.tools?(r(),n(s,{key:0,class:"ss-flex-1"},{default:i((()=>[d(t.$slots,"center",{},(()=>[c(T,{class:"ss-flex-1 search-box",radius:20,placeholder:"请输入关键词",cancelButton:"none",modelValue:y.value,"onUpdate:modelValue":a[0]||(a[0]=e=>y.value=e),onConfirm:x},null,8,["modelValue"])]),!0)])),_:3})):(r(),n(s,{key:1,class:"uni-navbar__header-container",onClick:B},{default:i((()=>[d(t.$slots,"center",{},(()=>["title"===e.tools&&"center"===e.titleAlign&&e.title.length?(r(),n(s,{key:0,class:"uni-navbar__header-container-inner"},{default:i((()=>[c(I,{style:u({color:v.value,fontSize:"36rpx"}),class:"ss-line-1"},{default:i((()=>[h(f(e.title),1)])),_:1},8,["style"])])),_:1})):p("",!0)]),!0)])),_:3}))])),_:3},8,["style"])])),_:3},8,["class"]),e.placeholder?(r(),n(s,{key:0,class:"uni-navbar__placeholder"},{default:i((()=>[e.statusBar?(r(),n(g,{key:0})):p("",!0),c(s,{class:"uni-navbar__placeholder-view",style:u({height:w.value})},null,8,["style"])])),_:1})):p("",!0)])),_:3},8,["class"])}}},[["__scopeId","data-v-c05a9774"]]),Ue=be({__name:"navbar",props:{sticky:Boolean,zIndex:{type:Number,default:100},back:{type:Boolean,default:!0},backtext:{type:String,default:""},bg:{type:String,default:"bg-white"},status:{type:String,default:""},alway:{type:Boolean,default:!0},opacity:{type:Boolean,default:!1},opacityBg:{type:Boolean,default:!1},noFixed:{type:Boolean,default:!1},ui:{type:String,default:""},capsule:{type:Boolean,default:!1},stopBack:{type:Boolean,default:!1},placeholder:{type:[Boolean],default:!0},bgStyles:{type:Object,default(){}}},emits:["navback"],setup(e,{emit:t}){const a=y({statusCur:"",capsuleStyle:{},capsuleBack:{}}),s=S.$platform.device.statusBarHeight,h=S.$platform.navbar,f=e;U((()=>{p()}));const p=()=>{a.capsuleStyle={width:S.$platform.capsule.width+"px",height:S.$platform.capsule.height+"px",margin:"0 "+(S.$platform.device.windowWidth-S.$platform.capsule.right)+"px"},a.capsuleBack=a.capsuleStyle};return(e,t)=>{const a=l(o("su-status-bar"),Me),p=m,g=l(o("su-fixed"),Le);return r(),n(g,{noFixed:f.noFixed,alway:f.alway,bgStyles:f.bgStyles,val:0,index:f.zIndex,noNav:"",bg:f.bg,ui:f.ui,opacity:f.opacity,placeholder:f.placeholder,sticky:f.sticky},{default:i((()=>[c(a),c(p,{class:"ui-navbar-box"},{default:i((()=>[c(p,{class:P(["ui-bar",""==f.status?"text-a":"light"==f.status?"text-white":"text-black"]),style:u([{height:k(h)-k(s)+"px"}])},{default:i((()=>[d(e.$slots,"item",{},void 0,!0),c(p,{class:"right"})])),_:3},8,["class","style"])])),_:3})])),_:3},8,["noFixed","alway","bgStyles","index","bg","ui","opacity","placeholder","sticky"])}}},[["__scopeId","data-v-1b1aaaf2"]]),Ee=be({__name:"navbar-item",props:{data:{type:Object,default:()=>({})},width:{type:String,default:"1px"}},setup(e){const t=I((()=>S.$platform.capsule.height));return(a,s)=>{const d=m,g=E,b=l(o("s-search-block"),Ve);return r(),n(d,{class:"ss-flex ss-col-center"},{default:i((()=>["text"===e.data.type?(r(),n(d,{key:0,class:"nav-title inline",style:u([{color:e.data.textColor,width:e.width}])},{default:i((()=>[h(f(e.data.text),1)])),_:1},8,["style"])):p("",!0),"image"===e.data.type?(r(),n(d,{key:1,style:u([{width:e.width}]),class:"menu-icon-wrap ss-flex ss-row-center ss-col-center",onClick:s[0]||(s[0]=t=>k(S).$router.go(e.data.url))},{default:i((()=>[c(g,{class:"nav-image",src:k(S).$url.cdn(e.data.src),mode:"aspectFit"},null,8,["src"])])),_:1},8,["style"])):p("",!0),"search"==e.data.type?(r(),n(d,{key:2,class:"ss-flex-1",style:u([{width:e.width}])},{default:i((()=>[c(b,{placeholder:e.data.placeholder||"搜索关键字",radius:e.data.borderRadius,elBackground:"#fff",height:t.value,width:e.width,onClick:s[1]||(s[1]=e=>k(S).$router.go("/pages/index/search"))},null,8,["placeholder","radius","height","width"])])),_:1},8,["style"])):p("",!0)])),_:1})}}},[["__scopeId","data-v-89a97bd5"]]),Fe=be({__name:"s-custom-navbar",props:{data:{type:Object,default:()=>({})},showLeftButton:{type:Boolean,default:!1}},setup(e){const t=e,a=S.$router.hasHistory(),s=I((()=>("inner"!=t.data.mode||!t.data.alway)&&("normal"!=t.data.mode&&void 0))),l=I((()=>t.data.list?t.data.list.app:[])),o=S.$platform.device.windowWidth,d=I((()=>{if(k(l).length){return(o-90)/8}})),h=e=>({width:e.width*d.value+10*(e.width-1)+"px",left:e.left*d.value+10*(e.left+1)+"px","border-radius":e.borderRadius+"px"}),f=I((()=>"inner"!==t.data.mode||Boolean(t.data.alwaysShow))),g=I((()=>"normal"!==t.data.mode&&(!t.showLeftButton&&"inner"===t.data.mode))),y=I((()=>"normal"===t.data.mode)),x=I((()=>{if(t.data.type)return{background:"color"==t.data.type?t.data.color:`url(${S.$url.cdn(t.data.src)}) no-repeat top center / 100% 100%`}}));function C(){a?S.$router.back():S.$router.go("/pages/index/index")}function A(){D()}return(t,o)=>{const d=b,S=m;return r(),n(Ue,{alway:f.value,back:!1,bg:"",placeholder:y.value,bgStyles:x.value,opacity:g.value,sticky:s.value},{item:i((()=>[c(S,{class:"nav-box"},{default:i((()=>[e.showLeftButton?(r(),n(S,{key:0,class:"nav-icon"},{default:i((()=>[c(S,{class:P(["icon-box ss-flex",{"inner-icon-box":"inner"==e.data.mode}])},{default:i((()=>[c(S,{class:"icon-button icon-button-left ss-flex ss-row-center",onClick:C},{default:i((()=>[k(a)?(r(),n(d,{key:0,class:"sicon-back"})):(r(),n(d,{key:1,class:"sicon-home"}))])),_:1}),c(S,{class:"line"}),c(S,{class:"icon-button icon-button-right ss-flex ss-row-center",onClick:A},{default:i((()=>[c(d,{class:"sicon-more"})])),_:1})])),_:1},8,["class"])])),_:1})):p("",!0),(r(!0),v(w,null,_(l.value,((e,t)=>(r(),n(S,{class:P(["nav-item",[{"ss-flex ss-col-center ss-row-center":"search"!==e.type}]]),key:t,style:u([h(e)])},{default:i((()=>[c(Ee,{data:e,width:h(e).width},null,8,["data","width"])])),_:2},1032,["style","class"])))),128))])),_:1})])),_:1},8,["alway","placeholder","bgStyles","opacity","sticky"])}}},[["__scopeId","data-v-6478786c"]]),Oe=be({__name:"su-inner-navbar",props:{zIndex:{type:Number,default:100},title:{type:String,default:""},bg:{type:String,default:"bg-white"},alway:{type:Boolean,default:!0},opacity:{type:Boolean,default:!0},noFixed:{type:Boolean,default:!0},ui:{type:String,default:""},capsule:{type:Boolean,default:!1},stopBack:{type:Boolean,default:!1},placeholder:{type:[Boolean],default:!1},bgStyles:{type:Object,default(){}}},emits:["navback","clickLeft"],setup(e,{emit:t}){const a=y({statusCur:"",capsuleStyle:{},capsuleBack:{},isDark:!0}),s=S.$platform.device.statusBarHeight,p=S.$platform.navbar,g=e,v=t,w=S.$router.hasHistory();function _(){w?S.$router.back():S.$router.go("/pages/index/index"),v("clickLeft")}function x(){D()}U((()=>{C()})),A((e=>{let t=e.scrollTop;a.isDark=t<S.$platform.navbar}));const C=()=>{a.capsuleStyle={width:S.$platform.capsule.width+"px",height:S.$platform.capsule.height+"px"},a.capsuleBack=a.capsuleStyle};return(t,y)=>{const v=l(o("su-status-bar"),Me),S=b,C=m,I=l(o("su-fixed"),Le);return r(),n(I,{noFixed:g.noFixed,alway:g.alway,bgStyles:g.bgStyles,val:0,index:g.zIndex,noNav:"",bg:g.bg,ui:g.ui,opacity:g.opacity,placeholder:g.placeholder},{default:i((()=>[c(v),c(C,{class:"ui-navbar-box"},{default:i((()=>[c(C,{class:P(["ui-bar ss-p-x-20",a.isDark?"text-white":"text-black"]),style:u([{height:k(p)-k(s)+"px"}])},{default:i((()=>[c(C,{class:"icon-box ss-flex"},{default:i((()=>[c(C,{class:"icon-button icon-button-left ss-flex ss-row-center",onClick:_},{default:i((()=>[k(w)?(r(),n(S,{key:0,class:"sicon-back"})):(r(),n(S,{key:1,class:"sicon-home"}))])),_:1}),c(C,{class:"line"}),c(C,{class:"icon-button icon-button-right ss-flex ss-row-center",onClick:x},{default:i((()=>[c(S,{class:"sicon-more"})])),_:1})])),_:1}),d(t.$slots,"center",{},(()=>[c(C,{class:"center navbar-title"},{default:i((()=>[h(f(e.title),1)])),_:1})]),!0)])),_:3},8,["class","style"])])),_:3})])),_:3},8,["noFixed","alway","bgStyles","index","bg","ui","opacity","placeholder"])}}},[["__scopeId","data-v-d940a794"]]);const ze=be({name:"su-tabbar-item",props:{customStyle:{type:[Object,String],default:()=>({})},customClass:{type:String,default:""},url:{type:String,default:""},linkType:{type:String,default:"navigateTo"},name:{type:[String,Number,null],default:""},icon:{icon:String,default:""},badge:{type:[String,Number,null],default:""},dot:{type:Boolean,default:!1},text:{type:String,default:""},badgeStyle:{type:[Object,String],default:""},isCenter:{type:Boolean,default:!1},centerImage:{type:String,default:""}},data:()=>({isActive:!1,addStyle:F,parentData:{value:null,activeColor:"",color:""},parent:{}}),created(){this.init()},methods:{getParentData(e=""){this.parent||(this.parent={}),this.parent=O.call(this,e),this.parent.children&&-1===this.parent.children.indexOf(this)&&this.parent.children.push(this),this.parent&&this.parentData&&Object.keys(this.parentData).map((e=>{this.parentData[e]=this.parent[e]}))},init(){this.updateParentData(),this.parent||console.log("u-tabbar-item必须搭配u-tabbar组件使用");const e=this.parent.children.indexOf(this);this.isActive=(this.name.split("?")[0]||e)===this.parentData.value},updateParentData(){this.getParentData("su-tabbar")},updateFromParent(){this.init()},clickHandler(){this.$nextTick((()=>{const e=this.parent.children.indexOf(this),t=this.name||e;t!==this.parent.value&&this.parent.$emit("change",t),this.$emit("click",t)}))}}},[["render",function(e,t,a,s,l,o){const p=E,g=m,y=b;return r(),n(g,{class:"u-tabbar-item",style:u([l.addStyle(a.customStyle)])},{default:i((()=>[a.isCenter?(r(),n(g,{key:0,class:"tabbar-center-item"},{default:i((()=>[c(p,{class:"center-image",src:a.centerImage,mode:"aspectFill"},null,8,["src"])])),_:1})):(r(),v(w,{key:1},[c(g,{class:"u-tabbar-item__icon"},{default:i((()=>[a.icon?(r(),n(p,{key:0,name:a.icon,color:l.isActive?l.parentData.activeColor:l.parentData.color,size:20},null,8,["name","color"])):(r(),v(w,{key:1},[l.isActive?d(e.$slots,"active-icon",{key:0},void 0,!0):d(e.$slots,"inactive-icon",{key:1},void 0,!0)],64))])),_:3}),d(e.$slots,"text",{},(()=>[c(y,{class:"u-tabbar-item__text",style:u({color:l.isActive?l.parentData.activeColor:l.parentData.color})},{default:i((()=>[h(f(a.text),1)])),_:1},8,["style"])]),!0)],64))])),_:3},8,["style"])}],["__scopeId","data-v-191720f8"]]);const Re=be({name:"su-tabbar",props:{customStyle:{type:[Object,String],default:()=>({})},customClass:{type:String,default:""},url:{type:String,default:""},linkType:{type:String,default:"navigateTo"},value:{type:[String,Number,null],default:""},safeAreaInsetBottom:{type:Boolean,default:!0},border:{type:Boolean,default:!0},zIndex:{type:[String,Number],default:10},activeColor:{type:String,default:"#1989fa"},inactiveColor:{type:String,default:"#7d7e80"},fixed:{type:Boolean,default:!0},placeholder:{type:Boolean,default:!0},midTabBar:{type:Boolean,default:!1}},data:()=>({placeholderHeight:0,safeBottomHeight:S.$platform.device.safeAreaInsets.bottom}),computed:{tabbarStyle(){const e={zIndex:this.zIndex};return z(e,F(this.customStyle))},updateChild(){return[this.value,this.activeColor,this.inactiveColor]},updatePlaceholder(){return[this.fixed,this.placeholder]}},watch:{updateChild(){this.updateChildren()},updatePlaceholder(){this.setPlaceholderHeight()}},created(){this.children=[]},mounted(){this.setPlaceholderHeight()},methods:{updateChildren(){this.children.length&&this.children.map((e=>e.updateFromParent()))},getRect(e,t){return new Promise((a=>{$().in(this)[t?"selectAll":"select"](e).boundingClientRect((e=>{t&&Array.isArray(e)&&e.length&&a(e),!t&&e&&a(e)})).exec()}))},async setPlaceholderHeight(){this.fixed&&this.placeholder&&(await R(20),this.getRect(".u-tabbar__content").then((({height:e=50})=>{this.placeholderHeight=e})))}}},[["render",function(e,t,a,s,l,o){const h=m;return r(),n(h,{class:"u-tabbar"},{default:i((()=>[c(h,{class:P(["u-tabbar__content",[a.border&&"u-border-top",a.fixed&&"u-tabbar--fixed",{"mid-tabbar":a.midTabBar}]]),ref:"u-tabbar__content",onTouchmove:t[0]||(t[0]=x((()=>{}),["stop","prevent"])),style:u([o.tabbarStyle])},{default:i((()=>[c(h,{class:"u-tabbar__content__item-wrapper"},{default:i((()=>[d(e.$slots,"default",{},void 0,!0)])),_:3}),a.safeAreaInsetBottom?(r(),n(h,{key:0,style:u([{height:l.safeBottomHeight+"px"}])},null,8,["style"])):p("",!0)])),_:3},8,["class","style"]),a.placeholder?(r(),n(h,{key:0,class:"u-tabbar__placeholder",style:u({height:l.placeholderHeight+"px"})},null,8,["style"])):p("",!0)])),_:3})}],["__scopeId","data-v-cc8282eb"]]),je=be({__name:"s-tabbar",props:{path:String,default:""},setup(e){const t=I((()=>{var e;return null==(e=S.$store("app").template.basic)?void 0:e.tabbar})),a=I((()=>{const e=t.value.style;return"color"===e.bgType?{background:e.bgColor}:"img"===e.bgType?{background:`url(${S.$url.cdn(e.bgImg)}) no-repeat top center / 100% auto`}:void 0})),s=e=>2===k(t).mode&&(k(t).items%2>0&&Math.ceil(k(t).items.length/2)===e+1);return(u,d)=>{var h,f;const g=E,b=l(o("su-tabbar-item"),ze),y=l(o("su-tabbar"),Re),x=m;return(null==(f=null==(h=t.value)?void 0:h.items)?void 0:f.length)>0?(r(),n(x,{key:0,class:"u-page__item"},{default:i((()=>[c(y,{value:e.path,fixed:!0,placeholder:!0,safeAreaInsetBottom:!0,inactiveColor:t.value.style.color,activeColor:t.value.style.activeColor,midTabBar:2===t.value.mode,customStyle:a.value},{default:i((()=>[(r(!0),v(w,null,_(t.value.items,((e,t)=>(r(),n(b,{key:e.text,text:e.text,name:e.url,isCenter:s(t),centerImage:k(S).$url.cdn(e.iconUrl),onClick:t=>k(S).$router.go(e.url)},{"active-icon":i((()=>[c(g,{class:"u-page__item__slot-icon",src:k(S).$url.cdn(e.activeIconUrl)},null,8,["src"])])),"inactive-icon":i((()=>[c(g,{class:"u-page__item__slot-icon",src:k(S).$url.cdn(e.iconUrl)},null,8,["src"])])),_:2},1032,["text","name","isCenter","centerImage","onClick"])))),128))])),_:1},8,["value","inactiveColor","activeColor","midTabBar","customStyle"])])),_:1})):p("",!0)}}},[["__scopeId","data-v-2389827b"]]),Ne=be({__name:"s-wallet-modal",setup(e){j((e=>({"178a572a":k(t)})));const t=S.$url.css("/static/images/sign.png"),a=I((()=>S.$store("modal").getWallet)),s=I((()=>S.$store("modal").getWalletInfo));return(e,t)=>{const u=b,d=m,g=C,y=l(o("su-popup"),ve);return r(),n(y,{show:a.value,onClose:k(N),type:"center",round:"10"},{default:i((()=>[c(d,{class:"model-box ss-flex-col"},{default:i((()=>[c(d,{class:"ss-m-t-56 ss-flex-col ss-col-center"},{default:i((()=>[c(u,{class:"cicon-check-round"}),c(d,{class:"score-title"},{default:i((()=>[h("恭喜")])),_:1}),s.value.points&&"null"!==s.value.points&&k(Ae)(s.value.points)>0||s.value.socialStatus&&"null"!==s.value.socialStatus?(r(),v(w,{key:0},[s.value.points&&k(Ae)(s.value.points)>0?(r(),n(d,{key:0,class:"model-title ss-flex ss-col-center ss-m-t-15 ss-font-35"},{default:i((()=>[h(" 获得积分:"+f(k(Ae)(s.value.points)),1)])),_:1})):p("",!0),s.value.socialStatus?(r(),n(d,{key:1,class:"model-title ss-flex ss-col-center ss-m-t-15 ss-font-35"},{default:i((()=>[h(" 获得身价:"+f(s.value.socialStatus),1)])),_:1})):p("",!0),c(d,{class:"model-title ss-flex ss-col-center ss-m-y-15"},{default:i((()=>[h(" 【待确权】 ")])),_:1})],64)):(r(),n(d,{key:1,class:"model-title ss-flex ss-col-center ss-m-y-15"},{default:i((()=>[h(" 下单成功 ")])),_:1}))])),_:1}),c(d,{class:"model-bg ss-flex-col ss-col-center ss-row-right"},{default:i((()=>[c(d,{class:"ss-m-b-40"},{default:i((()=>[c(g,{class:"ss-reset-button confirm-btn",onClick:t[0]||(t[0]=e=>{k(N)()})},{default:i((()=>[h("确认")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1},8,["show","onClose"])}}},[["__scopeId","data-v-dc671b0b"]]),He=be({__name:"s-signup-modal",setup(e){j((e=>({"42c80bd2":k(t)})));const t=S.$url.css("/static/images/sign.png"),a=I((()=>S.$store("modal").signUp)),s=I((()=>S.$store("modal").signUpInfo));return H((()=>a.value),(e=>{e&&setTimeout(W,3e3)})),(e,t)=>{const u=b,d=m,g=C,y=l(o("su-popup"),ve);return r(),n(y,{show:a.value,onClose:k(W),type:"center",round:"10"},{default:i((()=>[c(d,{class:"model-box ss-flex-col"},{default:i((()=>[c(d,{class:"ss-m-t-56 ss-flex-col ss-col-center"},{default:i((()=>{var e;return[c(u,{class:"cicon-check-round"}),c(d,{class:"score-title"},{default:i((()=>[h("恭喜!自动签到成功!")])),_:1}),c(d,{class:"model-title ss-flex ss-col-center ss-m-t-22 ss-m-b-30"},{default:i((()=>{var e;return[h(" 获得每日签到"+f(null==(e=s.value)?void 0:e.social)+"点身价 ",1)]})),_:1}),(null==(e=s.value)?void 0:e.upgradeOrNot)?(r(),n(d,{key:0,class:"model-title ss-flex ss-col-center ss-m-b-30"},{default:i((()=>{var e;return[h(" 您已升级等级为"+f(null==(e=s.value)?void 0:e.socialStatusName),1)]})),_:1})):p("",!0)]})),_:1}),c(d,{class:"model-bg ss-flex-col ss-col-center ss-row-right"},{default:i((()=>[c(d,{class:"ss-m-b-40"},{default:i((()=>[c(g,{class:"ss-reset-button confirm-btn",onClick:t[0]||(t[0]=e=>{k(W)()})},{default:i((()=>[h("确认")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1},8,["show","onClose"])}}},[["__scopeId","data-v-e22bfeb0"]]),We=be({__name:"account-login",props:{agreeStatus:{type:Boolean,default:!1}},emits:["onConfirm"],setup(e,{emit:t}){const a=q(null),s=t,u=e,d=y({model:{username:"",password:""},rules:{username:we,password:_e}});async function f(){if(!(await k(a).validate().catch((e=>{console.log("error: ",e)}))))return;if(!u.agreeStatus)return s("onConfirm",!0),void S.$helper.toast("请勾选同意");const{code:e,data:t}=await G.login(d.model);0===e&&Q()}return(e,t)=>{const s=l(o("uni-easyinput"),xe),u=l(o("uni-forms-item"),ke),p=l(o("uni-forms"),Se),g=C,b=m;return r(),n(b,null,{default:i((()=>[c(p,{ref_key:"accountLoginRef",ref:a,modelValue:d.model,"onUpdate:modelValue":t[2]||(t[2]=e=>d.model=e),rules:d.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center",class:"loginUniForm"},{default:i((()=>[c(u,{name:"username",label:"用户名",class:"loginUniFormItem"},{default:i((()=>[c(s,{placeholder:"请输入用户名",modelValue:d.model.username,"onUpdate:modelValue":t[0]||(t[0]=e=>d.model.username=e),inputBorder:!1},null,8,["modelValue"])])),_:1}),c(u,{name:"password",label:"密码",class:"loginUniFormItem"},{default:i((()=>[c(s,{type:"password",placeholder:"请输入密码",modelValue:d.model.password,"onUpdate:modelValue":t[1]||(t[1]=e=>d.model.password=e),inputBorder:!1},null,8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),c(b,{style:{display:"flex","justify-content":"space-between","margin-top":"20rpx"}},{default:i((()=>[c(g,{class:"ss-reset-button login-btn-start",onClick:f},{default:i((()=>[h("登录")])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-90a14fae"]]),qe=be({__name:"sms-login",props:{agreeStatus:{type:Boolean,default:!1}},emits:["onConfirm"],setup(e,{emit:t}){const a=(e,t)=>{f.model.mobile=e,f.mobileErrorMsg=t},s=q(null),u=t,d=e,f=y({verifyUsername:!0,usernameErrorMsg:"",isMobileEnd:!1,codeText:"获取验证码",mobileErrorMsg:"",model:{username:"",mobile:"",code:""},rules:{username:we,code:Pe,mobile:Ce}});let p=q("");async function g(e){const t=e.detail.value;if(""==t||t==p.value)return!1;p.value=t;const{data:a}=await G.verifyUsername(t);a?(f.usernameErrorMsg="请输入正确的用户名!",f.verifyUsername=a):(f.usernameErrorMsg="",f.verifyUsername=a)}async function b(){const e=X("linkId");e&&(f.model.linkId=e);if(!(await k(s).validate().catch((e=>{console.log("error: ",e)}))))return;if(!d.agreeStatus)return u("onConfirm",!0),void S.$helper.toast("请勾选同意");const{code:t}=await G.smsLogin(f.model);0===t&&Q()}return(e,t)=>{const u=E,d=m,p=l(o("uni-easyinput"),xe),y=l(o("uni-forms-item"),ke),v=l(o("uni-forms"),Se),w=C;return r(),n(d,null,{default:i((()=>[c(v,{ref_key:"smsLoginRef",ref:s,modelValue:f.model,"onUpdate:modelValue":t[2]||(t[2]=e=>f.model=e),rules:f.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center",class:"loginUniForm"},{default:i((()=>[c(y,{name:"username",label:"用户名",class:"loginUniFormItem","error-message":f.usernameErrorMsg},{default:i((()=>[c(p,{placeholder:"请输入用户名",modelValue:f.model.username,"onUpdate:modelValue":t[0]||(t[0]=e=>f.model.username=e),inputBorder:!1,clearable:!1,onBlur:g},{right:i((()=>[f.verifyUsername?(r(),n(d,{key:0,class:"icon"},{default:i((()=>[c(u,{style:"",src:k(S).$url.static("/static/images/shibai.png")},null,8,["src"])])),_:1})):(r(),n(d,{key:1,class:"icon"},{default:i((()=>[c(u,{src:k(S).$url.static("/static/images/chenggong.png")},null,8,["src"])])),_:1}))])),_:1},8,["modelValue"])])),_:1},8,["error-message"]),c(y,{name:"mobile",label:"手机号",class:"mobile loginUniFormItem ss-p-t-10","error-message":f.mobileErrorMsg},{default:i((()=>[c(Ie,{"verify-username":!f.verifyUsername,onInput:a},null,8,["verify-username"])])),_:1},8,["error-message"]),c(y,{name:"code",label:"验证码",class:"loginUniFormItem"},{default:i((()=>[c(p,{placeholder:"请输入验证码",modelValue:f.model.code,"onUpdate:modelValue":t[1]||(t[1]=e=>f.model.code=e),inputBorder:!1,type:"number",maxlength:"4"},null,8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),c(d,{style:{display:"flex","justify-content":"space-between","margin-top":"20rpx"}},{default:i((()=>[c(w,{class:"ss-reset-button login-btn-start",onClick:b},{default:i((()=>[h(" 登录 ")])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-2ebe60f2"]]),Ge=be({__name:"register",props:{agreeStatus:{type:Boolean,default:!1}},emits:["onConfirm"],setup(e,{emit:t}){const a=(e,t)=>{s.model.mobile=e,s.mobileErrorMsg=t},s=y({verifyUsername:!1,codeText:"获取验证码",mobileErrorMsg:"",usernameErrorMsg:"",model:{username:"",password:"",mobile:"",code:""},rules:{username:we,password:_e,code:Pe}}),u=q(null),d=t,f=e;let p=q("");async function g(e){const t=e.detail.value;if(""==t||t==p.value)return!1;p.value=t;const{data:a}=await G.verifyUsername(t);a?(s.usernameErrorMsg="",s.verifyUsername=a):(s.usernameErrorMsg="已存在用户名!",s.verifyUsername=a)}async function b(){console.log(s.model);if(!(await k(u).validate().catch((e=>{console.log("error: ",e)}))))return;if(!f.agreeStatus)return d("onConfirm",!0),void S.$helper.toast("请勾选同意");const e=X("linkId");if(!e)return S.$helper.toast("您只能通过分享注册"),!1;s.model.linkId=e;const{code:t}=await G.register(s.model);0===t&&Q()}return(e,t)=>{const d=E,f=m,p=l(o("uni-easyinput"),xe),y=l(o("uni-forms-item"),ke),v=l(o("uni-forms"),Se),w=C;return r(),n(f,null,{default:i((()=>[c(v,{ref_key:"smsLoginRef",ref:u,modelValue:s.model,"onUpdate:modelValue":t[3]||(t[3]=e=>s.model=e),rules:s.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center",class:"loginUniForm"},{default:i((()=>[c(y,{name:"username",label:"用户名",class:"loginUniFormItem","error-message":s.usernameErrorMsg},{default:i((()=>[c(p,{placeholder:"请输入用户名",modelValue:s.model.username,"onUpdate:modelValue":t[0]||(t[0]=e=>s.model.username=e),inputBorder:!1,clearable:!1,onBlur:g},{right:i((()=>[s.verifyUsername?(r(),n(f,{key:1,class:"icon"},{default:i((()=>[c(d,{src:k(S).$url.static("/static/images/chenggong.png")},null,8,["src"])])),_:1})):(r(),n(f,{key:0,class:"icon"},{default:i((()=>[c(d,{style:"",src:k(S).$url.static("/static/images/shibai.png")},null,8,["src"])])),_:1}))])),_:1},8,["modelValue"])])),_:1},8,["error-message"]),c(y,{name:"password",label:"密码",class:"loginUniFormItem"},{default:i((()=>[c(p,{type:"password",placeholder:"请输入密码",modelValue:s.model.password,"onUpdate:modelValue":t[1]||(t[1]=e=>s.model.password=e),inputBorder:!1},null,8,["modelValue"])])),_:1}),c(y,{name:"mobile",label:"手机号",class:"mobile loginUniFormItem ss-p-t-10","error-message":s.mobileErrorMsg},{default:i((()=>[c(Ie,{"verify-username":s.verifyUsername,onInput:a},null,8,["verify-username"])])),_:1},8,["error-message"]),c(y,{name:"code",label:"验证码",class:"loginUniFormItem"},{default:i((()=>[c(p,{placeholder:"请输入验证码",modelValue:s.model.code,"onUpdate:modelValue":t[2]||(t[2]=e=>s.model.code=e),inputBorder:!1,type:"number",maxlength:"4"},null,8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),c(f,{style:{display:"flex","justify-content":"space-between","margin-top":"20rpx"}},{default:i((()=>[c(w,{class:"ss-reset-button login-btn-start",onClick:b},{default:i((()=>[h(" 注册 ")])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-b5ad59e6"]]),Qe=be({__name:"reset-password",setup(e){const t=q(null),a=I((()=>S.$store("user").isLogin)),s=y({isMobileEnd:!1,model:{mobile:"",code:"",password:""},rules:{code:Pe,mobile:Ce,password:_e}}),u=async()=>{if(!(await k(t).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await Y.resetUserPassword(s.model);0===e&&J("accountLogin")};return(e,d)=>{const g=m,b=C,y=l(o("uni-easyinput"),xe),v=l(o("uni-forms-item"),ke),w=l(o("uni-forms"),Se);return r(),n(g,null,{default:i((()=>[c(g,{class:"head-box ss-m-b-60"},{default:i((()=>[c(g,{class:"head-title ss-m-b-20"},{default:i((()=>[h("重置密码")])),_:1}),c(g,{class:"head-subtitle"},{default:i((()=>[h("为了您的账号安全,设置密码前请先进行安全验证")])),_:1})])),_:1}),c(w,{ref_key:"resetPasswordRef",ref:t,modelValue:s.model,"onUpdate:modelValue":d[4]||(d[4]=e=>s.model=e),rules:s.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:i((()=>[c(v,{name:"mobile",label:"手机号"},{default:i((()=>[c(y,{placeholder:"请输入手机号",modelValue:s.model.mobile,"onUpdate:modelValue":d[1]||(d[1]=e=>s.model.mobile=e),type:"number",inputBorder:!1},{right:i((()=>[c(b,{class:P(["ss-reset-button code-btn code-btn-start",{"code-btn-end":s.isMobileEnd}]),disabled:s.isMobileEnd,onClick:d[0]||(d[0]=e=>k(Z)("resetPassword",s.model.mobile))},{default:i((()=>[h(f(k(K)("resetPassword")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),c(v,{name:"code",label:"验证码"},{default:i((()=>[c(y,{placeholder:"请输入验证码",modelValue:s.model.code,"onUpdate:modelValue":d[2]||(d[2]=e=>s.model.code=e),type:"number",maxlength:"4",inputBorder:!1},null,8,["modelValue"])])),_:1}),c(v,{name:"password",label:"密码"},{default:i((()=>[c(y,{type:"password",placeholder:"请输入密码",modelValue:s.model.password,"onUpdate:modelValue":d[3]||(d[3]=e=>s.model.password=e),inputBorder:!1},{right:i((()=>[c(b,{class:"ss-reset-button login-btn-start",onClick:u},{default:i((()=>[h(" 确认 ")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),a.value?p("",!0):(r(),n(b,{key:0,class:"ss-reset-button type-btn",onClick:d[5]||(d[5]=e=>k(J)("accountLogin"))},{default:i((()=>[h(" 返回登录 ")])),_:1}))])),_:1})}}},[["__scopeId","data-v-35234133"]]),Xe=be({__name:"change-mobile",setup(e){const t=q(0),a=q(null),s=I((()=>S.$store("user").userInfo)),u=y({isMobileEnd:!1,model:{oldMobile:"",oldCode:"",mobile:"",code:""},rules:{code:Pe,mobile:Ce}});async function d(){if(!(await k(a).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e,data:s}=await G.validatePhone(u.model.oldMobile,u.model.oldCode,2);console.log("下一步的请求校验",s),s&&(t.value=1)}async function p(){if(!(await k(a).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await Y.updateUserMobile({mobile:u.model.mobile,code:u.model.code});0===e&&(ee({icon:"success",title:"修改成功,请重新登录"}),setTimeout((function(){S.$store("user").logout(),Q(),S.$router.go("/pages/index/user")}),1e3))}return(e,g)=>{const b=m,y=C,v=l(o("uni-easyinput"),xe),w=l(o("uni-forms-item"),ke),_=l(o("uni-forms"),Se);return r(),n(b,null,{default:i((()=>[c(b,{class:"head-box ss-m-b-60"},{default:i((()=>[c(b,{class:"head-title ss-m-b-20"},{default:i((()=>[h(f(s.value.mobile?"更换手机号":"绑定手机号"),1)])),_:1}),c(b,{class:"head-subtitle"},{default:i((()=>[h("为了您的账号安全,请使用本人手机号码")])),_:1})])),_:1}),t.value?(r(),n(_,{key:1,ref_key:"changeMobileRef",ref:a,modelValue:u.model,"onUpdate:modelValue":g[7]||(g[7]=e=>u.model=e),rules:u.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:i((()=>[c(w,{name:"mobile",label:"新手机号"},{default:i((()=>[c(v,{placeholder:"请输入新手机号",modelValue:u.model.mobile,"onUpdate:modelValue":g[5]||(g[5]=e=>u.model.mobile=e),inputBorder:!1,type:"number"},{right:i((()=>[c(y,{class:P(["ss-reset-button code-btn-start",{"code-btn-end":u.isMobileEnd}]),disabled:u.isMobileEnd,onClick:g[4]||(g[4]=e=>k(Z)("changeMobileNew",u.model.mobile))},{default:i((()=>[h(f(k(K)("changeMobileNew")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),c(w,{name:"code",label:"验证码"},{default:i((()=>[c(v,{placeholder:"请输入验证码",modelValue:u.model.code,"onUpdate:modelValue":g[6]||(g[6]=e=>u.model.code=e),inputBorder:!1,type:"number",maxlength:"4"},null,8,["modelValue"])])),_:1}),c(y,{class:"ss-reset-button login-btn-start",onClick:p},{default:i((()=>[h(" 确定 ")])),_:1})])),_:1},8,["modelValue","rules"])):(r(),n(_,{key:0,ref_key:"changeMobileRef",ref:a,modelValue:u.model,"onUpdate:modelValue":g[3]||(g[3]=e=>u.model=e),rules:u.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:i((()=>[c(w,{name:"mobile",label:"原手机号"},{default:i((()=>[c(v,{placeholder:"请输入原手机号",modelValue:u.model.oldMobile,"onUpdate:modelValue":g[1]||(g[1]=e=>u.model.oldMobile=e),inputBorder:!1,type:"number"},{right:i((()=>[c(y,{class:P(["ss-reset-button code-btn-start",{"code-btn-end":u.isMobileEnd}]),disabled:u.isMobileEnd,onClick:g[0]||(g[0]=e=>k(Z)("changeMobileOld",u.model.oldMobile))},{default:i((()=>[h(f(k(K)("changeMobileOld")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),c(w,{name:"code",label:"验证码"},{default:i((()=>[c(v,{placeholder:"请输入验证码",modelValue:u.model.oldCode,"onUpdate:modelValue":g[2]||(g[2]=e=>u.model.oldCode=e),inputBorder:!1,type:"number",maxlength:"4"},null,8,["modelValue"])])),_:1}),c(y,{class:"ss-reset-button login-btn-start",onClick:d},{default:i((()=>[h(" 下一步 ")])),_:1})])),_:1},8,["modelValue","rules"]))])),_:1})}}},[["__scopeId","data-v-d18a72fa"]]),Ze=be({__name:"change-password",setup(e){const t=q(null),a=y({isMobileEnd:!1,model:{mobile:"",code:"",password:""},rules:{code:Pe,password:_e}});async function s(){/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+\S{5,12}$/.test(a.model.password)||(console.log(123),ee({icon:"error",title:"需包含字母和数字,长度在6-12之间"}));if(!(await k(t).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await Y.updateUserPassword(a.model);0===e&&(ee({icon:"success",title:"修改成功,请重新登录"}),setTimeout((function(){S.$store("user").logout(),Q(),S.$router.go("/pages/index/user")}),1e3))}return(e,u)=>{const d=m,p=C,g=l(o("uni-easyinput"),xe),b=l(o("uni-forms-item"),ke),y=l(o("uni-forms"),Se);return r(),n(d,null,{default:i((()=>[c(d,{class:"head-box ss-m-b-60"},{default:i((()=>[c(d,{class:"head-title ss-m-b-20"},{default:i((()=>[h("修改密码")])),_:1}),c(d,{class:"head-subtitle"},{default:i((()=>[h("如密码丢失或未设置,请点击忘记密码重新设置")])),_:1})])),_:1}),c(y,{ref_key:"changePasswordRef",ref:t,modelValue:a.model,"onUpdate:modelValue":u[3]||(u[3]=e=>a.model=e),rules:a.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:i((()=>[c(b,{name:"code",label:"验证码"},{default:i((()=>[c(g,{placeholder:"请输入验证码",modelValue:a.model.code,"onUpdate:modelValue":u[1]||(u[1]=e=>a.model.code=e),type:"number",maxlength:"4",inputBorder:!1},{right:i((()=>[c(p,{class:P(["ss-reset-button code-btn code-btn-start",{"code-btn-end":a.isMobileEnd}]),disabled:a.isMobileEnd,onClick:u[0]||(u[0]=e=>k(Z)("changePassword"))},{default:i((()=>[h(f(k(K)("changePassword")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),c(b,{name:"reNewPassword",label:"密码"},{default:i((()=>[c(g,{type:"password",placeholder:"请输入密码",modelValue:a.model.password,"onUpdate:modelValue":u[2]||(u[2]=e=>a.model.password=e),inputBorder:!1},{right:i((()=>[c(p,{class:"ss-reset-button login-btn-start",onClick:s},{default:i((()=>[h(" 确认 ")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),c(p,{class:"ss-reset-button type-btn",onClick:k(Q)},{default:i((()=>[h(" 取消修改 ")])),_:1},8,["onClick"])])),_:1})}}},[["__scopeId","data-v-c224f730"]]),Ke=be({__name:"mp-authorization",props:{agreeStatus:{type:Boolean,default:!1}},setup(e){const t=I((()=>S.$store("user").userInfo)),a=q(null),s=y({model:{nickname:t.value.nickname,avatar:t.value.avatar},rules:{},disabledStyle:{color:"#999",disableColor:"#fff"}});function u(e){!async function(e){if(!e)return;let{data:t}=await te.uploadFile(e);s.model.avatar=t}(e.detail.avatarUrl||"")}async function d(){const{model:e}=s,{nickname:t,avatar:a}=e;if(!t)return void S.$helper.toast("请输入昵称");if(!a)return void S.$helper.toast("请选择头像");const{code:l}=await Y.updateUser({avatar:s.model.avatar,nickname:s.model.nickname});0===l&&(S.$helper.toast("授权成功"),await S.$store("user").getInfo(),Q())}return(e,t)=>{const f=m,p=E,g=b,y=C,v=l(o("uni-forms-item"),ke),w=l(o("uni-easyinput"),xe),_=l(o("uni-forms"),Se);return r(),n(f,null,{default:i((()=>[c(f,{class:"head-box ss-m-b-60 ss-flex-col"},{default:i((()=>[c(f,{class:"ss-flex ss-m-b-20"},{default:i((()=>[c(f,{class:"head-title ss-m-r-40 head-title-animation"},{default:i((()=>[h("授权信息")])),_:1})])),_:1}),c(f,{class:"head-subtitle"},{default:i((()=>[h("完善您的头像、昵称、手机号")])),_:1})])),_:1}),c(_,{ref_key:"accountLoginRef",ref:a,modelValue:s.model,"onUpdate:modelValue":t[2]||(t[2]=e=>s.model=e),rules:s.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:i((()=>[c(v,{name:"avatar",label:"头像"},{default:i((()=>[c(y,{class:"ss-reset-button avatar-btn","open-type":"chooseAvatar",onChooseavatar:u},{default:i((()=>[c(p,{class:"avatar-img",src:k(S).$url.cdn(s.model.avatar),mode:"aspectFill",onClick:t[0]||(t[0]=e=>k(S).$router.go("/pages/user/info"))},null,8,["src"]),c(g,{class:"cicon-forward"})])),_:1})])),_:1}),c(v,{name:"nickname",label:"昵称"},{default:i((()=>[c(w,{type:"nickname",placeholder:"请输入昵称",modelValue:s.model.nickname,"onUpdate:modelValue":t[1]||(t[1]=e=>s.model.nickname=e),inputBorder:!1},null,8,["modelValue"])])),_:1}),c(f,{class:"foot-box"},{default:i((()=>[c(y,{class:"ss-reset-button authorization-btn",onClick:d},{default:i((()=>[h(" 确认授权 ")])),_:1})])),_:1})])),_:1},8,["modelValue","rules"])])),_:1})}}},[["__scopeId","data-v-b00d5530"]]),Je=be({__name:"officialAccountFirstLogin",emits:["onConfirm"],setup(e,{emit:t}){const a=q(null),s=y({isMobileEnd:!1,codeText:"获取验证码",model:{mobile:"",code:""},rules:{code:Pe,mobile:Ce}});async function u(){if(!(await k(a).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await G.smsLogin(s.model);0===e&&Q()}return(e,t)=>{const d=m,p=C,g=l(o("uni-easyinput"),xe),b=l(o("uni-forms-item"),ke),y=l(o("uni-forms"),Se);return r(),n(d,null,{default:i((()=>[c(d,{class:"head-box"},{default:i((()=>[c(d,{class:"ss-flex ss-m-b-20"},{default:i((()=>[c(d,{class:"isActive head-title"},{default:i((()=>[h(" 您首次登录,请输入手机号验证 ")])),_:1})])),_:1})])),_:1}),c(y,{ref_key:"smsLoginRef",ref:a,modelValue:s.model,"onUpdate:modelValue":t[3]||(t[3]=e=>s.model=e),rules:s.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center",class:"loginUniForm"},{default:i((()=>[c(b,{name:"mobile",label:"手机号",class:"loginUniFormItem"},{default:i((()=>[c(g,{placeholder:"请输入手机号",modelValue:s.model.mobile,"onUpdate:modelValue":t[1]||(t[1]=e=>s.model.mobile=e),inputBorder:!1,type:"number"},{right:i((()=>[c(p,{class:P(["ss-reset-button code-btn code-btn-start",{"code-btn-end":s.isMobileEnd}]),disabled:s.isMobileEnd,onClick:t[0]||(t[0]=e=>k(Z)("smsLogin",s.model.mobile))},{default:i((()=>[h(f(k(K)("smsLogin")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),c(b,{name:"code",label:"验证码",class:"loginUniFormItem"},{default:i((()=>[c(g,{placeholder:"请输入验证码",modelValue:s.model.code,"onUpdate:modelValue":t[2]||(t[2]=e=>s.model.code=e),inputBorder:!1,type:"number",maxlength:"4"},null,8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),c(d,{style:{display:"flex","justify-content":"space-between","margin-top":"20rpx"}},{default:i((()=>[c(p,{class:"ss-reset-button login-btn-start",onClick:u},{default:i((()=>[h(" 继续登录 ")])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-ed448707"]]),Ye=be({__name:"s-auth-modal",setup(e){I((()=>S.$store("app").info));const t=X("linkId"),a=S.$store("modal"),s=I((()=>a.auth)),u=I((()=>a.isActive)),d=y({protocol:!1}),f=q(!1);function g(){d.protocol=!d.protocol}function v(e){Q(),S.$router.go("/pages/public/richtext",{title:e})}function w(e){f.value=e,setTimeout((()=>{f.value=!1}),1e3)}return(e,a)=>{const y=m,_=ae,C=se,I=E,A=b,B=l(o("su-popup"),ve);return r(),n(B,{show:""!==s.value,round:"10",showClose:!0,onClose:k(Q)},{default:i((()=>[c(y,{class:"login-wrap"},{default:i((()=>[["smsLogin","accountLogin","register"].includes(s.value)?(r(),n(y,{key:0,class:"head-box"},{default:i((()=>[c(y,{class:"ss-flex ss-m-b-20"},{default:i((()=>[c(y,{class:P(["accountLogin"==u.value?"head-title ss-m-r-40 head-title-animation":"head-title-active ss-m-r-40"]),onClick:a[0]||(a[0]=e=>{u.value="accountLogin",k(J)("accountLogin","accountLogin")})},{default:i((()=>[h(" 账号登录 ")])),_:1},8,["class"]),c(y,{class:P(["smsLogin"==u.value?"head-title head-title-line head-title-animation ss-m-r-40":" ss-m-r-40 head-title-active head-title-line"]),onClick:a[1]||(a[1]=e=>{u.value="smsLogin",k(J)("smsLogin","smsLogin")})},{default:i((()=>[h(" 短信登录 ")])),_:1},8,["class"]),k(t)?(r(),n(y,{key:0,class:P(["register"==u.value?"head-title head-title-line head-title-animation":"head-title-active head-title-line"]),onClick:a[2]||(a[2]=e=>{u.value="register",k(J)("register","register")})},{default:i((()=>[h(" 注册 ")])),_:1},8,["class"])):p("",!0)])),_:1})])),_:1})):p("",!0),["smsLogin","accountLogin","register"].includes(s.value)?(r(),n(y,{key:1,class:P(["agreement-box ss-flex ss-row-center",{shake:f.value}])},{default:i((()=>[c(C,{class:"radio ss-flex ss-col-center",onClick:g},{default:i((()=>[c(_,{checked:d.protocol,color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:x(g,["stop"])},null,8,["checked"]),c(y,{class:"agreement-text ss-flex ss-col-center ss-m-l-8"},{default:i((()=>[h(" 我已阅读并遵守 "),c(y,{class:"tcp-text",onClick:a[3]||(a[3]=x((e=>v("用户协议")),["stop"]))},{default:i((()=>[h(" 《用户协议》 ")])),_:1}),c(y,{class:"agreement-text"},{default:i((()=>[h("与")])),_:1}),c(y,{class:"tcp-text",onClick:a[4]||(a[4]=x((e=>v("隐私协议")),["stop"]))},{default:i((()=>[h(" 《隐私协议》 ")])),_:1})])),_:1})])),_:1})])),_:1},8,["class"])):p("",!0),["accountLogin","smsLogin"].includes(s.value)?(r(),n(y,{key:2,class:"auto-login-box ss-flex ss-flex-col ss-row-center ss-col-center"},{default:i((()=>[["WechatOfficialAccount","WechatMiniProgram","App"].includes(k(S).$platform.name)&&k(S).$platform.isWechatInstalled?(r(),n(y,{key:0,class:"wx-login-btn",onClick:a[5]||(a[5]=e=>(async e=>{if(!d.protocol)return f.value=!0,setTimeout((()=>{f.value=!1}),1e3),void S.$helper.toast("请勾选同意");await S.$platform.useProvider(e).login()&&Q()})("wechat"))},{default:i((()=>[c(I,{class:"auto-login-img",src:k(S).$url.static("/static/images/wechat.png")},null,8,["src"]),c(A,null,{default:i((()=>[h("微信授权登录")])),_:1})])),_:1})):p("",!0)])),_:1})):p("",!0),["register"].includes(s.value)?(r(),n(y,{key:3,class:"auto-login-box ss-flex ss-flex-col ss-row-center ss-col-center"},{default:i((()=>[["WechatOfficialAccount","WechatMiniProgram","App"].includes(k(S).$platform.name)&&k(S).$platform.isWechatInstalled?(r(),n(y,{key:0,class:"wx-login-btn",onClick:a[6]||(a[6]=e=>(async e=>{if(!d.protocol)return f.value=!0,setTimeout((()=>{f.value=!1}),1e3),void S.$helper.toast("请勾选同意");if(!X("linkId"))return S.$helper.toast("您只能通过分享注册"),!1;await S.$platform.useProvider(e).register()&&Q()})("wechat"))},{default:i((()=>[c(I,{class:"auto-login-img",src:k(S).$url.static("/static/images/wechat.png")},null,8,["src"]),c(A,null,{default:i((()=>[h("微信授权注册")])),_:1})])),_:1})):p("",!0)])),_:1})):p("",!0),"officialAccountFirstLogin"===s.value?(r(),n(k(Je),{key:4,agreeStatus:d.protocol,onOnConfirm:w},null,8,["agreeStatus"])):p("",!0),"accountLogin"===s.value?(r(),n(We,{key:5,agreeStatus:d.protocol,onOnConfirm:w},null,8,["agreeStatus"])):p("",!0),"smsLogin"===s.value?(r(),n(qe,{key:6,agreeStatus:d.protocol,onOnConfirm:w},null,8,["agreeStatus"])):p("",!0),"register"===s.value?(r(),n(Ge,{key:7,agreeStatus:d.protocol,onOnConfirm:w},null,8,["agreeStatus"])):p("",!0),"resetPassword"===s.value?(r(),n(Qe,{key:8})):p("",!0),"changeMobile"===s.value?(r(),n(Xe,{key:9})):p("",!0),"changePassword"===s.value?(r(),n(Ze,{key:10})):p("",!0),"mpAuthorization"===s.value?(r(),n(Ke,{key:11})):p("",!0),c(y,{class:"safe-box"})])),_:1})])),_:1},8,["show","onClose"])}}},[["__scopeId","data-v-f4a9c249"]]);var et,at={exports:{}};et=at,function(){var a;const s=b(typeof uni)?"uni":b(typeof window)&&b(typeof document)?"web":"node",l="uni"==s,o="node"==s,r="web"==s,n={},i={},c=Object.freeze(["init","initAsyncDrawMode","initArgs","initCanvas","handleCtx","initData","draw","toImage","updateCanvasWH","clear","restoreAsyncDrawMode"]),u=Object.freeze(["setPaintbrush","setPaintbrushProp","resetPaintbrush","savePaintbrush","restorePaintbrush","calcText","calcImg","measureText","loadImage"]),d=Object.freeze(["setPaintbrush","setPaintbrushProp","resetPaintbrush","savePaintbrush","restorePaintbrush","drawText","drawStraightLine","drawDoubleStraightLine","drawDotted","drawDottedStraightLine","drawLine","drawTextDecoration","drawImg","drawQrCode","setCircle","setRect"]),h=Object.freeze(["setPaintbrush","setPaintbrushProp","resetPaintbrush","savePaintbrush","restorePaintbrush","drawText","drawStraightLine","drawDoubleStraightLine","drawDotted","drawDottedStraightLine","drawLine","drawTextDecoration","drawImg","drawQrCode","setCircle","setRect","calcText","calcImg","measureText","loadImage","drawArray","drawItem"]),f=Object.freeze(["drawText","drawImg"]),p=Object.freeze(["drawImage","putImageData","getImageData","createImageData","addPage","save","restore","rotate","translate","transform","getTransform","resetTransform","setTransform","isPointInPath","scale","clip","fill","stroke","fillText","strokeText","fillRect","strokeRect","clearRect","rect","measureText","moveTo","lineTo","bezierCurveTo","quadraticCurveTo","beginPath","closePath","arc","arcTo","ellipse","setLineDash","getLineDash","createPattern","createLinearGradient","createRadialGradient"]);let m,g=1;function b(e){return"undefined"!=String(e)}function y(e){return!((e||0==e)&&!["undefined","null"].includes(String(e)))}const v=class{constructor(e,t){((e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)})(this,a,void 0),this._id=g++,i[this._id]=t,e&&this.init(e)}init(t={}){this.initArgs(t).initData().initCanvas().handleCtx().resetPaintbrush(),!0===this._data.asyncDrawMode&&(((t,a,s,l)=>{e(t,a,"write to private field"),l?l.call(t,s):a.set(t,s)})(this,a,new v({asyncDrawMode:!1})),this.initAsyncDrawMode())}initAsyncDrawMode(){if(l)return;const e=this._data.ctxMethods,t=[...new Set([...h,...e])];for(let a=0;a<t.length;a++){const e=t[a];this.handleAsyncDrawModeItem(e)}}handleAsyncDrawModeItem(e){if(!l)if(c.includes(e))console.log("白名单跳过");else if("function"==typeof this[e]){this._data.nMethods[e]||(this._data.nMethods[e]=this[e]);let s=this;this[e]=function(){let l;return u.includes(e)&&(l=t(s,a)[e](...arguments)),l&&l!==s&&l!==t(s,a)?l:((d.includes(e)||s._data.ctxMethods.includes(e))&&s._data.asyncDrawQueue.push({method:e,args:arguments}),f.includes(e)?t(s,a)[e](...arguments):void 0)}}}restoreAsyncDrawMode(){if(l)return;const e=this._data.nMethods;for(const t in e)this[t]=e[t]}initArgs(e={}){return this._args=e,this}initCanvas(){const e=function(e,t){if(l&&!t.canvasId)throw new Error("canvasId 不能为空");let a,o={};switch(s){case"uni":a=ne(t.canvasId,e),o.canvas=a,o.ctx=a;break;case"web":a=(null==t?void 0:t.canvasId)?document.getElementById(null==t?void 0:t.canvasId):document.createElement("canvas"),a.width=(null==t?void 0:t.width)||10,a.height=(null==t?void 0:t.height)||10,o.canvas=a,o.ctx=a.getContext("2d");break;case"node":a=m.createCanvas((null==t?void 0:t.width)||10,(null==t?void 0:t.height)||10),o.canvas=a,o.ctx=a.getContext("2d")}return o}(i[this._id],this._args);return this.canvas=e.canvas,this.ctx=e.ctx,this}handleCtx(){const e=this.ctx,t=t=>{this._data.ctxMethods.push(t),this[t]=e[t].bind(e)};for(const a in e)"function"==typeof e[a]&&(this[a]||t(a));for(let a=0;a<p.length;a++){const s=p[a];"function"==typeof e[s]&&(this[s]||t(s))}return this}initData(){return this._data={oldPaintbrushProps:{},savedPaintbrushProps:[],font:{fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontSize:10,fontFamily:"sans-serif"},height:this._args.height||10,width:this._args.width||10,whChange:!1,asyncDrawQueue:[],nMethods:{},asyncDrawMode:!(!o&&!r)&&!1!==this._args.asyncDrawMode,ctxMethods:[]},this}setPaintbrush(e={}){!function(e){switch(null==e?void 0:e.textBaseline){case"normal":l&&(e.textBaseline="alphabetic");break;case"hanging":l&&(e.textBaseline="top");break;case"ideographic":l&&(e.textBaseline="bottom")}switch(null==e?void 0:e.textAlign){case"start":e.textAlign="left";break;case"end":e.textAlign="right"}}(e);for(const t in e)this.setPaintbrushProp(t,e[t]);return this}setPaintbrushProp(e,t){if(y(e)||y(t))return;e=function(e){if(!e)return"";const t=e.split("-");for(var a=1;a<t.length;a++)t[a]=t[a].charAt(0).toUpperCase()+t[a].substring(1);return t.join("")}(e);const a=this.ctx;if("font"==e){if(t){if("object"!=typeof t)return void console.warn("font属性需Object格式");for(const e in t)y(t[e])&&delete t[e];const s={...this._data.font,...t};l&&(s.fontSize=Math.round(s.fontSize)),this._data.font=s;const o=this._data.font;this._data.oldPaintbrushProps[e]=o;const r=()=>{a.font=`${o.fontStyle||"normal"} ${o.fontVariant||"normal"} ${o.fontWeight||"normal"} ${o.fontSize??10}px ${o.fontFamily||"sans-serif"}`};r()}}else{this._data.oldPaintbrushProps[e]=t;const s="set"+e[0].toUpperCase()+e.slice(1);"function"==typeof(null==a?void 0:a[s])?a[s](t):a[e]=t}return this}resetPaintbrush(e={}){return this.setPaintbrush({fillStyle:"#000000",strokeStyle:"#000000",shadowColor:"#000000",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineCap:"butt",lineJoin:"miter",lineWidth:1,miterLimit:10,font:this._data.font,textAlign:"start",textBaseline:"top",globalAlpha:1,globalCompositeOperation:"source-over",...e}),this}saveAndSetPaintbrush(e={}){return this.savePaintbrush(),this.setPaintbrush(e),this}savePaintbrush(){return this._data.savedPaintbrushProps.unshift({...this._data.oldPaintbrushProps}),this}restorePaintbrush(){const e=this._data.savedPaintbrushProps.shift();return e&&(this._data.oldPaintbrushProps={...this._data.oldPaintbrushProps,...e}),this.resetPaintbrush({...this._data.oldPaintbrushProps}),this}updateCanvasWH(e={}){var t,a,s;let{width:o,height:r,delay:n}=e,i=null==(t=this._args)?void 0:t.setCanvasWH;return o=o||(null==(a=this._data)?void 0:a.width)||10,r=r||(null==(s=this._data)?void 0:s.height)||10,new Promise(((e,t)=>{if(l){if(!i||"function"!=typeof i)return void t("setCanvasWH异常, uni-app 请在初始化时传入setCanvasWH函数");i({height:r,width:o}),setTimeout((()=>{e()}),n??50)}else this.canvas.height=r,this.canvas.width=o,e()})).then((e=>{this._data.width==o&&this._data.height==r||(this._data.whChange=!0),this._data.width=o,this._data.height=r,this._data.asyncDrawMode||this.resetPaintbrush(this._data.oldPaintbrushProps)}))}clear(){return this.ctx.clearRect(0,0,this._data.width||999999,this._data.height||999999),this}draw(e={}){const{reserve:t}=e;return new Promise(((e,a)=>{if(l){let a=!1;const s=setTimeout((()=>{a?clearTimeout(s):e()}),3e3);this.ctx.draw(t??!1,(()=>{a=!0,clearTimeout(s),e()}))}else if(this._data.asyncDrawMode){!0!==t&&this.clear(),this.restoreAsyncDrawMode(),this.resetPaintbrush();const s=this._data.asyncDrawQueue;new Promise((async(e,t)=>{for(let l=0;l<s.length;l++){const e=s[l];try{const t=this[e.method].call(this,...e.args);"function"==typeof(null==t?void 0:t.then)&&await t}catch(a){return void t(a)}}e()})).then((()=>{this._data.asyncDrawQueue=[],this.initAsyncDrawMode(),e()})).catch((e=>{this.initAsyncDrawMode(),a(e)}))}else e()}))}toImage(e={}){return new Promise(((t,a)=>{if(l){const s=this._args.canvasId;if(!s)return void a("canvasId不存在");le({...e,canvasId:s,success:a=>{var s;null==(s=e.success)||s.call(e,a),t(a.tempFilePath)},fail:t=>{var s;null==(s=e.fail)||s.call(e,t),a(t)}},i[this._id])}else t(this.canvas.toDataURL("image/"+(["jpg","jpeg"].includes(e.fileType)?"jpeg":"png"),e.quality??1))}))}calcText(e={}){const t=e.line||-1;return new Promise(((a,s)=>{try{let s=function(t,a){let s=0;const o=l(t).width;if(a){if(o<e.maxWidth||t.length<2)return{index:t.length,ellipsis:!1,width:o};s=l("...").width}const r=o+s;if(r<e.maxWidth||t.length<2)return{index:t.length,ellipsis:!1,width:r};let n,i=!0,c=Math.floor((t.length+1)/2),u=1,d="";for(;i;){if(c<=1){i=!1;break}if(c>t.length){c=t.length,i=!1;break}const a=t.substr(0,c);n=l(a).width+s,n>e.maxWidth?(t=a,"xy"==d&&Math.abs(u-c)<1?i=!1:(d="dy",u=c,c=Math.floor((a.length+1)/2))):n==e.maxWidth||c<=1||Math.abs(u-c)<1?i=!1:(d="xy",u=c,c+=Math.floor((t.length-c)/2))}return{index:c,ellipsis:a,width:n}};this.saveAndSetPaintbrush({...e.paintbrushProps||{}});const l=this.measureText;let o=[],r=e.val,n=0;const i={...this._data.font};if(e.maxWidth){let a=0;for(;r.length;){const l=t>0&&o.length+1>=t,{index:n,ellipsis:c,width:u}=s(r,l),d=r.substr(0,n);o.push({...e,val:d,y:a?e.y+(i.fontSize+(e.lineHeight||0))*a:e.y,width:u}),l?(c&&(o[o.length-1].val+="..."),r=""):r=r.slice(n),a++}n=1==o.length?o[0].width:o.length>1?e.maxWidth:0}else o=[e],n=l(e.val).width;this.restorePaintbrush(),a({...e,calcTexts:o,_calc:!0,left:e.x,top:e.y,right:e.x+n,bottom:o[o.length-1].y+i.fontSize,width:n,height:o[o.length-1].y+i.fontSize-e.y,fontSize:i.fontSize})}catch(l){s(l)}}))}drawText(e={}){return new Promise((async(t,a)=>{try{if(!e.val)return console.warn("需绘制的文本为空"),void t();this.saveAndSetPaintbrush({...e.paintbrushProps||{}});const a=e=>{this.fillText(e.val,e.x,e.y)},s=e=>{a(e),e.textDecoration&&this.drawTextDecoration(e)},l=e._calc?e:await this.calcText(e);for(let e=0;e<l.calcTexts.length;e++)s(l.calcTexts[e]);this.restorePaintbrush(),t(l)}catch(s){a(s)}}))}drawStraightLine(e={}){const{x1:t,y1:a,x2:s,y2:l,paintbrushProps:o}=e,r=this.ctx;r.beginPath(),r.moveTo(t,a),r.lineTo(s,l),this.saveAndSetPaintbrush(o||{}),r.stroke(),this.restorePaintbrush()}drawDoubleStraightLine(e={}){let{gap:t}=e;t=t??1,this.drawStraightLine(e),this.drawStraightLine({...e,y1:e.y1+t,y2:e.y2+t})}drawDotted(e={}){this.setCircle(e),e.clip&&(e.clip=!1),this.saveAndSetPaintbrush(e.paintbrushProps||{}),this.ctx.fill(),this.restorePaintbrush()}drawDottedStraightLine(e={}){let{x1:t,x2:a,y1:s,y2:l,gap:o,width:r,paintbrushProps:n}=e;a-=r,o=o||1;const i=Math.sqrt(Math.pow(t-a,2)+Math.pow(s-l,2)),c=function(e,t,a,s,l,o){let r,n,i,c,u,d=[];if(e===a)r=e+(s-t)*o,n=t+(s-t)/2,i=(e-r)**2+(t-n)**2;else if(t===s)r=e+(a-e)/2,n=t-(a-e)*o,i=(e-r)**2+(t-n)**2;else{let l=(e+a)/2,d=(t+s)/2;c=(a-e)/(t-s);let h=d-c*l,f=1+c**2,p=2*c*(h-d)-2*l,m=l**2+(h-d)**2-((a-e)**2+(s-t)**2)*o**2;u=-1/c,r=(-p+Math.sqrt(p**2-4*f*m)*(u>0&&a>e||u<0&&a<e?1:-1))/(2*f),n=c*r+h,i=(e-r)**2+(t-n)**2}if(e===a||Math.abs(u)>1){let e=(s-t)/(l+1);for(let a=0;a<l;a++){let l=t+e*(a+1),o=Math.sqrt(i-(l-n)**2)*(s>t?-1:1)+r;d.push([o,l])}}else{let t=(a-e)/(l+1);for(let s=0;s<l;s++){let l=e+t*(s+1),o=Math.sqrt(i-(l-r)**2)*(a>e?1:-1)+n;d.push([l,o])}}return d}(t,s,a,l,Math.floor((i-o)/(r+o)),9999999999);this.saveAndSetPaintbrush(n),this.drawDotted({x:t,y:s,d:r});for(let u=0;u<c.length;u++)this.drawDotted({x:c[u][0],y:c[u][1],d:r});this.drawDotted({x:a,y:l,d:r}),this.restorePaintbrush()}drawLine(e={}){const{style:t}=e;switch(t){case"double":e.gap=1.5*(e.width||1),this.drawDoubleStraightLine(e);break;case"solide":this.drawStraightLine(e);break;case"dotted":e.gap=1.5*(e.gap||1),e.paintbrushProps={fillStyle:e.color},this.drawDottedStraightLine(e)}}drawTextDecoration(e={}){this.savePaintbrush();const t=this._data.oldPaintbrushProps,a=this.measureText(e.val).width,s=e.textDecoration,l=s.line||"line-through",o=s.color||e.color||t.fillStyle||"#000000",r=s.thickness||s.width||!!e.fontSize&&.1*e.fontSize||1,n=s.style||"solide",i=s.offset||0,c=s.gap??1,u=e.fontSize||this._data.font.fontSize;this.setPaintbrush({lineWidth:r,strokeStyle:o});let d=0;switch(l){case"line-through":d=e.y+u/2-r/2;break;case"underline":d=e.y+u;break;case"overline":d=e.y}switch(t.textBaseline){case"top":d+=r/2;break;case"bottom":d-=u;break;case"center":d-=u/2}switch(d+=i,l){case"line-through":case"underline":case"overline":this.drawLine({x1:e.x,y1:d,x2:e.x+a,y2:d,style:n,gap:c,width:r,color:o})}this.restorePaintbrush()}drawImg(e={}){return new Promise((async(t,a)=>{try{if(!e.val)return console.warn("需绘制的图片为空"),void t();const a=e._calc?e:await this.calcImg(e);(null==a?void 0:a.drawImageArgs)&&Array.isArray(a.drawImageArgs)&&this.ctx.drawImage(...(null==a?void 0:a.drawImageArgs)||[]),t(a)}catch(s){a(s)}}))}calcImg(e={}){return new Promise((async(t,a)=>{try{if(!e.val)return console.warn("需绘制的图片为空"),void t();const a=await this.loadImage(e.val),s=e.mode||"scaleToFill";let o,r=e.x||0,n=e.y||0,i=e.width||0,c=e.height||0,u=a.width,d=a.height,h=0,f=0;const p=()=>[h,f,u,d,r,n,i,c];switch(s){case"aspectFit":c=a.height/a.width*i,c<e.height?n=Number(e.y)+e.height/2-c/2:(c=e.height,i=a.width/a.height*c,r=Number(e.x)+e.width/2-i/2),o=p();break;case"aspectFill":c=a.height/a.width*i,c<e.height?(c=e.height,h=a.width/a.height*e.height,h=(h-e.width)/h*a.width/2,u=a.width-2*h):(f=(c-e.height)/c*a.height/2,d=a.height-2*f),i=e.width,c=e.height,o=p();break;case"widthFix":c=e.height=a.height/a.width*e.width,o=[r,n,i,c];break;case"heightFix":i=e.width=a.width/a.height*e.height,o=[r,n,i,c];break;default:o=[r,n,i,c]}o.unshift(l?a.toString():a),t({...e,drawImageArgs:[...o],img:a,left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height,_calc:!0})}catch(s){a(s)}}))}drawQrCode(e={}){return new Promise(((t,a)=>{if(!(null==e?void 0:e.val))return console.warn("绘制二维码val为空"),void t();this.savePaintbrush();let s=[],l={text:String(e.val||"")||"",size:Number(e.size||0)||200,background:String(e.background||"")||"#ffffff",foreground:String(e.foreground||"")||"#000000",pdground:String(e.pdground||"")||"#000000",correctLevel:Number(e.correctLevel||0)||3,dx:Number(e.x||0)||0,dy:Number(e.y||0)||0},o=null,r=0;for(var n=0,i=s.length;n<i;n++)if(r=n,s[n].text==l.text&&s[n].text.correctLevel==l.correctLevel){o=s[n].obj;break}r==i&&(o=new _(l.text,l.correctLevel),s.push({text:l.text,correctLevel:l.correctLevel,obj:o}));let c=function(e){let t=e.options;return t.pdground&&(e.row>1&&e.row<5&&e.col>1&&e.col<5||e.row>e.count-6&&e.row<e.count-2&&e.col>1&&e.col<5||e.row>1&&e.row<5&&e.col>e.count-6&&e.col<e.count-2)?t.pdground:t.foreground},u=o.getModuleCount(),d=l.size,h=d/u,f=d/u;for(let e=0;e<u;e++)for(let t=0;t<u;t++){let a=(t+1)*h-t*h,s=(e+1)*h-e*h,r=c({row:e,col:t,count:u,options:l});this.setPaintbrush({fillStyle:o.modules[e][t]?r:l.background}),this.ctx.fillRect(l.dx+t*h,l.dy+e*f,a,s)}this.restorePaintbrush(),t({...e,height:e.size,width:e.size,left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.size})}))}setCircle(e={}){const t=this.ctx;let{x:a,y:s,d:l,mode:o}=e;o=o||"leftTop";const r=l/2;switch(e.clip&&t.save(),t.beginPath(),o){case"leftTop":t.arc(a+r,s+r,r,0,2*Math.PI);break;case"center":t.arc(a,s,r,0,2*Math.PI)}return t.closePath(),e.clip&&t.clip(),this}setRect(e={}){const t=this.ctx,{x:a,y:s,r:l,height:o,width:r}=e;return e.clip&&t.save(),t.beginPath(),l&&l>0?(t.arc(a+l,s+l,l,1*Math.PI,1.5*Math.PI),t.lineTo(a+r-l,s),t.arc(a+r-l,s+l,l,1.5*Math.PI,0),t.lineTo(a+r,s+o-l),t.arc(a+r-l,s+o-l,l,0,.5*Math.PI),t.lineTo(a+l,s+o),t.arc(a+l,s+o-l,l,.5*Math.PI,1*Math.PI),t.lineTo(a,s+l)):(t.moveTo(a,s),t.lineTo(a+r,s),t.lineTo(a+r,s+o),t.lineTo(a,s+o),t.lineTo(a,s)),t.closePath(),e.clip&&t.clip(),this}loadImage(e){return new Promise((async(t,a)=>{if(!e)return console.warn("加载图片url为空"),void t();if(n[e])return void t(n[e]);let l;try{switch(s){case"uni":l=await new Promise(((t,a)=>{if(e._loaded)t(e);else if(~e.indexOf("data:image")){let s=e,l={};k.base64ToPath(e).then((e=>{s=e,oe({src:s,success:e=>{l=e;const a=new String(s);for(const t in l)a[t]=l[t];a._loaded=!0,t(a)},fail:e=>a(e)})})).catch((e=>{a(e)}))}else"http"==e.substr(0,4)?re({url:e,success:({tempFilePath:e})=>{oe({src:e,success:a=>{const s=new String(e);for(const e in a)s[e]=a[e];s._loaded=!0,t(s)},fail:e=>a(e)})},fail:e=>a(e)}):oe({src:e,success:a=>{const s=new String(e);for(const e in a)s[e]=a[e];s._loaded=!0,t(s)},fail:e=>a(e)})}));break;case"web":l=await new Promise(((t,a)=>{if("string"!=typeof e)return void t(e);const s=new Image;s.onload=()=>{t(s)},s.onerror=e=>{a(e)},s.src=e}));break;case"node":l=await new Promise(((t,a)=>{"string"==typeof e?m.loadImage(e).then((e=>{t(e)})).catch((e=>{a(e)})):t(e)}))}}catch(o){a(o)}n[e]=l,t(l)}))}drawArray(e){return new Promise((async(t,a)=>{try{if(!e)return void a("drawArray需绘制参数不存在");if(!Array.isArray(e))return void a("drawArray参数需要是Array");e=[...e].sort(((e,t)=>((null==e?void 0:e.zIndex)??0)-((null==t?void 0:t.zIndex)??0)));const s=[];for(let t=0;t<e.length;t++){const a=e[t];let l;switch(typeof a){case"function":l=a(),"function"==typeof(null==l?void 0:l.then)&&(l=await l);break;case"object":l=Array.isArray(a)?await this.drawArray(a):await this.drawItem(a)}s.push({item:a,result:l})}t(s)}catch(s){a(s)}}))}drawItem(e={}){return new Promise((async(t,a)=>{var s,l;try{let a;switch(e.type){case"text":a=await this.drawText(e);break;case"image":a=await this.drawImg(e);break;case"qrcode":a=await this.drawQrCode(e);break;case"method":a=null==(s=this[e.name])?void 0:s.call(this,...e.data?Array.isArray(e.data)?e.data:[e.data]:[]),"function"==typeof(null==a?void 0:a.then)&&(a=await a);break;case"function":a=null==(l=e.val)?void 0:l.call(e),"function"==typeof(null==a?void 0:a.then)&&(a=await a)}t(a)}catch(o){a(o)}}))}drawRichText(e){return new Promise((async(t,a)=>{if(!e)return void a("drawRichText需绘制参数不存在");"string"==typeof e&&(e=x(e));const s=[];try{t({html:e,htmlParses:await function e(t,a){return new Promise((async(a,l)=>{var o;for(let n=0;n<t.length;n++){const a=t[n];if("text"==a.type||a.name,s.push(a),null==(o=a.children)?void 0:o.length){a.__handle=function(e){};try{await e(a.children,a)}catch(r){return void l(r)}}}a(s)}))}(e)})}catch(l){a(l)}}))}};let w=v;a=new WeakMap;var _=function(){function e(e){return e<128?[e]:e<2048?[192+(e>>6),128+(63&e)]:[224+(e>>12),128+(e>>6&63),128+(63&e)]}function t(t,a){this.typeNumber=-1,this.errorCorrectLevel=a,this.modules=null,this.moduleCount=0,this.dataCache=null,this.rsBlocks=null,this.totalDataCount=-1,this.data=t,this.utf8bytes=function(t){for(var a=[],s=0;s<t.length;s++)for(var l=e(t.charCodeAt(s)),o=0;o<l.length;o++)a.push(l[o]);return a}(t),this.make()}t.prototype={constructor:t,getModuleCount:function(){return this.moduleCount},make:function(){this.getRightType(),this.dataCache=this.createData(),this.createQrcode()},makeImpl:function(e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var t=0;t<this.moduleCount;t++)this.modules[t]=new Array(this.moduleCount);this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(!0,e),this.typeNumber>=7&&this.setupTypeNumber(!0),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(e,t){for(var a=-1;a<=7;a++)if(!(e+a<=-1||this.moduleCount<=e+a))for(var s=-1;s<=7;s++)t+s<=-1||this.moduleCount<=t+s||(this.modules[e+a][t+s]=0<=a&&a<=6&&(0==s||6==s)||0<=s&&s<=6&&(0==a||6==a)||2<=a&&a<=4&&2<=s&&s<=4)},createQrcode:function(){for(var e=0,t=0,a=null,s=0;s<8;s++){this.makeImpl(s);var l=d.getLostPoint(this);(0==s||e>l)&&(e=l,t=s,a=this.modules)}this.modules=a,this.setupTypeInfo(!1,t),this.typeNumber>=7&&this.setupTypeNumber(!1)},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0,null==this.modules[6][e]&&(this.modules[6][e]=e%2==0))},setupPositionAdjustPattern:function(){for(var e=d.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var a=0;a<e.length;a++){var s=e[t],l=e[a];if(null==this.modules[s][l])for(var o=-2;o<=2;o++)for(var r=-2;r<=2;r++)this.modules[s+o][l+r]=-2==o||2==o||-2==r||2==r||0==o&&0==r}},setupTypeNumber:function(e){for(var t=d.getBCHTypeNumber(this.typeNumber),a=0;a<18;a++){var s=!e&&1==(t>>a&1);this.modules[Math.floor(a/3)][a%3+this.moduleCount-8-3]=s,this.modules[a%3+this.moduleCount-8-3][Math.floor(a/3)]=s}},setupTypeInfo:function(e,t){for(var s=a[this.errorCorrectLevel]<<3|t,l=d.getBCHTypeInfo(s),o=0;o<15;o++){var r=!e&&1==(l>>o&1);o<6?this.modules[o][8]=r:o<8?this.modules[o+1][8]=r:this.modules[this.moduleCount-15+o][8]=r,r=!e&&1==(l>>o&1),o<8?this.modules[8][this.moduleCount-o-1]=r:o<9?this.modules[8][15-o-1+1]=r:this.modules[8][15-o-1]=r}this.modules[this.moduleCount-8][8]=!e},createData:function(){var e=new g,a=this.typeNumber>9?16:8;e.put(4,4),e.put(this.utf8bytes.length,a);for(var s=0,l=this.utf8bytes.length;s<l;s++)e.put(this.utf8bytes[s],8);for(e.length+4<=8*this.totalDataCount&&e.put(0,4);e.length%8!=0;)e.putBit(!1);for(;!(e.length>=8*this.totalDataCount||(e.put(t.PAD0,8),e.length>=8*this.totalDataCount));)e.put(t.PAD1,8);return this.createBytes(e)},createBytes:function(e){for(var t=0,a=0,s=0,l=this.rsBlock.length/3,o=new Array,r=0;r<l;r++)for(var n=this.rsBlock[3*r+0],i=this.rsBlock[3*r+1],c=this.rsBlock[3*r+2],u=0;u<n;u++)o.push([c,i]);for(var h=new Array(o.length),f=new Array(o.length),m=0;m<o.length;m++){var g=o[m][0],b=o[m][1]-g;for(a=Math.max(a,g),s=Math.max(s,b),h[m]=new Array(g),r=0;r<h[m].length;r++)h[m][r]=255&e.buffer[r+t];t+=g;var y=d.getErrorCorrectPolynomial(b),v=new p(h[m],y.getLength()-1).mod(y);for(f[m]=new Array(y.getLength()-1),r=0;r<f[m].length;r++){var w=r+v.getLength()-f[m].length;f[m][r]=w>=0?v.get(w):0}}var _=new Array(this.totalDataCount),x=0;for(r=0;r<a;r++)for(m=0;m<o.length;m++)r<h[m].length&&(_[x++]=h[m][r]);for(r=0;r<s;r++)for(m=0;m<o.length;m++)r<f[m].length&&(_[x++]=f[m][r]);return _},mapData:function(e,t){for(var a=-1,s=this.moduleCount-1,l=7,o=0,r=this.moduleCount-1;r>0;r-=2)for(6==r&&r--;;){for(var n=0;n<2;n++)if(null==this.modules[s][r-n]){var i=!1;o<e.length&&(i=1==(e[o]>>>l&1)),d.getMask(t,s,r-n)&&(i=!i),this.modules[s][r-n]=i,-1==--l&&(o++,l=7)}if((s+=a)<0||this.moduleCount<=s){s-=a,a=-a;break}}}},t.PAD0=236,t.PAD1=17;for(var a=[1,0,3,2],s=0,l=1,o=2,r=3,n=4,i=5,c=6,u=7,d={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;d.getBCHDigit(t)-d.getBCHDigit(d.G15)>=0;)t^=d.G15<<d.getBCHDigit(t)-d.getBCHDigit(d.G15);return(e<<10|t)^d.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;d.getBCHDigit(t)-d.getBCHDigit(d.G18)>=0;)t^=d.G18<<d.getBCHDigit(t)-d.getBCHDigit(d.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return d.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,a){switch(e){case s:return(t+a)%2==0;case l:return t%2==0;case o:return a%3==0;case r:return(t+a)%3==0;case n:return(Math.floor(t/2)+Math.floor(a/3))%2==0;case i:return t*a%2+t*a%3==0;case c:return(t*a%2+t*a%3)%2==0;case u:return(t*a%3+(t+a)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new p([1],0),a=0;a<e;a++)t=t.multiply(new p([1,h.gexp(a)],0));return t},getLostPoint:function(e){for(var t=e.getModuleCount(),a=0,s=0,l=0;l<t;l++)for(var o=0,r=e.modules[l][0],n=0;n<t;n++){var i=e.modules[l][n];if(n<t-6&&i&&!e.modules[l][n+1]&&e.modules[l][n+2]&&e.modules[l][n+3]&&e.modules[l][n+4]&&!e.modules[l][n+5]&&e.modules[l][n+6]&&(n<t-10?e.modules[l][n+7]&&e.modules[l][n+8]&&e.modules[l][n+9]&&e.modules[l][n+10]&&(a+=40):n>3&&e.modules[l][n-1]&&e.modules[l][n-2]&&e.modules[l][n-3]&&e.modules[l][n-4]&&(a+=40)),l<t-1&&n<t-1){var c=0;i&&c++,e.modules[l+1][n]&&c++,e.modules[l][n+1]&&c++,e.modules[l+1][n+1]&&c++,0!=c&&4!=c||(a+=3)}r^i?o++:(r=i,o>=5&&(a+=3+o-5),o=1),i&&s++}for(n=0;n<t;n++)for(o=0,r=e.modules[0][n],l=0;l<t;l++)i=e.modules[l][n],l<t-6&&i&&!e.modules[l+1][n]&&e.modules[l+2][n]&&e.modules[l+3][n]&&e.modules[l+4][n]&&!e.modules[l+5][n]&&e.modules[l+6][n]&&(l<t-10?e.modules[l+7][n]&&e.modules[l+8][n]&&e.modules[l+9][n]&&e.modules[l+10][n]&&(a+=40):l>3&&e.modules[l-1][n]&&e.modules[l-2][n]&&e.modules[l-3][n]&&e.modules[l-4][n]&&(a+=40)),r^i?o++:(r=i,o>=5&&(a+=3+o-5),o=1);return a+=Math.abs(100*s/t/t-50)/5*10}},h={glog:function(e){if(e<1)throw new Error("glog("+e+")");return h.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return h.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},f=0;f<8;f++)h.EXP_TABLE[f]=1<<f;for(f=8;f<256;f++)h.EXP_TABLE[f]=h.EXP_TABLE[f-4]^h.EXP_TABLE[f-5]^h.EXP_TABLE[f-6]^h.EXP_TABLE[f-8];for(f=0;f<255;f++)h.LOG_TABLE[h.EXP_TABLE[f]]=f;function p(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var a=0;a<e.length&&0==e[a];)a++;this.num=new Array(e.length-a+t);for(var s=0;s<e.length-a;s++)this.num[s]=e[s+a]}p.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),a=0;a<this.getLength();a++)for(var s=0;s<e.getLength();s++)t[a+s]^=h.gexp(h.glog(this.get(a))+h.glog(e.get(s)));return new p(t,0)},mod:function(e){var t=this.getLength(),a=e.getLength();if(t-a<0)return this;for(var s=new Array(t),l=0;l<t;l++)s[l]=this.get(l);for(;s.length>=a;){var o=h.glog(s[0])-h.glog(e.get(0));for(l=0;l<e.getLength();l++)s[l]^=h.gexp(h.glog(e.get(l))+o);for(;0==s[0];)s.shift()}return new p(s,0)}};var m=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];function g(){this.buffer=new Array,this.length=0}return t.prototype.getRightType=function(){for(var e=1;e<41;e++){var t=m[4*(e-1)+this.errorCorrectLevel];if(null==t)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+this.errorCorrectLevel);for(var a=t.length/3,s=0,l=0;l<a;l++){var o=t[3*l+0];s+=t[3*l+2]*o}var r=e>9?2:1;if(this.utf8bytes.length+r<s||40==e){this.typeNumber=e,this.rsBlock=t,this.totalDataCount=s;break}}},g.prototype={get:function(e){var t=Math.floor(e/8);return this.buffer[t]>>>7-e%8&1},put:function(e,t){for(var a=0;a<t;a++)this.putBit(e>>>t-a-1&1)},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t}(),x=function(){var e=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,t=/^<\/([-A-Za-z0-9_]+)[^>]*>/,a=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,s=c("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"),l=c("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"),o=c("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),r=c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),n=c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),i=c("script,style");function c(e){for(var t={},a=e.split(","),s=0;s<a.length;s++)t[a[s]]=!0;return t}return function(c){c=function(e){return e.replace(/<\?xml.*\?>\n/,"").replace(/<!doctype.*>\n/,"").replace(/<!DOCTYPE.*>\n/,"")}(c);var u=[],d={node:"root",children:[]};return function(c,u){var d,h,f,p=[],m=c;for(p.last=function(){return this[this.length-1]};c;){if(h=!0,p.last()&&i[p.last()])c=c.replace(new RegExp("([\\s\\S]*?)</"+p.last()+"[^>]*>"),(function(e,t){return t=t.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),u.chars&&u.chars(t),""})),y("",p.last());else if(0==c.indexOf("\x3c!--")?(d=c.indexOf("--\x3e"))>=0&&(u.comment&&u.comment(c.substring(4,d)),c=c.substring(d+3),h=!1):0==c.indexOf("</")?(f=c.match(t))&&(c=c.substring(f[0].length),f[0].replace(t,y),h=!1):0==c.indexOf("<")&&(f=c.match(e))&&(c=c.substring(f[0].length),f[0].replace(e,b),h=!1),h){var g=(d=c.indexOf("<"))<0?c:c.substring(0,d);c=d<0?"":c.substring(d),u.chars&&u.chars(g)}if(c==m)throw"Parse Error: "+c;m=c}function b(e,t,i,c){if(t=t.toLowerCase(),l[t])for(;p.last()&&o[p.last()];)y("",p.last());if(r[t]&&p.last()==t&&y("",t),(c=s[t]||!!c)||p.push(t),u.start){var d=[];i.replace(a,(function(e,t){var a=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:n[t]?t:"";d.push({name:t,value:a,escaped:a.replace(/(^|[^\\])"/g,'$1\\"')})})),u.start&&u.start(t,d,c)}}function y(e,t){if(t)for(a=p.length-1;a>=0&&p[a]!=t;a--);else var a=0;if(a>=0){for(var s=p.length-1;s>=a;s--)u.end&&u.end(p[s]);p.length=a}}y()}(c,{start:function(e,t,a){var s={name:e};if(0!==t.length&&(s.attrs=function(e){return e.reduce((function(e,t){var a=t.value,s=t.name;return e[s]?e[s]=e[s]+" "+a:e[s]=a,e}),{})}(t)),a){var l=u[0]||d;l.children||(l.children=[]),l.children.push(s)}else u.unshift(s)},end:function(e){var t=u.shift();if(t.name!==e&&console.error("invalid state: mismatch end tag"),0===u.length)d.children.push(t);else{var a=u[0];a.children||(a.children=[]),a.children.push(t)}},chars:function(e){var t={type:"text",text:e};if(0===u.length)d.children.push(t);else{var a=u[0];a.children||(a.children=[]),a.children.push(t)}},comment:function(e){var t={node:"comment",text:e},a=u[0];a.children||(a.children=[]),a.children.push(t)}}),d.children}}(),k=function(){function e(e){var t=e.split(",");return t[t.length-1]}var t=0;return{pathToBase64:function(e){return new Promise((function(t,a){if("object"==typeof window&&"document"in window){if("function"==typeof FileReader){var s=new XMLHttpRequest;return s.open("GET",e,!0),s.responseType="blob",s.onload=function(){if(200===this.status){let e=new FileReader;e.onload=function(e){t(e.target.result)},e.onerror=a,e.readAsDataURL(this.response)}},s.onerror=a,void s.send()}var l=document.createElement("canvas"),o=l.getContext("2d"),r=new Image;return r.onload=function(){l.width=r.width,l.height=r.height,o.drawImage(r,0,0),t(l.toDataURL()),l.height=l.width=0},r.onerror=a,void(r.src=e)}"object"!=typeof plus?"object"==typeof wx&&ie("getFileSystemManager")?wx.getFileSystemManager().readFile({filePath:e,encoding:"base64",success:function(e){t("data:image/png;base64,"+e.data)},fail:function(e){a(e)}}):a(new Error("not support")):plus.io.resolveLocalFileSystemURL(function(e){if(0===e.indexOf("_www")||0===e.indexOf("_doc")||0===e.indexOf("_documents")||0===e.indexOf("_downloads"))return e;if(0===e.indexOf("file://"))return e;if(0===e.indexOf("/storage/emulated/0/"))return e;if(0===e.indexOf("/")){var t=plus.io.convertAbsoluteFileSystem(e);if(t!==e)return t;e=e.substr(1)}return"_www/"+e}(e),(function(e){e.file((function(e){var s=new plus.io.FileReader;s.onload=function(e){t(e.target.result)},s.onerror=function(e){a(e)},s.readAsDataURL(e)}),(function(e){a(e)}))}),(function(e){a(e)}))}))},base64ToPath:function(a){return new Promise((function(s,l){if("object"==typeof window&&"document"in window){for(var o=(a=a.split(","))[0].match(/:(.*?);/)[1],r=atob(a[1]),n=r.length,i=new Uint8Array(n);n--;)i[n]=r.charCodeAt(n);return s((window.URL||window.webkitURL).createObjectURL(new Blob([i],{type:o})))}var c=a.split(",")[0].match(/data\:\S+\/(\S+);/);c?c=c[1]:l(new Error("base64 error"));var u=Date.now()+String(t++)+"."+c;if("object"!=typeof plus){try{v=("object"==typeof my&&(null==(d=null==my?void 0:my.env)?void 0:d.USER_DATA_PATH)?my.env.USER_DATA_PATH:"object"==typeof swan&&(null==(h=null==swan?void 0:swan.env)?void 0:h.USER_DATA_PATH)?swan.env.USER_DATA_PATH:"object"==typeof tt&&(null==(f=null==tt?void 0:tt.env)?void 0:f.USER_DATA_PATH)?tt.env.USER_DATA_PATH:"object"==typeof qq&&(null==(p=null==qq?void 0:qq.env)?void 0:p.USER_DATA_PATH)?qq.env.USER_DATA_PATH:"object"==typeof qh&&(null==(m=null==qh?void 0:qh.env)?void 0:m.USER_DATA_PATH)?qh.env.USER_DATA_PATH:"object"==typeof wx&&(null==(g=null==wx?void 0:wx.env)?void 0:g.USER_DATA_PATH)?wx.env.USER_DATA_PATH:"https://user")+"/"+u,uni.getFileSystemManager().writeFile({filePath:v,data:e(a),encoding:"base64",success:function(){s(v)},fail:function(e){l(e)}})}catch(_){l(new Error("not support"))}var d,h,f,p,m,g}else{var b="_doc",y="uniapp_temp",v="_doc/uniapp_temp/"+u;if(!function(e,t){for(var a=e.split("."),s=t.split("."),l=!1,o=0;o<s.length;o++){var r=a[o]-s[o];if(0!==r){l=r>0;break}}return l}("Android"===plus.os.name?"1.9.9.80627":"1.9.9.80472",plus.runtime.innerVersion))return void plus.io.resolveLocalFileSystemURL(b,(function(t){t.getDirectory(y,{create:!0,exclusive:!1},(function(t){t.getFile(u,{create:!0,exclusive:!1},(function(t){t.createWriter((function(t){t.onwrite=function(){s(v)},t.onerror=l,t.seek(0),t.writeAsBinary(e(a))}),l)}),l)}),l)}),l);var w=new plus.nativeObj.Bitmap(u);w.loadBase64Data(a,(function(){w.save(v,{},(function(){w.clear(),s(v)}),(function(e){w.clear(),l(e)}))}),(function(e){w.clear(),l(e)}))}}))}}}();b("object")&&(et.exports=w)}();const st=ce(at.exports);async function lt(e){return new Promise(((t,a)=>{t(window.location.origin+e)}))}async function ot(e){return new Promise(((t,a)=>{t(window.location.origin+e)}))}let rt=q("");async function nt(e){await te.getFileIO(e).then((e=>{rt.value=window.URL.createObjectURL(e)}))}async function it(e){const t=S.$store("user").userInfo;console.log(JSON.parse(X("user-store")).userInfo);let a=t.avatar;switch(e.shareInfo.poster.type){case"user":return await nt(a),e.avatar=rt.value,(async e=>{const t=e.width,a=S.$store("user").userInfo;return{background:await lt("/static/user-poster-bg.jpg"),list:[{name:"nickname",type:"text",val:a.nickname,x:t/2,y:.4*t,paintbrushProps:{textAlign:"center",fillStyle:"#333",font:{fontSize:14,fontFamily:"sans-serif"}}},{name:"avatar",type:"image",val:e.avatar,x:.4*t,y:.16*t,width:.2*t,height:.2*t,d:.2*t},{name:"qrcode",type:"qrcode",val:e.shareInfo.link,x:.35*t,y:.74*t,size:.3*t}]}})(e);case"goods":return await nt(a),e.avatar=rt.value,await nt(e.shareInfo.poster.image),e.shareInfo.poster.image=rt.value,(async e=>{const t=e.width,a=S.$store("user").userInfo;return{background:await ot("/static/goods-poster-bg.jpg"),list:[{name:"nickname",type:"text",val:a.nickname,x:.21*t,y:.06*t,paintbrushProps:{fillStyle:"#333",font:{fontSize:16,fontFamily:"sans-serif"}}},{name:"avatar",type:"image",val:e.avatar,x:.04*t,y:.04*t,width:.14*t,height:.14*t,d:.14*t},{name:"goodsBg",type:"rect",x:.03*t,y:.3*t,width:.94*t,height:.75*t,r:5},{name:"goodsImage",type:"image",val:e.shareInfo.poster.image,x:.03*t,y:.3*t,width:.94*t,height:.5*t,r:5},{name:"goodsTitle",type:"text",val:e.shareInfo.poster.title,x:.05*t,y:.83*t,maxWidth:.91*t,line:5,lineHeight:10,paintbrushProps:{fillStyle:"#333",font:{fontSize:16}}},{name:"goodsIntroduction",type:"text",val:e.shareInfo.poster.introduction,x:.05*t,y:.89*t,maxWidth:.9*t,height:.1*t,line:3,lineHeight:4,paintbrushProps:{fillStyle:"#333",font:{fontSize:12,fontFamily:"OPPOSANS"}}},{name:"goodsOriginalPrice",type:"text",val:e.shareInfo.poster.original_price>0?"¥"+e.shareInfo.poster.original_price:"",x:.3*t,y:1.32*t,paintbrushProps:{fillStyle:"#999",font:{fontSize:10,fontFamily:"OPPOSANS"}},textDecoration:{line:"line-through",style:"solide"}},{name:"qrcode",type:"qrcode",val:e.shareInfo.link,x:.75*t,y:1.07*t,size:.2*t}]}})(e);case"groupon":return(e=>{const t=e.width,a=S.$store("user").userInfo;return{background:ct(S.$url.cdn(S.$store("app").platform.share.posterInfo.groupon_bg)),list:[{name:"nickname",type:"text",val:a.nickname,x:.22*t,y:.06*t,paintbrushProps:{fillStyle:"#333",font:{fontSize:16,fontFamily:"sans-serif"}}},{name:"avatar",type:"image",val:ct(S.$url.cdn(a.avatar)),x:.04*t,y:.04*t,width:.14*t,height:.14*t,d:.14*t},{name:"goodsImage",type:"image",val:ct(e.shareInfo.poster.image),x:.03*t,y:.21*t,width:.94*t,height:.94*t,r:10},{name:"goodsTitle",type:"text",val:e.shareInfo.poster.title,x:.04*t,y:1.18*t,maxWidth:.91*t,line:2,lineHeight:5,paintbrushProps:{fillStyle:"#333",font:{fontSize:14}}},{name:"goodsPrice",type:"text",val:"¥"+e.shareInfo.poster.price,x:.04*t,y:1.3*t,paintbrushProps:{fillStyle:"#ff0000",font:{fontSize:20,fontFamily:"OPPOSANS"}}},{name:"grouponNum",type:"text",val:"2人团",x:.3*t,y:1.32*t,paintbrushProps:{fillStyle:"#ff0000",font:{fontSize:10,fontFamily:"OPPOSANS"}}},{name:"qrcode",type:"qrcode",val:e.shareInfo.link,x:.75*t,y:1.3*t,size:.2*t}]}})(e)}}function ct(e){return"https:"===window.location.protocol&&0===e.indexOf("http:")&&(e=e.replace("http:","https:")),e}async function ut(e,t){const a=e.width,s=new st({canvasId:e.canvasId,width:e.width,height:e.height,setCanvasWH:t=>{e.height=t.height}},t);let l=await it(e);const o=await s.drawImg({type:"image",val:l.background,x:0,y:0,width:a,mode:"widthFix",zIndex:0});await s.updateCanvasWH({width:o.width,height:o.bottom});let r=l.list;for(let i=0;i<r.length;i++){let e=r[i];if("text"===e.type&&await s.drawText(e),"image"===e.type){e.d&&s.setCircle({x:e.x,y:e.y,d:e.d,clip:!0}),e.r&&s.setRect({x:e.x,y:e.y,height:e.height,width:e.width,r:e.r,clip:!0});try{await s.drawImg(e)}catch(n){console.log(n)}s.restore()}if("rect"===e.type){e.r&&s.setRect({x:e.x,y:e.y,height:e.height,width:e.width,r:e.r,clip:!0});try{await s.draw(e)}catch(n){console.log(n)}s.restore()}"qrcode"===e.type&&(console.log(e),await s.drawQrCode(e))}return await s.draw(),setTimeout((async()=>{e.src=await s.toImage()}),100),e}const dt=be({__name:"index",props:{show:{type:Boolean,default:!1},shareInfo:{type:Object,default(){}}},emits:["success","close"],setup(e,{expose:t,emit:a}){const s=e,d=y({canvasId:"canvasId",width:.9*S.$platform.device.windowWidth,height:600,src:"",imgData:""}),f=a,g=V(),b=()=>{f("close")},v=()=>{["WechatOfficialAccount","H5"].includes(S.$platform.name)?S.$helper.toast("请长按图片保存"):ue({filePath:d.src,success:e=>{b(),S.$helper.toast("保存成功")},fail:e=>{S.$helper.toast("保存失败"),console.log("图片保存失败:",e)}})};return q(""),t({getPoster:async function(e){return d.src="",d.shareInfo=s.shareInfo,await ut(d,g)}}),(t,a)=>{const s=m,f=E,g=de,y=C,w=l(o("su-popup"),ve);return r(),n(w,{show:e.show,round:"10",onClose:b,type:"center",class:"popup-box"},{default:i((()=>[c(s,{class:"ss-flex-col ss-col-center ss-row-center"},{default:i((()=>[""===d.src?(r(),n(s,{key:0,class:"poster-title ss-flex ss-row-center",style:u({height:d.height+"px",width:d.width+"px"})},{default:i((()=>[h(" 海报加载中... ")])),_:1},8,["style"])):(r(),n(f,{key:1,class:"poster-img",src:d.src,style:u({height:d.height+"px",width:d.width+"px"}),"show-menu-by-longpress":!0},null,8,["src","style"])),c(g,{class:"hideCanvas","canvas-id":d.canvasId,id:d.canvasId,style:u({height:d.height+"px",width:d.width+"px"})},null,8,["canvas-id","id","style"]),""!==d.src?(r(),n(s,{key:2,class:"poster-btn-box ss-m-t-20 ss-flex ss-row-between ss-col-center"},{default:i((()=>[c(y,{class:"cancel-btn ss-reset-button",onClick:b},{default:i((()=>[h("取消")])),_:1}),c(y,{class:"save-btn ss-reset-button ui-BG-Main",onClick:v},{default:i((()=>[h(" 长按图片保存 ")])),_:1})])),_:1})):p("",!0)])),_:1})])),_:1},8,["show"])}}},[["__scopeId","data-v-db2761e2"]]),ht=be({__name:"s-share-modal",props:{shareInfo:{type:Object,default(){}}},setup(e){const t=I((()=>S.$store("modal").share)),a=I((()=>S.$store("app").platform.share)),s=q(""),u=e,d=y({showShareGuide:!1,showPosterModal:!1});let f=I((()=>({...u.shareInfo})));const g=()=>{const e=I((()=>S.$store("modal").shareInfo.spuId));he(),S.$store("user").isLogin?(e.value&&fe.getLinkId(3,e.value).then((e=>{0===e.code&&(f.value.link=f.value.link.replace("0",e.data.linkId),f.value.query=f.value.query.replace("0",e.data.linkId))})),k(s).getPoster(),d.showPosterModal=!0):J()},v=()=>{he(),["WechatOfficialAccount","H5"].includes(S.$platform.name)&&(d.showShareGuide=!0)};function w(){d.showShareGuide=!1}return(e,u)=>{const y=l(o("su-popup"),ve),_=E,x=m,P=b,I=C;return r(),n(x,null,{default:i((()=>[c(y,{show:d.showShareGuide,showClose:!1,onClose:w},null,8,["show"]),d.showShareGuide?(r(),n(x,{key:0,class:"guide-wrap"},{default:i((()=>[c(_,{class:"guide-image",src:k(S).$url.static("/static/images/share_guide.png")},null,8,["src"])])),_:1})):p("",!0),c(y,{show:t.value,round:"10",showClose:!1,onClose:k(he)},{default:i((()=>[c(x,{class:"share-box"},{default:i((()=>[c(x,{class:"share-list-box ss-flex"},{default:i((()=>[a.value.methods.includes("forward")?(r(),n(I,{key:0,class:"share-item share-btn ss-flex-col ss-col-center","open-type":"share",onClick:v},{default:i((()=>[c(_,{class:"share-img",src:k(S).$url.static("/static/images/share_wx.png"),mode:""},null,8,["src"]),c(P,{class:"share-title"},{default:i((()=>[h("微信好友")])),_:1})])),_:1})):p("",!0),a.value.methods.includes("poster")?(r(),n(I,{key:1,class:"share-item share-btn ss-flex-col ss-col-center",onClick:g},{default:i((()=>[c(_,{class:"share-img",src:k(S).$url.static("/static/images/share_poster.png"),mode:""},null,8,["src"]),c(P,{class:"share-title"},{default:i((()=>[h("生成海报")])),_:1})])),_:1})):p("",!0)])),_:1}),c(x,{class:"share-foot ss-flex ss-row-center ss-col-center",onClick:k(he)},{default:i((()=>[h(" 取消 ")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["show","onClose"]),c(dt,{ref_key:"SharePosterRef",ref:s,show:d.showPosterModal,shareInfo:k(f),onClose:u[0]||(u[0]=e=>d.showPosterModal=!1)},null,8,["show","shareInfo"])])),_:1})}}},[["__scopeId","data-v-c7b464de"]]),ft=be({__name:"s-menu-tools",setup(e){const t=I((()=>S.$store("modal").menu));const a=[{url:"/pages/index/index",icon:"/static/images/home.png",title:"首页"},{url:"/pages/index/search",icon:"/static/images/search.png",title:"搜索"},{url:"/pages/index/user",icon:"/static/images/user.png",title:"个人中心"},{url:"/pages/index/cart",icon:"/static/images/cart.png",title:"购物车"},{url:"/pages/user/goods-log",icon:"/static/images/browse.png",title:"浏览记录"},{url:"/pages/user/goods-collect",icon:"/static/images/collect.png",title:"我的收藏"},{url:"/pages/chat/index",icon:"/static/images/service.png",title:"客服"}];return(e,s)=>{const u=l(o("su-status-bar"),Me),d=m,g=E,b=C,y=l(o("su-popup"),ve);return r(),n(y,{show:t.value,type:"top",round:"20",backgroundColor:"#F0F0F0",onClose:k(pe)},{default:i((()=>[c(u),c(d,{class:"tools-wrap ss-m-x-30 ss-m-b-16"},{default:i((()=>[c(d,{class:"title ss-m-b-34 ss-p-t-20"},{default:i((()=>[h("快捷菜单")])),_:1}),c(d,{class:"container-list ss-flex ss-flex-wrap"},{default:i((()=>[(r(),v(w,null,_(a,(e=>c(d,{class:"list-item ss-m-b-24",key:e.title},{default:i((()=>[c(d,{class:"ss-flex-col ss-col-center"},{default:i((()=>[c(b,{class:"ss-reset-button list-image ss-flex ss-row-center ss-col-center",onClick:t=>function(e){pe(),e.url&&S.$router.go(e.url)}(e)},{default:i((()=>[t.value?(r(),n(g,{key:0,src:k(S).$url.static(e.icon),class:"list-icon"},null,8,["src"])):p("",!0)])),_:2},1032,["onClick"]),c(d,{class:"list-title ss-m-t-20"},{default:i((()=>[h(f(e.title),1)])),_:2},1024)])),_:2},1024)])),_:2},1024))),64))])),_:1})])),_:1})])),_:1},8,["show","onClose"])}}},[["__scopeId","data-v-38098966"]]),pt=be({__name:"s-layout",props:{title:{type:String,default:""},navbar:{type:String,default:"normal"},opacityBgUi:{type:String,default:"bg-white"},color:{type:String,default:""},tools:{type:String,default:"title"},keyword:{type:String,default:""},navbarStyle:{type:Object,default:()=>({mode:"",type:"",color:"",src:"",list:[],alwaysShow:0})},bgStyle:{type:Object,default:()=>({src:"",color:"var(--ui-BG-1)"})},tabbar:{type:[String,Boolean],default:""},onShareAppMessage:{type:[Boolean,Object],default:!0},leftWidth:{type:[Number,String],default:100},rightWidth:{type:[Number,String],default:100},defaultSearch:{type:String,default:""},showLeftButton:{type:Boolean,default:!1}},emits:["search"],setup(e,{emit:t}){const a=e,s=t,h=S.$store("sys");S.$store("user"),S.$store("app"),S.$store("modal");const f=I((()=>h)),g=I((()=>"normal"===a.navbar||"normal"===a.navbarStyle.mode?"normal":"inner")),b=I((()=>"inner"===g.value?{background:`${a.bgStyle.backgroundColor} url(${S.$url.cdn(a.bgStyle.backgroundImage)}) no-repeat top center / 100% auto`}:{})),y=I((()=>"normal"===g.value?{background:`${a.bgStyle.backgroundColor} url(${S.$url.cdn(a.bgStyle.backgroundImage)}) no-repeat top center / 100% auto`}:{})),v=I((()=>!0===a.onShareAppMessage?S.$platform.share.getShareInfo():me.isEmpty(a.onShareAppMessage)?{}:(S.$platform.share.updateShareInfo(a.onShareAppMessage),a.onShareAppMessage)));return ge((()=>{me.isEmpty(v.value)||S.$platform.share.updateShareInfo(v.value)})),(t,a)=>{const h=l(o("su-navbar"),De),w=l(o("s-custom-navbar"),Fe),_=l(o("su-inner-navbar"),Oe),x=m,C=l(o("s-tabbar"),je),I=l(o("s-wallet-modal"),Ne),A=l(o("s-signup-modal"),He),B=l(o("s-auth-modal"),Ye),T=l(o("s-share-modal"),ht),$=l(o("s-menu-tools"),ft);return r(),n(x,{class:P(["page-app",["theme-"+f.value.mode,"main-"+f.value.theme,"font-"+f.value.fontSize]])},{default:i((()=>[c(x,{class:"page-main",style:u([b.value])},{default:i((()=>["normal"===e.navbar?(r(),n(h,{key:0,title:e.title,statusBar:"",color:e.color,tools:e.tools,opacityBgUi:e.opacityBgUi,onSearch:a[0]||(a[0]=e=>s("search",e)),defaultSearch:e.defaultSearch},null,8,["title","color","tools","opacityBgUi","defaultSearch"])):"custom"===e.navbar&&"normal"===g.value?(r(),n(w,{key:1,data:e.navbarStyle,showLeftButton:e.showLeftButton},null,8,["data","showLeftButton"])):p("",!0),c(x,{class:"page-body",style:u([y.value])},{default:i((()=>["inner"===e.navbar?(r(),n(_,{key:0,title:e.title},null,8,["title"])):p("",!0),"inner"===e.navbar?(r(),n(x,{key:1,style:u([{paddingTop:k(S).$platform.navbar+"px"}])},null,8,["style"])):p("",!0),d(t.$slots,"default",{},void 0,!0),""!==e.tabbar?(r(),n(C,{key:2,path:e.tabbar},null,8,["path"])):p("",!0)])),_:3},8,["style"])])),_:3},8,["style"]),c(x,{class:"page-modal"},{default:i((()=>[c(I),c(A),c(B),c(T,{shareInfo:v.value},null,8,["shareInfo"]),c($)])),_:1})])),_:3},8,["class"])}}},[["__scopeId","data-v-ce36da0c"]]);export{pt as _,Le as a,$e as b,Me as c,Ve as d,ut as u};
|