(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/member/fees/pay"],{"0c51":function(e,t,n){"use strict";(function(e){var o=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n("7ca3")),c=n("8f59"),a=o(n("f5e9"));function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s={data:function(){return{loadEnd:!1,optionalPayMethod:4,payMethod:1,certificate:"",payFees:0,accountInfo:{}}},computed:u({},(0,c.mapState)({themeColor:function(e){return e.app.themeColor},iconPay:function(e){return a.default.svgToUrl("pay",e.app.themeColor)}})),onLoad:function(t){var n=this;this.optionalPayMethod=t.method,3==this.optionalPayMethod?this.payMethod=2:this.payMethod=1,this.payFees=t.fees,3==this.optionalPayMethod||4==this.optionalPayMethod?(e.showLoading({title:"加载中"}),this.getAccountInfo((function(){e.hideLoading(),n.loadEnd=!0}))):this.$nextTick((function(){n.loadEnd=!0}))},methods:{toPayment:function(){e.showLoading({title:"加载中",mask:!0}),this.$util.request("member.payOnline").then((function(t){if(1==t.code){var n=t.data;e.requestPayment(u(u({provider:"wxpay"},n),{},{success:function(){e.hideLoading(),e.reLaunch({url:"/pages/member/fees/success"})},fail:function(){e.hideLoading(),e.showToast({title:"支付已取消",icon:"none"})}}))}else e.showToast({title:t.msg,icon:"none"})})).catch((function(e){console.error("线上缴费 ",e)}))},toSubmit:function(){var t=this;this.certificate?(e.showLoading({title:"加载中",mask:!0}),this.uploadImage((function(n){t.$util.request("member.payOffline",{pay_voucher:n}).then((function(t){e.hideLoading(),1==t.code?e.reLaunch({url:"/pages/member/fees/success?type=1"}):e.showToast({title:t.msg,icon:"none"})})).catch((function(e){console.error("线下缴费 ",e)}))}))):e.showToast({title:"请上传支付凭证",icon:"none"})},uploadImage:function(t){this.$util.uploadFile(this.certificate).then((function(n){1==n.code?t(n.data.url):(e.hideLoading(),e.showToast({title:(null===n||void 0===n?void 0:n.msg)||"上传失败",icon:"none"}))})).catch((function(e){console.error("上传图片 ",e)}))},chooseImage:function(){var t=this;e.chooseMedia({count:1,mediaType:["image"],sourceType:["album","camera"],sizeType:["compressed"],success:function(e){t.certificate=e.tempFiles[0].tempFilePath}})},deleteImage:function(){this.certificate=""},previewImage:function(){e.previewImage({urls:[this.certificate],current:0})},getAccountInfo:function(t){var n=this;this.$util.request("member.accountInfo").then((function(o){t&&t(),1==o.code?n.accountInfo=o.data:e.showToast({title:o.msg,icon:"none"})})).catch((function(e){t&&t(),console.error("获取汇款账户信息 ",e)}))},handleCopy:function(e){this.$util.toPage({mode:8,content:e})}}};t.default=s}).call(this,n("df3c")["default"])},"4a86":function(e,t,n){"use strict";n.r(t);var o=n("a5a5"),i=n("d3fc");for(var c in i)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(c);n("5bb6");var a=n("828b"),r=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=r.exports},"5bb6":function(e,t,n){"use strict";var o=n("7848"),i=n.n(o);i.a},7848:function(e,t,n){},8949:function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("aa6c");o(n("3240"));var i=o(n("4a86"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},a5a5:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){}));var o=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.payMethod=1},e.e1=function(t){e.payMethod=2})},i=[]},d3fc:function(e,t,n){"use strict";n.r(t);var o=n("0c51"),i=n.n(o);for(var c in o)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(c);t["default"]=i.a}},[["8949","common/runtime","common/vendor"]]]);