Files
dvcp_v2_wxcp_app/src/apps/AppHandSnapshot/AppHandSnapshot.vue

156 lines
3.3 KiB
Vue
Raw Normal View History

2021-12-17 18:21:35 +08:00
<template>
<div class="AppHandSnapshot">
2022-01-14 17:02:52 +08:00
<component v-if="refresh && isAdmin" :is="component" @change="onChange" :params="params"> </component>
<div class="tabs" v-if="isTab && isAdmin">
2022-01-05 16:16:45 +08:00
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
2022-01-06 09:25:10 +08:00
<img :src="tabIndex == index ? item.activeImg : item.img" alt="" />
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p>
2022-01-05 10:48:53 +08:00
</div>
</div>
2022-01-14 17:02:52 +08:00
<div v-if="!isAdmin" class="empty">
<img src="./components/img/no-admin.png" alt="">
<p>没有网格员权限<br />无法查看网格信息哦~</p>
</div>
2021-12-17 18:21:35 +08:00
</div>
</template>
<script>
2022-01-05 16:16:45 +08:00
import List from './List.vue'
import Statistics from './Statistics.vue'
import Set from './Set.vue'
2021-12-17 18:21:35 +08:00
export default {
name: 'AppHandSnapshot',
appName: '随手拍',
2022-01-05 16:16:45 +08:00
2021-12-17 18:21:35 +08:00
data() {
return {
2022-01-06 09:25:10 +08:00
component: 'List',
2022-01-05 16:16:45 +08:00
params: {},
refresh: true,
2022-01-06 09:25:10 +08:00
tabIndex: 0,
2022-01-05 16:16:45 +08:00
tabs: [
2021-12-17 18:21:35 +08:00
{
2022-01-05 16:16:45 +08:00
img: require('./components/img/handle-icon.png'),
activeImg: require('./components/img/handle-icon-active.png'),
text: '办理',
2022-01-06 09:25:10 +08:00
component: 'List',
2021-12-17 18:21:35 +08:00
},
{
2022-01-05 16:16:45 +08:00
img: require('./components/img/statistics-icon.png'),
activeImg: require('./components/img/statistics-icon-active.png'),
text: '统计',
2022-01-06 09:25:10 +08:00
component: 'Statistics',
2021-12-17 18:21:35 +08:00
},
2022-01-13 11:13:06 +08:00
{
img: require('./components/img/set-icon.png'),
activeImg: require('./components/img/set-icon-active.png'),
text: '配置',
component: 'Set'
}
2021-12-17 18:21:35 +08:00
],
2022-01-06 09:25:10 +08:00
isTab: true,
2022-01-14 17:02:52 +08:00
isAdmin: false
2021-12-17 18:21:35 +08:00
}
},
2022-01-05 16:16:45 +08:00
components: {
List,
Statistics,
2022-01-06 09:25:10 +08:00
Set,
2022-01-05 16:16:45 +08:00
},
2021-12-17 18:21:35 +08:00
2022-01-05 16:16:45 +08:00
methods: {
onChange(e) {
this.params = e.params
this.component = e.type
2021-12-17 18:21:35 +08:00
},
2022-01-05 16:16:45 +08:00
tabClick(index, component) {
this.tabIndex = index
this.component = component
this.refresh = false
this.$nextTick(() => {
this.refresh = true
})
2022-01-06 09:25:10 +08:00
},
2022-01-14 17:02:52 +08:00
isGirdUser() {
this.isAdmin = false
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType != '0') {
this.isAdmin = true
}
}
})
},
},
onLoad() {
this.isGirdUser()
2021-12-17 18:21:35 +08:00
},
2022-01-05 16:16:45 +08:00
onShow() {
2022-01-06 09:25:10 +08:00
document.title = '随手拍'
2022-01-05 16:16:45 +08:00
uni.$on('hideTab', () => {
this.isTab = false
})
uni.$on('showTab', () => {
this.isTab = true
})
2022-01-14 17:02:52 +08:00
2021-12-17 18:21:35 +08:00
},
2022-01-05 16:16:45 +08:00
onReachBottom() {
2022-01-07 16:18:51 +08:00
if(!this.tabIndex) {
uni.$emit('nextList')
}
2022-01-06 09:25:10 +08:00
},
2021-12-17 18:21:35 +08:00
}
</script>
2022-01-05 16:16:45 +08:00
<style lang="scss" scoped>
2022-01-06 09:25:10 +08:00
.AppHandSnapshot {
2021-12-17 18:21:35 +08:00
height: 100%;
}
2022-01-06 09:25:10 +08:00
.tabs {
2022-01-05 16:16:45 +08:00
width: 100%;
height: 98px;
2022-01-06 09:25:10 +08:00
background: #fff;
2022-01-05 16:16:45 +08:00
border-top: 1px solid #ddd;
position: fixed;
bottom: 0;
left: 0;
display: flex;
2022-01-06 09:25:10 +08:00
.item {
2022-01-05 16:16:45 +08:00
flex: 1;
text-align: center;
2022-01-06 09:25:10 +08:00
img {
2022-01-05 16:16:45 +08:00
width: 56px;
height: 56px;
margin-top: 8px;
2021-12-17 18:21:35 +08:00
}
2022-01-06 09:25:10 +08:00
p {
2022-01-05 16:16:45 +08:00
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
2022-01-06 09:25:10 +08:00
color: #c4cad4;
2022-01-05 16:16:45 +08:00
line-height: 8px;
2021-12-17 18:21:35 +08:00
}
2022-01-06 09:25:10 +08:00
.color-3267F0 {
color: #3267f0;
2022-01-05 10:48:53 +08:00
}
}
2021-12-17 18:21:35 +08:00
}
2022-01-14 17:02:52 +08:00
.empty{
text-align: center;
img{
width: 282px;
height: 306px;
margin: 136px auto 0;
}
p{
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
}
}
2021-12-17 18:21:35 +08:00
</style>