(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/member/upgrade/upgrade"],{1031:function(e,t,n){"use strict";n.r(t);var r=n("57cb"),a=n("ef85");for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);n("bf98");var i,c=n("f0c5"),u=Object(c["a"])(a["default"],r["b"],r["c"],!1,null,"a287a278",null,!1,r["a"],i);t["default"]=u.exports},"4a12":function(e,t,n){"use strict";(function(e){n("2d0a");r(n("66fd"));var t=r(n("1031"));function r(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},"57cb":function(e,t,n){"use strict";var r;n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return r}));var a=function(){var e=this,t=e.$createElement;e._self._c},o=[]},bf98:function(e,t,n){"use strict";var r=n("d825"),a=n.n(r);a.a},d825:function(e,t,n){},ef85:function(e,t,n){"use strict";n.r(t);var r=n("faa4"),a=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);t["default"]=a.a},faa4:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("2f62");function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c={data:function(){return{auto:!1,list:[],index:0,level:0,other:0,current:"wechat",detail:{price:"",money:""}}},name:"upgrade",computed:o({},(0,r.mapState)({memberImg:function(e){return e.mallConfig.__wxapp_img.member}})),methods:{payMember:function(t,n){var r=this;e.showLoading({mask:!0,title:"领取中..."}),r.$request({url:r.$api.member.purchase,data:{member_level:t,type:n},method:"post"}).then((function(n){e.hideLoading(),0===n.code?n.data.retry&&1===n.data.retry?r.getPayDataTimer=setTimeout((function(){r.payMember(t)}),1e3):r.pay(n.data.pay_id,t):e.showModal({title:"提示",content:n.msg,showCancel:!1})})).catch((function(t){e.hideLoading(),e.showModal({title:"提示",content:t.errMsg,showCancel:!1})}))},pay:function(t,n){var r=this;r.$payment.pay(t).then((function(t){e.showToast({title:"支付成功",duration:1e3}),r.level=n})).catch((function(t){e.showToast({title:"支付失败",icon:"none",duration:1e3})}))},change:function(e){var t=this;t.index=e.detail.current,t.detail=t.list[t.index]},getList:function(){var t=this;t.$request({url:t.$api.member.all,method:"get"}).then((function(n){if(e.hideLoading(),t.$hideLoading(),0==n.code){if(t.list=n.data.list,t.index=0,t.other>0)for(var r=0;r<t.list.length;r++)t.other==t.list[r].level&&(t.index=r);else for(var a=0;a<t.list.length;a++)t.level==t.list[a].level&&(t.index=a);t.detail=t.list[t.index]}else e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(n){e.hideLoading(),t.$hideLoading()}))}},onLoad:function(e){this.$commonLoad.onload(e);var t=this;e.level&&(t.level=e.level),e.other&&(t.other=e.other),t.$showLoading({text:"加载中..."}),t.getList()}};t.default=c}).call(this,n("543d")["default"])}},[["4a12","common/runtime","common/vendor"]]]);