You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
import request from '@/utils/request'
|
|
|
|
// api地址
|
|
const api = {
|
|
list: 'category/list',
|
|
consultingContextList: 'AgencyAddress/ConsultingContext/getList',
|
|
consultingContextSelection: 'AgencyAddress/ConsultingContext/getSelection',
|
|
consultingContextInfo: 'AgencyAddress/ConsultingContext/getInfo',
|
|
}
|
|
|
|
// 页面数据
|
|
export function list() {
|
|
return request.get(api.list)
|
|
}
|
|
|
|
// 资讯中心列表
|
|
export function consultingContextList(param) {
|
|
let paramArr = [];
|
|
for (let key in param) {
|
|
paramArr.push(key + '=' + param[key])
|
|
}
|
|
let paramStr = '?' + paramArr.join('&')
|
|
return request.get(api.consultingContextList + paramStr)
|
|
}
|
|
|
|
// 资讯信息详情
|
|
export function consultingContextInfo(contextId) {
|
|
return request.get(api.consultingContextInfo + '?contextId=' + contextId)
|
|
}
|
|
|
|
// 获取资讯中心列表分类
|
|
export function consultingContextSelection() {
|
|
return request.get(api.consultingContextSelection)
|
|
}
|
|
|
|
/**
|
|
* 加载更多列表数据
|
|
* @param {Object} resList 新列表数据
|
|
* @param {Object} oldList 旧列表数据
|
|
* @param {int} pageNo 当前页码
|
|
*/
|
|
export const getMoreListData = (resList, oldList, pageNo) => {
|
|
// 如果是第一页需手动制空列表
|
|
if (pageNo == 1) oldList = []
|
|
// 合并新数据
|
|
return oldList.concat(resList)
|
|
}
|