add:新增接口代理

This commit was merged in pull request #7.
This commit is contained in:
zlong committed 2024-12-03 15:33:37 +08:00
1 parent 23cc6b6d35
commit f1eec0ac6d
9 files changed
+306 -4

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
import { get } from '@/api/request'
function getCarousalList() {
return get('https://bright.yilibili.com/api/carousals/active-list')
}
export default {
getCarousalList,
}
View File
Whitespace-only changes.
+9 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import carousalApi from '@/api/carousal'
import CardList from '@/pages/pet-manual/components/CardList.vue'
// const searchValue = ref('')
import bg from '@/static/image/feed-plan/bg.png'
@@ -103,7 +104,7 @@ function handleClickType(item: TypeItem) {
typeList.value.forEach(i => (i.isClick = false))
item.isClick = true
}
const isSearch = ref<boolean>(false)
const isSearch = ref<boolean>(true)
function handleSearchFocus() {
isSearch.value = false
}
@@ -120,6 +121,12 @@ const findList = ref<{ name: string }[]>([
{ name: '宠物吃饭慢' },
{ name: '猫咪尿闭怎么办' },
])
function onLoad() {
carousalApi.getCarousalList().then((res) => {
console.log(res)
})
}
onLoad()
</script>
<template>
@@ -131,7 +138,7 @@ const findList = ref<{ name: string }[]>([
v-model="searchValue"
placeholder="请搜索你想要的内容"
bg-color="white" clear-button="auto"
:cancel-button="isSearch ? 'none' : 'auto'"
:cancel-button="isSearch ? 'none' : 'always'"
:radius="20"
@focus="handleSearchFocus"
@cancel="handleCancel"