HTML
<view onTap="skip" data-id={{item.data.id}} style="padding-left: 20rpx">
</view>
js
skip(event) {
var id = event.currentTarget.dataset.id
console.log(event)
dd.navigateTo({
url: '../detailsbill/detailsbill?id=' + id,
})
},
接收的JS页面
onLoad: function (options) {
dd.showLoading({
content: '加载中...',
delay: '1000',
});
console.log(options)
var that = this;
// var that = this;
// that.setData({
// id: options.id
// })
console.log(options.id + "aaa")
// console.log(that.data.id)
// console.log(JSON.parse(options.list))options
// var that = this;
// that.setData({
// list: JSON.parse(options.list)
// })
dd.httpRequest({
headers: {
"Content-Type": "application/json"
},
url: 'http://192.168.41.123:8080/Budget/Budget/loadInvoiceDetail.action',
method: 'GET',
data: {
invoiceId: options.id
},
success: res => {
console.log(res.data.data)
// console.log("获得的的内容" + JSON.stringify(res));
// console.log("获得的的内容" + JSON.stringify(res.data));
let { data, header, status } = res;
// var that = this;
// let list = res.data;
// console.log(res.data)
if (status === 200) {
dd.hideLoading();
let success = res.data.success
if (success == true) {
that.setData({
list: res.data.data
})
} else {
dd.showToast({
type: 'fail',
content: '获取详情信息失败',
duration: 3000,
});
}
} else {
dd.showLoading({
content: '加载中...',
delay: '1000',
});
}
},
//请求失败动作
fail: function (res) {
},
//请求之前动作
complete: function (res) {
}
})
},