| | |
| | | {{ $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"> |
| | |
| | | <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> |
| | |
| | | :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> |
| | |
| | | <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' |
| | |
| | | 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) }, |
| | |
| | | ] |
| | | |
| | | // 获取公告数据 |
| | | 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 } }) |
| | | } |
| | |
| | | fetchQList() |
| | | |
| | | onBeforeUnmount(() => { |
| | | timeOut1() |
| | | if (timeout.value) { |
| | | clearTimeout(timeout.value) |
| | | } |
| | | }) |
| | | //#endregion---------------------------------------------- |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss"> |