order-slide-item.vue
2 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<template>
<div class="order-wrapper">
<AvatarHeader class="avatar-wrapper"></AvatarHeader>
<Slide :data="list" :loop="false" :autoPlay="false" class="slide-container" @change="slideChangeHandler">
<SlideItem v-for="i in list">
<div class="image-wrapper">
<img class="image" :src="i" alt="">
</div>
</SlideItem>
<template slot="dots"><i></i></template>
</Slide>
<div class="image-preview-footer">
<span class="image-preview-counter">{{currentPageIndex + 1}}/{{list.length}}</span>
</div>
</div>
</template>
<script>
import {Slide} from 'cube-ui';
import AvatarHeader from './avatar-header';
export default {
name: 'ShowOrderItem',
components: {
AvatarHeader,
Slide,
SlideItem: Slide.Item
},
data() {
return {
list: [
'https://wx1.sinaimg.cn/mw1024/686d7361ly1fpha0mpd5uj21hc0tyws2.jpg',
'https://wx1.sinaimg.cn/mw1024/686d7361ly1fpha0ncnnej21hc0zetxo.jpg',
'https://wx1.sinaimg.cn/mw1024/686d7361ly1fpha0mqvu5j21hc0zkgzz.jpg',
'https://wx1.sinaimg.cn/mw1024/686d7361ly1fpha0m3ufuj21hc0zkqbj.jpg'
],
currentPageIndex: 0
};
},
methods: {
close() {
},
slideChangeHandler(currentPageIndex) {
this.currentPageIndex = currentPageIndex;
}
}
};
</script>
<style lang="scss" scoped>
.order-wrapper {
width: 100%;
height: 100%;
position: relative;
background-image: url('~statics/image/showorder/sd_bg@2x.png');
background-size: cover;
}
.avatar-wrapper {
position: absolute;
width: 100%;
top: 0;
z-index: 2;
}
.image-wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.image {
width: 100%;
}
}
.image-preview-footer {
position: absolute;
width: 180px;
height: 60px;
background: rgba(0, 0, 0, 0.4);
top: 110px;
right: -60px;
border-radius: 30px;
}
.image-preview-counter {
margin-left: 40px;
font-size: 26px;
color: white;
height: 60px;
line-height: 60px;
}
</style>