var e = require("../../common/vendor.js"),
  r = require("../../hooks/onMounted.js"),
  n = require("../../hooks/onShareAppMessage.js"),
  o = require("../../service/index.js"),
  i = require("../../utils/navigate.js"),
  u = require("../../utils/util.js"),
  a = require("../../enums/index.js"),
  t = require("../../utils/common.js");
require("../../hooks/useState.js"),
  require("../../store/app/index.js"),
  require("../../data/index.js"),
  require("../../config/index.js"),
  require("../../constant/index.js"),
  require("../../utils/request.js"),
  Math || (e.unref(d) + e.unref(c) + e.unref(s))();
var s = function () {
    return "../../components/popup-pay-again/index.js";
  },
  d = function () {
    return "../../components/float-help/index.js";
  },
  c = function () {
    return "../../components/float-share/index.js";
  },
  p = {
    __name: "index",
    setup: function (s) {
      var d = e.ref(!0),
        c = e.ref(""),
        p = e.ref({}),
        f = e.ref(!1),
        l = function () {
          i.redirectTo({ url: "/pages/order-list-mine/index" });
        },
        v = function () {
          q(a.PayMethodEnum.WECHAT_PAY);
        },
        h = function () {
          f.value = !1;
        },
        j = function (e) {
          q(e), (f.value = !1);
        },
        q = function (e) {
          u.showLoading("支付中"),
            o
              .payOrderAgain({ payMethod: e, order_no: c.value })
              .then(function (r) {
                t.payForOrder({ payMethod: e, data: r })
                  .then(function (e) {
                    var r = e.orderNo;
                    i.redirectTo({
                      url: "/pages/pay-success/index",
                      params: { orderNo: r },
                    });
                  })
                  .catch(function (e) {
                    var r = e.orderNo;
                    i.redirectTo({
                      url: "/pages/pay-fail/index",
                      params: { orderNo: r },
                    });
                  });
              });
        };
      return (
        r.onMounted(function (e) {
          (c.value = e.orderNo),
            o.getOrderDetail({ order_no: e.orderNo }).then(function (e) {
              (p.value = e), (d.value = !1), u.hideLoading();
            });
        }),
        n.onShareAppMessage(),
        function (r, n) {
          return e.e(
            { a: !d.value },
            d.value
              ? {}
              : {
                  b: e.o(v),
                  c: e.o(l),
                  d: e.o(h),
                  e: e.o(j),
                  f: e.p({ visible: f.value }),
                }
          );
        }
      );
    },
  },
  f = e._export_sfc(p, [["__scopeId", "data-v-cb7a366a"]]);
(p.__runtimeHooks = 2), wx.createPage(f);
