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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<template>
    <view class="index-bonus o-h" v-if="!loadding">
        <!-- #ifdef MP-WEIXIN || APP-PLUS -->
        <view class="ww100" :style="'height:'+topBarTop()+'px;'"></view>
        <view class="tc  head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'">
            <view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view>
            <view class="fb">{{titel}}</view>
        </view>
        <!-- #endif -->
        <!--头部图片-->
        <view class="banner d-c-c d-c">
            <image :src="top_background" mode="widthFix"></image>
        </view>
 
        <!--是分销商-->
        <template v-if="is_bonus && isData">
            <!--金额信息-->
            <view class="bonus-wrap pr m-0-20" style="margin-top: 280rpx;">
                <view class="d-b-c border-b pb30 f28 lh150">
                    <view class="d-b-c">
                        <view class="user-avatar">
                            <image :src="user.avatarUrl" mode="aspectFill"></image>
                        </view>
                        <view class="gray3">
                            <view class="f32">{{ user.nickName }}</view>
                            <view class="gray6 f26">{{ info_words.index.words.referee.value }}:{{ bonus.referee ? bonus.referee.nickName : '平台' }}</view>
                        </view>
                    </view>
                    <view class="gray3 tc lh100">
                        <view>
                            <text v-if="bonus.is_expire">已过期</text>
                            <text class="fb f32" :class="{'red':bonus.is_expire}">{{remain_time}}</text>
                            <text class="f22" v-if="remain_time!='永久'">天</text>
                        </view>
                        <view class="f22 gray9 d-s-c">
                            <text>有效期</text>
                            <text class="iconfont icon-bangzhu" @click="notePopup()"></text>
                        </view>
                    </view>
                </view>
                <view class="d-s-c p-30-0 top_dash">
                    <view class="flex-1 d-c-c d-c">
                        <view class="">
                            <text class="f24">¥</text>
                            <text class="f40">{{ bonus.total_money }}</text>
                        </view>
                        <view class="pt20 f28 gray3">{{ info_words.index.words.total_money.value }}</view>
                    </view>
                    <view class="flex-1 d-c-c d-c">
                        <view class="">
                            <text class="f24">¥</text>
                            <text class="f40">{{ bonus.freeze_money_second }}</text>
                        </view>
                        <view class="pt20 f28 gray3">{{ info_words.index.words.freeze_money_second.value }}</view>
                    </view>
                </view>
                <view class="d-s-c p-30-0 top_dash">
                    <view class="flex-1 d-c-c d-c">
                        <view class="redF6">
                            <text class="f24">¥</text>
                            <text class="f40">{{ bonus.money }}</text>
                        </view>
                        <view class="pt20 f26 gray3">{{ info_words.index.words.money.value }}</view>
                    </view>
                    <view class="flex-1 d-c-c d-c">
                        <view class="">
                            <text class="f24">¥</text>
                            <text class="f40">{{ bonus.freeze_money }}</text>
                        </view>
                        <view class="pt20 f28 gray3">{{ info_words.index.words.freeze_money.value }}</view>
                    </view>
                </view>
                <view class="d-c-c pt30">
                    <button type="primary" class="btn-gcred flex-1" :style="{background: baseColor}" @click="gotoCash">{{ info_words.index.words.cash.value }}</button>
                </view>
            </view>
            <!--图标入口-->
            <view class="bonus-wrap m-0-20 p30 d-s-c f-w mt20 bg-white">
                <view class="d-c-c d-c flex-1" @click="gotoPage('/pages2/bonus/cash/list/list')">
                    <view>
                        <image class="bonus_index_img" src="../../../static/icon/icon-zijinmingxi.png" mode=""></image>
                    </view>
                    <text class="pt10 f26 mt20">{{ info_words.cash_list.title.value }}</text>
                </view>
                <view class="d-c-c d-c flex-1" @click="gotoPage('/pages2/bonus/order/order')">
                    <view>
                        <image class="bonus_index_img" src="../../../static/icon/icon-fenxiaodingdan.png" mode=""></image>
                    </view>
                    <text class="pt10 f26 mt20">{{ info_words.order.title.value }}</text>
                </view>
                <!-- <view class="d-c-c d-c flex-1" @click="gotoPage('/pages2/bonus/order/order2')">
                    <view>
                        <image class="bonus_index_img" src="../../../static/icon/icon-fenxiaodingdan.png" mode=""></image>
                    </view>
                    <text class="pt10 f26 mt20">业绩{{ info_words.order.title.value }}</text>
                </view> -->
                <!-- <view class="d-c-c d-c flex-1" @click="gotoPage('/pages2/bonus/team/team')">
                    <view>
                        <image class="bonus_index_img" src="../../../static/icon/icon-tuandui.png" mode=""></image>
                    </view>
                    <text class="pt10 f26 mt20">{{ info_words.team.title.value }}</text>
                </view> -->
                <view class="d-c-c d-c flex-1" @click="gotoPage('/pages2/bonus/qrcode/qrcode')">
                    <view>
                        <image class="bonus_index_img" src="../../../static/icon/icon-erweima.png" mode=""></image>
                    </view>
                    <text class="pt10 f26 mt20">{{ info_words.qrcode.title.value }}</text>
                </view>
            </view>
        </template>
        <!--不是分销商-->
        <template v-if="!is_bonus && isData">
            <view class="no-bonus">
                <view class="mt36 p-0-20 pt60 pb60 red f34 tc no-bonus-text">{{ info_words.index.words.not_bonus.value }}</view>
                <view class="p30 mt30">
                    <button type="primary" class="btn-gcred" :style="{background: baseColor}" @click="applybonus">{{ info_words.index.words.apply_now.value }}</button>
                </view>
            </view>
        </template>
        <!--有效期说明-->
        <uniPopup :show="isNotePopup" msg="有效期说明" @hidePopup="hideNotePopup">
            <view class="agreement-content f28 lh150 pb20">
                {{info_words.index.words.expire.value}}
            </view>
            <view class="ww100 pt20 d-c-c">
                <button type="primary" class="btn-gcred" :style="{background: baseColor}" @click="hideNotePopup">好的,我知道了</button>
            </view>
        </uniPopup>
    </view>
