|
|
@@ -12,7 +12,7 @@ import { useAuth } from '@/utils/auth'
|
|
|
import { useCart } from '@/contexts/CartContext'
|
|
|
import { Navbar } from '@/components/ui/navbar'
|
|
|
import { Carousel } from '@/components/ui/carousel'
|
|
|
-import Taro, { usePullDownRefresh, useReachBottom } from '@tarojs/taro'
|
|
|
+import Taro, { usePullDownRefresh, useReachBottom, useShareAppMessage } from '@tarojs/taro'
|
|
|
|
|
|
type GoodsResponse = InferResponseType<typeof goodsClient.$get, 200>
|
|
|
type Goods = GoodsResponse['data'][0]
|
|
|
@@ -161,6 +161,15 @@ const HomePage: React.FC = () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+ // 分享功能
|
|
|
+ useShareAppMessage(() => {
|
|
|
+ return {
|
|
|
+ title: '发现好物 - 精选商品推荐',
|
|
|
+ path: '/pages/index/index',
|
|
|
+ imageUrl: finalImgSrcs && finalImgSrcs.length > 0 ? finalImgSrcs[0].imageFile?.fullUrl : undefined
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
// // 商品点击
|
|
|
// const handleGoodsClick = (goods: GoodsData, index: number) => {
|
|
|
// console.log('点击商品:', goods, index)
|