<template>
  <clinic-salesperson-page-layout title="获客记录" :show-back="true">
    <view class="page">
      <view v-if="!list.length" class="empty">暂无获客记录</view>
      <view v-for="item in list" :key="item.id" class="row">
        <view>
          <text class="name">{{ item.user_nick_name || '用户' }}</text>
          <text class="phone">{{ item.user_phone }}</text>
        </view>
        <text class="time">{{ item.bind_at_text }}</text>
      </view>
    </view>
  </clinic-salesperson-page-layout>
</template>

<script>
import ClinicSalespersonPageLayout from '@/subPackages/sub_clinic_salesperson/components/clinic-salesperson-page-layout.vue'
import { getClinicSalespersonUserBindList } from '@/api/clinicSalesperson.js'

export default {
  components: { ClinicSalespersonPageLayout },
  data() {
    return { list: [] }
  },
  onLoad() {
    this.loadList()
  },
  methods: {
    async loadList() {
      const wrap = await getClinicSalespersonUserBindList({ page: 1, pageSize: 50 })
      if (wrap && wrap.ok) this.list = wrap.data?.items || []
    },
  },
}
</script>

<style lang="scss" scoped>
.page { padding: 24rpx; }
.empty { text-align: center; color: #999; padding: 80rpx 0; }
.row { background: #fff; border-radius: 12rpx; padding: 24rpx; margin-bottom: 16rpx; display: flex; justify-content: space-between; align-items: center; }
.name { display: block; font-size: 28rpx; font-weight: 600; }
.phone { font-size: 24rpx; color: #666; }
.time { font-size: 22rpx; color: #999; }
</style>
