uview-plus 3.7.32 → 3.8.18

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 (126) hide show
  1. package/README.md +0 -1
  2. package/changelog.md +1993 -1808
  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-datetime-picker/u-datetime-picker.vue +79 -10
  23. package/components/u-dragsort/u-dragsort.vue +3 -0
  24. package/components/u-dropdown/u-dropdown.vue +15 -2
  25. package/components/u-dropdown-item/u-dropdown-item.vue +3 -3
  26. package/components/u-form-item/u-form-item.vue +6 -1
  27. package/components/u-gap/u-gap.vue +5 -1
  28. package/components/u-goods-sku/u-goods-sku.vue +16 -15
  29. package/components/u-index-anchor/u-index-anchor.vue +13 -2
  30. package/components/u-index-list/u-index-list.vue +18 -5
  31. package/components/u-input/input.js +3 -3
  32. package/components/u-input/u-input.vue +27 -5
  33. package/components/u-keyboard/u-keyboard.vue +11 -6
  34. package/components/u-loading-page/loadingPage.js +1 -1
  35. package/components/u-loading-page/u-loading-page.vue +18 -12
  36. package/components/u-navbar/navbar.js +2 -3
  37. package/components/u-navbar/theme-vars.scss +21 -0
  38. package/components/u-navbar/u-navbar.vue +30 -6
  39. package/components/u-notice-bar/theme-vars.scss +25 -0
  40. package/components/u-notice-bar/u-notice-bar.vue +24 -5
  41. package/components/u-number-box/numberBox.js +4 -4
  42. package/components/u-number-box/u-number-box.vue +27 -13
  43. package/components/u-number-keyboard/u-number-keyboard.vue +6 -6
  44. package/components/u-picker/picker.js +43 -43
  45. package/components/u-picker/u-picker.vue +14 -2
  46. package/components/u-popup/popup.js +1 -1
  47. package/components/u-popup/u-popup.vue +14 -6
  48. package/components/u-pull-refresh/u-pull-refresh.vue +6 -6
  49. package/components/u-radio/u-radio.vue +6 -6
  50. package/components/u-rate/rate.js +2 -2
  51. package/components/u-rate/u-rate.vue +98 -21
  52. package/components/u-search/search.js +3 -3
  53. package/components/u-search/u-search.vue +29 -6
  54. package/components/u-select/u-select.vue +141 -73
  55. package/components/u-signature/u-signature.vue +35 -16
  56. package/components/u-skeleton/u-skeleton.vue +7 -2
  57. package/components/u-slider/u-slider.vue +30 -31
  58. package/components/u-steps-item/u-steps-item.vue +20 -17
  59. package/components/u-subsection/theme-vars.scss +41 -0
  60. package/components/u-subsection/u-subsection.vue +69 -16
  61. package/components/u-swipe-action-item/u-swipe-action-item.vue +11 -5
  62. package/components/u-switch/theme-vars.scss +41 -0
  63. package/components/u-switch/u-switch.vue +44 -15
  64. package/components/u-tabbar/u-tabbar.vue +5 -5
  65. package/components/u-tabbar-item/u-tabbar-item.vue +16 -5
  66. package/components/u-table/u-table.vue +18 -3
  67. package/components/u-table2/tableRow.vue +43 -41
  68. package/components/u-table2/u-table2.vue +56 -50
  69. package/components/u-tabs/u-tabs.vue +14 -1
  70. package/components/u-tag/theme-vars.scss +21 -0
  71. package/components/u-tag/u-tag.vue +17 -7
  72. package/components/u-td/u-td.vue +5 -3
  73. package/components/u-text/text.js +1 -1
  74. package/components/u-text/u-text.vue +15 -13
  75. package/components/u-textarea/props.js +2 -2
  76. package/components/u-textarea/textarea.js +1 -1
  77. package/components/u-textarea/u-textarea.vue +115 -61
  78. package/components/u-th/u-th.vue +5 -4
  79. package/components/u-title/u-title.vue +1 -0
  80. package/components/u-toast/u-toast.vue +8 -8
  81. package/components/u-tree/u-tree.vue +491 -51
  82. package/components/u-upload/u-upload.vue +34 -6
  83. package/index.js +178 -27
  84. package/index.scss +5 -1
  85. package/libs/config/color.js +1 -2
  86. package/libs/config/props.js +1 -1
  87. package/libs/css/theme-vars-core.scss +197 -0
  88. package/libs/css/theme-vars.scss +1 -0
  89. package/libs/function/index.js +8 -8
  90. package/libs/mixin/mixin.js +117 -5
  91. package/libs/root/index.js +175 -0
  92. package/libs/root/nvue-root.vue +72 -0
  93. package/libs/root/page.js +269 -0
  94. package/libs/root/root-toast-host.vue +31 -0
  95. package/libs/root/root.js +40 -0
  96. package/libs/root/runtime.js +11 -0
  97. package/libs/root/utils.js +115 -0
  98. package/libs/theme/runtime.js +391 -0
  99. package/libs/theme/theme.js +684 -0
  100. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  101. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  102. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  103. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  104. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  105. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  106. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  107. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  108. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  109. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  110. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  111. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  112. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  113. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  114. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  115. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  116. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  117. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  118. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  119. package/libs/util/gcanvas/env/canvas.js +0 -0
  120. package/libs/util/gcanvas/env/image.js +0 -0
  121. package/libs/util/gcanvas/env/tool.js +0 -0
  122. package/libs/util/gcanvas/index.js +0 -0
  123. package/package.json +1 -1
  124. package/theme.scss +113 -32
  125. package/types/comps/stepsItem.d.ts +8 -4
  126. package/types/index.d.ts +41 -2
