根据绑定的data-id的值:
<view class=”items” data-id=”{{item.id}}” bindtap=”index”>
<viewclass=”detail”>
<viewclass=”detail-express”>
<textclass=”{{title != ” ? ” : ‘type-text’}}”>{{item.name}}</text>
</view>
<viewclass=”detail-express”>
<text>{{item.in_business == ‘1’ ? ‘营业中’ : ‘休息中’}}</text>
</view>
<viewclass=”detail-express”>
<text>{{item.address}}</text>
<textclass=”number”></text>
</view>
</view>
<viewclass=”des”>详情</view>
</view>
跳转函数:
index: function (event) {
console.log(event);
wx.navigateTo({
url: “../store/store?storeid=” + event.currentTarget.dataset.id,//获取data-id中的参数
//接口调用成功的回调方法
success: function () { },
fail: function () { },
complete: function () { }
})
}