|
@@ -60,15 +60,20 @@ const shop = { |
|
@@ -60,15 +60,20 @@ const shop = { |
60
|
q.page = q.page || 1;
|
60
|
q.page = q.page || 1;
|
61
|
|
61
|
|
62
|
ShopData.getShopHeadData(domain, uid).then(result => {
|
62
|
ShopData.getShopHeadData(domain, uid).then(result => {
|
|
|
63
|
+
|
63
|
data.banner = result;
|
64
|
data.banner = result;
|
64
|
- q.brand = result.brandId;
|
|
|
65
|
- q.shop_id = result.shopId;
|
|
|
66
|
- nav.push({
|
|
|
67
|
- name: result.name
|
|
|
68
|
- });
|
65
|
+ if (result.brandId) {
|
|
|
66
|
+ q.brand = result.brandId;
|
|
|
67
|
+ q.shop_id = result.shopId;
|
|
|
68
|
+ nav.push({
|
|
|
69
|
+ name: result.name
|
|
|
70
|
+ });
|
|
|
71
|
+ } else {
|
|
|
72
|
+ res.status(404);
|
|
|
73
|
+ return Promise.reject('brand not found');
|
|
|
74
|
+ }
|
69
|
}).then(() => {
|
75
|
}).then(() => {
|
70
|
return Search.queryProductOfBrand(q).then(result => {
|
76
|
return Search.queryProductOfBrand(q).then(result => {
|
71
|
-
|
|
|
72
|
if (result && result.code === 200 && result.data) {
|
77
|
if (result && result.code === 200 && result.data) {
|
73
|
let ret = camelCase(result.data);
|
78
|
let ret = camelCase(result.data);
|
74
|
|
79
|
|
|
@@ -94,7 +99,7 @@ const shop = { |
|
@@ -94,7 +99,7 @@ const shop = { |
94
|
order: q.order
|
99
|
order: q.order
|
95
|
}));
|
100
|
}));
|
96
|
} else {
|
101
|
} else {
|
97
|
- return Promise.reject('query product error');
|
102
|
+ return Promise.reject('query shop index error');
|
98
|
}
|
103
|
}
|
99
|
});
|
104
|
});
|
100
|
}).catch(next);
|
105
|
}).catch(next);
|