1 |
- var e=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},t=(t,a,i)=>(e(t,a,"read from private field"),i?i.call(t):a.get(t));import{e as a,f as i,y as s,z as o,C as n,ay as l,aB as r,l as c,m as d,w as u,j as h,Q as f,p as m,t as p,g,i as b,an as y,v as _,k as w,F as v,r as x,A as k,u as S,s as C,D as P,aC as I,B as $,az as T,c as A,d as B,a0 as M,aD as V,P as D,ah as L,ad as F,o as z,ac as E,aE as O,ae as R,q as N,aF as j,aG as W,aH as U,aI as H,aJ as q,a3 as G,M as X,aK as Z,ao as Q,aL as Y,U as K,a5 as J,aM as ee,aN as te,aO as ae,aP as ie,ar as se,I as oe,aQ as ne,aR as le,aS as re,aT as ce,aU as de,E as ue,G as he,aV as fe,aW as me,aX as pe,aY as ge,aZ as be,a_ as ye,a$ as _e,b0 as we,b1 as ve,a8 as xe,n as ke}from"./index-9880b451.js";import{_ as Se}from"./_plugin-vue_export-helper.1b428a4d.js";const Ce={id:"2852637",name:"uniui图标库",font_family:"uniicons",css_prefix_text:"uniui-",description:"",glyphs:[{icon_id:"25027049",name:"yanse",font_class:"color",unicode:"e6cf",unicode_decimal:59087},{icon_id:"25027048",name:"wallet",font_class:"wallet",unicode:"e6b1",unicode_decimal:59057},{icon_id:"25015720",name:"settings-filled",font_class:"settings-filled",unicode:"e6ce",unicode_decimal:59086},{icon_id:"25015434",name:"shimingrenzheng-filled",font_class:"auth-filled",unicode:"e6cc",unicode_decimal:59084},{icon_id:"24934246",name:"shop-filled",font_class:"shop-filled",unicode:"e6cd",unicode_decimal:59085},{icon_id:"24934159",name:"staff-filled-01",font_class:"staff-filled",unicode:"e6cb",unicode_decimal:59083},{icon_id:"24932461",name:"VIP-filled",font_class:"vip-filled",unicode:"e6c6",unicode_decimal:59078},{icon_id:"24932462",name:"plus_circle_fill",font_class:"plus-filled",unicode:"e6c7",unicode_decimal:59079},{icon_id:"24932463",name:"folder_add-filled",font_class:"folder-add-filled",unicode:"e6c8",unicode_decimal:59080},{icon_id:"24932464",name:"yanse-filled",font_class:"color-filled",unicode:"e6c9",unicode_decimal:59081},{icon_id:"24932465",name:"tune-filled",font_class:"tune-filled",unicode:"e6ca",unicode_decimal:59082},{icon_id:"24932455",name:"a-rilidaka-filled",font_class:"calendar-filled",unicode:"e6c0",unicode_decimal:59072},{icon_id:"24932456",name:"notification-filled",font_class:"notification-filled",unicode:"e6c1",unicode_decimal:59073},{icon_id:"24932457",name:"wallet-filled",font_class:"wallet-filled",unicode:"e6c2",unicode_decimal:59074},{icon_id:"24932458",name:"paihangbang-filled",font_class:"medal-filled",unicode:"e6c3",unicode_decimal:59075},{icon_id:"24932459",name:"gift-filled",font_class:"gift-filled",unicode:"e6c4",unicode_decimal:59076},{icon_id:"24932460",name:"fire-filled",font_class:"fire-filled",unicode:"e6c5",unicode_decimal:59077},{icon_id:"24928001",name:"refreshempty",font_class:"refreshempty",unicode:"e6bf",unicode_decimal:59071},{icon_id:"24926853",name:"location-ellipse",font_class:"location-filled",unicode:"e6af",unicode_decimal:59055},{icon_id:"24926735",name:"person-filled",font_class:"person-filled",unicode:"e69d",unicode_decimal:59037},{icon_id:"24926703",name:"personadd-filled",font_class:"personadd-filled",unicode:"e698",unicode_decimal:59032},{icon_id:"24923351",name:"back",font_class:"back",unicode:"e6b9",unicode_decimal:59065},{icon_id:"24923352",name:"forward",font_class:"forward",unicode:"e6ba",unicode_decimal:59066},{icon_id:"24923353",name:"arrowthinright",font_class:"arrow-right",unicode:"e6bb",unicode_decimal:59067},{icon_id:"24923353",name:"arrowthinright",font_class:"arrowthinright",unicode:"e6bb",unicode_decimal:59067},{icon_id:"24923354",name:"arrowthinleft",font_class:"arrow-left",unicode:"e6bc",unicode_decimal:59068},{icon_id:"24923354",name:"arrowthinleft",font_class:"arrowthinleft",unicode:"e6bc",unicode_decimal:59068},{icon_id:"24923355",name:"arrowthinup",font_class:"arrow-up",unicode:"e6bd",unicode_decimal:59069},{icon_id:"24923355",name:"arrowthinup",font_class:"arrowthinup",unicode:"e6bd",unicode_decimal:59069},{icon_id:"24923356",name:"arrowthindown",font_class:"arrow-down",unicode:"e6be",unicode_decimal:59070},{icon_id:"24923356",name:"arrowthindown",font_class:"arrowthindown",unicode:"e6be",unicode_decimal:59070},{icon_id:"24923349",name:"arrowdown",font_class:"bottom",unicode:"e6b8",unicode_decimal:59064},{icon_id:"24923349",name:"arrowdown",font_class:"arrowdown",unicode:"e6b8",unicode_decimal:59064},{icon_id:"24923346",name:"arrowright",font_class:"right",unicode:"e6b5",unicode_decimal:59061},{icon_id:"24923346",name:"arrowright",font_class:"arrowright",unicode:"e6b5",unicode_decimal:59061},{icon_id:"24923347",name:"arrowup",font_class:"top",unicode:"e6b6",unicode_decimal:59062},{icon_id:"24923347",name:"arrowup",font_class:"arrowup",unicode:"e6b6",unicode_decimal:59062},{icon_id:"24923348",name:"arrowleft",font_class:"left",unicode:"e6b7",unicode_decimal:59063},{icon_id:"24923348",name:"arrowleft",font_class:"arrowleft",unicode:"e6b7",unicode_decimal:59063},{icon_id:"24923334",name:"eye",font_class:"eye",unicode:"e651",unicode_decimal:58961},{icon_id:"24923335",name:"eye-filled",font_class:"eye-filled",unicode:"e66a",unicode_decimal:58986},{icon_id:"24923336",name:"eye-slash",font_class:"eye-slash",unicode:"e6b3",unicode_decimal:59059},{icon_id:"24923337",name:"eye-slash-filled",font_class:"eye-slash-filled",unicode:"e6b4",unicode_decimal:59060},{icon_id:"24923305",name:"info-filled",font_class:"info-filled",unicode:"e649",unicode_decimal:58953},{icon_id:"24923299",name:"reload-01",font_class:"reload",unicode:"e6b2",unicode_decimal:59058},{icon_id:"24923195",name:"mic_slash_fill",font_class:"micoff-filled",unicode:"e6b0",unicode_decimal:59056},{icon_id:"24923165",name:"map-pin-ellipse",font_class:"map-pin-ellipse",unicode:"e6ac",unicode_decimal:59052},{icon_id:"24923166",name:"map-pin",font_class:"map-pin",unicode:"e6ad",unicode_decimal:59053},{icon_id:"24923167",name:"location",font_class:"location",unicode:"e6ae",unicode_decimal:59054},{icon_id:"24923064",name:"starhalf",font_class:"starhalf",unicode:"e683",unicode_decimal:59011},{icon_id:"24923065",name:"star",font_class:"star",unicode:"e688",unicode_decimal:59016},{icon_id:"24923066",name:"star-filled",font_class:"star-filled",unicode:"e68f",unicode_decimal:59023},{icon_id:"24899646",name:"a-rilidaka",font_class:"calendar",unicode:"e6a0",unicode_decimal:59040},{icon_id:"24899647",name:"fire",font_class:"fire",unicode:"e6a1",unicode_decimal:59041},{icon_id:"24899648",name:"paihangbang",font_class:"medal",unicode:"e6a2",unicode_decimal:59042},{icon_id:"24899649",name:"font",font_class:"font",unicode:"e6a3",unicode_decimal:59043},{icon_id:"24899650",name:"gift",font_class:"gift",unicode:"e6a4",unicode_decimal:59044},{icon_id:"24899651",name:"link",font_class:"link",unicode:"e6a5",unicode_decimal:59045},{icon_id:"24899652",name:"notification",font_class:"notification",unicode:"e6a6",unicode_decimal:59046},{icon_id:"24899653",name:"staff",font_class:"staff",unicode:"e6a7",unicode_decimal:59047},{icon_id:"24899654",name:"VIP",font_class:"vip",unicode:"e6a8",unicode_decimal:59048},{icon_id:"24899655",name:"folder_add",font_class:"folder-add",unicode:"e6a9",unicode_decimal:59049},{icon_id:"24899656",name:"tune",font_class:"tune",unicode:"e6aa",unicode_decimal:59050},{icon_id:"24899657",name:"shimingrenzheng",font_class:"auth",unicode:"e6ab",unicode_decimal:59051},{icon_id:"24899565",name:"person",font_class:"person",unicode:"e699",unicode_decimal:59033},{icon_id:"24899566",name:"email-filled",font_class:"email-filled",unicode:"e69a",unicode_decimal:59034},{icon_id:"24899567",name:"phone-filled",font_class:"phone-filled",unicode:"e69b",unicode_decimal:59035},{icon_id:"24899568",name:"phone",font_class:"phone",unicode:"e69c",unicode_decimal:59036},{icon_id:"24899570",name:"email",font_class:"email",unicode:"e69e",unicode_decimal:59038},{icon_id:"24899571",name:"personadd",font_class:"personadd",unicode:"e69f",unicode_decimal:59039},{icon_id:"24899558",name:"chatboxes-filled",font_class:"chatboxes-filled",unicode:"e692",unicode_decimal:59026},{icon_id:"24899559",name:"contact",font_class:"contact",unicode:"e693",unicode_decimal:59027},{icon_id:"24899560",name:"chatbubble-filled",font_class:"chatbubble-filled",unicode:"e694",unicode_decimal:59028},{icon_id:"24899561",name:"contact-filled",font_class:"contact-filled",unicode:"e695",unicode_decimal:59029},{icon_id:"24899562",name:"chatboxes",font_class:"chatboxes",unicode:"e696",unicode_decimal:59030},{icon_id:"24899563",name:"chatbubble",font_class:"chatbubble",unicode:"e697",unicode_decimal:59031},{icon_id:"24881290",name:"upload-filled",font_class:"upload-filled",unicode:"e68e",unicode_decimal:59022},{icon_id:"24881292",name:"upload",font_class:"upload",unicode:"e690",unicode_decimal:59024},{icon_id:"24881293",name:"weixin",font_class:"weixin",unicode:"e691",unicode_decimal:59025},{icon_id:"24881274",name:"compose",font_class:"compose",unicode:"e67f",unicode_decimal:59007},{icon_id:"24881275",name:"qq",font_class:"qq",unicode:"e680",unicode_decimal:59008},{icon_id:"24881276",name:"download-filled",font_class:"download-filled",unicode:"e681",unicode_decimal:59009},{icon_id:"24881277",name:"pengyouquan",font_class:"pyq",unicode:"e682",unicode_decimal:59010},{icon_id:"24881279",name:"sound",font_class:"sound",unicode:"e684",unicode_decimal:59012},{icon_id:"24881280",name:"trash-filled",font_class:"trash-filled",unicode:"e685",unicode_decimal:59013},{icon_id:"24881281",name:"sound-filled",font_class:"sound-filled",unicode:"e686",unicode_decimal:59014},{icon_id:"24881282",name:"trash",font_class:"trash",unicode:"e687",unicode_decimal:59015},{icon_id:"24881284",name:"videocam-filled",font_class:"videocam-filled",unicode:"e689",unicode_decimal:59017},{icon_id:"24881285",name:"spinner-cycle",font_class:"spinner-cycle",unicode:"e68a",unicode_decimal:59018},{icon_id:"24881286",name:"weibo",font_class:"weibo",unicode:"e68b",unicode_decimal:59019},{icon_id:"24881288",name:"videocam",font_class:"videocam",unicode:"e68c",unicode_decimal:59020},{icon_id:"24881289",name:"download",font_class:"download",unicode:"e68d",unicode_decimal:59021},{icon_id:"24879601",name:"help",font_class:"help",unicode:"e679",unicode_decimal:59001},{icon_id:"24879602",name:"navigate-filled",font_class:"navigate-filled",unicode:"e67a",unicode_decimal:59002},{icon_id:"24879603",name:"plusempty",font_class:"plusempty",unicode:"e67b",unicode_decimal:59003},{icon_id:"24879604",name:"smallcircle",font_class:"smallcircle",unicode:"e67c",unicode_decimal:59004},{icon_id:"24879605",name:"minus-filled",font_class:"minus-filled",unicode:"e67d",unicode_decimal:59005},{icon_id:"24879606",name:"micoff",font_class:"micoff",unicode:"e67e",unicode_decimal:59006},{icon_id:"24879588",name:"closeempty",font_class:"closeempty",unicode:"e66c",unicode_decimal:58988},{icon_id:"24879589",name:"clear",font_class:"clear",unicode:"e66d",unicode_decimal:58989},{icon_id:"24879590",name:"navigate",font_class:"navigate",unicode:"e66e",unicode_decimal:58990},{icon_id:"24879591",name:"minus",font_class:"minus",unicode:"e66f",unicode_decimal:58991},{icon_id:"24879592",name:"image",font_class:"image",unicode:"e670",unicode_decimal:58992},{icon_id:"24879593",name:"mic",font_class:"mic",unicode:"e671",unicode_decimal:58993},{icon_id:"24879594",name:"paperplane",font_class:"paperplane",unicode:"e672",unicode_decimal:58994},{icon_id:"24879595",name:"close",font_class:"close",unicode:"e673",unicode_decimal:58995},{icon_id:"24879596",name:"help-filled",font_class:"help-filled",unicode:"e674",unicode_decimal:58996},{icon_id:"24879597",name:"plus-filled",font_class:"paperplane-filled",unicode:"e675",unicode_decimal:58997},{icon_id:"24879598",name:"plus",font_class:"plus",unicode:"e676",unicode_decimal:58998},{icon_id:"24879599",name:"mic-filled",font_class:"mic-filled",unicode:"e677",unicode_decimal:58999},{icon_id:"24879600",name:"image-filled",font_class:"image-filled",unicode:"e678",unicode_decimal:59e3},{icon_id:"24855900",name:"locked-filled",font_class:"locked-filled",unicode:"e668",unicode_decimal:58984},{icon_id:"24855901",name:"info",font_class:"info",unicode:"e669",unicode_decimal:58985},{icon_id:"24855903",name:"locked",font_class:"locked",unicode:"e66b",unicode_decimal:58987},{icon_id:"24855884",name:"camera-filled",font_class:"camera-filled",unicode:"e658",unicode_decimal:58968},{icon_id:"24855885",name:"chat-filled",font_class:"chat-filled",unicode:"e659",unicode_decimal:58969},{icon_id:"24855886",name:"camera",font_class:"camera",unicode:"e65a",unicode_decimal:58970},{icon_id:"24855887",name:"circle",font_class:"circle",unicode:"e65b",unicode_decimal:58971},{icon_id:"24855888",name:"checkmarkempty",font_class:"checkmarkempty",unicode:"e65c",unicode_decimal:58972},{icon_id:"24855889",name:"chat",font_class:"chat",unicode:"e65d",unicode_decimal:58973},{icon_id:"24855890",name:"circle-filled",font_class:"circle-filled",unicode:"e65e",unicode_decimal:58974},{icon_id:"24855891",name:"flag",font_class:"flag",unicode:"e65f",unicode_decimal:58975},{icon_id:"24855892",name:"flag-filled",font_class:"flag-filled",unicode:"e660",unicode_decimal:58976},{icon_id:"24855893",name:"gear-filled",font_class:"gear-filled",unicode:"e661",unicode_decimal:58977},{icon_id:"24855894",name:"home",font_class:"home",unicode:"e662",unicode_decimal:58978},{icon_id:"24855895",name:"home-filled",font_class:"home-filled",unicode:"e663",unicode_decimal:58979},{icon_id:"24855896",name:"gear",font_class:"gear",unicode:"e664",unicode_decimal:58980},{icon_id:"24855897",name:"smallcircle-filled",font_class:"smallcircle-filled",unicode:"e665",unicode_decimal:58981},{icon_id:"24855898",name:"map-filled",font_class:"map-filled",unicode:"e666",unicode_decimal:58982},{icon_id:"24855899",name:"map",font_class:"map",unicode:"e667",unicode_decimal:58983},{icon_id:"24855825",name:"refresh-filled",font_class:"refresh-filled",unicode:"e656",unicode_decimal:58966},{icon_id:"24855826",name:"refresh",font_class:"refresh",unicode:"e657",unicode_decimal:58967},{icon_id:"24855808",name:"cloud-upload",font_class:"cloud-upload",unicode:"e645",unicode_decimal:58949},{icon_id:"24855809",name:"cloud-download-filled",font_class:"cloud-download-filled",unicode:"e646",unicode_decimal:58950},{icon_id:"24855810",name:"cloud-download",font_class:"cloud-download",unicode:"e647",unicode_decimal:58951},{icon_id:"24855811",name:"cloud-upload-filled",font_class:"cloud-upload-filled",unicode:"e648",unicode_decimal:58952},{icon_id:"24855813",name:"redo",font_class:"redo",unicode:"e64a",unicode_decimal:58954},{icon_id:"24855814",name:"images-filled",font_class:"images-filled",unicode:"e64b",unicode_decimal:58955},{icon_id:"24855815",name:"undo-filled",font_class:"undo-filled",unicode:"e64c",unicode_decimal:58956},{icon_id:"24855816",name:"more",font_class:"more",unicode:"e64d",unicode_decimal:58957},{icon_id:"24855817",name:"more-filled",font_class:"more-filled",unicode:"e64e",unicode_decimal:58958},{icon_id:"24855818",name:"undo",font_class:"undo",unicode:"e64f",unicode_decimal:58959},{icon_id:"24855819",name:"images",font_class:"images",unicode:"e650",unicode_decimal:58960},{icon_id:"24855821",name:"paperclip",font_class:"paperclip",unicode:"e652",unicode_decimal:58962},{icon_id:"24855822",name:"settings",font_class:"settings",unicode:"e653",unicode_decimal:58963},{icon_id:"24855823",name:"search",font_class:"search",unicode:"e654",unicode_decimal:58964},{icon_id:"24855824",name:"redo-filled",font_class:"redo-filled",unicode:"e655",unicode_decimal:58965},{icon_id:"24841702",name:"list",font_class:"list",unicode:"e644",unicode_decimal:58948},{icon_id:"24841489",name:"mail-open-filled",font_class:"mail-open-filled",unicode:"e63a",unicode_decimal:58938},{icon_id:"24841491",name:"hand-thumbsdown-filled",font_class:"hand-down-filled",unicode:"e63c",unicode_decimal:58940},{icon_id:"24841492",name:"hand-thumbsdown",font_class:"hand-down",unicode:"e63d",unicode_decimal:58941},{icon_id:"24841493",name:"hand-thumbsup-filled",font_class:"hand-up-filled",unicode:"e63e",unicode_decimal:58942},{icon_id:"24841494",name:"hand-thumbsup",font_class:"hand-up",unicode:"e63f",unicode_decimal:58943},{icon_id:"24841496",name:"heart-filled",font_class:"heart-filled",unicode:"e641",unicode_decimal:58945},{icon_id:"24841498",name:"mail-open",font_class:"mail-open",unicode:"e643",unicode_decimal:58947},{icon_id:"24841488",name:"heart",font_class:"heart",unicode:"e639",unicode_decimal:58937},{icon_id:"24839963",name:"loop",font_class:"loop",unicode:"e633",unicode_decimal:58931},{icon_id:"24839866",name:"pulldown",font_class:"pulldown",unicode:"e632",unicode_decimal:58930},{icon_id:"24813798",name:"scan",font_class:"scan",unicode:"e62a",unicode_decimal:58922},{icon_id:"24813786",name:"bars",font_class:"bars",unicode:"e627",unicode_decimal:58919},{icon_id:"24813788",name:"cart-filled",font_class:"cart-filled",unicode:"e629",unicode_decimal:58921},{icon_id:"24813790",name:"checkbox",font_class:"checkbox",unicode:"e62b",unicode_decimal:58923},{icon_id:"24813791",name:"checkbox-filled",font_class:"checkbox-filled",unicode:"e62c",unicode_decimal:58924},{icon_id:"24813794",name:"shop",font_class:"shop",unicode:"e62f",unicode_decimal:58927},{icon_id:"24813795",name:"headphones",font_class:"headphones",unicode:"e630",unicode_decimal:58928},{icon_id:"24813796",name:"cart",font_class:"cart",unicode:"e631",unicode_decimal:58929}]};const Pe=Se({name:"UniIcons",emits:["click"],props:{type:{type:String,default:""},color:{type:String,default:"#333333"},size:{type:[Number,String],default:16},customPrefix:{type:String,default:""}},data:()=>({icons:Ce.glyphs}),computed:{unicode(){let e=this.icons.find((e=>e.font_class===this.type));return e?unescape(`%u${e.unicode}`):""},iconSize(){return"number"==typeof(e=this.size)||/^[0-9]*$/g.test(e)?e+"px":e;var e}},methods:{_onClick(){this.$emit("click")}}},[["render",function(e,t,l,r,c,d){const u=n;return a(),i(u,{style:s({color:l.color,"font-size":d.iconSize}),class:o(["uni-icons",["uniui-"+l.type,l.customPrefix,l.customPrefix?l.type:""]]),onClick:d._onClick},null,8,["style","class","onClick"])}],["__scopeId","data-v-7c2f6cb0"]]),Ie={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:$e}=l(Ie);const Te=Se({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||$e("uni-search-bar.cancel")},placeholderText(){return this.placeholder||$e("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,r())},confirm(){r(),this.$emit("confirm",{value:this.searchVal})},blur(){r(),this.$emit("blur",{value:this.searchVal})},emitFocus(e){this.$emit("focus",e.detail)}}},[["render",function(e,t,o,l,r,_){const w=c(d("uni-icons"),Pe),v=b,x=y,k=n;return a(),i(v,{class:"uni-searchbar"},{default:u((()=>[h(v,{style:s({borderRadius:o.radius+"px",backgroundColor:o.bgColor}),class:"uni-searchbar__box",onClick:_.searchClick},{default:u((()=>[h(v,{class:"uni-searchbar__box-icon-search"},{default:u((()=>[f(e.$slots,"searchIcon",{},(()=>[h(w,{color:"#c0c4cc",size:"18",type:"search"})]),!0)])),_:3}),r.show||r.searchVal?(a(),i(x,{key:0,focus:r.showSync,disabled:o.readonly,placeholder:_.placeholderText,maxlength:o.maxlength,class:"uni-searchbar__box-search-input","confirm-type":"search",type:"text",modelValue:r.searchVal,"onUpdate:modelValue":t[0]||(t[0]=e=>r.searchVal=e),onConfirm:_.confirm,onBlur:_.blur,onFocus:_.emitFocus},null,8,["focus","disabled","placeholder","maxlength","modelValue","onConfirm","onBlur","onFocus"])):(a(),i(k,{key:1,class:"uni-searchbar__text-placeholder"},{default:u((()=>[m(p(o.placeholder),1)])),_:1})),r.show&&("always"===o.clearButton||"auto"===o.clearButton&&""!==r.searchVal)&&!o.readonly?(a(),i(v,{key:2,class:"uni-searchbar__box-icon-clear",onClick:_.clear},{default:u((()=>[f(e.$slots,"clearIcon",{},(()=>[h(w,{color:"#c0c4cc",size:"20",type:"clear"})]),!0)])),_:3},8,["onClick"])):g("",!0)])),_:3},8,["style","onClick"]),"always"===o.cancelButton||r.show&&"auto"===o.cancelButton?(a(),i(k,{key:0,onClick:_.cancel,class:"uni-searchbar__cancel"},{default:u((()=>[m(p(_.cancelTextI18n),1)])),_:1},8,["onClick"])):g("",!0)])),_:3})}],["__scopeId","data-v-d1d127ff"]]),Ae=Se({__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 n=e,l=_({searchVal:""}),r=()=>{t("click")};function f(e){e.value&&(C.$router.go("/pages/goods/list",{keyword:e.value}),setTimeout((()=>{l.searchVal=""}),100))}return(t,y)=>{const _=b,I=c(d("uni-search-bar"),Te),$=P;return a(),i(_,{class:o(["search-content ss-flex ss-col-center ss-row-between",[{"border-content":e.navbar}]]),onClick:r,style:s([{borderRadius:e.radius+"px",background:e.elBackground,height:e.height+"px",width:e.width}])},{default:u((()=>[e.navbar?(a(),i(_,{key:0,class:"ss-flex ss-col-center"},{default:u((()=>[h(_,{class:"search-icon _icon-search ss-m-l-10",style:s([{color:n.iconColor}])},null,8,["style"]),h(_,{class:"search-input ss-flex-1 ss-line-1",style:s([{color:e.fontColor,width:e.width}])},{default:u((()=>[m(p(e.placeholder),1)])),_:1},8,["style"])])),_:1})):g("",!0),e.navbar?g("",!0):(a(),i(I,{key:1,class:"ss-flex-1",radius:e.data.borderRadius,placeholder:e.data.placeholder,cancelButton:"none",clearButton:"none",onConfirm:f,modelValue:l.searchVal,"onUpdate:modelValue":y[0]||(y[0]=e=>l.searchVal=e)},null,8,["radius","placeholder","modelValue"])),h(_,{class:"keyword-link ss-flex"},{default:u((()=>[(a(!0),w(v,null,x(e.data.hotKeywords,((t,o)=>(a(),i(_,{key:o},{default:u((()=>[h(_,{class:"ss-m-r-16",style:s([{color:e.data.textColor}]),onClick:k((e=>S(C).$router.go("/pages/goods/list",{keyword:t})),["stop"])},{default:u((()=>[m(p(t),1)])),_:2},1032,["style","onClick"])])),_:2},1024)))),128))])),_:1}),e.data.hotKeywords&&e.data.hotKeywords.length&&e.navbar?(a(),i(_,{key:2,class:"ss-flex"},{default:u((()=>[(a(!0),w(v,null,x(e.data.hotKeywords,((t,o)=>(a(),i($,{class:"ss-reset-button keyword-btn",key:o,style:s([{color:e.data.textColor,marginRight:"10rpx"}])},{default:u((()=>[m(p(t),1)])),_:2},1032,["style"])))),128))])),_:1})):g("",!0)])),_:1},8,["style","class"])}}},[["__scopeId","data-v-59498a77"]]);class Be{constructor(e,t){this.options=e,this.animation=I(e),this.currentStepAnimates={},this.next=0,this.$=t}_nvuePushAnimates(e,t){let a=this.currentStepAnimates[this.next],i={};if(i=a||{styles:{},config:{}},Me.includes(e)){i.styles.transform||(i.styles.transform="");let a="";"rotate"===e&&(a="deg"),i.styles.transform+=`${e}(${t+a}) `}else i.styles[e]=`${t}`;this.currentStepAnimates[this.next]=i}_animateRun(e={},t={}){let a=this.$.$refs.ani.ref;if(a)return new Promise(((i,s)=>{nvueAnimation.transition(a,{styles:e,...t},(e=>{i()}))}))}_nvueNextAnimate(e,t=0,a){let i=e[t];if(i){let{styles:s,config:o}=i;this._animateRun(s,o).then((()=>{t+=1,this._nvueNextAnimate(e,t,a)}))}else this.currentStepAnimates={},"function"==typeof a&&a(),this.isEnd=!0}step(e={}){return this.animation.step(e),this}run(e){this.$.animationData=this.animation.export(),this.$.timer=setTimeout((()=>{"function"==typeof e&&e()}),this.$.durationTime)}}const Me=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function Ve(e,t){if(t)return clearTimeout(t.timer),new Be(e,t)}Me.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((e=>{Be.prototype[e]=function(...t){return this.animation[e](...t),this}}));const De=Se({name:"uniTransition",emits:["click","change"],props:{show:{type:Boolean,default:!1},modeClass:{type:[Array,String],default:()=>"fade"},duration:{type:Number,default:300},styles:{type:Object,default:()=>({})},customClass:{type:String,default:""}},data:()=>({isShow:!1,transform:"",opacity:1,animationData:{},durationTime:300,config:{}}),watch:{show:{handler(e){e?this.open():this.isShow&&this.close()},immediate:!0}},computed:{stylesObject(){let e={...this.styles,"transition-duration":this.duration/1e3+"s"},t="";for(let a in e){t+=this.toLine(a)+":"+e[a]+";"}return t},transformStyles(){return"transform:"+this.transform+";opacity:"+this.opacity+";"+this.stylesObject}},created(){this.config={duration:this.duration,timingFunction:"ease",transformOrigin:"50% 50%",delay:0},this.durationTime=this.duration},methods:{init(e={}){e.duration&&(this.durationTime=e.duration),this.animation=Ve(Object.assign(this.config,e),this)},onClick(){this.$emit("click",{detail:this.isShow})},step(e,t={}){if(this.animation){for(let t in e)try{"object"==typeof e[t]?this.animation[t](...e[t]):this.animation[t](e[t])}catch(a){console.error(`方法 ${t} 不存在`)}return this.animation.step(t),this}},run(e){this.animation&&this.animation.run(e)},open(){clearTimeout(this.timer),this.transform="",this.isShow=!0;let{opacity:e,transform:t}=this.styleInit(!1);void 0!==e&&(this.opacity=e),this.transform=t,this.$nextTick((()=>{this.timer=setTimeout((()=>{this.animation=Ve(this.config,this),this.tranfromInit(!1).step(),this.animation.run(),this.$emit("change",{detail:this.isShow})}),20)}))},close(e){this.animation&&this.tranfromInit(!0).step().run((()=>{this.isShow=!1,this.animationData=null,this.animation=null;let{opacity:e,transform:t}=this.styleInit(!1);this.opacity=e||1,this.transform=t,this.$emit("change",{detail:this.isShow})}))},styleInit(e){let t={transform:""},a=(e,a)=>{"fade"===a?t.opacity=this.animationType(e)[a]:t.transform+=this.animationType(e)[a]+" "};return"string"==typeof this.modeClass?a(e,this.modeClass):this.modeClass.forEach((t=>{a(e,t)})),t},tranfromInit(e){let t=(e,t)=>{let a=null;"fade"===t?a=e?0:1:(a=e?"-100%":"0","zoom-in"===t&&(a=e?.8:1),"zoom-out"===t&&(a=e?1.2:1),"slide-right"===t&&(a=e?"100%":"0"),"slide-bottom"===t&&(a=e?"100%":"0")),this.animation[this.animationMode()[t]](a)};return"string"==typeof this.modeClass?t(e,this.modeClass):this.modeClass.forEach((a=>{t(e,a)})),this.animation},animationType:e=>({fade:e?1:0,"slide-top":`translateY(${e?"0":"-100%"})`,"slide-right":`translateX(${e?"0":"100%"})`,"slide-bottom":`translateY(${e?"0":"100%"})`,"slide-left":`translateX(${e?"0":"-100%"})`,"zoom-in":`scaleX(${e?1:.8}) scaleY(${e?1:.8})`,"zoom-out":`scaleX(${e?1:1.2}) scaleY(${e?1:1.2})`}),animationMode:()=>({fade:"opacity","slide-top":"translateY","slide-right":"translateX","slide-bottom":"translateY","slide-left":"translateX","zoom-in":"scale","zoom-out":"scale"}),toLine:e=>e.replace(/([A-Z])/g,"-$1").toLowerCase()}},[["render",function(e,t,n,l,r,c){const d=b;return r.isShow?(a(),i(d,{key:0,ref:"ani",animation:r.animationData,class:o(n.customClass),style:s(c.transformStyles),onClick:c.onClick},{default:u((()=>[f(e.$slots,"default")])),_:3},8,["animation","class","style","onClick"])):g("",!0)}]]),Le={name:"SuPopup",components:{keypress:{name:"Keypress",props:{disable:{type:Boolean,default:!1}},mounted(){const e={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]};document.addEventListener("keyup",(t=>{if(this.disable)return;const a=Object.keys(e).find((a=>{const i=t.key,s=e[a];return s===i||Array.isArray(s)&&s.includes(i)}));a&&setTimeout((()=>{this.$emit(a,{})}),0)}))},render:()=>{}}},emits:["change","maskClick","close"],props:{show:{type:Boolean,default:!1},space:{type:Number,default:0},round:{type:[String,Number],default:0},showClose:{type:Boolean,default:!1},animation:{type:Boolean,default:!0},type:{type:String,default:"bottom"},isMaskClick:{type:Boolean,default:null},maskClick:{type:Boolean,default:null},backgroundColor:{type:String,default:"#ffffff"},backgroundImage:{type:String,default:""},safeArea:{type:Boolean,default:!0},maskBackgroundColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},zIndex:{type:[String,Number],default:10075}},watch:{show:{handler:function(e,t){(void 0!==t||e)&&(e?this.open():this.close())},immediate:!0},type:{handler:function(e){this.config[e]&&this[this.config[e]](!0)},immediate:!0},isDesktop:{handler:function(e){this.config[e]&&this[this.config[this.type]](!0)},immediate:!0},maskClick:{handler:function(e){this.mkclick=e},immediate:!0},isMaskClick:{handler:function(e){this.mkclick=e},immediate:!0},showPopup(e){document.getElementsByTagName("body")[0].style.overflow=e?"hidden":"visible"}},data(){return{sheep:C,duration:300,ani:[],showPopup:!1,showTrans:!1,popupWidth:0,popupHeight:0,config:{top:"top",bottom:"bottom",center:"center",left:"left",right:"right",message:"top",dialog:"center",share:"bottom"},maskClass:{position:"fixed",bottom:0,top:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.4)"},transClass:{position:"fixed",left:0,right:0},maskShow:!0,mkclick:!0,popupstyle:this.isDesktop?"fixforpc-top":"top"}},computed:{isDesktop(){return this.popupWidth>=500&&this.popupHeight>=500},bg(){return""===this.backgroundColor||"none"===this.backgroundColor?"transparent":this.backgroundColor},borderRadius(){if(this.round){if("bottom"===this.type)return{"border-top-left-radius":parseFloat(this.round)+"px","border-top-right-radius":parseFloat(this.round)+"px"};if("center"===this.type)return{"border-top-left-radius":parseFloat(this.round)+"px","border-top-right-radius":parseFloat(this.round)+"px","border-bottom-left-radius":parseFloat(this.round)+"px","border-bottom-right-radius":parseFloat(this.round)+"px"};if("top"===this.type)return{"border-bottom-left-radius":parseFloat(this.round)+"px","border-bottom-right-radius":parseFloat(this.round)+"px"}}}},mounted(){(()=>{const{windowWidth:e,windowHeight:t,windowTop:a,safeArea:i,screenHeight:s,safeAreaInsets:o}=C.$platform.device;this.popupWidth=e,this.popupHeight=t+(a||0),i&&this.safeArea?this.safeAreaInsets=o.bottom:this.safeAreaInsets=0})()},unmounted(){this.setH5Visible()},created(){null===this.isMaskClick&&null===this.maskClick?this.mkclick=!0:this.mkclick=null!==this.isMaskClick?this.isMaskClick:this.maskClick,this.animation?this.duration=300:this.duration=0,this.messageChild=null,this.clearPropagation=!1,this.maskClass.backgroundColor=this.maskBackgroundColor},methods:{setH5Visible(){document.getElementsByTagName("body")[0].style.overflow="visible"},closeMask(){this.maskShow=!1},disableMask(){this.mkclick=!1},clear(e){e.stopPropagation(),this.clearPropagation=!0},open(e){this.showPopup&&(clearTimeout(this.timer),this.showPopup=!1);e&&-1!==["top","center","bottom","left","right","message","dialog","share"].indexOf(e)||(e=this.type),this.config[e]?(this[this.config[e]](),this.$emit("change",{show:!0,type:e})):console.error("缺少类型:",e)},close(e){this.showTrans=!1,this.$emit("change",{show:!1,type:this.type}),this.$emit("close"),clearTimeout(this.timer),this.timer=setTimeout((()=>{this.showPopup=!1}),300)},touchstart(){this.clearPropagation=!1},onTap(){this.clearPropagation?this.clearPropagation=!1:(this.$emit("maskClick"),this.mkclick&&this.close())},top(e){this.popupstyle=this.isDesktop?"fixforpc-top":"top",this.ani=["slide-top"],this.transClass={position:"fixed",left:0,right:0,top:this.space+"px",backgroundColor:this.bg},e||(this.showPopup=!0,this.showTrans=!0,this.$nextTick((()=>{this.messageChild&&"message"===this.type&&this.messageChild.timerClose()})))},bottom(e){this.popupstyle="bottom",this.ani=["slide-bottom"],this.transClass={position:"fixed",left:0,right:0,bottom:0,paddingBottom:this.safeAreaInsets+this.space+"px",backgroundColor:this.bg},e||(this.showPopup=!0,this.showTrans=!0)},center(e){this.popupstyle="center",this.ani=["zoom-out","fade"],this.transClass={position:"fixed",display:"flex",flexDirection:"column",bottom:0,left:0,right:0,top:0,justifyContent:"center",alignItems:"center"},e||(this.showPopup=!0,this.showTrans=!0)},left(e){this.popupstyle="left",this.ani=["slide-left"],this.transClass={position:"fixed",left:0,bottom:0,top:0,backgroundColor:this.bg,display:"flex",flexDirection:"column"},e||(this.showPopup=!0,this.showTrans=!0)},right(e){this.popupstyle="right",this.ani=["slide-right"],this.transClass={position:"fixed",bottom:0,right:0,top:0,backgroundColor:this.bg,display:"flex",flexDirection:"column"},e||(this.showPopup=!0,this.showTrans=!0)}}},Fe=()=>{$((e=>({"0e55919e":e.backgroundImage})))},ze=Le.setup;Le.setup=ze?(e,t)=>(Fe(),ze(e,t)):Fe;const Ee=Se(Le,[["render",function(e,t,n,l,r,m){const p=c(d("uni-transition"),De),y=c(d("uni-icons"),Pe),_=b,w=T("keypress");return r.showPopup?(a(),i(_,{key:0,class:o(["uni-popup",[r.popupstyle,m.isDesktop?"fixforpc-z-index":""]]),style:s([{zIndex:n.zIndex}]),onTouchmove:k(m.clear,["stop","prevent"])},{default:u((()=>[h(_,{onTouchstart:m.touchstart},{default:u((()=>[r.maskShow?(a(),i(p,{key:"1",name:"mask","mode-class":"fade",styles:r.maskClass,duration:r.duration,show:r.showTrans,onClick:m.onTap},null,8,["styles","duration","show","onClick"])):g("",!0),h(p,{key:"2","mode-class":r.ani,name:"content",styles:{...r.transClass,...m.borderRadius},duration:r.duration,show:r.showTrans,onClick:m.onTap},{default:u((()=>[r.showPopup?(a(),i(_,{key:0,class:o(["uni-popup__wrapper",[r.popupstyle]]),style:s([{backgroundColor:m.bg},m.borderRadius]),onClick:m.clear},{default:u((()=>[n.showClose?(a(),i(y,{key:0,class:"close-icon",color:"#F6F6F6",type:"closeempty",size:"32",onClick:m.close},null,8,["onClick"])):g("",!0),f(e.$slots,"default",{},void 0,!0)])),_:3},8,["style","class","onClick"])):g("",!0)])),_:3},8,["mode-class","styles","duration","show","onClick"])])),_:3},8,["onTouchstart"]),r.maskShow?(a(),i(w,{key:0,onEsc:m.onTap},null,8,["onEsc"])):g("",!0)])),_:3},8,["class","style","onTouchmove"])):g("",!0)}],["__scopeId","data-v-c08d499a"]]),Oe=Se({__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 t=e,{safeAreaInsets:n}=C.$platform.device,l=L(),r=C.$helper.guid(),c=C.$platform.navbar,d=_({content:{},fixed:!0,scrollTop:0,opacityVal:0}),m=A((()=>d.fixed&&t.bottom?t.isInset?t.val+"px":t.val+n.bottom+"px":"auto"));d.fixed=!S(t.sticky),B((e=>{let t=e.scrollTop;d.scrollTop=t,d.opacityVal=t>C.$platform.navbar?1:.01*t})),M((()=>{V((()=>{p()}))}));const p=()=>{D().in(l).select(`#fixed-${r}`).boundingClientRect((e=>{null!=e&&(d.content=e,S(t.sticky)&&y(d.scrollTop))})).exec()},y=e=>{S(t.bottom)?d.fixed=e>=d.content.bottom-C.$platform.device.windowHeight+d.content.height+S(t.val):d.fixed=e>=d.content.top-(S(t.noNav)?S(t.val):S(t.val)+C.$platform.navbar)},w=()=>{t.hasToTop&&F({scrollTop:d.content.top,duration:100})};return(t,l)=>{const p=b;return a(),i(p,{class:"ui-fixed"},{default:u((()=>[h(p,{class:o(["ui-fixed-box",[{fixed:d.fixed}]]),id:`fixed-${S(r)}`,style:s([{left:e.sticky?"auto":"0px",top:d.fixed&&!e.bottom?(e.noNav?e.val:e.val+S(c))+"px":"auto",bottom:S(m),zIndex:e.index+S(C).$zIndex.navbar},e.alway?"":{opacity:d.opacityVal}])},{default:u((()=>[h(p,{class:"ui-fixed-content",onClick:w,style:s([{zIndex:e.index+S(C).$zIndex.navbar}])},{default:u((()=>[f(t.$slots,"default",{},void 0,!0),S(n).bottom&&e.bottom&&e.isInset?(a(),i(p,{key:0,class:"inset-bottom",style:s([{height:S(n).bottom+"px"}])},null,8,["style"])):g("",!0)])),_:3},8,["style"]),e.bottom?(a(),i(p,{key:0,class:o(["ui-fixed-bottom",[e.bg]])},null,8,["class"])):g("",!0),h(p,{class:o(["ui-fixed-bg",[e.ui,e.bg]]),style:s([{zIndex:e.index+S(C).$zIndex.navbar-1},e.bgStyles,e.opacity?{opacity:d.opacityVal}:""])},null,8,["class","style"])])),_:3},8,["id","class","style"]),(e.sticky||e.placeholder)&&d.fixed?(a(),i(p,{key:0,class:"skeleton",style:s([{height:d.content.height+"px",width:e.width+"px"}])},null,8,["style"])):g("",!0)])),_:3})}}},[["__scopeId","data-v-bb090a1f"]]),Re=Se({__name:"su-status-bar",setup(e){const t=C.$platform.device.statusBarHeight+"px";return(e,o)=>{const n=b;return a(),i(n,{style:s({height:t}),class:"uni-status-bar"},{default:u((()=>[f(e.$slots,"default",{},void 0,!0)])),_:3},8,["style"])}}},[["__scopeId","data-v-c47205c9"]]),Ne=Se({__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 l=e,r=e=>"number"==typeof e?e+"px":e;A((()=>({width:C.$platform.capsule.width+"px",height:C.$platform.capsule.height+"px",margin:"0 "+(C.$platform.device.windowWidth-C.$platform.capsule.right)+"px"})));const y=A((()=>l.defaultSearch));A((()=>l.dark?l.backgroundColor?l.backgroundColor:l.dark?"#333":"#FFF":l.backgroundColor||"#FFF"));const _=A((()=>l.dark?l.color?l.color:l.dark?"#fff":"#333":l.color||"#333")),w=A((()=>r(l.height))),v=A((()=>r(l.leftWidth)));function x(e){t("search",e.value)}A((()=>r(l.rightWidth))),z((()=>{uni.report&&""!==l.title&&uni.report("title",l.title)}));const k=C.$router.hasHistory();function P(){k?C.$router.back():C.$router.go("/pages/index/index"),t("clickLeft")}function I(){t("clickTitle")}return(t,l)=>{const r=b,$=c(d("su-status-bar"),Re),T=n,A=c(d("uni-search-bar"),Te);return a(),i(r,{class:o(["uni-navbar",{"uni-dark":e.dark}])},{default:u((()=>[h(r,{class:o([{"uni-navbar--fixed":e.fixed,"uni-navbar--shadow":e.shadow,"uni-navbar--border":e.border},"uni-navbar__content"])},{default:u((()=>[h(r,{class:o(["fixed-bg",[e.opacity?"":e.opacityBgUi]])},null,8,["class"]),e.statusBar?(a(),i($,{key:0})):g("",!0),h(r,{style:s({color:S(_),height:S(w),background:e.backgroundColor}),class:"uni-navbar__header"},{default:u((()=>[h(r,{class:"uni-navbar__header-btns uni-navbar__header-btns-left",style:s({width:S(v)})},{default:u((()=>[f(t.$slots,"left",{},(()=>[e.leftIcon.length>0?(a(),i(r,{key:0,class:"uni-navbar__content_view"},{default:u((()=>[h(r,{class:"icon-box ss-flex"},{default:u((()=>[h(r,{class:"icon-button icon-button-left ss-flex ss-row-center",onClick:P},{default:u((()=>[S(k)?(a(),i(T,{key:0,class:"sicon-back"})):(a(),i(T,{key:1,class:"sicon-home"}))])),_:1}),h(r,{class:"line"}),h(r,{class:"icon-button icon-button-right ss-flex ss-row-center",onClick:S(E)},{default:u((()=>[h(T,{class:"sicon-more"})])),_:1},8,["onClick"])])),_:1})])),_:1})):g("",!0),"left"===e.titleAlign&&e.title.length&&"WechatOfficialAccount"!==S(C).$platform.name?(a(),i(r,{key:1,class:o([{"uni-navbar-btn-icon-left":!e.leftIcon.length>0},"uni-navbar-btn-text"])},{default:u((()=>[h(T,{style:s({color:S(_),fontSize:"18px"})},{default:u((()=>[m(p(e.title),1)])),_:1},8,["style"])])),_:1},8,["class"])):g("",!0)]),!0)])),_:3},8,["style"]),"search"===e.tools?(a(),i(r,{key:0,class:"ss-flex-1"},{default:u((()=>[f(t.$slots,"center",{},(()=>[h(A,{class:"ss-flex-1 search-box",radius:20,placeholder:"请输入关键词",cancelButton:"none",modelValue:S(y),"onUpdate:modelValue":l[0]||(l[0]=e=>O(y)?y.value=e:null),onConfirm:x},null,8,["modelValue"])]),!0)])),_:3})):(a(),i(r,{key:1,class:"uni-navbar__header-container",onClick:I},{default:u((()=>[f(t.$slots,"center",{},(()=>["title"===e.tools&&"center"===e.titleAlign&&e.title.length?(a(),i(r,{key:0,class:"uni-navbar__header-container-inner"},{default:u((()=>[h(T,{style:s({color:S(_),fontSize:"36rpx"}),class:"ss-line-1"},{default:u((()=>[m(p(e.title),1)])),_:1},8,["style"])])),_:1})):g("",!0)]),!0)])),_:3}))])),_:3},8,["style"])])),_:3},8,["class"]),e.placeholder?(a(),i(r,{key:0,class:"uni-navbar__placeholder"},{default:u((()=>[e.statusBar?(a(),i($,{key:0})):g("",!0),h(r,{class:"uni-navbar__placeholder-view",style:s({height:S(w)})},null,8,["style"])])),_:1})):g("",!0)])),_:3},8,["class"])}}},[["__scopeId","data-v-c05a9774"]]),je=Se({__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 n=e,l=_({statusCur:"",capsuleStyle:{},capsuleBack:{}}),r=C.$platform.device.statusBarHeight,m=C.$platform.navbar;R((()=>{p()}));const p=()=>{l.capsuleStyle={width:C.$platform.capsule.width+"px",height:C.$platform.capsule.height+"px",margin:"0 "+(C.$platform.device.windowWidth-C.$platform.capsule.right)+"px"},l.capsuleBack=l.capsuleStyle};return(e,t)=>{const l=c(d("su-status-bar"),Re),p=b,g=c(d("su-fixed"),Oe);return a(),i(g,{noFixed:n.noFixed,alway:n.alway,bgStyles:n.bgStyles,val:0,index:n.zIndex,noNav:"",bg:n.bg,ui:n.ui,opacity:n.opacity,placeholder:n.placeholder,sticky:n.sticky},{default:u((()=>[h(l),h(p,{class:"ui-navbar-box"},{default:u((()=>[h(p,{class:o(["ui-bar",""==n.status?"text-a":"light"==n.status?"text-white":"text-black"]),style:s([{height:S(m)-S(r)+"px"}])},{default:u((()=>[f(e.$slots,"item",{},void 0,!0),h(p,{class:"right"})])),_:3},8,["class","style"])])),_:3})])),_:3},8,["noFixed","alway","bgStyles","index","bg","ui","opacity","placeholder","sticky"])}}},[["__scopeId","data-v-1b1aaaf2"]]),We=Se({__name:"navbar-item",props:{data:{type:Object,default:()=>({})},width:{type:String,default:"1px"}},setup(e){const t=A((()=>C.$platform.capsule.height));return(o,n)=>{const l=b,r=N,f=c(d("s-search-block"),Ae);return a(),i(l,{class:"ss-flex ss-col-center"},{default:u((()=>["text"===e.data.type?(a(),i(l,{key:0,class:"nav-title inline",style:s([{color:e.data.textColor,width:e.width}])},{default:u((()=>[m(p(e.data.text),1)])),_:1},8,["style"])):g("",!0),"image"===e.data.type?(a(),i(l,{key:1,style:s([{width:e.width}]),class:"menu-icon-wrap ss-flex ss-row-center ss-col-center",onClick:n[0]||(n[0]=t=>S(C).$router.go(e.data.url))},{default:u((()=>[h(r,{class:"nav-image",src:S(C).$url.cdn(e.data.src),mode:"aspectFit"},null,8,["src"])])),_:1},8,["style"])):g("",!0),"search"==e.data.type?(a(),i(l,{key:2,class:"ss-flex-1",style:s([{width:e.width}])},{default:u((()=>[h(f,{placeholder:e.data.placeholder||"搜索关键字",radius:e.data.borderRadius,elBackground:"#fff",height:S(t),width:e.width,onClick:n[1]||(n[1]=e=>S(C).$router.go("/pages/index/search"))},null,8,["placeholder","radius","height","width"])])),_:1},8,["style"])):g("",!0)])),_:1})}}},[["__scopeId","data-v-89a97bd5"]]),Ue=Se({__name:"s-custom-navbar",props:{data:{type:Object,default:()=>({})},showLeftButton:{type:Boolean,default:!1}},setup(e){const t=e,l=C.$router.hasHistory(),r=A((()=>("inner"!=t.data.mode||!t.data.alway)&&("normal"!=t.data.mode&&void 0))),c=A((()=>t.data.list?t.data.list.app:[])),d=C.$platform.device.windowWidth,f=A((()=>{if(S(c).length){return(d-90)/8}})),m=e=>({width:e.width*f.value+10*(e.width-1)+"px",left:e.left*f.value+10*(e.left+1)+"px","border-radius":e.borderRadius+"px"}),p=A((()=>"inner"!==t.data.mode||Boolean(t.data.alwaysShow))),y=A((()=>"normal"!==t.data.mode&&(!t.showLeftButton&&"inner"===t.data.mode))),_=A((()=>"normal"===t.data.mode)),k=A((()=>{if(t.data.type)return{background:"color"==t.data.type?t.data.color:`url(${C.$url.cdn(t.data.src)}) no-repeat top center / 100% 100%`}}));function P(){l?C.$router.back():C.$router.go("/pages/index/index")}function I(){E()}return(t,d)=>{const f=n,C=b;return a(),i(je,{alway:S(p),back:!1,bg:"",placeholder:S(_),bgStyles:S(k),opacity:S(y),sticky:S(r)},{item:u((()=>[h(C,{class:"nav-box"},{default:u((()=>[e.showLeftButton?(a(),i(C,{key:0,class:"nav-icon"},{default:u((()=>[h(C,{class:o(["icon-box ss-flex",{"inner-icon-box":"inner"==e.data.mode}])},{default:u((()=>[h(C,{class:"icon-button icon-button-left ss-flex ss-row-center",onClick:P},{default:u((()=>[S(l)?(a(),i(f,{key:0,class:"sicon-back"})):(a(),i(f,{key:1,class:"sicon-home"}))])),_:1}),h(C,{class:"line"}),h(C,{class:"icon-button icon-button-right ss-flex ss-row-center",onClick:I},{default:u((()=>[h(f,{class:"sicon-more"})])),_:1})])),_:1},8,["class"])])),_:1})):g("",!0),(a(!0),w(v,null,x(S(c),((e,t)=>(a(),i(C,{class:o(["nav-item",[{"ss-flex ss-col-center ss-row-center":"search"!==e.type}]]),key:t,style:s([m(e)])},{default:u((()=>[h(We,{data:e,width:m(e).width},null,8,["data","width"])])),_:2},1032,["style","class"])))),128))])),_:1})])),_:1},8,["alway","placeholder","bgStyles","opacity","sticky"])}}},[["__scopeId","data-v-6478786c"]]),He=Se({__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 l=e,r=_({statusCur:"",capsuleStyle:{},capsuleBack:{},isDark:!0}),g=C.$platform.device.statusBarHeight,y=C.$platform.navbar,w=C.$router.hasHistory();function v(){w?C.$router.back():C.$router.go("/pages/index/index"),t("clickLeft")}function x(){E()}R((()=>{k()})),B((e=>{let t=e.scrollTop;r.isDark=t<C.$platform.navbar}));const k=()=>{r.capsuleStyle={width:C.$platform.capsule.width+"px",height:C.$platform.capsule.height+"px"},r.capsuleBack=r.capsuleStyle};return(t,_)=>{const k=c(d("su-status-bar"),Re),C=n,P=b,I=c(d("su-fixed"),Oe);return a(),i(I,{noFixed:l.noFixed,alway:l.alway,bgStyles:l.bgStyles,val:0,index:l.zIndex,noNav:"",bg:l.bg,ui:l.ui,opacity:l.opacity,placeholder:l.placeholder},{default:u((()=>[h(k),h(P,{class:"ui-navbar-box"},{default:u((()=>[h(P,{class:o(["ui-bar ss-p-x-20",r.isDark?"text-white":"text-black"]),style:s([{height:S(y)-S(g)+"px"}])},{default:u((()=>[h(P,{class:"icon-box ss-flex"},{default:u((()=>[h(P,{class:"icon-button icon-button-left ss-flex ss-row-center",onClick:v},{default:u((()=>[S(w)?(a(),i(C,{key:0,class:"sicon-back"})):(a(),i(C,{key:1,class:"sicon-home"}))])),_:1}),h(P,{class:"line"}),h(P,{class:"icon-button icon-button-right ss-flex ss-row-center",onClick:x},{default:u((()=>[h(C,{class:"sicon-more"})])),_:1})])),_:1}),f(t.$slots,"center",{},(()=>[h(P,{class:"center navbar-title"},{default:u((()=>[m(p(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 qe=Se({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:j,parentData:{value:null,activeColor:"",color:""},parent:{}}),created(){this.init()},methods:{getParentData(e=""){this.parent||(this.parent={}),this.parent=W.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,o,l,r,c){const d=N,g=b,y=n;return a(),i(g,{class:"u-tabbar-item",style:s([r.addStyle(o.customStyle)])},{default:u((()=>[o.isCenter?(a(),i(g,{key:0,class:"tabbar-center-item"},{default:u((()=>[h(d,{class:"center-image",src:o.centerImage,mode:"aspectFill"},null,8,["src"])])),_:1})):(a(),w(v,{key:1},[h(g,{class:"u-tabbar-item__icon"},{default:u((()=>[o.icon?(a(),i(d,{key:0,name:o.icon,color:r.isActive?r.parentData.activeColor:r.parentData.color,size:20},null,8,["name","color"])):(a(),w(v,{key:1},[r.isActive?f(e.$slots,"active-icon",{key:0},void 0,!0):f(e.$slots,"inactive-icon",{key:1},void 0,!0)],64))])),_:3}),f(e.$slots,"text",{},(()=>[h(y,{class:"u-tabbar-item__text",style:s({color:r.isActive?r.parentData.activeColor:r.parentData.color})},{default:u((()=>[m(p(o.text),1)])),_:1},8,["style"])]),!0)],64))])),_:3},8,["style"])}],["__scopeId","data-v-191720f8"]]);const Ge=Se({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:C.$platform.device.safeAreaInsets.bottom}),computed:{tabbarStyle(){const e={zIndex:this.zIndex};return U(e,j(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=>{D().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 H(20),this.getRect(".u-tabbar__content").then((({height:e=50})=>{this.placeholderHeight=e})))}}},[["render",function(e,t,n,l,r,c){const d=b;return a(),i(d,{class:"u-tabbar"},{default:u((()=>[h(d,{class:o(["u-tabbar__content",[n.border&&"u-border-top",n.fixed&&"u-tabbar--fixed",{"mid-tabbar":n.midTabBar}]]),ref:"u-tabbar__content",onTouchmove:t[0]||(t[0]=k((()=>{}),["stop","prevent"])),style:s([c.tabbarStyle])},{default:u((()=>[h(d,{class:"u-tabbar__content__item-wrapper"},{default:u((()=>[f(e.$slots,"default",{},void 0,!0)])),_:3}),n.safeAreaInsetBottom?(a(),i(d,{key:0,style:s([{height:r.safeBottomHeight+"px"}])},null,8,["style"])):g("",!0)])),_:3},8,["class","style"]),n.placeholder?(a(),i(d,{key:0,class:"u-tabbar__placeholder",style:s({height:r.placeholderHeight+"px"})},null,8,["style"])):g("",!0)])),_:3})}],["__scopeId","data-v-cc8282eb"]]),Xe=Se({__name:"s-tabbar",props:{path:String,default:""},setup(e){const t=A((()=>{var e;return null==(e=C.$store("app").template.basic)?void 0:e.tabbar})),s=A((()=>{const e=t.value.style;return"color"===e.bgType?{background:e.bgColor}:"img"===e.bgType?{background:`url(${C.$url.cdn(e.bgImg)}) no-repeat top center / 100% auto`}:void 0})),o=e=>2===S(t).mode&&(S(t).items%2>0&&Math.ceil(S(t).items.length/2)===e+1);return(n,l)=>{var r,f;const m=N,p=c(d("su-tabbar-item"),qe),y=c(d("su-tabbar"),Ge),_=b;return(null==(f=null==(r=S(t))?void 0:r.items)?void 0:f.length)>0?(a(),i(_,{key:0,class:"u-page__item"},{default:u((()=>[h(y,{value:e.path,fixed:!0,placeholder:!0,safeAreaInsetBottom:!0,inactiveColor:S(t).style.color,activeColor:S(t).style.activeColor,midTabBar:2===S(t).mode,customStyle:S(s)},{default:u((()=>[(a(!0),w(v,null,x(S(t).items,((e,t)=>(a(),i(p,{key:e.text,text:e.text,name:e.url,isCenter:o(t),centerImage:S(C).$url.cdn(e.iconUrl),onClick:t=>S(C).$router.go(e.url)},{"active-icon":u((()=>[h(m,{class:"u-page__item__slot-icon",src:S(C).$url.cdn(e.activeIconUrl)},null,8,["src"])])),"inactive-icon":u((()=>[h(m,{class:"u-page__item__slot-icon",src:S(C).$url.cdn(e.iconUrl)},null,8,["src"])])),_:2},1032,["text","name","isCenter","centerImage","onClick"])))),128))])),_:1},8,["value","inactiveColor","activeColor","midTabBar","customStyle"])])),_:1})):g("",!0)}}},[["__scopeId","data-v-2389827b"]]);const Ze=Se({name:"uni-easyinput",emits:["click","iconClick","update:modelValue","input","focus","blur","confirm"],model:{prop:"modelValue",event:"update:modelValue"},props:{name:String,value:[Number,String],modelValue:[Number,String],type:{type:String,default:"text"},clearable:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},placeholder:String,placeholderStyle:String,focus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},maxlength:{type:[Number,String],default:140},confirmType:{type:String,default:"done"},clearSize:{type:[Number,String],default:15},inputBorder:{type:Boolean,default:!0},prefixIcon:{type:String,default:""},suffixIcon:{type:String,default:""},trim:{type:[Boolean,String],default:!0},passwordIcon:{type:Boolean,default:!0},styles:{type:Object,default:()=>({color:"#333",disableColor:"#F7F6F6",borderColor:"#e5e5e5"})},errorMessage:{type:[String,Boolean],default:""},paddingLeft:{type:[Number,String],default:0}},data:()=>({focused:!1,errMsg:"",val:"",showMsg:"",border:!1,isFirstBorder:!1,showClearIcon:!1,showPassword:!1}),computed:{msg(){return this.errorMessage||this.errMsg},inputMaxlength(){return Number(this.maxlength)}},watch:{value(e){this.errMsg&&(this.errMsg=""),this.val=e,this.form&&this.formItem&&!this.is_reset&&(this.is_reset=!1,this.formItem.setValue(e))},modelValue(e){this.errMsg&&(this.errMsg=""),this.val=e,this.form&&this.formItem&&!this.is_reset&&(this.is_reset=!1,this.formItem.setValue(e))},focus(e){this.$nextTick((()=>{this.focused=this.focus}))}},created(){this.value||0===this.value||(this.val=this.modelValue),this.modelValue||0===this.modelValue||(this.val=this.value),this.form=this.getForm("uniForms"),this.formItem=this.getForm("uniFormsItem"),this.form&&this.formItem&&this.formItem.name&&(this.is_reset||(this.is_reset=!1,this.formItem.setValue(this.val)),this.rename=this.formItem.name,this.form.inputChildrens.push(this))},mounted(){this.$nextTick((()=>{this.focused=this.focus}))},methods:{init(){},onClickIcon(e){this.$emit("iconClick",e)},getForm(e="uniForms"){let t=this.$parent,a=t.$options.name;for(;a!==e;){if(t=t.$parent,!t)return!1;a=t.$options.name}return t},onEyes(){this.showPassword=!this.showPassword},onInput(e){let t=e.detail.value;this.trim&&("boolean"==typeof this.trim&&this.trim&&(t=this.trimStr(t)),"string"==typeof this.trim&&(t=this.trimStr(t,this.trim))),this.errMsg&&(this.errMsg=""),this.val=t,this.$emit("input",t),this.$emit("update:modelValue",t)},onFocus(e){this.$emit("focus",e)},onBlur(e){e.detail.value,this.$emit("blur",e)},onConfirm(e){this.$emit("confirm",e.detail.value)},onClear(e){this.val="",this.$emit("input",""),this.$emit("update:modelValue","")},fieldClick(){this.$emit("click")},trimStr:(e,t="both")=>"both"===t?e.trim():"left"===t?e.trimLeft():"right"===t?e.trimRight():"start"===t?e.trimStart():"end"===t?e.trimEnd():"all"===t?e.replace(/\s+/g,""):e}},[["render",function(e,t,n,l,r,m){const p=c(d("uni-icons"),Pe),_=q,x=y,k=b;return a(),i(k,{class:o(["uni-easyinput",{"uni-easyinput-error":m.msg}]),style:s({color:n.inputBorder&&m.msg?"#e43d33":n.styles.color})},{default:u((()=>[h(k,{class:o(["uni-easyinput__content",{"is-input-border":n.inputBorder,"is-input-error-border":n.inputBorder&&m.msg,"is-textarea":"textarea"===n.type,"is-disabled":n.disabled}]),style:s({"border-color":n.inputBorder&&m.msg?"#dd524d":n.styles.borderColor,"background-color":n.disabled?n.styles.disableColor:""})},{default:u((()=>[n.prefixIcon?(a(),i(p,{key:0,class:"content-clear-icon",type:n.prefixIcon,color:"#c0c4cc",onClick:t[0]||(t[0]=e=>m.onClickIcon("prefix"))},null,8,["type"])):g("",!0),"textarea"===n.type?(a(),i(_,{key:1,class:o(["uni-easyinput__content-textarea",{"input-padding":n.inputBorder}]),name:n.name,value:r.val,placeholder:n.placeholder,placeholderStyle:n.placeholderStyle,disabled:n.disabled,"placeholder-class":"uni-easyinput__placeholder-class",maxlength:m.inputMaxlength,focus:r.focused,autoHeight:n.autoHeight,onInput:m.onInput,onBlur:m.onBlur,onFocus:m.onFocus,onConfirm:m.onConfirm},null,8,["class","name","value","placeholder","placeholderStyle","disabled","maxlength","focus","autoHeight","onInput","onBlur","onFocus","onConfirm"])):(a(),i(x,{key:2,type:"password"===n.type?"text":n.type,class:"uni-easyinput__content-input",style:s({"padding-right":"password"===n.type||n.clearable||n.prefixIcon?"":"10px","padding-left":n.paddingLeft+"px"}),name:n.name,value:r.val,password:!r.showPassword&&"password"===n.type,placeholder:n.placeholder,placeholderStyle:n.placeholderStyle,"placeholder-class":"uni-easyinput__placeholder-class",disabled:n.disabled,maxlength:m.inputMaxlength,focus:r.focused,confirmType:n.confirmType,onFocus:m.onFocus,onBlur:m.onBlur,onInput:m.onInput,onChange:m.onInput,onConfirm:m.onConfirm,"cursor-spacing":30,"always-embed":""},null,8,["type","style","name","value","password","placeholder","placeholderStyle","disabled","maxlength","focus","confirmType","onFocus","onBlur","onInput","onChange","onConfirm"])),"password"===n.type&&n.passwordIcon?(a(),w(v,{key:3},[r.val?(a(),i(p,{key:0,class:o(["content-clear-icon",{"is-textarea-icon":"textarea"===n.type}]),type:r.showPassword?"eye-slash-filled":"eye-filled",size:18,color:"#c0c4cc",onClick:m.onEyes},null,8,["class","type","onClick"])):g("",!0)],64)):n.suffixIcon?(a(),w(v,{key:4},[n.suffixIcon?(a(),i(p,{key:0,class:"content-clear-icon",type:n.suffixIcon,color:"#c0c4cc",onClick:t[1]||(t[1]=e=>m.onClickIcon("suffix"))},null,8,["type"])):g("",!0)],64)):(a(),w(v,{key:5},[n.clearable&&r.val&&!n.disabled?(a(),i(p,{key:0,class:o(["content-clear-icon",{"is-textarea-icon":"textarea"===n.type}]),type:"clear",size:n.clearSize,color:"#c0c4cc",onClick:m.onClear},null,8,["class","size","onClick"])):g("",!0)],64)),f(e.$slots,"right",{},void 0,!0)])),_:3},8,["class","style"])])),_:3},8,["class","style"])}],["__scopeId","data-v-cc151d44"]]);const Qe=Se({name:"uniFormsItem",props:{custom:{type:Boolean,default:!1},showMessage:{type:Boolean,default:!0},name:String,required:Boolean,validateTrigger:{type:String,default:""},leftIcon:String,iconColor:{type:String,default:"#606266"},label:String,labelWidth:{type:[Number,String],default:""},labelAlign:{type:String,default:""},labelPosition:{type:String,default:""},errorMessage:{type:[String,Boolean],default:""},rules:{type:Array,default:()=>[]}},data:()=>({errorTop:!1,errorBottom:!1,labelMarginBottom:"",errorWidth:"",errMsg:"",val:"",labelPos:"",labelWid:"",labelAli:"",showMsg:"undertext",border:!1,isFirstBorder:!1,isArray:!1,arrayField:""}),computed:{msg(){return this.errorMessage||this.errMsg},fieldStyle(){let e={};return"top"==this.labelPos&&(e.padding="0 0",this.labelMarginBottom="6px"),"left"==this.labelPos&&!1!==this.msg&&""!=this.msg?(e.paddingBottom="0px",this.errorBottom=!0,this.errorTop=!1):"top"==this.labelPos&&!1!==this.msg&&""!=this.msg?(this.errorBottom=!1,this.errorTop=!0):(this.errorTop=!1,this.errorBottom=!1),e},justifyContent(){return"left"===this.labelAli?"flex-start":"center"===this.labelAli?"center":"right"===this.labelAli?"flex-end":void 0},labelLeft(){return("left"===this.labelPos?parseInt(this.labelWid):0)+"rpx"}},watch:{validateTrigger(e){this.formTrigger=e}},created(){this.form=this.getForm(),this.group=this.getForm("uniGroup"),this.formRules=[],this.formTrigger=this.validateTrigger,this.name&&-1!==this.name.indexOf("[")&&-1!==this.name.indexOf("]")&&(this.isArray=!0,this.arrayField=this.name,this.form.formData[this.name]=this.form._getValue(this.name,""))},mounted(){this.form&&this.form.childrens.push(this),this.init()},unmounted(){this.__isUnmounted=!0,this.unInit()},methods:{init(){if(this.form){let{formRules:e,validator:t,formData:a,value:i,labelPosition:s,labelWidth:o,labelAlign:n,errShowType:l}=this.form;this.labelPos=this.labelPosition?this.labelPosition:s,this.label?this.labelWid=this.labelWidth?this.labelWidth:o||140:this.labelWid=this.labelWidth?this.labelWidth:o||"auto",this.labelWid&&"auto"!==this.labelWid&&(this.labelWid+="rpx"),this.labelAli=this.labelAlign?this.labelAlign:n,this.form.isFirstBorder||(this.form.isFirstBorder=!0,this.isFirstBorder=!0),this.group&&(this.group.isFirstBorder||(this.group.isFirstBorder=!0,this.isFirstBorder=!0)),this.border=this.form.border,this.showMsg=l;let r=this.isArray?this.arrayField:this.name;if(!r)return;e&&this.rules.length>0&&(e[r]||(e[r]={rules:this.rules}),t.updateSchema(e)),this.formRules=e[r]||{},this.validator=t}else this.labelPos=this.labelPosition||"left",this.labelWid=this.labelWidth||130,this.labelAli=this.labelAlign||"left"},unInit(){this.form&&this.form.childrens.forEach(((e,t)=>{e===this&&(this.form.childrens.splice(t,1),delete this.form.formData[e.name])}))},getForm(e="uniForms"){let t=this.$parent,a=t.$options.name;for(;a!==e;){if(t=t.$parent,!t)return!1;a=t.$options.name}return t},clearValidate(){this.errMsg=""},setValue(e){let t=this.isArray?this.arrayField:this.name;if(t){if(this.errMsg&&(this.errMsg=""),this.form.formData[t]=this.form._getValue(t,e),!this.formRules||(this.formRules,"{}"===JSON.stringify(this.formRules)))return;this.triggerCheck(this.form._getValue(this.name,e))}},async triggerCheck(e,t){if(this.errMsg="",!this.validator||0===Object.keys(this.formRules).length)return;const a=this.isRequired(this.formRules.rules||[]);let i=this.isTrigger(this.formRules.validateTrigger,this.validateTrigger,this.form.validateTrigger),s=null;if(i||t){let t=this.isArray?this.arrayField:this.name;s=await this.validator.validateUpdate({[t]:e},this.form.formData)}a||void 0!==e&&""!==e||(s=null);const o=this.form.inputChildrens.find((e=>e.rename===this.name));return(i||t)&&s&&s.errorMessage?(o&&(o.errMsg=s.errorMessage),"toast"===this.form.errShowType&&G({title:s.errorMessage||"校验错误",icon:"none"}),"modal"===this.form.errShowType&&X({title:"提示",content:s.errorMessage||"校验错误"})):o&&(o.errMsg=""),this.errMsg=s?s.errorMessage:"",this.form.validateCheck(s||null),s||null},isTrigger:(e,t,a)=>!("submit"===e||!e)||void 0===e&&("bind"===t||!t&&"bind"===a),isRequired(e){let t=!1;for(let a=0;a<e.length;a++){if(e[a].required){t=!0;break}}return t}}},[["render",function(e,t,l,r,y,_){const w=n,v=c(d("uni-icons"),Pe),x=b;return a(),i(x,{class:""},{default:u((()=>[h(x,{class:o(["uni-forms-item",{"uni-forms-item--border":y.border,"is-first-border":y.border&&y.isFirstBorder,"uni-forms-item-error":_.msg}])},{default:u((()=>[h(x,{class:"uni-forms-item__box"},{default:u((()=>[h(x,{class:o(["uni-forms-item__inner",["is-direction-"+y.labelPos]])},{default:u((()=>[h(x,{class:"uni-forms-item__label",style:s({width:y.labelWid,justifyContent:_.justifyContent})},{default:u((()=>[f(e.$slots,"label",{},(()=>[l.required?(a(),i(w,{key:0,class:"is-required"},{default:u((()=>[m("*")])),_:1})):g("",!0),l.leftIcon?(a(),i(v,{key:1,class:"label-icon",size:"16",type:l.leftIcon,color:l.iconColor},null,8,["type","color"])):g("",!0),h(w,{class:"label-text"},{default:u((()=>[m(p(l.label),1)])),_:1}),l.label?(a(),i(x,{key:2,class:"label-seat"})):g("",!0)]),!0)])),_:3},8,["style"]),h(x,{class:o(["uni-forms-item__content",{"is-input-error-border":_.msg}])},{default:u((()=>[f(e.$slots,"default",{},void 0,!0)])),_:3},8,["class"])])),_:3},8,["class"]),_.msg?(a(),i(x,{key:0,class:o(["uni-error-message",{"uni-error-msg--boeder":y.border}]),style:s({paddingLeft:_.labelLeft})},{default:u((()=>[h(w,{class:"uni-error-message-text"},{default:u((()=>[m(p("undertext"===y.showMsg?_.msg:""),1)])),_:1})])),_:1},8,["class","style"])):g("",!0)])),_:3})])),_:3},8,["class"])])),_:3})}],["__scopeId","data-v-52b226c3"]]);var Ye={email:/^\S+?@\S+?\.\S+?$/,idcard:/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i")};const Ke={int:"integer",bool:"boolean",double:"number",long:"number",password:"string"};function Je(e,t=""){["label"].forEach((t=>{void 0===e[t]&&(e[t]="")}));let a=t;for(let i in e){let t=new RegExp("{"+i+"}");a=a.replace(t,e[i])}return a}const et={integer:e=>et.number(e)&&parseInt(e,10)===e,string:e=>"string"==typeof e,number:e=>!isNaN(e)&&"number"==typeof e,boolean:function(e){return"boolean"==typeof e},float:function(e){return et.number(e)&&!et.integer(e)},array:e=>Array.isArray(e),object:e=>"object"==typeof e&&!et.array(e),date:e=>e instanceof Date,timestamp(e){return!(!this.integer(e)||Math.abs(e).toString().length>16)},file:e=>"string"==typeof e.url,email:e=>"string"==typeof e&&!!e.match(Ye.email)&&e.length<255,url:e=>"string"==typeof e&&!!e.match(Ye.url),pattern(e,t){try{return new RegExp(e).test(t)}catch(a){return!1}},method:e=>"function"==typeof e,idcard:e=>"string"==typeof e&&!!e.match(Ye.idcard),"url-https"(e){return this.url(e)&&e.startsWith("https://")},"url-scheme":e=>e.startsWith("://"),"url-web":e=>!1};const at={required:(e,t,a)=>e.required&&function(e,t){return null==e||"string"==typeof e&&!e||!(!Array.isArray(e)||e.length)||"object"===t&&!Object.keys(e).length}(t,e.format||typeof t)?Je(e,e.errorMessage||a.required):null,range(e,t,a){const{range:i,errorMessage:s}=e;let o=new Array(i.length);for(let l=0;l<i.length;l++){const e=i[l];et.object(e)&&void 0!==e.value?o[l]=e.value:o[l]=e}let n=!1;return Array.isArray(t)?n=new Set(t.concat(o)).size===o.length:o.indexOf(t)>-1&&(n=!0),n?null:Je(e,s||a.enum)},rangeNumber(e,t,a){if(!et.number(t))return Je(e,e.errorMessage||a.pattern.mismatch);let{minimum:i,maximum:s,exclusiveMinimum:o,exclusiveMaximum:n}=e,l=o?t<=i:t<i,r=n?t>=s:t>s;return void 0!==i&&l?Je(e,e.errorMessage||a.number[o?"exclusiveMinimum":"minimum"]):void 0!==s&&r?Je(e,e.errorMessage||a.number[n?"exclusiveMaximum":"maximum"]):void 0!==i&&void 0!==s&&(l||r)?Je(e,e.errorMessage||a.number.range):null},rangeLength(e,t,a){if(!et.string(t)&&!et.array(t))return Je(e,e.errorMessage||a.pattern.mismatch);let i=e.minLength,s=e.maxLength,o=t.length;return void 0!==i&&o<i?Je(e,e.errorMessage||a.length.minLength):void 0!==s&&o>s?Je(e,e.errorMessage||a.length.maxLength):void 0!==i&&void 0!==s&&(o<i||o>s)?Je(e,e.errorMessage||a.length.range):null},pattern:(e,t,a)=>et.pattern(e.pattern,t)?null:Je(e,e.errorMessage||a.pattern.mismatch),format(e,t,a){var i=Object.keys(et),s=Ke[e.format]?Ke[e.format]:e.format||e.arrayType;return i.indexOf(s)>-1&&!et[s](t)?Je(e,e.errorMessage||a.typeError):null},arrayTypeFormat(e,t,a){if(!Array.isArray(t))return Je(e,e.errorMessage||a.typeError);for(let i=0;i<t.length;i++){const s=t[i];let o=this.format(e,s,a);if(null!==o)return o}return null}};class it extends class{constructor(e){this._message=e}async validateRule(e,t,a,i,s){var o=null;let n=t.rules;if(n.findIndex((e=>e.required))<0){if(null==a)return o;if("string"==typeof a&&!a.length)return o}var l=this._message;if(void 0===n)return l.default;for(var r=0;r<n.length;r++){let c=n[r],d=this._getValidateType(c);if(Object.assign(c,{label:t.label||`["${e}"]`}),at[d]&&null!=(o=at[d](c,a,l)))break;if(c.validateExpr){let e=Date.now();if(!1===c.validateExpr(a,s,e)){o=this._getMessage(c,c.errorMessage||this._message.default);break}}if(c.validateFunction&&null!==(o=await this.validateFunction(c,a,i,s,d)))break}return null!==o&&(o=l.TAG+o),o}async validateFunction(e,t,a,i,s){let o=null;try{let n=null;const l=await e.validateFunction(e,t,i||a,(e=>{n=e}));(n||"string"==typeof l&&l||!1===l)&&(o=this._getMessage(e,n||l,s))}catch(n){o=this._getMessage(e,n.message,s)}return o}_getMessage(e,t,a){return Je(e,t||e.errorMessage||this._message[a]||t.default)}_getValidateType(e){var t="";return e.required?t="required":e.format?t="format":e.arrayType?t="arrayTypeFormat":e.range?t="range":void 0!==e.maximum||void 0!==e.minimum?t="rangeNumber":void 0!==e.maxLength||void 0!==e.minLength?t="rangeLength":e.pattern?t="pattern":e.validateFunction&&(t="validateFunction"),t}}{constructor(e,t){super(it.message),this._schema=e,this._options=t||null}updateSchema(e){this._schema=e}async validate(e,t){let a=this._checkFieldInSchema(e);return a||(a=await this.invokeValidate(e,!1,t)),a.length?a[0]:null}async validateAll(e,t){let a=this._checkFieldInSchema(e);return a||(a=await this.invokeValidate(e,!0,t)),a}async validateUpdate(e,t){let a=this._checkFieldInSchema(e);return a||(a=await this.invokeValidateUpdate(e,!1,t)),a.length?a[0]:null}async invokeValidate(e,t,a){let i=[],s=this._schema;for(let o in s){let n=s[o],l=await this.validateRule(o,n,e[o],e,a);if(null!=l&&(i.push({key:o,errorMessage:l}),!t))break}return i}async invokeValidateUpdate(e,t,a){let i=[];for(let s in e){let o=await this.validateRule(s,this._schema[s],e[s],e,a);if(null!=o&&(i.push({key:s,errorMessage:o}),!t))break}return i}_checkFieldInSchema(e){var t=Object.keys(e),a=Object.keys(this._schema);if(new Set(t.concat(a)).size===a.length)return"";var i=t.filter((e=>a.indexOf(e)<0));return[{key:"invalid",errorMessage:Je({field:JSON.stringify(i)},it.message.TAG+it.message.defaultInvalid)}]}}it.message=new function(){return{TAG:"",default:"验证错误",defaultInvalid:"提交的字段{field}在数据库中并不存在",validateFunction:"验证无效",required:"{label}必填",enum:"{label}超出范围",timestamp:"{label}格式无效",whitespace:"{label}不能为空",typeError:"{label}类型无效",date:{format:"{label}日期{value}格式无效",parse:"{label}日期无法解析,{value}无效",invalid:"{label}日期{value}无效"},length:{minLength:"{label}长度不能少于{minLength}",maxLength:"{label}长度不能超过{maxLength}",range:"{label}必须介于{minLength}和{maxLength}之间"},number:{minimum:"{label}不能小于{minimum}",maximum:"{label}不能大于{maximum}",exclusiveMinimum:"{label}不能小于等于{minimum}",exclusiveMaximum:"{label}不能大于等于{maximum}",range:"{label}必须介于{minimum}and{maximum}之间"},pattern:{mismatch:"{label}格式不匹配"}}};const st=Se({name:"uniForms",components:{},emits:["input","reset","validate","submit"],props:{value:{type:Object,default:()=>({})},modelValue:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},validateTrigger:{type:String,default:""},labelPosition:{type:String,default:"left"},labelWidth:{type:[String,Number],default:""},labelAlign:{type:String,default:"left"},errShowType:{type:String,default:"undertext"},border:{type:Boolean,default:!1}},data:()=>({formData:{}}),computed:{dataValue(){return"{}"===JSON.stringify(this.modelValue)?this.value:this.modelValue}},watch:{rules(e){this.init(e)},labelPosition(){this.childrens.forEach((e=>{e.init()}))}},created(){Z().$vm.$.appContext.config.globalProperties.binddata||(Z().$vm.$.appContext.config.globalProperties.binddata=function(e,t,a){if(a)this.$refs[a].setValue(e,t);else{let a;for(let e in this.$refs){const t=this.$refs[e];if(t&&t.$options&&"uniForms"===t.$options.name){a=t;break}}if(!a)return console.error("当前 uni-froms 组件缺少 ref 属性");a.setValue(e,t)}}),this.unwatchs=[],this.childrens=[],this.inputChildrens=[],this.checkboxChildrens=[],this.formRules=[],this.init(this.rules)},methods:{init(e){0!==Object.keys(e).length?(this.formRules=e,this.validator=new it(e),this.registerWatch()):this.formData=this.dataValue},registerWatch(){this.unwatchs.forEach((e=>e())),this.childrens.forEach((e=>{e.init()})),Object.keys(this.dataValue).forEach((e=>{let t=this.$watch("dataValue."+e,(t=>{if(t)if("[object Object]"===t.toString())for(let a in t){let i=`${e}[${a}]`;this.formData[i]=this._getValue(i,t[a])}else this.formData[e]=this._getValue(e,t)}),{deep:!0,immediate:!0});this.unwatchs.push(t)}))},setRules(e){this.init(e)},setValue(e,t,a){let i=this.childrens.find((t=>t.name===e));return i?(t=this._getValue(i.name,t),this.formData[e]=t,i.val=t,i.triggerCheck(t,a)):null},resetForm(e){this.childrens.forEach((e=>{e.errMsg="";const t=this.inputChildrens.find((t=>t.rename===e.name));t&&(t.errMsg="",t.is_reset=!0,t.$emit("input",t.multiple?[]:""),t.$emit("update:modelValue",t.multiple?[]:""))})),this.childrens.forEach((e=>{e.name&&(this.formData[e.name]=this._getValue(e.name,""))})),this.$emit("reset",e)},validateCheck(e){null===e&&(e=null),this.$emit("validate",e)},async validateAll(e,t,a,i){let s,o=[];for(let r in e){const e=this.childrens.find((e=>e.name===r));e&&o.push(e)}i||"function"!=typeof a||(i=a),!i&&"function"!=typeof i&&Promise&&(s=new Promise(((e,t)=>{i=function(a,i){a?t(a):e(i)}})));let n=[],l={};if(this.validator)for(let r in o){const t=o[r];let a=t.isArray?t.arrayField:t.name;if(t.isArray){if(-1!==t.name.indexOf("[")&&-1!==t.name.indexOf("]")){const i=t.name.split("["),s=i[0],o=i[1].replace("]","");l[s]||(l[s]={}),l[s][o]=this._getValue(a,e[a])}}else l[a]=this._getValue(a,e[a]);const i=await t.triggerCheck(e[a],!0);if(i&&(n.push(i),"toast"===this.errShowType||"modal"===this.errShowType))break}else l=e;return Array.isArray(n)&&0===n.length&&(n=null),Array.isArray(a)&&a.forEach((e=>{l[e]=this.dataValue[e]})),"submit"===t?this.$emit("submit",{detail:{value:l,errors:n}}):this.$emit("validate",n),i&&"function"==typeof i&&i(n,l),s&&i?s:null},submitForm(){},submit(e,t,a){for(let i in this.dataValue){this.childrens.find((e=>e.name===i))&&void 0===this.formData[i]&&(this.formData[i]=this._getValue(i,this.dataValue[i]))}return a||console.warn("submit 方法即将废弃,请使用validate方法代替!"),this.validateAll(this.formData,"submit",e,t)},validate(e,t){return this.submit(e,t,!0)},validateField(e,t){e=[].concat(e);let a={};return this.childrens.forEach((t=>{-1!==e.indexOf(t.name)&&(a=Object.assign({},a,{[t.name]:this.formData[t.name]}))})),this.validateAll(a,"submit",[],t)},resetFields(){this.resetForm()},clearValidate(e){e=[].concat(e),this.childrens.forEach((t=>{const a=this.inputChildrens.find((e=>e.rename===t.name));(0===e.length||-1!==e.indexOf(t.name))&&(t.errMsg="",a&&(a.errMsg=""))}))},_getValue(e,t){const a=this.formRules[e]&&this.formRules[e].rules||[],i=a.find((e=>e.format&&this.type_filter(e.format))),s=a.find((e=>e.format&&"boolean"===e.format||"bool"===e.format));return i&&(t=isNaN(t)?t:""===t||null===t?null:Number(t)),s&&(t=!!t),t},type_filter:e=>"int"===e||"double"===e||"number"===e||"timestamp"===e}},[["render",function(e,t,s,n,l,r){const c=Q,d=b;return a(),i(d,{class:o(["uni-forms",{"uni-forms--top":!s.border}])},{default:u((()=>[h(c,{onSubmit:k(r.submitForm,["stop"]),onReset:r.resetForm},{default:u((()=>[f(e.$slots,"default",{},void 0,!0)])),_:3},8,["onSubmit","onReset"])])),_:3},8,["class"])}],["__scopeId","data-v-5ab2d274"]]),ot={rules:[{required:!0,errorMessage:"请输入手机号"},{validateFunction:function(e,t,a,i){return Y.mobile(t)||i("手机号码格式不正确"),!0}}]},nt={rules:[{required:!0,errorMessage:"请输入密码"},{validateFunction:function(e,t,a,i){return/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+\S{5,12}$/.test(t)||i("需包含字母和数字,长度在6-12之间"),!0}}]},lt={rules:[{required:!0,errorMessage:"请输入验证码"}]},rt=Se({__name:"account-login",props:{agreeStatus:{type:Boolean,default:!1}},emits:["onConfirm"],setup(e,{emit:t}){const s=e,o=K(null),n=_({model:{mobile:"",password:""},rules:{mobile:ot,password:nt}});async function l(){if(!(await S(o).validate().catch((e=>{console.log("error: ",e)}))))return;if(!s.agreeStatus)return t("onConfirm",!0),void C.$helper.toast("请勾选同意");const{code:e,data:a}=await ee.login(n.model);0===e&&te()}return(e,t)=>{const s=b,r=P,f=c(d("uni-easyinput"),Ze),p=c(d("uni-forms-item"),Qe),g=c(d("uni-forms"),st);return a(),i(s,null,{default:u((()=>[h(s,{class:"head-box ss-m-b-60 ss-flex-col"},{default:u((()=>[h(s,{class:"ss-flex ss-m-b-20"},{default:u((()=>[h(s,{class:"head-title-active head-title-line",onClick:t[0]||(t[0]=e=>S(J)("smsLogin"))},{default:u((()=>[m(" 短信登录 ")])),_:1}),h(s,{class:"head-title ss-m-r-40 head-title-animation"},{default:u((()=>[m("账号登录")])),_:1})])),_:1}),h(s,{class:"head-subtitle"},{default:u((()=>[m("如果未设置过密码,请点击忘记密码")])),_:1})])),_:1}),h(g,{ref_key:"accountLoginRef",ref:o,modelValue:n.model,"onUpdate:modelValue":t[4]||(t[4]=e=>n.model=e),rules:n.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:u((()=>[h(p,{name:"mobile",label:"账号"},{default:u((()=>[h(f,{placeholder:"请输入账号",modelValue:n.model.mobile,"onUpdate:modelValue":t[2]||(t[2]=e=>n.model.mobile=e),inputBorder:!1},{right:u((()=>[h(r,{class:"ss-reset-button forgot-btn",onClick:t[1]||(t[1]=e=>S(J)("resetPassword"))},{default:u((()=>[m(" 忘记密码 ")])),_:1})])),_:1},8,["modelValue"])])),_:1}),h(p,{name:"password",label:"密码"},{default:u((()=>[h(f,{type:"password",placeholder:"请输入密码",modelValue:n.model.password,"onUpdate:modelValue":t[3]||(t[3]=e=>n.model.password=e),inputBorder:!1},{right:u((()=>[h(r,{class:"ss-reset-button login-btn-start",onClick:l},{default:u((()=>[m("登录")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"])])),_:1})}}},[["__scopeId","data-v-357bfd2c"]]),ct=Se({__name:"sms-login",props:{agreeStatus:{type:Boolean,default:!1}},emits:["onConfirm"],setup(e,{emit:t}){const s=e,n=K(null),l=_({isMobileEnd:!1,codeText:"获取验证码",model:{mobile:"",code:""},rules:{code:lt,mobile:ot}});async function r(){if(!(await S(n).validate().catch((e=>{console.log("error: ",e)}))))return;if(!s.agreeStatus)return t("onConfirm",!0),void C.$helper.toast("请勾选同意");const{code:e}=await ee.smsLogin(l.model);0===e&&te()}return(e,t)=>{const s=b,f=P,g=c(d("uni-easyinput"),Ze),y=c(d("uni-forms-item"),Qe),_=c(d("uni-forms"),st);return a(),i(s,null,{default:u((()=>[h(s,{class:"head-box ss-m-b-60"},{default:u((()=>[h(s,{class:"ss-flex ss-m-b-20"},{default:u((()=>[h(s,{class:"head-title head-title-line head-title-animation"},{default:u((()=>[m("短信登录")])),_:1}),h(s,{class:"head-title-active ss-m-r-40",onClick:t[0]||(t[0]=e=>S(J)("accountLogin"))},{default:u((()=>[m(" 账号登录 ")])),_:1})])),_:1}),h(s,{class:"head-subtitle"},{default:u((()=>[m("未注册的手机号,验证后自动注册账号")])),_:1})])),_:1}),h(_,{ref_key:"smsLoginRef",ref:n,modelValue:l.model,"onUpdate:modelValue":t[4]||(t[4]=e=>l.model=e),rules:l.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:u((()=>[h(y,{name:"mobile",label:"手机号"},{default:u((()=>[h(g,{placeholder:"请输入手机号",modelValue:l.model.mobile,"onUpdate:modelValue":t[2]||(t[2]=e=>l.model.mobile=e),inputBorder:!1,type:"number"},{right:u((()=>[h(f,{class:o(["ss-reset-button code-btn code-btn-start",{"code-btn-end":l.isMobileEnd}]),disabled:l.isMobileEnd,onClick:t[1]||(t[1]=e=>S(ae)("smsLogin",l.model.mobile))},{default:u((()=>[m(p(S(ie)("smsLogin")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),h(y,{name:"code",label:"验证码"},{default:u((()=>[h(g,{placeholder:"请输入验证码",modelValue:l.model.code,"onUpdate:modelValue":t[3]||(t[3]=e=>l.model.code=e),inputBorder:!1,type:"number",maxlength:"4"},{right:u((()=>[h(f,{class:"ss-reset-button login-btn-start",onClick:r},{default:u((()=>[m(" 登录 ")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"])])),_:1})}}},[["__scopeId","data-v-ba782287"]]),dt=Se({__name:"reset-password",setup(e){const t=K(null),s=A((()=>C.$store("user").isLogin)),n=_({isMobileEnd:!1,model:{mobile:"",code:"",password:""},rules:{code:lt,mobile:ot,password:nt}}),l=async()=>{if(!(await S(t).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await se.resetUserPassword(n.model);0===e&&J("accountLogin")};return(e,r)=>{const f=b,y=P,_=c(d("uni-easyinput"),Ze),w=c(d("uni-forms-item"),Qe),v=c(d("uni-forms"),st);return a(),i(f,null,{default:u((()=>[h(f,{class:"head-box ss-m-b-60"},{default:u((()=>[h(f,{class:"head-title ss-m-b-20"},{default:u((()=>[m("重置密码")])),_:1}),h(f,{class:"head-subtitle"},{default:u((()=>[m("为了您的账号安全,设置密码前请先进行安全验证")])),_:1})])),_:1}),h(v,{ref_key:"resetPasswordRef",ref:t,modelValue:n.model,"onUpdate:modelValue":r[4]||(r[4]=e=>n.model=e),rules:n.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:u((()=>[h(w,{name:"mobile",label:"手机号"},{default:u((()=>[h(_,{placeholder:"请输入手机号",modelValue:n.model.mobile,"onUpdate:modelValue":r[1]||(r[1]=e=>n.model.mobile=e),type:"number",inputBorder:!1},{right:u((()=>[h(y,{class:o(["ss-reset-button code-btn code-btn-start",{"code-btn-end":n.isMobileEnd}]),disabled:n.isMobileEnd,onClick:r[0]||(r[0]=e=>S(ae)("resetPassword",n.model.mobile))},{default:u((()=>[m(p(S(ie)("resetPassword")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),h(w,{name:"code",label:"验证码"},{default:u((()=>[h(_,{placeholder:"请输入验证码",modelValue:n.model.code,"onUpdate:modelValue":r[2]||(r[2]=e=>n.model.code=e),type:"number",maxlength:"4",inputBorder:!1},null,8,["modelValue"])])),_:1}),h(w,{name:"password",label:"密码"},{default:u((()=>[h(_,{type:"password",placeholder:"请输入密码",modelValue:n.model.password,"onUpdate:modelValue":r[3]||(r[3]=e=>n.model.password=e),inputBorder:!1},{right:u((()=>[h(y,{class:"ss-reset-button login-btn-start",onClick:l},{default:u((()=>[m(" 确认 ")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),S(s)?g("",!0):(a(),i(y,{key:0,class:"ss-reset-button type-btn",onClick:r[5]||(r[5]=e=>S(J)("accountLogin"))},{default:u((()=>[m(" 返回登录 ")])),_:1}))])),_:1})}}},[["__scopeId","data-v-35234133"]]),ut=Se({__name:"change-mobile",setup(e){const t=K(null),s=A((()=>C.$store("user").userInfo)),n=_({isMobileEnd:!1,model:{mobile:"",code:""},rules:{code:lt,mobile:ot}});async function l(){if(!(await S(t).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await se.updateUserMobile(n.model);0===e&&(C.$store("user").getInfo(),te())}async function r(e){if("getPhoneNumber:ok"!==e.detail.errMsg)return;await C.$platform.useProvider().bindUserPhoneNumber(e.detail)&&(C.$store("user").getInfo(),te())}return(e,f)=>{const y=b,_=P,w=c(d("uni-easyinput"),Ze),v=c(d("uni-forms-item"),Qe),x=c(d("uni-forms"),st);return a(),i(y,null,{default:u((()=>[h(y,{class:"head-box ss-m-b-60"},{default:u((()=>[h(y,{class:"head-title ss-m-b-20"},{default:u((()=>[m(p(S(s).mobile?"更换手机号":"绑定手机号"),1)])),_:1}),h(y,{class:"head-subtitle"},{default:u((()=>[m("为了您的账号安全,请使用本人手机号码")])),_:1})])),_:1}),h(x,{ref_key:"changeMobileRef",ref:t,modelValue:n.model,"onUpdate:modelValue":f[3]||(f[3]=e=>n.model=e),rules:n.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:u((()=>[h(v,{name:"mobile",label:"手机号"},{default:u((()=>[h(w,{placeholder:"请输入手机号",modelValue:n.model.mobile,"onUpdate:modelValue":f[1]||(f[1]=e=>n.model.mobile=e),inputBorder:!1,type:"number"},{right:u((()=>[h(_,{class:o(["ss-reset-button code-btn-start",{"code-btn-end":n.isMobileEnd}]),disabled:n.isMobileEnd,onClick:f[0]||(f[0]=e=>S(ae)("changeMobile",n.model.mobile))},{default:u((()=>[m(p(S(ie)("changeMobile")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),h(v,{name:"code",label:"验证码"},{default:u((()=>[h(w,{placeholder:"请输入验证码",modelValue:n.model.code,"onUpdate:modelValue":f[2]||(f[2]=e=>n.model.code=e),inputBorder:!1,type:"number",maxlength:"4"},{right:u((()=>[h(_,{class:"ss-reset-button login-btn-start",onClick:l},{default:u((()=>[m(" 确认 ")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),"WechatMiniProgram"===S(C).$platform.name?(a(),i(_,{key:0,class:"ss-reset-button type-btn","open-type":"getPhoneNumber",onGetphonenumber:r},{default:u((()=>[m(" 使用微信手机号 ")])),_:1})):g("",!0)])),_:1})}}},[["__scopeId","data-v-0241a05b"]]),ht=Se({__name:"change-password",setup(e){const t=K(null),s=_({model:{mobile:"",code:"",password:""},rules:{code:lt,password:nt}});async function n(){if(!(await S(t).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await se.updateUserPassword(s.model);0===e&&te()}return(e,l)=>{const r=b,f=P,g=c(d("uni-easyinput"),Ze),y=c(d("uni-forms-item"),Qe),_=c(d("uni-forms"),st);return a(),i(r,null,{default:u((()=>[h(r,{class:"head-box ss-m-b-60"},{default:u((()=>[h(r,{class:"head-title ss-m-b-20"},{default:u((()=>[m("修改密码")])),_:1}),h(r,{class:"head-subtitle"},{default:u((()=>[m("如密码丢失或未设置,请点击忘记密码重新设置")])),_:1})])),_:1}),h(_,{ref_key:"changePasswordRef",ref:t,modelValue:s.model,"onUpdate:modelValue":l[3]||(l[3]=e=>s.model=e),rules:s.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:u((()=>[h(y,{name:"code",label:"验证码"},{default:u((()=>[h(g,{placeholder:"请输入验证码",modelValue:s.model.code,"onUpdate:modelValue":l[1]||(l[1]=e=>s.model.code=e),type:"number",maxlength:"4",inputBorder:!1},{right:u((()=>[h(f,{class:o(["ss-reset-button code-btn code-btn-start",{"code-btn-end":s.isMobileEnd}]),disabled:s.isMobileEnd,onClick:l[0]||(l[0]=e=>S(ae)("changePassword"))},{default:u((()=>[m(p(S(ie)("resetPassword")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),h(y,{name:"reNewPassword",label:"密码"},{default:u((()=>[h(g,{type:"password",placeholder:"请输入密码",modelValue:s.model.password,"onUpdate:modelValue":l[2]||(l[2]=e=>s.model.password=e),inputBorder:!1},{right:u((()=>[h(f,{class:"ss-reset-button login-btn-start",onClick:n},{default:u((()=>[m(" 确认 ")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),h(f,{class:"ss-reset-button type-btn",onClick:S(te)},{default:u((()=>[m(" 取消修改 ")])),_:1},8,["onClick"])])),_:1})}}},[["__scopeId","data-v-3f07c832"]]),ft={uploadFile:e=>(oe("token"),ne({title:"上传中"}),new Promise(((t,a)=>{le({url:re+ce+"/infra/file/upload",filePath:e,name:"file",header:{Accept:"*/*","tenant-id":"1"},success:e=>{let a=JSON.parse(e.data);if(1!==a.error)return t(a);G({icon:"none",title:a.msg})},fail:e=>(console.log("上传失败:",e),t(!1)),complete:()=>{de()}})})))},mt=Se({__name:"mp-authorization",props:{agreeStatus:{type:Boolean,default:!1}},setup(e){const t=A((()=>C.$store("user").userInfo)),s=K(null),o=_({model:{nickname:t.value.nickname,avatar:t.value.avatar},rules:{},disabledStyle:{color:"#999",disableColor:"#fff"}});function l(e){!async function(e){if(!e)return;let{data:t}=await ft.uploadFile(e);o.model.avatar=t}(e.detail.avatarUrl||"")}async function r(){const{model:e}=o,{nickname:t,avatar:a}=e;if(!t)return void C.$helper.toast("请输入昵称");if(!a)return void C.$helper.toast("请选择头像");const{code:i}=await se.updateUser({avatar:o.model.avatar,nickname:o.model.nickname});0===i&&(C.$helper.toast("授权成功"),await C.$store("user").getInfo(),te())}return(e,t)=>{const f=b,p=N,g=n,y=P,_=c(d("uni-forms-item"),Qe),w=c(d("uni-easyinput"),Ze),v=c(d("uni-forms"),st);return a(),i(f,null,{default:u((()=>[h(f,{class:"head-box ss-m-b-60 ss-flex-col"},{default:u((()=>[h(f,{class:"ss-flex ss-m-b-20"},{default:u((()=>[h(f,{class:"head-title ss-m-r-40 head-title-animation"},{default:u((()=>[m("授权信息")])),_:1})])),_:1}),h(f,{class:"head-subtitle"},{default:u((()=>[m("完善您的头像、昵称、手机号")])),_:1})])),_:1}),h(v,{ref_key:"accountLoginRef",ref:s,modelValue:o.model,"onUpdate:modelValue":t[2]||(t[2]=e=>o.model=e),rules:o.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center"},{default:u((()=>[h(_,{name:"avatar",label:"头像"},{default:u((()=>[h(y,{class:"ss-reset-button avatar-btn","open-type":"chooseAvatar",onChooseavatar:l},{default:u((()=>[h(p,{class:"avatar-img",src:S(C).$url.cdn(o.model.avatar),mode:"aspectFill",onClick:t[0]||(t[0]=e=>S(C).$router.go("/pages/user/info"))},null,8,["src"]),h(g,{class:"cicon-forward"})])),_:1})])),_:1}),h(_,{name:"nickname",label:"昵称"},{default:u((()=>[h(w,{type:"nickname",placeholder:"请输入昵称",modelValue:o.model.nickname,"onUpdate:modelValue":t[1]||(t[1]=e=>o.model.nickname=e),inputBorder:!1},null,8,["modelValue"])])),_:1}),h(f,{class:"foot-box"},{default:u((()=>[h(y,{class:"ss-reset-button authorization-btn",onClick:r},{default:u((()=>[m(" 确认授权 ")])),_:1})])),_:1})])),_:1},8,["modelValue","rules"])])),_:1})}}},[["__scopeId","data-v-b00d5530"]]),pt=Se({__name:"s-auth-modal",setup(e){A((()=>C.$store("app").info));const t=C.$store("modal"),s=A((()=>t.auth)),n=_({protocol:!1}),l=K(!1);function r(){n.protocol=!n.protocol}function f(e){te(),C.$router.go("/pages/public/richtext",{title:e})}function p(e){l.value=e,setTimeout((()=>{l.value=!1}),1e3)}const y=async e=>{if(!n.protocol)return l.value=!0,setTimeout((()=>{l.value=!1}),1e3),void C.$helper.toast("请勾选同意");await C.$platform.useProvider(e).login()&&te()},w=async e=>{if("getPhoneNumber:ok"!==e.detail.errMsg)return void C.$helper.toast("快捷登录失败");await C.$platform.useProvider().mobileLogin(e.detail)&&te()};return(e,t)=>{const _=b,v=P,x=N,I=ue,$=he,T=c(d("su-popup"),Ee);return a(),i(T,{show:""!==S(s),round:"10",showClose:!0,onClose:S(te)},{default:u((()=>[h(_,{class:"login-wrap"},{default:u((()=>["accountLogin"===S(s)?(a(),i(rt,{key:0,agreeStatus:n.protocol,onOnConfirm:p},null,8,["agreeStatus"])):g("",!0),"smsLogin"===S(s)?(a(),i(ct,{key:1,agreeStatus:n.protocol,onOnConfirm:p},null,8,["agreeStatus"])):g("",!0),"resetPassword"===S(s)?(a(),i(dt,{key:2})):g("",!0),"changeMobile"===S(s)?(a(),i(ut,{key:3})):g("",!0),"changePassword"===S(s)?(a(),i(ht,{key:4})):g("",!0),"mpAuthorization"===S(s)?(a(),i(mt,{key:5})):g("",!0),["accountLogin","smsLogin"].includes(S(s))?(a(),i(_,{key:6,class:"auto-login-box ss-flex ss-flex-col ss-row-center ss-col-center"},{default:u((()=>["WechatMiniProgram"===S(C).$platform.name?(a(),i(_,{key:0,class:"ss-flex register-box"},{default:u((()=>[h(_,{class:"register-title"},{default:u((()=>[m("还没有账号?")])),_:1}),h(v,{class:"ss-reset-button login-btn","open-type":"getPhoneNumber",onGetphonenumber:w},{default:u((()=>[m(" 快捷登录 ")])),_:1}),h(_,{class:"circle"})])),_:1})):g("",!0),["WechatOfficialAccount","WechatMiniProgram","App"].includes(S(C).$platform.name)&&S(C).$platform.isWechatInstalled?(a(),i(v,{key:1,onClick:t[0]||(t[0]=e=>y("wechat")),class:"ss-reset-button auto-login-btn"},{default:u((()=>[h(x,{class:"auto-login-img",src:S(C).$url.static("/static/img/shop/platform/wechat.png")},null,8,["src"])])),_:1})):g("",!0),"ios"===S(C).$platform.os&&"App"===S(C).$platform.name?(a(),i(v,{key:2,onClick:t[1]||(t[1]=e=>y("apple")),class:"ss-reset-button auto-login-btn"},{default:u((()=>[h(x,{class:"auto-login-img",src:S(C).$url.static("/static/img/shop/platform/apple.png")},null,8,["src"])])),_:1})):g("",!0)])),_:1})):g("",!0),["accountLogin","smsLogin"].includes(S(s))?(a(),i(_,{key:7,class:o(["agreement-box ss-flex ss-row-center",{shake:l.value}])},{default:u((()=>[h($,{class:"radio ss-flex ss-col-center",onClick:r},{default:u((()=>[h(I,{checked:n.protocol,color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:k(r,["stop"])},null,8,["checked","onClick"]),h(_,{class:"agreement-text ss-flex ss-col-center ss-m-l-8"},{default:u((()=>[m(" 我已阅读并遵守 "),h(_,{class:"tcp-text",onClick:t[2]||(t[2]=k((e=>f("用户协议")),["stop"]))},{default:u((()=>[m(" 《用户协议》 ")])),_:1}),h(_,{class:"agreement-text"},{default:u((()=>[m("与")])),_:1}),h(_,{class:"tcp-text",onClick:t[3]||(t[3]=k((e=>f("隐私协议")),["stop"]))},{default:u((()=>[m(" 《隐私协议》 ")])),_:1})])),_:1})])),_:1})])),_:1},8,["class"])):g("",!0),h(_,{class:"safe-box"})])),_:1})])),_:1},8,["show","onClose"])}}},[["__scopeId","data-v-42047309"]]);var gt,bt={};gt={get exports(){return bt},set exports(e){bt=e}},function(){var a;const i=b(typeof uni)?"uni":b(typeof window)&&b(typeof document)?"web":"node",s="uni"==i,o="node"==i,n="web"==i,l={},r={},c=Object.freeze(["init","initAsyncDrawMode","initArgs","initCanvas","handleCtx","initData","draw","toImage","updateCanvasWH","clear","restoreAsyncDrawMode"]),d=Object.freeze(["setPaintbrush","setPaintbrushProp","resetPaintbrush","savePaintbrush","restorePaintbrush","calcText","calcImg","measureText","loadImage"]),u=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"]),m=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 p,g=1;function b(e){return"undefined"!=String(e)}function y(e){return!((e||0==e)&&!["undefined","null"].includes(String(e)))}const _=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++,r[this._id]=t,e&&this.init(e)}init(t={}){this.initArgs(t).initData().initCanvas().handleCtx().resetPaintbrush(),!0===this._data.asyncDrawMode&&(((t,a,i,s)=>{e(t,a,"write to private field"),s?s.call(t,i):a.set(t,i)})(this,a,new _({asyncDrawMode:!1})),this.initAsyncDrawMode())}initAsyncDrawMode(){if(s)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(!s)if(c.includes(e))console.log("白名单跳过");else if("function"==typeof this[e]){this._data.nMethods[e]||(this._data.nMethods[e]=this[e]);let i=this;this[e]=function(){let s;return d.includes(e)&&(s=t(i,a)[e](...arguments)),s&&s!==i&&s!==t(i,a)?s:((u.includes(e)||i._data.ctxMethods.includes(e))&&i._data.asyncDrawQueue.push({method:e,args:arguments}),f.includes(e)?t(i,a)[e](...arguments):void 0)}}}restoreAsyncDrawMode(){if(s)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(s&&!t.canvasId)throw new Error("canvasId 不能为空");let a,o={};switch(i){case"uni":a=ge(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=p.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}(r[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<m.length;a++){const i=m[a];"function"==typeof e[i]&&(this[i]||t(i))}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&&!n)&&!1!==this._args.asyncDrawMode,ctxMethods:[]},this}setPaintbrush(e={}){!function(e){switch(null==e?void 0:e.textBaseline){case"normal":s&&(e.textBaseline="alphabetic");break;case"hanging":s&&(e.textBaseline="top");break;case"ideographic":s&&(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 i={...this._data.font,...t};s&&(i.fontSize=Math.round(i.fontSize)),this._data.font=i;const o=this._data.font;this._data.oldPaintbrushProps[e]=o;const n=()=>{a.font=`${o.fontStyle||"normal"} ${o.fontVariant||"normal"} ${o.fontWeight||"normal"} ${o.fontSize??10}px ${o.fontFamily||"sans-serif"}`};n()}}else{this._data.oldPaintbrushProps[e]=t;const i="set"+e[0].toUpperCase()+e.slice(1);"function"==typeof(null==a?void 0:a[i])?a[i](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,i;let{width:o,height:n,delay:l}=e,r=null==(t=this._args)?void 0:t.setCanvasWH;return o=o||(null==(a=this._data)?void 0:a.width)||10,n=n||(null==(i=this._data)?void 0:i.height)||10,new Promise(((e,t)=>{if(s){if(!r||"function"!=typeof r)return void t("setCanvasWH异常, uni-app 请在初始化时传入setCanvasWH函数");r({height:n,width:o}),setTimeout((()=>{e()}),l??50)}else this.canvas.height=n,this.canvas.width=o,e()})).then((e=>{this._data.width==o&&this._data.height==n||(this._data.whChange=!0),this._data.width=o,this._data.height=n,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(s){let a=!1;const i=setTimeout((()=>{a?clearTimeout(i):e()}),3e3);this.ctx.draw(t??!1,(()=>{a=!0,clearTimeout(i),e()}))}else if(this._data.asyncDrawMode){!0!==t&&this.clear(),this.restoreAsyncDrawMode(),this.resetPaintbrush();const i=this._data.asyncDrawQueue;new Promise((async(e,t)=>{for(let s=0;s<i.length;s++){const e=i[s];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(s){const i=this._args.canvasId;if(!i)return void a("canvasId不存在");fe({...e,canvasId:i,success:a=>{var i;null==(i=e.success)||i.call(e,a),t(a.tempFilePath)},fail:t=>{var i;null==(i=e.fail)||i.call(e,t),a(t)}},r[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,i)=>{try{let i=function(t,a){let i=0;const o=s(t).width;if(a){if(o<e.maxWidth||t.length<2)return{index:t.length,ellipsis:!1,width:o};i=s("...").width}const n=o+i;if(n<e.maxWidth||t.length<2)return{index:t.length,ellipsis:!1,width:n};let l,r=!0,c=Math.floor((t.length+1)/2),d=1,u="";for(;r;){if(c<=1){r=!1;break}if(c>t.length){c=t.length,r=!1;break}const a=t.substr(0,c);l=s(a).width+i,l>e.maxWidth?(t=a,"xy"==u&&Math.abs(d-c)<1?r=!1:(u="dy",d=c,c=Math.floor((a.length+1)/2))):l==e.maxWidth||c<=1||Math.abs(d-c)<1?r=!1:(u="xy",d=c,c+=Math.floor((t.length-c)/2))}return{index:c,ellipsis:a,width:l}};this.saveAndSetPaintbrush({...e.paintbrushProps||{}});const s=this.measureText;let o=[],n=e.val,l=0;const r={...this._data.font};if(e.maxWidth){let a=0;for(;n.length;){const s=t>0&&o.length+1>=t,{index:l,ellipsis:c,width:d}=i(n,s),u=n.substr(0,l);o.push({...e,val:u,y:a?e.y+(r.fontSize+(e.lineHeight||0))*a:e.y,width:d}),s?(c&&(o[o.length-1].val+="..."),n=""):n=n.slice(l),a++}l=1==o.length?o[0].width:o.length>1?e.maxWidth:0}else o=[e],l=s(e.val).width;this.restorePaintbrush(),a({...e,calcTexts:o,_calc:!0,left:e.x,top:e.y,right:e.x+l,bottom:o[o.length-1].y+r.fontSize,width:l,height:o[o.length-1].y+r.fontSize-e.y,fontSize:r.fontSize})}catch(s){i(s)}}))}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)},i=e=>{a(e),e.textDecoration&&this.drawTextDecoration(e)},s=e._calc?e:await this.calcText(e);for(let e=0;e<s.calcTexts.length;e++)i(s.calcTexts[e]);this.restorePaintbrush(),t(s)}catch(i){a(i)}}))}drawStraightLine(e={}){const{x1:t,y1:a,x2:i,y2:s,paintbrushProps:o}=e,n=this.ctx;n.beginPath(),n.moveTo(t,a),n.lineTo(i,s),this.saveAndSetPaintbrush(o||{}),n.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:i,y2:s,gap:o,width:n,paintbrushProps:l}=e;a-=n,o=o||1;const r=Math.sqrt(Math.pow(t-a,2)+Math.pow(i-s,2)),c=function(e,t,a,i,s,o){let n,l,r,c,d,u=[];if(e===a)n=e+(i-t)*o,l=t+(i-t)/2,r=(e-n)**2+(t-l)**2;else if(t===i)n=e+(a-e)/2,l=t-(a-e)*o,r=(e-n)**2+(t-l)**2;else{let s=(e+a)/2,u=(t+i)/2;c=(a-e)/(t-i);let h=u-c*s,f=1+c**2,m=2*c*(h-u)-2*s,p=s**2+(h-u)**2-((a-e)**2+(i-t)**2)*o**2;d=-1/c,n=(-m+Math.sqrt(m**2-4*f*p)*(d>0&&a>e||d<0&&a<e?1:-1))/(2*f),l=c*n+h,r=(e-n)**2+(t-l)**2}if(e===a||Math.abs(d)>1){let e=(i-t)/(s+1);for(let a=0;a<s;a++){let s=t+e*(a+1),o=Math.sqrt(r-(s-l)**2)*(i>t?-1:1)+n;u.push([o,s])}}else{let t=(a-e)/(s+1);for(let i=0;i<s;i++){let s=e+t*(i+1),o=Math.sqrt(r-(s-n)**2)*(a>e?1:-1)+l;u.push([s,o])}}return u}(t,i,a,s,Math.floor((r-o)/(n+o)),9999999999);this.saveAndSetPaintbrush(l),this.drawDotted({x:t,y:i,d:n});for(let d=0;d<c.length;d++)this.drawDotted({x:c[d][0],y:c[d][1],d:n});this.drawDotted({x:a,y:s,d:n}),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,i=e.textDecoration,s=i.line||"line-through",o=i.color||e.color||t.fillStyle||"#000000",n=i.thickness||i.width||!!e.fontSize&&.1*e.fontSize||1,l=i.style||"solide",r=i.offset||0,c=i.gap??1,d=e.fontSize||this._data.font.fontSize;this.setPaintbrush({lineWidth:n,strokeStyle:o});let u=0;switch(s){case"line-through":u=e.y+d/2-n/2;break;case"underline":u=e.y+d;break;case"overline":u=e.y}switch(t.textBaseline){case"top":u+=n/2;break;case"bottom":u-=d;break;case"center":u-=d/2}switch(u+=r,s){case"line-through":case"underline":case"overline":this.drawLine({x1:e.x,y1:u,x2:e.x+a,y2:u,style:l,gap:c,width:n,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(i){a(i)}}))}calcImg(e={}){return new Promise((async(t,a)=>{try{if(!e.val)return console.warn("需绘制的图片为空"),void t();const a=await this.loadImage(e.val),i=e.mode||"scaleToFill";let o,n=e.x||0,l=e.y||0,r=e.width||0,c=e.height||0,d=a.width,u=a.height,h=0,f=0;const m=()=>[h,f,d,u,n,l,r,c];switch(i){case"aspectFit":c=a.height/a.width*r,c<e.height?l=Number(e.y)+e.height/2-c/2:(c=e.height,r=a.width/a.height*c,n=Number(e.x)+e.width/2-r/2),o=m();break;case"aspectFill":c=a.height/a.width*r,c<e.height?(c=e.height,h=a.width/a.height*e.height,h=(h-e.width)/h*a.width/2,d=a.width-2*h):(f=(c-e.height)/c*a.height/2,u=a.height-2*f),r=e.width,c=e.height,o=m();break;case"widthFix":c=e.height=a.height/a.width*e.width,o=[n,l,r,c];break;case"heightFix":r=e.width=a.width/a.height*e.height,o=[n,l,r,c];break;default:o=[n,l,r,c]}o.unshift(s?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(i){a(i)}}))}drawQrCode(e={}){return new Promise(((t,a)=>{if(!(null==e?void 0:e.val))return console.warn("绘制二维码val为空"),void t();this.savePaintbrush();let i=[],s={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,n=0;for(var l=0,r=i.length;l<r;l++)if(n=l,i[l].text==s.text&&i[l].text.correctLevel==s.correctLevel){o=i[l].obj;break}n==r&&(o=new v(s.text,s.correctLevel),i.push({text:s.text,correctLevel:s.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},d=o.getModuleCount(),u=s.size,h=u/d,f=u/d;for(let e=0;e<d;e++)for(let t=0;t<d;t++){let a=(t+1)*h-t*h,i=(e+1)*h-e*h,n=c({row:e,col:t,count:d,options:s});this.setPaintbrush({fillStyle:o.modules[e][t]?n:s.background}),this.ctx.fillRect(s.dx+t*h,s.dy+e*f,a,i)}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:i,d:s,mode:o}=e;o=o||"leftTop";const n=s/2;switch(e.clip&&t.save(),t.beginPath(),o){case"leftTop":t.arc(a+n,i+n,n,0,2*Math.PI);break;case"center":t.arc(a,i,n,0,2*Math.PI)}return t.closePath(),e.clip&&t.clip(),this}setRect(e={}){const t=this.ctx,{x:a,y:i,r:s,height:o,width:n}=e;return e.clip&&t.save(),t.beginPath(),s&&s>0?(t.arc(a+s,i+s,s,1*Math.PI,1.5*Math.PI),t.lineTo(a+n-s,i),t.arc(a+n-s,i+s,s,1.5*Math.PI,0),t.lineTo(a+n,i+o-s),t.arc(a+n-s,i+o-s,s,0,.5*Math.PI),t.lineTo(a+s,i+o),t.arc(a+s,i+o-s,s,.5*Math.PI,1*Math.PI),t.lineTo(a,i+s)):(t.moveTo(a,i),t.lineTo(a+n,i),t.lineTo(a+n,i+o),t.lineTo(a,i+o),t.lineTo(a,i)),t.closePath(),e.clip&&t.clip(),this}loadImage(e){return new Promise((async(t,a)=>{if(!e)return console.warn("加载图片url为空"),void t();if(l[e])return void t(l[e]);let s;try{switch(i){case"uni":s=await new Promise(((t,a)=>{if(e._loaded)t(e);else if(~e.indexOf("data:image")){let i=e,s={};k.base64ToPath(e).then((e=>{i=e,me({src:i,success:e=>{s=e;const a=new String(i);for(const t in s)a[t]=s[t];a._loaded=!0,t(a)},fail:e=>a(e)})})).catch((e=>{a(e)}))}else"http"==e.substr(0,4)?pe({url:e,success:({tempFilePath:e})=>{me({src:e,success:a=>{const i=new String(e);for(const e in a)i[e]=a[e];i._loaded=!0,t(i)},fail:e=>a(e)})},fail:e=>a(e)}):me({src:e,success:a=>{const i=new String(e);for(const e in a)i[e]=a[e];i._loaded=!0,t(i)},fail:e=>a(e)})}));break;case"web":s=await new Promise(((t,a)=>{if("string"!=typeof e)return void t(e);const i=new Image;i.onload=()=>{t(i)},i.onerror=e=>{a(e)},i.src=e}));break;case"node":s=await new Promise(((t,a)=>{"string"==typeof e?p.loadImage(e).then((e=>{t(e)})).catch((e=>{a(e)})):t(e)}))}}catch(o){a(o)}l[e]=s,t(s)}))}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 i=[];for(let t=0;t<e.length;t++){const a=e[t];let s;switch(typeof a){case"function":s=a(),"function"==typeof(null==s?void 0:s.then)&&(s=await s);break;case"object":s=Array.isArray(a)?await this.drawArray(a):await this.drawItem(a)}i.push({item:a,result:s})}t(i)}catch(i){a(i)}}))}drawItem(e={}){return new Promise((async(t,a)=>{var i,s;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==(i=this[e.name])?void 0:i.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==(s=e.val)?void 0:s.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 i=[];try{t({html:e,htmlParses:await function e(t,a){return new Promise((async(a,s)=>{var o;for(let l=0;l<t.length;l++){const a=t[l];if("text"==a.type||a.name,i.push(a),null==(o=a.children)?void 0:o.length){a.__handle=function(e){};try{await e(a.children,a)}catch(n){return void s(n)}}}a(i)}))}(e)})}catch(s){a(s)}}))}};let w=_;a=new WeakMap;var v=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=[],i=0;i<t.length;i++)for(var s=e(t.charCodeAt(i)),o=0;o<s.length;o++)a.push(s[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 i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(this.modules[e+a][t+i]=0<=a&&a<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==a||6==a)||2<=a&&a<=4&&2<=i&&i<=4)},createQrcode:function(){for(var e=0,t=0,a=null,i=0;i<8;i++){this.makeImpl(i);var s=u.getLostPoint(this);(0==i||e>s)&&(e=s,t=i,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=u.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var a=0;a<e.length;a++){var i=e[t],s=e[a];if(null==this.modules[i][s])for(var o=-2;o<=2;o++)for(var n=-2;n<=2;n++)this.modules[i+o][s+n]=-2==o||2==o||-2==n||2==n||0==o&&0==n}},setupTypeNumber:function(e){for(var t=u.getBCHTypeNumber(this.typeNumber),a=0;a<18;a++){var i=!e&&1==(t>>a&1);this.modules[Math.floor(a/3)][a%3+this.moduleCount-8-3]=i,this.modules[a%3+this.moduleCount-8-3][Math.floor(a/3)]=i}},setupTypeInfo:function(e,t){for(var i=a[this.errorCorrectLevel]<<3|t,s=u.getBCHTypeInfo(i),o=0;o<15;o++){var n=!e&&1==(s>>o&1);o<6?this.modules[o][8]=n:o<8?this.modules[o+1][8]=n:this.modules[this.moduleCount-15+o][8]=n,n=!e&&1==(s>>o&1),o<8?this.modules[8][this.moduleCount-o-1]=n:o<9?this.modules[8][15-o-1+1]=n:this.modules[8][15-o-1]=n}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 i=0,s=this.utf8bytes.length;i<s;i++)e.put(this.utf8bytes[i],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,i=0,s=this.rsBlock.length/3,o=new Array,n=0;n<s;n++)for(var l=this.rsBlock[3*n+0],r=this.rsBlock[3*n+1],c=this.rsBlock[3*n+2],d=0;d<l;d++)o.push([c,r]);for(var h=new Array(o.length),f=new Array(o.length),p=0;p<o.length;p++){var g=o[p][0],b=o[p][1]-g;for(a=Math.max(a,g),i=Math.max(i,b),h[p]=new Array(g),n=0;n<h[p].length;n++)h[p][n]=255&e.buffer[n+t];t+=g;var y=u.getErrorCorrectPolynomial(b),_=new m(h[p],y.getLength()-1).mod(y);for(f[p]=new Array(y.getLength()-1),n=0;n<f[p].length;n++){var w=n+_.getLength()-f[p].length;f[p][n]=w>=0?_.get(w):0}}var v=new Array(this.totalDataCount),x=0;for(n=0;n<a;n++)for(p=0;p<o.length;p++)n<h[p].length&&(v[x++]=h[p][n]);for(n=0;n<i;n++)for(p=0;p<o.length;p++)n<f[p].length&&(v[x++]=f[p][n]);return v},mapData:function(e,t){for(var a=-1,i=this.moduleCount-1,s=7,o=0,n=this.moduleCount-1;n>0;n-=2)for(6==n&&n--;;){for(var l=0;l<2;l++)if(null==this.modules[i][n-l]){var r=!1;o<e.length&&(r=1==(e[o]>>>s&1)),u.getMask(t,i,n-l)&&(r=!r),this.modules[i][n-l]=r,-1==--s&&(o++,s=7)}if((i+=a)<0||this.moduleCount<=i){i-=a,a=-a;break}}}},t.PAD0=236,t.PAD1=17;for(var a=[1,0,3,2],i=0,s=1,o=2,n=3,l=4,r=5,c=6,d=7,u={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;u.getBCHDigit(t)-u.getBCHDigit(u.G15)>=0;)t^=u.G15<<u.getBCHDigit(t)-u.getBCHDigit(u.G15);return(e<<10|t)^u.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;u.getBCHDigit(t)-u.getBCHDigit(u.G18)>=0;)t^=u.G18<<u.getBCHDigit(t)-u.getBCHDigit(u.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return u.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,a){switch(e){case i:return(t+a)%2==0;case s:return t%2==0;case o:return a%3==0;case n:return(t+a)%3==0;case l:return(Math.floor(t/2)+Math.floor(a/3))%2==0;case r:return t*a%2+t*a%3==0;case c:return(t*a%2+t*a%3)%2==0;case d:return(t*a%3+(t+a)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new m([1],0),a=0;a<e;a++)t=t.multiply(new m([1,h.gexp(a)],0));return t},getLostPoint:function(e){for(var t=e.getModuleCount(),a=0,i=0,s=0;s<t;s++)for(var o=0,n=e.modules[s][0],l=0;l<t;l++){var r=e.modules[s][l];if(l<t-6&&r&&!e.modules[s][l+1]&&e.modules[s][l+2]&&e.modules[s][l+3]&&e.modules[s][l+4]&&!e.modules[s][l+5]&&e.modules[s][l+6]&&(l<t-10?e.modules[s][l+7]&&e.modules[s][l+8]&&e.modules[s][l+9]&&e.modules[s][l+10]&&(a+=40):l>3&&e.modules[s][l-1]&&e.modules[s][l-2]&&e.modules[s][l-3]&&e.modules[s][l-4]&&(a+=40)),s<t-1&&l<t-1){var c=0;r&&c++,e.modules[s+1][l]&&c++,e.modules[s][l+1]&&c++,e.modules[s+1][l+1]&&c++,0!=c&&4!=c||(a+=3)}n^r?o++:(n=r,o>=5&&(a+=3+o-5),o=1),r&&i++}for(l=0;l<t;l++)for(o=0,n=e.modules[0][l],s=0;s<t;s++)r=e.modules[s][l],s<t-6&&r&&!e.modules[s+1][l]&&e.modules[s+2][l]&&e.modules[s+3][l]&&e.modules[s+4][l]&&!e.modules[s+5][l]&&e.modules[s+6][l]&&(s<t-10?e.modules[s+7][l]&&e.modules[s+8][l]&&e.modules[s+9][l]&&e.modules[s+10][l]&&(a+=40):s>3&&e.modules[s-1][l]&&e.modules[s-2][l]&&e.modules[s-3][l]&&e.modules[s-4][l]&&(a+=40)),n^r?o++:(n=r,o>=5&&(a+=3+o-5),o=1);return a+=Math.abs(100*i/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 m(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 i=0;i<e.length-a;i++)this.num[i]=e[i+a]}m.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 i=0;i<e.getLength();i++)t[a+i]^=h.gexp(h.glog(this.get(a))+h.glog(e.get(i)));return new m(t,0)},mod:function(e){var t=this.getLength(),a=e.getLength();if(t-a<0)return this;for(var i=new Array(t),s=0;s<t;s++)i[s]=this.get(s);for(;i.length>=a;){var o=h.glog(i[0])-h.glog(e.get(0));for(s=0;s<e.getLength();s++)i[s]^=h.gexp(h.glog(e.get(s))+o);for(;0==i[0];)i.shift()}return new m(i,0)}};var p=[[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=p[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,i=0,s=0;s<a;s++){var o=t[3*s+0];i+=t[3*s+2]*o}var n=e>9?2:1;if(this.utf8bytes.length+n<i||40==e){this.typeNumber=e,this.rsBlock=t,this.totalDataCount=i;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,i=c("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"),s=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"),n=c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),l=c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),r=c("script,style");function c(e){for(var t={},a=e.split(","),i=0;i<a.length;i++)t[a[i]]=!0;return t}return function(c){c=function(e){return e.replace(/<\?xml.*\?>\n/,"").replace(/<!doctype.*>\n/,"").replace(/<!DOCTYPE.*>\n/,"")}(c);var d=[],u={node:"root",children:[]};return function(c,d){var u,h,f,m=[],p=c;for(m.last=function(){return this[this.length-1]};c;){if(h=!0,m.last()&&r[m.last()])c=c.replace(new RegExp("([\\s\\S]*?)</"+m.last()+"[^>]*>"),(function(e,t){return t=t.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),d.chars&&d.chars(t),""})),y("",m.last());else if(0==c.indexOf("\x3c!--")?(u=c.indexOf("--\x3e"))>=0&&(d.comment&&d.comment(c.substring(4,u)),c=c.substring(u+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=(u=c.indexOf("<"))<0?c:c.substring(0,u);c=u<0?"":c.substring(u),d.chars&&d.chars(g)}if(c==p)throw"Parse Error: "+c;p=c}function b(e,t,r,c){if(t=t.toLowerCase(),s[t])for(;m.last()&&o[m.last()];)y("",m.last());if(n[t]&&m.last()==t&&y("",t),(c=i[t]||!!c)||m.push(t),d.start){var u=[];r.replace(a,(function(e,t){var a=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:l[t]?t:"";u.push({name:t,value:a,escaped:a.replace(/(^|[^\\])"/g,'$1\\"')})})),d.start&&d.start(t,u,c)}}function y(e,t){if(t)for(a=m.length-1;a>=0&&m[a]!=t;a--);else var a=0;if(a>=0){for(var i=m.length-1;i>=a;i--)d.end&&d.end(m[i]);m.length=a}}y()}(c,{start:function(e,t,a){var i={name:e};if(0!==t.length&&(i.attrs=function(e){return e.reduce((function(e,t){var a=t.value,i=t.name;return e[i]?e[i]=e[i]+" "+a:e[i]=a,e}),{})}(t)),a){var s=d[0]||u;s.children||(s.children=[]),s.children.push(i)}else d.unshift(i)},end:function(e){var t=d.shift();if(t.name!==e&&console.error("invalid state: mismatch end tag"),0===d.length)u.children.push(t);else{var a=d[0];a.children||(a.children=[]),a.children.push(t)}},chars:function(e){var t={type:"text",text:e};if(0===d.length)u.children.push(t);else{var a=d[0];a.children||(a.children=[]),a.children.push(t)}},comment:function(e){var t={node:"comment",text:e},a=d[0];a.children||(a.children=[]),a.children.push(t)}}),u.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 i=new XMLHttpRequest;return i.open("GET",e,!0),i.responseType="blob",i.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)}},i.onerror=a,void i.send()}var s=document.createElement("canvas"),o=s.getContext("2d"),n=new Image;return n.onload=function(){s.width=n.width,s.height=n.height,o.drawImage(n,0,0),t(s.toDataURL()),s.height=s.width=0},n.onerror=a,void(n.src=e)}"object"!=typeof plus?"object"==typeof wx&&be("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 i=new plus.io.FileReader;i.onload=function(e){t(e.target.result)},i.onerror=function(e){a(e)},i.readAsDataURL(e)}),(function(e){a(e)}))}),(function(e){a(e)}))}))},base64ToPath:function(a){return new Promise((function(i,s){if("object"==typeof window&&"document"in window){for(var o=(a=a.split(","))[0].match(/:(.*?);/)[1],n=atob(a[1]),l=n.length,r=new Uint8Array(l);l--;)r[l]=n.charCodeAt(l);return i((window.URL||window.webkitURL).createObjectURL(new Blob([r],{type:o})))}var c=a.split(",")[0].match(/data\:\S+\/(\S+);/);c?c=c[1]:s(new Error("base64 error"));var d=Date.now()+String(t++)+"."+c;if("object"!=typeof plus){try{_=("object"==typeof my&&(null==(u=null==my?void 0:my.env)?void 0:u.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==(m=null==qq?void 0:qq.env)?void 0:m.USER_DATA_PATH)?qq.env.USER_DATA_PATH:"object"==typeof qh&&(null==(p=null==qh?void 0:qh.env)?void 0:p.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")+"/"+d,uni.getFileSystemManager().writeFile({filePath:_,data:e(a),encoding:"base64",success:function(){i(_)},fail:function(e){s(e)}})}catch(v){s(new Error("not support"))}var u,h,f,m,p,g}else{var b="_doc",y="uniapp_temp",_="_doc/uniapp_temp/"+d;if(!function(e,t){for(var a=e.split("."),i=t.split("."),s=!1,o=0;o<i.length;o++){var n=a[o]-i[o];if(0!==n){s=n>0;break}}return s}("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(d,{create:!0,exclusive:!1},(function(t){t.createWriter((function(t){t.onwrite=function(){i(_)},t.onerror=s,t.seek(0),t.writeAsBinary(e(a))}),s)}),s)}),s)}),s);var w=new plus.nativeObj.Bitmap(d);w.loadBase64Data(a,(function(){w.save(_,{},(function(){w.clear(),i(_)}),(function(e){w.clear(),s(e)}))}),(function(e){w.clear(),s(e)}))}}))}}}();b("object")&&(gt.exports=w)}();const yt=bt;function _t(e){switch(e.shareInfo.poster.type){case"user":return(e=>{const t=e.width,a=C.$store("user").userInfo;return{background:wt(C.$url.cdn(C.$store("app").platform.share.posterInfo.user_bg)),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:wt(C.$url.cdn(a.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:.84*t,size:.3*t}]}})(e);case"goods":return(e=>{const t=e.width,a=C.$store("user").userInfo;return{background:wt(C.$url.cdn(C.$store("app").platform.share.posterInfo.goods_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:wt(C.$url.cdn(a.avatar)),x:.04*t,y:.04*t,width:.14*t,height:.14*t,d:.14*t},{name:"goodsImage",type:"image",val:wt(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:"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.3*t,size:.2*t}]}})(e);case"groupon":return(e=>{const t=e.width,a=C.$store("user").userInfo;return{background:wt(C.$url.cdn(C.$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:wt(C.$url.cdn(a.avatar)),x:.04*t,y:.04*t,width:.14*t,height:.14*t,d:.14*t},{name:"goodsImage",type:"image",val:wt(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 wt(e){return"https:"===window.location.protocol&&0===e.indexOf("http:")&&(e=e.replace("http:","https:")),e}const vt=Se({__name:"index",props:{show:{type:Boolean,default:!1},shareInfo:{type:Object,default(){}}},emits:["success","close"],setup(e,{expose:t,emit:o}){const n=e,l=_({canvasId:"canvasId",width:.9*C.$platform.device.windowWidth,height:600,src:""}),r=L(),f=()=>{o("close")},y=()=>{["WechatOfficialAccount","H5"].includes(C.$platform.name)?C.$helper.toast("请长按图片保存"):ye({filePath:l.src,success:e=>{f(),C.$helper.toast("保存成功")},fail:e=>{C.$helper.toast("保存失败"),console.log("图片保存失败:",e)}})};return t({getPoster:async function(e){l.src="",l.shareInfo=n.shareInfo;const t=await async function(e,t){const a=e.width,i=new yt({canvasId:e.canvasId,width:e.width,height:e.height,setCanvasWH:t=>{e.height=t.height}},t);let s=_t(e);const o=await i.drawImg({type:"image",val:s.background,x:0,y:0,width:a,mode:"widthFix",zIndex:0});await i.updateCanvasWH({width:o.width,height:o.bottom});let n=s.list;for(let l=0;l<n.length;l++){let e=n[l];"text"===e.type&&await i.drawText(e),"image"===e.type&&(e.d&&i.setCircle({x:e.x,y:e.y,d:e.d,clip:!0}),e.r&&i.setRect({x:e.x,y:e.y,height:e.height,width:e.width,r:e.r,clip:!0}),await i.drawImg(e),i.restore()),"qrcode"===e.type&&await i.drawQrCode(e)}return await i.draw(),setTimeout((async()=>{e.src=await i.toImage()}),100),e}(l,r);return t}}),(t,o)=>{const n=b,r=N,_=_e,w=P,v=c(d("su-popup"),Ee);return a(),i(v,{show:e.show,round:"10",onClose:f,type:"center",class:"popup-box"},{default:u((()=>[h(n,{class:"ss-flex-col ss-col-center ss-row-center"},{default:u((()=>[""===l.src?(a(),i(n,{key:0,class:"poster-title ss-flex ss-row-center",style:s({height:l.height+"px",width:l.width+"px"})},{default:u((()=>[m(" 海报加载中... ")])),_:1},8,["style"])):(a(),i(r,{key:1,class:"poster-img",src:l.src,style:s({height:l.height+"px",width:l.width+"px"}),"show-menu-by-longpress":!0},null,8,["src","style"])),h(_,{class:"hideCanvas","canvas-id":l.canvasId,id:l.canvasId,style:s({height:l.height+"px",width:l.width+"px"})},null,8,["canvas-id","id","style"]),""!==l.src?(a(),i(n,{key:2,class:"poster-btn-box ss-m-t-20 ss-flex ss-row-between ss-col-center"},{default:u((()=>[h(w,{class:"cancel-btn ss-reset-button",onClick:f},{default:u((()=>[m("取消")])),_:1}),h(w,{class:"save-btn ss-reset-button ui-BG-Main",onClick:y},{default:u((()=>[m(p(["wechatOfficialAccount","H5"].includes(S(C).$platform.name)?"长按图片保存":"保存图片"),1)])),_:1})])),_:1})):g("",!0)])),_:1})])),_:1},8,["show"])}}},[["__scopeId","data-v-c602f40e"]]),xt=Se({__name:"s-share-modal",props:{shareInfo:{type:Object,default(){}}},setup(e){const t=e,s=A((()=>C.$store("modal").share)),o=A((()=>C.$store("app").platform.share)),l=K(""),r=_({showShareGuide:!1,showPosterModal:!1}),f=()=>{we(),C.$store("user").isLogin?(S(l).getPoster(),r.showPosterModal=!0):J()},p=()=>{we(),["WechatOfficialAccount","H5"].includes(C.$platform.name)&&(r.showShareGuide=!0)},y=()=>{C.$helper.copyText(t.shareInfo.link),we()};function w(){r.showShareGuide=!1}return(t,_)=>{const v=c(d("su-popup"),Ee),x=N,k=b,I=n,$=P;return a(),i(k,null,{default:u((()=>[h(v,{show:r.showShareGuide,showClose:!1,onClose:w},null,8,["show"]),r.showShareGuide?(a(),i(k,{key:0,class:"guide-wrap"},{default:u((()=>[h(x,{class:"guide-image",src:S(C).$url.static("/static/img/shop/share/share_guide.png")},null,8,["src"])])),_:1})):g("",!0),h(v,{show:S(s),round:"10",showClose:!1,onClose:S(we)},{default:u((()=>[h(k,{class:"share-box"},{default:u((()=>[h(k,{class:"share-list-box ss-flex"},{default:u((()=>[S(o).methods.includes("forward")?(a(),i($,{key:0,class:"share-item share-btn ss-flex-col ss-col-center","open-type":"share",onClick:p},{default:u((()=>[h(x,{class:"share-img",src:S(C).$url.static("/static/img/shop/share/share_wx.png"),mode:""},null,8,["src"]),h(I,{class:"share-title"},{default:u((()=>[m("微信好友")])),_:1})])),_:1})):g("",!0),S(o).methods.includes("poster")?(a(),i($,{key:1,class:"share-item share-btn ss-flex-col ss-col-center",onClick:f},{default:u((()=>[h(x,{class:"share-img",src:S(C).$url.static("/static/img/shop/share/share_poster.png"),mode:""},null,8,["src"]),h(I,{class:"share-title"},{default:u((()=>[m("生成海报")])),_:1})])),_:1})):g("",!0),S(o).methods.includes("link")?(a(),i($,{key:2,class:"share-item share-btn ss-flex-col ss-col-center",onClick:y},{default:u((()=>[h(x,{class:"share-img",src:S(C).$url.static("/static/img/shop/share/share_link.png"),mode:""},null,8,["src"]),h(I,{class:"share-title"},{default:u((()=>[m("复制链接")])),_:1})])),_:1})):g("",!0)])),_:1}),h(k,{class:"share-foot ss-flex ss-row-center ss-col-center",onClick:S(we)},{default:u((()=>[m(" 取消 ")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["show","onClose"]),h(vt,{ref_key:"SharePosterRef",ref:l,show:r.showPosterModal,shareInfo:e.shareInfo,onClose:_[0]||(_[0]=e=>r.showPosterModal=!1)},null,8,["show","shareInfo"])])),_:1})}}},[["__scopeId","data-v-9a4a180a"]]),kt=Se({__name:"s-menu-tools",setup(e){const t=A((()=>C.$store("modal").menu));const s=[{url:"/pages/index/index",icon:"/static/img/shop/tools/home.png",title:"首页"},{url:"/pages/index/search",icon:"/static/img/shop/tools/search.png",title:"搜索"},{url:"/pages/index/user",icon:"/static/img/shop/tools/user.png",title:"个人中心"},{url:"/pages/index/cart",icon:"/static/img/shop/tools/cart.png",title:"购物车"},{url:"/pages/user/goods-log",icon:"/static/img/shop/tools/browse.png",title:"浏览记录"},{url:"/pages/user/goods-collect",icon:"/static/img/shop/tools/collect.png",title:"我的收藏"},{url:"/pages/chat/index",icon:"/static/img/shop/tools/service.png",title:"客服"}];return(e,o)=>{const n=c(d("su-status-bar"),Re),l=b,r=N,f=P,y=c(d("su-popup"),Ee);return a(),i(y,{show:S(t),type:"top",round:"20",backgroundColor:"#F0F0F0",onClose:S(ve)},{default:u((()=>[h(n),h(l,{class:"tools-wrap ss-m-x-30 ss-m-b-16"},{default:u((()=>[h(l,{class:"title ss-m-b-34 ss-p-t-20"},{default:u((()=>[m("快捷菜单")])),_:1}),h(l,{class:"container-list ss-flex ss-flex-wrap"},{default:u((()=>[(a(),w(v,null,x(s,(e=>h(l,{class:"list-item ss-m-b-24",key:e.title},{default:u((()=>[h(l,{class:"ss-flex-col ss-col-center"},{default:u((()=>[h(f,{class:"ss-reset-button list-image ss-flex ss-row-center ss-col-center",onClick:t=>function(e){ve(),e.url&&C.$router.go(e.url)}(e)},{default:u((()=>[S(t)?(a(),i(r,{key:0,src:S(C).$url.static(e.icon),class:"list-icon"},null,8,["src"])):g("",!0)])),_:2},1032,["onClick"]),h(l,{class:"list-title ss-m-t-20"},{default:u((()=>[m(p(e.title),1)])),_:2},1024)])),_:2},1024)])),_:2},1024))),64))])),_:1})])),_:1})])),_:1},8,["show","onClose"])}}},[["__scopeId","data-v-e6c87178"]]),St=Se({__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 n=e,l=C.$store("sys");C.$store("user"),C.$store("app"),C.$store("modal");const r=A((()=>l)),m=A((()=>"normal"===n.navbar||"normal"===n.navbarStyle.mode?"normal":"inner")),p=A((()=>"inner"===m.value?{background:`${n.bgStyle.backgroundColor} url(${C.$url.cdn(n.bgStyle.backgroundImage)}) no-repeat top center / 100% auto`}:{})),y=A((()=>"normal"===m.value?{background:`${n.bgStyle.backgroundColor} url(${C.$url.cdn(n.bgStyle.backgroundImage)}) no-repeat top center / 100% auto`}:{})),_=A((()=>!0===n.onShareAppMessage?C.$platform.share.getShareInfo():xe.isEmpty(n.onShareAppMessage)?{}:(C.$platform.share.updateShareInfo(n.onShareAppMessage),n.onShareAppMessage)));return ke((()=>{xe.isEmpty(_.value)||C.$platform.share.updateShareInfo(_.value)})),(n,l)=>{const w=c(d("su-navbar"),Ne),v=c(d("s-custom-navbar"),Ue),x=c(d("su-inner-navbar"),He),k=b,P=c(d("s-tabbar"),Xe),I=c(d("s-auth-modal"),pt),$=c(d("s-share-modal"),xt),T=c(d("s-menu-tools"),kt);return a(),i(k,{class:o(["page-app",["theme-"+S(r).mode,"main-"+S(r).theme,"font-"+S(r).fontSize]])},{default:u((()=>[h(k,{class:"page-main",style:s([S(p)])},{default:u((()=>["normal"===e.navbar?(a(),i(w,{key:0,title:e.title,statusBar:"",color:e.color,tools:e.tools,opacityBgUi:e.opacityBgUi,onSearch:l[0]||(l[0]=e=>t("search",e)),defaultSearch:e.defaultSearch},null,8,["title","color","tools","opacityBgUi","defaultSearch"])):"custom"===e.navbar&&"normal"===S(m)?(a(),i(v,{key:1,data:e.navbarStyle,showLeftButton:e.showLeftButton},null,8,["data","showLeftButton"])):g("",!0),h(k,{class:"page-body",style:s([S(y)])},{default:u((()=>["inner"===e.navbar?(a(),i(x,{key:0,title:e.title},null,8,["title"])):g("",!0),"inner"===e.navbar?(a(),i(k,{key:1,style:s([{paddingTop:S(C).$platform.navbar+"px"}])},null,8,["style"])):g("",!0),"custom"===e.navbar&&"inner"===S(m)?(a(),i(v,{key:2,data:e.navbarStyle,showLeftButton:e.showLeftButton},null,8,["data","showLeftButton"])):g("",!0),f(n.$slots,"default",{},void 0,!0),""!==e.tabbar?(a(),i(P,{key:3,path:e.tabbar},null,8,["path"])):g("",!0)])),_:3},8,["style"])])),_:3},8,["style"]),h(k,{class:"page-modal"},{default:u((()=>[h(I),h($,{shareInfo:S(_)},null,8,["shareInfo"]),h(T)])),_:1})])),_:3},8,["class"])}}},[["__scopeId","data-v-7fd14d76"]]);export{ft as F,St as _,Oe as a,Te as b,Pe as c,Ee as d,Ae as e,Re as f,Ze as g,st as h,Qe as i,ot as m};
|