暖心人
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.6 KiB

1 year ago
<template>
<view class="footer-nav row" >
<view class="nav-item col-3 row" v-for="(item,index) in buttonGroup" @click="commitFootCheck(item)">
<view class="nav-ico col-12">
<image mode="heightFix" class="img" :src="item.image+((item.name === footCheck)?'-active':'')+'.png'"/>
</view>
<view class="nav-title col-12" :class="{active:(item.name === footCheck)}" >{{item.title}}</view>
</view>
</view>
1 year ago
</template>
<script>
import {
imghost
} from '@/config/host.js'
export default {
props: {
},
data() {
return {
footCheck: 'home',
title: 'Hello',
loading: true,
buttonGroup: [{
image: imghost + "/static/image/foot-1",
1 year ago
url: '/pages/index/index',
name: 'home',
title:'暖新人',
1 year ago
},
{
image: imghost + "/static/image/foot-2",
1 year ago
url: '/pages/order/index',
name: 'order',
title:'暖新活动',
1 year ago
},
{
image: imghost + "/static/image/foot-3",
1 year ago
url: '/pages/chatList/index',
name: 'chat',
title:'暖新商城',
1 year ago
},
{
image: imghost + "/static/image/foot-4",
1 year ago
url: '/pages/user/index',
name: 'user',
title:'我的',
1 year ago
},
],
}
},
onLoad() {
},
methods: {
commitFootCheck(item) {
this.$store.commit('footCheck',item.name);
this.$store.commit('title',item.title);
console.log('commit');
},
isFootCheck() {
// return this.;
}
},
watch: {
"$store.state.footCheck": {
handler(newVal, oldVal) {
this.footCheck = newVal;
}
}
}
}
</script>
<style lang="scss">
@import '@/components/FooterNav/components/index.scss';
</style>