Commit 592d403b authored by 张杰's avatar 张杰

no message

parent bef2a341
Pipeline #51 canceled with stages
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
globalData: {
userInfo: null,
//一些默认值
operate_btn_height: 80
}
})
\ No newline at end of file
{
"pages":[
"pages/home/teacher/index",
"pages/home/reviewer/index",
"pages/home/parents/index",
"pages/add_record/index"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle":"black"
}
}
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
.kg-text-title {
font-size: 17px;
font-weight: bold;
}
.kg-text-normal-gray {
font-size: 15px;
color: rgb(78, 78, 78);
}
.kg-text-normal-dark {
font-size: 16px;
color: black;
}
.kg-separater {
background-color: #f2f6f9;
height: 10px;
width: 100vw;
}
.kg-operate-btn-bg {
position: fixed;
bottom: 0px;
/* background-color: red; */
height: 80px;
width: 100vh;
display: flex;
align-items: center;
}
.kg-operate-btn {
width: calc(100vw - 80px);
margin-left: 40px;
background-color: #f9aa76;
color: white;
font-size: 18px;
}
.kg-btn-no-border::after {
border: none;
}
// pages/add_record/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "记录"
}
\ No newline at end of file
<!--pages/add_record/index.wxml-->
<text>pages/add_record/index.wxml</text>
/* pages/add_record/index.wxss */
\ No newline at end of file
// pages/home/parents/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/home/parents/index.wxml-->
<text>pages/home/parents/index.wxml</text>
/* pages/home/parents/index.wxss */
\ No newline at end of file
// pages/home/reviewer/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/home/reviewer/index.wxml-->
<text>pages/home/reviewer/index.wxml</text>
/* pages/home/reviewer/index.wxss */
\ No newline at end of file
// pages/home/teacher/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
operateTap: function (event) {
console.log(event._relatedInfo.anchorTargetText)
wx.navigateTo({
url: '/pages/add_record/index',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/home/teacher/index.wxml-->
<import src='/template/operate_btn/index.wxml'></import>
<view class='home-header'>
<image class='home-header-user-icon' src='/src/img/defaut_teacher_icon.jpg'></image>
<view class='home-header-user-info'>
<view class='kg-text-title'>向日葵小班-张老师</view>
<view class='kg-text-normal-grayl'>共19人</view>
</view>
<view class='home-header-roll-call'>
<image class='roll-call-image' src='https://gomore-wxmall.oss-cn-shanghai.aliyuncs.com/miniapp/hangzhouwanke/tabbar/home/score.png'></image>
<view class='roll-call-title'>点名</view>
</view>
</view>
<view class='kg-separater'></view>
<!-- 滑动区域 -->
<scroll-view style='height:calc(100vh - 100px - 80px)' scroll-y='true'>
<view class='home-date-header'>
<view style='width:4px; height:15px;background-color:#f9aa76; margin-left:10px'></view>
<view class='kg-text-normal-gray' style='margin-left:8px'>2018-09-12</view>
</view>
<view wx:for="{{[1,2,3,4,5,6]}}">
<view class='home-student-info'>
<!-- 名字 -->
<view class='home-student-name'>
<view class='kg-text-normal-dark'>张小华</view>
<image class='home-student-sex' src='/src/img/female.png' mode='aspectFit'></image>
</view>
<!-- 图片 -->
<view class='home-student-picture'>
<image src='/src/img/student_picture.png' style='width:calc(100vw/4.5); height:calc(100vw/4.5); margin-left:10px'></image>
<image src='/src/img/student_picture.png' style='width:calc(100vw/4.5); height:calc(100vw/4.5); margin-left:10px'></image>
<image src='/src/img/student_picture.png' style='width:calc(100vw/4.5); height:calc(100vw/4.5); margin-left:10px'></image>
</view>
<!-- 行为 -->
<view class='home-student-name' style='justify-content: space-between;margin:0px 10px;'>
<view wx:for="{{[1,2,3]}}">
<view class='home-student-name'>
<image src='/src/img/eat.png' class='home-student-behavior' mode='aspectFit'></image>
<view class='kg-text-normal-dark'>吃饭</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
<template is="operate_btn"></template>
\ No newline at end of file
/* pages/home/teacher/index.wxss */
.home-header {
height: 90px;
/* background-color: rgb(182, 179, 179); */
display: flex;
flex-direction: row;
align-items: center;
margin-left: 16px;
margin-right: 16px;
justify-content: space-between;
}
.home-header-user-icon {
height: 60px;
width: 60px;
border-radius: 30px;
background-color: blueviolet;
}
.home-header-user-info {
height: 60px;
display: flex;
flex-direction: column;
justify-content: space-between;
/* background-color: burlywood; */
flex-grow: 1;
margin-left: 8px;
}
.home-header-roll-call {
width: 60px;
height: 40px;
display: flex;
flex-direction: row;
align-items: center;
margin-left: 8px;
}
.roll-call-image {
height: 20px;
width: 20px;
}
.roll-call-title {
font-size: 16px;
color: #f9aa76;
margin-left: 4px;
}
.home-date-header {
display: flex;
flex-direction: row;
height: 30px;
align-items: center;
}
.home-student-info {
display: flex;
flex-direction: column;
margin-left: 10px;
margin-right: 10px;
margin-top: 10px;
margin-bottom: 8px;
border-radius: 3px;
box-shadow: 0px 0px 4px 4px #f2f6f9;
padding: 6px 14px;
}
.home-student-name {
display: flex;
flex-direction: row;
height: 40px;
align-items: center;
}
.home-student-sex {
height: 20px;
width: 15px;
margin-left: 4px;
}
.home-student-behavior {
width: 30px;
height: 24px;
}
.home-student-picture {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
\ No newline at end of file
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.4.0",
"appid": "wx946944062df64d30",
"projectname": "Kindergarten",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
// template/operate_btn/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--template/operate_btn/index.wxml-->
<template name="operate_btn">
<view style='height:1px;width:100vw;background-color:#f2f6f9'></view>
<view class='kg-operate-btn-bg'>
<button class='kg-operate-btn kg-btn-no-border' bindtap='operateTap'>记录一笔</button>
</view>
</template>
\ No newline at end of file
/* template/operate_btn/index.wxss */
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime
}
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