Commit 49aba43c by zhangxw

购物车优化

1 parent 2eeac2f9
...@@ -50,7 +50,8 @@ Page({ ...@@ -50,7 +50,8 @@ Page({
}, },
choose(e) { choose(e) {
let { let {
index index,
item
} = e.currentTarget.dataset } = e.currentTarget.dataset
let { let {
goodsList goodsList
...@@ -59,6 +60,7 @@ Page({ ...@@ -59,6 +60,7 @@ Page({
this.hide(e) this.hide(e)
return return
} }
if (item.flag) return
this.setData({ this.setData({
[`goodsList[${index}].active`]: !goodsList[index].active [`goodsList[${index}].active`]: !goodsList[index].active
}) })
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="list"> <view class="list">
<view class="item {{item.showDel?'touch-move-active':''}}" data-index="{{index}}" data-ind="{{ind}}" <view class="item {{item.showDel?'touch-move-active':''}}" data-index="{{index}}" data-ind="{{ind}}"
bindtouchstart="start" bindtouchmove="move"> bindtouchstart="start" bindtouchmove="move">
<view class="content" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}"> <view class="content" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{item}}">
<view class="icon" wx:if="{{!item.flag}}"> <view class="icon" wx:if="{{!item.flag}}">
<icon type="{{item.active?'success':'circle'}}" color="{{item.active?'#FB8A32':'#B1B1B3'}}" size="20"> <icon type="{{item.active?'success':'circle'}}" color="{{item.active?'#FB8A32':'#B1B1B3'}}" size="20">
</icon> </icon>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!