@didaoktv/didaoui-uniapp 1.0.0 → 1.2.0

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 (114) hide show
  1. package/README.md +16 -7
  2. package/components/dd-action-sheet/dd-action-sheet.vue +3 -3
  3. package/components/dd-album/album.js +19 -0
  4. package/components/dd-album/dd-album.vue +345 -0
  5. package/components/dd-album/props.js +89 -0
  6. package/components/dd-avatar/avatar.js +19 -0
  7. package/components/dd-avatar/dd-avatar.vue +172 -160
  8. package/components/dd-avatar/props.js +84 -0
  9. package/components/dd-avatar-group/avatarGroup.js +14 -0
  10. package/components/dd-avatar-group/dd-avatar-group.vue +110 -0
  11. package/components/dd-avatar-group/props.js +57 -0
  12. package/components/dd-badge/dd-badge.vue +2 -2
  13. package/components/dd-barcode/dd-barcode.vue +1030 -0
  14. package/components/dd-bill-detail/dd-bill-detail.vue +265 -0
  15. package/components/dd-button/dd-button.vue +17 -17
  16. package/components/dd-calendar/dd-calendar.vue +357 -0
  17. package/components/dd-canvas/dd-canvas.vue +1088 -0
  18. package/components/dd-capsule-button/dd-capsule-button.vue +6 -6
  19. package/components/dd-car-keyboard/carKeyboard.js +6 -0
  20. package/components/dd-car-keyboard/dd-car-keyboard.vue +315 -0
  21. package/components/dd-car-keyboard/props.js +19 -0
  22. package/components/dd-cascader/dd-cascader.vue +405 -0
  23. package/components/dd-cell/dd-cell.vue +50 -23
  24. package/components/dd-cell-group/dd-cell-group.vue +32 -25
  25. package/components/dd-champion-card/dd-champion-card.vue +4 -4
  26. package/components/dd-checkbox/dd-checkbox.vue +30 -39
  27. package/components/dd-checkbox-group/dd-checkbox-group.vue +67 -0
  28. package/components/dd-copy/dd-copy.vue +74 -0
  29. package/components/dd-coupon/dd-coupon.vue +368 -0
  30. package/components/dd-cropper/dd-cropper.vue +1297 -0
  31. package/components/dd-dialog/dd-dialog.vue +1 -1
  32. package/components/dd-divider/dd-divider.vue +3 -3
  33. package/components/dd-dropdown-item/dd-dropdown-item.vue +5 -5
  34. package/components/dd-empty-state/dd-empty-state.vue +1 -1
  35. package/components/dd-field/dd-field.vue +531 -106
  36. package/components/dd-form/dd-form.vue +116 -0
  37. package/components/dd-form/rules.ts +84 -0
  38. package/components/dd-goods-sku/dd-goods-sku.vue +434 -0
  39. package/components/dd-icon/dd-icon.vue +2 -2
  40. package/components/dd-image/dd-image.vue +4 -4
  41. package/components/dd-input/dd-input.vue +5 -5
  42. package/components/dd-keyboard/dd-keyboard.vue +178 -0
  43. package/components/dd-keyboard/keyboard.js +22 -0
  44. package/components/dd-keyboard/props.js +89 -0
  45. package/components/dd-link/dd-link.vue +87 -0
  46. package/components/dd-link/link.js +18 -0
  47. package/components/dd-link/props.js +44 -0
  48. package/components/dd-list-cell/dd-list-cell.vue +4 -4
  49. package/components/dd-loading/dd-loading.vue +1 -1
  50. package/components/dd-loadmore/dd-loadmore.vue +2 -2
  51. package/components/dd-markdown/dd-markdown.vue +344 -0
  52. package/components/dd-markdown/marked.esm.mjs +7 -0
  53. package/components/dd-mini-program-navbar/dd-mini-program-navbar.vue +9 -9
  54. package/components/dd-navigation/dd-navigation.vue +5 -5
  55. package/components/dd-number-keyboard/dd-number-keyboard.vue +200 -0
  56. package/components/dd-number-keyboard/numberKeyboard.js +8 -0
  57. package/components/dd-number-keyboard/props.js +24 -0
  58. package/components/dd-parse/dd-parse.vue +534 -0
  59. package/components/dd-parse/node/handler.wxs +26 -0
  60. package/components/dd-parse/node/node.vue +603 -0
  61. package/components/dd-parse/parse.js +13 -0
  62. package/components/dd-parse/parser.js +1400 -0
  63. package/components/dd-parse/props.js +57 -0
  64. package/components/dd-popover/dd-popover.vue +10 -10
  65. package/components/dd-popover-item/dd-popover-item.vue +3 -3
  66. package/components/dd-popup/dd-popup.vue +5 -5
  67. package/components/dd-poster/dd-poster.vue +695 -0
  68. package/components/dd-progress/dd-progress.vue +3 -3
  69. package/components/dd-pull-refresh/dd-pull-refresh.vue +3 -3
  70. package/components/dd-qrcode/dd-qrcode.vue +509 -0
  71. package/components/dd-qrcode/qrcode.js +1283 -0
  72. package/components/dd-radio/dd-radio.vue +19 -20
  73. package/components/dd-radio-group/dd-radio-group.vue +53 -0
  74. package/components/dd-rate/dd-rate.vue +1 -1
  75. package/components/dd-room-card/dd-room-card.vue +3 -3
  76. package/components/dd-search-bar/dd-search-bar.vue +8 -8
  77. package/components/dd-segmented-tab/dd-segmented-tab.vue +6 -6
  78. package/components/dd-signature/dd-signature.vue +513 -0
  79. package/components/dd-skeleton/dd-skeleton.vue +1 -1
  80. package/components/dd-slider/dd-slider.vue +4 -4
  81. package/components/dd-stat-card/dd-stat-card.vue +5 -5
  82. package/components/dd-step/dd-step.vue +11 -11
  83. package/components/dd-stepper/dd-stepper.vue +6 -6
  84. package/components/dd-swipe-action/dd-swipe-action.vue +1 -1
  85. package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -1
  86. package/components/dd-tabbar-item/dd-tabbar-item.vue +8 -8
  87. package/components/dd-tag/dd-tag.vue +17 -1
  88. package/components/dd-text/dd-text.vue +250 -0
  89. package/components/dd-text/props.js +120 -0
  90. package/components/dd-text/text.js +30 -0
  91. package/components/dd-text/value.js +87 -0
  92. package/components/dd-toast/dd-toast.vue +2 -2
  93. package/components/dd-upload/dd-upload.vue +4 -4
  94. package/components/dd-workorder-card/dd-workorder-card.vue +237 -0
  95. package/index.ts +50 -9
  96. package/libs/config/color.js +16 -0
  97. package/libs/config/config.js +25 -0
  98. package/libs/config/props.js +185 -0
  99. package/libs/config/zIndex.js +20 -0
  100. package/libs/function/digit.js +167 -0
  101. package/libs/function/index.js +932 -0
  102. package/libs/function/test.js +327 -0
  103. package/libs/i18n/index.d.ts +2 -0
  104. package/libs/i18n/index.js +89 -0
  105. package/libs/i18n/locales/zh-Hans.js +86 -0
  106. package/libs/mixin/button.js +18 -0
  107. package/libs/mixin/mixin.js +44 -0
  108. package/libs/mixin/mpMixin.js +13 -0
  109. package/libs/mixin/openType.js +27 -0
  110. package/libs/utils.ts +462 -0
  111. package/libs/vue.js +3 -0
  112. package/package.json +1 -1
  113. package/scss/_dd-shared.scss +40 -0
  114. package/scss/_variables.scss +4 -1
