zhaoxiaoqiang
2021-07-20 2891aa37d99bc458a2ce501cb4ea185b363744f4
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
<!--
 * @Author: 小明丶
 * @Date: 2019-08-30 18:04:49
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-12-04 14:17:25
 * @Description:
 -->
<template>
    <div class="productManagement-page">
        <!-- <x-header title="产品管理" :left-options="{backText:'',showBack:false}"></x-header> -->
        <van-nav-bar title="产品管理" left-text="返回" left-arrow @click-left="onClickLeft" fixed style="line-height: 43px;">
            <i class="iconfont iconzuojiantou" slot="left" style="font-size: 25px;"></i>
        </van-nav-bar>
        <!--<x-header slot="header" title="产品管理" :left-options="{backText:'',preventGoBack:true}"-->
            <!--@on-click-back="pageGoBack()"></x-header>-->
        <div class="productManagement-header">
            <ul class="productManagement-list">
                <!-- v-if="productList1.length" -->
                <li class="item"  @click="handleJump(item)" v-for="(item,index) in productList1" :key="index">
                    <img :src="item.icon" style="width:40px;height:40px"></img>
                    <p style="margin-top:5px">商户收款</p>
                </li>
                <li class="item"  @click="goHbCp" v-if="productList2.length">
                    <i class="iconfont iconhuabei" style="color:#108FEA;width:20px;height:20px"></i>
                    <p style="margin-top:5px">花呗分期</p>
                </li>
                <li class="item" @click="handleJump(i)" v-for="(i,index) in productList3" :key="index" v-show="productList3.length">
                    <img class="item-logo" :src="i.icon" :alt="i.typeName">
                    <p>{{i.typeName}}</p>
                    <div class="tip-box" :style="i.openStatus==0?{background:'#F2F2F2'}:i.openStatus==1?{background:'#FFF5D9'}:i.openStatus==2?{background:'#E3FAEF'}:i.openStatus==3?{background:'#FCF0F0'}:''">
                        <p v-if="i.openStatus==2" style="color:#19BE6B;">已开通</p>
                        <p v-if="i.openStatus==1" style="color:#FFC421;">开通中</p>
                        <p v-if="i.openStatus==3" style="color:#FF6666;">未通过</p>
                        <p v-if="i.openStatus==0" style="color:#999999;">未开通</p>
                    </div>
                </li>
            </ul>
        </div>
        <f-no-data v-if="(productList2.length == 0) && (productList3.length == 0)"></f-no-data>
    </div>
</template>
 
