liangjin
2021-04-01 17b4a933b86881641eb65e6ffcdc3d253cb3e7e1
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
<!--
 * @Author: 小明丶
 * @Date: 2019-08-19 18:10:18
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-12-26 13:53:40
 * @Description:
 -->
<template>
  <div class="product-box h-100-g">
 
    <nav class="product-title">
      产品管理
    </nav>
 
    <div class="alipay" @click="$router.push('/product/facepay')">
      <van-icon name="scan" />
      <p>支付宝扫码收款</p>
    </div>
 
 
    <div class="product-list grid">
      <div class="list-title">办理分期</div>
      <div class="item flex-center-g" @click="handlerClick(item)" v-for="(item, index) in menu" :key="index" :class="item.icon.replace('#','')">
        <div class="text-center-g" >
          <svg class="icon"  aria-hidden="true" :style="{fill:item.color}">
            <use :xlink:href="item.icon"></use>
          </svg>
          <p class="label">{{item.label}}</p>
        </div>
      </div>
    </div>
 
  </div>
</template>
 
<script>
  export default {
    name: "product",
    data() {
      return {
        // 菜单栏
        menu: [
          {
            icon: '#iconxinyongkafenqi',
            label: '信用卡分期',
            path: '',
            color:'#896EDB'
          },
          {
            icon: '#iconhuabeifenqi',
            label: '花呗分期',
            color:'#896EDB'
          },
          {
            icon: '#iconshoujifenqi',
            label: '手机分期',
            color:'#896EDB'
          },
          {
            icon: '#icongoujizhijiang',
            label: '购机直降',
            color:'#ccc'
          },
          {
            icon: '#iconzhixianghua',
            label: '智享花',
            color:'#896EDB'
          },
          {
            icon: '#iconzhixianghua',
            label: '信用购',
            color:'#896EDB'
          },
          {
            icon: '#icondangmianfu',
            label: '商户收款',
            color:'#ccc'
          },
          {
            icon: '#iconhuabeiheyueji',
            label: '花呗合约机',
            color:'#896EDB'
          },
          {
            icon: '#iconhuabeitie',
            label: '花呗提额',
            color:'#896EDB'
          },
 
        ]
      }
    },
    created() {
       // this.openAuto();
    },
    methods: {
        openAuto(){
            let openId = window.localStorage.getItem("pOpenId");
            let codeId = window.localStorage.getItem("pCodeId");
            alert("openId:"+openId);
            alert("codeId:"+codeId);
            if(codeId == undefined) {
                var strUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + "wx594ab33e0466eccf" +
                    "&redirect_uri=" + "https%3a%2f%2fsie.jycash.cn%2fsib_wx_scorea%2f%23%2f" + "&response_type=code&scope=snsapi_userinfo" + "#wechat_redirect";
                window.location.href = strUrl;
            }else if(openId ==  undefined){
                this.$api.getWeChatUserInfo({"code":codeId}).then(
                    res => {
                        let openId = res.body;
                        window.localStorage.setItem("pOpenId",openId);
                        this.$api.setUserOpenId({"openId":openId}).then(
                            res => {
                                alert("updateOpenId:"+ openId);
                            },
                            error => {
                                statusCodeManage.showTipOfStatusCode(error, this);
                            }
                        );
                    },
                    error => {
                        statusCodeManage.showTipOfStatusCode(error, this);
                    }
                );
            }
        },
      handlerClick(item) {
        if (item.path) {
          this.$router.push(item.path);
          return false;
        }
 
        switch (item.label) {
          case '信用卡分期':
            this.Click_XYK();
            break;
          case '花呗分期':
            this.Click_HBFQ();
            break;
        }
      },
 
 
      //信用卡分期点击
      Click_XYK() {
        console.log('信用卡分期点击');
      },
 
      //花呗分期
      Click_HBFQ() {
        console.log('花呗分期');
      },
 
 
    }
  }
</script>
 
<style scoped lang="less">
  .product-box {
      padding-bottom: 100px;
 
    //产品标题
    .product-title {
      .lh(44px);
      background: @c-black;
      font-size: @font-16;
      color: @c-fff;
      font-weight: bold;
      text-align: center;
    }
 
 
    .alipay{
      width: 360px;
      margin: 0 auto;
      .flex(center,center,warp,column);
      margin-top: 20px;
      min-height: 130px;
      background-color: @c-fff;
      .van-icon{
        font-size: 55px;
        margin-bottom: 15px;
        color: @c-default;
      }
      p{
        font-size: @font-12;
        color: @c-default;
      }
    }
 
 
    //产品列表
    .grid {
      margin: 15px auto 0 auto;
      width: 360px;
      background-color: @c-bg-fff;
      .flex(flex-start, center, wrap);
      z-index: @zIndex-20;
      box-shadow: 0 8px 20px 0 rgba(66, 61, 93, 0.05);
      border-radius: 3px;
      .item {
        width: 120px;
        height: 122px;
      }
      .icon{
        width:35px;
        height:35px;
       /* fill:@c-default;*/
      }
      .label {
        margin-top: 15px;
        color: @c-text-666;
      }
    }
 
 
 
    .list-title{
      width: 100%;
      .lh(44px);
      padding-left: 25px;
      border-bottom: 1px solid #c7c7c7;
    }
 
 
    //单独修改某一单元格样式
    .iconshoujifenqi{
 
    }
 
 
 
  }
</style>