| 12 |
- webpackJsonp([16],{"8VMU":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a("mtWM"),s=a.n(l),r=a("wwIJ"),i=a("rHil"),n=a("oWtu"),o=a("NYxO"),d=a("YtJ0"),u=(r.a,i.a,n.a,d.a,Object(o.c)({userinfo:function(e){return e.userInfo},levelText:function(){return this.getLevelText(this.userinfo.level)}}),{name:"apply-update",components:{Selector:r.a,Group:i.a,Icon:n.a},store:d.a,data:function(){return{levelList:[{level:1,leveltext:"A"},{level:2,leveltext:"B"},{level:3,leveltext:"C"},{level:4,leveltext:"D"},{level:5,leveltext:"E"},{level:6,leveltext:"F"},{level:7,leveltext:"G"}],canLevelList:[],upGradeLevel:"",applyPrice:0,content:"",levelFree:!1,pay_type:"21",formdom:"",conditions:[]}},computed:Object(o.c)({userinfo:function(e){return e.userInfo},levelText:function(){return this.getLevelText(this.userinfo.level)}}),mounted:function(){this.getConditionsList()},methods:{getConditionsList:function(){var e=this;s()({method:"GET",url:"/api/upgrade/upReq"}).then(function(t){console.log(t.data.code),"success"===t.data.code?(t.data.data.req_list.forEach(function(t){t.level=t.user_level,t.leveltext=e.getLevelText(t.user_level)}),e.conditions=t.data.data.req_list.filter(function(e){return 1!=e.is_ban}),e.conditions.length>0&&(e.upGradeLevel=e.conditions[0].user_level,e.getRule(e.upGradeLevel))):e.$vux.toast.text(t.data.message,"middle")})},upGrade:function(){this.upGradeLevel<=this.userinfo.level?this.$vux.toast.text("所选等级低于当前等级","middle"):this.levelFree?this.freeUpGrade():this.payUpGrade()},freeUpGrade:function(){var e=this;s()({method:"POST",url:"/api/upgrade/addbycondition",data:{level:this.upGradeLevel}}).then(function(t){if("success"===t.data.code){var a=e;setTimeout(function(){a.$router.push({path:"/"})},2e3)}e.$vux.toast.text(t.data.message,"middle")})},payUpGrade:function(){var e=this;s()({method:"POST",url:"/api/upgrade/add",data:{level:this.upGradeLevel,money:1*this.applyPrice,pay_type:this.pay_type}}).then(function(t){var a=e;"error"==t.data.code?a.$vux.toast.text(t.data.message,"middle"):t.data.code&&Number(1*a.applyPrice)<=0?(a.$vux.toast.text(t.data.message,"middle"),setTimeout(function(){a.$router.push({path:"/apply_update_loading",query:{level:a.upGradeLevel,price:1*a.applyPrice}})},2e3)):"21"==a.pay_type?(a.formdom=t.data.data.payData,a.$nextTick(function(){document.forms[0].submit()})):"31"==a.pay_type&&(location.href=t.data.data.payData.url)})},divice:function(){var e=!0,t=navigator.userAgent.toLowerCase(),a=t.indexOf("android");t.indexOf("iphone"),t.indexOf("ipad");return-1!==a&&(e=!1),e},getRule:function(e){var t=this;if(""!==this.upGradeLevel)if(this.upGradeLevel<=this.userinfo.level)this.$vux.toast.text("所选等级低于当前等级","middle");else{this.levelFree=!0;for(var a=this.userinfo.upGrade,l=0;l<a.length;l++){if(a[l].level==this.upGradeLevel){a[l].required?this.levelFree=!0:this.levelFree=!1;break}l==a.length-1&&(this.levelFree=!1)}this.getLevelText(e);s()({method:"POST",url:"/api/upgrade/changelv",data:{upgrade_level:e}}).then(function(e){"success"===e.data.code?(t.applyPrice=e.data.data.upgrade_money,"0"==e.data.data.upgrade_money&&(t.levelFree=!0),t.content=e.data.data.protocol):t.$vux.toast.text(e.data.message,"middle")})}},changeLevel:function(){this.getRule(this.upGradeLevel)},getLevelText:function(e){switch(e){case 1:return"A";case 2:return"B";case 3:return"C";case 4:return"D";case 5:return"E";case 6:return"F";case 7:return"G";default:return""}}}}),v={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"wrapper",attrs:{id:"app_update"}},[a("div",{domProps:{innerHTML:e._s(e.formdom)}}),e._v(" "),a("div",{staticClass:"content"},[a("ul",{staticClass:"form mAuto"},[a("li",{staticClass:"mt30"},[a("span",[e._v("用户当前等级为:")]),e._v(" "),a("p",{staticClass:"level"},[e._v(e._s(e.levelText)+"级")])]),e._v(" "),a("li",[a("span",[e._v("申请升级为:")]),e._v(" "),a("group",{staticClass:"w50f"},[a("selector",{attrs:{placeholder:"请选择等级",options:e.conditions,"value-map":["level","leveltext"]},on:{"on-change":function(t){e.changeLevel()}},model:{value:e.upGradeLevel,callback:function(t){e.upGradeLevel=t},expression:"upGradeLevel"}})],1)],1),e._v(" "),a("li",{directives:[{name:"show",rawName:"v-show",value:!e.levelFree,expression:"!levelFree"}]},[a("span",[e._v("申请费用:")]),e._v(" "),a("p",[e._v(e._s(e.applyPrice)+"元")])])]),e._v(" "),a("p",{directives:[{name:"show",rawName:"v-show",value:!e.levelFree,expression:"!levelFree"}],staticClass:"mt20 pl24"},[e._v("升级说明:")]),e._v(" "),a("p",{directives:[{name:"show",rawName:"v-show",value:!e.levelFree,expression:"!levelFree"}],staticClass:"mt30 pl24",domProps:{innerHTML:e._s(e.content)}}),e._v(" "),a("p",{directives:[{name:"show",rawName:"v-show",value:e.levelFree,expression:"levelFree"}],staticClass:"mt30 red tc"},[e._v("您可以免费升级到当前所选等级")]),e._v(" "),a("ul",{directives:[{name:"show",rawName:"v-show",value:!e.levelFree,expression:"!levelFree"}],staticClass:"form mAuto"},[a("p",{staticClass:"mt30 pl20"},[e._v("支付方式")]),e._v(" "),a("div",{staticClass:"ub paytype-box"},[a("li",{staticClass:"pay-type2 pay2",class:21==e.pay_type?"checked":""},[a("label",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.pay_type,expression:"pay_type"}],attrs:{type:"radio",name:"type",value:"21"},domProps:{checked:e._q(e.pay_type,"21")},on:{change:function(t){e.pay_type="21"}}}),e._v("\n 支付宝\n ")])]),e._v(" "),a("li",{staticClass:"pay-type3 pay3",class:31==e.pay_type?"checked":""},[a("label",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.pay_type,expression:"pay_type"}],attrs:{type:"radio",name:"type",value:"31"},domProps:{checked:e._q(e.pay_type,"31")},on:{change:function(t){e.pay_type="31"}}}),e._v("\n 微信\n ")])])])])]),e._v(" "),a("button",{staticClass:"white-color button",on:{click:function(t){e.upGrade()}}},[e._v("立即申请")])])},staticRenderFns:[]};var p=a("VU/8")(u,v,!1,function(e){a("r2dH"),a("oEfT")},"data-v-83470cda",null);t.default=p.exports},oEfT:function(e,t){},r2dH:function(e,t){}});
- //# sourceMappingURL=16.b71013a3f5c6fd9cfa1d.js.map
|