1 |
- import{s as a,y as t,c as e,o as s,az as o,z as l,e as n,f as i,w as r,bt as c,_ as u,l as d,j as m,t as p,B as f,u as _,v as y,g,k as b,r as w,F as x,D as h,i as j,G as k,E as M,m as v}from"./index-b48a414d.js";import{_ as S}from"./uni-datetime-picker.c2317e65.js";import{_ as T}from"./su-tabs.a383f815.js";import{_ as z}from"./su-sticky.aabc6a00.js";import{_ as $}from"./s-empty.6d3471cc.js";import{_ as C}from"./uni-load-more.647920f4.js";import{f as N,r as W,_ as Y}from"./s-layout.d6dcdc81.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";import"./phone-international-input.feef99c7.js";import"./uni-badge.78cdef34.js";/* empty css */const E=D({__name:"money",setup(D){h((a=>({"6a9557b6":y(E)})));const E=a.$url.css("/static/img/shop/user/wallet_card_bg.png"),I=t({showMoney:!1,date:[],currentTab:0,pagination:{list:[],total:0,pageNo:1,pageSize:8},summary:{totalIncome:0,totalExpense:0},loadStatus:"",today:""}),V=[{name:"全部",value:""},{name:"收入",value:"1"},{name:"支出",value:"2"}],B=e((()=>a.$store("user").userWallet)),F=e((()=>I.date[0]===I.date[1]?I.date[0]:I.date.join("~")));async function G(){I.loadStatus="loading";const{data:a,code:t}=await c.getWalletTransactionPage({pageNo:I.pagination.pageNo,pageSize:I.pagination.pageSize,type:V[I.currentTab].value,"createTime[0]":I.date[0]+" 00:00:00","createTime[1]":I.date[1]+" 23:59:59"});0===t&&(I.pagination.list=u.concat(I.pagination.list,a.list),I.pagination.total=a.total,I.loadStatus=I.pagination.list.length<I.pagination.total?"more":"noMore")}async function A(){const{data:a,code:t}=await c.getWalletTransactionSummary({createTime:[I.date[0]+" 00:00:00",I.date[1]+" 23:59:59"]});0===t&&(I.summary=a)}function J(a){I.currentTab=a.index,W(I.pagination),G(),A()}function P(a){I.date[0]=a[0],I.date[1]=a[a.length-1],W(I.pagination),G(),A()}return s((()=>{I.today=o().format("YYYY-MM-DD"),I.date=[I.today,I.today],G(),A(),a.$store("user").getWallet()})),l((()=>{"noMore"!==I.loadStatus&&(I.pagination.pageNo++,G())})),(t,e)=>{const s=j,o=k,l=M,c=d(v("uni-datetime-picker"),S),u=d(v("su-tabs"),T),h=d(v("su-sticky"),z),W=d(v("s-empty"),$),D=d(v("uni-load-more"),C),E=d(v("s-layout"),Y);return n(),i(E,{class:"wallet-wrap",title:"钱包"},{default:r((()=>[m(s,{class:"header-box ss-flex ss-row-center ss-col-center"},{default:r((()=>[m(s,{class:"card-box ui-BG-Main ui-Shadow-Main"},{default:r((()=>[m(s,{class:"card-head ss-flex ss-col-center"},{default:r((()=>[m(s,{class:"card-title ss-m-r-10"},{default:r((()=>[p("钱包余额(元)")])),_:1}),m(s,{onClick:e[0]||(e[0]=a=>I.showMoney=!I.showMoney),class:f(["ss-eye-icon",I.showMoney?"cicon-eye":"cicon-eye-off"])},null,8,["class"])])),_:1}),m(s,{class:"ss-flex ss-row-between ss-col-center ss-m-t-64"},{default:r((()=>[m(s,{class:"money-num"},{default:r((()=>[p(_(I.showMoney?y(N)(B.value.balance):"*****"),1)])),_:1}),m(o,{class:"ss-reset-button topup-btn",onClick:e[1]||(e[1]=t=>y(a).$router.go("/pages/pay/recharge"))},{default:r((()=>[p(" 充值 ")])),_:1})])),_:1})])),_:1})])),_:1}),m(h,null,{default:r((()=>[m(s,{class:"filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between"},{default:r((()=>[m(c,{modelValue:I.data,"onUpdate:modelValue":e[2]||(e[2]=a=>I.data=a),type:"daterange",onChange:P,end:I.today},{default:r((()=>[m(o,{class:"ss-reset-button date-btn"},{default:r((()=>[m(l,null,{default:r((()=>[p(_(F.value),1)])),_:1}),m(l,{class:"cicon-drop-down ss-seldate-icon"})])),_:1})])),_:1},8,["modelValue","end"]),m(s,{class:"total-box"},{default:r((()=>[m(s,{class:"ss-m-b-10"},{default:r((()=>[p("总收入¥"+_(y(N)(I.summary.totalIncome)),1)])),_:1}),m(s,null,{default:r((()=>[p("总支出¥"+_(y(N)(I.summary.totalExpense)),1)])),_:1})])),_:1})])),_:1}),m(u,{list:V,onChange:J,scrollable:!1,current:I.currentTab},null,8,["current"])])),_:1}),0===I.pagination.total?(n(),i(W,{key:0,text:"暂无数据",icon:"/static/data-empty.png"})):g("",!0),I.pagination.total>0?(n(),i(s,{key:1},{default:r((()=>[(n(!0),b(x,null,w(I.pagination.list,(t=>(n(),i(s,{class:"wallet-list ss-flex border-bottom",key:t.id},{default:r((()=>[m(s,{class:"list-content"},{default:r((()=>[m(s,{class:"title-box ss-flex ss-row-between ss-m-b-20"},{default:r((()=>[m(l,{class:"title ss-line-1"},{default:r((()=>[p(_(t.title),1)])),_:2},1024),m(s,{class:"money"},{default:r((()=>[t.price>=0?(n(),i(l,{key:0,class:"add"},{default:r((()=>[p("+"+_(y(N)(t.price)),1)])),_:2},1024)):(n(),i(l,{key:1,class:"minus"},{default:r((()=>[p(_(y(N)(t.price)),1)])),_:2},1024))])),_:2},1024)])),_:2},1024),m(l,{class:"time"},{default:r((()=>[p(_(y(a).$helper.timeFormat(I.createTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:2},1024)])),_:2},1024)))),128))])),_:1})):g("",!0),I.pagination.total>0?(n(),i(D,{key:2,status:I.loadStatus,"content-text":{contentdown:"上拉加载更多"}},null,8,["status"])):g("",!0)])),_:1})}}},[["__scopeId","data-v-71409acb"]]);export{E as default};
|