fix(api): 替换所有接口请求的域名为 guilixu-api.websoft.top

- 将获取 STS Token 的接口地址由 paopao-api 改为 guilixu-api
- 更新图片上传接口地址为新的 guilixu-api 域名
- 修改用户推广页面中邀请码链接和二维码接口的域名
- 更改注册页微信登录接口请求的域名为 guilixu-api
This commit is contained in:
2026-06-16 17:15:59 +08:00
commit f3886664f7
617 changed files with 77059 additions and 0 deletions

131
src/pages/list.tsx Normal file
View File

@@ -0,0 +1,131 @@
import React, { useState, useEffect } from 'react'
import { View, Text, ScrollView, Image } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { listShopStore } from '@/api/shop/shopStore'
import type { ShopStore } from '@/api/shop/shopStore/model'
import EmptyState from '@/components/common/EmptyState'
import { useScrollHeight } from '@/hooks/useScrollHeight'
definePageConfig({
navigationBarTitleText: '门店列表',
})
const StoreListPage: React.FC = () => {
const [stores, setStores] = useState<ShopStore[]>([])
const [loading, setLoading] = useState(true)
const scrollHeight = useScrollHeight(44)
useEffect(() => {
fetchStores()
}, [])
const fetchStores = async () => {
try {
const data = await listShopStore({ status: 1 })
setStores(data || [])
} catch (e) {
console.error('获取门店列表失败:', e)
} finally {
setLoading(false)
}
}
const handleCallStore = (phone: string) => {
Taro.makePhoneCall({
phoneNumber: phone,
fail: () => {
Taro.showToast({ title: '拨打失败', icon: 'none' })
},
})
}
const handleOpenMap = (store: ShopStore) => {
if (store.latitude && store.longitude) {
Taro.openLocation({
latitude: parseFloat(store.latitude),
longitude: parseFloat(store.longitude),
name: store.name || '',
address: store.address || '',
})
} else {
Taro.showToast({ title: '暂无位置信息', icon: 'none' })
}
}
const handleBooking = (storeId: number) => {
Taro.navigateTo({ url: `/pages/store/booking?storeId=${storeId}` })
}
return (
<View className='min-h-screen bg-gray-50'>
<ScrollView scrollY style={{ height: scrollHeight }}>
{loading ? (
<View className='flex items-center justify-center py-10'>
<Text className='text-gray-400'>...</Text>
</View>
) : stores.length === 0 ? (
<EmptyState text='暂无门店' />
) : (
<View className='p-3'>
{stores.map(store => (
<View key={store.id} className='bg-white rounded-lg p-3 mb-3'>
<View className='flex justify-between items-start mb-2'>
<Text className='text-base font-medium text-gray-800 flex-1'>
{store.name}
</Text>
{store.distance && (
<Text className='text-xs text-gray-400 ml-2'>
{store.distance < 1
? `${Math.round(store.distance * 1000)}m`
: `${store.distance.toFixed(1)}km`}
</Text>
)}
</View>
<View className='flex items-center mb-1'>
<Text className='text-xs text-gray-400 mr-2'>📍</Text>
<Text className='text-xs text-gray-600 flex-1'>
{store.address}
</Text>
</View>
{store.businessHours && (
<View className='flex items-center mb-2'>
<Text className='text-xs text-gray-400 mr-2'>🕐</Text>
<Text className='text-xs text-gray-600'>
{store.businessHours}
</Text>
</View>
)}
<View className='flex gap-2 mt-2'>
<View
className='flex-1 py-2 bg-blue-50 rounded-lg text-center'
onClick={() => handleCallStore(store.phone || '')}
>
<Text className='text-xs text-blue-500'>📞 </Text>
</View>
<View
className='flex-1 py-2 bg-green-50 rounded-lg text-center'
onClick={() => handleOpenMap(store)}
>
<Text className='text-xs text-green-500'>📍 </Text>
</View>
<View
className='flex-1 py-2 bg-orange-50 rounded-lg text-center'
onClick={() => handleBooking(store.id!)}
>
<Text className='text-xs text-orange-500'>📅 </Text>
</View>
</View>
</View>
))}
</View>
)}
</ScrollView>
</View>
)
}
export default StoreListPage