@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,4 +1,4 @@
|
|
|
1
|
-
let bindIngXMixins = {}
|
|
1
|
+
let bindIngXMixins = {};
|
|
2
2
|
|
|
3
3
|
// #ifdef APP-NVUE
|
|
4
4
|
const BindingX = uni.requireNativePlugin('bindingx');
|
|
@@ -6,297 +6,291 @@ const dom = uni.requireNativePlugin('dom');
|
|
|
6
6
|
const animation = uni.requireNativePlugin('animation');
|
|
7
7
|
|
|
8
8
|
bindIngXMixins = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
data() {
|
|
10
|
+
return {};
|
|
11
|
+
},
|
|
12
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
13
|
+
watch: {
|
|
14
|
+
show(newVal) {
|
|
15
|
+
if (this.autoClose) return;
|
|
16
|
+
if (this.stop) return;
|
|
17
|
+
this.stop = true;
|
|
18
|
+
if (newVal) {
|
|
19
|
+
this.open(newVal);
|
|
20
|
+
} else {
|
|
21
|
+
this.close();
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
leftOptions() {
|
|
25
|
+
this.getSelectorQuery();
|
|
26
|
+
this.init();
|
|
27
|
+
},
|
|
28
|
+
rightOptions(newVal) {
|
|
29
|
+
this.init();
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
created() {
|
|
33
|
+
this.swipeaction = this.getSwipeAction();
|
|
34
|
+
if (this.swipeaction && Array.isArray(this.swipeaction.children)) {
|
|
35
|
+
this.swipeaction.children.push(this);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
mounted() {
|
|
39
|
+
this.box = this.getEl(this.$refs['selector-box--hock']);
|
|
40
|
+
this.selector = this.getEl(this.$refs['selector-content--hock']);
|
|
41
|
+
this.leftButton = this.getEl(this.$refs['selector-left-button--hock']);
|
|
42
|
+
this.rightButton = this.getEl(this.$refs['selector-right-button--hock']);
|
|
43
|
+
this.init();
|
|
44
|
+
},
|
|
45
|
+
// beforeDestroy() {
|
|
46
|
+
// this.swipeaction.children.forEach((item, index) => {
|
|
47
|
+
// if (item === this) {
|
|
48
|
+
// this.swipeaction.children.splice(index, 1)
|
|
49
|
+
// }
|
|
50
|
+
// })
|
|
51
|
+
// },
|
|
52
|
+
methods: {
|
|
53
|
+
init() {
|
|
54
|
+
this.$nextTick(() => {
|
|
55
|
+
this.x = 0;
|
|
56
|
+
this.button = {
|
|
57
|
+
show: false,
|
|
58
|
+
};
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
this.getSelectorQuery();
|
|
61
|
+
}, 200);
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
onClick(index, item, position) {
|
|
65
|
+
this.$emit('click', {
|
|
66
|
+
content: item,
|
|
67
|
+
index,
|
|
68
|
+
position,
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
touchstart(e) {
|
|
72
|
+
// fix by mehaotian 禁止滑动
|
|
73
|
+
if (this.disabled) return;
|
|
74
|
+
// 每次只触发一次,避免多次监听造成闪烁
|
|
75
|
+
if (this.stop) return;
|
|
76
|
+
this.stop = true;
|
|
77
|
+
if (this.autoClose && this.swipeaction) {
|
|
78
|
+
this.swipeaction.closeOther(this);
|
|
79
|
+
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
const leftWidth = this.button.left.width;
|
|
82
|
+
const rightWidth = this.button.right.width;
|
|
83
|
+
let expression = this.range(this.x, -rightWidth, leftWidth);
|
|
84
|
+
let leftExpression = this.range(this.x - leftWidth, -leftWidth, 0);
|
|
85
|
+
let rightExpression = this.range(this.x + rightWidth, 0, rightWidth);
|
|
86
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
|
-
|
|
87
|
+
this.eventpan = BindingX.bind(
|
|
88
|
+
{
|
|
89
|
+
anchor: this.box,
|
|
90
|
+
eventType: 'pan',
|
|
91
|
+
props: [
|
|
92
|
+
{
|
|
93
|
+
element: this.selector,
|
|
94
|
+
property: 'transform.translateX',
|
|
95
|
+
expression,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
element: this.leftButton,
|
|
99
|
+
property: 'transform.translateX',
|
|
100
|
+
expression: leftExpression,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
element: this.rightButton,
|
|
104
|
+
property: 'transform.translateX',
|
|
105
|
+
expression: rightExpression,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
(e) => {
|
|
110
|
+
// nope
|
|
111
|
+
if (e.state === 'end') {
|
|
112
|
+
this.x = e.deltaX + this.x;
|
|
113
|
+
this.isclick = true;
|
|
114
|
+
this.bindTiming(e.deltaX);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
touchend(e) {
|
|
120
|
+
if (this.isopen !== 'none' && !this.isclick) {
|
|
121
|
+
this.open('none');
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
bindTiming(x) {
|
|
125
|
+
const left = this.x;
|
|
126
|
+
const leftWidth = this.button.left.width;
|
|
127
|
+
const rightWidth = this.button.right.width;
|
|
128
|
+
const threshold = this.threshold;
|
|
129
|
+
if (!this.isopen || this.isopen === 'none') {
|
|
130
|
+
if (left > threshold) {
|
|
131
|
+
this.open('left');
|
|
132
|
+
} else if (left < -threshold) {
|
|
133
|
+
this.open('right');
|
|
134
|
+
} else {
|
|
135
|
+
this.open('none');
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
if ((x > -leftWidth && x < 0) || x > rightWidth) {
|
|
139
|
+
if ((x > -threshold && x < 0) || x - rightWidth > threshold) {
|
|
140
|
+
this.open('left');
|
|
141
|
+
} else {
|
|
142
|
+
this.open('none');
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
if ((x < threshold && x > 0) || x + leftWidth < -threshold) {
|
|
146
|
+
this.open('right');
|
|
147
|
+
} else {
|
|
148
|
+
this.open('none');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
146
153
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
/**
|
|
155
|
+
* 移动范围
|
|
156
|
+
* @param {Object} num
|
|
157
|
+
* @param {Object} mix
|
|
158
|
+
* @param {Object} max
|
|
159
|
+
*/
|
|
160
|
+
range(num, mix, max) {
|
|
161
|
+
return `min(max(x+${num}, ${mix}), ${max})`;
|
|
162
|
+
},
|
|
156
163
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
/**
|
|
165
|
+
* 开启swipe
|
|
166
|
+
*/
|
|
167
|
+
open(type) {
|
|
168
|
+
this.animation(type);
|
|
169
|
+
},
|
|
163
170
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
/**
|
|
172
|
+
* 关闭swipe
|
|
173
|
+
*/
|
|
174
|
+
close() {
|
|
175
|
+
this.animation('none');
|
|
176
|
+
},
|
|
170
177
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
178
|
+
/**
|
|
179
|
+
* 开启关闭动画
|
|
180
|
+
* @param {Object} type
|
|
181
|
+
*/
|
|
182
|
+
animation(type) {
|
|
183
|
+
const time = 300;
|
|
184
|
+
const leftWidth = this.button.left.width;
|
|
185
|
+
const rightWidth = this.button.right.width;
|
|
186
|
+
if (this.eventpan && this.eventpan.token) {
|
|
187
|
+
BindingX.unbind({
|
|
188
|
+
token: this.eventpan.token,
|
|
189
|
+
eventType: 'pan',
|
|
190
|
+
});
|
|
191
|
+
}
|
|
185
192
|
|
|
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
|
-
|
|
193
|
+
switch (type) {
|
|
194
|
+
case 'left':
|
|
195
|
+
Promise.all([this.move(this.selector, leftWidth), this.move(this.leftButton, 0), this.move(this.rightButton, rightWidth * 2)]).then(() => {
|
|
196
|
+
this.setEmit(leftWidth, type);
|
|
197
|
+
});
|
|
198
|
+
break;
|
|
199
|
+
case 'right':
|
|
200
|
+
Promise.all([this.move(this.selector, -rightWidth), this.move(this.leftButton, -leftWidth * 2), this.move(this.rightButton, 0)]).then(
|
|
201
|
+
() => {
|
|
202
|
+
this.setEmit(-rightWidth, type);
|
|
203
|
+
},
|
|
204
|
+
);
|
|
205
|
+
break;
|
|
206
|
+
default:
|
|
207
|
+
Promise.all([this.move(this.selector, 0), this.move(this.leftButton, -leftWidth), this.move(this.rightButton, rightWidth)]).then(() => {
|
|
208
|
+
this.setEmit(0, type);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
setEmit(x, type) {
|
|
213
|
+
const leftWidth = this.button.left.width;
|
|
214
|
+
const rightWidth = this.button.right.width;
|
|
215
|
+
this.isopen = this.isopen || 'none';
|
|
216
|
+
this.stop = false;
|
|
217
|
+
this.isclick = false;
|
|
218
|
+
// 只有状态不一致才会返回结果
|
|
219
|
+
if (this.isopen !== type && this.x !== x) {
|
|
220
|
+
if (type === 'left' && leftWidth > 0) {
|
|
221
|
+
this.$emit('change', 'left');
|
|
222
|
+
}
|
|
223
|
+
if (type === 'right' && rightWidth > 0) {
|
|
224
|
+
this.$emit('change', 'right');
|
|
225
|
+
}
|
|
226
|
+
if (type === 'none') {
|
|
227
|
+
this.$emit('change', 'none');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
this.x = x;
|
|
231
|
+
this.isopen = type;
|
|
232
|
+
},
|
|
233
|
+
move(ref, value) {
|
|
234
|
+
return new Promise((resolve, reject) => {
|
|
235
|
+
animation.transition(
|
|
236
|
+
ref,
|
|
237
|
+
{
|
|
238
|
+
styles: {
|
|
239
|
+
transform: `translateX(${value})`,
|
|
240
|
+
},
|
|
241
|
+
duration: 150, //ms
|
|
242
|
+
timingFunction: 'linear',
|
|
243
|
+
needLayout: false,
|
|
244
|
+
delay: 0, //ms
|
|
245
|
+
},
|
|
246
|
+
function (res) {
|
|
247
|
+
resolve(res);
|
|
248
|
+
},
|
|
249
|
+
);
|
|
250
|
+
});
|
|
251
|
+
},
|
|
213
252
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
this.x = x
|
|
235
|
-
this.isopen = type
|
|
236
|
-
},
|
|
237
|
-
move(ref, value) {
|
|
238
|
-
return new Promise((resolve, reject) => {
|
|
239
|
-
animation.transition(ref, {
|
|
240
|
-
styles: {
|
|
241
|
-
transform: `translateX(${value})`,
|
|
242
|
-
},
|
|
243
|
-
duration: 150, //ms
|
|
244
|
-
timingFunction: 'linear',
|
|
245
|
-
needLayout: false,
|
|
246
|
-
delay: 0 //ms
|
|
247
|
-
}, function(res) {
|
|
248
|
-
resolve(res)
|
|
249
|
-
})
|
|
250
|
-
})
|
|
253
|
+
/**
|
|
254
|
+
* 获取ref
|
|
255
|
+
* @param {Object} el
|
|
256
|
+
*/
|
|
257
|
+
getEl(el) {
|
|
258
|
+
return el.ref;
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* 获取节点信息
|
|
262
|
+
*/
|
|
263
|
+
getSelectorQuery() {
|
|
264
|
+
Promise.all([this.getDom('left'), this.getDom('right')]).then((data) => {
|
|
265
|
+
let show = 'none';
|
|
266
|
+
if (this.autoClose) {
|
|
267
|
+
show = 'none';
|
|
268
|
+
} else {
|
|
269
|
+
show = this.show;
|
|
270
|
+
}
|
|
251
271
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
show = this.show
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (show === 'none') {
|
|
277
|
-
// this.close()
|
|
278
|
-
} else {
|
|
279
|
-
this.open(show)
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
})
|
|
283
|
-
|
|
284
|
-
},
|
|
285
|
-
getDom(str) {
|
|
286
|
-
return new Promise((resolve, reject) => {
|
|
287
|
-
dom.getComponentRect(this.$refs[`selector-${str}-button--hock`], (data) => {
|
|
288
|
-
if (data) {
|
|
289
|
-
this.button[str] = data.size
|
|
290
|
-
resolve(data)
|
|
291
|
-
} else {
|
|
292
|
-
reject()
|
|
293
|
-
}
|
|
294
|
-
})
|
|
295
|
-
})
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
272
|
+
if (show === 'none') {
|
|
273
|
+
// this.close()
|
|
274
|
+
} else {
|
|
275
|
+
this.open(show);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
},
|
|
279
|
+
getDom(str) {
|
|
280
|
+
return new Promise((resolve, reject) => {
|
|
281
|
+
dom.getComponentRect(this.$refs[`selector-${str}-button--hock`], (data) => {
|
|
282
|
+
if (data) {
|
|
283
|
+
this.button[str] = data.size;
|
|
284
|
+
resolve(data);
|
|
285
|
+
} else {
|
|
286
|
+
reject();
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
};
|
|
299
293
|
|
|
300
294
|
// #endif
|
|
301
295
|
|
|
302
|
-
export default bindIngXMixins
|
|
296
|
+
export default bindIngXMixins;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export function isPC() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var userAgentInfo = navigator.userAgent;
|
|
3
|
+
var Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
|
|
4
|
+
var flag = true;
|
|
5
|
+
for (let v = 0; v < Agents.length - 1; v++) {
|
|
6
|
+
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
|
7
|
+
flag = false;
|
|
8
|
+
break;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return flag;
|
|
12
12
|
}
|