Forráskód Böngészése

我的股票修改

Zhangbw 3 hónapja
szülő
commit
ee9a87906f

+ 12 - 21
dist/dev/mp-weixin/pages/rank/rank.js

@@ -12,18 +12,11 @@ const _sfc_main = {
     const isLoggedIn = common_vendor.ref(false);
     const myStocks = common_vendor.ref([]);
     const viewMode = common_vendor.ref("list");
-    const swiperIndex = common_vendor.ref(0);
     const isLoading = common_vendor.ref(false);
     const lastLoadTime = common_vendor.ref(0);
     const CACHE_DURATION = 5e3;
     const setViewMode = (mode) => {
       viewMode.value = mode;
-      swiperIndex.value = mode === "list" ? 0 : 1;
-    };
-    const onSwiperChange = (e) => {
-      const index = e.detail.current;
-      swiperIndex.value = index;
-      viewMode.value = index === 0 ? "list" : "table";
     };
     const indexData = common_vendor.ref({
       stockCode: "000001",
@@ -299,9 +292,7 @@ const _sfc_main = {
         j: common_vendor.o(($event) => setViewMode("list")),
         k: viewMode.value === "table" ? 1 : "",
         l: common_vendor.o(($event) => setViewMode("table")),
-        m: myStocks.value.length > 0
-      }, myStocks.value.length > 0 ? {
-        n: common_vendor.f(myStocks.value, (stock, index, i0) => {
+        m: common_vendor.f(myStocks.value, (stock, index, i0) => {
           return {
             a: stock.code,
             b: common_vendor.o(($event) => removeStock(index), stock.code),
@@ -312,10 +303,9 @@ const _sfc_main = {
               ["show-delete"]: true
             })
           };
-        })
-      } : {}, {
-        o: myStocks.value.length > 0
-      }, myStocks.value.length > 0 ? {
+        }),
+        n: viewMode.value === "list",
+        o: myStocks.value.length === 0 ? 1 : "",
         p: common_vendor.f(myStocks.value, (stock, index, i0) => {
           return {
             a: common_vendor.t(stock.name),
@@ -329,14 +319,15 @@ const _sfc_main = {
             i: stock.code,
             j: common_vendor.o(($event) => handleStockClick(stock, index), stock.code)
           };
-        })
-      } : {}, {
-        q: swiperIndex.value,
-        r: common_vendor.o(onSwiperChange),
-        s: !isLoggedIn.value ? 1 : "",
-        t: !isLoggedIn.value
+        }),
+        q: viewMode.value === "table",
+        r: myStocks.value.length === 0 ? 1 : "",
+        s: myStocks.value.length === 0
+      }, myStocks.value.length === 0 ? {} : {}, {
+        t: !isLoggedIn.value ? 1 : "",
+        v: !isLoggedIn.value
       }, !isLoggedIn.value ? {
-        v: common_vendor.o(goToLogin)
+        w: common_vendor.o(goToLogin)
       } : {});
     };
   }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/dev/mp-weixin/pages/rank/rank.wxml


+ 0 - 9
dist/dev/mp-weixin/pages/rank/rank.wxss

@@ -116,15 +116,6 @@
   color: #E53935;
 }
 
