UpdateBox.vue
2.56 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<template>
<view>
<view
class="update-modal"
v-if="show"
>
<view class="update-box">
<image
class="bg"
:src="bg"
/>
<view class="content">
<view class="title">新版本升级 V.{{versionData.version}}</view>
<template v-for="(i,index) in versionData.textList">
<view
class="content-item"
:key="index"
>
{{i}}
</view>
</template>
</view>
<view
class="btn"
@click="toMarket"
>立即更新</view>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'updateBox',
data () {
return {
show: false,
versionData: {},
bg: require('@/assets/images/common/update-bg.webp')
}
},
computed: {
watchUpdateStatus () {
return this.$store.state.update.status
},
},
watch: {
watchUpdateStatus: {
immediate: true,
handler (newval) {
this.versionData = uni.$storage.get("mock_data")
if (newval) this.show = true
}
},
},
mounted () {
},
methods: {
toMarket () {
let { appUrl } = this.versionData
if (!appUrl) appUrl = 'market://details?id=io.dcloud.hellouniapp'
plus.runtime.openURL(appUrl)
}
}
}
</script>
<style scoped lang='scss'>
.update-modal {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 99999999999;
background: #00000066;
.update-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 800rpx;
height: 752rpx;
background: #ffffff;
border-radius: 32rpx;
box-sizing: border-box;
padding-top: 288rpx;
.bg {
width: 800rpx;
height: 400rpx;
position: absolute;
left: 0;
top: -84rpx;
}
.content {
position: relative;
z-index: 2;
width: 640rpx;
height: 288rpx;
overflow-y: scroll;
margin: 0 auto 32rpx;
.title {
text-align: center;
font-weight: 500;
font-size: 32rpx;
margin-bottom: 24rpx;
}
&-item {
color: #5a5e66;
font-size: 28rpx;
}
}
.btn {
width: 608rpx;
height: 80rpx;
background-image: linear-gradient(270deg, #2c66f7 0%, #48a6ff 100%);
border-radius: 98rpx;
text-align: center;
line-height: 80rpx;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
margin: 0 auto;
}
}
}
</style>