@10yun/cv-mobile-ui 0.5.62 → 0.5.63

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 (67) hide show
  1. package/package.json +1 -1
  2. package/plugins/uni-extend.js +10 -10
  3. package/ui-fireui/components/u-action-sheet/u-action-sheet.vue +46 -16
  4. package/ui-fireui/components/u-alert/u-alert.vue +11 -5
  5. package/ui-fireui/components/u-badge/u-badge.vue +52 -69
  6. package/ui-fireui/components/u-bottom-navigation/u-bottom-navigation.vue +28 -20
  7. package/ui-fireui/components/u-bottom-popup/u-bottom-popup.vue +40 -11
  8. package/ui-fireui/components/u-bubble-popup/u-bubble-popup.vue +3 -6
  9. package/ui-fireui/components/u-button/u-button.vue +262 -259
  10. package/ui-fireui/components/u-calendar/u-calendar.vue +227 -44
  11. package/ui-fireui/components/u-calendar/u-calendar2.js +562 -0
  12. package/ui-fireui/components/u-card/u-card.vue +50 -32
  13. package/ui-fireui/components/u-cascade-selection/u-cascade-selection.vue +197 -74
  14. package/ui-fireui/components/u-circular-progress/u-circular-progress.vue +324 -0
  15. package/ui-fireui/components/u-clipboard2/tui-clipboard.js +53 -0
  16. package/ui-fireui/components/u-collapse/u-collapse.vue +8 -8
  17. package/ui-fireui/components/u-config/index.js +129 -0
  18. package/ui-fireui/components/u-count-down/u-count-down.vue +124 -19
  19. package/ui-fireui/components/u-datetime/u-datetime.vue +416 -176
  20. package/ui-fireui/components/u-divider/u-divider.vue +3 -3
  21. package/ui-fireui/components/u-drawer/u-drawer.vue +55 -12
  22. package/ui-fireui/components/u-dropdown-list/u-dropdown-list.vue +103 -0
  23. package/ui-fireui/components/u-fab/u-fab.vue +344 -0
  24. package/ui-fireui/components/u-footer/u-footer.vue +148 -0
  25. package/ui-fireui/components/u-grid/u-grid.vue +2 -8
  26. package/ui-fireui/components/u-grid-item/u-grid-item.vue +22 -5
  27. package/ui-fireui/components/u-icon/u-icon-new.js +190 -0
  28. package/ui-fireui/components/u-icon/u-icon-new.vue +100 -0
  29. package/ui-fireui/components/u-image-cropper/u-image-cropper.vue +1144 -0
  30. package/ui-fireui/components/u-image-group/u-image-group.vue +164 -0
  31. package/ui-fireui/components/u-keyboard/u-keyboard.vue +3 -2
  32. package/ui-fireui/components/u-keyboard-input/u-keyboard-input.vue +1 -1
  33. package/ui-fireui/components/u-list-cell/u-list-cell.vue +82 -72
  34. package/ui-fireui/components/u-list-view/u-list-view.vue +33 -8
  35. package/ui-fireui/components/u-loading/u-loading.vue +107 -27
  36. package/ui-fireui/components/u-loadmore/u-loadmore.vue +21 -3
  37. package/ui-fireui/components/u-modal/u-modal.vue +140 -176
  38. package/ui-fireui/components/u-navigation-bar/u-navigation-bar.vue +121 -28
  39. package/ui-fireui/components/u-no-data/u-no-data.vue +58 -20
  40. package/ui-fireui/components/u-nomore/u-nomore.vue +5 -4
  41. package/ui-fireui/components/u-numberbox/u-numberbox.vue +88 -45
  42. package/ui-fireui/components/u-picture-cropper/u-picture-cropper.vue +94 -36
  43. package/ui-fireui/components/u-picture-cropper/u-picture-cropper.wxs +27 -17
  44. package/ui-fireui/components/u-rate/u-rate.vue +197 -0
  45. package/ui-fireui/components/u-round-progress/u-round-progress.vue +62 -42
  46. package/ui-fireui/components/u-scroll-top/u-scroll-top.vue +4 -3
  47. package/ui-fireui/components/u-section/u-section.vue +149 -0
  48. package/ui-fireui/components/u-skeleton/u-skeleton.vue +37 -6
  49. package/ui-fireui/components/u-steps/u-steps.vue +110 -27
  50. package/ui-fireui/components/u-sticky/u-sticky.vue +35 -21
  51. package/ui-fireui/components/u-sticky-wxs/u-sticky-wxs.vue +7 -4
  52. package/ui-fireui/components/u-sticky-wxs/u-sticky.wxs +39 -36
  53. package/ui-fireui/components/u-swipe-action/u-swipe-action.vue +76 -19
  54. package/ui-fireui/components/u-tabbar/u-tabbar.vue +71 -38
  55. package/ui-fireui/components/u-tabs/u-tabs.vue +133 -51
  56. package/ui-fireui/components/u-tag/u-tag.vue +109 -226
  57. package/ui-fireui/components/u-time-axis/u-time-axis.vue +1 -1
  58. package/ui-fireui/components/u-timeaxis-item/u-timeaxis-item.vue +1 -1
  59. package/ui-fireui/components/u-tips/u-tips.vue +35 -15
  60. package/ui-fireui/components/u-toast/u-toast.vue +9 -5
  61. package/ui-fireui/components/u-top-dropdown/u-top-dropdown.vue +8 -6
  62. package/ui-fireui/components/u-upload/u-upload-old.vue +462 -0
  63. package/ui-fireui/components/u-upload/u-upload.vue +648 -446
  64. package/ui-fireui/components/u-white-space/u-white-space.vue +68 -0
  65. package/ui-fireui/components/u-wing-blank/u-wing-blank.vue +100 -0
  66. package/uview-plus/libs/ctocode/index.js +1 -0
  67. package/uview-plus/libs/ctocode/richText.js +0 -1
