feat(user): 更新用户页面布局和功能配置
- 在用户页面添加导航栏并集成状态栏高度适配 - 修改用户卡片组件的高度设置和隐藏余额积分等显示项 - 更新用户中心菜单项标题和功能跳转逻辑 - 调整经销商申请表单中的邀请人ID输入框启用状态 - 修复登录验证跳转逻辑中的特定页面判断条件 - 更新项目配置文件中的微信小程序应用ID - 移除首页头部的品牌标识和下拉箭头图标显示
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"miniprogramRoot": "dist/",
|
"miniprogramRoot": "dist/",
|
||||||
"projectname": "template-10582",
|
"projectname": "template-10582",
|
||||||
"description": "南南佐顿门窗",
|
"description": "南南佐顿门窗",
|
||||||
"appid": "wx51962d6ac21f2ed2",
|
"appid": "wx644669e2da8d6519",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": true,
|
"urlCheck": true,
|
||||||
"es6": false,
|
"es6": false,
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ const AddUserAddress = () => {
|
|||||||
<View className={'bg-gray-100 h-3'}></View>
|
<View className={'bg-gray-100 h-3'}></View>
|
||||||
<CellGroup style={{padding: '4px 0'}}>
|
<CellGroup style={{padding: '4px 0'}}>
|
||||||
<Form.Item name="refereeId" label="邀请人ID" initialValue={FormData?.refereeId} required>
|
<Form.Item name="refereeId" label="邀请人ID" initialValue={FormData?.refereeId} required>
|
||||||
<Input placeholder="邀请人ID" disabled={true}/>
|
<Input placeholder="邀请人ID"/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="phone" label="手机号" initialValue={FormData?.phone} required>
|
<Form.Item name="phone" label="手机号" initialValue={FormData?.phone} required>
|
||||||
<View className="flex items-center justify-between">
|
<View className="flex items-center justify-between">
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import {Space} from '@nutui/nutui-react-taro'
|
import {Space} from '@nutui/nutui-react-taro'
|
||||||
import {TriangleDown} from '@nutui/icons-react-taro'
|
import {NavBar} from '@nutui/nutui-react-taro'
|
||||||
import {Avatar, NavBar} from '@nutui/nutui-react-taro'
|
|
||||||
import {getWxOpenId} from "@/api/layout";
|
import {getWxOpenId} from "@/api/layout";
|
||||||
// import {TenantId} from "@/config/app";
|
// import {TenantId} from "@/config/app";
|
||||||
import {getOrganization} from "@/api/system/organization";
|
import {getOrganization} from "@/api/system/organization";
|
||||||
@@ -20,7 +19,6 @@ import {getShopDealerRefereeByUserId} from "@/api/shop/shopDealerReferee";
|
|||||||
const Header = (props: any) => {
|
const Header = (props: any) => {
|
||||||
// 使用新的useShopInfo Hook
|
// 使用新的useShopInfo Hook
|
||||||
const {
|
const {
|
||||||
getWebsiteLogo,
|
|
||||||
getWebsiteName
|
getWebsiteName
|
||||||
} = useShopInfo();
|
} = useShopInfo();
|
||||||
|
|
||||||
@@ -260,12 +258,7 @@ const Header = (props: any) => {
|
|||||||
</Space>
|
</Space>
|
||||||
) : (
|
) : (
|
||||||
<View style={{display: 'flex', alignItems: 'center'}}>
|
<View style={{display: 'flex', alignItems: 'center'}}>
|
||||||
<Avatar
|
<Text className={'text-lg'} style={{color: '#ffffff'}}>{getWebsiteName()}</Text>
|
||||||
size="22"
|
|
||||||
src={getWebsiteLogo()}
|
|
||||||
/>
|
|
||||||
<Text className={'text-xs'} style={{color: '#ffffff'}}>{getWebsiteName()}</Text>
|
|
||||||
<TriangleDown size={9} className={'text-white'}/>
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</NavBar>
|
</NavBar>
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ function UserCard() {
|
|||||||
background: 'linear-gradient(to bottom, #ffffff, #ffffff)', // 这种情况建议使用类名来控制样式(引入外联样式)
|
background: 'linear-gradient(to bottom, #ffffff, #ffffff)', // 这种情况建议使用类名来控制样式(引入外联样式)
|
||||||
// width: '720rpx',
|
// width: '720rpx',
|
||||||
// margin: '10px auto 0px auto',
|
// margin: '10px auto 0px auto',
|
||||||
height: '170px',
|
height: '120px',
|
||||||
// borderRadius: '22px 22px 0 0',
|
// borderRadius: '22px 22px 0 0',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -198,27 +198,27 @@ function UserCard() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={'flex justify-around mt-1'}>
|
{/*<View className={'flex justify-around mt-1'}>*/}
|
||||||
<View className={'item flex justify-center flex-col items-center'}
|
{/* <View className={'item flex justify-center flex-col items-center'}*/}
|
||||||
onClick={() => navTo('/user/wallet/wallet', true)}>
|
{/* onClick={() => navTo('/user/wallet/wallet', true)}>*/}
|
||||||
<Text className={'text-sm text-gray-500'}>余额</Text>
|
{/* <Text className={'text-sm text-gray-500'}>余额</Text>*/}
|
||||||
<Text className={'text-xl'}>{data?.balance || '0.00'}</Text>
|
{/* <Text className={'text-xl'}>{data?.balance || '0.00'}</Text>*/}
|
||||||
</View>
|
{/* </View>*/}
|
||||||
<View className={'item flex justify-center flex-col items-center'}>
|
{/* <View className={'item flex justify-center flex-col items-center'}>*/}
|
||||||
<Text className={'text-sm text-gray-500'}>积分</Text>
|
{/* <Text className={'text-sm text-gray-500'}>积分</Text>*/}
|
||||||
<Text className={'text-xl'}>{data?.points || 0}</Text>
|
{/* <Text className={'text-xl'}>{data?.points || 0}</Text>*/}
|
||||||
</View>
|
{/* </View>*/}
|
||||||
<View className={'item flex justify-center flex-col items-center'}
|
{/* <View className={'item flex justify-center flex-col items-center'}*/}
|
||||||
onClick={() => navTo('/user/coupon/index', true)}>
|
{/* onClick={() => navTo('/user/coupon/index', true)}>*/}
|
||||||
<Text className={'text-sm text-gray-500'}>优惠券</Text>
|
{/* <Text className={'text-sm text-gray-500'}>优惠券</Text>*/}
|
||||||
<Text className={'text-xl'}>{data?.coupons || 0}</Text>
|
{/* <Text className={'text-xl'}>{data?.coupons || 0}</Text>*/}
|
||||||
</View>
|
{/* </View>*/}
|
||||||
<View className={'item flex justify-center flex-col items-center'}
|
{/* <View className={'item flex justify-center flex-col items-center'}*/}
|
||||||
onClick={() => navTo('/user/gift/index', true)}>
|
{/* onClick={() => navTo('/user/gift/index', true)}>*/}
|
||||||
<Text className={'text-sm text-gray-500'}>礼品卡</Text>
|
{/* <Text className={'text-sm text-gray-500'}>礼品卡</Text>*/}
|
||||||
<Text className={'text-xl'}>{data?.giftCards || 0}</Text>
|
{/* <Text className={'text-xl'}>{data?.giftCards || 0}</Text>*/}
|
||||||
</View>
|
{/* </View>*/}
|
||||||
</View>
|
{/*</View>*/}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -117,17 +117,17 @@ const UserCell = () => {
|
|||||||
}>
|
}>
|
||||||
<Cell
|
<Cell
|
||||||
className="nutui-cell-clickable"
|
className="nutui-cell-clickable"
|
||||||
title="账号安全"
|
title="个人资料"
|
||||||
align="center"
|
align="center"
|
||||||
extra={<ArrowRight color="#cccccc" size={18}/>}
|
extra={<ArrowRight color="#cccccc" size={18}/>}
|
||||||
onClick={() => navTo('/user/profile/profile', true)}
|
onClick={() => navTo('/user/profile/profile', true)}
|
||||||
/>
|
/>
|
||||||
<Cell
|
<Cell
|
||||||
className="nutui-cell-clickable"
|
className="nutui-cell-clickable"
|
||||||
title="切换主题"
|
title="返回首页"
|
||||||
align="center"
|
align="center"
|
||||||
extra={<ArrowRight color="#cccccc" size={18}/>}
|
extra={<ArrowRight color="#cccccc" size={18}/>}
|
||||||
onClick={() => navTo('/user/theme/index', true)}
|
onClick={() => Taro.reLaunch({url: '/pages/index/index'})}
|
||||||
/>
|
/>
|
||||||
<Cell
|
<Cell
|
||||||
className="nutui-cell-clickable"
|
className="nutui-cell-clickable"
|
||||||
|
|||||||
@@ -1,18 +1,27 @@
|
|||||||
import {useEffect} from 'react'
|
import {useEffect, useState} from 'react'
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
import UserCard from "./components/UserCard";
|
import UserCard from "./components/UserCard";
|
||||||
import UserOrder from "./components/UserOrder";
|
import UserOrder from "./components/UserOrder";
|
||||||
import UserCell from "./components/UserCell";
|
import UserCell from "./components/UserCell";
|
||||||
import UserFooter from "./components/UserFooter";
|
import UserFooter from "./components/UserFooter";
|
||||||
import {useUser} from "@/hooks/useUser";
|
import {useUser} from "@/hooks/useUser";
|
||||||
|
import {NavBar} from '@nutui/nutui-react-taro';
|
||||||
|
import {Home} from '@nutui/icons-react-taro'
|
||||||
import './user.scss'
|
import './user.scss'
|
||||||
import IsDealer from "./components/IsDealer";
|
import IsDealer from "./components/IsDealer";
|
||||||
|
|
||||||
function User() {
|
function User() {
|
||||||
|
const [statusBarHeight, setStatusBarHeight] = useState<number>()
|
||||||
const {
|
const {
|
||||||
isAdmin
|
isAdmin
|
||||||
} = useUser();
|
} = useUser();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Taro.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
setStatusBarHeight(res.statusBarHeight)
|
||||||
|
},
|
||||||
|
})
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,6 +43,28 @@ function User() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<NavBar
|
||||||
|
fixed={true}
|
||||||
|
style={{marginTop: `${statusBarHeight}px`, backgroundColor: 'transparent'}}
|
||||||
|
onBackClick={() => {
|
||||||
|
}}
|
||||||
|
left={
|
||||||
|
<div style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width: '30px',
|
||||||
|
height: '30px',
|
||||||
|
backgroundColor: 'white',
|
||||||
|
textAlign: 'center',
|
||||||
|
borderRadius: '50%',
|
||||||
|
}}>
|
||||||
|
<Home size={15} onClick={() => Taro.reLaunch({url: '/pages/index/index'})} style={{color: 'black', marginBottom: '1px'}} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span>我的</span>
|
||||||
|
</NavBar>
|
||||||
<div className={'w-full'} style={{
|
<div className={'w-full'} style={{
|
||||||
background: 'linear-gradient(to bottom, #e9fff2, #f9fafb)'
|
background: 'linear-gradient(to bottom, #e9fff2, #f9fafb)'
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
export default function navTo(url: string, isLogin = false) {
|
export default function navTo(url: string, isLogin = false) {
|
||||||
if (isLogin) {
|
if (isLogin && url != '/pages/user/user') {
|
||||||
if (!Taro.getStorageSync('access_token') || !Taro.getStorageSync('UserId')) {
|
if (!Taro.getStorageSync('access_token') || !Taro.getStorageSync('UserId')) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '请先登录',
|
title: '请先登录',
|
||||||
|
|||||||
Reference in New Issue
Block a user