<route lang="json5" type="page">
{
  style: {
    navigationBarTitleText: '我的资产',
    navigationBarBackgroundColor: '#fff',
  },
}
</route>

<template>
  <view class="min-h-screen py-15">
    <view class="mx-15 text-16 font-bold text-#333">我的资产</view>
    <view
      class="mt-15 mx-15 text-white btn-gradient p-15 rounded-10 shadow-[0_5px_30px_rgba(55,230,236,0.4)]"
    >
      <view class="text-14">总投资金</view>
      <view class="text-35 mt-10 font-bold">{{ userStore.userInfo?.member_investment }}</view>
      <view class="flex mt-15">
        <view class="flex-1">
          <view class="text-12 font-light">我的分红</view>
          <view class="text-16 font-bold mt-5">{{ userStore.userInfo?.member_dividend }}</view>
        </view>
        <view class="flex-1">
          <view class="text-12 font-light">数字人民币</view>
          <view class="text-16 font-bold mt-5">{{ userStore.userInfo?.member_dividend }}</view>
        </view>
        <view class="flex-1">
          <view class="text-12 font-light">认购点</view>
          <view class="text-16 font-bold mt-5">{{ userStore.userInfo?.member_point }}</view>
        </view>
      </view>
    </view>
    <view class="text-16 mx-15 mb-15 font-bold text-#333 mt-30">资产记录</view>
    <view
      class="flex px-15 py-8 border-b items-center border-#E5E5E5 border-b-solid"
      v-for="item in list"
      :key="item.id"
    >
      <image src="/static/images/page-sub/invite-icon.png" class="w-32 h-32 self-center" />
      <view class="flex flex-col flex-1 ml-15">
        <view class="text-14 text-#333">{{ item.title }}</view>
        <view class="text-12 mt-10 text-#999">奖励</view>
        <view class="text-12 mt-10 text-#999">{{ item.create_time }}</view>
      </view>

      <view class="flex flex-col items-end">
        <view class="text-14 font-bold text-#FF5F5F">{{ item.money }}</view>
        <!-- <view class="text-14 font-bold text-#FF5F5F">+2000 RMB</view> -->
        <!-- <view class="text-14 font-bold text-#FF5F5F">+30 点</view> -->
        <view class="text-14 mt-10 py-4 px-10 bg-#71C78A1A text-#71C78A" v-if="item.status === 1">
          已到账
        </view>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { getBalanceRecordsAPI } from '@/service'
import { useUserStore } from '@/store'
const userStore = useUserStore()

const { list } = useListPageRequest(getBalanceRecordsAPI)
</script>
