pages-user-wallet-money.ab25d6ac.js 4.8 KB

1
  1. import{s as a,v as t,c as e,o as s,aw as o,x as l,e as n,f as i,w as r,ax as c,_ as u,l as d,j as m,p,z as f,t as _,u as y,g,k as b,r as w,F as x,B as h,i as j,D as k,C as M,m as S}from"./index-9880b451.js";import{_ as T}from"./uni-datetime-picker.df7514bc.js";import{_ as v}from"./su-tabs.1ce39404.js";import{_ as C}from"./su-sticky.84aef901.js";import{_ as Y}from"./s-empty.74111684.js";import{_ as $}from"./uni-load-more.aac4524a.js";import{_ as z}from"./s-layout.dfc5b0b5.js";import{f as N}from"./useGoods.bdd1c2ea.js";import{r as W}from"./index.df38848e.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css */const I=D({__name:"money",setup(D){h((a=>({"6a9557b6":y(I)})));const I=a.$url.css("/static/img/shop/user/wallet_card_bg.png"),V=t({showMoney:!1,date:[],currentTab:0,pagination:{list:[],total:0,pageNo:1,pageSize:8},summary:{totalIncome:0,totalExpense:0},loadStatus:"",today:""}),B=[{name:"全部",value:""},{name:"收入",value:"1"},{name:"支出",value:"2"}],E=e((()=>a.$store("user").userWallet)),F=e((()=>V.date[0]===V.date[1]?V.date[0]:V.date.join("~")));async function G(){V.loadStatus="loading";const{data:a,code:t}=await c.getWalletTransactionPage({pageNo:V.pagination.pageNo,pageSize:V.pagination.pageSize,type:B[V.currentTab].value,"createTime[0]":V.date[0]+" 00:00:00","createTime[1]":V.date[1]+" 23:59:59"});0===t&&(V.pagination.list=u.concat(V.pagination.list,a.list),V.pagination.total=a.total,V.loadStatus=V.pagination.list.length<V.pagination.total?"more":"noMore")}async function P(){const{data:a,code:t}=await c.getWalletTransactionSummary({createTime:[V.date[0]+" 00:00:00",V.date[1]+" 23:59:59"]});0===t&&(V.summary=a)}function U(a){V.currentTab=a.index,W(V.pagination),G(),P()}function Z(a){V.date[0]=a[0],V.date[1]=a[a.length-1],W(V.pagination),G(),P()}return s((()=>{V.today=o().format("YYYY-MM-DD"),V.date=[V.today,V.today],G(),P(),a.$store("user").getWallet()})),l((()=>{"noMore"!==V.loadStatus&&(V.pagination.pageNo++,G())})),(t,e)=>{const s=j,o=k,l=M,c=d(S("uni-datetime-picker"),T),u=d(S("su-tabs"),v),h=d(S("su-sticky"),C),W=d(S("s-empty"),Y),D=d(S("uni-load-more"),$),I=d(S("s-layout"),z);return n(),i(I,{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=>V.showMoney=!V.showMoney),class:f(["ss-eye-icon",V.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(_(V.showMoney?y(N)(y(E).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:V.data,"onUpdate:modelValue":e[2]||(e[2]=a=>V.data=a),type:"daterange",onChange:Z,end:V.today},{default:r((()=>[m(o,{class:"ss-reset-button date-btn"},{default:r((()=>[m(l,null,{default:r((()=>[p(_(y(F)),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)(V.summary.totalIncome)),1)])),_:1}),m(s,null,{default:r((()=>[p("总支出¥"+_(y(N)(V.summary.totalExpense)),1)])),_:1})])),_:1})])),_:1}),m(u,{list:B,onChange:U,scrollable:!1,current:V.currentTab},null,8,["current"])])),_:1}),0===V.pagination.total?(n(),i(W,{key:0,text:"暂无数据",icon:"/static/data-empty.png"})):g("",!0),V.pagination.total>0?(n(),i(s,{key:1},{default:r((()=>[(n(!0),b(x,null,w(V.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(V.createTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:2},1024)])),_:2},1024)))),128))])),_:1})):g("",!0),V.pagination.total>0?(n(),i(D,{key:2,status:V.loadStatus,"content-text":{contentdown:"上拉加载更多"}},null,8,["status"])):g("",!0)])),_:1})}}},[["__scopeId","data-v-71409acb"]]);export{I as default};