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 | 122 | currentTabIndex: 1, |
123 | 123 | |
124 | 124 | in_zhact_gdmap:{}, //不同门店参与同一活动的限购 |
125 | + hid_inp:1, | |
126 | + user_note:{}, | |
125 | 127 | }, |
126 | 128 | onLoad: function (t) { |
127 | 129 | wx.setNavigationBarTitle({title: "填写订单",}) |
... | ... | @@ -1013,8 +1015,11 @@ Page({ |
1013 | 1015 | }); |
1014 | 1016 | }, |
1015 | 1017 | keyUpChangeNum: function (t) { |
1018 | + var index = t.currentTarget.dataset.index; | |
1019 | + var txt="user_note."+index; | |
1016 | 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 | 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 | 76 | <!-- <view>门店:{{item.pname}}</view> --> |
77 | 77 | <view>{{item.pname}}</view> |
78 | 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 | 81 | <view class="goods-img" style="position: relative"> |
82 | 82 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
... | ... | @@ -104,7 +104,6 @@ |
104 | 104 | <view class="goods-num">x{{items.goods_num}}</view> |
105 | 105 | </view> |
106 | 106 | </navigator> |
107 | - | |
108 | 107 | </view> |
109 | 108 | |
110 | 109 | <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> |
... | ... | @@ -208,9 +207,14 @@ |
208 | 207 | <view class="coupon-mes flex-vertical"> |
209 | 208 | <view>留言</view> |
210 | 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 | 218 | </view> |
215 | 219 | </view> |
216 | 220 | ... | ... |
pages/cart/cart2/cart2.wxss