Переглянути джерело

update

- 开放 微信支付
- 修改 支付宝全额支付参数,0表示全额,12表示分期
feat
JinxChen 1 рік тому
джерело
коміт
fd218fca36
5 змінених файлів з 60 додано та 32 видалено
  1. +8
    -1
      README.md
  2. +13
    -0
      src/config/appId.js
  3. +1
    -1
      src/config/models.js
  4. +11
    -9
      src/views/package-home/index.vue
  5. +27
    -21
      src/views/package-list/index.vue

+ 8
- 1
README.md Переглянути файл

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-08-17 16:19:13
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 18:17:53
* @LastEditTime: 2023-02-28 14:55:00
* @FilePath: \TelpoH5FrontendWeb\README.md
* @description: 项目说明
-->
@@ -227,3 +227,10 @@ update
`2023.2.27`
update
- 优化 支付方式选择页面


## v1.0.26
`2023.2.28`
update
- 开放 微信支付
- 修改 支付宝全额支付参数,0表示全额,12表示分期

+ 13
- 0
src/config/appId.js Переглянути файл

@@ -0,0 +1,13 @@
/*
* @Date: 2022-03-19 19:57:20
* @LastEditors: JinxChen
* @LastEditTime: 2022-10-12 16:50:09
* @FilePath: \ParentWeb\src\config\appId.js
* @description:
*/
const AppId = process.env.NODE_ENV === 'production' ?
'wx23f697736154110b' :
process.env.VUE_APP_BASE_API.indexOf('ai.ssjlai.com') > -1 ?
'wx23f697736154110b':
/* 'wx785c95a3e7f46f72' */'wx5e26f0813859e5f6'; //wx5e26f0813859e5f6 2022.10.12 更改测试公众号
export default AppId;

+ 1
- 1
src/config/models.js Переглянути файл

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


+ 11
- 9
src/views/package-home/index.vue Переглянути файл

@@ -1,12 +1,14 @@
<!--
* @Date: 2023-02-24 14:18:25
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-26 08:56:34
* @LastEditTime: 2023-02-28 14:53:14
* @FilePath: \TelpoH5FrontendWeb\src\views\package-home\index.vue
* @description:
-->
<template>
<div class="package-home"></div>
<div class="package-home">

</div>
</template>

