diff --git a/pages/review_student/index.js b/pages/review_student/index.js index db02ab2faf0b6d3fac2692a11ed1d51dbcc8536d..a66eb4129102223adfba0a2751399699642b9034 100644 --- a/pages/review_student/index.js +++ b/pages/review_student/index.js @@ -7,8 +7,9 @@ Page({ * 页é¢çš„åˆå§‹æ•°æ® */ data: { - signSummaryId:"", + signSummaryId: "", recordDetail: {}, + showAuditBtn: true, recordTypes: { "diet_morning": 'æ—©é¤', "diet_afternoon": "åˆé¤", @@ -33,6 +34,7 @@ Page({ //åŠ è½½è¯¦æƒ… getRecordDetailForSignId: function() { request.getRecordDetailForSignId(this.data.signSummaryId).then(res => { + console.log(res) if (res) { var dateStr = res.recordDate.substr(0, 10) let show_day = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周å…'); @@ -61,9 +63,13 @@ Page({ var r = wcRecord[j] r.z_recordType = this.data.recordTypes[r.recordType] } - + if (res.state == "finish") { + this.setData({ + showAuditBtn: false + }) + } this.setData({ - recordDetail: res, + recordDetail: res }) } @@ -76,9 +82,12 @@ Page({ }) }, - auditSignSummary: function (signSummaryId){ + auditSignSummary: function(signSummaryId) { console.log(signSummaryId) request.auditSignSummary(signSummaryId).then(res => { + this.setData({ + showAuditBtn: false + }) wx.showToast({ title: 'å®¡æ ¸æˆåŠŸ!', icon: 'none', @@ -94,8 +103,8 @@ Page({ }, - operateTap: function (e) { - this.auditSignSummary(this.data.signSummaryId ) + operateTap: function(e) { + this.auditSignSummary(this.data.signSummaryId) }, /** diff --git a/pages/review_student/index.wxml b/pages/review_student/index.wxml index b2e26ab35781a4272994c7bb5ee334536965c36c..01b7dd6d71a813b84a2273ac4e12fc029b4e496e 100644 --- a/pages/review_student/index.wxml +++ b/pages/review_student/index.wxml @@ -59,4 +59,4 @@ </view> </view> </scroll-view> -<template is="operate_btn" data="{{title:'通过'}}"></template> \ No newline at end of file +<template is="operate_btn" data="{{title:'通过'}}" wx:if="{{showAuditBtn}}"></template> \ No newline at end of file