account-management.vue 11 KB

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