Authored by ccbikai(👎🏻🍜)

个性化领券

@@ -359,12 +359,24 @@ exports.receiveCoupon = (receiveData, uid) => { @@ -359,12 +359,24 @@ exports.receiveCoupon = (receiveData, uid) => {
359 }; 359 };
360 360
361 exports.couponSend = (uid, token) => { 361 exports.couponSend = (uid, token) => {
362 -  
363 - return api.get('', { 362 + let data = {
364 method: 'app.coupons.couponSend', 363 method: 'app.coupons.couponSend',
365 uid: uid, 364 uid: uid,
366 coupon_send_token: token 365 coupon_send_token: token
367 - }).then(result => { 366 + };
  367 +
  368 + if (/:/.test(token)) {
  369 + let [couponId, personCouponId] = token.split(':');
  370 +
  371 + data = {
  372 + method: 'app.promotion.getCoupon',
  373 + uid: uid,
  374 + couponId: couponId,
  375 + personCouponId: personCouponId
  376 + };
  377 + }
  378 +
  379 + return api.get('', data).then(result => {
368 380
369 if (!result) { 381 if (!result) {
370 result.code = 404; 382 result.code = 404;
@@ -10,10 +10,8 @@ const _getProductBySkns = function(productObj) { @@ -10,10 +10,8 @@ const _getProductBySkns = function(productObj) {
10 productObj.defaultPros = []; 10 productObj.defaultPros = [];
11 if (result && result.data && result.data.product_list && result.code === 200) { 11 if (result && result.data && result.data.product_list && result.code === 200) {
12 result.data.product_list.forEach(function(val) { 12 result.data.product_list.forEach(function(val) {
13 - var goods_id = Array.isArray(val.goods_list) &&  
14 - val.goods_list.length ? val.goods_list[0].goods_id : null;  
15 var obj = { 13 var obj = {
16 - producturl: `//m.yohobuy.com/product/pro_${val.product_id}_${goods_id}/${val.cn_alphabet}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${val.product_skn}}}`, // eslint-disable-line 14 + producturl: `//m.yohobuy.com/product/${val.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${val.product_skn}}}`, // eslint-disable-line
17 productimg: helpers.image(val.default_images, 213, 284, 2, 60).replace('quality/80', 'quality/60'), 15 productimg: helpers.image(val.default_images, 213, 284, 2, 60).replace('quality/80', 'quality/60'),
18 productname: val.product_name, 16 productname: val.product_name,
19 vipprice: val.vip_price, 17 vipprice: val.vip_price,
@@ -14,7 +14,7 @@ const domains = { @@ -14,7 +14,7 @@ const domains = {
14 liveApi: 'http://testapi.live.yohops.com:9999/', 14 liveApi: 'http://testapi.live.yohops.com:9999/',
15 singleApi: 'http://api-test3.yohops.com:9999/', 15 singleApi: 'http://api-test3.yohops.com:9999/',
16 16
17 - api: 'http://api-test3.yohops.com:9999/', 17 + api: 'http://dev-api.yohops.com:9999/',
18 service: 'http://service-test3.yohops.com:9999/', 18 service: 'http://service-test3.yohops.com:9999/',
19 global: 'http://api-global.yohobuy.com', 19 global: 'http://api-global.yohobuy.com',
20 20