Commit 1a8815c3 by hank

对接服务效益数据

parent 5305e15a
......@@ -30,6 +30,9 @@ const Nav = (props) => {
setShow(false)
window.location.reload(true)
}
function cancel() {
setShow(false)
}
return (
<div className="layout-nav">
......@@ -42,7 +45,7 @@ const Nav = (props) => {
<div className="time" onClick={() => {
setShow(true)
}}>{time}</div>
{show && <div className="modal-container">
{show && <div className="modal-container animated fadeIn">
<div className="modal-content">
<span>OSC地址</span>
<input type="text" onChange={(e) => {
......@@ -58,6 +61,12 @@ const Nav = (props) => {
</div>
<div>
<button className="modal-btn" onClick={submit}>确认</button>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<button className="modal-btn" onClick={cancel}>取消</button>
</div>
</div>}
......
......@@ -11,6 +11,7 @@ import informationService from '../routes/informationCenter/informationService'
// import CityDetail from '../routes/province/CityDetail'
import IntroductionWarning from '../routes/IntroductionWarning/Index'
import warningAndPublication from '../routes/IntroductionWarning/warningAndPublication'
import warningAndPublicationBefit from '../routes/IntroductionWarning/warningAndPublicationBefit'
import eventMonitor from '../routes/eventMonitor/Index'
import VisitingScene from '../routes/VisitingScene/Index'
import ue4 from '../routes/ue4/Index'
......@@ -88,6 +89,7 @@ export default [
{
path: '/informationCenter/CenterIntroduction',
component: CenterIntroduction,
name: '中心介绍',
meta: {
vPath: '/首页/信息中心/中心介绍'
}
......@@ -95,6 +97,7 @@ export default [
{
path: '/informationCenter/informationService',
component: informationService,
name: '信息服务',
meta: {
vPath: '/首页/信息中心/信息服务'
}
......@@ -102,6 +105,7 @@ export default [
{
path: '/informationCenter/Video',
component: Video,
name: '宣传视频',
meta: {
vPath: '/首页/信息中心/宣传视频'
}
......@@ -124,6 +128,14 @@ export default [
meta: {
vPath: ''
}
},
{
path: '/introductionWarning/warningAndPublicationBefit',
component: warningAndPublicationBefit,
name: '预警发布服务效益',
meta: {
vPath: ''
}
}
]
},
......
......@@ -18,7 +18,9 @@ function IntroductionWarning(props) {
<div className="common-btn one" onClick={() => { }}>
预警信息全流程
</div>
<div className="common-btn one" onClick={() => { }}>
<div className="common-btn one" onClick={() => {
props.history.push('/introductionWarning/warningAndPublicationBefit')
}}>
预警发布服务效益
</div>
<div className="common-btn one" onClick={() => { }}>
......
import React, { useState } from 'react';
import { connect } from 'dva';
import './index.less';
import Layout from '@/components/Layout.js'
import { send } from '@/services/ctr'
import { getBenefitList } from '@/services/api'
function IntroductionWarning(props) {
const [videoList, setVideoList] = useState([])
const [active, setActive] = useState(null)
if (!videoList.length) {
getBenefitList().then(res => {
console.log(res.data.list)
setVideoList(res.data.list)
})
}
return (
<Layout>
<div className="warmingCenter-content animated fadeIn">
<div className="common-btn-container">
{videoList.map((item, index) => {
return <div className={active !== index ? "common-btn" : "common-btn common-btn-active"} key={item.url} onClick={() => {
setActive(index)
send('/首页/预警介绍/预警发布服务效益', ['' + index])
}}>
{item.title}
</div>
})}
</div>
<div className="common-btn-back" onClick={() => {
props.history.go(-1)
}}></div>
</div>
</Layout>
);
}
IntroductionWarning.propTypes = {
};
export default connect()(IntroductionWarning);
.video-container {
padding-left: 50px;
height: 500px;
overflow: sroll;
width: 800px;
}
.video-container .video-list {
text-align: left;
}
.video-container .video-list .video-list-item {
font-size: 17px;
color: white;
text-overflow: ellipsis;
overflow: hidden;
margin-bottom: 20px;
display: flex;
align-items: center;
height: 34px;
}
.video-container .video-list .video-list-item .play {
display: none;
width: 36px;
height: 34px;
background: url(../../assets/img/play.png) no-repeat center;
background-size: contain;
}
.video-container .video-list .video-list-item-active .play {
display: block;
}
import React, { useState, useEffect } from 'react';
import { connect } from 'dva';
import './index.less';
import './Video.less';
import Layout from '@/components/Layout.js'
import { send } from '@/services/ctr'
import { getVideoList } from '@/services/api'
......@@ -8,32 +8,35 @@ import { getVideoList } from '@/services/api'
function CenterIntroduction(props) {
// send('/首页/信息中心/宣传视频', [])
const [videoList, setVideoList] = useState([])
useEffect(function() {
const [active, setActive] = useState(null)
useEffect(function () {
})
if(!videoList.length) {
if (!videoList.length) {
getVideoList().then(res => {
console.log(res.data.list)
setVideoList(res.data.list)
})
}
return (
<Layout>
<div className="warmingCenter-content animated fadeIn">
<div className="common-btn-container">
{videoList.map((item, index) => {
return <div className="common-btn one" key={item.url} onClick={() => {
send('/首页/信息中心/宣传视频', [])
}}>
{item.title}
</div>
})}
<div className="common-btn one" onClick={() => {
send('/首页/信息中心/宣传视频', [])
}}>
视频1
<div className="video-container">
<div className="video-list">
{videoList.map((item, index) => {
return <div className={active !== index ? "video-list-item" : "video-list-item video-list-item-active"} key={item.url} onClick={() => {
setActive(index)
send('/首页/信息中心/宣传视频', [''+ index])
}}>
<div>
{item.title}
</div>
<div className="play">
</div>
</div>
})}
</div>
</div>
......
.video-container {
padding-left: 50px;
height: 500px;
overflow: sroll;
width: 800px;
.video-list {
text-align: left;
.video-list-item {
font-size: 17px;
color: white;
text-overflow: ellipsis;
overflow: hidden;
margin-bottom: 20px;
display: flex;
// justify-content: space-between;
align-items: center;
height: 34px;
.play {
display: none;
width: 36px;
height: 34px;
background: url(../../assets/img/play.png) no-repeat center;
background-size: contain;
}
}
.video-list-item-active {
.play {
display: block;
}
}
}
}
\ No newline at end of file
......@@ -23,4 +23,14 @@ export function getVideoList() {
c: 1000
}
})
}
export function getBenefitList() {
return request({
method: 'get',
url: '/interior/get/benefit',
params: {
p: 1,
c: 1000
}
})
}
\ No newline at end of file
......@@ -39,11 +39,10 @@ export function checkState(history) { // 检查路由状态 与大屏保持同
// console.log(data, sendObj)
// window.sessionStorage.setItem('isUse', 'true')
if (data.route === sendObj.path || (data.route === '/首页/全国/预警信息综合监控平台' && sendObj.path.indexOf('/首页/全国') !== -1)) {
console.log('路由重复')
// console.log('路由重复')
// window.sessionStorage.setItem('isUse', 'true')
} else {
const result = filterRouter(data.route)
console.log(result, 'result', window.location.hash.replace('#', '') !== result.path)
window.sessionStorage.removeItem('isUse')
if (result && window.location.hash.replace('#', '') !== result.path) {
history.replace(result.path)
......
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 sign in to comment