MrShi
4 天以前 4fabfe4dbd2eb28d07a4350597d314958cc1c281
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
    <view class="tc">
        <view class="index_box_vip_row" v-for="(item, index) in list" :key="index" @click="jump(item.id)">
            <view class="vip1">
                <view class="vip1_left">
                    {{item.name || ''}}
                </view>
                <view class="vip1_right">
                    {{item.price || ''}}
                </view>
            </view>
            <view class="vip2">
                <text>{{item.descs || ''}}</text>
                <u>¥{{item.linePrice || ''}}</u>
            </view>
            <view class="vip3">
                <view class="vip3_info">低至{{item.dayPrice}}元/天</view>
                <view class="vip3_button">购买</view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                list: [],
                page: 1
            };
        },
        onLoad() {
            this.getList()
        },
        onReachBottom() {
            this.getList()
        },
        methods: {
            jump(id) {
                uni.navigateTo({
                    url: `/pages/packageDetails/packageDetails?id=${id}`
                });
            },
            purchase(id) {
                uni.navigateTo({
                    url: `/pages/paymentPage/paymentPage?id=${id}`
                });
            },
            async getList() {
                let res = await this.$u.api.discountPage({
                    capacity: 10,
                    page: this.page,
                    model: {
                        bikeOrElec: 2
                    }
                })
                if (res.code === 200) {
                    this.page += 1
                    this.list.push(...res.data.records)
                }
            }
        }
    }
</script>
 
<style>
    page {
        background-color: #F7F7F7;
    }
</style>
<style lang="scss" scoped>
    .tc {
        width: 100%;
        padding: 20rpx;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        .index_box_vip_row {
            width: 100%;
            height: 216rpx;
            background: #FFFFFF;
            box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0,0,0,0.06);
            border-radius: 12rpx;
            padding: 24rpx;
            box-sizing: border-box;
            margin-bottom: 20rpx;
            &:last-child {
                margin: 0 !important;
            }
            .vip1 {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                .vip1_left {
                    flex: 1;
                    font-weight: 500;
                    font-size: 32rpx;
                    color: #303030;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    text-align: left;
                }
                .vip1_right {
                    flex-shrink: 0;
                    font-weight: 400;
                    font-size: 40rpx;
                    color: #FF5A31;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    &:before {
                        content: '¥';
                        font-weight: 400;
                        font-size: 26rpx;
                        color: #FF5A31;
                    }
                }
            }
            .vip2 {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-top: 10rpx;
                margin-bottom: 16rpx;
                text {
                    flex: 1;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    font-weight: 400;
                    font-size: 26rpx;
                    color: #777777;
                    text-align: left;
                }
                u {
                    flex-shrink: 0;
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #999999;
                    text-decoration: line-through;
                }
            }
            .vip3 {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                .vip3_info {
                    padding: 6rpx 12rpx;
                    box-sizing: border-box;
                    background: rgba(255,90,49,0.1);
                    border-radius: 8rpx;
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #FF5A31;
                }
                .vip3_button {
                    width: 120rpx;
                    height: 60rpx;
                    line-height: 60rpx;
                    text-align: center;
                    background: #01B6AD;
                    box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(1,182,173,0.24);
                    border-radius: 30rpx;
                    font-weight: 500;
                    font-size: 28rpx;
                    color: #FFFFFF;
                }
            }
        }
    }
</style>