fix: 修改footer样式

This commit is contained in:
qitmac000249 2017-07-24 16:41:11 +08:00
parent fa283088dc
commit e320308393
6 changed files with 36 additions and 23 deletions

View File

@ -3,25 +3,28 @@ import {
FETCH_MORE_NEWS
} from '../constants/action-types.js';
export function fetchNewsData (logId) {
const data = {
newsList:[
{ key: 1,title: '日志标题', username: 'John Brown', content: '您好!亲爱的用户:您已成功申请接口:实时空气质量数据查询,请于两个月内进行应用验证,逾期接口将不能正常使用。如果您在使用的过程中遇到任何问题,欢迎前往交流社区反馈意见,谢谢!',time: '2014-12-01' },
{ key: 2,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' },
{ key: 3,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' }
],
totalPage: 34
};
console.log(logId);
import axios from 'axios';
import variable from '../constants/variable';
export function fetchNewsData (uid,page,limit) {
// const data = {
// newsList:[
// { key: 1,title: '日志标题', username: 'John Brown', content: '您好!亲爱的用户:您已成功申请接口:实时空气质量数据查询,请于两个月内进行应用验证,逾期接口将不能正常使用。如果您在使用的过程中遇到任何问题,欢迎前往交流社区反馈意见,谢谢!',time: '2014-12-01' },
// { key: 2,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' },
// { key: 3,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' }
// ],
// totalPage: 34
// };
const param = {
uid: uid,
page: page,
limit: variable.PAGE_LIMIT?variable.PAGE_LIMIT:limit
}
console.log(param);
return {
type: FETCH_NEWS_DATA,
payload: new Promise(function(reslove,reject){
if(data){
reslove(data);
}else{
reject("chucuole");
}
})
payload: axios.get('/log/list',param)
};
}

View File

@ -2,7 +2,7 @@
.footer{
// max-width: 12rem;
margin: 20px auto;
margin: 0px auto;
clear: both;
font-size: 12px;
background: #000c15;

View File

@ -10,6 +10,7 @@ import { fetchNewsData } from '../../actions/news.js'
@connect(
state => {
return {
uid: state.user.curUid,
newsData: state.news.newsData?state.news.newsData:[]
}
},
@ -27,7 +28,8 @@ class News extends Component {
}
static propTypes = {
newsData: PropTypes.object,
fetchNewsData: PropTypes.func
fetchNewsData: PropTypes.func,
uid: PropTypes.string
}
setLoading(bool){
this.setState({
@ -35,7 +37,10 @@ class News extends Component {
})
}
componentWillMount(){
this.props.fetchNewsData()
console.log(this.props.uid);
this.props.fetchNewsData(1,1,10).then(function(data){
console.log(data);
})
}
render () {
const data = this.props.newsData

View File

@ -18,7 +18,9 @@ const logList = [{
}];
@connect(
state => {
// console.log(state);
return {
uid: state.user.curUid,
newsData: state.news.newsData
}
},
@ -31,7 +33,8 @@ class NewsList extends Component {
static propTypes = {
fetchNewsData: PropTypes.func,
setLoading: PropTypes.func
setLoading: PropTypes.func,
uid: PropTypes.string
}
constructor(props) {
@ -48,7 +51,8 @@ class NewsList extends Component {
})
const that = this;
this.props.setLoading(true);
this.props.fetchNewsData(+e.key).then(function(){
this.props.fetchNewsData(+this.props.uid,0,5).then(function(data){
console.log(data.data);
that.props.setLoading(false);
})
}

View File

@ -57,7 +57,7 @@ class NewsTimeline extends Component {
<section className="news-timeline">
<span className='removeAllNews'>
<Popconfirm title="你确定要清空所有消息吗?" onConfirm={removeConfirm} okText="删除" cancelText="取消">
清空消息
项目日志
</Popconfirm>
</span>
<Table

View File

@ -10,6 +10,7 @@ const initialState = {
export default (state = initialState, action) => {
switch (action.type) {
case FETCH_NEWS_DATA: {
// console.log(action.payload);
return {
...state,
newsData: action.payload