尾部导航
This commit is contained in:
@ -119,7 +119,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive } from "vue";
|
||||
// TODO:成果搜索添加按成果介绍搜索,需求搜索添加按需求描述搜索,添加实验室搜索
|
||||
import { onMounted, reactive, watch } from "vue";
|
||||
import { banner } from "@/api/website/home/index";
|
||||
import { useRouter } from "vue-router";
|
||||
import { getAllCount } from "../../../../api/website/home";
|
||||
@ -135,7 +136,7 @@ const router = useRouter();
|
||||
const queryParams = reactive({
|
||||
queryType: undefined,
|
||||
keyword: "",
|
||||
queryType: "1",
|
||||
queryType: "2",
|
||||
});
|
||||
const queryRules = reactive({
|
||||
queryType: [{ required: true, trigger: "change", message: "请选择搜索类型" }],
|
||||
@ -148,7 +149,7 @@ const searchTypeList = ref([
|
||||
"lab",
|
||||
"patent",
|
||||
"expert",
|
||||
"serviceDemand",
|
||||
// "serviceDemand",
|
||||
"technologyDemand",
|
||||
]);
|
||||
// const patentQueryTypeList = ;
|
||||
@ -179,13 +180,9 @@ const queryTypeList = [
|
||||
{ value: "3", label: "通过关键词搜索" },
|
||||
],
|
||||
[{ value: "1", label: "通过标题搜索" }],
|
||||
[{ value: "1", label: "通过标题搜索" }],
|
||||
// [{ value: "1", label: "通过标题搜索" }],
|
||||
];
|
||||
const switchTab = (index) => {
|
||||
state.tabIndex = index;
|
||||
// queryParams.queryType = undefined
|
||||
queryRef.value.resetFields("queryType");
|
||||
};
|
||||
|
||||
const handleDetail = async (mode, keyword, queryType) => {
|
||||
await queryRef.value.validate();
|
||||
const routeData = router.resolve({
|
||||
@ -213,8 +210,8 @@ const state = reactive({
|
||||
"找实验室",
|
||||
"找专利",
|
||||
"找专家",
|
||||
"接服务需求",
|
||||
"接技术需求",
|
||||
// "接服务需求",
|
||||
"接需求",
|
||||
],
|
||||
tabIndex: 0,
|
||||
banner: "",
|
||||
@ -228,6 +225,22 @@ const state = reactive({
|
||||
},
|
||||
});
|
||||
|
||||
const switchTab = (index) => {
|
||||
state.tabIndex = index;
|
||||
// queryParams.queryType = undefined
|
||||
// if(index)
|
||||
queryRef.value.resetFields("queryType");
|
||||
};
|
||||
|
||||
watch(
|
||||
() => state.tabIndex,
|
||||
(val) => {
|
||||
console.log(val);
|
||||
// return [2, 0][val];
|
||||
queryParams.queryType = ["2", "1", "0", "2", "2", "1"][val];
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
onMounted(() => {
|
||||
banner({ locals: "首页背景" }).then((resp) => {
|
||||
// console.log(resp);
|
||||
|
Reference in New Issue
Block a user