uview-plus 3.7.36 → 3.8.32

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 (132) hide show
  1. package/README.md +0 -1
  2. package/changelog.md +2047 -1782
  3. package/components/u-action-sheet/u-action-sheet.vue +54 -16
  4. package/components/u-agreement/u-agreement.vue +2 -1
  5. package/components/u-alert/u-alert.vue +8 -10
  6. package/components/u-button/u-button.vue +35 -5
  7. package/components/u-calendar/calendar.js +1 -0
  8. package/components/u-calendar/header.vue +98 -9
  9. package/components/u-calendar/month.vue +10 -7
  10. package/components/u-calendar/props.js +5 -0
  11. package/components/u-calendar/u-calendar.vue +109 -2
  12. package/components/u-car-keyboard/u-car-keyboard.vue +7 -7
  13. package/components/u-card/u-card.vue +6 -6
  14. package/components/u-cascader/u-cascader.vue +32 -12
  15. package/components/u-cate-tab/u-cate-tab.vue +49 -48
  16. package/components/u-cell/u-cell.vue +24 -4
  17. package/components/u-cell-group/u-cell-group.vue +10 -3
  18. package/components/u-checkbox/u-checkbox.vue +6 -6
  19. package/components/u-choose/u-choose.vue +9 -4
  20. package/components/u-city-locate/u-city-locate.vue +28 -22
  21. package/components/u-color-picker/u-color-picker.vue +15 -15
  22. package/components/u-cropper/u-cropper.vue +409 -387
  23. package/components/u-datetime-picker/u-datetime-picker.vue +79 -10
  24. package/components/u-dragsort/u-dragsort.vue +3 -0
  25. package/components/u-dropdown/u-dropdown.vue +15 -2
  26. package/components/u-dropdown-item/u-dropdown-item.vue +3 -3
  27. package/components/u-form-item/u-form-item.vue +6 -1
  28. package/components/u-gap/u-gap.vue +5 -1
  29. package/components/u-goods-sku/u-goods-sku.vue +16 -15
  30. package/components/u-index-anchor/u-index-anchor.vue +13 -2
  31. package/components/u-index-list/u-index-list.vue +18 -5
  32. package/components/u-input/input.js +3 -3
  33. package/components/u-input/u-input.vue +27 -5
  34. package/components/u-keyboard/u-keyboard.vue +11 -6
  35. package/components/u-loading-page/loadingPage.js +1 -1
  36. package/components/u-loading-page/u-loading-page.vue +18 -12
  37. package/components/u-navbar/navbar.js +2 -3
  38. package/components/u-navbar/theme-vars.scss +21 -0
  39. package/components/u-navbar/u-navbar.vue +30 -6
  40. package/components/u-notice-bar/theme-vars.scss +25 -0
  41. package/components/u-notice-bar/u-notice-bar.vue +24 -5
  42. package/components/u-number-box/numberBox.js +4 -4
  43. package/components/u-number-box/u-number-box.vue +27 -13
  44. package/components/u-number-keyboard/u-number-keyboard.vue +6 -6
  45. package/components/u-picker/picker.js +43 -43
  46. package/components/u-picker/u-picker.vue +14 -2
  47. package/components/u-popup/popup.js +1 -1
  48. package/components/u-popup/u-popup.vue +14 -6
  49. package/components/u-poster/u-poster.vue +12 -10
  50. package/components/u-pull-refresh/u-pull-refresh.vue +6 -6
  51. package/components/u-qrcode/qrcode.js +35 -29
  52. package/components/u-qrcode/u-qrcode.vue +17 -12
  53. package/components/u-radio/u-radio.vue +6 -6
  54. package/components/u-rate/rate.js +2 -2
  55. package/components/u-rate/u-rate.vue +98 -21
  56. package/components/u-search/search.js +3 -3
  57. package/components/u-search/u-search.vue +29 -6
  58. package/components/u-select/u-select.vue +141 -73
  59. package/components/u-signature/u-signature.vue +35 -16
  60. package/components/u-skeleton/u-skeleton.vue +7 -2
  61. package/components/u-slider/u-slider.vue +30 -31
  62. package/components/u-steps-item/u-steps-item.vue +20 -17
  63. package/components/u-subsection/theme-vars.scss +41 -0
  64. package/components/u-subsection/u-subsection.vue +69 -16
  65. package/components/u-swipe-action-item/u-swipe-action-item.vue +11 -5
  66. package/components/u-switch/theme-vars.scss +41 -0
  67. package/components/u-switch/u-switch.vue +44 -15
  68. package/components/u-tabbar/u-tabbar.vue +5 -5
  69. package/components/u-tabbar-item/u-tabbar-item.vue +16 -5
  70. package/components/u-table/u-table.vue +18 -3
  71. package/components/u-table2/tableRow.vue +43 -41
  72. package/components/u-table2/u-table2.vue +56 -50
  73. package/components/u-tabs/u-tabs.vue +14 -1
  74. package/components/u-tag/theme-vars.scss +21 -0
  75. package/components/u-tag/u-tag.vue +17 -7
  76. package/components/u-td/u-td.vue +5 -3
  77. package/components/u-text/text.js +1 -1
  78. package/components/u-text/u-text.vue +15 -13
  79. package/components/u-textarea/props.js +2 -2
  80. package/components/u-textarea/textarea.js +1 -1
  81. package/components/u-textarea/u-textarea.vue +115 -61
  82. package/components/u-th/u-th.vue +5 -4
  83. package/components/u-title/u-title.vue +1 -0
  84. package/components/u-toast/u-toast.vue +13 -9
  85. package/components/u-tooltip/u-tooltip.vue +1 -0
  86. package/components/u-tree/u-tree.vue +491 -51
  87. package/components/u-upload/u-upload.vue +34 -6
  88. package/index.js +178 -27
  89. package/index.scss +5 -1
  90. package/libs/config/color.js +1 -2
  91. package/libs/config/config.js +2 -0
  92. package/libs/config/props.js +1 -1
  93. package/libs/css/theme-vars-core.scss +201 -0
  94. package/libs/css/theme-vars.scss +1 -0
  95. package/libs/function/index.js +7 -7
  96. package/libs/mixin/mixin.js +111 -4
  97. package/libs/root/index.js +151 -0
  98. package/libs/root/nvue-root.vue +72 -0
  99. package/libs/root/page.js +269 -0
  100. package/libs/root/root-toast-host.vue +31 -0
  101. package/libs/root/root.js +44 -0
  102. package/libs/root/runtime.js +11 -0
  103. package/libs/root/utils.js +115 -0
  104. package/libs/theme/runtime.js +392 -0
  105. package/libs/theme/theme.js +682 -0
  106. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  107. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  108. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  109. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  110. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  111. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  112. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  113. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  114. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  115. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  116. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  117. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  118. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  119. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  120. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  121. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  122. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  123. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  124. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  125. package/libs/util/gcanvas/env/canvas.js +0 -0
  126. package/libs/util/gcanvas/env/image.js +0 -0
  127. package/libs/util/gcanvas/env/tool.js +0 -0
  128. package/libs/util/gcanvas/index.js +0 -0
  129. package/package.json +3 -2
  130. package/theme.scss +113 -32
  131. package/types/comps/qrcode.d.ts +6 -0
  132. package/types/index.d.ts +47 -2
