Authored by lijing

测试bug

@@ -35,18 +35,20 @@ const activity = (params) => { @@ -35,18 +35,20 @@ const activity = (params) => {
35 35
36 let bgUrl = ''; 36 let bgUrl = '';
37 37
38 - if (result && result[0] && result[0].data && result[1] && result[1].data) {  
39 -  
40 - resu = result[0].data;  
41 -  
42 - mobile = result[1].data.mobile;  
43 -  
44 - bgUrl = result[0].data.lottery.image;  
45 -  
46 - Object.assign(resu, {  
47 - mobile: mobile.substr(0,3) + '****' + mobile.substr(7),  
48 - bgUrl: bgUrl  
49 - }); 38 + if (result) {
  39 + if (result[0] && result[0].data) {
  40 + resu = result[0].data;
  41 + bgUrl = result[0].data.lottery.image;
  42 + Object.assign(resu, {
  43 + bgUrl: bgUrl
  44 + });
  45 + }
  46 + if (result[1] && result[1].data) {
  47 + mobile = result[1].data.mobile;
  48 + Object.assign(resu, {
  49 + mobile: mobile.substr(0,3) + '****' + mobile.substr(7)
  50 + });
  51 + }
50 } 52 }
51 53
52 return resu; 54 return resu;
@@ -364,9 +366,13 @@ const getOrders = (params) => { @@ -364,9 +366,13 @@ const getOrders = (params) => {
364 order_code: value.order_code 366 order_code: value.order_code
365 }); 367 });
366 368
  369 + // 计算商品总数
  370 + let totalNum = 0;
