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
Dec 06, 2018
by
张杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
饮食
parent
70bc625d
Show 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"
:[
"pages/home/teacher/index"
,
"pages/add_record/index"
,
"pages/add_record/index"
,
"pages/home/teacher/index"
,
"pages/home/reviewer/index"
,
"pages/home/reviewer/index"
,
"pages/home/parents/index"
"pages/home/parents/index"
...
...
pages/add_record/index.js
View file @
db4c9cf8
...
@@ -17,9 +17,45 @@ Page({
...
@@ -17,9 +17,45 @@ Page({
selectIndex
:
0
,
selectIndex
:
0
,
inputModel
:
[
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
)
{
tapCategory
:
function
(
e
)
{
...
...
pages/add_record/index.wxml
View file @
db4c9cf8
<!-- pages/add_record/index.wxml -->
<!-- pages/add_record/index.wxml -->
<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="segmentedControl">
<view class="segmentedControl">
<!-- 循环遍历 -->
<!-- 循环遍历 -->
...
@@ -17,7 +15,9 @@
...
@@ -17,7 +15,9 @@
<!-- 分类选项 -->
<!-- 分类选项 -->
<view class="category">
<view class="category">
<view wx:for="{{categorys}}">
<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>
</view>
<view class='kg-separater'></view>
<view class='kg-separater'></view>
...
@@ -29,6 +29,19 @@
...
@@ -29,6 +29,19 @@
</view>
</view>
<view class='kg-separater'></view>
<view class='kg-separater'></view>
<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 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>
</scroll-view>
</view>
</view>
<view hidden='{{controlIndex != 1}}'>睡觉</view>
<view hidden='{{controlIndex != 1}}'>睡觉</view>
...
...
pages/add_record/index.wxss
View file @
db4c9cf8
/* pages/add_record/index.wxss */
/* pages/add_record/index.wxss */
@import "../home/teacher/index.wxss"
/*LXSegmentedControl容器*/
/*LXSegmentedControl容器*/
.segmentedControl {
.segmentedControl {
/*水平居中*/
/*水平居中*/
...
@@ -15,6 +17,7 @@
...
@@ -15,6 +17,7 @@
}
}
/*普通文本*/
/*普通文本*/
.segmentedControl text {
.segmentedControl text {
/*水平排列*/
/*水平排列*/
float: left;
float: left;
...
@@ -33,6 +36,7 @@
...
@@ -33,6 +36,7 @@
}
}
/*选中状态文本*/
/*选中状态文本*/
.segmentedControl text.selected {
.segmentedControl text.selected {
/*同主色调*/
/*同主色调*/
background-color: #f9aa76;
background-color: #f9aa76;
...
@@ -41,6 +45,7 @@
...
@@ -41,6 +45,7 @@
}
}
/*最后一个分组按钮*/
/*最后一个分组按钮*/
.segmentedControl text.last {
.segmentedControl text.last {
/*不必右边框*/
/*不必右边框*/
border-right: 0;
border-right: 0;
...
@@ -57,4 +62,28 @@
...
@@ -57,4 +62,28 @@
justify-content: flex-start;
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;
}
pages/home/teacher/index.wxss
View file @
db4c9cf8
/* pages/home/teacher/index.wxss */
/* pages/home/teacher/index.wxss */
.home-header {
.home-header {
height: 180rpx;
height: 180rpx;
/* background-color: rgb(182, 179, 179); */
/* background-color: rgb(182, 179, 179); */
...
@@ -82,12 +83,10 @@
...
@@ -82,12 +83,10 @@
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
flex-wrap: wrap;
flex-wrap: wrap;
}
}
.home-student-picture {
.home-student-picture {
width:calc(100vw / 4.5);
width:calc(100vw / 4.5);
height:calc(100vw / 4.5);
height:calc(100vw / 4.5);
margin-left:20rpx
margin-left:20rpx;
}
}
\ No newline at end of file
src/img/cancel.png
0 → 100644
View file @
db4c9cf8
3.43 KB
src/img/take_photo.png
0 → 100644
View file @
db4c9cf8
5.38 KB
template/operate_btn/index.wxml
View file @
db4c9cf8
<!--template/operate_btn/index.wxml-->
<!--template/operate_btn/index.wxml-->
<template name="operate_btn">
<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-separater' style='height:4rpx;'></view>
<view class='kg-operate-btn-bg'>
<view class='kg-operate-btn-bg'>
<button class='kg-operate-btn kg-btn-no-border' bindtap='operateTap'>{{title}}</button>
<button class='kg-operate-btn kg-btn-no-border' bindtap='operateTap'>{{title}}</button>
</view>
</view>
</view>
</view>
</template>
</template>
<!--通用的分区标题-->
<!--通用的分区标题-->
...
...
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