Jacob
9 天以前 fbc764bdbca94ced960b53e7e46fa064583752f1
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
<template>
   <view>
       <view class='quality-recommend'>
          <swipers :imgUrls="imgUrls"></swipers>
          <view class='title acea-row row-center-wrapper'>
             <view class='line'></view>
             <view class='name'><text class='iconfont' :class="icon"></text>{{name}}</view>
             <view class='line'></view>
          </view>
          <goodList :bastList="bastList" :status="status"></goodList>
       </view>
       <home></home>
   </view>
</template>
 
<script>
   import goodList from '@/components/goodList';
   import home from '@/components/home';
   import swipers from '@/components/swipers';
   import { getGroomList } from '@/api/store.js';
   export default {
       components: {
           goodList,
           swipers,
           home
       },
       data() {
           return {
               imgUrls: [],
                   bastList:[],
                   name:'',
                   icon:'',
                   type:0,
                   status:0
           };
       },
        onLoad: function (options) {
            this.type = options.type;
         },
           onShow: function () {
             let type = this.type;
             if (type == 1){
               uni.setNavigationBarTitle({
                  title:"精品推荐"
               });
               this.name = '精品推荐';
               this.icon = 'icon-jingpintuijian';
             } else if (type == 2) {
               uni.setNavigationBarTitle({
                  title:"热门榜单"
               });
               this.name = '热门榜单';
               this.icon = 'icon-remen';
               this.status = 1;
             } else if (type == 3) {
               uni.setNavigationBarTitle({
                  title:"首发新品"
               });
               this.name = '首发新品';
               this.icon = 'icon-xinpin';  
             } else if (type == 4) {
                 uni.setNavigationBarTitle({
                    title:"促销单品"
                 });
                 this.name = '促销单品';
                 this.icon = 'icon-cuxiaoguanli';
             }else{
                 uni.setNavigationBarTitle({
                    title:"首发新品"
                 });
                 this.name = '首发新品';
                 this.icon = 'icon-xinpin';
             }
             this.getIndexGroomList();
           },
       methods: {
             getIndexGroomList: function () {
               let that = this;
               getGroomList(that.type).then(res=>{
                   that.imgUrls = res.data.banner;
                   that.$set(that,'bastList',res.data.list)
               });
             }
       }
   }
</script>
 
<style lang="scss">
   page{background-color:#fff;}
   .quality-recommend .title{height:120rpx;font-size:32rpx;color:#282828;background-color:#f5f5f5;}
   .quality-recommend .title .line{width:230rpx;height:2rpx;background-color:#e9e9e9;}
   .quality-recommend .title .name{margin:0 20rpx;}
   .quality-recommend .title .name .iconfont{margin-right:13rpx;font-size:38rpx;vertical-align:-4rpx;color:#343434;}
</style>