|
@@ -161,6 +161,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
memberId: null,
|
|
memberId: null,
|
|
|
|
|
+ taskId: null,
|
|
|
isSelfCheckin: false,
|
|
isSelfCheckin: false,
|
|
|
submitting: false,
|
|
submitting: false,
|
|
|
pendingSubmit: false,
|
|
pendingSubmit: false,
|
|
@@ -206,7 +207,8 @@ export default {
|
|
|
return '录音 ' + this.recordSeconds + '秒'
|
|
return '录音 ' + this.recordSeconds + '秒'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- onLoad: function() {
|
|
|
|
|
|
|
+ onLoad: function(options) {
|
|
|
|
|
+ this.taskId = options.taskId || null
|
|
|
this.todayText = this.getToday()
|
|
this.todayText = this.getToday()
|
|
|
var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
|
|
var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
|
|
|
if (role !== 'child') {
|
|
if (role !== 'child') {
|
|
@@ -445,6 +447,7 @@ export default {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
data: {
|
|
data: {
|
|
|
memberId: self.memberId,
|
|
memberId: self.memberId,
|
|
|
|
|
+ taskId: self.taskId || undefined,
|
|
|
exerciseType: self.form.exerciseType,
|
|
exerciseType: self.form.exerciseType,
|
|
|
durationMinutes: self.form.durationMinutes ? parseInt(self.form.durationMinutes) : null,
|
|
durationMinutes: self.form.durationMinutes ? parseInt(self.form.durationMinutes) : null,
|
|
|
intensity: self.form.intensity,
|
|
intensity: self.form.intensity,
|
|
@@ -458,7 +461,7 @@ export default {
|
|
|
header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
|
|
header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
|
|
|
success: function(res) {
|
|
success: function(res) {
|
|
|
if (res.data && res.data.code === 200) {
|
|
if (res.data && res.data.code === 200) {
|
|
|
- uni.showToast({ title: '打卡成功', icon: 'success' })
|
|
|
|
|
|
|
+ uni.showToast({ title: self.taskId ? '打卡成功,任务已完成' : '打卡成功', icon: 'success' })
|
|
|
self.syncedStepText = ''
|
|
self.syncedStepText = ''
|
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|