@@ -104,22 +104,49 @@
104
104
  >
105
105
  {{ unitEn ? 's' : '秒' }}
106
106
  </view>
107
+
108
+ <view
109
+ class="up-countdown-colon"
110
+ :style="{ lineHeight: colonSize + 'rpx', fontSize: colonSize + 'rpx', color: colonColor }"
111
+ v-if="seconds && isMs && isColon"
112
+ >
113
+ .
114
+ </view>
115
+ <view
116
+ class="up-countdown__ms"
117
+ :style="{
118
+ background: backgroundColor,
119
+ borderColor: borderColor,
120
+ fontSize: msSize + 'rpx',
121
+ color: msColor,
122
+ height: height + 'rpx',
123
+ width: msWidth > 0 ? msWidth + 'rpx' : 'auto'
124
+ }"
125
+ v-if="seconds && isMs"
126
+ >
127
+ <view :class="{ 'up-ms__list': ani }">
128
+ <view class="up-ms__item" :style="{ height: height + 'rpx' }" v-for="(item, index) in ms" :key="index">
129
+ <view :class="[scale ? 'up-countdown-scale' : '']">{{ item }}</view>
130
+ </view>
131
+ </view>
132
+ </view>
107
133
  </view>
108
134
  </template>
109
135
 
110
136
  <script>