</template>
 
<script>
    import uniPopup from '@/components/uni-popup.vue';
    export default {
        components: {
            uniPopup
        },
        data() {
            return {
                /*是否加载完成*/
                loadding: true,
                indicatorDots: true,
                autoplay: true,
                interval: 2000,
                duration: 500,
                /*0:不是分销商,1:分销商申请中,2:已经是分销商*/
                is_bonus: false,
                isData: false,
                bonus: {},
                /*顶部背景*/
                top_background: '',
                /*基本信息*/
                info_words: {},
                words: {},
                user: {},
                titel: '',
                baseColor: '',
                // 排位过期时间
                remain_time: '',
                isNotePopup: false,
            };
        },
        onLoad(e) {
            if (e.is_bonus) {
                this.is_bonus = e.is_bonus;
            }
            this.setPageColor();
        },
        onShow() {
            uni.showLoading({
                title: '加载中'
            });
            /*获取个人中心数据*/
            this.getData();
        },
        methods: {
            /*设置页面*/
            setPageColor() {
                let tabBar = uni.getStorageSync('TabBar');
                this.baseColor = tabBar.color;
            },
            /*获取数据*/
            getData() {
                let self = this;
                self._get('user.bonus/center', {}, function(data) {
                    self.info_words = data.data.words;
                    uni.setNavigationBarTitle({
                        title: self.info_words.index.title.value != '' ? self.info_words.index.title.value : self.info_words.index.title
                            .default
                    });
                    self.titel = data.data.words.index.title.value
                    self.is_bonus = data.data.is_bonus;
                    self.top_background = data.data.background;
                    self.bonus = data.data.bonus;
                    self.user = data.data.user;
                    self.remain_time = data.data.remain_time;
                    self.isData = true;
                    self.loadding = false;
                    uni.hideLoading();
                });
            },
 
            /*申请分销商*/
            applybonus() {
                this.gotoPage('/pages2/bonus/apply/apply');
            },
 
            /*去商城逛逛*/
            gotoShop() {
                this.gotoPage('/pages/index/index')
            },
 
            /*去提现*/
            gotoCash() {
                this.gotoPage('/pages2/bonus/cash/apply/apply');
            },
            goback() {
                uni.navigateBack();
            },
            /*有效期说明*/
            notePopup() {
                this.isNotePopup = true;
            },
            hideNotePopup(){
                this.isNotePopup = false;
            },
        }
    };
</script>
 
<style>
    page {
        background-color: #f2f2f2;
    }
 
    .index-bonus .banner {
        position: absolute;
        width: 100%;
        z-index: 0;
        min-height: 167rpx;
        /* padding-bottom: 60rpx; */
        background-repeat: no-repeat;
        background-size: 100%;
        top: 0;
    }
 
    .index-bonus .banner image {
        width: 100%;
    }
 
    .no-bonus {
        padding-top: 240rpx;
        position: relative;
    }
 
    .no-bonus-img {
        padding-top: 60rpx;
    }
 
    .no-bonus-img image {
        width: 300rpx;
    }
 
    .bonus-wrap {
        border-radius: 12rpx;
        background-position: -8px 52rpx;
        background-size: 100% 100%;
        background-image: radial-gradient(circle at 8px, transparent 0%, transparent 8px, #ffffff 8px, #ffffff 100%);
        padding: 31rpx 25rpx 36rpx 25rpx;
    }
 
    .index-bonus .bonus-wrap .iconfont {
        font-size: 60rpx;
    }
 
    .index-bonus .btn-gcred {
        height: 88rpx;
        line-height: 88rpx;
        border-radius: 44rpx;
    }
 
    .reg180 {
        padding-right: 20rpx;
        text-align: right;
        transform: rotateY(180deg);
        position: absolute;
        bottom: 0;
    }
 
    .icon-jiantou {
 
        color: #FFFFFF;
        font-size: 30rpx;
    }
 
    .head_top {
        position: absolute;
        width: 100%;
        height: 30px;
        line-height: 30px;
        color: #FFFFFF;
        font-size: 32rpx;
        z-index: 2;
    }
 
    .top_dash {
        border-bottom: 1rpx dashed #D9D9D9;
        padding-bottom: 9px;
 
    }
 
    .bonus_index_img {
        width: 90rpx;
        height: 90rpx;
    }
    
    .user-avatar image {
        width: 80rpx;
        height: 80rpx;
        border-radius: 50rpx;
        margin-right: 10rpx;
    }
    .no-bonus-text {
        background: #fff;
        margin-left: 26rpx;
        margin-right: 26rpx;
        border-radius: 12rpx;
    }
    .agreement-content {
        word-break: break-all;
        white-space:pre-line;
    }
    .index-bonus .bonus-wrap .icon-bangzhu {
        font-size: 28rpx;
        color: #999;
        margin-left: 5rpx;
    }
</style>