@@ -56,7 +56,7 @@ function onMenu() {
56
56
  // 微信小程序标准 87×32px → 174×64rpx (ponytail: 固定尺寸,H5 降级同样尺寸)
57
57
  .dd-capsule-button {
58
58
  width: 174rpx;
59
- height: 64rpx;
59
+ height: $dd-size-button-sm;
60
60
  border-radius: $dd-radius-full;
61
61
  @include dd-glass;
62
62
  display: flex;
@@ -78,14 +78,14 @@ function onMenu() {
78
78
  &__arrow {
79
79
  width: 20rpx;
80
80
  height: 20rpx;
81
- border-left: 4rpx solid $dd-text-secondary;
82
- border-bottom: 4rpx solid $dd-text-secondary;
81
+ border-left: $dd-space-1 solid $dd-text-secondary;
82
+ border-bottom: $dd-space-1 solid $dd-text-secondary;
83
83
  transform: rotate(45deg);
84
- margin-left: 4rpx;
84
+ margin-left: $dd-space-1;
85
85
  }
86
86
 
87
87
  &__dots {
88
- font-size: 36rpx;
88
+ font-size: $dd-font-size-h3;
89
89
  line-height: 1;
90
90
  color: $dd-text-secondary;
91
91
  }
@@ -93,7 +93,7 @@ function onMenu() {
93
93
  // 1px 竖向分隔线,仅 default 变体
94
94
  &__divider {
95
95
  width: 1px;
96
- height: 32rpx;
96
+ height: $dd-space-4;
97
97
  align-self: center;
98
98
  background: $dd-border-default;
99
99
  flex-shrink: 0;
@@ -0,0 +1,6 @@
1
+ export default {
2
+ // 车牌号键盘
3
+ carKeyboard: {
4
+ random: false
5
+ }
6
+ }
@@ -0,0 +1,315 @@
1
+ <template>
2
+ <view
3
+ class="dd-keyboard"
4
+ @touchmove.stop.prevent="noop"
5
+ >
6
+ <view
7
+ v-for="(group, i) in abc ? engKeyBoardList : areaList"
8
+ :key="i"
9
+ class="dd-keyboard__button"
10
+ :index="i"
11
+ :class="[i + 1 === 4 && 'dd-keyboard__button--center']"
12
+ >
13
+ <view
14
+ v-if="i === 3"
15
+ class="dd-keyboard__button__inner-wrapper"
16
+ >
17
+ <view
18
+ class="dd-keyboard__button__inner-wrapper__left"
19
+ hover-class="dd-keyboard-hover"
20
+ :hover-stay-time="200"
21
+ @tap="changeCarInputMode"
22
+ >
23
+ <text
24
+ class="dd-keyboard__button__inner-wrapper__left__lang"
25
+ :class="[!abc && 'dd-keyboard__button__inner-wrapper__left__lang--active']"
26
+ >中</text>
27
+ <text class="dd-keyboard__button__inner-wrapper__left__line">/</text>
28
+ <text
29
+ class="dd-keyboard__button__inner-wrapper__left__lang"
30
+ :class="[abc && 'dd-keyboard__button__inner-wrapper__left__lang--active']"
31
+ >英</text>
32
+ </view>
33
+ </view>
34
+ <view
35
+ class="dd-keyboard__button__inner-wrapper"
36
+ v-for="(item, j) in group"
37
+ :key="j"
38
+ >
39
+ <view
40
+ class="dd-keyboard__button__inner-wrapper__inner"
41
+ :hover-stay-time="200"
42
+ @tap="carInputClick(i, j)"
43
+ hover-class="dd-keyboard-hover"
44
+ >
45
+ <text class="dd-keyboard__button__inner-wrapper__inner__text">{{ item }}</text>
46
+ </view>
47
+ </view>
48
+ <view
49
+ v-if="i === 3"
50
+ @touchstart="backspaceClick"
51
+ @touchend="clearTimer"
52
+ class="dd-keyboard__button__inner-wrapper"
53
+ >
54
+ <view
55
+ class="dd-keyboard__button__inner-wrapper__right"
56
+ hover-class="dd-keyboard-hover"
57
+ :hover-stay-time="200"
58
+ >
59
+ <dd-icon
60
+ size="28"
61
+ name="backspace"
62
+ ></dd-icon>
63
+ </view>
64
+ </view>
65
+ </view>
66
+ </view>
67
+ </template>
68
+
69
+ <script>
70
+ import { props } from './props';
71
+ import { mpMixin } from '../../libs/mixin/mpMixin';
72
+ import { mixin } from '../../libs/mixin/mixin';
73
+ import { randomArray, sleep } from '../../libs/function/index';
74
+ /**
75
+ * keyboard 键盘组件
76
+ * @description 自定义的键盘面板,内含了数字键盘,车牌号键,身份证号键盘3种模式,都有可以打乱按键顺序的选项。
77
+ * @property {Boolean} random 是否打乱键盘的顺序
78
+ * @event {Function} change 点击键盘触发
79
+ * @event {Function} backspace 点击退格键触发
80
+ * @example <dd-keyboard ref="carKeyboard" mode="car" v-model="show"></dd-keyboard>
81
+ */
82
+ export default {
83
+ name: "dd-car-keyboard",
84
+ mixins: [mpMixin, mixin, props],
85
+ data() {
86
+ return {
87
+ // 车牌输入时,abc=true为输入车牌号码,bac=false为输入省份中文简称
88
+ abc: false
89
+ };
90
+ },
91
+ computed: {
92
+ areaList() {
93
+ let data = [
94
+ '京',
95
+ '沪',
96
+ '粤',
97
+ '津',
98
+ '冀',
99
+ '豫',
100
+ '云',
101
+ '辽',
102
+ '黑',
103
+ '湘',
104
+ '皖',
105
+ '鲁',
106
+ '苏',
107
+ '浙',
108
+ '赣',
109
+ '鄂',
110
+ '桂',
111
+ '甘',
112
+ '晋',
113
+ '陕',
114
+ '蒙',
115
+ '吉',
116
+ '闽',
117
+ '贵',
118
+ '渝',
119
+ '川',
120
+ '青',
121
+ '琼',
122
+ '宁',
123
+ '挂',
124
+ '藏',
125
+ '港',
126
+ '澳',
127
+ '新',
128
+ '使',
129
+ '学'
130
+ ];
131
+ let tmp = [];
132
+ // 打乱顺序
133
+ if (this.random) data = randomArray(data);
134
+ // 切割成二维数组
135
+ tmp[0] = data.slice(0, 10);
136
+ tmp[1] = data.slice(10, 20);
137
+ tmp[2] = data.slice(20, 30);
138
+ tmp[3] = data.slice(30, 36);
139
+ return tmp;
140
+ },
141
+ engKeyBoardList() {
142
+ let data = [
143
+ 1,
144
+ 2,
145
+ 3,
146
+ 4,
147
+ 5,
148
+ 6,
149
+ 7,
150
+ 8,
151
+ 9,
152
+ 0,
153
+ 'Q',
154
+ 'W',
155
+ 'E',
156
+ 'R',
157
+ 'T',
158
+ 'Y',
159
+ 'U',
160
+ 'I',
161
+ 'O',
162
+ 'P',
163
+ 'A',
164
+ 'S',
165
+ 'D',
166
+ 'F',
167
+ 'G',
168
+ 'H',
169
+ 'J',
170
+ 'K',
171
+ 'L',
172
+ 'Z',
173
+ 'X',
174
+ 'C',
175
+ 'V',
176
+ 'B',
177
+ 'N',
178
+ 'M'
179
+ ];
180
+ let tmp = [];
181
+ if (this.random) data = randomArray(data);
182
+ tmp[0] = data.slice(0, 10);
183
+ tmp[1] = data.slice(10, 20);
184
+ tmp[2] = data.slice(20, 30);
185
+ tmp[3] = data.slice(30, 36);
186
+ return tmp;
187
+ }
188
+ },
189
+ emits: ["change", "backspace"],
190
+ methods: {
191
+ // 点击键盘按钮
192
+ carInputClick(i, j) {
193
+ let value = '';
194
+ // 不同模式,获取不同数组的值
195
+ if (this.abc) value = this.engKeyBoardList[i][j];
196
+ else value = this.areaList[i][j];
197
+ // 如果允许自动切换,则将中文状态切换为英文
198
+ if (!this.abc && this.autoChange) sleep(200).then(() => this.abc = true)
199
+ this.$emit('change', value);
200
+ },
201
+ // 修改汽车牌键盘的输入模式,中文|英文
202
+ changeCarInputMode() {
203
+ this.abc = !this.abc;
204
+ },
205
+ // 点击退格键
206
+ backspaceClick() {
207
+ this.$emit('backspace');
208
+ clearInterval(this.timer); //再次清空定时器,防止重复注册定时器
209
+ this.timer = null;
210
+ this.timer = setInterval(() => {
211
+ this.$emit('backspace');
212
+ }, 250);
213
+ },
214
+ clearTimer() {
215
+ clearInterval(this.timer);
216
+ this.timer = null;
217
+ },
218
+ }
219
+ };
220
+ </script>
221
+
222
+ <style lang="scss" scoped>
223
+ @import '../../scss/variables';
224
+ @import '../../scss/dd-shared';
225
+ $dd-car-keyboard-background-color: $dd-bg-section !default;
226
+ $dd-car-keyboard-padding:6px 0 6px !default;
227
+ $dd-car-keyboard-button-inner-width:64rpx !default;
228
+ $dd-car-keyboard-button-inner-background-color:$dd-surface-container-high !default;
229
+ $dd-car-keyboard-button-height:80rpx !default;
230
+ $dd-car-keyboard-button-inner-box-shadow:0 1px 0px $dd-bg !default;
231
+ $dd-car-keyboard-button-border-radius:4px !default;
232
+ $dd-car-keyboard-button-inner-margin:8rpx 5rpx !default;
233
+ $dd-car-keyboard-button-text-font-size:16px !default;
234
+ $dd-car-keyboard-button-text-color:$dd-text-primary !default;
235
+ $dd-car-keyboard-center-inner-margin: 0 4rpx !default;
236
+ $dd-car-keyboard-special-button-width:134rpx !default;
237
+ $dd-car-keyboard-lang-font-size:16px !default;
238
+ $dd-car-keyboard-lang-color:$dd-text-primary !default;
239
+ $dd-car-keyboard-active-color:$dd-primary-400 !default;
240
+ $dd-car-keyboard-line-font-size:15px !default;
241
+ $dd-car-keyboard-line-color:$dd-text-primary !default;
242
+ $dd-car-keyboard-line-margin:0 1px !default;
243
+ $dd-car-keyboard-dd-keyboard-hover-background-color:$dd-surface-hover !default;
244
+
245
+ .dd-keyboard {
246
+ @include flex(column);
247
+ justify-content: space-around;
248
+ background-color: $dd-car-keyboard-background-color;
249
+ align-items: stretch;
250
+ padding: $dd-car-keyboard-padding;
251
+
252
+ &__button {
253
+ @include flex;
254
+ justify-content: center;
255
+ flex: 1;
256
+ /* #ifndef APP-NVUE */
257
+ /* #endif */
258
+
259
+ &__inner-wrapper {
260
+ box-shadow: $dd-car-keyboard-button-inner-box-shadow;
261
+ margin: $dd-car-keyboard-button-inner-margin;
262
+ border-radius: $dd-car-keyboard-button-border-radius;
263
+
264
+ &__inner {
265
+ @include flex;
266
+ justify-content: center;
267
+ align-items: center;
268
+ width: $dd-car-keyboard-button-inner-width;
269
+ background-color: $dd-car-keyboard-button-inner-background-color;
270
+ height: $dd-car-keyboard-button-height;
271
+ border-radius: $dd-car-keyboard-button-border-radius;
272
+
273
+ &__text {
274
+ font-size: $dd-car-keyboard-button-text-font-size;
275
+ color: $dd-car-keyboard-button-text-color;
276
+ }
277
+ }
278
+
279
+ &__left,
280
+ &__right {
281
+ border-radius: $dd-car-keyboard-button-border-radius;
282
+ width: $dd-car-keyboard-special-button-width;
283
+ height: $dd-car-keyboard-button-height;
284
+ background-color: $dd-car-keyboard-dd-keyboard-hover-background-color;
285
+ color: $dd-car-keyboard-button-text-color; // 退格图标 color=inherit,由此处控制
286
+ @include flex;
287
+ justify-content: center;
288
+ align-items: center;
289
+ box-shadow: $dd-car-keyboard-button-inner-box-shadow;
290
+ }
291
+
292
+ &__left {
293
+ &__line {
294
+ font-size: $dd-car-keyboard-line-font-size;
295
+ color: $dd-car-keyboard-line-color;
296
+ margin: $dd-car-keyboard-line-margin;
297
+ }
298
+
299
+ &__lang {
300
+ font-size: $dd-car-keyboard-lang-font-size;
301
+ color: $dd-car-keyboard-lang-color;
302
+
303
+ &--active {
304
+ color: $dd-car-keyboard-active-color;
305
+ }
306
+ }
307
+ }
308
+ }
309
+ }
310
+ }
311
+
312
+ .dd-keyboard-hover {
313
+ background-color: $dd-car-keyboard-dd-keyboard-hover-background-color;
314
+ }
315
+ </style>
@@ -0,0 +1,19 @@
1
+ import { defineMixin } from '../../libs/vue'
2
+ import CarKeyboardDefaultProps from './carKeyboard'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(CarKeyboardDefaultProps)
6
+ export const props = defineMixin({
7
+ props: {
8
+ // 是否打乱键盘按键的顺序
9
+ random: {
10
+ type: Boolean,
11
+ default: false
12
+ },
13
+ // 输入一个中文后,是否自动切换到英文
14
+ autoChange: {
15
+ type: Boolean,
16
+ default: false
17
+ }
18
+ }
19
+ })