let id = e.currentTarget.id;
console.log('id:',id)
switch (id){
case 0:
wx.navigateTo({
url: '../card/card?id=' + id
});break;
case 1:
wx.navigateTo({
url: '../scan/scan?id=' + id
});break;
case 2:
wx.navigateTo({
url: '../ticket/ticket?id=' + id
});break;
default:break;
}
id是字符串
类型和值要完全相同