From 49b4ed0f28bcc893dcb419b1939bd8f161110dc7 Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Fri, 27 Mar 2026 10:43:19 +0800 Subject: [PATCH] 11 --- package1/myCenter/addGoods.vue | 4 +- package1/myCenter/goodsList.vue | 132 +++++++++++++++++++++++++++----- 2 files changed, 116 insertions(+), 20 deletions(-) diff --git a/package1/myCenter/addGoods.vue b/package1/myCenter/addGoods.vue index 0f64bc9..16bf023 100644 --- a/package1/myCenter/addGoods.vue +++ b/package1/myCenter/addGoods.vue @@ -46,9 +46,9 @@ - + diff --git a/package1/myCenter/goodsList.vue b/package1/myCenter/goodsList.vue index 447ab1d..1cfa4a7 100644 --- a/package1/myCenter/goodsList.vue +++ b/package1/myCenter/goodsList.vue @@ -50,24 +50,24 @@ - + 编辑 - + - 设为推荐 + {{item.isPush == 0?'设为推荐':'取消推荐'}} - + - 设为必点 + {{item.isMust == 0?'设为必点':'取消必点'}} - + - 上架 + {{item.delFlag == 1?'下架':'上架'}} - + 删除 @@ -103,20 +103,24 @@ - + 编辑 - - 设为推荐 + + + {{item.isPush == 0?'设为推荐':'取消推荐'}} - - 设为必点 + + + {{item.isMust == 0?'设为必点':'取消必点'}} - - 上架 + + + {{item.delFlag == 1?'下架':'上架'}} - + + 删除 @@ -190,9 +194,101 @@ console.log("1111",type) if(type == 'shopList'){ this.shopList[index].isShow = !this.shopList[index].isShow + console.log(this.shopList[index]) }else{ this.shopList1[index].isShow = !this.shopList1[index].isShow + console.log(this.shopList1[index]) } + this.$forceUpdate() + }, + isPush(type,index,item,value) { + this.tui.request("/app/product/isPush", "POST", { + id: item.id, + isPush:value + }, false, true).then((res) => { + if (res.code == 200) { + if(type == 'shopList'){ + this.shopList[index].isPush = value + }else{ + this.shopList1[index].isPush = value + } + this.tui.toast('设置成功') + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) + }, + remove(v) { + let that = this; + uni.showModal({ + title: '提示', + content: '确定要删除该商品吗?', + success: function (res) { + if (res.confirm) { + that.tui.request("/app/product/delById", "POST", { + id: v.id + }, false, true).then((res) => { + if (res.code == 200) { + that.getShareList() + that.tui.toast('删除成功') + } else { + that.tui.toast(res.message) + } + }).catch((res) => {}) + } + } + }); + }, + isMust(type,index,item,value) { + this.tui.request("/app/product/isMust", "POST", { + id: item.id, + isMust:value + }, false, true).then((res) => { + if (res.code == 200) { + if(type == 'shopList'){ + this.shopList[index].isMust = value + }else{ + this.shopList1[index].isMust = value + } + this.tui.toast('设置成功') + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) + }, + upDown(type,index,item,value) { + if(value == 0){ + this.tui.request("/app/product/down", "POST", { + id: item.id + }, false, true).then((res) => { + if (res.code == 200) { + if(type == 'shopList'){ + this.shopList[index].delFlag = value + }else{ + this.shopList1[index].delFlag = value + } + this.tui.toast('设置成功') + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) + }else{ + this.tui.request("/app/product/up", "POST", { + id: item.id + }, false, true).then((res) => { + if (res.code == 200) { + if(type == 'shopList'){ + this.shopList[index].delFlag = value + }else{ + this.shopList1[index].delFlag = value + } + this.tui.toast('设置成功') + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) + } + }, goDetail(type,item){ let url="" @@ -237,7 +333,7 @@ this.shopList1 = [...this.shopList1, ...res.result.records] } for(let i=0;i