hy-app 0.1.2 → 0.1.3

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 (221) hide show
  1. package/README.md +1 -1
  2. package/api/http.ts +8 -8
  3. package/components/dialog/index.ts +2 -2
  4. package/components/hy-address-picker/hy-address-picker.vue +3 -29
  5. package/components/hy-address-picker/index.scss +27 -0
  6. package/components/hy-avatar/hy-avatar.vue +1 -45
  7. package/components/hy-avatar/index.scss +45 -0
  8. package/components/hy-avatar/typing.d.ts +1 -1
  9. package/components/hy-back-top/hy-back-top.vue +7 -22
  10. package/components/hy-back-top/index.scss +16 -0
  11. package/components/hy-back-top/props.ts +4 -4
  12. package/components/hy-back-top/typing.d.ts +2 -3
  13. package/components/hy-badge/hy-badge.vue +1 -72
  14. package/components/hy-badge/index.scss +72 -0
  15. package/components/hy-button/hy-button.vue +12 -124
  16. package/components/hy-button/index.scss +116 -0
  17. package/components/hy-calendar/header.vue +76 -0
  18. package/components/hy-calendar/hy-calendar.vue +366 -0
  19. package/components/hy-calendar/index.scss +171 -0
  20. package/components/hy-calendar/month.vue +524 -0
  21. package/components/hy-calendar/props.ts +37 -0
  22. package/components/hy-calendar/typing.d.ts +126 -0
  23. package/components/hy-card/hy-card.vue +21 -84
  24. package/components/hy-card/index.scss +57 -0
  25. package/components/hy-card/props.ts +2 -2
  26. package/components/hy-card/typing.d.ts +1 -1
  27. package/components/hy-cell/hy-cell.vue +1 -137
  28. package/components/hy-cell/index.scss +137 -0
  29. package/components/hy-check-button/hy-check-button.vue +1 -0
  30. package/components/hy-check-button/index.scss +5 -0
  31. package/components/hy-checkbox/hy-checkbox.vue +2 -95
  32. package/components/hy-checkbox/index.scss +94 -0
  33. package/components/hy-checkbox/typing.d.ts +1 -2
  34. package/components/hy-count-down/hy-count-down.vue +150 -0
  35. package/components/hy-count-down/index.scss +6 -0
  36. package/components/hy-count-down/index.ts +52 -0
  37. package/components/hy-count-down/props.ts +10 -0
  38. package/components/hy-count-down/typing.d.ts +20 -0
  39. package/components/hy-count-to/hy-count-to.vue +213 -0
  40. package/components/hy-count-to/index.scss +6 -0
  41. package/components/hy-count-to/props.ts +17 -0
  42. package/components/hy-count-to/typing.d.ts +48 -0
  43. package/components/hy-datetime-picker/hy-datetime-picker.vue +2 -28
  44. package/components/hy-datetime-picker/index.scss +28 -0
  45. package/components/hy-divider/hy-divider.vue +24 -49
  46. package/components/hy-divider/index.scss +25 -0
  47. package/components/hy-divider/props.ts +2 -2
  48. package/components/hy-divider/typing.d.ts +1 -1
  49. package/components/hy-dropdown/hy-dropdown.vue +43 -0
  50. package/components/hy-dropdown/index.scss +17 -0
  51. package/components/hy-dropdown/props.ts +17 -0
  52. package/components/hy-dropdown/typing.d.ts +48 -0
  53. package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
  54. package/components/hy-dropdown-item/index.scss +96 -0
  55. package/components/hy-dropdown-item/props.ts +10 -0
  56. package/components/hy-dropdown-item/typing.d.ts +31 -0
  57. package/components/hy-empty/hy-empty.vue +8 -26
  58. package/components/hy-empty/index.scss +19 -0
  59. package/components/hy-empty/props.ts +2 -2
  60. package/components/hy-empty/typing.d.ts +1 -1
  61. package/components/hy-float-button/hy-float-button.vue +201 -0
  62. package/components/hy-float-button/index.scss +69 -0
  63. package/components/hy-float-button/props.ts +25 -0
  64. package/components/hy-float-button/typing.d.ts +93 -0
  65. package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
  66. package/components/hy-folding-panel/index.scss +6 -0
  67. package/components/hy-folding-panel/props.ts +2 -2
  68. package/components/hy-folding-panel/typing.d.ts +2 -2
  69. package/components/hy-form/hy-form.vue +17 -34
  70. package/components/hy-form/index.scss +30 -0
  71. package/components/hy-form/props.ts +2 -0
  72. package/components/hy-form/typing.d.ts +9 -1
  73. package/components/hy-grid/hy-grid.vue +1 -43
  74. package/components/hy-grid/index.scss +40 -0
  75. package/components/hy-icon/hy-icon.vue +1 -93
  76. package/components/hy-icon/index.scss +84 -0
  77. package/components/hy-image/hy-image.vue +212 -0
  78. package/components/hy-image/index.scss +26 -0
  79. package/components/hy-image/props.ts +24 -0
  80. package/components/hy-image/typing.d.ts +76 -0
  81. package/components/hy-input/hy-input.vue +2 -72
  82. package/components/hy-input/index.scss +65 -0
  83. package/components/hy-line/hy-line.vue +4 -8
  84. package/components/hy-line/index.scss +5 -0
  85. package/components/hy-line/props.ts +3 -3
  86. package/components/hy-line/typing.d.ts +2 -2
  87. package/components/hy-line-progress/hy-line-progress.vue +15 -44
  88. package/components/hy-line-progress/index.scss +38 -0
  89. package/components/hy-line-progress/props.ts +2 -2
  90. package/components/hy-line-progress/typing.d.ts +1 -1
  91. package/components/hy-list/hy-list.vue +11 -41
  92. package/components/hy-list/index.scss +32 -0
  93. package/components/hy-list/props.ts +2 -2
  94. package/components/hy-loading/hy-loading.vue +95 -0
  95. package/components/hy-loading/index.scss +103 -0
  96. package/components/hy-loading/props.ts +17 -0
  97. package/components/hy-loading/typing.d.ts +52 -0
  98. package/components/hy-login/TheUserLogin.vue +16 -16
  99. package/components/hy-login/hy-login.vue +9 -9
  100. package/components/hy-login/props.ts +4 -4
  101. package/components/hy-modal/hy-modal.vue +11 -89
  102. package/components/hy-modal/index.scss +77 -0
  103. package/components/hy-modal/props.ts +2 -2
  104. package/components/hy-modal/typing.d.ts +1 -1
  105. package/components/hy-navbar/hy-navbar.vue +20 -92
  106. package/components/hy-navbar/index.scss +67 -0
  107. package/components/hy-navbar/props.ts +2 -2
  108. package/components/hy-navbar/typing.d.ts +1 -1
  109. package/components/hy-notice-bar/hy-column-notice.vue +11 -39
  110. package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
  111. package/components/hy-notice-bar/hy-row-notice.vue +5 -56
  112. package/components/hy-notice-bar/index.scss +93 -0
  113. package/components/hy-notice-bar/props.ts +4 -2
  114. package/components/hy-notice-bar/typing.d.ts +13 -3
  115. package/components/hy-number-step/hy-number-step.vue +1 -70
  116. package/components/hy-number-step/index.scss +71 -0
  117. package/components/hy-overlay/hy-overlay.vue +2 -14
  118. package/components/hy-overlay/index.scss +9 -0
  119. package/components/hy-picker/hy-picker.vue +1 -68
  120. package/components/hy-picker/index.scss +68 -0
  121. package/components/hy-popup/hy-popup.vue +1 -74
  122. package/components/hy-popup/index.scss +60 -0
  123. package/components/hy-price/hy-price.vue +1 -11
  124. package/components/hy-price/index.scss +11 -0
  125. package/components/hy-qrcode/hy-qrcode.vue +15 -37
  126. package/components/hy-qrcode/index.scss +23 -0
  127. package/components/hy-qrcode/props.ts +2 -2
  128. package/components/hy-qrcode/typing.d.ts +2 -2
  129. package/components/hy-radio/hy-radio.vue +2 -101
  130. package/components/hy-radio/index.scss +93 -0
  131. package/components/hy-radio/typing.d.ts +1 -2
  132. package/components/hy-rate/hy-rate.vue +1 -33
  133. package/components/hy-rate/index.scss +33 -0
  134. package/components/hy-read-more/hy-read-more.vue +7 -30
  135. package/components/hy-read-more/index.scss +25 -0
  136. package/components/hy-read-more/props.ts +3 -3
  137. package/components/hy-read-more/typing.d.ts +1 -1
  138. package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
  139. package/components/hy-safe-bottom/index.scss +5 -0
  140. package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
  141. package/components/hy-scroll-list/index.scss +34 -0
  142. package/components/hy-scroll-list/props.ts +2 -2
  143. package/components/hy-scroll-list/typing.d.ts +1 -1
  144. package/components/hy-search/hy-search.vue +1 -83
  145. package/components/hy-search/index.scss +83 -0
  146. package/components/hy-slider/hy-slider.vue +14 -92
  147. package/components/hy-slider/index.scss +77 -0
  148. package/components/hy-status-bar/hy-status-bar.vue +41 -0
  149. package/components/hy-status-bar/index.scss +6 -0
  150. package/components/hy-status-bar/props.ts +8 -0
  151. package/components/hy-status-bar/typing.d.ts +12 -0
  152. package/components/hy-steps/hy-steps.vue +36 -163
  153. package/components/hy-steps/index.scss +131 -0
  154. package/components/hy-steps/props.ts +2 -2
  155. package/components/hy-steps/typing.d.ts +2 -2
  156. package/components/hy-subsection/hy-subsection.vue +40 -132
  157. package/components/hy-subsection/index.scss +82 -0
  158. package/components/hy-subsection/props.ts +1 -0
  159. package/components/hy-subsection/typing.d.ts +13 -4
  160. package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
  161. package/components/hy-swipe-action/index.scss +9 -0
  162. package/components/hy-swipe-action/index.wxs +235 -0
  163. package/components/hy-swipe-action/props.ts +16 -0
  164. package/components/hy-swipe-action/typing.d.ts +55 -0
  165. package/components/hy-swipe-action/wxs.js +15 -0
  166. package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
  167. package/components/hy-swiper/hy-swiper.vue +1 -54
  168. package/components/hy-swiper/index.scss +82 -0
  169. package/components/hy-switch/hy-switch.vue +62 -72
  170. package/components/hy-switch/index.scss +46 -0
  171. package/components/hy-switch/props.ts +4 -1
  172. package/components/hy-switch/typing.d.ts +14 -1
  173. package/components/hy-tabs/hy-tabs.vue +22 -81
  174. package/components/hy-tabs/index.scss +63 -0
  175. package/components/hy-tabs/props.ts +5 -5
  176. package/components/hy-tabs/typing.d.ts +1 -1
  177. package/components/hy-tag/hy-tag.vue +1 -214
  178. package/components/hy-tag/index.scss +204 -0
  179. package/components/hy-text/hy-text.vue +238 -0
  180. package/components/hy-text/index.scss +70 -0
  181. package/components/hy-text/index.ts +0 -0
  182. package/components/hy-text/props.ts +30 -0
  183. package/components/hy-text/typing.d.ts +98 -0
  184. package/components/hy-textarea/hy-textarea.vue +1 -46
  185. package/components/hy-textarea/index.scss +40 -0
  186. package/components/hy-tooltip/hy-tooltip.vue +42 -95
  187. package/components/hy-tooltip/index.scss +64 -0
  188. package/components/hy-tooltip/props.ts +2 -2
  189. package/components/hy-tooltip/typing.d.ts +1 -1
  190. package/components/hy-transition/hy-transition.vue +4 -2
  191. package/components/hy-transition/typing.d.ts +1 -13
  192. package/components/hy-upload/hy-upload.vue +37 -182
  193. package/components/hy-upload/index.scss +147 -0
  194. package/components/hy-upload/props.ts +2 -2
  195. package/components/hy-upload/typing.d.ts +11 -11
  196. package/components/hy-warn/hy-warn.vue +15 -123
  197. package/components/hy-warn/index.scss +109 -0
  198. package/components/hy-warn/props.ts +3 -3
  199. package/components/hy-warn/typing.d.ts +4 -3
  200. package/components/hy-waterfall/index.scss +82 -0
  201. package/components/index.ts +25 -1
  202. package/components/message/index.ts +54 -54
  203. package/config/color.ts +2 -1
  204. package/global/index.ts +6 -6
  205. package/global/register-properties.ts +2 -2
  206. package/index.scss +2 -1
  207. package/libs/css/common.scss +14 -2
  208. package/package.json +2 -2
  209. package/{libs/css → public/font}/iconfont.css +4 -4
  210. package/theme.scss +6 -4
  211. package/typing/modules/common.d.ts +16 -1
  212. package/utils/calendar.js +1021 -0
  213. package/utils/colorGradient.ts +112 -0
  214. package/utils/index.ts +2 -0
  215. package/utils/inside.ts +80 -34
  216. package/utils/inspect.ts +66 -0
  217. package/utils/utils.ts +11 -12
  218. package/libs/css/download.zip +0 -0
  219. /package/{libs/css → public/font}/iconfont.ttf +0 -0
  220. /package/{libs/css → public/font}/iconfont.woff +0 -0
  221. /package/{libs/css → public/font}/iconfont.woff2 +0 -0
