| 1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/buy"],{"06f6":function(e,t,n){"use strict";n.r(t);var o=n("e5eb"),r=n("42ec");for(var i in r)"default"!==i&&function(e){n.d(t,e,(function(){return r[e]}))}(i);n("65fa");var s,c=n("f0c5"),u=Object(c["a"])(r["default"],o["b"],o["c"],!1,null,"7ed9559b",null,!1,o["a"],s);t["default"]=u.exports},"3d07":function(e,t,n){},"42ec":function(e,t,n){"use strict";n.r(t);var o=n("7a3d"),r=n.n(o);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},"52b9":function(e,t,n){"use strict";(function(e){n("6cdc"),n("921b");o(n("66fd"));var t=o(n("06f6"));function o(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},"65fa":function(e,t,n){"use strict";var o=n("3d07"),r=n.n(o);r.a},"7a3d":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("2f62"),r=n("cf45"),i=n("5f87"),s=n("01ea"),c=n("3a10");function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(){return n.e("components/plugin/tabs").then(n.bind(null,"f58d"))},f=function(){return n.e("components/plugin/list-cell").then(n.bind(null,"1861"))},p=function(){return n.e("components/app-delivery").then(n.bind(null,"c7ce"))},h=function(){return n.e("components/module/app-trademark").then(n.bind(null,"ea75"))},m=function(){return n.e("components/module/app-order-list").then(n.bind(null,"7d55"))},g=function(){return Promise.all([n.e("common/vendor"),n.e("components/app-coupon-sel")]).then(n.bind(null,"3c3e"))},b=function(){return n.e("components/plugin/alert").then(n.bind(null,"a366"))},y=n("90f4"),v={name:"order-buy",components:{AppTabs:d,AppDeliveryModule:p,TuiListCell:f,AppListModule:m,AppCouponSel:g,AppTrademark:h,AlertModule:b},data:function(){return{goodsInfo:{},tabIndex:0,tabs:[{name:"配送"},{name:"我要自提"}],showAlert:!1,form:{anonymity:"0",sendDistance:"",goodsId:"",goodsStyleId:"",goodsNum:"",couponId:"0",receiveLat:"",receiveLong:""},mentionForm:{bookMobile:""},discountArr:!1,freightPrice:0}},computed:a({},(0,o.mapGetters)({orderShop:"getOrderShop"}),{},(0,o.mapGetters)({shopUser:"getShopUser"}),{totalPrice:function(){var e=this.goodsInfo.price*this.option.goodsNum-this.freightPrice;return console.log("this.shopUser",this.shopUser),e.toFixed(2)}}),onLoad:function(e){},methods:{init:function(){var t=this,n=e.getStorageSync("buyGoodsDetil");n.price=this.option.goodsStyleId?n.goodsStyleList[this.option.selIndex].price:n.price,(0,s.getOrderShop)().then((function(){t.$refs.couponSel._getUserDiscount().then((function(e){t.discountArr=e})),!t.$util.isEmpty(t.$refs.appDelivery.region)&&t.$refs.appDelivery.region.latitude&&(t.freightPrice=(0,r.calcDistance)(t.orderShop.shop,t.$refs.appDelivery.region,t.orderShop.freight))})),(0,i.getShopUser)(),n.buyNum=this.option.goodsNum,this.goodsInfo=n,Object.keys(this.form).forEach((function(e,n){t.form[e]=t.option[e]}))},createOrderFn:function(){var t=this,n={},o=0==this.tabIndex?this.$refs.appDelivery.form:this.mentionForm,r=0==this.tabIndex?this.$refs.appDelivery.region:{};this.$refs.couponSel&&(n.couponId=this.$refs.couponSel.couponId),(0,c.createOrder)(a({needSend:0==this.tabIndex?"1":"0"},o,{},this.form,{},n,{},r)).then((function(n){e.removeStorageSync("buyGoodsDetil"),t.$util.pageTo({url:"/pages/callback/index",query:a({pagestatus:1},n.data)})}))},confirmFn:function(){console.log(this.$refs.appDelivery),this.createOrderFn()},tabChange:function(e){this.tabIndex=e.index},hideAlert:function(){this.showAlert=!1},anonymityChange:function(e){this.form.anonymity=1==this.form.anonymity?0:1},changeAddress:function(e){this.freightPrice=(0,r.calcDistance)(this.orderShop.shop,this.$refs.appDelivery.region,this.orderShop.freight)},formSubmit:function(e){console.log(e);var t=[],n=e.detail.value,o=y.validation(n,t);o?this.$msg(o):this.confirmFn()}}};t.default=v}).call(this,n("543d")["default"])},e5eb:function(e,t,n){"use strict";var o,r=function(){var e=this,t=e.$createElement,n=(e._self._c,e.$util.isEmpty(e.goodsInfo)),o=e.$util.isEmpty(this.orderShop),r=e.$util.isEmpty(e.discountArr),i=e.$util.isEmpty(this.orderShop);e._isMounted||(e.e0=function(t){e.showAlert=!0}),e.$mp.data=Object.assign({},{$root:{g0:n,g1:o,g2:r,g3:i}})},i=[];n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}))}},[["52b9","common/runtime","common/vendor"]]]);
|