<template>
  <view class="page">
    <!-- 明细组件，根据传值确定展示的数据 -->
    <MoneyDetail
      :withBool="true"
      v-for="(item, index) in moneyDetail"
      :itemInfo="item"
      :key="index"
    />
    <!-- 明细组件，根据传值确定展示的数据 -->
  </view>
</template>

<script>
import MoneyDetail from "../mineComponent/moneyDetail/index.vue";
export default {
  components: {
    MoneyDetail,
  },
  data() {
    return {
      //保证金提现明细数据
      moneyDetail: [],
      type: "",
    };
  },
  onLoad(options) {
    this.type = options.type;
  },
  methods: {
    getwithdrawalDetailList() {
      uni.$u.http
        .get(
          `/api/withdraw?is_page=1&page=1&limit=10&account_type=${this.type}`
        )
        .then((res) => {
          this.moneyDetail = res.data;
          this.moneyDetail.map((item) => {
            item.type_name = "余额提现";
            item.amount = "-" + item.amount;
          });
        });
    },
  },
  mounted() {
    this.getwithdrawalDetailList();
    uni.setBackgroundColor({
      backgroundColor: "#ffffff",
    });
  },
};
</script>

<style lang="scss" scoped>
.page {
  background-color: #fff;
  width: 92vw;
  height: 100vh;
  padding: 0 32rpx;
}
</style>
