Authored by zhangxiaoru

商品链接

... ... @@ -47,7 +47,7 @@ module.exports = class extends global.yoho.BaseModel {
if (isApp) {
val.detailUrl = val.detailUrl +
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http://m.yohobuy.com/activity/share-buy/detail","params":{"counum":"' +
'&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http://m.yohobuy.com/activity/share-buy/detail","params":{"counum":"' +
val.couponValue + '","couponType":"' + val.shareCouponType + '","detailDes":"' +
val.detailDes + '","couponId":"' + val.couponId + '"}}}';
}
... ... @@ -68,7 +68,7 @@ module.exports = class extends global.yoho.BaseModel {
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' + rebeatUrl + '"}}' : rebeatUrl;
indexData.strategyUrl = isApp ? strategyUrl +
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + strategyUrl + '"}}' : strategyUrl;
'&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + strategyUrl + '"}}' : strategyUrl;
return indexData;
});
... ... @@ -117,19 +117,22 @@ module.exports = class extends global.yoho.BaseModel {
}, {
code: 200
}).then((result) => {
let moreUrl;
if (result && result.code === 200 && result.data) {
result.data = _.assign(result.data, param);
result.data.moreUrl = helpers.urlFormat('', {
moreUrl = helpers.urlFormat('', {
coupon_code: result.data.couponCode,
coupon_id: param.couponId,
title: '优惠活动商品'
}, 'list');
result.data = _.assign(result.data, {
isApp: isApp ? true : false
});
result.data.moreUrl = isApp ? moreUrl +
'&openbuy:yohobuy={"action":"go.list","params":{"coupon_code":"' + result.data.couponCode +
'","coupon_id":"' + param.couponId + '","title":"优惠活动商品","actiontype":"1"}}' : moreUrl;
result.data.isApp = isApp ? true : false;
result.data.finish = parseInt(result.data.expiredTime, 10) > 0 ? false : true;
... ... @@ -168,7 +171,7 @@ module.exports = class extends global.yoho.BaseModel {
});
result.data.currencyUrl = isApp ? currencyUrl +
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' +
'&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' +
currencyUrl + '"}}' : currencyUrl;
result.data.shareUrl = isApp ? shareUrl +
... ...
... ... @@ -29,10 +29,17 @@ let shareData = {
imgUrl: 'http://img11.static.yhbimg.com/yhb-img01/2017/05/10/16/011568a808f9b10e098b6542d3a8cb3d6b.png'
};
let appVersion;
let couponId = $('.coupon-info').data('id');
require('common/share')(shareData);
require('common');
yoho.invokeMethod('set.shareInfo', shareData);
appVersion = window.queryString.app_version;
function division(time) {
time = time > 10 ? time + '' : '0' + time;
... ... @@ -57,17 +64,6 @@ function getRTime(conf) {
m = Math.floor(conf.endTime[key] / conf.aMinute % 60);
s = Math.floor(conf.endTime[key] / conf.aSecond % 60);
// showTime += d > 0 ? d + '天' : '';
// showTime += h > 0 ? h + '小时' : '';
// showTime += m + '分钟';
// showTime += s > 0 ? s + '秒' : '';
// if (showTime.length !== '') {
// showTime = '剩' + showTime;
// }
// console.log(m, division(m));
$(item).find('span').eq(0).html(division(d)[0]);
$(item).find('span').eq(1).html(division(d)[1]);
$(item).find('span').eq(2).html(division(h)[0]);
... ... @@ -99,6 +95,20 @@ if ($activityTime.data('id')) {
// 商品数据
function productData() {
let setting = {
type: 'default',
order: 0,
page: page,
noLazy: true,
};
if (appVersion) {
setting.app_version = appVersion;
}
if (couponId) {
setting.coupon_id = couponId;
}
if (!onloading) {
onloading = true;
... ... @@ -106,13 +116,7 @@ function productData() {
$.ajax({
type: 'GET',
url: location.protocol + '//m.yohobuy.com/product/search/search',
data: {
coupon_id: $('.coupon-info').data('id'),
type: 'default',
order: 0,
page: page,
noLazy: true
},
data: setting,
xhrFields: {
withCredentials: true
},
... ...