diff --git a/README.md b/README.md index a43483a..76ee819 100644 --- a/README.md +++ b/README.md @@ -199,4 +199,12 @@ fix ## v1.0.21 `2023.2.25` update -- 暂时只开放支付宝支付 \ No newline at end of file +- 暂时只开放支付宝支付 + + +## v1.0.22 +`2023.2.26` +update +- 修复 查询支付结果异常的问题 +- 增加 激活成功返回校园号首页 +- 取消 从接口获取套餐数据 \ No newline at end of file diff --git a/src/api/pay.js b/src/api/pay.js index b1da941..7900159 100644 --- a/src/api/pay.js +++ b/src/api/pay.js @@ -1,3 +1,10 @@ +/* + * @Date: 2023-02-25 16:21:00 + * @LastEditors: JinxChen + * @LastEditTime: 2023-02-26 10:17:38 + * @FilePath: \TelpoH5FrontendWeb\src\api\pay.js + * @description: + */ import javaRequest from '@/http/java_api'; export const APIPay = { diff --git a/src/assets/wx_pay_icon.png b/src/assets/wx_pay_icon.png new file mode 100644 index 0000000..00a601e Binary files /dev/null and b/src/assets/wx_pay_icon.png differ diff --git a/src/config/models.js b/src/config/models.js index 6a294ca..d0ab05a 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.21F'; //版本号 +export const VERSION_MODEL = '1.0.22F'; //版本号 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 2861acd..dc847fa 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 18:15:58 + * @LastEditTime: 2023-02-26 10:11:02 * @FilePath: \TelpoH5FrontendWeb\src\main.js * @description: */ @@ -107,8 +107,7 @@ Toast.setDefaultOptions('loading', { }); Dialog.setDefaultOptions({ confirmButtonColor: "#3296fa", - cancelButtonColor: "#999", - showCancelButton: false + showCancelButton: false, }); Vue.config.productionTip = false; Vue.prototype.$bus = new Vue(); diff --git a/src/views/index.vue b/src/views/index.vue index 7e94bde..982a9de 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,3 +1,10 @@ + @@ -12,7 +19,7 @@ export default { }, methods: { onClick() { - this.$router.push({ + this.$router.replace({ name: 'packageList', query: { imei: '45555' diff --git a/src/views/package-home/index.vue b/src/views/package-home/index.vue index 0c94acd..693298d 100644 --- a/src/views/package-home/index.vue +++ b/src/views/package-home/index.vue @@ -1,7 +1,7 @@ @@ -97,7 +97,7 @@ export default { 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`; if(params.imei) { - this.$router.push({ + this.$router.replace({ name: 'packageList', query: { imei: params.imei, diff --git a/src/views/package-list/index.vue b/src/views/package-list/index.vue index 79dad84..5083e90 100644 --- a/src/views/package-list/index.vue +++ b/src/views/package-list/index.vue @@ -1,7 +1,7 @@ @@ -15,10 +15,10 @@
-
+
@@ -39,7 +39,7 @@ :key="index" > -
+

推荐

@@ -63,11 +63,40 @@

话费充值

+ +
+
+

每月200分钟通话时长,1G流量。

