@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.
Files changed (146) hide show
  1. package/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
  2. package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
  3. package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
  4. package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
  5. package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
  6. package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
  7. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
  8. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
  9. package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
  10. package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
  11. package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
  12. package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
  13. package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
  14. package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
  15. package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
  16. package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
  17. package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
  18. package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
  19. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
  20. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
  21. package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
  22. package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
  23. package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
  24. package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
  25. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
  26. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
  27. package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
  28. package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
  29. package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
  30. package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
  31. package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
  32. package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
  33. package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
  34. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
  35. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
  36. package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
  37. package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
  38. package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
  39. package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
  40. package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
  41. package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
  42. package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
  43. package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
  44. package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
  45. package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
  46. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
  47. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
  48. package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
  49. package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
  50. package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
  51. package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
  52. package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
  53. package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
  54. package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
  55. package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
  56. package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
  57. package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
  58. package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
  59. package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
  60. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
  61. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
  62. package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
  63. package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
  64. package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
  65. package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
  66. package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
  67. package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
  68. package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
  69. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
  70. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
  71. package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
  72. package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
  73. package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
  74. package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
  75. package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
  76. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
  77. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
  78. package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
  79. package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
  80. package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
  81. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
  82. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
  83. package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
  84. package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
  85. package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
  86. package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
  87. package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
  88. package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
  89. package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
  90. package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
  91. package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
  92. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
  93. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
  94. package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
  95. package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
  96. package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
  97. package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
  98. package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
  99. package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
  100. package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
  101. package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
  102. package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
  103. package/dist/uni/uni-ui/uni-scss/package.json +73 -73
  104. package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
  105. package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
  106. package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
  107. package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
  108. package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
  109. package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
  110. package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
  111. package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
  112. package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
  113. package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
  114. package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
  115. package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
  116. package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
  117. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
  118. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
  119. package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
  120. package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
  121. package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
  122. package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
  123. package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
  124. package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
  125. package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
  126. package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
  127. package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
  128. package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
  129. package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
  130. package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
  131. package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
  132. package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
  133. package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
  134. package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
  135. package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
  136. package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
  137. package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
  138. package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
  139. package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
  140. package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
  141. package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
  142. package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
  143. package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
  144. package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
  145. package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
  146. 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
- data() {
10
- return {}
11
- },
9
+ data() {
10
+ return {};
11
+ },
12
12
 
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
- }
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
- 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)
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
- this.eventpan = BindingX.bind({
88
- anchor: this.box,
89
- eventType: 'pan',
90
- props: [{
91
- element: this.selector,
92
- property: 'transform.translateX',
93
- expression
94
- }, {
95
- element: this.leftButton,
96
- property: 'transform.translateX',
97
- expression: leftExpression
98
- }, {
99
- element: this.rightButton,
100
- property: 'transform.translateX',
101
- expression: rightExpression
102
- }, ]
103
- }, (e) => {
104
- // nope
105
- if (e.state === 'end') {
106
- this.x = e.deltaX + this.x;
107
- this.isclick = true
108
- this.bindTiming(e.deltaX)
109
- }
110
- });
111
- },
112
- touchend(e) {
113
- if (this.isopen !== 'none' && !this.isclick) {
114
- this.open('none')
115
- }
116
- },
117
- bindTiming(x) {
118
- const left = this.x
119
- const leftWidth = this.button.left.width
120
- const rightWidth = this.button.right.width
121
- const threshold = this.threshold
122
- if (!this.isopen || this.isopen === 'none') {
123
- if (left > threshold) {
124
- this.open('left')
125
- } else if (left < -threshold) {
126
- this.open('right')
127
- } else {
128
- this.open('none')
129
- }
130
- } else {
131
- if ((x > -leftWidth && x < 0) || x > rightWidth) {
132
- if ((x > -threshold && x < 0) || (x - rightWidth > threshold)) {
133
- this.open('left')
134
- } else {
135
- this.open('none')
136
- }
137
- } else {
138
- if ((x < threshold && x > 0) || (x + leftWidth < -threshold)) {
139
- this.open('right')
140
- } else {
141
- this.open('none')
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
- * @param {Object} num
150
- * @param {Object} mix
151
- * @param {Object} max
152
- */
153
- range(num, mix, max) {
154
- return `min(max(x+${num}, ${mix}), ${max})`
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
- * 开启swipe
159
- */
160
- open(type) {
161
- this.animation(type)
162
- },
164
+ /**
165
+ * 开启swipe
166
+ */
167
+ open(type) {
168
+ this.animation(type);
169
+ },
163
170
 
164
- /**
165
- * 关闭swipe
166
- */
167
- close() {
168
- this.animation('none')
169
- },
171
+ /**
172
+ * 关闭swipe
173
+ */
174
+ close() {
175
+ this.animation('none');
176
+ },
170
177
 
171
- /**
172
- * 开启关闭动画
173
- * @param {Object} type
174
- */
175
- animation(type) {
176
- const time = 300
177
- const leftWidth = this.button.left.width
178
- const rightWidth = this.button.right.width
179
- if (this.eventpan && this.eventpan.token) {
180
- BindingX.unbind({
181
- token: this.eventpan.token,
182
- eventType: 'pan'
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
- switch (type) {
187
- case 'left':
188
- Promise.all([
189
- this.move(this.selector, leftWidth),
190
- this.move(this.leftButton, 0),
191
- this.move(this.rightButton, rightWidth * 2)
192
- ]).then(() => {
193
- this.setEmit(leftWidth, type)
194
- })
195
- break
196
- case 'right':
197
- Promise.all([
198
- this.move(this.selector, -rightWidth),
199
- this.move(this.leftButton, -leftWidth * 2),
200
- this.move(this.rightButton, 0)
201
- ]).then(() => {
202
- this.setEmit(-rightWidth, type)
203
- })
204
- break
205
- default:
206
- Promise.all([
207
- this.move(this.selector, 0),
208
- this.move(this.leftButton, -leftWidth),
209
- this.move(this.rightButton, rightWidth)
210
- ]).then(() => {
211
- this.setEmit(0, type)
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
- setEmit(x, type) {
217
- const leftWidth = this.button.left.width
218
- const rightWidth = this.button.right.width
219
- this.isopen = this.isopen || 'none'
220
- this.stop = false
221
- this.isclick = false
222
- // 只有状态不一致才会返回结果
223
- if (this.isopen !== type && this.x !== x) {
224
- if (type === 'left' && leftWidth > 0) {
225
- this.$emit('change', 'left')
226
- }
227
- if (type === 'right' && rightWidth > 0) {
228
- this.$emit('change', 'right')
229
- }
230
- if (type === 'none') {
231
- this.$emit('change', 'none')
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
- * 获取ref
256
- * @param {Object} el
257
- */
258
- getEl(el) {
259
- return el.ref
260
- },
261
- /**
262
- * 获取节点信息
263
- */
264
- getSelectorQuery() {
265
- Promise.all([
266
- this.getDom('left'),
267
- this.getDom('right'),
268
- ]).then((data) => {
269
- let show = 'none'
270
- if (this.autoClose) {
271
- show = 'none'
272
- } else {
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
- 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;
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
  }