Authored by ccbikai(👎🏻🍜)

uid 获取优化

@@ -11,8 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production'; @@ -11,8 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production';
11 const isTest = process.env.NODE_ENV === 'test'; 11 const isTest = process.env.NODE_ENV === 'test';
12 12
13 const domains = { 13 const domains = {
14 - api: 'http://api.yoho.cn/',  
15 - service: 'http://service.yoho.cn/', 14 + api: 'http://api-test3.yohops.com:9999/',
  15 + service: 'http://service-test3.yohops.com:9999/',
16 16
17 singleApi: 'http://api-test3.yohops.com:9999/', 17 singleApi: 'http://api-test3.yohops.com:9999/',
18 global: 'http://global-test-soa.yohops.com:9999', 18 global: 'http://global-test-soa.yohops.com:9999',
@@ -158,7 +158,13 @@ function modalInit() { @@ -158,7 +158,13 @@ function modalInit() {
158 } 158 }
159 159
160 function persenalCouponInit() { 160 function persenalCouponInit() {
161 - let activityId = $('.feature-page').data('id'); 161 + let data = {
  162 + activity_id: $('.feature-page').data('id')
  163 + };
  164 +
  165 + if (qs.uid) {
  166 + data.uid = qs.uid;
  167 + }
162 168
163 $('.yoho-conpon').each(function() { 169 $('.yoho-conpon').each(function() {
164 let $this = $(this); 170 let $this = $(this);
@@ -167,10 +173,7 @@ function persenalCouponInit() { @@ -167,10 +173,7 @@ function persenalCouponInit() {
167 $.ajax({ 173 $.ajax({
168 url: '//m.yohobuy.com/activity/individuation/coupon', 174 url: '//m.yohobuy.com/activity/individuation/coupon',
169 dataType: 'jsonp', 175 dataType: 'jsonp',
170 - data: {  
171 - uid: qs.uid || 0,  
172 - activity_id: activityId  
173 - }, 176 + data: data,
174 success: function(res) { 177 success: function(res) {
175 if (res.code === 200 && res.data && res.data.couponId && res.data.personCouponId) { 178 if (res.code === 200 && res.data && res.data.couponId && res.data.personCouponId) {
176 $this.attr('data-token', `${res.data.couponId}:${res.data.personCouponId}`); 179 $this.attr('data-token', `${res.data.couponId}:${res.data.personCouponId}`);