mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-21 21:46:44 +08:00
Merge branch 'feature/GFRS-2097【待确定】培训系统优化' into dev
This commit is contained in:
11
src/api/ebiz/train/train.js
Normal file
11
src/api/ebiz/train/train.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import request from '@/assets/js/utils/request'
|
||||||
|
import getUrl from '@/assets/js/utils/get-url'
|
||||||
|
|
||||||
|
// 获取培训系统中心页面
|
||||||
|
export function trainHomeUrl(data) {
|
||||||
|
return request({
|
||||||
|
url: getUrl('/customer/train/account/trainHomeUrl', 0),
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
14
src/router/ebiz/train.js
Normal file
14
src/router/ebiz/train.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
//培训系统 定义相关组件
|
||||||
|
const trainLoading = () => import('@/views/ebiz/train/TrainLoading')
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
path: '/train/trainLoading',
|
||||||
|
name: 'trainLoading',
|
||||||
|
component: trainLoading,
|
||||||
|
meta: {
|
||||||
|
title: '培训中心。。。',
|
||||||
|
index: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -164,7 +164,9 @@ export default {
|
|||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
await this.getAgentInfo()
|
await this.getAgentInfo()
|
||||||
|
if(this.isGoodStart){
|
||||||
await this.getTableData()
|
await this.getTableData()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getTableData() {
|
async getTableData() {
|
||||||
|
|||||||
90
src/views/ebiz/train/TrainLoading.vue
Normal file
90
src/views/ebiz/train/TrainLoading.vue
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<template>
|
||||||
|
<div class="loading-content">
|
||||||
|
<div class="context-core">
|
||||||
|
正在跳转培训中心,<span>**</span>秒
|
||||||
|
</div>
|
||||||
|
<van-button class="mt20" type="info" @click="getDeviceInfo">getDeviceInfo</van-button>
|
||||||
|
<van-button class="mt20 mb20" type="info" @click="getUserInfo">getUserInfo</van-button>
|
||||||
|
<div>
|
||||||
|
{{ requestRes }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { Image as VanImage, Lazyload, Grid, GridItem } from 'vant'
|
||||||
|
import { trainHomeUrl } from '@/api/ebiz/train/train.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
[VanImage.name]: VanImage,
|
||||||
|
[Grid.name]: Grid,
|
||||||
|
[GridItem.name]: GridItem,
|
||||||
|
[Lazyload.name]: Lazyload
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
trainHomeUrl: '',
|
||||||
|
time: 10,
|
||||||
|
requestRes: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// this.initThisPage()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDeviceInfo() {
|
||||||
|
this.requestRes = ''
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
const res = await EWebBridge.webCallAppInJs('getDeviceInfo', {
|
||||||
|
secretKey: 'trainSecretKey'
|
||||||
|
})
|
||||||
|
this.requestRes = JSON.stringify(res, null, '\t')
|
||||||
|
console.log('getDeviceInfo :>> ', this.requestRes)
|
||||||
|
},
|
||||||
|
async getUserInfo() {
|
||||||
|
this.requestRes = ''
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
const res = await EWebBridge.webCallAppInJs('getUserInfo', {
|
||||||
|
secretKey: 'trainSecretKey'
|
||||||
|
})
|
||||||
|
this.requestRes = JSON.stringify(res, null, '\t')
|
||||||
|
console.log('getUserInfo :>> ', res)
|
||||||
|
},
|
||||||
|
initThisPage() {
|
||||||
|
trainHomeUrl({}).then(res => {
|
||||||
|
if (res.result == 0) {
|
||||||
|
this.trainHomeUrl = res.content
|
||||||
|
this.timeOut()
|
||||||
|
} else {
|
||||||
|
this.$toast(res.resultMessage)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
timeOut() {
|
||||||
|
let timer = setInterval(() => {
|
||||||
|
this.time--
|
||||||
|
if (this.time <= 0) {
|
||||||
|
this.time = 0
|
||||||
|
clearInterval(timer)
|
||||||
|
this.time = false
|
||||||
|
window.location.href = this.trainHomeUrl
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
next() {
|
||||||
|
window.location.href = this.trainHomeUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.loading-content {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user