Commit a114bbc7 authored by lvtz's avatar lvtz

amadd versionnotice

parent 9ac14c14
......@@ -57,6 +57,13 @@ App({
},
canEnterSystem (path) {
const visitor = LocalStorage.getItem('visitor');
// 新版本通知
if (LocalStorage.getItem('versionNotice') != 1 && path != 'src/pages/versionnotice/index') {
wx.redirectTo({
url: '/src/pages/versionnotice/index'
})
return;
}
if (!visitor || !visitor.id || !visitor.token || visitor.version != constants.storageVersion) {
LocalStorage.removeItem('teacher');
LocalStorage.removeItem('user');
......
......@@ -5,7 +5,8 @@
"src/pages/activityindex/index",
"business/pages/loginregistermgt/login",
"business/pages/loginregistermgt/register",
"business/pages/loginregistermgt/findpsd"
"business/pages/loginregistermgt/findpsd",
"src/pages/versionnotice/index"
],
"subpackages": [
{
......
// src/pages/versionnotice/index.js
import {
LocalStorage
} from '../../../utilities/index.js';
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
},
onLoad: function (options) {
},
onReady: function () {
},
onShow: function () {
},
onHide: function () {
},
onUnload: function () {
},
urlMath() {
const fromUrl = app.globalData.fromUrl;
console.log(fromUrl, 'fromUrlfromUrlfromUrl');
if (!fromUrl || fromUrl == 'src/pages/versionnotice/index') {
return '';
}
let _fromUrl = `${fromUrl}`;
if (fromUrl.substr(0, 1) != '/') {
_fromUrl = `/${fromUrl}`
}
const query = app.globalData.query;
let queryArr = [];
for (let key in query) {
if (query.hasOwnProperty(key)) {
queryArr.push(`${key}=${query[key]}`)
}
}
if (queryArr.length) {
return `${_fromUrl}?${queryArr.join('&')}`;
}
return _fromUrl;
},
doEnter(){
const visitor = LocalStorage.getItem('visitor');
LocalStorage.setItem('versionNotice', 1);
let url = this.urlMath() || '/ucenter/index';
// 新版本通知 未授权跳转
if(!visitor || !visitor.token){
wx.redirectTo({
url: '/wechatinfoget/index'
})
return
}
if (url == '/ucenter/index' || url.indexOf('\/schoolindex\/') != -1) {
wx.reLaunch({
url: url,
})
} else {
wx.reLaunch({url: url})
}
}
})
\ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {}
}
\ No newline at end of file
<view class="container">
<image class="version-image" mode="widthFix" src="{{localImageRoot}}announcement/image_01.png?{{imageVersion}}"/>
<image class="version-image" mode="widthFix" src="{{localImageRoot}}announcement/image_02.png?{{imageVersion}}"/>
<image class="version-image" mode="widthFix" src="{{localImageRoot}}announcement/image_03.png?{{imageVersion}}"/>
<image class="version-image" mode="widthFix" src="{{localImageRoot}}announcement/image_04.png?{{imageVersion}}"/>
<view class="btn" bindtap="doEnter">我知道了</view>
</view>
\ No newline at end of file
.container{
padding: 100rpx 0 160rpx;
}
.version-image{
width: 100%;
display: block;
}
.btn{
position: fixed;
left: 50%;
transform: translateX(-50%) scale(1);
bottom: 80rpx;
width: 365rpx;
height: 80rpx;
background: #65B8F4;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #fff;
animation: doScale linear 1s infinite;
}
@keyframes doScale{
20% {
transform: translateX(-50%) scale(1)
}
40% {
transform: translateX(-50%) scale(1.05)
}
60% {
transform: translateX(-50%) scale(1.1)
}
80% {
transform: translateX(-50%) scale(1.05)
}
100% {
transform: translateX(-50%) rotate(1)
}
}
\ No newline at end of file
......@@ -100,6 +100,14 @@ Page({
openid: _data.user.open_id,
});
LocalStorage.setItem('visitor', visitor);
// 授权成功,新版本通知未读 跳转
if(LocalStorage.getItem('versionNotice') != 1){
wx.redirectTo({
url: '/src/pages/versionnotice/index'
})
return
}
let url = that.urlMath() || '/ucenter/index';
if (url == '/ucenter/index' || url.indexOf('\/schoolindex\/') != -1) {
wx.reLaunch({
......
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