Commit e1641e6d authored by 张杰's avatar 张杰

no message

parent 1b1d6f24
...@@ -26,11 +26,11 @@ module.exports = { ...@@ -26,11 +26,11 @@ module.exports = {
return request.get('/wxsite/teacher/getAllStudent.do', params) return request.get('/wxsite/teacher/getAllStudent.do', params)
}, },
// 签到接口 // 签到接口
signIn(teacherId, classId, studentIds) { signIn(teacherId, classId, signStudents) {
var params = { var params = {
teacherId: teacherId, teacherId: teacherId,
classId: classId, classId: classId,
studentIds: studentIds signStudents: signStudents
} }
return request.post('/wxsite/teacher/signin.do', params) return request.post('/wxsite/teacher/signin.do', params)
}, },
......
...@@ -20,7 +20,7 @@ Page({ ...@@ -20,7 +20,7 @@ Page({
'selected': false 'selected': false
}, },
{ {
'value': 'WC', 'value': '大小便',
'code': 'wc', 'code': 'wc',
'selected': false 'selected': false
}, },
...@@ -28,7 +28,7 @@ Page({ ...@@ -28,7 +28,7 @@ Page({
clazz: [], clazz: [],
studentIds: [], studentIds: [],
controlIndex: 0, controlIndex: 0,
categoryCode: ['diet_morning', 'diet_afternoon', 'diet_evening', 'diet_morning_more', 'diet_afternoon_more', 'diet_water', 'diet_milk'], categoryCode: ['diet_morning', 'diet_morning_more', 'diet_afternoon', 'diet_afternoon_more', 'diet_evening'],//, 'diet_water', 'diet_milk'
categorys: [], categorys: [],
typeIndex: 0, typeIndex: 0,
inputModel: [ inputModel: [
...@@ -243,7 +243,7 @@ Page({ ...@@ -243,7 +243,7 @@ Page({
var poo = '0' var poo = '0'
var diaper = '0' var diaper = '0'
item.cellType = 'select' item.cellType = 'select'
item.cellOptions = ['pee', 'poo', 'diaper'] item.cellOptions = ['小便', '大便', '尿不湿']
for (var j = 0; j < item.recordItems.length; j++) { for (var j = 0; j < item.recordItems.length; j++) {
var r = item.recordItems[j] var r = item.recordItems[j]
if (r.recordType == 'wc_pee') { if (r.recordType == 'wc_pee') {
...@@ -255,7 +255,7 @@ Page({ ...@@ -255,7 +255,7 @@ Page({
} }
console.log('pee ' + pee + ' poo ' + poo + ' diaper ' + diaper) console.log('pee ' + pee + ' poo ' + poo + ' diaper ' + diaper)
} }
let wcString = 'pee ' + pee + '次 poo ' + poo + '次 diaper ' + diaper + '次' let wcString = '小便 ' + pee + '次 大便 ' + poo + '次 尿不湿 ' + diaper + '次'
item.wcString = wcString item.wcString = wcString
} }
...@@ -272,16 +272,22 @@ Page({ ...@@ -272,16 +272,22 @@ Page({
let optionIndex = e.currentTarget.dataset.optionindex let optionIndex = e.currentTarget.dataset.optionindex
let cellIndex = e.currentTarget.dataset.cellindex let cellIndex = e.currentTarget.dataset.cellindex
let records = this.getCurrentRecord() let records = this.getCurrentRecord()
var item = records[cellIndex].recordItems[0] var item = records[cellIndex].recordItems[0]
let selectIndex = e.currentTarget.dataset.optionindex
if (this.data.controlIndex == 2) { if (this.data.controlIndex == 2) {
records[cellIndex].optionIndex = e.currentTarget.dataset.optionindex if (records[cellIndex].optionIndex == selectIndex) {
records[cellIndex].optionIndex = null
}else{
records[cellIndex].optionIndex = selectIndex
}
} else { } else {
item.optionIndex = e.currentTarget.dataset.optionindex if (item.optionIndex == selectIndex) {
item.optionIndex = null
}else{
item.optionIndex = selectIndex
}
} }
if (this.data.controlIndex == 0) { if (this.data.controlIndex == 0) {
this.setData({ this.setData({
eatRecord: records eatRecord: records
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image> <image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image>
</view> </view>
</view> </view>
<view wx:if="{{pictureUrl.length < 3}}"> <view wx:if="{{pictureUrl.length < 2}}">
<!-- 添加图片按钮 --> <!-- 添加图片按钮 -->
<view class='add_picture_view' bindtap='addPicture'> <view class='add_picture_view' bindtap='addPicture'>
<image src='/src/img/take_photo.png' class='add_picture'></image> <image src='/src/img/take_photo.png' class='add_picture'></image>
......
{} {
\ No newline at end of file "navigationBarTitleText": "首页"
}
\ No newline at end of file
{} {
\ No newline at end of file "navigationBarTitleText": "首页"
}
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</view> </view>
<!-- 行为 --> <!-- 行为 -->
<view class='home-student-name' style='justify-content: space-between;margin:0rpx 30rpx;'> <view class='home-student-name' style='justify-content: space-between;margin:0rpx 30rpx;'>
<template is='imgTextView' data="{{img:'eat',text:item.eatCount }}"> </template> <template is='imgTextView' data="{{img:'eat',text:item.eatCount ? item.eatCount : 0}}"> </template>
<template is='imgTextView' data="{{img:'sleep',text:item.sleepTotal }}"> </template> <template is='imgTextView' data="{{img:'sleep',text:item.sleepTotal }}"> </template>
<template is='imgTextView' data="{{img:'wc',text:item.wcCount }}"> </template> <template is='imgTextView' data="{{img:'wc',text:item.wcCount }}"> </template>
</view> </view>
......
...@@ -20,9 +20,18 @@ Page({ ...@@ -20,9 +20,18 @@ Page({
let classId = options.classId let classId = options.classId
req.getAllStudent(classId).then(res => { req.getAllStudent(classId).then(res => {
console.log(res) console.log(res)
for (var i = 0; i < res.length; i++) {
var record = res[i]
//存在签到id,说明已经签到过,自动打勾
if (record.signSummaryId) {
this.data.selectTags[i] = true
}
}
this.setData({ this.setData({
records: res, records: res,
classId:classId selectTags: this.data.selectTags,
classId: classId
}) })
}) })
...@@ -47,9 +56,15 @@ Page({ ...@@ -47,9 +56,15 @@ Page({
var studentIds = [] var studentIds = []
for (var i = 0; i < records.length; i++) { for (var i = 0; i < records.length; i++) {
let item = records[i] let item = records[i]
if (this.data.selectTags[i]) {
studentIds.push(item.id) let student = {
"studentId": item.id,
"signSummaryId": item.signSummaryId,
"signState": this.data.selectTags[i] ? 0 : 1//签到状态:0:签到 1:取消签到
} }
studentIds.push(student)
} }
console.log(studentIds) console.log(studentIds)
...@@ -63,7 +78,13 @@ Page({ ...@@ -63,7 +78,13 @@ Page({
delta: 1 delta: 1
}) })
}, 1500) }, 1500)
}) }).catch(function (err) {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
});
});
}, },
/** /**
......
{} {
\ No newline at end of file "navigationBarTitleText": "首页"
}
\ No newline at end of file
...@@ -15,16 +15,20 @@ ...@@ -15,16 +15,20 @@
<view wx:for="{{records}}"> <view wx:for="{{records}}">
<view class='home-student-info' bindtap='tapCell' data-index='{{index}}'> <view class='home-student-info' bindtap='tapCell' data-index='{{index}}'>
<!-- 名字 --> <!-- 名字 -->
<view class='home-student-name'> <view class='kg-flex-row' style='margin-right:30rpx;'>
<view class='kg-text-normal-dark'>{{item.signStudentName}}</view> <view class='home-student-name'>
<template is="sex" data="{{sex:item.signStudentSex == '0' ? 'male' : 'female'}}"></template> <view class='kg-text-normal-dark'>{{item.signStudentName}}</view>
<template is="sex" data="{{sex:item.signStudentSex == '0' ? 'male' : 'female'}}"></template>
</view>
<template is='imgTextView' data="{{img:'zhaopian',text:item.arrIds.length}}"></template>
</view> </view>
<!-- 图片 --> <!-- 图片 -->
<view class='home-student-picture-item'> <!-- <view class='home-student-picture-item'>
<view wx:for="{{item.arrPic}}" wx:for-item="picItem" wx:for-index="picIndex"> <view wx:for="{{item.arrPic}}" wx:for-item="picItem" wx:for-index="picIndex">
<image src='{{picItem}}' class='home-student-picture' catchtap='previewPic' data-index='{{index}}' data-picIndex='{{picIndex}}' mode='aspectFill'></image> <image src='{{picItem}}' class='home-student-picture' catchtap='previewPic' data-index='{{index}}' data-picIndex='{{picIndex}}' mode='aspectFill'></image>
</view> </view>
</view> </view> -->
<!-- 行为 --> <!-- 行为 -->
<view class='home-student-name' style='justify-content: space-between;margin:0rpx 30rpx;'> <view class='home-student-name' style='justify-content: space-between;margin:0rpx 30rpx;'>
<template is='imgTextView' data="{{img:'eat',text:(item.eatCount ? item.eatCount : '0')}}"> </template> <template is='imgTextView' data="{{img:'eat',text:(item.eatCount ? item.eatCount : '0')}}"> </template>
......
{ {
"navigationBarTitleText": "手机号登录" "navigationBarTitleText": "比来时光"
} }
\ No newline at end of file
...@@ -87,6 +87,6 @@ sex:性别 f/m (女性/男性) ...@@ -87,6 +87,6 @@ sex:性别 f/m (女性/男性)
<template name='imgTextView'> <template name='imgTextView'>
<view class='kg-flex-row' style='justify-content: flex-start;height:60rpx;'> <view class='kg-flex-row' style='justify-content: flex-start;height:60rpx;'>
<image src='/src/img/{{img}}.png' style='width: 50rpx;height: 40rpx;'></image> <image src='/src/img/{{img}}.png' style='width: 50rpx;height: 40rpx;'></image>
<text class='kg-text-normal-dark' style='margin-left:10rpx'>{{text ? text : ""}}</text> <text class='kg-text-normal-dark' style='margin-left:10rpx'>{{text != null ? text : ""}}</text>
</view> </view>
</template> </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