stellar-ui-v2 1.40.28 → 1.40.30
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.
- package/README.md +8 -8
- package/components/ste-app-update/README.md +52 -13
- package/components/ste-app-update/method.js +102 -4
- package/components/ste-app-update/ste-app-update.vue +339 -76
- package/components/ste-date-picker/ste-date-picker.vue +391 -391
- package/components/ste-index-list/README.md +6 -6
- package/components/ste-marquee/README.md +168 -0
- package/components/ste-marquee/config.json +5 -0
- package/components/ste-marquee/ste-marquee.vue +347 -0
- package/components/ste-message-box/ste-message-box.js +72 -72
- package/components/ste-message-box/ste-message-box.vue +364 -364
- package/components/ste-notice-bar/ste-notice-bar.vue +264 -261
- package/components/ste-page-container/README.md +83 -83
- package/components/ste-page-container/WORKLOG-2026-03-12.md +229 -229
- package/components/ste-page-container/ste-page-container.vue +190 -190
- package/components/ste-popup/README.md +16 -16
- package/components/ste-popup/ste-popup.vue +392 -392
- package/components/ste-price/ste-price.vue +256 -256
- package/components/ste-radio/README.md +16 -16
- package/components/ste-rate/README.md +13 -13
- package/components/ste-select/datetime.vue +106 -106
- package/components/ste-slider/ste-slider.vue +552 -552
- package/components/ste-table-column/checkbox-icon.vue +65 -65
- package/components/ste-table-column/radio-icon.vue +110 -110
- package/components/ste-table-column/sub-table.vue +116 -116
- package/components/ste-tabs/props.js +212 -212
- package/components/ste-toast/ste-toast.js +69 -69
- package/components/ste-video/ste-video.vue +756 -756
- package/package.json +26 -18
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
## ✨ 特性
|
|
12
12
|
|
|
13
|
-
- 🎯 多平台覆盖,支持 微信小程序、支付宝小程序、H5.
|
|
14
|
-
- 🚀 40+ 个高质量组件,覆盖移动端主流场景.
|
|
15
|
-
- 📖 提供丰富的文档和组件示例.
|
|
13
|
+
- 🎯 多平台覆盖,支持 微信小程序、支付宝小程序、H5.
|
|
14
|
+
- 🚀 40+ 个高质量组件,覆盖移动端主流场景.
|
|
15
|
+
- 📖 提供丰富的文档和组件示例.
|
|
16
16
|
- 🎨 支持修改 CSS 变量实现主题定制.
|
|
17
17
|
|
|
18
18
|
## 📱 预览
|
|
@@ -75,11 +75,11 @@ npm i stellar-ui-v2 -S
|
|
|
75
75
|
|
|
76
76
|
## 周边生态
|
|
77
77
|
|
|
78
|
-
| 项目 | 描述 |
|
|
79
|
-
| --- | --- |
|
|
80
|
-
|[StellarUI-Plus](https://github.com/wuhanshuzhiyun/stellar-ui-plus) | 一个基于vue3构建,打造的uni-app组件库 |
|
|
81
|
-
|[ste-vue-inset-loader](https://github.com/wuhanshuzhiyun/ste-vue-inset-loader) |常用于小程序需要全局引入组件的场景的包 |
|
|
82
|
-
|[ste-helper](https://github.com/wuhanshuzhiyun/stellar-ui-plus/tree/main/plugins/ste-helper) |旨在帮助开发者更加有效率的使用 StellarUI-Plus来开发项目的vscode插件 |
|
|
78
|
+
| 项目 | 描述 |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
|[StellarUI-Plus](https://github.com/wuhanshuzhiyun/stellar-ui-plus) | 一个基于vue3构建,打造的uni-app组件库 |
|
|
81
|
+
|[ste-vue-inset-loader](https://github.com/wuhanshuzhiyun/ste-vue-inset-loader) |常用于小程序需要全局引入组件的场景的包 |
|
|
82
|
+
|[ste-helper](https://github.com/wuhanshuzhiyun/stellar-ui-plus/tree/main/plugins/ste-helper) |旨在帮助开发者更加有效率的使用 StellarUI-Plus来开发项目的vscode插件 |
|
|
83
83
|
|[ste-cli](https://github.com/wuhanshuzhiyun/ste-cli) |stellar配套的脚手架 |
|
|
84
84
|
|
|
85
85
|
## 核心团队
|
|
@@ -9,9 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
- 属性`clientId`用于设置APP的应用编码
|
|
11
11
|
- 属性`clientSecret`用于设置APP的应用密钥
|
|
12
|
+
- 属性`fallbackApiUrl`用于设置兜底检查接口地址
|
|
12
13
|
- 函数`start`用于开始检查更新
|
|
14
|
+
- 函数`getSkippedVersions`用于获取跳过版本列表
|
|
15
|
+
- 函数`clearSkippedVersions`用于清空跳过版本记录
|
|
13
16
|
- 回调事件`cancel`取消更新
|
|
14
|
-
- 回调事件`
|
|
17
|
+
- 回调事件`update`发现新版时触发
|
|
18
|
+
- 回调事件`no-update`没有新版时触发
|
|
19
|
+
- 回调事件`skip-version`跳过版本时触发
|
|
20
|
+
- 回调事件`fallback`命中兜底更新时触发
|
|
15
21
|
|
|
16
22
|
```html
|
|
17
23
|
<script>
|
|
@@ -31,12 +37,34 @@ export default {
|
|
|
31
37
|
});
|
|
32
38
|
}
|
|
33
39
|
},
|
|
40
|
+
// 获取跳过版本列表
|
|
41
|
+
getSkippedList() {
|
|
42
|
+
if (this.$refs.appUpdate) {
|
|
43
|
+
const list = this.$refs.appUpdate.getSkippedVersions();
|
|
44
|
+
console.log('已跳过的版本:', list);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// 清空跳过记录
|
|
48
|
+
clearSkipped() {
|
|
49
|
+
if (this.$refs.appUpdate) {
|
|
50
|
+
this.$refs.appUpdate.clearSkippedVersions();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
34
53
|
},
|
|
35
54
|
};
|
|
36
55
|
</script>
|
|
37
56
|
<template>
|
|
38
|
-
<ste-app-update
|
|
57
|
+
<ste-app-update
|
|
58
|
+
ref="appUpdate"
|
|
59
|
+
clientId="workbench_android"
|
|
60
|
+
clientSecret="gkS6lEEncqAocYK2qsrvPQZykm3ISeMx"
|
|
61
|
+
fallbackApiUrl="https://example.com/api/app-update/check"
|
|
62
|
+
@skip-version="onSkipVersion"
|
|
63
|
+
@fallback="onFallback"
|
|
64
|
+
></ste-app-update>
|
|
39
65
|
<button @click="checkForUpdates">检查更新</button>
|
|
66
|
+
<button @click="getSkippedList">获取跳过版本列表</button>
|
|
67
|
+
<button @click="clearSkipped">清空跳过记录</button>
|
|
40
68
|
</template>
|
|
41
69
|
```
|
|
42
70
|
|
|
@@ -45,23 +73,34 @@ export default {
|
|
|
45
73
|
### API
|
|
46
74
|
|
|
47
75
|
#### Props
|
|
48
|
-
| 属性名 | 说明
|
|
49
|
-
| ----- | -----
|
|
50
|
-
| `clientId` | 应用编码
|
|
51
|
-
| `clientSecret`| 应用密钥
|
|
52
|
-
| `apiUrl` | 更新API地址
|
|
53
|
-
| `appType` | APP环境,版本号的最后一位为环境标识 | `string`
|
|
54
|
-
| `btnText` | 立即体验按钮文本
|
|
55
|
-
| `appVersion` | 应用当前版本
|
|
56
|
-
| `zIndex` | 弹窗层级
|
|
76
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
77
|
+
| ----- | ----- | --- | ------- | ------| --------|
|
|
78
|
+
| `clientId` | 应用编码 | `string` | - | - | - |
|
|
79
|
+
| `clientSecret`| 应用密钥 | `string` | - | - | - |
|
|
80
|
+
| `apiUrl` | 更新API地址 | `string` | `https://zboa.whzb.com/inte-cloud-dev/blade-system/api/inte/client/ver/currentDetail` | - | - |
|
|
81
|
+
| `appType` | APP环境,版本号的最后一位为环境标识 | `string` | - | - | - |
|
|
82
|
+
| `btnText` | 立即体验按钮文本 | `string` | `立即体验` | - | - |
|
|
83
|
+
| `appVersion` | 应用当前版本 | `string` | - | - | `1.40.9`|
|
|
84
|
+
| `zIndex` | 弹窗层级 | `string/number` | `998` | - | `1.40.9`|
|
|
85
|
+
| `fallbackApiUrl`| 兜底检查接口地址 | `string` | - | - | `1.41.0`|
|
|
57
86
|
|
|
58
87
|
|
|
59
88
|
#### Events
|
|
60
89
|
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
61
90
|
| ----- | ----- | ------- | -------- |
|
|
62
91
|
| `cancel` | 取消更新 | - | - |
|
|
63
|
-
| `update` |
|
|
64
|
-
| `no-update` |
|
|
92
|
+
| `update` | 发现新版时触发 | - | - |
|
|
93
|
+
| `no-update` | 没有新版时触发 | - | - |
|
|
94
|
+
| `skip-version` | 跳过版本时触发 | version: string | `1.41.0` |
|
|
95
|
+
| `fallback` | 命中兜底更新时触发 | { title, description, downloadUrl } | `1.41.0` |
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
#### Methods
|
|
99
|
+
| 方法名 | 说明 | 返回值 | 支持版本 |
|
|
100
|
+
| ----- | ----- | ----- | -------- |
|
|
101
|
+
| `start(callback)` | 开始检查更新 | - | - |
|
|
102
|
+
| `getSkippedVersions()` | 获取已跳过的版本列表 | string[] | `1.41.0` |
|
|
103
|
+
| `clearSkippedVersions()` | 清空跳过版本记录 | - | `1.41.0` |
|
|
65
104
|
|
|
66
105
|
|
|
67
106
|
---$
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
export function download(data, { success, error, onProgressUpdate, downloadSuccess }) {
|
|
2
2
|
const package_type = data.package_type;
|
|
3
|
+
let timeout;
|
|
4
|
+
|
|
5
|
+
// 参数验证
|
|
6
|
+
if (!data.updateFile) {
|
|
7
|
+
const errorMsg = '更新文件地址不能为空';
|
|
8
|
+
uni.showToast({ title: errorMsg, icon: 'none' });
|
|
9
|
+
error && error(new Error(errorMsg));
|
|
10
|
+
throw new Error(errorMsg);
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
const downloadTask = uni.downloadFile({
|
|
4
14
|
url: data.updateFile,
|
|
5
15
|
success: (res) => {
|
|
16
|
+
clearTimeout(timeout);
|
|
17
|
+
|
|
6
18
|
if (res.statusCode === 200) {
|
|
19
|
+
// 文件完整性检查
|
|
20
|
+
if (!res.tempFilePath) {
|
|
21
|
+
const errorMsg = '下载文件路径为空';
|
|
22
|
+
uni.showToast({ title: errorMsg, icon: 'none' });
|
|
23
|
+
error && error(new Error(errorMsg));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
7
27
|
downloadSuccess && downloadSuccess(res.tempFilePath);
|
|
28
|
+
|
|
8
29
|
plus.runtime.install(
|
|
9
30
|
res.tempFilePath,
|
|
10
31
|
{ force: true },
|
|
@@ -27,10 +48,11 @@ export function download(data, { success, error, onProgressUpdate, downloadSucce
|
|
|
27
48
|
}
|
|
28
49
|
},
|
|
29
50
|
(e) => {
|
|
30
|
-
|
|
51
|
+
// 提示部分wgt包无法安装的问题
|
|
52
|
+
const errorMsg = e.message || '安装失败';
|
|
31
53
|
uni.showModal({
|
|
32
54
|
title: '提示',
|
|
33
|
-
content:
|
|
55
|
+
content: errorMsg,
|
|
34
56
|
showCancel: false,
|
|
35
57
|
success: () => {
|
|
36
58
|
error && error(e);
|
|
@@ -38,11 +60,87 @@ export function download(data, { success, error, onProgressUpdate, downloadSucce
|
|
|
38
60
|
});
|
|
39
61
|
}
|
|
40
62
|
);
|
|
63
|
+
} else {
|
|
64
|
+
const errorMsg = `下载失败,状态码:${res.statusCode}`;
|
|
65
|
+
uni.showToast({ title: errorMsg, icon: 'none' });
|
|
66
|
+
error && error(new Error(errorMsg));
|
|
41
67
|
}
|
|
42
68
|
},
|
|
69
|
+
fail: (err) => {
|
|
70
|
+
clearTimeout(timeout);
|
|
71
|
+
const errorMsg = `网络请求失败:${err.errMsg || '未知错误'}`;
|
|
72
|
+
uni.showToast({ title: errorMsg, icon: 'none' });
|
|
73
|
+
error && error(err);
|
|
74
|
+
}
|
|
43
75
|
});
|
|
44
|
-
|
|
76
|
+
|
|
77
|
+
// 下载进度监控
|
|
45
78
|
downloadTask.onProgressUpdate((res) => {
|
|
46
|
-
|
|
79
|
+
// 添加进度验证
|
|
80
|
+
if (res.progress >= 0 && res.progress <= 100) {
|
|
81
|
+
onProgressUpdate && onProgressUpdate(res);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 重置超时计时器
|
|
85
|
+
clearTimeout(timeout);
|
|
86
|
+
timeout = setTimeout(() => {
|
|
87
|
+
downloadTask.abort();
|
|
88
|
+
const errorMsg = '下载超时,请检查网络连接';
|
|
89
|
+
uni.showToast({ title: errorMsg, icon: 'none' });
|
|
90
|
+
error && error(new Error(errorMsg));
|
|
91
|
+
}, 300000); // 5分钟超时
|
|
47
92
|
});
|
|
93
|
+
|
|
94
|
+
// 初始超时设置
|
|
95
|
+
timeout = setTimeout(() => {
|
|
96
|
+
downloadTask.abort();
|
|
97
|
+
const errorMsg = '下载超时,请检查网络连接';
|
|
98
|
+
uni.showToast({ title: errorMsg, icon: 'none' });
|
|
99
|
+
error && error(new Error(errorMsg));
|
|
100
|
+
}, 300000);
|
|
101
|
+
|
|
102
|
+
return downloadTask;
|
|
48
103
|
}
|
|
104
|
+
|
|
105
|
+
// 获取设备唯一标识
|
|
106
|
+
export const getDeviceId = () => {
|
|
107
|
+
// #ifdef APP-PLUS
|
|
108
|
+
return plus.device.uuid || '';
|
|
109
|
+
// #endif
|
|
110
|
+
// #ifndef APP-PLUS
|
|
111
|
+
return '';
|
|
112
|
+
// #endif
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// 获取当前平台
|
|
116
|
+
export const getPlatform = () => {
|
|
117
|
+
// #ifdef APP-PLUS
|
|
118
|
+
return plus.os.name?.toLowerCase() || 'android';
|
|
119
|
+
// #endif
|
|
120
|
+
// #ifndef APP-PLUS
|
|
121
|
+
return 'unknown';
|
|
122
|
+
// #endif
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// 获取APPID
|
|
126
|
+
export const getAppId = () => {
|
|
127
|
+
// #ifdef APP-PLUS
|
|
128
|
+
return plus.runtime.appid || '';
|
|
129
|
+
// #endif
|
|
130
|
+
// #ifndef APP-PLUS
|
|
131
|
+
return '';
|
|
132
|
+
// #endif
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// 获取当前版本号
|
|
136
|
+
export const getVersion = (appVersion) => {
|
|
137
|
+
return new Promise((resolve) => {
|
|
138
|
+
if (appVersion) {
|
|
139
|
+
resolve(appVersion);
|
|
140
|
+
} else {
|
|
141
|
+
plus.runtime.getProperty(plus.runtime.appid || '', (inf) => {
|
|
142
|
+
resolve(inf.version || '');
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
};
|