From 08771138697e7dfbf606272c809b19e2f5e63cc0 Mon Sep 17 00:00:00 2001 From: rainbro <33367671@qq.com> Date: Wed, 2 Jul 2025 15:59:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/agent/payCertSetting.vue | 188 ++++++++++++++++++++++++++++++++----- 1 file changed, 167 insertions(+), 21 deletions(-) diff --git a/src/views/agent/payCertSetting.vue b/src/views/agent/payCertSetting.vue index f11c2d7..4589e3a 100644 --- a/src/views/agent/payCertSetting.vue +++ b/src/views/agent/payCertSetting.vue @@ -60,6 +60,7 @@
+

分账开关

@@ -68,16 +69,16 @@

微信商户平台> 账户中心 > API安全,申请API证书。

- + 立即设置 +
@@ -89,7 +90,7 @@
已设置 - 管理设置
@@ -108,8 +109,8 @@
已设置 - 立即设置 + 查看
未设置 @@ -126,6 +127,28 @@
+ + +
+ +
+ + + 选择文件 + +
+
+ + + 选择文件 + +
+
+
+
+ @@ -136,18 +159,17 @@ -

接收方比例:30%(当前仅支持给一个商户分账,最大30%)

- - - + + + + +
@@ -187,6 +209,7 @@ export default { return { // AUTH token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU', + payid: '', payinfo: [], payType: -1, payIsAutoRefund: -1, @@ -204,9 +227,19 @@ export default { profitShareTab: 'profit_share_setting', dialogVisibleApiv3: false, dialogVisibleProfitShare: false, + dialogVisibleCert: false, - profitShareInfo: [], + profitShareInfo: { + 'receiver_name': '', + }, profitShareReceiversRelationType: [], + showCustomInput: false, + + uploadParams: { + }, + uploadHeaders: { + 'Auth': this.token + }, } }, computed: { @@ -221,6 +254,7 @@ export default { this.getPayment(); this.getProfitShareInfo(); + this.payid = this.$route.query.payid; }, methods: { getPayment() { @@ -256,9 +290,9 @@ export default { }).then(response => { this.$nextTick(() => { this.profitShareReceiversRelationType = response.data.receivers_relation_type - if (response.status) { - this.profitShareStatus = response.data - + if (response.status && response.data.receivers.length > 0) { + this.profitShareInfo = response.data.receivers[0] + console.log(this.profitShareInfo) } }) }).catch(error => { @@ -286,6 +320,27 @@ export default { console.error(error, 'error') }) }, + updateProfitShareStatus(row) { + this.$http('POST', '/agentnew/ajax_update_profit_share_status', { + pid: this.$route.query.payid, + profit_share_status: row.profit_share_status==1 ? 0 : 1, + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + this.$nextTick(() => { + if (response.status) { + this.$Message.success(response.info); + this.getPayment() + } else { + this.$Message.error(response.info); + } + }) + }).catch(error => { + console.error(error, 'error') + }) + }, cancle() { this.getPayment(); }, @@ -305,12 +360,42 @@ export default { if (type == 'apiv3') { this.dialogVisibleApiv3 = true; this.dialogVisibleProfitShare = false; + this.dialogVisibleCert = false; } else if (type == 'profit_share_receivers') { this.dialogVisibleProfitShare = true; this.dialogVisibleApiv3 = false; + this.dialogVisibleCert = false; + } else if (type == 'cert') { + this.dialogVisibleCert = true; + this.dialogVisibleApiv3 = false; + this.dialogVisibleProfitShare = false; } }, // 确认按钮事件 + saveCert(row) { + console.log(row) + this.$refs.upload.submit(); + // this.$http('POST', '/agentnew/upload_pay_cert', { + // payid: this.$route.query.payid, + // apiv3: row.apiv3 + // }, { + // headers: { + // 'Auth': this.token + // } + // }).then(response => { + // this.$nextTick(() => { + // if (response.status) { + // this.$Message.success(response.info); + // } else { + // this.$Message.error(response.info); + // } + // }) + // }).catch(error => { + // console.error(error, 'error') + // }) + + // this.dialogVisibleApiv3 = false; + }, saveApiv3(row) { this.$http('POST', '/agentnew/ajax_save_apiv3', { pid: this.$route.query.payid, @@ -333,13 +418,48 @@ export default { this.dialogVisibleApiv3 = false; }, + saveProfitShareReceivers(row) { + this.$http('POST', '/agentnew/ajax_add_profit_share_receivers', { + pid: this.$route.query.payid, + rname: row.receiver_name, + raccount: row.receiver_account, + rtype: row.relation_type, + custom_relation: row.custom_relation + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + this.$nextTick(() => { + if (response.status) { + this.$Message.success(response.info); + } else { + this.$Message.error(response.info); + } + }) + }).catch(error => { + console.error(error, 'error') + }) + + this.dialogVisibleApiv3 = false; + }, // 取消按钮事件 handleCancelConfig() { this.dialogVisibleApiv3 = false; + this.dialogVisibleProfitShare = false; + this.dialogVisibleCert = false; }, dialogVisibleChange(data) { console.log(data, 'data098908090'); }, + profitShareReceiversRelationTypeChange(row) { + console.log(row.relation_type, 'relation_type'); + if (row.relation_type == 'CUSTOM') { + this.showCustomInput = true; + } else { + this.showCustomInput = false; + } + } } } @@ -626,4 +746,30 @@ lable { } } } + +.upload-button { + border-radius: 4px; + background: #F2F3F5; + box-sizing: border-box; + border: 1px solid #BABDC2; + .bgImg{ + width: 20px; + height: 16px; + margin-right: 6px; + background-image: url(@/assets/site/uploadIcon.svg); + } + &:hover{ + .bgImg{ + background-image: url(@/assets/site/uploadIcon_light.svg); + } + } +} +.upload-title { + font-size: 14px; + font-weight: normal; + line-height: normal; + letter-spacing: 0.08em; + color: #23242B; +} + \ No newline at end of file