refactor(request): 移除旧版请求工具并优化错误处理- 删除了 request-legacy.ts及相关文件
- 更新了所有 API 文件的导入路径 -优化了请求工具的错误处理逻辑 - 移除了冗余的调试信息 - 保留了关键的错误信息
This commit is contained in:
@@ -335,87 +335,6 @@ ${coupon.minPrice ? `最低消费:¥${coupon.minPrice}` : ''}
|
||||
|
||||
return (
|
||||
<ConfigProvider>
|
||||
{/* 搜索栏和功能入口 */}
|
||||
<View className="bg-white px-4 py-3">
|
||||
<View className="flex items-center justify-between gap-3">
|
||||
<View className="flex-1">
|
||||
<SearchBar
|
||||
placeholder="搜索优惠券"
|
||||
value={searchValue}
|
||||
className={'border'}
|
||||
onChange={setSearchValue}
|
||||
onSearch={handleSearch}
|
||||
/>
|
||||
</View>
|
||||
<Button
|
||||
size="small"
|
||||
fill="outline"
|
||||
icon={<Filter />}
|
||||
onClick={() => setShowFilter(true)}
|
||||
>
|
||||
筛选
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
fill="outline"
|
||||
icon={<Board />}
|
||||
onClick={() => setShowGuide(true)}
|
||||
>
|
||||
帮助
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* 热门优惠券轮播 */}
|
||||
{hotCoupons.length > 0 && (
|
||||
<View className="bg-white mb-2">
|
||||
<View className="px-4 py-2 text-sm font-medium text-gray-700">🔥 热门推荐</View>
|
||||
<Swiper
|
||||
height={120}
|
||||
autoPlay
|
||||
loop
|
||||
indicator
|
||||
className="px-4 pb-3"
|
||||
>
|
||||
{hotCoupons.map((coupon, index) => (
|
||||
<SwiperItem key={index}>
|
||||
<View
|
||||
className="bg-gradient-to-r from-red-400 to-pink-500 rounded-lg p-4 text-white mr-4"
|
||||
onClick={() => handleCouponDetail(coupon)}
|
||||
>
|
||||
<View className="flex justify-between items-center">
|
||||
<View>
|
||||
<View className="text-lg font-bold">
|
||||
{coupon.type === 10 ? `¥${coupon.reducePrice}` :
|
||||
coupon.type === 20 ? `${coupon.discount}折` : '免费'}
|
||||
</View>
|
||||
<View className="text-sm opacity-90">
|
||||
{coupon.name}
|
||||
</View>
|
||||
{coupon.minPrice && (
|
||||
<View className="text-xs opacity-80">
|
||||
满¥{coupon.minPrice}可用
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
<Button
|
||||
size="small"
|
||||
className="bg-white text-red-500 border-0"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
handleReceiveCoupon(coupon)
|
||||
}}
|
||||
>
|
||||
立即领取
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
</SwiperItem>
|
||||
))}
|
||||
</Swiper>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* Tab切换 */}
|
||||
<View className="bg-white">
|
||||
<Tabs value={activeTab} onChange={handleTabChange}>
|
||||
|
||||
Reference in New Issue
Block a user