|
|
@@ -2,7 +2,7 @@ import { useState } from 'react'
|
|
|
import { View, Text, ScrollView, Swiper, SwiperItem, Image } from '@tarojs/components'
|
|
|
import Taro from '@tarojs/taro'
|
|
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
|
|
-import { advertisementClient, wechatCouponStockClient } from '@/api'
|
|
|
+import { publicAdvertisementClient, wechatCouponStockClient } from '@/api'
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
import { Card, CardContent, CardHeader } from '@/components/ui/card'
|
|
|
import { cn } from '@/utils/cn'
|
|
|
@@ -42,11 +42,11 @@ export default function IndexPage() {
|
|
|
const { data: advertisements, isLoading: adsLoading } = useQuery({
|
|
|
queryKey: ['advertisements'],
|
|
|
queryFn: async () => {
|
|
|
- const response = await advertisementClient.$get({
|
|
|
+ const response = await publicAdvertisementClient.$get({
|
|
|
query: {
|
|
|
page: 1,
|
|
|
pageSize: 10,
|
|
|
- filters: JSON.stringify({ status: 1 }),
|
|
|
+ filters: JSON.stringify({ isEnabled: 1 }),
|
|
|
},
|
|
|
})
|
|
|
if (response.status !== 200) throw new Error('获取广告失败')
|