(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-05a7"],{"/u1q":function(t,s,i){"use strict";i.r(s);var e=i("gDS+"),o=i.n(e),a=i("14Xm"),n=i.n(a),c=i("D3Ub"),r=i.n(c),d=i("pMXA"),l=i("LmOT"),p=i("NW0I"),_=i("g09S"),u={directives:{focus:function(t,s,i){var e=s.value,o=i.context;e&&o.$nextTick(function(){t.focus()})}},data:function(){return{bgColor:{aside_bg_color:"#fff",bg_color:"#31374e",min_bg_color:"#ffb83d",font_s_color:"#fff",font_m_colo:"#000"},payArr:[],payInd:"",payOption:!1,setPriceShow:!1,input:"",infoData:[],checkDeductionList:[],member_coupon_ids:[],order_ids:"",payInfo:[],order_goods_model:[],order_model:[],actually:0,nowPrice_show:"",moneyRece:"",codeUser:"",isclick:!1,payStatus_fail:!1,payStatus_succ:!1,payStatus_loading:!1,asideIndex:0,Interval:null}},components:{headTop:d.a,orderLeft:l.a,orderRight:p.a,userPovop:_.a},computed:{getMember:function(){return this.$store.getters.getPosMember},moneyReceComputed:function(){if(0!=this.moneyRece)return(Number(this.moneyRece)-Number(this.infoData.total_price)).toFixed(2)},mimputedPrice:function(){var t=this.order_model.price,s=0;return this.order_goods_model.forEach(function(t){t.nowPrice&&(s+=Number(t.nowPrice))}),isNaN(Number(t)+Number(s))?0:(this.nowPrice_show=s,this.actually=(Number(t)+Number(s)).toFixed(2))},checkStatus:function(){return 73==this.payInd||29==this.payInd||40==this.payInd||94==this.payInd||95==this.payInd},checkSpanTxt:function(){return 73==this.payInd||94==this.payInd?"请打开微信,点击右上角+号--收付款,向收银员展示微信付款码!":40==this.payInd||95==this.payInd||29==this.payInd?"请打开支付宝,点击收付款,向收银员展示付款码!":void 0}},mounted:function(){this.asideIndex=this.$route.params.asideIndex,this.initJson()},activated:function(){console.log("1111111111111111")},methods:{editMember_close:function(t){this.isclick=!1},imputedPrice:function(){var t=0;return this.order_goods_model.forEach(function(s){s.nowPrice&&(t+=Number(s.nowPrice))}),isNaN(t)?0:t},payShowHide:function(){(this.payStatus_fail||this.payStatus_succ)&&0==this.asideIndex&&this.$store.commit("hangTag"),this.$router.push(this.fun.getUrl("checkstand",{},{}))},tryTap:function(){this.payStatus_fail=!1,this.payStatus_succ=!1},payIndMethod:function(){if(this.isclick)this.$message.error("还在请求支付,请等待~");else if(this.isclick=!0,"73"==this.payInd||29==this.payInd||87==this.payInd||40==this.payInd||95==this.payInd||94==this.payInd){var t=void 0;t="73"==this.payInd?"plugin.shop-pos.frontend.merge-pay.wechatMicroPay":"87"==this.payInd?"plugin.shop-pos.frontend.merge-pay.leshuaPos":"40"==this.payInd?"plugin.shop-pos.frontend.merge-pay.alipayScanPay":"95"==this.payInd?"plugin.shop-pos.frontend.merge-pay.alipayCardPayHj":"94"==this.payInd?"plugin.shop-pos.frontend.merge-pay.wechatCardPayHj":"plugin.shop-pos.frontend.merge-pay.alipay-pay-hj",this.payPostMethod(t,this.payInfo.order_pay.id)}else"3"==this.payInd?this.balancePay():"-1"==this.payInd&&this.cashPayBtn()},codeCreatOrder:function(){var t=this,s={price:this.$route.params.price,store_id:0,member_coupon_ids:[],orders:[],mobile:"",realname:"",goods_id:this.$store.getters.getPosUser.pos_goods_id,is_shop_pos:1,dispatch_type_id:14};$http.post("plugin.sweep-buy.frontend.controllers.create.index",s,"loading").then(function(s){1===s.result?(t.order_ids=s.data.order_ids,t.mergePay()):t.$message.error(s.msg),t.isclick=!1}).catch(function(t){console.log(t)})},cashPayBtn:function(){var t=this;if(this.moneyReceComputed<0)return this.$message.error("还差"+parseInt(this.moneyReceComputed)),void(this.isclick=!1);$http.post("plugin.shop-pos.frontend.merge-pay.cashPay",{order_pay_id:this.payInfo.order_pay.id},"loading").then(function(s){1===s.result?(t.$message.success("交易成功"),t.goHome()):(t.payStatus_fail=!1,t.$message.error(s.msg)),t.isclick=!1}).catch(function(t){console.log(t)})},balancePay:function(){var t=this,s={order_pay_id:this.payInfo.order_pay.id};$http.post("plugin.shop-pos.frontend.credit-merge-pay.credit2",s,"loading").then(function(s){if(1===s.result)t.payStatus_succ=!0;else{if(1==s.data.code_check)return t.$refs.options.orderShow=!0,void(t.$refs.options.oneShow=!0);t.payStatus_fail=!1,t.$message.error(s.msg)}t.isclick=!1}).catch(function(t){console.log(t)})},payPostMethod:function(t,s){var i=this;$http.post(t,{auth_code:this.codeUser,order_pay_id:s},"loading").then(function(t){if(1===t.result){if(95==i.payInd||94==i.payInd)return void i.hjPayMethod(s);i.payStatus_succ=!0}else i.payStatus_fail=!1,i.$message.error(t.msg);i.isclick=!1}).catch(function(t){console.log(t)})},hjPayMethod:function(t){var s=this;$http.post("order.merge-pay.check-order-pay",{order_pay_id:t},"loading").then(function(i){1===i.result?1==i.data.status?(clearInterval(s.Interval),s.Interval=null,s.payStatus_loading=!1,s.payStatus_succ=!0):(s.payStatus_loading=!0,s.Interval||(s.Interval=setInterval(function(){s.hjPayMethod(t)},1e3))):s.$message.error(i.msg),s.isclick=!1}).catch(function(t){console.log(t)})},sureConfirm:function(){this.actually<0?this.$message.error("改价后价格不能少于0元"):(this.infoData.total_price=this.actually,this.updateOrderPrice(),this.setPriceShow=!1)},nowEditPrice:function(t){t.nowPrice},updateOrderPrice:function(){var t=this;return r()(n.a.mark(function s(){var i,e;return n.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:i={order_goods_id:"",change_price:""},e={order_id:Number(t.order_ids),dispatch_price:"0.00",order_goods:[{change_price:0,order_goods_id:5451}]},t.order_goods_model.forEach(function(t,s){(i={order_goods_id:"",change_price:""}).order_goods_id=t.id,i.change_price=t.nowPrice?t.nowPrice:0,e.order_goods[s]=i}),$http.post("plugin.shop-pos.frontend.order.changeOrderPrice",e,"loading").then(function(s){1===s.result?(t.$message.success(s.msg),t.mergePay()):t.$message.error(s.msg)}).catch(function(t){console.log(t)});case 4:case"end":return s.stop()}},s,t)}))()},setPriceShow_open:function(){var t=this;$http.post("plugin.shop-pos.frontend.order.getOrderPrice",{order_id:this.order_ids},"loading").then(function(s){1===s.result?(t.order_goods_model=s.data.order_goods_model,t.order_model=s.data.order_model):t.$message.error(s.msg)}).catch(function(t){console.log(t)})},payIcon:function(t){t[0].value&&(this.payInd=t[0].value),t.forEach(function(t){"posCash"==t.code?t.icon="icon-pm_auction_paying":"balance"==t.code?t.icon="icon-fontclass-fanli":"wechatMicroPay"==t.code?t.icon="icon-card_weixin":"convergePayAlipay"==t.code?t.icon="icon-all_alipay":"leshuaPos"==t.code?t.icon="icon-fontclass-saomajilu":"AlipayScan"==t.code?t.icon="icon-all_alipay":"convergeAlipayCardPay"==t.code?t.icon="icon-pay_utsd":"convergeWechatCardPay"==t.code&&(t.icon="icon-pay_default")}),this.payArr=t},tapOrder:function(){0==this.asideIndex?this.createOrder():this.codeCreatOrder()},createOrder:function(){var t=this,s={address:"",goods:this.assembleGoods(),member_coupon_ids:o()(this.member_coupon_ids),orders:o()(this.assembleDeduction()),invoice_type:0,rise_type:0,call:"",email:"",company_number:"",mark:0,dispatch_type_id:14,is_shop_pos:1};$http.post("plugin.shop-pos.frontend.create",s,"loading").then(function(s){1===s.result?(t.order_ids=s.data.order_ids,t.mergePay()):t.$message.error(s.msg)}).catch(function(t){console.log(t)})},mergePay:function(){var t=this,s={order_ids:this.order_ids,is_shop_pos:1};$http.get("plugin.shop-pos.frontend.merge-pay.index",s,"loading").then(function(s){1===s.result?(console.log(s.data),t.payOption=!0,t.payInfo=s.data,t.payIcon(s.data.buttons)):t.$message.error(s.msg)}).catch(function(t){console.log(t)})},discountHandle:function(t){var s=t.item,i=t.value;this.checkDeductionList.length>0?(console.log(i,"抵扣更新"),this.checkDeductionList.forEach(function(t,s){t&&t.pre_id&&(i&&i.checked?(console.log("选中的时候检查是否有对应的code"),t.deduction_ids&&-1==t.deduction_ids.indexOf(i.code)&&t.deduction_ids.push(i.code)):i&&!i.checked&&(console.log("取消选中的时候检查去掉对应的code"),t.deduction_ids&&t.deduction_ids.indexOf(i.code)>-1&&t.deduction_ids.splice(t.deduction_ids.indexOf(i.code),1)))})):this.checkDeductionList.push({deduction_ids:i&&i.code&&i.checked?[i.code]:[],pre_id:s.pre_id}),this.initJson()},couponUpdateMethod:function(t){var s=t;this.member_coupon_ids=s,this.initJson()},assembleDeduction:function(){for(var t=[],s=0;s