<template>
    <view>
      <view class="text-top">
        <view class="text">奖项</view>
        <view class="text">共{{total}}个</view>
      </view>
        <My_listbox ref="List" @getlist="getList" >
          <view class="list-box">
            <navigator class="item" v-for="item in list" :key="item.sa_awardmxid"
                       url="">
              <view class="text">
                <view class="title u-line-2">{{ item.awardname || '--' }}</view>
                <view class="count u-line-1">
                  <text style="margin-right: 118px">类型：{{ item.type || '--' }}</text>
                  <text>金额：{{ CNY(item.price,'',false) || '--' }}元</text>
                </view>
                <view class="count u-line-1">来源：{{ item.awardheadname || '--' }}</view>
              </view>
            </navigator>
          </view>
        </My_listbox>

    </view>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      total:0,
      "content": {
      },
    }
  },
  onLoad(options){
    this.getList(true)
    uni.setNavigationBarTitle({
      title: '我的中奖信息'
    });
  },
  methods:{
    getList(init = false) {
      if (this.paging(this.content, init)) return;
      this.$Http.basic({
        "id": 20240515140302,
        content: this.content
      }).then(res => {
        this.$refs.List.RefreshToComplete()
        console.log("中奖信息", res)
        if (this.cutoff(res.msg)) return;
        this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
        this.total = res.total
        this.content = this.$refs.List.paging(this.content, res)
      })
    },
  }
}
</script>

<style lang="scss">
.text-top{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 10px;
  .text{
    font-family: Source Han Sans SC, Source Han Sans SC;
    font-weight: 400;
    font-size: 12px;
    color: #666666;
    line-height: 0px;
    text-align: left;
    font-style: normal;
    text-transform: none;
    margin-top: 10px;
  }
}
.list-box {
  width: 100vw;
  box-sizing: border-box;

    .item {
      display: flex;
      width: 100vw;
      border-radius: 5px;
      overflow: hidden;
      margin-top: 10px;
      background: #FFFFFF;
      padding: 10px;
    .text {
      flex: 1;
      font-family: Source Han Sans SC, Source Han Sans SC;

      .title {
        font-weight: bold;
        font-size: 14px;
        color: #333333;
        line-height: 24px;
      }
      .count {
        font-size: 12px;
        color: #999999;
        line-height: 17px;
        margin-top: 8px;
      }
    }

  }
}
</style>
