liangjin
2021-04-09 e03053f364c9284824a947912c39fa77b32ec570
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
<!--
 * @Author: 小明丶
 * @Date: 2020-04-07 09:40:03
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-06-28 11:21:56
 * @Description: 产品管理花呗业务页面
 -->
<template>
    <div class="hb-product-box">
        <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>
        <div class="info-box">
            <div class="info" v-for="(item,i) in productList" :key="i" @click="goNext(item)">
                <img :src="item.icon" alt="">
                <p>{{item.typeName}}</p>
            </div>
        </div>
    </div>
</template>
<script>
import Vue from 'vue';
import { NavBar } from 'vant';
 
Vue.use(NavBar);
export default {
    data() {
        return {
           productList:[], 
           openStatus:'',
        }
    },
    created(){
        
        if(this.$route.query.openStatus || this.$route.query.openStatus==0){
            window.sessionStorage.openStatus = this.$route.query.openStatus
        }
        
        this.$api.prodHbProd().then(res=>{
            this.productList = res.body
        })
    },
    methods:{
        onClickLeft() {
            this.$router.push('/main/productManagement');
        },
        goNext(item){
            var path = '',
                title = '';
                
            var {typeId,prodId} = item
            var query = {
                    typeId,
                    prodId,
                    zfbVersion:this.$route.query.zfbVersion,
                };
            
                if(typeId==='200010'){
                    switch(Number(window.sessionStorage.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;
                    }
                    title = '商户贴息'
                }
                if(typeId==='200009'){
                   switch (Number(window.sessionStorage.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 = '商品消费'
                }
                if (typeId === '200002' || typeId === '200008') {
                    switch (Number(window.sessionStorage.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 = '商户收款';
                    }
                }
            this.$router.push({
                path:path,
                query:{
                    title:title,
                    ...query
                }
            })
        }
    },
}
</script>
<style lang="less" scoped>
    .hb-product-box{
        background: #F5F5F7;
        min-height: 100vh;
        padding-top: 56px;
        .info-box{
            background: #fff;
            width: 96%;
            margin-left: 2%;
            padding-bottom: 23px;
            border-radius:3px;
            .info{
                text-align: center;
                width: 49%;
                display: inline-block;
                margin-top: 23px;
                img{
                    width: 36px;
                    height: 36px;
                }
            }
        }
    }
</style>