Authored by 陈峰

merge

... ... @@ -97,10 +97,10 @@ exports.cartPay = (uid, cartType, orderInfo, limitProductCode, sku, skn, buyNumb
result.error = true;
result.message = pay.message;
} else {
result.cartUrl = helpers.urlFormat('/cart/index/new');
result.cartUrl = helpers.urlFormat('/cart/index/index');
}
return pay;
return result;
}
result = Object.assign(
... ...
... ... @@ -288,11 +288,17 @@ const orderDetailData = (uid, orderCode) => {
// 为支付的拆单配送信息
if (orderDetail.isMultiPackage && orderDetail.isMultiPackage === 'Y') {
let jitInfo = {
deliveryId: orderDetail.deliveryId,
paymentType: orderDetail.paymentType,
couponCode: orderDetail.couponCode,
yohoCoin: orderDetail.yohoCoin,
cartType: 'ordinary'
};
orderDetail = _.assign(orderDetail, {
isJit: true,
packageTitle: orderDetail.packageTitle
// jitDetailUrl: '/cart/index/jitDetailUrl'
jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', jitInfo)
});
}
... ...
... ... @@ -9,27 +9,6 @@ const crypto = global.yoho.crypto;
* 地址数据
* @param uid
* @return
* {
* "code":200,
* "data":[
* {
* "area":"江苏省 南京市 浦口区",
* "address":"沿江街道******,
* "consignee":"孟令阶",
* "is_support":"Y",
* "area_code":"320111",
* "mobile":"180****2255",
* "address_id":"6117354", // 会被加密
* "is_default":"N",
* "is_delivery":"Y",
* "zip_code":"",
* "uid":"14616040",
* "phone":"",
* "email":""}
* ],
* "md5":"c35872955397cd0aabff4583cd41ac4b",
* "message":"Address List"
* }
*/
exports.addressData = (uid) => {
let params = {
... ... @@ -38,7 +17,7 @@ exports.addressData = (uid) => {
};
let options = {
cache: true
cache: false
};
return api.get('', params, options)
... ...
... ... @@ -11,13 +11,6 @@ let $ = require('yoho-jquery'),
tip = require('../../plugin/tip'),
dialog = require('../../plugin/dialog');
// cookie 参数
let actCkOpthn = {
expires: 'Session',
path: '/cart/index',
domain: 'm.yohobuy.com'
};
let cartObj = {
init(handle) {
let self = this;
... ... @@ -64,38 +57,37 @@ let cartObj = {
},
promoItemClick(e) {
let self = this;
let promotionId = $(e.currentTarget).data('id');
let promotionType = $(e.currentTarget).data('type');
let promotionTitle = encodeURIComponent(`以下商品参加【${$(e.currentTarget).data('title')}】促销活动`);
let promotionId = $(e.currentTarget).data('id'),
promotionType = $(e.currentTarget).data('type'),
status = $(e.currentTarget).data('status'),
promotionTitle = encodeURIComponent(`以下商品参加【${$(e.currentTarget).data('title')}】促销活动`);
self.toPromotionPage({
promotionType,
promotionId,
promotionTitle,
status: $(e.currentTarget).data('status')
status
});
},
toPromotionPage(opts) {
let cartType = cookie.get('_cartType') || 'ordinary';
let title = encodeURIComponent('优惠活动商品');
let href;
if (opts.promotionType === 'Gift') {
if (opts.status === 20 || (opts.promotionType !== 'Gift' && opts.promotionType !== 'Needpaygift')) {
href = `/product/index/index?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
} else if (opts.promotionType === 'Gift') {
href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
if (opts.status === 30) {
window.location.href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}&edit=1`;
} else {
window.location.href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
href += '&edit=1';
}
} else if (opts.promotionType === 'Needpaygift') {
href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
if (opts.status === 30) {
window.location.href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}&edit=1`;
} else {
window.location.href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
href += '&edit=1';
}
} else {
window.location.href = `/product/index/index?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
}
window.location.href = href;
},
allGiftBoxClick(e) {
let cartType = cookie.get('_cartType') || 'ordinary';
... ...
... ... @@ -219,11 +219,13 @@
.to-gift {
text-align: right;
width: 139px;
&.no-storage {
a {
color: #c6c6c6;
}
}
a {
color: #ff575c;
font-size: 23px;
... ...
... ... @@ -698,12 +698,11 @@
height: 510px;
background-color: #fff;
z-index: 2;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: 10px;
left: 50%;
margin-left: -270px;
top: 50%;
margin-top: -255px;
.yoho-coin-title {
font-size: 34px;
... ...
... ... @@ -11,7 +11,7 @@ const productProcess = require('./product-process');
const regPromoTitle = /^【[^]+】(.*)/;
const transPrice = (price, isSepcialZero) => {
return (price >= 0 || isSepcialZero) ? parseFloat(price).toFixed(2) : 0;
return (price > 0 || isSepcialZero) ? parseFloat(price).toFixed(2) : 0;
};
const formatPromotionTitle = (promo) => {
let title;
... ...