<script>
    import { mapState } from 'vuex';
    import Vue from 'vue';
    import { NavBar } from 'vant';
 
    Vue.use(NavBar);
    export default {
        name: 'productManagement',
        data() {
            return {
                productList3: [],
                productList2: [],
                productList1: []
            };
        },
        created(){
            this.init();
        },
        computed:{
            ...mapState(['userinfo']),
        },
        methods: {
            goShsk(){
 
            },
            goHbCp() {
                this.$router.push('/hbcp_sh')
            },
            onClickLeft() {
                this.$router.push({
                    path: '/main/mine'
                });
            },
            handleJump(productItem) {
                console.log('test', productItem)
                let {
                    typeId,
                    prodId,
                    openStatus,
                    zfbVersion
                } = productItem,
                path = '',
                title = '',
                query = {
                    typeId,
                    prodId,
                    zfbVersion,
                    openStatus
                };
                if(zfbVersion){
                    path = '/main/hb-product'
                }
                if(typeId==='200014'){
                    switch(openStatus){
                        case 2 :
                            path = "/huabei/staging_hbjl";
                            break;
                    }
                    query={
                        typeId,
                        orgType: this.userinfo.orgType,
                        orgId: this.userinfo.orgId
                    }
                }
                if(typeId==='200010'){
                    switch(openStatus){
                        case 0:
                            path = '/huabei/open';
                            break;
                        case 1:
                        case 3:
                            path = '/huabei/open-result';
                            break;
                        case 2:
                            path = '/shtx/staging';
                            break;
                        default:
                            path = '/huabei/open';
                            break;
                    }
                }
                if(typeId === '200008'){
                    path = '/channel-selection_sh';
                }
                if(typeId==='200009'){
                    typeId = '200002'
                }
                //  openStatus 1-开通中,2-已开通, 3-未开通
                //  openStatus 0-待开通  1-开通中,2-已开通, 3-开通失败
                // typeId 200001 信用卡分期
 
                if (typeId === '200001') {
                    path = '/creditStaging';
                    query = {
                        typeId,
                        orgType: this.userinfo.orgType,
                        orgId: this.userinfo.id
                    }
                } else if (typeId === '200002') {
                    switch (openStatus) {
                        case 0:
                            path = '/huabei/open';
                            break;
                        case 1:
                        case 3:
                            path = '/huabei/open-result';
                            break;
                        case 2:
                            if(typeId=='200008'){
                                path = '/huabei/staging_dmf';
                            }else{
                                path = '/huabei/staging';
                            }
                            break;
                        default:
                            path = '/huabei/open';
                            break;
                    }
                    if(typeId==='200002'){
                        title = '花呗分期';
                    }else{
                        title = '商户收款';
                    }
                } else if (typeId === '200003') {
                    path = '/ljcreditStaging';
                    query = {
                        typeId,
                        orgType: this.userinfo.orgType,
                        orgId: this.userinfo.id
                    }
                    // 购机直降
                } else if (typeId === '200004') {
                    // 0-待开通,1-开通中,2-已开通,3-开通失败
                    switch (openStatus) {
                        case 0:
                            path = '/gjzj/open';
                            break;
                        case 1:
                        case 2:
                        case 3:
                            path = '/gjzj/open-result';
                            break;
                        default:
                            path = '/huabei/open';
                            break;
                    }
                    query = {
                        typeId,
                        openStatus: openStatus,
                        icon: productItem.icon,
                    }
                }else if (typeId === '200005') {
                    // 0-待开通,1-开通中,2-已开通,3-开通失败
                    switch (openStatus) {
                        case 0:
                            path = '/heyd/merOpen';
                            break;
                        case 1:
                        case 2:
                        case 3:
                            path = '/heyd/open-result';
                            break;
                        case 4:
                            path = '/heyd/open-result';
                            break;
                        default:
                            path = '/heyd/merOpen';
                            break;
                    }
                    query = {
                        typeId,
                        openStatus: openStatus,
                        orgType: this.userinfo.orgType,
                        icon: productItem.icon,
                    }
                }else if (typeId === '200011') {
                    if(productItem.prodId=='30000012'){
                        switch (openStatus) {
                            case 0:
                                path = '/huabei/open';
                                break;
                            case 1:
                            case 3:
                                path = '/huabei/open-result';
                                break;
                            case 2:
                                path = '/huabei/staging';
                                break;
                            default:
                                path = '/huabei/open';
                                break;
                        }
                        title = '信用购-花呗分期';
                        query = {
                            typeId,
                            openStatus: openStatus,
                            orgType: this.userinfo.orgType,
                            icon: productItem.icon,
                            prodId:productItem.prodId
                        }
                    }else{
                        // 0-待开通,1-开通中,2-已开通,3-开通失败
                        switch (openStatus) {
                            case 0:
                                path = '/xyg/merOpen';
                                break;
                            case 1:
                            case 2:
                            case 3:
                                path = '/xyg/open-result';
                                break;
                            case 4:
                                path = '/xyg/open-result';
                                break;
                            default:
                                path = '/xyg/merOpen';
                                break;
                        }
                        title = '信用购-储蓄卡';
                        query = {
                            typeId,
                            openStatus: openStatus,
                            orgType: this.userinfo.orgType,
                            icon: productItem.icon,
                            prodId:productItem.prodId
                        }
                    }
 
                }else if (typeId === '200017') {
                    // 0-待开通,1-开通中,2-已开通,3-开通失败
                    switch (openStatus) {
                        case 0:
                            path = '/gzzj/merOpen';
                            break;
                        case 1:
                        case 2:
                        case 3:
                            path = '/gzzj/open-result';
                            break;
                        case 4:
                            path = '/gzzj/open-result';
                            break;
                        default:
                            path = '/gzzj/merOpen';
                            break;
                    }
                    query = {
                        typeId,
                        openStatus: openStatus,
                        orgType: this.userinfo.orgType,
                        icon: productItem.icon,
                    }
                }
                query.title = title;
                this.$router.push({
                    path,
                    query
                });
            },
            //初始化
            init() {
                this.$api.prodManagerInit().then(res => {
                    this.productList3 = [...res.body.prodTypeRespVoList3];
                    this.productList2 = [...res.body.prodTypeRespVoList2];
                    this.productList1 = []
                    this.productList2.forEach(item=>{
                        if(item.prodId == 30000008){
                            this.productList1.push(item)
                        }
                    })
                    console.log(this.productList1)
                    localStorage.setItem('hbcp_sh', JSON.stringify(res.body.prodTypeRespVoList2))
                });
            }
        },
    };
 
</script>
 
<style lang="less">
 
    .item-logo{
        display: block-line;
        vertical-align: middle;
        width: 45px;
        height: 45px;
        margin-left: auto;
    }
    .productManagement-page {
        // padding-top: 54px;
        background-color: #F5F5F7;
        min-height: 100vh;
        // padding-top: 44px;
 
        .productManagement-header {
            height: 100%;
            background: #F5F5F7;
            //margin-top: 50px;
            padding-top: 50px;
            .productManagement-list {
                box-sizing: border-box;
                padding:0 25px 50px;
                border-radius:3px;
                overflow: hidden;
                height: 100%;
                width: 359px;
                margin: auto;
                background: #fff;
                display: flex;
                flex-wrap: wrap;
                justify-content: space-between;
                .item{
                    position: relative;
                    margin-top: 28px;
                    width:35vw;
                    height:80px;
                    background:rgba(255,255,255,1);
                    box-shadow:0px 0px 15px 0px rgba(66,61,93,0.08);
                    border-radius:8px;
                    .tip-box{
                        position: absolute;
                        width:45px;
                        height:16px;
                        line-height: 16px;
                        border-radius:8px 0px 0px 8px;
                        top: 7px;
                        right: 0;
                        p{
                            font-size: 10px;
                        }
                    }
                }
                .open{
                    color:#19BE6B;
                    margin-top: 8px;
                }
                .notOpen{
                    color:#ED4014;
                    margin-top: 8px;
                }
                .iconfont {
                    font-size: 36px;
                    color: @color-text-placeholder;
                }
 
                .usable {
                    color: @color-text-three  !important;
                }
 
                li {
                    list-style: none;
                    float: left;
                    width: 49%;
                    text-align: center;
                    padding-top: 20px;
 
                    p {
                        font-size: @font-size-small;
                    }
                }
            }
        }
    }
 
</style>