@@ -16,8 +16,8 @@
16
16
  :style="[
17
17
  {
18
18
  width: addUnit(width),
19
- height: addUnit(height)
20
- }
19
+ height: addUnit(height),
20
+ },
21
21
  ]"
22
22
  />
23
23
  <view
@@ -107,8 +107,8 @@
107
107
  :style="[
108
108
  {
109
109
  width: addUnit(width),
110
- height: addUnit(height)
111
- }
110
+ height: addUnit(height),
111
+ },
112
112
  ]"
113
113
  >
114
114
  <HyIcon
@@ -128,7 +128,8 @@
128
128
  <script setup lang="ts">
129
129
  import { ref, toRefs, watch } from "vue";
130
130
  import defaultProps from "./props";
131
- import IProps, { FileVo } from "./typing";
131
+ import type IProps from "./typing";
132
+ import type { FileVo } from "./typing";
132
133
  import { addUnit, chooseFile } from "../../utils";
133
134
  import { IconConfig } from "../../config";
134
135
  // 组件
@@ -151,7 +152,6 @@ const {
151
152
  previewFullImage,
152
153
  deletable,
153
154
  useBeforeRead,
154
- afterRead
155
155
  } = toRefs(props);
156
156
  const emit = defineEmits([
157
157
  "clickPreview",
@@ -159,7 +159,7 @@ const emit = defineEmits([
159
159
  "error",
160
160
  "delete",
161
161
  "afterRead",
162
- "oversize"
162
+ "oversize",
163
163
  ]);
164
164
 
165
165
  const lists = ref<FileVo[]>([]);
@@ -172,8 +172,8 @@ const formatFileList = () => {
172
172
  // 如果item.url为本地选择的blob文件的话,无法判断其为video还是image,此处优先通过accept做判断处理
173
173
  isImage: accept.value === "image",
174
174
  isVideo: accept.value === "video",
175
- deletable: item.deletable || deletable.value
176
- })
175
+ deletable: item.deletable || deletable.value,
176
+ }),
177
177
  );
