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

126 lines
2.6 KiB
Vue
Raw Normal View History

2021-12-17 18:21:35 +08:00
<template>
<div class="AppHandSnapshot">
2022-01-05 16:16:45 +08:00
<component
v-if="refresh"
:is="component"
@change="onChange"
:params="params">
</component>
<div class="tabs" v-if="isTab">
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
<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>
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-05 17:56:20 +08:00
component: 'Set',
2022-01-05 16:16:45 +08:00
params: {},
refresh: true,
2022-01-05 17:56:20 +08:00
tabIndex: 2,
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: '办理',
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: '统计',
component: 'Statistics'
2021-12-17 18:21:35 +08:00
},
{
2022-01-05 16:16:45 +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-05 16:16:45 +08:00
isTab: true
2021-12-17 18:21:35 +08:00
}
},
2022-01-05 16:16:45 +08:00
components: {
List,
Statistics,
Set
},
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-05 10:48:53 +08:00
}
2021-12-17 18:21:35 +08:00
},
2022-01-05 16:16:45 +08:00
onShow() {
document.title = "随手拍"
uni.$on('hideTab', () => {
this.isTab = false
})
uni.$on('showTab', () => {
this.isTab = true
})
2021-12-17 18:21:35 +08:00
},
2022-01-05 16:16:45 +08:00
onReachBottom() {
uni.$emit('nextList')
}
2021-12-17 18:21:35 +08:00
}
</script>
2022-01-05 16:16:45 +08:00
<style lang="scss" scoped>
.AppHandSnapshot{
2021-12-17 18:21:35 +08:00
height: 100%;
}
2022-01-05 16:16:45 +08:00
.tabs{
width: 100%;
height: 98px;
background: #FFF;
border-top: 1px solid #ddd;
position: fixed;
bottom: 0;
left: 0;
display: flex;
.item{
flex: 1;
text-align: center;
img{
width: 56px;
height: 56px;
margin-top: 8px;
2021-12-17 18:21:35 +08:00
}
2022-01-05 16:16:45 +08:00
p{
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #C4CAD4;
line-height: 8px;
2021-12-17 18:21:35 +08:00
}
2022-01-05 16:16:45 +08:00
.color-3267F0{
color: #3267F0;
2022-01-05 10:48:53 +08:00
}
}
2021-12-17 18:21:35 +08:00
}
</style>