代码如下:
var query = new AV.Query('Cours')
query.containsAll('range', range)
.find()
.then(res => {
that.setData({
coursTuijian: res,
})
//此处得到的res可以直接显示,但是要是在代码中做判断时或赋值时,是不是必须加attributes
var cours = that.data.coursTuijian;
for (var j in stucoumap) {
cours[j].attributes.baoming = "";//例如此处,否则加不到属性中
if (cours[j].coursId == stucoumap[j].coursId) {
cours[j].attributes.baoming = "已报名";
break;
}
}
that.setData({
coursLable: '',
boyLable: 'selectcours',
boycours: 'tuijian',
coursTuijian: cours,
})
})