(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/member/upgrade/upgrade"],{"4a9f":function(e,t,n){"use strict";n.r(t);var r=n("6a72"),a=n.n(r);for(var i in r)"default"!==i&&function(e){n.d(t,e,(function(){return r[e]}))}(i);t["default"]=a.a},"6a72":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 i(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){o(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 o(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:i({},(0,r.mapState)({theme:function(e){return e.mallConfig.theme},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 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){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"])},"6e95":function(e,t,n){"use strict";var r,a=function(){var e=this,t=e.$createElement;e._self._c},i=[];n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return r}))},a0f3:function(e,t,n){},a9db:function(e,t,n){"use strict";(function(e){n("8748");r(n("66fd"));var t=r(n("bcf2"));function r(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},bcf2:function(e,t,n){"use strict";n.r(t);var r=n("6e95"),a=n("4a9f");for(var i in a)"default"!==i&&function(e){n.d(t,e,(function(){return a[e]}))}(i);n("bed6");var o,c=n("f0c5"),u=Object(c["a"])(a["default"],r["b"],r["c"],!1,null,"2cf867a3",null,!1,r["a"],o);t["default"]=u.exports},bed6:function(e,t,n){"use strict";var r=n("a0f3"),a=n.n(r);a.a}},[["a9db","common/runtime","common/vendor"]]]);