diff --git a/src/api/index.ts b/src/api/index.ts index 2c41814..1348f6e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -358,8 +358,10 @@ export async function cashout(data?: any,accountinfo?: any){ message.success(res.msg) // userinfo() store.dispatch("setUserInfo"); + return true; }else{ message.error(res.msg) + return false; } } /** @@ -394,6 +396,10 @@ export async function editaccount( id: any,data?: any){ const res=await put('wallect/' +id ,data); if(res.code==0){ message.success("修改成功") + router.push("/mine/wallet") + }else{ + message.error(res.msg) + } } /** diff --git a/src/views/mine/Cashout.vue b/src/views/mine/Cashout.vue index 5612e01..c90468b 100644 --- a/src/views/mine/Cashout.vue +++ b/src/views/mine/Cashout.vue @@ -113,7 +113,7 @@
*{{lan.$t('yueshu')}} {{danwei + parseFloat(yue) }},{{lan.$t('zuiditixian')}} @@ -139,6 +139,7 @@ export default defineComponent({ NavBottom, }, setup() { + const lan: any = useI18n(); const money = ref(0); const payinfo = ref({ @@ -172,6 +173,7 @@ export default defineComponent({ function all() { payinfo.value.money = yue.value; } + function sub() { console.log(toRaw(payinfo.value)); @@ -189,7 +191,11 @@ export default defineComponent({ cashout( toRaw(payinfo.value), toRaw(accountlist.value)[payinfo.value.type] - ); + ).then((res: boolean)=>{ + if(res){ + router.push("/mine/wallet") + } + }) } // cashout( @@ -202,6 +208,8 @@ export default defineComponent({ router.push(url) } + const minwithdraw = computed(()=>store.state.seting.minwithdraw) + return { money, moneychange, @@ -214,7 +222,8 @@ export default defineComponent({ store, lan, navto, - danwei + danwei, + minwithdraw }; }, });