Showing
5 changed files
with
118 additions
and
66 deletions
1 | -const api = global.yoho.API; | ||
2 | const _ = require('lodash'); | 1 | const _ = require('lodash'); |
3 | const helpers = global.yoho.helpers; | 2 | const helpers = global.yoho.helpers; |
4 | const utils = '../../../utils'; | 3 | const utils = '../../../utils'; |
5 | const productProcess = require(`${utils}/product-process`); | 4 | const productProcess = require(`${utils}/product-process`); |
6 | -const service = global.yoho.ServiceAPI; | 5 | +const serviceAPI = global.yoho.ServiceAPI; |
7 | const co = require('bluebird').coroutine; | 6 | const co = require('bluebird').coroutine; |
8 | 7 | ||
9 | module.exports = class extends global.yoho.BaseModel { | 8 | module.exports = class extends global.yoho.BaseModel { |
@@ -15,11 +14,14 @@ module.exports = class extends global.yoho.BaseModel { | @@ -15,11 +14,14 @@ module.exports = class extends global.yoho.BaseModel { | ||
15 | * 我的邀请码页 | 14 | * 我的邀请码页 |
16 | */ | 15 | */ |
17 | _getPromotionData(uid, isApp) { | 16 | _getPromotionData(uid, isApp) { |
18 | - return api.get('', { | 17 | + return this.get({ |
18 | + data: { | ||
19 | method: 'app.invitecode.my', | 19 | method: 'app.invitecode.my', |
20 | uid: uid | 20 | uid: uid |
21 | - }, { | 21 | + }, |
22 | + param: { | ||
22 | code: 200 | 23 | code: 200 |
24 | + } | ||
23 | }).then((result) => { | 25 | }).then((result) => { |
24 | 26 | ||
25 | if (result && result.code === 200 && result.data) { | 27 | if (result && result.code === 200 && result.data) { |
@@ -39,11 +41,16 @@ module.exports = class extends global.yoho.BaseModel { | @@ -39,11 +41,16 @@ module.exports = class extends global.yoho.BaseModel { | ||
39 | * 资源位 | 41 | * 资源位 |
40 | */ | 42 | */ |
41 | _getTrendPop(contentCode) { | 43 | _getTrendPop(contentCode) { |
42 | - return service.get('operations/api/v5/resource/get', { | 44 | + return this.get({ |
45 | + api: serviceAPI, | ||
46 | + url: 'operations/api/v5/resource/get', | ||
47 | + data: { | ||
43 | content_code: contentCode, | 48 | content_code: contentCode, |
44 | - }, { | 49 | + }, |
50 | + param: { | ||
45 | code: 200, | 51 | code: 200, |
46 | cache: true | 52 | cache: true |
53 | + } | ||
47 | }).then(result => { | 54 | }).then(result => { |
48 | if (result && result.code === 200 && result.data) { | 55 | if (result && result.code === 200 && result.data) { |
49 | return result.data[0]; | 56 | return result.data[0]; |
@@ -54,7 +61,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -54,7 +61,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
54 | } | 61 | } |
55 | 62 | ||
56 | promotionData(uid, isApp, contentCode) { | 63 | promotionData(uid, isApp, contentCode) { |
57 | - return api.all([this._getPromotionData(uid, isApp), this._getTrendPop(contentCode)]).then(result => { | 64 | + return Promise.all([this._getPromotionData(uid, isApp), this._getTrendPop(contentCode)]).then(result => { |
58 | let friendPromotionData = {}; | 65 | let friendPromotionData = {}; |
59 | 66 | ||
60 | friendPromotionData = Object.assign(friendPromotionData, result[0]); | 67 | friendPromotionData = Object.assign(friendPromotionData, result[0]); |
@@ -68,11 +75,13 @@ module.exports = class extends global.yoho.BaseModel { | @@ -68,11 +75,13 @@ module.exports = class extends global.yoho.BaseModel { | ||
68 | * 奖励列表页 | 75 | * 奖励列表页 |
69 | */ | 76 | */ |
70 | rewardList(uid, page, limit, isApp) { | 77 | rewardList(uid, page, limit, isApp) { |
71 | - return api.get('', { | 78 | + return this.get({ |
79 | + data: { | ||
72 | method: 'app.invitecode.history', | 80 | method: 'app.invitecode.history', |
73 | uid: uid, | 81 | uid: uid, |
74 | page: page, | 82 | page: page, |
75 | limit: limit | 83 | limit: limit |
84 | + } | ||
76 | }).then((result) => { | 85 | }).then((result) => { |
77 | 86 | ||
78 | if (result && result.code === 200 && result.data) { | 87 | if (result && result.code === 200 && result.data) { |
@@ -110,10 +119,12 @@ module.exports = class extends global.yoho.BaseModel { | @@ -110,10 +119,12 @@ module.exports = class extends global.yoho.BaseModel { | ||
110 | * 奖励详情页 | 119 | * 奖励详情页 |
111 | */ | 120 | */ |
112 | rewardDeatil(uid, firstOrderUid) { | 121 | rewardDeatil(uid, firstOrderUid) { |
113 | - return api.get('', { | 122 | + return this.get({ |
123 | + data: { | ||
114 | method: 'app.invitecode.detail', | 124 | method: 'app.invitecode.detail', |
115 | uid: uid, | 125 | uid: uid, |
116 | firstOrderUid: firstOrderUid | 126 | firstOrderUid: firstOrderUid |
127 | + } | ||
117 | }).then((result) => { | 128 | }).then((result) => { |
118 | 129 | ||
119 | if (result && result.code === 200) { | 130 | if (result && result.code === 200) { |
@@ -130,13 +141,12 @@ module.exports = class extends global.yoho.BaseModel { | @@ -130,13 +141,12 @@ module.exports = class extends global.yoho.BaseModel { | ||
130 | * 设置我的潮流口令 | 141 | * 设置我的潮流口令 |
131 | */ | 142 | */ |
132 | setTrendWord(uid, trendWord) { | 143 | setTrendWord(uid, trendWord) { |
133 | - return api.get('', { | 144 | + return this.get({ |
145 | + data: { | ||
134 | method: 'app.trendword.update', | 146 | method: 'app.trendword.update', |
135 | uid: uid, | 147 | uid: uid, |
136 | trendWord: trendWord | 148 | trendWord: trendWord |
137 | - }).then((result) => { | ||
138 | - | ||
139 | - return result; | 149 | + } |
140 | }); | 150 | }); |
141 | } | 151 | } |
142 | 152 | ||
@@ -144,11 +154,13 @@ module.exports = class extends global.yoho.BaseModel { | @@ -144,11 +154,13 @@ module.exports = class extends global.yoho.BaseModel { | ||
144 | * 好友邀请商品 | 154 | * 好友邀请商品 |
145 | */ | 155 | */ |
146 | _hotGoods(yhChannel, limit, page) { | 156 | _hotGoods(yhChannel, limit, page) { |
147 | - return api.get('', { | 157 | + return this.get({ |
158 | + data: { | ||
148 | method: 'app.search.top', | 159 | method: 'app.search.top', |
149 | yh_channel: yhChannel, | 160 | yh_channel: yhChannel, |
150 | page: page, | 161 | page: page, |
151 | limit: limit | 162 | limit: limit |
163 | + } | ||
152 | }).then((result) => { | 164 | }).then((result) => { |
153 | if (result && result.code === 200) { | 165 | if (result && result.code === 200) { |
154 | 166 | ||
@@ -163,19 +175,20 @@ module.exports = class extends global.yoho.BaseModel { | @@ -163,19 +175,20 @@ module.exports = class extends global.yoho.BaseModel { | ||
163 | * 好友邀请信息 | 175 | * 好友邀请信息 |
164 | */ | 176 | */ |
165 | inviteUserInfo(inviteCode) { | 177 | inviteUserInfo(inviteCode) { |
166 | - return api.get('', { | 178 | + return this.get({ |
179 | + data: { | ||
167 | method: 'app.invitecode.userinfo', | 180 | method: 'app.invitecode.userinfo', |
168 | inviteCode: inviteCode | 181 | inviteCode: inviteCode |
169 | - }).then((result) => { | ||
170 | - | ||
171 | - return result; | 182 | + } |
172 | }); | 183 | }); |
173 | } | 184 | } |
174 | 185 | ||
175 | _getProductList(skns) { | 186 | _getProductList(skns) { |
176 | - return api.get('', { | 187 | + return this.get({ |
188 | + data: { | ||
177 | method: 'app.search.li', | 189 | method: 'app.search.li', |
178 | query: skns | 190 | query: skns |
191 | + } | ||
179 | }).then((result) => { | 192 | }).then((result) => { |
180 | if (result && result.code === 200) { | 193 | if (result && result.code === 200) { |
181 | return result.data; | 194 | return result.data; |
@@ -199,9 +212,12 @@ module.exports = class extends global.yoho.BaseModel { | @@ -199,9 +212,12 @@ module.exports = class extends global.yoho.BaseModel { | ||
199 | if (!token) { | 212 | if (!token) { |
200 | return Promise.resolve({}); | 213 | return Promise.resolve({}); |
201 | } | 214 | } |
202 | - return api.get('', { | 215 | + |
216 | + return this.get({ | ||
217 | + data: { | ||
203 | method: 'app.SpaceOrders.getProductList', | 218 | method: 'app.SpaceOrders.getProductList', |
204 | order_token: token | 219 | order_token: token |
220 | + } | ||
205 | }).then((result) => { | 221 | }).then((result) => { |
206 | let self = this; | 222 | let self = this; |
207 | 223 | ||
@@ -247,7 +263,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -247,7 +263,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
247 | * 好友邀请页 | 263 | * 好友邀请页 |
248 | */ | 264 | */ |
249 | friendInvite(inciteCode, yhChannel, limit, page, contentCode, token) { | 265 | friendInvite(inciteCode, yhChannel, limit, page, contentCode, token) { |
250 | - return api.all([ | 266 | + return Promise.all([ |
251 | this.inviteUserInfo(inciteCode), | 267 | this.inviteUserInfo(inciteCode), |
252 | this._hotGoods(yhChannel, limit, page), | 268 | this._hotGoods(yhChannel, limit, page), |
253 | this._getTrendPop(contentCode), | 269 | this._getTrendPop(contentCode), |
@@ -272,11 +288,14 @@ module.exports = class extends global.yoho.BaseModel { | @@ -272,11 +288,14 @@ module.exports = class extends global.yoho.BaseModel { | ||
272 | } | 288 | } |
273 | 289 | ||
274 | reloadQrcode(uid) { | 290 | reloadQrcode(uid) { |
275 | - return api.get('', { | 291 | + return this.get({ |
292 | + data: { | ||
276 | method: 'app.invitecode.my', | 293 | method: 'app.invitecode.my', |
277 | uid: uid | 294 | uid: uid |
278 | - }, { | 295 | + }, |
296 | + param: { | ||
279 | code: 200 | 297 | code: 200 |
298 | + } | ||
280 | }).then((result) => { | 299 | }).then((result) => { |
281 | 300 | ||
282 | if (result && result.code === 200 && result.data) { | 301 | if (result && result.code === 200 && result.data) { |
1 | 'use strict'; | 1 | 'use strict'; |
2 | const _ = require('lodash'); | 2 | const _ = require('lodash'); |
3 | -const api = global.yoho.API; | ||
4 | const helpers = global.yoho.helpers; | 3 | const helpers = global.yoho.helpers; |
5 | 4 | ||
6 | const _getProductBySkns = function(productObj, extraParams) { | 5 | const _getProductBySkns = function(productObj, extraParams) { |
7 | - return api.get('', { | 6 | + return this.get({ |
7 | + data: { | ||
8 | productSkn: productObj.defaultSkns, | 8 | productSkn: productObj.defaultSkns, |
9 | method: 'h5.product.batch' | 9 | method: 'h5.product.batch' |
10 | - }, { | 10 | + }, |
11 | + param: { | ||
11 | cache: true | 12 | cache: true |
13 | + } | ||
12 | }).then((result) => { | 14 | }).then((result) => { |
13 | productObj.defaultPros = []; | 15 | productObj.defaultPros = []; |
14 | if (result && result.data && result.data.product_list && result.code === 200) { | 16 | if (result && result.data && result.data.product_list && result.code === 200) { |
@@ -40,9 +42,11 @@ const _getProductBySkns = function(productObj, extraParams) { | @@ -40,9 +42,11 @@ const _getProductBySkns = function(productObj, extraParams) { | ||
40 | * 获取店铺组店铺数据 | 42 | * 获取店铺组店铺数据 |
41 | */ | 43 | */ |
42 | const _getShopGroup = (shopRawData) => { | 44 | const _getShopGroup = (shopRawData) => { |
43 | - return api.get('', { | 45 | + return this.get({ |
46 | + data: { | ||
44 | method: 'app.shops.batchGetShops', | 47 | method: 'app.shops.batchGetShops', |
45 | shop_ids: shopRawData.defaultShopIds | 48 | shop_ids: shopRawData.defaultShopIds |
49 | + } | ||
46 | }).then(result => { | 50 | }).then(result => { |
47 | let renderData = _.get(result, 'data', []); | 51 | let renderData = _.get(result, 'data', []); |
48 | 52 | ||
@@ -72,16 +76,25 @@ class featureModel extends global.yoho.BaseModel { | @@ -72,16 +76,25 @@ class featureModel extends global.yoho.BaseModel { | ||
72 | let shopGroups = []; | 76 | let shopGroups = []; |
73 | 77 | ||
74 | if (params.type === 'preview') { // 开发/预览模式 | 78 | if (params.type === 'preview') { // 开发/预览模式 |
75 | - data = yield api.get('', { | 79 | + data = yield this.get({ |
80 | + data: { | ||
76 | method: 'app.activity.template.ignoreCache', | 81 | method: 'app.activity.template.ignoreCache', |
77 | activity_id: params.code | 82 | activity_id: params.code |
83 | + }, | ||
84 | + param: { | ||
85 | + cache: true | ||
86 | + } | ||
78 | }); | 87 | }); |
79 | } else { | 88 | } else { |
80 | - data = yield api.get('', { // 生产模式 | 89 | + // 生产模式 |
90 | + data = yield this.get({ | ||
91 | + data: { | ||
81 | method: 'app.activity.template', | 92 | method: 'app.activity.template', |
82 | activity_id: params.code | 93 | activity_id: params.code |
83 | - }, { | 94 | + }, |
95 | + param: { | ||
84 | cache: true | 96 | cache: true |
97 | + } | ||
85 | }); | 98 | }); |
86 | } | 99 | } |
87 | if (!data) { | 100 | if (!data) { |
@@ -118,10 +118,6 @@ exports.getGoods = cate => { | @@ -118,10 +118,6 @@ exports.getGoods = cate => { | ||
118 | } | 118 | } |
119 | }); | 119 | }); |
120 | 120 | ||
121 | - // console.log(data.goods1.length) | ||
122 | - // console.log(data.goods2.length) | ||
123 | - // console.log(data.goods3.length) | ||
124 | - | ||
125 | return { | 121 | return { |
126 | code: 200, | 122 | code: 200, |
127 | data | 123 | data |
@@ -107,10 +107,6 @@ exports.getGoods = cate => { | @@ -107,10 +107,6 @@ exports.getGoods = cate => { | ||
107 | } | 107 | } |
108 | }); | 108 | }); |
109 | 109 | ||
110 | - // console.log(data.goods1.length) | ||
111 | - // console.log(data.goods2.length) | ||
112 | - // console.log(data.goods3.length) | ||
113 | - | ||
114 | return { | 110 | return { |
115 | code: 200, | 111 | code: 200, |
116 | data | 112 | data |
@@ -5,7 +5,6 @@ | @@ -5,7 +5,6 @@ | ||
5 | */ | 5 | */ |
6 | 'use strict'; | 6 | 'use strict'; |
7 | const serviceAPI = global.yoho.ServiceAPI; | 7 | const serviceAPI = global.yoho.ServiceAPI; |
8 | -const api = global.yoho.API; | ||
9 | const _ = require('lodash'); | 8 | const _ = require('lodash'); |
10 | const helpers = global.yoho.helpers; | 9 | const helpers = global.yoho.helpers; |
11 | 10 | ||
@@ -74,8 +73,13 @@ class DetailModel extends global.yoho.BaseModel { | @@ -74,8 +73,13 @@ class DetailModel extends global.yoho.BaseModel { | ||
74 | _getLeftNav(choosed) { | 73 | _getLeftNav(choosed) { |
75 | choosed = choosed || 'all'; | 74 | choosed = choosed || 'all'; |
76 | 75 | ||
77 | - return serviceAPI.get('operations/api/v6/category/getCategory', {}, { | 76 | + return this.get({ |
77 | + api: serviceAPI, | ||
78 | + url: 'operations/api/v6/category/getCategory', | ||
79 | + data: {}, | ||
80 | + param: { | ||
78 | cache: true | 81 | cache: true |
82 | + } | ||
79 | }).then(result => { | 83 | }).then(result => { |
80 | if (result && result.code === 200) { | 84 | if (result && result.code === 200) { |
81 | 85 | ||
@@ -85,8 +89,10 @@ class DetailModel extends global.yoho.BaseModel { | @@ -85,8 +89,10 @@ class DetailModel extends global.yoho.BaseModel { | ||
85 | } | 89 | } |
86 | 90 | ||
87 | _getShareData(id) { | 91 | _getShareData(id) { |
88 | - return serviceAPI.get('guang/api/v6/share/guang', { | ||
89 | - id: id | 92 | + return this.get({ |
93 | + api: serviceAPI, | ||
94 | + url: 'guang/api/v6/share/guang', | ||
95 | + data: {id: id} | ||
90 | }).then(result => { | 96 | }).then(result => { |
91 | if (result && result.code === 200) { | 97 | if (result && result.code === 200) { |
92 | 98 | ||
@@ -100,10 +106,13 @@ class DetailModel extends global.yoho.BaseModel { | @@ -100,10 +106,13 @@ class DetailModel extends global.yoho.BaseModel { | ||
100 | * @param {*} articleId | 106 | * @param {*} articleId |
101 | */ | 107 | */ |
102 | _getArticle(articleId) { | 108 | _getArticle(articleId) { |
103 | - return serviceAPI.get(`${URI_PACKAGE_ARTICLE}getArticle`, { | ||
104 | - article_id: articleId | ||
105 | - }, { | 109 | + return this.get({ |
110 | + api: serviceAPI, | ||
111 | + url: `${URI_PACKAGE_ARTICLE}getArticle`, | ||
112 | + data: {article_id: articleId}, | ||
113 | + param: { | ||
106 | cache: true | 114 | cache: true |
115 | + } | ||
107 | }); | 116 | }); |
108 | } | 117 | } |
109 | 118 | ||
@@ -112,10 +121,13 @@ class DetailModel extends global.yoho.BaseModel { | @@ -112,10 +121,13 @@ class DetailModel extends global.yoho.BaseModel { | ||
112 | * @param {*} authorId | 121 | * @param {*} authorId |
113 | */ | 122 | */ |
114 | _getAuthor(authorId) { | 123 | _getAuthor(authorId) { |
115 | - return serviceAPI.get(`${URI_PACKAGE_AUTHOR}getAuthor`, { | ||
116 | - author_id: authorId | ||
117 | - }, { | 124 | + return this.get({ |
125 | + api: serviceAPI, | ||
126 | + url: `${URI_PACKAGE_AUTHOR}getAuthor`, | ||
127 | + data: {author_id: authorId}, | ||
128 | + param: { | ||
118 | cache: true | 129 | cache: true |
130 | + } | ||
119 | }); | 131 | }); |
120 | } | 132 | } |
121 | 133 | ||
@@ -124,10 +136,13 @@ class DetailModel extends global.yoho.BaseModel { | @@ -124,10 +136,13 @@ class DetailModel extends global.yoho.BaseModel { | ||
124 | * @param {*} articleId | 136 | * @param {*} articleId |
125 | */ | 137 | */ |
126 | _getArticleContent(articleId) { | 138 | _getArticleContent(articleId) { |
127 | - return serviceAPI.get(`${URI_PACKAGE_ARTICLE}getArticleContent`, { | ||
128 | - article_id: articleId | ||
129 | - }, { | 139 | + return this.get({ |
140 | + api: serviceAPI, | ||
141 | + url: `${URI_PACKAGE_ARTICLE}getArticleContent`, | ||
142 | + data: {article_id: articleId}, | ||
143 | + param: { | ||
130 | cache: true | 144 | cache: true |
145 | + } | ||
131 | }); | 146 | }); |
132 | } | 147 | } |
133 | 148 | ||
@@ -136,10 +151,13 @@ class DetailModel extends global.yoho.BaseModel { | @@ -136,10 +151,13 @@ class DetailModel extends global.yoho.BaseModel { | ||
136 | * @param {*} articleId | 151 | * @param {*} articleId |
137 | */ | 152 | */ |
138 | _getBrand(articleId) { | 153 | _getBrand(articleId) { |
139 | - return serviceAPI.get(`${URI_PACKAGE_ARTICLE}getBrand`, { | ||
140 | - article_id: articleId | ||
141 | - }, { | 154 | + return this.get({ |
155 | + api: serviceAPI, | ||
156 | + url: `${URI_PACKAGE_ARTICLE}getBrand`, | ||
157 | + data: {article_id: articleId}, | ||
158 | + param: { | ||
142 | cache: true | 159 | cache: true |
160 | + } | ||
143 | }); | 161 | }); |
144 | } | 162 | } |
145 | 163 | ||
@@ -149,13 +167,18 @@ class DetailModel extends global.yoho.BaseModel { | @@ -149,13 +167,18 @@ class DetailModel extends global.yoho.BaseModel { | ||
149 | * @param {*} tag | 167 | * @param {*} tag |
150 | */ | 168 | */ |
151 | _getOtherArticle(articleId, tag) { | 169 | _getOtherArticle(articleId, tag) { |
152 | - return serviceAPI.get(`${URI_PACKAGE_ARTICLE}getOtherArticle`, { | 170 | + return this.get({ |
171 | + api: serviceAPI, | ||
172 | + url: `${URI_PACKAGE_ARTICLE}getOtherArticle`, | ||
173 | + data: { | ||
153 | article_id: articleId, | 174 | article_id: articleId, |
154 | tags: tag, | 175 | tags: tag, |
155 | offset: 0, | 176 | offset: 0, |
156 | limit: 3 | 177 | limit: 3 |
157 | - }, { | 178 | + }, |
179 | + param: { | ||
158 | cache: true | 180 | cache: true |
181 | + } | ||
159 | }); | 182 | }); |
160 | } | 183 | } |
161 | 184 | ||
@@ -163,10 +186,12 @@ class DetailModel extends global.yoho.BaseModel { | @@ -163,10 +186,12 @@ class DetailModel extends global.yoho.BaseModel { | ||
163 | * APP 获取微信模块 | 186 | * APP 获取微信模块 |
164 | */ | 187 | */ |
165 | _getSingleTemplateWechat() { | 188 | _getSingleTemplateWechat() { |
166 | - return api.get('', { | 189 | + return this.get({ |
190 | + data: { | ||
167 | method: 'app.resources.getSingleTemplate', | 191 | method: 'app.resources.getSingleTemplate', |
168 | module: 'wechat', | 192 | module: 'wechat', |
169 | key: 'guang_detail_wechat' | 193 | key: 'guang_detail_wechat' |
194 | + } | ||
170 | }); | 195 | }); |
171 | } | 196 | } |
172 | 197 | ||
@@ -319,13 +344,16 @@ class DetailModel extends global.yoho.BaseModel { | @@ -319,13 +344,16 @@ class DetailModel extends global.yoho.BaseModel { | ||
319 | * @return {[object]} | 344 | * @return {[object]} |
320 | */ | 345 | */ |
321 | intro(id) { | 346 | intro(id) { |
322 | - let param = { | 347 | + return this.get({ |
348 | + api: serviceAPI, | ||
349 | + url: `${URI_PACKAGE_ARTICLE}getArticleContent`, | ||
350 | + data: { | ||
323 | article_id: id, | 351 | article_id: id, |
324 | client_type: 'h5' | 352 | client_type: 'h5' |
325 | - }; | ||
326 | - | ||
327 | - return serviceAPI.get(`${URI_PACKAGE_ARTICLE}getArticleContent`, param, { | 353 | + }, |
354 | + param: { | ||
328 | cache: true | 355 | cache: true |
356 | + } | ||
329 | }); | 357 | }); |
330 | } | 358 | } |
331 | 359 | ||
@@ -335,15 +363,15 @@ class DetailModel extends global.yoho.BaseModel { | @@ -335,15 +363,15 @@ class DetailModel extends global.yoho.BaseModel { | ||
335 | * @return {[type]} | 363 | * @return {[type]} |
336 | */ | 364 | */ |
337 | productInfoBySkns(sknString) { | 365 | productInfoBySkns(sknString) { |
338 | - // 调用搜索接口 | ||
339 | - let param = { | 366 | + return this.get({ |
367 | + data: { | ||
340 | method: 'h5.product.batch', | 368 | method: 'h5.product.batch', |
341 | productSkn: sknString, | 369 | productSkn: sknString, |
342 | order: 's_t_desc' | 370 | order: 's_t_desc' |
343 | - }; | ||
344 | - | ||
345 | - return api.get('', param, { | 371 | + }, |
372 | + param: { | ||
346 | cache: true | 373 | cache: true |
374 | + } | ||
347 | }).then(result => { | 375 | }).then(result => { |
348 | return _.get(result, 'data.product_list', []); | 376 | return _.get(result, 'data.product_list', []); |
349 | }); | 377 | }); |
-
Please register or login to post a comment