liangjin
2021-04-09 ebc11188a97946a82d2edd5c16df1e8f2f963945
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
<!--
 * @Author: 小明丶
 * @Date: 2019-08-19 15:50:40
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-11-19 16:36:23
 * @Description: 商户详情页面
 -->
<template>
    <div class="mer-info-box h-100-g">
        <v-navbar title="商户信息" fixed></v-navbar>
 
        <div class="content">
            <div class="cell-group">
                <v-cell v-model="info.merId" :Show_input="false" label='商户ID' icon='iconyonghu' readonly placeholder='请输入渠道名称'></v-cell>
                <v-cell v-model="info.merName" :Show_input="false" label='商户名称' icon='iconmobanguanliliebiao' readonly placeholder='请输入营业执照号' @click.native="copyText"></v-cell>
                <v-cell v-model="info.licenseNo" :Show_input="false" label='营业执照号' icon='iconyinhangka' readonly placeholder='请输入身份证号'></v-cell>
                <v-cell v-model="Addrs" :Show_input="false" label='所在地区' icon='icondingwei' readonly placeholder='请选择'></v-cell>
                <v-cell v-model="info.addr.dtlAddr" :Show_input="false" label='详细地址' icon='icontishi' readonly placeholder='请输入详细地址'></v-cell>
            </div>
 
            <div class="cell-group">
                <v-cell v-model="info.legalName" :Show_input="true" label='法人姓名' readonly placeholder='请输入姓名'></v-cell>
                <v-cell v-model="info.legalIdNo" :Show_input="false" label='法人身份证号' readonly placeholder='请输入手机号'></v-cell>
            </div>
 
            <div class="cell-group">
                <v-cell v-model="info.priName" :Show_input="false" label='负责人姓名' readonly placeholder='请输入姓名'></v-cell>
                <v-cell v-model="info.priMblNo" :Show_input="false" label='负责人手机号' readonly placeholder='请输入手机号'></v-cell>
            </div>
            
 
            <footer class="flex-center-g footer">
                <van-button class="btn left" @click="openDialog">{{info.freezeStatus?'冻结':'启用'}}商户</van-button>
                <van-button class="btn right" :color="$store.state.backColor" @click="$router.push(`/main/home?id=${info.merId}`)">订单查询</van-button>
            </footer>
        </div>
    </div>
</template>
<script>
    import {_copyToClipboard} from '@/utils/index';
    export default {
        data() {
            return {
                Addrs:'',
                info:{
                    addr:{
                        dtlAddr:'',
                        province:{name:''},
                        city:{name:''},
                        area:{name:''},
                    },
 
                }
            }
        },
        created(){
            this.init();
        },
        methods:{
            goNext(){
                console.log(this.info.merZfbInfos)
 
                sessionStorage.setItem('td-mer-photo', JSON.stringify(this.info.merZfbInfos))
                this.$router.push({
                    path:'/mine/mer-photo-chose',
                    query:{
                        merId:this.info.merId
                    }
                })
            },
            copyText(){
                _copyToClipboard(this.info.merName)
                this.$notify('复制成功!')
            },
            init(){
                let obj = {
                    merId:this.$route.query.merId
                };
                this.$api.merDetail(obj).then(res => {
                    this.info = res.body;
                    let list = []
                    res.body.merZfbInfos.forEach((item, index) => {
                        if(sessionStorage.isddxt == 1){
                            if(item.zfbVersion == 6 || item.zfbVersion == 7) {
                                list.push(item)
                            }
                        }else{
                            if(item.zfbVersion != 6 && item.zfbVersion != 7){
                                list.push(item)
                            }
                        }
                    })
                    this.info.merZfbInfos = list
                    let province = this.info.addr.province ||'',
                        city = this.info.addr.city ||'',
                        merZfbInfos = this.info.merZfbInfos,
                        area = this.info.addr.area ||'';
                    this.Addrs = (province.name || '') +  (city.name || '') + (area.name || '');
                    console.log(list)
                });
            },
 
            // 冻结启用 商户
            openDialog(){
                let {merId,freezeStatus} = this.info;
                this.$dialog.confirm({
                    message: `请问是否确认${freezeStatus ? '冻结' : '启用'}该商户?`
                }).then(() => {
                    let statusType = freezeStatus ? 0 : 1;
                    this.$api.channSwitchStatus({
                        orgId: merId,
                        orgType: 3,
                        statusType
                    }).then((res) => {
                        let text = statusType ? '启用成功' : '冻结成功';
                        this.info.freezeStatus = statusType;
                        this.$notify_success(text)
                    }).catch((err) => {
 
                    });
                }).catch(() => {
                    // on cancel
                });
            },
 
        }
    }
</script>
<style lang="less" scoped>
    .mer-info-box {
        background-color: @c-bg-f5;
        padding-top: 44px;
        .content {
            padding: 10px 8px;
        }
 
        .cell-group {
            margin-bottom: 10px;
        }
    }
 
    .footer {
        margin-top: 30px;
        padding-bottom: 30px;
 
        .btn {
            width: 170px;
            height: 44px;
            border: none;
            font-size: @font-16;
 
            &.left {
                background-color: @c-bg-eee;
                color: @c-text-666;
                border-radius: 22px 0px 0px 22px;
            }
 
            &.right {
                background-color: @c-bg-default;
                color: @c-text-fff;
                border-radius: 0px 22px 22px 0px;
            }
        }
    }
</style>