<template>
    <view class="customer-manage">
        <up-sticky>
            <view class="customer-search">
                <u-search placeholder="请输入客户名称" shape="square" color="#676767" bgColor="rgba(241, 242, 246, 0.2)"
                    borderColor="#F1F2F6" :showAction="false" v-model="keyword" :disabled="true" @click="openSearch"></u-search>
            </view>
            <view class="customer-dropdown">
                <u-dropdown>
                    <u-dropdown-item v-model="attach" title="归属" :options="attachList"></u-dropdown-item>
                    <u-dropdown-item v-model="cycle" title="周期" :options="cycleList"></u-dropdown-item>
                    <u-dropdown-item v-model="level" title="等级" :options="levelList"></u-dropdown-item>
                    <u-dropdown-item v-model="source" title="来源" :options="sourceList"></u-dropdown-item>
                </u-dropdown>
            </view>
        </up-sticky>
        <u-list height="440" style="padding-bottom: 16rpx;" scrollable enableBackToTop>
            <u-list-item v-for="item in 6" :key="item">
                <view class="u-list-item-content">
                    <view class="u-list-item-header">
                        <view class="u-list-item-title">华东电力集团公司超萨德勒环境</view>
                        <view class="u-list-item-tag">
                            <up-tag text="S级客户" height="36rpx" padding="4rpx 16rpx" plain plainFill
                                borderColor="transparent" color="#FF991B" :autoBgColor="80"></up-tag>
                            <up-tag text="业主单位" height="36rpx" padding="4rpx 16rpx" plain plainFill
                                borderColor="transparent" color="#2B69F8" :autoBgColor="80"></up-tag>
                        </view>
                    </view>
                    <view class="u-list-item-desc">
                        <view class="text">项目编号信息占位</view>
                        <view class="line"></view>
                        <view class="text">服务商提供</view>
                        <view class="line"></view>
                        <view class="text">王延亮</view>
                    </view>
                    <view class="u-list-item-info">
                        <view class="u-list-item-info-text">
                            <view class="company">股份有限公司</view>
                            <view class="evaluate">回款快、配合度高、回款dddddd</view>
                        </view>
                        <view class="u-list-item-info-address">
                            山东省青岛市市南区延安一路102号
                        </view>
                    </view>
                    <view class="u-list-item-extra">
                        <image class="img" src="@/static/images/tabbar/audit.png"></image>
                    </view>
                </view>

            </u-list-item>
        </u-list>
    </view>
    <view class="customer-float">
        创建客户
    </view>
    <view class="customer-footer">
        合作共赢 品质第一
    </view>
</template>
<script setup>
import { ref } from 'vue'

/* 搜索 */
const keyword = ref('')
const url = '/api/customer/list'
function openSearch() {
    uni.navigateTo({
        url: '/pages/common-search/index?url='+url
    })
}
/* 下拉菜单条件 */
const attachList = ref([
    {
        label: '仅本人',
        value: 1,
    },
    {
        label: '仅本人及下属',
        value: 2,
    },
    {
        label: '仅本部门',
        value: 3,
    },
    {
        label: '仅本部门',
        value: 3,
    }
])
const cycleList = ref([
    {
        label: '全部',
        value: 1,
    },
    {
        label: '本周',
        value: 1,
    },
    {
        label: '本月',
        value: 2,
    },
    {
        label: '本季度',
        value: 3,
    },
    {
        label: '本年',
        value: 3,
    }
])
const levelList = ref([
    {
        label: '全部',
        value: 1,
    },
    {
        label: 'S级',
        value: 1,
    },
    {
        label: 'A级',
        value: 2,
    },
    {
        label: 'B级',
        value: 2,
    },
    {
        label: 'C级',
        value: 2,
    }
])
const sourceList = ref([
    {
        label: '全部',
        value: 1,
    },
    {
        label: '自主开发',
        value: 1,
    },
    {
        label: '转介绍',
        value: 2,
    },
    {
        label: '服务商提供',
        value: 2,
    },
    {
        label: '商场活动',
        value: 2,
    }
])
const attach = ref(1)
const cycle = ref(1)
const level = ref(1)
const source = ref(1)
/* tag 样式 */
const levelTagStyle = ref([
    {
        color: '#FF991B',
        text: 'S级客户'
    },
    {
        color: '#2B69F8',
        text: 'A级客户'
    },
    {
        color: '#1ABEF1',
        text: 'B级客户'
    },
    {
        color: '#B7B7B7',
        text: 'C级客户'
    },
    {
        color: '#F23947',
        text: '禁止客户'
    },
])
const typeTagStyle = ref([
    {
        color: '#4FBF67',
        text: '投资单位'
    },
    {
        color: '#378EFF',
        text: '业主单位'
    },
    {
        color: '#FF9019',
        text: '总承包单位'
    },
    {
        color: '#FC5A5A',
        text: '设计单位'
    },
    {
        color: '#169EE8',
        text: '招标代理单位'
    },
])
</script>
<style lang='scss' scoped>
.customer-manage {
        background-color: #FFFFFF;
        border-radius: 16rpx;
        margin-bottom: 8rpx;
        z-index: 1;

        .customer-search {
            padding: 20rpx;
        }

        .u-list-item-content {
            display: flex;
            flex-direction: column;
            margin: 16rpx;
            gap: 16rpx;
            border-radius: 16rpx;
            box-shadow: 0px 0px 4px 0px rgba(163, 163, 163, 0.6);

            .u-list-item-header {
                display: flex;
                flex-direction: row;
                padding: 16rpx 16rpx 0 16rpx;

                .u-list-item-title {
                    flex: 1;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    font-size: 32rpx;
                    font-family: 'PingFang SC';
                    font-weight: 500;
                }

                .u-list-item-tag {
                    flex: 1;
                    display: flex;
                    flex-direction: row;
                    gap: 16rpx;
                }
            }

            .u-list-item-desc {
                color: #797979;
                display: flex;
                flex-direction: row;
                align-items: center;
                padding: 0 16rpx;
                gap: 8rpx;

                .text {
                    font-size: 24rpx;
                    font-family: 'PingFang SC';
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

                .line {
                    width: 1px;
                    height: 16rpx;
                    background-color: #797979;
                }
            }

            .u-list-item-info {
                display: flex;
                flex-direction: column;
                padding: 0 16rpx 16rpx 16rpx;

                .u-list-item-info-text {
                    display: flex;
                    flex-direction: row;
                    justify-content: space-between;
                    font-size: 28rpx;
                    font-family: 'PingFang SC';
                    color: #797979;

                    .company {
                        width: 40%;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                    }

                    .evaluate {
                        width: 60%;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                    }
                }

                .u-list-item-info-address {
                    font-size: 28rpx;
                    font-family: 'PingFang SC';
                    color: #797979;
                    width: 100%;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    overflow: hidden;
                }

            }

            .u-list-item-extra {
                position: absolute;
                right: 16rpx;
                z-index: 2;

                .img {
                    width: 100rpx;
                    height: 100rpx;
                }
            }
        }

    }

    .customer-float {
        position: fixed;
        bottom: 90rpx;
        right: 0;
        z-index: 999;
        background-color: #2b69f8;
        color: #fff;
        display: flex;
        align-items: center;
        cursor: pointer;
        padding: 20rpx 40rpx;
        box-shadow: 0px 0px 4px 0px rgba(186, 186, 186, 0.25);
        border-radius: 40rpx 0 0 40rpx;
    }

    .customer-footer {
        position: absolute;
        bottom: 8rpx;
        display: flex;
        justify-content: center;
        color: #B8B8B8;
        font-size: 24rpx;
        width: 100%;
    }
</style>