<template>
    <view class="container" style="paddingBottom:1rpx;">
      <u-navbar
			leftIconSize="40rpx"
			leftIconColor="#333333"
			title="征信查询记录统计"
		>
		</u-navbar>
      <view class="section">
        <u-cell-group>
        <u-cell title="近1个月查询次数:" titleStyle="font-weight:bolder" :value="detailInfo.lastOneMonths"></u-cell>
        <u-cell title="近2个月查询次数:" titleStyle="font-weight:bolder" :value="detailInfo.lastTwoMonths"></u-cell>
        <u-cell title="近3个月查询次数" titleStyle="font-weight:bolder" :value="detailInfo.lastThreeMonths"></u-cell>
        <u-cell title="近6个月查询次数" titleStyle="font-weight:bolder" :value="detailInfo.lastSixMonths"></u-cell>
        <u-cell title="近1年查询次数:" titleStyle="font-weight:bolder" center :value="detailInfo.lastOneYears"> </u-cell>
        <u-cell title="近2年查询次数:" titleStyle="font-weight:bolder" center :value="detailInfo.lastTwoYears"> </u-cell>
        <u-cell title="总查询次数:" titleStyle="font-weight:bolder" center :value="detailInfo.lastAllYears"> </u-cell>
      </u-cell-group>
      </view>
      <u-toast ref="uToast"></u-toast>
    </view>
  </template>
  
<script setup>
import { getCreditRecordAnalysis} from '@/api/invest/creditQueryRecord'
import {onLoad} from "@dcloudio/uni-app";
import {reactive ,toRefs,ref }from "vue";
const id = ref('')
const data = reactive({
  detailInfo: {} 
})
const {detailInfo} = toRefs(data)
onLoad((option) => {
    id.value = option.id
    getInfo()
  })
  function getInfo() {
    const today = new Date()
    const queryDateStart= today.getFullYear() + '-' + ('0' + (today.getMonth() + 1)).slice(-2) + '-' + ('0' + today.getDate()).slice(-2)
    getCreditRecordAnalysis({queryDateStart: queryDateStart}).then(res => {
          detailInfo.value = res.data
        })
  }
  </script>
  
  <style lang="scss" scoped>
  .section {
    margin: 24rpx;
    padding: 16rpx 24rpx;
    background-color: #fff;
    border-radius: 8rpx;
  
    .section-title {
      width: 280rpx;
      color: #333333;
      line-height: 44rpx;
      font-size: 30rpx;
      border-left: 6rpx solid #2681FF;
      padding-left: 26rpx;
    }
  
    .content {
      width: 647rpx;
      font-size: 28rpx;
      color: #333333;
      line-height: 40rpx;
      text-align: left;
    }
  
    .img-con {
      display: flex;
      flex-wrap: wrap;
      gap: 20rpx
    }
    .form-view {
      padding: 20rpx 0rpx 0 10rpx;
  
      .form-btn {
        padding-top: 20rpx;
      }
    }
  }
  </style>