account-select.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <view class="container">
  4. <view
  5. class="app-page-head card-header d-flex gap-3 flex-wrap align-items-center justify-content-between border-0">
  6. <view class="app-page-head mb-0">
  7. <h1 class="app-page-title" v-t="'Custom.Withdraw.Title1'"></h1>
  8. </view>
  9. </view>
  10. <uni-loading v-if="standardAccounts.length === 0" />
  11. <view class="row" v-else>
  12. <view class="col-12">
  13. <p class="tips"><span v-t="'news_add_field.OpenAccount.Des1'"></span>
  14. <span class="pdfLink">
  15. <cwg-link type="pdf" title="news_add_field.OpenAccount.Des2"
  16. url="pdf/PrivacyPolicy2019_01.pdf" target="_blank" />
  17. </span>
  18. </p>
  19. </view>
  20. <view class="col-lg-4" v-for="account in standardAccounts" :key="account.id">
  21. <view class="card overflow-hidden card-action action-border-primary">
  22. <view class="card-header bg-light border-0 p-4 accordion-b utton text-white bg">
  23. <!-- <view class="ribbon">Premium</view> -->
  24. <h4 class="text-white" v-t="account.name"></h4>
  25. <view class="mb-4" v-t="account.description"></view>
  26. <view class="display-6 fw-bold text-white lh-1 price-monthly">{{ account.minDeposit }}
  27. <span class="h6 text-white" v-t="'vu.item9'"></span>
  28. </view>
  29. </view>
  30. <view class="row-cell"></view>
  31. <view class="row-cell"></view>
  32. <view class="card-body p-4">
  33. <view class="fs-5 list-inline text-dark">
  34. <view class="d-flex gap-2 align-items-center py-1"> <i
  35. class="fa-regular fa-circle-check text-success"></i> {{ t('vu.item10') }}: {{
  36. account.minSpread }}
  37. </view>
  38. <view class="d-flex gap-2 align-items-center py-1"> <i
  39. class="fa-regular fa-circle-check text-success"></i> {{ t('vu.item11') }}: {{
  40. account.maxLeverage }}
  41. </view>
  42. </view>
  43. </view>
  44. <view class="card-footer p-4 pt-0 border-0">
  45. <button @click="handleContinue(account.id)"
  46. class="btn btn-danger waves-effect waves-light w-100"><i class="fi fi-rs-check"></i>
  47. {{ t('Btn.item13') }}</button>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </cwg-page-wrapper>
  54. </template>
  55. <script setup>
  56. import { ref, computed, onMounted, } from 'vue';
  57. import { onLoad } from '@dcloudio/uni-app';
  58. import { customApi } from "@/service/custom";
  59. import useRouter from "@/hooks/useRouter";
  60. import { useI18n } from "vue-i18n";
  61. const router = useRouter();
  62. const { t } = useI18n();
  63. const server = ref('')
  64. const showLogin = ref(null)
  65. const isTimeShow = ref(true)
  66. const loading = ref(true)
  67. onLoad((e) => {
  68. server.value = e.server
  69. })
  70. const typeList = computed(() => [
  71. {
  72. id: 7,
  73. type: 'StandardAccount',
  74. name: 'AccountType.StandardAccount',
  75. showCondition: () => showLogin.value && showLogin.value.indexOf('7') == -1,
  76. description: 'Custom.NewAccount.DesLogin5',
  77. minDeposit: '$200',
  78. minSpread: '0.01',
  79. maxLeverage: '1:1000',
  80. icon: '/static/images/info/bank-information-1.webp',
  81. },
  82. {
  83. id: 2,
  84. type: 'SeniorAccount',
  85. name: 'AccountType.SeniorAccount',
  86. showCondition: () => showLogin.value && showLogin.value.indexOf('2') == -1,
  87. description: 'Custom.NewAccount.DesLogin3',
  88. minDeposit: '$200',
  89. minSpread: '0.01',
  90. maxLeverage: '1:1000',
  91. icon: '/static/images/info/bank-information-2.webp',
  92. },
  93. {
  94. id: 8,
  95. type: 'CentAccount',
  96. name: 'AccountType.CentAccount',
  97. showCondition: () => showLogin.value && showLogin.value.indexOf('8') == -1 && isTimeShow.value,
  98. description: 'Custom.NewAccount.DesLogin8',
  99. minDeposit: '$200',
  100. minSpread: '0.01',
  101. maxLeverage: '1:500',
  102. icon: '/static/images/info/bank-information-3.webp',
  103. }
  104. ])
  105. // 定义账户数据类型
  106. const standardAccounts = computed(() => typeList.value.filter(account => account.showCondition()))
  107. const getExcludeShowLogin = async () => {
  108. try {
  109. let res = await customApi.excludeShowLogin({});
  110. if (res.code == 200) {
  111. if (res.data == null) {
  112. showLogin.value = [];
  113. } else {
  114. showLogin.value = res.data.excludeShowLoginTypes;
  115. }
  116. } else {
  117. console.error('获取账户显示权限失败:', res.msg);
  118. showLogin.value = [];
  119. }
  120. } catch (error) {
  121. console.error('获取账户显示权限出错:', error);
  122. showLogin.value = [];
  123. } finally {
  124. loading.value = false;
  125. }
  126. }
  127. // 继续按钮点击事件,向上传递选中的账户信息
  128. const handleContinue = (id) => {
  129. router.push({
  130. path: "/pages/customer/create-account",
  131. query: { id, server: server.value },
  132. });
  133. }
  134. //获取显示权限
  135. onMounted(() => {
  136. getExcludeShowLogin()
  137. })
  138. </script>
  139. <style lang="scss" scoped>
  140. @import "@/uni.scss";
  141. .bg {
  142. background-image: url('/static/images/vu/account-bg.png');
  143. background-size: cover;
  144. background-position: center bottom;
  145. }
  146. .tips{
  147. line-height: px2rpx(24);
  148. }
  149. </style>