This commit is contained in:
Rain Sun 2018-10-05 12:39:49 +08:00
parent 804f4f3a16
commit 2c43f1f969
7 changed files with 156 additions and 25 deletions

50
app.js
View File

@ -11,31 +11,31 @@ App({
* 当小程序初始化完成时会触发 onLaunch全局只触发一次
*/
onLaunch: function() {
var dbPost = new DBPost();
var loginTime = dbPost.getloginTimeData(); //获取上次登陆时间没有记录为0
if (loginTime) {
var timestamp = +new Date();
timestamp = timestamp / 1000;
timestamp = parseInt(timestamp);
var difference = timestamp - loginTime; //两次时间差
if (difference >= 86400) {
wx.clearStorageSync();
wx.redirectTo({
url: 'welcome/login/login'
})
console.log("登录超时")
} else {
wx.switchTab({
url: 'pages/post/post'
})
console.log("校验通过")
}
} else {
wx.redirectTo({
url: 'welcome/login/login'
})
console.log("无登录记录")
}
// var dbPost = new DBPost();
// var loginTime = dbPost.getloginTimeData(); //获取上次登陆时间没有记录为0
// if (loginTime) {
// var timestamp = +new Date();
// timestamp = timestamp / 1000;
// timestamp = parseInt(timestamp);
// var difference = timestamp - loginTime; //两次时间差
// if (difference >= 86400) {
// wx.clearStorageSync();
// wx.redirectTo({
// url: 'welcome/login/login'
// })
// console.log("登录超时")
// } else {
// wx.switchTab({
// url: 'pages/post/post'
// })
// console.log("校验通过")
// }
// } else {
// wx.redirectTo({
// url: 'welcome/login/login'
// })
// console.log("无登录记录")
// }
},
/**

View File

@ -1,5 +1,6 @@
{
"pages": [
"welcome/welcome/welcome",
"welcome/login/login",
"pages/post/post",
"pages/feedBack/feedBack",
@ -11,6 +12,7 @@
"pages/post/QRcode/QRcode",
"pages/user/xinxi/xinxi",
"welcome/signin/signin",
"pages/user/guanyu/guanyu",
"pages/user/user"
],

BIN
images/welcome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@ -0,0 +1,66 @@
// welcome/welcome/welcome.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,3 @@
{
"navigationBarBackgroundColor": "#3e1c54"
}

View File

@ -0,0 +1,13 @@
<!--welcome/welcome/welcome.wxml-->
<view class='text_1'>欢迎来到RCS</view>
<view class='big'>
<view class='box'>
<view class='item'>让</view>
<view class='item'>查</view>
<view class='item'>课</view>
<view class='item'>更</view>
<view class='item'>高</view>
<view class='item'>效</view>
</view>
</view>
<image src='../../images/welcome.png' class='welcome'></image>

View File

@ -0,0 +1,47 @@
/* welcome/welcome/welcome.wxss */
.welcome {
width: 100%;
height: 350rpx;
position: fixed;
bottom: 0px;
}
.text_1 {
color: #fff;
font-size: 60rpx;
font-weight: lighter;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
justify-content: center;
}
.box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 350rpx;
}
.item {
color: #fff;
font-size: 30rpx;
font-weight: lighter;
display: flex;
text-align: center;
}
.big {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
page {
background-color: #3e1c54;
}