Bladeren bron

update

- 修复 查询支付结果异常的问题
- 增加 激活成功返回校园号首页
- 取消 从接口获取套餐数据
feat
JinxChen 1 jaar geleden
bovenliggende
commit
2bb2054b6d
10 gewijzigde bestanden met toevoegingen van 154 en 41 verwijderingen
  1. +9
    -1
      README.md
  2. +7
    -0
      src/api/pay.js
  3. BIN
      src/assets/wx_pay_icon.png
  4. +1
    -1
      src/config/models.js
  5. +2
    -3
      src/main.js
  6. +8
    -1
      src/views/index.vue
  7. +2
    -2
      src/views/package-home/index.vue
  8. +104
    -22
      src/views/package-list/index.vue
  9. +18
    -8
      src/views/pay-result/index.vue
  10. +3
    -3
      vue.config.js

+ 9
- 1
README.md Bestand weergeven

@@ -199,4 +199,12 @@ fix
## v1.0.21 ## v1.0.21
`2023.2.25` `2023.2.25`
update update
- 暂时只开放支付宝支付
- 暂时只开放支付宝支付


## v1.0.22
`2023.2.26`
update
- 修复 查询支付结果异常的问题
- 增加 激活成功返回校园号首页
- 取消 从接口获取套餐数据

+ 7
- 0
src/api/pay.js Bestand weergeven

@@ -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'; import javaRequest from '@/http/java_api';


