(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/money/pay"],{"3c56":function(e,n,a){"use strict";(function(e,t){var o=a("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(a("2eee")),i=o(a("c973")),d=(a("c1eb"),a("5adf")),c=a("82ba"),s=(a("26cb"),{data:function(){return{payType:1,payName:"weixin",orderInfo:{},money:0,now_money:0,orderKey:"",orderId:"",payLoding:!1,type:"",pinkid:""}},computed:{},onLoad:function(e){var n=this;if(1==e.type)this.type=1,this.orderId=e.ordid,this.money=e.money;else{this.orderKey=e.key;var a=this.$api.prePage();(0,d.computedOrderkey)({orderkey:this.orderKey,couponId:a.couponChecked.id,addressId:a.addressData.id,useIntegral:a.checkedPoints?1:0}).then((function(e){var a=e.data;n.money=a.result.pay_price}))}e.pinkid&&(this.pinkid=e.pinkid),(0,c.getUserInfo)({}).then((function(e){var a=e.data;console.log(a),n.now_money=a.brokerage_price})).catch((function(e){console.log(e)}))},methods:{changePayType:function(e){this.payType=e,1==this.payType&&(this.payName="weixin"),2==this.payType&&(this.payName="ali"),3==this.payType&&(this.payName="brokerage")},orderMoneyPay:function(){var n=this;(0,d.orderPay)({uni:n.orderId,from:"routine",paytype:n.payName}).then((function(a){if("brokerage"==n.payName&&"SUCCESS"==a.data.status&&(200==a.status?n.paySuccessTo():n.$api.msg(msg)),"weixin"==n.payName||"routine"==n.payName){var o=a.data.result.jsConfig;console.log(o,"支付打印");var r={timeStamp:o.timestamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(e){n.paySuccessTo()},fail:function(){e.navigateTo({url:"/pages/order/order?state=0"})}};"weixin"==n.payName&&(console.log(r,"传入数据"),console.log(t,"wx"),t.requestPayment(r))}e.hideLoading(),n.payLoding=!1})).catch((function(a){e.hideLoading(),n.payLoding=!1,console.log(a)}))},paySuccessTo:function(){e.hideLoading(),e.redirectTo({url:"/pages/money/paySuccess?orderid="+this.orderId})},confirm:function(){var n=(0,i.default)(r.default.mark((function n(){var a;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=this,!("brokerage"==a.payName&&+a.now_money<a.money)){n.next=4;break}return e.showModal({title:"提示",content:"账户余额不足！",showCancel:!1,success:function(e){},fail:function(){},complete:function(){}}),n.abrupt("return");case 4:e.showLoading({title:"支付中",mask:!0}),a.payLoding=!0,1!=a.type?a.firstCreateOrder():a.orderMoneyPay();case 7:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}(),firstCreateOrder:function(){var n=this,a=n.$api.prePage(),t={real_name:a.addressData.real_name,phone:a.addressData.phone,couponId:a.couponChecked.id,addressId:a.addressData.id,useIntegral:a.checkedPoints?1:0,payType:n.payName,mark:a.desc,from:"routine",shipping_type:1};n.pinkid&&(t.pinkId=n.pinkid),(0,d.createOrderkey)(t,n.orderKey).then((function(a){var t=a.data,o=a.status,r=a.msg;if("ORDER_EXIST"==t.status)return e.showModal({title:"提示",content:r,showCancel:!1}),e.hideLoading(),void(n.payLoding=!1);n.orderId=t.result.orderId,"brokerage"==n.payName?200==o&&"SUCCESS"==t.status?n.paySuccessTo():n.$api.msg(r):n.orderMoneyPay()})).catch((function(a){e.hideLoading(),n.payLoding=!1,console.log(a)}))}}});n.default=s}).call(this,a("543d")["default"],a("bc2e")["default"])},"6bed":function(e,n,a){},7168:function(e,n,a){"use strict";var t=a("6bed"),o=a.n(t);o.a},b428:function(e,n,a){"use strict";(function(e,n){var t=a("4ea4");a("d1cd");t(a("66fd"));var o=t(a("d3622"));e.__webpack_require_UNI_MP_PLUGIN__=a,n(o.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},d3622:function(e,n,a){"use strict";a.r(n);var t=a("d4ee"),o=a("eb9e");for(var r in o)["default"].indexOf(r)<0&&function(e){a.d(n,e,(function(){return o[e]}))}(r);a("7168");var i=a("f0c5"),d=Object(i["a"])(o["default"],t["b"],t["c"],!1,null,null,null,!1,t["a"],void 0);n["default"]=d.exports},d4ee:function(e,n,a){"use strict";a.d(n,"b",(function(){return t})),a.d(n,"c",(function(){return o})),a.d(n,"a",(function(){}));var t=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){!e.payLoding&&e.confirm()})},o=[]},eb9e:function(e,n,a){"use strict";a.r(n);var t=a("3c56"),o=a.n(t);for(var r in t)["default"].indexOf(r)<0&&function(e){a.d(n,e,(function(){return t[e]}))}(r);n["default"]=o.a}},[["b428","common/runtime","common/vendor"]]]);