<template>
  <div class="result-page">
    <img :src="imgSrc" alt="">
    <text>{{ text }}</text>
    <u-button type="primary" :custom-style="{width:'100%',borderRadius:'4px',marginTop:'48px'}" @click="goBack">
      {{ btnText }}
    </u-button>
  </div>
</template>

<script>

export default {
  name: "result-page",
  data() {
    return {
      flag: true
    }
  },
  onLoad(val) {
    if (val.flag) {
      this.flag = val.flag
    }
  },
  methods: {
    goBack() {
      uni.navigateBack({
        delta: 3
      })
    }
  },
  computed: {
    text() {
      return this.flag ? '领取成功！' : '领取失败！请联系管理员处理'
    },
    btnText() {
      return this.flag ? '确定' : '我知道了'
    },
    imgSrc() {
      return this.flag ? (this.$cdn + 'other/' + 'kztcg.png') : (this.$cdn + 'other/' + 'kztsb.png')
    }
  }
}
</script>

<style lang="scss" scoped>
.result-page {
  min-height: 100%;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 96px;

  img {
    width: 192px;
    height: 192px;
  }

  text {
    font-size: 36px;
    font-weight: 800;
    color: #333333;
    line-height: 50px;
    display: flex;
    justify-content: center;
  }
}
</style>
