(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/createOrder"],{"0079":function(e,t,n){},"0a30":function(e,t,n){"use strict";n.r(t);var i=n("54ec"),a=n.n(i);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},1337:function(e,t,n){"use strict";var i;n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i}));var a=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()})},o=[]},"3d73":function(e,t,n){"use strict";n.r(t);var i=n("1337"),a=n("0a30");for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);n("9866");var c,r=n("f0c5"),s=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],c);t["default"]=s.exports},"54ec":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n("62c8"),a=n("7eca"),o=n("64ab");function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r={data:function(){var e;return e={isVip:0,addressImg:"data:image/png;base64, ",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},c(e,"payType",!0),c(e,"pinkid",""),c(e,"isP",0),e},onLoad:function(e){this.isVip=e.isVip,this.isP=e.isP,"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,o.cartAdd)({cartNum:1,new:1,mer_id:+e.merid,combinationId:+e.gid,productId:+e.pid,uniqueId:e.unique}).then((function(e){var n=e.data;t.cartId=n.cartId,t.loadData()})).catch((function(e){console.log(e)}))},userinfo:function(){var e=this;(0,a.userinfo)({}).then((function(t){var n=t.data,i=e;i.integralAll=n.integral,i.pickUpInfo.real_name=n.nickname,i.pickUpInfo.phone=n.phone}))},payMoneyNub:function(){var e=this;(0,i.computedOrderkey)({orderkey:this.orderKey,useIntegral:this.checkedPoints?1:0,couponId:this.couponChecked.id,addressId:this.addressData.id}).then((function(t){var n=t.data;console.log(n,"111"),e.payType=!0,e.integralShow=!0,e.payPrice=+n.result.pay_price,e.integralMoney=n.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,i.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,n="show"===e?10:300,i="show"===e?1:0;this.maskState=2,setTimeout((function(){t.maskState=i}),n)},loadData:function(){var e=this,t=this;(0,i.confirm)({cartId:t.cartId+""}).then((function(n){var i=n.data;console.log(i,"123456"),t.addressData=i.addressInfo||{},t.shopList=i.cartInfo,t.moneyAll=i.priceGroup,t.orderKey=i.orderKey,t.shopAddress=i.system_store,t.desc=i.desc,e.payMoneyNub(),t.couponsOrder(i.priceGroup.totalPrice)}))},numberChange:function(e){this.number=e.number},changePayType:function(e){this.payType=e},submit:function(){var t=this;if(this.checkedPoints&&this.shopList.length>1)return this.$api.msg("积分商品只可单件购买"),!1;if(!this.addressData.real_name&&0==this.tabCurrentIndex)return this.$api.msg("请选择收货地址"),!1;if(1===t.tabCurrentIndex){if(!t.pickUpInfo.real_name)return t.$api.msg("请填写用户名"),!1;t.addressData.real_name=t.pickUpInfo.real_name,t.addressData.phone=t.pickUpInfo.phone}var n="/pages/money/pay?key="+this.orderKey+"&isVip="+this.isVip;this.pinkid&&(n+="&pinkid="+this.pinkid),e.navigateTo({url:n})}}};t.default=r}).call(this,n("543d")["default"])},"621c":function(e,t,n){"use strict";(function(e){n("856e");i(n("66fd"));var t=i(n("3d73"));function i(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])},9866:function(e,t,n){"use strict";var i=n("0079"),a=n.n(i);a.a}},[["621c","common/runtime","common/vendor"]]]);