(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/createOrder"],{241:function(t,e,n){"use strict";n.r(e);var i=n(242),s=n(244);for(var o in s)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return s[t]}))}(o);n(246);var r,a=n(39),c=Object(a["default"])(s["default"],i["render"],i["staticRenderFns"],!1,null,"7da806a4",null,!1,i["components"],r);c.options.__file="components/uni-popup/uni-popup.vue",e["default"]=c.exports},242:function(t,e,n){"use strict";n.r(e);var i=n(243);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},243:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return s})),n.d(e,"staticRenderFns",(function(){return r})),n.d(e,"recyclableRender",(function(){return o})),n.d(e,"components",(function(){return i}));try{i={uniTransition:function(){return n.e("components/uni-transition/uni-transition").then(n.bind(null,672))}}}catch(a){if(-1===a.message.indexOf("Cannot find module")||-1===a.message.indexOf(".vue"))throw a;console.error(a.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var s=function(){var t=this,e=t.$createElement;t._self._c},o=!1,r=[];s._withStripped=!0},244:function(t,e,n){"use strict";n.r(e);var i=n(245),s=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=s.a},245:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(){n.e("components/uni-transition/uni-transition").then(function(){return resolve(n(672))}.bind(null,n)).catch(n.oe)},s={name:"UniPopup",components:{uniTransition:i},props:{animation:{type:Boolean,default:!0},type:{type:String,default:"center"},maskClick:{type:Boolean,default:!0}},data:function(){return{duration:300,ani:[],showPopup:!1,showTrans:!1,maskClass:{position:"fixed",bottom:0,top:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.4)"},transClass:{position:"fixed",left:0,right:0}}},watch:{type:{handler:function(t){switch(this.type){case"top":this.ani=["slide-top"],this.transClass={position:"fixed",left:0,right:0};break;case"bottom":this.ani=["slide-bottom"],this.transClass={position:"fixed",left:0,right:0,bottom:0};break;case"center":this.ani=["zoom-out","fade"],this.transClass={position:"fixed",display:"flex",flexDirection:"column",bottom:0,left:0,right:0,top:0,justifyContent:"center",alignItems:"center"};break}},immediate:!0}},created:function(){this.animation?this.duration=300:this.duration=0},methods:{clear:function(t){t.stopPropagation()},open:function(){var t=this;this.showPopup=!0,this.$nextTick((function(){clearTimeout(t.timer),t.timer=setTimeout((function(){t.showTrans=!0}),50)})),this.$emit("change",{show:!0})},close:function(t){var e=this;this.showTrans=!1,this.$nextTick((function(){clearTimeout(e.timer),e.timer=setTimeout((function(){e.$emit("change",{show:!1}),e.showPopup=!1}),300)}))},onTap:function(){this.maskClick&&this.close()}}};e.default=s},246:function(t,e,n){"use strict";n.r(e);var i=n(247),s=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=s.a},247:function(t,e,n){},451:function(t,e,n){"use strict";(function(t){var e=n(3);n(25);e(n(24));var i=e(n(452));wx.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n(1)["createPage"])},452:function(t,e,n){"use strict";n.r(e);var i=n(453),s=n(455);for(var o in s)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return s[t]}))}(o);n(457);var r,a=n(39),c=Object(a["default"])(s["default"],i["render"],i["staticRenderFns"],!1,null,null,null,!1,i["components"],r);c.options.__file="pages/order/createOrder.vue",e["default"]=c.exports},453:function(t,e,n){"use strict";n.r(e);var i=n(454);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},454:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return s})),n.d(e,"staticRenderFns",(function(){return r})),n.d(e,"recyclableRender",(function(){return o})),n.d(e,"components",(function(){return i}));var s=function(){var t=this,e=t.$createElement,n=(t._self._c,3!=t.goodsType&&t.checkedStore?t._f("distance")(t.checkedStore.distance):null),i=3!=t.goodsType&&t.checkedPoint&&2==t.shipping_type?t._f("distance")(t.checkedPoint.distance):null,s=1==t.shipping_type&&t.ps_start_m>0?t._f("rml")(t.ps_start):null,o=1==t.shipping_type&&t.ps_start_m>0?t._f("rml")(t.ps_up):null,r=1!=t.shipping_type||t.ps_start_m>0?null:t._f("rml")(t.ps_start),a=1!=t.shipping_type||t.ps_start_m>0?null:t._f("rml")(t.ps_up),c=1==t.shipping_type?t._f("rml")(t.pay_dis):null,d=t.payType?(0==t.tabCurrentIndex?(1*t.allPayInfo.pay_price+1*t.allPayInfo.deposit).toFixed(2):(t.allPayInfo.pay_price-t.allPayInfo.pay_postage+t.allPayInfo.deposit).toFixed(2))||0:null;t._isMounted||(t.e0=function(e){t.couponListshow&&t.toggleMask("show")},t.e1=function(e){t.checkedPoints=!t.checkedPoints},t.e2=function(e){t.payType&&(0!=t.tabCurrentIndex||!t.isOver)&&t.submit()}),t.$mp.data=Object.assign({},{$root:{f0:n,f1:i,f2:s,f3:o,f4:r,f5:a,f6:c,g0:d}})},o=!1,r=[];s._withStripped=!0},455:function(t,e,n){"use strict";n.r(e);var i=n(456),s=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=s.a},456:function(t,e,n){"use strict";(function(t){var i=n(3);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=i(n(10)),o=n(51),r=n(49),a=n(52),c=n(27),d=(i(n(241)),n(33));function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function h(t){for(var e=1;e9?e.getDate():"0"+e.getDate(),o=e.getHours()>9?e.getHours():"0"+e.getHours(),r=e.getMinutes()>9?e.getMinutes():"0"+e.getMinutes();this.start_date=n+"-"+i+"-"+s,this.statr_time=o+":"+r,console.log(this.start_date,this.statr_time),console.log(this.checkedStore,"this.checkedStore+++++++++++++")},watch:{pstime:function(t,e){console.log(this.checkedStore.day_time.split(" - ")[0]);var n=this.checkedStore.day_time.split(" - ")[0],i=this.checkedStore.day_time.split(" - ")[1],s=t+":00";(n>s||ithis.checkedStore.radius?(this.$api.msg("地址超出配送范围"),this.isOver=!0):this.isOver=!1),this.payMoneyNub()},immediate:!0,deep:!0},tabCurrentIndex:function(t,e){if(console.log(t,"newValue++++++++"),this.orderKey&&this.payMoneyNub(),0==t){var n=this.space(this.addressData.latitude,this.addressData.longitude,this.checkedStore.latitude,this.checkedStore.longitude);console.log(n,this.checkedStore.radius),0==this.tabCurrentIndex&&(n>this.checkedStore.radius?(this.$api.msg("地址超出配送范围"),this.isOver=!0):this.isOver=!1)}}},filters:{distance:function(t){var e="";return t?1*t>1e3?(1*t/1e3).toFixed(2)+"km":(1*t).toFixed(0)+"m":e},rml:function(t){var e="";return t?1*t>=1e3?(1*t/1e3).toFixed(1)+"公里":(1*t).toFixed(0)+"米":e}},computed:h(h({},(0,c.mapState)("user",["hasLogin","userInfo","checkedStore","checkedPoint","distribution"])),{},{Postage:function(){var t=+this.moneyAll.storePostage+this.pay_ps;return 0==t?"免运费":"¥"+t},payAllMoney:function(){return+this.moneyAll.totalPrice+ +this.moneyAll.vipPrice}}),methods:h(h({},(0,c.mapMutations)("user",["setPointInfo"])),{},{x:function(){this.sub=!1},space:function(t,e,n,i){var s=t*Math.PI/180,o=n*Math.PI/180,r=s-o,a=e*Math.PI/180-i*Math.PI/180,c=2*Math.asin(Math.sqrt(Math.pow(Math.sin(r/2),2)+Math.cos(s)*Math.cos(o)*Math.pow(Math.sin(a/2),2)));return c*=6378.137,c=Math.round(1e4*c)/1e4,1e3*c},cartAdd:function(t){var e=this;(0,a.cartAdd)({new:1,mer_id:+t.merid,combinationId:+t.gid+"",productId:+t.pid,uniqueId:t.unique}).then((function(t){var n=t.data;e.cartId=n.cartId,e.loadData()})).catch((function(t){console.log(t)}))},userinfo:function(){var t=this;(0,r.getUserInfo)({}).then((function(e){var n=e.data;t.integralAll=n.integral}))},payMoneyNub:function(){var t=this,e=this;(0,o.computedOrderkey)({orderkey:this.orderKey,useIntegral:this.checkedPoints?1:0,couponId:this.couponChecked.id,addressId:this.addressData.id,shipping_type:this.shipping_type}).then((function(n){var i=n.data;if(t.payType=!0,t.integralShow=!0,t.pay_ps=1*i.result.pay_postage_sh,t.pay_dis=1*i.result.distance,t.ps_start=1*i.result.store.sh_start_distance,t.ps_start_m=1*i.result.store.sh_start_money,t.ps_up=1*i.result.store.sh_step,t.ps_up_m=1*i.result.store.sh_step_money,t.payPrice=+i.result.pay_price,t.integralMoney=i.result.deduction_price,t.allPayInfo=i.result,i.result.store_user){t.is_caigou=!0;var s=new Date((new Date).getTime()+288e5),o=s.toJSON().split("T").join(" ").substr(0,19),r=o.split(" ");t.psdate=r[0],t.pstime=r[1],(0,d.getPointList)({},t.checkedStore.id).then((function(t){var n=t.data;e.setPointInfo(n.list[0])})),e.addressData.real_name=e.userInfo.store_info.name,e.addressData.phone=e.userInfo.store_info.phone,console.log(e.userInfo.store_info.name),console.log(e.userInfo.store_info.phone)}})).catch((function(e){console.log(e),t.integralShow=!1,t.payType=!1}))},checkedIntegral:function(){this.checkedPoints=!this.checkedPoints},checkedCp:function(t){this.couponChecked=t,this.payMoneyNub()},couponsOrder:function(t){var e=this;(0,o.couponsOrder)({cartId:this.cartId},t).then((function(t){t.data.length>0&&(e.couponListshow=!0),e.couponList=t.data}))},tabClick:function(t){this.tabCurrentIndex=t,this.shipping_type=t+1},toggleMask:function(t){var e=this,n="show"===t?10:300,i="show"===t?1:0;this.maskState=2,setTimeout((function(){e.maskState=i}),n)},loadData:function(){var t=this,e=this;(0,o.confirm)({cartId:e.cartId+""}).then((function(n){var i=n.data;console.log(i,"loadData"),-1==e.addressId?(e.addressData=i.addressInfo||{},console.log("5555555")):(0,r.getAddress)({},e.addressId).then((function(t){var n=t.data;e.addressData=n})),e.shopList=i.cartInfo,console.log(e.shopList,"obj.shopList+++++++++"),e.moneyAll=i.priceGroup,console.log(e.moneyAll,"obj.moneyAll+++++++++++"),e.orderKey=i.orderKey,t.payMoneyNub(),e.couponsOrder(i.priceGroup.totalPrice)})).catch((function(t){}))},numberChange:function(t){this.number=t.number},changePayType:function(t){this.payType=t},submit:function(){if(console.log("点击提交"),3!=this.goodsType&&!this.checkedStore)return this.$api.msg("请选择下单门店");if(3!=this.goodsType){if(""==this.psdate||""==this.pstime)return 1==this.shipping_type?this.$api.msg("请选择配送时间"):this.$api.msg("请选择自提时间");this.time_area=this.psdate+" "+this.pstime+":00",console.log(this.time_area,"this.time_area")}if(2==this.shipping_type){if(3!=this.goodsType){if(!this.checkedPoint)return this.$api.msg("请选择自提点");console.log(this.checkedPoint,"this.checkedPoint++++++++++++++")}console.log(this.checkedPoint,"this.checkedPoint+++++++++++")}if(this.checkedPoints&&this.shopList.length>1)return this.$api.msg("积分商品只可单件购买"),!1;if(!this.addressData.real_name&&3!=this.goodsType)return this.$api.msg("请选择收货地址"),!1;console.log("拼接URL66666666666666"),this.sub=!0;var e="/pages/money/pay?key="+this.orderKey+"&store_id="+this.checkedStore.id+"&shipping_type="+this.shipping_type;3==this.goodsType&&(e+="&goodstype="+this.goodsType),2==this.shipping_type&&(e+="&point_id="+this.checkedPoint.id),console.log(e,"url+++++++++++++++"),this.pinkid&&(e+="&pinkid="+this.pinkid),t.navigateTo({url:e})},selectStore:function(){t.navigateTo({url:"/pages/order/choisestore?type=1"})},selectPoint:function(){if(!this.checkedStore)return this.$api.msg("请选择下单门店");t.navigateTo({url:"/pages/order/choisestore?type=2&id="+this.checkedStore.id})},bindDateChange:function(t){console.log(t,"ddddddddddddddddddd"),this.psdate=t.detail.value,console.log(this.psdate)},bindTimeChange:function(t){this.pstime=t.detail.value,console.log(this.pstime)}})};e.default=p}).call(this,n(1)["default"])},457:function(t,e,n){"use strict";n.r(e);var i=n(458),s=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=s.a},458:function(t,e,n){}},[[451,"common/runtime","common/vendor"]]]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/order/createOrder.js.map