@@ -12,7 +12,10 @@
12
12
  class="u-action-sheet__header"
13
13
  v-if="title"
14
14
  >
15
- <text class="u-action-sheet__header__title u-line-1">{{title}}</text>
15
+ <text
16
+ class="u-action-sheet__header__title u-line-1"
17
+ :style="titleDynamicStyle"
18
+ >{{title}}</text>
16
19
  <view
17
20
  class="u-action-sheet__header__icon-wrap"
18
21
  @tap.stop="cancel"
@@ -20,7 +23,7 @@
20
23
  <up-icon
21
24
  name="close"
22
25
  size="17"
23
- color="#c8c9cc"
26
+ :color="closeIconColor"
24
27
  bold
25
28
  ></up-icon>
26
29
  </view>
@@ -30,12 +33,12 @@
30
33
  class="u-action-sheet__description"
31
34
  :style="[{
32
35
  marginTop: `${title && description ? 0 : '18px'}`
33
- }]"
36
+ }, descriptionDynamicStyle]"
34
37
  v-if="description"
35
38
  >{{description}}</text>
36
39
  <slot>
37
40
  <!-- 分割线 -->
38
- <u-line v-if="description"></u-line>
41
+ <u-line v-if="description" :color="dividerColor"></u-line>
39
42
  <!-- 操作项列表 -->
40
43
  <scroll-view scroll-y class="u-action-sheet__item-wrap" :style="{maxHeight: wrapMaxHeight}">
41
44
  <view :key="index" v-for="(item, index) in actions">
@@ -75,6 +78,7 @@
75
78
  <text
76
79
  v-if="item[subnameKey]"
77
80
  class="u-action-sheet__item-wrap__item__subname"
81
+ :style="[subnameStyle(index)]"
78
82
  >{{ item[subnameKey] }}</text>
79
83
  </template>
80
84
  <!-- 加载状态图标 -->
@@ -89,13 +93,13 @@
89
93
  </button>
90
94
  <!-- #endif -->
91
95
  <!-- 选项间分割线 -->
92
- <u-line v-if="index !== actions.length - 1"></u-line>
96
+ <u-line v-if="index !== actions.length - 1" :color="dividerColor"></u-line>
93
97
  </view>
94
98
  </scroll-view>
95
99
  </slot>
96
100
  <!-- 取消按钮前的分割区域 -->
97
101
  <u-gap
98
- bgColor="#eaeaec"
102
+ :bgColor="cancelGapColor"
99
103
  height="6"
