test_lgq/niucloud/public/wap/assets/app-pages-member-account_edit.a411166c.js
2024-01-24 17:36:08 +08:00

2 lines
5.4 KiB
JavaScript

import{d as e,r as a,a as l,c as t,o,al as n,h as r,E as c,j as u,w as d,F as s,J as p,K as m,m as i,l as b,i as _,b0 as f,b1 as h,$ as y,b2 as x,t as g,p as k,q as v,ao as V,Y as j}from"./index-849cf30e.js";import{_ as P}from"./u-input.46b72faa.js";import{_ as A,a as N}from"./u-form.4f9a45b5.js";import{_ as T}from"./u-button.9fa3f2a0.js";import{_ as C}from"./u-modal.081e9589.js";import"./u-icon.e3aa4770.js";import"./_plugin-vue_export-helper.1b428a4d.js";import"./u-line.19eb5c40.js";import"./u-loading-icon.d012ecbf.js";import"./u-popup.e01742d2.js";import"./u-transition.75065529.js";import"./u-safe-bottom.2f6af56c.js";const R=e({__name:"account_edit",setup(e){const R=a(!1),w=a(null),U=a("get"),q=a(!1),B=l({account_id:0,account_type:"bank",bank_name:"",realname:"",account_no:""}),E=t((()=>({realname:{type:"string",required:!0,message:"bank"==B.account_type?j("bankRealnamePlaceholder"):j("alipayRealnamePlaceholder"),trigger:["blur","change"]},bank_name:{type:"string",required:"bank"==B.account_type,message:j("bankNamePlaceholder"),trigger:["blur","change"]},account_no:{type:"string",required:!0,message:"bank"==B.account_type?j("bankAccountNoPlaceholder"):j("alipayAccountNoPlaceholder"),trigger:["blur","change"]}})));o((e=>{e.type&&(B.account_type=e.type),e.mode&&(U.value=e.mode),e.id&&(B.account_id=e.id,n({account_id:e.id}).then((e=>{e.data&&Object.keys(B).forEach((a=>{null!=e.data[a]&&(B[a]=e.data[a])}))})))}));const W=()=>{const e=B.account_id?f:h;w.value.validate().then((()=>{R.value||(R.value=!0,e(B).then((e=>{"get"==U.value?y({url:"/app/pages/member/account",param:{type:B.account_type,mode:U.value}}):y({url:"/app/pages/member/apply_cash_out",param:{account_id:e.data,type:B.account_type}})})).catch((()=>{R.value=!1})))}))},Y=()=>{x(B.account_id).then((()=>{y({url:"/app/pages/member/account",mode:"redirectTo"})}))};return(e,a)=>{const l=g,t=k(v("u-input"),P),o=k(v("u-form-item"),A),n=k(v("u-form"),N),f=k(v("u-button"),T),h=V,y=k(v("u-modal"),C);return r(),c(s,null,[u(h,{"scroll-y":"true",class:"w-screen h-screen bg-page"},{default:d((()=>[u(l,{class:"h-[30rpx]"}),u(l,{class:"p-[30rpx] bg-white mx-[32rpx] rounded"},{default:d((()=>["bank"==B.account_type?(r(),c(s,{key:0},[u(l,{class:"text-center text-base font-bold mt-[50rpx]"},{default:d((()=>[p(m(i(j)("addBankCard")),1)])),_:1}),u(l,{class:"text-center text-sm mt-[10rpx]"},{default:d((()=>[p(m(i(j)("addBankCardTips")),1)])),_:1}),u(l,{class:"mt-[50rpx]"},{default:d((()=>[u(n,{labelPosition:"left",model:B,labelWidth:"200rpx",errorType:"toast",rules:i(E),ref_key:"formRef",ref:w},{default:d((()=>[u(l,{class:"mt-[10rpx]"},{default:d((()=>[u(o,{label:i(j)("bankRealname"),prop:"realname","border-bottom":!0},{default:d((()=>[u(t,{modelValue:B.realname,"onUpdate:modelValue":a[0]||(a[0]=e=>B.realname=e),border:"none",clearable:"",placeholder:i(j)("bankRealnamePlaceholder")},null,8,["modelValue","placeholder"])])),_:1},8,["label"])])),_:1}),u(l,{class:"mt-[10rpx]"},{default:d((()=>[u(o,{label:i(j)("bankName"),prop:"bank_name","border-bottom":!0},{default:d((()=>[u(t,{modelValue:B.bank_name,"onUpdate:modelValue":a[1]||(a[1]=e=>B.bank_name=e),border:"none",clearable:"",placeholder:i(j)("bankNamePlaceholder")},null,8,["modelValue","placeholder"])])),_:1},8,["label"])])),_:1}),u(l,{class:"mt-[10rpx]"},{default:d((()=>[u(o,{label:i(j)("bankAccountNo"),prop:"account_no","border-bottom":!0},{default:d((()=>[u(t,{modelValue:B.account_no,"onUpdate:modelValue":a[2]||(a[2]=e=>B.account_no=e),border:"none",clearable:"",placeholder:i(j)("bankAccountNoPlaceholder")},null,8,["modelValue","placeholder"])])),_:1},8,["label"])])),_:1})])),_:1},8,["model","rules"])])),_:1})],64)):b("v-if",!0),"alipay"==B.account_type?(r(),c(s,{key:1},[u(l,{class:"text-center text-base font-bold mt-[50rpx]"},{default:d((()=>[p(m(i(j)("addAlipayAccount")),1)])),_:1}),u(l,{class:"text-center text-sm mt-[10rpx]"},{default:d((()=>[p(m(i(j)("addAlipayAccountTips")),1)])),_:1}),u(l,{class:"mt-[50rpx]"},{default:d((()=>[u(n,{labelPosition:"left",model:B,labelWidth:"200rpx",errorType:"toast",rules:i(E),ref_key:"formRef",ref:w},{default:d((()=>[u(l,{class:"mt-[10rpx]"},{default:d((()=>[u(o,{label:i(j)("alipayRealname"),prop:"realname","border-bottom":!0},{default:d((()=>[u(t,{modelValue:B.realname,"onUpdate:modelValue":a[3]||(a[3]=e=>B.realname=e),border:"none",clearable:"",placeholder:i(j)("alipayRealnamePlaceholder")},null,8,["modelValue","placeholder"])])),_:1},8,["label"])])),_:1}),u(l,{class:"mt-[10rpx]"},{default:d((()=>[u(o,{label:i(j)("alipayAccountNo"),prop:"account_no","border-bottom":!0},{default:d((()=>[u(t,{modelValue:B.account_no,"onUpdate:modelValue":a[4]||(a[4]=e=>B.account_no=e),border:"none",clearable:"",placeholder:i(j)("alipayAccountNoPlaceholder")},null,8,["modelValue","placeholder"])])),_:1},8,["label"])])),_:1})])),_:1},8,["model","rules"])])),_:1})],64)):b("v-if",!0),u(l,{class:"mt-[100rpx]"},{default:d((()=>[u(f,{text:i(j)("save"),type:"primary",shape:"circle",loading:R.value,onClick:W},null,8,["text","loading"]),B.account_id?(r(),_(l,{key:0,class:"mt-[30rpx]"},{default:d((()=>[u(f,{text:i(j)("delete"),type:"primary",shape:"circle",plain:!0,loading:R.value,onClick:a[5]||(a[5]=e=>q.value=!0)},null,8,["text","loading"])])),_:1})):b("v-if",!0)])),_:1})])),_:1})])),_:1}),u(y,{show:q.value,content:i(j)("deleteConfirm"),confirmText:i(j)("confirm"),cancelText:i(j)("cancel"),showCancelButton:!0,onConfirm:Y,onCancel:a[6]||(a[6]=e=>q.value=!1)},null,8,["show","content","confirmText","cancelText"])],64)}}});export{R as default};