Commit af03fe01 authored by 吴婷's avatar 吴婷

Merge branch 'wuting-jinfa-0518' into 'jinfa-0518'

fix: 修改公司图片更多按钮的显示判断 See merge request project/jinfa-mall!6
parents 7ec9ec92 3b00d175
......@@ -38,7 +38,9 @@ const Album: React.FC<AlbumProps> = (props) => {
</div>
)
}
<div className={styles.more_img} onClick={() => history.push(moreImgLink)}>{getMessage('shop.album.morePhoto')}</div>
{
workshopPics.length > 3 && <div className={styles.more_img} onClick={() => history.push(moreImgLink)}>{getMessage('shop.album.morePhoto')}</div>
}
</div>
</div>
</div>
......
import React,{ useState } from 'react'
import styles from './index.less'
import bannerImg from './1.png'
import { useMessageIntl } from '@linkseeks/lingxi-utils'
import React, { useState } from "react";
import styles from "./index.less";
import bannerImg from "./1.png";
import { useMessageIntl } from "@linkseeks/lingxi-utils";
interface Props {
companyImgList?:Array<any>,
shopMessageId?:string
companyImgList?: Array<any>;
shopMessageId?: string;
}
function CompanyAlbum(props: Props) {
const {
companyImgList=[bannerImg,bannerImg],
shopMessageId
} = props
const { getMessage } = useMessageIntl()
return (
<div className={styles['img-warp']}>
<div className={styles['title']}>{getMessage('locales.gongsixiangce', '公司相册')}</div>
<ul className={styles['box-warp']}>
<li className={styles['img-left']}>
<img src={companyImgList[0]} alt=""/>
</li>
<li className={styles['img-right']}>
{
companyImgList[1] &&
<div className={styles['img-rifht-top']}><img src={companyImgList[1]} alt=""/></div>
}
{
companyImgList.length>=2 &&
<li className={styles['box-warp']}>
{
companyImgList.map((url:string,index:number)=>{
if (index<2){
return;
}
if (index ==4){
return <div className={`${styles['box-left']} ${styles['show-more']}`}>
{getMessage('locales.gengduozhaopian', '更多照片')}
<a href={`/aboutUs/${shopMessageId}`} className='all-jump'></a>
</div>
}
if (index>2){
return;
}
return <div key={index + 'img'} className={styles['box-left']}><img src={url} alt=""/></div>
})
}
</li>
}
</li>
</ul>
</div>
)
const { companyImgList = [bannerImg, bannerImg], shopMessageId } = props;
const { getMessage } = useMessageIntl();
return (
<div className={styles["img-warp"]}>
<div className={styles["title"]}>
{getMessage("locales.gongsixiangce", "公司相册")}
</div>
<ul className={styles["box-warp"]}>
<li className={styles["img-left"]}>
<img src={companyImgList[0]} alt="" />
</li>
<li className={styles["img-right"]}>
{companyImgList[1] && (
<div className={styles["img-rifht-top"]}>
<img src={companyImgList[1]} alt="" />
</div>
)}
{companyImgList.length > 2 && (
<li className={styles["box-warp"]}>
<div className={styles["box-left"]}>
<img src={companyImgList[2]} alt="" />
</div>
{companyImgList.length > 3 && (
<div
className={`${styles["box-left"]} ${styles["show-more"]}`}
>
{getMessage("locales.gengduozhaopian", "更多照片")}
<a
href={`/aboutUs/${shopMessageId}`}
className="all-jump"
></a>
</div>
)}
</li>
)}
</li>
</ul>
</div>
);
}
export default CompanyAlbum
export default CompanyAlbum;
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