feat(user): 新增收货地址管理及售后申请页面
- 新增地址类型定义,增强前端地址数据结构 - 新增地址编辑页面,支持地址智能识别和定位选点功能 - 地址编辑支持省市区选择及默认地址设置 - 新增地址列表页面,支持地址展示、删除、编辑和选择功能 - 实现售后申请页面,支持选择售后类型和退款原因 - 售后申请支持商品选择、退款金额计算和凭证上传 - 新增售后详情页面,支持售后状态展示及申请取消 - 优化页面加载和用户交互体验,增加错误提示和权限处理
This commit is contained in:
136
src_bak/pages/user/benefit-packages/index.scss
Normal file
136
src_bak/pages/user/benefit-packages/index.scss
Normal file
@@ -0,0 +1,136 @@
|
||||
.benefit-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.top-banner {
|
||||
position: relative;
|
||||
background: linear-gradient(135deg, #ff6b35 0%, #ff9a56 100%);
|
||||
padding: 32rpx 32rpx 40rpx;
|
||||
}
|
||||
|
||||
.banner-title {
|
||||
display: block;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.banner-sub {
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
color: rgba(255,255,255,0.85);
|
||||
}
|
||||
|
||||
.history-link {
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 24rpx;
|
||||
color: rgba(255,255,255,0.9);
|
||||
}
|
||||
|
||||
.pkg-list {
|
||||
flex: 1;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.pkg-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 24rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pkg-cover {
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pkg-body {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.pkg-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.pkg-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.pkg-tag {
|
||||
font-size: 20rpx;
|
||||
color: #ff6b35;
|
||||
background: rgba(255, 107, 53, 0.1);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.pkg-desc {
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.pkg-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.pkg-cost {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.cost-points {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #ff6b35;
|
||||
}
|
||||
|
||||
.cost-balance {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #ff6b35;
|
||||
}
|
||||
|
||||
.cost-free {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #07c160;
|
||||
}
|
||||
|
||||
.pkg-stock {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.exchange-btn {
|
||||
padding: 16rpx 32rpx;
|
||||
background: linear-gradient(135deg, #ff6b35 0%, #ff9a56 100%);
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
.exchange-btn.disabled {
|
||||
background: #ccc;
|
||||
}
|
||||
97
src_bak/pages/user/benefit-packages/index.tsx
Normal file
97
src_bak/pages/user/benefit-packages/index.tsx
Normal file
@@ -0,0 +1,97 @@
|
||||
import { View, Text, Image, ScrollView } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { getBenefitPackageList } from '@/api/shop/shopMemberBenefit';
|
||||
import EmptyState from '@/components/common/EmptyState';
|
||||
import './index.scss';
|
||||
|
||||
definePageConfig({
|
||||
navigationBarTitleText: '会员权益包',
|
||||
});
|
||||
|
||||
export default function BenefitPackagesPage() {
|
||||
const [list, setList] = useState<any[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
loadList();
|
||||
}, []);
|
||||
|
||||
const loadList = async () => {
|
||||
try {
|
||||
const res = await getBenefitPackageList();
|
||||
if (res.code === 200) setList(res.data || []);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleExchange = (pkg: any) => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/user/benefit-exchange-confirm/index?id=${pkg.id}`,
|
||||
});
|
||||
};
|
||||
|
||||
const handleHistory = () => {
|
||||
Taro.navigateTo({ url: '/pages/user/benefit-exchange-list/index' });
|
||||
};
|
||||
|
||||
return (
|
||||
<View className="benefit-page">
|
||||
{/* 顶部提示 */}
|
||||
<View className="top-banner">
|
||||
<Text className="banner-title">专属会员权益</Text>
|
||||
<Text className="banner-sub">成为会员,即可申请兑换以下权益包</Text>
|
||||
<Text className="history-link" onClick={handleHistory}>
|
||||
兑换记录 >
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<ScrollView className="pkg-list" scrollY>
|
||||
{!loading && list.length === 0 && (
|
||||
<EmptyState description="暂无可用权益包" />
|
||||
)}
|
||||
{list.map((pkg) => (
|
||||
<View key={pkg.id} className="pkg-card">
|
||||
{pkg.coverImage && (
|
||||
<Image className="pkg-cover" src={pkg.coverImage} mode="aspectFill" />
|
||||
)}
|
||||
<View className="pkg-body">
|
||||
<View className="pkg-header">
|
||||
<Text className="pkg-name">{pkg.name}</Text>
|
||||
{pkg.tag && <Text className="pkg-tag">{pkg.tag}</Text>}
|
||||
</View>
|
||||
{pkg.description && (
|
||||
<Text className="pkg-desc">{pkg.description}</Text>
|
||||
)}
|
||||
<View className="pkg-footer">
|
||||
<View className="pkg-cost">
|
||||
{pkg.pointsCost > 0 && (
|
||||
<Text className="cost-points">{pkg.pointsCost}积分</Text>
|
||||
)}
|
||||
{pkg.balanceCost > 0 && (
|
||||
<Text className="cost-balance">¥{pkg.balanceCost}</Text>
|
||||
)}
|
||||
{pkg.pointsCost === 0 && pkg.balanceCost === 0 && (
|
||||
<Text className="cost-free">免费</Text>
|
||||
)}
|
||||
</View>
|
||||
<View className="pkg-stock">
|
||||
{pkg.stock === -1
|
||||
? '不限库存'
|
||||
: `剩余 ${pkg.stock} 件`}
|
||||
</View>
|
||||
<View
|
||||
className={`exchange-btn ${pkg.stock === 0 ? 'disabled' : ''}`}
|
||||
onClick={() => pkg.stock !== 0 && handleExchange(pkg)}
|
||||
>
|
||||
{pkg.stock === 0 ? '已兑完' : '立即兑换'}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user