Commit 57d52cbb authored by 张杰's avatar 张杰

no message

parent 7ddf710a
...@@ -14,8 +14,8 @@ var DEF_APP_CONFIG = { ...@@ -14,8 +14,8 @@ var DEF_APP_CONFIG = {
domain: 'http://dev.gomoretech.com/preschool-test', domain: 'http://dev.gomoretech.com/preschool-test',
baseUrl: "http://dev.gomoretech.com/preschool-test" baseUrl: "http://dev.gomoretech.com/preschool-test"
// 川哥本地环境 // 川哥本地环境
// domain: 'http://192.168.1.130:8080/preschool', // domain: 'http://192.168.199.230:8080/preschool',
// baseUrl: "http://192.168.1.130:8080/preschool", // baseUrl: "http://192.168.199.230:8080/preschool",
// 谢贝本地环境 // 谢贝本地环境
// domain: 'http://192.168.199.153:9090', // domain: 'http://192.168.199.153:9090',
// baseUrl: "http://192.168.199.153:9090/wxmall/wxsite" // baseUrl: "http://192.168.199.153:9090/wxmall/wxsite"
...@@ -91,11 +91,11 @@ module.exports.request = function (url, method = 'GET', data = {}, ...@@ -91,11 +91,11 @@ module.exports.request = function (url, method = 'GET', data = {},
// 如果成功,直接返回 // 如果成功,直接返回
if (userData.obj == null) { if (userData.obj == null) {
wx.hideLoading() wx.hideLoading()
// wx.showToast({ wx.showToast({
// title: userData.msg, title: userData.msg,
// icon: 'none', icon: 'none',
// duration: 2000 duration: 2000
// }) })
resolve(userData.msg) resolve(userData.msg)
}else{ }else{
resolve(userData.obj); resolve(userData.obj);
......
...@@ -10,6 +10,14 @@ module.exports = { ...@@ -10,6 +10,14 @@ module.exports = {
return request.get('/wxsite/teacher/querySignSummary.do', params) return request.get('/wxsite/teacher/querySignSummary.do', params)
}, },
// 审核老师当天签到记录
querySignSummaryByClass(classId) {
var params = {
classId: classId
}
return request.get('/wxsite/teacher/querySignSummaryByClassId.do', params)
},
// 获取所有学生 // 获取所有学生
getAllStudent(classId) { getAllStudent(classId) {
var params = { var params = {
...@@ -51,10 +59,18 @@ module.exports = { ...@@ -51,10 +59,18 @@ module.exports = {
return request.post('/wxsite/teacher/auditSignSummary.do?signSummaryId=' + signSummaryId) return request.post('/wxsite/teacher/auditSignSummary.do?signSummaryId=' + signSummaryId)
}, },
// 添加、修改记录明细 // 添加、修改记录明细
setRecord(recordList) { setRecord(signSummaryId, recordList, pictureIds) {
var params = { var params = {
recordList: recordList recordList: recordList
} }
if (signSummaryId != null) {
params.pictureList = [{
signSummaryId: signSummaryId,
pictures: pictureIds.join(',')
}]
}
return request.post('/wxsite/teacher/setRecord.do', params) return request.post('/wxsite/teacher/setRecord.do', params)
} }
......
...@@ -46,8 +46,8 @@ Page({ ...@@ -46,8 +46,8 @@ Page({
sleepRecord: [], sleepRecord: [],
wcRecord: [], wcRecord: [],
hidePhoto: false, hidePhoto: false,
pictureId: [], pictureIds: [],
pictureUrl:[] pictureUrl: [],
}, },
...@@ -77,15 +77,17 @@ Page({ ...@@ -77,15 +77,17 @@ Page({
success(res) { success(res) {
const resData = JSON.parse(res.data) const resData = JSON.parse(res.data)
// 获取服务端图片id // 获取服务端图片id
that.data.pictureId.push(resData.obj) that.data.pictureIds.push(resData.obj)
that.data.pictureUrl.push(utils.handleImgShow(resData.obj)) that.data.pictureUrl.push(utils.handleImgShow(resData.obj))
if (resData.obj) { if (resData.obj) {
that.setData({ that.setData({
pictureId: that.data.pictureId, pictureIds: that.data.pictureIds,
pictureUrl: that.data.pictureUrl pictureUrl: that.data.pictureUrl
}) })
} else { } else {
throw new Error({ msg: '图片上传失败' }) throw new Error({
msg: '图片上传失败'
})
} }
}, },
fail(err) { fail(err) {
...@@ -112,8 +114,12 @@ Page({ ...@@ -112,8 +114,12 @@ Page({
deleteImg: function(e) { deleteImg: function(e) {
var that = this var that = this
that.data.selectPic.splice(e.currentTarget.dataset.index, 1) that.data.selectPic.splice(e.currentTarget.dataset.index, 1)
that.data.pictureIds.splice(e.currentTarget.dataset.index, 1)
that.data.pictureUrl.splice(e.currentTarget.dataset.index, 1)
that.setData({ that.setData({
selectPic: that.data.selectPic selectPic: that.data.selectPic,
pictureIds: that.data.pictureIds,
pictureUrl: that.data.pictureUrl
}) })
}, },
//选择小分类 //选择小分类
...@@ -198,13 +204,6 @@ Page({ ...@@ -198,13 +204,6 @@ Page({
break break
} }
// if (r.recordCategory == 'wc') {
// r.cellType = 'select'
// r.cellOptions = ['pee', 'poo', 'diaper']
// break
// }
if (r.recordType == 'diet_milk') { if (r.recordType == 'diet_milk') {
r.cellType = 'input' r.cellType = 'input'
r.cellUnit = '毫升' r.cellUnit = '毫升'
...@@ -395,7 +394,12 @@ Page({ ...@@ -395,7 +394,12 @@ Page({
} }
} }
req.setRecord(arrRecordList).then(res => { let signSummaryId = null
if (this.data.studentIds.length == 1) {
signSummaryId = arrRecordList[0].signSummaryId
}
req.setRecord(signSummaryId,arrRecordList,this.data.pictureIds).then(res => {
wx.showToast({ wx.showToast({
title: '保存成功~', title: '保存成功~',
duration: 1500 duration: 1500
...@@ -409,7 +413,15 @@ Page({ ...@@ -409,7 +413,15 @@ Page({
onLoad: function(options) { onLoad: function(options) {
this.data.studentIds = JSON.parse(options.studentIds) this.data.studentIds = JSON.parse(options.studentIds)
console.log(this.data.studentIds) this.data.pictureIds = JSON.parse(options.pictureIds)
for (var i = 0; i < this.data.pictureIds.length; i++) {
this.data.pictureUrl.push(utils.handleImgShow(this.data.pictureIds[i]))
}
this.setData({
pictureUrl: this.data.pictureUrl
})
console.log(this.data.pictureIds)
if (this.data.studentIds.length > 1) { if (this.data.studentIds.length > 1) {
this.setData({ this.setData({
hidePhoto: true hidePhoto: true
......
...@@ -37,17 +37,20 @@ ...@@ -37,17 +37,20 @@
<template is="section_header" data="{{title:'今日拍照'}}"></template> <template is="section_header" data="{{title:'今日拍照'}}"></template>
<view class='home-student-picture-item' style='padding-left:20rpx;padding-bottom:40rpx;'> <view class='home-student-picture-item' style='padding-left:20rpx;padding-bottom:40rpx;'>
<!-- 选择的图片 --> <!-- 选择的图片 -->
<view wx:for="{{selectPic}}"> <view wx:for="{{pictureUrl}}">
<view class='add_picture_view'> <view class='add_picture_view'>
<image src='{{item}}' class='add_picture' bindtap='previewPic' data-index='{{index}}' mode='aspectFill'></image> <image src='{{item}}' class='add_picture' bindtap='previewPic' data-index='{{index}}' mode='aspectFill'></image>
<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 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>
</view> </view>
</view> </view>
</view>
</view> </view>
</scroll-view> </scroll-view>
......
// pages/home/reviewer/index.js // pages/home/reviewer/index.js
const request = require('../../../api/teacher.js') const request = require('../../../api/teacher.js')
const app = getApp()
Page({ Page({
/** /**
...@@ -7,35 +8,11 @@ Page({ ...@@ -7,35 +8,11 @@ Page({
*/ */
data: { data: {
selectIndex: 0, selectIndex: 0,
classList: [{ teacherId: "",
"id": "4028048267a5969b0167a5b22f3807f8", classList: [],
"code": "001",
"name": "一班"
},
{
"id": "00002",
"code": "002",
"name": "二班"
},
{
"id": "00003",
"code": "003",
"name": "三班"
},
{
"id": "00004",
"code": "004",
"name": "四班"
},
{
"id": "00005",
"code": "005",
"name": "五班"
}
],
teacherId: "4028048267a65d0f0167a69ae1910058",
classId: "", classId: "",
records: [] records: [],
}, },
tapClass: function(e) { tapClass: function(e) {
...@@ -54,7 +31,7 @@ Page({ ...@@ -54,7 +31,7 @@ Page({
}, },
querySignSummary: function() { querySignSummary: function() {
request.querySignSummary(this.data.teacherId, this.data.classId).then(res => { request.querySignSummaryByClass(this.data.classId).then(res => {
console.log(res) console.log(res)
for (var i = 0; i < res.length; i++) { for (var i = 0; i < res.length; i++) {
var item = res[i] var item = res[i]
...@@ -76,7 +53,14 @@ Page({ ...@@ -76,7 +53,14 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function(options) {
if (this.data.classList.length > 0){ this.setData({
teacherId: app.globalData.login.user.id,
classList: app.globalData.login.classes,
reviewerName: app.globalData.login.user.name,
})
if (this.data.classList.length > 0) {
this.data.classId = this.data.classList[0].id this.data.classId = this.data.classList[0].id
} }
this.querySignSummary() this.querySignSummary()
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class='kg-separater' style='height:2rpx;'></view> <view class='kg-separater' style='height:2rpx;'></view>
<view class='kg-home-header kg-flex-row'> <view class='kg-home-header kg-flex-row'>
<template is='userInfo' data="{{userImg:'/src/img/defaut_teacher_icon.png',title:'审核老师',subTitle:'向日葵幼儿园',sex:'male'}}"></template> <template is='userInfo' data="{{userImg:'/src/img/defaut_teacher_icon.png',title:reviewerName,subTitle:kindergarten,sex:''}}"></template>
<view></view> <view></view>
</view> </view>
<view class='kg-separater'></view> <view class='kg-separater'></view>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<view class="category"> <view class="category">
<view wx:for="{{classList}}" wx:key="id" id="{{item.id}}" bindtap='tapClass'> <view wx:for="{{classList}}" wx:key="id" id="{{item.id}}" bindtap='tapClass'>
<view class="eat_category_btn {{selectIndex == index ? 'selected' : ''}}" data-index='{{index}}'> <view class="eat_category_btn {{selectIndex == index ? 'selected' : ''}}" data-index='{{index}}'>
{{item.name}} {{item.departname}}
</view> </view>
</view> </view>
</view> </view>
......
...@@ -11,14 +11,17 @@ Page({ ...@@ -11,14 +11,17 @@ Page({
signIcon: "/src/img/signin.png", signIcon: "/src/img/signin.png",
userIcon: "/src/img/defaut_teacher_icon.png", userIcon: "/src/img/defaut_teacher_icon.png",
records: [], records: [],
userName:'',
subTitle:'共20人'
}, },
tapCell: function(e) { tapCell: function(e) {
console.log(e) console.log(e)
let studentId = e.currentTarget.dataset.studentid let index = e.currentTarget.dataset.index
let student = this.data.records[index]
wx.navigateTo({ wx.navigateTo({
url: '/pages/add_record/index?studentIds=' + JSON.stringify([studentId]), url: '/pages/add_record/index?studentIds=' + JSON.stringify([student.id]) + '&pictureIds=' + JSON.stringify(student.arrIds),
}) })
}, },
...@@ -52,6 +55,9 @@ Page({ ...@@ -52,6 +55,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function(options) {
this.setData({
userName: app.globalData.login.user.userName,
})
}, },
...@@ -89,6 +95,20 @@ Page({ ...@@ -89,6 +95,20 @@ Page({
for (var i = 0; i < res.length; i++) { for (var i = 0; i < res.length; i++) {
var item = res[i] var item = res[i]
item.signDate = item.signDate.substr(0, 10) item.signDate = item.signDate.substr(0, 10)
var arrPic = []
let arrIds = []
if (item.picture != null && item.picture != '') {
arrIds = item.picture.split(",")
for (var j = 0; j < arrIds.length; j++) {
let id = arrIds[j]
arrPic.push(utils.handleImgShow(id))
}
}
console.log(arrPic)
item.arrIds = arrIds
item.arrPic = arrPic
} }
this.setData({ this.setData({
records: res records: res
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<import src='/template/operate_btn/index.wxml'></import> <import src='/template/operate_btn/index.wxml'></import>
<view class='kg-separater' style='height:2rpx;'></view> <view class='kg-separater' style='height:2rpx;'></view>
<view class='kg-home-header kg-flex-row'> <view class='kg-home-header kg-flex-row'>
<template is='userInfo' data="{{userImg:userIcon,title:'向日葵小班-张老师',subTitle:'共19人',sex:''}}"></template> <template is='userInfo' data="{{userImg:userIcon,title:userName,subTitle:subTitle,sex:''}}"></template>
<view class='home-header-roll-call' bindtap='signTap'> <view class='home-header-roll-call' bindtap='signTap'>
<image class='roll-call-image' src='{{signIcon}}'></image> <image class='roll-call-image' src='{{signIcon}}'></image>
<view class='roll-call-title'>点名</view> <view class='roll-call-title'>点名</view>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<scroll-view style='height:calc(100vh - 200rpx - 140rpx)' scroll-y='true'> <scroll-view style='height:calc(100vh - 200rpx - 140rpx)' scroll-y='true'>
<template is="section_header" data="{{title:dateStr}}"></template> <template is="section_header" data="{{title:dateStr}}"></template>
<view wx:for="{{records}}"> <view wx:for="{{records}}">
<view class='home-student-info' bindtap='tapCell' data-studentId='{{item.id}}'> <view class='home-student-info' bindtap='tapCell' data-index='{{index}}'>
<!-- 名字 --> <!-- 名字 -->
<view class='home-student-name'> <view class='home-student-name'>
<view class='kg-text-normal-dark'>{{item.signStudentName}}</view> <view class='kg-text-normal-dark'>{{item.signStudentName}}</view>
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
</view> </view>
<!-- 图片 --> <!-- 图片 -->
<view class='home-student-picture-item'> <view class='home-student-picture-item'>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image> <view wx:for="{{item.arrPic}}" wx:for-item="picItem">
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image> <image src='{{picItem}}' class='home-student-picture' mode='aspectFill'></image>
<image src='/src/img/student_picture.png' class='home-student-picture' mode='aspectFill'></image> </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;'>
......
...@@ -27,7 +27,15 @@ Page({ ...@@ -27,7 +27,15 @@ Page({
}, },
operateTap: function (event) { operateTap: function (event) {
request.kg_login(true, this.data.mobile).then(res=>{ let mobile = this.data.mobile
if (mobile.length == 0) {
wx.showToast({
title: '请输入手机号',
icon: 'none'
})
return
}
request.kg_login(true, mobile).then(res=>{
console.log(res) console.log(res)
app.globalData.login = res app.globalData.login = res
//1是老师,2是家长 //1是老师,2是家长
...@@ -55,7 +63,13 @@ Page({ ...@@ -55,7 +63,13 @@ Page({
}) })
} }
}) }).catch(function (err) {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
});
});
}, },
......
<!--pages/login/index.wxml--> <!--pages/login/index.wxml-->
<import src='/template/operate_btn/index.wxml'></import> <import src='/template/operate_btn/index.wxml'></import>
<view style='padding:16px;'> <view style='padding:16px;margin-top:50rpx;'>
<view class='kg-text-normal-gray'>手机号</view> <view class='kg-text-normal-gray'>手机号</view>
<input placeholder='请输入手机号登录' style='margin:30rpx 0rpx;' bindinput='inputAction'></input> <input placeholder='请输入手机号登录' style='margin:30rpx 0rpx;' bindinput='inputAction'></input>
<view class='kg-separater' style='height:2rpx;'></view> <view class='kg-separater' style='height:2rpx;'></view>
</view>
<view class='kg-operate-btn-bg'>
<button class='kg-operate-btn kg-btn-no-border' bindtap='operateTap'>登录</button>
</view> </view>
\ No newline at end of file
<template is="operate_btn" data="{{title:'登录'}}"></template>
...@@ -247,7 +247,7 @@ module.exports = { ...@@ -247,7 +247,7 @@ module.exports = {
* 处理后台上传的图片在前端的显示 * 处理后台上传的图片在前端的显示
*/ */
handleImgShow(imgId) { handleImgShow(imgId) {
return `${request.DOMAIN}/wxmall/commonController.do?viewFile&fileid=${imgId}` return `${request.DOMAIN}/commonController.do?viewFile&fileid=${imgId}`
}, },
/** /**
......
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