Kaynağa Gözat

修改 微信支付参数

feat
JinxChen 1 yıl önce
ebeveyn
işleme
5d051969ac
1 değiştirilmiş dosya ile 11 ekleme ve 8 silme
  1. +11
    -8
      src/views/package-list/index.vue

+ 11
- 8
src/views/package-list/index.vue Dosyayı Görüntüle

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-03-29 16:57:58
* @LastEditors: JinxChen
* @LastEditTime: 2023-03-13 16:41:09
* @LastEditTime: 2023-03-13 18:12:26
* @FilePath: \TelpoH5FrontendWeb\src\views\package-list\index.vue
* @description: TODO 小台风充值h5
-->
@@ -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 //总金额单位为分,测试环境写死


Yükleniyor…
İptal
Kaydet