fix(api): 替换所有接口请求的域名为 guilixu-api.websoft.top
- 将获取 STS Token 的接口地址由 paopao-api 改为 guilixu-api - 更新图片上传接口地址为新的 guilixu-api 域名 - 修改用户推广页面中邀请码链接和二维码接口的域名 - 更改注册页微信登录接口请求的域名为 guilixu-api
This commit is contained in:
@@ -14,6 +14,8 @@ import SkuSelector from '@/components/business/SkuSelector'
|
||||
import { useCartContext } from '@/contexts/CartContext'
|
||||
import { useUserContext } from '@/contexts/UserContext'
|
||||
import { useScrollHeight } from '@/hooks/useScrollHeight'
|
||||
import { isGuest } from '@/utils/auth'
|
||||
import { requireLogin } from '@/utils/login-guard'
|
||||
|
||||
definePageConfig({
|
||||
navigationBarTitleText: '商品详情',
|
||||
@@ -71,13 +73,7 @@ const ProductDetailPage: React.FC = () => {
|
||||
}
|
||||
|
||||
const toggleFavorite = async () => {
|
||||
if (!isLoggedIn) {
|
||||
Taro.showToast({ title: '请先登录', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
Taro.navigateTo({ url: '/pages/passport/login' })
|
||||
}, 1500)
|
||||
return
|
||||
}
|
||||
if (!requireLogin({ action: 'favorite', redirect: `/pages/shop/product-detail?id=${id}` })) return
|
||||
try {
|
||||
if (isFavorite) {
|
||||
await removeShopGoodsFavorite({ goodsId: id })
|
||||
@@ -121,25 +117,13 @@ const ProductDetailPage: React.FC = () => {
|
||||
}
|
||||
|
||||
const handleAddCart = () => {
|
||||
if (!isLoggedIn) {
|
||||
Taro.showToast({ title: '请先登录', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
Taro.navigateTo({ url: '/pages/passport/login' })
|
||||
}, 1500)
|
||||
return
|
||||
}
|
||||
if (!requireLogin({ action: 'addToCart', redirect: `/pages/shop/product-detail?id=${id}` })) return
|
||||
setSkuMode('cart')
|
||||
setSkuVisible(true)
|
||||
}
|
||||
|
||||
const handleBuyNow = () => {
|
||||
if (!isLoggedIn) {
|
||||
Taro.showToast({ title: '请先登录', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
Taro.navigateTo({ url: '/pages/passport/login' })
|
||||
}, 1500)
|
||||
return
|
||||
}
|
||||
if (!requireLogin({ action: 'buyNow', redirect: `/pages/shop/product-detail?id=${id}` })) return
|
||||
setSkuMode('buy')
|
||||
setSkuVisible(true)
|
||||
}
|
||||
@@ -238,14 +222,14 @@ const ProductDetailPage: React.FC = () => {
|
||||
{/* 价格区域 */}
|
||||
<View className='bg-white p-4'>
|
||||
<View className='flex items-baseline gap-2'>
|
||||
<Price price={product.price || '0'} size='large' color='#ee0a24' />
|
||||
<Price price={product.price || '0'} size='large' color='#ee0a24' loginMask />
|
||||
<Tag>到手价</Tag>
|
||||
{product.salePrice && product.salePrice !== product.price && (
|
||||
{!isGuest() && product.salePrice && product.salePrice !== product.price && (
|
||||
<Text className='text-xs text-gray-400 ml-2'>¥{product.salePrice}</Text>
|
||||
)}
|
||||
</View>
|
||||
{/* 会员价 */}
|
||||
{product.memberStorePrice && product.memberStorePrice !== product.price && (
|
||||
{!isGuest() && product.memberStorePrice && product.memberStorePrice !== product.price && (
|
||||
<View className='mt-2 inline-block bg-orange-50 rounded px-2 py-1'>
|
||||
<Text className='text-xs text-orange-500'>会员价: ¥{product.memberStorePrice}</Text>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user