Commit e1641e6d authored by 张杰's avatar 张杰

no message

parent 1b1d6f24
......@@ -26,11 +26,11 @@ module.exports = {
return request.get('/wxsite/teacher/getAllStudent.do', params)
},
// 签到接口
signIn(teacherId, classId, studentIds) {
signIn(teacherId, classId, signStudents) {
var params = {
teacherId: teacherId,
classId: classId,
studentIds: studentIds
signStudents: signStudents
}
return request.post('/wxsite/teacher/signin.do', params)
},
......
......@@ -20,7 +20,7 @@ Page({
'selected': false
},
{
'value': 'WC',
'value': '大小便',
'code': 'wc',
'selected': false
},
......@@ -28,7 +28,7 @@ Page({
clazz: [],
studentIds: [],
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: [],
typeIndex: 0,
inputModel: [
......@@ -243,7 +243,7 @@ Page({
var poo = '0'
var diaper = '0'
item.cellType = 'select'
item.cellOptions = ['pee', 'poo', 'diaper']
item.cellOptions = ['小便', '大便', '尿不湿']
for (var j = 0; j < item.recordItems.length; j++) {
var r = item.recordItems[j]
if (r.recordType == 'wc_pee') {
......@@ -255,7 +255,7 @@ Page({
}
console.log('pee ' + pee + ' poo ' + poo + ' diaper ' + diaper)
}
let wcString = 'pee ' + pee + '次 poo ' + poo + '次 diaper ' + diaper + '次'
let wcString = '小便 ' + pee + '次 大便 ' + poo + '次 尿不湿 ' + diaper + '次'
item.wcString = wcString
}
......@@ -272,16 +272,22 @@ Page({
let optionIndex = e.currentTarget.dataset.optionindex
let cellIndex = e.currentTarget.dataset.cellindex
let records = this.getCurrentRecord()
var item = records[cellIndex].recordItems[0]
let selectIndex = e.currentTarget.dataset.optionindex
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 {
item.optionIndex = e.currentTarget.dataset.optionindex
if (item.optionIndex == selectIndex) {
item.optionIndex = null
}else{
item.optionIndex = selectIndex
}
}
if (this.data.controlIndex == 0) {
this.setData({
eatRecord: records
......
......@@ -43,7 +43,7 @@
<image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image>
</view>
</view>
<view wx:if="{{pictureUrl.length < 3}}">
<view wx:if="{{pictureUrl.length < 2}}">
<!-- 添加图片按钮 -->
<view class='add_picture_view' bindtap='addPicture'>
<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 @@
</view>
<!-- 行为 -->
<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:'wc',text:item.wcCount }}"> </template>
</view>
......
......@@ -20,9 +20,18 @@ Page({
let classId = options.classId
req.getAllStudent(classId).then(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({
records: res,
classId:classId
selectTags: this.data.selectTags,
classId: classId
})
})
......@@ -47,9 +56,15 @@ Page({
var studentIds = []
for (var i = 0; i < records.length; 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)
......@@ -63,7 +78,13 @@ Page({
delta: 1
})
}, 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 @@
<view wx:for="{{records}}">
<view class='home-student-info' bindtap='tapCell' data-index='{{index}}'>
<!-- 名字 -->
<view class='home-student-name'>
<view class='kg-text-normal-dark'>{{item.signStudentName}}</view>
<template is="sex" data="{{sex:item.signStudentSex == '0' ? 'male' : 'female'}}"></template>
<view class='kg-flex-row' style='margin-right:30rpx;'>
<view class='home-student-name'>
<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 class='home-student-picture-item'>
<!-- <view class='home-student-picture-item'>
<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 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>
......
{
"navigationBarTitleText": "手机号登录"
"navigationBarTitleText": "比来时光"
}
\ No newline at end of file
......@@ -87,6 +87,6 @@ sex:性别 f/m (女性/男性)
<template name='imgTextView'>
<view class='kg-flex-row' style='justify-content: flex-start;height:60rpx;'>
<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>
</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