diff --git a/src/views/agent/payList.vue b/src/views/agent/payList.vue index 5cc2116..ebc7920 100644 --- a/src/views/agent/payList.vue +++ b/src/views/agent/payList.vue @@ -20,7 +20,7 @@
- + @@ -64,7 +64,7 @@
- + @@ -108,7 +108,7 @@
- + @@ -150,7 +150,7 @@
- + @@ -191,7 +191,7 @@
- + @@ -228,7 +228,7 @@
-
+

前期准备事项

@@ -240,7 +240,7 @@

-
+

前期准备事项

1.申请公司微信支付。常见问题

@@ -275,7 +275,7 @@
-
+
@@ -309,7 +309,7 @@
-
+

前期准备事项

主账号登录并授权。去授权

@@ -323,6 +323,14 @@
+ +
+
+

前期准备事项

+

请确保使用要添加的京东主账号登录并授权

+

如未购买"快乐论文检测服务"服务或已过期,会跳转到购买服务页面

+
+
@@ -331,61 +339,80 @@ import GuipButton from '@/components/GuipButton.vue'; import GuipFormItem from '@/components/GuipFormItem.vue'; import GuipInput from '@/components/GuipInput.vue'; -// import GuipRadio from '@/components/GuipRadio.vue'; -// import GuipSelect from '@/components/GuipSelect.vue'; import GuipSwitch from '@/components/GuipSwitch.vue'; import GuipDialog from '@/components/GuipDialog.vue'; -// import PaymentMethod from '@/components/paymentMethod.vue'; -// import DomainModal from '@/components/domainModal.vue'; -// import CustomDropdown from '@/components/CustomDropdown.vue'; -// import SvgIcon from '@/components/SvgIcon.vue'; import GuipTable from '@/components/GuipTable.vue'; -// import GuipToolTip from '@/components/GuipToolTip.vue'; + +// 收款方式 +const PAY_TYPE_TAOBAO = 0; // 淘宝 +const PAY_TYPE_WEIXIN = 2; // 微信 +const PAY_TYPE_ALIPAY = 3; // 支付宝 +const PAY_TYPE_JINGDONG = 4; // 京东 +const PAY_TYPE_PDD = 11; // 拼多多 export default { components: { GuipButton, GuipFormItem, GuipInput, - // GuipRadio, - // GuipSelect, - // SvgIcon, GuipSwitch, GuipDialog, - // PaymentMethod, - // DomainModal, - // CustomDropdown, GuipTable, - // GuipToolTip }, data() { return { + // 收款方式 + payTypeTaoBao: PAY_TYPE_TAOBAO, + payTypeWeixin: PAY_TYPE_WEIXIN, + payTypeAlipay: PAY_TYPE_ALIPAY, + payTypeJingdong: PAY_TYPE_JINGDONG, + payTypePdd: PAY_TYPE_PDD, // AUTH token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU', + // 可添加的收款方式 addablePays: [], + // 收款方式列表 payList: [], + // 表格加载 tableLoading: false, + // 添加收款方式弹框 addPayDialogVisible: false, - showCancelButton: true, // 控制是否显示取消按钮 - showCloseButton: true, // 控制是否显示关闭按钮 + // 控制是否显示取消按钮 + showCancelButton: true, + // 控制是否显示关闭按钮 + showCloseButton: true, + // 添加收款方式弹框标题 addPayTitle: '', + // 添加收款方式类型 addPayType: '', + // 添加收款方式确认按钮文本 addPayconfirmText: '确定', + // 淘宝授权url taobaoAuthUrl: '', - + // 公司简称 company_short_name: '', + // 商户号 mch_id: '', + // 微信支付秘钥 apiv2: '', + // 公众号APPID appid: '', - + // 支付宝账号 alipay_account: '', + // 是否存在自供货 存在自供货 则不支持支付宝代收款 isExistSelfSupplys: false, + // 代收款 收款账号 receive_payment_account: '', + // 代收款 收款人姓名 receive_payment_name: '', + // 是否是平台支付 0平台支付 1自营支付 isPayPublic: '0', - + // 拼多多授权url pddAuthUrl: '', + // 拼多多店铺名称 pdd_shop_name: '', + // 京东授权url + jdAuthUrl: '', } }, computed: { @@ -408,9 +435,22 @@ export default { this.tableLoading = false this.$nextTick(() => { this.addablePays = response.data - this.taobaoAuthUrl = response.data[0].authurl - this.isExistSelfSupplys = response.data[3].is_exist_self_supplys - this.pddAuthUrl = response.data[11].authurl + if(response.data[PAY_TYPE_TAOBAO]) { + this.taobaoAuthUrl = response.data[PAY_TYPE_TAOBAO].authurl + } + + if (response.data[PAY_TYPE_ALIPAY]) { + this.isExistSelfSupplys = response.data[PAY_TYPE_ALIPAY].is_exist_self_supplys + } + + if (response.data[PAY_TYPE_PDD]) { + this.pddAuthUrl = response.data[PAY_TYPE_PDD].authurl + } + + if (response.data[PAY_TYPE_JINGDONG]) { + this.jdAuthUrl = response.data[PAY_TYPE_JINGDONG].authurl + } + }) }).catch(error => { console.error(error, 'error') @@ -483,16 +523,16 @@ export default { this.addPayDialogVisible = true; this.addPayTitle = '添加' + type_desc; this.addPayType = type; - if (type == 0) { + if (type == PAY_TYPE_TAOBAO || type == PAY_TYPE_JINGDONG) { this.addPayconfirmText = '去授权'; } }, // 确认按钮事件 addPayment() { - if (this.addPayType == 0) { + if (this.addPayType == PAY_TYPE_TAOBAO) { window.open(this.taobaoAuthUrl, '_blank'); - } else if (this.addPayType == 2) { + } else if (this.addPayType == PAY_TYPE_WEIXIN) { this.$http('POST', '/agentnew/ajax_add_weixinpay', { company_short_name: this.company_short_name, mch_id: this.mch_id, @@ -515,7 +555,7 @@ export default { console.error(error, 'error') }) - } else if (this.addPayType == 3) { + } else if (this.addPayType == PAY_TYPE_ALIPAY) { this.$http('POST', '/agentnew/ajax_add_alipay', { company_short_name: this.company_short_name, alipay_account: this.alipay_account, @@ -545,7 +585,7 @@ export default { }).catch(error => { console.error(error, 'error') }) - } else if (this.addPayType == 11) { + } else if (this.addPayType == PAY_TYPE_PDD) { this.$http('POST', '/agentnew/ajax_add_pddpay', { shop_name: this.pdd_shop_name, }, { @@ -555,14 +595,9 @@ export default { }).then(response => { this.$nextTick(() => { if (response.status) { - if (this.isPayPublic == 1) { - this.$Message.success(response.info); - this.getPayList(); - this.receive_payment_account = '' - this.receive_payment_name = '' - } else { - window.open(response.data.authurl, '_blank'); - } + this.$Message.success(response.info); + this.getPayList(); + this.pdd_shop_name = '' } else { this.$Message.error(response.info); @@ -571,6 +606,8 @@ export default { }).catch(error => { console.error(error, 'error') }) + } else if (this.addPayType == PAY_TYPE_JINGDONG) { + window.open(this.jdAuthUrl, '_blank'); } this.addPayDialogVisible = false; @@ -581,7 +618,6 @@ export default { }, // 关闭弹框事件 handleClose() { - this.$message.info('弹框已关闭'); this.addPayDialogVisible = false; }, dialogVisibleChange(data) {