Commit d09da57a5ce4aada8bb7021aeb890b20cf9f8143
1 parent
0e01eb45
小程序bug优化
Showing
4 changed files
with
126 additions
and
67 deletions
packageE/pages/cart/cart2/cart2.js
| ... | ... | @@ -168,6 +168,8 @@ Page({ |
| 168 | 168 | |
| 169 | 169 | bconfig: null, |
| 170 | 170 | showFold:true, |
| 171 | + | |
| 172 | + ly_map:{} | |
| 171 | 173 | }, |
| 172 | 174 | |
| 173 | 175 | |
| ... | ... | @@ -1036,8 +1038,11 @@ Page({ |
| 1036 | 1038 | } |
| 1037 | 1039 | |
| 1038 | 1040 | } |
| 1039 | - arr[j].exp_type = e_t; | |
| 1040 | - if (e_t == 0) th.setData({ is_all_zt: 0 }); | |
| 1041 | + if(car_item.is_gift != 1){ | |
| 1042 | + arr[j].exp_type = e_t; | |
| 1043 | + if (e_t == 0) th.setData({ is_all_zt: 0 }); | |
| 1044 | + } | |
| 1045 | + | |
| 1041 | 1046 | //else if (e_t == 1) th.setData({ is_all_zt: 1 }); |
| 1042 | 1047 | } |
| 1043 | 1048 | |
| ... | ... | @@ -2094,6 +2099,8 @@ Page({ |
| 2094 | 2099 | payWithPoints: !(t.detail.value.length > 0) |
| 2095 | 2100 | }); |
| 2096 | 2101 | }, |
| 2102 | + | |
| 2103 | + | |
| 2097 | 2104 | keyUpChangeNum: function (t) { |
| 2098 | 2105 | var index = t.currentTarget.dataset.index; |
| 2099 | 2106 | var txt = "user_note." + index; |
| ... | ... | @@ -2104,6 +2111,22 @@ Page({ |
| 2104 | 2111 | }, |
| 2105 | 2112 | |
| 2106 | 2113 | |
| 2114 | + show_ly:function (t){ | |
| 2115 | + var index = t.currentTarget.dataset.index; | |
| 2116 | + var txt='ly_map['+index+']'; | |
| 2117 | + this.setData({ | |
| 2118 | + [txt]:1 | |
| 2119 | + }) | |
| 2120 | + }, | |
| 2121 | + | |
| 2122 | + hide_ly:function (t){ | |
| 2123 | + var index = t.currentTarget.dataset.index; | |
| 2124 | + var txt='ly_map['+index+']'; | |
| 2125 | + this.setData({ | |
| 2126 | + [txt]:0 | |
| 2127 | + }) | |
| 2128 | + }, | |
| 2129 | + | |
| 2107 | 2130 | //寻找活动在列表中的最后一个 |
| 2108 | 2131 | find_pro_last(ord_goods,prom_type,prom_id){ |
| 2109 | 2132 | if(!ord_goods || ord_goods.length==0) return -1; | ... | ... |
packageE/pages/cart/cart2/cart2.wxml
| ... | ... | @@ -251,6 +251,68 @@ |
| 251 | 251 | <view bindtap="buycard" class="card_op">立即开通</view> |
| 252 | 252 | </view> |
| 253 | 253 | |
| 254 | + <!-- 有送礼包 --> | |
| 255 | + <view wx:if="{{send_lb[item.pickup_id]}}"> | |
| 256 | + <block wx:for="{{send_lb[item.pickup_id]}}" wx:key="id" wx:for-item="send"> | |
| 257 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.l_id}}" data-flag="{{send.flag}}" bindtap="viewLbDetails"> | |
| 258 | + <view class="flex ai_c"> | |
| 259 | + <view class="circle1">赠</view>{{send.zxlbtitle?send.zxlbtitle:send.lbtitle}} | |
| 260 | + <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> | |
| 261 | + </view> | |
| 262 | + <view class="flex ai_c"> | |
| 263 | + x{{send.num}}<text class="bg_jj"></text> | |
| 264 | + </view> | |
| 265 | + </view> | |
| 266 | + </block> | |
| 267 | + </view> | |
| 268 | + <!-- 每月礼包 --> | |
| 269 | + <view wx:if="{{month_lb[item.pickup_id]}}"> | |
| 270 | + <block wx:for="{{month_lb[item.pickup_id]}}" wx:key="id" wx:for-item="send"> | |
| 271 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.month_id}}" data-flag="2" bindtap="viewLbDetails"> | |
| 272 | + <view class="flex ai_c"> | |
| 273 | + <view class="circle1">赠</view>{{send.monthlbtitle}} | |
| 274 | + <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> | |
| 275 | + </view> | |
| 276 | + <view class="flex ai_c"> | |
| 277 | + x{{send.monthnum}}<text class="bg_jj"></text> | |
| 278 | + </view> | |
| 279 | + </view> | |
| 280 | + </block> | |
| 281 | + </view> | |
| 282 | + <!-- 赠品的显示 --> | |
| 283 | + <view wx:if="{{send_gf[item.pickup_id]}}"> | |
| 284 | + <block wx:for="{{send_gf[item.pickup_id]}}" wx:for-item="iter"> | |
| 285 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-pk="{{item.pickup_id}}" data-index="{{index}}" bindtap="show_sele_gift"> | |
| 286 | + <view class="flex ai_c"> | |
| 287 | + <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
| 288 | + </view> | |
| 289 | + | |
| 290 | + <view class="flex ai_c" wx:if="{{iter.selected}}"> | |
| 291 | + 已选择<text class="bg_jj"></text> | |
| 292 | + </view> | |
| 293 | + | |
| 294 | + <view class="flex ai_c" wx:else="{{}}"> | |
| 295 | + 未选择<text class="bg_jj"></text> | |
| 296 | + </view> | |
| 297 | + | |
| 298 | + </view> | |
| 299 | + </block> | |
| 300 | + </view> | |
| 301 | + | |
| 302 | + <!-----使用优惠券------> | |
| 303 | + <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" wx:if="{{!(yh_is_xz_yh[item.pickup_id]) && ((item.quan_list && item.quan_list.length>0 ) || get_by_quan_list_cart[item.pickup_id]!=null && item.can_num>0)}}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> | |
| 304 | + <view class="work-frame flex-space-between"> | |
| 305 | + <view class="work">优惠券<text class="quan_num_show fs20">{{item.can_num}}张可用</text></view> | |
| 306 | + <view class="xc-right-frame"> | |
| 307 | + <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text> | |
| 308 | + <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text> | |
| 309 | + <text wx:if="{{using_quan[item.pickup_id].isby}}">包邮券</text> | |
| 310 | + <view class="xc-right"></view> | |
| 311 | + </view> | |
| 312 | + </view> | |
| 313 | + </view> | |
| 314 | + | |
| 315 | + | |
| 254 | 316 | <view class="set-mes bdr_b-14"> |
| 255 | 317 | <view wx:if="{{order.store_prom}}"> |
| 256 | 318 | <icon color="#f23030" size="16" type="info"></icon> |
| ... | ... | @@ -322,70 +384,8 @@ |
| 322 | 384 | </block> |
| 323 | 385 | </view> |
| 324 | 386 | |
| 325 | - <!-- 有送礼包 --> | |
| 326 | - <view wx:if="{{send_lb[item.pickup_id]}}"> | |
| 327 | - <block wx:for="{{send_lb[item.pickup_id]}}" wx:key="id" wx:for-item="send"> | |
| 328 | - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.l_id}}" data-flag="{{send.flag}}" bindtap="viewLbDetails"> | |
| 329 | - <view class="flex ai_c"> | |
| 330 | - <view class="circle1">赠</view>{{send.zxlbtitle?send.zxlbtitle:send.lbtitle}} | |
| 331 | - <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> | |
| 332 | - </view> | |
| 333 | - <view class="flex ai_c"> | |
| 334 | - x{{send.num}}<text class="bg_jj"></text> | |
| 335 | - </view> | |
| 336 | - </view> | |
| 337 | - </block> | |
| 338 | - </view> | |
| 339 | - <!-- 每月礼包 --> | |
| 340 | - <view wx:if="{{month_lb[item.pickup_id]}}"> | |
| 341 | - <block wx:for="{{month_lb[item.pickup_id]}}" wx:key="id" wx:for-item="send"> | |
| 342 | - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.month_id}}" data-flag="2" bindtap="viewLbDetails"> | |
| 343 | - <view class="flex ai_c"> | |
| 344 | - <view class="circle1">赠</view>{{send.monthlbtitle}} | |
| 345 | - <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> | |
| 346 | - </view> | |
| 347 | - <view class="flex ai_c"> | |
| 348 | - x{{send.monthnum}}<text class="bg_jj"></text> | |
| 349 | - </view> | |
| 350 | - </view> | |
| 351 | - </block> | |
| 352 | - </view> | |
| 353 | - <!-- 赠品的显示 --> | |
| 354 | - <view wx:if="{{send_gf[item.pickup_id]}}"> | |
| 355 | - <block wx:for="{{send_gf[item.pickup_id]}}" wx:for-item="iter"> | |
| 356 | - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-pk="{{item.pickup_id}}" data-index="{{index}}" bindtap="show_sele_gift"> | |
| 357 | - <view class="flex ai_c"> | |
| 358 | - <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
| 359 | - </view> | |
| 360 | - | |
| 361 | - <view class="flex ai_c" wx:if="{{iter.selected}}"> | |
| 362 | - 已选择<text class="bg_jj"></text> | |
| 363 | - </view> | |
| 364 | - | |
| 365 | - <view class="flex ai_c" wx:else="{{}}"> | |
| 366 | - 未选择<text class="bg_jj"></text> | |
| 367 | - </view> | |
| 368 | - | |
| 369 | - </view> | |
| 370 | - </block> | |
| 371 | - </view> | |
| 372 | - | |
| 373 | - <!-----使用优惠券------> | |
| 374 | - <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" wx:if="{{!(yh_is_xz_yh[item.pickup_id]) && ((item.quan_list && item.quan_list.length>0 ) || get_by_quan_list_cart[item.pickup_id]!=null && item.can_num>0)}}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> | |
| 375 | - <view class="work-frame flex-space-between"> | |
| 376 | - <view class="work">优惠券<text class="quan_num_show fs20">{{item.can_num}}张可用</text></view> | |
| 377 | - <view class="xc-right-frame"> | |
| 378 | - <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text> | |
| 379 | - <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text> | |
| 380 | - <text wx:if="{{using_quan[item.pickup_id].isby}}">包邮券</text> | |
| 381 | - <view class="xc-right"></view> | |
| 382 | - </view> | |
| 383 | - </view> | |
| 384 | - </view> | |
| 385 | - | |
| 386 | - | |
| 387 | - <!-- 保障服务 --> | |
| 388 | - <view class="bz_view22 flex bdt16 ai_c" wx:if="{{bconfig.service_bz}}"> | |
| 387 | + <!-- 保障服务 --> | |
| 388 | + <view class="bz_view22 flex bdt16 ai_c" wx:if="{{bconfig.service_bz}}"> | |
| 389 | 389 | <image class="bzfu_img22" src="{{imgUrl}}/miniapp/images/bzfu_w.png"></image> |
| 390 | 390 | <view class="flex f1 ai_c rel22" style="position: relative;" bindtap="{{showFold ? 'clickCollapse':''}}"> |
| 391 | 391 | <view class="bz-content22 showArea22 {{flag ? '':'ellipsis-1x'}}">{{bconfig.service_bz}}</view> |
| ... | ... | @@ -395,11 +395,23 @@ |
| 395 | 395 | </view> |
| 396 | 396 | </view> |
| 397 | 397 | </view> |
| 398 | + | |
| 398 | 399 | <!-- 留言 --> |
| 399 | 400 | <view class="coupon-mes flex-vertical"> |
| 400 | 401 | <view>留言</view> |
| 401 | 402 | <view class="leave-word"> |
| 402 | - <input placeholder="给商家留言,最多100字" bindinput="keyUpChangeNum" data-index="{{pidx}}" value="{{user_note[pidx]}}" class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}" /> | |
| 403 | + | |
| 404 | + <block wx:if="{{ly_map[pidx]}}"> | |
| 405 | + <input bindblur="hide_ly" bindinput="keyUpChangeNum" | |
| 406 | + data-index="{{pidx}}" focus="{{ly_map[pidx]}}" style="color:#8c8c8c" | |
| 407 | + value="{{user_note[pidx]}}" class="word-box" | |
| 408 | + maxlength="100" name="user_note_{{item.pickup_id}}" /> | |
| 409 | + </block> | |
| 410 | + <block wx:else> | |
| 411 | + <text bindtap="show_ly" style="color:#8c8c8c;font-size:26rpx;" | |
| 412 | + data-index="{{pidx}}">{{user_note[pidx]?user_note[pidx]:'给商家留言,最多100字'}}</text> | |
| 413 | + </block> | |
| 414 | + | |
| 403 | 415 | |
| 404 | 416 | </view> |
| 405 | 417 | </view> | ... | ... |
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -279,6 +279,28 @@ Page({ |
| 279 | 279 | arr[i].content.gift_name=res.data.data.pageData[0].goods_name; |
| 280 | 280 | }) |
| 281 | 281 | } |
| 282 | + | |
| 283 | + //--送专享礼包-- | |
| 284 | + if(parseInt(content.is_zxlibao)) { | |
| 285 | + //-- 获取 -- | |
| 286 | + await getApp().request.promiseGet("/api/weshop/marketing/giftbag/detail/getNew1?storeId="+oo.stoid+"&giftBagId="+content.zxlibao, { | |
| 287 | + }).then(res => { | |
| 288 | + if(res.data.code==0 && res.data.data) | |
| 289 | + arr[i].content.zxlb_name=res.data.data.lbTitle; | |
| 290 | + }) | |
| 291 | + } | |
| 292 | + | |
| 293 | + //--送专享礼包-- | |
| 294 | + if(parseInt(content.is_monthgiftbag)) { | |
| 295 | + //-- 获取 -- | |
| 296 | + await getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagForm/get/"+oo.stoid+"/"+content.monthgiftbag, { | |
| 297 | + }).then(res => { | |
| 298 | + if(res.data.code==0 && res.data.data) | |
| 299 | + arr[i].content.monthgift_name=res.data.data.act_name; | |
| 300 | + }) | |
| 301 | + } | |
| 302 | + | |
| 303 | + | |
| 282 | 304 | } |
| 283 | 305 | th.setData({prom_goods_list:arr}); |
| 284 | 306 | }, | ... | ... |
pages/goods/goodsList/goodsList.wxml
| ... | ... | @@ -13,6 +13,8 @@ |
| 13 | 13 | <text space="{{true}}" wx:if="{{item.content.is_coupon && item.content.is_coupon!='0'}}">送{{item.content.coupon}}元优惠券 </text> |
| 14 | 14 | <text space="{{true}}" wx:if="{{item.content.is_gift && item.content.is_gift!='0'}}">送{{item.content.zp_mode==1?'多赠品':item.content.gift_name}} </text> |
| 15 | 15 | <text space="{{true}}" wx:if="{{item.content.is_libao && item.content.is_libao!='0'}}">送{{item.content.lb_name}} </text> |
| 16 | + <text space="{{true}}" wx:if="{{item.content.is_zxlibao && item.content.is_zxlibao!='0'}}">送{{item.content.zxlb_name}} </text> | |
| 17 | + <text space="{{true}}" wx:if="{{item.content.is_monthgiftbag && item.content.is_monthgiftbag!='0'}}">送{{item.content.monthgift_name}} </text> | |
| 16 | 18 | </view> |
| 17 | 19 | </block> |
| 18 | 20 | <!-- 新增 --> | ... | ... |