From 63afdf25dcda9b6cb7bb35bcd95ec896e63ab80d Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Tue, 14 Oct 2025 16:24:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=A4=E9=94=80=E8=AE=BE=E7=BD=AE=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/weChatPayment.vue | 104 +++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 60 deletions(-) diff --git a/src/views/weChatPayment.vue b/src/views/weChatPayment.vue index 7fc48de..f249720 100644 --- a/src/views/weChatPayment.vue +++ b/src/views/weChatPayment.vue @@ -188,25 +188,9 @@ export default { // 初始化 this.formData.set('doctor_id', this.$route.query.doctor_id) this.formData.set('depart_id', this.$route.query.depart_id) - this.getPayment(); console.log('apiclient_cert' in this.payInfo,'apiclient_key'); }, methods: { - getPayment() { - // 初始化数据、证书文件列表??? - - // this.$http('POST', '/agentnew/ajax_get_payinfo', { - // doctor_id : this.doctor_id, - // depart_id : this.depart_id - // }).then(response => { - // this.$nextTick(() => { - // this.payinfo = response.data - // this.formData1 = response.data - // }) - // }).catch(error => { - // console.error(error, 'error') - // }) - }, handRemove() { this.formData.delete('apiclient_cert'); this.payInfo.delete('apiclient_cert'); @@ -259,53 +243,53 @@ export default { // console.log('键 (Key):', key); // console.log('值 (Value):', value); // } - // if(!this.formData.has('apiclient_key') ){ - // this.noFileFlag1 = true; - // if( !this.formData.has('apiclient_cert')){ - // this.noFileFlag = true; - // this.$positionMessage({ - // type: 'error', - // message: '请先上传证书', - // target: this.$refs['saveRef'], // 可以是DOM元素或选择器 - // position: 'top' - // }) - // return false; - // } - // this.$positionMessage({ - // type: 'error', - // message: '请先上传证书', - // target: this.$refs['saveRef'], // 可以是DOM元素或选择器 - // position: 'top' - // }) - // return false; - // } + if(!this.formData.has('apiclient_key') ){ + this.noFileFlag1 = true; + if( !this.formData.has('apiclient_cert')){ + this.noFileFlag = true; + this.$positionMessage({ + type: 'error', + message: '请先上传证书', + target: this.$refs['saveRef'], // 可以是DOM元素或选择器 + position: 'top' + }) + return false; + } + this.$positionMessage({ + type: 'error', + message: '请先上传证书', + target: this.$refs['saveRef'], // 可以是DOM元素或选择器 + position: 'top' + }) + return false; + } this.$refs.wxform.validate((valid) => { console.log(valid, 'valid'); - // if (valid) { - // for (let key in this.formData1) { - // this.formData.set(key, this.formData1[key]) - // } - // this.formData.set('doctor_id', this.$route.query.doctor_id) - // this.formData.set('depart_id', this.$route.query.depart_id) - // this.formData.set('type',this.payTypeWeixin)//这个参数 待定 2 微信支付 \ 3 支付宝 - // this.formData.set('is_pay_public','0') - // const that = this; - // this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => { - // if(response.code == 0){ - // that.$message.success('保存成功'); - // // that.payList = response.data.paylist - // // that.$emit('saveEvent', that.payList) - // this.$router.go(-1); - // return true; - // } - // that.$message.error(response.msg); - // }).catch(error => { - // console.error(error, 'error') - // }) - // } else { - // return false; - // } + if (valid) { + for (let key in this.formData1) { + this.formData.set(key, this.formData1[key]) + } + this.formData.set('doctor_id', this.$route.query.doctor_id) + this.formData.set('depart_id', this.$route.query.depart_id) + this.formData.set('type',this.payTypeWeixin)//这个参数 待定 2 微信支付 \ 3 支付宝 + this.formData.set('is_pay_public','0') + const that = this; + this.$http('POST', '/api/admin/set_pay_method', this.formData).then(response => { + if(response.code == 0){ + that.$message.success('保存成功'); + // that.payList = response.data.paylist + // that.$emit('saveEvent', that.payList) + this.$router.go(-1); + return true; + } + that.$message.error(response.msg); + }).catch(error => { + console.error(error, 'error') + }) + } else { + return false; + } }) }, }