<template>
  <div v-loading.body.fullscreen="fullscreenLoading" element-loading-background="rgba(255, 255, 255, 0)">
    <!-- 在线支付 -->
    <backBar :title="$t('tab.tab13')"/>
    <iframe class="iframe" v-if="orderInfo.id" :src="orderInfo.from.url" frameborder="0"></iframe>
  </div>
</template>
<script>
import backBar from '@/components/backBar'
import { getPayRecordList } from '@/api/assets'
export default {
  components: {
    backBar
  },
  data () {
    return {
      ordernum: '',
      orderInfo: {}
    }
  },
  created () {
    this.ordernum = this.$route.params.ordernum
    this.getPayRecordList()
  },
  methods: {
    getPayRecordList() {
      this.fullscreenLoading = true
      getPayRecordList({
        ordernum: this.ordernum
      }).then(res => {
        var list = res.list || []
        if (list[0]) {
          var info = list[0]
          info.from = info.from ? JSON.parse(info.from) : {}
          info.to = info.to ? JSON.parse(info.to) : {}
          this.orderInfo = info
        }
      }).catch(() => {}).finally(() => {
        this.fullscreenLoading = false
      })
    },
  }
}
</script>
<style lang="less" scoped>
.iframe {
  position: fixed;
  top: 50px;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: calc(100% - 50px);
}
</style>