diff --git a/commons/js/config.js b/commons/js/config.js index 5abaa49..c35d060 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -121,6 +121,7 @@ api = { appBizSituation_tabs: 'app/biz/situation_tabs', //店铺概况_tab appBizSituation: 'app/biz/situation', //店铺概况 /店铺概况保存 appBizStreet: 'app/biz/street', //获取乡镇 + appBizAccountLogs: 'app/bizAccountLog/lists', //获取店铺充值日志 appCusorderV2Inten: 'app/cusorderV2/inten', //新增意向金订单 appCusorderV2: 'app/cusorderV2', //新建订单 /获取订单列表 /订单详情 /修改订单信息 diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index 5b16d8a..70977c6 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -1106,4 +1106,10 @@ apiQuery.putAppCluesLock = function (params) { HttpRequest(true, Config.api.appCluesLock, 2, params, "PUT", resolve, reject) }) } +//店铺充值记录 +apiQuery.getBizAccountLogs = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appBizAccountLogs, 2, params, "GET", resolve, reject) + }) +} export default apiQuery; \ No newline at end of file diff --git a/pages/customer/score/index.js b/pages/customer/score/index.js index 75ef0d4..f2bb8f7 100644 --- a/pages/customer/score/index.js +++ b/pages/customer/score/index.js @@ -10,31 +10,35 @@ Page({ imgUrl: _.config.imgUrl, cur_month: '', cur_tab_index: 0, - tab_list: [ - { + tab_list: [{ name: '全部', - id: 1 + id: 0 }, { name: '充值', - id: 2 + id: 1 }, { name: '消耗', - id: 3 + id: 2 } ], + pageNo: 1, list: [], loading: true, end: false, - noData: false + noData: false, + sumRechangeMoney: 0, + sumUseMoney: 0, + leftMoney: 0, + size: 20 }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.getBizAccountLog(); }, /** @@ -76,7 +80,8 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom() { - + if (this.data.noData || this.data.end || !this.data.load) return; + this.getBizAccountLog() }, /** @@ -86,9 +91,75 @@ Page({ }, - bindDateChange(e){ + bindDateChange(e) { this.setData({ - cur_month: e.detail.value + cur_month: e.detail.value, + pageNo: 1, + list: [], + noData: false, + end: false, + load: true, + loading: false }) + this.getBizAccountLog(); + }, + //切换tab + changeTab(e) { + this.setData({ + cur_tab_index: e.currentTarget.dataset.index, + pageNo: 1, + list: [], + noData: false, + end: false, + load: true, + loading: false + }) + this.getBizAccountLog(); + }, + //推送链接 + pushLink(e) { + if (e.currentTarget.dataset.url) { + _.$router.openUrlScheme(e.currentTarget.dataset.url) + } + }, + getBizAccountLog() { + this.setData({ + load: false, + loading: true, + }) + + let params = {}; + params['page'] = this.data.pageNo; + params['size'] = this.data.size; + params['type'] = this.data.tab_list[this.data.cur_tab_index]['id'] + if (this.data.cur_month) { + params['month'] = this.data.cur_month + } + _.apiQuery.getBizAccountLogs(params).then(res => { + if (this.data.pageNo == 1) { + this.setData({ + sumRechangeMoney: res.data.sumRecharge, + sumUseMoney: res.data.sumUseMoney, + leftMoney:res.data.leftMoney + }) + } + this.setData({ + total: res.data.total, + pageNo: this.data.pageNo + 1, + list: this.data.list.concat(res.data.list), + load: true, + loading: false, + }) + if (res.data.total == 0) { + this.setData({ + noData: true + }) + } else if (this.data.list.length == res.data.total) { + this.setData({ + end: true + }) + } + wx.stopPullDownRefresh() + }); } }) \ No newline at end of file diff --git a/pages/customer/score/index.wxml b/pages/customer/score/index.wxml index efd81cc..656b356 100644 --- a/pages/customer/score/index.wxml +++ b/pages/customer/score/index.wxml @@ -1,52 +1,53 @@ - 8082 + {{leftMoney}} 余额 - 8593 + {{sumRechangeMoney}} 充值 - 8593 + {{sumUseMoney}} 消耗 - + {{cur_month||'请选择月份'}} - + - {{item.name}} + {{item.name}} - + - {{'+40'}} - {{'L:138****1234'}} - {{'2025.02.25'}} + {{item.money}} + {{item.content}} + {{item.time}} - + + + 立即充值 + + - - - - + + + + \ No newline at end of file diff --git a/pages/customer/score/recharge.js b/pages/customer/score/recharge.js index e9a2d07..1f82937 100644 --- a/pages/customer/score/recharge.js +++ b/pages/customer/score/recharge.js @@ -65,6 +65,13 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage() { - + }, + //充值 + rechange(){ + wx.showToast({ + title: '系统维护中', + icon: 'none', + duration: 2000 + }) } }) \ No newline at end of file diff --git a/pages/customer/score/recharge.wxml b/pages/customer/score/recharge.wxml index 0e80428..adc1616 100644 --- a/pages/customer/score/recharge.wxml +++ b/pages/customer/score/recharge.wxml @@ -11,7 +11,7 @@ 充值金额¥20000 - +