pay.vue 765 Bytes
<template>
  <LayoutApp :show-back="true">
    <div>{{count}} 秒</div>
    <div>支付成功跳转成功页</div>
    <div>支付失败返回上一层</div>
  </LayoutApp>
</template>

<script>

import config from 'config';

export default {
  name: 'PayPage',
  props: ['orderCode', 'payParams', 'extra'],
  data() {
    return {
      count: 60
    };
  },
  mounted() {
    if (this.payParams) {
      const url = config.alipayUrl + '?' + this.payParams;

      window.location.href = url;
    }

    this.setCount();
  },
  methods: {
    setCount() {
      if (this.count > 0) {
        setTimeout(() => {
          this.count = this.count - 1;
          this.setCount();
        }, 1000);
      }
    }
  }
};
</script>

<style lang="scss" scoped>

</style>