From 8a24eac19240a6f3f931be84366ecde4c43b577d Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Sat, 11 Oct 2025 18:21:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=94=B6=E6=AC=BE=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BA=A4=E4=BA=92=E3=80=81=E6=A0=A1=E9=AA=8C=E6=8B=A6?= =?UTF-8?q?=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/addPay.vue | 76 ++++++++++++++++--------- src/views/HosInformation.vue | 44 +++++++-------- src/views/weChatPayment.vue | 128 ++++++++++++++++++++++++++++--------------- 3 files changed, 152 insertions(+), 96 deletions(-) diff --git a/src/components/addPay.vue b/src/components/addPay.vue index c65c028..8514ed5 100644 --- a/src/components/addPay.vue +++ b/src/components/addPay.vue @@ -59,15 +59,15 @@
@@ -737,6 +737,7 @@ export default { this.fetchPackData() this.fetchProjectData() this.geHosAdress() + this.getPayList() } else { await this.getAreaData() } @@ -764,7 +765,7 @@ export default { }, methods: { goToWxPay(){ - this.$router.push(`/weChatPayment?`); + this.$router.push(`/weChatPayment?doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`); }, showDialog(type) { if (type == 'register') { @@ -786,17 +787,15 @@ export default { this.$positionMessage({ type: type, message: msg+'收挂号费', - target: this.$refs['wxPayRef'], - position: 'bottom' + target: this.$refs['hasVisitFeeRef'], + position: 'top' }) }).catch(error => { console.error(error, 'error') }) }, onLineChange(e) { - this.onLinePay this.onLinePay = e - if(!this.selectWxpay){ this.$positionMessage({ type: 'error', @@ -806,12 +805,12 @@ export default { }) } - console.log(this.onLinePay, '====-0000'); }, // 获取支付列表 getPayList() { this.$http('POST', '/agentnew/ajax_get_pay_list', { - uid: this.$route.query.uid, + doctor_id: this.doctor_id, + depart_id:this.depart_id }).then(response => { this.$nextTick(() => { if ( @@ -902,7 +901,11 @@ export default { ...params }).then(response => { this.$nextTick(() => { - console.log(response); + if(response.code == 0) { + this.$Message.success('设置成功'); + }else{ + this.$Message.error(response.msg); + } this.freeRegVisible = false; }) }).catch(error => { @@ -914,28 +917,19 @@ export default { this.$positionMessage({ type: 'error', message: '请输入正确的金额', - target: '#siteMessage7', + target: '.registerMoney', position: 'top', }) return; } - this.$http('POST', '/api/admin/set_visit_price', { ...params }).then(response => { this.$nextTick(() => { if(response.code !== 0) { - this.$positionMessage({ - type: 'error', - message: response.msg, - target: '#siteMessage7', - }) - }else{ - this.$positionMessage({ - type: 'success', - message: '设置成功', - target: '#siteMessage7', - }) + this.$Message.error(response.msg); + }else{ + this.$Message.success('设置成功'); } this.registrationVisible = false; }) diff --git a/src/views/weChatPayment.vue b/src/views/weChatPayment.vue index 0ef1804..18fb2e0 100644 --- a/src/views/weChatPayment.vue +++ b/src/views/weChatPayment.vue @@ -17,12 +17,12 @@
2.登录微信商户平台,在产品中心开通Native支付,如需使用微信版,开通JSAPI支付。
已上传
-未上传任何文件
+ @@ -127,15 +126,32 @@ export default { }, data() { return { - // 公司简称 - company_short_name: '', - // 商户号 - mch_id: '', - // 微信支付秘钥 - apiv2: '', - // 公众号APPID - appid: '', - payinfo: [], + formData1:{ + // 公司简称 + company_short_name: '', + // 商户号 + mch_id: '', + // 微信支付秘钥 + key: '', + // 公众号APPID + appid: '', + }, + rules: { + company_short_name: [ + { required: true, message: '请输入公司简称', trigger: 'blur' } + ], + appid: [ + { required: true, message: '请输入公众号APPID', trigger: 'blur' } + ], + mch_id: [ + { required: true, message: '请输入微信支付商户号', trigger: 'blur' } + ], + key: [ + { required: true, message: '请输入微信支付秘钥', trigger: 'blur' } + ], + }, + formData: new FormData(), + payInfo:{}, saveBtnStyleObj: { width: '144px', height: '46px', @@ -146,7 +162,6 @@ export default { }, created() { // 初始化反显 - // this.getPayment() }, methods: { getPayment() { @@ -161,39 +176,62 @@ export default { }) }, handleAvatarChange(file, fileList) { - console.log(file, fileList) + console.log(file, fileList, 'file') let fileObj = file.raw + this.payInfo.apiclient_cert = fileObj; this.formData.set('apiclient_cert', fileObj) + // this.formData.append('apiclient_cert', fileObj) }, handleAvatarChange1(file, fileList) { - console.log(file, fileList) + console.log(file, fileList, 'file') let fileObj = file.raw + this.payInfo.apiclient_key = fileObj; this.formData.set('apiclient_key', fileObj) }, + saveConfirm() { - // - // this.$positionMessage({ - // type: 'error', - // message: '请先上传证书', - // target: this.$refs['saveRef'], // 可以是DOM元素或选择器 - // position: 'top' - // }) - // let obj = {} - // obj.uid = this.serviceInfo.uid - // obj.type = this.serviceInfo.type - // obj.info = "" - // const that = this - // this.$http('POST', '/agentnew/ajax_payment_switch', obj).then(response => { - // if(response.status){ - // that.$message.success('保存成功'); - // that.payList = response.data.paylist - // that.$emit('saveEvent', that.payList) - // return true; - // } - // that.$message.error(response.info); - // }).catch(error => { - // console.error(error, 'error') - // }) + // 查看有多少参数 + // for (let [key, value] of this.formData.entries()) { + // console.log('键 (Key):', key); + // console.log('值 (Value):', value); + // } + this.$refs.wxform.validate((valid) => { + console.log(valid, 'valid'); + if (valid) { + for (let key in this.formData1) { + this.formData.set(key, this.formData1[key]) + } + if(!this.formData.has('apiclient_key') || !this.formData.has('apiclient_cert')){ + this.$positionMessage({ + type: 'error', + message: '请先上传证书', + target: this.$refs['saveRef'], // 可以是DOM元素或选择器 + position: 'top' + }) + return false; + } + this.formData.set('doctor_id', this.$route.query.doctor_id) + this.formData.set('depart_id', this.$route.query.depart_id) + const that = this + this.$http('POST', '/agentnew/ajax_payment_switch', this.formData).then(response => { + if(response.status){ + that.$message.success('保存成功'); + // that.payList = response.data.paylist + // that.$emit('saveEvent', that.payList) + this.$router.go(-1); + + return true; + } + that.$message.error(response.info); + }).catch(error => { + console.error(error, 'error') + }) + } else { + return false; + } + }) + + }, }