+ +
+
+ + + + + + + + + + + +
+
@@ -84,7 +113,17 @@ export default { return { topupTitle: "请选择套餐充值激活电话卡", wxItem: "", - packageOrderList: [], + packageOrderList: [ + { + packageName: '移动语音卡套餐(1年)', + packagePayType: 1, + packagePrice: 240, + packageIssue: 12, + payWxPayProductId: process.env.NODE_ENV === "production" ? '1629407413618294784' : '1629405716684029952', //微信支付 + payAliPayProductId: process.env.NODE_ENV === "production" ? '1629407413618294784' : '1629405716684029952', //支付宝全额支付 + payAntPayProductId: process.env.NODE_ENV === "production" ? '1629407705558630400': '1629405558344859648', //支付宝花呗支付 + } + ], outTradeNo: "", //订单号 price: "", //价格, isShowNoData: false, //是否显示无套餐内容, 默认false @@ -95,6 +134,10 @@ export default { appId: '', }, + radio: '1', + payProductId: null, + packageIssue: null, + payType: '1', }; }, computed: { @@ -108,7 +151,7 @@ export default { created() { this.getParams(); this.getWxAutograph(); - this.getLiveBasePackage(); + /* this.getLiveBasePackage(); */ }, /* mounted() { this.getParams(); @@ -197,7 +240,8 @@ export default { .catch(error => { this.$dialog.confirm({ title: "获取套餐数据失败", - message: error + message: error, + showCancelButton: false, }); }) .finally(() => { @@ -243,18 +287,26 @@ export default { }, // 话费充值 onBuy(data) { - let payType = data.packagePayType; this.price = data.packagePrice; // 需要区分是要用微信支付还是支付宝花呗支付 - if (payType === 2) { + if (this.payType === '2') { + this.payProductId = process.env.NODE_ENV === "production" ? '1629407413618294784' : '1629405716684029952', //支付宝全额支付 + this.packageIssue = 1; + this.aliPay(data); + } else if (this.payType === '3') { + this.payProductId = process.env.NODE_ENV === "production" ? '1629407705558630400': '1629405558344859648', //支付宝花呗支付 + this.packageIssue = 12; + this.payType = '2' this.aliPay(data); } else { let openId = this.$store.getters.openId; if(openId === null || openId === 'null') { this.$dialog.confirm({ - message: '微信支付在调整中,请选择其它支付方式' + message: '微信支付在调整中,请选择其它支付方式', + showCancelButton: false, }) } else { + this.packageIssue = 1; this.wxPay(data); console.log("openid为空"); } @@ -270,10 +322,10 @@ export default { let reqBody = { openId: this.$store.getters.openId, //openId imei: this.params.imei, //imei - productId: data.pechargeUrl, //套餐id - packageName: data.productModel + ',' + data.packageName, //套餐名字 - packagePayType: data.packagePayType, //支付类型 - packageIssue: data.packageIssue, //分期 + productId: this.payProductId, //套餐id + packageName: /* data.productModel */ + ',' + data.packageName, //套餐名字 + packagePayType: Number(this.payType), //支付类型 + packageIssue: this.packageIssue, //分期 packagePrice: process.env.NODE_ENV === "production" ? data.packagePrice * 100 : 1 //总金额单位为分,测试环境写死 }; APICore.payLiveBaseDevice(reqBody) @@ -320,7 +372,7 @@ export default { iccid: that.params.iccid, isAdmin: that.$route.query.isAdmin || false, serialNo: that.params.imei, - issue: data.packageIssue + issue: that.packageIssue } }); console.log("微信支付成功::", res); @@ -358,10 +410,10 @@ export default { let reqBody = { openId: this.$store.getters.openId, //openId imei: this.params.imei, //imei - productId: data.pechargeUrl, //套餐id - packageName: data.productModel + ',' + data.packageName, //套餐名字 - packagePayType: data.packagePayType, //支付类型 - packageIssue: data.packageIssue, //分期 + productId: this.payProductId, //套餐id + packageName: /* data.productModel + ',' + */data.packageName, //套餐名字 + packagePayType: Number(this.payType), //支付类型 + packageIssue: this.packageIssue, //分期 packagePrice: process.env.NODE_ENV === "production" ? data.packagePrice * 100 : 1 //总金额单位为分,测试环境写死 }; this.$toast.clear(); @@ -379,7 +431,7 @@ export default { let alipayForm = decodeURI(alipayData.payXmlStr); that.$store.commit("isFromWx", true); let alipayUserId = process.env.NODE_ENV === "production" ? 42 : 18 - this.$router.push({ + this.$router.replace({ name: "payResult", query: { rechargeUrl: @@ -392,7 +444,7 @@ export default { isAdmin: that.$route.query.isAdmin || false, serialNo: that.params.imei, alipayUserId: alipayUserId, - productId: data.pechargeUrl + productId: this.payProductId } }); }) @@ -413,6 +465,10 @@ export default { return "2" /* break; */ } + }, + onRaidoChange(value) { + console.log("选择的支付类型是", value); + this.payType = value; } } }; @@ -476,7 +532,7 @@ export default { } .package-order-container { position: relative; - height: 120px; + height: 140px; width: 300px; padding: 5px 20px; margin: 10px 0; @@ -555,6 +611,14 @@ export default { } } } + .remark { + display: flex; + justify-content: flex-start; + p { + font-size: 14px; + /* font-weight: bold; */ + } + } } .content { font-size: 14px; @@ -580,5 +644,23 @@ export default { padding: 10px 0 0 0; } } + .pay-radios { + position: absolute; + bottom: 0; + width: 100%; + /* background-color: red; */ + /* padding: 0 15px; */ + .radios-con { + padding: 20px 10px; + @include center(); + font-size: 18px; + box-shadow: rgba(14, 30, 37, 0.12) 0 3px 5px 0, + rgba(14, 30, 37, 0.32) 0 2px 16px 0; + img { + height: 35px; + width: auto; + } + } + } } diff --git a/src/views/pay-result/index.vue b/src/views/pay-result/index.vue index f631362..8fc469f 100644 --- a/src/views/pay-result/index.vue +++ b/src/views/pay-result/index.vue @@ -1,7 +1,7 @@ @@ -89,7 +89,7 @@ export default { } }, onNavBack() { - this.$router.push({ + this.$router.replace({ name: "packageList", query: { serialNo: this.$route.query.serialNo, @@ -131,13 +131,23 @@ export default { message: `电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。`, showCancelButton: false }) - /* Dialog.confirm({ title: "SIM卡激活失败", message: data.message, className: "device_confirm", }); */ } else if (data.stateCode === 1 && data.message !== 'ok') { - - /* this.countDown(); */ - this.$dialog.confirm({ title: "SIM卡激活成功", message: '卡激活成功,5分钟后则可正常使用。', showCancelButton: false}); + this.$dialog.confirm({ + title: "SIM卡激活成功", + message: '卡激活成功,5分钟后则可正常使用。', + showCancelButton: false, + confirmButtonText: '返回首页'}).then(() => { + document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/") + }); } else if (data.stateCode === 1 && data.message === 'ok') { - this.$dialog.confirm({ title: "SIM卡激活成功", message: '卡激活成功,5分钟后则可正常使用。', showCancelButton: false}); + this.$dialog.confirm({ + title: "SIM卡激活成功", + message: '卡激活成功,5分钟后则可正常使用。', + showCancelButton: false, + confirmButtonText: '返回首页' + }).then(() => { + document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/") + }); } }) .catch(error => { @@ -200,7 +210,7 @@ export default { } that.timer = setInterval(() => { that.count++; - APIPay.getAlipayResult(reqBody) + APIPay.getWxPayResult(reqBody) .then(res => { if (res.data.code === 20000) { this.pageShow = true; diff --git a/vue.config.js b/vue.config.js index 1df34d4..9e5efb5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2020-04-15 10:00:32 - * @LastEditTime: 2023-02-25 15:35:15 + * @LastEditTime: 2023-02-26 09:19:56 * @LastEditors: JinxChen * @Description: In User Settings Edit * @FilePath: \TelpoH5FrontendWeb\vue.config.js @@ -52,8 +52,8 @@ module.exports = { }), pxtorem({ rootValue: 37.5, // 换算的基数 - // rootValue: 75, // 换算的基数 - /* selectorBlackList: ["van"], */ + /* rootValue: 75, */ // 换算的基数 + selectorBlackList: ["van"], propList: ["*"], //exclude: /node_modules/ })