Commit bff2c303 authored by SmileFei's avatar SmileFei

审核详情接口调试

parent a74dd480
......@@ -26,6 +26,18 @@ module.exports = {
}
return request.post('/preschool/wxsite/teacher/signin.do', params)
}
},
//根据签到表Id获取记录明细
getRecordDetailForSignId(signSummaryId) {
var params = {
signSummaryId: signSummaryId
}
return request.get('/preschool/wxsite/teacher/getRecordDetailForSignId.do', params)
},
//审核签到汇总表
auditSignSummary(signSummaryId) {
return request.post('/preschool/wxsite/teacher/auditSignSummary.do?signSummaryId=' + signSummaryId)
},
}
\ No newline at end of file
......@@ -49,7 +49,7 @@ Page({
tapStudent: function(e) {
wx.navigateTo({
url: '/pages/review_student/index',
url: '/pages/review_student/index?signSummaryId=' + e.currentTarget.id
})
},
......
// pages/review_student/index.js
const request = require('../../api/teacher.js')
Page({
/**
* 页面的初始数据
*/
data: {
signSummaryId:"",
recordDetail: {},
recordTypes: {
"diet_morning": '早餐',
"diet_afternoon": "午餐",
"diet_milk": "牛奶",
"diet_evening": "晚餐",
"diet_morning_more": "上午加餐",
"diet_afternoon_more": "下午加餐",
"diet_water": "喝水",
"diet_milk": "饮用牛奶",
"sleep_time": "睡觉时间",
"wc_pee": "小便",
"wc_poo": "便",
"wc_diaper": "换尿布"
},
eatStates: {
"less": "少",
"normal": "正常",
"more": "多"
}
},
//加载详情
getRecordDetailForSignId: function() {
request.getRecordDetailForSignId(this.data.signSummaryId).then(res => {
if (res) {
var dateStr = res.recordDate.substr(0, 10)
let show_day = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周六');
let date = new Date(dateStr);
var num = date.getDay()
res.recordDate = dateStr + " " + show_day[date.getDay()]
// 饮食
var dietRecords = res['dietRecord']
for (var j = 0; j < dietRecords.length; j++) {
var diet = dietRecords[j]
diet.z_recordType = this.data.recordTypes[diet.recordType]
diet.z_eatState = this.data.eatStates[diet.eatState]
}
// 睡觉
var sleepRecord = res.sleepRecord
for (var j = 0; j < sleepRecord.length; j++) {
var r = sleepRecord[j]
r.z_recordType = this.data.recordTypes[r.recordType]
}
// wc
var wcRecord = res.wcRecord
for (var j = 0; j < wcRecord.length; j++) {
var r = wcRecord[j]
r.z_recordType = this.data.recordTypes[r.recordType]
}
this.setData({
recordDetail: res,
})
}
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
auditSignSummary: function (signSummaryId){
console.log(signSummaryId)
request.auditSignSummary(signSummaryId).then(res => {
wx.showToast({
title: '审核成功!',
icon: 'none',
duration: 2000
})
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
operateTap: function (e) {
this.auditSignSummary(this.data.signSummaryId )
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.data.signSummaryId = options.signSummaryId;
this.getRecordDetailForSignId()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
......@@ -3,60 +3,60 @@
<view class='kg-separater' style='height:2rpx;'></view>
<view class='kg-home-header kg-flex-row'>
<template is='userInfo' data="{{userImg:'/src/img/defaut_teacher_icon.png',title:'张小华',subTitle:'向日葵小班',sex:'m'}}"></template>
<template is='userInfo' data="{{userImg:'/src/img/defaut_teacher_icon.png',title:'审核老师',subTitle:'向日葵幼儿园',sex:'m'}}"></template>
<view></view>
</view>
<view class='kg-separater'></view>
<scroll-view style='height:calc(100vh - 200rpx - 140rpx)' scroll-y='true'>
<view class='kg-quantity-cell timeline-content' style='margin-left:20rpx;margin-bottom:30rpx;'>
<view class='kg-flex-row' style='margin-bottom:20rpx;'>
<text class='kg-text-title'>2018-09-11 星期二</text>
<text class='kg-text-normal-gray'>王xx老师记录</text>
</view>
<template is='imgTextView' data="{{img:'eat',text:'饮食'}}"> </template>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>早餐</text>
<text class='kg-text-normal-gray'>正常</text>
</view>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>早餐</text>
<text class='kg-text-normal-gray'>正常</text>
<view class='kg-flex-row' style='margin-bottom:20rpx;'>
<text class='kg-text-title'>{{recordDetail.recordDate}}</text>
<text class='kg-text-normal-gray'>{{recordDetail.teacher ? recordDetail.teacher.name : ""}}记录</text>
</view>
<!-- 饮食 -->
<view wx:for="{{recordDetail.dietRecord}}" wx:for-item="dietItem" wx:for-index="dietIndex">
<view wx:if="{{dietIndex == 0}}">
<template is='imgTextView' data="{{img:'eat',text:'饮食'}}"> </template>
</view>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>早餐</text>
<text class='kg-text-normal-gray'>正常</text>
<text class='kg-text-normal-gray'>{{dietItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>{{dietItem.z_eatState}}</text>
</view>
<view class='kg-separater' style='height:2rpx;margin-left:100rpx;margin-right:0rpx;'></view>
<!-- 睡觉 -->
<template is='imgTextView' data="{{img:'sleep',text:'睡觉'}}"> </template>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>午睡</text>
<text class='kg-text-normal-gray'>50分钟</text>
</view>
<!-- 睡觉 -->
<view wx:for="{{recordDetail.sleepRecord}}" wx:for-item="sleepItem" wx:for-index="sleepIndex">
<view wx:if="{{sleepIndex == 0}}">
<view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view>
<template is='imgTextView' data="{{img:'sleep',text:'睡觉'}}"> </template>
</view>
<view class='kg-separater' style='height:2rpx;margin-left:100rpx;margin-right:0rpx;'></view>
<!-- wc -->
<template is='imgTextView' data="{{img:'wc',text:'WC'}}"> </template>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>pee</text>
<text class='kg-text-normal-gray'>4次</text>
<text class='kg-text-normal-gray'>{{sleepItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>{{sleepItem.value}}分钟</text>
</view>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>poo</text>
<text class='kg-text-normal-gray'>4次</text>
</view>
<!-- wc -->
<view wx:for="{{recordDetail.wcRecord}}" wx:for-item="wcItem" wx:for-index="wcIndex">
<view wx:if="{{wcIndex == 0}}">
<view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view>
<template is='imgTextView' data="{{img:'wc',text:'WC'}}"> </template>
</view>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>diaper</text>
<text class='kg-text-normal-gray'>4次</text>
</view>
<view class='kg-separater' style='height:2rpx;margin-left:100rpx;margin-right:0rpx;'></view>
<!-- 今日照片 -->
<template is='imgTextView' data="{{img:'today',text:'今日照片'}}"> </template>
<view class='home-student-picture-item' style='margin-left:40rpx;'>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image>
<text class='kg-text-normal-gray'>{{wcItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>{{wcItem.value}}次</text>
</view>
</view>
<!-- 今日照片 -->
<template is='imgTextView' data="{{img:'today',text:'今日照片'}}"> </template>
<view class='home-student-picture-item' style='margin-left:40rpx;'>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image>
</view>
</view>
</scroll-view>
<template is="operate_btn" data="{{title:'通过'}}"></template>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment