Browse Source

update

- 充值首页
    - 修改 页面跳转逻辑
        # 有基础套餐时
            # 已支付,跳转话费查询页面
            # 未支付, 跳转套餐充值页面
         # 无基础套餐时
            #是零川或者小台风,跳转话费查询页面
            #否则跳转错误页面
    - 增加 一个物联网卡的错误页面
test
JinxChen 1 year ago
parent
commit
4904577a95
7 changed files with 128 additions and 23 deletions
  1. +15
    -1
      README.md
  2. +2
    -2
      src/App.vue
  3. +1
    -1
      src/config/models.js
  4. +1
    -1
      src/main.js
  5. +3
    -1
      src/router/index.js
  6. +36
    -0
      src/views/error-pages/iotcard-error.vue
  7. +70
    -17
      src/views/package-home/index.vue

+ 15
- 1
README.md View File

@@ -690,4 +690,18 @@ update
## v1.0.86
`2023.9.18`
update
- 增加 建模答题错误提示弹窗
- 增加 建模答题错误提示弹窗


## v1.0.87
`2023.9.20`
update
- 充值首页
- 修改 页面跳转逻辑
# 有基础套餐时
# 已支付,跳转话费查询页面
# 未支付, 跳转套餐充值页面
# 无基础套餐时
#是零川或者小台风,跳转话费查询页面
#否则跳转错误页面
- 增加 一个物联网卡的错误页面

