stellar-ui-plus 1.21.3 → 1.21.5

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.
@@ -0,0 +1,6 @@
1
+ #### Props
2
+ | 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
3
+ | ----- | ----- | --- | ------- | ------ | -------- |
4
+ | `title` | 尺寸 | `string` | `日期选择` | - | - |
5
+
6
+
@@ -0,0 +1,36 @@
1
+ # AppUpdate App更新
2
+
3
+ 此组件用于APP更新功能
4
+
5
+ ---$
6
+
7
+ ### 基础用法
8
+
9
+ - 属性`height`用于设置日历的高度,单位为`rpx`,默认`100%`
10
+ - 属性`showTitle`用于设置是否显示日历的标题,默认`true`
11
+ - 属性`title`用户设置日历的标题,默认`日期选择`
12
+ - 事件`confirm`用于监听用户点击确定按钮事件,参数为选中的日期数组
13
+
14
+ ```html
15
+ <script setup lang="ts">
16
+ const handleConfirm = (v: (string | number)[]) => {
17
+ toast.showToast({
18
+ title: '确定选择:' + v.join(' '),
19
+ icon: 'none',
20
+ duration: 1500,
21
+ });
22
+ };
23
+ </script>
24
+ <template>
25
+ <ste-calendar height="720" :showTitle="false" @confirm="handleConfirm" />
26
+ </template>
27
+ ```
28
+
29
+ ---$
30
+
31
+ ### API
32
+
33
+ <!-- props -->
34
+
35
+ ---$
36
+ {{xuyajun}}
@@ -0,0 +1,5 @@
1
+ {
2
+ "group": "业务组件",
3
+ "title": "AppUpdate APP更新",
4
+ "icon": "https://image.whzb.com/chain/StellarUI/%E7%BB%84%E4%BB%B6%E5%9B%BE%E6%A0%87/button.png"
5
+ }
@@ -0,0 +1,9 @@
1
+ import type { PropType } from 'vue';
2
+ export default {
3
+ Authorization: { type: String, default: () => 'Basic c2FiZXIzOnNhYmVyM19zZWNyZXQ=' },
4
+ BladeAuth: {
5
+ type: String,
6
+ default: () =>
7
+ 'bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJibGFkZXguY24iLCJhdWQiOlsiYmxhZGV4Il0sInRva2VuX3R5cGUiOiJhY2Nlc3NfdG9rZW4iLCJjbGllbnRfaWQiOiJzYWJlcjMiLCJ0ZW5hbnRfaWQiOiI0ODI4MzEiLCJ1c2VyX2lkIjoiMTc3MjA5NjkzNjg3MjU3NDk3NyIsImRlcHRfaWQiOiIxNzcyMDk2OTM2MjcyNzg5NTA1IiwicG9zdF9pZCI6IjE3NzIwOTY5MzYzMTg5MjY4NTAiLCJyb2xlX2lkIjoiMTc3MjA5NjkzNTg5MTEwNzg0MiIsIm9hdXRoX2lkIjoiIiwiYWNjb3VudCI6ImFkbWluIiwidXNlcl9uYW1lIjoiYWRtaW4iLCJuaWNrX25hbWUiOiLnrqHnkIblkZgiLCJyZWFsX25hbWUiOiLnrqHnkIblkZgiLCJyb2xlX25hbWUiOiJhZG1pbiIsImRldGFpbCI6eyJ0eXBlIjoid2ViIiwiZGF0YVNjb3BlIjp7ImNoYWluQ2xpZW50SWQiOiIiLCJzdG9yZUlkIjoiIiwiY2hhbm5lbElkIjoiNjIwOTAxNyJ9fSwiZXhwIjoxNzYyOTEzNjQ4LCJuYmYiOjE3MzEzNzc2NDh9.WQMy9ixwsB3k3okaz8iEOgQJjHd2BRdTfRiAu6HSTSU',
8
+ },
9
+ };
@@ -0,0 +1,307 @@
1
+ <template>
2
+ <view class="update-mask flex-center">
3
+ <view class="content botton-radius">
4
+ <view class="content-top">
5
+ <view class="content-top-text">
6
+ <text class="">发现新版本 v{{ data.edition_name }}</text>
7
+ <text class="version">当前版本:{{ version }}</text>
8
+ </view>
9
+ <image class="content-top" style="top: 0" width="100%" height="100%" src="../../static/bg_top.png"></image>
10
+ </view>
11
+ <view class="content-header"></view>
12
+ <view class="content-body">
13
+ <view class="title"><text>更新内容</text></view>
14
+ <view class="body">
15
+ <scroll-view class="box-des-scroll" scroll-y="true"><rich-text :nodes="data.describe"></rich-text></scroll-view>
16
+ </view>
17
+ <view class="footer flex-center">
18
+ <view class="progress-box flex-column" v-if="!updateBtn">
19
+ <progress class="progress" border-radius="35" :percent="percent" activeColor="#3DA7FF" show-info stroke-width="10" />
20
+ <!-- <u-line-progress :striped="true" :percent="percent" :striped-active="true"></u-line-progress> -->
21
+ <view>
22
+ <text class="fs24">正在下载,请稍后 ({{ downloadedSize }}/{{ packageFileSize }}M)</text>
23
+ </view>
24
+ </view>
25
+
26
+ <button class="content-button" style="border: none; color: #fff" plain @click="confirm" v-if="updateBtn">立即升级</button>
27
+ </view>
28
+ </view>
29
+
30
+ <image v-if="cancleBtn" class="close-img" src="../../static/app_update_close.png" @click.stop="cancel"></image>
31
+ </view>
32
+ </view>
33
+ </template>
34
+
35
+ <script>
36
+ export default {
37
+ props: {
38
+ data: {
39
+ type: Object,
40
+ default: () => ({
41
+ describe: '1. 修复已知问题<br>2. 优化用户体验',
42
+ edition_url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-6bef1fe3-e3e3-4909-9f0c-6ed9bd11c93b/aae2360a-6628-4c93-b873-ce1600b9a852.apk', //安装包下载地址或者通用应用市场地址
43
+ edition_force: 1, //是否强制更新 0代表否 1代表是
44
+ package_type: 0, //0是整包升级 1是wgt升级
45
+ edition_name: '1.0.1', //后端返回的版本名称
46
+ }),
47
+ },
48
+ },
49
+ data() {
50
+ return {
51
+ version: '1.0.0', //当前运行版本(打包时manifest里的版本名称)
52
+ percent: 0, //进度条百分比
53
+ updateBtn: true, //是否显示立即更新
54
+ cancleBtn: false, //是否显示取消按钮
55
+ downloadedSize: 0, //当前已下载大小
56
+ packageFileSize: 0, //安装包大小
57
+ };
58
+ },
59
+ onHide() {
60
+ //解决应用切换到后台再次打开更新弹窗叠加多个的问题
61
+ // console.log('切换到后台');
62
+ this.data.edition_force = 0;
63
+ uni.navigateBack({
64
+ delta: 1,
65
+ });
66
+ },
67
+ onLoad({ obj }) {
68
+ this.data = JSON.parse(obj);
69
+ if (this.data.edition_force == 0) {
70
+ this.cancleBtn = true;
71
+ }
72
+ plus.runtime.getProperty(plus.runtime.appid, inf => {
73
+ this.version = inf.version;
74
+ });
75
+ },
76
+
77
+ onBackPress() {
78
+ // 强制更新不允许返回
79
+ if (this.data.edition_force == 1) {
80
+ return true;
81
+ }
82
+ },
83
+
84
+ methods: {
85
+ cancel() {
86
+ //取消升级 返回上一页
87
+ uni.navigateBack({
88
+ delta: 1,
89
+ });
90
+ },
91
+ confirm() {
92
+ if (this.data.package_type == 0) {
93
+ //apk整包升级 下载地址必须以.apk结尾
94
+ if (this.data.edition_url.includes('.apk')) {
95
+ this.updateBtn = false;
96
+ this.cancleBtn = false;
97
+ this.download();
98
+ } else {
99
+ //外部下载 一般是手机应用市场或者其他h5页面
100
+ this.data.edition_force = 0; // 解决跳转外部链接后,更新提示还在的问题
101
+ plus.runtime.openURL(this.data.edition_url);
102
+ uni.navigateBack({
103
+ delta: 1,
104
+ });
105
+ }
106
+ } else {
107
+ this.updateBtn = false;
108
+ this.cancleBtn = false;
109
+ //wgt资源包升级 下载地址必须以.wgt结尾
110
+ this.download();
111
+ }
112
+ },
113
+ download() {
114
+ let package_type = this.data.package_type;
115
+ let that = this;
116
+ const downloadTask = uni.downloadFile({
117
+ url: this.data.edition_url,
118
+ success: res => {
119
+ if (res.statusCode === 200) {
120
+ plus.runtime.install(
121
+ res.tempFilePath,
122
+ {
123
+ force: true, //true表示强制安装,不进行版本号的校验;false则需要版本号校验,
124
+ },
125
+ function () {
126
+ // console.log('success', success);
127
+ if (package_type == 1) {
128
+ plus.runtime.restart();
129
+ }
130
+ },
131
+ function (e) {
132
+ //提示部分wgt包无法安装的问题
133
+ that.data.edition_force = 0;
134
+ uni.showToast({
135
+ title: e.message,
136
+ icon: 'none',
137
+ duration: 2500,
138
+ });
139
+ setTimeout(() => {
140
+ uni.navigateBack();
141
+ }, 2000);
142
+ }
143
+ );
144
+ if (package_type == 0) {
145
+ // 解决安装app点击取消,更新还在的问题
146
+ this.data.edition_force = 0;
147
+ uni.navigateBack();
148
+ }
149
+ }
150
+ },
151
+ });
152
+ // 进度条
153
+ downloadTask.onProgressUpdate(res => {
154
+ this.percent = res.progress;
155
+ this.downloadedSize = (res.totalBytesWritten / Math.pow(1024, 2)).toFixed(2);
156
+ this.packageFileSize = (res.totalBytesExpectedToWrite / Math.pow(1024, 2)).toFixed(2);
157
+ });
158
+ },
159
+ },
160
+ };
161
+ </script>
162
+
163
+ <style>
164
+ page {
165
+ background: transparent;
166
+ }
167
+
168
+ .flex-center {
169
+ /* #ifndef APP-NVUE */
170
+ display: flex;
171
+ /* #endif */
172
+ justify-content: center;
173
+ align-items: center;
174
+ }
175
+
176
+ .update-mask {
177
+ position: fixed;
178
+ left: 0;
179
+ top: 0;
180
+ right: 0;
181
+ bottom: 0;
182
+ background-color: rgba(0, 0, 0, 0.65);
183
+ }
184
+
185
+ .botton-radius {
186
+ border-bottom-left-radius: 30rpx;
187
+ border-bottom-right-radius: 30rpx;
188
+ }
189
+
190
+ .content {
191
+ position: relative;
192
+ top: 0;
193
+ width: 600rpx;
194
+ background-color: #fff;
195
+ box-sizing: border-box;
196
+ padding: 0 50rpx;
197
+ font-family: Source Han Sans CN;
198
+ }
199
+
200
+ .text {
201
+ /* #ifndef APP-NVUE */
202
+ display: block;
203
+ /* #endif */
204
+ line-height: 200px;
205
+ text-align: center;
206
+ color: #ffffff;
207
+ }
208
+
209
+ .content-top {
210
+ position: absolute;
211
+ top: -195rpx;
212
+ left: 0;
213
+ width: 600rpx;
214
+ height: 270rpx;
215
+ }
216
+
217
+ .content-top-text {
218
+ font-size: 40rpx;
219
+ font-weight: bold;
220
+ color: #f8f8fa;
221
+ position: absolute;
222
+ top: 120rpx;
223
+ left: 50rpx;
224
+ z-index: 1;
225
+ display: flex;
226
+ flex-direction: column;
227
+ }
228
+
229
+ .content-header {
230
+ height: 70rpx;
231
+ }
232
+
233
+ .title {
234
+ font-size: 33rpx;
235
+ font-weight: bold;
236
+ color: #3da7ff;
237
+ line-height: 38px;
238
+ }
239
+
240
+ .footer {
241
+ height: 150rpx;
242
+ display: flex;
243
+ align-items: center;
244
+ justify-content: space-around;
245
+ }
246
+
247
+ .box-des-scroll {
248
+ box-sizing: border-box;
249
+ padding: 0 40rpx;
250
+ text-align: left;
251
+ }
252
+
253
+ .box-des {
254
+ font-size: 26rpx;
255
+ color: #000000;
256
+ line-height: 50rpx;
257
+ }
258
+
259
+ .progress-box {
260
+ width: 100%;
261
+ }
262
+
263
+ .progress {
264
+ width: 83%;
265
+ height: 40rpx;
266
+ border-radius: 35px;
267
+ }
268
+
269
+ .close-img {
270
+ width: 70rpx;
271
+ height: 70rpx;
272
+ z-index: 1000;
273
+ position: absolute;
274
+ bottom: -120rpx;
275
+ left: calc(50% - 70rpx / 2);
276
+ }
277
+
278
+ .content-button {
279
+ text-align: center;
280
+ flex: 1;
281
+ font-size: 30rpx;
282
+ font-weight: 400;
283
+ color: #ffffff;
284
+ border-radius: 40rpx;
285
+ margin: 0 18rpx;
286
+
287
+ height: 80rpx;
288
+ line-height: 80rpx;
289
+
290
+ background: linear-gradient(to right, #1785ff, #3da7ff);
291
+ }
292
+
293
+ .flex-column {
294
+ display: flex;
295
+ flex-direction: column;
296
+ align-items: center;
297
+ }
298
+ .fs24 {
299
+ font-size: 24rpx;
300
+ }
301
+ .version {
302
+ font-size: 24rpx;
303
+ margin-top: 10rpx;
304
+ color: #eeeeee;
305
+ text-decoration: underline;
306
+ }
307
+ </style>
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "ste-app-update",
3
+ "description": "按钮组件",
4
+ "example": "<ste-app-update></ste-app-update>",
5
+ "tutorial": "https://stellar-ui.intecloud.com.cn/plus/#/?active=app-update",
6
+ "attributes": [
7
+ {
8
+ "name": "title",
9
+ "description": "尺寸",
10
+ "type": "string",
11
+ "default": "日期选择"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,74 @@
1
+ <script setup lang="ts">
2
+ import { watch, onMounted, computed, nextTick } from 'vue';
3
+ import propsData from './props';
4
+ import UniUpdate from './rt-uni-update.vue';
5
+
6
+ const props = defineProps(propsData);
7
+
8
+ interface Data {
9
+ id: number;
10
+ createUser: number;
11
+ createDept: number;
12
+ createTime: string;
13
+ updateUser: number;
14
+ updateTime: string;
15
+ status: number;
16
+ isDeleted: number;
17
+ tenantId: string;
18
+ /** 应用id(关联inte_client表id字段) */
19
+ inteClientId: number;
20
+ /** 版本号 */
21
+ code: string;
22
+ /** 版本名称 */
23
+ name: string;
24
+ /** 版本说明 */
25
+ desc: string;
26
+ /** 版本更新内容 */
27
+ content: string;
28
+ /** 版本更新文件地址 */
29
+ updateFile: string;
30
+ /** 版本完整文件地址 */
31
+ entireFile: string;
32
+ /** 是否当前版本 */
33
+ isCurrent: true;
34
+ /** 是否强制更新 */
35
+ isForce: true;
36
+ /** 发布状态 TO_RELEASE待发布、RELEASED已发布 */
37
+ publishStatus: 'TO_RELEASE' | 'RELEASED';
38
+ createUserName: string;
39
+ updateUserName: string;
40
+ createDeptName: string;
41
+ }
42
+
43
+ uni.request({
44
+ url: 'http://172.16.118.216:30043/blade-system/api/inte/client/ver/currentDetail',
45
+ method: 'GET',
46
+ header: {
47
+ Authorization: props.Authorization,
48
+ 'Blade-Auth': props.BladeAuth,
49
+ },
50
+ success: (res: any) => {
51
+ const data: {
52
+ code: number;
53
+ success: boolean;
54
+ msg: string;
55
+ data: Data;
56
+ } = res.data;
57
+ if (data.code == 200) {
58
+ console.log(data.data);
59
+ } else {
60
+ console.log(data.msg);
61
+ }
62
+ },
63
+ });
64
+ </script>
65
+ <template>
66
+ <view class="ste-app-update-root">
67
+ <UniUpdate />
68
+ </view>
69
+ </template>
70
+
71
+ <style lang="scss" scoped>
72
+ .ste-app-update-root {
73
+ }
74
+ </style>
@@ -28,6 +28,7 @@
28
28
  | `min` | 步进器最小值 | `number` | `1` | - | - |
29
29
  | `max` | 步进器最大值 | `number` | `9999` | - | - |
30
30
  | `suggestData` | 建议数据集,不传则不展示建议模块 | `{title?: string;number?: number;applyForText?: string;applyForNumber?: number;items: { label: string; value: number }[];}` | - | - | - |
31
+ | `readonlySuggestInput` | 建议右侧申请输入框只读 | `boolean` | - | - | - |
31
32
 
32
33
 
33
34
  #### Events
@@ -39,3 +40,4 @@
39
40
  | `minus` | 点击减号前置钩子函数 | `value`:改变后的绑定值<br/>`suspend`:等待<br/>`next`:继续<br/>`stop`:停止 | - |
40
41
  | `click-suggest` | 点击建议模块触发 | `type`:点击的区域:`method`, `back`, `item`, `right`<br/>`item`:type为item时,点击的item对象 | - |
41
42
  | `click-stepper-input` | 点击步进器输入框触发 | - | - |
43
+ | `click-suggest-input` | 点击建议输入框触发 | - | - |
@@ -154,4 +154,9 @@ export default {
154
154
  suggestData: {
155
155
  type: Object as PropType<SuggestData>,
156
156
  },
157
+ /** 建议右侧的申请输入框只读 */
158
+ readonlySuggestInput: {
159
+ type: Boolean,
160
+ default: () => false,
161
+ },
157
162
  };
@@ -170,6 +170,11 @@
170
170
  "description": "建议数据集,不传则不展示建议模块",
171
171
  "type": "{title?: string;number?: number;applyForText?: string;applyForNumber?: number;items: { label: string; value: number }[];}"
172
172
  },
173
+ {
174
+ "name": "readonlySuggestInput",
175
+ "description": "建议右侧申请输入框只读",
176
+ "type": "boolean"
177
+ },
173
178
 
174
179
  {
175
180
  "name": "[event]change",
@@ -262,6 +267,11 @@
262
267
  "name": "[event]click-stepper-input",
263
268
  "description": "点击步进器输入框触发",
264
269
  "type": "() => void"
270
+ },
271
+ {
272
+ "name": "[event]click-suggest-input",
273
+ "description": "点击建议输入框触发",
274
+ "type": "() => void"
265
275
  }
266
276
  ]
267
277
  }
