From 5d051969ac3a0c3bff52d588a0cf99c1b16b2b67 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Mon, 13 Mar 2023 18:13:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/package-list/index.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/package-list/index.vue b/src/views/package-list/index.vue index ff3b268..1282bd6 100644 --- a/src/views/package-list/index.vue +++ b/src/views/package-list/index.vue @@ -1,7 +1,7 @@ @@ -279,30 +279,33 @@ export default { this.price = data.packagesPrice; // 遍历数据找到属于三种支付方式对应的套餐id, 1 微信 2 支付宝全额 3 支付宝分期 let payTypeToPackAgeId = data.payTypeList; - console.log("购买的套餐数据data", data); + console.log("购买的套餐数据data", payTypeToPackAgeId); // 需要区分是要用微信支付还是支付宝花呗支付 if (this.payType === '2') { // 全额 this.payProductId = payTypeToPackAgeId.filter(item => { - return item.payType === '2'; + return item.payType === '2' })[0].productId; this.packageIssue = 0; + console.log("this.payProductId", this.payProductId); this.aliPay(data); } else if (this.payType === '3') { // 分期 this.payProductId = payTypeToPackAgeId.filter(item => { - return item.payType === '3'; + return item.payType === '3' })[0].productId; this.packageIssue = 12; - this.payType = '2' + this.payType = '2'; + console.log("this.payProductId2", this.payProductId); this.aliPay(data); } else { // 微信 let openId = this.$store.getters.openId; this.payProductId = payTypeToPackAgeId.filter(item => { - return item.payType === '1'; + return item.payType === '1' })[0].productId; this.packageIssue = 0; + console.log("this.payProductId3", this.payProductId); if(openId === null || openId === 'null') { this.$dialog.confirm({ message: '获取OpenId失败,请您重新进入', @@ -324,7 +327,7 @@ export default { openId: this.$store.getters.openId, //openId imei: this.params.imei, //imei productId: this.payProductId, //套餐id - packageName: /* data.productModel */ data.packageName, //套餐名字 + packageName: /* data.productModel */ data.packagesName, //套餐名字 packagePayType: Number(this.payType), //支付类型 packageIssue: 0, //分期 packagePrice: process.env.NODE_ENV === "production" ? data.packagesPrice * 100 : 1 //总金额单位为分,测试环境写死 @@ -419,7 +422,7 @@ export default { openId: this.$store.getters.openId, //openId imei: this.params.imei, //imei productId: this.payProductId, //套餐id - packageName: /* data.productModel + ',' + */data.packageName, //套餐名字 + packageName: /* data.productModel + ',' + */data.packagesName, //套餐名字 packagePayType: Number(this.payType), //支付类型 packageIssue: this.packageIssue, //分期 packagePrice: process.env.NODE_ENV === "production" ? data.packagesPrice * 100 : 1 //总金额单位为分,测试环境写死