diff --git a/README.md b/README.md index b0c05bb..a43483a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -194,4 +194,9 @@ fix fix - 修复 调起微信支付异常的问题 - 修复 获取imei异常的问题 -- 修改 获取openId方式 \ No newline at end of file +- 修改 获取openId方式 + +## v1.0.21 +`2023.2.25` +update +- 暂时只开放支付宝支付 \ No newline at end of file diff --git a/src/config/models.js b/src/config/models.js index 9fcbd00..6a294ca 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -5,7 +5,7 @@ * @FilePath: \AntpayFrontEnd\src\config\models.js * @description: */ -export const VERSION_MODEL = '1.0.20F'; //版本号 +export const VERSION_MODEL = '1.0.21F'; //版本号 export const IMAGE_URL = { production: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/', diff --git a/src/main.js b/src/main.js index 4947b5f..2861acd 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,7 @@ /* * @Date: 2022-01-19 10:08:26 * @LastEditors: JinxChen - * @LastEditTime: 2023-02-25 15:44:55 + * @LastEditTime: 2023-02-25 18:15:58 * @FilePath: \TelpoH5FrontendWeb\src\main.js * @description: */ diff --git a/src/views/package-home/index.vue b/src/views/package-home/index.vue index f341d25..0c94acd 100644 --- a/src/views/package-home/index.vue +++ b/src/views/package-home/index.vue @@ -1,7 +1,7 @@ @@ -54,6 +54,7 @@ export default { console.log("获取token"); } } else { + this.getWxCode(); console.log("当前浏览器内核并非支付宝或者微信"); } }, @@ -94,8 +95,18 @@ export default { let proUrl = encodeURIComponent(`https://ai.ssjlai.com/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}`); */ let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}&iccid=${params.iccid}`); console.log("redUrl", redUrl); - let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${params.appId}&redirect_uri=${redUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect` - window.location.href = url; + let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${params.appId}&redirect_uri=${redUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`; + if(params.imei) { + this.$router.push({ + name: 'packageList', + query: { + imei: params.imei, + iccid: params.iccid, + } + }) + } else { + window.location.href = url; + } }, // 获取url传过来的参数 getParams() { diff --git a/src/views/package-list/index.vue b/src/views/package-list/index.vue index a391992..79dad84 100644 --- a/src/views/package-list/index.vue +++ b/src/views/package-list/index.vue @@ -1,7 +1,7 @@ @@ -246,10 +246,18 @@ export default { let payType = data.packagePayType; this.price = data.packagePrice; // 需要区分是要用微信支付还是支付宝花呗支付 - if (payType === "支付宝花呗") { + if (payType === 2) { this.aliPay(data); } else { - this.wxPay(data); + let openId = this.$store.getters.openId; + if(openId === null || openId === 'null') { + this.$dialog.confirm({ + message: '微信支付在调整中,请选择其它支付方式' + }) + } else { + this.wxPay(data); + console.log("openid为空"); + } } }, // 微信支付 @@ -257,6 +265,7 @@ export default { this.$toast.loading({ message: "加载中" }); + console.log("微信支付", data); let orderData = data; let reqBody = { openId: this.$store.getters.openId, //openId @@ -348,7 +357,7 @@ export default { let orderData = data; let reqBody = { openId: this.$store.getters.openId, //openId - imei: this.serialNo, //imei + imei: this.params.imei, //imei productId: data.pechargeUrl, //套餐id packageName: data.productModel + ',' + data.packageName, //套餐名字 packagePayType: data.packagePayType, //支付类型 @@ -366,7 +375,7 @@ export default { } let that = this; let alipayData = res.data.data.xmlStrMap; - this.outTradeNo = alipayData.outTradeNo; + that.outTradeNo = alipayData.outTradeNo; let alipayForm = decodeURI(alipayData.payXmlStr); that.$store.commit("isFromWx", true); let alipayUserId = process.env.NODE_ENV === "production" ? 42 : 18