save
This commit is contained in:
parent
27b4623500
commit
bbfd1284e9
|
@ -4,9 +4,10 @@ import { RiTimeLine } from 'oh-vue-icons/icons'
|
|||
import { addIcons, OhVueIcon } from 'oh-vue-icons'
|
||||
import { IoCloseCircleOutline, RiCloseCircleLine } from 'oh-vue-icons/icons'
|
||||
import dayjs from 'dayjs'
|
||||
import useDiscountStore from './useDiscountStore'
|
||||
addIcons(RiTimeLine, IoCloseCircleOutline, RiCloseCircleLine)
|
||||
export default defineComponent(() => {
|
||||
const store = useGameNews()
|
||||
const store = useDiscountStore()
|
||||
const containerRef = ref<VNodeRef | null>(null as VNodeRef | null)
|
||||
const searchText = ref('')
|
||||
const handleScroll = () => {
|
||||
|
@ -58,7 +59,7 @@ export default defineComponent(() => {
|
|||
class={
|
||||
'flex cursor-pointer h-[215px] overflow-hidden bg-[#17212d] items-center flex-col rounded-lg relative '
|
||||
}
|
||||
onClick={() => {}}
|
||||
onClick={() => { }}
|
||||
key={index}
|
||||
>
|
||||
<img class={'h-[142px] w-full object-cover'} src={item.commdity[0]?.img}></img>
|
||||
|
|
|
@ -23,18 +23,14 @@ export default defineStore("gameDiscount", () => {
|
|||
const loading = ref(false)
|
||||
const noMoreData = ref(false)
|
||||
const state = reactive({
|
||||
pageId: 1,
|
||||
name: '',
|
||||
pageSize: 1,
|
||||
pageIndex: 1,
|
||||
find: ''
|
||||
})
|
||||
const getList = async () => {
|
||||
const res = await request<{
|
||||
data: GameDiscount[];
|
||||
}>('POST', '/api/gameDiscount', {
|
||||
data: {
|
||||
pageId: state.pageId,
|
||||
name: state.name
|
||||
}
|
||||
})
|
||||
}>('GET', `/api/gameDiscount?pageSize=${state.pageSize}&pageIndex=${state.pageIndex}&find=${state.find}`)
|
||||
return res.data
|
||||
}
|
||||
const getNews = async () => {
|
||||
|
@ -47,7 +43,7 @@ export default defineStore("gameDiscount", () => {
|
|||
noMoreData.value = true;
|
||||
} else {
|
||||
list.value.push(...data);
|
||||
state.pageId += 1;
|
||||
state.pageIndex += 1;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
|
Loading…
Reference in New Issue