lin
2026-05-12 a861cbac6d618f1968c8b41d69775875b17366e4
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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
<template>
  <view class="page-container index">
    <!-- <image class="page-bg" src="@/static/imgs/index-top.png" mode="scaleToFill"></image> -->
    <view class="page-bg"></view>
    <view class="content" style="padding-bottom: 200rpx;">
        <!-- #ifdef APP-PLUS -->
        <view class="uni-popup" :style="{top:isNativeHead?'':StatusBar}" v-if="contactsFlag">
          <view class="ani uni-custom uni-popup__wrapper">
            <view class="uni-popup__wrapper-box">
              <view class="title">通讯权限</view>
              <view class="content">便于实现好友推荐、联系人同步等功能</view>
              <view class="btn-group">
                <button class="cancel-btn" @click="handleReject">拒绝</button>
                <button class="allow-btn" @click="handleAuthorize">允许</button>
              </view>
            </view>
          </view>
        </view>
        <!-- #endif -->
        <view class="hLogo">
            <view class="hLogoView">
                <view class="hLogo-1">
                    <image class="h-logo" src="/static/imgs/index-logo.png" mode=""></image>
                </view>
                <view class="hLogo-2" @tap="$util.goPages('../search/search')">
                    <image class="s-icon" src="/static/imgs/search.png" mode=""></image>
                    <input type="text" placeholder="请搜索您想要的商品" />
                    <view class="s-btn">搜索</view>
                </view>
            </view>
        </view>
 
        <view class="cates" v-if="catesNavData">
            <view class="cates-v" v-for="(item, index) in catesNavData" @tap="$util.goPages('/pages/catesList/catesList?catesId=' + item.id + '&title=' + item.title)">
                <image class="cates-v-icon" :src="item.icon" mode=""></image>
                <view class="">{{item.title}}</view>
            </view>
            <!-- <view class="cates-v" @tap="$util.goSwitch('/pages/cates/cates')">
                <image class="cates-v-icon" src="/static/imgs/more.png" mode=""></image>
                <view class="">更多</view>
            </view> -->
        </view>
        
        <!-- <view class="ad1" @tap="$util.goPages('/pages/catesList/catesList?catesId=11' + '&title=' + '服装鞋包')">
            <image src="/static/imgs/ad1.png" mode=""></image>
        </view> -->
        
        <view class="ad2" @tap="$util.goPages('/pages/catesList/catesList?catesId=3' + '&title=' + '手机数码')">
            <image src="/static/imgs/ad2.png" mode=""></image>
        </view>
        
        <view class="d3-wrap">
            <view class="ad3" @tap="$util.goPages('/pages/catesList/catesList?catesId=2' + '&title=' + '家用电器')">
                <image src="/static/imgs/ad3.png" mode=""></image>
            </view>
            <view class="ad4" @tap="$util.goPages('/pages/catesList/catesList?catesId=4' + '&title=' + '美妆个护')">
                <image src="/static/imgs/ad4.png" mode=""></image>
            </view>
        </view>
        
        <view class="ad5" @tap="$util.goPages('/pages/catesList/catesList?catesId=7' + '&title=' + '家居百货')">
            <image src="/static/imgs/ad5.png" mode=""></image>
        </view>
        
        <!-- <view class="c-goods" v-if="hotCates" v-for="(item, index) in hotCates">
            <view class="ca-ad" v-if="index % 2 == 0">
                <image src="/static/imgs/c1.png" mode=""></image>
            </view>
            <view class="ca-ad" v-else>
                <image src="/static/imgs/c2.png" mode=""></image>
            </view>
            <view class="cGoods">
                <scroll-view class="scroll-view_H" scroll-x="true">
                    <view class="scroll-view-item_H" v-for="(itm, index) in item.goods" @tap="$util.goPages('/pages/ginfo/ginfo?id=' + itm.id)">
                        <image lazy-load class="goods-icon" :src="itm.icon" mode=""></image>
                        <view class="goods-title">{{itm.title}}</view>
                        <view class="goods-price">
                            <view>¥</view>
                            <view class="red">{{itm.price}}</view>
                        </view>
                    </view>
                </scroll-view>
            </view>
        </view> -->
        <!-- <view class="c-goods" v-if="hotGoods">
            <view class="cGoods">
                <scroll-view class="scroll-view_H" scroll-x="true">
                    <view class="scroll-view-item_H" v-for="(itm, index) in hotGoods" @tap="$util.goPages('/pages/ginfo/ginfo?id=' + itm.id)">
                        <image lazy-load class="goods-icon" :src="itm.icon" mode=""></image>
                        <view class="goods-title">{{itm.title}}</view>
                        <view class="goods-price">
                            <view>¥</view>
                            <view class="red">{{itm.price}}</view>
                        </view>
                    </view>
                </scroll-view>
            </view>
        </view> -->
        
        <view class="cateNav">
            <view class="cateNav-item" :class="{active:actIndex===index}" v-for="(item, index) in cateNavList" :key="index" @click="navClick(item,index)">
                <view class="cateNav-title">{{item.title}}</view>
                <view class="cateNav-desc">{{item.desc}}</view>
            </view>
        </view>
        <view class="goods-main">
            <view class="goods-main-view">
                <view class="goods-list">
                    <view class="goods-item" v-for="(itm, index) in goodsData" @click="$util.goPages('/pages/ginfo/ginfo?id=' + itm.id)">
                        <image lazy-load class="goods-icon" :src="itm.icon" mode=""></image>
                        <view class="goods-title">{{itm.title}}</view>
                        <view class="goods-price">
                            <view>¥</view>
                            <view class="red">{{itm.price}}</view>
                            <!-- <view class="hyj">
                                <image src="@/static/imgs/hyj.png" mode=""></image>
                            </view> -->
                            <!-- <view>¥</view>
                            <view class="red">{{itm.price}}</view> -->
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <!-- <view class="login-desc" v-if="!userInfo" @tap="$util.goPages('../login/login')">
            <image class="login-icon" src="/static/imgs/logo-icon.png" mode=""></image>
            <view class="login-font">登录澜品优选,打开美好生活</view>
            <view class="login-btn">立即登录</view>
        </view> -->
    </view>
    
    <uni-popup ref="popup2" type="center" :is-mask-click="false">
      <view class="popup-content">
        <view class="edu-view edu-view2">
          <view class="edu-view-desc2">认证领取额度</view>
          <image class="edu-icon-succ" src="/static/imgs/auths.png" mode=""></image>
          <view class="edu-view-desc3">
            请您先认证个人信息,然后立即领取额度
          </view>
          <view class="edu-btns" @tap="go_auth">立即领取</view>
          <!-- <view class="edu-btns" @tap="$util.goPages('/pages/idcard/idcard')">立即领取</view> -->
        </view>
      </view>
    </uni-popup>
    <!-- 退改政策弹窗 -->
    <uni-popup maskBackgroundColor='rgba(0, 0, 0, 0.6)' ref="popupXY" type="center"  border-radius="10px" :isMaskClick="false" style="z-index: 666666666">
      <view style="background: white;padding: 40rpx;border-radius: 48rpx;height: 78vh;overflow: scroll;width: 560rpx;">
        <view style="text-align: center;font-weight: 700;font-size: 40rpx;color: #333333;margin-bottom: 28rpx;">新疆数澜科技有限公司(澜品优选)退款政策说明</view>
        <view class="txt">
            新疆数澜科技有限公司(下称“澜品优选”)已建立完善的客户服务与售后机制。在会员期内,如用户对服务或商品不满意,可随时通过官方客服热线(4006229771)提出异议、 申请终止服务或办理退款,我司客服团队将按既定流程及时处理,切实保障用户合法权益。现将退款政策具体流程说明如下:
        </view>
        <view class="txt">一、会员用户如对服务或商品不满意,可拨打澜品优选客服热线 4006229771 提出异议;</view>
        <view class="txt">二、若会员用户明确要求终止服务或办理退款,客服将提供以下两种方案供用户选择:1、全额退款:会员用户确认商品完好(不影响二次销售),并将收到的实物商品返还至澜品优选;2、折价退款:如实物权益商品已拆封使用、包装破损或影响二次销售,澜品优选将在扣除相应成本后,向会员用户退还剩余款项;</view>
       <view class="txt">三、客服与会员用户就退款事宜达成一致;</view>
        <view class="txt">四、澜品优选为会员用户办理会员终止,并将会员费用全额原路退回(一般 1 个工作日内到账);</view>
        <view class="txt">五、会员用户收到退款;</view>
        <view class="">六、退费流程结束。</view>
        <view :class="items?'items':''" style="text-align: center;margin-bottom: 40rpx;background: #EE2626;color: #FFFFFF;font-size: 32rpx;border-radius: 50rpx;padding: 28rpx;margin-top: 40rpx;" @click="agree">同意并继续  <text v-if="items">({{items}}S)</text></view>
        <view  style="text-align: center;font-size: 28rpx;margin-bottom: 20rpx;" @click="noAgree">不同意</view>
      </view>
    </uni-popup>
  </view>
