Преглед на файлове

Merge branch 'develop' into rel-master

feat
JinxChen преди 1 година
родител
ревизия
ab0b06ad2b
променени са 25 файла, в които са добавени 1439 реда и са изтрити 171 реда
  1. +64
    -2
      README.md
  2. +78
    -0
      package-lock.json
  3. +7
    -5
      package.json
  4. +11
    -2
      src/api/core.js
  5. +7
    -0
      src/api/pay.js
  6. +27
    -0
      src/api/wx.js
  7. Двоични данни
      src/assets/img/news-noData.png
  8. Двоични данни
      src/assets/img/unicom.png
  9. Двоични данни
      src/assets/img/yidong_logo.png
  10. Двоични данни
      src/assets/online.png
  11. Двоични данни
      src/assets/wx-pay.png
  12. Двоични данни
      src/assets/wx_pay_icon.png
  13. +13
    -0
      src/config/appId.js
  14. +3
    -3
      src/config/models.js
  15. +4
    -3
      src/main.js
  16. +15
    -3
      src/router/index.js
  17. +143
    -0
      src/views/active-status/index.vue
  18. +195
    -0
      src/views/buy-record/index.vue
  19. +163
    -0
      src/views/card-active/index.vue
  20. +316
    -0
      src/views/card-info/index.vue
  21. +9
    -2
      src/views/index.vue
  22. +54
    -19
      src/views/package-home/index.vue
  23. +266
    -104
      src/views/package-list/index.vue
  24. +61
    -25
      src/views/pay-result/index.vue
  25. +3
    -3
      vue.config.js

+ 64
- 2
README.md Целия файл

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-08-17 16:19:13
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-24 18:49:37
* @LastEditTime: 2023-03-02 01:14:22
* @FilePath: \TelpoH5FrontendWeb\README.md
* @description: 项目说明
-->
@@ -187,4 +187,66 @@ feature
## v1.0.19
`2023.2.25`
fix
- 修复 路由切换页面不刷新的问题
- 修复 路由切换页面不刷新的问题

## v1.0.20
`2023.2.25`
fix
- 修复 调起微信支付异常的问题
- 修复 获取imei异常的问题
- 修改 获取openId方式

## v1.0.21
`2023.2.25`
update
- 暂时只开放支付宝支付


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


## v1.0.23
`2023.2.26`
update
- 增加 激活成功显示页面


## v1.0.24
`2023.2.27`
update
- 增加 激活成功页面在线图标
- 优化 支付方式选择页面


## v1.0.25
`2023.2.27`
update
- 优化 支付方式选择页面


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


## v1.0.27
`2023.3.1`
feature
- 增加 已购买未激活容错页面
- 修复 已购买未激活未跳转容错页面的问题
- 修改 激活界面文字提示
- 修改 页面支付逻辑,由未激活充值购买变成已激活充值购买
- 增加 已购买未激活容错页面


## v1.0.28
`2023.3.2`
update
- 修改 最后一步按钮文案

+ 78
- 0
package-lock.json Целия файл

@@ -11,7 +11,9 @@
"@vant/area-data": "^1.2.2",
"amfe-flexible": "^2.2.1",
"axios": "^0.26.0",
"clipboard": "^2.0.11",
"core-js": "^3.6.5",
"dayjs": "^1.11.7",
"html2canvas": "^1.4.1",
"nprogress": "^0.2.0",
"rxjs": "^7.8.0",
@@ -5391,6 +5393,16 @@
"node": ">= 10"
}
},
"node_modules/clipboard": {
"version": "2.0.11",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz",
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"dependencies": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"node_modules/clipboardy": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz",
@@ -6556,6 +6568,11 @@
"integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==",
"dev": true
},
"node_modules/dayjs": {
"version": "1.11.7",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz",
"integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ=="
},
"node_modules/de-indent": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",
@@ -6884,6 +6901,11 @@
"node": ">=0.4.0"
}
},
"node_modules/delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"node_modules/depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@@ -8838,6 +8860,14 @@
"node": ">=6"
}
},
"node_modules/good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"dependencies": {
"delegate": "^3.1.2"
}
},
"node_modules/graceful-fs": {
"version": "4.2.9",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
@@ -16159,6 +16189,11 @@
"url": "https://opencollective.com/webpack"
}
},
"node_modules/select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
},
"node_modules/select-hose": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
@@ -17873,6 +17908,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
},
"node_modules/tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
@@ -24225,6 +24265,16 @@
"integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==",
"dev": true
},
"clipboard": {
"version": "2.0.11",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz",
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"clipboardy": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz",
@@ -25169,6 +25219,11 @@
"integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==",
"dev": true
},
"dayjs": {
"version": "1.11.7",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz",
"integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ=="
},
"de-indent": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",
@@ -25418,6 +25473,11 @@
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"dev": true
},
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@@ -26966,6 +27026,14 @@
"slash": "^2.0.0"
}
},
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"requires": {
"delegate": "^3.1.2"
}
},
"graceful-fs": {
"version": "4.2.9",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
@@ -32814,6 +32882,11 @@
"ajv-keywords": "^3.5.2"
}
},
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
},
"select-hose": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
@@ -34250,6 +34323,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
},
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",


+ 7
- 5
package.json Целия файл

@@ -12,10 +12,11 @@
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"@vant/area-data": "^1.2.2",
"amfe-flexible": "^2.2.1",
"axios": "^0.26.0",
"core-js": "^3.6.5",
"dayjs": "^1.11.7",
"html2canvas": "^1.4.1",
"nprogress": "^0.2.0",
"rxjs": "^7.8.0",
@@ -23,7 +24,8 @@
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"weixin-js-sdk": "^1.6.0"
"weixin-js-sdk": "^1.6.0",
"clipboard": "^2.0.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
@@ -34,16 +36,16 @@
"@vue/test-utils": "^1.0.3",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.3",
"compression-webpack-plugin": "^5.0.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^6.2.2",
"lint-staged": "^9.5.0",
"postcss-pxtorem": "^5.1.1",
"prettier": "^2.2.1",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11",
"postcss-pxtorem": "^5.1.1",
"compression-webpack-plugin": "^5.0.0"
"vue-template-compiler": "^2.6.11"
},
"gitHooks": {
"pre-commit": "lint-staged"


+ 11
- 2
src/api/core.js Целия файл

@@ -1,7 +1,7 @@
/*
* @Date: 2021-12-18 15:49:01
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-24 10:03:15
* @LastEditTime: 2023-02-25 17:04:23
* @FilePath: \TelpoH5FrontendWeb\src\api\core.js
* @description:
* b端的接口, 每次调用前先获取token
@@ -27,6 +27,7 @@ export const APICore = {
QueryLiveBasePackage, //获取基本套餐
payLiveBaseDevice, //微信统一下单
GpsDeviceFence, //围栏 redis
cardPackageList, //零川基础套餐列表
}
/* const headerAuth = this.$store.getters.gatewayToken; */
// 获取告警详情
@@ -76,4 +77,12 @@ function payLiveBaseDevice(params) {
data: params
});
}
export default APICore;

function cardPackageList(data) {
return service({
url: `${baseUrl}/core/api/v1/open/card/QueryIotCardPackage`,
method: 'post',
data,
});
}
export default APICore;

