|
|
@@ -87,7 +87,9 @@ import { getGameType, getGameTag, getGameList } from '@/api/index'
|
|
|
import Message from '@/utils/Message'
|
|
|
import { bytesChange } from '@/utils/bytesFormatter'
|
|
|
import type { DropdownMenuInstance } from 'vant'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
|
|
|
+const route = useRoute()
|
|
|
const img:any = inject('img')
|
|
|
const typeIndex = ref<number>(0)
|
|
|
const tag_idIndex = ref<number>(0)
|
|
|
@@ -121,7 +123,12 @@ onMounted(async() => {
|
|
|
tagArr.value = res.data.data
|
|
|
tagArr.value.unshift({ id: 0, name: '全部' })
|
|
|
})
|
|
|
- getGameLists(params)
|
|
|
+ if (route.query.tag_id) {
|
|
|
+ const id = parseInt(route.query.tag_id as string)
|
|
|
+ selectType('tag_id', id)
|
|
|
+ } else {
|
|
|
+ getGameLists(params)
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
// 初始化列表数据
|
|
|
@@ -142,7 +149,9 @@ const getGameLists = async(params:any) => {
|
|
|
}
|
|
|
const menuRef = ref<DropdownMenuInstance>()
|
|
|
// 点击类型、标签、排序
|
|
|
-const selectType = (type: any, index: any) => {
|
|
|
+const selectType = (type: 'type' | 'tag_id', index: any) => {
|
|
|
+ console.log(index)
|
|
|
+
|
|
|
gameLis.value = []
|
|
|
params.page = 1
|
|
|
|