<template>
  <view class="marketing-member-record">
    <view class="filter-card border-shadow">
      <view class="filter-row">
        <view class="filter-item">
          <text class="label">会员名：</text>
          <input class="input-mock" placeholder="请输入会员名" />
        </view>
        <view class="filter-item">
          <text class="label">支付方式：</text>
          <view class="select-mock">
            <text class="select-val">全部</text>
            <text class="arrow">▼</text>
          </view>
        </view>
        <view class="btn-group">
          <button class="btn btn-search">查询</button>
          <button class="btn btn-reset">重置</button>
        </view>
      </view>
    </view>

    <view class="table-card border-shadow">
      <view class="table-container">
        <view class="table-head">
          <view class="th cell-id">ID</view>
          <view class="th cell-user">用户信息</view>
          <view class="th cell-type">会员类型</view>
          <view class="th cell-price">支付金额</view>
          <view class="th cell-pay">支付方式</view>
          <view class="th cell-time">购买时间</view>
          <view class="th cell-expire">过期时间</view>
        </view>

        <view class="table-body">
          <view v-for="item in records" :key="item.id" class="table-row">
            <view class="td cell-id"><text class="td-txt">{{ item.id }}</text></view>
            <view class="td cell-user">
              <view class="user-box">
                <image class="avatar" :src="item.avatar"></image>
                <text class="nickname">{{ item.nickname }}</text>
              </view>
            </view>
            <view class="td cell-type"><text class="td-txt">{{ item.member_type }}</text></view>
            <view class="td cell-price"><text class="td-txt">￥{{ item.price.toFixed(2) }}</text></view>
            <view class="td cell-pay"><text class="td-txt">{{ item.pay_type }}</text></view>
            <view class="td cell-time"><text class="td-txt">{{ item.create_time }}</text></view>
            <view class="td cell-expire"><text class="td-txt">{{ item.expire_time }}</text></view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup lang="uts">
import { ref } from 'vue'

const records = ref([
  { id: 10, avatar: 'https://demo26.crmeb.net/uploads/attach/2021/11/20211115/a6f3b06e9d6d5a1b3c9d6d5a1b3c9d6d.png', nickname: '张三', member_type: '年卡会员', price: 99.00, pay_type: '微信支付', create_time: '2023-11-20 10:00:00', expire_time: '2024-11-20 10:00:00' },
  { id: 9, avatar: 'https://demo26.crmeb.net/uploads/attach/2021/11/20211115/a6f3b06e9d6d5a1b3c9d6d5a1b3c9d6d.png', nickname: '李四', member_type: '月卡会员', price: 9.90, pay_type: '余额支付', create_time: '2023-11-19 15:30:00', expire_time: '2023-12-19 15:30:00' },
  { id: 8, avatar: 'https://demo26.crmeb.net/uploads/attach/2021/11/20211115/a6f3b06e9d6d5a1b3c9d6d5a1b3c9d6d.png', nickname: '王五', member_type: '体验会员', price: 0.00, pay_type: '激活码', create_time: '2023-11-18 09:20:00', expire_time: '2023-11-25 09:20:00' }
])
</script>

<style scoped lang="scss">
.marketing-member-record {
  padding: 0;
  background: transparent;
  min-height: auto;
}

.border-shadow {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}

.filter-card {
  padding: 24px;
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.filter-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-right: 24px;
}

.label {
  font-size: 14px;
  color: #333;
  width: 70px;
}

.input-mock {
  width: 180px;
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
}

.select-mock {
  width: 180px;
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 0 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.select-val { font-size: 14px; color: #606266; }
.arrow { font-size: 10px; color: #c0c4cc; }

.btn-group {
  display: flex;
  flex-direction: row;
}

.btn {
  height: 32px;
  line-height: 32px;
  padding: 0 20px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 8px;
  background: #fff;
  border: 1px solid #dcdfe6;
  color: #606266;
}

.btn-search { background: #1890ff; color: #fff; border: none; }

.table-card { padding: 24px; }
.table-head {
  display: flex;
  flex-direction: row;
  background-color: #f8f8f9;
  border-bottom: 1px solid #e8eaec;
}
.th { padding: 12px 8px; font-size: 13px; color: #515a6e; font-weight: bold; }
.table-row {
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid #e8eaec;
  align-items: center;
}
.td { padding: 16px 8px; }
.td-txt { font-size: 13px; color: #515a6e; }

.cell-id { width: 60px; }
.cell-user { flex: 1; }
.cell-type { width: 120px; }
.cell-price { width: 100px; }
.cell-pay { width: 100px; }
.cell-time { width: 160px; }
.cell-expire { width: 160px; }

.user-box {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  margin-right: 8px;
}
.nickname { font-size: 13px; color: #515a6e; }
</style>



