@didaoktv/didaoui-uniapp 2.13.0 → 2.15.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.
- package/README.md +6 -6
- package/components/dd-album/dd-album.vue +280 -228
- package/components/dd-avatar/dd-avatar.vue +132 -75
- package/components/dd-avatar-group/dd-avatar-group.vue +52 -30
- package/components/dd-barcode/dd-barcode.vue +884 -947
- package/components/dd-button/dd-button.vue +47 -21
- package/components/dd-canvas/dd-canvas.vue +1156 -985
- package/components/dd-car-keyboard/dd-car-keyboard.vue +12 -12
- package/components/dd-champion-card/dd-champion-card.vue +49 -21
- package/components/dd-checkbox-group/dd-checkbox-group.vue +2 -0
- package/components/dd-copy/dd-copy.vue +51 -56
- package/components/dd-cropper/dd-cropper.vue +1224 -1135
- package/components/dd-divider/dd-divider.vue +9 -2
- package/components/dd-form/dd-form.vue +2 -0
- package/components/dd-goods-sku/dd-goods-sku.vue +6 -1
- package/components/dd-icon/dd-icon.vue +1 -1
- package/components/dd-keyboard/dd-keyboard.vue +95 -46
- package/components/dd-link/dd-link.vue +72 -49
- package/components/dd-markdown/dd-markdown.vue +154 -154
- package/components/dd-number-keyboard/dd-number-keyboard.vue +109 -94
- package/components/dd-package-sku/dd-package-sku.vue +24 -1
- package/components/dd-parse/dd-parse.vue +473 -442
- package/components/dd-poster/dd-poster.vue +579 -567
- package/components/dd-pull-refresh/dd-pull-refresh.vue +1 -9
- package/components/dd-qrcode/dd-qrcode.vue +431 -405
- package/components/dd-radio-group/dd-radio-group.vue +1 -1
- package/components/dd-segmented-tab/dd-segmented-tab.vue +61 -16
- package/components/dd-signature/dd-signature.vue +377 -357
- package/components/dd-step/dd-step.vue +1 -1
- package/components/dd-sticky/dd-sticky.vue +5 -10
- package/components/dd-swipe-action/dd-swipe-action.vue +1 -9
- package/components/dd-swipe-item/dd-swipe-item.vue +2 -0
- package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -5
- package/components/dd-switch/dd-switch.vue +1 -1
- package/components/dd-text/dd-text.vue +304 -82
- package/components/dd-waterfall/dd-waterfall.vue +147 -0
- package/components/dd-waterfall/waterfall.ts +17 -0
- package/index.ts +4 -3
- package/libs/function/index.d.ts +88 -0
- package/libs/function/index.js +14 -0
- package/libs/function/test.d.ts +65 -0
- package/package.json +1 -1
- package/scss/_mixins.scss +8 -0
- package/scss/_theme-tokens.scss +7 -0
- package/scss/_variables.scss +283 -156
- package/components/dd-album/album.js +0 -19
- package/components/dd-album/props.js +0 -89
- package/components/dd-avatar/avatar.js +0 -19
- package/components/dd-avatar/props.js +0 -84
- package/components/dd-avatar-group/avatarGroup.js +0 -14
- package/components/dd-avatar-group/props.js +0 -57
- package/components/dd-keyboard/keyboard.js +0 -19
- package/components/dd-keyboard/props.js +0 -79
- package/components/dd-link/link.js +0 -17
- package/components/dd-link/props.js +0 -44
- package/components/dd-number-keyboard/numberKeyboard.js +0 -8
- package/components/dd-number-keyboard/props.js +0 -24
- package/components/dd-parse/props.js +0 -57
- package/components/dd-text/props.js +0 -120
- package/components/dd-text/text.js +0 -30
- package/components/dd-text/value.js +0 -87
- package/libs/config/color.js +0 -16
- package/libs/config/props.js +0 -184
- package/libs/mixin/button.js +0 -18
- package/libs/mixin/mixin.js +0 -44
- package/libs/mixin/mpMixin.js +0 -13
- package/libs/mixin/openType.js +0 -27
- package/libs/vue.js +0 -3
- package/scss/_dd-shared.scss +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="dd-divider" :class="[`dd-divider--${contentPosition}`]">
|
|
2
|
+
<view class="dd-divider" :class="[`dd-divider--${contentPosition}`]" :style="rootStyle">
|
|
3
3
|
<view
|
|
4
4
|
class="dd-divider__line"
|
|
5
5
|
:class="[
|
|
@@ -30,6 +30,8 @@ interface Props {
|
|
|
30
30
|
dashed?: boolean
|
|
31
31
|
/** true=1px hairline; false=4rpx (dashed 归一化为 1px) */
|
|
32
32
|
hairline?: boolean
|
|
33
|
+
/** 最小高度(rpx);不传则用 $dd-space-5(24px),传 0 完全交给父容器控间距 */
|
|
34
|
+
minHeight?: number
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -41,6 +43,11 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
41
43
|
const slots = useSlots()
|
|
42
44
|
const hasContent = computed(() => !!slots.default)
|
|
43
45
|
|
|
46
|
+
// minHeight 为 rpx,运行时 upx2px 转 px(H5 动态 style 不识别 rpx)
|
|
47
|
+
const rootStyle = computed(() =>
|
|
48
|
+
props.minHeight == null ? '' : `min-height:${uni.upx2px(props.minHeight)}px`,
|
|
49
|
+
)
|
|
50
|
+
|
|
44
51
|
const lineStyle = computed(() => (props.dashed ? 'dashed' : 'solid'))
|
|
45
52
|
// ponytail: dashed 非 hairline 归一化回 1px,避免 4rpx 粗虚线显得笨重
|
|
46
53
|
const effectiveHairline = computed(() => props.hairline || props.dashed)
|
|
@@ -54,7 +61,7 @@ const effectiveHairline = computed(() => props.hairline || props.dashed)
|
|
|
54
61
|
display: flex;
|
|
55
62
|
align-items: center;
|
|
56
63
|
width: 100%;
|
|
57
|
-
height: $dd-space-5; // 24px
|
|
64
|
+
min-height: $dd-space-5; // 24px,插槽内容更高时随内容撑开
|
|
58
65
|
|
|
59
66
|
&__content {
|
|
60
67
|
flex: none;
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
<text v-if="originPrice" class="dd-goods-sku__header__info__price__origin">¥{{ originPrice }}</text>
|
|
26
26
|
</view>
|
|
27
27
|
<view class="dd-goods-sku__header__info__stock">库存 {{ stock }} 件</view>
|
|
28
|
-
<view class="dd-goods-sku__header__info__selected">已选: {{ selectedSkuText }}</view>
|
|
28
|
+
<view v-if="selectedSkuText" class="dd-goods-sku__header__info__selected">已选: {{ selectedSkuText }}</view>
|
|
29
|
+
<view v-else class="dd-goods-sku__header__info__selected dd-goods-sku__header__info__selected--hint">请选择规格</view>
|
|
29
30
|
</view>
|
|
30
31
|
</slot>
|
|
31
32
|
</view>
|
|
@@ -404,6 +405,10 @@ defineExpose({ open, close, reset })
|
|
|
404
405
|
&__selected {
|
|
405
406
|
font-size: 26rpx;
|
|
406
407
|
color: var(--dd-text-primary, #{$dd-text-primary});
|
|
408
|
+
|
|
409
|
+
&--hint {
|
|
410
|
+
color: var(--dd-text-tertiary, #{$dd-text-tertiary});
|
|
411
|
+
}
|
|
407
412
|
}
|
|
408
413
|
}
|
|
409
414
|
}
|
|
@@ -214,7 +214,7 @@ const iconStyle = computed(() => {
|
|
|
214
214
|
|
|
215
215
|
<style lang="scss" scoped>
|
|
216
216
|
@import '../../scss/variables';
|
|
217
|
-
|
|
217
|
+
@import '../../scss/mixins';
|
|
218
218
|
// ponytail: iconfont.cn 项目(Project id 5222155) base64 woff2 内嵌,避免外链字体请求;在线链接仅供调试,生产应下载字体包自托管备份
|
|
219
219
|
// ceiling: 图标集变更时从 iconfont.cn 该项目重新导出并替换 base64 与回退链接;若字体内码与下方 &--name:before 的 codepoint 不一致,图标需同步校正
|
|
220
220
|
@font-face {
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
</dd-popup>
|
|
54
54
|
</template>
|
|
55
55
|
|
|
56
|
-
<script>
|
|
57
|
-
import {
|
|
58
|
-
import
|
|
59
|
-
import
|
|
56
|
+
<script setup lang="ts">
|
|
57
|
+
import { computed } from 'vue'
|
|
58
|
+
import DdPopup from '../dd-popup/dd-popup.vue'
|
|
59
|
+
import DdNumberKeyboard from '../dd-number-keyboard/dd-number-keyboard.vue'
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* keyboard 键盘
|
|
@@ -82,53 +82,102 @@
|
|
|
82
82
|
* @event {Function} backspace 键盘退格键被点击
|
|
83
83
|
* @example <dd-keyboard mode="number" v-model="show"></dd-keyboard>
|
|
84
84
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
interface Props {
|
|
86
|
+
// 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘
|
|
87
|
+
mode?: string
|
|
88
|
+
// 是否显示键盘的"."符号
|
|
89
|
+
dotDisabled?: boolean
|
|
90
|
+
// 是否显示顶部工具条
|
|
91
|
+
tooltip?: boolean
|
|
92
|
+
// 是否显示工具条中间的提示
|
|
93
|
+
showTips?: boolean
|
|
94
|
+
// 工具条中间的提示文字
|
|
95
|
+
tips?: string
|
|
96
|
+
// 是否显示工具条左边的"取消"按钮
|
|
97
|
+
showCancel?: boolean
|
|
98
|
+
// 是否显示工具条右边的"完成"按钮
|
|
99
|
+
showConfirm?: boolean
|
|
100
|
+
// 是否打乱键盘按键的顺序
|
|
101
|
+
random?: boolean
|
|
102
|
+
// 是否开启底部安全区适配,开启的话,会在iPhoneX机型底部添加一定的内边距
|
|
103
|
+
safeAreaInsetBottom?: boolean
|
|
104
|
+
// 是否允许通过点击遮罩关闭键盘
|
|
105
|
+
closeOnClickOverlay?: boolean
|
|
106
|
+
// 控制键盘的弹出与收起
|
|
107
|
+
show?: boolean
|
|
108
|
+
// 是否显示遮罩,某些时候数字键盘时,用户希望看到自己的数值,所以可能不想要遮罩
|
|
109
|
+
overlay?: boolean
|
|
110
|
+
// 取消按钮的文字
|
|
111
|
+
cancelText?: string
|
|
112
|
+
// 确认按钮的文字
|
|
113
|
+
confirmText?: string
|
|
114
|
+
}
|
|
89
115
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
116
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
117
|
+
mode: 'number',
|
|
118
|
+
dotDisabled: false,
|
|
119
|
+
tooltip: true,
|
|
120
|
+
showTips: true,
|
|
121
|
+
tips: '',
|
|
122
|
+
showCancel: true,
|
|
123
|
+
showConfirm: true,
|
|
124
|
+
random: false,
|
|
125
|
+
safeAreaInsetBottom: true,
|
|
126
|
+
closeOnClickOverlay: true,
|
|
127
|
+
show: false,
|
|
128
|
+
overlay: true,
|
|
129
|
+
cancelText: '取消',
|
|
130
|
+
confirmText: '确定',
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const emit = defineEmits<{
|
|
134
|
+
(e: 'change', val: any): void;
|
|
135
|
+
(e: 'close'): void;
|
|
136
|
+
(e: 'confirm'): void;
|
|
137
|
+
(e: 'cancel'): void;
|
|
138
|
+
(e: 'backspace'): void;
|
|
139
|
+
}>()
|
|
140
|
+
|
|
141
|
+
// ponytail: 剥离运行时主题;面板底色由 dd-popup($dd-bg-elevated)承担
|
|
142
|
+
const popupShow = computed({
|
|
143
|
+
get() {
|
|
144
|
+
return props.show;
|
|
103
145
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
change(e) {
|
|
107
|
-
this.$emit('change', e);
|
|
108
|
-
},
|
|
109
|
-
// 键盘关闭
|
|
110
|
-
popupClose() {
|
|
111
|
-
this.$emit('close');
|
|
112
|
-
},
|
|
113
|
-
// 输入完成
|
|
114
|
-
onConfirm() {
|
|
115
|
-
this.$emit('confirm');
|
|
116
|
-
},
|
|
117
|
-
// 取消输入
|
|
118
|
-
onCancel() {
|
|
119
|
-
this.$emit('cancel');
|
|
120
|
-
},
|
|
121
|
-
// 退格键
|
|
122
|
-
backspace() {
|
|
123
|
-
this.$emit('backspace');
|
|
124
|
-
}
|
|
146
|
+
set(val) {
|
|
147
|
+
if (!val) emit('close');
|
|
125
148
|
}
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
function change(e: any) {
|
|
152
|
+
emit('change', e);
|
|
126
153
|
}
|
|
154
|
+
|
|
155
|
+
// 键盘关闭
|
|
156
|
+
function popupClose() {
|
|
157
|
+
emit('close');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// 输入完成
|
|
161
|
+
function onConfirm() {
|
|
162
|
+
emit('confirm');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// 取消输入
|
|
166
|
+
function onCancel() {
|
|
167
|
+
emit('cancel');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// 退格键
|
|
171
|
+
function backspace() {
|
|
172
|
+
emit('backspace');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
defineExpose({ popupShow, change, popupClose, onConfirm, onCancel, backspace })
|
|
127
176
|
</script>
|
|
128
177
|
|
|
129
178
|
<style lang="scss" scoped>
|
|
130
179
|
@import '../../scss/variables';
|
|
131
|
-
@import '../../scss/
|
|
180
|
+
@import '../../scss/mixins';
|
|
132
181
|
|
|
133
182
|
.dd-keyboard {
|
|
134
183
|
// 工具条按钮点击反馈(text 不支持 hover-class,由外层 view 承担)
|
|
@@ -137,16 +186,16 @@
|
|
|
137
186
|
}
|
|
138
187
|
|
|
139
188
|
&__tooltip {
|
|
140
|
-
@include flex;
|
|
189
|
+
@include dd-flex;
|
|
141
190
|
justify-content: space-between;
|
|
142
191
|
background-color: var(--dd-bg-elevated, #{$dd-bg-elevated});
|
|
143
|
-
padding:
|
|
192
|
+
padding: 28rpx $dd-space-3;
|
|
144
193
|
|
|
145
194
|
&__item {
|
|
146
195
|
color: var(--dd-text-primary, #{$dd-text-primary});
|
|
147
196
|
flex: 1;
|
|
148
197
|
text-align: center;
|
|
149
|
-
font-size:
|
|
198
|
+
font-size: 30rpx;
|
|
150
199
|
}
|
|
151
200
|
|
|
152
201
|
&__submit {
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
>{{text}}</text>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script>
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { mixin } from '../../libs/mixin/mixin';
|
|
13
|
-
import { addStyle, addUnit, getPx, toast } from '../../libs/function/index';
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { computed, nextTick } from 'vue'
|
|
11
|
+
import { addStyle, addUnit, getPx, toast } from '../../libs/function/index.js';
|
|
14
12
|
/**
|
|
15
13
|
* link 超链接
|
|
16
14
|
* @description 该组件为超链接组件,在不同平台有不同表现形式:在APP平台会通过plus环境打开内置浏览器,在小程序中把链接复制到粘贴板,同时提示信息,在H5中通过window.open打开链接。
|
|
@@ -25,62 +23,87 @@
|
|
|
25
23
|
*
|
|
26
24
|
* @example <dd-link href="https://didaoktv.com">蜀道难,难于上青天</dd-link>
|
|
27
25
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// #endif
|
|
68
|
-
this.$emit('click')
|
|
69
|
-
}
|
|
26
|
+
interface Props {
|
|
27
|
+
// 文字颜色
|
|
28
|
+
color?: string
|
|
29
|
+
// 字体大小,单位px
|
|
30
|
+
fontSize?: string | number
|
|
31
|
+
// 是否显示下划线
|
|
32
|
+
underLine?: boolean
|
|
33
|
+
// 要跳转的链接
|
|
34
|
+
href?: string
|
|
35
|
+
// 小程序中复制到粘贴板的提示语
|
|
36
|
+
mpTips?: string
|
|
37
|
+
// 下划线颜色
|
|
38
|
+
lineColor?: string
|
|
39
|
+
// 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
|
|
40
|
+
text?: string
|
|
41
|
+
// 定义需要用到的外部样式
|
|
42
|
+
customStyle?: Record<string, any> | string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
46
|
+
color: '#3c9cff',
|
|
47
|
+
fontSize: 15,
|
|
48
|
+
underLine: false,
|
|
49
|
+
href: '',
|
|
50
|
+
mpTips: '链接已复制,请在浏览器打开',
|
|
51
|
+
lineColor: '',
|
|
52
|
+
text: '',
|
|
53
|
+
customStyle: () => ({}),
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const emit = defineEmits<{ (e: 'click'): void }>()
|
|
57
|
+
|
|
58
|
+
const linkStyle = computed(() => {
|
|
59
|
+
const style = {
|
|
60
|
+
color: props.color,
|
|
61
|
+
fontSize: addUnit(props.fontSize),
|
|
62
|
+
// line-height设置为比字体大小多2px
|
|
63
|
+
lineHeight: addUnit(getPx(props.fontSize) + 2),
|
|
64
|
+
textDecoration: props.underLine ? 'underline' : 'none'
|
|
70
65
|
}
|
|
66
|
+
// if (props.underLine) {
|
|
67
|
+
// style.borderBottomColor = props.lineColor || props.color
|
|
68
|
+
// style.borderBottomWidth = '1px'
|
|
69
|
+
// }
|
|
70
|
+
return style
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
function openLink() {
|
|
74
|
+
// #ifdef APP-PLUS
|
|
75
|
+
plus.runtime.openURL(props.href)
|
|
76
|
+
// #endif
|
|
77
|
+
// #ifdef H5
|
|
78
|
+
window.open(props.href)
|
|
79
|
+
// #endif
|
|
80
|
+
// #ifdef MP
|
|
81
|
+
uni.setClipboardData({
|
|
82
|
+
data: props.href,
|
|
83
|
+
success: () => {
|
|
84
|
+
uni.hideToast();
|
|
85
|
+
nextTick(() => {
|
|
86
|
+
toast(props.mpTips);
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
// #endif
|
|
91
|
+
emit('click')
|
|
71
92
|
}
|
|
93
|
+
|
|
94
|
+
defineExpose({ openLink, linkStyle })
|
|
72
95
|
</script>
|
|
73
96
|
|
|
74
97
|
<style lang="scss" scoped>
|
|
75
98
|
@import '../../scss/variables';
|
|
76
|
-
@import '../../scss/
|
|
99
|
+
@import '../../scss/mixins';
|
|
77
100
|
$dd-link-line-height:1 !default;
|
|
78
101
|
|
|
79
102
|
.dd-link {
|
|
80
103
|
/* #ifndef APP-NVUE */
|
|
81
104
|
line-height: $dd-link-line-height;
|
|
82
105
|
/* #endif */
|
|
83
|
-
@include flex;
|
|
106
|
+
@include dd-flex;
|
|
84
107
|
flex-wrap: wrap;
|
|
85
108
|
flex: 1;
|
|
86
109
|
}
|