微信小程序
获取所点列表的id
<image wx:if="{{item.isFabulos == 1}}" src="../img/hearts.png" bindtap="praise" data-index="{{item.id}}"></image>
praise:function(e){
console.log(e.currentTarget.dataset['index']);
}
延时的方法
setTimeout(function(){
wx.switchTab({
url: '../my/my'
})
},500)
页面获取值得方法
naneset:function(e){
this.name = e.detail.value
},
wx.request
tixianbtn:function(e){
var money = this.data.money;
// var url = '../tixiantijiao/tixiantijiao?money='
// console.log("******" + money);
wx.request({
url:url + '/orderApi/withdraw',
method:'POST',
header:{
'content-type':'application/x-www-form-urlencoded'
},
data:{
money: money,
userId: wx.getStorageSync('userId')
},
success:res=>{
console.log(res);
// console.log()
var msga = res.data.msg;
console.log(msga);
if("等待审核" == msga ){
wx.navigateTo({
url: '../tixiantijiao/tixiantijiao?money=' + money
})
}else{
wx.showToast({
title: res.data.msg,
})
}
}
})
}
网友评论