From 3023b2ec0b47cf18c00de43b03e32e7d56df95a5 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 10 Mar 2025 15:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=20=E8=B7=B3=E8=BD=AC=E9=99=AA=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package_sub/pages/Shop/Cart.vue | 14 +- package_sub/pages/Shop/Pay.vue | 28 +- .../pages/UserAddress/AddUserAddress.vue | 3 + pages/index/index.vue | 1594 ++++++++--------- 4 files changed, 811 insertions(+), 828 deletions(-) diff --git a/package_sub/pages/Shop/Cart.vue b/package_sub/pages/Shop/Cart.vue index 50235ee..3ca6a97 100644 --- a/package_sub/pages/Shop/Cart.vue +++ b/package_sub/pages/Shop/Cart.vue @@ -385,13 +385,13 @@ export default { } catch (err) {} }, pay() { - // if (this.pickCart.length <= 0) { - // this.$refs.uToast.show({ - // title: "请选择下单商品", - // type: "warning", - // }); - // return - // } + if (this.carts.length <= 0) { + this.$refs.uToast.show({ + title: "请选择下单商品", + type: "warning", + }); + return + } this.$u.route({ url: '/package_sub/pages/Shop/Pay', params: { diff --git a/package_sub/pages/Shop/Pay.vue b/package_sub/pages/Shop/Pay.vue index c8edf97..c11c405 100644 --- a/package_sub/pages/Shop/Pay.vue +++ b/package_sub/pages/Shop/Pay.vue @@ -185,7 +185,7 @@ safe-area-inset-bottom > - + + 新建收货地址 + @@ -267,6 +276,13 @@ export default { } }, async submit() { + if(!this.site){ + this.$refs.uToast.show({ + title: "请选择收货地址", + type: "warning", + }); + return + } if (!this.site.id) { this.$refs.uToast.show({ title: "请选择收货地址", @@ -347,6 +363,11 @@ export default { console.error(err) } }, + goAddress(){ + uni.navigateTo({ + url:'/package_sub/pages/UserAddress/AddUserAddress?type=car' + }) + }, async refund() { try { uni.showModal({ @@ -378,7 +399,10 @@ export default { } }, created() { - this.getSites(); + // this.getSites(); + }, + onShow() { + this.getSites() }, onLoad(option) { if (option.order_id) { diff --git a/package_sub/pages/UserAddress/AddUserAddress.vue b/package_sub/pages/UserAddress/AddUserAddress.vue index 8cc86a5..c5c4cfa 100644 --- a/package_sub/pages/UserAddress/AddUserAddress.vue +++ b/package_sub/pages/UserAddress/AddUserAddress.vue @@ -80,6 +80,7 @@ export default { address: '', is_default: 0 }, + type:'' }; }, methods: { @@ -137,6 +138,7 @@ export default { }) return } + let that = this try { await this.$u.api.userAddressSave(this.form) this.$refs.uToast.show({ @@ -153,6 +155,7 @@ export default { if(option.id) { this.getDetail(option.id) } + this.type = options.type?options.type:'' } }; diff --git a/pages/index/index.vue b/pages/index/index.vue index 73f3323..63b7845 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,819 +1,775 @@ - - - - - + + + + + \ No newline at end of file