Commit 12bddbbb authored by XieZhiXiong's avatar XieZhiXiong
parents 2ad52ba8 28f5dc53
......@@ -42,7 +42,7 @@
"copy-to-clipboard": "^3.3.1",
"god": "0.1.28",
"lingxi-design": "^1.0.7",
"lingxi-design-ui": "^1.1.4",
"lingxi-design-ui": "^1.1.5",
"lingxi-editor-core": "^1.0.6",
"lingxi-web": "^1.0.6",
"lint-staged": "^10.0.7",
......@@ -80,4 +80,4 @@
"json2ts": "^0.0.7",
"ora": "^4.0.4"
}
}
}
\ No newline at end of file
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { Avatar, Menu, Spin } from 'antd';
import { ClickParam } from 'antd/es/menu';
import React from 'react';
import { history } from 'umi';
import PersonDropdown from './PersonDropdown'
......
......@@ -5,6 +5,7 @@ import {
BorderOutlined,
} from '@ant-design/icons'
import OuterSider from './OuterSide'
import { GlobalConfig } from '@/global/config'
import styles from '../styles/MenuSlider.less'
const { Sider } = Layout
......@@ -72,7 +73,7 @@ const MenuSlider: React.FC<MenuSliderProps> = (props) => {
return <>
<OuterSider {...props} />
<Sider theme="light" className="menu_sider" collapsed={props.collapseState}>
<div className={styles.logo}>LOGOLOGOGOG</div>
<div className={styles.logo}><img src={GlobalConfig.global.siteInfo.logo} /></div>
<div className={styles.menuTitle}>
{menuRouter?.name}
</div>
......
.logo {
height: 32px;
background: rgba(255, 255, 255, 1);
margin: 16px;
height: 64px;
display: flex;
align-items: center;
justify-content: center;
&>img {
width: 127px;
height: 44px;
}
}
:global {
......
......@@ -121,18 +121,78 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
})
}
/**
* 获取头条新闻
*/
const fetchLeadNews = () => {
return new Promise((resolve) => {
//@ts-ignore
PublicApi.getManageContentInformationFindAllByRecommendLabel({ recommendLabel: 1 }).then(res => {
if (res.code === 1000) {
let leadNewsList: any = res.data || []
if (leadNewsList.length >= 2) {
let leftList = leadNewsList.slice(0, Math.round(leadNewsList.length / 2))
let rightList = leadNewsList.slice(Math.round(leadNewsList.length / 2), leadNewsList.length)
resolve({
leadLeftNews: leftList,
leadRightNews: rightList
})
} else {
resolve({
leadNewsList,
leadRightNews: []
})
}
}
})
})
}
/**
* 获取全部栏目
*/
const fetchAllColumn = () => {
return new Promise((resolve) => {
PublicApi.getManageContentColumnAll().then(res => {
if (res.code === 1000) {
let result = ""
let allColumn = res.data
if (allColumn && allColumn.length > 0) {
let labelList = allColumn.map((item: any) => item.name)
let showCount = 4
if (labelList.length <= showCount) {
result = labelList.join(' | ')
} else {
labelList = labelList.slice(0, showCount)
result = labelList.join(' | ') + " ..."
}
}
resolve(result)
}
})
})
}
const getComponentsConfig = async () => {
// 导航栏
mainNavConfig[mainNavConfig.key].props.menuData = menuData
mainNavConfig[mainNavConfig.key].props.type = LAYOUT_TYPE.channel
mainNavConfig[mainNavConfig.key].props.categoryList = []
// 一号位广告
bannerAdvertConfig[bannerAdvertConfig.key].props.advertList = await findFirstAdvertsByType()
// 二号位广告
serviceAdvertConfig[serviceAdvertConfig.key].props.advertList = await findSecondAdvertsByType()
//店铺信息
AboutUsConfig[AboutUsConfig.key].props.shopInfo = await fetchShopInfo()
// 行情资讯
InformationConfig[InformationConfig.key].props.newsList = await fetchLeadNews()
InformationConfig[InformationConfig.key].props.allColumn = await fetchAllColumn()
let initIndex = 100
let floorLineConfig: any = {}
let floorLineKeys: any = []
......@@ -183,6 +243,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
}
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, CommonTitle2Config.key, AboutUsConfig.key, InformationConfig.key, FooterConfig.key]
let config = {
...mallLayoutConfig,
...topBarConfig,
......
......@@ -296,6 +296,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
<UploadImage
imgUrl={item.picUrl}
size={getImgSize()}
fileMaxSize={500}
onChange={(val) => handleKeyChange(val, item.sort, 'picUrl')}
/>
</div>
......
......@@ -9,6 +9,7 @@
border: 1px solid rgba(245, 245, 245, 1);
.information_header {
display: flex;
height: 60px;
line-height: 60px;
padding-left: 20px;
......@@ -24,6 +25,12 @@
font-size: 12px;
color: #909399;
}
.more_link {
color: #999999;
padding-right: 20px;
margin-left: auto;
}
}
}
......
......@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
import { PublicApi } from '@/services/api'
import { GetManageContentColumnAllResponse } from '@/services/PassApi'
import ImageBox from '@/components/ImageBox'
import { RightOutlined } from '@ant-design/icons'
import moment from 'moment'
import { LAYOUT_TYPE } from '@/constants'
import styles from './index.less'
......@@ -97,12 +98,24 @@ const Information: React.FC<InformationPropsType> = (props) => {
}
}
const toMoreLink = () => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall/infomation?channelId=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall/infomation?channelId=${shopUrlParam}`
default:
return `/infomation`
}
}
return (
<div className={styles.information}>
<div className={styles.information_container}>
<div className={styles.information_header}>
<span>行情资讯</span>
<label>{renderColumns()}</label>
<a href={toMoreLink()} className={styles.more_link}>更多好货 <RightOutlined /></a>
</div>
<div className={styles.information_list}>
......@@ -113,7 +126,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
<>
{
index === 0 ? (
<a href={toDetailLink(item.id)}>
<a href={toDetailLink(item.id)} key={`information_recommand_${item.id}`}>
<div className={styles.information_recommand}>
<div className={styles.information_recommand_img}>
<ImageBox width={220} height={146} imgUrl={item.imageUrl} />
......@@ -126,7 +139,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</div>
</a>
) : (
<a href={toDetailLink(item.id)}>
<a href={toDetailLink(item.id)} key={`news_list_item_${item.id}`}>
<div className={styles.news_list_item}>
<div className={styles.news_list_item_title}>{item.title}</div>
<div className={styles.news_list_item_date}>{(moment(item.createTime).format('YYYY-MM-DD HH:mm:ss'))}</div>
......@@ -134,7 +147,6 @@ const Information: React.FC<InformationPropsType> = (props) => {
</a>
)
}
</>
))
}
......@@ -147,7 +159,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
<>
{
index === 0 ? (
<a href={toDetailLink(item.id)}>
<a href={toDetailLink(item.id)} key={`information_recommand_${index}`}>
<div className={styles.information_recommand}>
<div className={styles.information_recommand_img}>
<ImageBox width={220} height={146} imgUrl={item.imageUrl} />
......@@ -160,7 +172,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</div>
</a>
) : (
<a href={toDetailLink(item.id)}>
<a href={toDetailLink(item.id)} key={`news_list_item_${index}`}>
<div className={styles.news_list_item}>
<div className={styles.news_list_item_title}>{item.title}</div>
<div className={styles.news_list_item_date}>{(moment(item.createTime).format('YYYY-MM-DD HH:mm:ss'))}</div>
......
......@@ -111,6 +111,7 @@
&_item {
flex: 1;
text-align: center;
cursor: pointer;
&_count {
font-size: 20px;
......@@ -165,6 +166,7 @@
height: 80px;
align-items: center;
justify-content: center;
cursor: pointer;
&.bb {
border-bottom: 1px solid #F4F5F7;
......
......@@ -166,7 +166,7 @@ const InformationDetail: React.FC<InformationDetailPropsType> = (props) => {
{
newsDetail.relatedInformation && newsDetail.relatedInformation.map(item => (
<div className={styles.information_about_list_item} key={`information_about_list_item_${item.id}`}>
<ImageBox width={257} height={172} imgUrl={informationImg2} />
<ImageBox width={257} height={172} imgUrl={item.imageUrl} />
<p>
<a href={toDetailLink(item.id)}>
{item.title}
......
......@@ -173,7 +173,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</div>
<div className={styles.information_focus_right}>
{
photoNews && photoNews.map((item: any, index) => (
photoNews && photoNews.map((item: any, index) => index < 3 && (
<div key={`information_focus_imgbox_sub_${item.id}`} className={index === 0 ? styles.information_focus_imgbox_sub_1 : styles.information_focus_imgbox_sub_2}>
<a href={toDetailLink(item.id)}>
<div className={index === 0 ? styles.information_focus_imgbox_sub_1_img : styles.information_focus_imgbox_sub_2_img} style={{ backgroundImage: `url(${item.imageUrl})` }} />
......
......@@ -66,7 +66,7 @@ const baseRequest = extend({
timeout: 30 * 1000,
headers: defaultHeaders,
credentials: 'include', // 默认请求是否带上cookie
// errorHandler
errorHandler
});
const cache = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment