Authored by 刘传洋

order submit tip

... ... @@ -385,7 +385,7 @@ class CartData
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
$paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes)
$paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes, $isContinueBuy)
{
if (in_array($cartType, array('ordinary', 'advance')) === FALSE) {
return array('code' => 400, 'message' => '购物车参数类型有误!', 'data' => array());
... ... @@ -441,6 +441,7 @@ class CartData
}
$param['remark'] = $remark;
$param['client_secret'] = Sign::getSign($param);
$param['is_continue_buy'] = $isContinueBuy;
return Yohobuy::get(API_URL, $param, false, false, 10, $userAgent);
... ...
... ... @@ -8,6 +8,7 @@ var dialog = require('../common/dialog');
var isProvinceChecked = false;
var isContinueBuy = 'N';
var $addressManage = $('.address-manage'),
$province = $addressManage.find('.text-input[name="province"]'),
... ... @@ -778,6 +779,7 @@ $('.to-play input.submit').click(function() {
$juangroupInput = $('.play-juan.is-select input[name="juangroup"]:checked'),
codeVal = $juangroupInput.val(),
juanCode = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();
subTip = '';
if ($invoiceCheck.hasClass('active')) {
invoiceType = $('.invoice-upload-type').html();
... ... @@ -814,20 +816,57 @@ $('.to-play input.submit').click(function() {
yohoCoin: yohoCoin,
isPreContact: ytoTrue(isPreContact),
isPrintPrice: ytoTrue(isPrintPrice),
redEnvelopes: redEnvelopes
redEnvelopes: redEnvelopes,
isContinueBuy: isContinueBuy
}
}).then(function(d) {
$loading.hide();
if (d.code === 200) {
// 去付款按钮埋点
$('.product-num').each(function() {
productNum += parseInt($(this).html());
});
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});
if(d.data && d.data.is_hint === 'Y') { // 商品校验不通过提示
window.location.href = d.data.payUrl;
if(d.data.hintInfo) {
subTip = d.data.hintInfo.productName;
if(subTip && subTip.length > 20) {
subTip = subTip.substr(0, 20); + '...';
}
subTip += d.data.hintInfo.suffix;
subTip += '<br/>';
subTip += d.data.hintInfo.lastLine;
}
new dialog.Dialog({
content: subTip,
className: 'confirm-dialog',
btns: [{
id: 'confirm-sure',
btnClass: ['confirm-sure'],
name: '继续提交',
cb: function() {
isContinueBuy = 'Y';
$this.prop('disabled', false);
$('.to-play input.submit').trigger('click');
}
}, {
id: 'confirm-cancel',
btnClass: ['confirm-cancel'],
name: '返回上一步',
cb: function() {
window.history.go(-1);
}
}]
}).show();
} else {
// 去付款按钮埋点
$('.product-num').each(function() {
productNum += parseInt($(this).html());
});
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();
}
... ...
... ... @@ -1030,7 +1030,7 @@ class CartModel
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes)
public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes, $isContinueBuy)
{
$result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE);
... ... @@ -1078,7 +1078,7 @@ class CartModel
$userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null;
}
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey, $userAgent, $redEnvelopes);
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey, $userAgent, $redEnvelopes, $isContinueBuy);
if ($orderSubRes && isset($orderSubRes['code'])) {
$orderSubRes['data']['unionKey'] = $unionKey;
$result = $orderSubRes;
... ...
... ... @@ -488,9 +488,11 @@ class IndexController extends WebAction
$isPreContact = $this->post('isPreContact', false); // 送货前是否联系
$isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格
$redEnvelopes = $this->post('redEnvelopes', null);
$isContinueBuy = $this->post('isContinueBuy', 'N');
// 调用下单接口
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
$paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
$paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes,
$isContinueBuy);
// 判断是否下单成功
if (empty($result['data']['order_code'])) {
UdpLog::info('【结算信息】判断是否下单成功', 'order_code' . $result['data']['order_code']);
... ...