var app = new Vue({
  el: "#app",
  data: function () {
    return {
      id: "",
      username: "",
      amout: "元",
      income: "元",
      notifyTime: ""
    }
  },
  created: function () {
  },
  mounted: function () {
    this.id = this.getUrlParam("id");
    console.log(this.id, "111111111111111");
    $("#loading").fadeOut();
    this.getPayNotify();
  },
  methods: {
    postReq(path, data) {
      return axios.post(path, data).then(function (r) {
        return r.data ? r.data : null;
      })
    },
    getPayNotify() {
      var self = this;
      console.log(this.id, "getPayNotify-------------------");
      this.$root.postReq("/web/econtractCtl/getPayNotify", {
        id: this.id
      }).then(rd => {
        if (rd.status == 0) {
          var info = (rd.data || {}) || {};
          self.username = info.username;
          self.amout = (info.amount || 0) + "元";
          self.income = (info.income_tax || 0) + "元";
          self.notifyTime = info.notifyTime || "";
        } else {
          self.$message.error(`数据不存在`);
        }
      });
    },
    getUrlParam(name) {
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      return r ? unescape(r[2]) : null;
    },
  },
});