Authored by zhangxiaoru

商品链接

@@ -47,7 +47,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -47,7 +47,7 @@ module.exports = class extends global.yoho.BaseModel {
47 47
48 if (isApp) { 48 if (isApp) {
49 val.detailUrl = val.detailUrl + 49 val.detailUrl = val.detailUrl +
50 - '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http://m.yohobuy.com/activity/share-buy/detail","params":{"counum":"' + 50 + '&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http://m.yohobuy.com/activity/share-buy/detail","params":{"counum":"' +
51 val.couponValue + '","couponType":"' + val.shareCouponType + '","detailDes":"' + 51 val.couponValue + '","couponType":"' + val.shareCouponType + '","detailDes":"' +
52 val.detailDes + '","couponId":"' + val.couponId + '"}}}'; 52 val.detailDes + '","couponId":"' + val.couponId + '"}}}';
53 } 53 }
@@ -68,7 +68,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -68,7 +68,7 @@ module.exports = class extends global.yoho.BaseModel {
68 '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' + rebeatUrl + '"}}' : rebeatUrl; 68 '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' + rebeatUrl + '"}}' : rebeatUrl;
69 69
70 indexData.strategyUrl = isApp ? strategyUrl + 70 indexData.strategyUrl = isApp ? strategyUrl +
71 - '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + strategyUrl + '"}}' : strategyUrl; 71 + '&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + strategyUrl + '"}}' : strategyUrl;
72 72
73 return indexData; 73 return indexData;
74 }); 74 });
@@ -117,19 +117,22 @@ module.exports = class extends global.yoho.BaseModel { @@ -117,19 +117,22 @@ module.exports = class extends global.yoho.BaseModel {
117 }, { 117 }, {
118 code: 200 118 code: 200
119 }).then((result) => { 119 }).then((result) => {
  120 + let moreUrl;
120 121
121 if (result && result.code === 200 && result.data) { 122 if (result && result.code === 200 && result.data) {
122 result.data = _.assign(result.data, param); 123 result.data = _.assign(result.data, param);
123 124
124 - result.data.moreUrl = helpers.urlFormat('', { 125 + moreUrl = helpers.urlFormat('', {
125 coupon_code: result.data.couponCode, 126 coupon_code: result.data.couponCode,
126 coupon_id: param.couponId, 127 coupon_id: param.couponId,
127 title: '优惠活动商品' 128 title: '优惠活动商品'
128 }, 'list'); 129 }, 'list');
129 130
130 - result.data = _.assign(result.data, {  
131 - isApp: isApp ? true : false  
132 - }); 131 + result.data.moreUrl = isApp ? moreUrl +
  132 + '&openbuy:yohobuy={"action":"go.list","params":{"coupon_code":"' + result.data.couponCode +
  133 + '","coupon_id":"' + param.couponId + '","title":"优惠活动商品","actiontype":"1"}}' : moreUrl;
  134 +
  135 + result.data.isApp = isApp ? true : false;
133 136
134 result.data.finish = parseInt(result.data.expiredTime, 10) > 0 ? false : true; 137 result.data.finish = parseInt(result.data.expiredTime, 10) > 0 ? false : true;
135 138
@@ -168,7 +171,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -168,7 +171,7 @@ module.exports = class extends global.yoho.BaseModel {
168 }); 171 });
169 172
170 result.data.currencyUrl = isApp ? currencyUrl + 173 result.data.currencyUrl = isApp ? currencyUrl +
171 - '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' + 174 + '&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' +
172 currencyUrl + '"}}' : currencyUrl; 175 currencyUrl + '"}}' : currencyUrl;
173 176
174 result.data.shareUrl = isApp ? shareUrl + 177 result.data.shareUrl = isApp ? shareUrl +
@@ -29,10 +29,17 @@ let shareData = { @@ -29,10 +29,17 @@ let shareData = {
29 imgUrl: 'http://img11.static.yhbimg.com/yhb-img01/2017/05/10/16/011568a808f9b10e098b6542d3a8cb3d6b.png' 29 imgUrl: 'http://img11.static.yhbimg.com/yhb-img01/2017/05/10/16/011568a808f9b10e098b6542d3a8cb3d6b.png'
30 }; 30 };
31 31
  32 +let appVersion;
  33 +
  34 +let couponId = $('.coupon-info').data('id');
  35 +
32 require('common/share')(shareData); 36 require('common/share')(shareData);
  37 +require('common');
33 38
34 yoho.invokeMethod('set.shareInfo', shareData); 39 yoho.invokeMethod('set.shareInfo', shareData);
35 40
  41 +appVersion = window.queryString.app_version;
  42 +
36 function division(time) { 43 function division(time) {
37 time = time > 10 ? time + '' : '0' + time; 44 time = time > 10 ? time + '' : '0' + time;
38 45
@@ -57,17 +64,6 @@ function getRTime(conf) { @@ -57,17 +64,6 @@ function getRTime(conf) {
57 m = Math.floor(conf.endTime[key] / conf.aMinute % 60); 64 m = Math.floor(conf.endTime[key] / conf.aMinute % 60);
58 s = Math.floor(conf.endTime[key] / conf.aSecond % 60); 65 s = Math.floor(conf.endTime[key] / conf.aSecond % 60);
59 66
60 - // showTime += d > 0 ? d + '天' : '';  
61 - // showTime += h > 0 ? h + '小时' : '';  
62 - // showTime += m + '分钟';  
63 - // showTime += s > 0 ? s + '秒' : '';  
64 -  
65 - // if (showTime.length !== '') {  
66 - // showTime = '剩' + showTime;  
67 - // }  
68 -  
69 - // console.log(m, division(m));  
70 -  
71 $(item).find('span').eq(0).html(division(d)[0]); 67 $(item).find('span').eq(0).html(division(d)[0]);
72 $(item).find('span').eq(1).html(division(d)[1]); 68 $(item).find('span').eq(1).html(division(d)[1]);
73 $(item).find('span').eq(2).html(division(h)[0]); 69 $(item).find('span').eq(2).html(division(h)[0]);
@@ -99,6 +95,20 @@ if ($activityTime.data('id')) { @@ -99,6 +95,20 @@ if ($activityTime.data('id')) {
99 95
100 // 商品数据 96 // 商品数据
101 function productData() { 97 function productData() {
  98 + let setting = {
  99 + type: 'default',
  100 + order: 0,
  101 + page: page,
  102 + noLazy: true,
  103 + };
  104 +
  105 + if (appVersion) {
  106 + setting.app_version = appVersion;
  107 + }
  108 +
  109 + if (couponId) {
  110 + setting.coupon_id = couponId;
  111 + }
102 112
103 if (!onloading) { 113 if (!onloading) {
104 onloading = true; 114 onloading = true;
@@ -106,13 +116,7 @@ function productData() { @@ -106,13 +116,7 @@ function productData() {
106 $.ajax({ 116 $.ajax({
107 type: 'GET', 117 type: 'GET',
108 url: location.protocol + '//m.yohobuy.com/product/search/search', 118 url: location.protocol + '//m.yohobuy.com/product/search/search',
109 - data: {  
110 - coupon_id: $('.coupon-info').data('id'),  
111 - type: 'default',  
112 - order: 0,  
113 - page: page,  
114 - noLazy: true  
115 - }, 119 + data: setting,
116 xhrFields: { 120 xhrFields: {
117 withCredentials: true 121 withCredentials: true
118 }, 122 },