-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.vue
104 lines (95 loc) · 2.19 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<script>
export default {
onLaunch: function(optios) {
//token判断存在跳转至首页 不存在跳转登录页
// #ifdef APP-PLUS
let token = uni.getStorageSync("vue_authtoken");
if (token) {
//存在则关闭启动页进入首页
plus.navigator.closeSplashscreen();
} else {
//不存在则跳转至登录页
uni.reLaunch({
url: "/pages/user/login",
success: () => {
plus.navigator.closeSplashscreen();
}
})
}
// #endif
// #ifdef H5
let token = uni.getStorageSync("vue_authtoken");
if (token) {
if (optios.path === 'pages/user/login') {
//存在则关闭启动页进入首页
uni.redirectTo({
url: "/pages/order/lotteryOrder"
})
}
} else {
if (optios.path != 'pages/user/register' && optios.path != 'pages/personal/download') {
//不存在则跳转至登录页
//存在则关闭启动页进入首页
uni.redirectTo({
url: "/pages/user/login"
})
} else if (optios.path == 'pages/personal/download') {
uni.redirectTo({
url: "/pages/personal/download"
})
}
}
// #endif
},
onShow: function() {
},
onHide: function() {
}
}
</script>
<style lang="scss">
/*每个页面公共css */
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss";
.box {
//font-family: PingFangSC-Semibold;
font-family: PingFangSC-Regular;
/* #ifndef H5 */
padding-bottom: 140upx;
padding-top: 170upx;
top: var(--status-bar-height);
/* #endif */
}
.box {
//font-family: PingFangSC-Semibold;
font-family: PingFangSC-Regular;
/* #ifndef APP-PLUS */
padding-bottom: 140upx;
padding-top: 88upx;
top: var(--status-bar-height);
/* #endif */
}
//全局动画
@keyframes show {
0% {
transform: translateY(-50px);
}
60% {
transform: translateY(40upx);
}
100% {
transform: translateY(0px);
}
}
@-webkit-keyframes show {
0% {
transform: translateY(-50px);
}
60% {
transform: translateY(40upx);
}
100% {
transform: translateY(0px);
}
}
</style>