diff --git a/pages/product/addGoodDetail/addGoodDetail.vue b/pages/product/addGoodDetail/addGoodDetail.vue index efaba34..30fabd8 100644 --- a/pages/product/addGoodDetail/addGoodDetail.vue +++ b/pages/product/addGoodDetail/addGoodDetail.vue @@ -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 = [] + }) + } diff --git a/pages/product/list/index.vue b/pages/product/list/index.vue index 3b5532c..faa6f2b 100644 --- a/pages/product/list/index.vue +++ b/pages/product/list/index.vue @@ -56,12 +56,12 @@ --> - + + :style="{height:[1,7].includes(where.type) ?'410rpx':'336rpx'}"> @@ -98,7 +98,7 @@ + @click="showOverly=true,xjItem=item" v-if='where.type==6||where.type==5||where.type==7'> 删除 订单{{item.product_order_number}} - - + + + + 审核未通过:{{item.refusal}} + + + - + @@ -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; - productDestory(that.mer_id, item.product_id) + 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({