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 @@ - +