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.

46 lines
1.1 KiB

const app = getApp();
5 years ago
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}"
},
JoinCourse:{
__:"{teacher_apply}?course_id=${belong_container_id}"
},
StudentJoinCourse:{
__:"{students}?course_id=${belong_container_id}&course_identity=2"
},
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);
if(!route) return;
let url = format(route, data);
app.navigateTo({url});
}
}
})