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