This commit is contained in:
SelfRidicule 2024-02-28 09:39:59 +08:00
parent 914dc02c62
commit 7a582220cd
2 changed files with 10 additions and 2 deletions

View File

@ -24,6 +24,14 @@ Page({
}); });
}, },
// 点击-选择优惠卷
couponSelect(e) {
console.log('couponSelect', e);
this.setData({
couponId: e.currentTarget.dataset.id,
});
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -2,8 +2,8 @@
<!-- 优惠卷列表 --> <!-- 优惠卷列表 -->
<view class="couponView"> <view class="couponView">
<van-radio-group value="{{ couponId }}" bind:change="couponChange"> <van-radio-group value="{{ couponId }}">
<view class="item" wx:for="{{3}}" wx:for-index="idx"> <view class="item" wx:for="{{3}}" wx:for-index="idx" data-id="{{idx}}" bind:tap="couponSelect">
<view class="imgView"> <view class="imgView">
<view class="img"></view> <view class="img"></view>
<view class="timeView"> <view class="timeView">