100
104
  v-if="cancelText"
101
105
  ></u-gap>
@@ -106,6 +110,7 @@
106
110
  @touchmove.stop.prevent
107
111
  :hover-stay-time="150"
108
112
  class="u-action-sheet__cancel-text"
113
+ :style="cancelTextDynamicStyle"
109
114
  >{{cancelText}}</text>
110
115
  </view>
111
116
  </view>
@@ -162,17 +167,50 @@
162
167
  }
163
168
  },
164
169
  computed: {
170
+ titleDynamicStyle() {
171
+ return {
172
+ color: this.upThemeVar('--up-main-color', '#303133')
173
+ }
174
+ },
175
+ descriptionDynamicStyle() {
176
+ return {
177
+ color: this.upThemeVar('--up-tips-color', '#909193')
178
+ }
179
+ },
180
+ closeIconColor() {
181
+ return this.upThemeVar('--up-content-color', '#606266')
182
+ },
183
+ dividerColor() {
184
+ return this.upThemeVar('--up-border-color', this.upThemeIsDark ? '#3a3a3c' : '#dadbde')
185
+ },
186
+ cancelGapColor() {
187
+ return this.upThemeVar('--up-gap-bg-color', this.upThemeIsDark ? '#111111' : '#eaeaec')
188
+ },
189
+ cancelTextDynamicStyle() {
190
+ return {
191
+ color: this.upThemeVar('--up-main-color', '#303133')
192
+ }
193
+ },
165
194
  // 操作项目的样式
166
195
  itemStyle() {
167
196
  return (index) => {
168
- let style = {};
197
+ const style = {
198
+ color: this.upThemeVar('--up-main-color', '#303133')
199
+ };
169
200
  if (this.actions[index].color) style.color = this.actions[index].color
170
201
  if (this.actions[index].fontSize) style.fontSize = addUnit(this.actions[index].fontSize)
171
202
  // 选项被禁用的样式
172
- if (this.actions[index].disabled) style.color = '#c0c4cc'
203
+ if (this.actions[index].disabled) style.color = this.upThemeVar('--up-light-color', '#c0c4cc')
173
204
  return style;
174
205
  }
175
206
  },
207
+ subnameStyle() {
208
+ return (index) => ({
209
+ color: this.actions[index].disabled
210
+ ? this.upThemeVar('--up-light-color', '#c0c4cc')
211
+ : this.upThemeVar('--up-tips-color', '#909193')
212
+ })
213
+ }
176
214
  },
177
215
  emits: ["close", "select", "update:show"],
