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.
47 lines
836 B
47 lines
836 B
const app = getApp();
|
|
Component({
|
|
properties: {
|
|
course_id: {
|
|
type: Number
|
|
},
|
|
id_: {
|
|
type: Number
|
|
},
|
|
refresh:{
|
|
type:Boolean,
|
|
observer:function(v){
|
|
if(v){
|
|
this.onLoad();
|
|
this.setData({ refresh: false });
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
data: {
|
|
imgDir: global.config.imgDir,
|
|
files:[],
|
|
loading:true
|
|
},
|
|
attached(){
|
|
;
|
|
this.onLoad();
|
|
},
|
|
methods: {
|
|
pull_files: function () {
|
|
app.callApi({ name: "files", data: { course_id: this.data.course_id }, complete: () => { wx.hideLoading(); this.setData({ loading: false }) } })
|
|
.then(res => {
|
|
this.setData({ files: res.data.files });
|
|
})
|
|
.catch(e=>{
|
|
|
|
});
|
|
},
|
|
|
|
|
|
onLoad: function (options) {
|
|
this.pull_files();
|
|
},
|
|
}
|
|
})
|