|
@@ -7,7 +7,7 @@ |
|
@@ -7,7 +7,7 @@ |
7
|
'use strict';
|
7
|
'use strict';
|
8
|
|
8
|
|
9
|
var api = global.yoho.API;
|
9
|
var api = global.yoho.API;
|
10
|
-
|
10
|
+const service = global.yoho.ServiceAPI;
|
11
|
|
11
|
|
12
|
/* 男生频道取品牌广告及热门品牌数据的位置码 */
|
12
|
/* 男生频道取品牌广告及热门品牌数据的位置码 */
|
13
|
let CODE_TOPPOS_BOYS = 'ce6ac059493ec26241a8cbe0bfa1b17a';
|
13
|
let CODE_TOPPOS_BOYS = 'ce6ac059493ec26241a8cbe0bfa1b17a';
|
|
@@ -26,15 +26,20 @@ let CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75'; |
|
@@ -26,15 +26,20 @@ let CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75'; |
26
|
*/
|
26
|
*/
|
27
|
|
27
|
|
28
|
const _packageAd = (params) => {
|
28
|
const _packageAd = (params) => {
|
29
|
- return api.get('', {
|
|
|
30
|
- method: 'app.brand.newBrandList',
|
|
|
31
|
- yh_channel: params.channel
|
|
|
32
|
|
29
|
|
33
|
- }, { code: 200 }).then(result => {
|
30
|
+ return service.get('/operations/api/v5/resource/home', {
|
|
|
31
|
+ content_code: '5a9b5bcfd2e13d56c9ba6b867a325dc1',
|
|
|
32
|
+ gender: 1,
|
|
|
33
|
+ limit: 1000,
|
|
|
34
|
+ page: 1
|
|
|
35
|
+ }).then(result => {
|
|
|
36
|
+
|
|
|
37
|
+ console.log(result);
|
34
|
|
38
|
|
35
|
- return result;
|
39
|
+ return result;
|
36
|
|
40
|
|
37
|
});
|
41
|
});
|
|
|
42
|
+
|
38
|
};
|
43
|
};
|
39
|
|
44
|
|
40
|
const _packageList = (params) => {
|
45
|
const _packageList = (params) => {
|
|
@@ -44,7 +49,7 @@ const _packageList = (params) => { |
|
@@ -44,7 +49,7 @@ const _packageList = (params) => { |
44
|
|
49
|
|
45
|
}, { code: 200 }).then(result => {
|
50
|
}, { code: 200 }).then(result => {
|
46
|
|
51
|
|
47
|
- return result;
|
52
|
+ return result;
|
48
|
|
53
|
|
49
|
});
|
54
|
});
|
50
|
};
|
55
|
};
|
|
@@ -52,46 +57,46 @@ const _packageList = (params) => { |
|
@@ -52,46 +57,46 @@ const _packageList = (params) => { |
52
|
const _package = (params) => {
|
57
|
const _package = (params) => {
|
53
|
return api.all([
|
58
|
return api.all([
|
54
|
|
59
|
|
55
|
- _packageAd(params),
|
60
|
+ _packageAd(params),
|
56
|
//_packageList(params)
|
61
|
//_packageList(params)
|
57
|
|
62
|
|
58
|
]).then(result => {
|
63
|
]).then(result => {
|
59
|
|
64
|
|
60
|
- console.log(result[0]);
|
65
|
+ //console.log(result[0]);
|
61
|
|
66
|
|
62
|
- return result;
|
67
|
+ return result;
|
63
|
|
68
|
|
64
|
});
|
69
|
});
|
65
|
};
|
70
|
};
|
66
|
|
71
|
|
67
|
const getBrandByChannel = (channel) => {
|
72
|
const getBrandByChannel = (channel) => {
|
68
|
|
73
|
|
69
|
- let params = {};
|
74
|
+ let params = {};
|
70
|
|
75
|
|
71
|
- /* 根据频道调用接口 */
|
76
|
+ /* 根据频道调用接口 */
|
72
|
switch (channel) {
|
77
|
switch (channel) {
|
73
|
- case '1': // 男生
|
78
|
+ case '1': // 男生
|
74
|
params = {
|
79
|
params = {
|
75
|
- contentCode: CODE_TOPPOS_BOYS,
|
|
|
76
|
- channel: 1
|
80
|
+ contentCode: CODE_TOPPOS_BOYS,
|
|
|
81
|
+ channel: 1
|
77
|
};
|
82
|
};
|
78
|
break;
|
83
|
break;
|
79
|
- case '2': // 女生
|
84
|
+ case '2': // 女生
|
80
|
params = {
|
85
|
params = {
|
81
|
- contentCode: CODE_TOPPOS_GIRLS,
|
|
|
82
|
- channel: 2
|
86
|
+ contentCode: CODE_TOPPOS_GIRLS,
|
|
|
87
|
+ channel: 2
|
83
|
};
|
88
|
};
|
84
|
break;
|
89
|
break;
|
85
|
- case '3': // 潮童
|
90
|
+ case '3': // 潮童
|
86
|
params = {
|
91
|
params = {
|
87
|
- contentCode: CODE_TOPPOS_KIDS,
|
|
|
88
|
- channel: 3
|
92
|
+ contentCode: CODE_TOPPOS_KIDS,
|
|
|
93
|
+ channel: 3
|
89
|
};
|
94
|
};
|
90
|
break;
|
95
|
break;
|
91
|
- case '4': // 创意生活
|
96
|
+ case '4': // 创意生活
|
92
|
params = {
|
97
|
params = {
|
93
|
- contentCode: CODE_TOPPOS_LIFESTYLE,
|
|
|
94
|
- channel: 4
|
98
|
+ contentCode: CODE_TOPPOS_LIFESTYLE,
|
|
|
99
|
+ channel: 4
|
95
|
};
|
100
|
};
|
96
|
break;
|
101
|
break;
|
97
|
default:
|
102
|
default:
|