fusions-ui 1.2.2 → 1.2.4
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-button/fu-button.vue +1 -0
- package/components/fu-date-picker/fu-date-picker.vue +66 -62
- package/components/fu-date-picker/props.js +1 -1
- package/components/fu-date-picker/time-picker.vue +13 -13
- package/components/fu-form-item/fu-form-item.vue +20 -23
- package/components/fu-form-item/props.js +5 -0
- package/components/fu-popup/fu-popup.vue +1 -1
- package/components/fu-section/fu-section.vue +3 -2
- package/components/fu-section/props.js +3 -3
- package/components/fu-swiper/fu-swiper.vue +3 -3
- package/components/fu-swiper/props.js +1 -1
- package/components/fu-vtabs/fu-vtabs.vue +19 -0
- package/package.json +1 -1
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
* @property {String} lang = [zh_CN|zh_TW|en] 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
125
125
|
* @property {String} customClass 自定义外部class样式
|
|
126
126
|
* @property {Object,String} customStyle 自定义外部样式
|
|
127
|
+
* @property {Object,String} customTextStyle 自定义按钮文本样式
|
|
127
128
|
* @event {Function} click 非禁止并且非加载中,才能点击
|
|
128
129
|
* @event {Function} tap 非禁止并且非加载中,才能点击
|
|
129
130
|
* @event {Function} getphonenumber open-type="getPhoneNumber"时有效
|
|
@@ -199,18 +199,22 @@
|
|
|
199
199
|
/**
|
|
200
200
|
* DatePicker 时间选择器
|
|
201
201
|
* @description 同时支持 PC 和移动端使用日历选择日期和日期范围
|
|
202
|
-
* @property {String}
|
|
202
|
+
* @property {String} mode = [date|daterange|datetime|datetimerange] 选择器类型
|
|
203
203
|
* @value date 日期
|
|
204
204
|
* @value daterange 日期范围
|
|
205
205
|
* @value datetime 日期时间
|
|
206
206
|
* @value datetimerange 日期时间范围
|
|
207
207
|
* @property {String|Number|Array|Date} value 绑定值
|
|
208
208
|
* @property {String} placeholder 单选择时的占位内容
|
|
209
|
-
* @property {String} start
|
|
209
|
+
* @property {String} start 最小值,可以使用日期的字符串(String)、时间戳(Number)
|
|
210
210
|
* @property {String} end 终止时间
|
|
211
|
-
* @property {String}
|
|
212
|
-
*
|
|
213
|
-
*
|
|
211
|
+
* @property {String} returnType 返回值格式(默认 string)
|
|
212
|
+
* @value timestamp 时间戳格式
|
|
213
|
+
* @value string 字符串格式
|
|
214
|
+
* @value date 日期格式
|
|
215
|
+
* @property {String} startPlaceholder 范围选择时开始日期的占位内容
|
|
216
|
+
* @property {String} endPlaceholder 范围选择时结束日期的占位内容
|
|
217
|
+
* @property {String} rangeSeparator 选择范围时的分隔符
|
|
214
218
|
* @property {Boolean} border = [true|false] 是否有边框
|
|
215
219
|
* @property {Boolean} disabled = [true|false] 是否禁用
|
|
216
220
|
* @property {Boolean} clearIcon = [true|false] 是否显示清除按钮(仅PC端适用)
|
|
@@ -274,59 +278,6 @@
|
|
|
274
278
|
i18nT: () => {}
|
|
275
279
|
}
|
|
276
280
|
},
|
|
277
|
-
watch: {
|
|
278
|
-
type: {
|
|
279
|
-
immediate: true,
|
|
280
|
-
handler(newVal) {
|
|
281
|
-
this.hasTime = newVal.indexOf('time') !== -1;
|
|
282
|
-
this.isRange = newVal.indexOf('range') !== -1;
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
// #ifndef VUE3
|
|
286
|
-
value: {
|
|
287
|
-
immediate: true,
|
|
288
|
-
handler(newVal) {
|
|
289
|
-
if (this.isEmitValue) {
|
|
290
|
-
this.isEmitValue = false;
|
|
291
|
-
return
|
|
292
|
-
}
|
|
293
|
-
this.initPicker(newVal)
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
// #endif
|
|
297
|
-
// #ifdef VUE3
|
|
298
|
-
modelValue: {
|
|
299
|
-
immediate: true,
|
|
300
|
-
handler(newVal) {
|
|
301
|
-
if (this.isEmitValue) {
|
|
302
|
-
this.isEmitValue = false;
|
|
303
|
-
return
|
|
304
|
-
}
|
|
305
|
-
this.initPicker(newVal)
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
// #endif
|
|
309
|
-
start: {
|
|
310
|
-
immediate: true,
|
|
311
|
-
handler(newVal) {
|
|
312
|
-
if (!newVal) return
|
|
313
|
-
this.calendarRange.startDate = getDate(newVal);
|
|
314
|
-
if (this.hasTime) {
|
|
315
|
-
this.calendarRange.startTime = getTime(newVal);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
end: {
|
|
320
|
-
immediate: true,
|
|
321
|
-
handler(newVal) {
|
|
322
|
-
if (!newVal) return
|
|
323
|
-
this.calendarRange.endDate = getDate(newVal);
|
|
324
|
-
if (this.hasTime) {
|
|
325
|
-
this.calendarRange.endTime = getTime(newVal, this.hideSecond);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
281
|
computed: {
|
|
331
282
|
timepickerStartTime() {
|
|
332
283
|
const activeDate = this.isRange ? this.tempRange.startDate : this.inputDate;
|
|
@@ -356,7 +307,7 @@
|
|
|
356
307
|
* for i18n
|
|
357
308
|
*/
|
|
358
309
|
singlePlaceholderText() {
|
|
359
|
-
return this.placeholder || (this.
|
|
310
|
+
return this.placeholder || (this.mode === 'date' ? this.selectDateText : this.selectDateTimeText)
|
|
360
311
|
},
|
|
361
312
|
startPlaceholderText() {
|
|
362
313
|
return this.startPlaceholder || this.startDateText
|
|
@@ -779,10 +730,10 @@
|
|
|
779
730
|
handleStartAndEnd(before, after, temp = false) {
|
|
780
731
|
if (!(before && after)) return
|
|
781
732
|
|
|
782
|
-
const
|
|
733
|
+
const mode = temp ? 'tempRange' : 'range'
|
|
783
734
|
const isStartEarlierEnd = dateCompare(before, after)
|
|
784
|
-
this[
|
|
785
|
-
this[
|
|
735
|
+
this[mode].startDate = isStartEarlierEnd ? before : after;
|
|
736
|
+
this[mode].endDate = isStartEarlierEnd ? after : before;
|
|
786
737
|
},
|
|
787
738
|
|
|
788
739
|
/**
|
|
@@ -844,6 +795,59 @@
|
|
|
844
795
|
}
|
|
845
796
|
}
|
|
846
797
|
}
|
|
798
|
+
},
|
|
799
|
+
watch: {
|
|
800
|
+
mode: {
|
|
801
|
+
immediate: true,
|
|
802
|
+
handler(newVal) {
|
|
803
|
+
this.hasTime = newVal.indexOf('time') !== -1;
|
|
804
|
+
this.isRange = newVal.indexOf('range') !== -1;
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
// #ifndef VUE3
|
|
808
|
+
value: {
|
|
809
|
+
immediate: true,
|
|
810
|
+
handler(newVal) {
|
|
811
|
+
if (this.isEmitValue) {
|
|
812
|
+
this.isEmitValue = false;
|
|
813
|
+
return
|
|
814
|
+
}
|
|
815
|
+
this.initPicker(newVal)
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
// #endif
|
|
819
|
+
// #ifdef VUE3
|
|
820
|
+
modelValue: {
|
|
821
|
+
immediate: true,
|
|
822
|
+
handler(newVal) {
|
|
823
|
+
if (this.isEmitValue) {
|
|
824
|
+
this.isEmitValue = false;
|
|
825
|
+
return
|
|
826
|
+
}
|
|
827
|
+
this.initPicker(newVal)
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
// #endif
|
|
831
|
+
start: {
|
|
832
|
+
immediate: true,
|
|
833
|
+
handler(newVal) {
|
|
834
|
+
if (!newVal) return
|
|
835
|
+
this.calendarRange.startDate = getDate(newVal);
|
|
836
|
+
if (this.hasTime) {
|
|
837
|
+
this.calendarRange.startTime = getTime(newVal);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
end: {
|
|
842
|
+
immediate: true,
|
|
843
|
+
handler(newVal) {
|
|
844
|
+
if (!newVal) return
|
|
845
|
+
this.calendarRange.endDate = getDate(newVal);
|
|
846
|
+
if (this.hasTime) {
|
|
847
|
+
this.calendarRange.endTime = getTime(newVal, this.hideSecond);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
},
|
|
847
851
|
}
|
|
848
852
|
}
|
|
849
853
|
</script>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<slot>
|
|
5
5
|
<view class="fu-datetime-picker-timebox-pointer"
|
|
6
6
|
:class="{'fu-datetime-picker-disabled': disabled, 'fu-datetime-picker-timebox': border}">
|
|
7
|
-
<text class="fu-datetime-picker-text">{{time}}</text>
|
|
7
|
+
<text class="fu-datetime-picker-text">{{ time }}</text>
|
|
8
8
|
<view v-if="!time" class="fu-datetime-picker-time">
|
|
9
|
-
<text class="fu-datetime-picker-text">{{selectTimeText}}</text>
|
|
9
|
+
<text class="fu-datetime-picker-text">{{ selectTimeText }}</text>
|
|
10
10
|
</view>
|
|
11
11
|
</view>
|
|
12
12
|
</slot>
|
|
@@ -15,24 +15,24 @@
|
|
|
15
15
|
<view v-if="visible" class="fu-datetime-picker-popup" :class="[dateShow && timeShow ? '' : 'fix-nvue-height']"
|
|
16
16
|
:style="fixNvueBug">
|
|
17
17
|
<view class="fu-title">
|
|
18
|
-
<text class="fu-datetime-picker-text">{{selectTimeText}}</text>
|
|
18
|
+
<text class="fu-datetime-picker-text">{{ selectTimeText }}</text>
|
|
19
19
|
</view>
|
|
20
20
|
<view v-if="dateShow" class="fu-datetime-picker__container-box">
|
|
21
21
|
<picker-view class="fu-datetime-picker-view" :indicator-style="indicatorStyle" :value="ymd"
|
|
22
22
|
@change="bindDateChange">
|
|
23
23
|
<picker-view-column>
|
|
24
24
|
<view class="fu-datetime-picker-item" v-for="(item,index) in years" :key="index">
|
|
25
|
-
<text class="fu-datetime-picker-item">{{lessThanTen(item)}}</text>
|
|
25
|
+
<text class="fu-datetime-picker-item">{{ lessThanTen(item) }}</text>
|
|
26
26
|
</view>
|
|
27
27
|
</picker-view-column>
|
|
28
28
|
<picker-view-column>
|
|
29
29
|
<view class="fu-datetime-picker-item" v-for="(item,index) in months" :key="index">
|
|
30
|
-
<text class="fu-datetime-picker-item">{{lessThanTen(item)}}</text>
|
|
30
|
+
<text class="fu-datetime-picker-item">{{ lessThanTen(item) }}</text>
|
|
31
31
|
</view>
|
|
32
32
|
</picker-view-column>
|
|
33
33
|
<picker-view-column>
|
|
34
34
|
<view class="fu-datetime-picker-item" v-for="(item,index) in days" :key="index">
|
|
35
|
-
<text class="fu-datetime-picker-item">{{lessThanTen(item)}}</text>
|
|
35
|
+
<text class="fu-datetime-picker-item">{{ lessThanTen(item) }}</text>
|
|
36
36
|
</view>
|
|
37
37
|
</picker-view-column>
|
|
38
38
|
</picker-view>
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
:indicator-style="indicatorStyle" :value="hms" @change="bindTimeChange">
|
|
46
46
|
<picker-view-column>
|
|
47
47
|
<view class="fu-datetime-picker-item" v-for="(item,index) in hours" :key="index">
|
|
48
|
-
<text class="fu-datetime-picker-item">{{lessThanTen(item)}}</text>
|
|
48
|
+
<text class="fu-datetime-picker-item">{{ lessThanTen(item) }}</text>
|
|
49
49
|
</view>
|
|
50
50
|
</picker-view-column>
|
|
51
51
|
<picker-view-column>
|
|
52
52
|
<view class="fu-datetime-picker-item" v-for="(item,index) in minutes" :key="index">
|
|
53
|
-
<text class="fu-datetime-picker-item">{{lessThanTen(item)}}</text>
|
|
53
|
+
<text class="fu-datetime-picker-item">{{ lessThanTen(item) }}</text>
|
|
54
54
|
</view>
|
|
55
55
|
</picker-view-column>
|
|
56
56
|
<picker-view-column v-if="!hideSecond">
|
|
57
57
|
<view class="fu-datetime-picker-item" v-for="(item,index) in seconds" :key="index">
|
|
58
|
-
<text class="fu-datetime-picker-item">{{lessThanTen(item)}}</text>
|
|
58
|
+
<text class="fu-datetime-picker-item">{{ lessThanTen(item) }}</text>
|
|
59
59
|
</view>
|
|
60
60
|
</picker-view-column>
|
|
61
61
|
</picker-view>
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
</view>
|
|
66
66
|
<view class="fu-datetime-picker-btn">
|
|
67
67
|
<view @click="clearTime">
|
|
68
|
-
<text class="fu-datetime-picker-btn-text">{{clearText}}</text>
|
|
68
|
+
<text class="fu-datetime-picker-btn-text">{{ clearText }}</text>
|
|
69
69
|
</view>
|
|
70
70
|
<view class="fu-datetime-picker-btn-group">
|
|
71
71
|
<view class="fu-datetime-picker-cancel" @click="tiggerTimePicker">
|
|
72
|
-
<text class="fu-datetime-picker-btn-text">{{cancelText}}</text>
|
|
72
|
+
<text class="fu-datetime-picker-btn-text">{{ cancelText }}</text>
|
|
73
73
|
</view>
|
|
74
74
|
<view @click="setTime">
|
|
75
|
-
<text class="fu-datetime-picker-btn-text">{{okText}}</text>
|
|
75
|
+
<text class="fu-datetime-picker-btn-text">{{ okText }}</text>
|
|
76
76
|
</view>
|
|
77
77
|
</view>
|
|
78
78
|
</view>
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
*/
|
|
99
99
|
export default {
|
|
100
100
|
name: 'FuTimePicker',
|
|
101
|
-
emits: ['change', 'input'],
|
|
101
|
+
emits: ['change', 'input', 'update:modelValue'],
|
|
102
102
|
data() {
|
|
103
103
|
return {
|
|
104
104
|
indicatorStyle: `height: 50px;`,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="fu-
|
|
3
|
-
:class="['is-direction-' + localLabelPos , border?'fu-
|
|
2
|
+
<view class="fu-form-item"
|
|
3
|
+
:class="['is-direction-' + localLabelPos , border?'fu-form-item--border': '' , border && isFirstBorder? 'is-first-border': '']">
|
|
4
4
|
<slot name="label">
|
|
5
|
-
<view class="fu-
|
|
5
|
+
<view class="fu-form-item__label" :class="{'no-label': !label && !required}" :style="{width: localLabelWidth, justifyContent: localLabelAlign}">
|
|
6
6
|
<text v-if="required" class="is-required">*</text>
|
|
7
7
|
<text>{{ label }}</text>
|
|
8
8
|
</view>
|
|
9
9
|
</slot>
|
|
10
10
|
<!-- #ifndef APP-NVUE -->
|
|
11
|
-
<view class="fu-
|
|
11
|
+
<view class="fu-form-item__content">
|
|
12
12
|
<slot></slot>
|
|
13
|
-
<view class="fu-
|
|
13
|
+
<view class="fu-form-item__error" :class="{'msg--active': msg}">
|
|
14
14
|
<text>{{ msg }}</text>
|
|
15
15
|
</view>
|
|
16
16
|
</view>
|
|
17
17
|
<!-- #endif -->
|
|
18
18
|
<!-- #ifdef APP-NVUE -->
|
|
19
|
-
<view class="fu-
|
|
20
|
-
<view class="fu-
|
|
19
|
+
<view class="fu-form-item__nuve-content">
|
|
20
|
+
<view class="fu-form-item__content">
|
|
21
21
|
<slot></slot>
|
|
22
22
|
</view>
|
|
23
|
-
<view class="fu-
|
|
23
|
+
<view class="fu-form-item__error" :class="{'msg--active': msg}">
|
|
24
24
|
<text class="error-text">{{ msg }}</text>
|
|
25
25
|
</view>
|
|
26
26
|
</view>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* @value right label 右侧对齐
|
|
44
44
|
* @property {String } message 显示的错误提示内容,如果为空字符串或者false,则不显示错误信息
|
|
45
45
|
* @property {String } prop 表单域的属性名,在使用校验规则时必填
|
|
46
|
-
* @property {String }
|
|
46
|
+
* @property {String } labelPosition = [top|left] label的文字的位置,优先级高于fu-form组件中的labelPosition
|
|
47
47
|
* @value top 顶部显示 label
|
|
48
48
|
* @value left 左侧显示 label
|
|
49
49
|
*/
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
// 宽度
|
|
223
223
|
this.localLabelWidth = this._labelWidthUnit(labelWidth);
|
|
224
224
|
// 标签位置
|
|
225
|
-
this.localLabelPos = this._labelPosition();
|
|
225
|
+
this.localLabelPos = this.labelPosition || this._labelPosition();
|
|
226
226
|
// 将需要校验的子组件加入form 队列
|
|
227
227
|
this.form && type && childrens.push(this)
|
|
228
228
|
|
|
@@ -367,17 +367,18 @@
|
|
|
367
367
|
},
|
|
368
368
|
'form.labelPosition'(val) {
|
|
369
369
|
// 标签位置
|
|
370
|
-
this.localLabelPos = this._labelPosition()
|
|
370
|
+
this.localLabelPos = this.labelPosition || this._labelPosition()
|
|
371
371
|
},
|
|
372
372
|
'form.labelAlign'(val) {
|
|
373
|
-
|
|
373
|
+
// 标签对齐方式
|
|
374
|
+
this.localLabelAlign = this._justifyContent();
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
377
|
}
|
|
377
378
|
</script>
|
|
378
379
|
|
|
379
380
|
<style lang="scss" scoped>
|
|
380
|
-
.fu-
|
|
381
|
+
.fu-form-item {
|
|
381
382
|
position: relative;
|
|
382
383
|
display: flex;
|
|
383
384
|
/* #ifdef APP-NVUE */
|
|
@@ -434,7 +435,7 @@
|
|
|
434
435
|
/* #endif */
|
|
435
436
|
}
|
|
436
437
|
|
|
437
|
-
& .fu-
|
|
438
|
+
& .fu-form-item__nuve-content {
|
|
438
439
|
display: flex;
|
|
439
440
|
flex-direction: column;
|
|
440
441
|
flex: 1;
|
|
@@ -478,7 +479,7 @@
|
|
|
478
479
|
&.is-direction-top {
|
|
479
480
|
flex-direction: column;
|
|
480
481
|
|
|
481
|
-
.fu-
|
|
482
|
+
.fu-form-item__label {
|
|
482
483
|
padding: 0 0 8px;
|
|
483
484
|
line-height: 1.5715;
|
|
484
485
|
text-align: left;
|
|
@@ -489,40 +490,37 @@
|
|
|
489
490
|
}
|
|
490
491
|
|
|
491
492
|
.is-required {
|
|
492
|
-
// color: $fu-color-error;
|
|
493
493
|
color: #dd524d;
|
|
494
494
|
font-weight: bold;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
|
|
498
498
|
|
|
499
|
-
.fu-
|
|
499
|
+
.fu-form-item--border {
|
|
500
500
|
margin-bottom: 0;
|
|
501
501
|
padding: 10px 0;
|
|
502
|
-
// padding-bottom: 0;
|
|
503
502
|
border-top: 1px #eee solid;
|
|
504
503
|
|
|
505
504
|
/* #ifndef APP-NVUE */
|
|
506
|
-
.fu-
|
|
505
|
+
.fu-form-item__content {
|
|
507
506
|
flex-direction: column;
|
|
508
507
|
justify-content: flex-start;
|
|
509
508
|
align-items: flex-start;
|
|
510
509
|
|
|
511
|
-
.fu-
|
|
510
|
+
.fu-form-item__error {
|
|
512
511
|
position: relative;
|
|
513
512
|
top: 5px;
|
|
514
513
|
left: 0;
|
|
515
514
|
padding-top: 0;
|
|
516
515
|
}
|
|
517
516
|
}
|
|
518
|
-
|
|
519
517
|
/* #endif */
|
|
520
518
|
|
|
521
519
|
/* #ifdef APP-NVUE */
|
|
522
520
|
display: flex;
|
|
523
521
|
flex-direction: column;
|
|
524
522
|
|
|
525
|
-
.fu-
|
|
523
|
+
.fu-form-item__error {
|
|
526
524
|
position: relative;
|
|
527
525
|
top: 0px;
|
|
528
526
|
left: 0;
|
|
@@ -531,7 +529,6 @@
|
|
|
531
529
|
}
|
|
532
530
|
|
|
533
531
|
/* #endif */
|
|
534
|
-
|
|
535
532
|
}
|
|
536
533
|
|
|
537
534
|
.is-first-border {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="fu-section" :class="customClass" :style="[customStyle]">
|
|
3
3
|
<view class="fu-section-header" @click="onClick">
|
|
4
|
-
<view class="fu-section-header__decoration" :class="
|
|
4
|
+
<view class="fu-section-header__decoration" :class="mode" v-if="mode" />
|
|
5
5
|
<slot v-else name="decoration"></slot>
|
|
6
6
|
|
|
7
7
|
<view class="fu-section-header__content">
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
/**
|
|
30
30
|
* Section 标题栏
|
|
31
31
|
* @description 标题栏
|
|
32
|
-
* @property {String}
|
|
32
|
+
* @property {String} mode = [line|circle|square] 标题装饰类型
|
|
33
33
|
* @value line 竖线
|
|
34
34
|
* @value circle 圆形
|
|
35
35
|
* @value square 正方形
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
* @property {String} subTitleColor 副标题字体颜色
|
|
42
42
|
* @property {String} customClass 自定义class
|
|
43
43
|
* @property {Object,String} customStyle 自定义样式
|
|
44
|
+
* @event {Function} click 点击标题栏触发
|
|
44
45
|
*/
|
|
45
46
|
export default {
|
|
46
47
|
name: 'FuSection',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
mode: {
|
|
4
4
|
type: String,
|
|
5
5
|
default: ''
|
|
6
6
|
},
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
titleColor: {
|
|
17
17
|
type: String,
|
|
18
|
-
default: '#
|
|
18
|
+
default: '#333333'
|
|
19
19
|
},
|
|
20
20
|
subTitle: {
|
|
21
21
|
type: String,
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
},
|
|
28
28
|
subTitleColor: {
|
|
29
29
|
type: String,
|
|
30
|
-
default: '#
|
|
30
|
+
default: '#999999'
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
* @property {Number} current 初始化时,默认显示第几项
|
|
103
103
|
* @property {String,Number} height 高度 (默认 125)
|
|
104
104
|
* @property {String} bgColor 背景色 (默认 #f2f3f4)
|
|
105
|
-
* @property {String}
|
|
105
|
+
* @property {String} nameKey 图片的属性名 (默认 image)
|
|
106
106
|
* @property {Boolean} showTitle = [true|false] 是否显示标题(默认 false)
|
|
107
107
|
* @property {String} keyTitle 标题的属性名
|
|
108
108
|
* @property {Object} titleStyle 自定义标题样式
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
methods: {
|
|
181
181
|
getItemType(e) {
|
|
182
182
|
if (typeof e === 'string') return this.$fu.isVideo(this.getSource(e)) ? 'video' : 'image'
|
|
183
|
-
if (typeof e === 'object' && this.
|
|
183
|
+
if (typeof e === 'object' && this.nameKey) {
|
|
184
184
|
if (!e.type) return this.$fu.isVideo(this.getSource(e)) ? 'video' : 'image'
|
|
185
185
|
if (e.type === 'image') return 'image'
|
|
186
186
|
if (e.type === 'video') return 'video'
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
|
|
191
191
|
getSource(e) {
|
|
192
192
|
if (typeof e === 'string') return e
|
|
193
|
-
if (typeof e === 'object' && this.
|
|
193
|
+
if (typeof e === 'object' && this.nameKey) return e[this.nameKey]
|
|
194
194
|
else this.$fu.error('请按格式传递列表参数')
|
|
195
195
|
return ''
|
|
196
196
|
},
|
|
@@ -26,6 +26,21 @@
|
|
|
26
26
|
<text :class="['fu-vtabs__bar-item--value', index == activeIndex && 'fu-vtabs__bar-item-active--value']" :style="[itemStyle(index),textStyle(index)]">{{item[keyName]}}</text>
|
|
27
27
|
<view class="fu-vtabs__bar-item--badge" :style="[$fu.addStyle(barItemBadgeStyle)]" v-if="!!(item.badge && (item.badge.show || item.badge.isDot || item.badge.value))">
|
|
28
28
|
<!-- 标记 -->
|
|
29
|
+
<fu-badge
|
|
30
|
+
:show="!!(item.badge && (item.badge.show || item.badge.isDot || item.badge.value))"
|
|
31
|
+
:isDot="item.badge && item.badge.isDot || propsBadge.isDot"
|
|
32
|
+
:value="item.badge && item.badge.value || propsBadge.value"
|
|
33
|
+
:max="item.badge && item.badge.max || propsBadge.max"
|
|
34
|
+
:type="item.badge && item.badge.type || propsBadge.type"
|
|
35
|
+
:showZero="item.badge && item.badge.showZero || propsBadge.showZero"
|
|
36
|
+
:bgColor="item.badge && item.badge.bgColor || propsBadge.bgColor"
|
|
37
|
+
:color="item.badge && item.badge.color || propsBadge.color"
|
|
38
|
+
:shape="item.badge && item.badge.shape || propsBadge.shape"
|
|
39
|
+
:numberType="item.badge && item.badge.numberType || propsBadge.numberType"
|
|
40
|
+
:offset="item.badge && item.badge.offset || propsBadge.offset"
|
|
41
|
+
:inverted="item.badge && item.badge.inverted || propsBadge.inverted"
|
|
42
|
+
:absolute="item.badge && item.badge.absolute || propsBadge.absolute"
|
|
43
|
+
></fu-badge>
|
|
29
44
|
</view>
|
|
30
45
|
</view>
|
|
31
46
|
</scroll-view>
|
|
@@ -62,6 +77,7 @@
|
|
|
62
77
|
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
63
78
|
import mixin from '../../libs/mixin/mixin.js'
|
|
64
79
|
import props from './props.js';
|
|
80
|
+
import fuBadgeProps from '../fu-badge/props.js'
|
|
65
81
|
// #ifdef APP-NVUE
|
|
66
82
|
const dom = uni.requireNativePlugin('dom')
|
|
67
83
|
// #endif
|
|
@@ -160,6 +176,9 @@
|
|
|
160
176
|
const style = {};
|
|
161
177
|
style.height = this.getHeight();
|
|
162
178
|
return style;
|
|
179
|
+
},
|
|
180
|
+
propsBadge() {
|
|
181
|
+
return fuBadgeProps
|
|
163
182
|
}
|
|
164
183
|
},
|
|
165
184
|
methods: {
|