zj
2024-06-03 96140d8eb2531144828dffe2ad8c19d0d9431009
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<template>
  <div class="font-26 promote">
    <assets-head :title="$t('推荐')" />
    <div class="advise w-828 h-220 p-40 box-border flex flex-col items-start justify-center"
      :class="{ 'h-260 ': $i18n.locale !== 'CN' }">
      <span v-if="$i18n.locale === 'CN'" class="font-600 font-50" style="color:#273549;">{{ $t('邀请好友,一起赚币') }}</span>
      <span v-else class="font-900 w-445 font-55">{{ $t('邀请好友,一起赚币') }}</span>
      <span class="w-500 mt-20 font-40 font-600" style="color:#273549">{{ $t('马上充值即刻获取佣金') }}</span>
    </div>
    <div class="performance-title">
      <div class="performance-title-1 flex-col flex items-start"
        :class="{ 'performance-title-1-1': $i18n.locale !== 'CN' }">
        {{ $t('我的总推广') }}
        <div class="performance-text text-left">{{ promote_list.total && promote_list.total.children }}</div>
      </div>
      <div class="performance-title-2  flex-col flex items-center"
        :class="{ 'performance-title-1-1': $i18n.locale !== 'CN' }">
        {{ $t('总充值') }}
        <div class="performance-text2 text-left">{{ promote_list.recharge_sum ? (promote_list.recharge_sum * 1).toFixed(2)
          :
          '0.00' }}</div>
      </div>
      <div class="flex items-center w-160 justify-end colorMain" style="align-self: start">
        <div class="performance-title-3" @click="$router.push('/promote/rules')">{{ $t('规则') }}</div>
 
        <img class="performance-title-4" src="../../assets/image/promote/right.png" />
      </div>
    </div>
    <div class="numberOfPeople">
      <div class="numberOfPeople-text flex flex-col align-center">
        {{ $t('一代人数') }}
        <div class="mt-20 numberOfPeople-text4 text-center">{{ promote_list.total && promote_list.total.level_1
        }}</div>
      </div>
      <div class="numberOfPeople-text2 flex flex-col align-center">
        {{ $t('二代人数') }}
        <div class="mt-20 numberOfPeople-text5 flex-1 text-center ">{{ promote_list.total &&
          promote_list.total.level_2
        }}</div>
      </div>
      <!--      <div style="flex: 1;"></div>-->
      <div class="numberOfPeople-text3 flex flex-col align-center">
        {{ $t('三代人数') }}
        <div class="mt-20 numberOfPeople-text6  flex-1 text-center ">{{ promote_list.total &&
          promote_list.total.level_3
        }}</div>
      </div>
    </div>
    <div class="Recommend">
      <div class="Recommend-text btnMain text-white" @click="ShareQRCode_push">{{ $t('立即推广') }}</div>
    </div>
    <div class="segmentation-max"></div>
    <div class="MyRecommendation-title">{{ $t('我的推广') }}</div>
    <div style="width: 100%;">
      <van-tabs ref="tabs" v-model="active" sticky animated @change="onChange">
        <van-tab :title="item.title" v-for="item in selectData" :key="item.title" :name="item.type">
          <div class="Recommendation-tab-title">
            <div class="Recommendation-tab-title1">{{ $t('用户名') }}</div>
            <div class="Recommendation-tab-title1">{{ $t('总人数') }}</div>
            <div class="Recommendation-tab-title1">{{ $t('总充值') }}</div>
          </div>
          <van-list v-model="loading" :finished="finished" :finished-text="$t('没有更多了')" @load="onLoad"
            :loading-text="$t('加载中...')">
            <div v-for="(item, index) in promote_list_data" :key="index" class="Recommendation-tab">
              <div class="Recommendation-tab1">{{ item.username }}</div>
              <div class="Recommendation-tab1">{{ item.reco_sum }}</div>
              <div class="Recommendation-tab1">{{ (item.recharge_sum * 1).toFixed(2) }}</div>
            </div>
          </van-list>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>
