require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/cashier/index"],{4582:function(t,e,i){"use strict";var a=i("9abe"),n=i.n(a);n.a},"67ed":function(t,e,i){"use strict";i.r(e);var a=i("b68d"),n=i.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(r);e["default"]=n.a},"8d3a":function(t,e,i){"use strict";i.r(e);var a=i("d4ba"),n=i("67ed");for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);i("4582");var o=i("f0c5"),s=Object(o["a"])(n["default"],a["b"],a["c"],!1,null,"79cc6059",null,!1,a["a"],void 0);e["default"]=s.exports},"9abe":function(t,e,i){},b68d:function(t,e,i){"use strict";(function(t,a){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("39ed"),r=i("4e39"),o={components:{countDown:function(){i.e("components/countDown/index").then(function(){return resolve(i("80f6"))}.bind(null,i)).catch(i.oe)},numberScroll:function(){i.e("components/numberScroll").then(function(){return resolve(i("b756"))}.bind(null,i)).catch(i.oe)}},data:function(){return{checked:!1,datatime:1676344056,cartArr:[{name:this.$t("微信支付"),icon:"icon-weixin2",value:"weixin",title:this.$t("使用微信快捷支付"),payStatus:1},{name:this.$t("支付宝支付"),icon:"icon-zhifubao",value:"alipay",title:this.$t("使用支付宝支付"),payStatus:1},{name:this.$t("余额支付"),icon:"icon-yuezhifu",value:"yue",title:this.$t("可用余额"),payStatus:1},{name:this.$t("线下支付"),icon:"icon-yuezhifu1",value:"offline",title:this.$t("使用线下付款"),payStatus:2},{name:this.$t("好友代付"),icon:"icon-haoyoudaizhifu",value:"friend",title:this.$t("找微信好友支付"),payStatus:1}],orderId:0,fromType:"",active:0,payPrice:0,payPriceShow:0,payPostage:0,offlinePostage:!1,invalidTime:0,initIn:!1,jumpData:{orderId:"",msg:""},formContent:"",oid:0}},watch:{cartArr:{handler:function(t,e){var i=this,a=[];t.forEach((function(t,e){t.payStatus&&(t.index=e,a.push(t))})),this.$nextTick((function(t){i.active=a[0].index,i.paytype=a[0].value}))},immediate:!0,deep:!0}},onLoad:function(t){t.order_id&&(this.orderId=t.order_id),t.from_type&&(this.fromType=t.from_type),this.getBasicConfig()},onShow:function(){var e=t.getEnterOptionsSync();if("1038"==e.scene&&"wxef277996acc166c3"==e.referrerInfo.appId&&this.initIn){var i=e.referrerInfo.extraData;this.initIn=!1,i?"success"==i.code?this.$util.Tips({title:this.$t("支付成功"),icon:"success"},{tab:5,url:"/pages/goods/order_pay_status/index?order_id=".concat(this.orderId,"&msg=").concat(this.jumpData.msg,"&type=3&totalPrice=").concat(this.payPriceShow)}):"cancel"==i.code?this.$util.Tips({title:this.$t("取消支付")},{tab:5,url:"/pages/goods/order_pay_status/index?order_id=".concat(this.orderId,"&msg=").concat(this.$t("取消支付"),"&type=3&totalPrice=").concat(this.payPriceShow,"&status=2")}):a.reLaunch({url:"/pages/goods/order_pay_status/index?order_id=".concat(this.orderId,"&msg=").concat(this.$t("支付失败"),"&totalPrice=").concat(this.payPriceShow)}):this.$util.Tips({title:this.$t("取消支付")},{tab:5,url:"/pages/goods/order_pay_status/index?order_id=".concat(this.orderId,"&msg=").concat(this.$t("取消支付"),"&type=3&totalPrice=").concat(this.payPriceShow,"&status=2")})}},methods:{getBasicConfig:function(){var t=this;(0,r.basicConfig)().then((function(e){t.cartArr[0].payStatus=e.data.pay_weixin_open||0,t.cartArr[1].payStatus=e.data.ali_pay_status||0,t.cartArr[1].payStatus=0,t.cartArr[2].payStatus=e.data.yue_pay_status,e.data.offline_pay_status?t.cartArr[3].payStatus=1:t.cartArr[3].payStatus=0,t.cartArr[4].payStatus=e.data.friend_pay_status||0,t.getCashierOrder()})).catch((function(e){return a.hideLoading(),t.$util.Tips({title:e})}))},getCashierOrder:function(){var t=this;a.showLoading({title:this.$t("创建订单中")}),(0,n.getCashierOrder)(this.orderId,this.fromType).then((function(e){t.payPrice=t.payPriceShow=e.data.pay_price,t.payPostage=e.data.pay_postage,t.offlinePostage=e.data.offline_postage,t.invalidTime=e.data.invalid_time,t.cartArr[2].number=e.data.now_money,t.number=Number(e.data.now_money)||0,t.oid=e.data.oid,a.hideLoading()})).catch((function(e){return a.hideLoading(),t.$util.Tips({title:e})}))},payType:function(t,e,i){this.active=i,this.paytype=e,this.number=t,this.offlinePostage&&(this.payPriceShow="offline"==e?this.$util.$h.Sub(this.payPrice,this.payPostage):this.payPrice)},formpost:function(t,e){var i=document.createElement("form");for(var a in i.action=t,i.method="post",i.target="_self",i.style.display="none",e){var n=document.createElement("input");n.name=a,n.value=e[a],i.appendChild(n)}document.body.appendChild(i),this.$nextTick((function(t){i.submit()}))},waitPay:function(){a.reLaunch({url:"/pages/goods/order_pay_status/index?order_id="+this.orderId+"&msg=取消支付&type=3&status=2&totalPrice="+this.payPriceShow})},goPay:function(e,i){var r=this,o=this;return o.orderId?"yue"==i&&parseFloat(e)