From eaf598a51e597ad0e1495fcda8a882d8fe91100e Mon Sep 17 00:00:00 2001 From: woody Date: Thu, 24 Apr 2025 14:19:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(specialArea):=20bug-42=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E4=B8=93=E5=8C=BA=E7=AD=89=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=90=8E=E9=80=80=E8=B7=AF=E5=BE=84=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=20=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E7=8A=B6=E6=80=81=E6=9C=BA=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?set=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/cartBall.vue | 57 ++++++------ components/cartBtmList.vue | 172 +---------------------------------- components/successDialog.vue | 47 ++-------- config/goods.js | 3 +- config/request.js | 2 +- pages/address/index.vue | 44 ++++++--- pages/other/index.vue | 2 +- pages/pay/index.vue | 13 +-- pages/regiest/index.vue | 2 +- pages/shoppingCar/index.vue | 124 +------------------------ pages/specialArea/list.vue | 17 +++- store/modules/user.js | 45 +++------ 12 files changed, 103 insertions(+), 425 deletions(-) diff --git a/components/cartBall.vue b/components/cartBall.vue index 2d8e0b6..cc8e27c 100644 --- a/components/cartBall.vue +++ b/components/cartBall.vue @@ -9,23 +9,35 @@ v-show="smallCarLength > 0">{{ smallCarLength }} - + {{ '购物车' }} - + diff --git a/components/cartBtmList.vue b/components/cartBtmList.vue index a8c159e..6f1d0a5 100644 --- a/components/cartBtmList.vue +++ b/components/cartBtmList.vue @@ -12,13 +12,7 @@ v-for="(item, index) in shopCarList" :key="item.specialArea" > - - + { - // deleteList.push({ - // shoppingId: item, - // }) - // }) - // api - // .validShop({ - // specialArea: this.goodsCheck[0].specialArea, - // deleteList: deleteList, - // }) - // .then((res) => { - // if (res.code == 200) { - // uni.navigateTo({ - // url: - // '/pages/regiest/index?specialArea=' + - // this.goodsCheck[0].specialArea + - // '&shoppArr=' + - // JSON.stringify(shoppArr), - // }) - // } else { - // uni.showToast({ - // title: res.msg, - // icon: 'none', - // mask: true, - // }) - // } - // }) let deleteList = []; shoppArr.forEach((item) => { deleteList.push({ @@ -393,42 +359,6 @@ export default { "&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 || @@ -458,34 +388,6 @@ export default { }); } else { if (this.goodsCheck[0].specialArea == 2) { - // let deleteList = [] - // shoppArr.forEach((item) => { - // deleteList.push({ - // shoppingId: item, - // }) - // }) - // api - // .validShop({ - // specialArea: this.goodsCheck[0].specialArea, - // deleteList: deleteList, - // }) - // .then((res) => { - // if (res.code == 200) { - // uni.navigateTo({ - // url: - // '/pages/other/index?specialArea=' + - // this.goodsCheck[0].specialArea + - // '&shoppArr=' + - // JSON.stringify(shoppArr), - // }) - // } else { - // uni.showToast({ - // title: res.msg, - // icon: 'none', - // mask: true, - // }) - // } - // }) let deleteList = []; shoppArr.forEach((item) => { deleteList.push({ @@ -499,42 +401,6 @@ export default { "&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({ @@ -607,42 +473,6 @@ export default { // this.getShoppingCount() }); }, - // checkArea() { - // let arr = [] - // this.shopCarList.forEach((item) => { - // item.shoppingCartList.forEach((ctem) => { - // if (item.isSelect.indexOf(ctem.shoppingId) > -1) { - // arr.push({ - // specialArea: item.specialArea, - // orderItemsParams: [ - // { - // waresCode: ctem.waresCode, - // shoppingId: ctem.shoppingId, - // waresName: ctem.waresName, - // achieve: ctem.achieve, - // waresPrice: ctem.waresPrice, - // cover1: ctem.cover1, - // quantity: ctem.number, - // waresItemsParamList: ctem.waresItemsParamList, - // waresSkuList: ctem.waresSkuList || [], - // source: ctem.source || '', - // }, - // ], - // }) - // } - // }) - // }) - // const arrayHashmap = arr.reduce((obj, item) => { - // obj[item.specialArea] - // ? obj[item.specialArea].orderItemsParams.push( - // ...item.orderItemsParams - // ) - // : (obj[item.specialArea] = item) - // return obj - // }, {}) - // this.goodsCheck = Object.values(arrayHashmap) - // this.checkPrice() - // }, // 计算价格 checkPrice() { let totalPrice = 0; diff --git a/components/successDialog.vue b/components/successDialog.vue index f1b6360..4d5e46e 100644 --- a/components/successDialog.vue +++ b/components/successDialog.vue @@ -6,27 +6,7 @@ {{'注册成功'}} - - + {{'复制'}} @@ -50,26 +30,17 @@ - - {{'确定'}} + @tap="handleClose" + > + 确定 + diff --git a/config/goods.js b/config/goods.js index 530a20f..f6c14bc 100644 --- a/config/goods.js +++ b/config/goods.js @@ -77,8 +77,7 @@ export const checkShare = (params) => http.get('/member/api/share/check-share-co //海粉订单详情 export const waresinfo = (params) => http.post('/sale/api/wares/query-confirm-waresinfo', params) -//购物车注册下单校验 -export const validShop = (params) => http.post('/sale/api/order/valid-enough-shop', params) + //hi粉确认订单 export const fansConfirm = (params) => http.post('/sale/api/order/fans-confirm-order', params) //购物车注册下单校验弹框 diff --git a/config/request.js b/config/request.js index 5fa9b1b..fe5e1ce 100644 --- a/config/request.js +++ b/config/request.js @@ -13,7 +13,7 @@ module.exports = (vm) => { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = '/prod-api'; + config.baseURL = 'http://localhost:8080/'; //#endif //#ifdef QA_SERVER diff --git a/pages/address/index.vue b/pages/address/index.vue index 0178065..65b6e2e 100644 --- a/pages/address/index.vue +++ b/pages/address/index.vue @@ -4,7 +4,7 @@ @@ -19,7 +19,7 @@ @@ -43,7 +43,7 @@ - + @@ -98,9 +98,17 @@ :defaultCode="defaultCode" @addressData="addressData" > - {{ - '确定' - }} + + 确定 + @@ -129,6 +137,7 @@ export default { isDefault: 0, pkId: "", }, + loading: false, rules: { recName: [ { @@ -195,19 +204,26 @@ export default { }, submit() { this.$refs.uForm.validate().then((res) => { + this.loading = true api.saveAddress(this.addressForm).then((res) => { if (res.code == "200") { - uni.showToast({ + const toast = uni.showToast({ title: res.msg, icon: "none", - success() { + complete() { setTimeout(() => { - uni.navigateBack(1); - }, 2000); + this.loading = false + uni.navigateBack(1) + toast.hideToast() + }, 500); }, }); + } else { + this.loading = false } - }); + }).catch(() => { + this.loading = false + }) }); }, getDiqu() { @@ -325,8 +341,6 @@ page { background-color: #fff; } .btn { - background-color: #fb3024; - border: none; height: 92rpx; line-height: 92rpx; font-size: 30rpx; diff --git a/pages/other/index.vue b/pages/other/index.vue index 79dcdf5..43eec48 100644 --- a/pages/other/index.vue +++ b/pages/other/index.vue @@ -1178,7 +1178,7 @@ export default { this.isLoading = false if (res.code == 200) { - uni.navigateTo({ + uni.redirectTo({ url: '/pages/pay/index?paramsPost=' + JSON.stringify(res.data) + diff --git a/pages/pay/index.vue b/pages/pay/index.vue index e8cd396..e1126a7 100644 --- a/pages/pay/index.vue +++ b/pages/pay/index.vue @@ -1,9 +1,4 @@ - +