From edb08b4f833daf35b39d807fc96e2472f03e9d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Wed, 11 Oct 2023 15:03:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=85=8D=E9=80=81=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request.js | 4 ++-- pages/bag/bag.wxml | 1 + pages/bag/bag.wxss | 3 ++- pages/bag/bagConfirm/bagConfirm.js | 14 ++++++++------ pages/mall/confirm/confirm.js | 16 +++++++++++++--- pages/mall/confirm/confirm.wxml | 2 +- pages/mall/details/details.js | 10 ++++++++++ 7 files changed, 37 insertions(+), 13 deletions(-) diff --git a/api/request.js b/api/request.js index 1916203..baffe03 100644 --- a/api/request.js +++ b/api/request.js @@ -7,9 +7,9 @@ import { errInfo } from './err' import { updToken } from './updateToken' // 正式地址 -// const api = "https://api.xuanhuojk.com/api/" +const api = "https://api.xuanhuojk.com/api/" // 测试地址 -const api = "https://api.xhtest.douhuofalv.com/api/" +// const api = "https://api.xhtest.douhuofalv.com/api/" const header = { "Accept" : "application/json" } diff --git a/pages/bag/bag.wxml b/pages/bag/bag.wxml index 4e32a89..ef6cae1 100644 --- a/pages/bag/bag.wxml +++ b/pages/bag/bag.wxml @@ -61,6 +61,7 @@ + 您还未登录,无法查看您的购物车信息 登录 diff --git a/pages/bag/bag.wxss b/pages/bag/bag.wxss index 6bac960..31eedf5 100644 --- a/pages/bag/bag.wxss +++ b/pages/bag/bag.wxss @@ -110,5 +110,6 @@ .checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked:before{ top: 18rpx; right: 5rpx; color: white; line-height: 34rpx; text-align: center; width: 36rpx; height: 36rpx; font-size:36rpx; } /* 未登录 */ -.auth-login{ text-align: center; font-size: 28rpx; color: gray; } +.auth-login{ text-align: center; font-size: 28rpx; color: gray; background: white; } +.auth-login image{ width: 218rpx; height: 218rpx; margin-bottom: 30rpx; } .auth-btn{ background: #da2b54; display: inline-block; width: 240rpx; height: 80rpx; line-height: 80rpx; border-radius: 40rpx; font-size: 32rpx; color: white; margin-top: 100rpx; } diff --git a/pages/bag/bagConfirm/bagConfirm.js b/pages/bag/bagConfirm/bagConfirm.js index cd827c7..c6ae590 100644 --- a/pages/bag/bagConfirm/bagConfirm.js +++ b/pages/bag/bagConfirm/bagConfirm.js @@ -18,11 +18,12 @@ Page({ freight : '', // 运费 weight : '', // 重量 distribution : [ - { type: 0, title: "选择配送方式" }, - { type: 1, title: "快递" }, - { type: 2, title: "自提" }, + { type: 2, title: "选择配送方式" }, + { type: 0, title: "快递" }, + { type: 1, title: "自提" }, ], - distributionIndex: 0 + distributionIndex: 0, + distributionType : 2 }, /** @@ -42,7 +43,8 @@ Page({ distributionChange(e){ if(e.detail.value === this.data.distributionIndex) return this.setData({ - distributionIndex: e.detail.value + distributionIndex : e.detail.value, + distributionType : this.data.distribution[e.detail.value].type }) this.placeInfo(this.data.skuId); }, @@ -94,7 +96,7 @@ Page({ cart_ids : this.data.skuId, address_id : this.data.address.address_id, remark : '', - delivery_type : this.data.distributionIndex + delivery_type : this.data.distributionType }).then(res => { wx.redirectTo({ url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data)) diff --git a/pages/mall/confirm/confirm.js b/pages/mall/confirm/confirm.js index f368e3b..60c89bd 100644 --- a/pages/mall/confirm/confirm.js +++ b/pages/mall/confirm/confirm.js @@ -19,10 +19,12 @@ Page({ freight : '', // 运费 weight : '', // 重量 distribution : [ + { type: 2, title: "请选择配送方式" }, { type: 0, title: "快递" }, { type: 1, title: "自提" }, ], - distributionIndex: 0 + distributionIndex: 0, + distributionType : 2, }, /** @@ -42,7 +44,8 @@ Page({ distributionChange(e){ if(e.detail.value === this.data.distributionIndex) return this.setData({ - distributionIndex: e.detail.value + distributionIndex : e.detail.value, + distributionType : this.data.distribution[e.detail.value].type }) this.placeInfo(this.data.skuId, this.data.goodsQty); }, @@ -80,6 +83,13 @@ Page({ * 商品确认下单 */ buyTap() { + if(this.data.distributionIndex == 0){ + wx.showToast({ + title: '请选择配送方式', + icon : 'none' + }) + return + } wx.showLoading({ title: '下单中...', mask : true @@ -88,7 +98,7 @@ Page({ goods_sku_id : this.data.skuId, qty : this.data.goodsQty, address_id : this.data.address.address_id, - delivery_type : this.data.distributionIndex + delivery_type : this.data.distributionType }).then(res => { wx.redirectTo({ url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data)) diff --git a/pages/mall/confirm/confirm.wxml b/pages/mall/confirm/confirm.wxml index 25a6305..92a44c1 100644 --- a/pages/mall/confirm/confirm.wxml +++ b/pages/mall/confirm/confirm.wxml @@ -1,5 +1,5 @@ - + diff --git a/pages/mall/details/details.js b/pages/mall/details/details.js index 2abd78f..94ed350 100644 --- a/pages/mall/details/details.js +++ b/pages/mall/details/details.js @@ -296,6 +296,16 @@ Page({ }) return } + + // 是否有推荐人 + if(!this.data.goodsData.has_parent) { + this.setData({ + isParent : true, + goodsSize : false + }) + return + } + wx.showLoading({ title: '加载中...', mask : true