<template>
  <view class="points-details-page">
    <TopNavBar
      title="积分明细"
      background="transparent"
      title-color="#172033"
      back-icon-color="#172033"
      :align-with-menu-button="true"
      :z-index="3"
      @back="handleBack"
    />

    <view class="points-details-content">
      <LedgerList :records="records" />
    </view>
  </view>
</template>

<script setup>
import TopNavBar from "@/components/TopNavBar/index.vue";
import LedgerList from "./components/LedgerList/index.vue";
import { pointsLedgerRecords } from "./data/ledger.js";

const records = pointsLedgerRecords;

const handleBack = () => {
  const pages = getCurrentPages();
  if (pages.length > 1) {
    uni.navigateBack();
  }
};
</script>

<style scoped lang="scss">
@import "./styles/index.scss";
</style>
