Browse Source

Merge branch 'develop' into test

test
JinxChen 1 year ago
parent
commit
94d1a87595
10 changed files with 154 additions and 41 deletions
  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 View File

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


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

+ 7
- 0
src/api/pay.js View File

@@ -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 = {


BIN
src/assets/wx_pay_icon.png View File

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

+ 1
- 1
src/config/models.js View File

@@ -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/',


+ 2
- 3
src/main.js View File

@@ -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();


+ 8
- 1
src/views/index.vue View File

@@ -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>
<div></div>
</template>
@@ -12,7 +19,7 @@ export default {
},
methods: {
onClick() {
this.$router.push({
this.$router.replace({
name: 'packageList',
query: {
imei: '45555'


+ 2
- 2
src/views/package-home/index.vue View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2023-02-24 14:18:25
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 18:08:22
* @LastEditTime: 2023-02-26 08:56:34
* @FilePath: \TelpoH5FrontendWeb\src\views\package-home\index.vue
* @description:
-->
@@ -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,


+ 104
- 22
src/views/package-list/index.vue View File

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

</div>
<div class="remark">
<p>每月200分钟通话时长,1G流量。</p>
</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>
</template>

@@ -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;
}
}
}
}
</style>

+ 18
- 8
src/views/pay-result/index.vue View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2023-02-24 16:47:33
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 16:30:36
* @LastEditTime: 2023-02-26 10:37:34
* @FilePath: \TelpoH5FrontendWeb\src\views\pay-result\index.vue
* @description:
-->
@@ -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;


+ 3
- 3
vue.config.js View File

@@ -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/
})


Loading…
Cancel
Save