From fab9d57071a7cc1dc1dcce0c9ee4640d20727251 Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Sat, 18 Oct 2025 11:06:15 +0800
Subject: [PATCH] 1

---
 src/assets/imgs/home/lbt_5.png |    0 
 src/assets/imgs/home/lbt_3.png |    0 
 src/assets/imgs/home/lbt_4.png |    0 
 src/views/homePage/index.vue   |   64 ++++++++++++++++++++------------
 8-20_app_1.rar                 |    0 
 src/assets/imgs/home/lbt_2.png |    0 
 src/assets/imgs/home/lbt_1.png |    0 
 7 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/8-20_app_1.rar b/8-20_app_1.rar
new file mode 100644
index 0000000..d5a1805
--- /dev/null
+++ b/8-20_app_1.rar
Binary files differ
diff --git a/src/assets/imgs/home/lbt_1.png b/src/assets/imgs/home/lbt_1.png
new file mode 100644
index 0000000..2739ac7
--- /dev/null
+++ b/src/assets/imgs/home/lbt_1.png
Binary files differ
diff --git a/src/assets/imgs/home/lbt_2.png b/src/assets/imgs/home/lbt_2.png
new file mode 100644
index 0000000..d853b78
--- /dev/null
+++ b/src/assets/imgs/home/lbt_2.png
Binary files differ
diff --git a/src/assets/imgs/home/lbt_3.png b/src/assets/imgs/home/lbt_3.png
new file mode 100644
index 0000000..67cecf6
--- /dev/null
+++ b/src/assets/imgs/home/lbt_3.png
Binary files differ
diff --git a/src/assets/imgs/home/lbt_4.png b/src/assets/imgs/home/lbt_4.png
new file mode 100644
index 0000000..960b673
--- /dev/null
+++ b/src/assets/imgs/home/lbt_4.png
Binary files differ
diff --git a/src/assets/imgs/home/lbt_5.png b/src/assets/imgs/home/lbt_5.png
new file mode 100644
index 0000000..9f26c84
--- /dev/null
+++ b/src/assets/imgs/home/lbt_5.png
Binary files differ
diff --git a/src/views/homePage/index.vue b/src/views/homePage/index.vue
index da3af5b..b5bd2eb 100644
--- a/src/views/homePage/index.vue
+++ b/src/views/homePage/index.vue
@@ -52,6 +52,7 @@
           {{ $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">
@@ -67,10 +68,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 +93,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">-->
-          <!--&lt;!&ndash;              <div class="notice_content textColor">&ndash;&gt;-->
-          <!--&lt;!&ndash;                <div>{{ item.startTime }}</div>&ndash;&gt;-->
-          <!--&lt;!&ndash;                <div>{{ item.title }}</div>&ndash;&gt;-->
-          <!--&lt;!&ndash;              </div>&ndash;&gt;-->
-          <!--            </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 +200,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'
@@ -227,16 +222,30 @@
 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
+  })
+  _getassets().then(res => {
+    myAssets.value = res
+  })
+}
+// 轮询获取资产信息
+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) },
@@ -319,15 +328,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 +400,14 @@
 fetchQList()
 
 onBeforeUnmount(() => {
+  timeOut1()
   if (timeout.value) {
     clearTimeout(timeout.value)
   }
 })
 //#endregion----------------------------------------------
 
+
 </script>
 
 <style lang="scss">

--
Gitblit v1.9.3