You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
10 KiB
JavaScript

import{o as t,c as e,w as i,b as s,n as l,d as a,e as o,t as n,f as r,g as d,i as c,h as u,s as p,a as h,j as f,k as g,l as y,m,p as _,r as b,q as x,u as k,v as S,F as w}from"./index-29fb9c31.js";import{_ as B}from"./uni-icons.1a1aa5ae.js";import{r as C,a as T}from"./uni-app.es.125322ac.js";import{_ as $}from"./_plugin-vue_export-helper.1b428a4d.js";import"./index.9253508f.js";const I=$({name:"UniBadge",emits:["click"],props:{type:{type:String,default:"error"},inverted:{type:Boolean,default:!1},isDot:{type:Boolean,default:!1},maxNum:{type:Number,default:99},absolute:{type:String,default:""},offset:{type:Array,default:()=>[0,0]},text:{type:[String,Number],default:""},size:{type:String,default:"small"},customStyle:{type:Object,default:()=>({})}},data:()=>({}),computed:{width(){return 8*String(this.text).length+12},classNames(){const{inverted:t,type:e,size:i,absolute:s}=this;return[t?"uni-badge--"+e+"-inverted":"","uni-badge--"+e,"uni-badge--"+i,s?"uni-badge--absolute":""].join(" ")},positionStyle(){if(!this.absolute)return{};let t=this.width/2,e=10;this.isDot&&(t=5,e=5);const i=`${-t+this.offset[0]}px`,s=`${-e+this.offset[1]}px`,l={rightTop:{right:i,top:s},rightBottom:{right:i,bottom:s},leftBottom:{left:i,bottom:s},leftTop:{left:i,top:s}},a=l[this.absolute];return a||l.rightTop},dotStyle(){return this.isDot?{width:"10px",minWidth:"0",height:"10px",padding:"0",borderRadius:"10px"}:{}},displayValue(){const{isDot:t,text:e,maxNum:i}=this;return t?"":Number(e)>i?`${i}+`:e}},methods:{onClick(){this.$emit("click")}}},[["render",function(u,p,h,f,g,y){const m=d,_=c;return t(),e(_,{class:"uni-badge--x"},{default:i((()=>[s(u.$slots,"default",{},void 0,!0),h.text?(t(),e(m,{key:0,class:l([y.classNames,"uni-badge"]),style:a([y.positionStyle,h.customStyle,y.dotStyle]),onClick:p[0]||(p[0]=t=>y.onClick())},{default:i((()=>[o(n(y.displayValue),1)])),_:1},8,["class","style"])):r("",!0)])),_:3})}],["__scopeId","data-v-414d462c"]]);const v=$({name:"UniListItem",emits:["click","switchChange"],props:{direction:{type:String,default:"row"},title:{type:String,default:""},note:{type:String,default:""},ellipsis:{type:[Number,String],default:0},disabled:{type:[Boolean,String],default:!1},clickable:{type:Boolean,default:!1},showArrow:{type:[Boolean,String],default:!1},link:{type:[Boolean,String],default:!1},to:{type:String,default:""},showBadge:{type:[Boolean,String],default:!1},showSwitch:{type:[Boolean,String],default:!1},switchChecked:{type:[Boolean,String],default:!1},badgeText:{type:String,default:""},badgeType:{type:String,default:"success"},badgeStyle:{type:Object,default:()=>({})},rightText:{type:String,default:""},thumb:{type:String,default:""},thumbSize:{type:String,default:"base"},showExtraIcon:{type:[Boolean,String],default:!1},extraIcon:{type:Object,default:()=>({type:"",color:"#000000",size:20,customPrefix:""})},border:{type:Boolean,default:!0},customStyle:{type:Object,default:()=>({padding:"",backgroundColor:"#FFFFFF"})},keepScrollPosition:{type:Boolean,default:!1}},watch:{"customStyle.padding":{handler(t){"number"==typeof t&&(t+="");let e=t.split(" ");if(1===e.length){const t=e[0];this.padding={top:t,right:t,bottom:t,left:t}}else if(2===e.length){const[t,i]=e;this.padding={top:t,right:i,bottom:t,left:i}}else if(4===e.length){const[t,i,s,l]=e;this.padding={top:t,right:i,bottom:s,left:l}}},immediate:!0}},data:()=>({isFirstChild:!1,padding:{top:"",right:"",bottom:"",left:""}}),mounted(){this.list=this.getForm(),this.list&&(this.list.firstChildAppend||(this.list.firstChildAppend=!0,this.isFirstChild=!0))},methods:{getForm(t="uniList"){let e=this.$parent,i=e.$options.name;for(;i!==t;){if(e=e.$parent,!e)return!1;i=e.$options.name}return e},onClick(){""===this.to?(this.clickable||this.link)&&this.$emit("click",{data:{}}):this.openPage()},onSwitchChange(t){this.$emit("switchChange",t.detail)},openPage(){-1!==["navigateTo","redirectTo","reLaunch","switchTab"].indexOf(this.link)?this.pageApi(this.link):this.pageApi("navigateTo")},pageApi(t){let e={url:this.to,success:t=>{this.$emit("click",{data:t})},fail:t=>{this.$emit("click",{data:t})}};switch(t){case"navigateTo":default:u(e);break;case"redirectTo":f(e);break;case"reLaunch":h(e);break;case"switchTab":p(e)}}}},[["render",function(u,p,h,f,b,x){const k=c,S=m,w=C(g("uni-icons"),B),T=d,$=C(g("uni-badge"),I),v=_;return t(),e(k,{class:l([{"uni-list-item--disabled":h.disabled},"uni-list-item"]),style:a({"background-color":h.customStyle.backgroundColor}),"hover-class":!h.clickable&&!h.link||h.disabled||h.showSwitch?"":"uni-list-item--hover",onClick:x.onClick},{default:i((()=>[b.isFirstChild?r("",!0):(t(),e(k,{key:0,class:l(["border--left",{"uni-list--border":h.border}])},null,8,["class"])),y(k,{class:l(["uni-list-item__container",{"container--right":h.showArrow||h.link,"flex--direction":"column"===h.direction}]),style:a({paddingTop:b.padding.top,paddingLeft:b.padding.left,paddingRight:b.padding.right,paddingBottom:b.padding.bottom})},{default:i((()=>[s(u.$slots,"header",{},(()=>[y(k,{class:"uni-list-item__header"},{default:i((()=>[h.thumb?(t(),e(k,{key:0,class:"uni-list-item__icon"},{default:i((()=>[y(S,{src:h.thumb,class:l(["uni-list-item__icon-img",["uni-list--"+h.thumbSize]])},null,8,["src","class"])])),_:1})):h.showExtraIcon?(t(),e(k,{key:1,class:"uni-list-item__icon"},{default:i((()=>[y(w,{customPrefix:h.extraIcon.customPrefix,color:h.extraIcon.color,size:h.extraIcon.size,type:h.extraIcon.type},null,8,["customPrefix","color","size","type"])])),_:1})):r("",!0)])),_:1})]),!0),s(u.$slots,"body",{},(()=>[y(k,{class:l(["uni-list-item__content",{"uni-list-item__content--center":h.thumb||h.showExtraIcon||h.showBadge||h.showSwitch}])},{default:i((()=>[h.title?(t(),e(T,{key:0,class:l(["uni-list-item__content-title",[0!==h.ellipsis&&h.ellipsis<=2?"uni-ellipsis-"+h.ellipsis:""]])},{default:i((()=>[o(n(h.title),1)])),_:1},8,["class"])):r("",!0),h.note?(t(),e(T,{key:1,class:"uni-list-item__content-note"},{default:i((()=>[o(n(h.note),1)])),_:1})):r("",!0)])),_:1},8,["class"])]),!0),s(u.$slots,"footer",{},(()=>[h.rightText||h.showBadge||h.showSwitch?(t(),e(k,{key:0,class:l(["uni-list-item__extra",{"flex--justify":"column"===h.direction}])},{default:i((()=>[h.rightText?(t(),e(T,{key:0,class:"uni-list-item__extra-text"},{default:i((()=>[o(n(h.rightText),1)])),_:1})):r("",!0),h.showBadge?(t(),e($,{key:1,type:h.badgeType,text:h.badgeText,"custom-style":h.badgeStyle},null,8,["type","text","custom-style"])):r("",!0),h.showSwitch?(t(),e(v,{key:2,disabled:h.disabled,checked:h.switchChecked,onChange:x.onSwitchChange},null,8,["disabled","checked","onChange"])):r("",!0)])),_:1},8,["class"])):r("",!0)]),!0)])),_:3},8,["class","style"]),h.showArrow||h.link?(t(),e(w,{key:1,size:16,class:"uni-icon-wrapper",color:"#bbb",type:"arrowright"})):r("",!0)])),_:3},8,["class","style","hover-class","onClick"])}],["__scopeId","data-v-0f950e05"]]);const z=$({name:"uniList","mp-weixin":{options:{multipleSlots:!1}},props:{stackFromEnd:{type:Boolean,default:!1},enableBackToTop:{type:[Boolean,String],default:!1},scrollY:{type:[Boolean,String],default:!1},border:{type:Boolean,default:!0},renderReverse:{type:Boolean,default:!1}},created(){this.firstChildAppend=!1},methods:{loadMore(t){this.$emit("scrolltolower")},scroll(t){this.$emit("scroll",t)}}},[["render",function(l,a,o,n,d,u){const p=c;return t(),e(p,{class:"uni-list uni-border-top-bottom"},{default:i((()=>[o.border?(t(),e(p,{key:0,class:"uni-list--border-top"})):r("",!0),s(l.$slots,"default",{},void 0,!0),o.border?(t(),e(p,{key:1,class:"uni-list--border-bottom"})):r("",!0)])),_:3})}],["__scopeId","data-v-c1d7c358"]]),F=$({__name:"index",setup(s){let l=b({color:"#FF8A5B",size:"28",type:"vip"}),a=b({color:"#26CED0",size:"28",type:"hand-up"});const n=t=>{sessionStorage.setItem("userlist_type",t),p({url:"/pages/user/list"})};let d=b([]);return T((()=>{sessionStorage.setItem("userlist_type","")})),(s,p)=>{const h=c,f=C(g("uni-icons"),B),m=C(g("uni-list-item"),v),_=C(g("uni-list"),z);return t(),e(h,{class:"container"},{default:i((()=>[y(h,{class:"top"},{default:i((()=>[y(h,{class:"top_left",onClick:p[0]||(p[0]=t=>n("expend"))},{default:i((()=>[y(h,{style:{display:"flex","margin-top":"60rpx"}},{default:i((()=>[y(h,null,{default:i((()=>[o("收费")])),_:1})])),_:1}),y(h,{style:{"padding-top":"20rpx","text-align":"center"}},{default:i((()=>[y(f,{type:"wallet",style:{color:"#fff","margin-top":"4rpx","margin-left":"4rpx"},size:"99"})])),_:1})])),_:1}),y(h,{class:"top_right"},{default:i((()=>[y(h,{class:"top_right1",onClick:p[1]||(p[1]=t=>{u({url:"/pages/user/user_add"})})},{default:i((()=>[y(h,{style:{display:"flex"}},{default:i((()=>[y(h,null,{default:i((()=>[o("新建")])),_:1})])),_:1}),y(h,{style:{"text-align":"center"}},{default:i((()=>[y(f,{type:"personadd",style:{color:"#fff","margin-top":"4rpx","margin-left":"4rpx"},size:"60"})])),_:1})])),_:1}),y(h,{class:"top_right2",onClick:p[2]||(p[2]=t=>n("recharge"))},{default:i((()=>[y(h,{style:{display:"flex"}},{default:i((()=>[y(h,null,{default:i((()=>[o("充值")])),_:1})])),_:1}),y(h,{style:{"text-align":"center"}},{default:i((()=>[y(f,{type:"vip",style:{color:"#fff","margin-top":"4rpx","margin-left":"4rpx"},size:"60"})])),_:1})])),_:1})])),_:1})])),_:1}),y(h,{style:{padding:"15rpx"}},{default:i((()=>[y(h,{class:"title"},{default:i((()=>[y(h,null,{default:i((()=>[o("今日流水")])),_:1}),y(f,{type:"map",style:{color:"#00BBF9","margin-top":"2rpx","margin-left":"4rpx"},size:"22"})])),_:1}),y(h,{class:"bottom"},{default:i((()=>[y(_,null,{default:i((()=>[(t(!0),x(w,null,k(S(d),((s,o)=>(t(),e(h,{key:o},{default:i((()=>[1==s.type?(t(),e(m,{key:0,showExtraIcon:"true",extraIcon:S(l),title:`充值${s.change_money}`,note:s.name,rightText:s.created_at.slice(-8)},null,8,["extraIcon","title","note","rightText"])):r("",!0),2==s.type?(t(),e(m,{key:1,showExtraIcon:"true",extraIcon:S(a),title:`${s.desc}${s.change_money}`,note:s.name,rightText:s.created_at.slice(-8)},null,8,["extraIcon","title","note","rightText"])):r("",!0)])),_:2},1024)))),128))])),_:1}),0==S(d).length?(t(),e(h,{key:0,style:{"font-size":"28rpx",color:"#ccc","text-align":"center","padding-top":"20rpx"}},{default:i((()=>[o(" 今日暂无记录 ")])),_:1})):r("",!0)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-6e30814a"]]);export{F as default};