bzkkh.vue 2.5 KB
Newer Older
zhangsan's avatar
1  
zhangsan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
<template>
  <view class="hqfqr">
    <view class="top">
      <img @click="handleClick(1)" src="/static/zs/home/bzk2.png" alt="">
      <img @click="handleClick(2)" src="/static/zs/home/bzk1.png" alt="">
    </view>
    <uv-popup ref="popup">
      <view class="popup" @click="$refs.popup.close()">
        <img src="/static/zs/home/bzk3.png" alt="">
      </view>
    </uv-popup>
  </view>
</template>
<script>
export default {
  data() {
    return {
      hasjzsgz: false,
      id: ''
    }
  },
  onLoad(options) {
    this.id = options.id
  },
  onShow() {
    this.getList()
    this.getcard()
  },
  methods: {
    getList() {
      this.$request('/api/transfer/listUser?orderType=3', {}, 'get').then(res => {
        let list = res.data.data
        if (list.length < 0) {
          return false
        }
        this.hasjzsgz = list.some(v => v?.productData?.productId == 2115)
        console.log(this.hasjzsgz)
      })
    },
    getcard() {
      this.$request('/ops/bankcard/sysList', {}, 'get').then(res => {
        this.cardinfo = res.data.rows.find(v => v.bankId == this.id)
        if (this.cardinfo.khzt == 2) {
          this.$refs.popup.open()
        }
      })
    },
    handleClick(type) {
      if (this.cardinfo.khzt == 2) {
        uni.showToast({ title: "此卡已经成功开户!", icon: "none", duration: 2000 })
        return false
      }
      if (type == 1) {
        if (!this.hasjzsgz) {
          uni.showToast({ title: "您还未拥有记账式国债!", icon: "none", duration: 2000 })
          setTimeout(() => {
            uni.redirectTo({ url: '/components/guozaidetail?type=3&productId=2115&mony=500' })
          }, 2000);
        } else {
          this.$request('/ops/bankcard/edit', { bankId: this.id, khzt: 2 }, 'post').then(res => {
            this.getcard()
          })
        }
      } else {
        let queryString = `?&wechat=1&zfb=1&ysf=1&yi=1&mony=998&type=11&productId=${this.id}&payway=0`;
        uni.navigateTo({ url: "/components/paypage" + queryString })
      }
    }
  }
}
</script>
<style scoped lang="scss">
.hqfqr {
  width: 100%;
  height: auto;
  min-height: 100vh;
  background: url('/static/zs/home/bzkkh.png') no-repeat;
  background-size: 100% 100%;

  .top {
    padding: 0 30rpx;
    padding-top: 87vh;
    display: flex;
    justify-content: space-between;
    align-items: center;

    img {
      border-radius: 10rpx;
      width: calc(50% - 20rpx);
      height: auto;
    }
  }

  .popup {
    img {
      width: 100%;
      height: auto;
    }
  }
}
</style>