(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/createOrder"],{"162d":function(e,t,n){"use strict";n.r(t);var i=n("82f7"),a=n("d8ad");for(var c in a)"default"!==c&&function(e){n.d(t,e,(function(){return a[e]}))}(c);n("4350");var r,o=n("f0c5"),d=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],r);t["default"]=d.exports},"31ca":function(e,t,n){},4350:function(e,t,n){"use strict";var i=n("31ca"),a=n.n(i);a.a},8028:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n("5531"),a=n("f9a9"),c=n("4d2c");function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o={data:function(){var e;return e={addressImg:"data:image/png;base64, ",tabCurrentIndex:0,navList:[{state:0,text:"快递配送"},{state:1,text:"到店自提"}],maskState:0,desc:"",payType:1,couponList:[],couponListshow:!1,couponChecked:{},addressData:{},shopAddress:{name:"",mobile:"",addressName:"",address:"",area:"",default:!1},shopList:[],cartId:"",moneyAll:{storeFreePostage:0,storePostage:0,totalPrice:0,vipPrice:0},payPrice:0,orderKey:"",checkedPoints:!1,integralAll:0,integralMoney:0,integralShow:!1},r(e,"payType",!0),r(e,"pinkid",""),e},onLoad:function(e){"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()}},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}).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;e.integralAll=n.integral}))},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).then((function(e){e.data.length>0&&(t.couponListshow=!0),t.couponList=e.data}))},tabClick:function(e){this.tabCurrentIndex=e},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;t.addressData=i.addressInfo||{},t.shopList=i.cartInfo,t.moneyAll=i.priceGroup,t.orderKey=i.orderKey,e.payMoneyNub(),t.couponsOrder(i.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)return this.$api.msg("请选择收货地址"),!1;var t="/pages/money/pay?key="+this.orderKey;this.pinkid&&(t+="&pinkid="+this.pinkid),e.navigateTo({url:t})}}};t.default=o}).call(this,n("543d")["default"])},"82f7":function(e,t,n){"use strict";var i;n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return c})),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.payType&&e.submit()})},c=[]},d8ad:function(e,t,n){"use strict";n.r(t);var i=n("8028"),a=n.n(i);for(var c in i)"default"!==c&&function(e){n.d(t,e,(function(){return i[e]}))}(c);t["default"]=a.a},f290:function(e,t,n){"use strict";(function(e){n("30ba");i(n("66fd"));var t=i(n("162d"));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"])}},[["f290","common/runtime","common/vendor"]]]);