Ver código fonte

超短池强势池显示日期修改

Zhangbw 1 mês atrás
pai
commit
e0a1cde153
2 arquivos alterados com 15 adições e 17 exclusões
  1. 8 9
      src/pages/pool/pool.vue
  2. 7 8
      src/pages/strong/strong.vue

+ 8 - 9
src/pages/pool/pool.vue

@@ -43,7 +43,7 @@
           <view v-else class="unlocked-content">
             <view class="unlocked-header">
               <view class="unlocked-dot"></view>
-              <text class="unlocked-tip">需学习内容 ({{ currentDate }})</text>
+              <text class="unlocked-tip">需学习内容 ({{ latestAddDate }})</text>
             </view>
             <view class="stock-list">
               <view class="stock-item" v-for="(stock, index) in stockList" :key="index">
@@ -121,13 +121,12 @@ let subscriptionTimer = null
 const app = getApp();
 // #endif
 
-// 获取当前日期
-const currentDate = computed(() => {
-  const now = new Date()
-  const year = now.getFullYear()
-  const month = String(now.getMonth() + 1).padStart(2, '0')
-  const day = String(now.getDate()).padStart(2, '0')
-  return `${year}年${month}月${day}日`
+// 最新股票加入时间(从接口数据取)
+const latestAddDate = computed(() => {
+  if (stockList.value.length > 0 && stockList.value[0].addDate) {
+    return stockList.value[0].addDate
+  }
+  return '-'
 })
 
 // 性能统计数据
@@ -153,7 +152,7 @@ const loadPerformanceStats = async (poolType) => {
 }
 
 // 日期变化时只刷新列表,不再更新统计数据
-const onDateChange = async ({ startDate, endDate, poolType }) => {
+const onDateChange = async () => {
 }
 
 // 获取涨跌样式

+ 7 - 8
src/pages/strong/strong.vue

@@ -38,7 +38,7 @@
           <view class="unlocked-content">
             <view class="unlocked-header">
               <view class="unlocked-dot"></view>
-              <text class="unlocked-tip">实时更新 ({{ currentDate }})</text>
+              <text class="unlocked-tip">实时更新 ({{ latestAddDate }})</text>
             </view>
             <view class="update-tip-wrapper">
               <text class="update-tip">数据更新提示(仅为历史数据同步,不代表实时交易建议)</text>
@@ -97,13 +97,12 @@ let refreshTimer = null
 const app = getApp();
 // #endif
 
-// 获取当前日期
-const currentDate = computed(() => {
-  const now = new Date()
-  const year = now.getFullYear()
-  const month = String(now.getMonth() + 1).padStart(2, '0')
-  const day = String(now.getDate()).padStart(2, '0')
-  return `${year}年${month}月${day}日`
+// 最新历史数据导入时间(从接口数据取)
+const latestAddDate = computed(() => {
+  if (stockList.value.length > 0 && stockList.value[0].addDate) {
+    return stockList.value[0].addDate
+  }
+  return '-'
 })
 
 // 获取涨跌样式