-/* 滑动切换容器 */
-.view-swiper {
-  height: calc(100vh - 380rpx);
-  width: 100%;
-}
-.swiper-scroll {
-  height: 100%;
-}
-
 /* 隐藏空列表 */
 .hidden-list {
   display: none !important;

+ 48 - 86
src/pages/rank/rank.vue

@@ -41,74 +41,55 @@
           </view>
         </view>
 
-        <!-- 滑动切换容器 -->
-        <swiper 
-          class="view-swiper"
-          :current="swiperIndex"
-          @change="onSwiperChange"
-          :duration="200"
-        >
-          <!-- 热力图视图 -->
-          <swiper-item>
-            <scroll-view scroll-y class="swiper-scroll">
-              <view v-if="myStocks.length > 0" class="stock-list">
-                <stock-list-item 
-                  v-for="(stock, index) in myStocks" 
-                  :key="stock.code"
-                  :stock="stock"
-                  :show-delete="true"
-                  @delete="removeStock(index)"
-                  @click="handleStockClick(stock, index)"
-                />
-              </view>
-              <view v-else class="empty-content">
-                <view class="empty-icon">📊</view>
-                <text class="empty-text">暂无收藏股票</text>
-                <text class="empty-desc">在强势池中点击"+"按钮添加股票</text>
-              </view>
-            </scroll-view>
-          </swiper-item>
-          
-          <!-- 详情表格视图 -->
-          <swiper-item>
-            <scroll-view scroll-y class="swiper-scroll">
-              <view v-if="myStocks.length > 0" class="stock-table">
-                <!-- 表头 -->
-                <view class="table-header">
-                  <text class="th-name">股票</text>
-                  <text class="th-date">自选日</text>
-                  <text class="th-price">自选价</text>
-                  <text class="th-profit">自选收益</text>
-                </view>
-                <!-- 表格内容 -->
-                <view 
-                  v-for="(stock, index) in myStocks" 
-                  :key="stock.code"
-                  class="table-row"
-                  @click="handleStockClick(stock, index)"
-                >
-                  <view class="td-name">
-                    <text class="stock-name">{{ stock.name }}</text>
-                    <view class="stock-code-row">
-                      <text :class="['stock-tag', getMarketClass(stock.code)]">{{ getMarketTag(stock.code) }}</text>
-                      <text class="stock-code">{{ stock.code }}</text>
-                    </view>
-                  </view>
-                  <text class="td-date">{{ stock.addDate || '--' }}</text>
-                  <text class="td-price">{{ formatPrice(stock.addPrice) }}</text>
-                  <text :class="['td-profit', getProfitClass(stock.profitPercent)]">
-                    {{ stock.profitPercent || '--' }}
-                  </text>
-                </view>
-              </view>
-              <view v-else class="empty-content">
-                <view class="empty-icon">📊</view>
-                <text class="empty-text">暂无收藏股票</text>
-                <text class="empty-desc">在强势池中点击"+"按钮添加股票</text>
+        <!-- 热力图视图 -->
+        <view v-show="viewMode === 'list'" class="stock-list" :class="{ 'hidden-list': myStocks.length === 0 }">
+          <stock-list-item 
+            v-for="(stock, index) in myStocks" 
+            :key="stock.code"
+            :stock="stock"
+            :show-delete="true"
+            @delete="removeStock(index)"
+            @click="handleStockClick(stock, index)"
+          />
+        </view>
+
+        <!-- 详情表格视图 -->
+        <view v-show="viewMode === 'table'" class="stock-table" :class="{ 'hidden-list': myStocks.length === 0 }">
+          <!-- 表头 -->
+          <view class="table-header">
+            <text class="th-name">股票</text>
+            <text class="th-date">自选日</text>
+            <text class="th-price">自选价</text>
+            <text class="th-profit">自选收益</text>
+          </view>
+          <!-- 表格内容 -->
+          <view 
+            v-for="(stock, index) in myStocks" 
+            :key="stock.code"
+            class="table-row"
+            @click="handleStockClick(stock, index)"
+          >
+            <view class="td-name">
+              <text class="stock-name">{{ stock.name }}</text>
+              <view class="stock-code-row">
+                <text :class="['stock-tag', getMarketClass(stock.code)]">{{ getMarketTag(stock.code) }}</text>
+                <text class="stock-code">{{ stock.code }}</text>
               </view>
-            </scroll-view>
-          </swiper-item>
-        </swiper>
+            </view>
+            <text class="td-date">{{ stock.addDate || '--' }}</text>
+            <text class="td-price">{{ formatPrice(stock.addPrice) }}</text>
+            <text :class="['td-profit', getProfitClass(stock.profitPercent)]">
+              {{ stock.profitPercent || '--' }}
+            </text>
+          </view>
+        </view>
+
+        <!-- 空状态 -->
+        <view v-if="myStocks.length === 0" class="empty-content">
+          <view class="empty-icon">📊</view>
+          <text class="empty-text">暂无收藏股票</text>
+          <text class="empty-desc">在强势池中点击"+"按钮添加股票</text>
+        </view>
 
         <!-- 底部安全区域 -->
         <view class="bottom-safe-area"></view>
@@ -139,7 +120,6 @@ import StockListItem from '../../components/StockListItem.vue'
 const isLoggedIn = ref(false)
 const myStocks = ref([])
 const viewMode = ref('list') // 'list' 或 'table'
-const swiperIndex = ref(0) // swiper当前索引
 const isLoading = ref(false) // 加载状态
 const lastLoadTime = ref(0) // 上次加载时间
 const CACHE_DURATION = 5000 // 缓存有效期5秒
@@ -147,14 +127,6 @@ const CACHE_DURATION = 5000 // 缓存有效期5秒
 // 设置视图模式
 const setViewMode = (mode) => {
   viewMode.value = mode
-  swiperIndex.value = mode === 'list' ? 0 : 1
-}
-
-// swiper滑动切换
-const onSwiperChange = (e) => {
-  const index = e.detail.current
-  swiperIndex.value = index
-  viewMode.value = index === 0 ? 'list' : 'table'
 }
 
 const indexData = ref({
@@ -606,16 +578,6 @@ onUnload(() => {
   color: #E53935;
 }
 
-/* 滑动切换容器 */
-.view-swiper {
-  height: calc(100vh - 380rpx);
-  width: 100%;
-}
-
-.swiper-scroll {
-  height: 100%;
-}
-
 /* 隐藏空列表 */
 .hidden-list {
   display: none !important;

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott