大神来帮帮我!如何将数组遍历出的{{item.xxx}}作为点击事件的参数发起请求?
大神帮帮我!!!
wxml
<view class="table">
<view class="tr bg-w">
<text class="th">姓名</text>
<text class="th">手机号</text>
<text class="th ">邮箱</text>
</view>
<block wx:for="{{searchResult}}">
<view class="tr bg-g" >
<text class="td" selectable bindtap="watchContact">{{item.contactName}}</text>
<text class="td" selectable >{{item.telPhone}}</text>
<text class="td" selectable >{{item.mail}}</text>
</view>
</block>
</view>
js
Page({
data: {
inputData: '',
searchResult: []
},
watchContact:function(){
var that = this;
wx.request({
url: 'https://xxxxxxxx/findBycontactName',
method:'post',
header: {
'content-type': 'application/json'
},
data:{
},
success: (resp) => {
}
})
}