后台接口对接
This commit is contained in:
parent
11184cc189
commit
6fdd9601aa
|
|
@ -2,5 +2,5 @@ export default {
|
||||||
deptId: 101,
|
deptId: 101,
|
||||||
from: 'server',
|
from: 'server',
|
||||||
initPageNum: 1,
|
initPageNum: 1,
|
||||||
initPageSize: 5
|
initPageSize: 50
|
||||||
}
|
}
|
||||||
|
|
@ -9,9 +9,9 @@ export default {
|
||||||
invoke(args) {
|
invoke(args) {
|
||||||
let userInfo = _this.getCurUserInfo();
|
let userInfo = _this.getCurUserInfo();
|
||||||
// request 触发前拼接 url
|
// request 触发前拼接 url
|
||||||
// args.url = 'https://www.opsoul.com' + args.url;
|
args.url = 'https://www.opsoul.com' + args.url;
|
||||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
// args.url = 'http://127.0.0.1:80' + args.url;
|
||||||
args.url = 'http://10.45.137.214:80' + args.url;
|
// args.url = 'http://10.45.110.174:80' + args.url;
|
||||||
if (!args.data) {
|
if (!args.data) {
|
||||||
args.data = {}
|
args.data = {}
|
||||||
}
|
}
|
||||||
|
|
@ -310,6 +310,40 @@ export default {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
// 更新用户信息的方法顺便更新本地缓存
|
||||||
|
if (res[1].data.code === 0) {
|
||||||
|
let userInfo = this.getCurUserInfo();
|
||||||
|
let qryUserInfoRes = await this.qryUserInfo(userInfo.openId);
|
||||||
|
let newUserInfo = {
|
||||||
|
...qryUserInfoRes.data,
|
||||||
|
wxLoginCode: userInfo.wxLoginCode
|
||||||
|
};
|
||||||
|
uni.setStorageSync('userProfile', newUserInfo);
|
||||||
|
}
|
||||||
|
return res[1].data;
|
||||||
|
},
|
||||||
|
async updateWorkerTeam(params = {}) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/worker/team/updateTeam',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res[1].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;
|
return res[1].data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
<view class="flex justify-end align-center">
|
<view class="flex justify-end align-center">
|
||||||
<view v-if="Boolean(member.showEditInput)" :key="member.workerId"
|
<view v-if="Boolean(member.showEditInput)" :key="member.workerId"
|
||||||
class="flex justify-end align-center margin-lr-sm">
|
class="flex justify-end align-center margin-lr-sm">
|
||||||
<input class="radius-input" type="text" :value="member.workerName" placeholder="姓名备注"></input>
|
<input class="radius-input" type="text" v-model="member.workerName" placeholder="姓名备注"></input>
|
||||||
<view class="text-lg margin-left-sm">
|
<view class="text-lg margin-left-sm">
|
||||||
<text class="cuIcon-roundcheckfill text-main-color" :data-index="index"
|
<text class="cuIcon-roundcheckfill text-main-color" :data-index="index"
|
||||||
@click="editNoteName"></text>
|
@click="editWorkerName"></text>
|
||||||
<text class="cuIcon-roundclosefill margin-left-xs" :data-index="index"
|
<text class="cuIcon-roundclosefill margin-left-xs" :data-index="index"
|
||||||
@click="hideEditInput"></text>
|
@click="hideEditInput"></text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -111,17 +111,28 @@
|
||||||
this.$set(this.members, curIndex, Object.assign(this.members[curIndex], {
|
this.$set(this.members, curIndex, Object.assign(this.members[curIndex], {
|
||||||
showEditInput: true
|
showEditInput: true
|
||||||
}))
|
}))
|
||||||
console.log(this.members)
|
|
||||||
},
|
},
|
||||||
hideEditInput(e) {
|
hideEditInput(e) {
|
||||||
let curIndex = e.currentTarget.dataset.index;
|
let curIndex = e.currentTarget.dataset.index;
|
||||||
this.$set(this.members, curIndex, Object.assign(this.members[curIndex], {
|
this.$set(this.members, curIndex, Object.assign(this.members[curIndex], {
|
||||||
showEditInput: false
|
showEditInput: false
|
||||||
}))
|
}))
|
||||||
console.log(this.members)
|
|
||||||
},
|
},
|
||||||
editNoteName(e) {
|
async editWorkerName(e) {
|
||||||
this.hideEditInput(e);
|
let curIndex = e.currentTarget.dataset.index;
|
||||||
|
let memberInfo = this.members[curIndex];
|
||||||
|
let res = await this.$request.updateWorkerTeam({
|
||||||
|
workerTeamId: memberInfo.workerTeamId,
|
||||||
|
workerName: memberInfo.workerName
|
||||||
|
});
|
||||||
|
if (res.code === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '修改成功',
|
||||||
|
icon: 'success',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
this.hideEditInput(e);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
makePhoneCall(e) {
|
makePhoneCall(e) {
|
||||||
let phoneNum = e.currentTarget.dataset.phone;
|
let phoneNum = e.currentTarget.dataset.phone;
|
||||||
|
|
@ -139,7 +150,8 @@
|
||||||
title: '保存成功',
|
title: '保存成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
});
|
||||||
|
this.reloadData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async inviteMaster(params) {
|
async inviteMaster(params) {
|
||||||
|
|
|
||||||
|
|
@ -1,81 +1,124 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view class="margin-bottom-lg">
|
||||||
<!-- 顶部操作条 -->
|
<!-- 顶部操作条 -->
|
||||||
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
||||||
<block slot="backText">返回</block>
|
<block slot="backText">返回</block>
|
||||||
<block slot="content">我的钱包</block>
|
<block slot="content">我的钱包</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="margin-sm shadow-warp">
|
<view class="margin-sm shadow-warp">
|
||||||
<view class="padding-tb-lg padding-lr bg-gradual-color light">
|
<view class="padding-tb-lg padding-lr bg-gradual-color light">
|
||||||
<view>账户余额(元)</view>
|
<view>账户余额(元)</view>
|
||||||
<view class="flex justify-between margin-top-sm">
|
<view class="flex justify-between margin-top-sm">
|
||||||
<view class="text-xxl">{{myMoneyBag.balance}}</view>
|
<!-- <view class="text-xxl">{{myMoneyBag.balance}}</view> -->
|
||||||
<view class="cu-btn bg-white radius">充值</view>
|
<view class="text-xxl">--</view>
|
||||||
</view>
|
<view class="cu-btn bg-white radius">充值</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding bg-white flex justify-between">
|
</view>
|
||||||
<view>可提现金额:<text class="text-price text-black">{{myMoneyBag.balanceToExtract}}</text></view>
|
<view class="padding bg-white flex justify-between">
|
||||||
<view>
|
<!-- <view>可提现金额:<text class="text-price text-black">{{myMoneyBag.balanceToExtract}}</text></view> -->
|
||||||
<text>提现</text>
|
<view>可提现金额:<text class="text-price text-black">--</text></view>
|
||||||
<text class="cuIcon-right"></text>
|
<view>
|
||||||
</view>
|
<text>提现</text>
|
||||||
</view>
|
<text class="cuIcon-right"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-bottom-lg">
|
</view>
|
||||||
<view v-for="(billItem, index) in myMoneyBag.bill">
|
</view>
|
||||||
<uni-collapse v-model="openStatusArr[index]">
|
<uni-collapse v-model="openStatusArr[index]" ref="collapse" v-for="(billItem, index) in bill">
|
||||||
<uni-collapse-item>
|
<uni-collapse-item>
|
||||||
<template v-slot:title>
|
<template v-slot:title>
|
||||||
<view class="padding bg-white">
|
<view class="padding bg-white" :data-index="index" @click="showStatement">
|
||||||
<view class="margin-bottom-xs">{{billItem.duration}}</view>
|
<view class="margin-bottom-xs">{{billItem.createTime}}</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="margin-right"><text>支出:</text><text class="text-price text-black">{{billItem.outgoings}}</text></text>
|
<text class="margin-right"><text>支出:</text><text
|
||||||
<text><text>收入:</text><text class="text-price text-black">{{billItem.income}}</text></text>
|
class="text-price text-black">{{billItem.payCount}}</text></text>
|
||||||
</view>
|
<text><text>收入:</text><text
|
||||||
</view>
|
class="text-price text-black">{{billItem.incomeCount}}</text></text>
|
||||||
</template>
|
</view>
|
||||||
<view>
|
</view>
|
||||||
<view v-for="(item, index1) in billItem.statement" class="bg-white padding flex justify-between align-center" @click="showDetail">
|
</template>
|
||||||
<view>
|
<view>
|
||||||
<view class="margin-bottom-xs">{{item.name}}</view>
|
<view v-for="(item, index1) in billItem.statement"
|
||||||
<view>{{item.createTime}}</view>
|
class="bg-white padding flex justify-between align-center" @click="showDetail">
|
||||||
</view>
|
<view>
|
||||||
<view class="text-price text-black">{{item.inOutMoney}}</view>
|
<view class="margin-bottom-xs" v-if="item.financialDetailType == 1">师傅转派</view>
|
||||||
</view>
|
<view class="margin-bottom-xs" v-else-if="item.financialDetailType == 2">多级分销</view>
|
||||||
</view>
|
<view class="margin-bottom-xs" v-else-if="item.financialDetailType == 3">平台抽成</view>
|
||||||
</uni-collapse-item>
|
<view>{{item.createTime}}</view>
|
||||||
</uni-collapse>
|
</view>
|
||||||
</view>
|
<view class="text-price text-black">{{item.payMoney}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</uni-collapse-item>
|
||||||
|
</uni-collapse>
|
||||||
<script>
|
</view>
|
||||||
export default {
|
</template>
|
||||||
data() {
|
|
||||||
return {
|
<script>
|
||||||
openStatusArr: [['0']], //0打开,1收起
|
export default {
|
||||||
myMoneyBag: {}
|
data() {
|
||||||
}
|
return {
|
||||||
},
|
openStatusArr: [], //0打开,1收起
|
||||||
onLoad() {
|
myMoneyBag: {},
|
||||||
this.loadData();
|
bill: []
|
||||||
},
|
}
|
||||||
methods: {
|
},
|
||||||
async loadData() {
|
onLoad() {
|
||||||
this.myMoneyBag = await this.$api.data('myMoneyBag');
|
this.loadData();
|
||||||
for(let i = 0; i < this.myMoneyBag.bill.length - 1; i++) {
|
},
|
||||||
this.openStatusArr.concat(['1']);
|
methods: {
|
||||||
}
|
async loadData() {
|
||||||
},
|
this.myMoneyBag = await this.$api.data('myMoneyBag');
|
||||||
showDetail() {
|
|
||||||
uni.navigateTo({
|
// 查询账单
|
||||||
url: '/pages/my/statement-desc'
|
let billRes = await this.$request.qryFinancialCount();
|
||||||
})
|
this.bill = billRes.data;
|
||||||
}
|
for (let i = 0; i < this.bill.length; i++) {
|
||||||
},
|
this.openStatusArr.push('1');
|
||||||
}
|
}
|
||||||
</script>
|
},
|
||||||
|
async showStatement(e) {
|
||||||
<style>
|
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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue