home.js
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { HomeApi } from "@/api/ServerApi"
const HomeData = {
carouseTime: 2, // 轮播图滚动间隔时间 单位秒
carouseVOList: [ // 轮播图
{
picUrl: null, //轮播图地址
linkUrl: null, // 轮播图链接地址
linkType: null // 1-内链 2-外链
}
],
iconVOS: [ // 金刚区图标
{
iconName: null, // 图标名称
iconEnName: null, // 图标英文名称
iconUrl: null, // 图标地址
linkUrlType: null, // 图标类型
jumpLink: null // 图标跳转地址
}
],
scrollBarVOS: [ // 滚动热点
{
id: null, // 数据ID
scrollTitle: null, // 热点标题
scrollTag: null, // 热点标签
backgroundColor: null // 热点标签背景颜色
}
],
newsQueryVOS: { // 新闻动态
total: 0, // 数据条数合计
list: [
{
id: null, // 数据ID
newsTitle: null, // 数据标题
newsType: null, // 数据类型
newsTypeName: null, // 类型名称
releaseTime: null, // 发布时间
isRecommend: null // 是否推荐, 1-推荐
}
]
}
}
export default {
namespaced: true,
state: {
HomeData: { ...HomeData }
},
mutations: {
MSetHomeData (state, data) {
state.HomeData = data
}
},
actions: {
AGetHomeData ({ state, commit }, param = {}) {
return HomeApi.getIndex(param).then(res => {
if (res.data) {
commit('MSetHomeData', res.data)
}
return Promise.resolve(res)
})
}
}
}