111
137
  export default {
112
- name: 'fuiCountdown',
138
+ name: 'tuiCountdown',
139
+ emits: ['end', 'time'],
113
140
  props: {
114
141
  //数字框宽度
115
142
  width: {
116
143
  type: Number,
117
- default: 25
144
+ default: 32
118
145
  },
119
146
  //数字框高度
120
147
  height: {
121
148
  type: Number,
122
- default: 25
149
+ default: 32
123
150
  },
124
151
  //数字框border颜色
125
152
  borderColor: {
@@ -158,7 +185,7 @@ export default {
158
185
  },
159
186
  //剩余时间 (单位:秒)
160
187
  time: {
161
- type: Number,
188
+ type: [Number, String],
162
189
  default: 0
163
190
  },
164
191
  //是否包含天
@@ -190,11 +217,33 @@ export default {
190
217
  isColon: {
191
218
  type: Boolean,
192
219
  default: true
220
+ },
221
+ //是否返回剩余时间
222
+ returnTime: {
223
+ type: Boolean,
224
+ default: false
225
+ },
226
+ //是否显示毫秒
227
+ isMs: {
228
+ type: Boolean,
229
+ default: false
230
+ },
231
+ msWidth: {
232
+ type: Number,
233
+ default: 32
234
+ },
235
+ msSize: {
236
+ type: Number,
237
+ default: 24
238
+ },
239
+ msColor: {
240
+ type: String,
241
+ default: '#333'
193
242
  }
194
243
  },
195
244
  watch: {
196
245
  time(val) {
197
- clearInterval(this.countdown);
246
+ this.clearTimer();
198
247
  this.doLoop();
199
248
  }
200
249
  },
@@ -204,35 +253,60 @@ export default {
204
253
  d: '0',
205
254
  h: '00',
206
255
  i: '00',
207
- s: '00'
256
+ s: '00',
257
+ //此处若从9到1,结束需要特殊处理
258
+ ms: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
259
+ ani: false
208
260
  };
209
261
  },
210
262
  created() {
211
- this.doLoop();
263
+ this.clearTimer();
264
+ let seconds = Number(this.time || 0);
265
+ if (seconds > 0) {
266
+ this.doLoop();
267
+ }
212
268
  },
269
+ // #ifndef VUE3
213
270
  beforeDestroy() {
214
- clearInterval(this.countdown);
215
- this.countdown = null;
271
+ this.clearTimer();
216
272
  },
273
+ // #endif
274
+ // #ifdef VUE3
275
+ beforeUnmount() {
276
+ this.clearTimer();
277
+ },
278
+ // #endif
217
279
  methods: {
218
- getWidth(num, width) {
280
+ getWidth: function (num, width) {
219
281
  return num > 99 ? (width / 2) * num.toString().length : width;
220
282
  },
221
- endOfTime() {
283
+ clearTimer() {
222
284
  clearInterval(this.countdown);
223
285
  this.countdown = null;
224
- this.$emit('end', {});
225
286
  },
226
- doLoop() {
227
- let seconds = this.time || 0;
287
+ endOfTime(isStop = false) {
288
+ this.ani = false;
289
+ this.clearTimer();
290
+ if (!isStop) {
291
+ this.$emit('end', {});
292
+ }
293
+ },
294
+ doLoop(time = 0) {
295
+ let seconds = time || Number(this.time || 0);
296
+ this.ani = true;
228
297
  this.countDown(seconds);
229
298
  this.countdown = setInterval(() => {
230
299
  seconds--;
231
- if (seconds < 0) {
300
+ this.countDown(seconds);
301
+ if (this.returnTime) {
302
+ this.$emit('time', {
303
+ seconds: seconds
304
+ });
305
+ }
306
+ if (seconds <= 0) {
232
307
  this.endOfTime();
233
308
  return;
234
309
  }
235
- this.countDown(seconds);
236
310
  }, 1000);
237
311
  },
238
312
  countDown(seconds) {
@@ -242,8 +316,6 @@ export default {
242
316
  hour = this.hours ? Math.floor(seconds / (60 * 60)) - day * 24 : 0;
243
317
  minute = this.minutes ? Math.floor(seconds / 60) - hour * 60 - day * 24 * 60 : 0;
244
318
  second = Math.floor(seconds) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60;
245
- } else {
246
- this.endOfTime();
247
319
  }
248
320
  hour = hour < 10 ? '0' + hour : hour;
249
321
  minute = minute < 10 ? '0' + minute : minute;
@@ -252,6 +324,13 @@ export default {
252
324
  this.h = hour;
253
325
  this.i = minute;
254
326
  this.s = second;
327
+ },
328
+ reset(seconds = 0) {
329
+ let time = seconds || Number(this.time);
330
+ this.clearTimer();
331
+ if (time > 0) {
332
+ this.doLoop(time);
333
+ }
255
334
  }
256
335
  }
257
336
  };
@@ -273,7 +352,6 @@ export default {
273
352
  display: flex;
274
353
  align-items: center;
275
354
  justify-content: center;
276
- padding: 2rpx;
277
355
  border-radius: 6rpx;
278
356
  white-space: nowrap;
279
357
  transform: translateZ(0);
@@ -298,4 +376,31 @@ export default {
298
376
  transform: scale(0.9);
299
377
  transform-origin: center center;
300
378
  }
379
+
380
+ .up-countdown__ms {
381
+ border: 1rpx solid;
382
+ overflow: hidden;
383
+ border-radius: 6rpx;
384
+ }
385
+
386
+ /*ms使用css3代替js频繁更新操作,性能优化*/
387
+ .up-ms__list {
388
+ animation: loop 1s steps(10) infinite;
389
+ }
390
+
391
+ @keyframes loop {
392
+ from {
393
+ transform: translateY(0);
394
+ }
395
+
396
+ to {
397
+ transform: translateY(-100%);
398
+ }
399
+ }
400
+
401
+ .up-ms__item {
402
+ display: flex;
403
+ align-items: center;
404
+ justify-content: center;
405
+ }
301
406
  </style>