11
zhouhao
2021-11-04 427bd60f5d568a235703e2c54498d8f57724ffe7
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
<!--
 * @Author: 小明丶
 * @Date: 2019-08-15 15:40:14
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-11-19 18:28:39
 * @Description:
 -->
<template>
    <div class="channel-box ">
        <v-navbar title="渠道管理" fixed></v-navbar>
        <van-search class="search" placeholder="请输入商户名称/负责人电话" v-model="value" shape='round' />
        <!-- <div class="list-box-div"> -->
           
                <div class="item-box">
                    <router-link class="channel-item flex-start-g" v-for="(item, index) in calcChanList" :key="index" :to="{path:'/mine/channel-add',query:{chanId:item.chanId}}">
                        <p class="icon-box flex-center-g" :style="{background:$store.state.backColor}">
                            <svg class="icon" aria-hidden="true" style="width:25px;height:25px;fill:#fff" @click="$router.back()">
                                <use xlink:href="#iconyonghu"></use>
                            </svg>
                        </p>
                        <div>
                            <p class="name">{{item.priName}}</p>
                            <p class="c-text-666-g font-12-g">{{item.priMblNo}}</p>
                        </div>
                    </router-link>
                </div>
                <!-- <van-button class="btn" @click="$router.push('/mine/channel-add')">
                    <div class="inner">
                        <van-icon name="plus" />
                        <span class="text">新增</span>
                    </div>
                </!-->
                <v-button-circle icon='iconjia' title='新增' @click="$router.push('/mine/channel-add?isAdd=1')"></v-button-circle>
           
        <!-- </div> -->
    </div>
</template>
 
<script>
import hList from '../../../components/common/h-list';
export default {
    components:{
        hList
    },
    data() {
        return {
            finished:false,
            loading:false,
            value:'',
            chanList:[]
        }
    },
    computed:{
        // 根据搜索关键字获取 对应的数据
        calcChanList(){
            let v = this.value;
            let arr = this.chanList.filter(item=>{
                return item.priName.indexOf(v) > -1 || item.priMblNo.indexOf(v) > -1;
            })
            if(arr){
                return arr
            }
            return this.chanList;
        }
    },
    created(){
        this.init()
    },
    methods: {
        saleOrderLoad(){
            this.finished = true
        },
        init(){
            this.$api.getChannel().then((res) => {
                let {chanList} = res.body;
                let arr = [];
                for(let key in chanList){
                    arr.push(...chanList[key])
                }
                this.chanList = arr;
                //this.chanList = [...arr,...arr,...arr,...arr,...arr,...arr,...arr,...arr,...arr];//调试用
            }).catch((err) => {
 
            });
        },
        go(){
            this.$router.push('/mine/channel-detail')
        }
    },
}
</script>
<style lang="less" scoped>
.channel-box{
    background-color: @c-bg-f5;
    padding-top: 44px;
    //padding-bottom: 50px;
    // .list-box-div{
    //         overflow: scroll;
    //         height: 80vh;
    //     }
    // .list-box-div::-webkit-scrollbar,.withdrawals-box::-webkit-scrollbar {
    //     display: none;
    // }
    .btn{
        position: fixed;
        width:50px;
        height:50px;
        padding: 0;
        right: 8px;
        bottom: 68px;
        border-radius:50%;
        color: @c-text-f5;
        z-index: @zIndex-50;
        box-shadow:0px 5px 9px 0px rgba(80,47,183,0.2);
        background:linear-gradient(0deg,rgba(106,79,188,1),rgba(137,110,219,1));
        .inner{
            display: flex;
            flex-direction: column;
        }
        .text{
            .lh(15px);
        }
    }
}
.search{
    margin-top: 10px;
    padding: 15px 8px;
}
.item-box{
    background-color: @c-bg-fff;
    padding-bottom: 25px;
}
.channel-item{
    height: 67px;
    margin: 0 8px 10px;
    padding-left: 12px;
    box-shadow:0px 0px 5px 0px rgba(66,61,93,0.08);
    border-radius:3px;
    color: @c-text-333;
    .icon-box{
        width: 32px;
        height: 32px;
        margin-right: 15px;
        border-radius: 50%;
        background-color: @c-bg-black;
    }
    .name{
        margin-bottom: 5px;
        font-weight: bold;
    }
}
</style>