Skip to content

Commit

Permalink
000
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyChen2001 committed Jul 19, 2021
1 parent 0411d5b commit 8a9b7ec
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
25 changes: 25 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,31 @@ App({
})
}
},

exp:function(present){
if(present=="eat"){
this.globalData.exp = this.globalData.exp+20,
AV.User.current().set("exp",this.globalData.exp);
console.log(this.globalData.exp);
AV.User.current().save();
}
else if(present="sleep"){
this.globalData.exp = this.globalData.exp+20,
AV.User.current().set("exp",this.globalData.exp);
AV.User.current().save();
}
else if(present=="present"){
this.globalData.exp = this.globalData.exp+20,
AV.User.current().set("exp",this.globalData.exp);
AV.User.current().save();
}
else if(present=="medicine"){
this.globalData.exp = this.globalData.exp+20,
AV.User.current().set("exp",this.globalData.exp);
AV.User.current().save();
}
},

globalData: {
TakeMedicineBefore: false,
userInfo: null,
Expand Down
4 changes: 1 addition & 3 deletions pages/home/eat/eat.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ Page({
this.setData({
dialogShow: false,
})
app.globalData.exp = app.globalData.exp+20,
AV.User.current().set("exp",app.globalData.exp);
AV.User.current().save();
app.exp("eat"),
app.globalData.eatfinish = true
},

Expand Down
4 changes: 1 addition & 3 deletions pages/home/medicine/medicine.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ Page({
})
}
}
app.globalData.exp = app.globalData.exp+20,
AV.User.current().set("exp",app.globalData.exp);
AV.User.current().save();
app.exp("medicine"),
app.globalData.medicinefinish = true
},

Expand Down
4 changes: 1 addition & 3 deletions pages/home/practice/practice.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ Page({
},
click: function (e) {
app.homeclick(e),
app.globalData.exp = app.globalData.exp+20,
AV.User.current().set("exp",app.globalData.exp);
AV.User.current().save();
app.exp("practice");
app.globalData.practicefinish = true

},
Expand Down
4 changes: 1 addition & 3 deletions pages/home/sleep/sleep.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ Page({
},
click: function (e) {
app.homeclick(e),
app.globalData.exp = app.globalData.exp+20,
AV.User.current().set("exp",app.globalData.exp);
AV.User.current().save();
app.exp("sleep"),
app.globalData.sleepfinish = true
},

Expand Down
2 changes: 1 addition & 1 deletion project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
"list": []
}
}
}
}

0 comments on commit 8a9b7ec

Please sign in to comment.