创建商品转跳店铺状态维护

This commit is contained in:
唐明明
2021-11-04 16:15:24 +08:00
10 changed files with 2102 additions and 1926 deletions

View File

@@ -149,18 +149,31 @@
<!-- 选择店铺 -->
<uni-popup ref="storePopup">
<view class="category-popup">
<view class="header">
<view class="title">选择店铺</view>
</view>
<view class="category-flex">
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in storesArr" :key="index" @click="item.check = !item.check">
<view class="category-name">{{item.name}}</view>
<view class="category-content">{{item.address}}</view>
<block v-if="storesArr.length <0">
<view class="header">
<view class="title">选择店铺</view>
</view>
</view>
<view class="btns">
<button type="default" size="default" @click="affirmCategory('stores', 'storePopup')">确定</button>
</view>
<view class="category-flex">
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in storesArr" :key="index" @click="item.check = !item.check">
<view class="category-name">{{item.name}}</view>
<view class="category-content">{{item.address}}</view>
</view>
</view>
<view class="btns">
<button type="default" size="default" @click="affirmCategory('stores', 'storePopup')">确定</button>
</view>
</block>
<block v-else>
<no-list name="no-shop" txt='您还没有创建店铺~' />
<view class="btns" v-if="storePer">
<button type="default" size="default" @click="$Router.push({name:'shopCreate'})">新建店铺</button>
</view>
<view class=""v-else>
<view class="btns" v-if="storePer">
<button type="default" size="default">当前没有创建店铺的权限</button>
</view>
</view>
</block>
</view>
</uni-popup>
<!-- 安全区 -->
@@ -207,6 +220,7 @@
tagsIndex : 0, // 选择标签的下标
servicesArr : [], // 可选服务
type : 1, // 1为商品2为服务
storePer : true,// 默认可以创建门店
};
},
computed:{
@@ -214,6 +228,12 @@
return this.percent * this.skus_price
}
},
beforeRouteLeave(to, from, next){
console.log(to)
console.log(from)
console.log(next)
next()
},
created() {
// 编辑状态信息
if(this.$Route.query.type && this.$Route.query.type === 'edit'){
@@ -258,7 +278,7 @@
this.services = services
this.stores = stores
this.percent = Number(res.percent)
this.storePer = res.storePer
}).catch(err => {
uni.showToast({
@@ -291,6 +311,7 @@
this.categoryId = this.$Route.query.id
this.categoryCid= this.$Route.query.cid
this.percent = Number(res.percent)
this.storePer = res.storePer
}).catch(err => {
uni.showToast({
title: err.message,
@@ -633,7 +654,7 @@
.btns{
padding-top: $padding * 2;
button{
background: $text-price;
background: $mian-color;
border-radius: 0;
height: 90rpx;
line-height: 90rpx;