|
@@ -40,7 +40,6 @@ |
|
@@ -40,7 +40,6 @@ |
40
|
|
40
|
|
41
|
<script>
|
41
|
<script>
|
42
|
import {BetterScroll} from 'cube-ui';
|
42
|
import {BetterScroll} from 'cube-ui';
|
43
|
-import lottie from 'lottie-web';
|
|
|
44
|
|
43
|
|
45
|
function getRect(el) {
|
44
|
function getRect(el) {
|
46
|
if (el instanceof window.SVGElement) {
|
45
|
if (el instanceof window.SVGElement) {
|
|
@@ -171,9 +170,7 @@ export default { |
|
@@ -171,9 +170,7 @@ export default { |
171
|
mounted() {
|
170
|
mounted() {
|
172
|
setTimeout(() => {
|
171
|
setTimeout(() => {
|
173
|
this.initScroll();
|
172
|
this.initScroll();
|
174
|
- setTimeout(() => {
|
|
|
175
|
- this.pullDownInitTop = 0 - this.$refs.pulldown.clientHeight;
|
|
|
176
|
- }, 0);
|
173
|
+
|
177
|
}, 20);
|
174
|
}, 20);
|
178
|
},
|
175
|
},
|
179
|
methods: {
|
176
|
methods: {
|
|
@@ -257,21 +254,28 @@ export default { |
|
@@ -257,21 +254,28 @@ export default { |
257
|
}
|
254
|
}
|
258
|
},
|
255
|
},
|
259
|
_initLottie() {
|
256
|
_initLottie() {
|
260
|
- this.lottieBefore = lottie.loadAnimation({
|
|
|
261
|
- container: document.getElementById('beforePullDown'), // the dom element that will contain the animation
|
|
|
262
|
- renderer: 'svg',
|
|
|
263
|
- loop: false,
|
|
|
264
|
- autoplay: true,
|
|
|
265
|
- path: 'https://cdn.yoho.cn/mapp/lottie/ufo-pull-1227.json' // the path to the animation json
|
|
|
266
|
- });
|
|
|
267
|
- this.lottieAfter = lottie.loadAnimation({
|
|
|
268
|
- container: document.getElementById('afterPullDown'), // the dom element that will contain the animation
|
|
|
269
|
- renderer: 'svg',
|
|
|
270
|
- loop: true,
|
|
|
271
|
- autoplay: true,
|
|
|
272
|
- path: 'https://cdn.yoho.cn/mapp/lottie/ufo-refresh-1227.json' // the path to the animation json
|
|
|
273
|
- });
|
|
|
274
|
-
|
257
|
+ setTimeout(() => {
|
|
|
258
|
+ import(/* webpackChunkName: "lottie-web" */ 'lottie-web').then(lottie => {
|
|
|
259
|
+ this.lottieBefore = lottie.loadAnimation({
|
|
|
260
|
+ container: document.getElementById('beforePullDown'), // the dom element that will contain the animation
|
|
|
261
|
+ renderer: 'svg',
|
|
|
262
|
+ loop: false,
|
|
|
263
|
+ autoplay: true,
|
|
|
264
|
+ path: 'https://cdn.yoho.cn/mapp/lottie/ufo-pull-1227.json' // the path to the animation json
|
|
|
265
|
+ });
|
|
|
266
|
+ this.lottieAfter = lottie.loadAnimation({
|
|
|
267
|
+ container: document.getElementById('afterPullDown'), // the dom element that will contain the animation
|
|
|
268
|
+ renderer: 'svg',
|
|
|
269
|
+ loop: true,
|
|
|
270
|
+ autoplay: true,
|
|
|
271
|
+ path: 'https://cdn.yoho.cn/mapp/lottie/ufo-refresh-1227.json' // the path to the animation json
|
|
|
272
|
+ });
|
|
|
273
|
+ this.$nextTick(() => {
|
|
|
274
|
+ this.pullDownInitTop = 0 - this.$refs.pulldown.clientHeight;
|
|
|
275
|
+ console.log(this.pullDownInitTop)
|
|
|
276
|
+ });
|
|
|
277
|
+ });
|
|
|
278
|
+ }, 200);
|
275
|
},
|
279
|
},
|
276
|
_initPullDownRefresh() {
|
280
|
_initPullDownRefresh() {
|
277
|
this.scroll.on('pullingDown', () => {
|
281
|
this.scroll.on('pullingDown', () => {
|
|
@@ -280,6 +284,7 @@ export default { |
|
@@ -280,6 +284,7 @@ export default { |
280
|
this.$emit('pullingDown');
|
284
|
this.$emit('pullingDown');
|
281
|
});
|
285
|
});
|
282
|
this.scroll.on('scroll', (pos) => {
|
286
|
this.scroll.on('scroll', (pos) => {
|
|
|
287
|
+ console.log('scroll')
|
283
|
if (!this.pullDownRefresh) {
|
288
|
if (!this.pullDownRefresh) {
|
284
|
return;
|
289
|
return;
|
285
|
}
|
290
|
}
|
|
@@ -336,8 +341,11 @@ export default { |
|
@@ -336,8 +341,11 @@ export default { |
336
|
|
341
|
|
337
|
<style lang="scss" scoped>
|
342
|
<style lang="scss" scoped>
|
338
|
.list-wrapper {
|
343
|
.list-wrapper {
|
339
|
- position: relative;
|
|
|
340
|
- height: 100%;
|
344
|
+ position: absolute;
|
|
|
345
|
+ top: 0;
|
|
|
346
|
+ right: 0;
|
|
|
347
|
+ left: 0;
|
|
|
348
|
+ bottom: 0;
|
341
|
overflow: hidden;
|
349
|
overflow: hidden;
|
342
|
background: #fff;
|
350
|
background: #fff;
|
343
|
|
351
|
|