const app = getApp(); Component({ properties: { data:Object }, data: { }, methods: { onTap(){ let { exercise_status, current_status, id} = this.data.data; if (exercise_status == 3 || current_status < 2) { app.navigateTo({ url: `{exercise}?exercise_id=${id}` }); }else{ // 让用户选择是否答题,故添加封面; app.navigateTo({url:`{exercise_cover}?exercise_id=${id}&exercise_status=${exercise_status}¤t_status=${current_status}`}); } } } })