feat(pages): 添加管理页面功能和配置
- 创建 .editorconfig 文件统一代码风格配置 - 配置 .eslintrc 使用 taro/react 规则集 - 完善 .gitignore 忽略编译产物和敏感文件 - 添加 admin/article/add 页面实现文章管理功能 - 添加 dealer/apply/add 页面实现经销商申请功能 - 添加 dealer/bank/add 页面实现银行卡管理功能 - 添加 dealer/customer/add 页面实现客户管理功能 - 添加 user/address/add 页面实现用户地址管理功能 - 添加 user/chat/message/add 页面实现消息功能 - 添加 user/gift/add 页面实现礼品管理功能 - 配置各页面导航栏标题和样式 - 实现表单验证和数据提交功能 - 集成图片上传和头像选择功能 - 添加日期选择和数据校验逻辑 - 实现编辑和新增模式切换 - 集成用户权限和角色管理功能
This commit is contained in:
4
src/user/about/index.config.ts
Normal file
4
src/user/about/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '关于我们',
|
||||
navigationBarTextStyle: 'black'
|
||||
})
|
||||
3
src/user/about/index.scss
Normal file
3
src/user/about/index.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
:root {
|
||||
|
||||
}
|
||||
95
src/user/about/index.tsx
Normal file
95
src/user/about/index.tsx
Normal file
@@ -0,0 +1,95 @@
|
||||
import {useEffect, useState} from "react";
|
||||
import Taro from '@tarojs/taro';
|
||||
import {listCmsArticle} from "@/api/cms/cmsArticle";
|
||||
import {Avatar, Cell, Divider} from '@nutui/nutui-react-taro'
|
||||
import {ArrowRight} from '@nutui/icons-react-taro'
|
||||
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
|
||||
import {listCmsNavigation} from "@/api/cms/cmsNavigation";
|
||||
// 显示html富文本
|
||||
import {View, RichText} from '@tarojs/components'
|
||||
import {listCmsDesign} from "@/api/cms/cmsDesign";
|
||||
import {CmsDesign} from "@/api/cms/cmsDesign/model";
|
||||
import {type Config} from "@/api/cms/cmsWebsiteField/model";
|
||||
import {configWebsiteField} from "@/api/cms/cmsWebsiteField";
|
||||
|
||||
|
||||
const Helper = () => {
|
||||
const [nav, setNav] = useState<CmsNavigation>()
|
||||
const [design, setDesign] = useState<CmsDesign>()
|
||||
const [category, setCategory] = useState<CmsNavigation[]>([])
|
||||
const [config, setConfig] = useState<Config>()
|
||||
|
||||
const reload = async () => {
|
||||
const navs = await listCmsNavigation({model: 'page', parentId: 0});
|
||||
if (navs.length > 0) {
|
||||
const nav = navs[0];
|
||||
setNav(nav);
|
||||
// 查询页面信息
|
||||
const design = await listCmsDesign({categoryId: nav.navigationId})
|
||||
setDesign(design[0])
|
||||
// 查询子栏目
|
||||
const category = await listCmsNavigation({parentId: nav.navigationId})
|
||||
category.map(async (item, index) => {
|
||||
category[index].articles = await listCmsArticle({categoryId: item.navigationId});
|
||||
})
|
||||
setCategory(category)
|
||||
// 查询字段
|
||||
const configInfo = await configWebsiteField({})
|
||||
setConfig(configInfo)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
reload().then()
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={'px-3'}>
|
||||
<Cell>
|
||||
{nav && (
|
||||
<View className={'flex flex-col justify-center items-center w-full'}>
|
||||
<Avatar
|
||||
src={design?.photo}
|
||||
size={'100'}
|
||||
/>
|
||||
<View className={'font-bold text-sm'}>
|
||||
{design?.comments}
|
||||
</View>
|
||||
<View className={'text-left py-3 text-gray-600'}>
|
||||
<RichText
|
||||
nodes={design?.content || '关于我们的简单描述'}/>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
</Cell>
|
||||
{category.map((item, index) => (
|
||||
<Cell
|
||||
title={(
|
||||
<div className={'font-bold'} id={`${index}`}>
|
||||
{item.categoryName}
|
||||
</div>
|
||||
)}
|
||||
description={(
|
||||
<>
|
||||
<Divider/>
|
||||
{item.articles?.map((child, _) => (
|
||||
<View className={'item flex justify-between items-center my-2'}>
|
||||
<View
|
||||
onClick={() => Taro.navigateTo({url: `/cms/detail/index?id=${child.articleId}`})}>{child.title}</View>
|
||||
<ArrowRight size={16} className={'text-gray-400'}/>
|
||||
</View>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
>
|
||||
</Cell>
|
||||
))}
|
||||
<Cell className={'flex flex-col'}>
|
||||
<span>服务热线:{config?.tel}</span>
|
||||
<span>工作日:{config?.workDay}</span>
|
||||
</Cell>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Helper;
|
||||
Reference in New Issue
Block a user