178
178
  isInCount.value = lists.value.length < maxCount.value;
179
179
  };
@@ -183,28 +183,28 @@ watch(
183
183
  () => {
184
184
  formatFileList();
185
185
  },
186
- { immediate: true, deep: true }
186
+ { immediate: true, deep: true },
187
187
  );
188
188
 
189
189
  watch(
190
190
  () => deletable.value,
191
191
  () => {
192
192
  formatFileList();
193
- }
193
+ },
194
194
  );
195
195
 
196
196
  watch(
197
197
  () => maxCount.value,
198
198
  () => {
199
199
  formatFileList();
200
- }
200
+ },
201
201
  );
202
202
 
203
203
  watch(
204
204
  () => accept.value,
205
205
  () => {
206
206
  formatFileList();
207
- }
207
+ },
208
208
  );
209
209
 
210
210
  const chooseFileFn = () => {
@@ -226,12 +226,12 @@ const chooseFileFn = () => {
226
226
  compressed: compressed.value,
227
227
  maxDuration: maxDuration.value,
228
228
  sizeType: sizeType.value,
229
- camera: camera.value
229
+ camera: camera.value,
230
230
  },
231
231
  {
232
- maxCount: maxCount.value - lists.value.length
233
- }
234
- )
232
+ maxCount: maxCount.value - lists.value.length,
233
+ },
234
+ ),
235
235
  )
