(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"54aa":function(e,t,o){"use strict";o.r(t);var n=o("7be1"),a=o.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(r);t["default"]=a.a},"5a5f":function(e,t,o){"use strict";var n=o("ecf6"),a=o.n(n);a.a},"6ec6":function(e,t,o){"use strict";o.r(t);var n=o("54aa");for(var a in n)["default"].indexOf(a)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(a);o("5a5f");var r=o("f0c5"),c=Object(r["a"])(n["default"],void 0,void 0,!1,null,null,null,!1,void 0,void 0);t["default"]=c.exports},"7be1":function(e,t,o){"use strict";(function(e){var n=o("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(o("9523"));function r(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?r(Object(o),!0).forEach((function(t){(0,a.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var i={globalData:{address:"",openId:null,token:null,location:{},system:{},userInfo:{},onAddress:{},onGoodCart:[],onCoupon:{}},onLaunch:function(){var t=e.getStorageSync("userInfo"),o=e.getStorageSync("token");this.globalData.token=o,this.globalData.userInfo=t,this.getSystem(),this.overShare(),t&&t.id&&o?(this.getUserInfo(),e.switchTab({url:"/pages/index/index"})):console.log("没登陆")},onShow:function(){console.log("App Show")},onHide:function(){console.log("App Hide")},methods:{overShare:function(){wx.onAppRoute((function(e){var t=getCurrentPages(),o=t[t.length-1];o&&wx.showShareMenu({withShareTicket:!0,menus:["shareAppMessage","shareTimeline"]})}))},getSystem:function(){var t=this;this.axiosFromToken("POST","common/service",{},"加载中").then((function(o){t.globalData.system=o.data,e.setStorageSync("system",o.data),console.log(o,"系统配置")}))},getUserInfo:function(){var t=this;this.axiosFromToken("POST","user/userinfo",{token:this.globalData.token}).then((function(o){1==o.code?(console.log("用户信息",o.data),t.globalData.userInfo=o.data,e.setStorageSync("userInfo",o.data)):t.$tools.showToast(o.msg)}))},getAddress:function(){var t=this;return console.log(this,"this"),new Promise((function(o,n){if(t.globalData.location&&t.globalData.location.Address&&t.globalData.location.latitude&&t.globalData.location.longitude)o();else{var a=new t.$vm.$amapwx.AMapWX({key:"32744ba7c2805fac5edc9f7bafc1e1ae"});e.showLoading({title:"加载中"}),a.getRegeo({success:function(n){e.hideLoading(),t.globalData.location=n[0];var a=n[0].regeocodeData.addressComponent;"string"==typeof a.city?n[0].Address=a.city:n[0].Address=a.province,n[0].Address=n[0].Address.substring(0,n[0].Address.length-1),o(n[0].Address)},fail:function(o){e.hideLoading(),"getLocation:fail auth deny"==o.errMsg&&t.showtt("请同意授权位置信息"),console.log(o)}})}}))},createParmas:function(t){var o=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return new Promise((function(a,r){o.$vm.$tools.axiosFrom("POST","order/orderPayment",{paytype:n,order_no:t,openid:e.getStorageSync("openId")}).then((function(e){console.log(e,"支付参数"),1==n?o.payFn("alipay",e.data).then((function(e){a(e)})).catch((function(e){r(e)})):2==n&&o.payFn("wxpay",e.data).then((function(e){a(e)})).catch((function(e){r(e)}))}))}))},payFn:function(t,o){return console.log(o,"支付参数"),new Promise((function(n,a){e.requestPayment(c(c({provider:t},o),{},{success:function(t){e.showToast({icon:"success",title:"支付成功"}),n(t)},fail:function(t){e.showToast({icon:"error",title:"支付失败"}),a(t)}}))}))}}};t.default=i}).call(this,o("543d")["default"])},aaf2:function(e,t,o){"use strict";(function(e){var t=o("4ea4"),n=t(o("9523"));o("0178");var a=t(o("66fd")),r=t(o("6ec6")),c=t(o("8132")),i=t(o("7b1c")),s=t(o("7661"));t(o("5221"));function u(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}wx.__webpack_require_UNI_MP_PLUGIN__=o,a.default.prototype.$tools=i.default,a.default.prototype.$amapwx=s.default,a.default.mixin(c.default),r.default.mpType="app";var l=new a.default(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?u(Object(o),!0).forEach((function(t){(0,n.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},r.default));e(l).$mount()}).call(this,o("543d")["createApp"])},ecf6:function(e,t,o){}},[["aaf2","common/runtime","common/vendor"]]]);