list.js
1.81 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
67
68
69
70
71
72
73
74
75
76
77
78
import api from '../../common/api';
export default {
getList() {
return api.get({
url: '/brand/list',
api: 'store',
code: 200
}).then(result => {
let resu = {
brandList: [],
letters: []
};
if (result) {
let build = [];
let brandArr = Object.keys(result);
brandArr.forEach((val) => {
build.push({
letter: val,
brand: result[val]
});
});
resu.brandList = build;
resu.letters = brandArr;
}
return resu;
});
},
getTabList() {
return api.get({
url: '/brand/category',
api: 'store',
code: 200
}).then(result => {
let resu = [];
if (result) {
resu = result;
}
return resu;
});
},
getcateList(category) {
return api.get({
url: '/brand/newList',
api: 'store',
code: 200,
data: {
category: category.category
}
}).then(result => {
let resu = {
brandList: [],
letters: []
};
if (result) {
let build = [];
let brandArr = Object.keys(result);
brandArr.forEach((val) => {
build.push({
letter: val,
brand: result[val]
});
});
resu.brandList = build;
resu.letters = brandArr;
}
return resu;
});
},
};