|
@@ -62,12 +62,24 @@ Page({
|
|
student_id: pt_student.id
|
|
student_id: pt_student.id
|
|
},
|
|
},
|
|
success: res => {
|
|
success: res => {
|
|
- console.log(res)
|
|
|
|
|
|
+ let validLocation = false;
|
|
if (res.data.status == 'success' && res.data.result == 'ok') {
|
|
if (res.data.status == 'success' && res.data.result == 'ok') {
|
|
- let validLocation = api.isTest ? true : false;
|
|
|
|
- this.setData({
|
|
|
|
- is_btn_disabled: !validLocation
|
|
|
|
- })
|
|
|
|
|
|
+ validLocation = true;
|
|
|
|
+ } else {
|
|
|
|
+ validLocation = api.isTest ? true : false;
|
|
|
|
+ }
|
|
|
|
+ this.setData({
|
|
|
|
+ is_btn_disabled: !validLocation
|
|
|
|
+ })
|
|
|
|
+ if(validLocation) {
|
|
|
|
+ var start_time = wx.getStorageSync('check_card_start_time')
|
|
|
|
+ if(start_time) {
|
|
|
|
+ this.setData({
|
|
|
|
+ startTime: start_time,
|
|
|
|
+ isLearning: true
|
|
|
|
+ })
|
|
|
|
+ this.startClock()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
});
|
|
@@ -145,9 +157,10 @@ Page({
|
|
success: res => {
|
|
success: res => {
|
|
let validLocation = false;
|
|
let validLocation = false;
|
|
if (res.data.status == 'success' && res.data.result == 'ok') {
|
|
if (res.data.status == 'success' && res.data.result == 'ok') {
|
|
|
|
+ validLocation = true;
|
|
|
|
+ } else {
|
|
validLocation = api.isTest ? true : false;
|
|
validLocation = api.isTest ? true : false;
|
|
}
|
|
}
|
|
- validLocation = api.isTest ? true : false;
|
|
|
|
this.setData({
|
|
this.setData({
|
|
is_btn_disabled: !validLocation
|
|
is_btn_disabled: !validLocation
|
|
})
|
|
})
|
|
@@ -202,9 +215,11 @@ Page({
|
|
success: res => {
|
|
success: res => {
|
|
if (res.data.status == 'success') {
|
|
if (res.data.status == 'success') {
|
|
wx.setStorageSync('check_card_id', res.data.check_card_id)
|
|
wx.setStorageSync('check_card_id', res.data.check_card_id)
|
|
|
|
+ var start_time = new Date().getTime()
|
|
|
|
+ wx.setStorageSync('check_card_start_time', start_time)
|
|
that.setData({
|
|
that.setData({
|
|
isLearning: !isLearning,
|
|
isLearning: !isLearning,
|
|
- startTime: new Date().getTime()
|
|
|
|
|
|
+ startTime: start_time
|
|
})
|
|
})
|
|
that.startClock()
|
|
that.startClock()
|
|
} else {
|
|
} else {
|
|
@@ -248,6 +263,7 @@ Page({
|
|
isLearning: false,
|
|
isLearning: false,
|
|
showPopup: true
|
|
showPopup: true
|
|
})
|
|
})
|
|
|
|
+ wx.setStorageSync('check_card_start_time', '')
|
|
const ctx = wx.createCanvasContext('shareCanvas')
|
|
const ctx = wx.createCanvasContext('shareCanvas')
|
|
let width = this.data.shareCanvasWidth
|
|
let width = this.data.shareCanvasWidth
|
|
let height = this.data.shareCanvasHeight
|
|
let height = this.data.shareCanvasHeight
|