DeleteAccountDialogs.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <cwg-popup :title="t('Tips.DeleteAccount')" :visible="props.visible" :showFooter="false"
  3. @update:visible="$emit('update:visible', $event)">
  4. <scroll-view scroll-y class="account-list" :style="{ maxHeight: '40vh' }">
  5. <!-- 加载状态 -->
  6. <view v-if="loading" class="loading-state">
  7. <uni-load-more :status="loading ? 'loading' : 'noMore'" />
  8. </view>
  9. </scroll-view>
  10. <cwg-tabel ref="tableRef" :columns="columns" :queryParams="search" :api="listApi">
  11. <template #avatar="{ row }">
  12. <image :src="row.avatar" class="avatar" mode="widthFix" />
  13. <cwg-file :path="row.path" />
  14. </template>
  15. <template #type="{ row }">
  16. <view class="status-badge">{{ getAccountTypeText(row.type) }}
  17. </view>
  18. </template>
  19. <template #action="{ row, index }">
  20. <view class="expand-btn" @click="doDetail(row)">
  21. <!-- <cwg-icon name="crm-trash-can" :size="16" color="#1d293d" /> -->
  22. <view v-t="'Tips.TransactionRecord'"></view>
  23. </view>
  24. </template>
  25. </cwg-tabel>
  26. <TransactionDialogs ref="transactionDialogsRef" v-model:visible="transactionDialogVisible"
  27. :loginInfo="selectedLoginInfo" />
  28. </cwg-popup>
  29. </template>
  30. <script setup>
  31. import { ref, computed, watch } from 'vue'
  32. import { useI18n } from 'vue-i18n'
  33. import { customApi } from '@/service/custom'
  34. import TransactionDialogs from './TransactionDialogs.vue'
  35. const { t } = useI18n()
  36. const props = defineProps({
  37. // 是否显示弹窗
  38. visible: {
  39. type: Boolean,
  40. default: false
  41. },
  42. // 分页信息
  43. pagerInfo: {
  44. type: Object,
  45. default: () => ({
  46. current: 1,
  47. row: 10,
  48. pageTotal: 0,
  49. rowTotal: 0
  50. })
  51. }
  52. })
  53. const emit = defineEmits(['update:visible', 'page-change', 'view-record'])
  54. // 表格列配置
  55. const columns = ref([
  56. {
  57. prop: 'login',
  58. label: t('Label.TradingAccount'),
  59. align: 'left'
  60. },
  61. {
  62. prop: 'platform',
  63. label: t('Label.PlatformType'),
  64. align: 'left'
  65. },
  66. {
  67. prop: 'type',
  68. label: t('Label.AccountType'),
  69. align: 'left',
  70. slot: 'type',
  71. },
  72. {
  73. prop: 'status',
  74. label: t('PersonalManagement.Label.State'),
  75. slot: 'status',
  76. align: 'left'
  77. },
  78. {
  79. label: t('Label.Action'),
  80. slot: 'action'
  81. }
  82. ])
  83. // 列表数据
  84. const tableData = ref([])
  85. const loading = ref(false)
  86. // 账户类型映射
  87. const accountTypeMap = {
  88. 1: 'AccountType.ClassicAccount',
  89. 2: 'AccountType.SeniorAccount',
  90. 3: 'AccountType.AgencyAccount',
  91. 5: 'AccountType.SpeedAccount',
  92. 6: 'AccountType.SpeedAccount',
  93. 7: 'AccountType.StandardAccount',
  94. 8: 'AccountType.CentAccount'
  95. }
  96. // 判断是否在7月28日之后
  97. const isAfterJuly28 = () => {
  98. const today = new Date()
  99. const july28 = new Date(today.getFullYear(), 6, 28)
  100. return today > july28
  101. }
  102. // 获取账户类型文本
  103. const getAccountTypeText = (type) => {
  104. if (type === 3 && isAfterJuly28()) {
  105. return '--'
  106. }
  107. const key = accountTypeMap[type]
  108. return key ? t(key) : '--'
  109. }
  110. // 查看交易记录
  111. const selectedLoginInfo = ref({})
  112. const transactionDialogVisible = ref(false)
  113. const doDetail = (row) => {
  114. selectedLoginInfo.value = row
  115. transactionDialogVisible.value = true
  116. }
  117. const listApi = ref(null)
  118. listApi.value = customApi.deleteAccountList
  119. </script>
  120. <style scoped lang="scss">
  121. @import "@/uni.scss";
  122. .delete-account-dialog {
  123. background-color: var(--color-white);
  124. border-radius: px2rpx(8);
  125. overflow: hidden;
  126. @media (min-width: 768px) {
  127. width: px2rpx(800);
  128. }
  129. }
  130. .dialog-header {
  131. display: flex;
  132. align-items: center;
  133. justify-content: space-between;
  134. padding: px2rpx(30) px2rpx(30) px2rpx(20);
  135. .dialog-title {
  136. font-size: px2rpx(20);
  137. font-weight: 600;
  138. color: #333;
  139. }
  140. }
  141. .dialog-content {
  142. padding: px2rpx(20);
  143. }
  144. .expand-btn {
  145. display: inline-flex;
  146. align-items: center;
  147. height: px2rpx(24);
  148. padding: 0 px2rpx(16);
  149. border: none;
  150. background-color: var(--color-secondary-focus);
  151. color: var(--color-white);
  152. font-size: px2rpx(13);
  153. font-weight: 500;
  154. cursor: pointer;
  155. transition: all 0.2s ease;
  156. .icon {
  157. transition: transform 0.3s ease;
  158. }
  159. }
  160. .empty-state {
  161. display: flex;
  162. flex-direction: column;
  163. align-items: center;
  164. justify-content: center;
  165. padding: px2rpx(60) 0;
  166. .empty-text {
  167. margin-top: px2rpx(20);
  168. font-size: px2rpx(18);
  169. color: #999;
  170. }
  171. }
  172. </style>