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.
pk8f3pmu2/model/presence.js

48 lines
947 B

5 years ago
const AV = require('../lib/av-live-query-weapp-min');
class Presence extends AV.Object{
set user(value){
this.set("user", value);
}
get user(){
return this.get("user");
}
set class(value){
this.set("class", value);
}
get class(){
return this.get("class");
}
set isasking(value){
this.set("isasking", value);
}
get isasking(){
return this.get("isasking");
}
get present(){
return this.get("present");
}
set present(value){
this.set("present", value);
}
get mark() {
return this.get('done');
}
set mark(value) {
this.set('mark', value);
}
add_mark(value) {
this.increment(value);
}
enter(){
console.log("presence.enter");
console.log(this);
this.set("present", true).save().catch(error=>console.error(error.message));
}
leave(){
this.set("present", false).save()
}
5 years ago
}
AV.Object.register(Presence, "Presence");
module.exports = Presence;