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.
35 lines
782 B
35 lines
782 B
const app = getApp();
|
|
const route = {
|
|
Course:{
|
|
Exercise:"{exercise_cover}?exercise_id=${container_id}",
|
|
HomeworkCommon:"{course}?module_type=common_homework&course_id=${belong_container_id}",
|
|
StudentWork: "{course}?module_type=common_homework&course_id=${belong_container_id}",
|
|
}
|
|
}
|
|
|
|
Component({
|
|
properties: {
|
|
data:Object
|
|
},
|
|
|
|
data: {
|
|
eduImgDir:global.config.eduImgDir
|
|
},
|
|
methods: {
|
|
enterDetail(){
|
|
let {data} = this.data;
|
|
try{
|
|
var url = route[data.belong_container_type][data.container_type];
|
|
}catch(e){
|
|
return;
|
|
}
|
|
if(!url) return;
|
|
console.log(url);
|
|
url = url.replace(/\$\{(.*?)\}/g,function(match, name){
|
|
return data[name]||'';
|
|
});
|
|
app.navigateTo({url});
|
|
}
|
|
}
|
|
})
|