(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2368c6ff"],{"1ec9":function(t,e,a){t.exports=a.p+"static/img/walletBackground.1d1fa4c2.svg"},"45d5":function(t,e,a){t.exports=a.p+"static/img/walletPicture.c9b14268.svg"},"565c":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"page default-main"},[i("div",[i("el-row",[i("el-col",{staticClass:"wallet-recharge-box wallet-recharge-box-left",attrs:{span:15}},[i("div",{staticClass:"wallet-recharge-box-container"},[i("div",{staticClass:"wallet-recharge-box-container-left",style:{"background-image":"url("+a("1ec9")+")"}},[i("div",[i("img",{staticClass:"wallet-page-wallet-picture",attrs:{alt:"wallet",src:a("45d5")}})]),i("div",{staticClass:"left-wallet-balance"},[t._v("Wallet balance 🎉 🎉")]),i("div",{staticClass:"left-wallet-recharge-figure"},[t._v("$"+t._s(t.walletBalance))])]),i("div",{staticClass:"wallet-recharge-box-container-right"},[i("el-row",{staticClass:"right-wallet-recharge-title-row"},[i("el-col",{attrs:{span:8,offset:1}},[i("span",{staticClass:"left-text"},[t._v("Automatic payment")])]),i("el-col",{staticStyle:{"horiz-align":"left"},attrs:{span:3}},[i("el-switch",{staticClass:"wallet-automatic-payment-switch",attrs:{"active-color":"#2F43A3","inactive-color":"#5D5D5F"},on:{change:t.editWalletInfo},model:{value:t.automaticPayment,callback:function(e){t.automaticPayment=e},expression:"automaticPayment"}})],1),i("el-col",{attrs:{span:2}},[i("el-tooltip",{staticClass:"item",attrs:{placement:"bottom",effect:"dark"}},[i("div",{attrs:{slot:"content"},slot:"content"},[t._v("Once an unpaid order is synchronized or created, "),i("br"),t._v("payment will be automatically made within the specified time, "),i("br"),t._v("which will improve efficiency and reduce your working time, "),i("br"),t._v("allowing you to focus more on store marketing.")]),i("div",[i("img",{staticClass:"wallet-question-mark",attrs:{alt:"questionMark",src:a("885b")}})])])],1)],1),i("el-row",{directives:[{name:"show",rawName:"v-show",value:t.automaticPayment,expression:"automaticPayment"}],staticClass:"right-wallet-recharge-title-row"},[i("el-col",{attrs:{span:6,offset:1}},[i("span",{staticClass:"left-text"},[t._v(" Payment after ")])]),i("el-col",{attrs:{span:12}},[i("el-row",[i("el-col",{staticStyle:{width:"20%"}},[i("button",{staticClass:"number-input-button",attrs:{disabled:t.minusDisable},on:{click:t.minus}},[i("span",{staticClass:"number-input-button__inner"},[t._v("-")])])]),i("el-col",{staticStyle:{width:"60%"}},[i("el-input",{staticClass:"number-input\n number-input__inner",attrs:{maxlength:"4",size:"small"},on:{input:t.handleInput},model:{value:t.autoPaymentTimeNumber,callback:function(e){t.autoPaymentTimeNumber=e},expression:"autoPaymentTimeNumber"}})],1),i("el-col",{staticStyle:{width:"20%"}},[i("button",{staticClass:"number-input-button",attrs:{disabled:t.plusDisable},on:{click:t.plus}},[i("span",{staticClass:"number-input-button__inner"},[t._v("+")])])])],1)],1),i("el-col",{attrs:{span:4}},[i("span",{staticClass:"left-text"},[t._v(" Minutes ")])])],1),i("el-row",{directives:[{name:"show",rawName:"v-show",value:t.automaticPayment,expression:"automaticPayment"}],staticClass:"right-wallet-recharge-title-row"},[i("el-col",{attrs:{span:15,offset:1}},[i("span",{staticClass:"left-text"},[t._v("Email notification of insufficient balance")])]),i("el-col",{staticStyle:{"text-align":"left"},attrs:{span:4}},[i("el-checkbox",{staticClass:"notification-checkbox",on:{change:t.editWalletInfo},model:{value:t.emailNotification,callback:function(e){t.emailNotification=e},expression:"emailNotification"}})],1)],1),i("el-row",{directives:[{name:"show",rawName:"v-show",value:t.automaticPayment,expression:"automaticPayment"}],staticClass:"right-wallet-recharge-title-row"},[i("el-col",{attrs:{offset:1,span:20}},[i("el-input",{staticClass:"email-input",attrs:{id:"emailInput",placeholder:"Artshiney@gmail.com",maxlength:"100",disabled:t.emailDisabled},on:{blur:t.editEmail},model:{value:t.notificationEmail,callback:function(e){t.notificationEmail=e},expression:"notificationEmail"}})],1),i("el-col",{attrs:{span:2}},[i("img",{staticClass:"edit-icon",attrs:{alt:"editIcon",src:a("db66")},on:{click:t.focusOnEmailAddressInput}})])],1)],1)])]),i("el-col",{staticClass:"wallet-recharge-box wallet-recharge-box-right",attrs:{span:8}},[i("div",{staticClass:"right-wallet-recharge-title"},[t._v(" Wallet recharge ")]),i("el-row",{staticStyle:{"padding-left":"6px"}},t._l(t.rechargeList,(function(e){return i("el-button",{key:e,staticClass:"right-button",on:{click:function(a){return t.setRechargeFigure(e)}}},[i("span",{staticClass:"right-button-inner"},[t._v("$ "+t._s(e))])])})),1),i("el-row",{staticClass:"wallet-page-custom-button-row",staticStyle:{"padding-left":"6px"}},[i("el-button",{staticClass:"right-button custom-button",style:t.showCustomInput?{background:"#5C7AEA",color:"#FFFFFF"}:{},on:{click:t.setInputFigure}},[i("span",{staticClass:"right-button-inner",style:t.showCustomInput?{background:"#5C7AEA",color:"#FFFFFF"}:{}},[t._v(" Custom ")])]),i("el-input",{directives:[{name:"show",rawName:"v-show",value:t.showCustomInput,expression:"showCustomInput"}],staticClass:"wallet-page-custom-input",attrs:{id:"figureInput"},on:{input:t.inputChange},model:{value:t.inputFigure,callback:function(e){t.inputFigure=e},expression:"inputFigure"}})],1),i("el-row",{staticStyle:{"padding-left":"6px"}},[i("el-button",{staticClass:"right-last-button",attrs:{disabled:t.rechargeDisabled},on:{click:t.createWalletRechargeOrder}},[i("span",{staticClass:"right-last-button-inner"},[t._v("Recharge")])])],1)],1),i("PaypalDialog",{attrs:{"jump-to-order-page":!1,"show-wallet-payment":!1,"pay-target":3,"order-ids":[t.walletRechargeOrderId]},model:{value:t.showPaypal,callback:function(e){t.showPaypal=e},expression:"showPaypal"}})],1),i("el-row",{staticStyle:{"margin-top":"20px","margin-bottom":"15px"}},[i("el-input",{staticStyle:{width:"35%"},attrs:{placeholder:"ID,Order number,store order number",maxlength:"100","suffix-icon":"el-icon-search",clearable:""},on:{change:t.onConditionChange},model:{value:t.query.orderNo,callback:function(e){t.$set(t.query,"orderNo",e)},expression:"query.orderNo"}}),i("el-date-picker",{staticStyle:{width:"30%","margin-left":"1%"},attrs:{format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",type:"daterange","range-separator":"To","start-placeholder":"Start date","end-placeholder":"End date","unlink-panels":""},on:{change:t.onConditionChange},model:{value:t.query.dateRange,callback:function(e){t.$set(t.query,"dateRange",e)},expression:"query.dateRange"}}),i("el-select",{staticStyle:{width:"33%","margin-left":"1%"},attrs:{placeholder:"All Cause",clearable:""},on:{change:t.onConditionChange},model:{value:t.query.cause,callback:function(e){t.$set(t.query,"cause",e)},expression:"query.cause"}},t._l(t.causeList,(function(t){return i("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),i("el-row",{staticClass:"wallet-record-list"},[i("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.walletList,"tooltip-effect":"dark",stripe:""}},[i("el-table-column",{attrs:{prop:"id",label:"ID",align:"center"}}),i("el-table-column",{attrs:{prop:"orderNo",label:"Order No.",align:"center"}}),i("el-table-column",{attrs:{prop:"storeOrderNo",label:"Store order No.",align:"center"}}),i("el-table-column",{attrs:{prop:"changeAmount",label:"Change amount",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("div",{style:{color:e.row.changeAmountValue>0?"#FF0000":"rgb(0,165,96)"}},[t._v(t._s(e.row.changeAmount))])]}}])}),i("el-table-column",{attrs:{prop:"cause",label:"Cause",align:"center"}}),i("el-table-column",{attrs:{prop:"walletBalance",label:"Wallet balance",align:"center"}}),i("el-table-column",{attrs:{prop:"date",label:"Date",align:"center"}})],1),i("el-pagination",{staticStyle:{"margin-top":"15px"},attrs:{background:"",layout:"total, prev, pager, next, jumper","page-sizes":[10,20,30,40,50,100],"current-page":t.query.current,"page-size":t.query.size,total:t.query.total,align:"right"},on:{"update:currentPage":function(e){return t.$set(t.query,"current",e)},"update:current-page":function(e){return t.$set(t.query,"current",e)},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)])},l=[],s=a("57f9"),n=a("43f3"),r=a("de73"),o={name:"WalletList",components:{PaypalDialog:r["a"]},filters:{statusFilters(t,e){return e.find(e=>e.status===t).label}},data(){return{rechargeDisabled:!1,walletRechargeOrderId:"",showPaypal:!1,emailDisabled:!0,maxAutoPaymentTimeNumber:1e3,minAutoPaymentTimeNumber:0,automaticPayment:!1,autoPaymentTimeNumber:"",notificationEmail:"",emailNotification:!1,inputFigure:"",walletBalance:0,rechargeList:[100,200,300,400,500],showCustomInput:!1,causeList:[{label:"Wallet recharge",value:1},{label:"Payment",value:2},{label:"Refund",value:3},{label:"Withdraw",value:4}],query:{dateRange:[],cause:"",orderNo:"",startDate:"",endDate:"",current:1,size:10},walletList:[],accountEmail:""}},computed:{minusDisable(){return this.autoPaymentTimeNumber<=this.minAutoPaymentTimeNumber},plusDisable(){return this.autoPaymentTimeNumber>=this.maxAutoPaymentTimeNumber}},watch:{inputFigure:{handler(t){this.rechargeDisabled=""===t||0===t.length},immediate:!0}},created(){this.getUserInfo(),this.getWalletInfo(),this.getWalletList()},methods:{async getUserInfo(){const t=await Object(n["p"])();this.accountEmail=t.data.email},async createWalletRechargeOrder(){this.rechargeDisabled=!0;const t=parseInt(this.inputFigure.replace("$ ",""));if(t<=0||isNaN(t))return this.rechargeDisabled=!1,void this.$message.error("Please enter the number");const e={amount:t},a=await Object(s["a"])(e);this.walletRechargeOrderId=a.data.orderId,await this.showPaypalDialog(),this.rechargeDisabled=!1},showPaypalDialog(){this.showPaypal=!0},onConditionChange(){const t=this.query.dateRange;this.query.startDate=t[0],this.query.endDate=t[1],this.query.current=1,this.getWalletList()},async getWalletList(){const t=Object.assign({},this.query),e=await Object(s["b"])(t),a=e.data;this.walletList=a.records,console.log("walletList: "+this.walletList),null!==this.walletList&&0!==this.walletList.length?(console.log("没中断!"),this.walletList.forEach(t=>{t.cause=this.causeList.find(e=>e.value===t.cause).label,t.changeAmountValue=t.changeAmount,console.log("item: "+t.cause),console.log("changeAmount: "+t.changeAmount),t.changeAmount>0?t.changeAmount="+$"+t.changeAmount:t.changeAmount<0?t.changeAmount="-$"+-1*t.changeAmount:t.changeAmount="",t.walletBalance=t.walletBalance?"$ "+t.walletBalance:""}),this.query.current=a.current,this.query.size=a.size,this.query.total=a.total):console.log("中断了!")},handleInput(){let t=this.autoPaymentTimeNumber;const e=/^\d*$/i.test(t);e||(t=t.slice(0,-1)),this.autoPaymentTimeNumber=t},editEmail(){""===this.notificationEmail&&(this.notificationEmail=this.accountEmail);const t=/^[A-Za-z\d]+([-._][A-Za-z\d]+)*@[A-Za-z\d]+(-[A-Za-z\d]+)*(\.[A-Za-z]{2,6}|[A-Za-z]{2,4}\.[A-Za-z]{2,3})$/;t.test(this.notificationEmail)?this.editWalletInfo():this.$message.error("Please enter the correct email address")},async editWalletInfo(){const t={walletAutoPaySwitch:this.automaticPayment,walletAutoPayDelay:this.autoPaymentTimeNumber,walletNotifyEmail:this.notificationEmail,walletEmailNotifySwitch:this.emailNotification},e=Object.assign({},t);await Object(s["c"])(e),await this.getWalletInfo(),this.emailDisabled=!0},async getWalletInfo(){const t=await Object(s["e"])();null!=t&&null!=t.data&&"success"===t.msg&&(this.automaticPayment=t.data.walletAutoPaySwitch,this.autoPaymentTimeNumber=t.data.walletAutoPayDelay,this.walletBalance=t.data.amount,this.notificationEmail=t.data.walletNotifyEmail,this.emailNotification=t.data.walletEmailNotifySwitch,""===this.notificationEmail&&(this.notificationEmail=this.accountEmail))},handleSizeChange(t){this.query.current=1,this.query.size=t,this.getWalletList()},handleCurrentChange(t){this.query.current=t,this.getWalletList()},setRechargeFigure(t){this.inputFigure="$ "+t,this.showCustomInput=!1},setInputFigure(){this.inputFigure="",this.showCustomInput=!0,setTimeout(()=>{document.getElementById("figureInput").focus()},100)},focusOnEmailAddressInput(){this.emailDisabled=!1,setTimeout(()=>{document.getElementById("emailInput").focus()},100)},inputChange(){this.inputFigure=this.handelInputNumber(this.inputFigure),this.inputFigure=0===this.inputFigure.length?"":"$ "+this.inputFigure.replace("$","")},handelInputNumber(t){t=t.replace("$","").replace(" ","");const e=/^\d*\.?\d{0,3}$/i.test(t);return e||(t=t.slice(0,-1)),t},minus(){this.autoPaymentTimeNumber<=this.minAutoPaymentTimeNumber||(this.autoPaymentTimeNumber--,this.editWalletInfo())},plus(){this.autoPaymentTimeNumber>this.maxAutoPaymentTimeNumber||(this.autoPaymentTimeNumber++,this.editWalletInfo())}}},c=o,u=(a("eafb"),a("2877")),m=Object(u["a"])(c,i,l,!1,null,"47991dc2",null);e["default"]=m.exports},"885b":function(t,e,a){t.exports=a.p+"static/img/questionMark.8dba501f.svg"},db66:function(t,e,a){t.exports=a.p+"static/img/notificationEmailEdit.e703d56a.svg"},e119:function(t,e,a){},eafb:function(t,e,a){"use strict";a("e119")}}]);