yapi/client/actions/news.js
2017-07-18 10:17:07 +08:00

92 lines
1.8 KiB
JavaScript

import {
FETCH_NEWS_DATA,
FETCH_MORE_NEWS
} from '../constants/action-types.js';
export function fetchNewsData () {
const data = [{
name: 'John Brown',
date: '2015-11-11 13:00:15',
desc: '创建服务现场'
}, {
name: 'John Brown1',
date: '2015-11-11 13:00:15',
desc: '技术测试异常'
}, {
name: 'John Brown2',
date: '2015-11-11 13:00:15',
desc: '网络异常正在修复'
}]
return {
type: FETCH_NEWS_DATA,
payload: data
};
}
export function fetchViewedNews () {
const data = [{
name: 'John Brown21',
date: '2015-11-11 13:00:15',
desc: '创建服务现场'
}, {
name: 'John Brown12',
date: '2015-11-11 13:00:15',
desc: '技术测试异常'
}, {
name: 'John Brown22',
date: '2015-11-11 13:00:15',
desc: '网络异常正在修复'
}]
return {
type: FETCH_NEWS_DATA,
payload: data
}
}
export function fetchNotVieweNews () {
const data = [{
name: 'John Brown22',
date: '2015-11-11 13:00:15',
desc: '创建服务现场'
}, {
name: 'John Brown12',
date: '2015-11-11 13:00:15',
desc: '技术测试异常'
}, {
name: 'John Brown22',
date: '2015-11-11 13:00:15',
desc: '网络异常正在修复'
}]
return {
type: FETCH_NEWS_DATA,
payload: data
}
}
export function fetchMoreNews () {
return (dispatch)=>{
const data = [{
name: 'John Brown2212',
date: '2015-11-11 13:00:15',
desc: '创建服务现场'
}, {
name: 'John Brown1132',
date: '2015-11-11 13:00:15',
desc: '技术测试异常'
}, {
name: 'John Brown23212',
date: '2015-11-11 13:00:15',
desc: '网络异常正在修复'
}]
dispatch({
type: FETCH_MORE_NEWS,
payload: data
})
}
}