card-Operation.fd0ff110.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["card-Operation"],{"00b4":function(e,t,a){"use strict";a("ac1f");var r=a("23e7"),s=a("c65b"),i=a("1626"),n=a("825a"),c=a("577e"),o=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),u=/./.test;r({target:"RegExp",proto:!0,forced:!o},{test:function(e){var t=n(this),a=c(e),r=t.exec;if(!i(r))return s(u,t,a);var o=s(r,t,a);return null!==o&&(n(o),!0)}})},"36c5":function(e,t,a){},"498a":function(e,t,a){"use strict";var r=a("23e7"),s=a("58a8").trim,i=a("c8d2");r({target:"String",proto:!0,forced:i("trim")},{trim:function(){return s(this)}})},5863:function(e,t,a){"use strict";a.r(t);a("498a");var r=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],attrs:{id:"card-operation","element-loading-background":"rgba(43, 48, 67, 0.1)","element-loading-spinner":"el-icon-loading"}},[e.pictViews?e._e():t("div",{staticClass:"promotion-box pb-3 mt-1"},[t("div",{staticClass:"container"},[t("div",{staticClass:"row"},[t("div",{staticClass:"col-12"},[t("div",{staticClass:"promotion-box-white mt-0"},[t("div",{attrs:{id:"tabs"}},[t("div",{},[t("div",{staticClass:"row"},[t("div",{staticClass:"col-12"},[t("div",{},[t("el-form",{ref:"businessForm",staticClass:"form",attrs:{model:e.businessForm,rules:e.rules,"label-position":"top"}},["1"==e.type?[t("el-form-item",{attrs:{prop:"cardNumber",label:e.$t("card.Form.f24")+":"}},[t("el-input",{staticClass:"m-input",attrs:{placeholder:e.$t("card.vaildate.v22")},model:{value:e.businessForm.cardNumber,callback:function(t){e.$set(e.businessForm,"cardNumber","string"===typeof t?t.trim():t)},expression:"businessForm.cardNumber"}})],1),t("el-form-item",{attrs:{prop:"activeCode",label:e.$t("card.Form.f26")+":"}},[t("el-input",{staticClass:"m-input",attrs:{placeholder:e.$t("card.vaildate.v24")},model:{value:e.businessForm.activeCode,callback:function(t){e.$set(e.businessForm,"activeCode","string"===typeof t?t.trim():t)},expression:"businessForm.activeCode"}})],1),t("el-form-item",{attrs:{prop:"pin",label:e.$t("card.Info.s26")}},[t("el-input",{staticClass:"m-input",attrs:{"show-password":"",autocomplete:"off",placeholder:e.$t("card.vaildate.v23")},model:{value:e.businessForm.pin,callback:function(t){e.$set(e.businessForm,"pin","string"===typeof t?t.trim():t)},expression:"businessForm.pin"}})],1),t("el-form-item",{attrs:{prop:"password",label:e.$t("card.Btn.Confirm")+e.$t("PersonalManagement.Label.PinCode")+":"}},[t("el-input",{staticClass:"m-input",attrs:{"show-password":"",autocomplete:"off",placeholder:e.$t("card.vaildate.v31")},model:{value:e.businessForm.password,callback:function(t){e.$set(e.businessForm,"password","string"===typeof t?t.trim():t)},expression:"businessForm.password"}})],1),t("el-form-item",{attrs:{prop:"platform"}},[t("ul",{staticClass:"pwd"},[t("li",{directives:[{name:"t",rawName:"v-t",value:"card.vaildate.v32",expression:"'card.vaildate.v32'"}],class:{fit:e.rule1}}),t("li",{directives:[{name:"t",rawName:"v-t",value:"card.vaildate.v33",expression:"'card.vaildate.v33'"}],class:{fit:e.rule2}})])])]:e._e(),"2"==e.type?[t("el-form-item",{attrs:{prop:"cardNumber",label:e.$t("card.Form.f24")}},[t("el-input",{staticClass:"m-input",attrs:{placeholder:e.$t("card.vaildate.v22")},model:{value:e.businessForm.cardNumber,callback:function(t){e.$set(e.businessForm,"cardNumber","string"===typeof t?t.trim():t)},expression:"businessForm.cardNumber"}})],1),t("div",{staticClass:"amount"},[t("el-form-item",{attrs:{prop:"amount",label:e.$t("card.Form.f28")}},[t("el-input",{staticClass:"m-input",attrs:{type:"number",step:"0.01",min:e.rechargeMinQuota,max:e.rechargeMaxQuota,placeholder:e.$t("card.vaildate.v26")},model:{value:e.businessForm.amount,callback:function(t){e.$set(e.businessForm,"amount",t)},expression:"businessForm.amount"}})],1),t("span",{directives:[{name:"t",rawName:"v-t",value:"card.Form.f57",expression:"'card.Form.f57'"}],staticClass:"btn",on:{click:e.allBalance}})],1)]:e._e(),"3"==e.type?[t("el-form-item",{attrs:{prop:"cardNumber",label:e.$t("card.Form.f24")+":"}},[t("el-input",{staticClass:"m-input",attrs:{placeholder:e.$t("card.vaildate.v22")},model:{value:e.businessForm.cardNumber,callback:function(t){e.$set(e.businessForm,"cardNumber","string"===typeof t?t.trim():t)},expression:"businessForm.cardNumber"}})],1),t("el-form-item",{attrs:{prop:"pin",label:e.$t("card.Info.s26")}},[t("el-input",{staticClass:"m-input",attrs:{"show-password":"",autocomplete:"off",placeholder:e.$t("card.vaildate.v23")},model:{value:e.businessForm.pin,callback:function(t){e.$set(e.businessForm,"pin","string"===typeof t?t.trim():t)},expression:"businessForm.pin"}})],1),t("el-form-item",{attrs:{prop:"password",label:e.$t("card.Btn.Confirm")+e.$t("PersonalManagement.Label.PinCode")+":"}},[t("el-input",{staticClass:"m-input",attrs:{"show-password":"",autocomplete:"off",placeholder:e.$t("card.vaildate.v31")},model:{value:e.businessForm.password,callback:function(t){e.$set(e.businessForm,"password","string"===typeof t?t.trim():t)},expression:"businessForm.password"}})],1),t("el-form-item",{attrs:{prop:"platform"}},[t("ul",{staticClass:"pwd"},[t("li",{directives:[{name:"t",rawName:"v-t",value:"card.vaildate.v32",expression:"'card.vaildate.v32'"}],class:{fit:e.rule1}}),t("li",{directives:[{name:"t",rawName:"v-t",value:"card.vaildate.v33",expression:"'card.vaildate.v33'"}],class:{fit:e.rule2}})])])]:e._e(),"5"==e.type||"4"==e.type?[t("el-form-item",{attrs:{prop:"cardNumber",label:e.$t("card.Form.f24")}},[t("el-input",{staticClass:"m-input",attrs:{placeholder:e.$t("card.vaildate.v22")},model:{value:e.businessForm.cardNumber,callback:function(t){e.$set(e.businessForm,"cardNumber","string"===typeof t?t.trim():t)},expression:"businessForm.cardNumber"}})],1),t("el-form-item",{attrs:{label:e.$t("card.Form.f27")}},[t("el-input",{staticClass:"m-input",attrs:{"show-password":"",autocomplete:"off",placeholder:e.$t("card.vaildate.v25")},model:{value:e.businessForm.clientRemark,callback:function(t){e.$set(e.businessForm,"clientRemark","string"===typeof t?t.trim():t)},expression:"businessForm.clientRemark"}})],1)]:e._e()],2),1==e.type?[t("div",{staticClass:"form-group text-center mt-5 mb-5"},[t("a",{directives:[{name:"t",rawName:"v-t",value:"card.Btn.Activate",expression:"'card.Btn.Activate'"}],staticClass:"btn-signing",attrs:{href:"javascript:;"},on:{click:function(t){return e.ucardActivat(1)}}})])]:e._e(),2==e.type?[t("div",{staticClass:"fee"},[t("div",[t("span",{directives:[{name:"t",rawName:"v-t",value:"card.Form.f56",expression:"'card.Form.f56'"}]}),t("span",[e._v(e._s(e.userBalance)+" USD")])]),e.businessForm.rechargeFixedFee?e._e():t("div",[t("span",{directives:[{name:"t",rawName:"v-t",value:"card.Form.f58",expression:"'card.Form.f58'"}]}),t("span",[e._v(e._s(e.exchangeRate)+" %")])]),t("div",[t("span",{directives:[{name:"t",rawName:"v-t",value:"card.Form.f59",expression:"'card.Form.f59'"}]}),t("span",[e._v(e._s(e.fee)+" USD")])])]),t("div",{staticClass:"form-group text-center mt-5 mb-5"},[t("a",{directives:[{name:"t",rawName:"v-t",value:"card.Btn.Recharge",expression:"'card.Btn.Recharge'"}],staticClass:"btn-signing",attrs:{href:"javascript:;"},on:{click:function(t){return e.ucardActivat(2)}}})])]:e._e(),3==e.type?[t("div",{staticClass:"form-group text-center mt-5 mb-5"},[t("a",{directives:[{name:"t",rawName:"v-t",value:"card.Btn.Submit",expression:"'card.Btn.Submit'"}],staticClass:"btn-signing",attrs:{href:"javascript:;"},on:{click:function(t){return e.ucardActivat(3)}}})])]:e._e(),4==e.type?[t("div",{staticClass:"form-group text-center mt-5 mb-5"},[t("a",{directives:[{name:"t",rawName:"v-t",value:"card.Btn.Freeze",expression:"'card.Btn.Freeze'"}],staticClass:"btn-signing",attrs:{href:"javascript:;"},on:{click:function(t){return e.ucardActivat(4)}}})])]:e._e(),5==e.type?[t("div",{staticClass:"form-group text-center mt-5 mb-5"},[t("a",{directives:[{name:"t",rawName:"v-t",value:"card.Btn.Unfreeze",expression:"'card.Btn.Unfreeze'"}],staticClass:"btn-signing",attrs:{href:"javascript:;"},on:{click:function(t){return e.ucardActivat(5)}}})])]:e._e()],2)])])])])])])])])])])},s=[],i=a("5530"),n=a("c7eb"),c=a("1da1"),o=(a("d9e2"),a("99af"),a("14d9"),a("a9e3"),a("b680"),a("ac1f"),a("00b4"),a("c6e4")),u=a("f121"),d=a.n(u),l=d.a.Host80,m={name:"Operation",inject:["reload"],data:function(){var e=this;return{Host80:l,userBalance:0,exchangeRate:0,isAuthInfo:!1,rules:{pin:[{validator:function(t,a,r){e.Config.Pattern.Pin.test(a)?r():r(new Error(e.$i18n.t("vaildate.password.format")))},trigger:"blur",required:!0}],password:[{validator:function(t,a,r){e.Config.Pattern.Pin.test(a)?r():r(new Error(e.$i18n.t("vaildate.password.format")))},trigger:"blur",required:!0}],cardNo:[{required:!0,message:this.$i18n.t("card.vaildate.v22"),trigger:"blur"}],cardNumber:[{required:!0,message:this.$i18n.t("card.vaildate.v22"),trigger:"blur"}],amount:[{required:!0,message:this.$i18n.t("card.vaildate.v26"),trigger:"blur"},{validator:function(t,a,r){return e.validateAmount(a,r)},trigger:"blur"}],activeCode:[{validator:function(t,a,r){/^\d*$/.test(a)?r():r(new Error(e.$i18n.t("card.vaildate.v24")))},trigger:"blur",required:!0}]},businessForm:{cardNo:"",cardNumber:"",activeCode:"",pin:"",amount:0,clientRemark:""},type:"",cardId:"",pictLoading:!1,pictViews:!1,rechargeMinQuota:0,rechargeMaxQuota:0}},computed:{rule1:function(){return!!this.businessForm.pin&&/^(0|1|2|3|4|5|6|7|8|9)\d{5}$/.test(this.businessForm.pin)},fee:function(){if(!this.businessForm.amount)return 0;if(this.businessForm.rechargeFixedFee)return this.businessForm.rechargeFixedFee;var e=Math.ceil(this.businessForm.amount);return(e*this.exchangeRate/100).toFixed(2)},maxRecharge:function(){var e=Number(this.userBalance)||0,t=Number(this.exchangeRate)/100;return e<=0?0:Math.floor(e/(1+t)*100)/100},rule2:function(){return!!this.businessForm.pin&&this.Config.Pattern.Pin.test(this.businessForm.pin)},lang:function(){return this.Session.Get("lang")}},methods:{allBalance:function(){this.$set(this.businessForm,"amount",this.maxRecharge)},validateAmount:function(e,t){e=Number(e),!e||e<=0?t(new Error(this.$i18n.t("card.vaildate.v34"))):0==this.maxRecharge?t(new Error("".concat(this.$i18n.t("card.Form.f56")," 0 USD"))):e>this.maxRecharge?t(new Error("".concat(this.$i18n.t("card.vaildate.v35")," ").concat(this.maxRecharge," USD"))):e<this.rechargeMinQuota?t(new Error("".concat(this.$i18n.t("card.vaildate.v36")," ").concat(this.rechargeMinQuota," USD"))):e>=this.rechargeMaxQuota?t(new Error("".concat(this.$i18n.t("card.vaildate.v37")," ").concat(this.rechargeMaxQuota," USD"))):t()},ucardActivat:function(e){var t=this;return Object(c["a"])(Object(n["a"])().mark((function a(){var r;return Object(n["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.$refs.businessForm.validate();case 3:if(r=a.sent,r){a.next=6;break}return a.abrupt("return");case 6:if(t.businessForm.pin===t.businessForm.password){a.next=9;break}return t.$pigeon.MessageError(t.$i18n.t("card.vaildate.v29")),a.abrupt("return");case 9:a.t0=e,a.next=1===a.t0?12:2===a.t0?14:3===a.t0?16:4===a.t0?18:5===a.t0?20:22;break;case 12:return t.ucardActivate(),a.abrupt("break",22);case 14:return t.ucardRecharge(),a.abrupt("break",22);case 16:return t.ucardResetPassword(),a.abrupt("break",22);case 18:return t.ucardFreeze(),a.abrupt("break",22);case 20:return t.ucardUnfreeze(),a.abrupt("break",22);case 22:a.next=27;break;case 24:a.prev=24,a.t1=a["catch"](0),t.cardList=[];case 27:case"end":return a.stop()}}),a,null,[[0,24]])})))()},backActivity:function(){this.$router.push({path:"/card/index"}).catch((function(e){return e}))},ucardActivate:function(){var e=this;return Object(c["a"])(Object(n["a"])().mark((function t(){var a;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,o["a"].ucardActivate(e.businessForm);case 2:a=t.sent,200==a.code?(e.$pigeon.MessageOK(e.$i18n.t("card.Msg.m3")),e.backActivity(),e.confirmToReload(),e.pictLoading=!1):(e.$pigeon.MessageError(a.msg),e.pictLoading=!1);case 4:case"end":return t.stop()}}),t)})))()},ucardFreeze:function(){var e=this;return Object(c["a"])(Object(n["a"])().mark((function t(){var a;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,o["a"].ucardFreeze(e.businessForm);case 2:a=t.sent,200==a.code?(e.$pigeon.MessageOK(e.$i18n.t("card.Msg.m4")),e.backActivity(),e.confirmToReload(),e.pictLoading=!1):(e.$pigeon.MessageError(a.msg),e.pictLoading=!1);case 4:case"end":return t.stop()}}),t)})))()},ucardUnfreeze:function(){var e=this;return Object(c["a"])(Object(n["a"])().mark((function t(){var a;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,o["a"].ucardUnfreeze(e.businessForm);case 2:a=t.sent,200==a.code?(e.$pigeon.MessageOK(e.$i18n.t("card.Msg.m5")),e.backActivity(),e.confirmToReload(),e.pictLoading=!1):(e.$pigeon.MessageError(a.msg),e.pictLoading=!1);case 4:case"end":return t.stop()}}),t)})))()},ucardRecharge:function(){var e=this;return Object(c["a"])(Object(n["a"])().mark((function t(){var a,r,s,i;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.businessForm.amount=Number(e.businessForm.amount),a=e.businessForm,r=a.amount,s=a.cardNo,t.prev=2,t.next=5,o["a"].ucardRecharge({amount:r,cardNo:s});case 5:i=t.sent,200==i.code?(e.$pigeon.MessageOK(e.$i18n.t("card.Msg.m2")),e.backActivity(),e.confirmToReload(),e.pictLoading=!1):(e.$pigeon.MessageError(i.msg),e.pictLoading=!1),t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](2),e.pictLoading=!1;case 12:case"end":return t.stop()}}),t,null,[[2,9]])})))()},ucardResetPassword:function(){var e=this;return Object(c["a"])(Object(n["a"])().mark((function t(){var a;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,o["a"].ucardResetPassword(e.businessForm);case 2:a=t.sent,200==a.code?(e.$pigeon.MessageOK(e.$i18n.t("card.Msg.m6")),e.backActivity(),e.confirmToReload(),e.pictLoading=!1):(e.$pigeon.MessageError(a.msg),e.pictLoading=!1);case 4:case"end":return t.stop()}}),t)})))()},getCardInfo:function(){var e=this;return Object(c["a"])(Object(n["a"])().mark((function t(){var a;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.pictLoading=!0,e.pictViews=!0,t.prev=2,t.next=5,o["a"].getCardInfo({id:e.cardId});case 5:a=t.sent,e.businessForm=a.data,e.pictLoading=!1,e.pictViews=!1,e.exchangeRate=a.data.rechargeFeeRate,e.rechargeMaxQuota=a.data.rechargeMaxQuota,e.rechargeMinQuota=a.data.rechargeMinQuota,e.rechargeFixedFee=a.data.rechargeFixedFee,1==e.type&&(e.businessForm=Object(i["a"])(Object(i["a"])({},e.businessForm),{},{cardNumber:""})),t.next=20;break;case 16:t.prev=16,t.t0=t["catch"](2),e.pictLoading=!1,e.pictViews=!1;case 20:case"end":return t.stop()}}),t,null,[[2,16]])})))()},walletBalance:function(){var e=this;return Object(c["a"])(Object(n["a"])().mark((function t(){var a;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o["a"].walletBalance();case 3:a=t.sent,200===a.code?e.userBalance=a.data.balance||0:(e.$message.error(a.msg),e.userBalance=0),t.next=11;break;case 7:t.prev=7,t.t0=t["catch"](0),e.userBalance=0,e.$message.error(t.t0);case 11:case"end":return t.stop()}}),t,null,[[0,7]])})))()}},mounted:function(){var e=this.$route.query,t=e.cardId,a=e.type;this.type=a,this.cardId=t,t&&(this.getCardInfo(),"2"==a&&this.walletBalance())}},p=m,v=(a("8c33"),a("e83b"),a("2877")),b=Object(v["a"])(p,r,s,!1,null,"27acc7bc",null);t["default"]=b.exports},"8c33":function(e,t,a){"use strict";a("8def")},"8def":function(e,t,a){},c8d2:function(e,t,a){"use strict";var r=a("5e77").PROPER,s=a("d039"),i=a("5899"),n="​…᠎";e.exports=function(e){return s((function(){return!!i[e]()||n[e]()!==n||r&&i[e].name!==e}))}},e83b:function(e,t,a){"use strict";a("36c5")}}]);