367 _.forEach(value.order_goods, item => { 371 _.forEach(value.order_goods, item => {
  372 + count = item.buy_num;
  373 + totalNum = count + totalNum;
368 Object.assign(perOrder, { 374 Object.assign(perOrder, {
369 - count: item.buy_num 375 + count: totalNum
370 }); 376 });
371 }); 377 });
372 378
@@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
18 <div class="reason-box" > 18 <div class="reason-box" >
19 <div class="box-head"><span class="box-cmp">完成</span></div> 19 <div class="box-head"><span class="box-cmp">完成</span></div>
20 <div class="swiper-container box-main"> 20 <div class="swiper-container box-main">
21 -  
22 <ul class="swiper-wrapper"> 21 <ul class="swiper-wrapper">
23 {{#cancelReason}} 22 {{#cancelReason}}
24 <li class="swiper-slide" data-reason-id="{{id}}"><span >{{reason}}</span></li> 23 <li class="swiper-slide" data-reason-id="{{id}}"><span >{{reason}}</span></li>
@@ -34,7 +33,7 @@ @@ -34,7 +33,7 @@
34 <span class="close"></span> 33 <span class="close"></span>
35 <div class="lucky hide"></div> 34 <div class="lucky hide"></div>
36 <div class="unlucky hide"></div> 35 <div class="unlucky hide"></div>
37 - <p class="hide">免单金额会以有货币形式,在订单<span class="code"></span>,发货15天后且无退换货情况,返还至您的有货个人中心账户内,请注意查收!</p> 36 + <p class="hide message"></p>
38 <a></a> 37 <a></a>
39 </div> 38 </div>
40 </div> 39 </div>
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <header class="header"> 2 <header class="header">
3 订单编号:{{orderNum}} 3 订单编号:{{orderNum}}
4 {{#if status}} 4 {{#if status}}
5 - <div class="raffle-btn" data-uid="{{uid}}" data-code="{{order_code}}">参加抽奖</div> 5 + <a class="raffle-btn" data-uid="{{uid}}" data-code="{{order_code}}" href="javascript:void(0)">参加抽奖</a>
6 {{else}} 6 {{else}}
7 <div class="disable-btn">已抽奖</div> 7 <div class="disable-btn">已抽奖</div>
8 {{/ if}} 8 {{/ if}}
@@ -213,12 +213,12 @@ orderHammer.on('tap', function(e) { @@ -213,12 +213,12 @@ orderHammer.on('tap', function(e) {
213 orderCode: orderCode 213 orderCode: orderCode
214 }, 214 },
215 success: function(data) { 215 success: function(data) {
216 - var lucky = data.data.orderLotteryCode;  
217 - switch(lucky){ 216 + var luck = data.data.orderLotteryCode;
  217 + switch(luck){
218 case 0: 218 case 0:
219 break; 219 break;
220 case 1: 220 case 1:
221 - lucky(); 221 + lucky(data);
222 break; 222 break;
223 case 2: 223 case 2:
224 unlucky(); 224 unlucky();
@@ -231,13 +231,16 @@ orderHammer.on('tap', function(e) { @@ -231,13 +231,16 @@ orderHammer.on('tap', function(e) {
231 break; 231 break;
232 } 232 }
233 // 中奖 233 // 中奖
234 - function lucky() { 234 + function lucky(data) {
  235 + var message = data.data.orderLotteryMessage;
  236 + var bgPic = data.data.prize.image;
235 $('.lucky').show(); 237 $('.lucky').show();
236 $('.dia-c').show(); 238 $('.dia-c').show();
237 $('.dia-main').find('p').show(); 239 $('.dia-main').find('p').show();
238 var dia_h = $('.dia-main').height() / 2; 240 var dia_h = $('.dia-main').height() / 2;
239 $('.dia-main').css('margin-top', '-' + dia_h + 'px'); 241 $('.dia-main').css('margin-top', '-' + dia_h + 'px');
240 - $('.dia-main').find('.code').text(orderCode); 242 + $('.dia-main').find('.message').text(message);
  243 + $('.dia-main').find('.lucky').css("background-image","url(" + bgPic + ")");
241 } 244 }
242 // 未中奖 245 // 未中奖
243 function unlucky() { 246 function unlucky() {
@@ -330,10 +333,6 @@ $(window).scroll(function() { @@ -330,10 +333,6 @@ $(window).scroll(function() {
330 getOrders(); 333 getOrders();
331 334
332 $(function() { 335 $(function() {
333 - $('.dia-main').on('click', function () {  
334 - window.location.href = '//m.yohobuy.com/activity/raffle/orders'  
335 - });  
336 -  
337 if ($('.dia-tip').length > 0) { 336 if ($('.dia-tip').length > 0) {
338 if(window.cookie('bindUrl') == 'http://m.yohobuy.com/passport/bind/success?type=bind') { 337 if(window.cookie('bindUrl') == 'http://m.yohobuy.com/passport/bind/success?type=bind') {
339 userId = $('.dia-tip').val(); 338 userId = $('.dia-tip').val();
@@ -442,5 +441,9 @@ $reaMask.on('touchend', function(event) { @@ -442,5 +441,9 @@ $reaMask.on('touchend', function(event) {
442 }); 441 });
443 442
444 $('.dia-c .close').on('click', function() { 443 $('.dia-c .close').on('click', function() {
445 - $('.dia-c').hide(); 444 + window.location.href = '//m.yohobuy.com/activity/raffle/orders'
  445 +});
  446 +
  447 +$('.dia-main a').on('click', function () {
  448 + window.location.href = '//m.yohobuy.com/activity/raffle/orders'
446 }); 449 });
@@ -174,14 +174,16 @@ @@ -174,14 +174,16 @@
174 width: 540px; 174 width: 540px;
175 height: 421px; 175 height: 421px;
176 background: resolve("activity/raffle/dia-succ.png"); 176 background: resolve("activity/raffle/dia-succ.png");
177 - background-size: 100%; 177 + background-size: 100% 100%;
  178 + background-repeat: no-repeat;
178 } 179 }
179 180
180 .unlucky { 181 .unlucky {
181 width: 540px; 182 width: 540px;
182 height: 421px; 183 height: 421px;
183 background: resolve("activity/raffle/dia-err.png"); 184 background: resolve("activity/raffle/dia-err.png");
184 - background-size: 100%; 185 + background-size: 100% 100%;
  186 + background-repeat: no-repeat;
185 } 187 }
186 188
187 p { 189 p {
@@ -194,6 +196,7 @@ @@ -194,6 +196,7 @@
194 color: #444; 196 color: #444;
195 padding: 30px; 197 padding: 30px;
196 line-height: 30px; 198 line-height: 30px;
  199 + text-align: center;
197 } 200 }
198 201
199 a { 202 a {