stellar-ui-plus 1.20.22 → 1.20.24

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.
Files changed (34) hide show
  1. package/components/ste-barcode/encode.ts +16 -16
  2. package/components/ste-button/ste-button.vue +7 -0
  3. package/components/ste-category/ste-category.vue +1 -1
  4. package/components/ste-function-list/ATTRIBUTES.md +2 -2
  5. package/components/ste-function-list/ste-function-list.easycom.json +8 -4
  6. package/components/ste-function-list/ste-function-list.vue +16 -23
  7. package/components/ste-goods-info/ATTRIBUTES.md +2 -2
  8. package/components/ste-goods-info/ste-goods-info.easycom.json +3 -3
  9. package/components/ste-goods-info/ste-goods-info.vue +34 -23
  10. package/components/ste-login/ATTRIBUTES.md +4 -1
  11. package/components/ste-login/README.md +114 -17
  12. package/components/ste-login/components/loginFormItem.vue +221 -0
  13. package/components/ste-login/props.ts +6 -1
  14. package/components/ste-login/ste-login.easycom.json +19 -1
  15. package/components/ste-login/ste-login.vue +51 -128
  16. package/components/ste-login/type.d.ts +6 -2
  17. package/components/ste-login-info/ATTRIBUTES.md +3 -4
  18. package/components/ste-login-info/ste-login-info.easycom.json +12 -18
  19. package/components/ste-main-info/ATTRIBUTES.md +17 -0
  20. package/components/ste-order-card/ATTRIBUTES.md +18 -1
  21. package/components/ste-order-card/README.md +134 -8
  22. package/components/ste-order-card/ste-order-card.easycom.json +66 -12
  23. package/components/ste-order-card/ste-order-card.vue +2 -2
  24. package/components/ste-qrcode/uqrcode.js +33 -33
  25. package/components/ste-user-info/ATTRIBUTES.md +7 -0
  26. package/components/ste-user-info/README.md +63 -0
  27. package/components/ste-user-info/props.ts +6 -0
  28. package/components/ste-user-info/ste-user-info.easycom.json +51 -0
  29. package/components/ste-user-info/ste-user-info.vue +57 -8
  30. package/index.ts +2 -2
  31. package/package.json +3 -2
  32. package/types/components.d.ts +2 -2
  33. package/types/refComponents.d.ts +2 -2
  34. package/components/ste-donut-chart/ATTRIBUTES.md +0 -33
@@ -172,7 +172,7 @@ export function stringToCode128(text: string) {
172
172
 
173
173
  codes = codes.concat(codesForChar(b1, b2, barc.currcs))
174
174
  // code C takes 2 chars each time
175
- if (barc.currcs === CODESET.C)
175
+ if (barc.currcs === CODESET.C)
176
176
  i++
177
177
  }
178
178
 
@@ -203,7 +203,7 @@ export function stringToCode128(text: string) {
203
203
  function perhapsCodeC(bytes: number[], codeset: number) {
204
204
  for (let i = 0; i < bytes.length; i++) {
205
205
  const b = bytes[i]
206
- if ((b < 48 || b > 57) && b !== CHAR_TILDE)
206
+ if ((b < 48 || b > 57) && b !== CHAR_TILDE)
207
207
  return codeset
208
208
  }
209
209
  return CODESET.C
@@ -221,13 +221,13 @@ export function stringToCode128(text: string) {
221
221
  if (chr2 === -1) {
222
222
  shifter === SET_CODEB
223
223
  currcs = CODESET.B
224
- }
224
+ }
225
225
  else if (chr2 !== -1 && !charCompatible(chr2, currcs)) {
226
226
  // need to check ahead as well
227
227
  if (charCompatible(chr2, CODESET.A)) {
228
228
  shifter = SET_CODEA
229
229
  currcs = CODESET.A
230
- }
230
+ }
231
231
  else {
232
232
  shifter = SET_CODEB
233
233
  currcs = CODESET.B
@@ -235,7 +235,7 @@ export function stringToCode128(text: string) {
235
235
  }
236
236
  }
237
237
  /* eslint-enable no-unused-expressions */
238
- }
238
+ }
239
239
  else {
240
240
  // if there is a next char AND that next char is also not compatible
241
241
 
@@ -251,11 +251,11 @@ export function stringToCode128(text: string) {
251
251
  currcs = CODESET.A
252
252
  break
253
253
  }
254
- }
254
+ }
255
255
  else {
256
256
  // no need to shift code sets, a temporary SHIFT will suffice
257
257
  shifter = SET_SHIFT
258
- }
258
+ }
259
259
  }
