更新商品甘丽

This commit is contained in:
zmj 2024-04-24 08:47:26 +08:00
parent 773efe87ca
commit 5b7783d015
2 changed files with 78 additions and 42 deletions

View File

@ -729,21 +729,20 @@
let that = this let that = this
this.isSet2() this.isSet2()
that.formData.delivery_way = that.$store.state.app.userInfo?.mer_info.delivery_way.split(',') that.formData.delivery_way = that.$store.state.app.userInfo?.mer_info.delivery_way.split(',')
console.log(that.formData) if (option.product_id) {
// if (option.product_id) { that.formData.product_id = option.product_id
// that.formData.product_id = option.product_id this.mode = 'edit'
// this.mode = 'edit' this.showSet = true
// this.showSet = true productDetail(option.mer_id, option.product_id).then(res => {
// productDetail(option.mer_id, option.product_id).then(res => { this.formData = res.data
// this.formData = res.data //
// // this.formData.product_attribute = JSON.parse(this.formData.product_attribute)
// this.formData.product_attribute = JSON.parse(this.formData.product_attribute) this.formData.cate_name = this.formData.storeCategory.cate_name
// this.formData.cate_name = this.formData.storeCategory.cate_name this.formData.cate_id = this.formData.storeCategory.store_category_id
// this.formData.cate_id = this.formData.storeCategory.store_category_id this.formData.imageList = this.formData.image_list
// this.formData.imageList = this.formData.image_list if (!that.formData.imageList) that.formData.imageList = []
// if (!that.formData.imageList) that.formData.imageList = [] })
// }) }
// }

View File

@ -56,12 +56,12 @@
</view> </view>
</scroll-view> </scroll-view>
</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="wrapper" style="background-color: #F1F1F1;">
<view class='product_list' v-if="productList && productList.length > 0"> <view class='product_list' v-if="productList && productList.length > 0">
<view v-for="(item,index) in productList" :key="index" class="card" <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="card-top">
<view class="" style="width: 196rpx;height: 196rpx;position: relative;margin-right: 20rpx;"> <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> <u--image :src="item.image" width='196rpx' height='196rpx' duration="450"></u--image>
@ -98,7 +98,7 @@
<view class="" <view class=""
style="display: flex;justify-content: space-between;font-size: 28rpx;font-size: 28rpx;"> 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;" <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>
<view class="" v-else style="border-right: 1px solid #CECECE;flex: 1;text-align: center;" <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;"> <view class="card-footer-li" style="flex: 1;border: none;">
订单<text style="color: #FC452F;">{{item.product_order_number}}</text> 订单<text style="color: #FC452F;">{{item.product_order_number}}</text>
</view> </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>
<!-- <view class='item' @click="yinc"> <!-- <view class='item' @click="yinc">
<view class='image'> <view class='image'>
@ -212,7 +224,7 @@
<view class="" v-if='where.type==6'> <view class="" v-if='where.type==6'>
当前商品待审核删除后将移至回收站 当前商品待审核删除后将移至回收站
</view> </view>
<view class="" v-else-if='where.type==5'> <view class="" v-else-if='where.type==5||where.type==7'>
确定删除吗 确定删除吗
</view> </view>
<view class="" v-else-if='where.type==2'> <view class="" v-else-if='where.type==2'>
@ -228,12 +240,12 @@
<view class="warp-foot-li" v-if='![2,3].includes(where.type)'> <view class="warp-foot-li" v-if='![2,3].includes(where.type)'>
<u-button text="返回" @click="showOverly = false"></u-button> <u-button text="返回" @click="showOverly = false"></u-button>
</view> </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> <u-button text="返回" @click="showOverly = false"></u-button>
</view> --> </view>
<view class="warp-foot-li"> <view class="warp-foot-li">
<u-button type='primary' v-if='where.type==6||where.type==5' text="删除" <u-button type='primary' v-if='where.type==6||where.type==5||where.type==7' text="删除"
@tap="handleRecycle(xjItem)"></u-button> @tap="handleRecycle(xjItem,where.type)"></u-button>
<u-button type='primary' v-else-if='(where.type==2 && flag) ||(where.type==3 &&flag1)' <u-button type='primary' v-else-if='(where.type==2 && flag) ||(where.type==3 &&flag1)'
text="我知道了" @tap="Iknow"></u-button> text="我知道了" @tap="Iknow"></u-button>
<u-button type='primary' v-else text="继续下架" @tap="handleShelves(xjItem,0)"></u-button> <u-button type='primary' v-else text="继续下架" @tap="handleShelves(xjItem,0)"></u-button>
@ -339,10 +351,11 @@
}, },
data() { data() {
return { return {
current: 0,
flag1: true, flag1: true,
flag: true, flag: true,
xjList: [1, 3, 4], xjList: [1, 3, ],
sjList: [2], sjList: [2, 4],
xjItem: "", xjItem: "",
showOverly: false, showOverly: false,
isWholeSale: false, isWholeSale: false,
@ -405,14 +418,15 @@
this.getCategoryList(); this.getCategoryList();
this.isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale == 2; this.isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale == 2;
if (options.type) { if (options.type) {
this.tabClick = options.type this.where.type = options.type
// console.log(options.type)
// this.tabClick = options.type
} }
var that = this; var that = this;
// //
uni.getSystemInfo({ uni.getSystemInfo({
success(e) { success(e) {
that.isWidth = e.windowWidth / 5; that.isWidth = e.windowWidth / 5;
console.log(that.isWidth)
} }
}); });
}, },
@ -481,8 +495,8 @@
this.tabList = res.data; this.tabList = res.data;
let clickIndex = 0; let clickIndex = 0;
this.tabList.forEach((item, index) => { this.tabList.forEach((item, index) => {
if (item.type == this.type) { if (item.type == this.where.type) {
clickIndex = index; this.current = index;
} }
}); });
this.setMenuLeft(clickIndex); this.setMenuLeft(clickIndex);
@ -847,16 +861,17 @@
}); });
}, },
handleRecycle(item, index) { handleRecycle(item, type) {
let index = this.productList.findIndex(items => items.product_id == item.product_id)
let that = this; let that = this
type == 5 ?
productDestory(that.mer_id, item.product_id) productDestory(that.mer_id, item.product_id)
.then(res => { .then(res => {
that.$util.Tips({ that.$util.Tips({
title: res.message, title: res.message,
icon: 'success' icon: 'success'
}, () => { }, () => {
// that.productList.splice(index, 1); that.productList.splice(index, 1);
}); });
// this.$set(this, 'num', -1); // this.$set(this, 'num', -1);
}) })
@ -864,7 +879,24 @@
this.$set(this, 'num', -1); this.$set(this, 'num', -1);
Toast(`${rej}, 删除失败`); 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 this.showOverly = false
}, },
// 0 // 0
@ -877,8 +909,8 @@
icon: 'none' icon: 'none'
}) })
that.showOverly = false that.showOverly = false
this.productList = [] // this.productList = []
this.getList(this.mer_id, false); // this.getList(this.mer_id, false);
// uni.showModal({ // uni.showModal({
// content: '', // content: '',
// success: function(res) { // success: function(res) {
@ -895,13 +927,15 @@
// } // }
// }); // });
} else { } else {
console.log("laizhe1")
that.onAndOff(item, 1) that.onAndOff(item, 1)
this.productList = [] // this.productList = []
this.getList(this.mer_id, false); // this.getList(this.mer_id, false);
} }
}, },
// //
onAndOff(item, status) { onAndOff(item, status) {
// console.log("")
let that = this; let that = this;
productOffApi(that.mer_id, item.product_id, { productOffApi(that.mer_id, item.product_id, {
status: status status: status
@ -910,8 +944,11 @@
title: res.message, title: res.message,
icon: 'success' icon: 'success'
}, () => { }, () => {
that.loading = false
that.loaded = false
that.$set(item, 'is_show', item.is_show == 0 ? 1 : 0); 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 => { }).catch(err => {
return that.$util.Tips({ return that.$util.Tips({