(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/createOrder"],{"2c8d":function(e,t,i){"use strict";i.r(t);var n=i("b026"),a=i("ce84");for(var s in a)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(s);i("7326");var o=i("f0c5"),c=Object(o["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=c.exports},"2ddf":function(e,t,i){},"628a":function(e,t,i){"use strict";(function(e){var n=i("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(i("9523")),s=i("1b3d"),o=i("36af"),c=i("5e62"),r={data:function(){var e;return e={isVip:0,addressImg:"data:image/png;base64,[encoded data, 4176 characters]",tabCurrentIndex:0,navList:[{state:0,text:"快递配送"},{state:1,text:"到店自提"}],maskState:0,desc:"",payType:1,couponList:[],couponListshow:!1,couponChecked:{},addressData:{},pickUpInfo:{real_name:"",phone:""},shopAddress:{name:"",mobile:"",addressName:"",address:"",area:"",default:!1},shopList:[],system_store:[],cartId:"",moneyAll:{storeFreePostage:0,storePostage:0,totalPrice:0,vipPrice:0},payPrice:0,orderKey:"",checkedPoints:!1,integralAll:0,integralMoney:0,integralShow:!1},(0,a.default)(e,"payType",!0),(0,a.default)(e,"pinkid",""),(0,a.default)(e,"isP",0),(0,a.default)(e,"store_id",0),e},onLoad:function(e){this.isVip=e.isVip,this.isP=e.isP,e.store_id&&(this.store_id=e.store_id),"pink"==e.type?(this.pinkid=e.pinkId,this.cartAdd(e)):(this.cartId=e.id,this.loadData()),this.userinfo()},watch:{checkedPoints:function(e,t){this.integralShow=!1,this.payMoneyNub()},addressData:function(){this.payMoneyNub()}},computed:{Postage:function(){var e=+this.moneyAll.storePostage;return 0==e?"免运费":"￥"+e},payAllMoney:function(){return+this.moneyAll.totalPrice+ +this.moneyAll.vipPrice}},methods:{cartAdd:function(e){var t=this;(0,c.cartAdd)({cartNum:1,new:1,mer_id:+e.merid,combinationId:+e.gid,productId:+e.pid,uniqueId:e.unique}).then((function(e){var i=e.data;t.cartId=i.cartId,t.loadData()})).catch((function(e){console.log(e)}))},userinfo:function(){var e=this;(0,o.userinfo)({}).then((function(t){var i=t.data,n=e;n.integralAll=i.integral,n.pickUpInfo.real_name=i.nickname,n.pickUpInfo.phone=i.phone}))},payMoneyNub:function(){var e=this;(0,s.computedOrderkey)({orderkey:this.orderKey,useIntegral:this.checkedPoints?1:0,couponId:this.couponChecked.id,addressId:this.addressData.id}).then((function(t){var i=t.data;console.log(i,"111"),e.payType=!0,e.integralShow=!0,e.payPrice=+i.result.pay_price,e.integralMoney=i.result.deduction_price})).catch((function(t){console.log(t),e.integralShow=!1,e.payType=!1}))},checkedIntegral:function(){this.checkedPoints=!this.checkedPoints},checkedCp:function(e){this.couponChecked=e,this.payMoneyNub()},couponsOrder:function(e){var t=this;(0,s.couponsOrder)({},e,this.cartId).then((function(e){e.data.length>0&&(t.couponListshow=!0),t.couponList=e.data}))},tabClick:function(e){this.tabCurrentIndex=e,this.addressData={}},toggleMask:function(e){var t=this,i="show"===e?10:300,n="show"===e?1:0;this.maskState=2,setTimeout((function(){t.maskState=n}),i)},loadData:function(){var e=this,t=this;(0,s.confirm)({cartId:t.cartId+""}).then((function(i){var n=i.data;console.log(n,"123456"),t.addressData=n.addressInfo||{},t.shopList=n.cartInfo,t.moneyAll=n.priceGroup,t.orderKey=n.orderKey,t.shopAddress=n.system_store,t.desc=n.desc,e.payMoneyNub(),t.couponsOrder(n.priceGroup.totalPrice)}))},numberChange:function(e){this.number=e.number},changePayType:function(e){this.payType=e},submit:function(){if(this.checkedPoints&&this.shopList.length>1)return this.$api.msg("积分商品只可单件购买"),!1;if(!this.addressData.real_name&&0==this.tabCurrentIndex&&8!=isVip)return this.$api.msg("请选择收货地址"),!1;if(1===this.tabCurrentIndex){if(!this.pickUpInfo.real_name)return this.$api.msg("请填写用户名"),!1;if(!this.pickUpInfo.phone)return this.$api.msg("请填写手机号"),!1;this.addressData.real_name=this.pickUpInfo.real_name,this.addressData.phone=this.pickUpInfo.phone}var t="/pages/money/pay?key="+this.orderKey+"&isVip="+this.isVip;this.pinkid&&(t+="&pinkid="+this.pinkid),e.navigateTo({url:t})}}};t.default=r}).call(this,i("543d")["default"])},7326:function(e,t,i){"use strict";var n=i("2ddf"),a=i.n(n);a.a},abfd:function(e,t,i){"use strict";(function(e,t){var n=i("4ea4");i("12d5");n(i("66fd"));var a=n(i("2c8d"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(a.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},b026:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){}));var n=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.couponListshow&&e.toggleMask("show")},e.e1=function(t){e.payType&&e.submit()})},a=[]},ce84:function(e,t,i){"use strict";i.r(t);var n=i("628a"),a=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(s);t["default"]=a.a}},[["abfd","common/runtime","common/vendor"]]]);