Files
dvcp_v2_wxcp_app/library/apps/AppHandSnapshot/AppHandSnapshot.vue

155 lines
3.3 KiB
Vue
Raw Normal View History

2021-12-17 18:21:35 +08:00
<template>
<div class="AppHandSnapshot">
2022-06-13 09:57:52 +08:00
<component v-if="refresh && isGridMember" :is="component" @change="onChange" :params="params"/>
<div class="tabs" v-if="isTab && isGridMember">
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-06-13 09:57:52 +08:00
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/>
2022-01-06 09:25:10 +08:00
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p>
2022-01-05 10:48:53 +08:00
</div>
</div>
2022-06-13 09:57:52 +08:00
<div v-if="!isGridMember" class="empty">
2022-01-14 17:02:52 +08:00
<img src="./components/img/no-admin.png" alt="">
2023-03-17 09:47:38 +08:00
<p>没有网格员权限<br/>无法查看{{user.corpId == 'wpytYEDgAACQq2uZ5x54MvlJ9fgvSPXQ' ? '微心愿' : '随手拍'}}信息哦~</p>
2022-01-14 17:02:52 +08:00
</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'
2022-06-13 09:57:52 +08:00
import {mapState} from 'vuex'
2022-01-05 16:16:45 +08:00
2021-12-17 18:21:35 +08:00
export default {
name: 'AppHandSnapshot',
appName: '随手拍',
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-14 19:01:00 +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,
2021-12-17 18:21:35 +08:00
}
},
2022-06-13 09:57:52 +08:00
computed: {
...mapState(['user']),
isGridMember() {
return this.user.girdCheckType > 0
}
},
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-06-13 09:57:52 +08:00
}
2021-12-17 18:21:35 +08:00
},
2022-01-05 16:16:45 +08:00
onShow() {
2023-03-17 09:47:38 +08:00
document.title = this.user.corpId == 'wpytYEDgAACQq2uZ5x54MvlJ9fgvSPXQ' ? '微心愿' : '随手拍'
2022-01-05 16:16:45 +08:00
uni.$on('hideTab', () => {
this.isTab = false
})
uni.$on('showTab', () => {
this.isTab = true
})
2022-06-13 09:57:52 +08:00
2021-12-17 18:21:35 +08:00
},
2022-01-05 16:16:45 +08:00
onReachBottom() {
2022-06-13 09:57:52 +08:00
if (!this.tabIndex) {
2022-01-07 16:18:51 +08:00
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-06-13 09:57:52 +08:00
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-06-13 09:57:52 +08:00
2022-01-06 09:25:10 +08:00
.item {
2022-01-05 16:16:45 +08:00
flex: 1;
text-align: center;
2022-06-13 09:57:52 +08:00
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-06-13 09:57:52 +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-06-13 09:57:52 +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-06-13 09:57:52 +08:00
.empty {
2022-01-14 17:02:52 +08:00
text-align: center;
2022-06-13 09:57:52 +08:00
img {
2022-01-14 17:02:52 +08:00
width: 282px;
height: 306px;
margin: 136px auto 0;
}
2022-06-13 09:57:52 +08:00
p {
2022-01-14 17:02:52 +08:00
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
}
}
2021-12-17 18:21:35 +08:00
</style>