fusions-ui 1.2.4 → 1.2.7
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 -20
- 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 +26 -33
- package/components/fu-form-item/props.js +30 -8
- 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 +110 -0
- package/components/fu-icon/fuicon.css +584 -0
- package/components/{fu-icons/icons.js → fu-icon/fuicon.js} +1031 -1031
- package/components/{fu-icons/fuicons.ttf → fu-icon/fuicon.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 +38 -43
- 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 +34 -17
- 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 +29 -27
- package/components/fu-swiper/props.js +81 -25
- 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
|
@@ -3,29 +3,29 @@
|
|
|
3
3
|
<view :class="{ 'fu-navbar--fixed': fixed, 'fu-navbar--shadow': shadow, 'fu-navbar--border': border }" :style="{ 'background': themeBgColor }" class="fu-navbar__content">
|
|
4
4
|
<status-bar v-if="statusBar" />
|
|
5
5
|
<view class="fu-navbar__header" :style="{ color: themeColor, height: navbarHeight}">
|
|
6
|
-
<view @tap="
|
|
6
|
+
<view @tap="handleClickLeft" class="fu-navbar__header-btns fu-navbar__header-btns-left" :style="{width: leftIconWidth}">
|
|
7
7
|
<slot name="left">
|
|
8
|
-
<view class="fu-navbar__content_view" v-if="leftIcon
|
|
9
|
-
<fu-
|
|
8
|
+
<view class="fu-navbar__content_view" v-if="leftIcon">
|
|
9
|
+
<fu-icon :color="themeColor" :name="leftIcon" size="24" />
|
|
10
10
|
</view>
|
|
11
|
-
<view class="fu-navbar-btn-text" :class="{ 'fu-navbar-btn-icon-left': !leftIcon
|
|
11
|
+
<view class="fu-navbar-btn-text" :class="{ 'fu-navbar-btn-icon-left': !leftIcon }" v-if="leftText">
|
|
12
12
|
<text :style="{ color: themeColor, fontSize: '12px' }">{{ leftText }}</text>
|
|
13
13
|
</view>
|
|
14
14
|
</slot>
|
|
15
15
|
</view>
|
|
16
|
-
<view class="fu-navbar__header-container" :style="{'padding': '0 ' + paddingTitle + 'px'}" @tap="
|
|
16
|
+
<view class="fu-navbar__header-container" :style="{'padding': '0 ' + paddingTitle + 'px'}" @tap="handleClickTitle">
|
|
17
17
|
<slot>
|
|
18
|
-
<view class="fu-navbar__header-container-inner" v-if="title
|
|
18
|
+
<view class="fu-navbar__header-container-inner" v-if="title">
|
|
19
19
|
<text class="fu-nav-bar-text fu-ellipsis-1" :style="{color: themeColor }">{{ title }}</text>
|
|
20
20
|
</view>
|
|
21
21
|
</slot>
|
|
22
22
|
</view>
|
|
23
|
-
<view class="fu-navbar__header-btns fu-navbar__header-btns-right" :style="{width:rightIconWidth}" @click="
|
|
23
|
+
<view class="fu-navbar__header-btns fu-navbar__header-btns-right" :style="{width:rightIconWidth}" @click="handleClickRight">
|
|
24
24
|
<slot name="right">
|
|
25
|
-
<view v-if="rightIcon
|
|
26
|
-
<fu-
|
|
25
|
+
<view v-if="rightIcon">
|
|
26
|
+
<fu-icon :color="themeColor" :name="rightIcon" size="24" />
|
|
27
27
|
</view>
|
|
28
|
-
<view class="fu-navbar-btn-text" v-if="rightText
|
|
28
|
+
<view class="fu-navbar-btn-text" v-if="rightText && !rightIcon">
|
|
29
29
|
<text class="fu-nav-bar-right-text" :style="{ color: themeColor}">{{ rightText }}</text>
|
|
30
30
|
</view>
|
|
31
31
|
</slot>
|
|
@@ -65,17 +65,19 @@
|
|
|
65
65
|
* @property {String,Number} leftWidth 导航栏左侧宽度(默认 60)
|
|
66
66
|
* @property {String,Number} rightWidth 导航栏右侧宽度 (默认60)
|
|
67
67
|
* @property {String} paddingTitle 导航栏左右内间距(默认 10)
|
|
68
|
+
*
|
|
68
69
|
* @event {Function} clickLeft 左侧按钮点击时触发
|
|
69
70
|
* @event {Function} clickRight 右侧按钮点击时触发
|
|
70
71
|
* @event {Function} clickTitle 中间标题点击时触发
|
|
72
|
+
* @example <fu-navbar :title="title"></fu-navbar>
|
|
71
73
|
*/
|
|
72
74
|
export default {
|
|
73
|
-
name: '
|
|
75
|
+
name: 'FuNavbar',
|
|
74
76
|
components: {
|
|
75
77
|
statusBar
|
|
76
78
|
},
|
|
77
|
-
emits: ['clickLeft', 'clickRight', 'clickTitle'],
|
|
78
79
|
mixins: [mpMixin, props],
|
|
80
|
+
emits: ['clickLeft', 'clickRight', 'clickTitle'],
|
|
79
81
|
computed: {
|
|
80
82
|
themeBgColor() {
|
|
81
83
|
if (this.dark) {
|
|
@@ -83,10 +85,10 @@
|
|
|
83
85
|
if (this.bgColor) {
|
|
84
86
|
return this.bgColor
|
|
85
87
|
} else {
|
|
86
|
-
return this.dark ? '#
|
|
88
|
+
return this.dark ? '#333333' : '#FFFFFF'
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
|
-
return this.bgColor || '#
|
|
91
|
+
return this.bgColor || '#FFFFFF'
|
|
90
92
|
},
|
|
91
93
|
themeColor() {
|
|
92
94
|
if (this.dark) {
|
|
@@ -115,15 +117,18 @@
|
|
|
115
117
|
}
|
|
116
118
|
},
|
|
117
119
|
methods: {
|
|
118
|
-
|
|
120
|
+
// 左侧按钮点击时触发
|
|
121
|
+
handleClickLeft(e) {
|
|
119
122
|
this.$emit("clickLeft", e);
|
|
120
123
|
},
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
|
|
125
|
+
// 右侧按钮点击时触发
|
|
126
|
+
handleClickRight(e) {
|
|
123
127
|
this.$emit("clickRight", e);
|
|
124
128
|
},
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
|
|
130
|
+
// 中间标题点击时触发
|
|
131
|
+
handleClickTitle(e) {
|
|
127
132
|
this.$emit("clickTitle", e);
|
|
128
133
|
}
|
|
129
134
|
}
|
|
@@ -131,6 +136,7 @@
|
|
|
131
136
|
</script>
|
|
132
137
|
|
|
133
138
|
<style lang="scss" scoped>
|
|
139
|
+
@import '../../libs/style/components.scss';
|
|
134
140
|
$nav-height: 44px;
|
|
135
141
|
|
|
136
142
|
.fu-nvue-fixed {
|
|
@@ -158,32 +164,25 @@
|
|
|
158
164
|
}
|
|
159
165
|
|
|
160
166
|
.fu-navbar-btn-text {
|
|
161
|
-
|
|
162
|
-
display: flex;
|
|
163
|
-
/* #endif */
|
|
164
|
-
flex-direction: column;
|
|
167
|
+
@include flex(column);
|
|
165
168
|
justify-content: flex-start;
|
|
166
169
|
align-items: center;
|
|
167
170
|
line-height: 12px;
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
.fu-navbar__header {
|
|
171
|
-
|
|
172
|
-
display: flex;
|
|
173
|
-
/* #endif */
|
|
174
|
+
@include flex(row);
|
|
174
175
|
padding: 0 10px;
|
|
175
|
-
flex-direction: row;
|
|
176
176
|
height: $nav-height;
|
|
177
177
|
font-size: 12px;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
.fu-navbar__header-btns {
|
|
181
|
+
@include flex(row);
|
|
181
182
|
/* #ifndef APP-NVUE */
|
|
182
183
|
overflow: hidden;
|
|
183
|
-
display: flex;
|
|
184
184
|
/* #endif */
|
|
185
185
|
flex-wrap: nowrap;
|
|
186
|
-
flex-direction: row;
|
|
187
186
|
width: 120rpx;
|
|
188
187
|
justify-content: center;
|
|
189
188
|
align-items: center;
|
|
@@ -193,42 +192,36 @@
|
|
|
193
192
|
}
|
|
194
193
|
|
|
195
194
|
.fu-navbar__header-btns-left {
|
|
196
|
-
|
|
197
|
-
display: flex;
|
|
198
|
-
/* #endif */
|
|
195
|
+
@include flex;
|
|
199
196
|
width: 120rpx;
|
|
200
197
|
justify-content: flex-start;
|
|
201
198
|
align-items: center;
|
|
202
199
|
}
|
|
203
200
|
|
|
204
201
|
.fu-navbar__header-btns-right {
|
|
205
|
-
|
|
206
|
-
display: flex;
|
|
207
|
-
/* #endif */
|
|
208
|
-
flex-direction: row;
|
|
202
|
+
@include flex(row);
|
|
209
203
|
justify-content: flex-end;
|
|
210
204
|
align-items: center;
|
|
211
205
|
}
|
|
212
206
|
|
|
213
207
|
.fu-navbar__header-container {
|
|
214
|
-
|
|
215
|
-
display: flex;
|
|
216
|
-
/* #endif */
|
|
208
|
+
@include flex;
|
|
217
209
|
flex: 1;
|
|
218
210
|
padding: 0 10px;
|
|
211
|
+
/* #ifndef APP-NVUE */
|
|
219
212
|
overflow: hidden;
|
|
213
|
+
/* #endif */
|
|
220
214
|
}
|
|
221
215
|
|
|
222
216
|
.fu-navbar__header-container-inner {
|
|
223
|
-
|
|
224
|
-
display: flex;
|
|
225
|
-
/* #endif */
|
|
217
|
+
@include flex(row);
|
|
226
218
|
flex: 1;
|
|
227
|
-
flex-direction: row;
|
|
228
219
|
align-items: center;
|
|
229
220
|
justify-content: center;
|
|
230
221
|
font-size: 12px;
|
|
222
|
+
/* #ifndef APP-NVUE */
|
|
231
223
|
overflow: hidden;
|
|
224
|
+
/* #endif */
|
|
232
225
|
}
|
|
233
226
|
|
|
234
227
|
|
|
@@ -262,8 +255,8 @@
|
|
|
262
255
|
}
|
|
263
256
|
|
|
264
257
|
.fu-ellipsis-1 {
|
|
265
|
-
overflow: hidden;
|
|
266
258
|
/* #ifndef APP-NVUE */
|
|
259
|
+
overflow: hidden;
|
|
267
260
|
white-space: nowrap;
|
|
268
261
|
text-overflow: ellipsis;
|
|
269
262
|
/* #endif */
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script>
|
|
56
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
56
57
|
import NoticeRow from './notice-row.vue'
|
|
57
58
|
import NoticeColumn from './notice-column.vue'
|
|
58
|
-
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
59
59
|
import props from './props.js'
|
|
60
60
|
/**
|
|
61
61
|
* NoticeBar 通知栏
|
|
@@ -79,20 +79,20 @@
|
|
|
79
79
|
* @property {String} color 字体颜色
|
|
80
80
|
* @property {String,Number} size 字体大小(默认 14)
|
|
81
81
|
* @property {String} bgColor 背景颜色
|
|
82
|
+
*
|
|
83
|
+
* @event {Function} click 点击通知栏文字触发
|
|
84
|
+
* @event {Function} clickRight 点击右侧图标触发
|
|
85
|
+
* @event {Function} end 一个周期滚动结束触发(仅mode=column时生效)
|
|
86
|
+
* @example <fu-notice-bar :list="list"></fu-notice-bar>
|
|
82
87
|
*/
|
|
83
88
|
export default {
|
|
84
89
|
name:"FuNoticeBar",
|
|
85
|
-
emits: ['click', '
|
|
90
|
+
emits: ['click', 'clickRight', 'end'],
|
|
86
91
|
mixins: [mpMixin, props],
|
|
87
92
|
components: {
|
|
88
93
|
NoticeRow,
|
|
89
94
|
NoticeColumn
|
|
90
95
|
},
|
|
91
|
-
data() {
|
|
92
|
-
return {
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
},
|
|
96
96
|
computed: {
|
|
97
97
|
// 当设置了show为false,或者autoHidden为true且list为空时,不显示通知
|
|
98
98
|
showNotice() {
|
|
@@ -123,6 +123,8 @@
|
|
|
123
123
|
|
|
124
124
|
<style lang="scss" scoped>
|
|
125
125
|
.fu-notice-bar {
|
|
126
|
-
|
|
126
|
+
/* #ifndef APP-NVUE */
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
/* #endif */
|
|
127
129
|
}
|
|
128
130
|
</style>
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
<view class="fu-column-notice" :style="[noticeStyle]" @tap="handleClick" v-if="show">
|
|
3
3
|
<!-- 左图标 -->
|
|
4
4
|
<view class="fu-column-notice__icon--left" v-if="leftIcon">
|
|
5
|
-
<fu-
|
|
5
|
+
<fu-icon :name="leftIconName" :size="leftIconSize" :color="leftIconColor"></fu-icon>
|
|
6
6
|
</view>
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
<!-- 滚动显示内容 -->
|
|
9
|
-
<swiper class="fu-column-notice__swiper" :style="[swiperStyle]" :vertical="vertical" circular
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
<swiper class="fu-column-notice__swiper" :style="[swiperStyle]" :vertical="vertical" circular
|
|
10
|
+
:autoplay="autoPlay" :interval="duration" @change="change">
|
|
11
|
+
<swiper-item v-for="(item, index) in list" :key="index" class="fu-column-notice__swiper__item">
|
|
12
|
+
<view class="fu-column-notice__swiper__content fu-text-ellipsis" :style="[textStyle()]">
|
|
13
|
+
{{item}}
|
|
14
|
+
</view>
|
|
15
|
+
</swiper-item>
|
|
15
16
|
</swiper>
|
|
16
|
-
|
|
17
|
+
|
|
17
18
|
<!-- 右图标 -->
|
|
18
19
|
<view class="fu-column-notice__icon--right" @click="handleClickRight" v-if="rightIcon">
|
|
19
|
-
<fu-
|
|
20
|
+
<fu-icon :name="rightIconName" :size="rightIconSize" :color="rightIconColor"></fu-icon>
|
|
20
21
|
</view>
|
|
21
22
|
</view>
|
|
22
23
|
</template>
|
|
@@ -42,104 +43,160 @@
|
|
|
42
43
|
* @property {String} fontColor 字体颜色
|
|
43
44
|
* @property {String,Number} fontSize 字体大小(默认 14)
|
|
44
45
|
* @property {String} bgColor 背景颜色
|
|
46
|
+
*
|
|
47
|
+
* @event {Function} click 点击通知栏文字触发
|
|
48
|
+
* @event {Function} clickRight 点击右侧图标触发
|
|
49
|
+
* @event {Function} end 一个周期滚动结束触发
|
|
50
|
+
* @example <notice-column :list="list"></notice-column>
|
|
45
51
|
*/
|
|
46
52
|
export default {
|
|
47
|
-
name:"NoticeColumn",
|
|
53
|
+
name: "NoticeColumn",
|
|
48
54
|
mixins: [mpMixin, mixin],
|
|
49
55
|
emits: ['click', 'clickRight', 'end'],
|
|
50
56
|
props: {
|
|
51
|
-
|
|
57
|
+
/**
|
|
58
|
+
* @description 显示的内容
|
|
59
|
+
*/
|
|
52
60
|
list: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
type: Array,
|
|
62
|
+
default () {
|
|
63
|
+
return []
|
|
64
|
+
}
|
|
57
65
|
},
|
|
58
|
-
|
|
66
|
+
/**
|
|
67
|
+
* @description 是否显示
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
59
70
|
show: {
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: true
|
|
62
73
|
},
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
/**
|
|
75
|
+
* @description 滚动方向
|
|
76
|
+
* @values @values 'row' - 水平滚动, 'column' - 垂直滚动
|
|
77
|
+
* @default 'row'
|
|
78
|
+
*/
|
|
65
79
|
mode: {
|
|
66
|
-
|
|
67
|
-
|
|
80
|
+
type: String,
|
|
81
|
+
default: 'row'
|
|
68
82
|
},
|
|
69
|
-
|
|
83
|
+
/**
|
|
84
|
+
* @description 是否显示左边图标
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
70
87
|
leftIcon: {
|
|
71
|
-
|
|
72
|
-
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: true
|
|
73
90
|
},
|
|
74
|
-
|
|
91
|
+
/**
|
|
92
|
+
* @description 左边图标的名称
|
|
93
|
+
* @default 'volume'
|
|
94
|
+
*/
|
|
75
95
|
leftIconName: {
|
|
76
|
-
|
|
77
|
-
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'volume'
|
|
78
98
|
},
|
|
79
|
-
|
|
99
|
+
/**
|
|
100
|
+
* @description 左边图标的大小
|
|
101
|
+
* @default 20
|
|
102
|
+
*/
|
|
80
103
|
leftIconSize: {
|
|
81
|
-
|
|
82
|
-
|
|
104
|
+
type: Number,
|
|
105
|
+
default: 20
|
|
83
106
|
},
|
|
84
|
-
|
|
107
|
+
/**
|
|
108
|
+
* @description 左边图标的颜色
|
|
109
|
+
* @default '#333333'
|
|
110
|
+
*/
|
|
85
111
|
leftIconColor: {
|
|
86
112
|
type: String,
|
|
87
113
|
default: '#333333'
|
|
88
114
|
},
|
|
89
|
-
|
|
115
|
+
/**
|
|
116
|
+
* @description 是否显示右边的图标
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
90
119
|
rightIcon: {
|
|
91
|
-
|
|
92
|
-
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false
|
|
93
122
|
},
|
|
94
|
-
|
|
123
|
+
/**
|
|
124
|
+
* @description 右边图标的名称
|
|
125
|
+
* @default 'right'
|
|
126
|
+
*/
|
|
95
127
|
rightIconName: {
|
|
96
|
-
|
|
97
|
-
|
|
128
|
+
type: String,
|
|
129
|
+
default: 'right'
|
|
98
130
|
},
|
|
99
|
-
|
|
131
|
+
/**
|
|
132
|
+
* @description 右边图标的大小
|
|
133
|
+
* @default 20
|
|
134
|
+
*/
|
|
100
135
|
rightIconSize: {
|
|
101
|
-
|
|
102
|
-
|
|
136
|
+
type: [String, Number],
|
|
137
|
+
default: 20
|
|
103
138
|
},
|
|
104
|
-
|
|
139
|
+
/**
|
|
140
|
+
* @description 右边图标的颜色
|
|
141
|
+
* @default '#333333'
|
|
142
|
+
*/
|
|
105
143
|
rightIconColor: {
|
|
106
144
|
type: String,
|
|
107
145
|
default: '#333333'
|
|
108
146
|
},
|
|
109
|
-
|
|
147
|
+
/**
|
|
148
|
+
* @description 设置圆角
|
|
149
|
+
*/
|
|
110
150
|
radius: {
|
|
111
|
-
|
|
112
|
-
|
|
151
|
+
type: Number,
|
|
152
|
+
default: 0
|
|
113
153
|
},
|
|
114
|
-
|
|
154
|
+
/**
|
|
155
|
+
* @description 内边距
|
|
156
|
+
* @default '9px 12px'
|
|
157
|
+
*/
|
|
115
158
|
padding: {
|
|
116
|
-
|
|
117
|
-
|
|
159
|
+
type: String,
|
|
160
|
+
default: '9px 12px'
|
|
118
161
|
},
|
|
119
|
-
|
|
162
|
+
/**
|
|
163
|
+
* @description 自动播放
|
|
164
|
+
* @default true
|
|
165
|
+
*/
|
|
120
166
|
autoPlay: {
|
|
121
|
-
|
|
122
|
-
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: true
|
|
123
169
|
},
|
|
124
|
-
|
|
170
|
+
/**
|
|
171
|
+
* @description 滚动周期
|
|
172
|
+
* @default 2000
|
|
173
|
+
*/
|
|
125
174
|
duration: {
|
|
126
|
-
|
|
127
|
-
|
|
175
|
+
type: Number,
|
|
176
|
+
default: 2000
|
|
128
177
|
},
|
|
129
|
-
|
|
178
|
+
/**
|
|
179
|
+
* @description 背景颜色
|
|
180
|
+
*/
|
|
130
181
|
bgColor: {
|
|
131
|
-
|
|
132
|
-
|
|
182
|
+
type: String,
|
|
183
|
+
default: ''
|
|
133
184
|
},
|
|
134
|
-
|
|
185
|
+
/**
|
|
186
|
+
* @description 字体颜色
|
|
187
|
+
* @default '#333333'
|
|
188
|
+
*/
|
|
135
189
|
fontColor: {
|
|
136
|
-
|
|
137
|
-
|
|
190
|
+
type: String,
|
|
191
|
+
default: '#333333'
|
|
138
192
|
},
|
|
139
|
-
|
|
193
|
+
/**
|
|
194
|
+
* @description 字体大小
|
|
195
|
+
* @default 14
|
|
196
|
+
*/
|
|
140
197
|
fontSize: {
|
|
141
|
-
|
|
142
|
-
|
|
198
|
+
type: [String, Number],
|
|
199
|
+
default: 14
|
|
143
200
|
}
|
|
144
201
|
},
|
|
145
202
|
data() {
|
|
@@ -149,31 +206,31 @@
|
|
|
149
206
|
},
|
|
150
207
|
computed: {
|
|
151
208
|
textStyle() {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
209
|
+
return (type) => {
|
|
210
|
+
let style = {
|
|
211
|
+
color: this.fontColor || '',
|
|
212
|
+
fontSize: this.$fu.addUnit(this.fontSize)
|
|
213
|
+
};
|
|
214
|
+
return style
|
|
215
|
+
}
|
|
159
216
|
},
|
|
160
217
|
noticeStyle() {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
218
|
+
let style = {
|
|
219
|
+
background: this.bgColor || 'transparent'
|
|
220
|
+
};
|
|
221
|
+
if (this.padding) style.padding = this.padding
|
|
222
|
+
return style
|
|
166
223
|
},
|
|
167
224
|
swiperStyle() {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
225
|
+
let style = {}
|
|
226
|
+
style.height = this.fontSize ? this.$fu.addUnit(this.fontSize + 6) : '16px';
|
|
227
|
+
style.lineHeight = style.height;
|
|
228
|
+
return style
|
|
172
229
|
},
|
|
173
230
|
// 标记是否为垂直
|
|
174
231
|
vertical() {
|
|
175
|
-
|
|
176
|
-
|
|
232
|
+
if (this.mode === 'row') return false
|
|
233
|
+
else return true
|
|
177
234
|
}
|
|
178
235
|
},
|
|
179
236
|
methods: {
|
|
@@ -181,12 +238,12 @@
|
|
|
181
238
|
handleClick() {
|
|
182
239
|
this.$emit('click', this.index)
|
|
183
240
|
},
|
|
184
|
-
|
|
241
|
+
|
|
185
242
|
// 点击右边图标
|
|
186
243
|
handleClickRight() {
|
|
187
244
|
this.$emit('clickRight', this.index)
|
|
188
245
|
},
|
|
189
|
-
|
|
246
|
+
|
|
190
247
|
// 切换事件
|
|
191
248
|
change(e) {
|
|
192
249
|
let index = e.detail.current;
|
|
@@ -200,49 +257,57 @@
|
|
|
200
257
|
</script>
|
|
201
258
|
|
|
202
259
|
<style lang="scss" scoped>
|
|
203
|
-
@import '../../libs/
|
|
204
|
-
|
|
260
|
+
@import '../../libs/style/components.scss';
|
|
261
|
+
|
|
205
262
|
.fu-column-notice {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
263
|
+
@include flex(row);
|
|
264
|
+
align-items: center;
|
|
265
|
+
justify-content: center;
|
|
266
|
+
flex-wrap: nowrap;
|
|
267
|
+
/* #ifndef APP-NVUE */
|
|
268
|
+
overflow: hidden;
|
|
269
|
+
/* #endif */
|
|
270
|
+
|
|
271
|
+
&__swiper {
|
|
272
|
+
height: auto;
|
|
273
|
+
flex: 1;
|
|
274
|
+
@include flex(row);
|
|
275
|
+
align-items: center;
|
|
276
|
+
margin-left: 6px;
|
|
277
|
+
|
|
278
|
+
&__item {
|
|
279
|
+
@include flex(row);
|
|
280
|
+
/* #ifndef APP-NVUE */
|
|
281
|
+
overflow: hidden;
|
|
282
|
+
/* #endif */
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&__content {
|
|
286
|
+
/* #ifndef APP-NVUE */
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
/* #endif */
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&__icon {
|
|
293
|
+
&--left {
|
|
294
|
+
display: inline-flex;
|
|
295
|
+
align-items: center;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&--right {
|
|
299
|
+
margin-left: 6px;
|
|
300
|
+
display: inline-flex;
|
|
301
|
+
align-items: center;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
241
304
|
}
|
|
242
|
-
|
|
305
|
+
|
|
243
306
|
.fu-text-ellipsis {
|
|
307
|
+
/* #ifndef APP-NVUE */
|
|
244
308
|
overflow: hidden;
|
|
245
309
|
white-space: nowrap;
|
|
246
310
|
text-overflow: ellipsis;
|
|
311
|
+
/* #endif */
|
|
247
312
|
}
|
|
248
313
|
</style>
|