refactor(shop): 更新 API调用和页面逻辑

- 修改了多个文件中的 API调用路径
- 优化了部分组件的显示逻辑
- 添加了优惠券相关功能
-调整了环境变量配置
This commit is contained in:
2025-08-14 01:06:44 +08:00
parent 89cadc3886
commit 2c864ce770
12 changed files with 138 additions and 89 deletions

View File

@@ -237,8 +237,7 @@ function UserCard() {
<span className={'text-sm text-gray-500'}></span>
<span className={'text-xl'}>{giftCount}</span>
</div>
<div className={'item flex justify-center flex-col items-center'}
onClick={() => navTo('/user/points/points', true)}>
<div className={'item flex justify-center flex-col items-center'}>
<span className={'text-sm text-gray-500'}></span>
<span className={'text-xl'}>{pointsCount}</span>
</div>

View File

@@ -1,6 +1,7 @@
import {Cell} from '@nutui/nutui-react-taro'
import navTo from "@/utils/common";
import Taro from '@tarojs/taro'
import {View,Text} from '@tarojs/components'
import {ArrowRight, ShieldCheck, LogisticsError, Location, Reward, Tips, Ask} from '@nutui/icons-react-taro'
const UserCell = () => {
@@ -25,25 +26,25 @@ const UserCell = () => {
return (
<>
<div className={'px-4'}>
<View className={'px-4'}>
<Cell
className="nutui-cell-clickable"
style={{
backgroundImage: 'linear-gradient(to right bottom, #54a799, #177b73)',
}}
title={
<div style={{display: 'inline-flex', alignItems: 'center'}} onClick={() => navTo('/dealer/index', true)}>
<View style={{display: 'inline-flex', alignItems: 'center'}} onClick={() => navTo('/dealer/index', true)}>
<Reward className={'text-orange-100 '} size={16}/>
<span style={{fontSize: '16px'}} className={'pl-3 text-orange-100 font-medium'}></span>
<span className={'text-white opacity-80 pl-3'}></span>
</div>
<Text style={{fontSize: '16px'}} className={'pl-3 text-orange-100 font-medium'}></Text>
<Text className={'text-white opacity-80 pl-3'}></Text>
</View>
}
extra={<ArrowRight color="#cccccc" size={18}/>}
/>
<Cell.Group divider={true} description={
<div style={{display: 'inline-flex', alignItems: 'center'}}>
<span style={{marginTop: '12px'}}></span>
</div>
<View style={{display: 'inline-flex', alignItems: 'center'}}>
<Text style={{marginTop: '12px'}}></Text>
</View>
}>
<Cell
className="nutui-cell-clickable"
@@ -51,10 +52,10 @@ const UserCell = () => {
display: 'none'
}}
title={
<div style={{display: 'inline-flex', alignItems: 'center'}}>
<View style={{display: 'inline-flex', alignItems: 'center'}}>
<LogisticsError size={16}/>
<span className={'pl-3 text-sm'}></span>
</div>
<Text className={'pl-3 text-sm'}></Text>
</View>
}
align="center"
extra={<ArrowRight color="#cccccc" size={18}/>}
@@ -65,10 +66,10 @@ const UserCell = () => {
<Cell
className="nutui-cell-clickable"
title={
<div style={{display: 'inline-flex', alignItems: 'center'}}>
<View style={{display: 'inline-flex', alignItems: 'center'}}>
<Location size={16}/>
<span className={'pl-3 text-sm'}></span>
</div>
<Text className={'pl-3 text-sm'}></Text>
</View>
}
align="center"
extra={<ArrowRight color="#cccccc" size={18}/>}
@@ -79,10 +80,10 @@ const UserCell = () => {
<Cell
className="nutui-cell-clickable"
title={
<div style={{display: 'inline-flex', alignItems: 'center'}}>
<View style={{display: 'inline-flex', alignItems: 'center'}}>
<ShieldCheck size={16}/>
<span className={'pl-3 text-sm'}></span>
</div>
<Text className={'pl-3 text-sm'}></Text>
</View>
}
align="center"
extra={<ArrowRight color="#cccccc" size={18}/>}
@@ -93,10 +94,10 @@ const UserCell = () => {
<Cell
className="nutui-cell-clickable"
title={
<div style={{display: 'inline-flex', alignItems: 'center'}}>
<View style={{display: 'inline-flex', alignItems: 'center'}}>
<Ask size={16}/>
<span className={'pl-3 text-sm'}></span>
</div>
<Text className={'pl-3 text-sm'}></Text>
</View>
}
align="center"
extra={<ArrowRight color="#cccccc" size={18}/>}
@@ -107,10 +108,10 @@ const UserCell = () => {
<Cell
className="nutui-cell-clickable"
title={
<div style={{display: 'inline-flex', alignItems: 'center'}}>
<View style={{display: 'inline-flex', alignItems: 'center'}}>
<Tips size={16}/>
<span className={'pl-3 text-sm'}></span>
</div>
<Text className={'pl-3 text-sm'}></Text>
</View>
}
align="center"
extra={<ArrowRight color="#cccccc" size={18}/>}
@@ -120,9 +121,9 @@ const UserCell = () => {
/>
</Cell.Group>
<Cell.Group divider={true} description={
<div style={{display: 'inline-flex', alignItems: 'center'}}>
<span style={{marginTop: '12px'}}></span>
</div>
<View style={{display: 'inline-flex', alignItems: 'center'}}>
<Text style={{marginTop: '12px'}}></Text>
</View>
}>
<Cell
className="nutui-cell-clickable"
@@ -139,7 +140,7 @@ const UserCell = () => {
onClick={onLogout}
/>
</Cell.Group>
</div>
</View>
</>
)
}