|
@@ -10,6 +10,7 @@ const api = global.yoho.API; |
|
@@ -10,6 +10,7 @@ const api = global.yoho.API; |
10
|
const serviceAPI = global.yoho.ServiceAPI;
|
10
|
const serviceAPI = global.yoho.ServiceAPI;
|
11
|
const utils = '../../../utils';
|
11
|
const utils = '../../../utils';
|
12
|
const productProcess = require(`${utils}/product-process`);
|
12
|
const productProcess = require(`${utils}/product-process`);
|
|
|
13
|
+const _ = require('lodash');
|
13
|
|
14
|
|
14
|
// 资源位
|
15
|
// 资源位
|
15
|
const _getBanner = (param) => {
|
16
|
const _getBanner = (param) => {
|
|
@@ -99,6 +100,16 @@ const getPayCod = (param) => { |
|
@@ -99,6 +100,16 @@ const getPayCod = (param) => { |
99
|
resu.banner = result[0];
|
100
|
resu.banner = result[0];
|
100
|
}
|
101
|
}
|
101
|
|
102
|
|
|
|
103
|
+ if (result && result[0]) {
|
|
|
104
|
+ _.forEach(result[0], function(val) {
|
|
|
105
|
+ if (val.template_name == 'single_image') {
|
|
|
106
|
+ resu.banner = val;
|
|
|
107
|
+ } else if (val.template_name == 'text') {
|
|
|
108
|
+ resu.prompt = val.data;
|
|
|
109
|
+ }
|
|
|
110
|
+ })
|
|
|
111
|
+ }
|
|
|
112
|
+
|
102
|
if (result && result[1]) {
|
113
|
if (result && result[1]) {
|
103
|
resu.othersBuy = result[1];
|
114
|
resu.othersBuy = result[1];
|
104
|
}
|
115
|
}
|
|
@@ -135,8 +146,15 @@ const getPayAli = (param) => { |
|
@@ -135,8 +146,15 @@ const getPayAli = (param) => { |
135
|
resu.banner = result[0][0];
|
146
|
resu.banner = result[0][0];
|
136
|
}
|
147
|
}
|
137
|
|
148
|
|
138
|
- if (result && result[0] && result[0][1]) {
|
|
|
139
|
- resu.prompt = result[0][1].data;
|
149
|
+ if (result && result[0]) {
|
|
|
150
|
+ _.forEach(result[0], function(val) {
|
|
|
151
|
+ if (val.template_name == 'single_image') {
|
|
|
152
|
+ resu.banner = val;
|
|
|
153
|
+ } else if (val.template_name == 'text') {
|
|
|
154
|
+ resu.prompt = val.data;
|
|
|
155
|
+ }
|
|
|
156
|
+ })
|
|
|
157
|
+
|
140
|
}
|
158
|
}
|
141
|
|
159
|
|
142
|
if (result && result[1]) {
|
160
|
if (result && result[1]) {
|