Commit 1b1d6f24 authored by 张杰's avatar 张杰

no message

parent 7a231989
......@@ -405,7 +405,9 @@ Page({
duration: 1500
})
setTimeout(() => {
this.getRecord()
wx.navigateBack({
})
}, 1500)
})
......@@ -413,7 +415,10 @@ Page({
onLoad: function(options) {
this.data.studentIds = JSON.parse(options.studentIds)
this.data.pictureIds = JSON.parse(options.pictureIds)
if (options.pictureIds != null) {
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]))
}
......
......@@ -39,7 +39,7 @@
<!-- 选择的图片 -->
<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='{{item}}' class='add_picture' catchtap='previewPic' data-index='{{index}}' mode='aspectFill'></image>
<image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image>
</view>
</view>
......
// pages/home/parents/index.js
const request = require('../../../api/parrent.js')
const utils = require('../../../utils/util.js')
const app = getApp()
......@@ -18,6 +20,15 @@ Page({
},
previewPic: function (e) {
var current = this.data.records[e.target.dataset.index].arrPic[e.target.dataset.picIndex]
wx.previewImage({
current: current,
urls: this.data.records[e.target.dataset.index].arrPic
})
},
/**
* 生命周期函数--监听页面加载
*/
......@@ -53,6 +64,20 @@ Page({
let date = new Date(dateStr);
var num = date.getDay()
item.recordDate = dateStr + " " + show_day[date.getDay()]
//图片
var arrPic = []
let arrIds = []
if (item.pictures != null && item.pictures != '') {
arrIds = item.pictures.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
// 饮食
var dietRecords = item['dietRecord']
......
......@@ -59,14 +59,14 @@
</view>
</view>
<!-- <soview 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:'today',text:'今日照片'}}"> </template>
<template is='imgTextView' data="{{img:'today',text:'今日照片'}}"> </template>
<view class='home-student-picture-item' style='margin-left:40rpx;'>
<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> -->
<view wx:for="{{item.arrPic}}" wx:for-item="picItem" wx:for-index="picIndex">
<image src='{{picItem}}' class='home-student-picture' catchtap='previewPic' data-index='{{index}}' data-picIndex='{{picIndex}}' mode='aspectFill'></image>
</view>
</view>
</view>
</view>
......
// pages/home/reviewer/index.js
const request = require('../../../api/teacher.js')
const app = getApp()
const utils = require('../../../utils/util.js')
Page({
/**
......@@ -25,17 +27,43 @@ Page({
},
tapStudent: function(e) {
let student = this.data.records[e.currentTarget.dataset.index]
wx.navigateTo({
url: '/pages/review_student/index?signSummaryId=' + e.currentTarget.id
url: '/pages/review_student/index?signSummaryId=' + student.id + '&pictureIds=' + JSON.stringify(student.arrIds)
})
},
previewPic: function (e) {
var current = this.data.records[e.target.dataset.index].arrPic[e.target.dataset.picIndex]
wx.previewImage({
current: current,
urls: this.data.records[e.target.dataset.index].arrPic
})
},
querySignSummary: function() {
request.querySignSummaryByClass(this.data.classId).then(res => {
console.log(res)
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
......
......@@ -18,7 +18,7 @@
</view>
</view>
</view>
<view class='home-student-info' wx:for="{{records}}" wx:key="id" id="{{item.id}}" bindtap='tapStudent'>
<view class='home-student-info' wx:for="{{records}}" data-index='{{index}}' wx:key="id" id="{{item.id}}" bindtap='tapStudent'>
<!-- 名字 -->
<view class='home-student-name'>
<view class='kg-text-normal-dark'>{{item.signStudentName}}</view>
......@@ -26,9 +26,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" wx:for-index="picIndex">
<image src='{{picItem}}' class='home-student-picture' catchtap='previewPic' data-index='{{index}}' data-picIndex='{{picIndex}}' mode='aspectFill'></image>
</view>
</view>
<!-- 行为 -->
<view class='home-student-name' style='justify-content: space-between;margin:0rpx 30rpx;'>
......
......@@ -12,7 +12,7 @@ Page({
userIcon: "/src/img/defaut_teacher_icon.png",
records: [],
userName:'',
subTitle:'共20人'
subTitle:'共0人'
},
......@@ -96,6 +96,10 @@ Page({
return
}
var signSummary = app.globalData.login.classes[0].id
var studentCount = app.globalData.login.classes[0].studentCount
this.setData({
subTitle: '共' + studentCount + '人'
})
// request.querySignSummary("4028048267a65d0f0167a69ae1910058", "4028048267a5969b0167a5b22f3807f8").then(res => {
request.querySignSummary(app.globalData.login.user.id, signSummary).then(res => {
......
......@@ -22,7 +22,7 @@
<!-- 图片 -->
<view class='home-student-picture-item'>
<view wx:for="{{item.arrPic}}" wx:for-item="picItem" wx:for-index="picIndex">
<image src='{{picItem}}' class='home-student-picture' bindtap='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>
<!-- 行为 -->
......
......@@ -6,5 +6,5 @@
<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>
<button class='kg-operate-btn kg-btn-no-border' bindtap='operateTap' open-type='getUserInfo'>登录</button>
</view>
\ No newline at end of file
// pages/review_student/index.js
const request = require('../../api/teacher.js')
const utils = require('../../utils/util.js')
Page({
......@@ -112,6 +113,18 @@ Page({
*/
onLoad: function(options) {
this.data.signSummaryId = options.signSummaryId;
if (options.pictureIds != null) {
this.data.pictureIds = JSON.parse(options.pictureIds)
var arrPic = []
for (var i = 0; i < this.data.pictureIds.length; i++) {
let id = this.data.pictureIds[i]
arrPic.push(utils.handleImgShow(id))
}
this.setData({
arrPic: arrPic
})
}
this.getRecordDetailForSignId()
},
......
......@@ -33,7 +33,7 @@
<template is='imgTextView' data="{{img:'sleep',text:'睡觉'}}"> </template>
</view>
<view class='kg-flex-row timeline-content-detail'>
<text class='kg-text-normal-gray'>{{sleepItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>午睡</text>
<text class='kg-text-normal-gray'>{{sleepItem.value}}分钟</text>
</view>
</view>
......@@ -53,9 +53,9 @@
<!-- 今日照片 -->
<template is='imgTextView' data="{{img:'today',text:'今日照片'}}"> </template>
<view class='home-student-picture-item' style='margin-left:40rpx;'>
<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="{{arrPic}}" wx:for-item="picItem" wx:for-index="picIndex">
<image src='{{picItem}}' class='home-student-picture' catchtap='previewPic' data-index='{{index}}' data-picIndex='{{picIndex}}' mode='aspectFill'></image>
</view>
</view>
</view>
</scroll-view>
......
......@@ -24,7 +24,7 @@
<view wx:if="{{type == 'input'}}">
<!-- 输入型cell -->
<view class='kg-flex-row'>
<input class='kg-border' style='width:140rpx;margin-right:10rpx;' bindinput="bindKeyInput" data-cellIndex='{{cellIndex}}' value="{{inputValue}}"></input>
<input class='kg-border' style='width:140rpx;margin-right:10rpx;' bindinput="bindKeyInput" data-cellIndex='{{cellIndex}}' value="{{inputValue}}" type='number'></input>
<view class='kg-text-normal-gray'>{{unit}}</view>
</view>
</view>
......
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