小程序转发
All checks were successful
Deploy to Server / deploy (push) Successful in 24s

This commit is contained in:
jeremygan2021
2026-02-17 11:07:16 +08:00
parent eb3655acd1
commit 321c57bee2
8 changed files with 121 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
import { View, Text, Image, ScrollView, Button } from '@tarojs/components'
import Taro, { useRouter, useLoad } from '@tarojs/taro'
import Taro, { useRouter, useLoad, useShareAppMessage, useShareTimeline } from '@tarojs/taro'
import { useState } from 'react'
import { getConfigDetail } from '../../api'
import ParticleBackground from '../../components/ParticleBackground'
@@ -28,6 +28,22 @@ export default function Detail() {
}
}
useShareAppMessage(() => {
return {
title: product?.name || '商品详情',
path: `/pages/goods/detail?id=${product?.id}`,
imageUrl: product?.static_image_url
}
})
useShareTimeline(() => {
return {
title: product?.name || '商品详情',
query: `id=${product?.id}`,
imageUrl: product?.static_image_url
}
})
const handleAddToCart = () => {
if (!product) return
addToCart(product)