|
@@ -38,15 +38,8 @@
|
|
|
import { mapGetters } from 'vuex';
|
|
|
export default {
|
|
|
name: 'TabBar',
|
|
|
- // props: {
|
|
|
- // : {
|
|
|
- // type: String,
|
|
|
- // default: 'clientHome',
|
|
|
- // },
|
|
|
- // },
|
|
|
data() {
|
|
|
return {
|
|
|
- currentTab:'clientHome',
|
|
|
clientList: [
|
|
|
{
|
|
|
text: '首页',
|
|
@@ -125,12 +118,10 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
- ...mapGetters(['scope'])
|
|
|
+ ...mapGetters(['scope','currentTab'])
|
|
|
},
|
|
|
methods: {
|
|
|
handTab(row) {
|
|
|
- console.log(row);
|
|
|
- this.currentTab = row.name
|
|
|
if(this.scope === 'CUSTOMER'){
|
|
|
uni.switchTab({
|
|
|
url:row.pagePath
|
|
@@ -140,20 +131,18 @@ export default {
|
|
|
url:row.pagePath
|
|
|
})
|
|
|
}
|
|
|
- // uni.navigateTo({
|
|
|
- // url:row.pagePath
|
|
|
- // })
|
|
|
- // if (this.isShow) {
|
|
|
- // uni.switchTab({
|
|
|
- // url: row.pagePath,
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // uni.redirectTo({
|
|
|
- // url: row.pagePath,
|
|
|
- // });
|
|
|
- // }
|
|
|
+ this.$store.commit('SET_CURRENT_TAB',row.name)
|
|
|
},
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ scope(newV,oldV){
|
|
|
+ if(newV=== 'MERCHANT'){
|
|
|
+ this.$store.commit("SET_CURRENT_TAB",this.merchantList[0].name)
|
|
|
+ }else{
|
|
|
+ this.$store.commit("SET_CURRENT_TAB",this.clientList[0].name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|