Blame view

src/components/payResult.vue 2.3 KB
d29bf602   liuqimichale   赤峰测试环境 农行支付
1
2
3
4
5
6
  <template>
    <div style="padding-top: 50px">
      <div class="pay-result">
        <div :style="{'background-image': 'url('+resultBG+')'}" class="result-bg"></div>
        <div>{{payMsg}}</div>
      </div>
092148e6   liuqimichale   赤峰测试环境 农行支付
7
8
  
      <div class="close" @click="closePage" v-show="isShow">关闭</div>
d29bf602   liuqimichale   赤峰测试环境 农行支付
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    </div>
  </template>
  
  <script>
  
  import oKBg from '../assets/images/ok.png'
  import noBg from '../assets/images/no.png'
  import { queryBankOrderState } from '@/api/payResult/payResult'
  
  export default {
    name: 'payResult',
    data() {
      return {
        resultBG: '',
        payMsg: '支付成功',
092148e6   liuqimichale   赤峰测试环境 农行支付
24
25
        orderId:'',
        isShow:false
d29bf602   liuqimichale   赤峰测试环境 农行支付
26
27
28
29
30
31
      }
    },
    created(){
      // console.log(this.$route.query.ID)
  
      this.resultBG = oKBg
092148e6   liuqimichale   赤峰测试环境 农行支付
32
33
34
35
36
37
38
39
40
41
42
  
      if(window.navigator.userAgent.indexOf('Bankabc/Portal') > -1) {
        // alert('当前页面在新容器');
        this.isShow = true
      } else {
        // alert('当前页面在旧容器');
  
      }
  
      // this.orderId = localStorage.getItem("OrderNum")
      // this.queryBankOrderState()
d29bf602   liuqimichale   赤峰测试环境 农行支付
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
      // alert(window.location.href)
      // alert(this.$router.query.ID)
    },
    mounted(){
      // alert(window.location.href)
    },
    methods:{
      queryBankOrderState:function () {
        let me = this
        let params = {
          payOrderId : me.orderId
        }
        queryBankOrderState(params).then(response => {
          console.log(response)
          if(response.data.payResultEnum == 'PAY_SUCCESS'){
            me.resultBG = oKBg
            me.payMsg = '支付成功'
          }else{
            me.resultBG = noBg
            me.payMsg = '支付失败'
          }
  
        })
092148e6   liuqimichale   赤峰测试环境 农行支付
66
67
68
69
70
71
72
73
74
75
      },
      closePage:function () {
        if(window.navigator.userAgent.indexOf('Bankabc/Portal') > -1) {
          // alert('当前页面在新容器');
          AlipayJSBridge.call('abcExitWebAndBackToHome');
        } else {
          // alert('当前页面在旧容器');
          // 旧支付方式
  
        }
d29bf602   liuqimichale   赤峰测试环境 农行支付
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
      }
    }
  
  }
  </script>
  
  <style scoped lang="scss">
    .pay-result {
      /*width: 150px;*/
      margin: 0 auto;
      text-align: center;
    }
    .result-bg {
      display: inline-block;
      width: 70px;
      height: 70px;
      background-position: center 0;
      background-size: 100% 100%;
    }
092148e6   liuqimichale   赤峰测试环境 农行支付
95
96
97
98
99
100
101
102
103
104
105
    .close{
      width: 80%;
      margin: 20px auto;
      height: 40px;
      line-height: 40px;
      color: #fff;
      text-align: center;
      background: #0564cc;
      border-radius: 5px;
      cursor: pointer;
    }
d29bf602   liuqimichale   赤峰测试环境 农行支付
106
107
108
  
  
  </style>