(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/payment-mp-wx/payment-mp-wx"],{"0980":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=function(){Promise.all([n.e("common/vendor"),n.e("components/ns-show-toast/ns-show-toast")]).then(function(){return resolve(n("f505"))}.bind(null,n)).catch(n.oe)},o={name:"payment-mp-wx",props:{payInfo:{type:Object,default:function(){return{}}},isIphoneX:{type:Boolean,default:!1}},components:{nsShowToast:a},data:function(){return{payIndex:0,payTypeList:[{name:"微信支付",provider:"wxpay",icon:"iconweixinzhifu",type:"wechatpay"}]}},created:function(){this.getPayType()},methods:{setPayType:function(t){this.payIndex=t},pay:function(){var e=this,n=this.payTypeList[this.payIndex];n&&"wxpay"==n.provider&&this.$api.sendRequest({url:"/api/pay/pay",data:{out_trade_no:this.payInfo.out_trade_no,pay_type:n.type},success:function(a){if(a.code>=0){var o=a.data.data;t.requestPayment({provider:n.provider,timeStamp:o.timeStamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(t){e.$util.redirectTo("/pages/pay/result/result",{code:e.payInfo.out_trade_no},"","redirectTo")},fail:function(n){e.flag=!1,"requestPayment:fail cancel"==n.errMsg?e.$util.showToast({title:"您已取消支付"}):t.showModal({content:"支付失败,失败原因: "+n.errMsg,showCancel:!1}),setTimeout((function(){e.$util.redirectTo("/pages/pay/result/result",{code:e.payInfo.out_trade_no},"redirectTo")}),2e3)}})}else e.$util.showToast({title:a.message})},fail:function(t){e.$util.showToast({title:"request:fail"})}})},getPayType:function(){var t=this;this.$api.sendRequest({url:"/api/pay/type",success:function(e){0==e.code&&t.payTypeList.forEach((function(n,a){-1==e.data.pay_type.indexOf(n.type)&&t.payTypeList.splice(a,1)}))}})}}};e.default=o}).call(this,n("543d")["default"])},2005:function(t,e,n){"use strict";var a=n("6749"),o=n.n(a);o.a},6749:function(t,e,n){},9802:function(t,e,n){"use strict";n.r(e);var a=n("0980"),o=n.n(a);for(var i in a)"default"!==i&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=o.a},b83d:function(t,e,n){"use strict";n.r(e);var a=n("efca"),o=n("9802");for(var i in o)"default"!==i&&function(t){n.d(e,t,(function(){return o[t]}))}(i);n("2005");var s,u=n("f0c5"),r=Object(u["a"])(o["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],s);e["default"]=r.exports},efca:function(t,e,n){"use strict";var a={nsShowToast:function(){return Promise.all([n.e("common/vendor"),n.e("components/ns-show-toast/ns-show-toast")]).then(n.bind(null,"f505"))}},o=function(){var t=this,e=t.$createElement;t._self._c},i=[];n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return a}))}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/payment-mp-wx/payment-mp-wx-create-component',
    {
        'components/payment-mp-wx/payment-mp-wx-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("b83d"))
        })
    },
    [['components/payment-mp-wx/payment-mp-wx-create-component']]
]);