@@ -20,6 +20,7 @@ const emits = defineEmits<{
20
20
  (e: 'plus', value: number | string, suspend: () => void, next: () => void, stop: () => void): void;
21
21
  (e: 'minus', value: number | string, suspend: () => void, next: () => void, stop: () => void): void;
22
22
  (e: 'click-suggest', type: 'method' | 'back' | 'item' | 'right', item?: { label: string; value: string | number }): void;
23
+ (e: 'click-suggest-input'): void;
23
24
  (e: 'click-stepper-input'): void;
24
25
  }>();
25
26
 
@@ -152,7 +153,8 @@ const clickSuggest = (type: 'method' | 'back' | 'item' | 'right', item?: { label
152
153
  emits('click-suggest', type, item);
153
154
  };
154
155
 
155
- const clickInput = () => emits('click-stepper-input');
156
+ const clickStepperInput = () => emits('click-stepper-input');
157
+ const clickSuggestInput = () => emits('click-suggest-input');
156
158
 
157
159
  const viewClass = computed(() => {
158
160
  const imgSize = utils.formatPx<'num'>(props.imageSize, 'num');
@@ -234,7 +236,7 @@ const viewClass = computed(() => {
234
236
  @change="numberChange"
235
237
  @plus="plus"
236
238
  @minus="minus"
237
- @click-input="clickInput"
239
+ @click-input="clickStepperInput"
238
240
  />
239
241
  </view>
240
242
  </slot>
@@ -248,9 +250,11 @@ const viewClass = computed(() => {
248
250
  <view class="ste-goods-info-apply-for" v-if="suggesData.applyForText">
249
251
  <view class="ste-goods-info-apply-for-text">{{ suggesData.applyForText }}:</view>
250
252
  <view class="ste-goods-info-apply-for-number">
251
- <input class="ste-goods-info-apply-for-input" v-model="suggesData.applyForNumber" />
253
+ <view class="ste-goods-info-apply-for-input" @click.stop="clickSuggestInput">
254
+ <input class="ste-goods-info-apply-for-input" :class="{ readonly: readonlySuggestInput }" v-model="suggesData.applyForNumber" />
255
+ </view>
252
256
  <view class="ste-goods-info-apply-for-back" @click="clickSuggest('back')">
253
- <ste-icon />
257
+ <ste-icon code="&#xe632;" size="16" />
254
258
  </view>
255
259
  </view>
256
260
  </view>
@@ -408,10 +412,17 @@ const viewClass = computed(() => {
408
412
  min-height: 30rpx;
409
413
  font-size: 22rpx;
410
414
  text-align: center;
415
+ &.readonly {
416
+ pointer-events: none;
417
+ }
411
418
  }
412
419
  .ste-goods-info-apply-for-back {
413
420
  width: 32rpx;
414
421
  border-left: 2rpx solid #e6e8ea;
422
+ display: flex;
423
+ align-items: center;
424
+ justify-content: center;
425
+ cursor: pointer;
415
426
  }
416
427
  }
417
428
  }
@@ -1,22 +1,22 @@
1
1
  /* #ifdef APP */
2
2
  /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
3
+ /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
3
4
  @font-face {
4
- font-family: 'ste-iconfont-1709689042473';
5
- /* Project id 4457057 */
6
- src: url('https://at.alicdn.com/t/c/font_4457057_yv7ztjy747.woff2?t=1749632798789') format('woff2'),
7
- url('https://at.alicdn.com/t/c/font_4457057_yv7ztjy747.woff?t=1749632798789') format('woff'),
8
- url('https://at.alicdn.com/t/c/font_4457057_yv7ztjy747.ttf?t=1749632798789') format('truetype');
5
+ font-family: 'ste-iconfont-1709689042473'; /* Project id 4457057 */
6
+ src:
7
+ url('https://at.alicdn.com/t/c/font_4457057_74vgslmjyas.woff2?t=1749781466318') format('woff2'),
8
+ url('https://at.alicdn.com/t/c/font_4457057_74vgslmjyas.woff?t=1749781466318') format('woff'),
9
+ url('https://at.alicdn.com/t/c/font_4457057_74vgslmjyas.ttf?t=1749781466318') format('truetype');
9
10
  }
10
-
11
11
  /* #endif */
12
12
  /* #ifndef APP */
13
13
  /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
14
14
  @font-face {
15
- font-family: 'ste-iconfont-1709689042473';
16
- /* Project id 4457057 */
17
- src: url('//at.alicdn.com/t/c/font_4457057_yv7ztjy747.woff2?t=1749632798789') format('woff2'),
18
- url('//at.alicdn.com/t/c/font_4457057_yv7ztjy747.woff?t=1749632798789') format('woff'),
19
- url('//at.alicdn.com/t/c/font_4457057_yv7ztjy747.ttf?t=1749632798789') format('truetype');
15
+ font-family: 'ste-iconfont-1709689042473'; /* Project id 4457057 */
16
+ src:
17
+ url('//at.alicdn.com/t/c/font_4457057_74vgslmjyas.woff2?t=1749781466318') format('woff2'),
18
+ url('//at.alicdn.com/t/c/font_4457057_74vgslmjyas.woff?t=1749781466318') format('woff'),
19
+ url('//at.alicdn.com/t/c/font_4457057_74vgslmjyas.ttf?t=1749781466318') format('truetype');
20
20
  }
21
21
 
22
- /* #endif */
22
+ /* #endif */
@@ -40,7 +40,7 @@ const cmpCssVar = computed(() => {
40
40
  '--margin-top': utils.formatPx(props.marginTop),
41
41
  '--margin-bottom': utils.formatPx(props.marginBottom),
42
42
  '--font-family': props.fontFamily ? props.fontFamily : defaultFontFamily,
43
- '--display': props.inlineBlock ? 'inline-block' : 'inline-flex',
43
+ '--display': props.inlineBlock ? 'inline-block' : 'block',
44
44
  };
45
45
  });
46
46
 
@@ -23,4 +23,4 @@
23
23
  | `secondaryBtnClick` | 次要按钮点击时触发 | `item`:所点击的按钮项 | - |
24
24
  | `tabChange` | 复杂登录时tab切换时触发 | `item`:当前选项卡项 | - |
25
25
  | `formDataChange` | 复杂登录时输入框或者下拉框改变时触发 | `data`:所有表单值 | - |
26
- | `getCode` | 当配置输入类型为验证码时,点击获取验证码时触发 | - | - |
26
+ | `getCode` | 当配置输入类型为验证码时,点击获取验证码时触发 | `suspend`:等待<br/>`next`:继续<br/>`stop`:停止 | - |
@@ -94,6 +94,7 @@
94
94
  @secondary-btn-click="handleClick"
95
95
  @protocol-click="protocolClick"
96
96
  @form-data-change="formDataChange"
97
+ @get-code="getCode"
97
98
  />
98
99
  </view>
99
100
  </template>
@@ -196,6 +197,16 @@
196
197
  const protocolClick = (item: any) => {
197
198
  console.log(item);
198
199
  };
200
+
201
+ const getCode = (suspend: () => {}, next: () => {}) => {
202
+ suspend();
203
+ console.log('调用获取验证码接口');
204
+
205
+ setTimeout(() => {
206
+ console.log('验证码发送成功,开始倒计时');
207
+ next();
208
+ }, 2000);
209
+ };
199
210
  </script>
200
211
  ```
201
212
 
@@ -112,8 +112,6 @@ const props = defineProps({
112
112
  });
113
113
  const emits = defineEmits(['update:modelValue', 'change', 'getCode']);
114
114
 
115
- console.log('config is ', props.config);
116
-
117
115
  const defaultConfig = {
118
116
  placeholder: '请输入',
119
117
  };
@@ -142,10 +140,28 @@ const handleChange = () => {
142
140
 
143
141
  const defaultCountValue = 60;
144
142
  let codeTimer: any;
145
- const getCode = () => {
143
+ const getCode = async () => {
146
144
  if (count.value > 0) return;
145
+
146
+ let next = true;
147
+ const stop = new Promise<void>((resolve, reject) => {
148
+ emits(
149
+ 'getCode',
150
+ () => (next = false),
151
+ () => resolve(),
152
+ () => reject()
153
+ );
154
+ });
155
+
156
+ if (!next) {
157
+ try {
158
+ await stop;
159
+ } catch (e) {
160
+ return;
161
+ }
162
+ }
163
+
147
164
  count.value = defaultCountValue;
148
- emits('getCode');
149
165
  codeTimer = setInterval(() => {
150
166
  if (count.value <= 0) {
151
167
  clearInterval(codeTimer);
@@ -32,7 +32,7 @@ export const loginEmits = {
32
32
  secondaryBtnClick: (item: BtnItem) => item,
33
33
  tabChange: (item: BaseConfigItem) => item,
34
34
  formDataChange: (data: Record<string, any>) => data,
35
- getCode: () => true,
35
+ getCode: (suspend: () => void, next: () => void, stop: () => void) => typeof suspend === 'function' && typeof next === 'function' && typeof stop === 'function',
36
36
  };
37
37
 
38
38
  export default loginProps;
@@ -145,8 +145,21 @@
145
145
  {
146
146
  "name": "[event]getCode",
147
147
  "description": "当配置输入类型为验证码时,点击获取验证码时触发",
148
- "type": "() => void",
149
- "params": []
148
+ "type": "(suspend: ()=>void,next: ()=>void,stop: ()=>void) => void",
149
+ "params": [
150
+ {
151
+ "name": "suspend",
152
+ "description": "等待"
153
+ },
154
+ {
155
+ "name": "next",
156
+ "description": "继续"
157
+ },
158
+ {
159
+ "name": "stop",
160
+ "description": "停止"
161
+ }
162
+ ]
150
163
  }
151
164
  ]
152
165
  }
@@ -34,7 +34,7 @@
34
34
  <view class="login-tabs-item">
35
35
  <view class="login-module">
36
36
  <template v-for="i in loginGroup[loginCurrentTabIndex].items" :key="i.key">
37
- <login-form-item :config="i" v-model="formData[i.key]" @change="formDataChange($event, i.key)" :color="mainColor" @get-code="emits('getCode')" />
37
+ <login-form-item :config="i" v-model="formData[i.key]" @change="formDataChange($event, i.key)" :color="mainColor" @get-code="handleGetCode" />
38
38
  </template>
39
39
  </view>
40
40
  <view class="protocol-box">
@@ -156,6 +156,11 @@ const handleBtnClick = (item: any, type: 'primary' | 'secondary') => {
156
156
  }
157
157
  };
158
158
 
159
+ const handleGetCode = (suspend: () => void, next: () => void, reject: () => void) => {
160
+ // 向更上层组件发出事件
161
+ emits('getCode', suspend, next, reject);
162
+ };
163
+
159
164
  defineExpose({ formData });
160
165
  </script>
161
166
 
@@ -54,7 +54,7 @@ function backClick() {
54
54
  </script>
55
55
 
56
56
  <template>
57
- <view class="ste-navbar-root" :style="[pageStyle, { paddingTop: `${navbarTop}rpx` }]">
57
+ <view class="ste-navbar-root" :style="[pageStyle, { paddingTop: `${navbarTop}rpx` }]" data-test="navbar">
58
58
  <view class="nav" :style="{ width: `${navbarWidth}rpx`, height: `${navbarHeight}rpx`, backgroundColor: backgroundColor }">
59
59
  <view class="back-box">
60
60
  <view v-if="autoBack" class="back" :style="{ backgroundColor: backBackgroundColor, borderColor: backBorderColor, opacity: backOpacity }">
package/index.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import steAnimate from "./components/ste-animate/ste-animate.vue"
2
2
  export const SteAnimate = steAnimate
3
+ import steAppUpdate from "./components/ste-app-update/ste-app-update.vue"
4
+ export const SteAppUpdate = steAppUpdate
3
5
  import steAreaChart from "./components/ste-area-chart/ste-area-chart.vue"
4
6
  export const SteAreaChart = steAreaChart
5
7
  import steBadge from "./components/ste-badge/ste-badge.vue"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stellar-ui-plus",
3
- "version": "1.21.3",
3
+ "version": "1.21.5",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",
Binary file
Binary file
@@ -1,4 +1,5 @@
1
1
  import steAnimate from "../components/ste-animate/ste-animate.vue"
2
+ import steAppUpdate from "../components/ste-app-update/ste-app-update.vue"
2
3
  import steAreaChart from "../components/ste-area-chart/ste-area-chart.vue"
3
4
  import steBadge from "../components/ste-badge/ste-badge.vue"
4
5
  import steBarChart from "../components/ste-bar-chart/ste-bar-chart.vue"
@@ -84,6 +85,7 @@ import steWatermark from "../components/ste-watermark/ste-watermark.vue"
84
85
  declare module '@vue/runtime-core' {
85
86
  export interface GlobalComponents {
86
87
  SteAnimate: typeof steAnimate;
88
+ SteAppUpdate: typeof steAppUpdate;
87
89
  SteAreaChart: typeof steAreaChart;
88
90
  SteBadge: typeof steBadge;
89
91
  SteBarChart: typeof steBarChart;
@@ -1,4 +1,5 @@
1
1
  import steAnimate from "../components/ste-animate/ste-animate.vue"
2
+ import steAppUpdate from "../components/ste-app-update/ste-app-update.vue"
2
3
  import steAreaChart from "../components/ste-area-chart/ste-area-chart.vue"
3
4
  import steBadge from "../components/ste-badge/ste-badge.vue"
4
5
  import steBarChart from "../components/ste-bar-chart/ste-bar-chart.vue"
@@ -79,6 +80,7 @@ import steUserInfo from "../components/ste-user-info/ste-user-info.vue"
79
80
  import steVideo from "../components/ste-video/ste-video.vue"
80
81
  import steWatermark from "../components/ste-watermark/ste-watermark.vue"
81
82
  export type RefAnimate = InstanceType<typeof steAnimate>
83
+ export type RefAppUpdate = InstanceType<typeof steAppUpdate>
82
84
  export type RefAreaChart = InstanceType<typeof steAreaChart>
83
85
  export type RefBadge = InstanceType<typeof steBadge>
84
86
  export type RefBarChart = InstanceType<typeof steBarChart>