236
236
  .then((res: any) => {
237
237
  onBeforeRead(multiple.value ? res : res[0]);
@@ -255,16 +255,16 @@ const onBeforeRead = (file: FileVo) => {
255
255
  Object.assign(
256
256
  Object.assign(
257
257
  {
258
- file
258
+ file,
259
259
  },
260
- getDetail()
260
+ getDetail(),
261
261
  ),
262
262
  {
263
263
  callback: (ok: any) => {
264
264
  ok ? resolve(ok) : reject();
265
- }
266
- }
267
- )
265
+ },
266
+ },
267
+ ),
268
268
  );
269
269
  });
270
270
  }
@@ -278,7 +278,7 @@ const onBeforeRead = (file: FileVo) => {
278
278
  const getDetail = (index?: number) => {
279
279
  return {
280
280
  name: name.value,
281
- index: index == null ? fileList.value.length : index
281
+ index: index == null ? fileList.value.length : index,
282
282
  };
283
283
  };
284
284
  const onAfterRead = (file: FileVo) => {
@@ -290,10 +290,10 @@ const onAfterRead = (file: FileVo) => {
290
290
  "oversize",
291
291
  Object.assign(
292
292
  {
293
- file
293
+ file,
294
294
  },
295
- getDetail()
296
- )
295
+ getDetail(),
296
+ ),
297
297
  );
298
298
  return;
299
299
  }
