...
|
...
|
@@ -71,16 +71,7 @@ class CouponList extends global.yoho.BaseModel { |
|
|
};
|
|
|
|
|
|
return this.get(options).then(result => {
|
|
|
if (result && result.code === 200 && result.data && result.data.list) {
|
|
|
for (let item of result.data.list) {
|
|
|
item.template_name === 'single_image' &&
|
|
|
item.data.length === 1 &&
|
|
|
(item.singleOne = true);
|
|
|
}
|
|
|
return resourcesProcess(result.data.list);
|
|
|
} else {
|
|
|
return result;
|
|
|
}
|
|
|
return this.resData(result);
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -95,19 +86,23 @@ class CouponList extends global.yoho.BaseModel { |
|
|
};
|
|
|
|
|
|
return this.get(options).then(result => {
|
|
|
if (result && result.code === 200 && result.data && result.data.list) {
|
|
|
for (let item of result.data.list) {
|
|
|
item.template_name === 'single_image' &&
|
|
|
item.data.length === 1 &&
|
|
|
(item.singleOne = true);
|
|
|
}
|
|
|
return resourcesProcess(result.data.list);
|
|
|
} else {
|
|
|
return result;
|
|
|
}
|
|
|
return this.resData(result);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
resData(result) {
|
|
|
if (result && result.code === 200 && result.data && result.data.list) {
|
|
|
for (let item of result.data.list) {
|
|
|
item.template_name === 'single_image' &&
|
|
|
item.data.length === 1 &&
|
|
|
(item.singleOne = true);
|
|
|
}
|
|
|
return resourcesProcess(result.data.list);
|
|
|
} else {
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
index(params) {
|
|
|
return Promise.all([
|
|
|
this.getCoupons(params),
|
...
|
...
|
|