fusions-ui 1.2.3 → 1.2.6
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/components/fu-avatar/fu-avatar.vue +4 -2
- package/components/fu-avatar/props.js +52 -15
- package/components/fu-avatar-group/fu-avatar-group.vue +3 -2
- package/components/fu-avatar-group/props.js +31 -9
- package/components/fu-badge/fu-badge.vue +8 -14
- package/components/fu-badge/props.js +56 -16
- package/components/fu-banner-arc/fu-banner-arc.vue +4 -5
- package/components/fu-banner-arc/props.js +15 -4
- package/components/fu-button/fu-button.vue +18 -19
- package/components/fu-button/props.js +108 -35
- package/components/fu-cell/fu-cell.vue +9 -8
- package/components/fu-cell-group/fu-cell-group.vue +2 -1
- package/components/fu-cell-group/props.js +7 -2
- package/components/fu-checkbox/fu-checkbox.vue +5 -4
- package/components/fu-checkbox/props.js +51 -14
- package/components/fu-code-input/fu-code-input.vue +10 -6
- package/components/fu-code-input/props.js +66 -17
- package/components/fu-code-verify/fu-code-verify.vue +9 -5
- package/components/fu-code-verify/props.js +64 -17
- package/components/fu-collapse/fu-collapse.vue +10 -3
- package/components/fu-collapse/props.js +9 -3
- package/components/fu-collapse-item/fu-collapse-item.vue +45 -31
- package/components/fu-collapse-item/props.js +49 -16
- package/components/fu-countdown/fu-countdown.vue +2 -1
- package/components/fu-countdown/props.js +15 -4
- package/components/fu-datetime-picker/fu-datetime-picker.vue +6 -5
- package/components/fu-datetime-picker/props.js +91 -25
- package/components/fu-form/fu-form.vue +2 -1
- package/components/fu-form/props.js +34 -6
- package/components/fu-form-item/fu-form-item.vue +46 -56
- package/components/fu-form-item/props.js +34 -7
- package/components/fu-grid/fu-grid.vue +16 -17
- package/components/fu-grid/props.js +20 -5
- package/components/fu-grid-item/fu-grid-item.vue +31 -35
- package/components/fu-grid-item/props.js +11 -3
- package/components/fu-icon/fu-icon.vue +107 -0
- package/components/fu-icon/icon.css +584 -0
- package/components/{fu-icons/icons.js → fu-icon/icon.js} +1031 -1031
- package/components/{fu-icons/fuicons.ttf → fu-icon/icon.ttf} +0 -0
- package/components/fu-icon/props.js +55 -0
- package/components/fu-image/fu-image.vue +15 -10
- package/components/fu-image/props.js +69 -18
- package/components/fu-index-anchor/fu-index-anchor.vue +6 -5
- package/components/fu-index-anchor/props.js +20 -6
- package/components/fu-index-item/fu-index-item.vue +4 -4
- package/components/fu-index-list/fu-index-list.vue +9 -9
- package/components/fu-index-list/props.js +19 -6
- package/components/fu-input/fu-input.vue +54 -68
- package/components/fu-input/props.js +145 -53
- package/components/fu-keyboard/fu-keyboard.vue +19 -9
- package/components/fu-keyboard/keyboard-car.vue +33 -22
- package/components/fu-keyboard/keyboard-number.vue +17 -9
- package/components/fu-keyboard/props.js +66 -17
- package/components/fu-line/fu-line.vue +17 -13
- package/components/fu-line/props.js +30 -5
- package/components/fu-link/fu-link.vue +14 -8
- package/components/fu-link/props.js +22 -7
- package/components/fu-loading/fu-loading.vue +32 -27
- package/components/fu-loading/props.js +28 -8
- package/components/fu-loading-more/fu-loading-more.vue +19 -23
- package/components/fu-loading-more/props.js +27 -13
- package/components/fu-modal/fu-modal.vue +11 -6
- package/components/fu-modal/props.js +61 -17
- package/components/{fu-nav-bar/fu-nav-bar.vue → fu-navbar/fu-navbar.vue} +37 -44
- package/components/fu-notice-bar/fu-notice-bar.vue +10 -8
- package/components/fu-notice-bar/notice-column.vue +187 -122
- package/components/fu-notice-bar/notice-row.vue +85 -28
- package/components/fu-notice-bar/props.js +83 -22
- package/components/fu-number-box/fu-number-box.vue +26 -28
- package/components/fu-number-box/props.js +37 -11
- package/components/fu-parse/fu-parse.vue +0 -1
- package/components/fu-picker/fu-picker.vue +22 -17
- package/components/fu-picker/props.js +70 -19
- package/components/fu-popup/fu-popup.vue +39 -44
- package/components/fu-popup/props.js +34 -9
- package/components/fu-progress/fu-progress.vue +3 -2
- package/components/fu-progress/props.js +36 -9
- package/components/fu-rate/fu-rate.vue +40 -32
- package/components/fu-rate/props.js +47 -13
- package/components/fu-read-more/fu-read-more.vue +19 -14
- package/components/fu-read-more/props.js +68 -46
- package/components/fu-ribbon/fu-ribbon.vue +8 -7
- package/components/fu-ribbon/props.js +15 -4
- package/components/fu-scroll-list/fu-scroll-list.vue +18 -34
- package/components/fu-scroll-list/props.js +19 -10
- package/components/fu-search/fu-search.vue +13 -18
- package/components/fu-search/props.js +69 -17
- package/components/fu-section/fu-section.vue +19 -22
- package/components/fu-section/props.js +30 -4
- package/components/fu-sign-board/fu-sign-board.vue +18 -3
- package/components/fu-sign-board/props.js +15 -5
- package/components/fu-skeleton/fu-skeleton.vue +8 -12
- package/components/fu-skeleton/props.js +15 -4
- package/components/fu-steps/fu-steps.vue +3 -2
- package/components/fu-steps/props.js +23 -7
- package/components/fu-steps-item/fu-steps-item.vue +3 -3
- package/components/fu-steps-item/props.js +15 -5
- package/components/fu-sticky/fu-sticky.vue +3 -3
- package/components/fu-sticky/props.js +21 -7
- package/components/fu-subsection/fu-subsection.vue +29 -22
- package/components/fu-subsection/props.js +40 -10
- package/components/fu-swipe-action-item/bindingx.js +1 -1
- package/components/fu-swipe-action-item/fu-swipe-action-item.vue +134 -123
- package/components/fu-swipe-action-item/mpwxs.js +1 -1
- package/components/fu-swipe-action-item/props.js +22 -6
- package/components/fu-swiper/fu-swiper.vue +26 -24
- package/components/fu-swiper/props.js +80 -24
- package/components/fu-switch/fu-switch.vue +20 -12
- package/components/fu-switch/props.js +48 -13
- package/components/fu-tabs/fu-tabs.vue +36 -33
- package/components/fu-tabs/props.js +46 -13
- package/components/fu-tag/fu-tag.vue +24 -21
- package/components/fu-tag/props.js +63 -17
- package/components/fu-text/fu-text.vue +72 -33
- package/components/fu-text/props.js +85 -27
- package/components/fu-text/value.js +6 -6
- package/components/fu-textarea/fu-textarea.vue +13 -17
- package/components/fu-textarea/props.js +103 -30
- package/components/fu-timeaxis/fu-timeaxis.vue +1 -1
- package/components/fu-timeaxis-item/fu-timeaxis-item.vue +8 -4
- package/components/fu-transition/fu-transition.vue +48 -49
- package/components/fu-transition/props.js +21 -0
- package/components/fu-upload/fu-upload.vue +3 -1
- package/components/fu-upload/props.js +67 -19
- package/components/fu-upload/upload-file.vue +31 -18
- package/components/fu-upload/upload-image.vue +37 -19
- package/components/fu-vtabs/fu-vtabs.vue +6 -4
- package/components/fu-vtabs/props.js +50 -15
- package/components/fu-waterfall/fu-waterfall.vue +11 -9
- package/components/fu-waterfall/props.js +37 -15
- package/index.js +17 -24
- package/index.scss +9 -7
- package/libs/config/config.js +16 -9
- package/libs/function/applyEven.js +9 -9
- package/libs/function/check.js +81 -89
- package/libs/function/{index.js → common.js} +5 -5
- package/libs/function/message.js +0 -27
- package/libs/mixin/mixin.js +26 -21
- package/libs/{utils/min.router.config.js → route/min.route.config.js} +7 -7
- package/libs/{utils/router.config.js → route/route.config.js} +10 -11
- package/libs/{css/main.scss → style/common.scss} +50 -87
- package/libs/style/style.h5.scss +8 -0
- package/libs/style/style.mp.scss +15 -0
- package/package.json +1 -1
- package/components/fu-calendar/calendar-item.vue +0 -214
- package/components/fu-calendar/calendar.js +0 -546
- package/components/fu-calendar/fu-calendar.vue +0 -536
- package/components/fu-calendar/i18n/en.json +0 -12
- package/components/fu-calendar/i18n/index.js +0 -8
- package/components/fu-calendar/i18n/zh-Hans.json +0 -12
- package/components/fu-calendar/i18n/zh-Hant.json +0 -12
- package/components/fu-calendar/util.js +0 -360
- package/components/fu-date-picker/calendar-item.vue +0 -177
- package/components/fu-date-picker/calendar.vue +0 -917
- package/components/fu-date-picker/fu-date-picker.vue +0 -1069
- package/components/fu-date-picker/i18n/en.json +0 -22
- package/components/fu-date-picker/i18n/index.js +0 -8
- package/components/fu-date-picker/i18n/zh-Hans.json +0 -22
- package/components/fu-date-picker/i18n/zh-Hant.json +0 -22
- package/components/fu-date-picker/props.js +0 -68
- package/components/fu-date-picker/time-picker.vue +0 -924
- package/components/fu-date-picker/util.js +0 -419
- package/components/fu-icons/fu-icons.vue +0 -102
- package/components/fu-icons/fuicons.css +0 -585
- package/components/fu-landscape/fu-landscape.vue +0 -167
- package/components/fu-landscape/props.js +0 -64
- package/components/fu-tabbar/fu-tabbar.vue +0 -333
- package/components/fu-tabbar/props.js +0 -78
- package/libs/css/style.h5.scss +0 -35
- package/libs/css/style.mp.scss +0 -50
- package/libs/utils/util.js +0 -58
- /package/components/{fu-nav-bar → fu-navbar}/props.js +0 -0
- /package/components/{fu-nav-bar → fu-navbar}/status-bar.vue +0 -0
- /package/{components/fu-datetime-picker → libs/function}/dayjs.js +0 -0
- /package/libs/{css → style}/color.scss +0 -0
- /package/libs/{css/component.scss → style/components.scss} +0 -0
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
plain && plainFill && `fu-tag--${type}--plain--fill`
|
|
13
13
|
]"
|
|
14
14
|
:style="[{
|
|
15
|
-
marginRight: closable&& closePlace=='right-top'
|
|
16
|
-
marginTop: closable && closePlace=='right-top'
|
|
15
|
+
marginRight: closable && closePlace =='right-top'? '10px': 0,
|
|
16
|
+
marginTop: closable && closePlace =='right-top'? '10px': 0,
|
|
17
17
|
}, style, $fu.addStyle(customStyle)]"
|
|
18
18
|
@tap="handleClick">
|
|
19
19
|
<slot name="icon">
|
|
20
20
|
<view class="fu-tag__icon" v-if="icon">
|
|
21
21
|
<image :src="icon" :style="[imgStyle]" v-if="$fu.isImage(icon)"></image>
|
|
22
|
-
<fu-
|
|
22
|
+
<fu-icon :name="icon" :size="iconSize" :color="elIconColor" v-else />
|
|
23
23
|
</view>
|
|
24
24
|
</slot>
|
|
25
25
|
<text
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
:class="[`fu-tag__close--${size}`,`fu-tag__close--${closePlace}`]"
|
|
38
38
|
:style="{backgroundColor: closeColor}"
|
|
39
39
|
@tap.stop="handleClose"
|
|
40
|
-
v-if="closable && closePlace=='right'">
|
|
41
|
-
<fu-
|
|
40
|
+
v-if="closable && closePlace =='right'">
|
|
41
|
+
<fu-icon name="cancel" :size="closeSize" color="#ffffff" />
|
|
42
42
|
</view>
|
|
43
43
|
</view>
|
|
44
44
|
<view
|
|
45
45
|
class="fu-tag__close"
|
|
46
46
|
:class="[`fu-tag__close--${size}`,`fu-tag__close--${closePlace}`]"
|
|
47
47
|
:style="{backgroundColor: closeColor}"
|
|
48
|
-
v-if="closable && closePlace=='right-top'" @tap.stop="handleClose">
|
|
49
|
-
<fu-
|
|
48
|
+
v-if="closable && closePlace =='right-top'" @tap.stop="handleClose">
|
|
49
|
+
<fu-icon name="cancel" :size="closeSize" color="#ffffff" />
|
|
50
50
|
</view>
|
|
51
51
|
</view>
|
|
52
52
|
</fu-transition>
|
|
@@ -75,31 +75,34 @@
|
|
|
75
75
|
* @property {String} bgColor 背景颜色,默认为空字符串,即不处理
|
|
76
76
|
* @property {String} color 标签字体颜色,默认为空字符串,即不处理
|
|
77
77
|
* @property {String} borderColor 镂空形式标签的边框颜色
|
|
78
|
-
* @property {String} closeColor 关闭按钮图标的颜色(默认 #C6C7CB)
|
|
79
78
|
* @property {Boolean} plainFill = [true|false] 镂空时是否填充背景色(默认 false)
|
|
80
79
|
* @property {Boolean} plain = [true|false] 是否镂空(默认 false )
|
|
81
80
|
* @property {Boolean} closable = [true|false] 是否可关闭,设置为true,文字右边会出现一个关闭图标(默认 false )
|
|
81
|
+
* @property {String} closeColor 关闭按钮图标的颜色(默认 #C6C7CB)
|
|
82
|
+
* @property {String} closePlace = [right|right-top] 关闭按钮图标的位置(默认 'right-top')
|
|
82
83
|
* @property {String} icon 内置图标,或绝对路径的图片
|
|
83
84
|
* @property {String} iconColor 内置图标颜色
|
|
84
|
-
* @
|
|
85
|
-
*
|
|
85
|
+
* @property {Boolean} cellChild nvue模式下 是否直接显示,在fu-list等cell下面使用就需要设置
|
|
86
|
+
*
|
|
87
|
+
* @event {Function} click 点击标签时触发 index: 传递的index参数值
|
|
88
|
+
* @event {Function} close closable为true时,点击标签关闭按钮触发 index: 传递的index参数值
|
|
86
89
|
* @example <fu-tag text="标签" type="error" plain plainFill></fu-tag>
|
|
87
90
|
*/
|
|
88
91
|
export default {
|
|
89
92
|
name: 'FuTag',
|
|
90
|
-
emits: ['click', 'close'],
|
|
91
93
|
mixins: [mpMixin, mixin, props],
|
|
94
|
+
emits: ['click', 'close'],
|
|
92
95
|
computed: {
|
|
93
96
|
style() {
|
|
94
97
|
const style = {}
|
|
95
98
|
if (this.bgColor) {
|
|
96
|
-
style.backgroundColor = this.bgColor
|
|
99
|
+
style.backgroundColor = this.bgColor;
|
|
97
100
|
}
|
|
98
101
|
if (this.color) {
|
|
99
|
-
style.color = this.color
|
|
102
|
+
style.color = this.color;
|
|
100
103
|
}
|
|
101
104
|
if (this.borderColor) {
|
|
102
|
-
style.borderColor = this.borderColor
|
|
105
|
+
style.borderColor = this.borderColor;
|
|
103
106
|
}
|
|
104
107
|
return style
|
|
105
108
|
},
|
|
@@ -107,12 +110,12 @@
|
|
|
107
110
|
textColor() {
|
|
108
111
|
const style = {}
|
|
109
112
|
if (this.color) {
|
|
110
|
-
style.color = this.color
|
|
113
|
+
style.color = this.color;
|
|
111
114
|
}
|
|
112
115
|
return style
|
|
113
116
|
},
|
|
114
117
|
imgStyle() {
|
|
115
|
-
const width = this.size === 'large' ? '17px' : this.size === 'medium' ? '15px' : '13px'
|
|
118
|
+
const width = this.size === 'large' ? '17px' : this.size === 'medium' ? '15px' : '13px';
|
|
116
119
|
return {
|
|
117
120
|
width,
|
|
118
121
|
height: width
|
|
@@ -120,17 +123,17 @@
|
|
|
120
123
|
},
|
|
121
124
|
// 文本的样式
|
|
122
125
|
closeSize() {
|
|
123
|
-
const size = this.size === 'large' ? 15 : this.size === 'medium' ?
|
|
126
|
+
const size = this.size === 'large' ? 15 : this.size === 'medium' ? 12 : 12;
|
|
124
127
|
return size
|
|
125
128
|
},
|
|
126
129
|
// 图标大小
|
|
127
130
|
iconSize() {
|
|
128
|
-
const size = this.size === 'large' ? 21 : this.size === 'medium' ? 19 : 16
|
|
131
|
+
const size = this.size === 'large' ? 21 : this.size === 'medium' ? 19 : 16;
|
|
129
132
|
return size
|
|
130
133
|
},
|
|
131
134
|
// 图标颜色
|
|
132
135
|
elIconColor() {
|
|
133
|
-
return this.iconColor ? this.iconColor : this.plain ? this.type : '#ffffff'
|
|
136
|
+
return this.iconColor ? this.iconColor : this.plain ? this.type : '#ffffff';
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
methods: {
|
|
@@ -148,8 +151,8 @@
|
|
|
148
151
|
</script>
|
|
149
152
|
|
|
150
153
|
<style lang="scss" scoped>
|
|
151
|
-
@import '../../libs/
|
|
152
|
-
@import '../../libs/
|
|
154
|
+
@import '../../libs/style/components.scss';
|
|
155
|
+
@import '../../libs/style/color.scss';
|
|
153
156
|
|
|
154
157
|
.fu-tag {
|
|
155
158
|
position: relative;
|
|
@@ -1,86 +1,132 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 序号,用于区分多个标签
|
|
5
|
+
*/
|
|
4
6
|
index: {
|
|
5
7
|
type: [String,Number],
|
|
6
8
|
default: ''
|
|
7
9
|
},
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @description 是否显示
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
9
14
|
show: {
|
|
10
15
|
type: Boolean,
|
|
11
16
|
default: true
|
|
12
17
|
},
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @description 标签类型
|
|
20
|
+
* @values 'primary' - 主色, 'error' - 错误, 'success' - 成功, 'warning' - 警告, 'info' - 信息
|
|
21
|
+
* @default 'primary'
|
|
22
|
+
*/
|
|
14
23
|
type: {
|
|
15
24
|
type: String,
|
|
16
25
|
default: 'primary'
|
|
17
26
|
},
|
|
18
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @description 标签的大小
|
|
29
|
+
* @default 'medium'
|
|
30
|
+
*/
|
|
19
31
|
size: {
|
|
20
32
|
type: String,
|
|
21
33
|
default: 'medium'
|
|
22
34
|
},
|
|
23
|
-
|
|
35
|
+
/**
|
|
36
|
+
* @description tag的形状
|
|
37
|
+
* @values 'circle' - 两边半圆形, 'square' - 方形,带圆角
|
|
38
|
+
* @default 'square'
|
|
39
|
+
*/
|
|
24
40
|
shape: {
|
|
25
41
|
type: String,
|
|
26
42
|
default: 'square'
|
|
27
43
|
},
|
|
28
|
-
|
|
44
|
+
/**
|
|
45
|
+
* @description 标签文字
|
|
46
|
+
*/
|
|
29
47
|
text: {
|
|
30
48
|
type: [String,Number],
|
|
31
49
|
default: ''
|
|
32
50
|
},
|
|
33
|
-
|
|
51
|
+
/**
|
|
52
|
+
* @description 背景颜色,默认为空字符串,即不处理
|
|
53
|
+
*/
|
|
34
54
|
bgColor: {
|
|
35
55
|
type: String,
|
|
36
56
|
default: ''
|
|
37
57
|
},
|
|
38
|
-
|
|
58
|
+
/**
|
|
59
|
+
* @description 标签字体颜色,默认为空字符串,即不处理
|
|
60
|
+
*/
|
|
39
61
|
color: {
|
|
40
62
|
type: String,
|
|
41
63
|
default: ''
|
|
42
64
|
},
|
|
43
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @description 标签的边框颜色
|
|
67
|
+
*/
|
|
44
68
|
borderColor: {
|
|
45
69
|
type: String,
|
|
46
70
|
default: ''
|
|
47
71
|
},
|
|
48
|
-
|
|
72
|
+
/**
|
|
73
|
+
* @description 镂空时是否填充背景色
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
49
76
|
plainFill: {
|
|
50
77
|
type: Boolean,
|
|
51
78
|
default: false
|
|
52
79
|
},
|
|
53
|
-
|
|
80
|
+
/**
|
|
81
|
+
* @description 是否镂空
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
54
84
|
plain: {
|
|
55
85
|
type: Boolean,
|
|
56
86
|
default: false
|
|
57
87
|
},
|
|
58
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @description 是否可关闭
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
59
92
|
closable: {
|
|
60
93
|
type: Boolean,
|
|
61
94
|
default: false
|
|
62
95
|
},
|
|
63
|
-
|
|
96
|
+
/**
|
|
97
|
+
* @description 关闭按钮图标的颜色
|
|
98
|
+
* @default '#C6C7CB'
|
|
99
|
+
*/
|
|
64
100
|
closeColor: {
|
|
65
101
|
type: String,
|
|
66
102
|
default: '#C6C7CB'
|
|
67
103
|
},
|
|
68
|
-
|
|
104
|
+
/**
|
|
105
|
+
* @description 关闭按钮图标的位置
|
|
106
|
+
* @values 'right' - 右边, 'right-top' - 右上
|
|
107
|
+
* @default 'right-top'
|
|
108
|
+
*/
|
|
69
109
|
closePlace: {
|
|
70
110
|
type: String,
|
|
71
111
|
default: 'right-top'
|
|
72
112
|
},
|
|
73
|
-
|
|
113
|
+
/**
|
|
114
|
+
* @description 内置图标,或绝对路径的图片
|
|
115
|
+
*/
|
|
74
116
|
icon: {
|
|
75
117
|
type: String,
|
|
76
118
|
default: ''
|
|
77
119
|
},
|
|
78
|
-
|
|
120
|
+
/**
|
|
121
|
+
* @description 图标颜色
|
|
122
|
+
*/
|
|
79
123
|
iconColor: {
|
|
80
124
|
type: String,
|
|
81
125
|
default: ''
|
|
82
126
|
},
|
|
83
|
-
|
|
127
|
+
/**
|
|
128
|
+
* @description nvue模式下 是否直接显示,在fu-list等cell下面使用就需要设置
|
|
129
|
+
*/
|
|
84
130
|
cellChild: {
|
|
85
131
|
type: Boolean,
|
|
86
132
|
default: false
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
2
|
+
<view
|
|
3
|
+
class="fu-text"
|
|
4
|
+
:class="[customClass]"
|
|
5
|
+
:style="{margin: margin, justifyContent: align === 'left' ? 'flex-start' : align === 'center' ? 'center' : 'flex-end'}"
|
|
6
|
+
@tap="handleClick"
|
|
7
|
+
v-if="show">
|
|
3
8
|
<text :class="['fu-text__price', type && `fu-text__value--${type}`]" :style="[valueStyle]" v-if="mode === 'price'">¥</text>
|
|
4
9
|
<view class="fu-text__prefix-icon" v-if="prefixIcon">
|
|
5
|
-
<fu-
|
|
10
|
+
<fu-icon :name="prefixIcon" :color="iconColor" :size="iconSize"></fu-icon>
|
|
6
11
|
</view>
|
|
7
12
|
<fu-link :href="href" underLine v-if="mode === 'link'">
|
|
8
13
|
<slot>{{ value }}</slot>
|
|
9
14
|
</fu-link>
|
|
10
15
|
<template v-else-if="openType && isMp">
|
|
11
|
-
<button
|
|
12
|
-
|
|
13
|
-
:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
<button
|
|
17
|
+
class="fu-reset-button fu-text__value"
|
|
18
|
+
:class="[type && `fu-text__value--${type}`, lines && `fu-line-${lines}`]"
|
|
19
|
+
:style="[valueStyle]"
|
|
20
|
+
:openType="openType"
|
|
21
|
+
:lang="lang"
|
|
22
|
+
:session-from="sessionFrom"
|
|
23
|
+
:send-message-title="sendMessageTitle"
|
|
24
|
+
:send-message-path="sendMessagePath"
|
|
25
|
+
:send-message-img="sendMessageImg"
|
|
26
|
+
:show-message-card="showMessageCard"
|
|
27
|
+
:app-parameter="appParameter"
|
|
28
|
+
@getuserinfo="onGetUserInfo"
|
|
29
|
+
@contact="onContact"
|
|
30
|
+
@getphonenumber="onGetPhoneNumber"
|
|
31
|
+
@error="onError"
|
|
32
|
+
@launchapp="onLaunchApp"
|
|
33
|
+
@opensetting="onOpenSetting">
|
|
16
34
|
<slot>{{ value }}</slot>
|
|
17
35
|
</button>
|
|
18
36
|
</template>
|
|
19
|
-
<text
|
|
37
|
+
<text
|
|
38
|
+
class="fu-text__value"
|
|
39
|
+
:style="[valueStyle]"
|
|
40
|
+
:class="[type && `fu-text__value--${type}`, lines && `fu-line-${lines}`]"
|
|
41
|
+
v-else>
|
|
20
42
|
<slot>{{ value }}</slot>
|
|
21
43
|
</text>
|
|
22
44
|
<view class="fu-text__suffix-icon" v-if="suffixIcon">
|
|
23
|
-
<fu-
|
|
45
|
+
<fu-icon :name="suffixIcon" :color="iconColor" :size="iconSize"></fu-icon>
|
|
24
46
|
</view>
|
|
25
47
|
</view>
|
|
26
48
|
</template>
|
|
@@ -54,16 +76,16 @@
|
|
|
54
76
|
* @value name 姓名
|
|
55
77
|
* @value date 日期
|
|
56
78
|
* @value link 超链接
|
|
57
|
-
* @property {String} href mode=link
|
|
79
|
+
* @property {String} href 配置的链接(仅mode=link时生效)
|
|
58
80
|
* @property {String,Function} format 格式化规则
|
|
59
|
-
* @property {Boolean} call mode=phone
|
|
81
|
+
* @property {Boolean} call 点击文本是否拨打电话(仅mode=phone时生效)(默认 false)
|
|
60
82
|
* @property {String} openType 小程序的打开方式
|
|
61
|
-
* @property {
|
|
83
|
+
* @property {String,Number} weight 控制文本粗细(默认 'normal')
|
|
62
84
|
* @property {Boolean} block 是否块状(默认 false)
|
|
63
85
|
* @property {String,Number} lines 文本显示的行数,如果设置,超出此行数,将会显示省略号
|
|
64
86
|
* @property {String} color 文本颜色
|
|
65
87
|
* @property {String,Number} size 字体大小(默认 15)
|
|
66
|
-
* @property {String} decoration = [none|underline|line-through]
|
|
88
|
+
* @property {String} decoration = [none|underline|line-through] 文字装饰(默认 'none' )
|
|
67
89
|
* @value none 无装饰
|
|
68
90
|
* @value underline 下划线
|
|
69
91
|
* @value line-through 中划线
|
|
@@ -73,12 +95,14 @@
|
|
|
73
95
|
* @value left 左对齐
|
|
74
96
|
* @value center 居中
|
|
75
97
|
* @value right 右对齐
|
|
76
|
-
* @property {String} wordWrap
|
|
98
|
+
* @property {String} wordWrap = [break-word|normal|anywhere] 文字换行(默认 'normal' )
|
|
77
99
|
* @value break-word 在长单词或URL地址内部进行换行
|
|
78
100
|
* @value normal 只在允许的断字点换行(浏览器保持默认处理)
|
|
79
101
|
* @value anywhere 为防止溢出,如果行中没有其他可接受的断点,则不可断的字符串(如长词或 URL)可能会在任何时候换行。
|
|
80
|
-
* @property {
|
|
81
|
-
* @
|
|
102
|
+
* @property {String} customClass 定义需要用到的外部类
|
|
103
|
+
* @property {Object,String} customStyle 定义需要用到的外部样式
|
|
104
|
+
*
|
|
105
|
+
* @event {Function} click 点击触发事件
|
|
82
106
|
* @example <fu-text text="愿重逢折扇青衣, 愿再见杨柳依依"></fu-text>
|
|
83
107
|
*/
|
|
84
108
|
export default {
|
|
@@ -97,53 +121,68 @@
|
|
|
97
121
|
valueStyle() {
|
|
98
122
|
const style = {
|
|
99
123
|
textDecoration: this.decoration,
|
|
100
|
-
fontWeight: this.
|
|
124
|
+
fontWeight: this.weight || 'normal',
|
|
101
125
|
wordWrap: this.wordWrap,
|
|
102
126
|
fontSize: this.$fu.addUnit(this.size)
|
|
103
127
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
style.flex = 1;
|
|
108
|
-
style.textAlign = this.align === 'left' ? 'flex-start' : this.align === 'center' ? 'center' : 'right';
|
|
128
|
+
|
|
129
|
+
if(!this.type) {
|
|
130
|
+
style.color = this.color
|
|
109
131
|
}
|
|
110
|
-
|
|
111
|
-
|
|
132
|
+
|
|
133
|
+
if(this.lineHeight) {
|
|
134
|
+
style.lineHeight = this.$fu.addUnit(this.lineHeight)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if(this.isNvue) {
|
|
138
|
+
if(this.lines) {
|
|
139
|
+
style.lines = this.lines
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if(this.mode != 'price' && !this.prefixIcon && !this.suffixIcon) {
|
|
143
|
+
style.flex = 1;
|
|
144
|
+
style.textAlign = this.align === 'left' ? 'flex-start' : this.align === 'center' ? 'center' : 'right';
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
if(this.block) {
|
|
148
|
+
style.display = 'block'
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
112
152
|
return this.$fu.deepMerge(style, this.$fu.addStyle(this.customStyle));
|
|
113
153
|
},
|
|
114
154
|
isNvue() {
|
|
115
|
-
let nvue = false
|
|
155
|
+
let nvue = false;
|
|
116
156
|
// #ifdef APP-NVUE
|
|
117
|
-
nvue = true
|
|
157
|
+
nvue = true;
|
|
118
158
|
// #endif
|
|
119
159
|
return nvue
|
|
120
160
|
},
|
|
121
161
|
isMp() {
|
|
122
|
-
let mp = false
|
|
162
|
+
let mp = false;
|
|
123
163
|
// #ifdef MP
|
|
124
|
-
mp = true
|
|
164
|
+
mp = true;
|
|
125
165
|
// #endif
|
|
126
166
|
return mp
|
|
127
167
|
}
|
|
128
168
|
},
|
|
129
169
|
methods: {
|
|
130
|
-
|
|
170
|
+
handleClick() {
|
|
131
171
|
// 如果为手机号模式,拨打电话
|
|
132
172
|
if (this.call && this.mode === 'phone') {
|
|
133
173
|
uni.makePhoneCall({
|
|
134
174
|
phoneNumber: this.text
|
|
135
175
|
})
|
|
136
176
|
}
|
|
137
|
-
this.$emit('click'
|
|
177
|
+
this.$emit('click')
|
|
138
178
|
}
|
|
139
179
|
}
|
|
140
180
|
}
|
|
141
181
|
</script>
|
|
142
182
|
|
|
143
183
|
<style lang="scss" scoped>
|
|
144
|
-
@import '../../libs/
|
|
145
|
-
@import '../../libs/
|
|
146
|
-
|
|
184
|
+
@import '../../libs/style/components.scss';
|
|
185
|
+
@import '../../libs/style/color.scss';
|
|
147
186
|
$fu-main-color: #333333;
|
|
148
187
|
$fu-content-color: #666666;
|
|
149
188
|
$fu-tips-color: #909193;
|
|
@@ -1,112 +1,170 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 主题颜色
|
|
5
|
+
* @values 'primary' - 主色, 'error' - 错误, 'success' - 成功, 'warning' - 警告, 'info' - 信息
|
|
6
|
+
*/
|
|
4
7
|
type: {
|
|
5
8
|
type: String,
|
|
6
9
|
default: ''
|
|
7
10
|
},
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @description 是否显示
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
9
15
|
show: {
|
|
10
16
|
type: Boolean,
|
|
11
17
|
default: true
|
|
12
18
|
},
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @description 显示的值
|
|
21
|
+
*/
|
|
14
22
|
text: {
|
|
15
23
|
type: [String,Number],
|
|
16
24
|
default: ''
|
|
17
25
|
},
|
|
18
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @description 前置图标
|
|
28
|
+
*/
|
|
19
29
|
prefixIcon: {
|
|
20
30
|
type: String,
|
|
21
31
|
default: ''
|
|
22
32
|
},
|
|
23
|
-
|
|
33
|
+
/**
|
|
34
|
+
* @description 后置图标
|
|
35
|
+
*/
|
|
24
36
|
suffixIcon: {
|
|
25
37
|
type: String,
|
|
26
38
|
default: ''
|
|
27
39
|
},
|
|
28
|
-
|
|
40
|
+
/**
|
|
41
|
+
* @description 图标颜色
|
|
42
|
+
*/
|
|
29
43
|
iconColor: {
|
|
30
44
|
type: String,
|
|
31
45
|
default: ''
|
|
32
46
|
},
|
|
33
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @description 图标大小
|
|
49
|
+
* @default 15
|
|
50
|
+
*/
|
|
34
51
|
iconSize: {
|
|
35
52
|
type: [String,Number],
|
|
36
53
|
default: 15
|
|
37
54
|
},
|
|
38
|
-
|
|
39
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @description 文本处理的匹配模式
|
|
57
|
+
* @values 'text' - 普通文本, 'price' - 价格, 'phone' - 手机号码, 'name' - 姓名, 'date' - 日期, 'link' - 超链接
|
|
58
|
+
* @default 'text'
|
|
59
|
+
*/
|
|
40
60
|
mode: {
|
|
41
61
|
type: String,
|
|
42
|
-
default: ''
|
|
62
|
+
default: 'text'
|
|
43
63
|
},
|
|
44
|
-
|
|
64
|
+
/**
|
|
65
|
+
* @description 配置的链接(仅mode=link时生效)
|
|
66
|
+
*/
|
|
45
67
|
href: {
|
|
46
68
|
type: String,
|
|
47
69
|
default: ''
|
|
48
70
|
},
|
|
49
|
-
|
|
71
|
+
/**
|
|
72
|
+
* 格式化规则
|
|
73
|
+
*/
|
|
50
74
|
format: {
|
|
51
75
|
type: [String,Function],
|
|
52
76
|
default: ''
|
|
53
77
|
},
|
|
54
|
-
|
|
78
|
+
/**
|
|
79
|
+
* @description 点击文本是否拨打电话(仅mode=phone时生效)
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
55
82
|
call: {
|
|
56
83
|
type: Boolean,
|
|
57
84
|
default: false
|
|
58
85
|
},
|
|
59
|
-
|
|
86
|
+
/**
|
|
87
|
+
* @description 小程序的打开方式
|
|
88
|
+
*/
|
|
60
89
|
openType: {
|
|
61
90
|
type: String,
|
|
62
91
|
default: ''
|
|
63
92
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
93
|
+
/**
|
|
94
|
+
* @description 是否粗体
|
|
95
|
+
* @default 'normal'
|
|
96
|
+
*/
|
|
97
|
+
weight: {
|
|
98
|
+
type: [String,Number],
|
|
99
|
+
default: 'normal'
|
|
68
100
|
},
|
|
69
|
-
|
|
101
|
+
/**
|
|
102
|
+
* @description 是否块状
|
|
103
|
+
* @default true
|
|
104
|
+
*/
|
|
70
105
|
block: {
|
|
71
106
|
type: Boolean,
|
|
72
107
|
default: false
|
|
73
108
|
},
|
|
74
|
-
|
|
109
|
+
/**
|
|
110
|
+
* @description 文本显示的行数,如果设置,超出此行数,将会显示省略号
|
|
111
|
+
*/
|
|
75
112
|
lines: {
|
|
76
113
|
type: [String,Number],
|
|
77
114
|
default: ''
|
|
78
115
|
},
|
|
79
|
-
|
|
116
|
+
/**
|
|
117
|
+
* @description 文本颜色
|
|
118
|
+
*/
|
|
80
119
|
color: {
|
|
81
120
|
type: String,
|
|
82
121
|
default: ''
|
|
83
122
|
},
|
|
84
|
-
|
|
123
|
+
/**
|
|
124
|
+
* @description 字体大小
|
|
125
|
+
* @default 15
|
|
126
|
+
*/
|
|
85
127
|
size: {
|
|
86
128
|
type: [String,Number],
|
|
87
129
|
default: 15
|
|
88
130
|
},
|
|
89
|
-
|
|
131
|
+
/**
|
|
132
|
+
* @description 文字装饰
|
|
133
|
+
* @values 'none' - 无装饰, 'underline' - 下划线, 'line-through' - 中划线
|
|
134
|
+
* @default 'none'
|
|
135
|
+
*/
|
|
90
136
|
decoration: {
|
|
91
137
|
type: String,
|
|
92
138
|
default: 'none'
|
|
93
139
|
},
|
|
94
|
-
|
|
140
|
+
/**
|
|
141
|
+
* @description 外边距,对象、字符串,数值形式均可
|
|
142
|
+
*/
|
|
95
143
|
margin: {
|
|
96
144
|
type: [Object,String,Number],
|
|
97
145
|
default: 0
|
|
98
146
|
},
|
|
99
|
-
|
|
147
|
+
/**
|
|
148
|
+
* @description 文本行高
|
|
149
|
+
*/
|
|
100
150
|
lineHeight: {
|
|
101
151
|
type: [String,Number],
|
|
102
152
|
default: ''
|
|
103
153
|
},
|
|
104
|
-
|
|
154
|
+
/**
|
|
155
|
+
* @description 文本对齐方式
|
|
156
|
+
* @values 'left' - 左对齐, 'center' - 居中, 'right' - 右对齐
|
|
157
|
+
* @default 'left'
|
|
158
|
+
*/
|
|
105
159
|
align: {
|
|
106
160
|
type: String,
|
|
107
161
|
default: 'left'
|
|
108
162
|
},
|
|
109
|
-
|
|
163
|
+
/**
|
|
164
|
+
* @description 文字换行
|
|
165
|
+
* @values 'break-word' - 在长单词或URL地址内部进行换行, 'normal' - 只在允许的断字点换行(浏览器保持默认处理), 'anywhere' - 为防止溢出,如果行中没有其他可接受的断点,则不可断的字符串(如长词或 URL)可能会在任何时候换行。
|
|
166
|
+
* @default 'normal'
|
|
167
|
+
*/
|
|
110
168
|
wordWrap: {
|
|
111
169
|
type: String,
|
|
112
170
|
default: 'normal'
|