From c9b691ea7eb6f3fec2f5418370a21368b086183e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87?= Date: Thu, 6 Mar 2025 19:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=97=AE=E9=A2=98=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E8=8B=A5=E5=B9=B2=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + app.wxss | 14 +-- components/listView/index.wxml | 4 +- components/modalView/index.wxss | 2 +- components/navbar/index.wxss | 6 +- components/shopItem/index.wxss | 2 +- pages/help/index/index.js | 3 + pages/help/index/index.wxss | 2 +- pages/help/package/index.js | 109 +++++++++++------------ pages/help/package/index.wxml | 11 ++- pages/help/package/index.wxss | 7 +- pages/my/index/index.wxml | 2 +- pages/my/promation/activities/index.js | 4 +- pages/my/promation/activities/index.wxml | 5 +- pages/my/promation/activities/index.wxss | 8 +- pages/order/detail-group/index.wxml | 3 +- pages/order/detail-group/index.wxss | 4 +- pages/order/detail/index.wxml | 9 +- pages/order/detail/index.wxss | 9 ++ pages/shop/detail/index.wxml | 3 +- pages/shop/detail/index.wxss | 2 +- 21 files changed, 115 insertions(+), 95 deletions(-) diff --git a/app.js b/app.js index d5570f0..8008ee2 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,7 @@ import userApi from './api/user'; import commonApi from './api/common'; let token = wx.getStorageSync('accessToken'); +console.log(1); App({ async onLaunch(options){ wx.getStorage({ diff --git a/app.wxss b/app.wxss index 30abf2c..cb5cdea 100644 --- a/app.wxss +++ b/app.wxss @@ -14,7 +14,9 @@ page{ min-height: 100vh; box-sizing: border-box; } - +view::-webkit-scrollbar{ + display: none; +} button{ border-radius: 24rpx; box-sizing: border-box; @@ -36,8 +38,8 @@ button:not([size=mini]) .icon{ } button[type=primary]{ - background-color:var(--main-color)!important; - color:var(--main-font-color)!important; + background-color:var(--main-color); + color:var(--main-font-color); } button[disabled]{ opacity: .7; @@ -178,7 +180,7 @@ page-container .content{ content: '- ¥'; } .money{ - color:#EB0000; + color:#ff0000; } .money-promation{ color:#FF8400; @@ -219,7 +221,7 @@ page-container .content{ } .custom-scroll-view .main{ flex:1; - overflow: auto; + overflow: hidden; } .bottom-bar-v2{ padding:24rpx; @@ -261,7 +263,7 @@ page-container .content{ } .cells .cell-hd.not-empty::before{ content: '*'; - color: #EB0000 + color: #ff0000; } .cells .cell-hd .icon{ width:40rpx;height:40rpx; diff --git a/components/listView/index.wxml b/components/listView/index.wxml index 427a70e..26cc6fe 100644 --- a/components/listView/index.wxml +++ b/components/listView/index.wxml @@ -1,4 +1,6 @@ - + diff --git a/components/modalView/index.wxss b/components/modalView/index.wxss index 100bc55..33c99bb 100644 --- a/components/modalView/index.wxss +++ b/components/modalView/index.wxss @@ -27,7 +27,7 @@ .modal-view-main .btns{ margin-top:32rpx; display: flex; - gap: 18rpx; + gap: 20rpx; } .modal-view-main .btns .button{ flex:1; diff --git a/components/navbar/index.wxss b/components/navbar/index.wxss index 3e64b7a..5706c29 100644 --- a/components/navbar/index.wxss +++ b/components/navbar/index.wxss @@ -1,9 +1,9 @@ /* components/navBar.wxss */ .nav-bar{} .nav-bar .title{ - font-size: 32rpx; - font-weight: 500; - color: var(--main-font-color); + font-size: 36rpx; + font-weight: 600; + color:#222222; } .nav-bar-content{ display: flex; diff --git a/components/shopItem/index.wxss b/components/shopItem/index.wxss index f3f6aba..a9bd0ab 100644 --- a/components/shopItem/index.wxss +++ b/components/shopItem/index.wxss @@ -38,7 +38,7 @@ } .shop-item .promation.buy .coupon::before{ content: '买'; - background-color:#EB0000; + background-color:#ff0000; } .shop-item .promation .coupon::before{ content: '券'; diff --git a/pages/help/index/index.js b/pages/help/index/index.js index 76e219e..dc06a21 100644 --- a/pages/help/index/index.js +++ b/pages/help/index/index.js @@ -39,6 +39,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { + console.log('onLoad',new Date().getTime()); let height = this.selectComponent("#navBar").getHeight(); this.setData({ navBarHeight:height @@ -64,11 +65,13 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady() { + console.log('onReady',new Date().getTime()); }, /** * 生命周期函数--监听页面显示 */ onShow() { + console.log('onShow',new Date().getTime()); wx.getStorage({ key:'pre-order', success:(res)=>{ diff --git a/pages/help/index/index.wxss b/pages/help/index/index.wxss index f4fa14c..47c7c19 100644 --- a/pages/help/index/index.wxss +++ b/pages/help/index/index.wxss @@ -218,7 +218,7 @@ color: #FF8400; } .pc-content .kv-item .red{ - color: #EB0000; + color: #ff0000; } .pc-content .kv-item .key{ flex:1 diff --git a/pages/help/package/index.js b/pages/help/package/index.js index afd025b..55250b0 100644 --- a/pages/help/package/index.js +++ b/pages/help/package/index.js @@ -18,7 +18,7 @@ Page({ sendTypeKV:userApi.order.orderDeliverStatusKV, timePeriods:[], - timePeriodsIndex:0, + timePeriodsIndex:-1, isShowDeliverType:false }, validator:{ @@ -85,7 +85,8 @@ Page({ data:{ price_request:priceRequest, delivery_method:this.data.sendType, - community_time_period_id:this.data.timePeriods[this.data.timePeriodsIndex].communtiy_time_period_id + community_time_period_id:this.data.timePeriods[this.data.timePeriodsIndex].communtiy_time_period_id, + delivery_date:this.data.timePeriods[this.data.timePeriodsIndex].time_period_date }, success(){ wx.navigateBack(); @@ -162,68 +163,65 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - - //获取配送时段 - commonApi.community.timePeriods(options.communityId).then((data)=>{ - this.setData({ - timePeriods:data - }); - this.findTimePeriodId(); - }); + let preOrder = wx.getStorageSync('pre-order'); + this.savedTimePeriodId = preOrder.community_time_period_id; commonApi.station.list(options.communityId).then((data)=>{ - wx.getStorage({ - key:'pre-order', - success:(res)=>{ - this.savedTimePeriodId = res.data.community_time_period_id; - this.findTimePeriodId(); - data.items.map((item,index)=>{ - const __item = res.data.price_request.packages.find((_item)=>_item.station_id==item.id); - if(__item){ - item.package = __item.pickup_codes.split(',')||[]; - } - }); - let tempImgs = [],imgOrderCount = 0; - if(res.data.price_request.pickup_images){ - const imgs = res.data.price_request.pickup_images.split(','); - imgs.map((item)=>{ - tempImgs.push({ - serverUrl:item, - uploaded:true - }) - }); - imgOrderCount = res.data.price_request.pickup_images_count||0; + + data.items.map((item,index)=>{ + if(preOrder){ + const __item = preOrder.price_request.packages.find((_item)=>_item.station_id==item.id); + if(__item){ + item.package = __item.pickup_codes.split(',')||[]; + return; } - this.setData({ - sendType:res.data.delivery_method, - stationList:data.items, - tempImgs, - imgOrderCount - }); } - }); - data.items.map((item)=>{ item.package = []; }); + let tempImgs = [],imgOrderCount = 0; + if(preOrder?.price_request?.pickup_images){ + const imgs = preOrder.price_request.pickup_images.split(','); + imgs.map((item)=>{ + tempImgs.push({ + serverUrl:item, + uploaded:true + }) + }); + imgOrderCount = preOrder.price_request.pickup_images_count||0; + } this.setData({ - stationList:data.items + sendType:preOrder.delivery_method, + stationList:data.items, + tempImgs, + imgOrderCount }); - wx.nextTick(()=>{ - this.setData({ - [`stationList[0].focus`]:true - }) + + + //获取配送时段 + return commonApi.community.timePeriods(options.communityId); + }).then((data)=>{ + let timePeriodsIndex = data.findIndex((item)=>{ + //找到之前选择的时段 + if(item.communtiy_time_period_id==this.savedTimePeriodId){ + //如果没满 + if(!item.order_full){ + return true; + } + } }); - }); - }, - findTimePeriodId(){ - const timePeriodsIndex = this.data.timePeriods.findIndex((item)=>{ - return item.communtiy_time_period_id==this.savedTimePeriodId; - }); - if(timePeriodsIndex>-1){ - this.setData({ - timePeriodsIndex + //如果还是没找到,就去找is_default 还是没有就让用户去选择,这里应该是没有可选的了 + if(timePeriodsIndex==-1){ + timePeriodsIndex = data.findIndex((item)=>item.is_default); + } + data.map((item)=>{ + // item.order_full = true; }) - } - console.log(timePeriodsIndex); + + this.setData({ + timePeriods:data, + timePeriodsIndex + }); + }) + }, chooseImage(){ wx.chooseMedia({ @@ -325,7 +323,6 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady() { - }, /** diff --git a/pages/help/package/index.wxml b/pages/help/package/index.wxml index 8e0fae1..332fedd 100644 --- a/pages/help/package/index.wxml +++ b/pages/help/package/index.wxml @@ -1,5 +1,5 @@ - + @@ -68,7 +68,10 @@ {{sendTypeKV[sendType]}} - 配送时段:{{timePeriods[timePeriodsIndex].time_period_name}} + + 配送时段:{{timePeriods[timePeriodsIndex].time_period_name}} + + 配送时段:请选择 @@ -103,8 +106,8 @@ 配送时段 - + {{item.time_period_name}} diff --git a/pages/help/package/index.wxss b/pages/help/package/index.wxss index 6cbea9c..d765577 100644 --- a/pages/help/package/index.wxss +++ b/pages/help/package/index.wxss @@ -248,14 +248,17 @@ background-color: rgba(255, 195, 0, 0.05); color: var(--main-color); } -.deliver-type-content .time-list .item.disabled{ +.deliver-type-content .time-list .item.order_full,.deliver-type-content .time-list .item.expired{ border: 1rpx solid rgba(136, 136, 136, 0.5); background-color: rgba(153, 153, 153, 0.1); color: #999999; } -.deliver-type-content .time-list .item.disabled::after{ +.deliver-type-content .time-list .item.order_full::after{ content:'运力不足'; } +.deliver-type-content .time-list .item.expired::after{ + content:'不可用' +} .deliver-type-content .time-list .item .time{ flex:1; } diff --git a/pages/my/index/index.wxml b/pages/my/index/index.wxml index 1d70c72..64e4fa8 100644 --- a/pages/my/index/index.wxml +++ b/pages/my/index/index.wxml @@ -1,7 +1,7 @@