(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/shopping/confirmPackageOrder"],{"7aa4":function(e,n,o){},"7d6e":function(e,n,o){"use strict";o.r(n);var t=o("c810"),a=o("b702");for(var c in a)["default"].indexOf(c)<0&&function(e){o.d(n,e,(function(){return a[e]}))}(c);o("da65"),o("bb6f");var r=o("828b"),i=Object(r["a"])(a["default"],t["b"],t["c"],!1,null,"c91c2104",null,!1,t["a"],void 0);n["default"]=i.exports},"8ede":function(e,n,o){"use strict";(function(e,n){var t=o("47a9");o("584a");t(o("3240"));var a=t(o("7d6e"));e.__webpack_require_UNI_MP_PLUGIN__=o,n(a.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},b702:function(e,n,o){"use strict";o.r(n);var t=o("e14f"),a=o.n(t);for(var c in t)["default"].indexOf(c)<0&&function(e){o.d(n,e,(function(){return t[e]}))}(c);n["default"]=a.a},bb6f:function(e,n,o){"use strict";var t=o("7aa4"),a=o.n(t);a.a},c810:function(e,n,o){"use strict";o.d(n,"b",(function(){return t})),o.d(n,"c",(function(){return a})),o.d(n,"a",(function(){}));var t=function(){var e=this,n=e.$createElement,o=(e._self._c,null!=e.address&&null!=e.address.phone?e.utils.parsePhone(e.address.phone):null),t=null!=e.package.payMoney?e.package.payMoney.toFixed(2):null,a=null!=e.package.payMoney?e.package.payMoney.toFixed(2):null,c=null!=e.totalMoney?e.totalMoney.toFixed(2):null,r=e.couponsList.length,i=e.couponsList.length;e.$mp.data=Object.assign({},{$root:{g0:o,g1:t,g2:a,g3:c,g4:r,g5:i}})},a=[]},da65:function(e,n,o){"use strict";var t=o("fbaf"),a=o.n(t);a.a},e14f:function(e,n,o){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t=o("caff"),a=o("98ea"),c=o("a678"),r={components:{EvanSwitch:function(){o.e("components/evan-switch/evan-switch").then(function(){return resolve(o("4e94"))}.bind(null,o)).catch(o.oe)},popupBottom:function(){Promise.all([o.e("common/vendor"),o.e("components/px-popup-bottom/px-popup-bottom")]).then(function(){return resolve(o("f348"))}.bind(null,o)).catch(o.oe)}},data:function(){return{temps:[],totalMoney:0,couponUserId:null,couponText:"请选择",couponsList:[],couponVisible:!1,companyUserId:null,packageId:null,address:null,package:{},form:{orderKey:null,addressId:null,mark:null}}},onLoad:function(n){var o=this;this.packageId=n.packageId,this.companyUserId=n.companyUserId,this.confirmPackageOrder(),e.$on("updateAddress",(function(e){o.address=e,o.form.addressId=e.id})),this.getWeixinTemps()},onShow:function(){},methods:{getWeixinTemps:function(){var e=this;(0,t.getWeixinTemps)().then((function(n){200==n.code&&(e.temps=n.temp)}),(function(e){}))},couponSelect:function(e){console.log(e),this.couponText="-¥"+e.couponPrice.toFixed(2),this.couponUserId=e.id,this.couponVisible=!1,this.computedPackageOrder()},openCoupon:function(){var e=this,n=this,o={packageCateId:this.package.cateId,couponType:1,useMinPrice:this.totalMoney};(0,c.getMyEnableCouponList)(o).then((function(o){e.couponVisible=!0,n.couponsList=o.data}))},confirmPackageOrder:function(){var n=this,o={packageId:this.packageId,couponUserId:this.couponUserId};(0,a.confirmPackageOrder)(o).then((function(o){200==o.code?(n.form.orderKey=o.orderKey,n.address=o.address,n.package=o.package,null!=o.address&&(n.form.addressId=o.address.id),n.totalMoney=o.totalMoney):e.showToast({icon:"none",title:o.msg})}),(function(e){}))},computedPackageOrder:function(){var n=this,o={packageId:this.packageId,couponUserId:this.couponUserId};(0,a.computedPackageOrder)(o).then((function(o){200==o.code?n.totalMoney=o.totalMoney:e.showToast({icon:"none",title:o.msg})}),(function(e){}))},submitOrder:function(){var n=this;null!=this.form.orderKey?null!=this.form.addressId?e.requestSubscribeMessage({tmplIds:this.temps,success:function(e){n.createPackageOrder()},fail:function(e){n.createPackageOrder()}}):e.showToast({icon:"none",title:"收货地址不能为空"}):e.showToast({icon:"none",title:"订单KEY不存在"})},createPackageOrder:function(){e.showLoading({title:"正在处理中..."});var n={couponUserId:this.couponUserId,mark:this.form.mark,orderKey:this.form.orderKey,addressId:this.form.addressId,packageId:this.packageId,companyUserId:this.companyUserId};(0,a.createPackageOrder)(n).then((function(n){if(e.hideLoading(),200!=n.code)return 501==n.code?(e.showToast({icon:"none",title:n.msg}),void setTimeout((function(){e.navigateBack({delta:1})}),200)):void e.showToast({icon:"none",title:n.msg});1==n.order.isPrescribe?setTimeout((function(){e.redirectTo({url:"prescribe?orderId="+n.order.id})}),200):setTimeout((function(){e.redirectTo({url:"./paymentOrder?orderId="+n.order.id})}),200)}),(function(e){}))},openAddress:function(){e.navigateTo({url:"/pages_user/user/address"})}}};n.default=r}).call(this,o("df3c")["default"])},fbaf:function(e,n,o){}},[["8ede","common/runtime","common/vendor"]]]);