微信小程序实现商品详情页规格选择功能,现在效果是点击版本对应选项颜色的也一起选中了,要实现点击版本实现对应版本选项选中,点击颜色对应颜色选中
<view class='chosebox' wx:for="{{chose}}" wx:for-item="property" wx:key="index2" wx:if="{{chose.length>0}}" data-id="{{property.id}}">
<text class='ctil'>{{property.name}}</text>
<view class='chose'>
<view wx:for="{{property.childsCurGoods}}" wx:for-item="item2" wx:key="index" class="{{activeIndex == index ? 'ck':''}}" wx:for-index='index' data-index='{{index}}' data-msg='{{item2}}' wx:key='index' catchtap="clickMenu">
{{item2.name}}
</view>
</view>
</view>
clickMenu: function (event) {
var that=this
var index, id;
var tempObj = event.currentTarget.dataset;
index = tempObj.index;
id = tempObj.msg.id;
that.setData({
activeIndex: index,
tempKey: id
})
},
怎么修改