resource-service.js
943 Bytes
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
import Service from './service';
import ResourceApi from '@/api/resource-api';
class ResourceService extends Service {
constructor() {
super();
this.api = new ResourceApi();
}
info(id) {
return this.api.info(id).then(result => {
// let {resGoodsPools, resContentInfos} = result.data;
let resGoodsPools = result.data.resGoodsPools;
let resContentInfos = result.data.resContentInfos;
resContentInfos.sort((a, b) => {
if (a.orderBy < b.orderBy) {
return -1;
}
if (a.orderBy > b.orderBy) {
return 1;
}
return 0;
});
resContentInfos.push({
type: 'resGoodsPoools',
data: resGoodsPools
});
return resContentInfos;
});
}
editGoodsPool(data) {
return this.api.editGoodsPool(data);
}
editResource(data) {
return this.api.editResource(data);
}
}
export default ResourceService;