function e(e, t, r) {
    return t in e ? Object.defineProperty(e, t, {
        value: r,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : e[t] = r, e;
}

var t = require("util.js");

module.exports = {
    app: function() {
        return getApp();
    },
    //------------获取全路径的图片地址-----------
    getFullUrl: function(e) {
       if(e==undefined || e=="") return "";
       if(e.indexOf("http")!=-1) return e;
       e=this.app().globalData.setting.imghost + e;
       return e;
    },

    //--------跳转到支付页面--------
    jumpToCart4: function(e, r) {
        var a = {
            order_sn: e.order_sn,
            order_amount: e.order_amount
        };

        //t=1正常单  2组合单
        if(e.type==1){ a.type=1; }
        e.master_order_sn && (a.master_order_sn = e.master_order_sn);
        var n = "/pages/cart/cart4/cart4?" + t.Obj2Str(a);
        r ? wx.redirectTo({
            url: n
        }) : wx.navigateTo({
            url: n
        });
    },
    wxParseAddFullImageUrl: function(t, r) {
        if (void 0 !== t.data[r].images) {
            for (var a = t.data[r], n = 0; n < a.images.length; n++) a.images[n].attr.src = this.getFullUrl(a.images[n].attr.src), 
            a.imageUrls[n] = this.getFullUrl(a.imageUrls[n]);
            console.log(a), t.setData(e({}, r, a));
        }
    },


};