Authored by 周少峰

Merge branch 'release/5.2'

Showing 34 changed files with 515 additions and 217 deletions
... ... @@ -200,7 +200,7 @@ class OrderData
* @param type $address_id
* @return type
*/
public static function updateDeliveryAddress($order_code, $user_name, $area_code, $address, $mobile, $phone)
public static function updateDeliveryAddress($order_code, $user_name, $area_code, $address, $mobile, $phone, $uid)
{
// 构建必传参数
$param = Yohobuy::param();
... ... @@ -210,6 +210,7 @@ class OrderData
$param['area_code'] = $area_code;
$param['address'] = $address;
$param['mobile'] = $mobile;
$param['uid'] = $uid;
if($phone){
$param['phone'] = $phone;
}
... ...
... ... @@ -142,6 +142,10 @@
<h3>送货时间</h3>
<ul>
<li class="pay-type-tips">
温馨提示:快递公司会尽力按您选择的送货时间配送,如遇特殊情况(天气、环境等)无法按您要求的时间配送,还请您谅解。
</li>
{{#each delivery}}
<li>
<input {{#if checked}}checked{{/if}} value={{id}} class="radio" name="pay-time-radio" type="radio" id="{{id}}"/>
... ... @@ -149,9 +153,7 @@
</li>
{{/each}}
<li class="pay-dashed-hr pay-type-tips">声明:我们会努力按照您指定的时间配送,但因为天气、交通等各类因素影响,您的订单有可能会有延误现象,敬请谅解!</li>
<li>
<li class="delivery-second-confirm">
<span>送货前是否联系:</span>
<input value="Y" class="radio" name="call-me" type="radio" id=""/>
<label for="">是</label>
... ... @@ -366,22 +368,47 @@
</dl>
{{/if}}
<dl class="play-bi-pan pan">
<dt>使用有货币支付</dt>
<dt>
<span class="not-btn-tip red hide">抱歉,您的订单实付款不满足有货币使用条件</span>使用有货币支付
</dt>
<dd>
<div class="play-pan">
<div class="strong">
使用有货币:
<input type="text" class="textbox" id="biprice" data-bi="{{ownYohoCoin}}" value="0" /> 个
</div>
<p >
您目前有有货币 <em class="strong">{{ownYohoCoin}}</em> 个
</p>
<p class="errbitip red"></p>
<div class="btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
</div>
<div class="errbitip red">{{#unless yohoCoinCompute.yohoCoinClick}}{{yohoCoinCompute.yohoCoinMsg}}{{/unless}}</div>
<ul class="play-pan" id="biprice" data-yoho-coin-num={{yohoCoinCompute.yohoCoinNum}} data-yoho-coin-click={{yohoCoinCompute.yohoCoinClick}}>
<li>
<div class="float-left num-list-width">
有货币满<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个即可使用,每次使用有货币为<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数倍
</div>
<div class="float-right yoho-coin-help">?
<div class="yoho-coin-help-dialog hide">
<span class="arrow-up"></span>
<div class="yoho-coin-help-dialog-title">有货币使用条件:</div>
<div class="yoho-coin-help-dialog-content">
<ul>
<li>1.订单金额大于20元(含20元)</li>
<li>2.有货币数量大于<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个(含<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个)</li>
<li>3.每笔支付不得超过应付金额{{yohoCoinCompute.yoho_coin_pay_rule.max_pay_rate_desc}}</li>
<li class="coin-gray">备注:使用有货币数量为<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数倍,100有货币抵1元。</li>
</ul>
</div>
</div>
</div>
</li>
<li>
您当前共有有货币<span class="sign-amount totalYohoCoinNum">{{yohoCoinCompute.totalYohoCoinNum}}</span>个,可用<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>个
</li>
<li class="{{#unless yohoCoinCompute.yohoCoinClick}}coin-gray{{/unless}} yohoCoinTip">
本次使用有货币<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>个 抵扣<span class="sign-amount yohoCoin">¥{{yohoCoinCompute.yohoCoin}}</span>
</li>
<li>
<div class="float-left btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
<div class="float-right">
<a class="yoho-coin-help-link" href="/help/?category_id=87" target="_blank">有货币使用规则?</a>
</div>
</li>
</ul>
</dd>
</dl>
... ...
... ... @@ -112,22 +112,47 @@
</ul>
<dl class="play-bi-pan pan">
<dt>使用有货币支付</dt>
<dt>
<span class="not-btn-tip red hide">抱歉,您的订单实付款不满足有货币使用条件</span>使用有货币支付
</dt>
<dd>
<div class="play-pan">
<div class="strong">
使用有货币:
<input type="text" class="textbox" id="biprice" data-bi="{{ownYohoCoin}}" value="0" />
</div>
<p >
您目前有有货币 <em class="strong">{{ownYohoCoin}}</em>
</p>
<p class="errbitip red"></p>
<div class="btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
</div>
<div class="errbitip red">{{#unless yohoCoinCompute.yohoCoinClick}}{{yohoCoinCompute.yohoCoinMsg}}{{/unless}}</div>
<ul class="play-pan" id="biprice" data-yoho-coin-num={{yohoCoinCompute.yohoCoinNum}} data-yoho-coin-click={{yohoCoinCompute.yohoCoinClick}}>
<li>
<div class="float-left num-list-width">
有货币满<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个即可使用,每次使用有货币为<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数倍
</div>
<div class="float-right yoho-coin-help">?
<div class="yoho-coin-help-dialog hide">
<span class="arrow-up"></span>
<div class="yoho-coin-help-dialog-title">有货币使用条件:</div>
<div class="yoho-coin-help-dialog-content">
<ul>
<li>1.订单金额大于20元(含20元)</li>
<li>2.有货币数量大于<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个(含<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个)</li>
<li>3.每笔支付不得超过应付金额{{yohoCoinCompute.yoho_coin_pay_rule.max_pay_rate_desc}}</li>
<li class="coin-gray">备注:使用有货币数量为<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数倍,100有货币抵1元。</li>
</ul>
</div>
</div>
</div>
</li>
<li>
您当前共有有货币<span class="sign-amount totalYohoCoinNum">{{yohoCoinCompute.totalYohoCoinNum}}</span>个,可用<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>个
</li>
<li class="{{#unless yohoCoinCompute.yohoCoinClick}}coin-gray{{/unless}} yohoCoinTip">
本次使用有货币<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>个 抵扣<span class="sign-amount yohoCoin"{{yohoCoinCompute.yohoCoin}}</span>
</li>
<li>
<div class="float-left btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
<div class="float-right">
<a class="yoho-coin-help-link" href="/help/?category_id=87" target="_blank">有货币使用规则?</a>
</div>
</li>
</ul>
</dd>
</dl><!--/play-bi-pan pan-->
</div><!--/play-right-->
... ...
... ... @@ -52,6 +52,7 @@
</div>
{{/ progress}}
{{#if hastrace}}
{{# traceOrder}}
<div class="trace-order">
<p class="sub-title">
... ... @@ -87,6 +88,7 @@
</div>
</div>
{{/ traceOrder}}
{{/if}}
{{# orderInfo}}
<div class="order-info">
... ...
... ... @@ -81,11 +81,11 @@
</div>
<div class="order-status">
{{#if noPay}}
<span class="no-pay">待付款</span>
<span class="no-pay">待付款</span>
{{/if}}
{{#if paid}}
<span class="paid">备货中</span>
<span class="paid">待发货</span>
{{/if}}
{{#if shipped}}
... ... @@ -112,7 +112,7 @@
{{/if}}
{{#if complete}}
<span class="complete">备货中</span>
<span class="complete">待发货</span>
{{/if}}
{{#if cancel}}
... ... @@ -137,7 +137,7 @@
{{#if confirmReceived}}
<span class="op-item confirm-received">确认收货</span>
{{^}}
<a class="op-item{{#if payNow}} pay-now{{/if}}" href="{{href}}" target="_blank">
<a class="op-item{{#if payNow}} pay-now{{/if}} {{#if comment}}comment-show-btn{{/if}}" href="{{href}}" target="_blank">
{{#if payNow}}
立即付款
{{^}}
... ...
... ... @@ -144,7 +144,7 @@
</div>
<div class="gobuy float-left {{gobytype}}" id="miniCartBox">
<span class="ic-infomation">0</span>
<span class="ic-infomation hide">0</span>
<div class="gobuy-wrapper"></div>
</div>
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -907,6 +907,19 @@ $('.btn_account').on('click', function() {
new Alert('您有赠品没有选择,请选择完再结算!').show();
} else {
if ($('input:checked').length > 0) {
// 添加埋点
var productId = [];
$('.pay-wapper input:checked').parents('tr').each(function() {
if ($(this).attr('data-pid')) {
productId.push($(this).attr('data-pid'));
}
});
// 结算点击埋点
window.addPoint('YB_SC_TOBUY_CLICK', {PRD_ID: productId.join(',')});
if ($('.pre-sell-box input:checked').length > 0) {
window.location.href = '/cart/index/orderEnsure?type=2';
} else {
... ... @@ -926,4 +939,7 @@ $goodsDetail.on('selectstart', function() {
return false;
});
scrollToFirst();
\ No newline at end of file
scrollToFirst();
// 购物车默认埋点
window.addPoint('YB_SC');
\ No newline at end of file
... ...
... ... @@ -197,12 +197,14 @@ $.extend({
// 添加埋点
function addPoint(operate, parameter) {
var CID = 1;
if (!window._yas || !window._yas.sendCustomInfo || !operate) {
return false;
checkYas(operate, parameter);
return;
}
var CID = 1;
//男:1,女:2,潮童:3,创意生活:4
switch(cookie('_Channel')) {
case 'boys':
... ... @@ -223,20 +225,28 @@ function addPoint(operate, parameter) {
window._yas.sendCustomInfo({
'op': operate,
'uid': getUid(),
'param': JSON.stringify(parameter)
}, true);
}
function checkYas(operate, parameter) {
// yas库异步加载
var sto = setInterval(function() {
if (window._yas && window._yas.sendCustomInfo) {
addPoint(operate, parameter);
clearInterval(sto);
}
}, 100);
}
//为您优选埋点 http://redmine.yoho.cn/issues/10117
function givePoint(parameter) {
parameter = $.extend({
'REC_POSE': '',
'REC_ID': RECID,
'PRD_ID': '',
'PRD_NUM': 0,
'C_ID': CID,
'ACTION_ID': 0,
'page_num': 1
}, parameter);
... ...
... ... @@ -156,6 +156,8 @@ function actionGoodsCart() {
var text = '';
$.fn.miniCart = function(options) {
var $cartNum = $(params.cartNum);
params = $.extend(defaults, options);
if (typeof window.cookie(params.cookie) === 'undefined') {
cartInfo = null;
... ... @@ -177,8 +179,10 @@ function actionGoodsCart() {
} else {
$('#icart-num').attr('class', 'icart-num');
}
$(params.cartNum).html(totalNum);
$cartNum.html(totalNum);
}
totalNum ? $cartNum.removeClass('hide') : $cartNum.addClass('hide');
};
$.fn.search = function(searchDomain) {
... ...
... ... @@ -771,7 +771,7 @@ $('.to-play input.submit').click(function() {
paymentType = $('.pay-time-modify input[name="pay-type"]:checked').val(),
paymentId = $('.pay-time-modify input[name="pay-type"]:checked').data('pay'),
remark = $('#notedesc').val(),
yohoCoin = $('#biprice').val(),
yohoCoin = $('#biprice.is-select').data('yoho-coin-num') * 1 || 0,
isPreContact = $('.pay-time-modify input[name="call-me"]:checked').val(),
isPrintPrice = $('.play-pan input[name="isPP"]:checked').val(),
redEnvelopes = $('.use-envelopes input:checked').attr('data-use'),
... ... @@ -792,7 +792,7 @@ $('.to-play input.submit').click(function() {
return;
}
$this.attr('disabled', 'disabled');
$this.attr('disabled', 'disabled');
$.ajax({
type: 'POST',
... ... @@ -819,7 +819,6 @@ $('.to-play input.submit').click(function() {
}).then(function(d) {
$loading.hide();
if (d.code === 200) {
// 去付款按钮埋点
$('.product-num').each(function() {
... ... @@ -827,6 +826,7 @@ $('.to-play input.submit').click(function() {
});
window.addPoint('YB_SC_TOPAY_CLICK', {ORDER_CODE: d.data.order_code, PRD_NUM: productNum, ORDER_AMOUNT: d.data.order_amount, UNIONCOOKIE: d.data.unionKey});
window.location.href = d.data.payUrl;
} else {
new dialog.Alert(d.message).show();
... ...
... ... @@ -9,7 +9,8 @@ var $ = require('yoho.jquery'),
$receiptInfoSaveBtn = $('.receipt-info .save-receipt'),
$receiptInfoCancelBtn = $('.receipt-info .cancel-receipt'),
$eReceiptBtn = $('.receipt-type .e-receipt'),
$paperReceiptBtn = $('.receipt-type .paper-receipt');
$paperReceiptBtn = $('.receipt-type .paper-receipt'),
$yohoCoinHelp = $('.yoho-coin-help');
var address = require('./address'),
... ... @@ -49,7 +50,6 @@ var Order = {
e: {
$pan: $('.pan'),
$jc: $('#juancode'),
$bp: $('#biprice'),
$statistics: $('li', '.play-total'),
$tobi: $('p em', '.play-bi-pan .play-pan'),
$cancel: $('.cancel', '.btn-group'),
... ... @@ -112,6 +112,10 @@ var Order = {
var pan = $(this).parent('dl.pan');
if ($(this).hasClass('not-btn')) {
return false;
}
if (pan.find('dd').is(':hidden')) {
c.winShow(pan);
... ... @@ -237,6 +241,7 @@ var Order = {
isExpress = '';
var tipsStr;
var isJuan = false;
var envelopesVal;
... ... @@ -249,6 +254,7 @@ var Order = {
for (i = 0; i < dArr.length; i++) {
if (dArr[i].promotion === '优惠券:') {
isJuan = true;
dArr[i].promotion = (tipsStr ? tipsStr : '优惠券') + '<span class="juan-modify">[修改]</span>:';
}
... ... @@ -271,16 +277,36 @@ var Order = {
e.$payTotal.html(str);
e.$toPay.html((data.last_order_amount).toFixed(2));
//有货币清零状态更新
$('#biprice').val(accMul(100, data.use_yoho_coin));
if (~~data.use_yoho_coin === 0) {
$('.errbitip').text('');
} else {
$('.errbitip').text('抵扣' + data.use_yoho_coin.toFixed(2) + '元');
//有货币清零状态更新 start
$('dl.play-bi-pan').find('dt').removeClass('not-btn');
$('.not-btn-tip').addClass('hide');
$('.yohoCoinTip').removeClass('coin-gray');
if (data.yohoCoinCompute.yohoCoinNum > 0) {
$('.errbitip').html('');
}
if (!data.yohoCoinCompute.yohoCoinClick) {
if (isJuan) {
//不可以使用状态
$('dl.play-bi-pan').find('dt').addClass('not-btn');
$('.not-btn-tip').removeClass('hide');
//如果有货币按钮为打开状态,则关闭
Order.Common.winHide($('.play-bi-pan'));
}
$('.yohoCoinTip').addClass('coin-gray');
$('.errbitip').html(data.yohoCoinCompute.yohoCoinMsg);
}
$('#biprice').data({
'yoho-coin-num': data.yohoCoinCompute.yohoCoinNum,
'yoho-coin-click': data.yohoCoinCompute.yohoCoinClick
});
$('#biprice').find('.num-limit-coin').html(data.yohoCoinCompute.yoho_coin_pay_rule.num_limit);
$('#biprice').find('.totalYohoCoinNum').html(data.yohoCoinCompute.totalYohoCoinNum);
$('#biprice').find('.yohoCoinNum').html(data.yohoCoinCompute.yohoCoinNum);
$('#biprice').find('.yohoCoin').html('¥' + data.yohoCoinCompute.yohoCoin);
//有货币清零状态更新 end
//使用的红包
envelopesVal = e.$useEnvelopesInput.data('all') - data.use_red_envelopes;
if (~~data.use_red_envelopes > 0) {
e.$useEnvelopes.find('span').html('-¥' + data.use_red_envelopes.toFixed(2));
e.$useEnvelopes.find('input').attr('data-use', data.use_red_envelopes);
... ... @@ -359,7 +385,6 @@ var Order = {
$biok: $('#bisubmit'),
$carriageGroup: $('input[name="carriagegroup"]'),
$selectExpress: $('.express-list input'),
$bp: $('#biprice'),
$errorTip: $('.errbitip'),
$useEnvelopes: $('.use-envelopes'),
$hasEnvelopes: $('.has-envelopes span'),
... ... @@ -378,7 +403,7 @@ var Order = {
var $juangroupInput = $('.play-juan.is-select input[name="juangroup"]:checked');
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
var biVal = $('#biprice.is-select').val();
var biVal = $('#biprice.is-select').data('yoho-coin-num') * 1 || 0;
var codeVal = $juangroupInput.val();
var cartType = $('.address-manage').attr('cart-type');
var redEnvelopes = $('.use-envelopes input:checked').attr('data-use');
... ... @@ -407,7 +432,8 @@ var Order = {
e.$selectExpress.click(function() {
var expressId = $(this).val();
//订单金额发生变化,使用有货币重置
$('#biprice').removeClass('is-select');
e.$loading.show();
getSelectData(function(d) {
... ... @@ -430,6 +456,7 @@ var Order = {
} else if (expressId === '2') {
$('.express-list.sf').removeClass('hide');
}
} else {
new dialog.Alert(data.message).show();
}
... ... @@ -448,7 +475,8 @@ var Order = {
var juanText = '';
$('.play-juan').addClass('is-select');
//订单金额发生变化,使用有货币重置
$('#biprice').removeClass('is-select');
getSelectData(function(d) {
var code = d.couponCode;
... ... @@ -459,12 +487,13 @@ var Order = {
$('.play-juan').removeClass('is-select');
} else {
e.$loading.show();
options = {
type: 'POST',
url: '/cart/index/orderCompute',
data: d,
success: function(data) {
... ... @@ -497,15 +526,10 @@ var Order = {
// 优惠券修改
$(document).on('click', '.juan-modify', function() {
var $pan = $('.play-juan-pan');
c.winShow($pan);
c.winShow($('.play-juan-pan'));
});
e.$biok.click(function() {
var pan = $(this).parents('dl.pan');
var juanText;
... ... @@ -517,79 +541,47 @@ var Order = {
juanText = $('.play-juan input[value="' + d.couponCode + '"]').next().text();
}
//if (d.yohoCoin * 1 === 0) {
if (!/^\d+$/.test(d.yohoCoin + '') || d.yohoCoin * 1 === 0) {
$('.errbitip').html('请输入一个正整数');
$('#biprice').removeClass('is-select');
} else if (d.yohoCoin * 1 > $('.play-pan em').text() * 1) {
$('.errbitip').html('您的有货币不足');
$('#biprice').removeClass('is-select');
} else {
e.$loading.show();
options = {
type: 'POST',
url: '/cart/index/orderCompute',
data: d,
success: function(data) {
e.$loading.hide();
if (data.code === 200) {
u.render(data.data, juanText);
c.winHide(pan);
//$('.play-bi-pan dt').hide();
} else {
$('.errbitip').html(data.message);
e.$loading.show();
options = {
type: 'POST',
url: '/cart/index/orderCompute',
data: d,
success: function(data) {
var result = data.data;
$('.errbitip').html('');
e.$loading.hide();
if (data.code === 200) {
if (result.yohoCoinCompute && !result.yohoCoinCompute.yohoCoinClick) {
$('.errbitip').html(result.yohoCoinCompute.yohoCoinMsg);
$('#biprice').removeClass('is-select');
$('.yohoCoinTip').addClass('coin-gray');
return false;
}
}
};
$.ajax(options);
}
u.render(result, juanText);
c.winHide(pan);
} else {
$('.errbitip').html(data.message);
$('#biprice').removeClass('is-select');
}
}
};
$.ajax(options);
});
});
// 修改有货币
$(document).on('click', '.bi-modify', function() {
var $pan = $('.play-bi-pan');
c.winShow($pan);
});
e.$bp.keyup(function() {
var val = $(this).val();
//if (val * 1 < 0 || val.indexOf('.') > 0) {
if (!/^\d+$/.test(val + '')) {
e.$errorTip.html('请输入一个正整数');
} else if (val * 1 > $(this).data('bi') * 1) {
e.$errorTip.html('您的有货币不足');
} else {
e.$errorTip.html('抵扣' + (val / 100).toFixed(2) + '元');
}
c.winShow($('.play-bi-pan'));
});
// 取消yoho 币
$('.cancel-bi').click(function() {
var $pan = $('.play-bi-pan');
var juanText;
$('.errbitip').html('');
if ($('#biprice').hasClass('is-select')) {
e.$loading.show();
... ... @@ -613,17 +605,8 @@ var Order = {
if (data.code === 200) {
u.render(data.data, juanText);
c.winHide($pan);
$('#biprice').val('0');
//$('.play-bi-pan dt').hide();
$('#biprice').removeClass('is-select');
$('.errbitip').html('');
// $('.use-envelopes input').attr('checked', 'checked');
// $('.red-envelopes').addClass('active');
} else {
$('.errbitip').html(data.message);
}
... ... @@ -635,7 +618,6 @@ var Order = {
} else {
c.winHide($pan);
$('#biprice').val('0');
}
});
... ... @@ -646,7 +628,8 @@ var Order = {
var $pan = $('.play-juan-pan');
if ($('.play-juan').hasClass('is-select')) {
//订单金额发生变化,使用有货币重置
$('#biprice').removeClass('is-select');
e.$loading.show();
getSelectData(function(d) {
... ... @@ -672,7 +655,6 @@ var Order = {
// $('.use-envelopes input').attr('checked', 'checked');
// $('.red-envelopes').addClass('active');
} else {
e.$juantip.html(data.message);
}
... ... @@ -695,6 +677,8 @@ var Order = {
var $this = $(this),
juanText;
//订单金额发生变化,使用有货币重置
$('#biprice').removeClass('is-select');
e.$loading.show();
$this.attr('disabled', 'disabled');
... ... @@ -712,7 +696,6 @@ var Order = {
}
juanText = $('.play-juan input[value="' + d.couponCode + '"]').next().text();
options = {
type: 'POST',
url: '/cart/index/orderCompute',
... ... @@ -788,6 +771,7 @@ $('.why').click(function() {
$('#differentBag').click(function() {
return false;
});
$(document).click(function() {
$('#differentBag').hide();
});
... ... @@ -876,6 +860,9 @@ $invoiceCheck.click(function(){
}
if ($invoiceCheck.attr('checked')) {
// 选中时传输
window.addPoint('YB_SC_INVOICE_ISSUE');
$invoiceCheck.addClass('active');
if ($('.invoice-content-outter').hasClass('hide')) {
$receiptInfo.removeClass('hide');
... ... @@ -952,6 +939,9 @@ function saveReceiptInfo() {
$receiptInfo.addClass('hide');
$('.invoice-content-outter').removeClass('hide');
// 保存按钮埋点
window.addPoint('YB_SC_INVOICE_INFO_SAVE', {INVOICE_TYPE: invoiceTypeInt, INVOICE_TITLE: $('input[name="title"]:checked').val(), INVOICE_CONTENT: receiptContent});
}
function rejustReceiptInfo() {
... ... @@ -1049,3 +1039,13 @@ $('#input-mobile').bind('input propertychange', function() {
$('.invoice-phone .enpty-input').addClass('hide');
}
});
// 订单确认页默认埋点
window.addPoint('YB_SC_ORDER_ENSURE');
//有货币帮助弹框
$yohoCoinHelp.hover(function() {
$(this).find('.yoho-coin-help-dialog').removeClass('hide');
}, function() {
$(this).find('.yoho-coin-help-dialog').addClass('hide');
});
... ...
... ... @@ -33,6 +33,7 @@ var TicketCat = {
$toPay: $('.ticket-play em'),
$errorTip: $('.errbitip'),
$tbody: $('table tbody', '.pay-wapper'),
$yohoCoinHelp: $('.yoho-coin-help'),
//门票js
$showTicketMobile: $('.show-ticket-mobile'),
... ... @@ -147,6 +148,10 @@ var TicketCat = {
el.$pan.find('dt').click(function() {
var pan = $(this).parent('dl.pan');
if ($(this).hasClass('not-btn')) {
return false;
}
if (pan.find('dd').is(':hidden')) {
c.winShow(pan);
$(this).addClass('active');
... ... @@ -164,50 +169,35 @@ var TicketCat = {
$('#biprice').addClass('is-select');
selectData = _this.getSelectData();
if (!/^\d+$/.test(selectData.yohoCoin + '') || selectData.yohoCoin * 1 === 0) {
$('.errbitip').html('请输入一个正整数');
$('#biprice').removeClass('is-select');
} else if (selectData.yohoCoin * 1 > $('.play-pan em').text() * 1) {
$('.errbitip').html('您的有货币不足');
$('#biprice').removeClass('is-select');
} else {
el.$loading.show();
$.ajax({
type: 'POST',
url: '/cart/index/setTicket',
data: selectData,
success: function(data) {
el.$loading.hide();
if (data.code === 200) {
_this.render(data.data);
c.winHide(pan);
} else {
$('.errbitip').html(data.message);
el.$loading.show();
$.ajax({
type: 'POST',
url: '/cart/index/setTicket',
data: selectData,
success: function(data) {
var result = data.data;
$('.errbitip').html('');
el.$loading.hide();
if (data.code === 200) {
if (result.yohoCoinCompute && !result.yohoCoinCompute.yohoCoinClick) {
$('.errbitip').html(result.yohoCoinCompute.yohoCoinMsg);
$('#biprice').removeClass('is-select');
$('.yohoCoinTip').addClass('coin-gray');
return false;
}
_this.render(result);
c.winHide(pan);
} else {
$('.errbitip').html(data.message);
$('#biprice').removeClass('is-select');
}
});
}
}
});
});
// 修改有货币
$(document).on('click', '.bi-modify', function() {
var $pan = $('.play-bi-pan');
c.winShow($pan);
});
//键盘事件,计算有币货抵多少钱
$('#biprice').keyup(function() {
var val = $(this).val();
if (!/^\d+$/.test(val + '')) {
el.$errorTip.html('请输入一个正整数');
} else if (val * 1 > $(this).data('bi') * 1) {
el.$errorTip.html('您的有货币不足');
} else {
el.$errorTip.html('抵扣' + (val / 100).toFixed(2) + '元');
}
c.winShow($('.play-bi-pan'));
});
// 取消yoho 币
... ... @@ -215,7 +205,6 @@ var TicketCat = {
var $pan = $('.play-bi-pan'),
selectData = {};
$('.errbitip').html('');
el.$loading.show();
selectData = _this.getSelectData();
selectData.yohoCoin = 0;
... ... @@ -229,7 +218,6 @@ var TicketCat = {
_this.render(data.data);
c.winHide($pan);
$('#biprice').val('0');
$('#biprice').removeClass('is-select');
$('.errbitip').html('');
} else {
... ... @@ -280,6 +268,12 @@ var TicketCat = {
});
});
//有货币帮助弹框
el.$yohoCoinHelp.hover(function() {
$(this).find('.yoho-coin-help-dialog').removeClass('hide');
}, function() {
$(this).find('.yoho-coin-help-dialog').addClass('hide');
});
},
//渲染价格明细
... ... @@ -288,11 +282,12 @@ var TicketCat = {
i,
dArr = data.shopping_cart_data.promotion_formula_list,
str = '',
isJuan = false,
isExpress = '';
for (i = 0; i < dArr.length; i++) {
if (dArr[i].promotion === '有货币') {
if (dArr[i].promotion === '有货币') {
dArr[i].promotion = '有货币<span class="bi-modify">[修改]</span>:';
}
... ... @@ -311,18 +306,37 @@ var TicketCat = {
e.$payTotal.html(str);
e.$toPay.html((data.shopping_cart_data.last_order_amount).toFixed(2));
//有货币清零状态更新
$('#biprice').val(accMul(100, data.shopping_cart_data.use_yoho_coin));
if (data.use_yoho_coin === 0) {
$('.errbitip').text('');
} else {
$('.errbitip').text('抵扣' + data.shopping_cart_data.use_yoho_coin.toFixed(2) + '元');
//有货币清零状态更新 start
$('dl.play-bi-pan').find('dt').removeClass('not-btn');
$('.not-btn-tip').addClass('hide');
$('.yohoCoinTip').removeClass('coin-gray');
if (data.yohoCoinCompute.yohoCoinNum > 0) {
$('.errbitip').html('');
}
if (!data.yohoCoinCompute.yohoCoinClick) {
if (isJuan) {
//不可以使用状态
$('dl.play-bi-pan').find('dt').addClass('not-btn');
$('.not-btn-tip').removeClass('hide');
//如果有货币按钮为打开状态,则关闭
_this.Common.winHide($('.play-bi-pan'));
}
$('.yohoCoinTip').addClass('coin-gray');
$('.errbitip').html(data.yohoCoinCompute.yohoCoinMsg);
}
$('#biprice').data({
'yoho-coin-num': data.yohoCoinCompute.yohoCoinNum,
'yoho-coin-click': data.yohoCoinCompute.yohoCoinClick
});
$('#biprice').find('.num-limit-coin').html(data.yohoCoinCompute.yoho_coin_pay_rule.num_limit);
$('#biprice').find('.totalYohoCoinNum').html(data.yohoCoinCompute.totalYohoCoinNum);
$('#biprice').find('.yohoCoinNum').html(data.yohoCoinCompute.yohoCoinNum);
$('#biprice').find('.yohoCoin').html('¥' + data.yohoCoinCompute.yohoCoin);
//有货币清零状态更新 end
},
getSelectData: function() {
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
var biVal = $('#biprice.is-select').val();
var biVal = $('#biprice.is-select').data('yoho-coin-num') * 1 || 0;
var cartType = $('.address-manage').attr('cart-type');
var resultData;
... ...
... ... @@ -17,8 +17,9 @@ var $ = require('yoho.jquery'),
activeTab,
imgAlt,
imgSrc,
orderCode,
payment;
payment,
orderCode = $('.order-num').text(),
orderCount = $('.order-num').siblings('strong').text();
$.jqtab = function(tabtit, tabcon) {
... ... @@ -91,6 +92,10 @@ $('#btnby').click(function() {
payment = $('.choose-type').attr('data-id');
orderCode = $('.order-num').text();
getData(payment, orderCode);
// 埋点
window.addPoint('YB_SC_PAYMENT_TOPAY_CLICK', {ORDER_CODE: orderCode, ORDER_AMOUNT: orderCount, PAY_STYLE: payment});
window.open($payUrl + '?order_code=' + orderCode + '&payment_type=' + $showValue);
$lightBox.show();
});
... ... @@ -108,4 +113,7 @@ $('.pay-over').unbind('click').bind('click', function() {
window.location.href = $(_this).data('url');
}
);
});
\ No newline at end of file
});
// 默认埋点
window.addPoint('YB_SC_PAYMENT', {ORDER_CODE: orderCode, ORDER_AMOUNT: orderCount});
\ No newline at end of file
... ...
{
"name": "web-yohobuy",
"version": "5.1.4",
"version": "5.1.5",
"description": "web yohobuy static",
"keywords": [],
"homepage": "",
... ...
... ... @@ -264,10 +264,11 @@
cursor: pointer;
}
.operation .pay-now {
.operation .pay-now,
.operation .confirm-received {
display: block;
color: #fff;
background: #de034a;
background: #353535;
height: 20px;
line-height: 20px;
text-align: center;
... ... @@ -285,6 +286,18 @@
text-align: center;
border: 1px solid #000;
}
.operation .comment-show-btn {
display: block;
color: #fff;
background: #349bba;
height: 20px;
line-height: 20px;
text-align: center;
margin: 0 auto;
margin-bottom: 2px;
border-radius: 4px;
width: 68px;
}
}
}
... ...
... ... @@ -422,7 +422,11 @@
.pay-type-tips {
color: #999;
padding-left: 15px;
}
.delivery-second-confirm {
padding-top: 10px;
border-top: 1px dashed #ccc;
}
div.pay-type-legend {
... ...
... ... @@ -127,6 +127,7 @@
.red {
color: #e8044f!important;
text-align: center;
}
.orange {
... ... @@ -152,10 +153,20 @@
margin-bottom:5px;
}
.pan dt.not-btn {
background: resolve(/order/not-btn.png) no-repeat center center;
cursor: auto;
}
.not-btn-tip {
position: absolute;
right: 150px;
}
.pan dd {
display: none;
border: 1px #ccc solid;
padding: 10px 15px;
padding: 10px 12px;
margin-bottom: 10px;
}
... ... @@ -183,7 +194,8 @@
background: none;
border: 1px solid #ccc;
border-radius: 2px;
height: 20px;
height: 25px;
width: 60px
}
.ok {
... ... @@ -241,8 +253,8 @@
.play-right {
float: right;
width: 50%;
width: 405px;
font-size: 12px;
.pan {
text-align: right;
... ... @@ -342,8 +354,77 @@
}
.play-bi-pan {
.errbitip {
text-align: left;
}
.play-pan {
width: 100%;
.num-list-width {
width: 350px;
}
.yoho-coin-help-link {
color: #027cf9;
}
li {
margin-top: 12px;
overflow: hidden;
&:last-child {
margin-top: 20px;
}
}
.yoho-coin-help {
display: inline-block;
background-color: #000;
border-radius: 16px;
width: 16px;
height: 16px;
line-height: 17px;
text-align: center;
color: #fff;
font-size: 14px;
cursor: pointer;
}
.yoho-coin-help-dialog {
position: absolute;
right: 20px;
color: #000;
background-color: #fff;
border: 1px solid #000;
margin-top: 10px;
width: 240px;
padding: 5px 10px;
text-align: left;
font-size: 12px;
cursor: auto;
li {
margin-top: 5px;
}
}
.yoho-coin-help-dialog-title {
font-weight: bold;
}
}
.coin-gray {
color: #999;
}
.sign-amount {
color: #d0021b;
padding: 0 2px;
}
dd {
text-align: right;
text-align: left;
}
.textbox {
... ... @@ -358,6 +439,40 @@
}
}
.btn-group {
text-align: left;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
}
.arrow-up {
position: absolute;
right: 6px;
width: 0;
height: 0;
top: -9px;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 8px solid #000;
&:before {
content: '';
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 8px solid #fff;
right: -6px;
top: 1px;
position: absolute;
}
}
}
... ...
... ... @@ -190,6 +190,11 @@ class OrderModel
$detail['traceOrder']['orderDate'] = date('Y.m.d H:i:s', $orderDetail['create_time']);
$expressInfo = self::getExpressInfo($orderCode, $uid, $orderDetail['payment_type'], $orderDetail['create_time'], true);
$detail['traceOrder']['logistics'] = $expressInfo['logistics']; //物流信息
if(empty($expressInfo['logistics'][0])){
$detail['hastrace']=false;
}else{
$detail['hastrace']=true;
}
$detail['traceOrder']['logisticsCompany'] = $expressInfo['logisticsCompany'];
$detail['traceOrder']['courierNumbe'] = $expressInfo['courierNumbe'];
//虚拟商品
... ... @@ -338,7 +343,7 @@ class OrderModel
$result['courierNumbe'] = '';
if ($paymetType == 1) {
if ($isDetail) {
$result['logistics'][] = array(date('Y-m-d H:i:s', $createTime), ' ', '您的订单已提交,等待付款');
$result['logistics'][] = '';//array(date('Y-m-d H:i:s', $createTime), ' ', '您的订单已提交,等待付款');
}
else {
$result['logistics'][] = date('Y-m-d H:i:s', $createTime) . ' ' . '您的订单已提交,等待付款';
... ... @@ -529,12 +534,12 @@ class OrderModel
//'订单已付款,等待备货中'
elseif ($payType != 2 && $payStatus == 'Y') {
$ret['keyName'] = 'paid';
$ret['statusStr'] = '备货中';
$ret['statusStr'] = '待发货';//'备货中';
}
//'订单已成功,等待备货中'-货到付款
elseif ($payType == 2 && $payStatus == 'N') {
$ret['keyName'] = 'complete';
$ret['statusStr'] = '备货中';
$ret['statusStr'] = '待发货';//'备货中';
}
break;
case 1:
... ... @@ -542,7 +547,7 @@ class OrderModel
case 3:
//'订单已付款,等待备货中'
$ret['keyName'] = 'paid';
$ret['statusStr'] = '备货中';
$ret['statusStr'] = '待发货';//'备货中';
break;
case 4:
case 5:
... ... @@ -587,6 +592,8 @@ class OrderModel
$ticketUrl = Helpers::url('/home/QRcode', array('orderCode' => $orderCode));//改成node重构的
//立即付款
$payUrl = Helpers::url('/shopping/pay', array('ordercode' => $orderCode));
//评价晒单 node
$commentUrl = Helpers::url('/home/comment/order', array('orderId' => $orderCode));
//取消订单
$cancelOrderUrl = 'javascript:void(0)';
//确认订单
... ... @@ -595,6 +602,10 @@ class OrderModel
$exchangeUrl = Helpers::url('/home/returns/exchangeRequest', array('orderCode' => $orderCode));
//申请退货
$refundUrl = Helpers::url('/home/returns/refundrequest', array('orderCode' => $orderCode));
if($status >= 6 && $isCancel == 'N' && $payStatus == 'Y') {
$operation[] = array('href' => $commentUrl, 'name' => '晒单评价', 'comment' => true);
}
//再次购买 use_limit_code
if ( $isCancel == 'Y' && $useLimitCode !== 'Y') {
$operation[] = array( 'name' => '再次购买', 'reBuy' => true);
... ...
... ... @@ -55,7 +55,6 @@ class CartModel
// 调用接口,获取购物车数据
$cartData = CartData::cartData($uid, $shoppingKey);
// print_r($cartData); exit;
// 接口异常时,购物车置为空
if (empty($cartData['data'])) {
$result['isEmpty'] = true;
... ... @@ -690,10 +689,15 @@ class CartModel
*/
public static function cartPay($uid, $cartType, $isAdvanceCart)
{
$result = [];
/* 调接口订单确认接口 */
$pay = CartData::cartPay($uid, $cartType);
$result = self::filterCartPay($pay, $cartType, $isAdvanceCart, $uid);
return self::filterCartPay($pay, $cartType, $isAdvanceCart, $uid);
//有货币
$result['yohoCoinCompute'] = self::yohoCoinCompute($pay['data']);
return $result;
}
/**
* 处理购物车返回
... ... @@ -771,7 +775,7 @@ class CartModel
// 默认
if (!isset($result['defaultDelivery'])) {
$result['defaultDelivery'] = '只工作日送货(双休日、节假日不送)';
$result['defaultDelivery'] = '送货时间不限';
if (isset($result['delivery'][0])) {
$result['delivery'][0]['checked'] = true;
}
... ... @@ -880,10 +884,7 @@ class CartModel
}
// 返还的 YOHO 币
$result['totalYoho'] = $pay['data']['shopping_cart_data']['gain_yoho_coin'];
// 拥有的有货币
$result['ownYohoCoin'] = $pay['data']['yoho_coin'] * 100;
// 默认是否使用有货币
$result['useYohoCoin'] = empty($pay['data']['use_yoho_coin']) ? false : true;
// 红包总金额
$result['redEnvelopes'] = empty($pay['data']['red_envelopes']) ? false : Helpers::transPrice($pay['data']['red_envelopes']);
// 使用的红包金额
... ... @@ -906,7 +907,6 @@ class CartModel
$isNewUser = false;
}
$result['isNewUser'] = $isNewUser ? true : false;
//JIT拆单需求 package
$result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']);
} while (false);
... ... @@ -1000,6 +1000,8 @@ class CartModel
$compute['data']['promotion_formula_list'] = $promotionFormulaList;
//JIT拆单
$compute['packages'] = self::getPackageInfo($compute['data']);
//有货币
$compute['data']['yohoCoinCompute'] = self::yohoCoinCompute($compute['data']);
}
$result = $compute;
}
... ... @@ -1554,7 +1556,13 @@ class CartModel
*/
public function addTicket($uid, $productSku, $buyNumber, $yohoCoin = 0)
{
return CartData::addTicket($uid, $productSku, $buyNumber, $yohoCoin);
$result = [];
$result = CartData::addTicket($uid, $productSku, $buyNumber, $yohoCoin);
//有货币
if (isset($result['data']['shopping_cart_data'])) {
$result['data']['yohoCoinCompute'] = self::yohoCoinCompute($result['data']['shopping_cart_data']);
}
return $result;
}
/**
... ... @@ -1567,10 +1575,17 @@ class CartModel
*/
public function filterTicket($uid, $productSku, $buyNumber, $yohoCoin = 0)
{
$result = [];
$cartType = 'advance';
$data = self::addTicket($uid, $productSku, $buyNumber, $yohoCoin);
return self::filterCartPay($data, $cartType, false);
$result = self::filterCartPay($data, $cartType, false);
//有货币
if (isset($data['data']['shopping_cart_data'])) {
$result['yohoCoinCompute'] = self::yohoCoinCompute($data['data']['shopping_cart_data']);
}
return $result;
}
/**
... ... @@ -1586,4 +1601,35 @@ class CartModel
{
return CartData::submitTicket($uid, $productSku, $buyNumber, $mobile, $yohoCoin);
}
/**
*有货币使用前端方案显示及是否可单击判断
*/
public static function yohoCoinCompute($orderCompute) {
$yohoCoinData = ['totalYohoCoinNum' => 0, 'yohoCoin' => 0, 'yohoCoinNum' =>0, 'useYohoCoin' => 0, 'yohoCoinClick' => 0, 'yohoCoinMsg' => ''];
if (empty($orderCompute) || empty($orderCompute['yoho_coin_pay_rule'])) {
return $yohoCoinData;
}
$yohoCoinData = [
'totalYohoCoinNum' => isset($orderCompute['total_yoho_coin_num']) ? intval($orderCompute['total_yoho_coin_num']) : 0,
'yohoCoin' => isset($orderCompute['yoho_coin']) ? Helpers::transPrice($orderCompute['yoho_coin']) : 0,
'yohoCoinNum' => isset($orderCompute['yoho_coin']) ? $orderCompute['yoho_coin'] * 100 : 0,
'useYohoCoin' => isset($orderCompute['use_yoho_coin']) ? Helpers::transPrice($orderCompute['use_yoho_coin']) : 0,
'yohoCoinClick' => 0,
'yohoCoinMsg' => '',
'yoho_coin_pay_rule' => $orderCompute['yoho_coin_pay_rule']
];
if ($yohoCoinData['totalYohoCoinNum'] < 100) {
$yohoCoinData['yohoCoinMsg'] = "抱歉,您的有货币不足,有货币满{$orderCompute['yoho_coin_pay_rule']['num_limit']}个方可使用";
} else if ($yohoCoinData['useYohoCoin'] > 0 || $yohoCoinData['yohoCoin'] > 0) {
$yohoCoinData['yohoCoinMsg'] = '可抵¥' . ($yohoCoinData['useYohoCoin'] > 0 ? $yohoCoinData['useYohoCoin'] : $yohoCoinData['yohoCoin']);
$yohoCoinData['yohoCoinClick'] = 1;
} else {
$yohoCoinData['yohoCoinMsg'] = "抱歉,您的订单实付款不满足有货币使用条件";
}
return $yohoCoinData;
}
}
... ...
... ... @@ -131,6 +131,7 @@ class OrdersController extends WebAction
if (isset($detail['noramlPayMode'])) {
$data['orderInfo'] = $detail['orderInfo'];
$data['traceOrder'] = $detail['traceOrder'];
$data['hastrace'] = $detail['hastrace'];
$data['noramlPayMode'] = $detail['noramlPayMode'];
}
else if (isset($detail['virtualPayMode'])) {
... ... @@ -265,7 +266,8 @@ class OrdersController extends WebAction
$result = array('code' => 400, 'message' => '缺失必填项', 'data' => '');
break;
}
$result = OrderData::updateDeliveryAddress($order_code, $user_name, $area_code, $address, $mobile, $phone);
$uid = $this->getUid();
$result = OrderData::updateDeliveryAddress($order_code, $user_name, $area_code, $address, $mobile, $phone, $uid);
if (!isset($result['code'])) {
break;
}
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "5.1.4"
application.version = "5.1.5"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "5.1.4"
application.version = "5.1.5"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "5.1.4"
application.version = "5.1.5"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "5.1.4"
application.version = "5.1.5"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...