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

File diff suppressed because one or more lines are too long