Authored by lijing

测试bug

... ... @@ -35,18 +35,20 @@ const activity = (params) => {
let bgUrl = '';
if (result && result[0] && result[0].data && result[1] && result[1].data) {
resu = result[0].data;
mobile = result[1].data.mobile;
bgUrl = result[0].data.lottery.image;
Object.assign(resu, {
mobile: mobile.substr(0,3) + '****' + mobile.substr(7),
bgUrl: bgUrl
});
if (result) {
if (result[0] && result[0].data) {
resu = result[0].data;
bgUrl = result[0].data.lottery.image;
Object.assign(resu, {
bgUrl: bgUrl
});
}
if (result[1] && result[1].data) {
mobile = result[1].data.mobile;
Object.assign(resu, {
mobile: mobile.substr(0,3) + '****' + mobile.substr(7)
});
}
}
return resu;
... ... @@ -364,9 +366,13 @@ const getOrders = (params) => {
order_code: value.order_code
});
// 计算商品总数
let totalNum = 0;
_.forEach(value.order_goods, item => {
count = item.buy_num;
totalNum = count + totalNum;
Object.assign(perOrder, {
count: item.buy_num
count: totalNum
});
});
... ...
... ... @@ -18,7 +18,6 @@
<div class="reason-box" >
<div class="box-head"><span class="box-cmp">完成</span></div>
<div class="swiper-container box-main">
<ul class="swiper-wrapper">
{{#cancelReason}}
<li class="swiper-slide" data-reason-id="{{id}}"><span >{{reason}}</span></li>
... ... @@ -34,7 +33,7 @@
<span class="close"></span>
<div class="lucky hide"></div>
<div class="unlucky hide"></div>
<p class="hide">免单金额会以有货币形式,在订单<span class="code"></span>,发货15天后且无退换货情况,返还至您的有货个人中心账户内,请注意查收!</p>
<p class="hide message"></p>
<a></a>
</div>
</div>
... ...
... ... @@ -2,7 +2,7 @@
<header class="header">
订单编号:{{orderNum}}
{{#if status}}
<div class="raffle-btn" data-uid="{{uid}}" data-code="{{order_code}}">参加抽奖</div>
<a class="raffle-btn" data-uid="{{uid}}" data-code="{{order_code}}" href="javascript:void(0)">参加抽奖</a>
{{else}}
<div class="disable-btn">已抽奖</div>
{{/ if}}
... ...
... ... @@ -213,12 +213,12 @@ orderHammer.on('tap', function(e) {
orderCode: orderCode
},
success: function(data) {
var lucky = data.data.orderLotteryCode;
switch(lucky){
var luck = data.data.orderLotteryCode;
switch(luck){
case 0:
break;
case 1:
lucky();
lucky(data);
break;
case 2:
unlucky();
... ... @@ -231,13 +231,16 @@ orderHammer.on('tap', function(e) {
break;
}
// 中奖
function lucky() {
function lucky(data) {
var message = data.data.orderLotteryMessage;
var bgPic = data.data.prize.image;
$('.lucky').show();
$('.dia-c').show();
$('.dia-main').find('p').show();
var dia_h = $('.dia-main').height() / 2;
$('.dia-main').css('margin-top', '-' + dia_h + 'px');
$('.dia-main').find('.code').text(orderCode);
$('.dia-main').find('.message').text(message);
$('.dia-main').find('.lucky').css("background-image","url(" + bgPic + ")");
}
// 未中奖
function unlucky() {
... ... @@ -330,10 +333,6 @@ $(window).scroll(function() {
getOrders();
$(function() {
$('.dia-main').on('click', function () {
window.location.href = '//m.yohobuy.com/activity/raffle/orders'
});
if ($('.dia-tip').length > 0) {
if(window.cookie('bindUrl') == 'http://m.yohobuy.com/passport/bind/success?type=bind') {
userId = $('.dia-tip').val();
... ... @@ -442,5 +441,9 @@ $reaMask.on('touchend', function(event) {
});
$('.dia-c .close').on('click', function() {
$('.dia-c').hide();
window.location.href = '//m.yohobuy.com/activity/raffle/orders'
});
$('.dia-main a').on('click', function () {
window.location.href = '//m.yohobuy.com/activity/raffle/orders'
});
\ No newline at end of file
... ...
... ... @@ -174,14 +174,16 @@
width: 540px;
height: 421px;
background: resolve("activity/raffle/dia-succ.png");
background-size: 100%;
background-size: 100% 100%;
background-repeat: no-repeat;
}
.unlucky {
width: 540px;
height: 421px;
background: resolve("activity/raffle/dia-err.png");
background-size: 100%;
background-size: 100% 100%;
background-repeat: no-repeat;
}
p {
... ... @@ -194,6 +196,7 @@
color: #444;
padding: 30px;
line-height: 30px;
text-align: center;
}
a {
... ...