account-management.vue 10 KB

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