@@ -304,10 +304,10 @@ const onAfterRead = (file: FileVo) => {
304
304
  "afterRead",
305
305
  Object.assign(
306
306
  {
307
- file
307
+ file,
308
308
  },
309
- getDetail()
310
- )
309
+ getDetail(),
310
+ ),
311
311
  );
312
312
  };
313
313
 
@@ -320,8 +320,8 @@ const deleteItem = (index: number) => {
320
320
  emit(
321
321
  "delete",
322
322
  Object.assign(Object.assign({}, getDetail(index)), {
323
- file: fileList.value[index]
324
- })
323
+ file: fileList.value[index],
324
+ }),
325
325
  );
326
326
  };
327
327
 
@@ -351,7 +351,7 @@ const onPreviewImage = (previewItem: FileVo, index: number) => {
351
351
  current: current,
352
352
  fail() {
353
353
  uni.showToast({ title: "预览图片失败" });
354
- }
354
+ },
355
355
  });
356
356
  };
357
357
 
@@ -368,8 +368,8 @@ const onPreviewVideo = (index: number) => {
368
368
  if (item.isVideo || (item.type && item.type === "video")) {
369
369
  sources.push(
370
370
  Object.assign(Object.assign({}, item), {
371
- type: "video"
372
- })
371
+ type: "video",
372
+ }),
373
373
  );
