From 9a9d832dbd364557e070abcd9a7779a2c6c07ffb Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Tue, 20 Jan 2026 17:35:13 +0800
Subject: [PATCH] 1
---
src/views/homePage/index.vue | 81 +++++++++++++++++++++++-----------------
1 files changed, 47 insertions(+), 34 deletions(-)
diff --git a/src/views/homePage/index.vue b/src/views/homePage/index.vue
index da3af5b..9b2ccbe 100644
--- a/src/views/homePage/index.vue
+++ b/src/views/homePage/index.vue
@@ -52,14 +52,17 @@
{{ $t("总资产") }}(USD)
</div>
</div>
+
<div class="flex-centerY flex-position-between" style="margin-top: 15px">
<div class="flex flex-justify-between">
<div style="font-size: 33px;font-weight: bold;color: black">
{{ showMoney ? todayMoney.money_contract : "*****" }}
</div>
</div>
+ <!-- <div style="background: black;color: white;padding: 4px 17px;border-radius: 90px;font-size: 14px"
+ @click="toPage('/cryptos/recharge/rechargeList?isForeign=true')"> -->
<div style="background: black;color: white;padding: 4px 17px;border-radius: 90px;font-size: 14px"
- @click="toPage('/cryptos/recharge/rechargeList?isForeign=true')">
+ @click="toPage('/customerService')">
{{ $t("充值") }}
</div>
</div>
@@ -67,10 +70,12 @@
<div>
{{ $t("今日盈亏") }}
</div>
- <div style="margin-left: 15px">
+ <div style="margin-left: 15px"
+ :style="todayMoney.money_contract_profit_today > 0 ? 'color: #0f0' : todayMoney.money_contract_profit_today < 0 ? 'color: #f00' : ''">
{{ showMoney ? todayMoney.money_contract_profit_today : "****" }}
</div>
- <div style="margin-left: 15px">
+ <div style="margin-left: 15px"
+ :style="todayMoney.money_contract_profit_today > 0 ? 'color: #0f0' : todayMoney.money_contract_profit_today < 0 ? 'color: #f00' : ''">
{{ showMoney ? (Number(todayMoney.money_contract_profit_today + '') / (todayMoney.money_contract == 0 ? 1 :
todayMoney.money_contract) * 100).toFixed(2) + '%' : "****" }}
</div>
@@ -90,19 +95,11 @@
:show-indicators="false" style="border-radius: 8px;overflow: hidden">
<van-swipe-item v-for="item in announceList" style="border-radius: 8px;overflow: hidden;border: #eee 1px solid"
:key="item.id" @click="toAnnounceDetail(item.uuid)">
- <!-- <div class="flex justify-start items-center">-->
- <!-- <img :src="item.imgUrl" style="width:100%" alt="" class="notice_img mr-5">-->
- <!--<!– <div class="notice_content textColor">–>-->
- <!--<!– <div>{{ item.startTime }}</div>–>-->
- <!--<!– <div>{{ item.title }}</div>–>-->
- <!--<!– </div>–>-->
- <!-- </div>-->
<img :src="item.imgUrl" alt="" class="notice_img mr-5" style="width:100%;height:100px;border-radius: 8px">
</van-swipe-item>
</van-swipe>
- <!-- </van-notice-bar>-->
<div class="flex-center" style="position:absolute;bottom:5px;left:0;;z-index:999;width: 100%">
- <div v-for="(i, index) in announceList">
+ <div v-for="(i, index) in announceList" :key="index">
<div v-if="current != index" style="width:3px;height:3px;background:#bbb;margin-right:5px;border-radius: 3px">
</div>
<div v-else style="width:3px;height:3px;background:#333;;margin-right:5px;border-radius: 3px"></div>
@@ -205,7 +202,7 @@
<script setup>
import Head from './components/head.vue'
import { useI18n } from "vue-i18n";
-import { ref, computed, onBeforeUnmount } from 'vue';
+import { ref, computed, onBeforeUnmount, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import ListQuatation from "@/components/Transform/list-quotation/index.vue";
import { _getHomeList } from '@/service/cryptos.api'
@@ -225,18 +222,27 @@
const router = useRouter()
const store = useStore();
const showMoney = ref(true)
-const myAssets = ref({})
-const myAssetsz = ref({})
-_getassets().then(res => {
- myAssets.value = res
-})
const todayMoney = ref({
money_contract_profit_today: 0
})
-_getContractBySymbolType().then(data => {
- todayMoney.value = data
-})
+
+// 获取资产信息
+function getAllAssets() {
+ _getContractBySymbolType().then(data => {
+ todayMoney.value = data
+ })
+}
+// 轮询获取资产信息
+let times1 = null;
+getAllAssets();
+times1 = setInterval(() => {
+ getAllAssets();
+}, 4000)
+// 停止获取资产计数器
+function timeOut1() {
+ clearInterval(times1)
+}
const tabbers = [
// { key: 1, name: t('跟单'), icon: new URL('@/assets/imgs/home/home_1.png', import.meta.url) },
@@ -278,13 +284,13 @@
// icon2: new URL('@/assets/imgs/home/home_10b.png', import.meta.url),
// path: '/customerService'
// },
- {
- key: 9,
- name: t('申购'),
- icon: new URL('@/assets/img/img.png', import.meta.url),
- icon2: new URL('@/assets/imgs/home/home_12b.png', import.meta.url),
- path: '/ICO/ico'
- },
+ // {
+ // key: 9,
+ // name: t('申购'),
+ // icon: new URL('@/assets/img/img.png', import.meta.url),
+ // icon2: new URL('@/assets/imgs/home/home_12b.png', import.meta.url),
+ // path: '/ICO/ico'
+ // },
{
key: 9,
name: t('C2C'),
@@ -319,15 +325,20 @@
]
// 获取公告数据
-const announceList = ref([])
-_getNewsList1({
- language: useI18n().locale.value,
-}).then(res => {
- announceList.value = res
-})
+const announceList = ref([
+ { imgUrl: new URL('@/assets/imgs/home/lbt_1.png', import.meta.url), id: 1, title: '公告标题1', content: '公告内容1', time: '2022-01-01' },
+ { imgUrl: new URL('@/assets/imgs/home/lbt_2.png', import.meta.url), id: 2, title: '公告标题2', content: '公告内容2', time: '2022-01-01' },
+ { imgUrl: new URL('@/assets/imgs/home/lbt_3.png', import.meta.url), id: 3, title: '公告标题3', content: '公告内容3', time: '2022-01-01' },
+ { imgUrl: new URL('@/assets/imgs/home/lbt_4.png', import.meta.url), id: 4, title: '公告标题4', content: '公告内容4', time: '2022-01-01' },
+ { imgUrl: new URL('@/assets/imgs/home/lbt_5.png', import.meta.url), id: 5, title: '公告标题5', content: '公告内容5', time: '2022-01-01' },
+])
+// _getNewsList1().then(res => {
+// announceList.value = res
+// })
// 跳转公告详情
const toAnnounceDetail = (announceId) => {
+ return
if (announceId) {
router.push({ path: '/cryptos/AnnounceDetail', query: { id: announceId } })
}
@@ -386,12 +397,14 @@
fetchQList()
onBeforeUnmount(() => {
+ timeOut1()
if (timeout.value) {
clearTimeout(timeout.value)
}
})
//#endregion----------------------------------------------
+
</script>
<style lang="scss">
--
Gitblit v1.9.3