stellar-ui-plus 1.22.4 → 1.22.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
"description": "更新API地址",
|
|
22
22
|
"type": "string",
|
|
23
23
|
"default": "https://zboa.whzb.com/inte-cloud-dev/blade-system/api/inte/client/ver/currentDetail"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "[event]cancel",
|
|
27
|
+
"description": "取消更新",
|
|
28
|
+
"type": "() => void"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "[event]complete",
|
|
32
|
+
"description": "取消,成功更新都会执行",
|
|
33
|
+
"type": "() => void"
|
|
24
34
|
}
|
|
25
35
|
]
|
|
26
36
|
}
|
|
@@ -20,6 +20,12 @@ const percent = ref(0);
|
|
|
20
20
|
const updateBtn = ref(true);
|
|
21
21
|
const downloadedSize = ref('0');
|
|
22
22
|
const packageFileSize = ref('0');
|
|
23
|
+
|
|
24
|
+
const emits = defineEmits<{
|
|
25
|
+
(e: 'cancel', event?: any): void;
|
|
26
|
+
(e: 'complete', event?: any): void;
|
|
27
|
+
}>();
|
|
28
|
+
|
|
23
29
|
const getData = (callback?: (resVersion: { name: string; code: string; updateFile: string }, version: string) => void) => {
|
|
24
30
|
uni.request({
|
|
25
31
|
url: props.apiUrl,
|
|
@@ -46,6 +52,7 @@ const getData = (callback?: (resVersion: { name: string; code: string; updateFil
|
|
|
46
52
|
if (data.updateFile && data.code > version.value) {
|
|
47
53
|
open.value = true;
|
|
48
54
|
}
|
|
55
|
+
emits('complete');
|
|
49
56
|
} else {
|
|
50
57
|
console.log(_data.msg);
|
|
51
58
|
}
|
|
@@ -94,6 +101,12 @@ const confirm = () => {
|
|
|
94
101
|
}
|
|
95
102
|
};
|
|
96
103
|
|
|
104
|
+
function close() {
|
|
105
|
+
open.value = false;
|
|
106
|
+
emits('cancel');
|
|
107
|
+
emits('complete');
|
|
108
|
+
}
|
|
109
|
+
|
|
97
110
|
defineExpose({
|
|
98
111
|
start,
|
|
99
112
|
stop() {
|
|
@@ -130,7 +143,7 @@ defineExpose({
|
|
|
130
143
|
</view>
|
|
131
144
|
</view>
|
|
132
145
|
|
|
133
|
-
<image v-if="!data.isForce" class="close-img" src="../../static/app_update_close.png" @click.stop="
|
|
146
|
+
<image v-if="!data.isForce" class="close-img" src="../../static/app_update_close.png" @click.stop="close"></image>
|
|
134
147
|
</view>
|
|
135
148
|
</view>
|
|
136
149
|
</template>
|