<template>
  <div>
    <img :src="successiconUrl" alt="" style="margin: 10px auto;width: 64px;height: 64px;">
    <div style="padding: 10px 30px 50px">
      <p>尊敬的车主您好：</p>
      <p>尊敬的车主您好：</p>
      <p>尊敬的车主您好：</p>
    </div>
    <div style="padding: 0 20px">
      <mt-button size="large" type="primary" @click="toPay" style="margin-bottom: 20px;">去支付</mt-button>
      <mt-button size="large" type="danger" @click="toBackPage">返回</mt-button>
    </div>

  </div>
</template>

<script>


import { scanCouponQR } from '@/api/couponPay/couponPay.js'

export default {
  name: "coupon",
  data() {
    return {
      successiconUrl: require('../../assets/images/successIcon.png'),
      loseiconUrl: require('../../assets/images/loseIcon.png'),
      carNum: '苏BB210V',
      carNumberColor: ''
    }
  },
  created() {

    // this.carNum = this.$route.query.carNumber  // 获取车牌号
    // this.carNumberColor = this.$route.query.carNumberColor  // 获取颜色   0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色
    // this.currentTabActive = this.$route.query.parkFlag ? this.$route.query.parkFlag : 0
    // console.log(this.currentTabActive)
    // console.log(this.carNumber)
    this.scanCouponQR()
  },
  methods: {
    scanCouponQR(){
      var salt = this.$utils.myCommonSalt(32);
      var jsondata = {
        app_id: this.$utils.myVarAppid,
        deviceInfo: this.$utils.myDeviceInfo,
        salt: salt,
        sign_type: "md5",
        carType:'02',
        codeType:'2',
        cardRelParkNo:'123qwe',
        key:'1',
        carNum: this.carNum,
        // carNumberColor: this.carNumberColor,
        orgId: this.$utils.myOrgId,
        terminalSource:'7',
        // token:'e2c1e43722dd43a5b7e268001b39e6f0'
      }
      jsondata.sign = this.$utils.signObject(jsondata)
      console.log(jsondata)
      scanCouponQR(jsondata).then(response => {
        console.log(response)
      })
    },
    toPay() {
      this.$router.push({
        path: 'couponPay'
      })
    },
    toBackPage() {
      this.$router.back()
    }
  }
};
</script>

<style scoped>

</style>