+ 7
- 0
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 = {


+ 27
- 0
src/api/wx.js Целия файл

@@ -13,6 +13,9 @@ const APIWx = {
checkIsNewCustomer, //获取微信用户是否首次关注,即是否是新用户
ocr, //ocr识别
Effective, //激活接口
GetCardInfo,
LckjGetOrderPackageShow,
CheckImei,
}
export default APIWx;
function createJSSDK({ userId, sUrl, appId }) {
@@ -46,4 +49,28 @@ function Effective(params) {
method: 'post',
data: params,
});
}
//获取物联网卡信息
function GetCardInfo(params) {
return request({
url: '/api/Command/GetCardInfo',
method: 'post',
data: params,
});
}
// 随手精灵(查询零川物联卡加油包已订购套餐)
function LckjGetOrderPackageShow({ iccid, imei }){
return request({
url: '/api/IOTCard/LckjGetOrderPackageShow',
method: 'get',
params: { iccid, imei}
})
}
//检查imei属于哪家厂商
function CheckImei(params) {
return request({
url: '/api/Command/CheckImei',
method: 'post',
data: params,
});
}

Двоични данни
src/assets/img/news-noData.png Целия файл

Before After
Width: 336  |  Height: 236  |  Size: 16KB

Двоични данни
src/assets/img/unicom.png Целия файл

Before After
Width: 164  |  Height: 138  |  Size: 13KB

Двоични данни
src/assets/img/yidong_logo.png Целия файл

Before After
Width: 138  |  Height: 138  |  Size: 16KB

Двоични данни
src/assets/online.png Целия файл

Before After
Width: 107  |  Height: 37  |  Size: 8.5KB

Двоични данни
src/assets/wx-pay.png Целия файл

Before After
Width: 81  |  Height: 81  |  Size: 2.3KB

Двоични данни
src/assets/wx_pay_icon.png Целия файл

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

+ 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;

+ 3
- 3
src/config/models.js Целия файл

@@ -1,11 +1,11 @@
/*
* @Date: 2021-11-20 10:26:39
* @LastEditors: JinxChen
* @LastEditTime: 2022-07-21 16:41:11
* @FilePath: \AntpayFrontEnd\src\config\models.js
* @LastEditTime: 2023-02-27 09:59:02
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description:
*/
export const VERSION_MODEL = '1.0.19F'; //版本号
export const VERSION_MODEL = '1.0.28F'; //版本号
export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/',


+ 4
- 3
src/main.js Целия файл

