liangjin
2021-03-30 13bee775e4ad2c2ea255836201c4d6a00b4888a0
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
<template>
  <div class="hbcp-page">
    <v-navbar title="花呗分期"></v-navbar>
    <div class="list-box">
      <p v-if="list.length > 0">请选择产品</p>
      <div class="cp-box">
        <div style="margin-top:16px" v-for="(item,i) in list" :key="i" >
            <div class="box" @click="go(item)">
              <img :src="item.icon" alt />
              <p>{{item.typeName}}</p>
            </div>
        </div>
      </div>
      <p style="margin-top:40px" v-if="list2.length > 0">请选择消费场景</p>
      <div class="cp-box-2">
        <div style="margin-top:16px" v-for="(item,i) in list2" :key="i" >
            <div class="box" @click="go(item)">
              <img :src="item.icon" alt />
              <p>{{item.typeName}}</p>
            </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [],
      list2:[],
    };
  },
  created() {
    JSON.parse(localStorage.hbcp).forEach(e=>{
      if(e.lineType==1){
        this.list.push(e)
      }else{
        this.list2.push(e)
      }
    })
    
  },
  methods: {
    go(item) {
      console.log(item)
      // return
      var path = "",
        text = "";
      item.typeId = Number(item.typeId);
      if (item.isHbProd == 1) {
        path = "/channel-selection";
        switch (item.typeId) {
          case 200002:
            text = "用户付息通道";
            break;
          case 200009:
            text = "商品消费通道";
            break;
          case 200010:
            text = "商户贴息通道";
            break;
          case 200011:
            text = "运营商消费通道";
            break;
        }
      } else {
        // switch (item.typeId) {
        //   case 200011:
        //     path = "/xyg/list";
        //     break;
        // }
      }
      this.$router.push({
        path,
        query: {
          typeId: item.typeId,
          prodId: item.prodId,
          text: text
        }
      });
    }
  }
};
</script>
<style lang="less" scoped>
.hbcp-page {
  & {
    min-height: 100vh;
    background: #f5f5f7;
  }
  .list-box {
    width: 94%;
    min-height: 335px;
    background: rgba(255, 255, 255, 1);
    border-radius: 3px;
    margin-top: 10px;
    margin-left: 3%;
    box-sizing: border-box;
    padding: 24px 13px;
    & > p {
      font-size: 16px;
      font-family: PingFang SC;
      font-weight: 500;
      color: rgba(51, 51, 51, 1);
    }
    & > .cp-box {
      display: flex;
      justify-content: space-around;
      flex-wrap: wrap;
      .box {
        text-align: center;
        width: 115px;
        height: 90px;
        background: rgba(255, 255, 255, 1);
        box-shadow: 0px 0px 15px 0px rgba(66, 61, 93, 0.08);
        border-radius: 8px;
        padding-top: 15px;
        box-sizing: border-box;
      }
      img {
        width: 46px;
        height: 46px;
      }
    }
    & > .cp-box-2 {
      display: flex;
      justify-content: space-around;
       flex-wrap: wrap;
      .box {
        text-align: center;
        width: 115px;
        height: 90px;
        background: rgba(255, 255, 255, 1);
        box-shadow: 0px 0px 15px 0px rgba(66, 61, 93, 0.08);
        border-radius: 8px;
        padding-top: 15px;
        box-sizing: border-box;
      }
      img {
        width: 46px;
        height: 46px;
      }
    }
  }
}
</style>