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
@@ -31,7 +31,7 @@
31
31
  :toolbarRightSlot="toolbarRightSlot"
32
32
  :pageInline="pageInline"
33
33
  :maskClass="maskClass"
34
- :maskStyle="maskStyle"
34
+ :maskStyle="resolvedMaskStyle"
35
35
  @close="close"
36
36
  @cancel="cancel"
37
37
  @confirm="confirm"
@@ -111,6 +111,9 @@
111
111
  },
112
112
  watch: {
113
113
  show(newValue, oldValue) {
114
+ if (!newValue && this.hasInput) {
115
+ this.showByClickInput = false
116
+ }
114
117
  if (newValue) {
115
118
  // #ifdef VUE3
116
119
  this.innerValue = this.correctValue(this.modelValue)
@@ -142,6 +145,17 @@
142
145
  propsChange() {
143
146
  return [this.mode, this.maxDate, this.minDate, this.minHour, this.maxHour, this.minMinute, this.maxMinute, this.filter, this.modelValue]
144
147
  },
148
+ resolvedMaskStyle() {
149
+ if (this.upHasProp('maskStyle')) {
150
+ return this.maskStyle || ''
151
+ }
152
+ if (this.upThemeIsDark) {
153
+ const topBottomStrong = 'rgba(28, 28, 30, 0.95)'
154
+ const topBottomWeak = 'rgba(28, 28, 30, 0.6)'
155
+ return `background-image: linear-gradient(180deg, ${topBottomStrong}, ${topBottomWeak}), linear-gradient(0deg, ${topBottomStrong}, ${topBottomWeak});`
156
+ }
157
+ return ''
158
+ },
145
159
  // input的props
146
160
  inputPropsInner() {
147
161
  return {
@@ -160,6 +174,20 @@
160
174
  emits: ['close', 'cancel', 'confirm', 'change', 'update:modelValue'],
161
175
  // #endif
162
176
  methods: {
177
+ toInt(value, fallback = 0) {
178
+ const num = parseInt(value, 10)
179
+ return Number.isFinite(num) ? num : fallback
180
+ },
181
+ // 按列安全读取 picker 值,避免快速滚动时出现越界/空值
182
+ safeColumnValue(values, columnIndex, optionIndex, fallback = '') {
183
+ const column = Array.isArray(values[columnIndex]) ? values[columnIndex] : []
184
+ if (!column.length) return fallback
185
+ let index = Number(optionIndex)
186
+ if (!Number.isFinite(index)) index = 0
187
+ index = range(0, column.length - 1, index)
188
+ const value = column[index]
189
+ return value == null ? fallback : value
190
+ },
163
191
  getInputValue(newValue) {
164
192
  if (newValue == '' || !newValue || newValue == undefined) {
165
193
  this.inputValue = ''
@@ -214,6 +242,9 @@
214
242
  // 关闭选择器
215
243
  close() {
216
244
  if (this.closeOnClickOverlay) {
245
+ if (this.hasInput) {
246
+ this.showByClickInput = false
247
+ }
217
248
  this.$emit('close')
218
249
  }
219
250
  },
@@ -243,7 +274,13 @@
243
274
  },
244
275
  //用正则截取输出值,当出现多组数字时,抛出错误
245
276
  intercept(e,type){
246
- let judge = e.match(/\d+/g)
277
+ if (e === undefined || e === null) {
278
+ return type ? '0000' : '00'
279
+ }
280
+ let judge = String(e).match(/\d+/g)
281
+ if (!judge || judge.length === 0) {
282
+ return type ? '0000' : '00'
283
+ }
247
284
  //判断是否掺杂数字
248
285
  if(judge.length>1){
249
286
  error("请勿在过滤或格式化函数时添加数字")
@@ -260,30 +297,53 @@
260
297
  // 列发生变化时触发
261
298
  change(e) {
262
299
  const { indexs, values } = e
300
+ const safeValues = Array.isArray(values) ? values : []
263
301
  let selectValue = ''
264
302
  if(this.mode === 'time') {
265
303
  // 根据value各列索引,从各列数组中,取出当前时间的选中值
266
- selectValue = `${this.intercept(values[0][indexs[0]])}:${this.intercept(values[1][indexs[1]])}`
304
+ const hourText = this.safeColumnValue(safeValues, 0, indexs[0], padZero(this.minHour))
305
+ const minuteText = this.safeColumnValue(safeValues, 1, indexs[1], padZero(this.minMinute))
306
+ let hour = this.toInt(this.intercept(hourText), this.minHour)
307
+ let minute = this.toInt(this.intercept(minuteText), this.minMinute)
308
+ hour = range(this.minHour, this.maxHour, hour)
309
+ minute = range(this.minMinute, this.maxMinute, minute)
310
+ selectValue = `${padZero(hour)}:${padZero(minute)}`
267
311
  } else {
312
+ const validCurrent = dayjs(this.innerValue).isValid() ? dayjs(this.innerValue) : dayjs(this.minDate)
313
+ const currentYear = validCurrent.year()
314
+ const currentMonth = validCurrent.month() + 1
315
+ const currentDate = validCurrent.date()
316
+ const currentHour = validCurrent.hour()
317
+ const currentMinute = validCurrent.minute()
318
+
319
+ const yearText = this.safeColumnValue(safeValues, 0, indexs[0], `${currentYear}`)
320
+ const monthText = this.safeColumnValue(safeValues, 1, indexs[1], padZero(currentMonth))
268
321
  // 将选择的值转为数值,比如'03'转为数值的3,'2019'转为数值的2019
269
- const year = parseInt(this.intercept(values[0][indexs[0]],'year'))
270
- const month = parseInt(this.intercept(values[1][indexs[1]]))
271
- let date = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1)
322
+ let year = this.toInt(this.intercept(yearText, 'year'), currentYear)
323
+ let month = this.toInt(this.intercept(monthText), currentMonth)
272
324
  let hour = 0, minute = 0
325
+ month = range(1, 12, month)
273
326
  // 此月份的最大天数
274
327
  const maxDate = dayjs(`${year}-${month}`).daysInMonth()
328
+ const dayText = this.safeColumnValue(safeValues, 2, indexs[2], padZero(Math.min(currentDate, maxDate)))
329
+ let date = this.toInt(this.intercept(dayText), Math.min(currentDate, maxDate))
275
330
  // year-month模式下,date不会出现在列中,设置为1,为了符合后边需要减1的需求
276
331
  if (this.mode === 'year-month') {
277
332
  date = 1
278
333
  }
279
334
  // 不允许超过maxDate值
280
- date = Math.min(maxDate, date)
335
+ date = range(1, maxDate, date)
281
336
  if (this.mode === 'datetime') {
282
- hour = parseInt(this.intercept(values[3][indexs[3]]))
283
- minute = parseInt(this.intercept(values[4][indexs[4]]))
337
+ const hourText = this.safeColumnValue(safeValues, 3, indexs[3], padZero(currentHour))
338
+ const minuteText = this.safeColumnValue(safeValues, 4, indexs[4], padZero(currentMinute))
339
+ hour = range(0, 23, this.toInt(this.intercept(hourText), currentHour))
340
+ minute = range(0, 59, this.toInt(this.intercept(minuteText), currentMinute))
284
341
  }
285
342
  // 转为时间模式
286
343
  selectValue = Number(new Date(year, month - 1, date, hour, minute))
344
+ if (!Number.isFinite(selectValue)) {
345
+ selectValue = this.correctValue(this.innerValue)
346
+ }
287
347
  }
288
348
  // 取出准确的合法值,防止超越边界的情况
289
349
  selectValue = this.correctValue(selectValue)
@@ -440,6 +500,15 @@
440
500
  range: [minMinute, maxMinute],
441
501
  },
442
502
  ];
503
+ // 兜底:防止边界计算异常导致日列出现空范围(快速滚动场景)
504
+ if (result[2] && result[2].type === 'day') {
505
+ const start = Number(result[2].range[0])
506
+ const end = Number(result[2].range[1])
507
+ if (!Number.isFinite(start) || !Number.isFinite(end) || start > end) {
508
+ const fallbackDays = dayjs(this.innerValue).isValid() ? dayjs(this.innerValue).daysInMonth() : 31
509
+ result[2].range = [1, fallbackDays]
510
+ }
511
+ }
443
512
  if (this.mode === 'date')
444
513
  result.splice(3, 2);
445
514
  if (this.mode === 'year-month')
@@ -518,7 +587,7 @@
518
587
  flex-direction: column;
519
588
  justify-content: center;
520
589
  border-radius: 4px;
521
- border: 1px solid #eee;
590
+ border: 1px solid var(--up-border-color, #eee);
522
591
  padding: 0 10px;
523
592
  }
524
593
  }
@@ -371,6 +371,9 @@ export default {
371
371
  position: relative;
372
372
  padding: 0;
373
373
  box-sizing: border-box;
374
+ border: 1px solid var(--up-border-color, rgba(125, 126, 128, 0.35));
375
+ border-radius: 8px;
376
+ background-color: var(--up-card-bg-color, #ffffff);
374
377
  }
375
378
  }
376
379
 
@@ -8,13 +8,13 @@
8
8
  <view class="u-dropdown__menu__item" v-for="(item, index) in menuList" :key="index" @tap.stop="menuClick(index)">
9
9
  <view class="u-flex u-flex-row">
10
10
  <text class="u-dropdown__menu__item__text" :style="{
11
- color: item.disabled ? '#c0c4cc' : (index === current || highlightIndexList.includes(index)) ? activeColor : inactiveColor,
11
+ color: item.disabled ? menuDisabledColor : (index === current || highlightIndexList.includes(index)) ? resolvedActiveColor : resolvedInactiveColor,
12
12
  fontSize: addUnit(titleSize)
13
13
  }">{{item.title}}</text>
14
14
  <view class="u-dropdown__menu__item__arrow" :class="{
15
15
  'u-dropdown__menu__item__arrow--rotate': index === current
16
16
  }">
17
- <up-icon :custom-style="{display: 'flex'}" :name="menuIcon" :size="addUnit(menuIconSize)" :color="index === current || highlightIndexList.includes(index) ? activeColor : '#c0c4cc'"></up-icon>
17
+ <up-icon :custom-style="{display: 'flex'}" :name="menuIcon" :size="addUnit(menuIconSize)" :color="index === current || highlightIndexList.includes(index) ? resolvedActiveColor : menuDisabledColor"></up-icon>
18
18
  </view>
19
19
  </view>
20
20
  </view>
@@ -77,6 +77,19 @@
77
77
  }
78
78
  },
79
79
  computed: {
80
+ resolvedActiveColor() {
81
+ return this.activeColor === '#2979ff'
82
+ ? this.upThemeVar('--up-primary', '#2979ff')
83
+ : this.activeColor
84
+ },
85
+ resolvedInactiveColor() {
86
+ return this.inactiveColor === '#606266'
87
+ ? this.upThemeVar('--up-content-color', '#606266')
88
+ : this.inactiveColor
89
+ },
90
+ menuDisabledColor() {
91
+ return this.upThemeVar('--up-disabled-color', '#c0c4cc')
92
+ },
80
93
  // 下拉出来部分的样式
81
94
  popupStyle() {
82
95
  let style = {};
@@ -76,8 +76,8 @@
76
76
  if (parent) {
77
77
  this.parent = parent;
78
78
  // 将子组件的激活颜色配置为父组件设置的激活和未激活时的颜色
79
- this.activeColor = parent.activeColor;
80
- this.inactiveColor = parent.inactiveColor;
79
+ this.activeColor = parent.resolvedActiveColor || parent.activeColor;
80
+ this.inactiveColor = parent.resolvedInactiveColor || parent.inactiveColor;
81
81
  // 将本组件的this,放入到父组件的children数组中,让父组件可以操作本(子)组件的方法和属性
82
82
  // push进去前,显判断是否已经存在了本实例,因为在子组件内部数据变化时,会通过父组件重新初始化子组件
83
83
  let exist = parent.children.find(val => {
@@ -115,6 +115,6 @@
115
115
 
116
116
  <style scoped lang="scss">
117
117
  .u-dropdown-item__scroll {
118
- background: #ffffff;
118
+ background: var(--up-card-bg-color, #ffffff);
119
119
  }
120
120
  </style>
@@ -36,7 +36,7 @@
36
36
  </view>
37
37
  <text
38
38
  class="u-form-item__body__left__content__label"
39
- :style="[parentData.labelStyle, {
39
+ :style="[labelDynamicStyle, parentData.labelStyle, {
40
40
  justifyContent: parentData['labelAlign'] === 'left' ? 'flex-start' : parentData['labelAlign'] === 'center' ? 'center' : 'flex-end'
41
41
  }]"
42
42
  >{{ label }}</text>
@@ -122,6 +122,11 @@
122
122
  },
123
123
  // 组件创建完成时,将当前实例保存到u-form中
124
124
  computed: {
125
+ labelDynamicStyle() {
126
+ return {
127
+ color: this.upThemeVar('--up-main-color', '#303133')
128
+ }
129
+ },
125
130
  propsLine() {
126
131
  return defProps.line
127
132
  }
@@ -24,8 +24,12 @@
24
24
  mixins: [mpMixin, mixin, props],
25
25
  computed: {
26
26
  gapStyle() {
27
+ const defaultBg = this.upThemeIsDark ? '#111111' : 'transparent'
28
+ const resolvedBg = (this.bgColor && this.bgColor !== 'transparent')
29
+ ? this.bgColor
30
+ : this.upThemeVar('--up-gap-bg-color', defaultBg)
27
31
  const style = {
28
- backgroundColor: this.bgColor,
32
+ backgroundColor: resolvedBg,
29
33
  height: addUnit(this.height),
30
34
  marginTop: addUnit(this.marginTop),
31
35
  marginBottom: addUnit(this.marginBottom),
@@ -149,7 +149,7 @@
149
149
  },
150
150
  // 是否可以购买
151
151
  canBuy() {
152
- const selectedSkuCount = Object.keys(this.selectedSku).length
152
+ const selectedSkuCount = Object.keys(this.selectedSku).filter((key) => this.selectedSku[key] !== '').length
153
153
  const skuTreeCount = this.skuTree.length
154
154
  return selectedSkuCount === skuTreeCount && this.buyNum > 0 && this.stock > 0
155
155
  },
@@ -312,7 +312,7 @@
312
312
 
313
313
  <style lang="scss" scoped>
314
314
  .up-goods-sku {
315
- background-color: #fff;
315
+ background-color: var(--up-card-bg-color, #fff);
316
316
  overflow: hidden;
317
317
 
318
318
  .up-goods-sku-container {
@@ -349,26 +349,26 @@
349
349
 
350
350
  &__symbol {
351
351
  font-size: 24rpx;
352
- color: #fa3534;
352
+ color: var(--up-error, #fa3534);
353
353
  margin-right: 4rpx;
354
354
  }
355
355
 
356
356
  &__value {
357
357
  font-size: 36rpx;
358
- color: #fa3534;
358
+ color: var(--up-error, #fa3534);
359
359
  font-weight: bold;
360
360
  }
361
361
  }
362
362
 
363
363
  &__stock {
364
364
  font-size: 26rpx;
365
- color: #999;
365
+ color: var(--up-tips-color, #999);
366
366
  margin-bottom: 20rpx;
367
367
  }
368
368
 
369
369
  &__selected {
370
370
  font-size: 26rpx;
371
- color: #333;
371
+ color: var(--up-main-color, #333);
372
372
  }
373
373
  }
374
374
  }
@@ -382,7 +382,7 @@
382
382
 
383
383
  &__title {
384
384
  font-size: 28rpx;
385
- color: #333;
385
+ color: var(--up-main-color, #333);
386
386
  margin-bottom: 20rpx;
387
387
  }
388
388
 
@@ -393,21 +393,22 @@
393
393
 
394
394
  &__item {
395
395
  padding: 10rpx 20rpx;
396
- border: 2rpx solid #eee;
396
+ border: 2rpx solid var(--up-border-color, #eee);
397
397
  border-radius: 10rpx;
398
398
  margin-right: 20rpx;
399
399
  margin-bottom: 20rpx;
400
400
  font-size: 26rpx;
401
- color: #333;
401
+ color: var(--up-main-color, #333);
402
+ background-color: var(--up-card-bg-color, #fff);
402
403
 
403
404
  &--active {
404
- border-color: #fa3534;
405
- color: #fa3534;
405
+ border-color: var(--up-error, #fa3534);
406
+ color: var(--up-error, #fa3534);
406
407
  }
407
408
 
408
409
  &--disabled {
409
- color: #ccc;
410
- border-color: #eee;
410
+ color: var(--up-disabled-color, #ccc);
411
+ border-color: var(--up-border-color, #eee);
411
412
  }
412
413
  }
413
414
  }
@@ -422,7 +423,7 @@
422
423
 
423
424
  &__title {
424
425
  font-size: 28rpx;
425
- color: #333;
426
+ color: var(--up-main-color, #333);
426
427
  }
427
428
  }
428
429
  }
@@ -431,4 +432,4 @@
431
432
  padding: 20rpx 0rpx 40rpx 0;
432
433
  }
433
434
  }
434
- </style>
435
+ </style>
@@ -8,14 +8,14 @@
8
8
  :ref="`u-index-anchor-${text}`"
9
9
  :style="{
10
10
  height: addUnit(height),
11
- backgroundColor: bgColor
11
+ backgroundColor: resolvedBgColor
12
12
  }"
13
13
  >
14
14
  <text
15
15
  class="u-index-anchor__text"
16
16
  :style="{
17
17
  fontSize: addUnit(size),
18
- color: color
18
+ color: resolvedColor
19
19
  }"
20
20
  >{{ text.name || text }}</text>
21
21
  </view>
@@ -79,6 +79,17 @@
79
79
  }
80
80
  },
81
81
  computed: {
82
+ resolvedColor() {
83
+ return this.color === '#606266'
84
+ ? this.upThemeVar('--up-content-color', '#606266')
85
+ : this.color
86
+ },
87
+ resolvedBgColor() {
88
+ const isDefaultBgColor = this.bgColor === '#f1f1f1' || this.bgColor === '#dedede'
89
+ return isDefaultBgColor
90
+ ? this.upThemeVar('--up-bg-color', '#f1f1f1')
91
+ : this.bgColor
92
+ },
82
93
  parentSticky() {
83
94
  const indexList = $parent.call(this, "u-index-list");
84
95
  return indexList ? indexList.sticky : true;
@@ -60,12 +60,12 @@
60
60
  v-for="(item, index) in uIndexList"
61
61
  :key="index"
62
62
  :style="{
63
- backgroundColor: activeIndex === index ? activeColor : 'transparent'
63
+ backgroundColor: activeIndex === index ? resolvedActiveColor : 'transparent'
64
64
  }"
65
65
  >
66
66
  <text
67
67
  class="u-index-list__letter__item__index"
68
- :style="{color: activeIndex === index ? '#fff' : inactiveColor}"
68
+ :style="{color: activeIndex === index ? activeLetterTextColor : resolvedInactiveColor}"
69
69
  >{{ item.key || item }}</text>
70
70
  </view>
71
71
  </view>
@@ -172,6 +172,19 @@
172
172
  itemHeight
173
173
  } = this.letterInfo
174
174
  return Math.floor(top - (height / 2) + itemHeight * this.activeIndex + itemHeight - 70 / 2)
175
+ },
176
+ resolvedInactiveColor() {
177
+ return this.inactiveColor === '#606266'
178
+ ? this.upThemeVar('--up-content-color', '#606266')
179
+ : this.inactiveColor
180
+ },
181
+ resolvedActiveColor() {
182
+ return this.activeColor === '#5677fc'
183
+ ? this.upThemeVar('--up-primary', '#5677fc')
184
+ : this.activeColor
185
+ },
186
+ activeLetterTextColor() {
187
+ return this.upThemeVar('--up-white', '#ffffff')
175
188
  }
176
189
  },
177
190
  watch: {
@@ -577,8 +590,8 @@
577
590
  height: 50px;
578
591
  border-radius: 100px 100px 0 100px;
579
592
  text-align: center;
580
- color: #ffffff;
581
- background-color: #c9c9c9;
593
+ color: var(--up-white, #ffffff);
594
+ background-color: var(--up-index-list-indicator-bg-color, var(--up-content-color, #c9c9c9));
582
595
  transform: rotate(-45deg);
583
596
  @include flex;
584
597
  justify-content: center;
@@ -588,7 +601,7 @@
588
601
  font-size: 28px;
589
602
  line-height: 28px;
590
603
  font-weight: bold;
591
- color: #fff;
604
+ color: var(--up-white, #fff);
592
605
  transform: rotate(45deg);
593
606
  text-align: center;
594
607
  }
@@ -14,13 +14,13 @@ export default {
14
14
  type: 'text',
15
15
  fixed: false,
16
16
  disabled: false,
17
- disabledColor: '#f5f7fa',
17
+ disabledColor: '',
18
18
  clearable: false,
19
19
  password: false,
20
20
  maxlength: 140,
21
21
  placeholder: null,
22
22
  placeholderClass: 'input-placeholder',
23
- placeholderStyle: 'color: #c0c4cc',
23
+ placeholderStyle: '',
24
24
  showWordLimit: false,
25
25
  confirmType: 'done',
26
26
  confirmHold: false,
@@ -35,7 +35,7 @@ export default {
35
35
  adjustPosition: true,
36
36
  inputAlign: 'left',
37
37
  fontSize: '15px',
38
- color: '#303133',
38
+ color: '',
39
39
  prefixIcon: '',
40
40
  prefixIconStyle: '',
41
41
  suffixIcon: '',
@@ -29,7 +29,7 @@
29
29
  :disabled="disabled || readonly"
30
30
  :maxlength="maxlength"
31
31
  :placeholder="placeholder"
32
- :placeholder-style="placeholderStyle"
32
+ :placeholder-style="placeholderStyleInner"
33
33
  :placeholder-class="placeholderClass"
34
34
  :confirm-type="confirmType"
35
35
  :confirm-hold="confirmHold"
@@ -188,6 +188,12 @@ export default {
188
188
  }
189
189
  },
190
190
  computed: {
191
+ placeholderStyleInner() {
192
+ if (this.placeholderStyle) {
193
+ return this.placeholderStyle;
194
+ }
195
+ return `color: ${this.upThemeVar('--up-tips-color', this.$u?.color?.tipsColor || '#909399')}`;
196
+ },
191
197
  // 是否密码
192
198
  isPassword() {
193
199
  let ret = false;
@@ -220,21 +226,37 @@ export default {
220
226
  let classes = [],
221
227
  { border, disabled, shape } = this;
222
228
  border === "surround" &&
223
- (classes = classes.concat(["u-border", "u-input--radius"]));
229
+ (classes = classes.concat(["u-input--radius"]));
224
230
  classes.push(`u-input--${shape}`);
225
231
  border === "bottom" &&
226
232
  (classes = classes.concat([
227
- "u-border-bottom",
228
233
  "u-input--no-radius",
229
234
  ]));
230
235
  return classes.join(" ");
231
236
  },
237
+ inputBorderColor() {
238
+ const lightBorder = this.upThemeVar('--up-border-color', '#dadbde');
239
+ return this.upThemeVar(
240
+ '--up-input-border-color',
241
+ this.upThemeIsDark ? 'rgba(255, 255, 255, 0.08)' : lightBorder
242
+ );
243
+ },
232
244
  // 组件的样式
233
245
  wrapperStyle() {
234
246
  const style = {};
235
247
  // 禁用状态下,被背景色加上对应的样式
236
248
  if (this.disabled) {
237
- style.backgroundColor = this.disabledColor;
249
+ style.backgroundColor = this.disabledColor || this.upThemeVar('--up-bg-color', this.$u?.color?.bgColor || '#f3f4f6');
250
+ }
251
+ if (this.border === "surround") {
252
+ style.borderWidth = "0.5px";
253
+ style.borderStyle = "solid";
254
+ style.borderColor = this.inputBorderColor;
255
+ }
256
+ if (this.border === "bottom") {
257
+ style.borderBottomWidth = "0.5px";
258
+ style.borderBottomStyle = "solid";
259
+ style.borderBottomColor = this.inputBorderColor;
238
260
  }
239
261
  // 无边框时,去除内边距
240
262
  if (this.border === "none") {
@@ -251,7 +273,7 @@ export default {
251
273
  // 输入框的样式
252
274
  inputStyle() {
253
275
  const style = {
254
- color: this.color,
276
+ color: this.color || this.upThemeVar('--up-main-color', this.$u?.color?.mainColor || '#303133'),
255
277
  fontSize: addUnit(this.fontSize),
256
278
  textAlign: this.inputAlign
257
279
  };
@@ -8,9 +8,7 @@
8
8
  :safeAreaInsetBottom="safeAreaInsetBottom"
9
9
  @close="popupClose"
10
10
  :zIndex="zIndex"
11
- :customStyle="{
12
- backgroundColor: 'rgb(214, 218, 220)'
13
- }"
11
+ :customStyle="popupStyle"
14
12
  >
15
13
  <view class="u-keyboard">
16
14
  <slot />
@@ -106,6 +104,13 @@
106
104
  }
107
105
  },
108
106
  mixins: [mpMixin, mixin, props],
107
+ computed: {
108
+ popupStyle() {
109
+ return {
110
+ backgroundColor: this.upThemeVar('--up-bg-color', this.upThemeIsDark ? '#2c2c2e' : 'rgb(214, 218, 220)')
111
+ }
112
+ }
113
+ },
109
114
  emits: ["change", "close", "confirm", "cancel", "backspace"],
110
115
  methods: {
111
116
  change(e) {
@@ -138,11 +143,11 @@
138
143
  &__tooltip {
139
144
  @include flex;
140
145
  justify-content: space-between;
141
- background-color: #FFFFFF;
146
+ background-color: var(--up-card-bg-color, #ffffff);
142
147
  padding: 14px 12px;
143
148
 
144
149
  &__item {
145
- color: #333333;
150
+ color: var(--up-main-color, #303133);
146
151
  flex: 1;
147
152
  text-align: center;
148
153
  font-size: 15px;
@@ -155,7 +160,7 @@
155
160
 
156
161
  &__cancel {
157
162
  text-align: left;
158
- color: #888888;
163
+ color: var(--up-tips-color, #909399);
159
164
  }
160
165
 
161
166
  &__tips {
@@ -15,7 +15,7 @@ export default {
15
15
  image: '',
16
16
  loadingMode: 'circle',
17
17
  loading: false,
18
- bgColor: '#ffffff',
18
+ bgColor: '',
19
19
  color: '#C8C8C8',
20
20
  fontSize: 19,
21
21
  iconSize: 28,
@@ -1,17 +1,7 @@
1
1
  <template>
2
2
  <u-transition
3
3
  :show="loading"
4
- :custom-style="{
5
- position: 'fixed',
6
- top: 0,
7
- left: 0,
8
- right: 0,
9
- bottom: 0,
10
- backgroundColor: bgColor,
11
- display: 'flex',
12
- zIndex: zIndex,
13
- ...customStyle
14
- }"
4
+ :custom-style="overlayStyle"
15
5
  >
16
6
  <view class="u-loading-page">
17
7
  <view class="u-loading-page__warpper">
@@ -61,7 +51,7 @@ import { addUnit } from '../../libs/function/index';
61
51
  * @property {String} image 文字上方用于替换loading动画的图片
62
52
  * @property {String} loadingMode 加载动画的模式,circle-圆形,spinner-花朵形,semicircle-半圆形 (默认 'circle' )
63
53
  * @property {Boolean} loading 是否加载中 (默认 false )
64
- * @property {String} bgColor 背景色 (默认 '#ffffff' )
54
+ * @property {String} bgColor 背景色,留空时跟随主题页面背景
65
55
  * @property {String} color 文字颜色 (默认 '#C8C8C8' )
66
56
  * @property {String | Number} fontSize 文字大小 (默认 19 )
67
57
  * @property {String | Number} iconSize 图标大小 (默认 28 )
@@ -73,6 +63,22 @@ import { addUnit } from '../../libs/function/index';
73
63
  export default {
74
64
  name: "u-loading-page",
75
65
  mixins: [mpMixin, mixin, props],
66
+ computed: {
67
+ overlayStyle() {
68
+ const fallbackBg = this.$u?.color?.bgColor || (this.upThemeIsDark ? '#1f1f1f' : '#f3f4f6')
69
+ return {
70
+ position: 'fixed',
71
+ top: 0,
72
+ left: 0,
73
+ right: 0,
74
+ bottom: 0,
75
+ backgroundColor: this.bgColor || this.upThemeVar('--up-page-bg-color', fallbackBg),
76
+ display: 'flex',
77
+ zIndex: this.zIndex,
78
+ ...this.customStyle
79
+ }
80
+ }
81
+ },
76
82
  data() {
77
83
  return {};
78
84
  },