Commit 9767aa7c1e64fff879040ff0da07ac84dbc14f41
1 parent
ecd21b5c
购物车留言的时候穿透底层按钮
Showing
3 changed files
with
30 additions
and
6 deletions
pages/cart/cart2/cart2.js
| @@ -122,6 +122,8 @@ Page({ | @@ -122,6 +122,8 @@ Page({ | ||
| 122 | currentTabIndex: 1, | 122 | currentTabIndex: 1, |
| 123 | 123 | ||
| 124 | in_zhact_gdmap:{}, //不同门店参与同一活动的限购 | 124 | in_zhact_gdmap:{}, //不同门店参与同一活动的限购 |
| 125 | + hid_inp:1, | ||
| 126 | + user_note:{}, | ||
| 125 | }, | 127 | }, |
| 126 | onLoad: function (t) { | 128 | onLoad: function (t) { |
| 127 | wx.setNavigationBarTitle({title: "填写订单",}) | 129 | wx.setNavigationBarTitle({title: "填写订单",}) |
| @@ -1013,8 +1015,11 @@ Page({ | @@ -1013,8 +1015,11 @@ Page({ | ||
| 1013 | }); | 1015 | }); |
| 1014 | }, | 1016 | }, |
| 1015 | keyUpChangeNum: function (t) { | 1017 | keyUpChangeNum: function (t) { |
| 1018 | + var index = t.currentTarget.dataset.index; | ||
| 1019 | + var txt="user_note."+index; | ||
| 1016 | this.setData({ | 1020 | this.setData({ |
| 1017 | - maxWord: t.detail.value.length | 1021 | + maxWord: t.detail.value.length, |
| 1022 | + [txt]: t.detail.value | ||
| 1018 | }); | 1023 | }); |
| 1019 | }, | 1024 | }, |
| 1020 | 1025 | ||
| @@ -3790,5 +3795,17 @@ Page({ | @@ -3790,5 +3795,17 @@ Page({ | ||
| 3790 | }); | 3795 | }); |
| 3791 | }, | 3796 | }, |
| 3792 | 3797 | ||
| 3798 | + set_hid_inp:function (e) { | ||
| 3799 | + var index = e.currentTarget.dataset.index; | ||
| 3800 | + var txt = "cartlist[" + index + "].focus"; | ||
| 3801 | + this.setData({[txt]:1}) | ||
| 3802 | + }, | ||
| 3803 | + | ||
| 3804 | + clear_hid_inp:function (e) { | ||
| 3805 | + var index = e.currentTarget.dataset.index; | ||
| 3806 | + var txt = "cartlist[" + index + "].focus"; | ||
| 3807 | + this.setData({[txt]:0}) | ||
| 3808 | + } | ||
| 3809 | + | ||
| 3793 | 3810 | ||
| 3794 | }); | 3811 | }); |
pages/cart/cart2/cart2.wxml
| @@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
| 76 | <!-- <view>门店:{{item.pname}}</view> --> | 76 | <!-- <view>门店:{{item.pname}}</view> --> |
| 77 | <view>{{item.pname}}</view> | 77 | <view>{{item.pname}}</view> |
| 78 | </view> | 78 | </view> |
| 79 | - <view class="order-detail" wx:if="{{items.goods_num>0}}" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> | 79 | + <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> |
| 80 | <!----商品图片-----> | 80 | <!----商品图片-----> |
| 81 | <view class="goods-img" style="position: relative"> | 81 | <view class="goods-img" style="position: relative"> |
| 82 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> | 82 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
| @@ -104,7 +104,6 @@ | @@ -104,7 +104,6 @@ | ||
| 104 | <view class="goods-num">x{{items.goods_num}}</view> | 104 | <view class="goods-num">x{{items.goods_num}}</view> |
| 105 | </view> | 105 | </view> |
| 106 | </navigator> | 106 | </navigator> |
| 107 | - | ||
| 108 | </view> | 107 | </view> |
| 109 | 108 | ||
| 110 | <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> | 109 | <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> |
| @@ -208,9 +207,14 @@ | @@ -208,9 +207,14 @@ | ||
| 208 | <view class="coupon-mes flex-vertical"> | 207 | <view class="coupon-mes flex-vertical"> |
| 209 | <view>留言</view> | 208 | <view>留言</view> |
| 210 | <view class="leave-word"> | 209 | <view class="leave-word"> |
| 211 | - <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}" | ||
| 212 | - class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}"></input> | 210 | + <input hidden="{{!item.focus}}" bindinput="keyUpChangeNum" disabled="{{disabled}}" |
| 211 | + data-index="{{index}}" bindblur="clear_hid_inp" focus="{{item.focus}}" value="{{user_note[index]}}" | ||
| 212 | + class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}" /> | ||
| 213 | 213 | ||
| 214 | + <view class="{{user_note[index]?'':'c-a'}}" style="width: 80%;font-size: 26rpx" data-index="{{index}}" | ||
| 215 | + bindtap="set_hid_inp" wx:if="{{!item.focus}}"> | ||
| 216 | + {{user_note[index]?user_note[index]:'给商家留言,最多100字'}} | ||
| 217 | + </view> | ||
| 214 | </view> | 218 | </view> |
| 215 | </view> | 219 | </view> |
| 216 | 220 |
pages/cart/cart2/cart2.wxss
| @@ -249,7 +249,10 @@ margin:auto; */ | @@ -249,7 +249,10 @@ margin:auto; */ | ||
| 249 | position: relative; | 249 | position: relative; |
| 250 | font-size: 24rpx; | 250 | font-size: 24rpx; |
| 251 | margin-left: 20rpx; | 251 | margin-left: 20rpx; |
| 252 | - flex-grow: 1; | 252 | + display: flex; |
| 253 | + align-items: center; | ||
| 254 | + height: 50rpx; | ||
| 255 | + width: 500rpx; | ||
| 253 | } | 256 | } |
| 254 | 257 | ||
| 255 | .word-box { | 258 | .word-box { |