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

Page({
    data: {
        showLoding: !0,
        orderid: "",
        verificationQrcode: {},
        orderData: {},
        ordercart: [],
        token: "",
        orderValidity: [],
        purchasenotes: "",
        contentHidden: !0,
        orderVerification: []
    },
    onLoad: function(e) {
        this.setData({
            orderid: e.orderid || ""
        }), this.getOrderDetail();
    },
    getOrderDetail: function() {
        var i = this;
        return r(e.default.mark(function r() {
            var o, n, d, c;
            return e.default.wrap(function(e) {
                for (;;) switch (e.prev = e.next) {
                  case 0:
                    return i, o = i.data.orderid, e.prev = 2, e.next = 5, t.request(t.baseUrl + "shop/order/detail", {
                        orderid: o
                    }, !0);

                  case 5:
                    if (n = e.sent, (d = n.data).orderData.updatetime = a.changeTime(new Date(1e3 * d.orderData.updatetime)), 
                    d.orderValidity && d.orderValidity.length > 0) for (c = 0; c < d.orderValidity.length; c++) i.data.orderValidity[c] = a.changeTime(new Date(1e3 * d.orderValidity[c]));
                    i.setData({
                        showLoding: !1,
                        companyList: d.companyList,
                        orderData: d.orderData,
                        token: d.token,
                        ordercart: d.ordercart,
                        verificationQrcode: d.verificationQrcode,
                        orderValidity: i.data.orderValidity,
                        purchasenotes: d.purchasenotes,
                        orderVerification: d.orderVerification
                    }), e.next = 15;
                    break;

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

                  case 15:
                  case "end":
                    return e.stop();
                }
            }, r, null, [ [ 2, 12 ] ]);
        }))();
    },
    call: function(e) {
        var r = e.currentTarget.dataset.tel;
        wx.makePhoneCall({
            phoneNumber: r
        });
    },
    toMap: function(e) {
        var r = e.currentTarget.dataset, t = r.latitude, a = r.longitude;
        wx.openLocation({
            latitude: t,
            longitude: a
        });
    },
    showcontentHidden: function() {
        this.setData({
            contentHidden: !1
        });
    },
    copy: function(e) {
        var r = e.currentTarget.dataset.code;
        wx.setClipboardData({
            data: r
        });
    }
});