From 6b019592ce032937fd6d3631a912fa8cd37e9fe4 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Thu, 07 Aug 2025 14:56:31 +0800
Subject: [PATCH] 1

---
 src/components/tabHead.vue |   51 +++++++++++++++++++++++++++------------------------
 1 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/src/components/tabHead.vue b/src/components/tabHead.vue
index 0e845bd..58b3022 100644
--- a/src/components/tabHead.vue
+++ b/src/components/tabHead.vue
@@ -16,35 +16,20 @@
       <slot></slot>
     </div>
     <!-- 搜索弹窗 -->
-    <van-popup
-      v-model="searchShow"
-      round
-      position="bottom"
-      :style="{ height: '80%' }"
-    >
+    <van-popup v-model="searchShow" round position="bottom" :style="{ height: '80%' }">
       <div class="popup_head">
         <van-icon name="arrow-left" size=".5em" @click="searchShow = false" />
         <div class="popup_input">
-          <van-field
-            v-model="searchValue"
-            :placeholder="$t('hj37')"
-            left-icon="search"
-            clearable
-          />
+          <van-field v-model="searchValue" :placeholder="$t('hj37')" left-icon="search" clearable />
         </div>
         <van-button type="primary" round @click="submit">{{
           $t("Search")
         }}</van-button>
       </div>
 
-      <van-list
-        v-model="loading"
-        :finished="finished"
-        :finished-text="$t('hj43')"
-        @load="onLoad"
-        v-if="(lists && lists.length > 0) || !finished"
-      >
-        <van-cell v-for="item in lists" :key="item.id">
+      <van-list v-model="loading" :finished="finished" :finished-text="$t('hj43')" @load="onLoad"
+        v-if="(lists && lists.length > 0) || !finished">
+        <van-cell v-for="item in lists" :key="item.id" @click="toDetails(item)">
           <div class="search_item">
             <div class="search_item_left">
               <div class="search_item_left_name">{{ item.name }}</div>
@@ -108,12 +93,12 @@
     this.getInfoSite();
   },
   methods: {
+    // 跳转客服页面
     aRouter1() {
-      // 跳转客服页面
       window.open(this.onlineService);
     },
+    // 获取客服地址
     async getInfoSite() {
-      // 获取客服地址
       let data = await api.getInfoSite();
       if (data.status === 0) {
         this.onlineService = data.data.onlineService;
@@ -129,7 +114,7 @@
       // 跳转设置页面
       this.$router.push("/setting");
     },
-    onLoad: handleDt.throttle(async function(a, b) {
+    onLoad: handleDt.throttle(async function (a, b) {
       // 搜索列表加载
       this.finished = false;
       let opt = {
@@ -146,6 +131,8 @@
 
       if (data.status === 0 && data.data.list) {
         this.lists = [...this.lists, ...data.data.list];
+      } else if (data.status != 0) {
+        this.finished = true;
       }
 
       if (data.data.list && data.data.list.length <= 0) {
@@ -165,7 +152,23 @@
       // 提交搜索
       this.init();
       this.onLoad();
-    }
+    },
+    // 点击进入详情
+    toDetails(item) {
+      const obj = {
+        pid: item.code || "",
+        type: item.stock_type || ""
+      };
+      window.localStorage.setItem("kLine", JSON.stringify(obj));
+
+      this.$router.push({
+        path: "/kline",
+        query: {
+          code: item.code,
+          type: item.stock_type
+        }
+      });
+    },
   }
 };
 </script>

--
Gitblit v1.9.3