You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
7.0 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/OrderSubmission/index"],{"1ee2":function(e,t,o){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o("2d3a"),i=o("2f62"),r=o("c7f0"),s=(o("bcec"),o("b6d1"));function a(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 d(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach((function(t){c(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=function(){o.e("components/OrderGoods").then(function(){return resolve(o("daac"))}.bind(null,o)).catch(o.oe)},l=function(){o.e("components/CouponListWindow").then(function(){return resolve(o("d26e"))}.bind(null,o)).catch(o.oe)},h=function(){o.e("components/AddressWindow").then(function(){return resolve(o("2da6"))}.bind(null,o)).catch(o.oe)},p="OrderSubmission",f=(0,s.isWeixin)(),g={name:p,components:{OrderGoods:u,CouponListWindow:l,AddressWindow:h},props:{},data:function(){return{offlinePayStatus:2,from:this.$deviceType,deduction:!0,enableIntegral:!0,enableIntegralNum:0,isWeixin:f,pinkId:0,active:"weixin",showCoupon:!1,showAddress:!1,addressInfo:{},couponId:0,orderGroupInfo:{priceGroup:{}},usableCoupon:{},addressLoaded:!1,useIntegral:!1,orderPrice:{payPrice:"计算中"},mark:"",systemStore:{},shipping_type:0,contacts:"",contactsTel:"",storeSelfMention:0,cartid:"",isIntegral:!1,isEnough:!0}},computed:(0,i.mapGetters)(["userInfo","storeItems"]),watch:{useIntegral:function(){this.computedPrice()},shipping_type:function(){this.computedPrice()}},onLoad:function(){var e=this;console.log("loadddddddd"),this.$store.dispatch("getUser",!0),e.getCartInfo(),console.log(e.$yroute),void 0!==e.$yroute.query.pinkid&&(e.pinkId=e.$yroute.query.pinkid),this.isIntegral="true"==e.$yroute.query.isIntegral,this.useIntegral=this.isIntegral,this.isIntegral&&(this.active="integral"),void 0!==e.$yroute.query.id&&(e.cartid=e.$yroute.query.id,console.log(e.cartid))},methods:{showStoreList:function(){this.$store.commit("get_to","orders"),this.$yrouter.push({path:"/pages/shop/StoreList/index"})},addressType:function(t){!t||this.systemStore.id?(console.log(this),this.shipping_type=t):e.showToast({title:"暂无门店信息,您无法选择到店自提!",icon:"none",duration:2e3})},changeUseIntegral:function(e){this.isIntegral||(this.useIntegral=e.mp.detail.value[0])},computedPrice:function(){var e=this,t=this.shipping_type;(0,n.postOrderComputed)(this.orderGroupInfo.orderKey,{addressId:this.addressInfo.id,useIntegral:this.useIntegral?1:0,couponId:this.usableCoupon.id||0,shipping_type:parseInt(t)+1}).then((function(t){var o=t.data;"EXTEND_ORDER"===o.status?e.$yrouter.replace({path:"/pages/order/OrderDetails/index",query:{id:o.result.orderId}}):e.orderPrice=o.result}))},getCartInfo:function(){var t=this,o=this.$yroute.query.id;if(!o)return e.showToast({title:"参数有误",icon:"none",duration:2e3}),this.$yrouter.back();(0,n.postOrderConfirm)(o).then((function(e){console.log(e,999999),console.log(e.data.systemStore||{},999999),t.offlinePayStatus=e.data.offline_pay_status,t.orderGroupInfo=e.data,t.deduction=e.data.deduction,t.usableCoupon=e.data.usableCoupon||{},t.addressInfo=e.data.addressInfo||{},t.systemStore=e.data.systemStore||{},t.storeSelfMention=e.data.storeSelfMention,t.isEnough=e.data.isEnough,t.computedPrice()})).catch((function(t){console.log(t),e.showToast({title:"加载订单数据失败",icon:"none",duration:2e3})}))},addressTap:function(){this.showAddress=!0,this.addressLoaded||(this.addressLoaded=!0,this.$refs.mychild.getAddressList())},addressRedirect:function(){this.addressLoaded=!1,this.showAddress=!1},couponTap:function(){this.showCoupon=!0},changeCoupon:function(e){this.usableCoupon=e||{couponTitle:"不使用优惠券",id:0},this.computedPrice()},payItem:function(e){this.active=e},changeAddress:function(e){this.addressInfo=e,this.computedPrice()},createOrder:function(){var t=this;if(this.isIntegral){if(this.userInfo.integral<this.orderPrice.payIntegral)return void e.showToast({title:"积分不足",icon:"none",duration:2e3});this.active="integral"}var o=this.shipping_type;if(this.isIntegral||this.active)if(this.addressInfo.id||this.shipping_type){if(this.shipping_type){if((""===this.contacts||""===this.contactsTel)&&this.shipping_type)return void e.showToast({title:"请填写联系人或联系人电话",icon:"none",duration:2e3});if(!/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.contactsTel))return void e.showToast({title:"请填写正确的手机号",icon:"none",duration:2e3});if(!/^[\u4e00-\u9fa5\w]{2,16}$/.test(this.contacts))return void e.showToast({title:"请填写您的真实姓名",icon:"none",duration:2e3})}e.showLoading({title:"生成订单中"});var i={};"app"==this.$deviceType&&(i.from="app"),console.log(this.$deviceType),(0,r.subscribeMessage)(),(0,n.createOrder)(this.orderGroupInfo.orderKey,d({realName:this.contacts,phone:this.contactsTel,addressId:this.addressInfo.id,useIntegral:this.useIntegral?1:0,couponId:this.usableCoupon.id||0,payType:this.active,pinkId:this.pinkId,seckillId:this.orderGroupInfo.seckill_id,combinationId:this.orderGroupInfo.combination_id,bargainId:this.orderGroupInfo.bargain_id,from:this.from,mark:this.mark||"",shippingType:parseInt(o)+1,storeId:this.storeItems?this.storeItems.id:this.systemStore.id},i)).then((function(o){e.hideLoading(),r.handleOrderPayResults.call(t,o.data,"create",t.active)})).catch((function(e){(0,s.handleErrorMessage)(e,"创建订单失败")}))}else e.showToast({title:"请选择收货地址",icon:"none",duration:2e3});else e.showToast({title:"请选择支付方式",icon:"none",duration:2e3})}}};t.default=g}).call(this,o("543d")["default"])},"4b0f":function(e,t,o){"use strict";var n;o.d(t,"b",(function(){return i})),o.d(t,"c",(function(){return r})),o.d(t,"a",(function(){return n}));var i=function(){var e=this,t=e.$createElement;e._self._c},r=[]},"5b08":function(e,t,o){"use strict";o.r(t);var n=o("4b0f"),i=o("684a");for(var r in i)"default"!==r&&function(e){o.d(t,e,(function(){return i[e]}))}(r);o("7b59");var s,a=o("f0c5"),d=Object(a["a"])(i["default"],n["b"],n["c"],!1,null,"bcf49da2",null,!1,n["a"],s);t["default"]=d.exports},"684a":function(e,t,o){"use strict";o.r(t);var n=o("1ee2"),i=o.n(n);for(var r in n)"default"!==r&&function(e){o.d(t,e,(function(){return n[e]}))}(r);t["default"]=i.a},"7b59":function(e,t,o){"use strict";var n=o("dbe4"),i=o.n(n);i.a},dbe4:function(e,t,o){},f923:function(e,t,o){"use strict";(function(e){o("ef82");n(o("66fd"));var t=n(o("5b08"));function n(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,o("543d")["createPage"])}},[["f923","common/runtime","common/vendor"]]]);