71 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

let app = getApp()
import { pageTitle } from '../../utils/js/replace'
Page({
/** 页面的初始数据 */
data: {
canLogin: true,
},
/** 生命周期函数--监听页面加载 */
onLoad: function (options) {
wx.setNavigationBarTitle({
title: `${pageTitle}`
})
wx.showLoading({ title: '加载中' })
},
/** 生命周期函数--监听页面显示 */
onShow: function () {
let startDate = new Date("2020/05/29 22:00:00");
let endDate = new Date("2020/05/30 22:00:00");
let d = new Date()
if(d >= startDate && d <= endDate){
this.setData({
canLogin : false
})
wx.showModal({
showCancel: false,
mask: true,
content:"给您带来不便敬请谅解 \r\n 预计恢复时间2020.05.30 22:00:00",
title:"系统更新维护中"
})
}
// 获取缓存里的扫码内容 登录
let bind = wx.getStorageSync('bind')
setTimeout(function () {
app.loginCloudBird(bind);
}, 1000)
},
/** 用户点击右上角分享 */
onShareAppMessage: function () {
return { path: "pages/firstpage/firstpage?from=share" }
},
gologin () {
if(!this.data.canLogin){
wx.showModal({
showCancel: false,
mask: true,
content:"给您带来不便敬请谅解 \r\n 预计恢复时间2020.05.30 22:00:00",
title:"系统更新维护中"
})
return;
}
wx.showModal({
title: '您还未登录',
content: '请先登录再进行操作!',
showCancel: true,//是否显示取消按钮
success: function (res) {
if (res.cancel) {
//点击取消
} else if (res.confirm) {
//点击确定
wx.navigateTo({
url: '../wxlogin/wxlogin'
})
}
}
})
}
})