@@ -15,8 +15,18 @@
15
15
  :showSubtitle="showSubtitle"
16
16
  :showTitle="showTitle"
17
17
  :weekText="weekText"
18
+ :showSwitch="monthSwitch"
19
+ :prevDisabled="switchPrevDisabled"
20
+ :nextDisabled="switchNextDisabled"
21
+ :prevYearDisabled="switchPrevYearDisabled"
22
+ :nextYearDisabled="switchNextYearDisabled"
23
+ @prev="prevMonth"
24
+ @next="nextMonth"
25
+ @prevYear="prevYear"
26
+ @nextYear="nextYear"
18
27
  ></uHeader>
19
28
  <scroll-view
29
+ v-if="!monthSwitch"
20
30
  :style="{
21
31
  height: addUnit(listHeight, 'px')
22
32
  }"
@@ -48,9 +58,41 @@
48
58
  :monthFormat="monthFormat"
49
59
  ref="month"
50
60
  @monthSelected="monthSelected"
51
- @updateMonthTop="updateMonthTop"
61
+ @updateMonthTop="onUpdateMonthTop"
52
62
  ></uMonth>
53
63
  </scroll-view>
64
+ <view
65
+ v-else
66
+ :style="{
67
+ height: addUnit(listHeight, 'px')
68
+ }"
69
+ >
70
+ <uMonth
71
+ :color="color"
72
+ :rowHeight="rowHeight"
73
+ :showMark="showMark"
74
+ :months="currentMonths"
75
+ :mode="mode"
76
+ :maxCount="maxCount"
77
+ :startText="startText"
78
+ :endText="endText"
79
+ :defaultDate="defaultDate"
80
+ :minDate="innerMinDate"
81
+ :maxDate="innerMaxDate"
82
+ :maxMonth="monthNum"
83
+ :readonly="readonly"
84
+ :maxRange="maxRange"
85
+ :rangePrompt="rangePrompt"
86
+ :showRangePrompt="showRangePrompt"
87
+ :allowSameDay="allowSameDay"
88
+ :forbidDays="forbidDays"
89
+ :forbidDaysToast="forbidDaysToast"
90
+ :monthFormat="monthFormat"
91
+ ref="month"
92
+ @monthSelected="monthSelected"
93
+ @updateMonthTop="onUpdateMonthTop"
94
+ ></uMonth>
95
+ </view>
54
96
  <slot name="footer" v-if="showConfirm">
