(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/member/upgrade/upgrade"],{"0fd3":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("2f62");function i(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?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(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){var n=this;e.showLoading({title:"领取中..."}),n.$request({url:n.$api.member.purchase,data:{member_level:t},method:"post"}).then((function(r){e.hideLoading(),0===r.code?r.data.retry&&1===r.data.retry?n.getPayDataTimer=setTimeout((function(){n.payMember(t)}),1e3):n.pay(r.data.pay_id,t):e.showModal({title:"提示",content:r.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 i=0;i<t.list.length;i++)t.level==t.list[i].level&&(t.index=i);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){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"])},"37f0":function(e,t,n){},"398d":function(e,t,n){"use strict";n.r(t);var r=n("0fd3"),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);t["default"]=i.a},"795e":function(e,t,n){"use strict";var r=n("37f0"),i=n.n(r);i.a},a291:function(e,t,n){"use strict";(function(e){n("b8bc");r(n("66fd"));var t=r(n("c626"));function r(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},c626:function(e,t,n){"use strict";n.r(t);var r=n("d5b2"),i=n("398d");for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("795e");var a,c=n("f0c5"),u=Object(c["a"])(i["default"],r["b"],r["c"],!1,null,"4327a954",null,!1,r["a"],a);t["default"]=u.exports},d5b2:function(e,t,n){"use strict";var r;n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return r}));var i=function(){var e=this,t=e.$createElement;e._self._c},o=[]}},[["a291","common/runtime","common/vendor"]]]);