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,7 +3,7 @@
|
|
|
3
3
|
<!-- 签名canvas -->
|
|
4
4
|
<view class="fu-sign-board__content">
|
|
5
5
|
<view class="fu-sign-board__content__wrapper">
|
|
6
|
-
<canvas class="fu-sign-board__content__canvas" :canvas-id="
|
|
6
|
+
<canvas class="fu-sign-board__content__canvas" :canvas-id="canvasId" :disableScroll="true" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd"></canvas>
|
|
7
7
|
</view>
|
|
8
8
|
</view>
|
|
9
9
|
|
|
@@ -40,9 +40,10 @@
|
|
|
40
40
|
/**
|
|
41
41
|
* @description SignBoard签名板
|
|
42
42
|
* @property {Boolean} show = [true|false] 是否显示(默认 false)
|
|
43
|
-
* @property {Array} signSelectColor
|
|
44
|
-
* @property {Boolean} rotate
|
|
45
|
-
* @property {String,Number} customBarHeight
|
|
43
|
+
* @property {Array} signSelectColor 可选签名颜色(默认 ['#060606', '#ec3930'])
|
|
44
|
+
* @property {Boolean} rotate 是否旋转输出图片(默认 true)
|
|
45
|
+
* @property {String,Number} customBarHeight 自定义顶栏的高度(默认 0)
|
|
46
|
+
*
|
|
46
47
|
* @event {Function} save 保存时触发
|
|
47
48
|
* @event {Function} close 关闭时触发
|
|
48
49
|
*/
|
|
@@ -51,8 +52,9 @@
|
|
|
51
52
|
emits: ['save', 'close'],
|
|
52
53
|
mixins: [mpMixin, mixin, props],
|
|
53
54
|
data() {
|
|
55
|
+
const canvasId = this.$fu.uuid();
|
|
54
56
|
return {
|
|
55
|
-
|
|
57
|
+
canvasId,
|
|
56
58
|
ctx: null,
|
|
57
59
|
canvasWidth: 0,
|
|
58
60
|
canvasHeight: 0,
|
|
@@ -94,7 +96,7 @@
|
|
|
94
96
|
},
|
|
95
97
|
created() {
|
|
96
98
|
// 创建canvas
|
|
97
|
-
this.ctx = uni.createCanvasContext(this.
|
|
99
|
+
this.ctx = uni.createCanvasContext(this.canvasId, this);
|
|
98
100
|
},
|
|
99
101
|
methods: {
|
|
100
102
|
// 获取画板的相关信息
|
|
@@ -120,17 +122,19 @@
|
|
|
120
122
|
this.ctx.fill()
|
|
121
123
|
this.ctx.draw()
|
|
122
124
|
},
|
|
125
|
+
|
|
123
126
|
// 开始画
|
|
124
127
|
onTouchStart(e) {
|
|
125
128
|
// #ifdef APP
|
|
126
129
|
if(e.type != 'onTouchstart') return false
|
|
127
130
|
// #endif
|
|
128
|
-
// #ifndef APP || MP-ALIPAY
|
|
129
|
-
if (e.type != 'touchstart') return false
|
|
130
|
-
// #endif
|
|
131
131
|
// #ifdef MP-ALIPAY
|
|
132
132
|
if(e.type != 'touchStart') return false
|
|
133
133
|
// #endif
|
|
134
|
+
// #ifndef APP || MP-ALIPAY
|
|
135
|
+
if (e.type != 'touchstart') return false
|
|
136
|
+
// #endif
|
|
137
|
+
|
|
134
138
|
// 设置线条颜色
|
|
135
139
|
this.ctx.setFillStyle(this.currentSelectColor)
|
|
136
140
|
// 设置透明度
|
|
@@ -160,17 +164,18 @@
|
|
|
160
164
|
|
|
161
165
|
this.pointToLine(currentLine)
|
|
162
166
|
},
|
|
167
|
+
|
|
163
168
|
// 正在画
|
|
164
169
|
onTouchMove(e) {
|
|
165
170
|
// #ifdef APP
|
|
166
171
|
if(e.type != 'onTouchmove') return false
|
|
167
172
|
// #endif
|
|
168
|
-
// #ifndef APP || MP-ALIPAY
|
|
169
|
-
if (e.type != 'touchmove') return false
|
|
170
|
-
// #endif
|
|
171
173
|
// #ifdef MP-ALIPAY
|
|
172
174
|
if(e.type != 'touchMove') return false
|
|
173
175
|
// #endif
|
|
176
|
+
// #ifndef APP || MP-ALIPAY
|
|
177
|
+
if (e.type != 'touchmove') return false
|
|
178
|
+
// #endif
|
|
174
179
|
if (e.cancelable) {
|
|
175
180
|
// 判断默认行为是否已经被禁用
|
|
176
181
|
if (!e.defaultPrevented) {
|
|
@@ -217,17 +222,18 @@
|
|
|
217
222
|
|
|
218
223
|
this.pointToLine(currentLine)
|
|
219
224
|
},
|
|
225
|
+
|
|
220
226
|
// 移动结束
|
|
221
227
|
onTouchEnd(e) {
|
|
222
228
|
// #ifdef APP
|
|
223
229
|
if(e.type != 'onTouchend') return false
|
|
224
230
|
// #endif
|
|
225
|
-
// #ifndef APP || MP-ALIPAY
|
|
226
|
-
if (e.type != 'touchend') return false
|
|
227
|
-
// #endif
|
|
228
231
|
// #ifdef MP-ALIPAY
|
|
229
232
|
if(e.type != 'touchEnd') return false
|
|
230
233
|
// #endif
|
|
234
|
+
// #ifndef APP || MP-ALIPAY
|
|
235
|
+
if (e.type != 'touchend') return false
|
|
236
|
+
// #endif
|
|
231
237
|
let point = {
|
|
232
238
|
x: e.changedTouches[0].x,
|
|
233
239
|
y: e.changedTouches[0].y
|
|
@@ -260,15 +266,17 @@
|
|
|
260
266
|
this.linePrack = linePrack;
|
|
261
267
|
this.currentLine = [];
|
|
262
268
|
},
|
|
269
|
+
|
|
263
270
|
// 重置绘画板
|
|
264
271
|
reDraw() {
|
|
265
272
|
this.initCanvas('#FFFFFF')
|
|
266
273
|
},
|
|
274
|
+
|
|
267
275
|
// 保存
|
|
268
276
|
save() {
|
|
269
277
|
// 在组件内使用需要第二个参数this
|
|
270
278
|
uni.canvasToTempFilePath({
|
|
271
|
-
canvasId: this.
|
|
279
|
+
canvasId: this.canvasId,
|
|
272
280
|
fileType: 'png',
|
|
273
281
|
quality: 1,
|
|
274
282
|
success: (res) => {
|
|
@@ -287,11 +295,12 @@
|
|
|
287
295
|
}
|
|
288
296
|
}, this)
|
|
289
297
|
},
|
|
298
|
+
|
|
290
299
|
// 预览图片
|
|
291
300
|
previewImage() {
|
|
292
301
|
// 在组件内使用需要第二个参数this
|
|
293
302
|
uni.canvasToTempFilePath({
|
|
294
|
-
canvasId: this.
|
|
303
|
+
canvasId: this.canvasId,
|
|
295
304
|
fileType: 'png',
|
|
296
305
|
quality: 1,
|
|
297
306
|
success: (res) => {
|
|
@@ -327,14 +336,17 @@
|
|
|
327
336
|
}
|
|
328
337
|
})
|
|
329
338
|
},
|
|
339
|
+
|
|
330
340
|
// 切换画笔颜色
|
|
331
341
|
colorSwitch(color) {
|
|
332
342
|
this.currentSelectColor = color;
|
|
333
343
|
},
|
|
344
|
+
|
|
334
345
|
// 绘制两点之间的线条
|
|
335
346
|
pointToLine(line) {
|
|
336
347
|
this.calcBethelLine(line)
|
|
337
348
|
},
|
|
349
|
+
|
|
338
350
|
// 计算插值,让线条更加圆滑
|
|
339
351
|
calcBethelLine(line) {
|
|
340
352
|
if (line.length <= 1) {
|
|
@@ -424,12 +436,14 @@
|
|
|
424
436
|
}
|
|
425
437
|
this.currentLine = line;
|
|
426
438
|
},
|
|
439
|
+
|
|
427
440
|
// 求两点之间的距离
|
|
428
441
|
distance(a, b) {
|
|
429
442
|
let x = b.x - a.x;
|
|
430
443
|
let y = b.y - a.y;
|
|
431
444
|
return Math.sqrt(x * x + y * y)
|
|
432
445
|
},
|
|
446
|
+
|
|
433
447
|
// 计算点信息
|
|
434
448
|
ctaCalc(x0, y0, r0, x1, y1, r1, x2, y2, r2) {
|
|
435
449
|
let a = [],
|
|
@@ -513,6 +527,7 @@
|
|
|
513
527
|
}
|
|
514
528
|
return a
|
|
515
529
|
},
|
|
530
|
+
|
|
516
531
|
// 绘制贝塞尔曲线
|
|
517
532
|
drawBethel(point, is_fill, color) {
|
|
518
533
|
this.ctx.beginPath()
|
|
@@ -534,6 +549,7 @@
|
|
|
534
549
|
}
|
|
535
550
|
this.ctx.draw(true)
|
|
536
551
|
},
|
|
552
|
+
|
|
537
553
|
// 旋转图片
|
|
538
554
|
async getRotateImage(dataUrl) {
|
|
539
555
|
// const url = await this.base64ToPath(dataUrl)
|
|
@@ -563,6 +579,7 @@
|
|
|
563
579
|
}, 50)
|
|
564
580
|
})
|
|
565
581
|
},
|
|
582
|
+
|
|
566
583
|
// 将base64转换为本地
|
|
567
584
|
base64ToPath(dataUrl) {
|
|
568
585
|
return new Promise((resolve, reject) => {
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 是否显示
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
4
7
|
show: {
|
|
5
8
|
type: Boolean,
|
|
6
9
|
default: false
|
|
7
10
|
},
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @description 可选签名颜色
|
|
13
|
+
*/
|
|
9
14
|
signSelectColor: {
|
|
10
15
|
type: Array,
|
|
11
|
-
default: () => (['#
|
|
16
|
+
default: () => (['#060606', '#ec3930'])
|
|
12
17
|
},
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @description 是否旋转输出图片
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
14
22
|
rotate: {
|
|
15
23
|
type: Boolean,
|
|
16
24
|
default: true
|
|
17
25
|
},
|
|
18
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @description 自定义顶栏的高度
|
|
28
|
+
*/
|
|
19
29
|
customBarHeight: {
|
|
20
30
|
type: [Number,String],
|
|
21
31
|
default: 0
|
|
@@ -73,18 +73,17 @@
|
|
|
73
73
|
// #endif
|
|
74
74
|
},
|
|
75
75
|
methods: {
|
|
76
|
-
|
|
77
|
-
* 初始化数据
|
|
78
|
-
*/
|
|
76
|
+
// 初始化数据
|
|
79
77
|
init() {
|
|
80
78
|
let elements = [];
|
|
81
|
-
if (!this.$fu.
|
|
79
|
+
if (!this.$fu.isArray(this.skeleton)) return this.$fu.error('skeleton参数必须为数组形式,参考文档示例:');
|
|
82
80
|
this.skeleton.forEach(item => {
|
|
83
81
|
const elClass = this.getElCounts(item);
|
|
84
82
|
elements = elements.concat(elClass);
|
|
85
83
|
})
|
|
86
84
|
this.elements = [...elements];
|
|
87
85
|
},
|
|
86
|
+
|
|
88
87
|
/**
|
|
89
88
|
* 处理骨架屏参数内容
|
|
90
89
|
* @param {Object} e 每项数据
|
|
@@ -92,11 +91,11 @@
|
|
|
92
91
|
getElCounts(e) {
|
|
93
92
|
let elements = [];
|
|
94
93
|
let children = [];
|
|
95
|
-
if (this.$fu.
|
|
94
|
+
if (this.$fu.checkNumber(e)) return [{ type: 'gap', height: e }];
|
|
96
95
|
const type = e.type || 'line';
|
|
97
96
|
const num = e.num || 1;
|
|
98
97
|
const style = e.style || {};
|
|
99
|
-
const styleIsArray = this.$fu.
|
|
98
|
+
const styleIsArray = this.$fu.isArray(style);
|
|
100
99
|
const gap = e.gap || '20rpx';
|
|
101
100
|
const child = e.children || [];
|
|
102
101
|
for (let i = 0; i < child.length; i++) {
|
|
@@ -123,9 +122,8 @@
|
|
|
123
122
|
}
|
|
124
123
|
return elements;
|
|
125
124
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*/
|
|
125
|
+
|
|
126
|
+
// 创建动画
|
|
129
127
|
createAnimation(opacity = 1) {
|
|
130
128
|
// loading结束之后或未开启动画不执行
|
|
131
129
|
if (!this.loading || !this.animate) return;
|
|
@@ -151,8 +149,7 @@
|
|
|
151
149
|
}
|
|
152
150
|
</script>
|
|
153
151
|
<style lang="scss" scoped>
|
|
154
|
-
@import '../../libs/
|
|
155
|
-
|
|
152
|
+
@import '../../libs/style/components.scss';
|
|
156
153
|
$avatar: 100rpx;
|
|
157
154
|
$avatarSm: 50rpx;
|
|
158
155
|
$avatarLg: 200rpx;
|
|
@@ -237,6 +234,5 @@
|
|
|
237
234
|
background-position: 0 50%
|
|
238
235
|
}
|
|
239
236
|
}
|
|
240
|
-
|
|
241
237
|
/* #endif */
|
|
242
238
|
</style>
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 是否显示骨架
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
4
7
|
loading: {
|
|
5
8
|
type: Boolean,
|
|
6
9
|
default: true
|
|
7
10
|
},
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @description 骨架内容 具体说明参考文档:
|
|
13
|
+
*/
|
|
9
14
|
skeleton: {
|
|
10
15
|
type: Array,
|
|
11
16
|
default: () => []
|
|
12
17
|
},
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @description 是否开启动画效果
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
14
22
|
animate: {
|
|
15
23
|
type: Boolean,
|
|
16
24
|
default: true
|
|
17
25
|
},
|
|
18
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @description 是否圆角骨架风格
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
19
30
|
round: {
|
|
20
31
|
type: Boolean,
|
|
21
32
|
default: false
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* @property {String} activeIcon 激活状态的图标
|
|
21
21
|
* @property {String} inactiveIcon 未激活状态图标
|
|
22
22
|
* @property {Boolean} dot 是否显示点类型 (默认 false )
|
|
23
|
+
*
|
|
23
24
|
* @example <fu-steps current="0"><fu-steps-item title="已出库" desc="10:35" ></fu-steps-item></fu-steps>
|
|
24
25
|
*/
|
|
25
26
|
export default {
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
updateChildData() {
|
|
44
45
|
this.children.map(child => {
|
|
45
46
|
// 先判断子组件是否存在对应的方法
|
|
46
|
-
this.$fu.
|
|
47
|
+
this.$fu.isFunc((child || {}).updateFromParent()) && child.updateFromParent()
|
|
47
48
|
})
|
|
48
49
|
},
|
|
49
50
|
// 接受子组件的通知,去修改其他子组件的数据
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
</script>
|
|
64
65
|
|
|
65
66
|
<style lang="scss" scoped>
|
|
66
|
-
@import '../../libs/
|
|
67
|
+
@import '../../libs/style/components.scss';
|
|
67
68
|
|
|
68
69
|
.fu-steps {
|
|
69
70
|
@include flex;
|
|
@@ -1,36 +1,52 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 排列方向
|
|
5
|
+
* @values 'row' - 横向, 'column' - 竖向
|
|
6
|
+
* @default 'row'
|
|
7
|
+
*/
|
|
4
8
|
direction: {
|
|
5
9
|
type: String,
|
|
6
10
|
default: 'row'
|
|
7
11
|
},
|
|
8
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @description 设置第几个步骤
|
|
14
|
+
*/
|
|
9
15
|
current: {
|
|
10
16
|
type: [String, Number],
|
|
11
17
|
default: 0
|
|
12
18
|
},
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @description 激活状态颜色
|
|
21
|
+
*/
|
|
14
22
|
activeColor: {
|
|
15
23
|
type: String,
|
|
16
24
|
default: '#2979ff'
|
|
17
25
|
},
|
|
18
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @description 未激活状态颜色
|
|
28
|
+
*/
|
|
19
29
|
inactiveColor: {
|
|
20
30
|
type: String,
|
|
21
31
|
default: '#969799'
|
|
22
32
|
},
|
|
23
|
-
|
|
33
|
+
/**
|
|
34
|
+
* @description 激活状态的图标
|
|
35
|
+
*/
|
|
24
36
|
activeIcon: {
|
|
25
37
|
type: String,
|
|
26
38
|
default: ''
|
|
27
39
|
},
|
|
28
|
-
|
|
40
|
+
/**
|
|
41
|
+
* @description 未激活状态图标
|
|
42
|
+
*/
|
|
29
43
|
inactiveIcon: {
|
|
30
44
|
type: String,
|
|
31
45
|
default: ''
|
|
32
46
|
},
|
|
33
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @description 是否显示点类型
|
|
49
|
+
*/
|
|
34
50
|
dot: {
|
|
35
51
|
type: Boolean,
|
|
36
52
|
default: false
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
<slot name="icon">
|
|
10
10
|
<view class="fu-steps-item__wrapper__dot" v-if="parentData.dot" :style="{ backgroundColor: statusColor }"></view>
|
|
11
11
|
<view class="fu-steps-item__wrapper__icon" v-else-if="parentData.activeIcon || parentData.inactiveIcon">
|
|
12
|
-
<fu-
|
|
12
|
+
<fu-icon :name="index <= parentData.current ? parentData.activeIcon : parentData.inactiveIcon" :size="iconSize" :color="index <= parentData.current ? parentData.activeColor : parentData.inactiveColor" />
|
|
13
13
|
</view>
|
|
14
14
|
<view class="fu-steps-item__wrapper__circle" :style="{ backgroundColor: statusClass === 'process' ? parentData.activeColor : 'transparent', borderColor: statusColor }" v-else>
|
|
15
15
|
<text class="fu-steps-item__wrapper__circle__text" :style="{ color: index == parentData.current ? '#ffffff' : parentData.inactiveColor }" v-if="statusClass === 'process' || statusClass === 'wait'">{{ index + 1}}</text>
|
|
16
|
-
<fu-
|
|
16
|
+
<fu-icon :name="statusClass === 'error' ? 'cancel' : 'select'" size="12" :color="statusClass === 'error' ? '#f76c6c' : parentData.activeColor" v-else />
|
|
17
17
|
</view>
|
|
18
18
|
</slot>
|
|
19
19
|
</view>
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
</script>
|
|
158
158
|
|
|
159
159
|
<style lang="scss" scoped>
|
|
160
|
-
@import '../../libs/
|
|
160
|
+
@import '../../libs/style/components.scss';
|
|
161
161
|
|
|
162
162
|
$fu-tips-color: #a7a8aa !default;
|
|
163
163
|
$fu-content-color: #77797e !default;
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 标题
|
|
5
|
+
*/
|
|
4
6
|
title: {
|
|
5
7
|
type: [String, Number],
|
|
6
8
|
default: ''
|
|
7
9
|
},
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @description 描述文本
|
|
12
|
+
*/
|
|
9
13
|
desc: {
|
|
10
14
|
type: [String, Number],
|
|
11
15
|
default: ''
|
|
12
16
|
},
|
|
13
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @description 图标大小
|
|
19
|
+
* @default 18
|
|
20
|
+
*/
|
|
14
21
|
iconSize: {
|
|
15
22
|
type: [String, Number],
|
|
16
|
-
default:
|
|
23
|
+
default: 18
|
|
17
24
|
},
|
|
18
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @description 当前步骤是否处于失败状态
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
19
29
|
error: {
|
|
20
30
|
type: Boolean,
|
|
21
31
|
default: false
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
* @property {String,Number} offsetTop 吸顶时与顶部的距离,单位px(默认 0 )
|
|
17
17
|
* @property {String,Number} customNavHeight 自定义导航栏的高度 (h5 默认44 其他默认 0 )
|
|
18
18
|
* @property {Boolean} disabled = [true|false] 是否禁用吸顶功能 (默认 false )
|
|
19
|
-
* @property {String} bgColor
|
|
20
|
-
* @property {String,Number} zIndex 吸顶时的z-index值(默认
|
|
19
|
+
* @property {String} bgColor 背景颜色
|
|
20
|
+
* @property {String,Number} zIndex 吸顶时的z-index值(默认 99)
|
|
21
21
|
* @property {String,Number} index 自定义标识,用于区分是哪一个组件(默认 0)
|
|
22
22
|
* @property {String} customClass 自定义外部样式类
|
|
23
23
|
* @property {Object,String} customStyle 自定义外部的样式
|
|
24
|
+
*
|
|
24
25
|
* @example <fu-sticky offsetTop="200"><view>此处吸顶</view></fu-sticky>
|
|
25
26
|
*/
|
|
26
27
|
export default {
|
|
@@ -139,7 +140,6 @@
|
|
|
139
140
|
setFixed(top) {
|
|
140
141
|
// 判断是否出于吸顶条件范围
|
|
141
142
|
const fixed = top <= this.stickyTop;
|
|
142
|
-
console.log(fixed);
|
|
143
143
|
this.fixed = fixed;
|
|
144
144
|
},
|
|
145
145
|
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
|
|
5
|
+
*/
|
|
4
6
|
offsetTop: {
|
|
5
7
|
type: [String, Number],
|
|
6
8
|
default: 0
|
|
7
9
|
},
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @description 自定义导航栏的高度
|
|
12
|
+
*/
|
|
9
13
|
customNavHeight: {
|
|
10
14
|
type: [String, Number],
|
|
11
15
|
// #ifdef H5
|
|
@@ -16,22 +20,32 @@ export default {
|
|
|
16
20
|
default: 0
|
|
17
21
|
// #endif
|
|
18
22
|
},
|
|
19
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @description 是否禁用吸顶功能
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
20
27
|
disabled: {
|
|
21
28
|
type: Boolean,
|
|
22
29
|
default: false
|
|
23
30
|
},
|
|
24
|
-
|
|
31
|
+
/**
|
|
32
|
+
* @description 吸顶区域的背景颜色
|
|
33
|
+
*/
|
|
25
34
|
bgColor: {
|
|
26
35
|
type: String,
|
|
27
36
|
default: ''
|
|
28
37
|
},
|
|
29
|
-
|
|
38
|
+
/**
|
|
39
|
+
* @description z-index值
|
|
40
|
+
* @default 99
|
|
41
|
+
*/
|
|
30
42
|
zIndex: {
|
|
31
43
|
type: [String, Number],
|
|
32
|
-
default:
|
|
44
|
+
default: 99
|
|
33
45
|
},
|
|
34
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @description 列表中的索引值
|
|
48
|
+
*/
|
|
35
49
|
index: {
|
|
36
50
|
type: [String, Number],
|
|
37
51
|
default: 0
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view ref="fu-subsection" class="fu-subsection" :class="[`fu-subsection--${mode}`]" :style="[$fu.addStyle(this.customStyle), wrapperStyle]">
|
|
3
|
-
<view
|
|
3
|
+
<view
|
|
4
|
+
ref="fu-subsection__bar"
|
|
5
|
+
class="fu-subsection__bar"
|
|
6
|
+
:style="[barStyle]"
|
|
4
7
|
:class="[
|
|
5
8
|
mode === 'button' && 'fu-subsection--button__bar',
|
|
6
9
|
current === 0 && mode === 'subsection' && 'fu-subsection__bar--first',
|
|
7
10
|
current > 0 && current < list.length - 1 && mode === 'subsection' && 'fu-subsection__bar--center',
|
|
8
11
|
current === list.length - 1 && mode === 'subsection' && 'fu-subsection__bar--last'
|
|
9
12
|
]"></view>
|
|
10
|
-
<view
|
|
13
|
+
<view
|
|
14
|
+
:ref="`fu-subsection__item--${index}`"
|
|
15
|
+
class="fu-subsection__item"
|
|
11
16
|
:class="[
|
|
12
17
|
`fu-subsection__item--${index}`,
|
|
13
18
|
index < list.length - 1 && 'fu-subsection__item--no-border-right',
|
|
14
19
|
index === 0 && 'fu-subsection__item--first',
|
|
15
20
|
index === list.length - 1 && 'fu-subsection__item--last'
|
|
16
|
-
]" :style="[itemStyle(index)]" v-for="(item, index) in list" :key="index" @tap="
|
|
21
|
+
]" :style="[itemStyle(index)]" v-for="(item, index) in list" :key="index" @tap="handleClick(index)">
|
|
17
22
|
<text class="fu-subsection__item__text" :style="[textStyle(index)]">{{ getText(item) }}</text>
|
|
18
23
|
</view>
|
|
19
24
|
</view>
|
|
@@ -44,6 +49,7 @@
|
|
|
44
49
|
* @property {String,Object} customStyle 定义需要用到的外部样式
|
|
45
50
|
* @property {String,Object} customItemStyle 自定义选项样式
|
|
46
51
|
* @property {String} keyName 从`list`元素对象中读取的键名(默认 'name' )
|
|
52
|
+
*
|
|
47
53
|
* @event {Function} change 分段器选项发生改变时触发 回调 index:选项的index索引值,从0开始
|
|
48
54
|
* @example <fu-subsection :list="list" :current="current" @change="sectionChange"></fu-subsection>
|
|
49
55
|
*/
|
|
@@ -152,7 +158,7 @@
|
|
|
152
158
|
// #endif
|
|
153
159
|
},
|
|
154
160
|
|
|
155
|
-
|
|
161
|
+
handleClick(index) {
|
|
156
162
|
this.$emit("change", index);
|
|
157
163
|
}
|
|
158
164
|
},
|
|
@@ -188,21 +194,24 @@
|
|
|
188
194
|
</script>
|
|
189
195
|
|
|
190
196
|
<style lang="scss" scoped>
|
|
197
|
+
@import '../../libs/style/components.scss';
|
|
198
|
+
$padding: 3px;
|
|
199
|
+
$border-radius: 3px;
|
|
200
|
+
|
|
191
201
|
.fu-subsection {
|
|
192
|
-
|
|
193
|
-
flex-direction: row;
|
|
202
|
+
@include flex(row);
|
|
194
203
|
position: relative;
|
|
195
|
-
overflow: hidden;
|
|
196
204
|
/* #ifndef APP-NVUE */
|
|
197
205
|
width: 100%;
|
|
198
206
|
box-sizing: border-box;
|
|
207
|
+
overflow: hidden;
|
|
199
208
|
/* #endif */
|
|
200
209
|
|
|
201
210
|
&--button {
|
|
202
211
|
height: 32px;
|
|
203
212
|
background-color: rgb(238, 238, 239);
|
|
204
|
-
padding:
|
|
205
|
-
border-radius:
|
|
213
|
+
padding: $padding;
|
|
214
|
+
border-radius: $border-radius;
|
|
206
215
|
align-items: stretch;
|
|
207
216
|
|
|
208
217
|
&__bar {
|
|
@@ -223,8 +232,8 @@
|
|
|
223
232
|
/* #endif */
|
|
224
233
|
|
|
225
234
|
&--first {
|
|
226
|
-
border-top-left-radius:
|
|
227
|
-
border-bottom-left-radius:
|
|
235
|
+
border-top-left-radius: $border-radius;
|
|
236
|
+
border-bottom-left-radius: $border-radius;
|
|
228
237
|
border-top-right-radius: 0px;
|
|
229
238
|
border-bottom-right-radius: 0px;
|
|
230
239
|
}
|
|
@@ -239,17 +248,16 @@
|
|
|
239
248
|
&--last {
|
|
240
249
|
border-top-left-radius: 0px;
|
|
241
250
|
border-bottom-left-radius: 0px;
|
|
242
|
-
border-top-right-radius:
|
|
243
|
-
border-bottom-right-radius:
|
|
251
|
+
border-top-right-radius: $border-radius;
|
|
252
|
+
border-bottom-right-radius: $border-radius;
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
255
|
|
|
247
256
|
&__item {
|
|
248
|
-
|
|
249
|
-
flex-direction: row;
|
|
250
|
-
flex: 1;
|
|
257
|
+
@include flex(row);
|
|
251
258
|
justify-content: center;
|
|
252
259
|
align-items: center;
|
|
260
|
+
flex: 1;
|
|
253
261
|
// vue环境下,需要设置相对定位,因为滑块为绝对定位,item需要在滑块的上面
|
|
254
262
|
position: relative;
|
|
255
263
|
|
|
@@ -258,20 +266,19 @@
|
|
|
258
266
|
}
|
|
259
267
|
|
|
260
268
|
&--first {
|
|
261
|
-
border-top-left-radius:
|
|
262
|
-
border-bottom-left-radius:
|
|
269
|
+
border-top-left-radius: $border-radius;
|
|
270
|
+
border-bottom-left-radius: $border-radius;
|
|
263
271
|
}
|
|
264
272
|
|
|
265
273
|
&--last {
|
|
266
|
-
border-top-right-radius:
|
|
267
|
-
border-bottom-right-radius:
|
|
274
|
+
border-top-right-radius: $border-radius;
|
|
275
|
+
border-bottom-right-radius: $border-radius;
|
|
268
276
|
}
|
|
269
277
|
|
|
270
278
|
&__text {
|
|
279
|
+
@include flex(row);
|
|
271
280
|
font-size: 12px;
|
|
272
281
|
line-height: 12px;
|
|
273
|
-
display: flex;
|
|
274
|
-
flex-direction: row;
|
|
275
282
|
align-items: center;
|
|
276
283
|
transition-property: color;
|
|
277
284
|
transition-duration: 0.3s;
|