+ 2
- 2
src/App.vue View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-01-19 10:08:26
* @LastEditors: JinxChen
* @LastEditTime: 2023-04-08 17:05:46
* @LastEditTime: 2023-09-20 15:13:58
* @FilePath: \TelpoH5FrontendWeb\src\App.vue
* @description:
-->
@@ -26,7 +26,7 @@ export default {
},
mounted() {
this.debug();
console.log("当前版本号::", VERSION_MODEL, "当前环境::", process.env.NODE_ENV, this.$title);
console.log("当前版本号::", VERSION_MODEL, "当前环境::", process.env.NODE_ENV);

},
methods: {


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

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


+ 1
- 1
src/main.js View File

@@ -1,7 +1,7 @@
/*
* @Date: 2022-01-19 10:08:26
* @LastEditors: JinxChen
* @LastEditTime: 2023-05-30 10:58:58
* @LastEditTime: 2023-09-20 14:15:47
* @FilePath: \TelpoH5FrontendWeb\src\main.js
* @description:
*/


+ 3
- 1
src/router/index.js View File

@@ -1,7 +1,7 @@
/*
* @Date: 2023-06-01 18:41:50
* @LastEditors: JinxChen
* @LastEditTime: 2023-06-07 10:40:03
* @LastEditTime: 2023-09-20 11:15:50
* @FilePath: \TelpoH5FrontendWeb\src\router\index.js
* @description:
*/
@@ -57,6 +57,8 @@ const routes = [

// 告警详情-中间页
{ path: '/aiCallAlarm', name: 'aiCallAlarm', component: resolve => require(['@/views/ai-call-alarm'], resolve) },
// 物联网卡错误页
{ path: '/iotcardError', name: 'iotcardError', component: resolve => require(['@/views/error-pages/iotcard-error'], resolve) },
];

const router = new VueRouter({


+ 36
- 0
src/views/error-pages/iotcard-error.vue View File

@@ -0,0 +1,36 @@
<template>
<div class="error">
<div class="tips">
<p>非本平台配送的电话卡。</p>
<!-- <p>无此服务。</p> -->
</div>
</div>
</template>

<script>
export default {
name: 'iotcard-error',
data(){
return {

}
}
}
</script>

<style scoped lang="scss">
.error {
height: 100vh;
background-color: #fff;
@include center();
.tips {
p {
font-size: 16px;
color: #000;
padding: 10px;
text-align: left;
font-weight: 500;
}
}
}
</style>

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

@@ -1,7 +1,7 @@
<!--
* @Date: 2023-02-24 14:18:25
* @LastEditors: JinxChen
* @LastEditTime: 2023-04-17 16:34:52
* @LastEditTime: 2023-09-20 14:20:27
* @FilePath: \TelpoH5FrontendWeb\src\views\package-home\index.vue
* @description:
-->
@@ -23,22 +23,53 @@ export default {
return {
params: {}, //获取路由的参数
isRecharge: null, //是否已经支付
isHasBasePackage: null, //是否存在基础套餐
whiteTitleList: ['小台风', '零川'], //白名单物联网卡列表
currentIotTitle: '', //当前设备所属物联网名字
};
},
created() {
/* this.getToken(); */
this.getAuth();
},
mounted() {
this.getParams();
},
methods: {
// 2023.09.20 修改需求 进入首页同时查套餐和充值状态
// 1.无基础套餐卡不是零川或者小台风,跳转错误页面
// 2.无基础套餐卡但是零川或者小台风,跳转话费查询页面
// 3.如果有基础套餐并且已充值,跳转费查询页面
// 4.如果有基础套餐但未充值,跳转套餐充值页面
getDevicePayPackage() {
return new Promise((resolve, reject) => {
APICore.devicePayPackage(this.params.imei)
.then(res => {
let data = res.data;
if (data.code === 106 || data.code === 104) {
this.getAuth();
setTimeout(() => {
this.getDevicePayPackage();
}, 1500);
} else {
// 筛选是否存在基础套餐, producModelId = 1 是基础套餐, 2 是加油包
const isHasBasePackage = data.data.packagesList.some(res => {
return res.producModelId === 1;
});
resolve(isHasBasePackage);
}
}).catch(e => {
reject(false);
})
})
},
checkImei() {
let reqBody = {
imei: this.params.imei,
iccid: this.params.iccid || ''
};
APIWx.CheckImei(reqBody).then(res =>{
console.log("res", res.data.isRecharge);
this.isRecharge = res.data.isRecharge;
this.currentIotTitle = res.data.title;
this.getWxCode();
}).catch(e => {
console.log("e", e.message);
@@ -107,16 +138,39 @@ export default {
getWxCode() {
let params = this.params;
let commonUrl = process.env.VUE_APP_BASE_API;
// todo 暂时去掉
if(this.isRecharge) {
// 如果是已经支付,但未激活,跳转激活界面
/* this.$router.replace({
name: 'cardActive',
query: {
imei: params.imei,
iccid: params.iccid
}
}) */
let isWhiteTitle = this.whiteTitleList.includes(this.currentIotTitle) > 0;
let cardInfoBaseUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/cardInfo?imei=${params.imei}&iccid=${params.iccid}`);
let toupBaseUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&iccid=${params.iccid}`);
if(this.isHasBasePackage) {
// 有套餐
if(this.isRecharge) {
// 已支付,跳转话费查询页面
console.log("有套餐跳转话费查询页面");
let wxRedUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${AppId}&redirect_uri=${cardInfoBaseUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`;
window.location.href = wxRedUrl;
} else if (!this.isRecharge) {
// 未支付, 跳转套餐充值页面
console.log("跳转套餐充值页面");
let wxRedUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${AppId}&redirect_uri=${toupBaseUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`;
window.location.href = wxRedUrl;
}
} else {
// 无套餐
if(isWhiteTitle) {
// 是零川或者小台风,跳转话费查询页面
let wxRedUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${AppId}&redirect_uri=${cardInfoBaseUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`;
window.location.href = wxRedUrl;
console.log("无套餐跳转话费查询页面");
} else {
// 跳转错误页面;
this.$router.replace({
name: 'iotcardError'
})
console.log("跳转错误页面");
}
}
// 2023.09.20 废弃
/* if(this.isRecharge) {
let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/cardInfo?imei=${params.imei}&iccid=${params.iccid}`);
let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${AppId}&redirect_uri=${redUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`;
window.location.href = url;
@@ -124,23 +178,22 @@ export default {
let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&iccid=${params.iccid}`);
let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${AppId}&redirect_uri=${redUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`;
window.location.href = url;
}
} */

},
// 获取url传过来的参数
getParams() {
async getParams() {
let params = this.$route.query;
if (params) {
console.log("params", params);
this.params = {...params};
this.$store.commit("appId", AppId);
if(params.reqUrl) {
const reqUrl = encodeURI(params.reqUrl);
window.location.href = reqUrl;
} else {
this.isHasBasePackage = await this.getDevicePayPackage();
this.checkImei();
}
console.log("this.params", this.params);
}
},
}


Loading…
Cancel
Save