<route lang="json5" type="page">
{
  style: {
    navigationBarTitleText: '投资记录',
    navigationBarBackgroundColor: '#fff',
  },
}
</route>
<script lang="ts" setup>
import { getBuyFundOrderListAPI } from '@/service'
import { useListPageRequest } from '@/hooks/useListPageRequest'
import { formatTime } from '@/utils'

const { list: fundList } = useListPageRequest(getBuyFundOrderListAPI)
</script>
<template>
  <view class="min-h-screen pb-100">
    <template v-if="fundList.length > 0">
      <view
        class="flex px-15 py-8 border-b border-#E5E5E5 border-b-solid"
        v-for="item in fundList"
        :key="item.id"
      >
        <image src="/static/images/page-sub/money-icon.png" class="w-32 h-32 self-center" />
        <view class="flex flex-col flex-1 justify-between ml-15">
          <view class="text-14 text-#333">{{ item.fund_name }}</view>
          <view class="text-12 text-#999">投资</view>
          <view class="text-12 text-#999">{{ formatTime(item.create_time * 1000) }}</view>
        </view>

        <view class="flex flex-col items-end">
          <view class="text-16 text-#FF5F5F">+{{ item.buy_price }} RMB</view>
          <view
            class="text-14 mt-18 py-4 px-10 bg-#71C78A1A text-#71C78A"
            v-if="item.order_status === 1"
          >
            投资成功
          </view>
        </view>
      </view>
    </template>
    <template v-else>
      <wd-status-tip image="content" tip="暂无内容" />
    </template>
  </view>
</template>
