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}" }, 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}); } } })