</template>
 
<script>
import permision from "@/js_sdk/wa-permission/permission.js"
export default {
  props: {
    // 开启动画
    animation: {
      type: Boolean,
      default: true
    },
    type: {
      type: String,
      default: 'top'
    },
    //是否是原生头部
    isNativeHead:{
      type: Boolean,
      default: true
    },
  },
  data() {
    return {
      contactsFlag: false,
      staHeight: 0,
      paddingHeight: 0,
      indicatorDots: true,
      indicatorColor: '#e3b400',
      indicatorActiveColor: '#ffffff',
      autoplay: true,
      interval: 3000,
      duration: 500,
      bannerData: [],
      catesNavData: [],
      catesHotData: [],
      userInfo: null,
      config: null,
      statusBarHeight: 30,
      StatusBar: 0,
      hotGoods: null,
      newGoods: null,
      hotCates: null,
        catesId: 3,
        is_hot: '',
        pageIndex: 1,
        pageSize: 10,
        goodsData: [],
        cateNavList: [
            {
                title: '为你推荐',
                desc: '猜你喜欢',
                skey: '手机数码',
                catesId: 3,
            },{
                title: '疯狂折扣',
                desc: '好物精选',
                skey: '家用电器',
                catesId: 2,
            },{
                title: '哇!超值',
                desc: '天天低价',
                skey: '美妆个护',
                catesId: 4,
            },{
                title: '热销排行',
                desc: '热门榜单',
                skey: '母婴童玩',
                catesId: 5,
            },
        ],
        actIndex: 0,
        items:10, // 退改政策,倒计时
    }
  },
  onShow() {
    this.getData()
    this.getConfig()
    this.getUserInfo()
    // #ifdef APP-PLUS
    plus.navigator.setStatusBarBackground('transparent');
    // #endif
  },
  created() {
      this.catesGoods()
  },
  onLoad() {
    const systemInfo = uni.getSystemInfoSync();
    this.statusBarHeight = systemInfo.statusBarHeight || 30;
    // 退改政策,倒计时
   const ds = setInterval(() => {
      this.items -=1;
      if(!this.items){
        clearInterval(ds)
      }
    }, 1000 );
    setTimeout(() => {
     //  if(!_this.$route.query?.isApp && !uni.getStorageSync('popupXY') && sessionStorage.getItem('APP_ID')!=='b2e24d04-6a97-40a0-9894-a44237c674ac'){
        // this.$refs.popupXY.open()
     //  }
    if(!uni.getStorageSync('popupXY')){
        this.$refs.popupXY.open()
      }
    },200)
  },
  onReady() {
    // #ifdef APP-PLUS
    this.getSystemInfo();
    // #endif
  },
  mounted() {
  },
  methods: {
      // 退改政策,同意
      agree(){
        if(this.items){
          return;
        }
        uni.setStorageSync('popupXY',1)
        this.$refs.popupXY.close()
      },
      // 不同意
      noAgree(){
        uni.clearStorageSync('popupXY')
        // #ifdef APP-PLUS
            if(plus.os.name.toLowerCase() === 'android') {
                plus.runtime.quit();
            } else {
                const threadClass = plus.ios.importClass("NSThread");
                const mainThread = plus.ios.invoke(threadClass,"mainThread");
                plus.ios.invoke(mainThread,"exit");
                // ios11
                plus.ios.import("UIApplication").sharedApplication().performSelector("exit");
            }
        // #endif
      },
      navClick(data,index) {
          this.actIndex = index;
          this.catesId = data.catesId
          this.catesGoods()
      },
    //获取分类商品
    catesGoods(){
        this.$util.post('Goods/getCatesGoods', {catesId: this.catesId, is_hot: this.is_hot, pageIndex: this.pageIndex, pageSize: this.pageSize}).then(res => {
            if(res.code == 1) {
                this.goodsData = res.data.list
            }
        })
    },
    //获取状态栏高度
    getSystemInfo() {
      let _this = this;
      uni.getSystemInfo({
        success: function(e) {
          _this.StatusBar = e.statusBarHeight + 'px'; //用于自定义头部时,给手机状态栏留出位置,可通过isNativeHead这个参数控制
        }
      })
    },
    getConfig() {
      let t = this
      t.$util.post('Index/getConfig').then(res => {
        if(res.code == 1) {
          console.log('config', res.data)
          t.config = res.data
        }
      })
    },
    getUserInfo () {
      let t = this
      t.$util.post('User/getUser').then(res => {
        console.log(res);
        if(res.code == 1){
          this.userInfo = res.data
          if(res.data.over_auth == 0 && t.config.put_open == 2){
            setTimeout(() => {
              //t.$refs.popup2.open()
            }, 100)
          }
          // if(res.data.contacts == 0 && uni.getSystemInfoSync().platform == 'android'){
          //   // t.contactsFlag = !t.contactsFlag
          //   t.requestAndroidPermission('android.permission.READ_CONTACTS')
          // }
        }
      })
    },
    handleAuthorize() {
      this.contactsFlag = false;
      this.requestAndroidPermission('android.permission.READ_CONTACTS')
    },
    // 4. 手动点击“拒绝”按钮
    handleReject() {
      this.contactsFlag = false;
      uni.showToast({ title: '已拒绝通讯录权限', icon: 'none' });
      // 可根据业务需求处理拒绝后的逻辑(如限制功能使用)
    },
    go_auth () {
      let goUrl = ''
      if(this.userInfo.idcard_auth == 0){
        goUrl = '/pages/idcard/idcard'
      } else if(this.userInfo.face_auth == 0){
        goUrl = '/pages/face/face'
      } else if(this.userInfo.job_auth == 0){
        goUrl = '/pages/job/job'
      } else if(this.userInfo.bank_auth == 0){
        goUrl = '/pages/addBank/addBank?backUrl=/pages/edu/edu'
      }
      console.log(goUrl);
      if(goUrl != '') {
        uni.navigateTo({
          url: goUrl
        })
      }else{
        this.$refs.popup2.close()
        uni.showToast({
          title: '无法认证!',
          icon: 'error'
        })
      }
    },
    goLingqu () {
      if(!this.userInfo){
          return uni.showToast({
            title: '请先登录!',
            icon: 'error'
          })
      }
      if(this.userInfo && this.userInfo.over_auth == 1) {
        return uni.showToast({
          title: '您已完成认证!',
          icon: 'success'
        })
      }
      let goUrl = ''
      if(this.userInfo.idcard_auth == 0){
        goUrl = '/pages/idcard/idcard'
      } else if(this.userInfo.face_auth == 0){
        goUrl = '/pages/face/face'
      } else if(this.userInfo.job_auth == 0){
        goUrl = '/pages/job/job'
      } else if(this.userInfo.bank_auth == 0){
        goUrl = '/pages/addBank/addBank?backUrl=/pages/edu/edu'
      } else {
        return uni.showToast({
          title: '您已完成认证!',
          icon: 'success'
        })
      }
      if(goUrl != '') {
        uni.navigateTo({
          url: goUrl
        })
      }
    },
    async requestAndroidPermission(permisionID) {
      let t = this
      let result = await permision.requestAndroidPermission(permisionID)
      if (result == 1) {
        t.setContacts()
      } else if (result == 0) {
        this.$util.goSetting()
      } else {
        this.$util.goSetting()
      }
    },
    getData () {
      this.$util.post('Goods/getIndexData').then(res => {
          console.log('getIndexData',res)
        this.bannerData = res.data.bannerData
        this.catesNavData = res.data.catesNavData
        this.catesHotData = res.data.catesHotData
        this.hotGoods = res.data.hotGoods
        this.newGoods = res.data.newGoods
        this.hotCates = res.data.hotCates
      })
    },
    setContacts () {
      uni.showLoading({
        title: '授权中...'
      })
      let self = this
      plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE, addressbook => {
            addressbook.find(["displayName","phoneNumbers"],function(contacts){
              let ob = []
              let phone = []
              for(let i in contacts){
                let json = {}
                if(contacts[i].phoneNumbers.length > 0 && contacts[i].displayName){
                  if(phone.indexOf(contacts[i].phoneNumbers[0].value) < 0){
                    json.name = contacts[i].displayName
                    json.phone = contacts[i].phoneNumbers[0].value
                    phone = phone.concat(json.phone)
                    ob = ob.concat(json)
                  }
                }
              }
 
              if(ob.length > 0){
                self.$util.post('Contacts/setContacts', ob).then(res => {
                  uni.hideLoading()
                  uni.showToast({
                    title: res.msg || '授权成功!',
                    icon: 'success',
                  })
                })
              }
              uni.hideLoading()
            })
          },
          function (e){
            this.requestAndroidPermission('android.permission.READ_CONTACTS')
          })
    },
  }
}
</script>
 
