(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/createOrder"],{"12e2":function(e,t,n){"use strict";(function(e){var i=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n("9523")),c=n("5adf"),o=n("82ba"),r=n("1d73"),d={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},(0,a.default)(e,"payType",!0),(0,a.default)(e,"pinkid",""),e},onLoad:function(e){"pink"==e.type?(this.pinkid=e.pinkId,this.cartAdd(e)):(this.cartId=e.id,this.loadData()),this.getUserInfo()},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,r.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)}))},getUserInfo:function(){var e=this;(0,o.getUserInfo)({}).then((function(t){var n=t.data;e.integralAll=n.integral}))},payMoneyNub:function(){var e=this;(0,c.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,c.couponsOrder)({},e,this.cartId).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,c.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=d}).call(this,n("543d")["default"])},"3e1e":function(e,t,n){"use strict";var i=n("ade8"),a=n.n(i);a.a},8057:function(e,t,n){"use strict";n.r(t);var i=n("12e2"),a=n.n(i);for(var c in i)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(c);t["default"]=a.a},"9ab7":function(e,t,n){"use strict";(function(e,t){var i=n("4ea4");n("d1cd");i(n("66fd"));var a=i(n("f390"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(a.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},ade8:function(e,t,n){},b038:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){}));var i=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=[]},f390:function(e,t,n){"use strict";n.r(t);var i=n("b038"),a=n("8057");for(var c in a)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(c);n("3e1e");var o=n("f0c5"),r=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);t["default"]=r.exports}},[["9ab7","common/runtime","common/vendor"]]]);