178
216
  methods: {
@@ -218,21 +256,21 @@
218
256
  $u-action-sheet-reset-button-width:100% !default;
219
257
  $u-action-sheet-title-font-size: 16px !default;
220
258
  $u-action-sheet-title-padding: 12px 30px !default;
221
- $u-action-sheet-title-color: $u-main-color !default;
259
+ $u-action-sheet-title-color: var(--up-main-color, #303133) !default;
222
260
  $u-action-sheet-header-icon-wrap-right:15px !default;
223
261
  $u-action-sheet-header-icon-wrap-top:15px !default;
224
262
  $u-action-sheet-description-font-size:13px !default;
225
- $u-action-sheet-description-color:14px !default;
263
+ $u-action-sheet-description-color: var(--up-tips-color, #909193) !default;
226
264
  $u-action-sheet-description-margin: 18px 15px !default;
227
265
  $u-action-sheet-item-wrap-item-padding:17px !default;
228
266
  $u-action-sheet-item-wrap-name-font-size:16px !default;
229
267
  $u-action-sheet-item-wrap-subname-font-size:13px !default;
230
- $u-action-sheet-item-wrap-subname-color: #c0c4cc !default;
268
+ $u-action-sheet-item-wrap-subname-color: var(--up-tips-color, #909193) !default;
231
269
  $u-action-sheet-item-wrap-subname-margin-top:10px !default;
232
270
  $u-action-sheet-cancel-text-font-size:16px !default;
233
- $u-action-sheet-cancel-text-color:$u-content-color !default;
271
+ $u-action-sheet-cancel-text-color: var(--up-main-color, #303133) !default;
234
272
  $u-action-sheet-cancel-text-font-size:15px !default;
235
- $u-action-sheet-cancel-text-hover-background-color:rgb(242, 243, 245) !default;
273
+ $u-action-sheet-cancel-text-hover-background-color: var(--up-hover-bg-color, rgb(242, 243, 245)) !default;
236
274
 
237
275
  .u-reset-button {
238
276
  width: $u-action-sheet-reset-button-width;
@@ -259,7 +297,7 @@
259
297
 
260
298
  &__description {
261
299
  font-size: $u-action-sheet-description-font-size;
262
- color: $u-tips-color;
300
+ color: $u-action-sheet-description-color;
263
301
  margin: $u-action-sheet-description-margin;
264
302
  text-align: center;
265
303
  }
@@ -275,7 +313,7 @@
275
313
 
276
314
  &__name {
277
315
  font-size: $u-action-sheet-item-wrap-name-font-size;
278
- color: $u-main-color;
316
+ color: var(--up-main-color, #303133);
279
317
  text-align: center;
280
318
  }
281
319
 
@@ -299,4 +337,4 @@
299
337
  background-color: $u-action-sheet-cancel-text-hover-background-color;
300
338
  }
301
339
  }
302
- </style>
340
+ </style>
@@ -3,9 +3,10 @@
3
3
  width: 100%;;
4
4
  display: inline-block;
5
5
  flex-direction: column;
6
+ color: var(--up-main-color, #303133);
6
7
  .agreement-url {
7
8
  display: inline-block;
8
- color: blue;
9
+ color: var(--up-primary, #2979ff);
9
10
  // #ifdef H5
10
11
  cursor: pointer;
11
12
  // #endif
@@ -195,7 +195,7 @@
195
195
  }
196
196
 
197
197
  &--primary--light {
198
- background-color: #ecf5ff;
198
+ background-color: var(--up-primary-light, #ecf5ff);
199
199
  }
200
200
 
201
201
  &--error--dark {
@@ -203,7 +203,7 @@
203
203
  }
204
204
 
205
205
  &--error--light {
206
- background-color: #FEF0F0;
206
+ background-color: var(--up-error-light, #FEF0F0);
207
207
  }
208
208
 
209
209
  &--success--dark {
@@ -211,7 +211,7 @@
211
211
  }
212
212
 
213
213
  &--success--light {
214
- background-color: #f5fff0;
214
+ background-color: var(--up-success-light, #f5fff0);
215
215
  }
216
216
 
217
217
  &--warning--dark {
@@ -219,7 +219,7 @@
219
219
  }
220
220
 
221
221
  &--warning--light {
222
- background-color: #FDF6EC;
222
+ background-color: var(--up-warning-light, #FDF6EC);
223
223
  }
224
224
 
225
225
  &--info--dark {
@@ -227,7 +227,7 @@
227
227
  }
228
228
 
229
229
  &--info--light {
230
- background-color: #f4f4f5;
230
+ background-color: var(--up-info-light, #f4f4f5);
231
231
  }
232
232
 
233
233
  &__icon {
@@ -239,24 +239,22 @@
239
239
  flex: 1;
240
240
 
241
241
  &__title {
242
- color: $u-main-color;
242
+ color: var(--up-main-color, $u-main-color);
243
243
  font-size: 14px;
244
244
  font-weight: bold;
245
- color: #fff;
246
245
  margin-bottom: 2px;
247
246
  }
248
247
 
249
248
  &__desc {
250
- color: $u-main-color;
249
+ color: var(--up-main-color, $u-main-color);
251
250
  font-size: 14px;
252
251
  flex-wrap: wrap;
253
- color: #fff;
254
252
  }
255
253
  }
256
254
 
257
255
  &__title--dark,
258
256
  &__desc--dark {
259
- color: #FFFFFF;
257
+ color: var(--up-white, #FFFFFF);
260
258
  }
261
259
 
262
260
  &__text--primary--light,
@@ -117,7 +117,6 @@ import { mixin } from '../../libs/mixin/mixin';
117
117
  import { props } from "./props";
118
118
  import { addStyle } from '../../libs/function/index';
119
119
  import { throttle } from '../../libs/function/throttle';
120
- import color from '../../libs/config/color';
121
120
  /**
122
121
  * button 按钮
123
122
  * @description Button 按钮
@@ -192,15 +191,21 @@ export default {
192
191
  );
193
192
  }
194
193
  },
194
+ isDarkTheme() {
195
+ return this.$u.theme && this.$u.theme.mode === 'dark';
196
+ },
197
+ themeTypeColor() {
198
+ return this.$u.color[this.type] || this.$u.color.info;
199
+ },
195
200
  loadingColor() {
196
201
  if (this.plain) {
197
202
  // 如果有设置color值,则用color值,否则使用type主题颜色
198
203
  return this.color
199
204
  ? this.color
200
- : color[`u-${this.type}`];
205
+ : this.themeTypeColor;
201
206
  }
202
207
  if (this.type === "info") {
203
- return "#c9c9c9";
208
+ return this.isDarkTheme ? "#9ca3af" : "#c9c9c9";
204
209
  }
205
210
  return "rgb(200, 200, 200)";
206
211
  },
@@ -211,7 +216,9 @@ export default {
211
216
  if (this.plain) {
212
217
  return this.color ? this.color : this.type;
213
218
  } else {
214
- return this.type === "info" ? "#000000" : "#ffffff";
219
+ return this.type === "info"
220
+ ? (this.isDarkTheme ? "#f3f4f6" : "#000000")
221
+ : "#ffffff";
215
222
  }
216
223
  },
217
224
  baseColor() {
@@ -240,6 +247,27 @@ export default {
240
247
  style.borderWidth = "1px";
241
248
  style.borderStyle = "solid";
242
249
  }
250
+ return style;
251
+ }
252
+ const typeColor = this.themeTypeColor;
253
+ if (this.plain) {
254
+ style.color = this.type === 'info' ? this.$u.color.mainColor : typeColor;
255
+ style.backgroundColor = this.isDarkTheme ? '#1c1c1e' : '#ffffff';
256
+ style.borderColor = this.type === 'info' ? this.$u.color.borderColor : typeColor;
257
+ style.borderWidth = this.hairline ? '0.5px' : '1px';
258
+ style.borderStyle = 'solid';
259
+ } else {
260
+ style.borderWidth = this.hairline ? '0.5px' : '1px';
261
+ style.borderStyle = 'solid';
262
+ if (this.type === 'info') {
263
+ style.color = this.$u.color.mainColor;
264
+ style.backgroundColor = this.isDarkTheme ? '#2c2c2e' : '#ffffff';
265
+ style.borderColor = this.$u.color.borderColor;
266
+ } else {
267
+ style.color = '#ffffff';
268
+ style.backgroundColor = typeColor;
269
+ style.borderColor = typeColor;
270
+ }
243
271
  }
244
272
  return style;
245
273
  },
@@ -248,10 +276,12 @@ export default {
248
276
  let style = {};
249
277
  // 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
250
278
  if (this.type === "info") {
251
- style.color = "#323233";
279
+ style.color = this.$u.color.mainColor;
252
280
  }
253
281
  if (this.color) {
254
282
  style.color = this.plain ? this.color : "white";
283
+ } else if (this.plain && this.type !== 'info') {
284
+ style.color = this.themeTypeColor;
255
285
  }
256
286
  style.fontSize = this.textSize + "px";
257
287
  return style;
@@ -39,6 +39,7 @@ export default {
39
39
  allowSameDay: false,
40
40
  round: 0,
41
41
  monthNum: 3,
42
+ monthSwitch: false,
42
43
  weekText: [t("up.week.one"), t("up.week.two"), t("up.week.three"), t("up.week.four"), t("up.week.five"), t("up.week.six"), t("up.week.seven")],
43
44
  forbidDays: [],
44
45
  forbidDaysToast: t("up.calendar.disabled"),
@@ -4,10 +4,36 @@
4
4
  class="u-calendar-header__title"
5
5
  v-if="showTitle"
6
6
  >{{ title }}</text>
7
- <text
8
- class="u-calendar-header__subtitle"
7
+ <view
8
+ class="u-calendar-header__subtitle-wrap"
9
9
  v-if="showSubtitle"
10
- >{{ subtitle }}</text>
10
+ >
11
+ <text
12
+ v-if="showSwitch"
13
+ class="u-calendar-header__switch"
14
+ :class="{ 'u-calendar-header__switch--disabled': prevYearDisabled }"
15
+ @click="prevYear"
16
+ >«</text>
17
+ <text
18
+ v-if="showSwitch"
19
+ class="u-calendar-header__switch"
20
+ :class="{ 'u-calendar-header__switch--disabled': prevDisabled }"
21
+ @click="prev"
22
+ >‹</text>
23
+ <text class="u-calendar-header__subtitle">{{ subtitle }}</text>
24
+ <text
25
+ v-if="showSwitch"
26
+ class="u-calendar-header__switch"
27
+ :class="{ 'u-calendar-header__switch--disabled': nextDisabled }"
28
+ @click="next"
29
+ >›</text>
30
+ <text
31
+ v-if="showSwitch"
32
+ class="u-calendar-header__switch"
33
+ :class="{ 'u-calendar-header__switch--disabled': nextYearDisabled }"
34
+ @click="nextYear"
35
+ >»</text>
36
+ </view>
11
37
  <view class="u-calendar-header__weekdays">
12
38
  <text class="u-calendar-header__weekdays__weekday">{{ weekText[0] }}</text>
13
39
  <text class="u-calendar-header__weekdays__weekday">{{ weekText[1] }}</text>
@@ -54,6 +80,31 @@
54
80
  return []
55
81
  }
56
82
  },
83
+ // 是否显示月份切换按钮
84
+ showSwitch: {
85
+ type: Boolean,
86
+ default: false
87
+ },
88
+ // 上个月按钮是否禁用
89
+ prevDisabled: {
90
+ type: Boolean,
91
+ default: false
92
+ },
93
+ // 下个月按钮是否禁用
94
+ nextDisabled: {
95
+ type: Boolean,
96
+ default: false
97
+ },
98
+ // 上一年按钮是否禁用
99
+ prevYearDisabled: {
100
+ type: Boolean,
101
+ default: false
102
+ },
103
+ // 下一年按钮是否禁用
104
+ nextYearDisabled: {
105
+ type: Boolean,
106
+ default: false
107
+ }
57
108
  },
58
109
  data() {
59
110
  return {
@@ -61,8 +112,25 @@
61
112
  }
62
113
  },
63
114
  methods: {
64
- name() {
65
-
115
+ prev() {
116
+ if (!this.prevDisabled) {
117
+ this.$emit('prev')
118
+ }
119
+ },
120
+ next() {
121
+ if (!this.nextDisabled) {
122
+ this.$emit('next')
123
+ }
124
+ },
125
+ prevYear() {
126
+ if (!this.prevYearDisabled) {
127
+ this.$emit('prevYear')
128
+ }
129
+ },
130
+ nextYear() {
131
+ if (!this.nextYearDisabled) {
132
+ this.$emit('nextYear')
133
+ }
66
134
  }
67
135
  },
68
136
  }
@@ -77,20 +145,41 @@
77
145
 
78
146
  &__title {
79
147
  font-size: 16px;
80
- color: $u-main-color;
148
+ color: var(--up-main-color, $u-main-color);
81
149
  text-align: center;
82
150
  height: 42px;
83
151
  line-height: 42px;
84
152
  font-weight: bold;
85
153
  }
86
154
 
155
+ &__subtitle-wrap {
156
+ @include flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ height: 40px;
160
+ }
161
+
87
162
  &__subtitle {
88
163
  font-size: 14px;
89
- color: $u-main-color;
90
- height: 40px;
164
+ color: var(--up-main-color, $u-main-color);
91
165
  text-align: center;
166
+ font-weight: bold;
167
+ min-width: 120px;
168
+ }
169
+
170
+ &__switch {
171
+ width: 44px;
172
+ height: 40px;
92
173
  line-height: 40px;
174
+ text-align: center;
175
+ color: var(--up-main-color, $u-main-color);
176
+ font-size: 22px;
93
177
  font-weight: bold;
178
+ flex-shrink: 0;
179
+
180
+ &--disabled {
181
+ opacity: 0.35;
182
+ }
94
183
  }
95
184
 
96
185
  &__weekdays {
@@ -99,7 +188,7 @@
99
188
 
100
189
  &__weekday {
101
190
  font-size: 13px;
102
- color: $u-main-color;
191
+ color: var(--up-main-color, $u-main-color);
103
192
  line-height: 30px;
104
193
  flex: 1;
105
194
  text-align: center;
@@ -217,9 +217,10 @@
217
217
  // 处于第一和最后一个之间的日期,背景色设置为浅色,通过将对应颜色进行等分,再取其尾部的颜色值
218
218
  if (dayjs(date).isAfter(dayjs(this.selected[0])) && dayjs(date).isBefore(dayjs(this
219
219
  .selected[len]))) {
220
- style.backgroundColor = colorGradient(this.color, '#ffffff', 100)[90]
220
+ const rangeEndColor = this.upThemeVar('--up-card-bg-color', this.upThemeIsDark ? '#1c1c1e' : '#ffffff')
221
+ style.backgroundColor = colorGradient(this.color, rangeEndColor, 100)[90]
221
222
  // 增加一个透明度,让范围区间的背景色也能看到底部的mark水印字符
222
- style.opacity = 0.7
223
+ style.opacity = this.upThemeIsDark ? 0.85 : 0.7
223
224
  }
224
225
  } else if (this.selected.length === 1) {
225
226
  // 之所以需要这么写,是因为uni-app的iOS客户端的bug
@@ -502,7 +503,7 @@
502
503
  font-size: 14px;
503
504
  line-height: 42px;
504
505
  height: 42px;
505
- color: $u-main-color;
506
+ color: var(--up-main-color, $u-main-color);
506
507
  text-align: center;
507
508
  font-weight: bold;
508
509
  }
@@ -524,7 +525,7 @@
524
525
 
525
526
  &__text {
526
527
  font-size: 155px;
527
- color: rgba(231, 232, 234, 0.83);
528
+ color: var(--up-calendar-month-mark-color, rgba(231, 232, 234, 0.83));
528
529
  }
529
530
  }
530
531
 
@@ -555,7 +556,7 @@
555
556
  }
556
557
 
557
558
  &__buttom-info {
558
- color: $u-content-color;
559
+ color: var(--up-content-color, $u-content-color);
559
560
  text-align: center;
560
561
  position: absolute;
561
562
  bottom: 5px;
@@ -569,20 +570,21 @@
569
570
  }
570
571
 
571
572
  &--disabled {
572
- color: #cacbcd;
573
+ color: var(--up-disabled-color, #cacbcd);
573
574
  }
574
575
  }
575
576
 
576
577
  &__info {
577
578
  text-align: center;
578
579
  font-size: 16px;
580
+ color: var(--up-main-color, $u-main-color);
579
581
 
580
582
  &--selected {
581
583
  color: #ffffff;
582
584
  }
583
585
 
584
586
  &--disabled {
585
- color: #cacbcd;
587
+ color: var(--up-disabled-color, #cacbcd);
586
588
  }
587
589
  }
588
590
 
@@ -613,4 +615,5 @@
613
615
  }
614
616
  }
615
617
  }
618
+
616
619
  </style>
@@ -143,6 +143,11 @@ export const props = defineMixin({
143
143
  type: [Number, String],
144
144
  default: 3
145
145
  },
146
+ // 是否启用非滚动的单月切换模式
147
+ monthSwitch: {
148
+ type: Boolean,
149
+ default: () => defProps.calendar.monthSwitch
150
+ },
146
151
  // 星期文案
147
152
  weekText: {
148
153
  type: Array,