import{v as a,s as e,c as t,C as s,p as l,aV as o,D as n,o as r,e as d,w as i,_ as u,b as c,i as p,y as m,z as _,u as f,E as g,f as b,h as y,F as x,k as v,m as w,A as k,B as h,d as j}from"./index-520dfaee.js";import{_ as S}from"./uni-datetime-picker.00e54fc8.js";import{_ as T}from"./su-tabs.251eecb0.js";import{_ as C}from"./su-sticky.4736fd36.js";import{_ as I}from"./s-empty.b6c95127.js";import{_ as M}from"./uni-load-more.ba4f287c.js";import{a as N}from"./s-layout.5146c957.js";import{_ as V}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                */const Y=V({__name:"score",setup(V){a((()=>{}));const Y=2*e.$platform.device.statusBarHeight,$=t((()=>e.$store("user").userInfo)),D=e.$platform.navbar,H={data:[],current_page:1,total:1,last_page:1,expense:0,income:0},B=s({currentTab:0,pagination:H,loadStatus:"",date:[],today:""}),q=[{name:"全部",value:"all"},{name:"收入",value:"income"},{name:"支出",value:"expense"}],z=t((()=>B.date[0]===B.date[1]?B.date[0]:B.date.join("~")));async function A(a=1,t=8){B.loadStatus="loading";let s=await e.$api.user.wallet.log({type:"score",list_rows:t,page:a,tab:q[B.currentTab].value,date:(l=B.date,[l[0]+" 00:00:00",l[1]+" 23:59:59"])});var l;if(1===s.code){let a=u.concat(B.pagination.data,s.data.list.data);B.pagination={...s.data.list,data:a,income:s.data.income,expense:s.data.expense},B.pagination.current_page<B.pagination.last_page?B.loadStatus="more":B.loadStatus="noMore"}}function E(a){B.pagination=H,B.currentTab=a.index,A()}function F(a){B.date[0]=a[0],B.date[1]=a[a.length-1],B.pagination=H,A()}function U(){"noMore"!==B.loadStatus&&A(B.pagination.current_page+1)}return l((async a=>{B.today=o().format("YYYY-MM-DD"),B.date=[B.today,B.today],A()})),n((()=>{U()})),(a,e)=>{const t=w,s=k,l=h,o=c(j("uni-datetime-picker"),S),n=c(j("su-tabs"),T),u=c(j("su-sticky"),C),V=c(j("s-empty"),I),H=c(j("uni-load-more"),M),A=c(j("s-layout"),N);return r(),d(A,{class:"wallet-wrap",title:"我的积分",navbar:"inner"},{default:i((()=>[p(t,{class:"header-box ss-flex ss-flex-col ss-row-center ss-col-center",style:g([{marginTop:"-"+Number(Y+88)+"rpx",paddingTop:Number(Y+88)+"rpx"}])},{default:i((()=>[p(t,{class:"header-bg"},{default:i((()=>[p(t,{class:"bg"})])),_:1}),p(t,{class:"score-box ss-flex-col ss-row-center ss-col-center"},{default:i((()=>[p(t,{class:"ss-m-b-30"},{default:i((()=>[p(s,{class:"all-title ss-m-r-8"},{default:i((()=>[m("当前积分")])),_:1})])),_:1}),p(s,{class:"all-num"},{default:i((()=>[m(_(f($).score||0),1)])),_:1})])),_:1})])),_:1},8,["style"]),p(u,{customNavHeight:f(D)},{default:i((()=>[p(t,{class:"filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between"},{default:i((()=>[p(o,{modelValue:B.data,"onUpdate:modelValue":e[0]||(e[0]=a=>B.data=a),type:"daterange",onChange:F,end:B.today},{default:i((()=>[p(l,{class:"ss-reset-button date-btn"},{default:i((()=>[p(s,null,{default:i((()=>[m(_(f(z)),1)])),_:1}),p(s,{class:"cicon-drop-down ss-seldate-icon"})])),_:1})])),_:1},8,["modelValue","end"]),p(t,{class:"total-box"},{default:i((()=>[p(t,{class:"ss-m-b-10"},{default:i((()=>[m("总收入￥"+_(B.pagination.income),1)])),_:1}),p(t,null,{default:i((()=>[m("总支出￥"+_(-B.pagination.expense),1)])),_:1})])),_:1})])),_:1}),p(n,{list:q,onChange:E,scrollable:!1,current:B.currentTab},null,8,["current"])])),_:1},8,["customNavHeight"]),p(t,{class:"list-box"},{default:i((()=>[B.pagination.total>0?(r(),d(t,{key:0},{default:i((()=>[(r(!0),b(x,null,y(B.pagination.data,(a=>(r(),d(t,{class:"list-item ss-flex ss-col-center ss-row-between",key:a.id},{default:i((()=>[p(t,{class:"ss-flex-col"},{default:i((()=>[p(t,{class:"name"},{default:i((()=>[m(_(a.event_text)+_(a.memo?"-"+a.memo:""),1)])),_:2},1024),p(t,{class:"time"},{default:i((()=>[m(_(a.createtime),1)])),_:2},1024)])),_:2},1024),a.amount>0?(r(),d(t,{key:0,class:"add"},{default:i((()=>[m("+"+_(parseInt(a.amount)),1)])),_:2},1024)):(r(),d(t,{key:1,class:"minus"},{default:i((()=>[m(_(parseInt(a.amount)),1)])),_:2},1024))])),_:2},1024)))),128))])),_:1})):(r(),d(V,{key:1,text:"暂无数据",icon:"/static/data-empty.png"}))])),_:1}),B.pagination.total>0?(r(),d(H,{key:0,status:B.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:U},null,8,["status"])):v("",!0)])),_:1})}}},[["__scopeId","data-v-3e1bc530"]]);export{Y as default};
