diff --git a/common/js/request.js b/common/js/request.js
index 1a4aca2..b6c62cf 100644
--- a/common/js/request.js
+++ b/common/js/request.js
@@ -6,8 +6,8 @@ export default {
uni.addInterceptor('request', {
invoke(args) {
// request 触发前拼接 url
- // args.url = 'https://www.opsoul.com' + args.url;
- args.url = 'http://10.45.137.214:80' + args.url;
+ args.url = 'https://www.opsoul.com' + args.url;
+ // args.url = 'http://10.45.137.214:80' + args.url;
// args.url = 'http://127.0.0.1:80' + args.url;
if (args.data) {
args.data.deptId = globalData.deptId;
@@ -344,5 +344,21 @@ export default {
data: params
})
return res[1].data.data;
+ },
+ async qryFinancialCount(params = {}) {
+ let res = await uni.request({
+ url: '/financial/detail/count',
+ method: 'POST',
+ data: params
+ })
+ return res[1].data;
+ },
+ async qryFinancialDetail(params = {}) {
+ let res = await uni.request({
+ url: '/financial/detail/list',
+ method: 'POST',
+ data: params
+ })
+ return res[1].data;
}
}
diff --git a/pages/my/my-money-bag.vue b/pages/my/my-money-bag.vue
index 0c5c9b9..06694a5 100644
--- a/pages/my/my-money-bag.vue
+++ b/pages/my/my-money-bag.vue
@@ -1,5 +1,5 @@
-
+
返回
@@ -9,7 +9,8 @@
账户余额(元)
- {{myMoneyBag.balance}}
+
+ --
{{bindBankCard.encodeBankNum}}
@@ -20,32 +21,30 @@
-
-
-
-
-
-
- {{billItem.duration}}
-
- 支出:{{billItem.outgoings}}
- 收入:{{billItem.income}}
-
-
-
+
+
+
+
+ {{billItem.createTime}}
-
-
- {{item.name}}
- {{item.createTime}}
-
- {{item.inOutMoney}}
-
+ 支出:{{billItem.payCount}}
+ 收入:{{billItem.incomeCount}}
-
-
-
-
+
+
+
+
+
+ 师傅转派
+ 多级分销
+ 平台抽成
+ {{item.createTime}}
+
+ {{item.payMoney}}
+
+
+
+
@@ -53,10 +52,11 @@
export default {
data() {
return {
- openStatusArr: [['0']], //0打开,1收起
+ openStatusArr: [], //0打开,1收起
myMoneyBag: {},
curUserInfo: {},
- bindBankCard: null
+ bindBankCard: null,
+ bill: []
}
},
onLoad() {
@@ -68,8 +68,11 @@
methods: {
async loadData() {
this.myMoneyBag = await this.$api.data('myMoneyBag');
- for(let i = 0; i < this.myMoneyBag.bill.length - 1; i++) {
- this.openStatusArr.concat(['1']);
+ // 查询账单
+ let billRes = await this.$request.qryFinancialCount();
+ this.bill = billRes.data;
+ for (let i = 0; i < this.bill.length; i++) {
+ this.openStatusArr.push('1');
}
this.curUserInfo = this.$request.getCurUserInfo();
this.loadBindBankCard();
@@ -84,6 +87,41 @@
this.bindBankCard = res.data;
this.bindBankCard.encodeBankNum = '****' + this.bindBankCard.bankNum.substring(this.bindBankCard.bankNum.length - 4);
},
+ async showStatement(e) {
+ let curIndex = e.currentTarget.dataset.index;
+ // 1为缩起状态,0为展开状态
+ if (this.openStatusArr[curIndex] == '1' && !this.bill[curIndex].statement) {
+ let createTime = new Date(new Date(this.bill[curIndex].createTime).setHours(0));
+ let createMonth = createTime.getMonth() + 1;
+ let createYear = createTime.getFullYear();
+ let finishYear = createMonth === 12 ? createYear + 1 : createYear;
+ let finishMonth = createMonth === 12 ? 1 : createMonth + 1;
+
+ let createTimeStr = createYear + '-' + createMonth + '-1 00:00:00';
+ let finishTimeStr = finishYear + '-' + finishMonth + '-1 00:00:00';
+
+ uni.showLoading({
+ mask: true,
+ title: '加载中'
+ })
+ let res = await this.$request.qryFinancialDetail({
+ beginTime: createTimeStr,
+ endTime: finishTimeStr
+ });
+ // let newStatements = this.statements.concat();
+ // newStatements[curIndex] = res.rows;
+ // this.statements = newStatements;
+ let newBill = this.bill.concat();
+ newBill[curIndex].statement = res.rows;
+ this.bill = newBill;
+ // #ifdef MP
+ this.$nextTick(() => {
+ this.$refs.collapse[curIndex].resize();
+ uni.hideLoading();
+ })
+ // #endif
+ }
+ },
showDetail() {
uni.navigateTo({
url: '/pages/my/statement-desc'