|
|
@@ -4,19 +4,20 @@ import classNames from 'classnames'
|
|
|
import http from '@/utils/http'
|
|
|
import { useHistory } from 'react-router-dom'
|
|
|
import taohuanyuan from './image/D_taohuayuan.png'
|
|
|
+import taohuanyuanMobile from './image/M_D_taohuayuan.png'
|
|
|
import xingtong from './image/D_xingtong.png'
|
|
|
+import xingtongMobile from './image/M_D_xingtong.png'
|
|
|
import xuni from './image/D_xuni.png'
|
|
|
import address from './image/D_address.png'
|
|
|
import like from './image/icon_like.png'
|
|
|
import share from './image/icon_share.png'
|
|
|
import intro from './image/icon_intro.png'
|
|
|
-import floor from './image/bg_floor.png'
|
|
|
-import map from './image/bg_map.png'
|
|
|
import arrow from './image/arrow.png'
|
|
|
|
|
|
import { message } from 'antd'
|
|
|
import { Intro, MapIntro } from './component/Intro'
|
|
|
import { Preview } from './component/Preview'
|
|
|
+import isMobile from '@/utils/isMobile'
|
|
|
|
|
|
const imgArrTemp = [
|
|
|
{ src: 'Bao-0.png', title: '基本情况' },
|
|
|
@@ -49,24 +50,36 @@ function Diagram({
|
|
|
addressLeft,
|
|
|
addressTop,
|
|
|
text,
|
|
|
- handleClick
|
|
|
+ handleClick,
|
|
|
+ textLeft,
|
|
|
+ textTop
|
|
|
}: {
|
|
|
imgSrc: any
|
|
|
left: number
|
|
|
top: number
|
|
|
addressLeft: number
|
|
|
addressTop: number
|
|
|
+ textLeft?: number
|
|
|
+ textTop?: number
|
|
|
text: string
|
|
|
handleClick: () => void
|
|
|
}) {
|
|
|
console.log(imgSrc)
|
|
|
console.log(taohuanyuan)
|
|
|
return (
|
|
|
- <div className={styles.diagram} style={{ left: `${left}%`, top: `${top}%` }}>
|
|
|
+ <div
|
|
|
+ className={classNames(styles.diagram, isMobile() && styles.diagramMobile)}
|
|
|
+ style={{ left: `${left}%`, top: `${top}%` }}
|
|
|
+ >
|
|
|
<img className='diagram-img' src={imgSrc} onClick={handleClick} alt='' />
|
|
|
+ {isMobile() && (
|
|
|
+ <div className='diagram-text' style={{ left: `${textLeft}%`, top: `${textTop}%` }}>
|
|
|
+ {text}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<div className='diagram-address' style={{ left: `${addressLeft}%`, top: `${addressTop}%` }}>
|
|
|
<img src={address} alt='' />
|
|
|
- <div className='diagram-text'>{text}</div>
|
|
|
+ {!isMobile() && <div className='diagram-text'>{text}</div>}
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
|
@@ -75,7 +88,7 @@ function Diagram({
|
|
|
function Layout({ setIsFloor }: { setIsFloor: (isFloor: boolean) => void }) {
|
|
|
const history = useHistory()
|
|
|
return (
|
|
|
- <div className={styles.layout}>
|
|
|
+ <div className={classNames(styles.layout, isMobile() && styles.layoutMobile)}>
|
|
|
<div className='back' onClick={() => setIsFloor(false)}>
|
|
|
<img src={require('./image/back.png')} alt='' />
|
|
|
</div>
|
|
|
@@ -83,7 +96,7 @@ function Layout({ setIsFloor }: { setIsFloor: (isFloor: boolean) => void }) {
|
|
|
<div
|
|
|
className='floor-1'
|
|
|
onClick={() => {
|
|
|
- history.push('/home?m=SG-dwRgbFq7Fiz')
|
|
|
+ history.push('/home?m=SG-NqtcxoVBj5C')
|
|
|
setTimeout(() => {
|
|
|
window.location.reload()
|
|
|
}, 200)
|
|
|
@@ -142,8 +155,16 @@ function A0Base() {
|
|
|
}
|
|
|
return (
|
|
|
<div
|
|
|
- className={styles.A0base}
|
|
|
- style={{ backgroundImage: isFloor ? `url(${floor})` : `url(${map})` }}
|
|
|
+ className={classNames(styles.A0base, isMobile() && styles.A0baseMobile)}
|
|
|
+ style={{
|
|
|
+ backgroundImage: isFloor
|
|
|
+ ? isMobile()
|
|
|
+ ? `url(${require('./image/M_bg_floor.png')})`
|
|
|
+ : `url(${require('./image/bg_floor.png')})`
|
|
|
+ : isMobile()
|
|
|
+ ? `url(${require('./image/M_bg_map.png')})`
|
|
|
+ : `url(${require('./image/bg_map.png')})`
|
|
|
+ }}
|
|
|
>
|
|
|
{showIntro &&
|
|
|
(isFloor ? (
|
|
|
@@ -155,33 +176,64 @@ function A0Base() {
|
|
|
|
|
|
{!isFloor && !showIntro && !isPreview[0] && (
|
|
|
<>
|
|
|
- <Diagram
|
|
|
- imgSrc={taohuanyuan}
|
|
|
- left={13.6}
|
|
|
- top={8.2}
|
|
|
- addressLeft={30.4}
|
|
|
- addressTop={6}
|
|
|
- text='桃花园科技创新生态园'
|
|
|
- handleClick={() => setIsPreview([true, 'baoan'])}
|
|
|
- />
|
|
|
- <Diagram
|
|
|
- imgSrc={xingtong}
|
|
|
- left={9.6}
|
|
|
- top={5}
|
|
|
- addressLeft={25.6}
|
|
|
- addressTop={73}
|
|
|
- text='星通大厦'
|
|
|
- handleClick={() => setIsFloor(true)}
|
|
|
- />
|
|
|
- <Diagram
|
|
|
- imgSrc={xuni}
|
|
|
- left={47.5}
|
|
|
- top={-22}
|
|
|
- addressLeft={55.5}
|
|
|
- addressTop={85}
|
|
|
- text='深圳虚拟大学园'
|
|
|
- handleClick={() => setIsPreview([true, 'nanshang'])}
|
|
|
- />
|
|
|
+ {!isMobile() ? (
|
|
|
+ <Diagram
|
|
|
+ imgSrc={taohuanyuan}
|
|
|
+ left={13.6}
|
|
|
+ top={8.2}
|
|
|
+ addressLeft={30.4}
|
|
|
+ addressTop={6}
|
|
|
+ text='桃花园科技创新生态园'
|
|
|
+ handleClick={() => setIsPreview([true, 'baoan'])}
|
|
|
+ />
|
|
|
+ ) : (
|
|
|
+ <Diagram
|
|
|
+ imgSrc={taohuanyuanMobile}
|
|
|
+ left={9.6}
|
|
|
+ top={8.2}
|
|
|
+ addressLeft={47.2}
|
|
|
+ addressTop={4}
|
|
|
+ text='桃花园科技创新生态园'
|
|
|
+ textLeft={50}
|
|
|
+ textTop={100}
|
|
|
+ handleClick={() => setIsPreview([true, 'baoan'])}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+
|
|
|
+ {!isMobile() ? (
|
|
|
+ <Diagram
|
|
|
+ imgSrc={xingtong}
|
|
|
+ left={9.6}
|
|
|
+ top={5}
|
|
|
+ addressLeft={25.6}
|
|
|
+ addressTop={73}
|
|
|
+ text='星通大厦'
|
|
|
+ handleClick={() => setIsFloor(true)}
|
|
|
+ />
|
|
|
+ ) : (
|
|
|
+ <Diagram
|
|
|
+ imgSrc={xingtongMobile}
|
|
|
+ left={20.6}
|
|
|
+ top={31}
|
|
|
+ addressLeft={13.2}
|
|
|
+ addressTop={66.5}
|
|
|
+ text='星通大厦'
|
|
|
+ textLeft={70}
|
|
|
+ textTop={110}
|
|
|
+ handleClick={() => setIsFloor(true)}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {!isMobile() && (
|
|
|
+ <Diagram
|
|
|
+ imgSrc={xuni}
|
|
|
+ left={47.5}
|
|
|
+ top={-22}
|
|
|
+ addressLeft={55.5}
|
|
|
+ addressTop={85}
|
|
|
+ text='深圳虚拟大学园'
|
|
|
+ handleClick={() => setIsPreview([true, 'nanshang'])}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</>
|
|
|
)}
|
|
|
|
|
|
@@ -192,7 +244,10 @@ function A0Base() {
|
|
|
type={isPreview[1]}
|
|
|
/>
|
|
|
)}
|
|
|
- <div className='A0_iconBar' style={{ display: isPreview[0] ? 'none' : 'flex' }}>
|
|
|
+ <div
|
|
|
+ className='A0_iconBar'
|
|
|
+ style={{ display: isPreview[0] || (isMobile() && showIntro) ? 'none' : 'flex' }}
|
|
|
+ >
|
|
|
<div className='A0_icon' onClick={() => handleLikeClick()}>
|
|
|
<div
|
|
|
className={classNames(isLike ? 'addLikeAc' : '', 'addLike')}
|