| xqd
@@ -81,10 +81,28 @@ Page({
|
|
|
return;
|
|
|
}
|
|
|
if (isLearning) {
|
|
|
- this.setData({
|
|
|
- isLearning: !isLearning
|
|
|
+ let check_card_id = wx.getStorageSync('check_card_id');
|
|
|
+ wx.request({
|
|
|
+ url: api.endCheckCardUrl,
|
|
|
+ method: 'GET',
|
|
|
+ data: {
|
|
|
+ 'check_card_id': check_card_id
|
|
|
+ },
|
|
|
+ success: res => {
|
|
|
+ if (res.data.status == 'success') {
|
|
|
+ that.setData({
|
|
|
+ isLearning: !isLearning
|
|
|
+ })
|
|
|
+ that.endClock()
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.data.info,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 800
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
- this.endClock()
|
|
|
} else {
|
|
|
wx.request({
|
|
|
url: api.startCheckCardUrl,
|
| xqd
@@ -94,6 +112,7 @@ Page({
|
|
|
},
|
|
|
success: res => {
|
|
|
if (res.data.status == 'success') {
|
|
|
+ wx.setStorageSync('check_card_id', res.data.check_card_id)
|
|
|
that.setData({
|
|
|
isLearning: !isLearning,
|
|
|
startTime: new Date().getTime()
|