374
374
  if (i === index) {
375
375
  current = videoIndex;
@@ -386,7 +386,7 @@ const onPreviewVideo = (index: number) => {
386
386
  current: current,
387
387
  fail() {
388
388
  uni.showToast({ title: "预览视频失败" });
389
- }
389
+ },
390
390
  });
391
391
  // #endif
392
392
  };
@@ -402,156 +402,11 @@ const onClickPreview = (item: FileVo, index: number) => {
402
402
  }
403
403
  emit(
404
404
  "clickPreview",
405
- Object.assign(Object.assign({}, item), getDetail(index))
405
+ Object.assign(Object.assign({}, item), getDetail(index)),
406
406
  );
407
407
  };
408
408
  </script>
409
409
 
410
410
  <style lang="scss" scoped>
411
- @import "../../libs/css/mixin.scss";
412
- @import "../../theme.scss";
413
- $hy-upload-image-width: 80px !default;
414
- $hy-upload-text-font-size: 11px !default;
415
-
416
- .hy-upload {
417
- @include flex(column);
418
- flex: 1;
419
-
420
- &__wrap {
421
- @include flex;
422
- flex-wrap: wrap;
423
- flex: 1;
424
-
425
- &__preview {
426
- border-radius: 2px;
427
- margin: 0 8px 8px 0;
428
- position: relative;
429
- overflow: hidden;
430
- @include flex;
431
-
432
- &__image {
433
- width: $hy-upload-image-width;
434
- height: $hy-upload-image-width;
435
- }
436
-
437
- &__other {
438
- width: $hy-upload-image-width;
439
- height: $hy-upload-image-width;
440
- background-color: rgb(242, 242, 242);
441
- flex: 1;
442
- @include flex(column);
443
- justify-content: center;
444
- align-items: center;
445
-
446
- &__text {
447
- font-size: $hy-upload-text-font-size;
448
- color: $hy-tips-color;
449
- margin-top: 2px;
450
- }
451
- }
452
- }
453
- }
454
-
455
- &__deletable {
456
- position: absolute;
457
- top: 0;
458
- right: 0;
459
- background-color: rgb(55, 55, 55);
460
- height: 14px;
461
- width: 14px;
462
- @include flex;
463
- border-bottom-left-radius: 100px;
464
- align-items: center;
465
- justify-content: center;
466
- z-index: 9;
467
-
468
- &__icon {
469
- position: absolute;
470
- transform: scale(0.7);
471
- top: 0;
472
- right: 0;
473
- }
474
- }
475
-
476
- &__success {
477
- position: absolute;
478
- bottom: 0;
479
- right: 0;
480
- @include flex;
481
- // 由于weex(nvue)为阿里巴巴的KPI(部门业绩考核)的laji产物,不支持css绘制三角形
482
- // 所以在nvue下使用图片,非nvue下使用css实现
483
- /* #ifndef APP-NVUE */
484
- border-style: solid;
485
- border-color: transparent $hy-success $hy-success transparent;
486
- border-width: 9px;
487
- align-items: center;
488
- justify-content: center;
489
- /* #endif */
490
-
491
- &__icon {
492
- /* #ifndef APP-NVUE */
493
- position: absolute;
494
- transform: scale(0.7);
495
- bottom: -10px;
496
- right: -10px;
497
- /* #endif */
498
- /* #ifdef APP-NVUE */
499
- width: 16px;
500
- height: 16px;
501
- /* #endif */
502
- }
503
- }
504
-
505
- &__button {
506
- @include flex(column);
507
- align-items: center;
508
- justify-content: center;
509
- width: $hy-upload-image-width;
510
- height: $hy-upload-image-width;
511
- background-color: rgb(244, 245, 247);
512
- border-radius: 2px;
513
- margin: 0 8px 8px 0;
514
- /* #ifndef APP-NVUE */
515
- box-sizing: border-box;
516
- /* #endif */
517
-
518
- &__text {
519
- font-size: $hy-upload-text-font-size;
520
- color: $hy-tips-color;
521
- margin-top: 2px;
522
- }
523
-
524
- &--hover {
525
- background-color: rgb(230, 231, 233);
526
- }
527
-
528
- &--disabled {
529
- opacity: 0.5;
530
- }
531
- }
532
- }
533
-
534
- .material-sent {
535
- width: 100%;
536
- height: 100%;
537
- background: rgba(245, 245, 245, 0.3);
538
- backdrop-filter: blur(4px);
539
- position: absolute;
540
- display: flex;
541
- justify-content: center;
542
- align-items: center;
543
- flex-direction: column;
544
- z-index: 10;
545
-
546
- .select-tips {
547
- width: 70%;
548
- height: 10rpx;
549
- margin-bottom: 12rpx;
550
- }
551
-
552
- .tips-text {
553
- font-size: 12px;
554
- color: #b99c65;
555
- }
556
- }
411
+ @import "./index.scss";
557
412
  </style>
