From f23bd879187a16bdcb872cdc427cb090ee14c64c Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Tue, 17 Jun 2025 16:14:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AE=A2=E6=9C=8D=E4=B8=AD=E5=BF=83):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=9C=8D=E4=B8=AD=E5=BF=83=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8F=8A=E9=85=8D=E9=80=81=E6=96=B9=E5=BC=8F=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加客服中心页面,包含客服列表和微信二维码展示功能 - 在商品提交页面增加配送方式选择(外卖配送/到店自提) - 修改地址选择逻辑,根据配送方式显示不同内容 - 在用户信息页面添加初中和高中学校字段 - 优化订单提交逻辑,支持不同配送方式的参数传递 --- pages.json | 7 + pages/index/index.vue | 5 +- pages_order/auth/wxUserInfo.vue | 30 ++- .../components/list/gourmet/productSelectList.vue | 13 +- .../components/list/gourmet/productSubmit.vue | 142 +++++++++++++- .../components/product/submitUnitSelect.vue | 107 +++++++++-- pages_order/mine/customerService.vue | 207 +++++++++++++++++++++ 7 files changed, 476 insertions(+), 35 deletions(-) create mode 100644 pages_order/mine/customerService.vue diff --git a/pages.json b/pages.json index 6e210ca..14762be 100644 --- a/pages.json +++ b/pages.json @@ -189,6 +189,13 @@ "enablePullDownRefresh": false, "navigationBarTextStyle": "white" } + }, + { + "path": "mine/customerService", + "style": { + "navigationBarTitleText": "客服中心", + "enablePullDownRefresh": false + } } ] }], diff --git a/pages/index/index.vue b/pages/index/index.vue index 54d13e5..83fd4ab 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -139,9 +139,12 @@ - + + diff --git a/pages_order/auth/wxUserInfo.vue b/pages_order/auth/wxUserInfo.vue index 8419997..9c49ae6 100644 --- a/pages_order/auth/wxUserInfo.vue +++ b/pages_order/auth/wxUserInfo.vue @@ -84,6 +84,16 @@ {{ form.address || '请选择居住地址'}} + + + + 手机号 @@ -140,6 +150,8 @@ yearDate : this.$dayjs().add(-18, 'y').valueOf(),//默认满18岁 address : '', phone : '', + middleSchool: '', + highSchool: '', }, maxDate : this.$dayjs().valueOf(), minDate : this.$dayjs().add(-100, 'y').valueOf(), @@ -218,7 +230,7 @@ } }) }, - getUserInfo(){ + getUserInfo(){ this.$api('getInfo', res => { if(res.code == 200){ @@ -234,6 +246,10 @@ this.$dayjs(res.result.yearDate + '-01-01').valueOf() || this.form.yearDate this.form.address = res.result.address || this.form.address + + this.form.middleSchool = res.result.middleSchool || this.form.middleSchool + + this.form.highSchool = res.result.highSchool || this.form.highSchool } }) }, @@ -399,6 +415,18 @@ line-height: 80rpx; color: #555; } + + .school-input{ + background-color: #f7f7f7; + width: 600rpx; + height: 80rpx; + text-align: center; + border-radius: 40rpx; + margin-top: 30rpx; + padding: 0 30rpx; + box-sizing: border-box; + color: #333; + } .btn { // background: $uni-linear-gradient-btn-color; diff --git a/pages_order/components/list/gourmet/productSelectList.vue b/pages_order/components/list/gourmet/productSelectList.vue index cdff58f..783d450 100644 --- a/pages_order/components/list/gourmet/productSelectList.vue +++ b/pages_order/components/list/gourmet/productSelectList.vue @@ -214,19 +214,10 @@ } this.$refs.productSubmit.open() }, - submit({addressId}){ - if(!addressId){ - uni.showToast({ - title: '请选择地址', - icon: 'none' - }) - return - } - - + submit(submitData){ this.$api('createSumOrder', { - addressId, + ...submitData, list : JSON.stringify(this.priceList) }, res => { if(res.code == 200){ diff --git a/pages_order/components/list/gourmet/productSubmit.vue b/pages_order/components/list/gourmet/productSubmit.vue index 57ac2ee..27a0894 100644 --- a/pages_order/components/list/gourmet/productSubmit.vue +++ b/pages_order/components/list/gourmet/productSubmit.vue @@ -4,8 +4,29 @@ bgColor="#f7f7f7"> - - + + + 配送方式 + + + 🚚 + 外卖配送 + + + 🏪 + 到店自提 + + + + + + {{ address.name }} @@ -18,6 +39,19 @@ + + + + + + 配送方式 + + + 🚚 + 外卖配送 + + + 🏪 + 到店自提 + + + + + + @click="openAddress" + v-if="deliveryMethod === '0'"> {{ address.name }} @@ -20,6 +42,17 @@ name="arrow-right"> + + + + + + + @@ -143,6 +176,7 @@ num : 1, unit : {}, addressTotal : 0, + deliveryMethod : '0', } }, methods: { @@ -190,14 +224,19 @@ let data = { shopId : this.detail.id,//商品id - addressId : this.address.id,//地址id num : this.num, + deliveryMethod: this.deliveryMethod } - if(this.$utils.verificationAll(data, { - addressId : '请选择地址', - })){ - return + // 外卖配送需要地址 + if (this.deliveryMethod === 'delivery') { + if (!this.address.id) { + return uni.showToast({ + title: '请选择收货地址', + icon: 'none' + }) + } + data.addressId = this.address.id } this.$api('createPointsOrder', data, res => { @@ -213,17 +252,20 @@ let data = { shopId : this.detail.id,//商品id // skuId : this.unit.id,//规格id - addressId : this.address.id,//地址id // sku : this.unit.title,//规格 num : this.num, + deliveryMethod: this.deliveryMethod } - - if(this.$utils.verificationAll(data, { - // skuId : '请选择规格', - addressId : '请选择地址', - })){ - return + // 外卖配送需要地址 + if (this.deliveryMethod == '0') { + if (!this.address.id) { + return uni.showToast({ + title: '请选择收货地址', + icon: 'none' + }) + } + data.addressId = this.address.id } this.$api('createOrder', data, res => { @@ -252,6 +294,9 @@ } }) }, + selectDeliveryMethod(method){ + this.deliveryMethod = method + }, } } @@ -261,6 +306,40 @@ max-height: 80vh; overflow: hidden; overflow-y: auto; + .delivery-method{ + padding: 20rpx; + background-color: #fff; + .title{ + font-size: 30rpx; + padding: 10rpx; + font-weight: 600; + } + .options{ + display: flex; + gap: 20rpx; + .option{ + padding: 15rpx 30rpx; + border: 2rpx solid #F3F3F3; + border-radius: 10rpx; + display: flex; + align-items: center; + justify-content: center; + flex: 1; + background-color: #F6F6F6; + &.active{ + border-color: $uni-price-color; + background-color: $uni-price-color; + color: #fff; + } + .icon{ + margin-right: 10rpx; + } + .text{ + font-size: 28rpx; + } + } + } + } .address{ display: flex; padding: 20rpx; diff --git a/pages_order/mine/customerService.vue b/pages_order/mine/customerService.vue new file mode 100644 index 0000000..5fe4b40 --- /dev/null +++ b/pages_order/mine/customerService.vue @@ -0,0 +1,207 @@ + + + + + \ No newline at end of file