Showing
1 changed file
with
42 additions
and
12 deletions
@@ -7,6 +7,9 @@ | @@ -7,6 +7,9 @@ | ||
7 | const api = global.yoho.API; | 7 | const api = global.yoho.API; |
8 | const config = global.yoho.config; | 8 | const config = global.yoho.config; |
9 | 9 | ||
10 | +/** | ||
11 | + * 商品的 banner | ||
12 | + */ | ||
10 | const getProductBannerAsync = (pid) => { | 13 | const getProductBannerAsync = (pid) => { |
11 | return api.get('', { | 14 | return api.get('', { |
12 | method: 'web.productBanner.data', | 15 | method: 'web.productBanner.data', |
@@ -15,7 +18,10 @@ const getProductBannerAsync = (pid) => { | @@ -15,7 +18,10 @@ const getProductBannerAsync = (pid) => { | ||
15 | 18 | ||
16 | }; | 19 | }; |
17 | 20 | ||
18 | -const sizeInfoAsync = skn => { | 21 | +/** |
22 | + * 商品尺寸 | ||
23 | + */ | ||
24 | +const sizeInfoAsync = (skn) => { | ||
19 | return api.get('', { | 25 | return api.get('', { |
20 | method: 'h5.product.intro', | 26 | method: 'h5.product.intro', |
21 | productskn: skn | 27 | productskn: skn |
@@ -23,15 +29,20 @@ const sizeInfoAsync = skn => { | @@ -23,15 +29,20 @@ const sizeInfoAsync = skn => { | ||
23 | 29 | ||
24 | }; | 30 | }; |
25 | 31 | ||
26 | -// 退换支持 | ||
27 | -const isSupportReturnedSale = skn => { | 32 | +/** |
33 | + * 特殊商品退换货 | ||
34 | + */ | ||
35 | +const isSupportReturnedSale = (skn) => { | ||
28 | return api.get('', { | 36 | return api.get('', { |
29 | method: 'app.product.refundExchange', | 37 | method: 'app.product.refundExchange', |
30 | product_skn: skn | 38 | product_skn: skn |
31 | }, config.apiCache); | 39 | }, config.apiCache); |
32 | }; | 40 | }; |
33 | 41 | ||
34 | -const getProductComfortAsync = pid => { | 42 | +/** |
43 | + * 商品舒适度 | ||
44 | + */ | ||
45 | +const getProductComfortAsync = (pid) => { | ||
35 | return api.get('', { | 46 | return api.get('', { |
36 | method: 'web.productComfort.data', | 47 | method: 'web.productComfort.data', |
37 | product_id: pid | 48 | product_id: pid |
@@ -39,14 +50,20 @@ const getProductComfortAsync = pid => { | @@ -39,14 +50,20 @@ const getProductComfortAsync = pid => { | ||
39 | 50 | ||
40 | }; | 51 | }; |
41 | 52 | ||
42 | -const getProductModelCardAsync = pid => { | 53 | +/** |
54 | + * 模特卡 | ||
55 | + */ | ||
56 | +const getProductModelCardAsync = (pid) => { | ||
43 | return api.get('', { | 57 | return api.get('', { |
44 | method: 'web.productModelcard.list', | 58 | method: 'web.productModelcard.list', |
45 | product_id: pid | 59 | product_id: pid |
46 | }, config.apiCache); | 60 | }, config.apiCache); |
47 | }; | 61 | }; |
48 | 62 | ||
49 | -const getProductModelTryAsync = skn => { | 63 | +/** |
64 | + * 模特试穿 | ||
65 | + */ | ||
66 | +const getProductModelTryAsync = (skn) => { | ||
50 | return api.get('', { | 67 | return api.get('', { |
51 | method: 'web.productModelTry.data', | 68 | method: 'web.productModelTry.data', |
52 | product_skn: skn | 69 | product_skn: skn |
@@ -55,8 +72,6 @@ const getProductModelTryAsync = skn => { | @@ -55,8 +72,6 @@ const getProductModelTryAsync = skn => { | ||
55 | 72 | ||
56 | /** | 73 | /** |
57 | * 获得产品信息 | 74 | * 获得产品信息 |
58 | - * @param pid | ||
59 | - * @returns {Promise.<type>} | ||
60 | */ | 75 | */ |
61 | const getProductAsync = (pid, uid, isStudents, vipLevel) => { | 76 | const getProductAsync = (pid, uid, isStudents, vipLevel) => { |
62 | let params = { | 77 | let params = { |
@@ -78,6 +93,9 @@ const getProductAsync = (pid, uid, isStudents, vipLevel) => { | @@ -78,6 +93,9 @@ const getProductAsync = (pid, uid, isStudents, vipLevel) => { | ||
78 | return api.get('', params, config.apiCache); | 93 | return api.get('', params, config.apiCache); |
79 | }; | 94 | }; |
80 | 95 | ||
96 | +/** | ||
97 | + * 促销信息 | ||
98 | + */ | ||
81 | const getPromotionAsync = (skn) => { | 99 | const getPromotionAsync = (skn) => { |
82 | let params = { | 100 | let params = { |
83 | method: 'app.product.promotion', | 101 | method: 'app.product.promotion', |
@@ -87,6 +105,9 @@ const getPromotionAsync = (skn) => { | @@ -87,6 +105,9 @@ const getPromotionAsync = (skn) => { | ||
87 | return api.get('', params, config.apiCache); | 105 | return api.get('', params, config.apiCache); |
88 | }; | 106 | }; |
89 | 107 | ||
108 | +/** | ||
109 | + * 限购商品 | ||
110 | + */ | ||
90 | const getLimitedProductStatusAsync = (code, uid, skn) => { | 111 | const getLimitedProductStatusAsync = (code, uid, skn) => { |
91 | let params = { | 112 | let params = { |
92 | method: 'app.limitProduct.productStatus', | 113 | method: 'app.limitProduct.productStatus', |
@@ -105,9 +126,7 @@ const getLimitedProductStatusAsync = (code, uid, skn) => { | @@ -105,9 +126,7 @@ const getLimitedProductStatusAsync = (code, uid, skn) => { | ||
105 | }; | 126 | }; |
106 | 127 | ||
107 | /** | 128 | /** |
108 | - * | ||
109 | - * @param skn product_skn | ||
110 | - * @param sid shop_id | 129 | + * 店铺推荐 |
111 | */ | 130 | */ |
112 | const getShopRecommendAsync = (skn, page, limit) => { | 131 | const getShopRecommendAsync = (skn, page, limit) => { |
113 | return api.get('', { | 132 | return api.get('', { |
@@ -118,6 +137,16 @@ const getShopRecommendAsync = (skn, page, limit) => { | @@ -118,6 +137,16 @@ const getShopRecommendAsync = (skn, page, limit) => { | ||
118 | }); | 137 | }); |
119 | }; | 138 | }; |
120 | 139 | ||
140 | +/** | ||
141 | + * 套餐和量贩 | ||
142 | + */ | ||
143 | +const getBundleAsync = (skn) => { | ||
144 | + return api.get('', { | ||
145 | + method: 'query.product.bundleSkn', | ||
146 | + product_skn: skn | ||
147 | + }); | ||
148 | +}; | ||
149 | + | ||
121 | module.exports = { | 150 | module.exports = { |
122 | getProductBannerAsync, | 151 | getProductBannerAsync, |
123 | sizeInfoAsync, | 152 | sizeInfoAsync, |
@@ -128,5 +157,6 @@ module.exports = { | @@ -128,5 +157,6 @@ module.exports = { | ||
128 | getPromotionAsync, | 157 | getPromotionAsync, |
129 | isSupportReturnedSale, | 158 | isSupportReturnedSale, |
130 | getLimitedProductStatusAsync, | 159 | getLimitedProductStatusAsync, |
131 | - getShopRecommendAsync | 160 | + getShopRecommendAsync, |
161 | + getBundleAsync | ||
132 | }; | 162 | }; |
-
Please register or login to post a comment