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
db4c9cf8
Commit
db4c9cf8
authored
6 years ago
by
张杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
饮食
parent
70bc625d
master
1.0.1
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
125 additions
and
49 deletions
+125
-49
app.json
app.json
+2
-2
index.js
pages/add_record/index.js
+37
-1
index.wxml
pages/add_record/index.wxml
+16
-3
index.wxss
pages/add_record/index.wxss
+67
-38
index.wxss
pages/home/teacher/index.wxss
+2
-3
cancel.png
src/img/cancel.png
+0
-0
take_photo.png
src/img/take_photo.png
+0
-0
index.wxml
template/operate_btn/index.wxml
+1
-2
No files found.
app.json
View file @
db4c9cf8
{
"pages"
:[
"pages/home/teacher/index"
,
"pages/add_record/index"
,
"pages/home/teacher/index"
,
"pages/home/reviewer/index"
,
"pages/home/parents/index"
...
...
This diff is collapsed.
Click to expand it.
pages/add_record/index.js
View file @
db4c9cf8
...
...
@@ -17,8 +17,44 @@ Page({
selectIndex
:
0
,
inputModel
:
[
]
],
selectPic
:
[]
},
//添加图片
addPicture
:
function
(
e
)
{
var
that
=
this
;
// 选择图片
wx
.
chooseImage
({
sizeType
:
[
'original'
,
'compressed'
],
// 可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'album'
,
'camera'
],
// 可以指定来源是相册还是相机,默认二者都有
success
:
function
(
res
)
{
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
for
(
var
i
in
res
.
tempFilePaths
)
{
that
.
data
.
selectPic
.
push
(
res
.
tempFilePaths
[
i
])
}
that
.
setData
({
selectPic
:
that
.
data
.
selectPic
});
}
})
},
previewPic
:
function
(
e
)
{
var
current
=
this
.
data
.
selectPic
[
e
.
target
.
dataset
.
index
]
wx
.
previewImage
({
current
:
current
,
urls
:
this
.
data
.
selectPic
})
},
//删除图片
deleteImg
:
function
(
e
)
{
var
that
=
this
that
.
data
.
selectPic
.
splice
(
e
.
currentTarget
.
dataset
.
index
,
1
)
that
.
setData
({
selectPic
:
that
.
data
.
selectPic
})
},
tapCategory
:
function
(
e
)
{
...
...
This diff is collapsed.
Click to expand it.
pages/add_record/index.wxml
View file @
db4c9cf8
<!-- pages/add_record/index.wxml -->
<import src='/template/operate_btn/index.wxml'></import>
<view class='kg-separater ' style='height:2rpx;'></view>
<view class="segmentedControl">
<!-- 循环遍历 -->
...
...
@@ -17,7 +15,9 @@
<!-- 分类选项 -->
<view class="category">
<view wx:for="{{categorys}}">
<view class="eat_category_btn {{selectIndex == index ? 'selected' : ''}}" bindtap='tapCategory' data-index='{{index}}'>{{item}}</view>
<view class="eat_category_btn {{selectIndex == index ? 'selected' : ''}}" bindtap='tapCategory' data-index='{{index}}'>
{{item}}
</view>
</view>
</view>
<view class='kg-separater'></view>
...
...
@@ -29,6 +29,19 @@
</view>
<view class='kg-separater'></view>
<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 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 class='add_picture_view' bindtap='addPicture'>
<image src='/src/img/take_photo.png' class='add_picture'></image>
</view>
</view>
</scroll-view>
</view>
<view hidden='{{controlIndex != 1}}'>睡觉</view>
...
...
This diff is collapsed.
Click to expand it.
pages/add_record/index.wxss
View file @
db4c9cf8
/* pages/add_record/index.wxss */
@import "../home/teacher/index.wxss"
/*LXSegmentedControl容器*/
.segmentedControl {
/*水平居中*/
margin: 10px auto;
/*边框为2px 主色调为蓝*/
border: 1px solid #f9aa76;
/*圆角6px*/
border-radius: 6px;
/*控件宽度*/
width: calc(100vw - 20px);
/*控件高度*/
height: 30px;
/*水平居中*/
margin: 10px auto;
/*边框为2px 主色调为蓝*/
border: 1px solid #f9aa76;
/*圆角6px*/
border-radius: 6px;
/*控件宽度*/
width: calc(100vw - 20px);
/*控件高度*/
height: 30px;
}
/*普通文本*/
.segmentedControl text {
/*水平排列*/
float: left;
/*宽度为控件宽度的1/3 再减去2px的右边框*/
width: calc((100vw - 20px) / 3 - 1px);
/*字体大小*/
font-size: 14px;
/*主色调*/
color: #f9aa76;
/*行高,与控件高度相等*/
line-height: 30px;
/*文本水平居中*/
text-align: center;
/*右边距*/
border-right: 1px solid #f9aa76;
/*水平排列*/
float: left;
/*宽度为控件宽度的1/3 再减去2px的右边框*/
width: calc((100vw - 20px) / 3 - 1px);
/*字体大小*/
font-size: 14px;
/*主色调*/
color: #f9aa76;
/*行高,与控件高度相等*/
line-height: 30px;
/*文本水平居中*/
text-align: center;
/*右边距*/
border-right: 1px solid #f9aa76;
}
/*选中状态文本*/
.segmentedControl text.selected {
/*同主色调*/
background-color: #f9aa76;
/*前景色为白色*/
color: white;
/*同主色调*/
background-color: #f9aa76;
/*前景色为白色*/
color: white;
}
/*最后一个分组按钮*/
.segmentedControl text.last {
/*不必右边框*/
border-right: 0;
/*高度也不必减少2px,就是控件高度的1/3*/
width: calc((100vw - 20px) / 3);
/*不必右边框*/
border-right: 0;
/*高度也不必减少2px,就是控件高度的1/3*/
width: calc((100vw - 20px) / 3);
}
.category {
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 20rpx 20rpx 0rpx;
margin-right: -40rpx;
justify-content: flex-start;
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 20rpx 20rpx 0rpx;
margin-right: -40rpx;
justify-content: flex-start;
}
.add_picture_view {
position: relative;
width: calc(100vw / 4 + 30rpx);
height: calc(100vw / 4 + 30rpx);
margin-right: 30rpx;
}
.add_picture {
border-width: 1rxp;
position: absolute;
left: 0rpx;
bottom: 0rpx;
width: calc(100vw / 4);
height: calc(100vw / 4);
}
.delete {
position: absolute;
/* background:#ccc; */
opacity: 1;
top: 0rpx;
right: 0rpx;
width: 60rpx;
height: 60rpx;
}
This diff is collapsed.
Click to expand it.
pages/home/teacher/index.wxss
View file @
db4c9cf8
/* pages/home/teacher/index.wxss */
.home-header {
height: 180rpx;
/* background-color: rgb(182, 179, 179); */
...
...
@@ -82,12 +83,10 @@
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.home-student-picture {
width:calc(100vw / 4.5);
height:calc(100vw / 4.5);
margin-left:20rpx
margin-left:20rpx;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/img/cancel.png
0 → 100644
View file @
db4c9cf8
3.43 KB
This diff is collapsed.
Click to expand it.
src/img/take_photo.png
0 → 100644
View file @
db4c9cf8
5.38 KB
This diff is collapsed.
Click to expand it.
template/operate_btn/index.wxml
View file @
db4c9cf8
<!--template/operate_btn/index.wxml-->
<template name="operate_btn">
<view style='position:fixed;bottom: 0rpx;height:140rpx;'>
<view style='position:fixed;bottom: 0rpx;height:140rpx;
background-color:white;
'>
<view class='kg-separater' style='height:4rpx;'></view>
<view class='kg-operate-btn-bg'>
<button class='kg-operate-btn kg-btn-no-border' bindtap='operateTap'>{{title}}</button>
</view>
</view>
</template>
<!--通用的分区标题-->
...
...
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