index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div class="airwallexWallet">
  3. <s-header :name="$t('airwallex.wallet')" :noback="false"></s-header>
  4. <div class="amount">
  5. <van-cell-group inset>
  6. <van-cell center :title="$t('airwallex.amount')" :value="amount" label="描述信息:可提取的金额" />
  7. </van-cell-group>
  8. </div>
  9. <br>
  10. <div class="cell-container">
  11. <van-cell-group inset>
  12. <van-cell title="创建付款单" is-link to="/airwallexPayout" />
  13. <van-cell title="付款详情页" is-link to="/paymentDetail" />
  14. <van-cell title="去百度" is-link url="https://www.baidu.com" />
  15. </van-cell-group>
  16. </div>
  17. <br>
  18. <div class="airwallexWalletBtn">
  19. <van-button round type="primary" class="register" @click="handleWithdraw">提现</van-button>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import { useRouter } from 'vue-router';
  25. import sHeader from "@/components/SimpleHeader";
  26. import { styleUrl } from '../../common/js/utils';
  27. import { ref, onMounted } from 'vue';
  28. import { getWallet } from '@/service/airwallex/index';
  29. export default {
  30. setup() {
  31. styleUrl("airwallex")
  32. const router = useRouter();
  33. const amount = ref(0.00);
  34. const loginUserStr = localStorage.getItem('loginUser');
  35. const loginUser = JSON.parse(loginUserStr);
  36. const adminId = loginUser.id;
  37. // console.log("adminId>>>", adminId);
  38. onMounted(async () => {
  39. try {
  40. // 请求后端接口: 获取钱包信息
  41. const resp = await getWallet(adminId);
  42. // console.log("resp.data>>>", resp.data);
  43. amount.value = resp.data.accountAmount;
  44. } catch (error) {
  45. console.error(error);
  46. // 处理异常情况
  47. }
  48. })
  49. const handleWithdraw = () => {
  50. // 导航到提现页面
  51. router.push('/airwallexBeneficiary');
  52. };
  53. return {
  54. amount,
  55. handleWithdraw
  56. };
  57. },
  58. components: { sHeader },
  59. }
  60. </script>