account-management.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <view class="content-container">
  4. <!-- 动态字段列表 -->
  5. <view class="content-title">
  6. <cwg-header :title="t('Documentary.TundManagement.item9')" />
  7. <view class="content-title-btns">
  8. <view class="btn-primary btn-primary1" @click="toSubscribeList()">
  9. <cwg-icon icon="crm-plus" :size="16" color="#fff" />
  10. <text v-t="'Documentary.TundManagement.item44'" />
  11. </view>
  12. </view>
  13. </view>
  14. <uni-loading v-if="accountDataLoading" />
  15. <template v-else>
  16. <view class="field-container" v-if="accountData.length > 0">
  17. <view class="account-l-con" v-for="(item, index) in accountData" :key="index">
  18. <view class="tit">
  19. <view>
  20. <i class="el-icon-success green-icon"></i><text class="tit-tit"
  21. v-t="'Documentary.TundManagement.item13'"></text>
  22. - {{ item.followLogin || "--" }}
  23. </view>
  24. </view>
  25. <view class="account-grid">
  26. <view class="account-grid-item">
  27. <view class="sub" v-t="'Label.TradingAccount'"></view>
  28. <view class="num">{{ item.followLogin || "--" }}</view>
  29. </view>
  30. <view class="account-grid-item">
  31. <view class="sub" v-t="'Label.PlatformType'"></view>
  32. <view class="num">{{ item.followPlatform || "--" }}</view>
  33. </view>
  34. <view class="account-grid-item">
  35. <view class="sub" v-t="'Label.AccountType'"></view>
  36. <view class="num">
  37. <text>{{ groupTypeName(item.followLoginType) }}</text>
  38. </view>
  39. </view>
  40. <view class="account-grid-item">
  41. <view class="sub" v-t="'Label.Leverage'"></view>
  42. <view class="num">
  43. <text v-if="item.followLeverage">1:{{ item.followLeverage }}</text>
  44. <text v-else>{{ "--" }}</text>
  45. </view>
  46. </view>
  47. <view class="account-grid-item">
  48. <view class="sub" v-t="'Label.Balance'"></view>
  49. <view class="num">
  50. {{ numberFormat(item.followBalance) }}
  51. </view>
  52. </view>
  53. <view class="account-grid-item">
  54. <view class="sub" v-t="'Label.Equity'"></view>
  55. <view class="num">{{ numberFormat(item.followEquity) }}</view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <cwg-empty-state v-if="accountData.length == 0" />
  61. </template>
  62. </view>
  63. </cwg-page-wrapper>
  64. </template>
  65. <script setup lang="ts">
  66. import { computed, ref, nextTick, onMounted, reactive, watch } from 'vue';
  67. import { isAfterJuly28 } from '@/utils/dateUtils'
  68. import { useI18n } from 'vue-i18n';
  69. const { t, locale } = useI18n();
  70. import { documentaryApi } from '@/service/documentary';
  71. import { useFilters } from '@/composables/useFilters'
  72. const { numberFormat, numberDecimal } = useFilters()
  73. import useRouter from "@/hooks/useRouter";
  74. const router = useRouter()
  75. // 账户类型
  76. function groupTypeName(type) {
  77. const typeMap = {
  78. '1': t('AccountType.ClassicAccount'),
  79. '2': t('AccountType.SeniorAccount'),
  80. '3': isAfterJuly28() ? '--' : t('AccountType.AgencyAccount'),
  81. '5': t('AccountType.SpeedAccount'),
  82. '6': t('AccountType.SpeedAccount'),
  83. '7': t('AccountType.StandardAccount'),
  84. '8': t('AccountType.CentAccount')
  85. }
  86. return typeMap[type] || ''
  87. }
  88. const toSubscribeList = () => {
  89. console.log(111111);
  90. router.push('/pages/follow/trading-center')
  91. }
  92. //获取客户信号源账户
  93. const accountDataLoading = ref(false)
  94. const accountData = ref([])
  95. const accountPager = ref({
  96. current: 1,
  97. row: 10,
  98. rowTotal: 0,
  99. pageTotal: 0
  100. })
  101. const getDealLogin = async () => {
  102. accountDataLoading.value = true;
  103. let res = await documentaryApi.followDealSubscribeLoginList({
  104. platform: null,
  105. page: {
  106. current: accountPager.value.current,
  107. row: accountPager.value.row,
  108. },
  109. });
  110. if (res.code == 200) {
  111. accountData.value = res.data || []
  112. accountPager.value.rowTotal = res.page.rowTotal;
  113. accountPager.value.pageTotal = res.page.pageTotal;
  114. } else {
  115. uni.showToast({
  116. title: res.msg,
  117. icon: 'none'
  118. });
  119. }
  120. accountDataLoading.value = false;
  121. }
  122. onMounted(() => {
  123. getDealLogin()
  124. })
  125. </script>
  126. <style scoped lang="scss">
  127. @import "@/uni.scss";
  128. .content-container {
  129. .field-container {
  130. display: grid;
  131. grid-template-columns: repeat(3, 1fr);
  132. gap: px2rpx(16);
  133. width: 100%;
  134. min-width: 0;
  135. overflow: hidden;
  136. @media (max-width: 991px) {
  137. grid-template-columns: 1fr;
  138. }
  139. .account-l-con {
  140. background-color: transparent;
  141. border-radius: px2rpx(8);
  142. padding: px2rpx(20);
  143. margin-bottom: px2rpx(16);
  144. transition: all 0.3s ease;
  145. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  146. width: 100%;
  147. box-sizing: border-box;
  148. border: 1px solid var(--bs-border-color);
  149. &:hover {
  150. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  151. transform: translateY(-2px);
  152. }
  153. .tit {
  154. display: flex;
  155. justify-content: space-between;
  156. align-items: center;
  157. margin-bottom: px2rpx(20);
  158. padding-bottom: px2rpx(12);
  159. border-bottom: 1px solid var(--bs-border-color);
  160. view:first-child {
  161. display: flex;
  162. align-items: center;
  163. gap: px2rpx(8);
  164. .green-icon {
  165. color: #28a745;
  166. font-size: px2rpx(16);
  167. }
  168. .tit-tit {
  169. font-size: px2rpx(16);
  170. font-weight: 600;
  171. color: var(--bs-emphasis-color);
  172. }
  173. text:last-child {
  174. font-size: px2rpx(14);
  175. font-weight: 500;
  176. color: var(--bs-body-color);
  177. }
  178. }
  179. .caozuo {
  180. display: flex;
  181. gap: px2rpx(12);
  182. i {
  183. font-size: px2rpx(18);
  184. color: var(--bs-body-color);
  185. transition: all 0.2s ease;
  186. &:hover {
  187. color: #eb3f57;
  188. cursor: pointer;
  189. }
  190. &:active {
  191. transform: scale(0.9);
  192. }
  193. }
  194. }
  195. }
  196. .account-grid {
  197. display: grid;
  198. grid-template-columns: repeat(3, 1fr);
  199. gap: px2rpx(16);
  200. width: 100%;
  201. box-sizing: border-box;
  202. @media (max-width: 480px) {
  203. grid-template-columns: repeat(3, 1fr);
  204. }
  205. .account-grid-item {
  206. /* 🔥 核心修复 3:去掉强制最小宽度,避免超宽 */
  207. /* min-width: px2rpx(200); */
  208. margin-bottom: px2rpx(16);
  209. .sub {
  210. font-size: px2rpx(12);
  211. font-weight: 500;
  212. color: var(--bs-body-color);
  213. margin-bottom: px2rpx(4);
  214. text-transform: uppercase;
  215. letter-spacing: px2rpx(0.5);
  216. white-space: nowrap;
  217. overflow: hidden;
  218. text-overflow: ellipsis;
  219. }
  220. .num {
  221. font-size: px2rpx(14);
  222. font-weight: 400;
  223. color: var(--bs-emphasis-color);
  224. line-height: 1.4;
  225. white-space: nowrap;
  226. overflow: hidden;
  227. text-overflow: ellipsis;
  228. }
  229. }
  230. }
  231. }
  232. }
  233. }
  234. .content-title {
  235. display: flex;
  236. justify-content: space-between;
  237. align-items: center;
  238. .content-title-btns {
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. gap: px2rpx(12);
  243. margin-bottom: px2rpx(24);
  244. .btn-primary {
  245. min-width: px2rpx(120);
  246. background-color: var(--color-error);
  247. color: #fff;
  248. padding: 0 px2rpx(12);
  249. border: none;
  250. font-size: px2rpx(14);
  251. text-align: center;
  252. cursor: pointer;
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. gap: px2rpx(8);
  257. }
  258. .btn-primary1 {
  259. background-color: #cf1322;
  260. ;
  261. }
  262. .btn-primary2 {
  263. background-color: var(--color-secondary-focus);
  264. }
  265. }
  266. }
  267. </style>