export const APIPay = { export const APIPay = {


BIN
src/assets/wx_pay_icon.png Bestand weergeven

Before After
Width: 464  |  Height: 171  |  Size: 73KB

+ 1
- 1
src/config/models.js Bestand weergeven

@@ -5,7 +5,7 @@
* @FilePath: \AntpayFrontEnd\src\config\models.js * @FilePath: \AntpayFrontEnd\src\config\models.js
* @description: * @description:
*/ */
export const VERSION_MODEL = '1.0.21F'; //版本号
export const VERSION_MODEL = '1.0.22F'; //版本号
export const IMAGE_URL = { export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/', production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/',


+ 2
- 3
src/main.js Bestand weergeven

@@ -1,7 +1,7 @@
/* /*
* @Date: 2022-01-19 10:08:26 * @Date: 2022-01-19 10:08:26
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 18:15:58
* @LastEditTime: 2023-02-26 10:11:02
* @FilePath: \TelpoH5FrontendWeb\src\main.js * @FilePath: \TelpoH5FrontendWeb\src\main.js
* @description: * @description:
*/ */
@@ -107,8 +107,7 @@ Toast.setDefaultOptions('loading', {
}); });
Dialog.setDefaultOptions({ Dialog.setDefaultOptions({
confirmButtonColor: "#3296fa", confirmButtonColor: "#3296fa",
cancelButtonColor: "#999",
showCancelButton: false
showCancelButton: false,
}); });
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.prototype.$bus = new Vue(); Vue.prototype.$bus = new Vue();


+ 8
- 1
src/views/index.vue Bestand weergeven

@@ -1,3 +1,10 @@
<!--
* @Date: 2023-02-25 16:34:35
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-26 10:35:39
* @FilePath: \TelpoH5FrontendWeb\src\views\index.vue
* @description:
-->
<template> <template>
<div></div> <div></div>
</template> </template>
@@ -12,7 +19,7 @@ export default {
}, },
methods: { methods: {
onClick() { onClick() {
this.$router.push({
this.$router.replace({
name: 'packageList', name: 'packageList',
query: { query: {
imei: '45555' imei: '45555'


+ 2
- 2
src/views/package-home/index.vue Bestand weergeven

@@ -1,7 +1,7 @@
<!-- <!--
* @Date: 2023-02-24 14:18:25 * @Date: 2023-02-24 14:18:25
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 18:08:22
* @LastEditTime: 2023-02-26 08:56:34
* @FilePath: \TelpoH5FrontendWeb\src\views\package-home\index.vue * @FilePath: \TelpoH5FrontendWeb\src\views\package-home\index.vue
* @description: * @description:
--> -->
@@ -97,7 +97,7 @@ export default {
console.log("redUrl", redUrl); 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`; 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) { if(params.imei) {
this.$router.push({
this.$router.replace({
name: 'packageList', name: 'packageList',
query: { query: {
imei: params.imei, imei: params.imei,


+ 104
- 22
src/views/package-list/index.vue Bestand weergeven

@@ -1,7 +1,7 @@
<!-- <!--
* @Date: 2022-03-29 16:57:58 * @Date: 2022-03-29 16:57:58
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 18:14:46
* @LastEditTime: 2023-02-26 10:37:08
* @FilePath: \TelpoH5FrontendWeb\src\views\package-list\index.vue * @FilePath: \TelpoH5FrontendWeb\src\views\package-list\index.vue
* @description: TODO 小台风充值h5 * @description: TODO 小台风充值h5
--> -->
@@ -15,10 +15,10 @@
<!-- 灰色线条 --> <!-- 灰色线条 -->
<div class="gray-line"></div> <div class="gray-line"></div>
<!-- 套餐说明 --> <!-- 套餐说明 -->
<div class="order-description" v-show="packageOrderList.length">
<!-- <div class="order-description" v-show="packageOrderList.length">
<h5>套餐说明:</h5> <h5>套餐说明:</h5>
<h5>每月200分钟通话时长,1G流量。</h5> <h5>每月200分钟通话时长,1G流量。</h5>
</div>
</div> -->
<!-- 套餐列表 --> <!-- 套餐列表 -->
<div class="topup-container"> <div class="topup-container">
<div class="main"> <div class="main">
@@ -39,7 +39,7 @@
:key="index" :key="index"
> >
<!-- 推荐 --> <!-- 推荐 -->
<div class="recom" v-show="index === 0">
<div class="recom" v-show="false">
<div class="shape"></div> <div class="shape"></div>
<div class="square"> <div class="square">
<p>推荐</p> <p>推荐</p>
@@ -63,11 +63,40 @@
<div class="buy-btn" @click="onBuy(item)"> <div class="buy-btn" @click="onBuy(item)">
<p>话费充值</p> <p>话费充值</p>
</div> </div>

</div>
<div class="remark">
<p>每月200分钟通话时长,1G流量。</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- 底部支付类型选择 -->
<div class="pay-radios">
<div class="radios-con">
<van-radio-group v-model="radio" direction="horizontal" @change="onRaidoChange">
<van-radio name="1">
<template #default>
<span>微信支付</span>
<!-- <img src="../../assets/wx_pay_icon.png"/> -->
</template>
</van-radio>
<van-radio name="2">
<template #default>
<span>支付宝</span>
<!-- <img src="../../assets/alipay.png"/> -->
</template>
</van-radio>
<van-radio name="3">
<template #default>
<span>花呗</span>
<!-- <img src="../../assets/antpay.png"/> -->
</template>
</van-radio>
</van-radio-group>
</div>
</div>
</div> </div>
</template> </template>


@@ -84,7 +113,17 @@ export default {
return { return {
topupTitle: "请选择套餐充值激活电话卡", topupTitle: "请选择套餐充值激活电话卡",
wxItem: "", 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: "", //订单号 outTradeNo: "", //订单号
price: "", //价格, price: "", //价格,
isShowNoData: false, //是否显示无套餐内容, 默认false isShowNoData: false, //是否显示无套餐内容, 默认false
@@ -95,6 +134,10 @@ export default {
appId: '', appId: '',


}, },
radio: '1',
payProductId: null,
packageIssue: null,
payType: '1',
}; };
}, },
computed: { computed: {
@@ -108,7 +151,7 @@ export default {
created() { created() {
this.getParams(); this.getParams();
this.getWxAutograph(); this.getWxAutograph();
this.getLiveBasePackage();
/* this.getLiveBasePackage(); */
}, },
/* mounted() { /* mounted() {
this.getParams(); this.getParams();
@@ -197,7 +240,8 @@ export default {
.catch(error => { .catch(error => {
this.$dialog.confirm({ this.$dialog.confirm({
title: "获取套餐数据失败", title: "获取套餐数据失败",
message: error
message: error,
showCancelButton: false,
}); });
}) })
.finally(() => { .finally(() => {
@@ -243,18 +287,26 @@ export default {
}, },
// 话费充值 // 话费充值
onBuy(data) { onBuy(data) {
let payType = data.packagePayType;
this.price = data.packagePrice; 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); this.aliPay(data);
} else { } else {
let openId = this.$store.getters.openId; let openId = this.$store.getters.openId;
if(openId === null || openId === 'null') { if(openId === null || openId === 'null') {
this.$dialog.confirm({ this.$dialog.confirm({
message: '微信支付在调整中,请选择其它支付方式'
message: '微信支付在调整中,请选择其它支付方式',
showCancelButton: false,
}) })
} else { } else {
this.packageIssue = 1;
this.wxPay(data); this.wxPay(data);
console.log("openid为空"); console.log("openid为空");
} }
@@ -270,10 +322,10 @@ export default {
let reqBody = { let reqBody = {
openId: this.$store.getters.openId, //openId openId: this.$store.getters.openId, //openId
imei: this.params.imei, //imei 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 //总金额单位为分,测试环境写死 packagePrice: process.env.NODE_ENV === "production" ? data.packagePrice * 100 : 1 //总金额单位为分,测试环境写死
}; };
APICore.payLiveBaseDevice(reqBody) APICore.payLiveBaseDevice(reqBody)
@@ -320,7 +372,7 @@ export default {
iccid: that.params.iccid, iccid: that.params.iccid,
isAdmin: that.$route.query.isAdmin || false, isAdmin: that.$route.query.isAdmin || false,
serialNo: that.params.imei, serialNo: that.params.imei,
issue: data.packageIssue
issue: that.packageIssue
} }
}); });
console.log("微信支付成功::", res); console.log("微信支付成功::", res);
@@ -358,10 +410,10 @@ export default {
let reqBody = { let reqBody = {
openId: this.$store.getters.openId, //openId openId: this.$store.getters.openId, //openId
imei: this.params.imei, //imei 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 //总金额单位为分,测试环境写死 packagePrice: process.env.NODE_ENV === "production" ? data.packagePrice * 100 : 1 //总金额单位为分,测试环境写死
}; };
this.$toast.clear(); this.$toast.clear();
@@ -379,7 +431,7 @@ export default {
let alipayForm = decodeURI(alipayData.payXmlStr); let alipayForm = decodeURI(alipayData.payXmlStr);
that.$store.commit("isFromWx", true); that.$store.commit("isFromWx", true);
let alipayUserId = process.env.NODE_ENV === "production" ? 42 : 18 let alipayUserId = process.env.NODE_ENV === "production" ? 42 : 18
this.$router.push({
this.$router.replace({
name: "payResult", name: "payResult",
query: { query: {
rechargeUrl: rechargeUrl:
@@ -392,7 +444,7 @@ export default {
isAdmin: that.$route.query.isAdmin || false, isAdmin: that.$route.query.isAdmin || false,
serialNo: that.params.imei, serialNo: that.params.imei,
alipayUserId: alipayUserId, alipayUserId: alipayUserId,
productId: data.pechargeUrl
productId: this.payProductId
} }
}); });
}) })
@@ -413,6 +465,10 @@ export default {
return "2" return "2"
/* break; */ /* break; */
} }
},
onRaidoChange(value) {
console.log("选择的支付类型是", value);
this.payType = value;
} }
} }
}; };
@@ -476,7 +532,7 @@ export default {
} }
.package-order-container { .package-order-container {
position: relative; position: relative;
height: 120px;
height: 140px;
width: 300px; width: 300px;
padding: 5px 20px; padding: 5px 20px;
margin: 10px 0; margin: 10px 0;
@@ -555,6 +611,14 @@ export default {
} }
} }
} }
.remark {
display: flex;
justify-content: flex-start;
p {
font-size: 14px;
/* font-weight: bold; */
}
}
} }
.content { .content {
font-size: 14px; font-size: 14px;
@@ -580,5 +644,23 @@ export default {
padding: 10px 0 0 0; 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;
}
}
}
} }
</style> </style>

+ 18
- 8
src/views/pay-result/index.vue Bestand weergeven

@@ -1,7 +1,7 @@
<!-- <!--
* @Date: 2023-02-24 16:47:33 * @Date: 2023-02-24 16:47:33
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 16:30:36
* @LastEditTime: 2023-02-26 10:37:34
* @FilePath: \TelpoH5FrontendWeb\src\views\pay-result\index.vue * @FilePath: \TelpoH5FrontendWeb\src\views\pay-result\index.vue
* @description: * @description:
--> -->
@@ -89,7 +89,7 @@ export default {
} }
}, },
onNavBack() { onNavBack() {
this.$router.push({
this.$router.replace({
name: "packageList", name: "packageList",
query: { query: {
serialNo: this.$route.query.serialNo, serialNo: this.$route.query.serialNo,
@@ -131,13 +131,23 @@ export default {
message: `电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。`, message: `电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。`,
showCancelButton: false showCancelButton: false
}) })
/* Dialog.confirm({ title: "SIM卡激活失败", message: data.message, className: "device_confirm", }); */
} else if (data.stateCode === 1 && data.message !== 'ok') { } 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') { } 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 => { .catch(error => {
@@ -200,7 +210,7 @@ export default {
} }
that.timer = setInterval(() => { that.timer = setInterval(() => {
that.count++; that.count++;
APIPay.getAlipayResult(reqBody)
APIPay.getWxPayResult(reqBody)
.then(res => { .then(res => {
if (res.data.code === 20000) { if (res.data.code === 20000) {
this.pageShow = true; this.pageShow = true;


+ 3
- 3
vue.config.js Bestand weergeven

@@ -1,7 +1,7 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-04-15 10:00:32 * @Date: 2020-04-15 10:00:32
* @LastEditTime: 2023-02-25 15:35:15
* @LastEditTime: 2023-02-26 09:19:56
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \TelpoH5FrontendWeb\vue.config.js * @FilePath: \TelpoH5FrontendWeb\vue.config.js
@@ -52,8 +52,8 @@ module.exports = {
}), }),
pxtorem({ pxtorem({
rootValue: 37.5, // 换算的基数 rootValue: 37.5, // 换算的基数
// rootValue: 75, // 换算的基数
/* selectorBlackList: ["van"], */
/* rootValue: 75, */ // 换算的基数
selectorBlackList: ["van"],
propList: ["*"], propList: ["*"],
//exclude: /node_modules/ //exclude: /node_modules/
}) })


Laden…
Annuleren
Opslaan