diff --git a/public/searchIcons/360.png b/public/searchIcons/360.png new file mode 100644 index 0000000..4c40d64 Binary files /dev/null and b/public/searchIcons/360.png differ diff --git a/public/searchIcons/baidu.png b/public/searchIcons/baidu.png new file mode 100644 index 0000000..4915077 Binary files /dev/null and b/public/searchIcons/baidu.png differ diff --git a/public/searchIcons/bing.png b/public/searchIcons/bing.png new file mode 100644 index 0000000..00cde97 Binary files /dev/null and b/public/searchIcons/bing.png differ diff --git a/public/searchIcons/google.png b/public/searchIcons/google.png new file mode 100644 index 0000000..6e67776 Binary files /dev/null and b/public/searchIcons/google.png differ diff --git a/src/layout/adder/AdderPage.tsx b/src/layout/adder/AdderPage.tsx index cb30680..14dc5d5 100644 --- a/src/layout/adder/AdderPage.tsx +++ b/src/layout/adder/AdderPage.tsx @@ -10,14 +10,20 @@ import { import AdderPageBack from './AdderPageBack' import useLayoutStore from '../useLayoutStore' import { OhVueIcon, addIcons } from 'oh-vue-icons' -import { MdKeyboardcommandkey, FaCompass, FaPencilRuler } from 'oh-vue-icons/icons' +import { + MdKeyboardcommandkey, + FaCompass, + FaPencilRuler, + IoGameController +} from 'oh-vue-icons/icons' import CustomAdder from './CustomAdder' import clsx from 'clsx' import ThemeProvider from '@/utils/ThemeProvider' import WidgetAdder from './WidgetAdder' import { Form, Input, Select } from 'ant-design-vue' import HotAdder from './HotAdder' -addIcons(MdKeyboardcommandkey, FaCompass, FaPencilRuler) +import GameAdder from './GameAdder' +addIcons(MdKeyboardcommandkey, FaCompass, FaPencilRuler, IoGameController) const ItemButton = defineComponent({ props: { @@ -118,6 +124,14 @@ export default defineComponent(() => { type.value = 2 }} /> + { + type.value = 3 + }} + />
{ ) : type.value === 1 ? ( - ) : ( + ) : type.value === 2 ? ( + ) : ( + )}
diff --git a/src/layout/adder/GameAdder.tsx b/src/layout/adder/GameAdder.tsx new file mode 100644 index 0000000..f2c712a --- /dev/null +++ b/src/layout/adder/GameAdder.tsx @@ -0,0 +1,211 @@ +import CategoryTab from '@/utils/CategoryTab' +import request from '@/utils/request' +import { computed, defineComponent, inject, onMounted, ref, watch } from 'vue' +import type { BackgroundType } from '../background/BackgroundSwtich' +import clsx from 'clsx' +import useLayoutStore from '../useLayoutStore' +import { AddToToken } from './AdderPage' +import { v4 as uuid } from 'uuid' +import { Button } from 'ant-design-vue' +const URL_ADDRESS = 'http://newfatfox.oss-cn-beijing.aliyuncs.com' +interface GameType { + id: string + name: string + rom: string + playstation: string + hot: number + category: string + despt: string + icon: string +} +export const GameItem = defineComponent({ + props: { + content: { + type: Object as () => GameType, + required: true + } + }, + setup(props) { + const layout = useLayoutStore() + const isGame = computed(() => layout.state.current === 0) + const addTo = inject(AddToToken) + return () => ( +
+
+ + +
+
+ {props.content.name} +
+
+ {props.content.despt} +
+
+
+
+ +
+
+ ) + } +}) + +export default defineComponent(() => { + const layout = useLayoutStore() + const loading = ref(false) + const isGame = computed(() => layout.state.current === 0) + const appList = ref([]) + const selectType = ref('fc') + + watch( + selectType, + (val) => { + loading.value = true + + request('GET', `/api/games?type=${val}`) + .then((res) => { + appList.value = res + }) + .finally(() => { + setTimeout(() => { + loading.value = false + }, 200) + }) + }, + { + immediate: true + } + ) + return () => ( +
+
+ { + selectType.value = e + }} + v-slots={{ + select: (text: string) => ( + + ), + unSelect: (text: string) => ( + + ) + }} + > +
+
+
+ {!loading.value ? ( +
+ {appList.value.map((el) => ( + + ))} +
+ ) : ( +
+ {Array(12) + .fill(0) + .map((el, idx) => ( +
+ ))} +
+ )} +
+
+
+ ) +}) diff --git a/src/layout/adder/HotAdder.tsx b/src/layout/adder/HotAdder.tsx index 860c252..f70d939 100644 --- a/src/layout/adder/HotAdder.tsx +++ b/src/layout/adder/HotAdder.tsx @@ -5,6 +5,7 @@ import type { BackgroundType } from '../background/BackgroundSwtich' import clsx from 'clsx' import useLayoutStore from '../useLayoutStore' import { AddToToken } from './AdderPage' +import { v4 as uuid } from 'uuid' import { Button } from 'ant-design-vue' interface HotAppCategoryType { @@ -34,14 +35,21 @@ export const LinkItem = defineComponent({ const addTo = inject(AddToToken) return () => (
- + +
- +
) @@ -130,7 +163,9 @@ export default defineComponent(() => {