diff --git a/common/js/request.js b/common/js/request.js index b308fe3..daad7ed 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -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; } } diff --git a/components/multi-level-nav/multiselect-vertical-nav.vue b/components/multi-level-nav/multiselect-vertical-nav.vue index a01c8d1..6d2bc3a 100644 --- a/components/multi-level-nav/multiselect-vertical-nav.vue +++ b/components/multi-level-nav/multiselect-vertical-nav.vue @@ -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); + } } } diff --git a/pages.json b/pages.json index 6c212c8..6b4f424 100644 --- a/pages.json +++ b/pages.json @@ -52,6 +52,8 @@ "path": "withdraw" }, { "path": "b-account-bind" + }, { + "path": "my-money-bag" }] }, { "root":"pages/publish/", diff --git a/pages/my/my-money-bag.vue b/pages/my/my-money-bag.vue index 8c317ae..409c86b 100644 --- a/pages/my/my-money-bag.vue +++ b/pages/my/my-money-bag.vue @@ -5,40 +5,27 @@ 返回 我的钱包 - - - 账户余额(元) - - - -- - - - {{bindBankCard.encodeBankNum}} - 账户另绑 - - - 账户绑定 - - - - + - 师傅转派 - 多级分销 - 平台抽成 - {{item.createTime}} + + 提现单号:{{item.code}} + + 分销金额 + + + {{item.createTime}} {{item.payMoney}} @@ -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' - }) } }, } diff --git a/pages/my/my-operator.vue b/pages/my/my-operator.vue index 19e78e3..943c1da 100644 --- a/pages/my/my-operator.vue +++ b/pages/my/my-operator.vue @@ -89,14 +89,14 @@ 全选 - + 反选 - + @@ -113,7 +113,7 @@ 取消 - 确定 @@ -124,7 +124,7 @@ - + @@ -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' diff --git a/pages/my/statement-desc.vue b/pages/my/statement-desc.vue index 68aac6b..25d2780 100644 --- a/pages/my/statement-desc.vue +++ b/pages/my/statement-desc.vue @@ -17,7 +17,9 @@ 详情说明: - {{statementDesc.remark}} + + 结单金额 + 大师傅/店铺提成金额 到帐备注: @@ -30,19 +32,19 @@ 提现单号: - {{statementDesc.extractCode}} + {{statementDesc.code}} 发起时间: - {{statementDesc.payTime}} + {{statementDesc.updateTime}} - + 订单时间: - {{statementDesc.orderCreateTime}} + {{statementDesc.createTime}} diff --git a/pages/my/withdraw.vue b/pages/my/withdraw.vue index f468e73..810256e 100644 --- a/pages/my/withdraw.vue +++ b/pages/my/withdraw.vue @@ -63,9 +63,9 @@ - + + + @@ -140,8 +140,10 @@ } }) }, - withdraw() { - + showFinanalDetails() { + uni.navigateTo({ + url: '/pages/my/my-money-bag' + }) } }, }