55
97
  <view class="u-calendar__confirm">
56
98
  <u-button
@@ -111,6 +153,7 @@ import test from '../../libs/function/test';
111
153
  * @property {Boolean} allowSameDay 是否允许日期范围的起止时间为同一天,mode = range时有效 (默认 false )
112
154
  * @property {Number|String} round 圆角值,默认无圆角 (默认 0 )
113
155
  * @property {Number|String} monthNum 最多展示的月份数量 (默认 3 )
156
+ * @property {Boolean} monthSwitch 是否启用非滚动的单月切换模式 (默认 false )
114
157
  * @property {Array} weekText 星期文案 (默认 ['一', '二', '三', '四', '五', '六', '日'] )
115
158
  *
116
159
  * @event {Function()} confirm 点击确定按钮时触发 选择日期相关的返回参数
@@ -197,6 +240,24 @@ export default {
197
240
  return ''
198
241
  }
199
242
  },
243
+ currentMonths() {
244
+ if (this.monthSwitch && this.months.length) {
245
+ return [this.months[this.monthIndex]]
246
+ }
247
+ return this.months
248
+ },
249
+ switchPrevDisabled() {
250
+ return this.monthIndex <= 0
251
+ },
252
+ switchNextDisabled() {
253
+ return this.monthIndex >= this.months.length - 1
254
+ },
255
+ switchPrevYearDisabled() {
256
+ return this.monthIndex - 12 < 0
257
+ },
258
+ switchNextYearDisabled() {
259
+ return this.monthIndex + 12 > this.months.length - 1
260
+ },
200
261
  buttonDisabled() {
201
262
  // 如果为range类型,且选择的日期个数不足1个时,让底部的按钮出于disabled状态
202
263
  if (this.mode === 'range') {
@@ -256,7 +317,7 @@ export default {
256
317
  } else {
257
318
  bottomPadding = 30
258
319
  }
259
- this.listHeight = this.rowHeight * 5 + bottomPadding
320
+ this.listHeight = this.rowHeight * (this.monthSwitch ? 6 : 5) + bottomPadding
260
321
  this.setMonth()
261
322
  },
262
323
  close() {
@@ -350,6 +411,43 @@ export default {
350
411
  year: dayjs(minDate).add(i, 'month').year()
351
412
  })
352
413
  }
414
+ if (this.monthSwitch) {
415
+ this.monthIndex = this.getDefaultMonthIndex()
416
+ }
417
+ },
418
+ getDefaultMonthIndex() {
419
+ let selected = dayjs().format('YYYY-MM')
420
+ if (this.defaultDate) {
421
+ if (!test.array(this.defaultDate)) {
422
+ selected = dayjs(this.defaultDate).format('YYYY-MM')
423
+ } else if (this.defaultDate.length) {
424
+ selected = dayjs(this.defaultDate[0]).format('YYYY-MM')
425
+ }
426
+ }
427
+ const index = this.months.findIndex(({ year, month }) => {
428
+ return `${year}-${padZero(month)}` === selected
429
+ })
430
+ return index === -1 ? 0 : index
431
+ },
432
+ prevMonth() {
433
+ if (!this.switchPrevDisabled) {
434
+ this.monthIndex -= 1
435
+ }
436
+ },
437
+ nextMonth() {
438
+ if (!this.switchNextDisabled) {
439
+ this.monthIndex += 1
440
+ }
441
+ },
442
+ prevYear() {
443
+ if (!this.switchPrevYearDisabled) {
444
+ this.monthIndex -= 12
445
+ }
446
+ },
447
+ nextYear() {
448
+ if (!this.switchNextYearDisabled) {
449
+ this.monthIndex += 12
450
+ }
353
451
  },
354
452
  // 滚动到默认设置的月份
355
453
  scrollIntoDefaultMonth(selected) {
@@ -386,6 +484,12 @@ export default {
386
484
  }
387
485
  },
388
486
  // 更新月份的top值
