Merge remote-tracking branch 'origin/gray'
Showing
9 changed files
with
23 additions
and
15 deletions
@@ -454,17 +454,13 @@ class BuyNowController { | @@ -454,17 +454,13 @@ class BuyNowController { | ||
454 | } | 454 | } |
455 | 455 | ||
456 | /** | 456 | /** |
457 | - * 输入优惠券码使用优惠券 | 457 | + * 兑换优惠券 |
458 | */ | 458 | */ |
459 | useCouponCode(req, res, next) { | 459 | useCouponCode(req, res, next) { |
460 | co(function* () { | 460 | co(function* () { |
461 | - let result = yield req.ctx(BuyNowModel).usePromotionCode({ | ||
462 | - uid: req.user.uid, | ||
463 | - product_sku: req.body.product_sku, | ||
464 | - sku_type: req.body.sku_type, | ||
465 | - buy_number: req.body.buy_number, | ||
466 | - promotion_code: req.body.promotion_code | ||
467 | - }); | 461 | + let result = yield req.ctx(shoppingModel).useCoupon( |
462 | + req.user.uid, req.body.couponCode | ||
463 | + ); | ||
468 | 464 | ||
469 | res.json(result); | 465 | res.json(result); |
470 | })().catch(next); | 466 | })().catch(next); |
@@ -267,7 +267,8 @@ const payAli = (req, res, next) => { | @@ -267,7 +267,8 @@ const payAli = (req, res, next) => { | ||
267 | uid: req.user.uid, | 267 | uid: req.user.uid, |
268 | udid: req.cookies.udid || require('yoho-md5')(req.ip) || 'yoho', | 268 | udid: req.cookies.udid || require('yoho-md5')(req.ip) || 'yoho', |
269 | orderCode: req.query.out_trade_no, | 269 | orderCode: req.query.out_trade_no, |
270 | - contentCode: '78d0fb6c97d691863286edcb4d8abfa9' | 270 | + contentCode: '78d0fb6c97d691863286edcb4d8abfa9', |
271 | + client_id: req.cookies._yasvd || '' | ||
271 | }; | 272 | }; |
272 | 273 | ||
273 | // 如果没有uid,跳转到首页 | 274 | // 如果没有uid,跳转到首页 |
@@ -44,7 +44,7 @@ class payModel extends global.yoho.BaseModel { | @@ -44,7 +44,7 @@ class payModel extends global.yoho.BaseModel { | ||
44 | return this.get({data: { | 44 | return this.get({data: { |
45 | method: 'app.recommend.purchased', | 45 | method: 'app.recommend.purchased', |
46 | productSkn: param.skn, | 46 | productSkn: param.skn, |
47 | - udid: param.uid, | 47 | + uid: param.uid, |
48 | rec_pos: '100005', | 48 | rec_pos: '100005', |
49 | limit: 2, | 49 | limit: 2, |
50 | client_id: param.client_id | 50 | client_id: param.client_id |
@@ -267,7 +267,7 @@ class shoppingModel extends global.yoho.BaseModel { | @@ -267,7 +267,7 @@ class shoppingModel extends global.yoho.BaseModel { | ||
267 | } | 267 | } |
268 | 268 | ||
269 | /** | 269 | /** |
270 | - * 购物车结算--使用优惠券 | 270 | + * 购物车结算--兑换优惠券 |
271 | * @param uid int 用户uid | 271 | * @param uid int 用户uid |
272 | * @param couponCode string 优惠券代码 | 272 | * @param couponCode string 优惠券代码 |
273 | * @return | 273 | * @return |
@@ -20,6 +20,11 @@ module.exports = (limiter, policy) => { | @@ -20,6 +20,11 @@ module.exports = (limiter, policy) => { | ||
20 | 20 | ||
21 | try { | 21 | try { |
22 | blacklist = JSON.parse(args[0]); | 22 | blacklist = JSON.parse(args[0]); |
23 | + } catch (error) { | ||
24 | + logger.error(error); | ||
25 | + } | ||
26 | + | ||
27 | + try { | ||
23 | whitelist = JSON.parse(args[1]); | 28 | whitelist = JSON.parse(args[1]); |
24 | } catch (error) { | 29 | } catch (error) { |
25 | logger.error(error); | 30 | logger.error(error); |
@@ -64,12 +64,11 @@ function getGender() { | @@ -64,12 +64,11 @@ function getGender() { | ||
64 | 64 | ||
65 | require('channel/maybe-like')({gender: getGender()}); | 65 | require('channel/maybe-like')({gender: getGender()}); |
66 | 66 | ||
67 | -// 你可能喜欢没有数据就隐藏 | ||
68 | -setTimeout(function() { | 67 | +$(document).on('PAY_SUCCESS_PAGE_MAYBE_LIKE_LOAD', () => { |
69 | if ($('#goods-list').find('.good-info').length === 0) { | 68 | if ($('#goods-list').find('.good-info').length === 0) { |
70 | $('.maybe-like').hide(); | 69 | $('.maybe-like').hide(); |
71 | } | 70 | } |
72 | -}, 200); | 71 | +}); |
73 | 72 | ||
74 | function Marquee() { | 73 | function Marquee() { |
75 | prompt.scrollLeft(prompt.scrollLeft() + 1); | 74 | prompt.scrollLeft(prompt.scrollLeft() + 1); |
@@ -213,8 +213,13 @@ module.exports = function(likeParameter) { | @@ -213,8 +213,13 @@ module.exports = function(likeParameter) { | ||
213 | }); | 213 | }); |
214 | 214 | ||
215 | // 为您优选埋点 end | 215 | // 为您优选埋点 end |
216 | + | ||
217 | + // 支付成功页,请求数据完成 | ||
218 | + $(document).trigger('PAY_SUCCESS_PAGE_MAYBE_LIKE_LOAD'); | ||
216 | }, | 219 | }, |
217 | error: function() { | 220 | error: function() { |
221 | + // 支付成功页,请求数据完成 | ||
222 | + $(document).trigger('PAY_SUCCESS_PAGE_MAYBE_LIKE_LOAD'); | ||
218 | tip.show('网络断开连接了~'); | 223 | tip.show('网络断开连接了~'); |
219 | searching = false; | 224 | searching = false; |
220 | loading.hideLoadingMask(); | 225 | loading.hideLoadingMask(); |
@@ -46,6 +46,8 @@ const PARAMMAP = { | @@ -46,6 +46,8 @@ const PARAMMAP = { | ||
46 | const getParams = (pathParams) => { | 46 | const getParams = (pathParams) => { |
47 | let params = {}; | 47 | let params = {}; |
48 | 48 | ||
49 | + pathParams = _.replace(pathParams, '.html', ''); | ||
50 | + | ||
49 | if (pathParams) { | 51 | if (pathParams) { |
50 | let paramsRaw = _.split(pathParams, '-'); | 52 | let paramsRaw = _.split(pathParams, '-'); |
51 | 53 |
-
Please register or login to post a comment