From 46a2603a375c682e3cb87dc6145d4d688f09b06d Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 29 May 2020 15:31:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=B7=E8=AE=A2=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mall/index.wxs | 10 +++++++++- pages/mall/order-info/index.js | 7 ++++++- pages/mall/order-info/index.wxml | 6 +++--- pages/mall/order-info/index.wxss | 6 +----- utils/request.js | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/pages/mall/index.wxs b/pages/mall/index.wxs index 8d9c005..f9c9b07 100644 --- a/pages/mall/index.wxs +++ b/pages/mall/index.wxs @@ -53,10 +53,18 @@ function isVideoUrl(url){ return false } +function minNumber(order, num){ + if(order && parseInt(order.minBuyNum) > 0){ + return Number(order.minBuyNum) + } + return num +} + module.exports = { formatePrice: formatePrice, formateWeight: formateWeight, formateDate: formateDate, formateText: formateText, - isVideoUrl: isVideoUrl + isVideoUrl: isVideoUrl, + minNumber: minNumber } \ No newline at end of file diff --git a/pages/mall/order-info/index.js b/pages/mall/order-info/index.js index 5a23f5c..f30eeb5 100644 --- a/pages/mall/order-info/index.js +++ b/pages/mall/order-info/index.js @@ -14,6 +14,7 @@ Page({ backStr: '返回', orderInfo: null, matchTag: null, + imageHeight: 0, sukList: [], imgList: [], form: { @@ -38,7 +39,8 @@ Page({ } this.setData({ token: app.globalData.token, - isIPhoneX: app.globalData.isIPhoneX + isIPhoneX: app.globalData.isIPhoneX, + imageHeight: float.accDiv(float.accMul(750, 9), 16), }) event.on('EventMessage', this, this.onEvent) if (options.id) { @@ -72,6 +74,9 @@ Page({ } else { imgList = result.data.imgList } + if(Number(result.data.minBuyNum) > 1){ + this.data.form.number = parseInt(result.data.minBuyNum) + } this.setData({ ['form.productId']: options.id, orderInfo: result.data, diff --git a/pages/mall/order-info/index.wxml b/pages/mall/order-info/index.wxml index 266c32e..2e80e18 100644 --- a/pages/mall/order-info/index.wxml +++ b/pages/mall/order-info/index.wxml @@ -6,11 +6,11 @@ - + - @@ -49,7 +49,7 @@ 购买数量 - + diff --git a/pages/mall/order-info/index.wxss b/pages/mall/order-info/index.wxss index b655c21..cbb3b1d 100644 --- a/pages/mall/order-info/index.wxss +++ b/pages/mall/order-info/index.wxss @@ -3,10 +3,6 @@ margin-top: 18rpx; } -.swiper { - height: 450rpx; -} - .detail-price { font-size: 32rpx; font-family: DINAlternate-Bold, DINAlternate; @@ -73,7 +69,7 @@ button::after { left: 0; z-index: -1 !important; width: 100%; - height: 400rpx; + height: 100%; } .play-btn { diff --git a/utils/request.js b/utils/request.js index e1f4b06..4805048 100644 --- a/utils/request.js +++ b/utils/request.js @@ -21,7 +21,7 @@ function fun(url, method, data, header) { if (typeof result.data === "object") { if (result.data.code === 0) { resolve(result.data) - } else if (result.data.code === 666) { + } else if (result.data.code === 401) { app.globalData.token = null event.emit('EventMessage', { what: 666,