更新商品甘丽
This commit is contained in:
parent
773efe87ca
commit
5b7783d015
|
@ -729,21 +729,20 @@
|
|||
let that = this
|
||||
this.isSet2()
|
||||
that.formData.delivery_way = that.$store.state.app.userInfo?.mer_info.delivery_way.split(',')
|
||||
console.log(that.formData)
|
||||
// if (option.product_id) {
|
||||
// that.formData.product_id = option.product_id
|
||||
// this.mode = 'edit'
|
||||
// this.showSet = true
|
||||
// productDetail(option.mer_id, option.product_id).then(res => {
|
||||
// this.formData = res.data
|
||||
// //该死的后端,格式不按添加的格式来
|
||||
// this.formData.product_attribute = JSON.parse(this.formData.product_attribute)
|
||||
// this.formData.cate_name = this.formData.storeCategory.cate_name
|
||||
// this.formData.cate_id = this.formData.storeCategory.store_category_id
|
||||
// this.formData.imageList = this.formData.image_list
|
||||
// if (!that.formData.imageList) that.formData.imageList = []
|
||||
// })
|
||||
// }
|
||||
if (option.product_id) {
|
||||
that.formData.product_id = option.product_id
|
||||
this.mode = 'edit'
|
||||
this.showSet = true
|
||||
productDetail(option.mer_id, option.product_id).then(res => {
|
||||
this.formData = res.data
|
||||
//该死的后端,格式不按添加的格式来
|
||||
this.formData.product_attribute = JSON.parse(this.formData.product_attribute)
|
||||
this.formData.cate_name = this.formData.storeCategory.cate_name
|
||||
this.formData.cate_id = this.formData.storeCategory.store_category_id
|
||||
this.formData.imageList = this.formData.image_list
|
||||
if (!that.formData.imageList) that.formData.imageList = []
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -56,12 +56,12 @@
|
|||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
<u-tabs :list="tabList" @click="selectMenu" type='primary' lineColor='#32BB3B'></u-tabs>
|
||||
<u-tabs :current='current' :list="tabList" @click="selectMenu" type='primary' lineColor='#32BB3B'></u-tabs>
|
||||
|
||||
<view class="wrapper" style="background-color: #F1F1F1;">
|
||||
<view class='product_list' v-if="productList && productList.length > 0">
|
||||
<view v-for="(item,index) in productList" :key="index" class="card"
|
||||
:style="{height:where.type==1?'410rpx':'336rpx'}">
|
||||
:style="{height:[1,7].includes(where.type) ?'410rpx':'336rpx'}">
|
||||
<view class="card-top">
|
||||
<view class="" style="width: 196rpx;height: 196rpx;position: relative;margin-right: 20rpx;">
|
||||
<u--image :src="item.image" width='196rpx' height='196rpx' duration="450"></u--image>
|
||||
|
@ -98,7 +98,7 @@
|
|||
<view class=""
|
||||
style="display: flex;justify-content: space-between;font-size: 28rpx;font-size: 28rpx;">
|
||||
<view class="" style="border-right: 1px solid #CECECE;flex: 1;text-align: center;"
|
||||
@click="showOverly=true,xjItem=item" v-if='where.type==6||where.type==5'>
|
||||
@click="showOverly=true,xjItem=item" v-if='where.type==6||where.type==5||where.type==7'>
|
||||
删除
|
||||
</view>
|
||||
<view class="" v-else style="border-right: 1px solid #CECECE;flex: 1;text-align: center;"
|
||||
|
@ -131,8 +131,20 @@
|
|||
<view class="card-footer-li" style="flex: 1;border: none;">
|
||||
订单<text style="color: #FC452F;">{{item.product_order_number}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="card-footer" style="color: #FC452F;padding-left: 20rpx;" v-if='where.type==7'>
|
||||
<view class="ellipsis" style="width: 650rpx;">
|
||||
审核未通过:{{item.refusal}}
|
||||
</view>
|
||||
<!-- <view class="card-footer-li" style="flex: 1.5;">
|
||||
近30天: 访客<text style="color: #FC452F;">{{item.product_visitor_number}}</text>
|
||||
</view>
|
||||
<view class="card-footer-li" style="flex: 1;">
|
||||
咨询<text style="color: #FC452F;">{{item.product_consult_number}}</text>
|
||||
</view>
|
||||
<view class="card-footer-li" style="flex: 1;border: none;">
|
||||
订单<text style="color: #FC452F;">{{item.product_order_number}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- <view class='item' @click="yinc">
|
||||
<view class='image'>
|
||||
|
@ -212,7 +224,7 @@
|
|||
<view class="" v-if='where.type==6'>
|
||||
当前商品待审核,删除后将移至回收站
|
||||
</view>
|
||||
<view class="" v-else-if='where.type==5'>
|
||||
<view class="" v-else-if='where.type==5||where.type==7'>
|
||||
确定删除吗?
|
||||
</view>
|
||||
<view class="" v-else-if='where.type==2'>
|
||||
|
@ -228,12 +240,12 @@
|
|||
<view class="warp-foot-li" v-if='![2,3].includes(where.type)'>
|
||||
<u-button text="返回" @click="showOverly = false"></u-button>
|
||||
</view>
|
||||
<!-- <view class="warp-foot-li" v-if='where.type==2&&'>
|
||||
<view class="warp-foot-li" v-if='where.type==3&&!flag1'>
|
||||
<u-button text="返回" @click="showOverly = false"></u-button>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="warp-foot-li">
|
||||
<u-button type='primary' v-if='where.type==6||where.type==5' text="删除"
|
||||
@tap="handleRecycle(xjItem)"></u-button>
|
||||
<u-button type='primary' v-if='where.type==6||where.type==5||where.type==7' text="删除"
|
||||
@tap="handleRecycle(xjItem,where.type)"></u-button>
|
||||
<u-button type='primary' v-else-if='(where.type==2 && flag) ||(where.type==3 &&flag1)'
|
||||
text="我知道了" @tap="Iknow"></u-button>
|
||||
<u-button type='primary' v-else text="继续下架" @tap="handleShelves(xjItem,0)"></u-button>
|
||||
|
@ -339,10 +351,11 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
flag1: true,
|
||||
flag: true,
|
||||
xjList: [1, 3, 4],
|
||||
sjList: [2],
|
||||
xjList: [1, 3, ],
|
||||
sjList: [2, 4],
|
||||
xjItem: "",
|
||||
showOverly: false,
|
||||
isWholeSale: false,
|
||||
|
@ -405,14 +418,15 @@
|
|||
this.getCategoryList();
|
||||
this.isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale == 2;
|
||||
if (options.type) {
|
||||
this.tabClick = options.type
|
||||
this.where.type = options.type
|
||||
// console.log(options.type)
|
||||
// this.tabClick = options.type
|
||||
}
|
||||
var that = this;
|
||||
// 获取设备宽度
|
||||
uni.getSystemInfo({
|
||||
success(e) {
|
||||
that.isWidth = e.windowWidth / 5;
|
||||
console.log(that.isWidth)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -481,8 +495,8 @@
|
|||
this.tabList = res.data;
|
||||
let clickIndex = 0;
|
||||
this.tabList.forEach((item, index) => {
|
||||
if (item.type == this.type) {
|
||||
clickIndex = index;
|
||||
if (item.type == this.where.type) {
|
||||
this.current = index;
|
||||
}
|
||||
});
|
||||
this.setMenuLeft(clickIndex);
|
||||
|
@ -847,16 +861,17 @@
|
|||
});
|
||||
},
|
||||
|
||||
handleRecycle(item, index) {
|
||||
|
||||
let that = this;
|
||||
handleRecycle(item, type) {
|
||||
let index = this.productList.findIndex(items => items.product_id == item.product_id)
|
||||
let that = this
|
||||
type == 5 ?
|
||||
productDestory(that.mer_id, item.product_id)
|
||||
.then(res => {
|
||||
that.$util.Tips({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
}, () => {
|
||||
// that.productList.splice(index, 1);
|
||||
that.productList.splice(index, 1);
|
||||
});
|
||||
// this.$set(this, 'num', -1);
|
||||
})
|
||||
|
@ -864,7 +879,24 @@
|
|||
|
||||
this.$set(this, 'num', -1);
|
||||
Toast(`${rej}, 删除失败`);
|
||||
}) :
|
||||
productDeleteApi(that.mer_id, item.product_id)
|
||||
.then(res => {
|
||||
that.$util.Tips({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
}, () => {
|
||||
that.productList.splice(index, 1);
|
||||
});
|
||||
this.$set(this, 'num', -1);
|
||||
})
|
||||
.catch(rej => {
|
||||
|
||||
this.$set(this, 'num', -1);
|
||||
Toast(`${rej}, 加入回收站失败`);
|
||||
})
|
||||
|
||||
|
||||
this.showOverly = false
|
||||
},
|
||||
//下架 0
|
||||
|
@ -877,8 +909,8 @@
|
|||
icon: 'none'
|
||||
})
|
||||
that.showOverly = false
|
||||
this.productList = []
|
||||
this.getList(this.mer_id, false);
|
||||
// this.productList = []
|
||||
// this.getList(this.mer_id, false);
|
||||
// uni.showModal({
|
||||
// content: '确定要下架该商品么?',
|
||||
// success: function(res) {
|
||||
|
@ -895,13 +927,15 @@
|
|||
// }
|
||||
// });
|
||||
} else {
|
||||
console.log("laizhe1")
|
||||
that.onAndOff(item, 1)
|
||||
this.productList = []
|
||||
this.getList(this.mer_id, false);
|
||||
// this.productList = []
|
||||
// this.getList(this.mer_id, false);
|
||||
}
|
||||
},
|
||||
//上下架
|
||||
onAndOff(item, status) {
|
||||
// console.log("来这热")
|
||||
let that = this;
|
||||
productOffApi(that.mer_id, item.product_id, {
|
||||
status: status
|
||||
|
@ -910,8 +944,11 @@
|
|||
title: res.message,
|
||||
icon: 'success'
|
||||
}, () => {
|
||||
that.loading = false
|
||||
that.loaded = false
|
||||
that.$set(item, 'is_show', item.is_show == 0 ? 1 : 0);
|
||||
that.getList(this.mer_id, false)
|
||||
console.log("萨芬大沙发沙发")
|
||||
that.getList(this.mer_id, true)
|
||||
});
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
|
|
Loading…
Reference in New Issue