order.vue
1.89 KB
1
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
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
80
81
82
83
84
85
86
<template>
<Layout>
<Slide ref="slide"
:data="list"
:loop="false"
:autoPlay="false"
direction="vertical"
class="slide-container"
:showDots="false"
@scroll-end="onChange"
:speed="1000"
:threshold="0.05"
:options="scrollOpts"
>
<SlideItem v-for="i in list">
<OrderSlideItem></OrderSlideItem>
</SlideItem>
</Slide>
</Layout>
</template>
<script>
import {Slide} from 'cube-ui';
import OrderSlideItem from './components/order-slide-item';
export default {
name: 'ShowOrderPage',
components: {
Slide,
SlideItem: Slide.Item,
OrderSlideItem,
},
data() {
return {
list: [
{
url: 'http://www.didichuxing.com/',
image: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3978382133,2176310874&fm=27&gp=0.jpg'
},
{
url: 'http://www.didichuxing.com/',
image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide02.png'
},
{
url: 'http://www.didichuxing.com/',
image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide02.png'
},
],
scrollOpts: {
deceleration: 0.0001,
listenScroll: true,
probeType: 3,
click: true,
directionLockThreshold: 0,
}
};
},
mounted() {
},
methods: {
onChange(i) {
this.$nextTick(() => {
this.list.shift();
this.list.push({
url: 'http://www.didichuxing.com/',
image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide03.png'
});
});
},
clickHandler(e) {
console.log(e);
}
}
};
</script>
<style lang="scss" scoped>
.slide-container {
/deep/ .cube-slide-item {
width: 100%;
}
}
</style>