Commit 67139e99 authored by 张杰's avatar 张杰

bug fix

parent 50defc57
...@@ -20,6 +20,12 @@ ...@@ -20,6 +20,12 @@
color: rgb(78, 78, 78); color: rgb(78, 78, 78);
} }
.kg-text-light-gray {
font-weight:bold;
font-size: 26rpx;
color: #8a8b8c
}
.kg-text-normal-dark { .kg-text-normal-dark {
font-size: 32rpx; font-size: 32rpx;
color: black; color: black;
......
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
.add_picture_view { .add_picture_view {
position: relative; position: relative;
width: calc(100vw / 4 + 20rpx); width: calc(100vw / 2.5 + 20rpx);
height: calc(100vw / 4 + 20rpx); height: calc(100vw / 2.5 + 20rpx);
margin-right: 30rpx; margin-right: 30rpx;
} }
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
position: absolute; position: absolute;
left: 0rpx; left: 0rpx;
bottom: 0rpx; bottom: 0rpx;
width: calc(100vw / 4); width: calc(100vw / 2.5);
height: calc(100vw / 4); height: calc(100vw / 2.5);
} }
.delete { .delete {
......
...@@ -17,19 +17,70 @@ Page({ ...@@ -17,19 +17,70 @@ Page({
records: [], records: [],
recordTypes: app.globalData.recordTypes, recordTypes: app.globalData.recordTypes,
eatStates: app.globalData.eatStates, eatStates: app.globalData.eatStates,
rightIcon: '/src/img/xiugaimima.png' rightIcon: '/src/img/xiugaimima.png',
pictureId: "",
userIcon: "",
selectPic:[]
},
tapUserInfoImg: function(e) {
var that = this;
// 选择图片
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function(res) {
//选中的图片路径
let temPath = res.tempFilePaths[0]
that.data.selectPic.push(temPath)
that.setData({
selectPic: that.data.selectPic
});
wx.uploadFile({
url: utils.uploadPath(),
filePath: temPath,
name: 'file',
header: {
'access-token': utils.getAccessToken()
},
success(res) {
const resData = JSON.parse(res.data)
// 获取服务端图片id
that.data.pictureId = resData.obj
that.data.userIcon = utils.handleImgShow(resData.obj)
if (resData.obj) {
that.setData({
pictureId: that.data.pictureId,
userIcon: that.data.userIcon
})
} else {
throw new Error({
msg: '图片上传失败'
})
}
},
fail(err) {
wx.showToast({
title: err.msg,
icon: 'none'
})
}
})
}
})
}, },
changePwdTap: function(e) { changePwdTap: function(e) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/reset_psw/index', url: '/pages/reset_psw/index',
}) })
}, },
previewPic: function (e) { previewPic: function(e) {
var current = this.data.records[e.target.dataset.index].arrPic[e.target.dataset.picIndex] var current = this.data.records[e.target.dataset.index].arrPic[e.target.dataset.picindex]
wx.previewImage({ wx.previewImage({
current: current, current: current,
urls: this.data.records[e.target.dataset.index].arrPic urls: this.data.records[e.target.dataset.index].arrPic
...@@ -42,7 +93,7 @@ Page({ ...@@ -42,7 +93,7 @@ Page({
*/ */
onLoad: function(options) { onLoad: function(options) {
const that = this const that = this
if (app.globalData.login.students.length == 0) { if (app.globalData.login.students.length == 0) {
wx.showToast({ wx.showToast({
...@@ -54,7 +105,7 @@ Page({ ...@@ -54,7 +105,7 @@ Page({
let student = app.globalData.login.students[0] let student = app.globalData.login.students[0]
var studentId = student.id var studentId = student.id
this.setData({ this.setData({
student:student, student: student,
userIcon: app.globalData.login.wxaUser.avatarUrl, userIcon: app.globalData.login.wxaUser.avatarUrl,
sex: student.sex sex: student.sex
}) })
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<view class='kg-home-header kg-flex-row'> <view class='kg-home-header kg-flex-row'>
<template is='userInfo' data="{{userImg:userIcon,title:student.name,subTitle:student.className,sex:sex}}"></template> <template is='userInfo' data="{{userImg:userIcon,title:student.name,subTitle:student.className,sex:sex}}"></template>
<view class='kg-flex-column' style='align-items:flex-end;'> <view class='kg-flex-column' style='align-items:flex-end;'>
<image class='top_logo' src='/src/img/parent_logo.png'></image> <!-- <image class='top_logo' src='/src/img/parent_logo.png'></image> -->
<view class='home-header-roll-call' bindtap='changePwdTap'> <view class='home-header-roll-call' bindtap='changePwdTap'>
<image class='roll-call-image' src='{{rightIcon}}'></image> <image class='roll-call-image' src='{{rightIcon}}'></image>
<view class='roll-call-title' style='margin-top:20rpx;'>修改密码</view> <view class='roll-call-title' r>修改密码</view>
</view> </view>
</view> </view>
...@@ -16,53 +16,53 @@ ...@@ -16,53 +16,53 @@
<view class='kg-separater'></view> <view class='kg-separater'></view>
<scroll-view style='height:calc(100vh - 200rpx)' scroll-y='true'> <scroll-view style='height:calc(100vh - 200rpx)' scroll-y='true'>
<view wx:for="{{records}}"> <view wx:for="{{records}}" wx:key="item">
<view class='timeline-cell'> <view class='timeline-cell'>
<view class='timeline-line-container'> <view class='timeline-line-container'>
<view class='timeline-line'></view> <view class='timeline-line'></view>
<image class='timeline-cycle' src='/src/img/timeline-cycle.jpeg'></image> <image class='timeline-cycle' src='/src/img/timeline-cycle.jpeg'></image>
</view> </view>
<view class='kg-quantity-cell timeline-content'> <view class='kg-quantity-cell timeline-content'>
<view class='kg-flex-row' style='margin-bottom:20rpx;'> <view class='kg-flex-row'>
<text class='kg-text-title'>{{item.recordDate}}</text> <text class='kg-text-title'>{{item.recordDate}}</text>
<text class='kg-text-normal-gray'>{{item.teacher ? item.teacher.name : ""}}记录</text> <text class='kg-text-light-gray'>{{item.teacher ? item.teacher.name : ""}}记录</text>
</view> </view>
<!-- 饮食 --> <!-- 饮食 -->
<view wx:for="{{item.dietRecord}}" wx:for-item="dietItem" wx:for-index="dietIndex"> <view wx:for="{{item.dietRecord}}" wx:for-item="dietItem" wx:for-index="dietIndex" wx:key="dietItem.id">
<view wx:if="{{dietIndex == 0}}"> <view wx:if="{{dietIndex == 0}}">
<template is='imgTextView' data="{{img:'eat',text:'饮食'}}"> </template> <template is='imgTextView' data="{{img:'eat',text:'饮食'}}"> </template>
</view> </view>
<view class='kg-flex-row timeline-content-detail'> <view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>{{dietItem.z_recordType}}</text> <text class='kg-text-normal-gray' style='width:130rpx;'>{{dietItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>{{dietItem.z_eatState}}</text> <text class='kg-text-normal-gray' style='width:130rpx;'>{{dietItem.z_eatState}}</text>
</view> </view>
</view> </view>
<!-- 睡觉 --> <!-- 睡觉 -->
<view wx:for="{{item.sleepRecord}}" wx:for-item="sleepItem" wx:for-index="sleepIndex"> <view wx:for="{{item.sleepRecord}}" wx:for-item="sleepItem" wx:for-index="sleepIndex" wx:key="sleepItem.id">
<view wx:if="{{sleepIndex == 0}}"> <view wx:if="{{sleepIndex == 0}}">
<view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view> <view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view>
<template is='imgTextView' data="{{img:'sleep',text:'睡觉'}}"> </template> <template is='imgTextView' data="{{img:'sleep',text:'睡觉'}}"> </template>
</view> </view>
<view class='kg-flex-row timeline-content-detail'> <view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>午睡</text> <text class='kg-text-normal-gray' style='width:130rpx;'>午睡</text>
<text class='kg-text-normal-gray'>{{sleepItem.value}}分钟</text> <text class='kg-text-normal-gray' style='width:130rpx;'>{{sleepItem.value}}分钟</text>
</view> </view>
</view> </view>
<!-- wc --> <!-- wc -->
<view wx:for="{{item.wcRecord}}" wx:for-item="wcItem" wx:for-index="wcIndex"> <view wx:for="{{item.wcRecord}}" wx:for-item="wcItem" wx:for-index="wcIndex" wx:key="wcItem.id">
<view wx:if="{{wcIndex == 0}}"> <view wx:if="{{wcIndex == 0}}">
<view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view> <view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view>
<template is='imgTextView' data="{{img:'wc',text:'WC'}}"> </template> <template is='imgTextView' data="{{img:'wc',text:'WC'}}"> </template>
</view> </view>
<view class='kg-flex-row timeline-content-detail'> <view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>{{wcItem.z_recordType}}</text> <text class='kg-text-normal-gray' style='width:130rpx;'>{{wcItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>{{wcItem.value}}次</text> <text class='kg-text-normal-gray' style='width:130rpx;'>{{wcItem.value}}次</text>
</view> </view>
</view> </view>
<text class='kg-text-normal-gray' style='margin-left:60rpx;'>{{item.remark ? item.remark : ''}}</text> <text class='kg-text-normal-gray' style='margin-left:60rpx;'>{{item.remark ? item.remark : ''}}</text>
...@@ -71,11 +71,11 @@ ...@@ -71,11 +71,11 @@
<!-- 今日照片 --> <!-- 今日照片 -->
<template is='imgTextView' data="{{img:'today',text:'今日照片'}}"> </template> <template is='imgTextView' data="{{img:'today',text:'今日照片'}}"> </template>
<view class='home-student-picture-item' style='margin-left:40rpx;'> <view class='home-student-picture-item' style='margin-left:40rpx;'>
<view wx:for="{{item.arrPic}}" wx:for-item="picItem" wx:for-index="picIndex"> <view wx:for="{{item.arrPic}}" wx:for-item="picItem" wx:for-index="picIndex" wx:key="picItem">
<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>
<text class='kg-text-normal-gray' style='margin-left:60rpx;'>{{item.pictureRemark ? item.pictureRemark : ''}}</text> <text class='kg-text-normal-gray' style='margin-left:60rpx;'>【禾其狗狗喝水器挂式水壶猫咪自动饮水杯用品狗笼喂水器宠物饮水器】https://m.tb.cn/h.3HA5uKq?sm=8a2196 点击链接,再选择浏览器咑閞;或復·制这段描述¥502VbroYaCP¥后到👉淘♂寳♀👈</text>
</view> </view>
</view> </view>
......
...@@ -47,11 +47,12 @@ ...@@ -47,11 +47,12 @@
} }
.timeline-content { .timeline-content {
flex-grow: 1; /* flex-grow: 1; */
margin-top: 10px; margin-top: 10px;
margin-left: 4px; margin-left: 4px;
margin-bottom: 10px; margin-bottom: 10px;
margin-right: 10px; margin-right: 10px;
width: 660rpx;
/* background-color: red; */ /* background-color: red; */
} }
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
} }
.home-student-picture { .home-student-picture {
width:calc(100vw / 4.5); width:calc(100vw / 3);
height:calc(100vw / 4.5); height:calc(100vw / 3);
margin-left:20rpx; margin-left:20rpx;
} }
\ No newline at end of file
...@@ -60,7 +60,7 @@ subTitle:副标题 ...@@ -60,7 +60,7 @@ subTitle:副标题
--> -->
<template name='userInfo'> <template name='userInfo'>
<view class='kg-flex-row'> <view class='kg-flex-row'>
<image class='kg-user-icon' src='{{userImg}}'></image> <image class='kg-user-icon' src='{{userImg}}' bindtap='tapUserInfoImg'></image>
<view class='kg-flex-column' style='margin-left: 16rpx;height: 120rpx;'> <view class='kg-flex-column' style='margin-left: 16rpx;height: 120rpx;'>
<view class='kg-flex-row' style='justify-content:flex-start;'> <view class='kg-flex-row' style='justify-content:flex-start;'>
<view class='kg-text-title'>{{title}}</view> <view class='kg-text-title'>{{title}}</view>
...@@ -88,8 +88,8 @@ sex:性别 f/m (女性/男性) ...@@ -88,8 +88,8 @@ sex:性别 f/m (女性/男性)
<!-- 图片+文字 --> <!-- 图片+文字 -->
<template name='imgTextView'> <template name='imgTextView'>
<view class='kg-flex-row' style='justify-content: flex-start;height:60rpx;'> <view class='kg-flex-row' style='justify-content: flex-start;height:80rpx;'>
<image src='/src/img/{{img}}.png' style='width: 50rpx;height: 40rpx;'></image> <image src='/src/img/{{img}}.png' style='width: 50rpx;height: 40rpx;'></image>
<text class='kg-text-normal-dark' style='margin-left:10rpx'>{{text != null ? text : ""}}</text> <text class='kg-text-normal-dark' style='margin-left:10rpx;font-weight:bold;'>{{text != null ? text : ""}}</text>
</view> </view>
</template> </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