487
+ onUpdateMonthTop(topArr = []) {
488
+ if (this.monthSwitch) {
489
+ return
490
+ }
491
+ this.updateMonthTop(topArr)
492
+ },
389
493
  updateMonthTop(topArr = []) {
390
494
  // 设置对应月份的top值,用于onScroll方法更新月份
391
495
  topArr.map((item, index) => {
@@ -414,6 +518,9 @@ export default {
414
518
 
415
519
  <style lang="scss" scoped>
416
520
  .u-calendar {
521
+ color: var(--up-main-color, $u-main-color);
522
+ background-color: var(--up-card-bg-color, #ffffff);
523
+
417
524
  &__confirm {
418
525
  padding: 7px 18px;
419
526
  }
@@ -59,7 +59,7 @@
59
59
  <up-icon
60
60
  size="28"
61
61
  name="backspace"
62
- color="#303133"
62
+ :color="upThemeVar('--up-main-color', '#303133')"
63
63
  ></up-icon>
64
64
  </view>
65
65
  </view>
@@ -222,25 +222,25 @@
222
222
  </script>
223
223
 
224
224
  <style lang="scss" scoped>
225
- $u-car-keyboard-background-color: rgb(224, 228, 230) !default;
225
+ $u-car-keyboard-background-color: var(--up-bg-color, rgb(224, 228, 230)) !default;
226
226
  $u-car-keyboard-padding:6px 0 6px !default;
227
227
  $u-car-keyboard-button-inner-width:64rpx !default;
228
- $u-car-keyboard-button-inner-background-color:#FFFFFF !default;
228
+ $u-car-keyboard-button-inner-background-color:var(--up-card-bg-color, #ffffff) !default;
229
229
  $u-car-keyboard-button-height:80rpx !default;
230
230
  $u-car-keyboard-button-inner-box-shadow:0 1px 0px #999992 !default;
231
231
  $u-car-keyboard-button-border-radius:4px !default;
232
232
  $u-car-keyboard-button-inner-margin:8rpx 5rpx !default;
233
233
  $u-car-keyboard-button-text-font-size:16px !default;
234
- $u-car-keyboard-button-text-color:$u-main-color !default;
234
+ $u-car-keyboard-button-text-color:var(--up-main-color, #303133) !default;
235
235
  $u-car-keyboard-center-inner-margin: 0 4rpx !default;
236
236
  $u-car-keyboard-special-button-width:134rpx !default;
237
237
  $u-car-keyboard-lang-font-size:16px !default;
238
- $u-car-keyboard-lang-color:$u-main-color !default;
238
+ $u-car-keyboard-lang-color:var(--up-main-color, #303133) !default;
239
239
  $u-car-keyboard-active-color:$u-primary !default;
240
240
  $u-car-keyboard-line-font-size:15px !default;
241
- $u-car-keyboard-line-color:$u-main-color !default;
241
+ $u-car-keyboard-line-color:var(--up-main-color, #303133) !default;
242
242
  $u-car-keyboard-line-margin:0 1px !default;
243
- $u-car-keyboard-u-hover-class-background-color:#BBBCC6 !default;
243
+ $u-car-keyboard-u-hover-class-background-color:var(--up-border-color, #BBBCC6) !default;
244
244
 
245
245
  .u-keyboard {
246
246
  @include flex(column);
@@ -136,12 +136,12 @@
136
136
  </script>
137
137
 
138
138
  <style lang="scss" scoped>
139
- .u-card {
140
- position: relative;
141
- overflow: hidden;
142
- font-size: 28rpx;
143
- background-color: #ffffff;
144
- box-sizing: border-box;
139
+ .u-card {
140
+ position: relative;
141
+ overflow: hidden;
142
+ font-size: 28rpx;
143
+ background-color: var(--up-card-bg-color, #ffffff);
144
+ box-sizing: border-box;
145
145
 
146
146
  &-full {
147
147
  // 如果是与屏幕之间不留空隙,应该设置左右边距为0
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <up-popup :show="popupShow" mode="bottom" :popup="false"
3
3
  :mask="true" :closeable="closeable" :safe-area-inset-bottom="true"
4
- close-icon-color="#ffffff" :z-index="uZIndex"
4
+ :close-icon-color="closeIconColor" :z-index="uZIndex"
5
5
  :maskCloseAble="maskCloseAble" @close="close">
6
6
  <view class="up-p-t-30 up-p-l-20 up-m-b-10" v-if="headerDirection ==='column'">
7
7
  <up-steps v-if="popupShow" dot direction="column" v-model:current="tabsIndex">
@@ -21,7 +21,7 @@
21
21
  <template v-for="(levelData, levelIndex) in levelList" :key="levelIndex">
22
22
  <view v-if="optionsCols == 2 || levelIndex == tabsIndex" class="area-item"
23
23
  :style="{ width: optionsCols == 2 ? '33.33333%' : '750rpx'}">
24
- <view class="u-padding-10 u-bg-gray" style="height: 100%;">
24
+ <view class="u-padding-10" :style="[levelPaneStyle, { height: '100%' }]">
25
25
  <scroll-view :scroll-y="true" style="height: 100%">
26
26
  <up-cell-group v-if="levelIndex === 0 || selectedValueIndexs[levelIndex - 1] !== undefined">
27
27
  <up-cell v-for="(item,index) in levelData"
@@ -199,12 +199,30 @@
199
199
  uZIndex() {
200
200
  // 如果用户有传递z-index值,优先使用
201
201
  return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
202
+ },
203
+ closeIconColor() {
204
+ return 'var(--up-main-color, #303133)';
205
+ },
206
+ levelPaneStyle() {
207
+ return {
208
+ backgroundColor: 'var(--up-bg-color, #f7f7f7)'
209
+ };
202
210
  }
203
211
  },
204
212
  // 新增confirm事件
205
213
  emits: ['update:modelValue', 'update:show', 'change', 'confirm', 'cancel'],
206
214
  methods: {
207
215
  t,
216
+ getSelectedValues() {
217
+ const result = [];
218
+ for (let i = 0; i < this.selectedValueIndexs.length; i++) {
219
+ const selectedIndex = this.selectedValueIndexs[i];
220
+ if (selectedIndex === undefined) continue;
221
+ if (!this.levelList[i] || !this.levelList[i][selectedIndex]) continue;
222
+ result.push(this.levelList[i][selectedIndex][this.valueKey]);
223
+ }
224
+ return result;
225
+ },
208
226
  initLevelList() {
209
227
  // 初始化第一级数据
210
228
  if (this.data && this.data.length > 0) {
@@ -216,7 +234,10 @@
216
234
  // 检查data是否为空
217
235
  if (!this.data || this.data.length == 0) return;
218
236
  // 检查modelValue是否为空
219
- if (!this.modelValue || this.modelValue.length == 0) return;
237
+ if (!this.modelValue || this.modelValue.length == 0) {
238
+ this.confirmValues = [];
239
+ return;
240
+ }
220
241
  // 根据默认值设置选中项
221
242
  // 根据modelValue获取indexs给selectedValueIndexs
222
243
  this.selectedValueIndexs = [];
@@ -242,6 +263,8 @@
242
263
  break;
243
264
  }
244
265
  }
266
+ // 同步确认值,避免“仅回显未改动时确认返回空数组”
267
+ this.confirmValues = this.getSelectedValues();
245
268
  },
246
269
  close() {
247
270
  this.$emit('cancel');
@@ -288,12 +311,7 @@
288
311
  // 修改emitChange方法,增加closePopup参数
289
312
  emitChange(closePopup = true) {
290
313
  // 构造选中结果
291
- const result = [];
292
- for (let i = 0; i < this.selectedValueIndexs.length; i++) {
293
- if (this.selectedValueIndexs[i] !== undefined && this.levelList[i]) {
294
- result.push(this.levelList[i][this.selectedValueIndexs[i]][this.valueKey]);
295
- }
296
- }
314
+ const result = this.getSelectedValues();
297
315
 
298
316
  // 更新confirmValues
299
317
  this.confirmValues = [...result];
@@ -310,9 +328,11 @@
310
328
  this.close();
311
329
  },
312
330
  handleConfirm() {
331
+ const values = this.confirmValues.length ? this.confirmValues : this.getSelectedValues();
332
+ this.confirmValues = [...values];
313
333
  // 确认时触发confirm事件
314
- this.$emit('update:modelValue', this.confirmValues);
315
- this.$emit('confirm', this.confirmValues);
334
+ this.$emit('update:modelValue', values);
335
+ this.$emit('confirm', values);
316
336
  this.close();
317
337
  },
318
338
  // 跳转父节点
@@ -346,6 +366,6 @@
346
366
 
347
367
  // 添加按钮区域样式
348
368
  .u-cascader-action {
349
- border-top: 1px solid #eee;
369
+ border-top: 1px solid var(--up-border-color, #eee);
350
370
  }
351
371
  </style>
@@ -285,13 +285,13 @@
285
285
  overflow: hidden;
286
286
  }
287
287
 
288
- .u-search-inner {
289
- background-color: rgb(234, 234, 234);
290
- border-radius: 100rpx;
291
- display: flex;
292
- align-items: center;
293
- padding: 10rpx 16rpx;
294
- }
288
+ .u-search-inner {
289
+ background-color: var(--up-bg-color, rgb(234, 234, 234));
290
+ border-radius: 100rpx;
291
+ display: flex;
292
+ align-items: center;
293
+ padding: 10rpx 16rpx;
294
+ }
295
295
 
296
296
  .u-search-text {
297
297
  font-size: 26rpx;
@@ -304,26 +304,26 @@
304
304
  height: 100%;
305
305
  }
306
306
 
307
- .u-cate-tab__item {
308
- height: 110rpx;
309
- background: #f6f6f6;
310
- box-sizing: border-box;
311
- display: flex;
312
- align-items: center;
313
- justify-content: center;
314
- font-size: 26rpx;
315
- color: #444;
316
- font-weight: 400;
317
- line-height: 1;
318
- }
319
-
320
- .u-cate-tab__item-active {
321
- position: relative;
322
- color: #000;
323
- font-size: 30rpx;
324
- font-weight: 600;
325
- background: #fff;
326
- }
307
+ .u-cate-tab__item {
308
+ height: 110rpx;
309
+ background: var(--up-bg-color, #f6f6f6);
310
+ box-sizing: border-box;
311
+ display: flex;
312
+ align-items: center;
313
+ justify-content: center;
314
+ font-size: 26rpx;
315
+ color: var(--up-content-color, #444);
316
+ font-weight: 400;
317
+ line-height: 1;
318
+ }
319
+
320
+ .u-cate-tab__item-active {
321
+ position: relative;
322
+ color: var(--up-main-color, #000);
323
+ font-size: 30rpx;
324
+ font-weight: 600;
325
+ background: var(--up-card-bg-color, #fff);
326
+ }
327
327
 
328
328
  .u-cate-tab__item-active::before {
329
329
  content: "";
@@ -338,37 +338,38 @@
338
338
  height: 100%;
339
339
  }
340
340
 
341
- .u-cate-tab__right-box {
342
- flex: 1;
343
- background-color: rgb(250, 250, 250);
344
- }
341
+ .u-cate-tab__right-box {
342
+ flex: 1;
343
+ background-color: var(--up-page-bg-color, var(--up-bg-color, rgb(250, 250, 250)));
344
+ }
345
345
 
346
346
  .u-cate-tab__page-view {
347
347
  padding: 16rpx;
348
348
  }
349
349
 
350
- .u-cate-tab__page-item {
351
- margin-bottom: 30rpx;
352
- background-color: #fff;
353
- padding: 16rpx;
354
- border-radius: 8rpx;
355
- }
350
+ .u-cate-tab__page-item {
351
+ margin-bottom: 30rpx;
352
+ background-color: var(--up-card-bg-color, #fff);
353
+ border: 1px solid var(--up-border-color, #e5e7eb);
354
+ padding: 16rpx;
355
+ border-radius: 8rpx;
356
+ }
356
357
 
357
358
  .u-cate-tab__page-item:last-child {
358
359
  min-height: 100vh;
359
360
  }
360
361
 
361
- .item-title {
362
- font-size: 26rpx;
363
- color: $u-main-color;
364
- font-weight: bold;
365
- }
366
-
367
- .item-menu-name {
368
- font-weight: normal;
369
- font-size: 24rpx;
370
- color: $u-main-color;
371
- }
362
+ .item-title {
363
+ font-size: 26rpx;
364
+ color: var(--up-main-color, $u-main-color);
365
+ font-weight: bold;
366
+ }
367
+
368
+ .item-menu-name {
369
+ font-weight: normal;
370
+ font-size: 24rpx;
371
+ color: var(--up-main-color, $u-main-color);
372
+ }
372
373
 
373
374
  .item-container {
374
375
  display: flex;
@@ -15,23 +15,25 @@
15
15
  <!-- 将slot与默认内容用if/else分开主要是因为微信小程序不支持slot嵌套传递,这样才能解决collapse组件的slot不失效问题,label暂时未用到。 -->
16
16
  <slot name="title" v-if="$slots.title || !title">
17
17
  </slot>
18
- <text v-else class="u-cell__title-text" :style="[titleTextStyle]"
18
+ <text v-else class="u-cell__title-text" :style="[titleTextStyle, cellTitleDynamicStyle]"
19
19
  :class="[required && 'u-cell--required', disabled && 'u-cell--disabled', size === 'large' && 'u-cell__title-text--large']">{{ title }}</text>
20
20
  <slot name="label">
21
21
  <text class="u-cell__label" v-if="label"
22
+ :style="[cellLabelDynamicStyle]"
22
23
  :class="[disabled && 'u-cell--disabled', size === 'large' && 'u-cell__label--large']">{{ label }}</text>
23
24
  </slot>
24
25
  </view>
25
26
  </view>
26
27
  <slot name="value">
27
28
  <text class="u-cell__value"
29
+ :style="[cellValueDynamicStyle]"
28
30
  :class="[disabled && 'u-cell--disabled', size === 'large' && 'u-cell__value--large']"
29
31
  v-if="!testEmpty(value)">{{ value }}</text>
30
32
  </slot>
31
33
  <view class="u-cell__right-icon-wrap" v-if="$slots['right-icon'] || isLink"
32
34
  :class="[`u-cell__right-icon-wrap--${arrowDirection}`]">
33
35
  <up-icon v-if="rightIcon && !$slots['right-icon']" :name="rightIcon"
34
- :custom-style="rightIconStyle" :color="disabled ? '#c8c9cc' : 'info'"
36
+ :custom-style="rightIconStyle" :color="disabled ? cellDisabledColor : 'info'"
35
37
  :size="size === 'large' ? 18 : 16"></up-icon>
36
38
  <slot v-else name="right-icon">
37
39
  </slot>
@@ -91,6 +93,24 @@
91
93
  computed: {
92
94
  titleTextStyle() {
93
95
  return addStyle(this.titleStyle)
96
+ },
97
+ cellDisabledColor() {
98
+ return this.upThemeVar('--up-disabled-color', '#c8c9cc')
99
+ },
100
+ cellTitleDynamicStyle() {
101
+ return {
102
+ color: this.upThemeVar('--up-main-color', '#303133')
103
+ }
104
+ },
105
+ cellLabelDynamicStyle() {
106
+ return {
107
+ color: this.upThemeVar('--up-tips-color', '#909399')
108
+ }
109
+ },
110
+ cellValueDynamicStyle() {
111
+ return {
112
+ color: this.upThemeVar('--up-content-color', '#606266')
113
+ }
94
114
  }
95
115
  },
96
116
  emits: ['click'],
@@ -127,8 +147,8 @@
127
147
  $u-cell-label-line-height: 18px !default;
128
148
  $u-cell-value-font-size: 14px !default;
129
149
  $u-cell-value-color: $u-content-color !default;
130
- $u-cell-clickable-color: $u-bg-color !default;
131
- $u-cell-disabled-color: #c8c9cc !default;
150
+ $u-cell-clickable-color: var(--up-hover-bg-color, #f1f1f1) !default;
151
+ $u-cell-disabled-color: $u-disabled-color !default;
132
152
  $u-cell-padding-top-large: 13px !default;
133
153
  $u-cell-padding-bottom-large: 13px !default;
134
154
  $u-cell-value-font-size-large: 15px !default;
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <view :style="[addStyle(customStyle)]" :class="[customClass]" class="u-cell-group">
2
+ <view :style="[groupStyle, addStyle(customStyle)]" :class="[customClass]" class="u-cell-group">
3
3
  <view v-if="title" class="u-cell-group__title">
4
4
  <slot name="title">
5
- <text class="u-cell-group__title__text">{{ title }}</text>
5
+ <text class="u-cell-group__title__text" :style="{ color: upThemeVar('--up-main-color', '#303133') }">{{ title }}</text>
6
6
  </slot>
7
7
  </view>
8
8
  <view class="u-cell-group__wrapper">
@@ -32,6 +32,14 @@
32
32
  export default {
33
33
  name: 'u-cell-group',
34
34
  mixins: [mpMixin, mixin, props],
35
+ computed: {
36
+ groupStyle() {
37
+ const fallbackBg = this.upThemeIsDark ? '#1c1c1e' : '#ffffff'
38
+ return {
39
+ backgroundColor: this.upThemeVar('--up-card-bg-color', fallbackBg)
40
+ }
41
+ }
42
+ },
35
43
  methods: {
36
44
  addStyle
37
45
  }
@@ -63,4 +71,3 @@
63
71
  }
64
72
  }
65
73
  </style>
66
-
@@ -111,16 +111,16 @@
111
111
  },
112
112
  // 组件选中激活时的颜色
113
113
  elActiveColor() {
114
- return this.activeColor ? this.activeColor : (this.parentData.activeColor ? this.parentData.activeColor : '#2979ff');
114
+ return this.activeColor ? this.activeColor : (this.parentData.activeColor ? this.parentData.activeColor : this.upThemeVar('--up-primary', '#2979ff'));
115
115
  },
116
116
  // 组件选未中激活时的颜色
117
117
  elInactiveColor() {
118
118
  return this.inactiveColor ? this.inactiveColor : (this.parentData.inactiveColor ? this.parentData.inactiveColor :
119
- '#c8c9cc');
119
+ this.upThemeVar('--up-border-color', '#c8c9cc'));
120
120
  },
121
121
  // label的颜色
122
122
  elLabelColor() {
123
- return this.labelColor ? this.labelColor : (this.parentData.labelColor ? this.parentData.labelColor : '#606266')
123
+ return this.labelColor ? this.labelColor : (this.parentData.labelColor ? this.parentData.labelColor : this.upThemeVar('--up-content-color', '#606266'))
124
124
  },
125
125
  // 组件的形状
126
126
  elShape() {
@@ -133,7 +133,7 @@
133
133
  },
134
134
  elIconColor() {
135
135
  const iconColor = this.iconColor ? this.iconColor : (this.parentData.iconColor ? this.parentData.iconColor :
136
- '#ffffff');
136
+ this.upThemeVar('--up-card-bg-color', '#ffffff'));
137
137
  // 图标的颜色
138
138
  if (this.elDisabled) {
139
139
  // disabled状态下,已勾选的checkbox图标改为elInactiveColor
@@ -161,7 +161,7 @@
161
161
  iconWrapStyle() {
162
162
  // checkbox的整体样式
163
163
  const style = {}
164
- style.backgroundColor = this.isChecked && !this.elDisabled ? this.elActiveColor : '#ffffff'
164
+ style.backgroundColor = this.isChecked && !this.elDisabled ? this.elActiveColor : this.upThemeVar('--up-card-bg-color', '#ffffff')
165
165
  style.borderColor = this.isChecked && !this.elDisabled ? this.elActiveColor : this.elInactiveColor
166
166
  style.width = addUnit(this.elSize)
167
167
  style.height = addUnit(this.elSize)
@@ -294,7 +294,7 @@
294
294
  $u-checkbox-icon-wrap-checked-color:#fff !default;
295
295
  $u-checkbox-icon-wrap-checked-background-color:red !default;
296
296
  $u-checkbox-icon-wrap-checked-border-color:#2979ff !default;
297
- $u-checkbox-icon-wrap-disabled-background-color:#ebedf0 !default;
297
+ $u-checkbox-icon-wrap-disabled-background-color:var(--up-bg-color, #ebedf0) !default;
298
298
  $u-checkbox-icon-wrap-disabled-checked-color:#c8c9cc !default;
299
299
  $u-checkbox-label-margin-left:5px !default;
300
300
  $u-checkbox-label-margin-right:12px !default;
@@ -91,9 +91,14 @@
91
91
  currentIndex: ''
92
92
  }
93
93
  },
94
- created: function () {
95
- this.currentIndex = this.modelValue;
96
- },
94
+ watch: {
95
+ modelValue: {
96
+ immediate: true,
97
+ handler(newVal) {
98
+ this.currentIndex = newVal
99
+ }
100
+ }
101
+ },
97
102
  emits: ['update:modelValue', 'custom-click'],
98
103
  methods: {
99
104
  change(index){
@@ -106,4 +111,4 @@
106
111
  }
107
112
  }
108
113
  }
109
- </script>
114
+ </script>
@@ -139,25 +139,31 @@
139
139
  }
140
140
  </script>
141
141
 
142
- <style lang="scss">
143
- .list__item {
144
- padding: 8px 1px;
145
- }
146
- .u-current-city-title {
147
- color: grey;
148
- margin-bottom: 5px;
149
- }
150
- .u-current-city-item {
151
- height: 30px;
152
- }
153
- .hot-city-list {
154
- display: flex !important;
155
- flex-direction: row !important;
156
- padding: 12px 0;
157
- .hot-city-item {
158
- padding: 6px 12px;
159
- margin: 5px;
160
- border: 1px solid #ededed;
161
- }
162
- }
163
- </style>
142
+ <style lang="scss">
143
+ .list__item {
144
+ padding: 8px 1px;
145
+ }
146
+ .u-current-city-title {
147
+ color: var(--up-tips-color, #909399);
148
+ margin-bottom: 5px;
149
+ }
150
+ .u-location-city,
151
+ .list__item__city-name {
152
+ color: var(--up-main-color, #303133);
153
+ }
154
+ .u-current-city-item {
155
+ height: 30px;
156
+ }
157
+ .hot-city-list {
158
+ display: flex !important;
159
+ flex-direction: row !important;
160
+ padding: 12px 0;
161
+ .hot-city-item {
162
+ padding: 6px 12px;
163
+ margin: 5px;
164
+ color: var(--up-main-color, #303133);
165
+ border: 1px solid var(--up-border-color, #ededed);
166
+ background-color: var(--up-card-bg-color, #ffffff);
167
+ }
168
+ }
169
+ </style>