Index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <div class="index">
  3. <div class="index-func">
  4. <div class="func-head">
  5. <img src="@/assets/img/index/default-img.png" alt="" @click="goUser" />
  6. </div>
  7. <div class="search-currency pf400 fs14 fcA9A9A9" @click="goSearch">
  8. <img src="../../assets/icon/index/search-gray.svg" class="search-img" alt="" />
  9. 搜索您关心的币种
  10. </div>
  11. <div class="qr-code" @click="goQrCode">
  12. <img src="../../assets/icon/index/ic_qrcode_bk.svg" alt="" />
  13. </div>
  14. <div class="notification" @click="goNotifi">
  15. <img src="../../assets/icon/index/Notification.svg" alt="" />
  16. </div>
  17. </div>
  18. <div class="asset-total">
  19. <div class="asset-title pf400 fs16 fc1F2937">
  20. 理财总资产(USDT)
  21. <img :src="isHide ? eyeOpen : eyeClose" class="eye-close" @click="toggleEye" />
  22. </div>
  23. <div class="asset-number pf600 fs32 fc1F2937" :class="{ 'mask-style': isHide }">
  24. {{ isHide ? "···········" : "1,125,158.00" }}
  25. </div>
  26. <div
  27. class="asset-approximately pf400 fs16 fcDF384C"
  28. :class="{ 'mask-style': isHide }">
  29. {{ isHide ? "·········" : "≈35,458.00" }}
  30. </div>
  31. <div class="asset-revenue">
  32. <div class="asset-left">
  33. <div class="text pf400 fs12 fc6A7187">昨日收益(USDT)</div>
  34. <div class="number pf400 fs16 fc061237" :class="{ 'mask-style': isHide }">
  35. {{ isHide ? "·········" : "5,678.00" }}
  36. </div>
  37. </div>
  38. <div class="asset-right">
  39. <div class="text pf400 fs12 fc6A7187">累计收益(USDT)</div>
  40. <div class="number pf400 fs16 fc061237" :class="{ 'mask-style': isHide }">
  41. {{ isHide ? "·········" : "5,678.00" }}
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="advertisement">
  47. <img src="../../assets/img/index/Rectangle 1.png" alt="" />
  48. </div>
  49. <div class="index-menu">
  50. <div
  51. class="menu-item"
  52. v-for="(item, index) in indexMenu"
  53. :key="index"
  54. @click="goMenu(index)">
  55. <img :src="item.image" alt="" />
  56. <div class="item-text pf400 fs14 fc666666">{{ item.name }}</div>
  57. </div>
  58. </div>
  59. <HotCoin></HotCoin>
  60. <HotFinancial></HotFinancial>
  61. </div>
  62. </template>
  63. <script setup>
  64. import { useRoute, useRouter } from "vue-router";
  65. import { ref } from "vue";
  66. import HotCoin from "./components/HotCoin.vue";
  67. import HotFinancial from "./components/HotFinancial.vue";
  68. const router = useRouter();
  69. const isHide = ref(false);
  70. const toggleEye = () => {
  71. isHide.value = !isHide.value;
  72. };
  73. const eyeClose = require("@/assets/icon/index/EyeClosed.svg");
  74. const eyeOpen = require("@/assets/icon/index/eye-open.svg");
  75. const indexMenu = [
  76. {
  77. name: "秒合约",
  78. image: require("@/assets/icon/index/Rectangle 6.png"),
  79. },
  80. {
  81. name: "充币",
  82. image: require("@/assets/icon/index/Rectangle 8.png"),
  83. },
  84. {
  85. name: "质押理财",
  86. image: require("@/assets/icon/index/Rectangle 3.png"),
  87. },
  88. {
  89. name: "贷款",
  90. image: require("@/assets/icon/index/Rectangle 4.png"),
  91. },
  92. {
  93. name: "OTC",
  94. image: require("@/assets/icon/index/Rectangle 9.png"),
  95. },
  96. {
  97. name: "ICO",
  98. image: require("@/assets/icon/index/Rectangle 2.png"),
  99. },
  100. {
  101. name: "邀请推广",
  102. image: require("@/assets/icon/index/Rectangle 5.png"),
  103. },
  104. {
  105. name: "客服",
  106. image: require("@/assets/icon/index/Rectangle 7.png"),
  107. },
  108. ];
  109. const goMenu = (index) => {
  110. if (index == 0) {
  111. router.push("/bitcoin/seconds");
  112. } else if (index == 1) {
  113. router.push("/rechargeIndex");
  114. } else if (index == 2) {
  115. router.push("/financialIndex");
  116. } else if (index == 3) {
  117. router.push("/loanIndex");
  118. } else if (index == 4) {
  119. router.push("/otcIndex");
  120. } else if (index == 5) {
  121. router.push("/icoIndex");
  122. } else if (index == 6) {
  123. router.push("/invite");
  124. } else if (index == 7) {
  125. }
  126. };
  127. const goSearch = () => {
  128. router.push("/searchIcon");
  129. };
  130. const goNotifi = () => {
  131. router.push("/notification");
  132. };
  133. const goUser = () => {
  134. router.push("/indexUser");
  135. };
  136. const goQrCode = () => {
  137. // router.push("/splashScreen");
  138. };
  139. </script>
  140. <style lang="less" scoped>
  141. .index {
  142. display: flex;
  143. flex-direction: column;
  144. justify-content: flex-start;
  145. align-items: center;
  146. margin-bottom: 80px;
  147. width: 100%;
  148. .index-func {
  149. position: fixed;
  150. left: 0px;
  151. top: 0px;
  152. z-index: 10;
  153. display: flex;
  154. flex-direction: row;
  155. justify-content: space-between;
  156. align-items: center;
  157. padding: 20px 15px 0 15px;
  158. width: 100%;
  159. background: #ffffff;
  160. box-sizing: border-box;
  161. .func-head {
  162. display: flex;
  163. flex-direction: row;
  164. justify-content: center;
  165. align-items: center;
  166. width: 38px;
  167. height: 38px;
  168. border-radius: 12px;
  169. background: #f5f5f5;
  170. img {
  171. width: 18px;
  172. height: 18px;
  173. }
  174. }
  175. .search-currency {
  176. display: flex;
  177. flex-direction: row;
  178. justify-content: flex-start;
  179. align-items: center;
  180. margin-left: -6px;
  181. width: 210px;
  182. height: 38px;
  183. border-radius: 50px;
  184. border: 1px solid #dddddd;
  185. box-sizing: border-box;
  186. .search-img {
  187. margin-left: 12.5px;
  188. margin-right: 9.5px;
  189. width: 17px;
  190. height: 17px;
  191. }
  192. }
  193. .qr-code {
  194. display: flex;
  195. flex-direction: row;
  196. justify-content: center;
  197. align-items: center;
  198. margin-right: -10px;
  199. width: 21px;
  200. height: 18px;
  201. img {
  202. width: 21px;
  203. height: 18px;
  204. }
  205. }
  206. .notification {
  207. display: flex;
  208. flex-direction: row;
  209. justify-content: center;
  210. align-items: center;
  211. width: 16px;
  212. height: 18px;
  213. img {
  214. width: 16px;
  215. height: 18px;
  216. }
  217. }
  218. }
  219. .asset-total {
  220. display: flex;
  221. flex-direction: column;
  222. justify-content: flex-start;
  223. margin-top: 70px;
  224. width: 343px;
  225. .mask-style {
  226. font-size: 24px !important;
  227. letter-spacing: -4px;
  228. font-weight: 600;
  229. opacity: 0.9;
  230. }
  231. .asset-title {
  232. display: flex;
  233. flex-direction: row;
  234. justify-content: flex-start;
  235. align-items: center;
  236. height: 22px;
  237. .eye-close {
  238. margin-left: 5px;
  239. width: 16px;
  240. height: 16px;
  241. }
  242. }
  243. .asset-number {
  244. margin-top: 3px;
  245. height: 44px;
  246. line-height: 44px;
  247. }
  248. .asset-approximately {
  249. margin-top: 1px;
  250. height: 22px;
  251. line-height: 22px;
  252. }
  253. .asset-revenue {
  254. display: flex;
  255. flex-direction: row;
  256. justify-content: space-between;
  257. margin-top: 6px;
  258. height: 44px;
  259. .asset-left,
  260. .asset-right {
  261. height: 100%;
  262. .text {
  263. height: 20px;
  264. line-height: 20px;
  265. letter-spacing: 0.3px;
  266. }
  267. .number {
  268. margin-top: 3px;
  269. height: 24px;
  270. line-height: 24px;
  271. }
  272. }
  273. }
  274. }
  275. .advertisement {
  276. margin-top: 10px;
  277. width: 345px;
  278. height: 85px;
  279. }
  280. .index-menu {
  281. display: flex;
  282. flex-direction: row;
  283. justify-content: flex-start;
  284. flex-wrap: wrap;
  285. margin-top: 29px;
  286. width: 318px;
  287. height: 139px;
  288. .menu-item {
  289. display: flex;
  290. flex-direction: column;
  291. justify-content: flex-start;
  292. align-items: center;
  293. margin-left: 30px;
  294. width: 57px;
  295. height: 57px;
  296. &:nth-child(1),
  297. &:nth-child(5) {
  298. margin-left: 0px;
  299. }
  300. &:nth-child(5),
  301. &:nth-child(6),
  302. &:nth-child(7),
  303. &:nth-child(8) {
  304. margin-top: 25px;
  305. }
  306. img {
  307. width: 32px;
  308. height: 32px;
  309. }
  310. .item-text {
  311. margin-top: 1px;
  312. height: 24px;
  313. line-height: 24px;
  314. letter-spacing: 0.2px;
  315. }
  316. }
  317. }
  318. }
  319. </style>