@@ -1,7 +1,7 @@
/*
* @Date: 2022-01-19 10:08:26
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 15:44:55
* @LastEditTime: 2023-02-26 14:40:46
* @FilePath: \TelpoH5FrontendWeb\src\main.js
* @description:
*/
@@ -11,6 +11,7 @@ import App from "./App.vue";
import router from "./router";
import store from "./store";
import '@/assets/css/reset.scss';
import dayjs from 'dayjs';
// ui库按需引入
import 'vant/lib/index.css';
import {
@@ -107,10 +108,10 @@ Toast.setDefaultOptions('loading', {
});
Dialog.setDefaultOptions({
confirmButtonColor: "#3296fa",
cancelButtonColor: "#999",
showCancelButton: false
showCancelButton: false,
});
Vue.config.productionTip = false;
Vue.prototype.$dayjs = dayjs;
Vue.prototype.$bus = new Vue();
new Vue({
router,


+ 15
- 3
src/router/index.js Целия файл

@@ -1,7 +1,14 @@
/*
* @Date: 2023-02-25 16:34:35
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-26 15:30:31
* @FilePath: \TelpoH5FrontendWeb\src\router\index.js
* @description:
*/
/*
* @Date: 2022-01-19 10:08:26
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 15:56:31
* @LastEditTime: 2023-02-25 16:33:59
* @FilePath: \TelpoH5FrontendWeb\src\router\index.js
* @description:
*/
@@ -17,6 +24,11 @@ const routes = [
{ path: '/packageHome', name: 'packageHome', component: resolve => require(['@/views/package-home'], resolve) },
{ path: '/packageList', name: 'packageList', component: resolve => require(['@/views/package-list'], resolve) },
{ path: '/payResult', name: 'payResult', component: resolve => require(['@/views/pay-result'], resolve) },
{ path: '/cardInfo', name: 'cardInfo', component: resolve => require(['@/views/card-info'], resolve) },
{ path: '/buyRecord', name: 'buyRecord', component: resolve => require(['@/views/buy-record'], resolve) },
{ path: '/activeStatus', name: 'activeStatus', component: resolve => require(['@/views/active-status'], resolve) },
{ path: '/cardActive', name: 'cardActive', component: resolve => require(['@/views/card-active'], resolve) },


];

@@ -26,11 +38,11 @@ const router = new VueRouter({
routes,
});
router.beforeEach((to, form, next) => {
Nprogress.start();
/* Nprogress.start(); */
next();
});
router.afterEach(() => {
Nprogress.done();
/* Nprogress.done(); */
});

export default router;

+ 143
- 0
src/views/active-status/index.vue Целия файл

@@ -0,0 +1,143 @@
<template>
<div class="active-container" v-show="isPageShow">
<div class="header">
<van-icon name="passed" size="80" color="green" v-if="isActive"/>
<van-icon name="warning-o" size="80" color="red" v-else/>
</div>
<div class="main">
<div class="text success" v-if="isActive">
<p>激活成功,请重启设备,看到连接平台</p>
<div class="img">图标<img src="../../assets/online.png"/>后,则可正常使用。</div>
</div>
<div class="text fail" v-else>
<p>电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。</p>
</div>
</div>
<van-button type="primary" size="large" @click="onBackHome">返回首页</van-button>
</div>
</template>

<script>
import { isNotNull} from "@/utils/index";
import APIWx from "@/api/wx";
export default {
name:'',
data(){
return {
isPageShow: false,
isActive: null,
}
},
created() {
this.effective();
},
methods: {
// 激活接口
effective() {
this.$toast.loading('激活中,请稍候...');
let reqBody = {
imei: this.$route.query.serialNo,
iccid: this.$route.query.iccid || '',
issue: Number(this.$route.query.issue) || 0
};
APIWx.Effective(reqBody)
.then(res => {
console.log("res", res);
let data = res.data;
console.log("data", data);
this.$toast.clear();
if(data.stateCode !== 1) {
/* this.$dialog.confirm({
title: '温馨提示',
message: `${data.message}`,
showCancelButton: false
}) */
this.isPageShow = true;
this.isActive = false;
} else if(data.stateCode === 0 && data.message !== null) {
/* this.$dialog.confirm({
title: '温馨提示',
message: `电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。`,
showCancelButton: false
}) */
this.isPageShow = true;
this.isActive = false;
} else if (data.stateCode === 1 && data.message !== 'ok') {
/* this.$dialog.confirm({
title: "SIM卡激活成功",
message: '卡激活成功,5分钟后则可正常使用。',
showCancelButton: false,
confirmButtonText: '返回首页'}).then(() => {
document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
}); */
this.isPageShow = true;
this.isActive = true;
} else if (data.stateCode === 1 && data.message === 'ok') {
/* this.$dialog.confirm({
title: "SIM卡激活成功",
message: '卡激活成功,5分钟后则可正常使用。',
showCancelButton: false,
confirmButtonText: '返回首页'
}).then(() => {
document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
}); */
this.isPageShow = true;
this.isActive = true;
}
})
.catch(error => {
console.log("出错了:;", error);
this.$dialog.confirm({
title: '温馨提示',
message: `${error.message}`,
showCancelButton: false
})
}).finally(() => {
this.$toast.clear();
})
},
onBackHome() {
document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
}
}
}
</script>

<style scoped lang="scss">
.active-container {
height: 100vh;
padding: 40px 40px;
.header {
padding: 10px 0;
@include center();
}
.main {
width: 100%;
padding: 10px;
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-direction: column;
.text, p {
width: 100%;
font-size: 16px;
text-align: left;
font-weight: 500;
margin: 5px 0;
img {
height: 25px;
width: 60px;
margin: 0 5px;
}
.img {
display: flex;
justify-content: flex-start;
align-items: center;
}
}
}
.van-button {
margin-top: 20px;
}
}
</style>

+ 195
- 0
src/views/buy-record/index.vue Целия файл

@@ -0,0 +1,195 @@
<!--
* @Date: 2022-11-21 11:04:12
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-26 15:02:53
* @FilePath: \TelpoH5FrontendWeb\src\views\buy-record\index.vue
* @description:
-->
<template>
<div class="buy-record">
<van-nav-bar title="订购记录" left-arrow :border="true" @click-left="onNavBack"></van-nav-bar>
<div class="record-container" v-if="recordList.length > 0">
<div class="record-list" v-for="(item, index) in recordList" :key="index">
<div class="title">
<div class="title-left"><p class="order">充值套餐</p></div>
<div class="title-right" :data-clipboard-text="item.packageOrder" @click="onCopy('.title-right')">
<p>订单号<van-icon class="right-icon" name="description"/></p>
</div>
</div>
<div class="name">
<p>{{item.packageName}}</p>
</div>
<div class="bottom">
<div class="btn-left"><span>{{new Date(item.orderTime).Format("yyyy-MM-dd hh:mm")}}</span></div>
<div class="btn-right"><span>{{item.packagePrice}}</span><span class="btn-price">元</span></div>
</div>
</div>
</div>
<div class="data-null" v-else>
<img src="@/assets/img/news-noData.png" alt />
<span>暂无购买记录</span>
</div>
</div>
</template>

<script>
import Clipboard from 'clipboard';
import APIWx from "@/api/wx";
export default {
name:'',
data(){
return {
recordList: [
/* {
title: '充值套餐',
orderNumber: '20221122112424',
name: '50分钟语音月清资源包',
time: '2022-11-22 11:24:23',
price: '6.5'
},
{
title: '充值套餐',
orderNumber: '777777777',
name: '50分钟语音月清资源包',
time: '2022-11-22 11:24:23',
price: '6.5'
},
{
title: '充值套餐',
orderNumber: '555555',
name: '50分钟语音月清资源包',
time: '2022-11-22 11:24:23',
price: '6.5'
}, */
]
}
},
created() {
this.getLckjGetOrderPackageShow();
},
methods: {
getLckjGetOrderPackageShow() {
this.$toast.loading({
message: '数据加载中...'
})
let reqParams = {
imei: this.$route.query.imei,
iccid: this.$route.query.iccid
}
APIWx.LckjGetOrderPackageShow(reqParams).then(res => {
let data = res.data;
if(data.stateCode === 1) {
this.recordList = data.data;
this.$toast.success({
message: "数据加载成功",
duration: 1500
});
}
console.log("res", res);
}).catch(error => {
console.log("error");
}).finally(() => {
this.$toast.clear();
})
},
onNavBack() {
/* this.$router.push({
name: "check",
query: { serialNo: this.$route.query.serialNo, iccid: this.$route.query.iccid, isShowMenu: true}
}); */
},
// 复制订单号
onCopy(type) {
const clipboard = new Clipboard(type);
clipboard.on('success', e => {
this.$toast.success({
message: '已复制到粘贴板'
});
clipboard.destroy();
})
}

}
}
</script>

<style scoped lang="scss">
.buy-record {
height: 100vh;
.record-container {
position: relative;
height: calc(100vh - 88px);
padding: 15px;
overflow: scroll;
.record-list {
background-color: #fff;
padding: 15px;
margin-bottom: 20px;
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
p, span {
font-size: 16px;
}
.title {
display: flex;
justify-content: space-between;
align-items: center;
p {
font-size: 16px;
}
.title-right {
display: flex;
justify-content: space-between;
align-items: center;
p {
font-size: 16px;
color: $blue;
@include center();
.right-icon {
height: 20px !important;
width: 20px !important;
display: flex;
justify-content: flex-end;
align-items: center;
color: #1890ff !important;
}
}
}
}
.name {
margin-top: 20px;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
.btn-left {
span {
color: #999;
}
}
.btn-right {
span {
font-size: 20px;
color: #fca842;
}
.btn-price {
font-size: 16px
}
}
}
}
}
.data-null {
height: calc(100vh - 88px);
@include center();
flex-direction: column;
img {
height: 200px;
width: 300px;
}
span {
font-size: 16px;
}
}
}
</style>

+ 163
- 0
src/views/card-active/index.vue Целия файл

@@ -0,0 +1,163 @@
<template>
<div class="active-container" v-if="isPageShow">
<div class="header">
<van-icon name="passed" size="80" color="green" v-if="isActive"/>
<!-- <van-icon name="warning-o" size="80" color="red" v-else/> -->
</div>
<div class="main">
<div class="text success" v-if="isActive">
<p>激活成功,请重启设备,看到连接平台</p>
<p class="img">图标<img src="../../assets/online.png"/>后,则可正常使用。</p>
</div>
<div class="text fail" v-else>
<p>电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。</p>
</div>
</div>
<van-button type="primary" size="large" @click="onBackHome">返回首页</van-button>
</div>
</template>

<script>
import { isNotNull} from "@/utils/index";
import APIWx from "@/api/wx";
export default {
name:'',
data(){
return {
isPageShow: false,
isActive: null,
}
},
created() {
//this.effective();
this.onShowDialog();
},
methods: {
onShowDialog() {
// 检测到您已充值、但未激活电话卡。。。。
// 您已充值,按确定继续使用
let that = this;
this.$dialog.confirm({
title: '使用提示',
message: `<span>您已充值、按确定继续使用</span>`,
showCancelButton: false
}).then(() => {
/* that.$router.replace({
name: 'activeStatus',
query: {
serialNo: this.$route.query.imei,
iccid: this.$route.query.iccid || '',
}
}) */
document.location.replace("https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/SmartDigitalSsjl");
})
},
// 激活接口
effective() {
this.$toast.loading('激活中,请稍候...');
let reqBody = {
imei: this.$route.query.imei,
iccid: this.$route.query.iccid || '',
issue: Number(this.$route.query.issue) || 0
};
APIWx.Effective(reqBody)
.then(res => {
console.log("res", res);
let data = res.data;
console.log("data", data);
this.$toast.clear();
if(data.stateCode !== 1) {
/* this.$dialog.confirm({
title: '温馨提示',
message: `${data.message}`,
showCancelButton: false
}) */
this.isPageShow = true;
this.isActive = false;
} else if(data.stateCode === 0 && data.message !== null) {
/* this.$dialog.confirm({
title: '温馨提示',
message: `电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。`,
showCancelButton: false
}) */
this.isPageShow = true;
this.isActive = false;
} else if (data.stateCode === 1 && data.message !== 'ok') {
/* this.$dialog.confirm({
title: "SIM卡激活成功",
message: '卡激活成功,5分钟后则可正常使用。',
showCancelButton: false,
confirmButtonText: '返回首页'}).then(() => {
document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
}); */
this.isPageShow = true;
this.isActive = true;
} else if (data.stateCode === 1 && data.message === 'ok') {
/* this.$dialog.confirm({
title: "SIM卡激活成功",
message: '卡激活成功,5分钟后则可正常使用。',
showCancelButton: false,
confirmButtonText: '返回首页'
}).then(() => {
document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
}); */
this.isPageShow = true;
this.isActive = true;
}
})
.catch(error => {
console.log("出错了:;", error);
this.$dialog.confirm({
title: '温馨提示',
message: `${error.message}`,
showCancelButton: false
})
}).finally(() => {
this.$toast.clear();
})
},
onBackHome() {
document.location.replace("https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/SmartDigitalSsjl");
}
}
}
</script>

<style scoped lang="scss">
.active-container {
height: 100vh;
padding: 40px 50px;
.header {
padding: 10px 0;
@include center();
}
.main {
width: 100%;
padding: 10px 0;
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-direction: column;
.text, p {
width: 100%;
font-size: 16px;
text-align: left;
font-weight: 500;
margin: 5px 0;
img {
height: 25px;
width: 60px;
margin: 0 5px;
}
.img {
display: flex;
justify-content: flex-start;
align-items: center;
}
}
}
.van-button {
margin-top: 20px;
}
}
</style>

+ 316
- 0
src/views/card-info/index.vue Целия файл

@@ -0,0 +1,316 @@
<!--
* @Date: 2022-04-15 10:22:36
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-26 15:05:41
* @FilePath: \TelpoH5FrontendWeb\src\views\card-info\index.vue
* @description:
-->
<template>
<div class="card-info-container">
<van-nav-bar title="话费查询"
:left-arrow="false"
:border="true">
</van-nav-bar>
<div class="check-container">
<!-- header -->
<div class="header">
<!-- banner -->
<div class="banner">
<van-image
:src="logo"
round
>
</van-image>
<div class="right-message">
<p>{{ setMeal.msisdn }}</p>
</div>
</div>
<p class="padding-left">ICCID:{{ setMeal.iccid || '--' }}</p>
<p class="padding-left">语音通话接听免费,免漫游费。禁止手机使用</p>
<div class="action">
<div class="action-item"><p>{{ setMeal.realname || '--' }}</p></div> <span> | </span> <div class="action-item"><p>{{ setMeal.cardState || '--' }}</p></div> <span> | </span> <div class="btn"><p @click="onRefresh">刷新</p></div>
</div>
</div>
<!-- 套餐详情 -->
<div class="card-details">
<div class="set-meal">
<p class="font-orange">{{ setMeal.expireTime || '--' }}</p>
<p>套餐到期时间</p>
</div>
<div class="set-meal">
<p class="font-orange">{{ setMeal.residueVoiceData || '--' }}</p>
<p>剩余语音(分钟)</p>
</div>
<div class="set-meal" v-show="false">
<p class="font-orange">{{ setMeal || '--' }}</p>
<p>套餐流量(M)</p>
</div>
<div class="set-meal">
<p class="font-orange">{{ setMeal.residueFlow || '--' }}</p>
<p>剩余流量(M)</p>
</div>
</div>
<!-- 套餐操作 -->
<div class="card-details-menu">
<div class="meal-item" @click="onMealBuy">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAADgUlEQVRYR+2XTWhUVxTH/+cl5IPQUhG0ASlWWoRaF22hSDeCRUT6gV+LUnEkQt+5b9GAUdRu2odupGDEQOa9+1IKRgUZLZUq1I1SF10VFdSNFqGKdBZtJ0UYTWi5R26ZFJmMvnvnRVDJ3QzDPR+/9z9zzpxHeMoPPeV8mAMsWqFnT8Esyz43xmxoevJTSqlDRdVox3+Ggs2ARPQaAGHmV9pJUNQnt8Ra6whA2RjzahRFvxVN6OvvArgcwBUR2aKUOuqboKh9LqCIUJZlfwI4wcyqaEJf/1xAGzBN09NEtISZl/kmKGrvBKi13gVgv4icICIpmrSVPxGdDsPwWPOdE2CWZe+JyM8AqgD+nmXAAMBSAEeYudQWYKVS6ZqYmLBgZWbeOZuASZKsCoLgnJ29URR93xagddJa/wSgh5lXzCZgmqYJEW3u6upaMDAwMNk2YJZl+0RkN4CXmPleA/pTAB94At9m5i+sT6VS6ajVar8DOKeUsrFmHKffoPXKsmyNiJw1xrwfRdH5BuBXAFoGfgy0BVxt7/PKa22cAUdGRl7s7u6uEdHeMAz3eqrW0ny6vPV6feHQ0ND9Qgo2FLsIoDatQBFIl/J6KdgAtBvNtmq1Oi+O43+TJFkcBEEsIp15sEQ0NTU1tWdwcPAP1/J6A46NjW0yxthh/W4Yhr+Uy+V3Ojo6jgDIBQRgO3Q9M9+0iV3K6w04Ojr6cmdnp+26Hcx8ME+1R927ltcbsFHmX0XkqlKqeal15nXp3ulgzl087aC1/haAhTvrTDTT8A0Aix/XvW0Dpmk6QEQW8haA/wZ2m+ckM3+Z5+utYJqmrxPRDQCfMfM3eQmK3vsC2uV1nTGmQkR2/bdz0eX0AvirsVKdsu84Lk5eTRLHcdDf32/3tU9EZIKI7Gh5oZHseouk9uHtGkUichfAP0Q0H8DxarW6OY5j4wLprGCapiUiOiwie5j560ZH7yIiu8huVUqNP5zQ1/5RsD6A3xHRm8xsVfn/aK2vi8g1pdTGJkAv+9kAtO8li5j5rSbAyyJyRyn1UROgl31hQK31dgAHjDEfR1F0xgZMkuTDIAh+aPXP4mtfGHB4eLi3r6/vAoC3RcR+gohWArhUr9dXNq9LvvaFAW2A8fHxvsnJyR3GmLX2exAEP/b09BwolUr1Vgl87VvFcG4Sl5HwJGzmAIuqOqfgc6/gA38wwThLucAeAAAAAElFTkSuQmCC" alt=""/>
<p>套餐订购</p>
</div>
<div class="meal-item" @click="onRecordCheck">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAD6UlEQVRYR+2YXWgcVRiG3+9sshtSiUaKmFAvSlEReiFuKSKWoNbUm17401DFH0KTOWdCDLheCHrhoCBi1MhKMnMmCaEJuZFaGhRrTVFaQW8MXigiFmqVyipYwRKM7GTOJyfsStimmbS72QbN3C3n7JyH9/t5vzOEDf7QBufDJmC1EdpUsFLBfD7fkk6n3wVwVCk1k6RwooJa605mlgBuTHpZ5ToRMRGNO44zbde01lsBfAwgCyBi5oNKqaOrvXdVQAsH4DiA88x8thrA8fHx9sXFxU8AbGfmZwAMENHdSZCrAgZB8D4R7Uqn07d3d3f/faWA5f2jo6Pb4zg+SUS3MPNepdTp4eHh61Kp1EclyAOXC3cS4Gf2EKXUfVXA3WGMmWXmrUSUATAkpcyVQn4AwHvMPKmUsqpe8qwr4MjISLahoeE4MxejKNrX2Nh4CMBzFjKVSh2L49iufVcsFh8YGBi4WFdArfW9AD4EcCGO4wf7+vqWclhr/XYJMgLwQxRFHf39/RcuF6F1UTAMw33MbKvznDGm03XdX8oAvu/vFEJ8ZQsPwB4pZeGqqzgIgivOQd/3HxVCTBPRt8z8kJTy9zKA1noHgM8BxMaYPa7rnkvK7ZoqqLW2iT7GzF8S0X4p5Z/LKnmbMcbCNQPokFJ+nwRn12sGGATBs0T0DjPPEtEjUsq/loX1JiHEKQA3G2Pud13367XA1QxQa/0SgFetfRUKhSc8zyuWAYaGhm5obm7+FMBtRNTpOM4XYRiOGWNsazmdBFq1gkEQ5IjoLQCHW1tbD3V1dcXlQwcHB7e0tLRY97jLhtxxnJM2alprw8wvK6VeWVdAz/NEW1vbTwC2WY8tFAoPe5635Dj5fD6TyWRsm+kA0CWlPFaCqR9gGIZ7bc4xs63agwBmLSSAxfb29iPGmP1CiKfLw8K1ADxsIYrFYltTU9PjzDxmIQH8AcD+7lNKBRVhrI+Ck5OTWxYWFn4FMC2lVBMTE01RFE3Y6aQE9IKU8o2V7LUuORgEwZNENMXMLwohdjDzYwCuB/AzM7+plLJD6Yr2WhdArfUJAHZeBDNfJKIjQoipnp6eU3ZQXaU66xNirfUMETUAmJqfn5/J5XILSS2j7kWyRqDKbfVR8CrhltyrLjm4YQCJ6B4A/04lSWC2sh3HeV5rbW+C1sqW22lhbm5uVzabLdbM6ojoVgBlm0risxV9Qin1ge/7u4UQT1UCSilf+1+FuCbXzuWyl0b+bwD0SymHk0Kyrhf3S/oLkT3vTvtVQQixs7e397eqAO2fq/n0sQKgdZgfmfl1pdSZJLilnrSWTddyzyZgtepvKvifV/Af4cRYRyl1cksAAAAASUVORK5CYII=" alt=""/>
<p>订购记录</p>
</div>
</div>
<div class="tips-container">
<p>注:</p>
<p>通话结束后,剩余语音时长需1小时后才更新。</p>
</div>
</div>
</div>
</template>

<script>
import APIWx from "@/api/wx";
export default {
name:'cardInfo',
inject: ["reload"],
data(){
return {
//套餐信息
setMeal: {
expireTime: '', //套餐过期时间
residueVoiceData: '', //剩余语音
availableData: '', //流量套餐
residueFlow: '', //剩余流量
iccid: this.$route.query.iccid, //iccid
cardState: '', //卡激活状态
realname: '', //是否已实名 1是 0 否
msisdn: '', //msisdn
isUnicom: null, //是否是联通
},
isShowMenu: this.$route.query.isShowMenu,
}
},
computed: {
// 顶部图标
logo(){
if(this.setMeal.isUnicom !== null) {
return this.setMeal.isUnicom ? require('@/assets/img/unicom.png') : require('@/assets/img/yidong_logo.png')
} else {
return null
}
}
},
created() {
this.getCardInfo();
},
methods: {
//获取小台风物联网卡信息
getCardInfo() {
this.$toast.loading({ message: '查询中...' });
let reqBody = {
imei: this.$route.query.imei,
iccid: '' || this.$route.query.iccid
}
APIWx.GetCardInfo(reqBody)
.then(res => {
let data = res.data;
if (data.stateCode === 1 ) {
let item = data.data;
this.setMeal.expireTime = this.$dayjs(item.expireTime).format("YYYY-MM-DD");
this.setMeal.residueVoiceData = item.availableVoiceData;
this.setMeal.residueFlow = item.availableData;
this.setMeal.cardState = item.cardState;
this.setMeal.realname = Number(item.realname) === 1 ? '已实名' : '未实名';
this.setMeal.msisdn = item.msisdn;
// 截取msisdn 前三位, 148 是移动,其它都是联通
this.setMeal.isUnicom = item.msisdn.slice(0,3) === '148' ? false : true;
this.$toast.success({
message: "查询成功",
duration: 1500
});
}
})
.catch(error => {
console.log("接口报错了", error);
}).finally(() => {
this.$toast.clear();
})
},
// 返回
onNavBack() {
/* this.$router.push({ name: 'device'}); */
},
// onRefresh 刷新
onRefresh() {
this.reload();
},
// 购买套餐
onMealBuy() {
this.$router.push({
name: 'packageList',
query: { imei: this.$route.query.imei, iccid: this.$route.query.iccid, isShowMenu: this.isShowMenu}
})
},
// 订购记录
onRecordCheck () {
this.$router.push({
name: 'buyRecord',
query: { imei: this.$route.query.imei, iccid: this.$route.query.iccid, isShowMenu: this.isShowMenu}
})
}

}
}
</script>

<style scoped lang="scss">
.card-info-container {
max-height: 100vh;
width: 100%;
position: relative;
background-color: #fff;
p {
font-size: 16px;
color: #9B9B9B;
}
.check-container {
height: calc(100vh - 88px);
padding: 8px 10px;
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
.header {
height: 200px;
width: 100%;
display: flex;
justify-content: space-around;
flex-direction: column;
align-items: flex-start;
border: 1px solid #fff;
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
.padding-left {
padding-left: 10px;
}
.banner {
height: 75px;
margin: 10px 0;
padding-left: 5px;
display: flex;
justify-content: flex-start;
align-items: center;
.van-image {
height: 75px;
width: 75px;
border: 5px solid #E0EEFF;
}
.right-message {
text-align: center;
margin-left: 10px;
p {
font-size: 18px;
color: #64A9FF;
}
}
}
.action {
height: 35px;
text-align: center;
padding-left: 10px;
width: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
p {
font-size: 16px;
color: #64A9FF;
}
span {
display: block;
color: #9B9B9B;
font-size: 16px;
padding: 0 8px;
}
.btn {
height: 25px;
width: 75px;
line-height: 25px;
text-align: center;
background-color: #64A9FF;
border-radius: 10px;
p {
color: #fff;
}
}
}
}
.card-details {
height: 75px;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
border: 1px solid #fff;
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
.set-meal {
flex: 1;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
p {
font-size: 16px;
padding: 5px 0;
}
.font-orange {
color: orange;
}
}
.set-meal:nth-of-type(2) {
border-left: 1px solid #DDDDDD;
border-right: 1px solid #DDDDDD;
}
}
.card-details-menu {
height: 75px;
width: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 20px;
border: 1px solid #fff;
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
.meal-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding-left: 10px;
img {
height: 45px;
width: 40px
}
p {
font-size: 14px;
padding: 5px 0;
}
}
}
.tips-container {
width: 100%;
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-direction: column;
p {
margin: 10px;
color: red;
}
}
}
}
</style>

+ 9
- 2
src/views/index.vue Целия файл

@@ -1,5 +1,12 @@
<!--
* @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 @click="onClick">测试</div>
<div></div>
</template>

<script>
@@ -12,7 +19,7 @@ export default {
},
methods: {
onClick() {
this.$router.push({
this.$router.replace({
name: 'packageList',
query: {
imei: '45555'


+ 54
- 19
src/views/package-home/index.vue Целия файл

@@ -1,42 +1,65 @@
<!--
* @Date: 2023-02-24 14:18:25
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-24 15:39:49
* @LastEditTime: 2023-03-02 01:30:58
* @FilePath: \TelpoH5FrontendWeb\src\views\package-home\index.vue
* @description:
-->
<template>
<div class="package-home"></div>
<div class="package-home">

</div>
</template>

<script>
import { APIPay } from "@/api/pay";
import APICore from "@/api/core";
import APIWx from "@/api/wx";
import { isNotNull } from "@/utils/index";
export default {
name: "",
data() {
return {
params: {

}
params: {}, //获取路由的参数
isRecharge: null, //是否已经支付
};
},
created() {
this.getParams();
this.getToken();
this.getAuth();
this.checkBrowser();
this.getParams();
this.checkImei();
},
mounted() {

},
methods: {
checkImei() {
let reqBody = {
imei: this.params.imei,
iccid: this.params.imei || ''
};
APIWx.CheckImei(reqBody).then(res =>{
console.log("checkImei", res);
let data = res.data;
if(data) {
this.isRecharge = data.isRecharge;
console.log("是否已经支付", this.isRecharge);
};
this.checkBrowser();
}).catch(e => {
console.log("e", e.message);
})
},

// checkBrowser 检查扫码的浏览器内核
checkBrowser() {
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 (
@@ -46,14 +69,15 @@ export default {
let timeStamp = new Date().getTime();
let code = url.split("&")[0];
if (isNotNull(code)) {
this.$store.commit("wxAuthCode", `${code}`);
this.$store.commit("wxAuthCode", code);
/* this.getOpenId(); */
this.getWxCode();
}
} else {
this.getWxCode();
console.log("获取token");
}
} else {
this.getWxCode();
console.log("当前浏览器内核并非支付宝或者微信");
}
},
@@ -90,12 +114,25 @@ export default {
getWxCode() {
let params = this.params;
let commonUrl = process.env.VUE_APP_BASE_API;
/* let testUrl = encodeURIComponent(`https://id.ssjlai.com/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}`);
let proUrl = encodeURIComponent(`https://ai.ssjlai.com/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}`); */
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`
window.location.href = url;
/* let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}&iccid=${params.iccid}`);
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`;
window.location.href = url; */
// todo 暂时去掉
if(this.isRecharge) {
// 如果是已经支付,但未激活,跳转激活界面
this.$router.replace({
name: 'cardActive',
query: {
imei: params.imei,
iccid: params.iccid
}
})
} else {
let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}&iccid=${params.iccid}`);
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`;
window.location.href = url;
}

},
// 获取url传过来的参数
getParams() {
@@ -112,6 +149,4 @@ export default {
</script>

<style scoped lang="scss">
.package-home {
}
</style>

+ 266
- 104
src/views/package-list/index.vue Целия файл

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-03-29 16:57:58
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 15:52:29
* @LastEditTime: 2023-03-02 00:31:50
* @FilePath: \TelpoH5FrontendWeb\src\views\package-list\index.vue
* @description: TODO 小台风充值h5
-->
@@ -14,19 +14,9 @@
</van-nav-bar>
<!-- 灰色线条 -->
<div class="gray-line"></div>
<!-- 套餐说明 -->
<div class="order-description" v-show="packageOrderList.length">
<h5>套餐说明:</h5>
<h5>每月200分钟通话时长,1G流量。</h5>
</div>
<!-- 套餐列表 -->
<div class="topup-container">
<div class="main">
<!-- <div class="tips" v-show="!isCanTopup">
<p>非本公司发行的SIM卡,</p>
<p>无此服务。</p>
<div class="cancel-button" @click="onNavBack">返回</div>
</div> -->
<!-- 无套餐时显示 -->
<div class="noData_container" v-show="packageOrderList.length === 0 && isShowNoData">
<p>暂无相关套餐数据,请您联系管理员~</p>
@@ -39,7 +29,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>
@@ -50,20 +40,54 @@
<div class="title">
<p>{{item.packageName}}<!-- :{{(item.packagePrice/item.packageIssue).toFixed(0)}}元/月 --></p>
</div>
<div class="remark">
<p>每月200分钟通话时长,1G流量</p>
</div>
<div class="details">
<p>
低至
<span
class="orange"
>{{(item.packagePrice/(item.packageIssue === 0 ? 1: item.packageIssue)).toFixed(0)}}</span>元/月

<span class="orange large">¥{{(item.packagePrice/(item.packageIssue === 0 ? 1: item.packageIssue)).toFixed(0)}}</span>元/月,
</p>
<p class="orange">
<span class="orange price">{{item.packagePrice}}元</span>
<p class="total">
<span>合计</span><span class="orange price">{{item.packagePrice}}元</span>
</p>
</div>
<div class="package-buy">
<div class="buy-btn" @click="onBuy(item)">
<p>话费充值</p>
<p>第一步:充值话费</p>
</div>
</div>
<div class="radios-con">
<div class="pay-type">
<p>支付方式:</p>
</div>
<van-radio-group v-model="radio" direction="horizontal" @change="onRaidoChange">
<van-radio name="1">
<template #default>
<div class="radio-con">
<span>微信</span>
<img src="../../assets/wx-pay.png"/>
</div>
</template>
</van-radio>
<van-radio name="2">
<template #default>
<div class="radio-con">
<span>支付宝</span>
<img src="../../assets/alipay.png"/>
</div>
</template>
</van-radio>
<van-radio name="3">
<template #default>
<div class="radio-con">
<span>12期花呗</span>
<img src="../../assets/antpay.png"/>
</div>
</template>
</van-radio>
</van-radio-group>
</div>
</div>
</div>
</div>
@@ -73,42 +97,51 @@

<script>
import APIWx from "@/api/wx";
import AppId from "@/config/appId";
import { APIPay } from "@/api/pay";
let wx = require("weixin-js-sdk"); // TODO 再封装,可拦截错误提示等操作
import APICore from "@/api/core";
import axios from "axios";
let wx = require("weixin-js-sdk"); // TODO 再封装,可拦截错误提示等操作
import { isNotNull } from "@/utils/index";
export default {
name: "packageList",
data() {
return {
topupTitle: "请选择套餐充值激活电话卡",
wxItem: "",
packageOrderList: [],
topupTitle: "请选择套餐充值电话卡", //充值页面标题
// 套餐列表, todo 需要从接口获取
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
// 获取从路由的参数,import 调取激活接口需要用到
params: {
imei: '',
iccid: '',
manufactorId: '',
appId: '',
manufactorId: '', //厂商id,一般用来获取core接口token
appId: '', //公众号appId,需要对接多个不同公众号时动态从页面路由获取,

},
radio: '1', //支付方式单选按钮默认值
payProductId: null, //套餐id
packageIssue: null, //套餐分期
payType: '1', //支付方式 1 微信, 2 支付宝,支付宝又分为花呗和全额支付,全额支付分期数传0 或者1 ,花呗则传 3 6 12
};
},
computed: {
isCanTopup() {
return this.$route.query.isCanTopup;
},
serialNo() {
return this.$route.query.serialNo;
}
},
created() {
this.getAuth();
this.getParams();
this.getWxAutograph();
this.getLiveBasePackage();
// todo 接口列表
/* this.getLiveBasePackage(); */
},
/* mounted() {
this.getParams();
@@ -119,12 +152,17 @@ export default {
// 根据code获取openId
getOpenId() {
let code = this.$store.getters.wxAuthCode;
APIPay.getOpenId(code).then(res => {
let data= res.data;
if(data.code === 20000) {
this.$store.commit("openId", data.data.openId);
}
})
let openId = this.$store.getters.openId;
if(isNotNull(openId)) {
console.log("已经存在openId");
} else {
APIPay.getOpenId(code).then(res => {
let data= res.data;
if(data.code === 20000) {
this.$store.commit("openId", data.data.openId);
}
})
}
},
// 获取b端接口的token
getAuth() {
@@ -156,10 +194,15 @@ export default {
duration: 1500
});
let reqBody = {
imei: this.params.imei
manufactorId:"",
productModelId:0,
iccid:"",
pageNumber:1,
begNumber:20
}
APICore.QueryLiveBasePackage(reqBody)
APICore.cardPackageList(reqBody)
.then(res => {
console.log("data", res.data);
if (res.data.code === 106 || res.data.code === 104) {
// token过期
this.getAuth();
@@ -169,11 +212,13 @@ export default {
} else if (res.data.code === 0 && res.data.data === null) {
this.isShowNoData = true;
}else {
let data = res.data.data.packageList;
let data = res.data.data.list;
if(data === null) {
this.isShowNoData = true;
} else {
this.packageOrderList = data.reverse();
this.packageOrderList = data.filter(item => {
return item.pechargeUrl === '1629405716684029952' || item.pechargeUrl === '1629405558344859648';
});
console.log("套餐数据::", data);
}
}
@@ -185,7 +230,8 @@ export default {
.catch(error => {
this.$dialog.confirm({
title: "获取套餐数据失败",
message: error
message: error,
showCancelButton: false,
});
})
.finally(() => {
@@ -204,11 +250,10 @@ 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;
this.wxItem = res.data.data;
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: item.appId, // 必填,公众号的唯一标识
@@ -220,7 +265,6 @@ export default {

wx.ready(() => {
resolve(true);
/* that.canScan = true; */
});
})
.catch(err => {
@@ -231,13 +275,28 @@ export default {
},
// 话费充值
onBuy(data) {
let payType = data.packagePayType;
this.price = data.packagePrice;
// 需要区分是要用微信支付还是支付宝花呗支付
if (payType === "支付宝花呗") {
if (this.payType === '2') {
this.payProductId = process.env.NODE_ENV === "production" ? '1629407413618294784' : '1629405716684029952', //支付宝全额支付
this.packageIssue = 0;
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 {
this.wxPay(data);
let openId = this.$store.getters.openId;
this.payProductId = process.env.NODE_ENV === "production" ? '1629407413618294784': '1629405716684029952'; //支付宝花呗支付
if(openId === null || openId === 'null') {
this.$dialog.confirm({
message: '获取OpenId失败,请您重新进入',
showCancelButton: false,
})
} else {
this.wxPay(data);
}
}
},
// 微信支付
@@ -245,31 +304,36 @@ export default {
this.$toast.loading({
message: "加载中"
});
console.log("微信支付", data);
let orderData = data;
let reqBody = {
openId: this.$store.getters.openId, //openId
imei: this.params.imei, //imei
productId: data.productId, //套餐id
packageName: data.productModel + ',' + data.packageName, //套餐名字
packagePayType: this.shiftType(data.packagePayType), //支付类型
packageIssue: data.packageIssue, //分期
productId: this.payProductId, //套餐id
packageName: /* data.productModel */ data.packageName, //套餐名字
packagePayType: Number(this.payType), //支付类型
packageIssue: 12, //分期
packagePrice: process.env.NODE_ENV === "production" ? data.packagePrice * 100 : 1 //总金额单位为分,测试环境写死
};
this.$toast.clear();
APICore.payLiveBaseDevice(reqBody)
.then(res => {
this.$toast.clear();
if (res.data.code === 104 || res.data.code === 106) {
this.getAuth();
setTimeout(() => {
this.wxPay(orderData);
}, 1000);
} else if (res.data.code === 104) {
this.$dialog.confirm({
message: `${res.data.message}`
})
}
let that = this;
let wxData = res.data.data;
that.outTradeNo = wxData.out_trade_no;
console.log("wxData", wxData);
// 本地测试
that.$router.push({
/* that.$router.push({
name: "payResult",
query: {
outTradeNo: that.outTradeNo,
@@ -281,7 +345,7 @@ export default {
routerName: this.params.routerName,
issue: data.packageIssue
}
});
}); */
wx.chooseWXPay({
timestamp: wxData.timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符
nonceStr: wxData.nonceStr, // 支付签名随机串,不长于 32 位
@@ -290,7 +354,7 @@ export default {
paySign: wxData.paySign, // 支付签名
success: function(res) {
// 支付成功后的回调函数
that.$router.push({
that.$router.replace({
name: "payResult",
query: {
outTradeNo: that.outTradeNo,
@@ -298,23 +362,26 @@ export default {
rechargeUrl: data.rechargeUrl,
iccid: that.params.iccid,
isAdmin: that.$route.query.isAdmin || false,
serialNo: that.$route.query.serialNo,
issue: data.packageIssue
serialNo: that.params.imei,
issue: that.packageIssue
}
});
console.log("微信支付成功::", res);
},
fail: err => {
console.log("支付出错了::", err);
this.$dialog.confirm({
title: "支付失败",
message: "出错了,请您重新进入"
that.$dialog.confirm({
title: "温馨提示",
message: "出错了,请您重新进入",
showCancelButton: false
});
},
cancel: function(err) {
// 用户取消支付
this.$dialog.confirm({
message: "您取消了支付"
that.$dialog.confirm({
title: "温馨提示",
message: "您取消了支付",
showCancelButton: false
});
console.log("用户取消了支付::", err);
}
@@ -336,11 +403,11 @@ export default {
let orderData = data;
let reqBody = {
openId: this.$store.getters.openId, //openId
imei: this.serialNo, //imei
productId: data.productId, //套餐id
packageName: data.productModel + ',' + data.packageName, //套餐名字
packagePayType: this.shiftType(data.packagePayType), //支付类型
packageIssue: data.packageIssue, //分期
imei: this.params.imei, //imei
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();
@@ -354,11 +421,11 @@ export default {
}
let that = this;
let alipayData = res.data.data.xmlStrMap;
this.outTradeNo = alipayData.outTradeNo;
that.outTradeNo = alipayData.outTradeNo;
let alipayForm = decodeURI(alipayData.payXmlStr);
that.$store.commit("isFromWx", true);
let alipayUserId = process.env.NODE_ENV === "production" ? 42 : 18
this.$router.push({
let alipayUserId = process.env.NODE_ENV === "production" ? 42 : 18;
this.$router.replace({
name: "payResult",
query: {
rechargeUrl:
@@ -367,31 +434,29 @@ export default {
outTradeNo: that.outTradeNo,
price: that.price,
alipayForm: alipayForm,
iccid: that.$route.query.iccid,
iccid: that.params.iccid,
isAdmin: that.$route.query.isAdmin || false,
serialNo: that.$route.query.serialNo,
serialNo: that.params.imei,
alipayUserId: alipayUserId,
productId: data.productId
productId: this.payProductId
}
});
})
.catch(error => {
console.log("error", error);
this.$dialog.confirm({
message: `${error.message}`,
showCancelButton: false
})
})
.finally(() => {
this.$toast.clear();
});
},
// 转换类型
shiftType(type) {
switch (type) {
case "微信":
return "1"
/* break; */
case "支付宝花呗":
return "2"
/* break; */
}
// 支付类型切换
onRaidoChange(value) {
console.log("选择的支付类型是", value);
this.payType = value;
}
}
};
@@ -407,15 +472,16 @@ export default {
background-color: white;
height: 100vh;
.topup-container {
position: relative;
/* 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 {
padding: 0 10px;
display: flex;
justify-content: center;
align-items: center;
@@ -455,10 +521,8 @@ export default {
}
.package-order-container {
position: relative;
height: 120px;
width: 300px;
padding: 5px 20px;
margin: 10px 0;
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;
@@ -496,41 +560,112 @@ export default {
}
}
.order-content {
padding-top: 25px;
padding: 15px 0;
.title {
display: flex;
justify-content: flex-start;
p {
font-size: 14px;
font-size: 16px;
font-weight: bold;
}
}
.details {
display: flex;
justify-content: space-between;
justify-content: flex-start;
align-items: center;
p {
height: 40px;
@include center();
font-size: 14px;
padding: 5px 0 5px 10px;
}
.total {
font-size: 16px;
padding: 0;
}
.orange {
color: orange;
}
.large {
font-size: 26px;
margin: 0 2px;
}
.price {
font-size: 14px;
font-weight: bold;
padding-right: 5px;
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;
justify-content: flex-start;
p {
font-size: 14px;
padding: 5px 10px;
/* font-weight: bold; */
}
}
.package-buy {
padding: 5px 8px;
.buy-btn {
height: 40px;
width: 150px;
padding: 0 5px;
display: flex;
justify-content: center;
align-items: center;
background: orange;
border-radius: 20px;
p {
font-size: 16px;
padding: 0;
color: white;
}
}
}
.radios-con {
/* padding: 20px 10px; */
/* @include center(); */
/* align-items: center; */
padding: 10px 0 10px 10px;
font-size: 14px;
/* box-shadow: rgba(14, 30, 37, 0.12) 0 3px 5px 0,
rgba(14, 30, 37, 0.32) 0 2px 16px 0; */
img {
height: 20px;
width: 20px;
margin: 2px;
}
.pay-type {
text-align: left;
p {
font-size: 14px;
padding: 0 0 10px 0;
}
}

.radio-con {
@include center();
}
.van-cell-text {
display: flex;
justify-content: flex-start;
align-items: center;
span {
font-size: 14px;
padding: 0 5px;
}
}
}
@@ -553,11 +688,38 @@ 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;
}
}
.pay-radios {
position: relative;
top: 0;
width: 100%;
/* background-color: red; */
/* padding: 0 15px; */
.radios-con {
padding: 20px 10px;
/* @include center(); */
align-items: 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;
}
.van-cell-text {
display: flex;
justify-content: flex-start;
align-items: center;
span {
padding: 0 5px;
}
}
}
}
}
</style>

+ 61
- 25
src/views/pay-result/index.vue Целия файл

@@ -1,7 +1,7 @@
<!--
* @Date: 2023-02-24 16:47:33
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 16:02:53
* @LastEditTime: 2023-03-02 10:58:55
* @FilePath: \TelpoH5FrontendWeb\src\views\pay-result\index.vue
* @description:
-->
@@ -25,7 +25,8 @@
<div class="details">
<div class="details-item">
<p class="left-text">订单状态</p>
<p>{{isPayStatus ? '支付成功' : '查询失败'}}</p>
<p v-if="payStatus">支付成功</p>
<p v-else class="error">查询失败</p>
</div>
<div class="details-item">
<p class="left-text">订单尾号</p>
@@ -38,11 +39,14 @@
</div>
<!-- 返回 -->
<div class="footer pos-center">
<!-- <div class="back-btn" @click="onNavBack" v-show="!isPayStatus">
<!-- <div class="back-btn" @click="onNavBack" v-show="!payStatus">
<p>返回重新选择套餐购买</p>
</div> -->
<div class="back-btn" @click="onNext" v-show="!isPayStatus">
<!-- <div class="back-btn" @click="onNext" v-show="payStatus">
<p>激活电话卡</p>
</div> -->
<div class="back-btn" @click="onBackHome">
<p>第{{isAliPay ? '三' : '二'}}步:继续使用功能</p>
</div>
</div>
</div>
@@ -63,19 +67,24 @@ export default {
name: "payResult",
data() {
return {
pageShow: false,
count: 0,
timer: "", //定时器
isPayStatus: null,
price: this.$route.query.price,
outTradeNo: this.$route.query.outTradeNo,
isIos: null //是否是ios
pageShow: false, //是否显示页面,备注:需要在查询结果出来后才显示页面
count: 0, //轮询接口时间次数
timer: "", //轮询支付结果定时器
payStatus: null, //支付状态
price: this.$route.query.price, //价格
outTradeNo: this.$route.query.outTradeNo, //支付订单号
isIos: null, //是否是ios,
};
},
created() {
this.checkParams();
this.closeTime();
},
computed: {
isAliPay() {
return this.$route.query.alipayForm
}
},
mounted() {
//this.checkParams();
//this.closeTime();
@@ -89,7 +98,7 @@ export default {
}
},
onNavBack() {
this.$router.push({
this.$router.replace({
name: "packageList",
query: {
serialNo: this.$route.query.serialNo,
@@ -103,7 +112,15 @@ export default {
onNext() {
console.log("激活", );
//this.$toast.loading("激活中");
this.effective();
/* this.effective(); */
this.$router.replace({
name: 'activeStatus',
query: {
serialNo: this.$route.query.serialNo,
iccid: this.$route.query.iccid,
issue: Number(this.$route.query.issue) || 0
}
})
},
// 激活接口
effective() {
@@ -131,13 +148,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 => {
@@ -180,7 +207,7 @@ export default {
let that = this;
console.log("支付宝结果");
this.$toast.loading({
message: "结果查询中"
message: "支付结果查询中"
});
let reqBody = {
outTradeNo: params.outTradeNo
@@ -192,7 +219,7 @@ export default {
if (that.count >= 30) {
if (that.timer) {
clearInterval(that.timer);
this.isPayStatus = false;
this.payStatus = false;
this.pageShow = true;
this.$toast.clear();
console.log("关闭轮询1");
@@ -200,11 +227,11 @@ export default {
}
that.timer = setInterval(() => {
that.count++;
APIPay.getAlipayResult(reqBody)
APIPay.getWxPayResult(reqBody)
.then(res => {
if (res.data.code === 20000) {
this.pageShow = true;
this.isPayStatus = true;
this.payStatus = true;
this.$toast.clear();
console.log("关闭轮询2");
if (that.timer) {
@@ -220,7 +247,7 @@ export default {
// todo 轮询微信支付的订单,支付成功则激活 (只有直播基地的imei才激活操作)
let that = this;
console.log("微信");
this.$toast.loading({message: "结果查询中"});
this.$toast.loading({message: "支付结果查询中"});
let reqBody = {
outTradeNo: params.outTradeNo
};
@@ -231,7 +258,7 @@ export default {
if (that.count >= 30) {
if (that.timer) {
clearInterval(that.timer);
this.isPayStatus = false;
this.payStatus = false;
this.pageShow = true;
this.$toast.clear();
console.log("关闭轮询3");
@@ -243,7 +270,7 @@ export default {
.then(res => {
if (res.data.code === 20000) {
this.pageShow = true;
this.isPayStatus = true;
this.payStatus = true;
this.$toast.clear();
console.log("关闭轮询4");
if (that.timer) {
@@ -278,6 +305,11 @@ export default {
this.pageShow = true;
}
}, 31000);
},
onBackHome() {
/* document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/"); */
document.location.replace("https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/SmartDigitalSsjl");
// https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/SmartDigitalSsjl
}
}
};
@@ -331,6 +363,10 @@ export default {
.left-text {
color: gray;
}
.error {
color: red;
font-size: 24px;
}
}
.price {
padding: 20px 0;


+ 3
- 3
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/
})


Loading…
Отказ
Запис