<script>
import { Tab, Tabs } from 'vant';
import Axiospromote from '@/API/promote.js'
import { List } from 'vant';
import assetsHead from "@/components/assets-head";
export default {
  data() {
    return {
      active: '1',
      level: 1,
      page_no: 1,
      promote_list: [],
      promote_list_data: [],
      list: [],
      loading: false,
      finished: false,
      pageSize: 10,
      selectData: [
        { title: this.$t('一代'), type: '1' },
        { title: this.$t('二代'), type: '2' },
        { title: this.$t('三代'), type: '3' },
      ]
    }
  },
  components: {
    assetsHead,
    [Tab.name]: Tab,
    [Tabs.name]: Tabs,
    [List.name]: List,
  },
  created() {
    // this.init()
  },
  methods: {
    init() {
      this.promote_data()
    },
    onLoad() {
      // 异步更新数据
      this.promote_data()
    },
    promote_data() {
      const t = this
      this.loading = true;
      Axiospromote.promote({ level: t.level, page_no: t.page_no }).then((res) => {
        console.log(111, res)
        t.promote_list = res.data
        this.promote_list_data = [...this.promote_list_data, ...res.data.list]
        // console.log(logs)
        this.loading = false
        if (res.data.list.length < this.pageSize) {
          this.finished = true
        } else {
          this.page_no++
        }
        this.$refs.tabs && this.$refs.tabs.resize();
      })
    },
    onClickLeft() {
      this.$router.push('/')
    },
    ShareQRCode_push() {
      this.$router.push('/ShareQRCode')
    },
    onChange(e) {
      this.promote_list_data = []
      this.finished = false
      this.page_no = 1
      this.level = e
      this.loading = true;
      if (this.loading) {
        this.promote_data()
      }
    }
  },
}
</script>
<style lang="scss" scoped>
.promote {
  width: 100%;
  box-sizing: border-box;
 
  ::v-deep .van-tabs__nav {
    @include themify() {
      background: themed("cont_background");
    }
  }
 
  ::v-deep .van-tab--active {
    @include themify() {
      color: themed("active_line");
    }
  }
}
 
 
 
.advise {
  background: url("./invite-bg.png") no-repeat center center;
  background-size: 100% 100%;
}
 
.banner {
  width: 100%;
}
 
.performance-title {
  width: 100%;
  display: flex;
  padding-right: 35px;
  padding-left: 35px;
  margin-top: 40px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}
 
.performance-title-1 {
  width: 200px;
  font-style: normal;
  font-weight: 400;
  font-size: 26px;
  color: #848E9C;
 
  &.performance-title-1-1 {
    width: 250px;
    font-size: 26px;
    text-align: center;
    margin-right: 10px;
  }
}
 
.performance-title-2 {
  flex: 1;
  font-style: normal;
  font-weight: 400;
  font-size: 26px;
  color: #848E9C;
 
  &.performance-title-1-1 {
    font-size: 26px;
    text-align: left;
  }
}
 
.performance-title-3 {
  font-style: normal;
  font-weight: 400;
  font-size: 26px;
}
 
.performance-title-4 {
  width: 35px;
}
 
.performance {
  width: 100%;
  display: flex;
  padding-right: 35px;
  padding-left: 35px;
  margin-top: 25px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}
 
.performance-text {
  width: 250px;
  font-style: normal;
  font-weight: 600;
  font-size: 66px;
  color: #2EBD85;
  margin-top: 22px;
}
 
.performance-text2 {
  flex: 1;
  font-style: normal;
  font-weight: 600;
  font-size: 66px;
  color: #2EBD85;
  margin-top: 22px;
}
 
.numberOfPeople {
  width: 100%;
  display: flex;
  padding-right: 35px;
  padding-left: 35px;
  margin-top: 45px;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
}
 
.numberOfPeople-text,
.numberOfPeople-text2,
.numberOfPeople-text3 {
  font-style: normal;
  font-weight: 400;
  text-align: center;
  font-size: 26px;
  color: #848E9C;
}
 
.numberOfPeople2 {
  width: 100%;
  display: flex;
  padding-right: 35px;
  padding-left: 35px;
  margin-top: 20px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}
 
.numberOfPeople-text4,
.numberOfPeople-text5,
.numberOfPeople-text6 {
  font-style: normal;
  font-weight: 700;
  text-align: center;
  font-size: 40px;
 
  @include themify() {
    color: themed("text_color");
  }
}
 
 
.Recommend {
  padding-right: 35px;
  padding-left: 35px;
  margin-top: 45px;
  height: 100px;
  box-sizing: border-box;
}
 
.Recommend-text {
  //background: #FCD436;
  border-radius: 4px;
  line-height: 100px;
  font-weight: 400;
  font-size: 32px;
  text-align: center;
  border-radius: 8px;
  //color: #333333;
}
 
.segmentation-max {
  margin-top: 45px;
  width: 100%;
  height: 20px;
 
  @include themify() {
    background: themed("bg_dark");
  }
}
 
.MyRecommendation-title {
  padding: 32px 35px 38px;
  font-style: normal;
  font-weight: 400;
  font-size: 32px;
  text-align: left;
 
  @include themify() {
    color: themed("text_color");
  }
}
 
.Recommendation-tab-title {
  margin-left: 35px;
  margin-right: 35px;
  height: 85px;
 
  @include themify() {
    background: themed("tab_background");
  }
 
  display: flex;
  margin-top: 35px;
}
 
.Recommendation-tab-title1 {
  flex: 1;
  font-style: normal;
  font-weight: 400;
  font-size: 30px;
  line-height: 85px;
  text-align: center;
  color: #868D9A;
}
 
.Recommendation-tab {
  margin-left: 35px;
  margin-right: 35px;
  height: 85px;
  display: flex;
  margin-top: 35px;
}
 
.Recommendation-tab1 {
  flex: 1;
  font-style: normal;
  font-weight: 400;
  font-size: 34px;
  line-height: 85px;
  text-align: center;
  color: #333333;
}
</style>