账单开发,选品广场接口对接
This commit is contained in:
parent
f4181b6dfa
commit
0297de1f53
|
|
@ -681,5 +681,13 @@ export default {
|
|||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async addCustomerSelection(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/customer/selection/app/add',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,11 @@
|
|||
},
|
||||
// searchGoods(e) {
|
||||
// uni.$emit(this.$globalFun.VERTICAL_NAV_SEARCH, e.detail.value);
|
||||
// }
|
||||
// }
|
||||
clearChosenItem() {
|
||||
this.chosenCategoryIds = [];
|
||||
uni.$emit(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chosenCategoryIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@
|
|||
"path": "withdraw"
|
||||
}, {
|
||||
"path": "b-account-bind"
|
||||
}, {
|
||||
"path": "my-money-bag"
|
||||
}]
|
||||
}, {
|
||||
"root":"pages/publish/",
|
||||
|
|
|
|||
|
|
@ -5,40 +5,27 @@
|
|||
<block slot="backText">返回</block>
|
||||
<block slot="content">我的钱包</block>
|
||||
</cu-custom>
|
||||
<view class="margin-sm shadow-warp">
|
||||
<view class="padding-tb-lg padding-lr bg-gradual-color light">
|
||||
<view>账户余额(元)</view>
|
||||
<view class="flex justify-between margin-top-sm">
|
||||
<!-- <view class="text-xxl">{{myMoneyBag.balance}}</view> -->
|
||||
<view class="text-xxl">--</view>
|
||||
</view>
|
||||
<view v-if="bindBankCard && bindBankCard.bankNum" class="flex justify-end margin-top-sm align-center">
|
||||
<view class="margin-lr-sm text-lg">{{bindBankCard.encodeBankNum}}</view>
|
||||
<view class="cu-btn bg-white radius" @click="bindBankAccount">账户另绑</view>
|
||||
</view>
|
||||
<view v-else class="flex justify-end margin-top-sm align-center">
|
||||
<view class="cu-btn bg-white radius" @click="bindBankAccount">账户绑定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-collapse v-model="openStatusArr[index]" ref="collapse" v-for="(billItem, index) in bill">
|
||||
<uni-collapse-item>
|
||||
<template v-slot:title>
|
||||
<view class="padding bg-white" :data-index="index" @click="showStatement">
|
||||
<view class="margin-bottom-xs">{{billItem.createTime}}</view>
|
||||
<view>
|
||||
<text class="margin-right"><text>支出:</text><text class="text-price text-black">{{billItem.payCount}}</text></text>
|
||||
<text><text>收入:</text><text class="text-price text-black">{{billItem.incomeCount}}</text></text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view>
|
||||
<view v-for="(item, index1) in billItem.statement" class="bg-white padding flex justify-between align-center" @click="showDetail(bill[index].statement[index1])">
|
||||
<view v-for="(item, index1) in billItem.statement"
|
||||
class="bg-white padding flex justify-between align-center solid-bottom" @click="showDetail(bill[index].statement[index1])">
|
||||
<view>
|
||||
<view class="margin-bottom-xs" v-if="item.financialDetailType == 1">师傅转派</view>
|
||||
<view class="margin-bottom-xs" v-else-if="item.financialDetailType == 2">多级分销</view>
|
||||
<view class="margin-bottom-xs" v-else-if="item.financialDetailType == 3">平台抽成</view>
|
||||
<view>{{item.createTime}}</view>
|
||||
<view class="flex">
|
||||
<view class="margin-right-sm">提现单号:{{item.code}}</view>
|
||||
<view class="text-gray">
|
||||
<view class="margin-bottom-xs" v-if="item.financialDetailType == 3">分销金额</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-gray">{{item.createTime}}</view>
|
||||
</view>
|
||||
<view class="text-price text-black">{{item.payMoney}}</view>
|
||||
</view>
|
||||
|
|
@ -53,43 +40,25 @@
|
|||
data() {
|
||||
return {
|
||||
openStatusArr: [], //0打开,1收起
|
||||
myMoneyBag: {},
|
||||
curUserInfo: {},
|
||||
bindBankCard: null,
|
||||
bill: []
|
||||
bill: [],
|
||||
curUserInfo: {}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
},
|
||||
onShow() {
|
||||
this.reloadData();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
this.myMoneyBag = await this.$api.data('myMoneyBag');
|
||||
// 查询账单
|
||||
let billRes = await this.$request.qryFinancialCount();
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
let billRes = await this.$request.qryFinancialCount({
|
||||
financialDetailTypes: [3],
|
||||
workerId: this.curUserInfo.customerId
|
||||
});
|
||||
this.bill = billRes.data;
|
||||
for (let i = 0; i < this.bill.length; i++) {
|
||||
this.openStatusArr.push('1');
|
||||
}
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.loadBindBankCard();
|
||||
uni.showToast({
|
||||
title: '功能开发中,暂无法使用',
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
async reloadData() {
|
||||
this.loadBindBankCard();
|
||||
},
|
||||
async loadBindBankCard() {
|
||||
let res = await this.$request.getBindBankCardByCustomerId({
|
||||
customerId: this.curUserInfo.customerId
|
||||
});
|
||||
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;
|
||||
|
|
@ -110,11 +79,10 @@
|
|||
})
|
||||
let res = await this.$request.qryFinancialDetail({
|
||||
beginTime: createTimeStr,
|
||||
endTime: finishTimeStr
|
||||
endTime: finishTimeStr,
|
||||
financialDetailTypes: [3],
|
||||
payeeId: this.curUserInfo.customerId
|
||||
});
|
||||
// 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;
|
||||
|
|
@ -130,11 +98,6 @@
|
|||
uni.navigateTo({
|
||||
url: '/pages/my/statement-desc?statementDesc=' + encodeURIComponent(JSON.stringify(item))
|
||||
})
|
||||
},
|
||||
bindBankAccount() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/b-arrive-bind'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,14 +89,14 @@
|
|||
<view class="margin-right">
|
||||
<view class="margin-bottom-sm">
|
||||
<text class="margin-right-xs">全选</text>
|
||||
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 0"
|
||||
@click="changeAgreeShield(0)">
|
||||
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
|
||||
@click="changeAgreeShield(1)">
|
||||
</checkbox>
|
||||
</view>
|
||||
<view>
|
||||
<text class="margin-right-xs">反选</text>
|
||||
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
|
||||
@click="changeAgreeShield(1)">
|
||||
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 2"
|
||||
@click="changeAgreeShield(2)">
|
||||
</checkbox>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
</view>
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action margin-0 flex-sub text-black" @tap="hideModal">取消</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left"
|
||||
@click="confirmShield">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
<view class="cuIcon-roundclosefill"></view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="DrawerWindow bg-gray" :class="modalName=='categoryModal'?'show':''">
|
||||
<multiselect-vertical-nav :list="categoryList" :containerHeight="'calc(100vh - 200rpx)'"></multiselect-vertical-nav>
|
||||
<multiselect-vertical-nav ref="multiSelectNav" :list="categoryList" :containerHeight="'calc(100vh - 200rpx)'"></multiselect-vertical-nav>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -160,10 +160,12 @@
|
|||
code: '',
|
||||
name: '组建/审批区域团队'
|
||||
}],
|
||||
agreeShield: 0,
|
||||
agreeShield: 1,
|
||||
modalName: null,
|
||||
categoryList: [],
|
||||
chosenCategoryIds: []
|
||||
chosenCategoryIds: [],
|
||||
allLevel3CategoryIds: [],
|
||||
curUserInfo: {}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
|
@ -201,12 +203,27 @@
|
|||
this.categoryList = this.categoryList.concat(firstCategory.child)
|
||||
}
|
||||
})
|
||||
|
||||
// 遍历得到所有的第三级类目
|
||||
this.getTargetLevelCategory(res, 3, this.allLevel3CategoryIds);
|
||||
},
|
||||
async getTargetLevelCategory(list ,level, res = []) {
|
||||
list.forEach(item => {
|
||||
if (item.level !== level) {
|
||||
if (item.child && item.child.length) {
|
||||
this.getTargetLevelCategory(item.child, level, res);
|
||||
}
|
||||
} else {
|
||||
res.push(item.goodsCategoryId);
|
||||
}
|
||||
})
|
||||
},
|
||||
showModal(modalName) {
|
||||
this.modalName = modalName;
|
||||
},
|
||||
hideModal() {
|
||||
this.modalName = null
|
||||
this.modalName = null;
|
||||
this.$refs.multiSelectNav.clearChosenItem();
|
||||
},
|
||||
bindEvent() {
|
||||
uni.$on(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.tmpChooseCategory);
|
||||
|
|
@ -234,13 +251,53 @@
|
|||
}
|
||||
},
|
||||
changeAgreeShield(agreeShield) {
|
||||
this.agreeShield = agreeShield;
|
||||
this.agreeShield = agreeShield;
|
||||
this.$refs.multiSelectNav.clearChosenItem();
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请重新进行逐条选品'
|
||||
})
|
||||
},
|
||||
tmpChooseCategory(chosenCategoryIds) {
|
||||
this.chosenCategoryIds = chosenCategoryIds;
|
||||
console.log("chosenCategoryIds=" + JSON.stringify(this.chosenCategoryIds))
|
||||
},
|
||||
confirmShield(e) {},
|
||||
async confirmShield(e) {
|
||||
if (this.agreeShield === 2 && this.chosenCategoryIds.length === 0) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请至少选择一个类目'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let chosenCategoryIds = this.chosenCategoryIds;
|
||||
if (this.agreeShield === 1 && this.chosenCategoryIds.length === 0) {
|
||||
// 全选,带上所有的类目id
|
||||
chosenCategoryIds = this.allLevel3CategoryIds;
|
||||
}
|
||||
let res = await this.$request.addCustomerSelection({
|
||||
customerId: this.curUserInfo.customerId,
|
||||
deptCategoryIds: chosenCategoryIds,
|
||||
selectionType: this.agreeShield
|
||||
});
|
||||
if (res && res.code === 0) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '设置成功'
|
||||
})
|
||||
this.hideModal();
|
||||
} else if (res && res.msg){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.msg,
|
||||
duration: 2000
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '设置失败'
|
||||
})
|
||||
}
|
||||
},
|
||||
showCertificationForm() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/Certification'
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@
|
|||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
<text class="text-gray">详情说明:</text>
|
||||
<text v-if="statementDesc.remark">{{statementDesc.remark}}</text>
|
||||
<!-- <text v-if="statementDesc.remark">{{statementDesc.remark}}</text> -->
|
||||
<text v-if="statementDesc.financialDetailType == 0">结单金额</text>
|
||||
<text v-else-if="statementDesc.financialDetailType == 1">大师傅/店铺提成金额</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
<text class="text-gray">到帐备注:</text>
|
||||
|
|
@ -30,19 +32,19 @@
|
|||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
<text class="text-gray">提现单号:</text>
|
||||
<text v-if="statementDesc.extractCode">{{statementDesc.extractCode}}</text>
|
||||
<text v-if="statementDesc.code">{{statementDesc.code}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
<text class="text-gray">发起时间:</text>
|
||||
<text v-if="statementDesc.payTime">{{statementDesc.payTime}}</text>
|
||||
<text v-if="statementDesc.updateTime">{{statementDesc.updateTime}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
<!-- <view class="margin-bottom-sm">
|
||||
<text class="text-gray">订单编号:</text>
|
||||
<text v-if="statementDesc.orderDetailCode">{{statementDesc.orderDetailCode}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="margin-bottom-sm">
|
||||
<text class="text-gray">订单时间:</text>
|
||||
<text v-if="statementDesc.orderCreateTime">{{statementDesc.orderCreateTime}}</text>
|
||||
<text v-if="statementDesc.createTime">{{statementDesc.createTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 操作按钮 -->
|
||||
<!-- <view class="margin-lr">
|
||||
<button class="cu-btn lg bg-main-color long-btn shadow-blur" @click="withdraw">提现</button>
|
||||
</view> -->
|
||||
<view class="margin-lr">
|
||||
<button class="cu-btn lg line-main-color long-btn shadow-blur" @click="showFinanalDetails">分销明细</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -140,8 +140,10 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
withdraw() {
|
||||
|
||||
showFinanalDetails() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/my-money-bag'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue