feat(dealer): 更新分销商页面功能与UI优化- 修改分享标题从"网宿小店"为"唐九运售电云"
- 调整商品列表内边距从 py-3 到 py-1- 在购物车页面更新分享标题为"唐九运售电云" - 扩展网站字段模型增加 NoticeBar 字段 -为经销商用户模型添加 dealerName、dealerPhone 和 dealerAvatar 字段- 引入二维码图标替换原有图标- 新增获取推荐人信息逻辑并展示推荐人详情 - 首页新增公告栏组件显示配置的通知内容 - 商品详情页分享标题同步更新为"唐九运售电云"
This commit is contained in:
@@ -55,4 +55,5 @@ export interface Config {
|
|||||||
email?: string;
|
email?: string;
|
||||||
loginTitle?: string;
|
loginTitle?: string;
|
||||||
sysLogo?: string;
|
sysLogo?: string;
|
||||||
|
NoticeBar?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ export interface ShopDealerUser {
|
|||||||
totalMoney?: string;
|
totalMoney?: string;
|
||||||
// 推荐人用户ID
|
// 推荐人用户ID
|
||||||
refereeId?: number;
|
refereeId?: number;
|
||||||
|
dealerName?: string;
|
||||||
|
dealerPhone?: string;
|
||||||
|
dealerAvatar?: string;
|
||||||
// 成员数量(一级)
|
// 成员数量(一级)
|
||||||
firstNum?: number;
|
firstNum?: number;
|
||||||
// 成员数量(二级)
|
// 成员数量(二级)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from 'react'
|
import React, {useState, useEffect} from 'react'
|
||||||
import {View, Text} from '@tarojs/components'
|
import {View, Text} from '@tarojs/components'
|
||||||
import {ConfigProvider, Button, Grid, Avatar} from '@nutui/nutui-react-taro'
|
import {ConfigProvider, Button, Grid, Avatar} from '@nutui/nutui-react-taro'
|
||||||
import {
|
import {
|
||||||
User,
|
User,
|
||||||
Shopping,
|
Shopping,
|
||||||
Dongdong,
|
QrCode,
|
||||||
ArrowRight,
|
ArrowRight,
|
||||||
Purse,
|
Purse,
|
||||||
People
|
People
|
||||||
@@ -13,6 +13,8 @@ import {useDealerUser} from '@/hooks/useDealerUser'
|
|||||||
import {useThemeStyles} from '@/hooks/useTheme'
|
import {useThemeStyles} from '@/hooks/useTheme'
|
||||||
import {businessGradients, cardGradients, gradientUtils} from '@/styles/gradients'
|
import {businessGradients, cardGradients, gradientUtils} from '@/styles/gradients'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
|
import {getShopDealerRefereeByUserId} from "@/api/shop/shopDealerReferee";
|
||||||
|
import {ShopDealerUser} from "@/api/shop/shopDealerUser/model";
|
||||||
|
|
||||||
const DealerIndex: React.FC = () => {
|
const DealerIndex: React.FC = () => {
|
||||||
const {
|
const {
|
||||||
@@ -20,6 +22,7 @@ const DealerIndex: React.FC = () => {
|
|||||||
error,
|
error,
|
||||||
refresh,
|
refresh,
|
||||||
} = useDealerUser()
|
} = useDealerUser()
|
||||||
|
const [dealer, setDealer] = useState<ShopDealerUser>()
|
||||||
|
|
||||||
// 使用主题样式
|
// 使用主题样式
|
||||||
const themeStyles = useThemeStyles()
|
const themeStyles = useThemeStyles()
|
||||||
@@ -53,6 +56,15 @@ const DealerIndex: React.FC = () => {
|
|||||||
return userTheme.background
|
return userTheme.background
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 初始化当前用户名称
|
||||||
|
useEffect(() => {
|
||||||
|
getShopDealerRefereeByUserId(Taro.getStorageSync('UserId')).then((data) => {
|
||||||
|
setDealer(data);
|
||||||
|
})
|
||||||
|
}, [dealerUser])
|
||||||
|
|
||||||
|
|
||||||
console.log(getGradientBackground(), 'getGradientBackground()')
|
console.log(getGradientBackground(), 'getGradientBackground()')
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
@@ -101,8 +113,7 @@ const DealerIndex: React.FC = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View className="flex-1 flex-col">
|
<View className="flex-1 flex-col">
|
||||||
<View className="text-white text-lg font-bold mb-1" style={{
|
<View className="text-white text-lg font-bold mb-1" style={{}}>
|
||||||
}}>
|
|
||||||
{dealerUser?.realName || '分销商'}
|
{dealerUser?.realName || '分销商'}
|
||||||
</View>
|
</View>
|
||||||
<View className="text-sm" style={{
|
<View className="text-sm" style={{
|
||||||
@@ -225,7 +236,7 @@ const DealerIndex: React.FC = () => {
|
|||||||
</View>
|
</View>
|
||||||
</Grid.Item>
|
</Grid.Item>
|
||||||
|
|
||||||
<Grid.Item text={'我的邀请'} onClick={() => navigateToPage('/dealer/team/index')}>
|
<Grid.Item text={'会员中心'} onClick={() => navigateToPage('/pages/user/user')}>
|
||||||
<View className="text-center">
|
<View className="text-center">
|
||||||
<View className="w-12 h-12 bg-purple-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
<View className="w-12 h-12 bg-purple-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
||||||
<People color="#8b5cf6" size="20"/>
|
<People color="#8b5cf6" size="20"/>
|
||||||
@@ -236,7 +247,7 @@ const DealerIndex: React.FC = () => {
|
|||||||
<Grid.Item text={'我的邀请码'} onClick={() => navigateToPage('/dealer/qrcode/index')}>
|
<Grid.Item text={'我的邀请码'} onClick={() => navigateToPage('/dealer/qrcode/index')}>
|
||||||
<View className="text-center">
|
<View className="text-center">
|
||||||
<View className="w-12 h-12 bg-orange-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
<View className="w-12 h-12 bg-orange-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
||||||
<Dongdong color="#f59e0b" size="20"/>
|
<QrCode color="#f59e0b" size="20"/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</Grid.Item>
|
</Grid.Item>
|
||||||
@@ -284,6 +295,17 @@ const DealerIndex: React.FC = () => {
|
|||||||
{/*</Grid>*/}
|
{/*</Grid>*/}
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
</View>
|
</View>
|
||||||
|
<View className="bg-white mx-4 mt-4 rounded-xl p-4">
|
||||||
|
<View className="font-semibold mb-4 text-gray-800">我的推荐人</View>
|
||||||
|
<View className={'flex items-center gap-2'}>
|
||||||
|
<Avatar src={dealer?.dealerAvatar}/>
|
||||||
|
<View className={'flex flex-col'}>
|
||||||
|
<Text className="text-lg font-semibold">{dealer?.dealerName}</Text>
|
||||||
|
<Text className="text-gray-500"
|
||||||
|
onClick={() => Taro.makePhoneCall({phoneNumber: `${dealer?.dealerPhone}`})}>{dealer?.dealerPhone}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* 底部安全区域 */}
|
{/* 底部安全区域 */}
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ function Cart() {
|
|||||||
|
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: '购物车 - 网宿小店'
|
title: '购物车 - 唐九运售电云'
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return {
|
return {
|
||||||
title: '购物车 - 网宿小店',
|
title: '购物车 - 唐九运售电云',
|
||||||
success: function () {
|
success: function () {
|
||||||
console.log('分享成功');
|
console.log('分享成功');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ const BestSellers = () => {
|
|||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: `${goods?.name || '精选商品'} - 网宿小店`,
|
title: `${goods?.name || '精选商品'} - 唐九运售电云`,
|
||||||
path: `/shop/goodsDetail/index?id=${goods?.goodsId}`,
|
path: `/shop/goodsDetail/index?id=${goods?.goodsId}`,
|
||||||
imageUrl: goods?.image
|
imageUrl: goods?.image
|
||||||
};
|
};
|
||||||
@@ -94,7 +94,7 @@ const BestSellers = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className={'py-3'}>
|
<View className={'py-1'}>
|
||||||
<View className={'flex flex-col justify-between items-center rounded-lg px-2'}>
|
<View className={'flex flex-col justify-between items-center rounded-lg px-2'}>
|
||||||
{list?.map((item, index) => {
|
{list?.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -4,28 +4,31 @@ import Taro from '@tarojs/taro';
|
|||||||
import {useShareAppMessage, useShareTimeline} from "@tarojs/taro"
|
import {useShareAppMessage, useShareTimeline} from "@tarojs/taro"
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
import {getShopInfo} from "@/api/layout";
|
import {getShopInfo} from "@/api/layout";
|
||||||
import {Sticky} from '@nutui/nutui-react-taro'
|
import {Sticky, NoticeBar} from '@nutui/nutui-react-taro'
|
||||||
import {View} from '@tarojs/components'
|
import {View} from '@tarojs/components'
|
||||||
import Menu from "./Menu";
|
import Menu from "./Menu";
|
||||||
import Banner from "./Banner";
|
import Banner from "./Banner";
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
import Grid from "@/pages/index/Grid";
|
import Grid from "@/pages/index/Grid";
|
||||||
import PopUpAd from "@/pages/index/PopUpAd";
|
import PopUpAd from "@/pages/index/PopUpAd";
|
||||||
|
import {configWebsiteField} from "@/api/cms/cmsWebsiteField";
|
||||||
|
import type {Config} from "@/api/cms/cmsWebsiteField/model";
|
||||||
|
|
||||||
function Home() {
|
function Home() {
|
||||||
// 吸顶状态
|
// 吸顶状态
|
||||||
const [stickyStatus, setStickyStatus] = useState<boolean>(false)
|
const [stickyStatus, setStickyStatus] = useState<boolean>(false)
|
||||||
|
const [config, setConfig] = useState<Config>()
|
||||||
|
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: '网宿小店 - 网宿软件',
|
title: '唐九运售电云 - 网宿软件',
|
||||||
path: `/pages/index/index`
|
path: `/pages/index/index`
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return {
|
return {
|
||||||
title: '网宿小店 - 网宿软件',
|
title: '唐九运售电云 - 网宿软件',
|
||||||
path: `/pages/index/index`,
|
path: `/pages/index/index`,
|
||||||
success: function () {
|
success: function () {
|
||||||
console.log('分享成功');
|
console.log('分享成功');
|
||||||
@@ -83,6 +86,10 @@ function Home() {
|
|||||||
// 获取站点信息
|
// 获取站点信息
|
||||||
getShopInfo().then(() => {
|
getShopInfo().then(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
// 获取配置信息
|
||||||
|
configWebsiteField({}).then(data => {
|
||||||
|
setConfig(data)
|
||||||
})
|
})
|
||||||
// Taro.getSetting:获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。
|
// Taro.getSetting:获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。
|
||||||
Taro.getSetting({
|
Taro.getSetting({
|
||||||
@@ -115,6 +122,7 @@ function Home() {
|
|||||||
<View className={'flex flex-col mt-1'}>
|
<View className={'flex flex-col mt-1'}>
|
||||||
<Menu/>
|
<Menu/>
|
||||||
<Banner/>
|
<Banner/>
|
||||||
|
<NoticeBar content={config?.NoticeBar || '主营直购电售电业务,以更优惠电价、更全面的服务,致力为工商企业创造更优越经营环境,帮助企业减负排压,深度赋能'} />
|
||||||
<BestSellers/>
|
<BestSellers/>
|
||||||
<Grid />
|
<Grid />
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ const GoodsDetail = () => {
|
|||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: `${goods?.name || '精选商品'} - 网宿小店`,
|
title: `${goods?.name || '精选商品'} - 唐九运售电云`,
|
||||||
path: `/shop/goodsDetail/index?id=${goodsId}`,
|
path: `/shop/goodsDetail/index?id=${goodsId}`,
|
||||||
imageUrl: goods?.image
|
imageUrl: goods?.image
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user