<script>
@@ -23,9 +25,9 @@ export default {
};
},
created() {
this.getParams();
this.getToken();
this.getAuth();
this.getParams();
this.checkBrowser();
},
methods: {
@@ -34,9 +36,9 @@ export default {
const userAgent = window.navigator.userAgent;
console.log("浏览器内核", userAgent);
if (/AlipayClient/.test(userAgent)) {
console.log("alipay");
console.log("支付宝");
} else if (/MicroMessenger/.test(userAgent)) {
console.log("wx");
console.log("微信");
let url = window.location.href.split("?code=")[1];
console.log("获取授权code的url", url);
if (
@@ -51,10 +53,9 @@ export default {
}
} else {
this.getWxCode();
console.log("获取token");
}
} else {
this.getWxCode();
/* this.getWxCode(); */
console.log("当前浏览器内核并非支付宝或者微信");
}
},
@@ -96,7 +97,7 @@ export default {
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`;
if(params.imei) {
/* if(params.imei) {
this.$router.replace({
name: 'packageList',
query: {
@@ -106,7 +107,8 @@ export default {
})
} else {
window.location.href = url;
}
} */
window.location.href = url;
},
// 获取url传过来的参数
getParams() {


+ 27
- 21
src/views/package-list/index.vue Переглянути файл

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-03-29 16:57:58
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-27 18:25:19
* @LastEditTime: 2023-02-28 14:58:08
* @FilePath: \TelpoH5FrontendWeb\src\views\package-list\index.vue
* @description: TODO 小台风充值h5
-->
@@ -125,7 +125,7 @@
</template>
</van-radio>
</van-radio-group> -->
<van-radio-group v-model="radio" @change="onRaidoChange">
<!-- <van-radio-group v-model="radio" @change="onRaidoChange">
<van-cell-group border >
<van-cell clickable @click="radio = '1'" center>
<template #default>
@@ -161,8 +161,9 @@
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</van-radio-group> -->
</div>

</div>
</div>
</template>
@@ -174,6 +175,7 @@ let wx = require("weixin-js-sdk"); // TODO 再封装,可拦截错误提示等
import APICore from "@/api/core";
import axios from "axios";
import { isNotNull } from "@/utils/index";
import AppId from "@/config/appId";
export default {
name: "packageList",
data() {
@@ -328,7 +330,7 @@ export default {
APIWx.createJSSDK({
sUrl: window.location.href.split("#")[0],
userId: '',
appId: this.params.appId
appId: this.params.appId || AppId
})
.then(res => {
let item = res.data.data;
@@ -359,7 +361,7 @@ export default {
// 需要区分是要用微信支付还是支付宝花呗支付
if (this.payType === '2') {
this.payProductId = process.env.NODE_ENV === "production" ? '1629407413618294784' : '1629405716684029952', //支付宝全额支付
this.packageIssue = 1;
this.packageIssue = 0;
this.aliPay(data);
} else if (this.payType === '3') {
this.payProductId = process.env.NODE_ENV === "production" ? '1629407705558630400': '1629405558344859648', //支付宝花呗支付
@@ -370,17 +372,17 @@ export default {
let openId = this.$store.getters.openId;
if(openId === null || openId === 'null') {
this.$dialog.confirm({
message: '微信支付在调整中,请选择其它支付方式',
message: '获取OpenId失败,请您重新进入',
showCancelButton: false,
})
} else {
this.packageIssue = 1;
/* this.packageIssue = 1;
this.$dialog.confirm({
message: '微信支付在调整中,请选择其它支付方式',
showCancelButton: false,
})
}) */
// todo 暂时取消开放微信支付
//this.wxPay(data);
this.wxPay(data);
console.log("openid为空");
}
}
@@ -526,6 +528,10 @@ export default {
})
.catch(error => {
console.log("error", error);
this.$dialog.confirm({
message: `${error.message}`,
showCancelButton: false
})
})
.finally(() => {
this.$toast.clear();
@@ -561,14 +567,14 @@ export default {
height: 100vh;
.topup-container {
position: relative;
margin: 20px;
/* margin: 20px; */
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: column;
background-color: white;
overflow: scroll;
/* height: calc(100vh - 4rem); */
height: calc(100vh - 88px);
.main {
display: flex;
justify-content: center;
@@ -609,10 +615,8 @@ export default {
}
.package-order-container {
position: relative;
/* height: 140px; */
width: 300px;
margin: 10px 0;
padding: 0 10px;
padding: 0 20px;
z-index: 999;
box-shadow: rgba(14, 30, 37, 0.12) 0 3px 5px 0,
rgba(14, 30, 37, 0.32) 0 2px 16px 0;
@@ -683,19 +687,20 @@ export default {
.price {
font-size: 16px;
}
.buy-btn {
/* .buy-btn {
height: 30px;
width: 90px;
width: 100px;
display: flex;
justify-content: center;
align-items: center;
background: orange;
border-radius: 20px;
border-radius: 45px;
p {
font-size: 16px;
padding: 0;
color: white;
color: red;
}
}
} */
}
.remark {
display: flex;
@@ -715,8 +720,9 @@ export default {
justify-content: center;
align-items: center;
background: orange;
border-radius: 30px;
border-radius: 20px;
p {
font-size: 16px;
padding: 0;
color: white;
}
@@ -775,7 +781,7 @@ export default {
justify-content: flex-start;
align-items: flex-start;
flex-direction: column;
padding: 5px 0 10px 25px;
padding: 5px 0 10px 10px;
h5 {
font-size: 14px;
padding: 10px 0 0 0;


Завантаження…
Відмінити
Зберегти