@@ -0,0 +1,147 @@
1
+ @use "../../libs/css/mixin.scss" as *;
2
+ @use "../../theme.scss" as *;
3
+
4
+ $hy-upload-image-width: 80px !default;
5
+ $hy-upload-text-font-size: 11px !default;
6
+
7
+ .hy-upload {
8
+ @include flex(column);
9
+ flex: 1;
10
+
11
+ &__wrap {
12
+ @include flex;
13
+ flex-wrap: wrap;
14
+ flex: 1;
15
+
16
+ &__preview {
17
+ border-radius: 2px;
18
+ margin: 0 8px 8px 0;
19
+ position: relative;
20
+ overflow: hidden;
21
+ @include flex;
22
+
23
+ &__image {
24
+ width: $hy-upload-image-width;
25
+ height: $hy-upload-image-width;
26
+ }
27
+
28
+ &__other {
29
+ width: $hy-upload-image-width;
30
+ height: $hy-upload-image-width;
31
+ background-color: rgb(242, 242, 242);
32
+ flex: 1;
33
+ @include flex(column);
34
+ justify-content: center;
35
+ align-items: center;
36
+
37
+ &__text {
38
+ font-size: $hy-upload-text-font-size;
39
+ color: $hy-tips-color;
40
+ margin-top: 2px;
41
+ }
42
+ }
43
+ }
44
+ }
45
+
46
+ &__deletable {
47
+ position: absolute;
48
+ top: 0;
49
+ right: 0;
50
+ background-color: rgb(55, 55, 55);
51
+ height: 14px;
52
+ width: 14px;
53
+ @include flex;
54
+ border-bottom-left-radius: 100px;
55
+ align-items: center;
56
+ justify-content: center;
57
+ z-index: 9;
58
+
59
+ &__icon {
60
+ position: absolute;
61
+ transform: scale(0.7);
62
+ top: 0;
63
+ right: 0;
64
+ }
65
+ }
66
+
67
+ &__success {
68
+ position: absolute;
69
+ bottom: 0;
70
+ right: 0;
71
+ @include flex;
72
+ // 由于weex(nvue)为阿里巴巴的KPI(部门业绩考核)的laji产物,不支持css绘制三角形
73
+ // 所以在nvue下使用图片,非nvue下使用css实现
74
+ /* #ifndef APP-NVUE */
75
+ border-style: solid;
76
+ border-color: transparent $hy-success $hy-success transparent;
77
+ border-width: 9px;
78
+ align-items: center;
79
+ justify-content: center;
80
+ /* #endif */
81
+
82
+ &__icon {
83
+ /* #ifndef APP-NVUE */
84
+ position: absolute;
85
+ transform: scale(0.7);
86
+ bottom: -10px;
87
+ right: -10px;
88
+ /* #endif */
89
+ /* #ifdef APP-NVUE */
90
+ width: 16px;
91
+ height: 16px;
92
+ /* #endif */
93
+ }
94
+ }
95
+
96
+ &__button {
97
+ @include flex(column);
98
+ align-items: center;
99
+ justify-content: center;
100
+ width: $hy-upload-image-width;
101
+ height: $hy-upload-image-width;
102
+ background-color: rgb(244, 245, 247);
103
+ border-radius: 2px;
104
+ margin: 0 8px 8px 0;
105
+ /* #ifndef APP-NVUE */
106
+ box-sizing: border-box;
107
+ /* #endif */
108
+
109
+ &__text {
110
+ font-size: $hy-upload-text-font-size;
111
+ color: $hy-tips-color;
112
+ margin-top: 2px;
113
+ }
114
+
115
+ &--hover {
116
+ background-color: rgb(230, 231, 233);
117
+ }
118
+
119
+ &--disabled {
120
+ opacity: 0.5;
121
+ }
122
+ }
123
+ }
124
+
125
+ .material-sent {
126
+ width: 100%;
127
+ height: 100%;
128
+ background: rgba(245, 245, 245, 0.3);
129
+ backdrop-filter: blur(4px);
130
+ position: absolute;
131
+ display: flex;
132
+ justify-content: center;
133
+ align-items: center;
134
+ flex-direction: column;
135
+ z-index: 10;
136
+
137
+ .select-tips {
138
+ width: 70%;
139
+ height: 10rpx;
140
+ margin-bottom: 12rpx;
141
+ }
142
+
143
+ .tips-text {
144
+ font-size: 12px;
145
+ color: #b99c65;
146
+ }
147
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
  import { IconConfig } from "../../config";
3
3
 
4
4
  const defaultProps: IProps = {
@@ -23,7 +23,7 @@ const defaultProps: IProps = {
23
23
  fileList: [],
24
24
  uploadText: "",
25
25
  width: 80,
26
- height: 80
26
+ height: 80,
27
27
  };
28
28
 
29
29
  export default defaultProps;
@@ -1,46 +1,46 @@
1
- import { CSSProperties } from "vue";
1
+ import type { CSSProperties } from "vue";
2
2
 
3
3
  export interface FileVo {
4
4
  /**
5
5
  * @description 上传文件本地地址链接
6
6
  * */
7
- url: string;
7
+ url?: string;
8
8
  /**
9
9
  * @description 上传文件类型
10
10
  * */
11
- type: "image" | "video" | "file";
11
+ type?: "image" | "video" | "file";
12
12
  /**
13
13
  * @description 上传文件本地地址链接
14
14
  * */
15
- thumb: string;
15
+ thumb?: string;
16
16
  /**
17
17
  * @description 文件大小
18
18
  * */
19
- size: number;
19
+ size?: number;
20
20
  /**
21
21
  * @description 是否视频
22
22
  * */
23
- isVideo: boolean;
23
+ isVideo?: boolean;
24
24
  /**
25
25
  * @description 是否图片
26
26
  * */
27
- isImage: boolean;
27
+ isImage?: boolean;
28
28
  /**
29
29
  * @description 是否显示删除按钮
30
30
  * */
31
- deletable: boolean;
31
+ deletable?: boolean;
32
32
  /**
33
33
  * @description 上传时候状态
34
34
  * */
35
- status: "loading" | "failed" | "success";
35
+ status?: "loading" | "failed" | "success";
36
36
  /**
37
37
  * @description 提示信息
38
38
  * */
39
- message: string;
39
+ message?: string;
40
40
  /**
41
41
  * @description 进度条
42
42
  * */
43
- schedule: string | number;
43
+ schedule?: string | number;
44
44
  }
45
45
 
46
46
  export default interface IProps {