|
@@ -1,9 +1,7 @@
|
|
<!-- 教师首页 -->
|
|
<!-- 教师首页 -->
|
|
<template>
|
|
<template>
|
|
- <view class="teacherHome" :style="{paddingTop:navHeight+'rpx'}">
|
|
|
|
- <view class="data-board" v-if="pageType == 1">
|
|
|
|
-
|
|
|
|
- </view>
|
|
|
|
|
|
+ <view class="teacherHome">
|
|
|
|
+ <dataBoard v-if="pageType == 1"></dataBoard>
|
|
<view class="home-page" v-if="pageType == 2">
|
|
<view class="home-page" v-if="pageType == 2">
|
|
<nav-bar :title="title" :background="background"></nav-bar>
|
|
<nav-bar :title="title" :background="background"></nav-bar>
|
|
<view class="top-back-img" :style="{top:navHeight+'rpx'}">
|
|
<view class="top-back-img" :style="{top:navHeight+'rpx'}">
|
|
@@ -71,6 +69,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <img class="scan_btn" @click.stop="saoCode" src="@/pages_safetyExamine/images/icon_xyxc_sm.png" />
|
|
<tab-bar></tab-bar>
|
|
<tab-bar></tab-bar>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -92,12 +91,16 @@
|
|
import {
|
|
import {
|
|
topWarn
|
|
topWarn
|
|
} from '@/pages/component/topWarn.vue'
|
|
} from '@/pages/component/topWarn.vue'
|
|
|
|
+ import {
|
|
|
|
+ dataBoard
|
|
|
|
+ } from '@/pages/views/dataBoard/dataBoard.vue'
|
|
export default {
|
|
export default {
|
|
name: "teacherHome",
|
|
name: "teacherHome",
|
|
components: {
|
|
components: {
|
|
tabBar,
|
|
tabBar,
|
|
navBar,
|
|
navBar,
|
|
topWarn,
|
|
topWarn,
|
|
|
|
+ dataBoard,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -112,13 +115,16 @@
|
|
created() {
|
|
created() {
|
|
if (pageRestrictVerify('dataBoard')) {
|
|
if (pageRestrictVerify('dataBoard')) {
|
|
this.dataPageType = true;
|
|
this.dataPageType = true;
|
|
- // this.pageType = 1;
|
|
|
|
|
|
+ this.pageType = 1;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ goHome(){
|
|
|
|
+ this.pageType = 2;
|
|
|
|
+ },
|
|
goPage(type) {
|
|
goPage(type) {
|
|
if (!type) {
|
|
if (!type) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -140,8 +146,9 @@
|
|
}
|
|
}
|
|
if (type == 'dataBoard') {
|
|
if (type == 'dataBoard') {
|
|
//数据看板
|
|
//数据看板
|
|
-
|
|
|
|
- } else if (type == 'securityCheck') {
|
|
|
|
|
|
+ this.pageType = 1;
|
|
|
|
+
|
|
|
|
+ }else if (type == 'securityCheck') {
|
|
//安全检查
|
|
//安全检查
|
|
this.getGentleIdentifier();
|
|
this.getGentleIdentifier();
|
|
} else if (type == 'securityExamination') {
|
|
} else if (type == 'securityExamination') {
|
|
@@ -233,6 +240,35 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ /* 扫一扫*/
|
|
|
|
+ saoCode() {
|
|
|
|
+ let self = this;
|
|
|
|
+ uni.scanCode({
|
|
|
|
+ onlyFromCamera: true,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ let list = res.result.split("?")[1].split("&");
|
|
|
|
+ let codeData = {};
|
|
|
|
+ list.forEach((item) => {
|
|
|
|
+ codeData[item.split("=")[0]] = item.split("=")[1];
|
|
|
|
+ })
|
|
|
|
+ if(codeData.type == 1 || codeData.type == 5 || codeData.type == 7 ||
|
|
|
|
+ codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
|
|
|
|
+ codeData.type == 11 || codeData.type == 12){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ mask: true,
|
|
|
|
+ icon: "none",
|
|
|
|
+ position: "center",
|
|
|
|
+ title: '请扫描正确的小程序二维码',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -410,6 +446,14 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .scan_btn {
|
|
|
|
+ z-index:10;
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 210rpx;
|
|
|
|
+ right: 0rpx;
|
|
|
|
+ width: 130rpx;
|
|
|
|
+ height: 130rpx;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|