var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), r = require("../../@babel/runtime/helpers/slicedToArray"), t = require("../../@babel/runtime/helpers/asyncToGenerator"), i = (getApp(), 
require("../../utils/login.js"));

require("../../utils/common.js");

Page({
    data: {
        showLoding: !0,
        orderid: "",
        recommendedList: [],
        info: {}
    },
    onLoad: function(e) {
        this.setData({
            orderid: e.orderid || ""
        }), this.getOrderDetail();
    },
    getOrderDetail: function() {
        var n = this;
        return t(e.default.mark(function t() {
            var a, o, s;
            return e.default.wrap(function(e) {
                for (;;) switch (e.prev = e.next) {
                  case 0:
                    return n, e.prev = 1, a = n.data.orderid, e.next = 5, i.request(i.baseUrl + "shop/notify/paymentSuccessful", {
                        orderid: a
                    }, !0);

                  case 5:
                    o = e.sent, console.log("getOrderDetail", o), (s = o.data).recommendedList.forEach(function(e) {
                        var t = e.price.split("."), i = r(t, 2);
                        e.price_buck = i[0], e.price_cent = i[1];
                    }), n.setData({
                        showLoding: !1,
                        info: s,
                        recommendedList: s.recommendedList
                    }), e.next = 15;
                    break;

                  case 12:
                    e.prev = 12, e.t0 = e.catch(1), console.log(e.t0);

                  case 15:
                  case "end":
                    return e.stop();
                }
            }, t, null, [ [ 1, 12 ] ]);
        }))();
    }
});