260
260
 
261
261
  // ok some type of shift is nessecary
@@ -263,12 +263,12 @@ export function stringToCode128(text: string) {
263
263
  result.push(shifter)
264
264
  // result.push(codeValue(chr2));-----------------------------------
265
265
  result.push(codeValue(chr1))
266
- }
266
+ }
267
267
  else {
268
268
  if (currcs === CODESET.C) {
269
269
  // include next as well
270
270
  result.push(codeValue(chr1, chr2))
271
- }
271
+ }
272
272
  else {
273
273
  result.push(codeValue(chr1))
274
274
  }
@@ -284,19 +284,19 @@ function codeValue(chr1: number, chr2: any = undefined) {
284
284
  if (typeof chr2 === 'undefined')
285
285
  return chr1 >= 32 ? chr1 - 32 : chr1 + 64
286
286
  else
287
- return Number.parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2))
287
+ return Number.parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2))
288
288
  }
289
289
 
290
290
  function charCompatible(chr: number, codeset: number) {
291
291
  const csa = codeSetAllowedFor(chr)
292
- if (csa === CODESET.ANY)
292
+ if (csa === CODESET.ANY)
293
293
  return true
294
294
  // if we need to change from current
295
- if (csa === CODESET.AB)
295
+ if (csa === CODESET.AB)
296
296
  return true
297
- if (csa === CODESET.A && codeset === CODESET.A)
297
+ if (csa === CODESET.A && codeset === CODESET.A)
298
298
  return true
299
- if (csa === CODESET.B && codeset === CODESET.B)
299
+ if (csa === CODESET.B && codeset === CODESET.B)
300
300
  return true
301
301
  return false
302
302
  }
