1
PC-20250623MANY\Administrator
2025-09-28 c264438b92a9ded3aa0796ab6968c70195ecac01
src/components/tabHead.vue
@@ -1,7 +1,7 @@
<template>
  <div class="tab_head">
    <div class="head_left">
      <div class="icon" @click="searchShow = true" v-if="leftShow">
    <div class="head_left flex-center">
      <div class="icon" @click="searchShow = true" v-if="leftShow" style="margin-right:.2666rem;">
        <van-icon name="search" size=".5em" />
      </div>
      <slot name="left"></slot>
@@ -16,19 +16,34 @@
      <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-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">
@@ -57,6 +72,7 @@
<script>
import * as api from "@/axios/api";
import handleDt from "@/utils/deTh";
import { Toast } from "vant";
export default {
  name: "tabHead",
  data() {
@@ -95,7 +111,8 @@
  methods: {
    // 跳转客服页面
    aRouter1() {
      window.open(this.onlineService);
      // window.open(this.onlineService);
      Toast(this.$t("kf1"));
    },
    // 获取客服地址
    async getInfoSite() {
@@ -114,7 +131,7 @@
      // 跳转设置页面
      this.$router.push("/setting");
    },
    onLoad: handleDt.throttle(async function (a, b) {
    onLoad: handleDt.throttle(async function(a, b) {
      // 搜索列表加载
      this.finished = false;
      let opt = {
@@ -168,7 +185,7 @@
          type: item.stock_type
        }
      });
    },
    }
  }
};
</script>