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
2b579026
Commit
2b579026
authored
6 years ago
by
张杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加对登录状态的判断
parent
5620a6f3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
49 deletions
+51
-49
request.js
api/request.js
+5
-5
app.js
app.js
+20
-32
index.wxml
pages/home/parents/index.wxml
+2
-2
index.wxss
pages/home/parents/index.wxss
+1
-1
index.wxml
pages/login/index.wxml
+2
-2
index.wxss
pages/login/index.wxss
+10
-2
index.wxml
pages/review_student/index.wxml
+3
-3
project.config.json
project.config.json
+8
-2
No files found.
api/request.js
View file @
2b579026
...
...
@@ -11,14 +11,14 @@ const ERR_NOT_ACCESS_TOKEN = 21;
var
DEF_APP_CONFIG
=
{
appId
:
"wxe19b38d5dbc061c6"
,
// 勾芒小程序测试号
// 开发环境
domain
:
'https://dev.gomoretech.com/preschool'
,
baseUrl
:
"https://dev.gomoretech.com/preschool"
//
domain: 'https://dev.gomoretech.com/preschool',
//
baseUrl: "https://dev.gomoretech.com/preschool"
// 川哥本地环境
// domain: 'http://192.168.199.230:8080/preschool',
// baseUrl: "http://192.168.199.230:8080/preschool",
//
// 谢贝本地
环境
// domain: 'http://192.168.199.153:9090
',
// baseUrl: "http://192.168.199.153:9090/wxmall/wxsite
"
//
正式
环境
domain
:
'https://preschool.gomoretech.com/preschool
'
,
baseUrl
:
"https://preschool.gomoretech.com/preschool
"
}
const
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
()
:
DEF_APP_CONFIG
;
const
APP_ID
=
extConfig
.
appId
||
DEF_APP_CONFIG
.
appId
;
...
...
This diff is collapsed.
Click to expand it.
app.js
View file @
2b579026
//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
onLaunch
:
function
()
{
setTimeout
(
function
()
{
this
.
checkLoginState
()
}.
bind
(
this
),
1000
)
},
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if
(
this
.
userInfoReadyCallback
)
{
this
.
userInfoReadyCallback
(
res
)
}
}
})
}
}
})
checkLoginState
:
function
()
{
var
pages
=
getCurrentPages
()
//获取加载的页面
var
currentPage
=
pages
[
pages
.
length
-
1
]
//获取当前页面的对象
var
url
=
currentPage
.
route
//当前页面url
if
(
url
!=
"pages/login/index"
&&
this
.
globalData
.
isLogin
==
false
)
{
wx
.
redirectTo
({
url
:
'/pages/login/index'
,
})
}
},
globalData
:
{
isLogin
:
false
,
userInfo
:
null
,
//一些默认值
operate_btn_height
:
80
,
...
...
@@ -55,7 +39,11 @@ App({
"normal"
:
"正常"
,
"more"
:
"多"
},
studentPaymentTypes
:
{
'nursery_all'
:
'全托'
,
'nursery_morning'
:
'上午托'
,
'nursery_afternoon'
:
'下午托'
,
}
studentPaymentTypes
:
{
'nursery_all'
:
'全托'
,
'nursery_morning'
:
'上午托'
,
'nursery_afternoon'
:
'下午托'
,
}
}
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/home/parents/index.wxml
View file @
2b579026
...
...
@@ -37,7 +37,7 @@
<image src='{{picItem}}' class='home-student-picture' catchtap='previewPic' data-index='{{index}}' data-picIndex='{{picIndex}}' mode='aspectFill'></image>
</view>
</view>
<text class='kg-text-light-gray' style='margin-left:60rpx;margin-right:
4
5rpx;'>{{item.pictureRemark ? item.pictureRemark : ''}}</text>
<text class='kg-text-light-gray' style='margin-left:60rpx;margin-right:
3
5rpx;'>{{item.pictureRemark ? item.pictureRemark : ''}}</text>
<view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view>
...
...
@@ -78,7 +78,7 @@
<text class='kg-text-normal-gray' >{{wcItem.value ? wcItem.value : '0'}}次</text>
</view>
</view>
<text class='kg-text-light-gray' style='margin-left:60rpx;margin-right:
4
5rpx;'>{{item.remark ? item.remark : ''}}</text>
<text class='kg-text-light-gray' style='margin-left:60rpx;margin-right:
3
5rpx;'>{{item.remark ? item.remark : ''}}</text>
</view>
</view>
...
...
This diff is collapsed.
Click to expand it.
pages/home/parents/index.wxss
View file @
2b579026
...
...
@@ -58,7 +58,7 @@
.timeline-content-detail {
margin-left:60rpx;
margin-right:
60
rpx;
margin-right:
38
rpx;
margin-bottom:10rpx;
}
...
...
This diff is collapsed.
Click to expand it.
pages/login/index.wxml
View file @
2b579026
<!--pages/login/index.wxml-->
<import src='/template/operate_btn/index.wxml'></import>
<view class='kg-separater' style='height:2rpx;'></view>
<image class='login_logo' src='
/src/img/login_logo.png
'></image>
<view
style='padding:16px;margin-top:50rpx;
'>
<image class='login_logo' src=''></image>
<view
class='login-board
'>
<view class='kg-text-normal-gray'>手机号</view>
<input placeholder='请输入手机号登录' style='margin:30rpx 0rpx;' bindinput='inputAction' value='{{mobile}}'></input>
<view class='kg-separater' style='height:2rpx;'></view>
...
...
This diff is collapsed.
Click to expand it.
pages/login/index.wxss
View file @
2b579026
This diff is collapsed.
Click to expand it.
pages/review_student/index.wxml
View file @
2b579026
...
...
@@ -29,7 +29,7 @@
<view wx:if="{{dietIndex == 0}}">
<template is='imgTextView' data="{{img:'eat',text:'饮食'}}"> </template>
</view>
<view class='kg-flex-row timeline-content-detail'>
<view class='kg-flex-row timeline-content-detail'
style='margin-right:60rpx;'
>
<text class='kg-text-normal-gray'>{{dietItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>{{dietItem.z_eatState}}</text>
</view>
...
...
@@ -41,7 +41,7 @@
<view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view>
<template is='imgTextView' data="{{img:'sleep',text:'睡眠'}}"> </template>
</view>
<view class='kg-flex-row timeline-content-detail'>
<view class='kg-flex-row timeline-content-detail'
style='margin-right:60rpx;'
>
<text class='kg-text-normal-gray'>午睡</text>
<text class='kg-text-normal-gray'>{{sleepItem.value ? sleepItem.value : '0'}}分钟</text>
</view>
...
...
@@ -53,7 +53,7 @@
<view class='kg-separater' style='height:2rpx;margin-left:80rpx;margin-right:0rpx;'></view>
<template is='imgTextView' data="{{img:'wc',text:'大小便'}}"> </template>
</view>
<view class='kg-flex-row timeline-content-detail'>
<view class='kg-flex-row timeline-content-detail'
style='margin-right:60rpx;'
>
<text class='kg-text-normal-gray'>{{wcItem.z_recordType}}</text>
<text class='kg-text-normal-gray'>{{wcItem.value ? wcItem.value : '0'}}次</text>
</view>
...
...
This diff is collapsed.
Click to expand it.
project.config.json
View file @
2b579026
...
...
@@ -4,7 +4,7 @@
"ignore"
:
[]
},
"setting"
:
{
"urlCheck"
:
fals
e
,
"urlCheck"
:
tru
e
,
"es6"
:
true
,
"postcss"
:
true
,
"minified"
:
true
,
...
...
@@ -36,8 +36,14 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
0
,
"current"
:
1
,
"list"
:
[
{
"id"
:
-1
,
"name"
:
"教师首页"
,
"pathName"
:
"pages/home/teacher/index"
,
"query"
:
""
},
{
"id"
:
-1
,
"name"
:
"教师首页"
,
...
...
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