@@ -305,11 +305,11 @@ function codeSetAllowedFor(chr: number) {
305
305
  if (chr >= 48 && chr <= 57) {
306
306
  // 0-9
307
307
  return CODESET.ANY
308
- }
308
+ }
309
309
  else if (chr >= 32 && chr <= 95) {
310
310
  // 0-9 A-Z
311
311
  return CODESET.AB
312
- }
312
+ }
313
313
  else {
314
314
  // if non printable
315
315
  return chr < 32 ? CODESET.A : CODESET.B
@@ -203,7 +203,14 @@ function handleClick(e: any) {
203
203
  background-size: cover;
204
204
  border-radius: 10rpx;
205
205
  margin: 0;
206
+
207
+ // #ifndef MP-ALIPAY
206
208
  border-width: 10rpx;
209
+ // #endif
210
+
211
+ // #ifdef MP-ALIPAY
212
+ border-width: 2rpx;
213
+ // #endif
207
214
 
208
215
  .btn-box {
209
216
  width: 100%;
@@ -40,7 +40,7 @@ const initData = () => {
40
40
  });
41
41
  };
42
42
 
43
- watch(() => props.data, initData, { immediate: true });
43
+ watch(() => props.data, initData, { immediate: true, deep: true });
44
44
 
45
45
  const handleCategoryClick = (item: CategoryItem, index: number) => {
46
46
  categoryData.forEach((item, i) => {
@@ -18,6 +18,6 @@
18
18
  #### Events
19
19
  | 事件名 | 说明 | 事件参数 | 支持版本 |
20
20
  | ----- | ----- | ------- | -------- |
21
- | `click-header` | 点击列表头部触发 | `type`:点击的区域类型(可选值:`title`, `subhead`,`more`) | - |
22
- | `click-item` | 点击列表项触发 | `type`:点击的区域类型(可选值:`image` , `title` , `subhead` , `status` , `button`) | - |
21
+ | `click-header` | 点击列表头部触发 | `type`:点击的区域类型(可选值:`empty`, `title`, `subhead`,`more`) | - |
22
+ | `click-item` | 点击列表项触发 | `type`:点击的区域类型(可选值:`empty`, `image` , `title` , `subhead` , `status` , `button`)<br/>`item`:当前点击的数据项 | - |
23
23
  | `click-empty` | 数据为空时点击内容触发 | `type`:点击的区域类型(可选值:`image` , `text` , `button`) | - |
@@ -73,22 +73,26 @@
73
73
  {
74
74
  "name": "[event]click-header",
75
75
  "description": "点击列表头部触发",
76
- "type": "(type: 'title' | 'subhead' | 'more') => void",
76
+ "type": "(type: 'empty' | 'title' | 'subhead' | 'more') => void",
77
77
  "params": [
78
78
  {
79
79
  "name": "type",
80
- "description": "点击的区域类型(可选值:`title`, `subhead`,`more`)"
80
+ "description": "点击的区域类型(可选值:`empty`, `title`, `subhead`,`more`)"
81
81
  }
82
82
  ]
83
83
  },
84
84
  {
85
85
  "name": "[event]click-item",
86
86
  "description": "点击列表项触发",
87
- "type": "(type: 'image' | 'title' | 'subhead' | 'status' | 'button') => void",
87
+ "type": "(type: 'empty' | 'image' | 'title' | 'subhead' | 'status' | 'button'; item:FunctionListItem) => void",
88
88
  "params": [
89
89
  {
90
90
  "name": "type",
91
- "description": "点击的区域类型(可选值:`image` , `title` , `subhead` , `status` , `button`)"
91
+ "description": "点击的区域类型(可选值:`empty`, `image` , `title` , `subhead` , `status` , `button`)"
92
+ },
93
+ {
94
+ "name": "item",
95
+ "description": "当前点击的数据项"
92
96
  }
93
97
  ]
94
98
  },
@@ -12,23 +12,23 @@ const rootStyle = computed(() => {
12
12
  });
13
13
 
14
14
  const emits = defineEmits<{
15
- (e: 'click-header', type: 'title' | 'subhead' | 'more'): void;
16
- (e: 'click-item', type: 'image' | 'title' | 'subhead' | 'status' | 'button', item: FunctionListItem): void;
15
+ (e: 'click-header', type: 'empty' | 'title' | 'subhead' | 'more'): void;
16
+ (e: 'click-item', type: 'empty' | 'image' | 'title' | 'subhead' | 'status' | 'button', item: FunctionListItem): void;
17
17
  (e: 'click-empty', type: 'image' | 'text' | 'button'): void;
18
18
  }>();
19
19
 
20
- const onClickHeader = (type: 'title' | 'subhead' | 'more') => emits('click-header', type);
20
+ const onClickHeader = (type: 'empty' | 'title' | 'subhead' | 'more') => emits('click-header', type);
21
21
 
22
- const onClickItem = (type: 'image' | 'title' | 'subhead' | 'status' | 'button', item: FunctionListItem) => emits('click-item', type, item);
22
+ const onClickItem = (type: 'empty' | 'image' | 'title' | 'subhead' | 'status' | 'button', item: FunctionListItem) => emits('click-item', type, item);
23
23
 
24
24
  const onClickEmpty = (type: 'image' | 'text' | 'button') => emits('click-empty', type);
25
25
  </script>
26
26
  <template>
27
27
  <view class="ste-function-list-root" :style="[rootStyle]">
28
- <view class="ste-function-list-header">
28
+ <view class="ste-function-list-header" @click="onClickHeader('empty')">
29
29
  <view class="ste-function-list-header-l">
30
- <view class="ste-function-list-title" @click="onClickHeader('title')">{{ title }}</view>
31
- <view class="ste-function-list-subhead" @click="onClickHeader('subhead')">
30
+ <view class="ste-function-list-title" @click.stop="onClickHeader('title')">{{ title }}</view>
31
+ <view class="ste-function-list-subhead" @click.stop="onClickHeader('subhead')">
32
32
  <slot name="subhead">
33
33
  {{ subhead }}
34
34
  </slot>
@@ -36,7 +36,7 @@ const onClickEmpty = (type: 'image' | 'text' | 'button') => emits('click-empty',
36
36
  </view>
37
37
  <view class="ste-function-list-header-r">
38
38
  <slot name="header-right">
39
- <view class="ste-function-list-more" @click="onClickHeader('more')">
39
+ <view class="ste-function-list-more" @click.stop="onClickHeader('more')">
40
40
  更多
41
41
  <ste-icon code="&#xe674;" color="#353535"></ste-icon>
42
42
  </view>
@@ -45,24 +45,17 @@ const onClickEmpty = (type: 'image' | 'text' | 'button') => emits('click-empty',
45
45
  </view>
46
46
  <view class="ste-function-list-content" v-if="data?.length">
47
47
  <scroll-view scroll-x class="content-list" :class="{ multiple: data?.length > 1 }">
48
- <view class="content-list-item" v-for="(item, index) in data" :key="index">
49
- <view class="content-list-item-image" @click="onClickItem('image', item)">
48
+ <view class="content-list-item" v-for="(item, index) in data" :key="index" @click="onClickItem('empty', item)">
49
+ <view class="content-list-item-image" @click.stop="onClickItem('image', item)">
50
50
  <ste-image :src="item.image" mode="aspectFill"></ste-image>
51
51
  </view>
52
52
  <view class="content-list-item-info">
53
- <view class="content-list-item-info-title" @click="onClickItem('title', item)">{{ item.title }}</view>
54
- <view class="content-list-item-info-subhead" v-if="item.subhead" @click="onClickItem('subhead', item)">{{ item.subhead }}</view>
53
+ <view class="content-list-item-info-title" @click.stop="onClickItem('title', item)">{{ item.title }}</view>
54
+ <view class="content-list-item-info-subhead" v-if="item.subhead" @click.stop="onClickItem('subhead', item)">{{ item.subhead }}</view>
55
55
  <view class="content-list-item-info-footer">
56
- <view class="content-list-item-info-status" @click="onClickItem('status', item)">{{ item.statusText }}</view>
57
- <view class="content-list-item-info-button" v-if="item.buttonText || buttonText || item.buttonIcon || buttonIcon">
58
- <ste-button
59
- :mode="100"
60
- :rootStyle="{ height: '56rpx' }"
61
- type="primary"
62
- @click="onClickItem('button', item)"
63
- :background="item.buttonBg || buttonBg"
64
- :color="item.buttonColor || buttonColor"
65
- >
56
+ <view class="content-list-item-info-status" @click.stop="onClickItem('status', item)">{{ item.statusText }}</view>
57
+ <view class="content-list-item-info-button" v-if="item.buttonText || buttonText || item.buttonIcon || buttonIcon" @click.stop="onClickItem('button', item)">
58
+ <ste-button :mode="100" :rootStyle="{ height: '56rpx' }" type="primary" :background="item.buttonBg || buttonBg" :color="item.buttonColor || buttonColor">
66
59
  <ste-icon :code="item.buttonIcon || buttonIcon" :color="item.buttonColor || buttonColor" />
67
60
  {{ item.buttonText || buttonText }}
68
61
  </ste-button>
@@ -73,7 +66,7 @@ const onClickEmpty = (type: 'image' | 'text' | 'button') => emits('click-empty',
73
66
  </scroll-view>
74
67
  </view>
75
68
  <view class="ste-function-list-empty" v-else>
76
- <ste-image :src="emptyImage" width="96" height="96" @clicl="onClickEmpty('image')" />
69
+ <ste-image :src="emptyImage" width="96" height="96" @click="onClickEmpty('image')" />
77
70
  <view class="empty-message" @click="onClickEmpty('text')">{{ emptyText }}</view>
78
71
  <ste-button :mode="100" :rootStyle="{ height: '56rpx' }" type="primary" :background="buttonBg" :color="buttonColor" @click="onClickEmpty('button')">
79
72
  {{ emptyButtonText }}
@@ -34,8 +34,8 @@
34
34
  | 事件名 | 说明 | 事件参数 | 支持版本 |
35
35
  | ----- | ----- | ------- | -------- |
36
36
  | `change` | 数值/选择改变时触发 | `data`:正在发生改变的数据:{ number?: number; checked?: boolean; applyForNumber?: number }<br/>`goods`:当前商品信息 | - |
37
- | `click` | 点击确定按钮时触发 | `type`:点击位置:'image' / 'title' / 'code' / 'price' / 'originalPrice' / 'stepper' | - |
37
+ | `click` | 点击确定按钮时触发 | `type`:点击位置: `empty` , `image` , `title` , `code` , `price` , `originalPrice` , `stepper` | - |
38
38
  | `plus` | 点击加号前置钩子函数 | `value`:改变后的绑定值<br/>`suspend`:等待<br/>`next`:继续<br/>`stop`:停止 | - |
39
39
  | `minus` | 点击减号前置钩子函数 | `value`:改变后的绑定值<br/>`suspend`:等待<br/>`next`:继续<br/>`stop`:停止 | - |
40
- | `click-suggest` | 点击建议模块触发 | `type`:点击的区域:'method' / 'back' / 'item' / 'right'<br/>`item`:type为item时,点击的item对象 | - |
40
+ | `click-suggest` | 点击建议模块触发 | `type`:点击的区域:`method`, `back`, `item`, `right`<br/>`item`:type为item时,点击的item对象 | - |
41
41
  | `click-stepper-input` | 点击步进器输入框触发 | - | - |
@@ -189,11 +189,11 @@
189
189
  {
190
190
  "name": "[event]click",
191
191
  "description": "点击确定按钮时触发",
192
- "type": "(type: 'image' | 'title' | 'code' | 'price' | 'originalPrice' | 'stepper') => void",
192
+ "type": "(type:'empty' | 'image' | 'title' | 'code' | 'price' | 'originalPrice' | 'stepper') => void",
193
193
  "params": [
194
194
  {
195
195
  "name": "type",
196
- "description": "点击位置:'image' | 'title' | 'code' | 'price' | 'originalPrice' | 'stepper'"
196
+ "description": "点击位置: `empty` , `image` , `title` , `code` , `price` , `originalPrice` , `stepper`"
197
197
  }
198
198
  ]
199
199
  },
@@ -250,7 +250,7 @@
250
250
  "params": [
251
251
  {
252
252
  "name": "type",
253
- "description": "点击的区域:'method' | 'back' | 'item' | 'right'"
253
+ "description": "点击的区域:`method`, `back`, `item`, `right`"
254
254
  },
255
255
  {
256
256
  "name": "item",
@@ -16,7 +16,7 @@ const emits = defineEmits<{
16
16
  (e: 'update:number', number?: number): void;
17
17
  (e: 'update:checked', checked?: boolean): void;
18
18
  (e: 'change', change: { number?: number; checked?: boolean; applyForNumber?: number }, data: GoodsInfoType): void;
19
- (e: 'click', type: 'image' | 'title' | 'code' | 'price' | 'originalPrice' | 'stepper'): void;
19
+ (e: 'click', type: 'empty' | 'image' | 'title' | 'code' | 'price' | 'originalPrice' | 'stepper'): void;
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;
@@ -83,7 +83,7 @@ const checkboxChange = () => {
83
83
  emits('change', { checked: _checked.value }, props.data);
84
84
  };
85
85
 
86
- const onClick = (type: 'image' | 'title' | 'code' | 'price' | 'originalPrice' | 'stepper') => {
86
+ const onClick = (type: 'empty' | 'image' | 'title' | 'code' | 'price' | 'originalPrice' | 'stepper') => {
87
87
  emits('click', type);
88
88
  };
89
89
 
@@ -168,14 +168,14 @@ const viewClass = computed(() => {
168
168
  <view @click="clickChecked" class="ste-goods-info-checkbox left" v-if="checkbox === 'left'">
169
169
  <setCheckbox :disabled="checkboxDisabled" iconSize="30" :model-value="_checked" />
170
170
  </view>
171
- <view class="ste-goods-info-view" :class="viewClass">
172
- <view class="ste-goods-info-image">
173
- <setImage :radius="imageRadius" :src="data.image" :width="imageSize" :height="imageSize" @click="onClick('image')" />
171
+ <view class="ste-goods-info-view" :class="viewClass" @click="onClick('empty')">
172
+ <view class="ste-goods-info-image" @click.stop="onClick('image')">
173
+ <setImage :radius="imageRadius" :src="data.image" :width="imageSize" :height="imageSize" />
174
174
  </view>
175
175
  <view class="ste-goods-info-content">
176
176
  <view class="content-header">
177
177
  <view class="ste-goods-info-header">
178
- <view class="ste-goods-info-title" :style="[titleStyle]" @click="onClick('title')">
178
+ <view class="ste-goods-info-title" :style="[titleStyle]" @click.stop="onClick('title')">
179
179
  <view class="ste-goods-info-tag-box" v-if="data.tag">
180
180
  <view class="ste-goods-info-tag" :style="{ background: _tagBg }">{{ data.tag }}</view>
181
181
  </view>
@@ -185,7 +185,7 @@ const viewClass = computed(() => {
185
185
  <setCheckbox :disabled="checkboxDisabled" iconSize="30" :model-value="_checked" />
186
186
  </view>
187
187
  </view>
188
- <view class="ste-goods-info-codes" @click="onClick('code')">
188
+ <view class="ste-goods-info-codes" @click.stop="onClick('code')">
189
189
  {{ data.code }}
190
190
  <span style="color: #e6e8ea">|</span>
191
191
  {{ data.barCode }}
@@ -196,21 +196,26 @@ const viewClass = computed(() => {
196
196
  </view>
197
197
  <view class="content-footer">
198
198
  <view class="ste-goods-info-price" v-if="showPriceRow">
199
- <view class="ste-goods-info-price-left" v-if="!hidePrice">
200
- <setPrice :value="data.price" :digits="2" bold :styleType="3" :line-price-color="priceColor" :fontSize="priceSize" @click="onClick('price')" />
201
- <setPrice
202
- v-if="data.originalPrice"
203
- :digits="2"
204
- :value="data.originalPrice"
205
- isSuggestPrice
206
- line-price-color="#666666"
207
- marginLeft="16"
208
- fontSize="20"
209
- @click="onClick('originalPrice')"
210
- :showUnit="false"
211
- />
199
+ <view class="ste-goods-info-price-left">
200
+ <block v-if="!hidePrice">
201
+ <view @click.stop="onClick('price')">
202
+ <setPrice :value="data.price" :digits="2" bold :styleType="3" :line-price-color="priceColor" :fontSize="priceSize" />
203
+ </view>
204
+ <view @click.stop="onClick('originalPrice')">
205
+ <setPrice
206
+ v-if="data.originalPrice"
207
+ :digits="2"
208
+ :value="data.originalPrice"
209
+ isSuggestPrice
210
+ line-price-color="#666666"
211
+ marginLeft="16"
212
+ fontSize="20"
213
+ :showUnit="false"
214
+ />
215
+ </view>
216
+ </block>
212
217
  </view>
213
- <view class="ste-goods-info-price-right" @click="onClick('stepper')">
218
+ <view class="ste-goods-info-price-right" @click.stop="onClick('stepper')">
214
219
  <slot name="stepper">
215
220
  <view v-if="stepper" :class="{ readonly: readonlyStepper }" @click.stop="true">
216
221
  <steStepper
@@ -347,10 +352,16 @@ const viewClass = computed(() => {
347
352
 
348
353
  .ste-goods-info-price {
349
354
  width: 100%;
350
- height: 34rpx;
355
+ line-height: 34rpx;
351
356
  display: flex;
352
357
  justify-content: space-between;
353
- align-items: anchor-center;
358
+ align-items: center;
359
+ .ste-goods-info-price-left {
360
+ display: flex;
361
+ flex-direction: row;
362
+ align-items: flex-end;
363
+ }
364
+
354
365
  .ste-goods-info-price-right .readonly {
355
366
  pointer-events: none;
356
367
  }
@@ -2,6 +2,7 @@
2
2
  | 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
3
3
  | ----- | ----- | --- | ------- | ------ | -------- |
4
4
  | `mode` | 登录模式 | `string` | `base` | `base`:基础登录<br/>`mode1`:复杂登录 | - |
5
+ | `color` | 颜色统一设置,包括按钮、输入框图标、协议超链接等,默认跟随主题色 | `string` | `` | - | - |
5
6
  | `protocolCheck` | 是否勾选协议 | `boolean` | `false` | - | - |
6
7
  | `baseProtocol` | 协议可读部分内容 | `string` | `` | - | - |
7
8
  | `protocolData` | 协议配置数据 | `ProtocolItem[]` | `[]` | - | - |
@@ -9,7 +10,8 @@
9
10
  | `primaryBtn` | 主要按钮配置 | `BtnItem[]` | `[]` | - | - |
10
11
  | `secondaryBtn` | 次要按钮配置 | `BtnItem[]` | `[]` | - | - |
11
12
  | `loginGroup` | 登录表单配置 | `LoginGroupItem[]` | `[]` | - | - |
12
- | `loginBackground` | 登录框背景 | `string` | `` | - | - |
13
+ | `loginBoxBackground` | 登录框背景 | `string` | `` | - | - |
14
+ | `loginBoxHeight` | 登录框高度,默认占整个高度的67%,也可以为具体像素值 | `string` | `67%` | - | - |
13
15
  | `bottomTip` | 底部提示 | `string` | `` | - | - |
14
16
 
15
17
 
@@ -21,3 +23,4 @@
21
23
  | `secondaryBtnClick` | 次要按钮点击时触发 | `item`:所点击的按钮项 | - |
22
24
  | `tabChange` | 复杂登录时tab切换时触发 | `item`:当前选项卡项 | - |
23
25
  | `formDataChange` | 复杂登录时输入框或者下拉框改变时触发 | `data`:所有表单值 | - |
26
+ | `getCode` | 当配置输入类型为验证码时,点击获取验证码时触发 | - | - |
@@ -65,13 +65,15 @@
65
65
  </script>
66
66
  ```
67
67
 
68
- #### 复杂登录
68
+ #### 复杂登录 - 示例1
69
69
 
70
70
  - `mode`值为`mode1`时为复杂登录
71
71
  - 此时`primaryBtnData`样式不变,`secondaryBtnData`为文字按钮
72
72
  - 若需要拿到表单数据
73
73
  - `@form-data-change`事件监听,事件参数为表单数据
74
74
  - 通过ref方式获取`formData`属性
75
+ - 根据`loginGroup`属性动态生成tab栏和表单
76
+ - 其中`items`属性配置具体输入,其中`type` 支持`number`/`password`/`select`/`txt`/`validate`(数字、密码、下拉框、文本提示、验证码)
75
77
 
76
78
  ```html
77
79
  <template>
@@ -86,7 +88,7 @@
86
88
  :bottomTip="baseTip"
87
89
  :loginGroup="loginGroup"
88
90
  loginImgUrl="https://image.whzb.com/chain/inte-cloud-tour-uniapp/00-普通图片/00-开发版//login/bg2.png?202408121"
89
- loginBackgroundImg="https://image.whzb.com/chain/inte-cloud-tour-uniapp/00-普通图片/00-开发版//login/bg1.png?202408121"
91
+ loginBoxBackground="https://image.whzb.com/chain/inte-cloud-tour-uniapp/00-普通图片/00-开发版//login/bg1.png?202408121"
90
92
  @tabChange="tabChange"
91
93
  @primaryBtnClick="handleClick"
92
94
  @secondary-btn-click="handleClick"
@@ -197,16 +199,111 @@
197
199
  </script>
198
200
  ```
199
201
 
202
+ #### 复杂登录 - 示例2
203
+
204
+ - 当`loginGroup`配置为一个数据时,顶部tab栏会隐藏显示
205
+ - 可在单个表单中配置`iconColor`改变图标颜色
206
+
207
+ ```html
208
+ <template>
209
+ <view style="width: 100vw; height: 100vh;padding-top: 186rpx">
210
+ <ste-login
211
+ ref="myLogin"
212
+ mode="mode1"
213
+ color="#EC3E1A"
214
+ :baseProtocol="base"
215
+ :protocolData="protocolData"
216
+ :primaryBtn="primaryBtnData"
217
+ :secondaryBtn="secondaryBtnData"
218
+ :bottomTip="baseTip"
219
+ :loginGroup="loginGroup"
220
+ loginImgUrl="https://image.whzb.com/chain/StellarUI/image/食堂登录.png"
221
+ loginBoxBackground="rgba(255, 255, 255, .75)"
222
+ @primaryBtnClick="handleClick"
223
+ @secondary-btn-click="handleClick"
224
+ @protocol-click="protocolClick"
225
+ @form-data-change="formDataChange"
226
+ />
227
+ </view>
228
+ </template>
229
+ <script lang="ts" setup>
230
+ import { reactive, ref } from 'vue';
231
+ import type { RefLogin } from '@/uni_modules/stellar-ui-plus/types/refComponents';
232
+ const baseTip = '版本信息 V1.0.0';
233
+
234
+ const myLogin = ref<RefLogin>();
235
+
236
+ const base = '登录即同意';
237
+ const protocolData = reactive([{ title: '中百食堂隐私郑策', key: 'p1' }]);
238
+
239
+ const loginGroup = reactive([
240
+ {
241
+ title: '登陆',
242
+ key: 'bind',
243
+ items: [
244
+ {
245
+ title: '手机号',
246
+ key: 'username',
247
+ type: 'number' as const,
248
+ style: {
249
+ iconColor: '#FFAFA4',
250
+ },
251
+ },
252
+ {
253
+ title: '验证码',
254
+ key: 'validate',
255
+ type: 'validate' as const,
256
+ style: {
257
+ iconColor: '#FFAFA4',
258
+ },
259
+ },
260
+ ],
261
+ },
262
+ ]);
263
+
264
+ const primaryBtnData = reactive([
265
+ {
266
+ title: '登录',
267
+ key: 'wx',
268
+ },
269
+ ]);
270
+
271
+ const secondaryBtnData = reactive([
272
+ {
273
+ title: '微信一键登录',
274
+ key: 'wxOneKey',
275
+ },
276
+ ]);
277
+
278
+ const handleClick = (item: any) => {
279
+ console.log(item);
280
+ if (item.key === 'wx') {
281
+ console.log('点击了微信登录');
282
+ console.log(myLogin.value?.formData);
283
+ }
284
+ };
285
+
286
+ const formDataChange = (data: any) => {
287
+ console.log(data);
288
+ };
289
+
290
+ const protocolClick = (item: any) => {
291
+ console.log(item);
292
+ };
293
+ </script>
294
+ ```
295
+
200
296
  ---$
201
297
 
202
298
  ### API
203
299
 
204
300
  #### BaseConfigItem & ProtocolItem & BtnItem
205
301
 
206
- | 属性名 | 说明 | 是否必填 | 类型 |
207
- | ------- | ---------- | -------- | -------- |
208
- | `title` | 显示的内容 | 是 | `string` |
209
- | `key` | 标识符 | 是 | `string` |
302
+ | 属性名 | 说明 | 是否必填 | 类型 |
303
+ | ------- | ------------------------------ | -------- | -------- |
304
+ | `title` | 显示的内容 | 是 | `string` |
305
+ | `key` | 标识符 | 是 | `string` |
306
+ | `style` | 对应配置的样式(暂时只支持部分) | 否 | `object` |
210
307
 
211
308
  #### LoginGroupItem
212
309
 
@@ -218,17 +315,17 @@
218
315
 
219
316
  #### LoginItem
220
317
 
221
- | 属性名 | 说明 | 是否必填 | 类型 |
222
- | ------------- | -------------------------------------------------- | -------- | ------------------ |
223
- | `title` | 显示的内容 | 是 | `string` |
224
- | `key` | 标识符 | 是 | `string` |
225
- | `type` | 输入类型,暂支持`number`/`password`/`select`/`txt` | 否 | `string` |
226
- | `value` | 默认值 | 否 | `string` |
227
- | `selectData` | 选项数据,仅当`type`为`select`时生效 | 否 | `BaseConfigItem[]` |
228
- | `maxLength` | 最大长度 | 否 | `number` |
229
- | `disabled` | 禁用 | 否 | `boolean` |
230
- | `icon` | 输入框模式下对应的前缀图标code | 否 | `string` |
231
- | `placeholder` | 输入框模式下对应的placeholder | 否 | `string` |
318
+ | 属性名 | 说明 | 是否必填 | 类型 |
319
+ | ------------- | ------------------------------------------------------------- | -------- | ------------------ |
320
+ | `title` | 显示的内容 | 是 | `string` |
321
+ | `key` | 标识符 | 是 | `string` |
322
+ | `type` | 输入类型,暂支持`number`/`password`/`select`/`txt`/`validate` | 否 | `string` |
323
+ | `value` | 默认值 | 否 | `string` |
324
+ | `selectData` | 选项数据,仅当`type`为`select`时生效 | 否 | `BaseConfigItem[]` |
325
+ | `maxLength` | 最大长度 | 否 | `number` |
326
+ | `disabled` | 禁用 | 否 | `boolean` |
327
+ | `icon` | 输入框模式下对应的前缀图标code | 否 | `string` |
328
+ | `placeholder` | 输入框模式下对应的placeholder | 否 | `string` |
232
329
 
233
330
  <!-- props -->
234
331