<template>
    <TContainer>
        <view class="client">
            <view class="search">
                <TSearch
                    v-model="searchValue"
                    placeholder="请输入客户名称"
                    backgroundColor="#F4F4F4"
                />
            </view>
            <view class="list">
                <block v-for="item in clientList" :key="item.id">
                    <ClientCard :item="item" />
                </block>
            </view>
            <view class="float-btn" @click="handleAddClient">
                <view>
                    <TIcon name="icon-add" :size="24" color="#fff" />
                </view>
            </view>
        </view>
    </TContainer>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import ClientCard from './components/client-card.vue'
import { IClient } from './interface'

const searchValue = ref('')
const clientList = ref<IClient[]>([
    {
        id: 1,
        contact: '张三',
        mobile: '12345678901',
        address: '北京市朝阳区芍药居',
        createTime: '2021-01-01'
    },
    {
        id: 2,
        contact: 'kaeery',
        mobile: '18138952909',
        address: '北京市朝阳区芍药居',
        createTime: '2021-01-01'
    }
])
// 添加客户
const handleAddClient = () => {
    uni.navigateTo({
        url: '/bundle/pages/salesman/client-info/index'
    })
}
</script>

<style lang="scss" scoped></style>
