init.vue
1.4 KB
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
<template>
<view v-if="show">
<!-- logo区域 -->
<view class="logoWrap">
<image src="../../static/image/logo_txt.png" mode=""></image>
</view>
<!-- 标题区域 -->
<!-- <view class="titleWrap">
生态环境监管
</view> -->
<!-- 底部区域 -->
<view class="bottomWrap"></view>
</view>
</template>
<script>
export default{
data(){
return{
show:false
}
},
created() {
// 从本地缓存中同步获取指定 key 对应的内容,用于判断是否是第一次打开应用
const value = uni.getStorageSync('launchFlag');
if (value) {
// 如何已经有,直接去home首页
this.$href('/pages/login/login')
} else {
this.show = true
// 没有值,跳到引导页,并存储,下次打开就不会进去引导页
uni.setStorage({
key: 'launchFlag',
data: true
});
setTimeout(()=>{
this.$href('/pages/login/login')
},2000)
}
}
}
</script>
<style>
page{background: #4bb377;}
/* logo区域 */
.logoWrap{padding-top: 376rpx;display: flex;justify-content: center;}
.logoWrap image{width: 504rpx;height: 140rpx;}
/* 标题区域 */
.titleWrap{padding-top: 36rpx;font-size: 40rpx;color: #fff;text-align: center;}
/* 底部区域 */
.bottomWrap{position: fixed;bottom: 0;background: url(../../static/image/img_1.png) no-repeat;background-size: 100% 168rpx;z-index: 1;width: 100%;height: 168rpx;}
</style>