quanwei
2025-11-21 1db9a4130699636cabe7e0c9f7f15d004aadada0
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<template>
    <view class="prodcut-list-wrap" :data-theme='theme()' :class="theme() || ''">
        <view class="point_top theme-bg">
            <image class="bg-points" src="/static/bg-points.png" mode=""></image>
            <view class="pr mb28">
                <view class="f60 white d-b-c">
                    <view><text class="fb mr20">{{my_points}}</text><text class="f26">{{points_name()}}</text></view>
                    <view class="f26 white mr10" @click="isRule = true">积分规则<text class="icon iconfont icon-qiye"></text></view>
                </view>
                <view class="f26 white">别小看{{points_name()}},它可以省大钱!</view>
                
            </view>
        </view>
        <view class="ponit_title d-c-c">
            <image style="width: 37rpx;height: 22rpx;" src="/static/dots.png" mode=""></image>
            <text class="m-0-20">好物兑换</text>
            <image style="width: 37rpx;height: 22rpx;" src="/static/dots.png" mode=""></image>
        </view>
        <view class="list">
            <view class="item" v-for="(item, index) in listData" :key="index" @click="gotoList(item.point_product_id)">
                <view class="product-cover">
                    <image :src="item.product_image" mode="aspectFit"></image>
                </view>
                <view class="product-info flex-1 d-c">
                    <view>
                        <view class="product-title text-ellipsis-2">{{ item.product.product_name }}</view>
                        <view class="already-sale d-b-c">
                            <text>限量{{ item.stock }}件</text>
                        </view>
                    </view>
                    <view class="d-b-c ww100">
                        <view class="f24 theme-price">
                            <text v-if="item.sku[0].point_money!=0">¥{{ item.sku[0].point_money }}+</text>
                            <text class="">{{ item.sku[0].point_num }}{{points_name()}}</text>
                        </view>
                        <view class="point_btn theme-btn">兑换</view>
                    </view>
                </view>
            </view>
        </view>
        <!-- 没有记录 -->
        <view class="d-c-c p30" v-if="listData.length == 0 && !loading">
            <text class="iconfont icon-wushuju"></text>
            <text class="cont">亲,暂无相关记录哦</text>
        </view>
        <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
        
        <popup :show="isRule" :width="575" :heigth="550" :padding="0" @hidePopup="isRule=false" backgroundColor="none">
            <view class="pop-center">
                <image class="bg-rule" src="/static/invite/bg-rule.png" mode=""></image>
                <view class="pop-title">活动规则</view>
                <scroll-view scroll-y="true" style="height: 473rpx;">
                    <view class="pop-title-box">{{content}}</view>
                </scroll-view>
            </view>
        </popup>
        
    </view>
</template>
 
<script>
    import popup from '@/components/uni-popup.vue';
    import uniLoadMore from '@/components/uni-load-more.vue';
    export default {
        components: {
            uniLoadMore,
            popup
        },
        data() {
            return {
                /*是否加载完成*/
                loading: true,
                /*数据列表*/
                listData: [],
                /*最后一页码数*/
                last_page: 0,
                /*当前页面*/
                page: 1,
                /*每页条数*/
                list_rows: 10,
                no_more: false,
                my_points: 0,
                isRule:false,
                content:''
            };
        },
        onReady() {
            uni.setNavigationBarTitle({
                title: this.points_name()+'商城'
            });
        },
        onShow() {
            this.page = 1;
            this.listData = [];
            this.getData();
        },
        computed: {
            /*加载中状态*/
            loadingType() {
                if (this.loading) {
                    return 1;
                } else {
                    if (this.listData.length != 0 && this.no_more) {
                        return 2;
                    } else {
                        return 0;
                    }
                }
            }
        },
        onReachBottom() {
            let self = this;
            if (self.page < self.last_page) {
                self.page++;
                self.getData();
            }
            self.no_more = true;
        },
        methods: {
            /*获取数据*/
            getData() {
                let self = this;
                self.loading = true;
                self._get(
                    'plus.points.product/index', {
                        page: self.page || 1,
                        list_rows: self.list_rows
                    },
                    function(res) {
                        self.loading = false;
                        self.listData = self.listData.concat(res.data.list.data);
                        self.my_points = res.data.points;
                        self.content = res.data.setting.content;
                        self.last_page = res.data.list.last_page;
                        if (res.data.list.last_page <= 1) {
                            self.no_more = true;
                        }
                    }
                );
            },
 
            /*跳转产品列表*/
            gotoList(e) {
                this.gotoPage('/pages/plus/points/detail/detail?point_product_id=' + e);
            }
        }
    };
</script>
 
<style lang="scss">
    page {
        background: #FBF9F9;
    }
 
    .point_top {
        position: relative;
        width: 750rpx;
        height: 346rpx;
        position: relative;
        z-index: 1;
        padding: 81rpx 19rpx 0 26rpx;
        font-size: 26rpx;
        color: #ffffff;
        box-sizing: border-box;
 
        .bg-points {
            width: 750rpx;
            height: 346rpx;
            z-index: 0;
            position: absolute;
            left: 0;
            top: 0;
        }
    }
 
 
    .prodcut-list-wrap .list {
        padding: 0 20rpx;
    }
 
    .ponit_title {
        height: 95rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 28rpx;
        font-weight: bold;
    }
 
    .prodcut-list-wrap .list .item {
        padding: 25rpx 20rpx;
        width: 710rpx;
        height: 252rpx;
        background: #FFFFFF;
        box-shadow: 0px 8rpx 3rpx 0px rgba(6, 0, 1, 0.03);
        border-radius: 5rpx;
        margin-bottom: 20rpx;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-sizing: border-box;
    }
 
    .prodcut-list-wrap .product-cover {
        margin-right: 20rpx;
    }
 
    .prodcut-list-wrap .product-cover,
    .prodcut-list-wrap .product-cover image {
        width: 212rpx;
        height: 212rpx;
        border-radius: 10rpx;
    }
 
    .prodcut-list-wrap .product-info {
        flex: 1;
        margin-left: 26rpx;
        flex-direction: column;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        height: 212rpx;
    }
 
    .prodcut-list-wrap .product-title {
        margin-bottom: 18rpx;
    }
 
    .prodcut-list-wrap .price {
        font-size: 20rpx;
        line-height: 28rpx;
    }
 
    .prodcut-list-wrap .price .num {
        padding: 0 4rpx;
        font-size: 36rpx;
    }
 
    .prodcut-list-wrap .already-sale {
        color: #999;
        font-size: 20rpx;
    }
 
    .prodcut-list-wrap .already-sale .btn-red {
        line-height: 2;
        font-size: 28rpx;
    }
 
    .point_btn {
        width: 148rpx;
        height: 48rpx;
        border-radius: 25rpx;
        font-size: 22rpx;
        color: #FFFFFF;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
    }
    
    .pop-center {
        position: relative;
        width: 575rpx;
        height: 550rpx;
    }
    
    .pop-title {
        position: relative;
        height: 77rpx;
        line-height: 77rpx;
        color: #ffffff;
        font-size: 28rpx;
        text-align: center;
        z-index: 1;
    }
    .pop-title-box{
        padding: 40rpx 52rpx 20rpx 42rpx;
        white-space: pre-line;
        color: #7F685A;
        font-size: 26rpx;
        line-height: 46rpx;
    }
    .bg-rule {
        width: 575rpx;
        height: 550rpx;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 0;
    }
</style>