This commit is contained in:
2019-12-20 09:51:28 +08:00
parent edc8983853
commit 3cf388faed
6 changed files with 31 additions and 6 deletions

View File

@@ -7,8 +7,15 @@ Page({
*/
data: {
list:[],
select:[],
userid:0
},
sel(a){
console.log(a)
this.setData({
[`select[${a.detail.index}]`]:!a.detail.select
})
},
/**
* 生命周期函数--监听页面加载
@@ -53,7 +60,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.onLoad()
},
/**
@@ -89,5 +96,10 @@ Page({
*/
onShareAppMessage: function() {
},
num(){
for(let i in this.data.select){
}
}
})

View File

@@ -1,6 +1,6 @@
<view class="shopping">
<view class="item" wx:for="{{list}}" wx:for-index="j" wx:key="{{j}}">
<shopping-item shopname="{{item.goods_name}}" shopdesc="{{item.spec_key_name||'默认规格'}}" price="{{item.goods_price}}" pic="{{item.image}}" num="{{item.goods_num}}" gid="{{item.id}}"></shopping-item>
<shopping-item shopname="{{item.goods_name}}" shopdesc="{{item.spec_key_name||'默认规格'}}" price="{{item.goods_price}}" pic="{{item.image}}" num="{{item.goods_num}}" gid="{{item.id}}" index="{{j}}" select="{{select[j]}}" bindsel="sel"></shopping-item>
</view>
<!-- <view class="item">
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item>