<template>
  <view class="page">
    <!-- 钱包 -->
    <view class="recharge-me ">
      <view class="wallet-content">
        <view class="h-balance-wrap">
          <view class="h-balance">
            <view class="recharge-balance">
              <view class="name">已用额度</view>
              <view class="Number" style="font-size: 48rpx">{{ data.amount || 0 }}</view>
            </view>
            <text style="position: absolute;top:32rpx;right: 32rpx;color:#FFAF36  ">解绑</text>
          </view>
          <view style="display: flex;justify-content: space-between;margin: 8rpx 0rpx">
            <text>赠送会员编号：</text>
            <text>{{ data.userNo }}</text>
          </view>
          <view style="display: flex;justify-content: space-between;margin: 8rpx 0rpx">
            <text>收到时间：：</text>
            <text>{{ data.createTime }}</text>
          </view>
        </view>
        <text style="margin:24rpx 0;overflow: hidden">使用记录</text>
        <view class="useList" v-for=" item in recordList">
          <view style="display: flex;align-items: center">
            <view class="icon">{{ item.type == 0 ? "消费" : "增加" }}</view>
            <text>{{ item.createTime }}</text>
          </view>
          <view>
            <view>
              <text>{{ item.type == 0 ? "-" : "+"  }}</text>
              {{ item.amount || 0 }}
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      data: {},
      page: {
        pageSize: 1,
        pageNum: 10
      },
      recordList: []
    };
  },
  onLoad(option) {
    this.data = JSON.parse(option.data)
    console.log(this.data)
    this.getMycardRecordList()
  },
  onShow() {
  },
  methods: {
    getMycardRecordList() {
      this.page.id = this.data.id
      this.$api.getMycardRecordList(this.page).then((res) => {
        console.log(res)
        this.recordList.push(res.data.data)
        console.log(this.recordList,'4444444444444')
      })
    },
    //解除绑定
    getCreateLoveCard() {

    }
  },
};
</script>

<style scoped lang="scss">
@import '/common/css/common.css';
@import './familyCard';
</style>
