money.js 4.8 KB

1
  1. "use strict";const e=require("../../../common/vendor.js"),t=require("../../../sheep/index.js"),a=require("../../../sheep/api/pay/wallet.js"),s=require("../../../sheep/hooks/useGoods.js"),r=require("../../../sheep/util/index.js");if(require("../../../sheep/url/index.js"),require("../../../sheep/store/index.js"),require("../../../sheep/store/app.js"),require("../../../sheep/api/promotion/diy.js"),require("../../../sheep/request/index.js"),require("../../../sheep/config/index.js"),require("../../../sheep/platform/index.js"),require("../../../sheep/platform/provider/wechat/index.js"),require("../../../sheep/platform/provider/wechat/miniProgram.js"),require("../../../sheep/api/member/auth.js"),require("../../../sheep/api/member/social.js"),require("../../../sheep/api/member/user.js"),require("../../../sheep/platform/provider/apple/index.js"),require("../../../sheep/platform/share.js"),require("../../../sheep/router/index.js"),require("../../../sheep/hooks/useModal.js"),require("../../../sheep/helper/index.js"),require("../../../sheep/helper/test.js"),require("../../../sheep/helper/digit.js"),require("../../../sheep/api/member/signin.js"),require("../../../sheep/helper/throttle.js"),require("../../../sheep/platform/pay.js"),require("../../../sheep/api/pay/order.js"),require("../../../sheep/store/user.js"),require("../../../sheep/store/cart.js"),require("../../../sheep/api/trade/cart.js"),require("../../../sheep/api/trade/order.js"),require("../../../sheep/api/promotion/coupon.js"),require("../../../sheep/store/sys.js"),require("../../../sheep/store/modal.js"),require("../../../sheep/config/zIndex.js"),!Array){(e.resolveComponent("uni-datetime-picker")+e.resolveComponent("su-tabs")+e.resolveComponent("su-sticky")+e.resolveComponent("s-empty")+e.resolveComponent("uni-load-more")+e.resolveComponent("s-layout"))()}Math||((()=>"../../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js")+(()=>"../../../sheep/ui/su-tabs/su-tabs.js")+(()=>"../../../sheep/ui/su-sticky/su-sticky.js")+(()=>"../../../sheep/components/s-empty/s-empty.js")+(()=>"../../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js")+(()=>"../../../sheep/components/s-layout/s-layout.js"))();const o={__name:"money",setup(o){e.useCssVars((t=>({"6a9557b6":e.unref(i)})));const i=t.sheep.$url.css("/static/img/shop/user/wallet_card_bg.png"),n=e.reactive({showMoney:!1,date:[],currentTab:0,pagination:{list:[],total:0,pageNo:1,pageSize:8},summary:{totalIncome:0,totalExpense:0},loadStatus:"",today:""}),p=[{name:"全部",value:""},{name:"收入",value:"1"},{name:"支出",value:"2"}],u=e.computed((()=>t.sheep.$store("user").userWallet)),l=e.computed((()=>n.date[0]===n.date[1]?n.date[0]:n.date.join("~")));async function d(){n.loadStatus="loading";const{data:t,code:s}=await a.PayWalletApi.getWalletTransactionPage({pageNo:n.pagination.pageNo,pageSize:n.pagination.pageSize,type:p[n.currentTab].value,"createTime[0]":n.date[0]+" 00:00:00","createTime[1]":n.date[1]+" 23:59:59"});0===s&&(n.pagination.list=e._.concat(n.pagination.list,t.list),n.pagination.total=t.total,n.loadStatus=n.pagination.list.length<n.pagination.total?"more":"noMore")}async function c(){const{data:e,code:t}=await a.PayWalletApi.getWalletTransactionSummary({createTime:[n.date[0]+" 00:00:00",n.date[1]+" 23:59:59"]});0===t&&(n.summary=e)}function m(e){n.currentTab=e.index,r.resetPagination(n.pagination),d(),c()}function h(e){n.date[0]=e[0],n.date[1]=e[e.length-1],r.resetPagination(n.pagination),d(),c()}return e.onLoad((()=>{n.today=e.dayjs().format("YYYY-MM-DD"),n.date=[n.today,n.today],d(),c(),t.sheep.$store("user").getWallet()})),e.onReachBottom((()=>{"noMore"!==n.loadStatus&&(n.pagination.pageNo++,d())})),(a,r)=>e.e({a:e.o((e=>n.showMoney=!n.showMoney)),b:e.n(n.showMoney?"cicon-eye":"cicon-eye-off"),c:e.t(n.showMoney?e.unref(s.fen2yuan)(u.value.balance):"*****"),d:e.o((a=>e.unref(t.sheep).$router.go("/pages/pay/recharge"))),e:e.t(l.value),f:e.o(h),g:e.o((e=>n.data=e)),h:e.p({type:"daterange",end:n.today,modelValue:n.data}),i:e.t(e.unref(s.fen2yuan)(n.summary.totalIncome)),j:e.t(e.unref(s.fen2yuan)(n.summary.totalExpense)),k:e.o(m),l:e.p({list:p,scrollable:!1,current:n.currentTab}),m:0===n.pagination.total},0===n.pagination.total?{n:e.p({text:"暂无数据",icon:"/static/data-empty.png"})}:{},{o:n.pagination.total>0},n.pagination.total>0?{p:e.f(n.pagination.list,((t,a,r)=>e.e({a:e.t(t.title),b:t.price>=0},t.price>=0?{c:e.t(e.unref(s.fen2yuan)(t.price))}:{d:e.t(e.unref(s.fen2yuan)(t.price))},{e:t.id}))),q:e.t(e.unref(t.sheep).$helper.timeFormat(n.createTime,"yyyy-mm-dd hh:MM:ss"))}:{},{r:n.pagination.total>0},n.pagination.total>0?{s:e.p({status:n.loadStatus,"content-text":{contentdown:"上拉加载更多"}})}:{},{t:e.s(a.__cssVars()),v:e.p({title:"钱包"})})}},i=e._export_sfc(o,[["__scopeId","data-v-71409acb"]]);wx.createPage(i);