<style>
@import url(@/static/css/index.css);
</style>
<style lang="scss">
    .cateNav {
        display: flex;
        justify-content: center;
        gap: 30rpx;
        margin-top: 40rpx;
        margin-bottom: 30rpx;
        .cateNav-item {
            width: 20%;
            text-align: center;
            .cateNav-title {
                color: #333333;
                font-weight: bold;
                font-size: 32rpx;
            }
            .cateNav-desc {
                color: #666666;
                font-size: 24rpx;
            }
        }
        .cateNav-item.active {
            .cateNav-title {
                color: #4766FE;
            }
            .cateNav-desc {
                color: #ffffff;
                background-color: #4766FE;
                border-radius: 50rpx;
                padding: 12rpx 0;
            }
        }
    }
.uni-popup {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  overflow: hidden;
  &__wrapper {
    position: absolute;
    z-index: 9999999;
    /* #ifndef APP-NVUE */
    box-sizing: border-box;
    /* #endif */
    &.ani {
      /* #ifndef APP-NVUE */
      transition: all 0.3s;
      /* #endif */
    }
    &.top {
      top: 0;
      width:705rpx;
      /* #ifdef APP-NVUE */
      left:22.5rpx;
      /* #endif */
      /* #ifndef APP-NVUE */
      left:0;
      transform: translateY(-705rpx);
      /* #endif */
    }
    &-box {
      position: relative;
      /* #ifndef APP-NVUE */
      box-sizing: border-box;
      /* #endif */
    }
    &.uni-custom {
      & .uni-popup__wrapper-box {
        width: 705rpx;
        /* #ifndef APP-NVUE */
        margin: 0 22.5rpx;
        /* #endif */
        padding: 30upx;
        background: #fff;
        z-index:9999;
        border: solid 2rpx #ddd;
        /* #ifndef APP-NVUE */
        box-sizing: border-box;
        /* #endif */
        border-radius: 16rpx;
        .title{
          font-size: 32rpx;
          font-weight: bold;
        }
        .content{
          margin-top: 16rpx;
          line-height: 1.6;
        }
      }
      &.top{
        & .uni-popup__wrapper-box {
          width: 705rpx;
        }
      }
    }
    &.uni-top{
      transform: translateY(0);
    }
  }
}
 
// 退款政策
.txt{
  font-size: 28rpx;
  color: #333333;
  line-height: 48rpx;
  margin-bottom: 10rpx;
}
.items{
  background: #ccc !important;
}
</style>