forked from gxwebsoft/mp-10550
修复已知问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {useEffect, useState} from "react";
|
||||
import {CmsArticle} from "@/api/cms/cmsArticle/model";
|
||||
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'
|
||||
@@ -7,59 +7,57 @@ 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 [list, setList] = useState<CmsArticle[]>([])
|
||||
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)
|
||||
}
|
||||
|
||||
listCmsArticle({model: 'page'}).then(res => {
|
||||
setList(res)
|
||||
}).catch(error => {
|
||||
console.error("Failed to fetch goods detail:", error);
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
reload().then()
|
||||
}, []);
|
||||
|
||||
if (list.length == 0) {
|
||||
return (
|
||||
<div className={'text-center'}>
|
||||
<View className={'text-gray-500'}>
|
||||
暂无数据
|
||||
</View>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={'px-3'}>
|
||||
<Cell>
|
||||
{nav && (
|
||||
<View className={'flex flex-col justify-center items-center w-full'}>
|
||||
<Avatar
|
||||
src={nav?.icon}
|
||||
src={design?.photo}
|
||||
size={'100'}
|
||||
/>
|
||||
<View className={'font-bold text-sm'}>
|
||||
{nav?.comments}
|
||||
{design?.comments}
|
||||
</View>
|
||||
<View className={'text-left py-3 text-gray-600'}>
|
||||
<RichText
|
||||
nodes={'时里院子市集是一家B2C模式的会员电商平台,以健康安全食品,中国国家地理标志产品,药食同源产品等为主线,愿景是守护5亿家庭餐桌健康;选品原则是健康,好吃,方便,实惠。通过严格的筛选供货商,从选品、采购发货、仓储物流产品检测、售前售后等各环节严格把控,提升用户满意度。平台采取透明公开化,以持续为用户提供物美价廉的好产品为准准则,为用户创造价值为唯一宗旨,倡导终身用户,终身服务的经营理念。'}/>
|
||||
nodes={design?.content || '关于我们的简单描述'}/>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
@@ -74,22 +72,21 @@ const Helper = () => {
|
||||
description={(
|
||||
<>
|
||||
<Divider/>
|
||||
<View className={'item flex justify-between items-center my-2'}>
|
||||
<View>{item.categoryName}</View>
|
||||
<ArrowRight size={16} className={'text-gray-400'}/>
|
||||
</View>
|
||||
<View className={'item flex justify-between items-center my-2'}>
|
||||
<View>{item.categoryName}</View>
|
||||
<ArrowRight size={16} className={'text-gray-400'}/>
|
||||
</View>
|
||||
{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>服务热线:0771-88888888</span>
|
||||
<span>工作日:9:00-18:00</span>
|
||||
<span>服务热线:{config?.tel}</span>
|
||||
<span>工作日:{config?.workDay}</span>
|
||||
</Cell>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ const Helper = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<SearchBar shape="round" maxLength={5} className={'mt-2'} />
|
||||
<SearchBar shape="round" className={'mt-2'} />
|
||||
{navigation && (
|
||||
<Image
|
||||
src={navigation.icon}
|
||||
|
||||
@@ -73,7 +73,7 @@ function Profile() {
|
||||
avatar: `${detail.avatarUrl}`,
|
||||
})
|
||||
Taro.uploadFile({
|
||||
url: 'https://server.gxwebsoft.com/api/oss/upload',
|
||||
url: 'https://server.websoft.top/api/oss/upload',
|
||||
filePath: detail.avatarUrl,
|
||||
name: 'file',
|
||||
header: {
|
||||
|
||||
Reference in New Issue
Block a user