选择
This commit is contained in:
@@ -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){
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user