Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
Kindergarten
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Kindergarten
Commits
57d52cbb
Commit
57d52cbb
authored
6 years ago
by
张杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
7ddf710a
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
123 additions
and
72 deletions
+123
-72
request.js
api/request.js
+7
-7
teacher.js
api/teacher.js
+17
-1
index.js
pages/add_record/index.js
+28
-16
index.wxml
pages/add_record/index.wxml
+4
-1
index.js
pages/home/reviewer/index.js
+14
-30
index.wxml
pages/home/reviewer/index.wxml
+2
-2
index.js
pages/home/teacher/index.js
+22
-2
index.wxml
pages/home/teacher/index.wxml
+5
-5
index.js
pages/login/index.js
+16
-2
index.wxml
pages/login/index.wxml
+7
-5
util.js
utils/util.js
+1
-1
No files found.
api/request.js
View file @
57d52cbb
...
...
@@ -14,8 +14,8 @@ var DEF_APP_CONFIG = {
domain
:
'http://dev.gomoretech.com/preschool-test'
,
baseUrl
:
"http://dev.gomoretech.com/preschool-test"
// 川哥本地环境
// domain: 'http://192.168.1
.1
30:8080/preschool',
// baseUrl: "http://192.168.1
.1
30:8080/preschool",
// domain: 'http://192.168.1
99.2
30:8080/preschool',
// baseUrl: "http://192.168.1
99.2
30:8080/preschool",
// 谢贝本地环境
// domain: 'http://192.168.199.153:9090',
// baseUrl: "http://192.168.199.153:9090/wxmall/wxsite"
...
...
@@ -91,11 +91,11 @@ module.exports.request = function (url, method = 'GET', data = {},
// 如果成功,直接返回
if
(
userData
.
obj
==
null
)
{
wx
.
hideLoading
()
//
wx.showToast({
//
title: userData.msg,
//
icon: 'none',
//
duration: 2000
//
})
wx
.
showToast
({
title
:
userData
.
msg
,
icon
:
'none'
,
duration
:
2000
})
resolve
(
userData
.
msg
)
}
else
{
resolve
(
userData
.
obj
);
...
...
This diff is collapsed.
Click to expand it.
api/teacher.js
View file @
57d52cbb
...
...
@@ -10,6 +10,14 @@ module.exports = {
return
request
.
get
(
'/wxsite/teacher/querySignSummary.do'
,
params
)
},
// 审核老师当天签到记录
querySignSummaryByClass
(
classId
)
{
var
params
=
{
classId
:
classId
}
return
request
.
get
(
'/wxsite/teacher/querySignSummaryByClassId.do'
,
params
)
},
// 获取所有学生
getAllStudent
(
classId
)
{
var
params
=
{
...
...
@@ -51,10 +59,18 @@ module.exports = {
return
request
.
post
(
'/wxsite/teacher/auditSignSummary.do?signSummaryId='
+
signSummaryId
)
},
// 添加、修改记录明细
setRecord
(
recordList
)
{
setRecord
(
signSummaryId
,
recordList
,
pictureIds
)
{
var
params
=
{
recordList
:
recordList
}
if
(
signSummaryId
!=
null
)
{
params
.
pictureList
=
[{
signSummaryId
:
signSummaryId
,
pictures
:
pictureIds
.
join
(
','
)
}]
}
return
request
.
post
(
'/wxsite/teacher/setRecord.do'
,
params
)
}
...
...
This diff is collapsed.
Click to expand it.
pages/add_record/index.js
View file @
57d52cbb
...
...
@@ -46,8 +46,8 @@ Page({
sleepRecord
:
[],
wcRecord
:
[],
hidePhoto
:
false
,
pictureId
:
[],
pictureUrl
:
[]
pictureId
s
:
[],
pictureUrl
:
[],
},
...
...
@@ -77,15 +77,17 @@ Page({
success
(
res
)
{
const
resData
=
JSON
.
parse
(
res
.
data
)
// 获取服务端图片id
that
.
data
.
pictureId
.
push
(
resData
.
obj
)
that
.
data
.
pictureId
s
.
push
(
resData
.
obj
)
that
.
data
.
pictureUrl
.
push
(
utils
.
handleImgShow
(
resData
.
obj
))
if
(
resData
.
obj
)
{
that
.
setData
({
pictureId
:
that
.
data
.
pictureId
,
pictureId
s
:
that
.
data
.
pictureIds
,
pictureUrl
:
that
.
data
.
pictureUrl
})
}
else
{
throw
new
Error
({
msg
:
'图片上传失败'
})
throw
new
Error
({
msg
:
'图片上传失败'
})
}
},
fail
(
err
)
{
...
...
@@ -112,8 +114,12 @@ Page({
deleteImg
:
function
(
e
)
{
var
that
=
this
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
({
selectPic
:
that
.
data
.
selectPic
selectPic
:
that
.
data
.
selectPic
,
pictureIds
:
that
.
data
.
pictureIds
,
pictureUrl
:
that
.
data
.
pictureUrl
})
},
//选择小分类
...
...
@@ -198,13 +204,6 @@ Page({
break
}
// if (r.recordCategory == 'wc') {
// r.cellType = 'select'
// r.cellOptions = ['pee', 'poo', 'diaper']
// break
// }
if
(
r
.
recordType
==
'diet_milk'
)
{
r
.
cellType
=
'input'
r
.
cellUnit
=
'毫升'
...
...
@@ -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
({
title
:
'保存成功~'
,
duration
:
1500
...
...
@@ -403,13 +407,21 @@ Page({
setTimeout
(()
=>
{
this
.
getRecord
()
},
1500
)
})
},
onLoad
:
function
(
options
)
{
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
)
{
this
.
setData
({
hidePhoto
:
true
...
...
This diff is collapsed.
Click to expand it.
pages/add_record/index.wxml
View file @
57d52cbb
...
...
@@ -37,16 +37,19 @@
<template is="section_header" data="{{title:'今日拍照'}}"></template>
<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'>
<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>
</view>
</view>
<view wx:if="{{pictureUrl.length < 3}}">
<!-- 添加图片按钮 -->
<view class='add_picture_view' bindtap='addPicture'>
<image src='/src/img/take_photo.png' class='add_picture'></image>
</view>
</view>
</view>
</view>
...
...
This diff is collapsed.
Click to expand it.
pages/home/reviewer/index.js
View file @
57d52cbb
// pages/home/reviewer/index.js
const
request
=
require
(
'../../../api/teacher.js'
)
const
app
=
getApp
()
Page
({
/**
...
...
@@ -7,35 +8,11 @@ Page({
*/
data
:
{
selectIndex
:
0
,
classList
:
[{
"id"
:
"4028048267a5969b0167a5b22f3807f8"
,
"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"
,
teacherId
:
""
,
classList
:
[],
classId
:
""
,
records
:
[]
records
:
[],
},
tapClass
:
function
(
e
)
{
...
...
@@ -54,7 +31,7 @@ Page({
},
querySignSummary
:
function
()
{
request
.
querySignSummary
(
this
.
data
.
teacherId
,
this
.
data
.
classId
).
then
(
res
=>
{
request
.
querySignSummary
ByClass
(
this
.
data
.
classId
).
then
(
res
=>
{
console
.
log
(
res
)
for
(
var
i
=
0
;
i
<
res
.
length
;
i
++
)
{
var
item
=
res
[
i
]
...
...
@@ -76,7 +53,14 @@ Page({
* 生命周期函数--监听页面加载
*/
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
.
querySignSummary
()
...
...
This diff is collapsed.
Click to expand it.
pages/home/reviewer/index.wxml
View file @
57d52cbb
...
...
@@ -3,7 +3,7 @@
<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:'male
'}}"></template>
<template is='userInfo' data="{{userImg:'/src/img/defaut_teacher_icon.png',title:
reviewerName,subTitle:kindergarten,sex:'
'}}"></template>
<view></view>
</view>
<view class='kg-separater'></view>
...
...
@@ -14,7 +14,7 @@
<view class="category">
<view wx:for="{{classList}}" wx:key="id" id="{{item.id}}" bindtap='tapClass'>
<view class="eat_category_btn {{selectIndex == index ? 'selected' : ''}}" data-index='{{index}}'>
{{item.name}}
{{item.
depart
name}}
</view>
</view>
</view>
...
...
This diff is collapsed.
Click to expand it.
pages/home/teacher/index.js
View file @
57d52cbb
...
...
@@ -11,14 +11,17 @@ Page({
signIcon
:
"/src/img/signin.png"
,
userIcon
:
"/src/img/defaut_teacher_icon.png"
,
records
:
[],
userName
:
''
,
subTitle
:
'共20人'
},
tapCell
:
function
(
e
)
{
console
.
log
(
e
)
let
studentId
=
e
.
currentTarget
.
dataset
.
studentid
let
index
=
e
.
currentTarget
.
dataset
.
index
let
student
=
this
.
data
.
records
[
index
]
wx
.
navigateTo
({
url
:
'/pages/add_record/index?studentIds='
+
JSON
.
stringify
([
student
Id
]
),
url
:
'/pages/add_record/index?studentIds='
+
JSON
.
stringify
([
student
.
id
])
+
'&pictureIds='
+
JSON
.
stringify
(
student
.
arrIds
),
})
},
...
...
@@ -52,6 +55,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
setData
({
userName
:
app
.
globalData
.
login
.
user
.
userName
,
})
},
...
...
@@ -89,6 +95,20 @@ Page({
for
(
var
i
=
0
;
i
<
res
.
length
;
i
++
)
{
var
item
=
res
[
i
]
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
({
records
:
res
...
...
This diff is collapsed.
Click to expand it.
pages/home/teacher/index.wxml
View file @
57d52cbb
...
...
@@ -2,7 +2,7 @@
<import src='/template/operate_btn/index.wxml'></import>
<view class='kg-separater' style='height:2rpx;'></view>
<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'>
<image class='roll-call-image' src='{{signIcon}}'></image>
<view class='roll-call-title'>点名</view>
...
...
@@ -13,7 +13,7 @@
<scroll-view style='height:calc(100vh - 200rpx - 140rpx)' scroll-y='true'>
<template is="section_header" data="{{title:dateStr}}"></template>
<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='kg-text-normal-dark'>{{item.signStudentName}}</view>
...
...
@@ -21,9 +21,9 @@
</view>
<!-- 图片 -->
<view class='home-student-picture-item'>
<
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 wx:for="{{item.arrPic}}" wx:for-item="picItem"
>
<image src='{{picItem}}
' class='home-student-picture' mode='aspectFill'></image>
<
/view
>
</view>
<!-- 行为 -->
<view class='home-student-name' style='justify-content: space-between;margin:0rpx 30rpx;'>
...
...
This diff is collapsed.
Click to expand it.
pages/login/index.js
View file @
57d52cbb
...
...
@@ -27,7 +27,15 @@ Page({
},
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
)
app
.
globalData
.
login
=
res
//1是老师,2是家长
...
...
@@ -55,7 +63,13 @@ Page({
})
}
})
}).
catch
(
function
(
err
)
{
wx
.
showToast
({
title
:
err
.
message
,
icon
:
'none'
,
duration
:
2000
});
});
},
...
...
This diff is collapsed.
Click to expand it.
pages/login/index.wxml
View file @
57d52cbb
<!--pages/login/index.wxml-->
<import src='/template/operate_btn/index.wxml'></import>
<view style='padding:16px;'>
<view class='kg-text-normal-gray'>手机号</view>
<input placeholder='请输入手机号登录' style='margin:30rpx 0rpx;' bindinput='inputAction'></input>
<view class='kg-separater' style='height:2rpx;'></view>
<view style='padding:16px;
margin-top:50rpx;
'>
<view class='kg-text-normal-gray'>手机号</view>
<input placeholder='请输入手机号登录' style='margin:30rpx 0rpx;' bindinput='inputAction'></input>
<view class='kg-separater' style='height:2rpx;'></view>
</view>
<template is="operate_btn" data="{{title:'登录'}}"></template>
<view class='kg-operate-btn-bg'>
<button class='kg-operate-btn kg-btn-no-border' bindtap='operateTap'>登录</button>
</view>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
utils/util.js
View file @
57d52cbb
...
...
@@ -247,7 +247,7 @@ module.exports = {
* 处理后台上传的图片在前端的显示
*/
handleImgShow
(
imgId
)
{
return
`
${
request
.
DOMAIN
}
/
wxmall/
commonController.do?viewFile&fileid=
${
imgId
}
`
return
`
${
request
.
DOMAIN
}
/commonController.do?viewFile&fileid=
${
imgId
}
`
},
/**
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment