页面1
async getListTransferAndApprova() {
//把mark值拼接到路径的后面,定义一个变量,使得切换穿的mark都不一样
let mark = '';
if (this.tabsCurrent === 0) {
mark = '2';
} else if (this.tabsCurrent === 1) {
mark = '3';
}else if (this.tabsCurrent === 2) {
mark = '4';
}else if (this.tabsCurrent ===3) {
mark = '5';
}
const data ={
mark:mark,
query:this.queryParams
}
const res = await listTransferAndApprova(data)
uni.hideLoading()
this.requestList = res.rows
},
//点击时跳转把mark也传递过去
detail(item) {
let mark = '';
if (this.tabsCurrent === 0) {
mark = '2';
} else if (this.tabsCurrent === 1) {
mark = '3';
} else if (this.tabsCurrent === 2) {
mark = '4';
} else if (this.tabsCurrent === 3) {
mark = '5';
}
item.mark = mark;
uni.navigateTo({
url: `/subpkg/allot/allotAuditDetail?item=${JSON.stringify(item)}&itemId=${this.tabsCurrent}`
});
},
页面2
来接收传递过来的数据
/**接收传递过来的数据*/
onLoad(option) {
this.title = parseInt(JSON.parse(option.itemId))
if (option.item) {
const item = JSON.parse(option.item);
console.log(item);
this.dataDetail = item
}
},
打印出来的,mark已被接收