From e40c56e3afece016a025e3da5502bcdaa7635f46 Mon Sep 17 00:00:00 2001 From: ywk <317226901@qq.com> Date: Mon, 7 Apr 2025 11:21:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(cart):=20=E7=A7=BB=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/cartBtmList.vue | 158 ++++++++++++++++++++---------------- pages/shoppingCar/index.vue | 156 +++++++++++++++++++---------------- 2 files changed, 170 insertions(+), 144 deletions(-) diff --git a/components/cartBtmList.vue b/components/cartBtmList.vue index 25058a7..ea915d4 100644 --- a/components/cartBtmList.vue +++ b/components/cartBtmList.vue @@ -374,42 +374,49 @@ export default { shoppingId: item, }); }); - api - .validShop({ - specialArea: this.goodsCheck[0].specialArea, - deleteList: deleteList, - }) - .then((res) => { - if (res.code == 200) { - this.tableData = response.data; - this.tableData.forEach((item) => { - this.$set(item, "quantity", 1); - }); - this.dialogVisible2 = true; - // api - // .energyShop({ - // specialArea: this.goodsCheck[0].specialArea, - // deleteList: deleteList, - // }) - // .then((response) => { - // if (response.data && response.data.length > 0) { - // this.tableData = response.data; - // this.tableData.forEach((item) => { - // this.$set(item, "quantity", 1); - // }); - // this.dialogVisible2 = true; - // } else { - // uni.navigateTo({ - // url: - // "/pages/regiest/index?specialArea=" + - // this.goodsCheck[0].specialArea + - // "&shoppArr=" + - // JSON.stringify(shoppArr), - // }); - // } - // }); - } - }); + uni.navigateTo({ + url: + "/pages/regiest/index?specialArea=" + + this.goodsCheck[0].specialArea + + "&shoppArr=" + + JSON.stringify(shoppArr), + }); + // api + // .validShop({ + // specialArea: this.goodsCheck[0].specialArea, + // deleteList: deleteList, + // }) + // .then((res) => { + // if (res.code == 200) { + // // this.tableData = response.data; + // // this.tableData.forEach((item) => { + // // this.$set(item, "quantity", 1); + // // }); + // // this.dialogVisible2 = true; + // // api + // // .energyShop({ + // // specialArea: this.goodsCheck[0].specialArea, + // // deleteList: deleteList, + // // }) + // // .then((response) => { + // // if (response.data && response.data.length > 0) { + // // this.tableData = response.data; + // // this.tableData.forEach((item) => { + // // this.$set(item, "quantity", 1); + // // }); + // // this.dialogVisible2 = true; + // // } else { + // // uni.navigateTo({ + // // url: + // // "/pages/regiest/index?specialArea=" + + // // this.goodsCheck[0].specialArea + + // // "&shoppArr=" + + // // JSON.stringify(shoppArr), + // // }); + // // } + // // }); + // } + // }); } else if (this.goodsCheck[0].specialArea == 21) { if ( this.userInfo.registerShare == 0 || @@ -473,42 +480,49 @@ export default { shoppingId: item, }); }); - api - .validShop({ - specialArea: this.goodsCheck[0].specialArea, - deleteList: deleteList, - }) - .then((res) => { - if (res.code == 200) { - this.tableData = response.data; - this.tableData.forEach((item) => { - this.$set(item, "quantity", 1); - }); - this.dialogVisible2 = true; - // api - // .energyShop({ - // specialArea: this.goodsCheck[0].specialArea, - // deleteList: deleteList, - // }) - // .then((response) => { - // if (response.data && response.data.length > 0) { - // this.tableData = response.data; - // this.tableData.forEach((item) => { - // this.$set(item, "quantity", 1); - // }); - // this.dialogVisible2 = true; - // } else { - // uni.navigateTo({ - // url: - // "/pages/other/index?specialArea=" + - // this.goodsCheck[0].specialArea + - // "&shoppArr=" + - // JSON.stringify(shoppArr), - // }); - // } - // }); - } - }); + uni.navigateTo({ + url: + "/pages/other/index?specialArea=" + + this.goodsCheck[0].specialArea + + "&shoppArr=" + + JSON.stringify(shoppArr), + }); + // api + // .validShop({ + // specialArea: this.goodsCheck[0].specialArea, + // deleteList: deleteList, + // }) + // .then((res) => { + // if (res.code == 200) { + // // this.tableData = response.data; + // // this.tableData.forEach((item) => { + // // this.$set(item, "quantity", 1); + // // }); + // // this.dialogVisible2 = true; + // // api + // // .energyShop({ + // // specialArea: this.goodsCheck[0].specialArea, + // // deleteList: deleteList, + // // }) + // // .then((response) => { + // // if (response.data && response.data.length > 0) { + // // this.tableData = response.data; + // // this.tableData.forEach((item) => { + // // this.$set(item, "quantity", 1); + // // }); + // // this.dialogVisible2 = true; + // // } else { + // // uni.navigateTo({ + // // url: + // // "/pages/other/index?specialArea=" + + // // this.goodsCheck[0].specialArea + + // // "&shoppArr=" + + // // JSON.stringify(shoppArr), + // // }); + // // } + // // }); + // } + // }); } else if (this.goodsCheck[0].specialArea == 30) { if (this.goodsCheck[0].orderItemsParams.length > 1) { uni.showToast({ diff --git a/pages/shoppingCar/index.vue b/pages/shoppingCar/index.vue index 7826da4..cca0897 100644 --- a/pages/shoppingCar/index.vue +++ b/pages/shoppingCar/index.vue @@ -306,6 +306,7 @@ export default { } }, goBuy() { + console.log(this.goodsCheck[0]); let shoppArr = this.goodsCheck[0].orderItemsParams.map((item) => { return item.shoppingId; }); @@ -341,48 +342,52 @@ export default { // }) // } // }) + let deleteList = []; shoppArr.forEach((item) => { deleteList.push({ shoppingId: item, }); }); - api - .validShop({ - specialArea: this.goodsCheck[0].specialArea, - deleteList: deleteList, - }) - .then((res) => { - if (res.code == 200) { - this.tableData = response.data; - this.tableData.forEach((item) => { - this.$set(item, "quantity", 1); - }); - this.dialogVisible2 = true; - // api - // .energyShop({ - // specialArea: this.goodsCheck[0].specialArea, - // deleteList: deleteList, - // }) - // .then((response) => { - // if (response.data && response.data.length > 0) { - // this.tableData = response.data; - // this.tableData.forEach((item) => { - // this.$set(item, "quantity", 1); - // }); - // this.dialogVisible2 = true; - // } else { - // uni.navigateTo({ - // url: - // "/pages/regiest/index?specialArea=" + - // this.goodsCheck[0].specialArea + - // "&shoppArr=" + - // JSON.stringify(shoppArr), - // }); - // } - // }); - } - }); + uni.navigateTo({ + url: + "/pages/regiest/index?specialArea=" + + this.goodsCheck[0].specialArea + + "&shoppArr=" + + JSON.stringify(shoppArr), + }); + + // api + // .validShop({ + // specialArea: this.goodsCheck[0].specialArea, + // deleteList: deleteList, + // }) + // .then((res) => { + // if (res.code == 200) { + // // api + // // .energyShop({ + // // specialArea: this.goodsCheck[0].specialArea, + // // deleteList: deleteList, + // // }) + // // .then((response) => { + // // if (response.data && response.data.length > 0) { + // // this.tableData = response.data; + // // this.tableData.forEach((item) => { + // // this.$set(item, "quantity", 1); + // // }); + // // this.dialogVisible2 = true; + // // } else { + // // uni.navigateTo({ + // // url: + // // "/pages/regiest/index?specialArea=" + + // // this.goodsCheck[0].specialArea + + // // "&shoppArr=" + + // // JSON.stringify(shoppArr), + // // }); + // // } + // // }); + // } + // }); } else if (this.goodsCheck[0].specialArea == 21) { // uni.navigateTo({ // url: @@ -414,42 +419,49 @@ export default { shoppingId: item, }); }); - api - .validShop({ - specialArea: this.goodsCheck[0].specialArea, - deleteList: deleteList, - }) - .then((res) => { - if (res.code == 200) { - this.tableData = response.data; - this.tableData.forEach((item) => { - this.$set(item, "quantity", 1); - }); - this.dialogVisible2 = true; - // api - // .energyShop({ - // specialArea: this.goodsCheck[0].specialArea, - // deleteList: deleteList, - // }) - // .then((response) => { - // if (response.data && response.data.length > 0) { - // this.tableData = response.data; - // this.tableData.forEach((item) => { - // this.$set(item, "quantity", 1); - // }); - // this.dialogVisible2 = true; - // } else { - // uni.navigateTo({ - // url: - // "/pages/other/index?specialArea=" + - // this.goodsCheck[0].specialArea + - // "&shoppArr=" + - // JSON.stringify(shoppArr), - // }); - // } - // }); - } - }); + uni.navigateTo({ + url: + "/pages/other/index?specialArea=" + + this.goodsCheck[0].specialArea + + "&shoppArr=" + + JSON.stringify(shoppArr), + }); + // api + // .validShop({ + // specialArea: this.goodsCheck[0].specialArea, + // deleteList: deleteList, + // }) + // .then((res) => { + // if (res.code == 200) { + // // this.tableData = response.data; + // // this.tableData.forEach((item) => { + // // this.$set(item, "quantity", 1); + // // }); + // // this.dialogVisible2 = true; + // // api + // // .energyShop({ + // // specialArea: this.goodsCheck[0].specialArea, + // // deleteList: deleteList, + // // }) + // // .then((response) => { + // // if (response.data && response.data.length > 0) { + // // this.tableData = response.data; + // // this.tableData.forEach((item) => { + // // this.$set(item, "quantity", 1); + // // }); + // // this.dialogVisible2 = true; + // // } else { + // // uni.navigateTo({ + // // url: + // // "/pages/other/index?specialArea=" + + // // this.goodsCheck[0].specialArea + + // // "&shoppArr=" + + // // JSON.stringify(shoppArr), + // // }); + // // } + // // }); + // } + // }); } else if (this.goodsCheck[0].specialArea == 30) { if (this.goodsCheck[0].orderItemsParams.length > 1) { uni.showToast({