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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<template>
<u-popup :show="show" mode="bottom" @close="onClose" :round="20">
<view class="box">
<view class="header flex">
<text>礼物</text>
<u-icon name="close" @click="onClose"></u-icon>
</view>
<swiper indicator-dots>
<swiper-item class="flex flex-around">
<view v-for="(item,index) in datalist" :key="index+''" class="flex-col"
:class="currentIndex == index ? 'active' : ''">
<view class="image-padding">
<image :src="item.url" style="width:94rpx;" mode="widthFix" @click="giftClick(index)">
</image>
</view>
<text class="">{{currentIndex == index ? "赠送" : item.title}}</text>
</view>
</swiper-item>
</swiper>
</view>
</u-popup>
</template>
<script>
export default {
name: "more",
props: ["show"],
data() {
return {
currentIndex: "",
datalist: [{
title: "免费",
url: "/static/images/gift/599778030eff04b11420e3d8751bfbb6 1@2x.png"
},
{
title: "免费",
url: "/static/images/gift/0ea40b8376ef8157791b928a339ed9c9_tplv-obj 1@2x.png"
},
{
title: "免费",
url: "/static/images/gift/898bc8988a737b909e952854747c8f7e_tplv-obj 1@2x.png"
},
{
title: "免费",
url: "/static/images/gift/a7ccf403bd4b727447d9ab06f1d9231c 1@2x.png"
},
{
title: "99币",
url: "/static/images/gift/e1972046aa7cc5ae870041a655ddf016_tplv-obj 1@2x.png"
},
]
}
},
methods: {
onClose() {
this.$emit("onClose", "more");
},
giftClick(index) {
this.currentIndex = index;
},
}
}
</script>
<style lang="scss" scoped>
.mt-1 {
margin-top: 10rpx;
}
.flex {
display: flex;
}
.flex-around {
justify-content: space-around;
}
.image-padding {
padding: 16rpx;
}
.flex-col {
display: flex;
flex-direction: column;
justify-content: left;
align-items: center;
width: 126rpx;
color: #777777;
font-size: 28rpx;
}
.text-center {
text-align: center;
}
.header {
justify-content: space-between;
padding: 32rpx 40rpx;
}
.box {
height: 440rpx;
}
.active {
view {
background-color: #F7F7F7;
border-radius: 10rpx 10rpx 0 0;
}
text {
display: inline-block;
width: 100%;
background-color: #FF506F;
color: white;
text-align: center;
padding: 5rpx 0;
}
}
</style>