Authored by ccbikai(👎🏻🍜)

个性化领券

... ... @@ -359,12 +359,24 @@ exports.receiveCoupon = (receiveData, uid) => {
};
exports.couponSend = (uid, token) => {
return api.get('', {
let data = {
method: 'app.coupons.couponSend',
uid: uid,
coupon_send_token: token
}).then(result => {
};
if (/:/.test(token)) {
let [couponId, personCouponId] = token.split(':');
data = {
method: 'app.promotion.getCoupon',
uid: uid,
couponId: couponId,
personCouponId: personCouponId
};
}
return api.get('', data).then(result => {
if (!result) {
result.code = 404;
... ...
... ... @@ -10,10 +10,8 @@ const _getProductBySkns = function(productObj) {
productObj.defaultPros = [];
if (result && result.data && result.data.product_list && result.code === 200) {
result.data.product_list.forEach(function(val) {
var goods_id = Array.isArray(val.goods_list) &&
val.goods_list.length ? val.goods_list[0].goods_id : null;
var obj = {
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
producturl: `//m.yohobuy.com/product/${val.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${val.product_skn}}}`, // eslint-disable-line
productimg: helpers.image(val.default_images, 213, 284, 2, 60).replace('quality/80', 'quality/60'),
productname: val.product_name,
vipprice: val.vip_price,
... ...
... ... @@ -14,7 +14,7 @@ const domains = {
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
api: 'http://dev-api.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
global: 'http://api-global.yohobuy.com',
... ...