效果
页面
<view class="table">
<view class="tr bg-w">
<view class="th ">选择</view>
<view class="th ">所属街道</view>
<view class="th">上报单位</view>
<view class="th ">上报人</view>
</view>
<block wx:for="{{listArr}}" wx:key="index" wx:for-item="item" >
<view >
<view class="tr bg-g" >
<view class="td" ><checkbox bindtap="check" value="{{item.reportId}}" data-index="{{item.reportId}}"></checkbox></view>
<view class="td" >{{item.areaName}}</view>
<view class="td" >{{item.reportUnit}}</view>
<view class="td" >{{item.reportPerson}}</view>
</view>
</view>
</block>
</view>
Js
data:{
id:",
}
check(e){
var that=this;
var select=e.currentTarget.dataset.index;
//多选拼接id
that.data.id+="'"+select+"',";
console.log(that.data.id);
console.log(select);
that.setData({
})
},