店铺router

This commit is contained in:
唐明明
2021-11-04 16:20:18 +08:00
parent cc8833e353
commit f8aed4d12c
2 changed files with 11 additions and 5 deletions

View File

@@ -168,7 +168,7 @@
<view class="btns" v-if="storePer">
<button type="default" size="default" @click="$Router.push({name:'shopCreate'})">新建店铺</button>
</view>
<view class=""v-else>
<view v-else>
<view class="btns" v-if="storePer">
<button type="default" size="default">当前没有创建店铺的权限</button>
</view>
@@ -221,6 +221,7 @@
servicesArr : [], // 可选服务
type : 1, // 1为商品2为服务
storePer : true,// 默认可以创建门店
shopRefresh: false
};
},
computed:{
@@ -229,11 +230,16 @@
}
},
beforeRouteLeave(to, from, next){
console.log(to)
console.log(from)
console.log(next)
if(to.name === 'shopCreate'){
this.shopRefresh = true
}
next()
},
onShow(){
if(this.shopRefresh){
// 刷新店铺
}
},
created() {
// 编辑状态信息
if(this.$Route.query.type && this.$Route.query.type === 'edit'){