| xqd
@@ -71,7 +71,7 @@ Page({
|
|
|
handleBtnClick() {
|
|
|
let isLearning = this.data.isLearning
|
|
|
let is_btn_disabled = this.data.is_btn_disabled
|
|
|
- let can_check_card = false;
|
|
|
+ let that = this;
|
|
|
if (is_btn_disabled) {
|
|
|
wx.showToast({
|
|
|
title: '请到学校之后再打卡',
|
| xqd
@@ -94,7 +94,11 @@ Page({
|
|
|
},
|
|
|
success: res => {
|
|
|
if (res.data.status == 'success') {
|
|
|
- can_check_card = true;
|
|
|
+ that.setData({
|
|
|
+ isLearning: !isLearning,
|
|
|
+ startTime: new Date().getTime()
|
|
|
+ })
|
|
|
+ that.startClock()
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: res.data.info,
|
| xqd
@@ -104,14 +108,6 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- if(can_check_card) {
|
|
|
- this.setData({
|
|
|
- isLearning: !isLearning,
|
|
|
- startTime: new Date().getTime()
|
|
|
- })
|
|
|
- this.startClock()
|
|
|
- }
|
|
|
}
|
|
|
},
|
|
|
startClock() {
|