You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
983 B

const app = getApp();
const { processObj, get, format } = require("../../js/utils");
const ROUTE = {
Course:{
Exercise:{
__:"{exercise_cover}?exercise_id=${container_id}"
},
HomeworkCommon:{
__:"{course}?module_type=common_homework&course_id=${belong_container_id}",
practice: "{shixun_homework}?homework_id=${container_id}"
},
StudentWork:{
__:"{course}?module_type=common_homework&course_id=${belong_container_id}",
}
}
}
processObj(ROUTE);
Component({
properties: {
data:Object
},
data: {
eduImgDir:global.config.eduImgDir
},
methods: {
enterDetail(){
let {data} = this.data;
let route = get(ROUTE,data.belong_container_type,{});
route = get(route, data.container_type,{});
route = get(route, data.homework_type);
console.log(route);
if(!route) return;
let url = format(route, data);
console.log("navutl", url);
app.navigateTo({url});
}
}
})