Merge branch 'feature/GFRS-2097【待确定】培训系统优化' into dev

This commit is contained in:
mengxiaolong
2021-01-06 18:19:15 +08:00
4 changed files with 118 additions and 1 deletions

View 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
View 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
}
}
]

View File

@@ -164,7 +164,9 @@ export default {
},
async created() {
await this.getAgentInfo()
if(this.isGoodStart){
await this.getTableData()
}
},
methods: {
async getTableData() {

View 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>