@kengic/uni 0.5.1 → 0.5.2-beta.1
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/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
- package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
- package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
- package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
- package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
- package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
- package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
- package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
- package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
- package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
- package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
- package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
- package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
- package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
- package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
- package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
- package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
- package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
- package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
- package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
- package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
- package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
- package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
- package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
- package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
- package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
- package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
- package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
- package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
- package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
- package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
- package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
- package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
- package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
- package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
- package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
- package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
- package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
- package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
- package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
- package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
- package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
- package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
- package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
- package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
- package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
- package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
- package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
- package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
- package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
- package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
- package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
- package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
- package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
- package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
- package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
- package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
- package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
- package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
- package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
- package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
- package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
- package/dist/uni/uni-ui/uni-scss/package.json +73 -73
- package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
- package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
- package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
- package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
- package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
- package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
- package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
- package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
- package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
- package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
- package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
- package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
- package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
- package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
- package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
- package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
- package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
- package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
- package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
- package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
- package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
- package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
- package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
- package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
- package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
- package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
- package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
- package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
- package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
- package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
- package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
- package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
- package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
- package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
- package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
- package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
- package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
- package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
- package/package.json +1 -1
|
@@ -1,491 +1,515 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
2
|
+
<view class="uni-cursor-point">
|
|
3
|
+
<view
|
|
4
|
+
v-if="popMenu && (leftBottom || rightBottom || leftTop || rightTop) && content.length > 0"
|
|
5
|
+
:class="{
|
|
6
|
+
'uni-fab--leftBottom': leftBottom,
|
|
7
|
+
'uni-fab--rightBottom': rightBottom,
|
|
8
|
+
'uni-fab--leftTop': leftTop,
|
|
9
|
+
'uni-fab--rightTop': rightTop,
|
|
10
|
+
}"
|
|
11
|
+
class="uni-fab"
|
|
12
|
+
:style="nvueBottom"
|
|
13
|
+
>
|
|
14
|
+
<view
|
|
15
|
+
:class="{
|
|
16
|
+
'uni-fab__content--left': horizontal === 'left',
|
|
17
|
+
'uni-fab__content--right': horizontal === 'right',
|
|
18
|
+
'uni-fab__content--flexDirection': direction === 'vertical',
|
|
19
|
+
'uni-fab__content--flexDirectionStart': flexDirectionStart,
|
|
20
|
+
'uni-fab__content--flexDirectionEnd': flexDirectionEnd,
|
|
21
|
+
'uni-fab__content--other-platform': !isAndroidNvue,
|
|
22
|
+
}"
|
|
23
|
+
:style="{ width: boxWidth, height: boxHeight, backgroundColor: styles.backgroundColor }"
|
|
24
|
+
class="uni-fab__content"
|
|
25
|
+
elevation="5"
|
|
26
|
+
>
|
|
27
|
+
<view v-if="flexDirectionStart || horizontalLeft" class="uni-fab__item uni-fab__item--first" />
|
|
28
|
+
<view
|
|
29
|
+
v-for="(item, index) in content"
|
|
30
|
+
:key="index"
|
|
31
|
+
:class="{ 'uni-fab__item--active': isShow }"
|
|
32
|
+
class="uni-fab__item"
|
|
33
|
+
@click="_onItemClick(index, item)"
|
|
34
|
+
>
|
|
35
|
+
<image :src="item.active ? item.selectedIconPath : item.iconPath" class="uni-fab__item-image" mode="aspectFit" />
|
|
36
|
+
<text class="uni-fab__item-text" :style="{ color: item.active ? styles.selectedColor : styles.color }">{{ item.text }}</text>
|
|
37
|
+
</view>
|
|
38
|
+
<view v-if="flexDirectionEnd || horizontalRight" class="uni-fab__item uni-fab__item--first" />
|
|
39
|
+
</view>
|
|
40
|
+
</view>
|
|
41
|
+
<view
|
|
42
|
+
:class="{
|
|
43
|
+
'uni-fab__circle--leftBottom': leftBottom,
|
|
44
|
+
'uni-fab__circle--rightBottom': rightBottom,
|
|
45
|
+
'uni-fab__circle--leftTop': leftTop,
|
|
46
|
+
'uni-fab__circle--rightTop': rightTop,
|
|
47
|
+
'uni-fab__content--other-platform': !isAndroidNvue,
|
|
48
|
+
}"
|
|
49
|
+
class="uni-fab__circle uni-fab__plus"
|
|
50
|
+
:style="{ 'background-color': styles.buttonColor, bottom: nvueBottom }"
|
|
51
|
+
@click="_onClick"
|
|
52
|
+
>
|
|
53
|
+
<uni-icons
|
|
54
|
+
class="fab-circle-icon"
|
|
55
|
+
:type="styles.icon"
|
|
56
|
+
:color="styles.iconColor"
|
|
57
|
+
size="32"
|
|
58
|
+
:class="{ 'uni-fab__plus--active': isShow && content.length > 0 }"
|
|
59
|
+
></uni-icons>
|
|
60
|
+
<!-- <view class="fab-circle-v" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view>
|
|
41
61
|
<view class="fab-circle-h" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view> -->
|
|
42
|
-
|
|
43
|
-
|
|
62
|
+
</view>
|
|
63
|
+
</view>
|
|
44
64
|
</template>
|
|
45
65
|
|
|
46
66
|
<script>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
67
|
+
let platform = 'other';
|
|
68
|
+
// #ifdef APP-NVUE
|
|
69
|
+
platform = uni.getSystemInfoSync().platform;
|
|
70
|
+
// #endif
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Fab 悬浮按钮
|
|
74
|
+
* @description 点击可展开一个图形按钮菜单
|
|
75
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=144
|
|
76
|
+
* @property {Object} pattern 可选样式配置项
|
|
77
|
+
* @property {Object} horizontal = [left | right] 水平对齐方式
|
|
78
|
+
* @value left 左对齐
|
|
79
|
+
* @value right 右对齐
|
|
80
|
+
* @property {Object} vertical = [bottom | top] 垂直对齐方式
|
|
81
|
+
* @value bottom 下对齐
|
|
82
|
+
* @value top 上对齐
|
|
83
|
+
* @property {Object} direction = [horizontal | vertical] 展开菜单显示方式
|
|
84
|
+
* @value horizontal 水平显示
|
|
85
|
+
* @value vertical 垂直显示
|
|
86
|
+
* @property {Array} content 展开菜单内容配置项
|
|
87
|
+
* @property {Boolean} popMenu 是否使用弹出菜单
|
|
88
|
+
* @event {Function} trigger 展开菜单点击事件,返回点击信息
|
|
89
|
+
* @event {Function} fabClick 悬浮按钮点击事件
|
|
90
|
+
*/
|
|
91
|
+
export default {
|
|
92
|
+
name: 'UniFab',
|
|
93
|
+
emits: ['fabClick', 'trigger'],
|
|
94
|
+
props: {
|
|
95
|
+
pattern: {
|
|
96
|
+
type: Object,
|
|
97
|
+
default() {
|
|
98
|
+
return {};
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
horizontal: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: 'left',
|
|
104
|
+
},
|
|
105
|
+
vertical: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: 'bottom',
|
|
108
|
+
},
|
|
109
|
+
direction: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: 'horizontal',
|
|
112
|
+
},
|
|
113
|
+
content: {
|
|
114
|
+
type: Array,
|
|
115
|
+
default() {
|
|
116
|
+
return [];
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
show: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false,
|
|
122
|
+
},
|
|
123
|
+
popMenu: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: true,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
data() {
|
|
129
|
+
return {
|
|
130
|
+
fabShow: false,
|
|
131
|
+
isShow: false,
|
|
132
|
+
isAndroidNvue: platform === 'android',
|
|
133
|
+
styles: {
|
|
134
|
+
color: '#3c3e49',
|
|
135
|
+
selectedColor: '#007AFF',
|
|
136
|
+
backgroundColor: '#fff',
|
|
137
|
+
buttonColor: '#007AFF',
|
|
138
|
+
iconColor: '#fff',
|
|
139
|
+
icon: 'plusempty',
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
computed: {
|
|
144
|
+
contentWidth(e) {
|
|
145
|
+
return (this.content.length + 1) * 55 + 15 + 'px';
|
|
146
|
+
},
|
|
147
|
+
contentWidthMin() {
|
|
148
|
+
return '55px';
|
|
149
|
+
},
|
|
150
|
+
// 动态计算宽度
|
|
151
|
+
boxWidth() {
|
|
152
|
+
return this.getPosition(3, 'horizontal');
|
|
153
|
+
},
|
|
154
|
+
// 动态计算高度
|
|
155
|
+
boxHeight() {
|
|
156
|
+
return this.getPosition(3, 'vertical');
|
|
157
|
+
},
|
|
158
|
+
// 计算左下位置
|
|
159
|
+
leftBottom() {
|
|
160
|
+
return this.getPosition(0, 'left', 'bottom');
|
|
161
|
+
},
|
|
162
|
+
// 计算右下位置
|
|
163
|
+
rightBottom() {
|
|
164
|
+
return this.getPosition(0, 'right', 'bottom');
|
|
165
|
+
},
|
|
166
|
+
// 计算左上位置
|
|
167
|
+
leftTop() {
|
|
168
|
+
return this.getPosition(0, 'left', 'top');
|
|
169
|
+
},
|
|
170
|
+
rightTop() {
|
|
171
|
+
return this.getPosition(0, 'right', 'top');
|
|
172
|
+
},
|
|
173
|
+
flexDirectionStart() {
|
|
174
|
+
return this.getPosition(1, 'vertical', 'top');
|
|
175
|
+
},
|
|
176
|
+
flexDirectionEnd() {
|
|
177
|
+
return this.getPosition(1, 'vertical', 'bottom');
|
|
178
|
+
},
|
|
179
|
+
horizontalLeft() {
|
|
180
|
+
return this.getPosition(2, 'horizontal', 'left');
|
|
181
|
+
},
|
|
182
|
+
horizontalRight() {
|
|
183
|
+
return this.getPosition(2, 'horizontal', 'right');
|
|
184
|
+
},
|
|
185
|
+
// 计算 nvue bottom
|
|
186
|
+
nvueBottom() {
|
|
187
|
+
const safeBottom = uni.getSystemInfoSync().windowBottom;
|
|
188
|
+
// #ifdef APP-NVUE
|
|
189
|
+
return 30 + safeBottom;
|
|
190
|
+
// #endif
|
|
191
|
+
// #ifndef APP-NVUE
|
|
192
|
+
return 30;
|
|
193
|
+
// #endif
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
watch: {
|
|
197
|
+
pattern: {
|
|
198
|
+
handler(val, oldVal) {
|
|
199
|
+
this.styles = Object.assign({}, this.styles, val);
|
|
200
|
+
},
|
|
201
|
+
deep: true,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
created() {
|
|
205
|
+
this.isShow = this.show;
|
|
206
|
+
if (this.top === 0) {
|
|
207
|
+
this.fabShow = true;
|
|
208
|
+
}
|
|
209
|
+
// 初始化样式
|
|
210
|
+
this.styles = Object.assign({}, this.styles, this.pattern);
|
|
211
|
+
},
|
|
212
|
+
methods: {
|
|
213
|
+
_onClick() {
|
|
214
|
+
this.$emit('fabClick');
|
|
215
|
+
if (!this.popMenu) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
this.isShow = !this.isShow;
|
|
219
|
+
},
|
|
220
|
+
open() {
|
|
221
|
+
this.isShow = true;
|
|
222
|
+
},
|
|
223
|
+
close() {
|
|
224
|
+
this.isShow = false;
|
|
225
|
+
},
|
|
226
|
+
/**
|
|
227
|
+
* 按钮点击事件
|
|
228
|
+
*/
|
|
229
|
+
_onItemClick(index, item) {
|
|
230
|
+
if (!this.isShow) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this.$emit('trigger', {
|
|
234
|
+
index,
|
|
235
|
+
item,
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
/**
|
|
239
|
+
* 获取 位置信息
|
|
240
|
+
*/
|
|
241
|
+
getPosition(types, paramA, paramB) {
|
|
242
|
+
if (types === 0) {
|
|
243
|
+
return this.horizontal === paramA && this.vertical === paramB;
|
|
244
|
+
} else if (types === 1) {
|
|
245
|
+
return this.direction === paramA && this.vertical === paramB;
|
|
246
|
+
} else if (types === 2) {
|
|
247
|
+
return this.direction === paramA && this.horizontal === paramB;
|
|
248
|
+
} else {
|
|
249
|
+
return this.isShow && this.direction === paramA ? this.contentWidth : this.contentWidthMin;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
};
|
|
234
254
|
</script>
|
|
235
255
|
|
|
236
|
-
<style lang="scss"
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
256
|
+
<style lang="scss">
|
|
257
|
+
$uni-shadow-base: 0 1px 5px 2px
|
|
258
|
+
rgba(
|
|
259
|
+
$color: #000000,
|
|
260
|
+
$alpha: 0.3,
|
|
261
|
+
) !default;
|
|
262
|
+
|
|
263
|
+
.uni-fab {
|
|
264
|
+
position: fixed;
|
|
265
|
+
/* #ifndef APP-NVUE */
|
|
266
|
+
display: flex;
|
|
267
|
+
/* #endif */
|
|
268
|
+
justify-content: center;
|
|
269
|
+
align-items: center;
|
|
270
|
+
z-index: 10;
|
|
271
|
+
border-radius: 45px;
|
|
272
|
+
box-shadow: $uni-shadow-base;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.uni-cursor-point {
|
|
276
|
+
/* #ifdef H5 */
|
|
277
|
+
cursor: pointer;
|
|
278
|
+
/* #endif */
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.uni-fab--active {
|
|
282
|
+
opacity: 1;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.uni-fab--leftBottom {
|
|
286
|
+
left: 15px;
|
|
287
|
+
bottom: 30px;
|
|
288
|
+
/* #ifdef H5 */
|
|
289
|
+
left: calc(15px + var(--window-left));
|
|
290
|
+
bottom: calc(30px + var(--window-bottom));
|
|
291
|
+
/* #endif */
|
|
292
|
+
// padding: 10px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.uni-fab--leftTop {
|
|
296
|
+
left: 15px;
|
|
297
|
+
top: 30px;
|
|
298
|
+
/* #ifdef H5 */
|
|
299
|
+
left: calc(15px + var(--window-left));
|
|
300
|
+
top: calc(30px + var(--window-top));
|
|
301
|
+
/* #endif */
|
|
302
|
+
// padding: 10px;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.uni-fab--rightBottom {
|
|
306
|
+
right: 15px;
|
|
307
|
+
bottom: 30px;
|
|
308
|
+
/* #ifdef H5 */
|
|
309
|
+
right: calc(15px + var(--window-right));
|
|
310
|
+
bottom: calc(30px + var(--window-bottom));
|
|
311
|
+
/* #endif */
|
|
312
|
+
// padding: 10px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.uni-fab--rightTop {
|
|
316
|
+
right: 15px;
|
|
317
|
+
top: 30px;
|
|
318
|
+
/* #ifdef H5 */
|
|
319
|
+
right: calc(15px + var(--window-right));
|
|
320
|
+
top: calc(30px + var(--window-top));
|
|
321
|
+
/* #endif */
|
|
322
|
+
// padding: 10px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.uni-fab__circle {
|
|
326
|
+
position: fixed;
|
|
327
|
+
/* #ifndef APP-NVUE */
|
|
328
|
+
display: flex;
|
|
329
|
+
/* #endif */
|
|
330
|
+
justify-content: center;
|
|
331
|
+
align-items: center;
|
|
332
|
+
width: 55px;
|
|
333
|
+
height: 55px;
|
|
334
|
+
background-color: #3c3e49;
|
|
335
|
+
border-radius: 45px;
|
|
336
|
+
z-index: 11;
|
|
337
|
+
// box-shadow: $uni-shadow-base;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.uni-fab__circle--leftBottom {
|
|
341
|
+
left: 15px;
|
|
342
|
+
bottom: 30px;
|
|
343
|
+
/* #ifdef H5 */
|
|
344
|
+
left: calc(15px + var(--window-left));
|
|
345
|
+
bottom: calc(30px + var(--window-bottom));
|
|
346
|
+
/* #endif */
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.uni-fab__circle--leftTop {
|
|
350
|
+
left: 15px;
|
|
351
|
+
top: 30px;
|
|
352
|
+
/* #ifdef H5 */
|
|
353
|
+
left: calc(15px + var(--window-left));
|
|
354
|
+
top: calc(30px + var(--window-top));
|
|
355
|
+
/* #endif */
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.uni-fab__circle--rightBottom {
|
|
359
|
+
right: 15px;
|
|
360
|
+
bottom: 30px;
|
|
361
|
+
/* #ifdef H5 */
|
|
362
|
+
right: calc(15px + var(--window-right));
|
|
363
|
+
bottom: calc(30px + var(--window-bottom));
|
|
364
|
+
/* #endif */
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.uni-fab__circle--rightTop {
|
|
368
|
+
right: 15px;
|
|
369
|
+
top: 30px;
|
|
370
|
+
/* #ifdef H5 */
|
|
371
|
+
right: calc(15px + var(--window-right));
|
|
372
|
+
top: calc(30px + var(--window-top));
|
|
373
|
+
/* #endif */
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.uni-fab__circle--left {
|
|
377
|
+
left: 0;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.uni-fab__circle--right {
|
|
381
|
+
right: 0;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.uni-fab__circle--top {
|
|
385
|
+
top: 0;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.uni-fab__circle--bottom {
|
|
389
|
+
bottom: 0;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.uni-fab__plus {
|
|
393
|
+
font-weight: bold;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// .fab-circle-v {
|
|
397
|
+
// position: absolute;
|
|
398
|
+
// width: 2px;
|
|
399
|
+
// height: 24px;
|
|
400
|
+
// left: 0;
|
|
401
|
+
// top: 0;
|
|
402
|
+
// right: 0;
|
|
403
|
+
// bottom: 0;
|
|
404
|
+
// /* #ifndef APP-NVUE */
|
|
405
|
+
// margin: auto;
|
|
406
|
+
// /* #endif */
|
|
407
|
+
// background-color: white;
|
|
408
|
+
// transform: rotate(0deg);
|
|
409
|
+
// transition: transform 0.3s;
|
|
410
|
+
// }
|
|
411
|
+
|
|
412
|
+
// .fab-circle-h {
|
|
413
|
+
// position: absolute;
|
|
414
|
+
// width: 24px;
|
|
415
|
+
// height: 2px;
|
|
416
|
+
// left: 0;
|
|
417
|
+
// top: 0;
|
|
418
|
+
// right: 0;
|
|
419
|
+
// bottom: 0;
|
|
420
|
+
// /* #ifndef APP-NVUE */
|
|
421
|
+
// margin: auto;
|
|
422
|
+
// /* #endif */
|
|
423
|
+
// background-color: white;
|
|
424
|
+
// transform: rotate(0deg);
|
|
425
|
+
// transition: transform 0.3s;
|
|
426
|
+
// }
|
|
427
|
+
|
|
428
|
+
.fab-circle-icon {
|
|
429
|
+
transform: rotate(0deg);
|
|
430
|
+
transition: transform 0.3s;
|
|
431
|
+
font-weight: 200;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.uni-fab__plus--active {
|
|
435
|
+
transform: rotate(135deg);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.uni-fab__content {
|
|
439
|
+
/* #ifndef APP-NVUE */
|
|
440
|
+
box-sizing: border-box;
|
|
441
|
+
display: flex;
|
|
442
|
+
/* #endif */
|
|
443
|
+
flex-direction: row;
|
|
444
|
+
border-radius: 55px;
|
|
445
|
+
overflow: hidden;
|
|
446
|
+
transition-property: width, height;
|
|
447
|
+
transition-duration: 0.2s;
|
|
448
|
+
width: 55px;
|
|
449
|
+
border-color: #dddddd;
|
|
450
|
+
border-width: 1rpx;
|
|
451
|
+
border-style: solid;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.uni-fab__content--other-platform {
|
|
455
|
+
border-width: 0px;
|
|
456
|
+
box-shadow: $uni-shadow-base;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.uni-fab__content--left {
|
|
460
|
+
justify-content: flex-start;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.uni-fab__content--right {
|
|
464
|
+
justify-content: flex-end;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.uni-fab__content--flexDirection {
|
|
468
|
+
flex-direction: column;
|
|
469
|
+
justify-content: flex-end;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.uni-fab__content--flexDirectionStart {
|
|
473
|
+
flex-direction: column;
|
|
474
|
+
justify-content: flex-start;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.uni-fab__content--flexDirectionEnd {
|
|
478
|
+
flex-direction: column;
|
|
479
|
+
justify-content: flex-end;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.uni-fab__item {
|
|
483
|
+
/* #ifndef APP-NVUE */
|
|
484
|
+
display: flex;
|
|
485
|
+
/* #endif */
|
|
486
|
+
flex-direction: column;
|
|
487
|
+
justify-content: center;
|
|
488
|
+
align-items: center;
|
|
489
|
+
width: 55px;
|
|
490
|
+
height: 55px;
|
|
491
|
+
opacity: 0;
|
|
492
|
+
transition: opacity 0.2s;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.uni-fab__item--active {
|
|
496
|
+
opacity: 1;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.uni-fab__item-image {
|
|
500
|
+
width: 20px;
|
|
501
|
+
height: 20px;
|
|
502
|
+
margin-bottom: 4px;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.uni-fab__item-text {
|
|
506
|
+
color: #ffffff;
|
|
507
|
+
font-size: 12px;
|
|
508
|
+
line-height: 12px;
|
|
509
|
+
margin-top: 2px;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.uni-fab__item--first {
|
|
513
|
+
width: 55px;
|
|
514
|
+
}
|
|
491
515
|
</style>
|