Authored by zhangxiaoru

merging

... ... @@ -223,7 +223,7 @@ exports.orderSub = (req, res, next) => {
unionKey = testQyhUnion.client_id ? encryData : '';
}
} else {
unionKey = '{"client_id":' + req.cookies.mkt_code + '}';
unionKey = '{"client_id":' + req.cookies.mkt_code + (req.cookies.union_data ? ',"union_data":' + req.cookies.union_data : '') + '}';
}
/* 检查联盟参数是否有效 */
... ...
... ... @@ -136,7 +136,7 @@ const newDetail = {
return res.json({
code: 400,
data: helpers.urlFormat('/signin.html', {
refer: req.originalUrl
refer: req.headers.referer
})});
}
... ...
... ... @@ -226,7 +226,7 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
params.qhy_union = qhyUnion;
}
return api.get('', params, {
return api.post('', params, {
headers: {
'X-Forwarded-For': ip || '',
'User-Agent': userAgent
... ...
... ... @@ -5,20 +5,24 @@
<a href="/product/new">随便逛逛</a>
</div>
{{^}}
{{#if cartNav}}
<ul class="cart-nav clearfix">
<li class="{{#if ordinaryCart}}active{{/if}}" id="common-cart-nav" data-type="ordinary">
<div class="cart-nav clearfix{{#if cartNav}} more{{/if}}">
{{#if commonGoodsCount}}
<div class="nav-item{{#if ordinaryCart}} active{{/if}}" id="common-cart-nav" data-type="ordinary">
<span>普通商品({{commonGoodsCount}})</span>
</li>
<li class="{{#if advanceCart}}active{{/if}}" id="presell-cart-nav" data-type="advance">
</div>
{{/if}}
{{#if presellGoodsCount}}
<div class="nav-item{{#if advanceCart}} active{{/if}}" id="presell-cart-nav" data-type="advance">
<span >预售商品({{presellGoodsCount}})</span>
<div id="presell-tip" class="presell-tip hide">
<div class="triangle"></div>
<p class="pt-content">预售商品点这里结算哦~</p>
</div>
</li>
</ul>
{{/if}}
</div>
{{/if}}
<button class="btn-edit"></button>
</div>
{{#if ordinaryCart}}
<div class="cart-content normal-good active">
{{#commonCart}}
... ...
... ... @@ -61,7 +61,11 @@ let indexObj = {
if (referrer && referrer !== window.location.href) {
cookie.remove('_cartReferrer');
window.location.href = referrer;
if (referrer === document.referrer || referrer === window.queryString.referrer) {
window.history.go(-1);
} else {
window.location.href = referrer;
}
} else {
window.location.href = '/?go=1';
}
... ... @@ -89,8 +93,7 @@ let indexObj = {
let self = this;
if ((!data || (!data.commonCart && !data.preSellCart)) && no_try !== true) {
self.refreshPage();
return;
return self.refreshPage();
}
let cartType = cookie.get('_cartType') || 'ordinary';
... ... @@ -120,6 +123,9 @@ let indexObj = {
$('.cart-box').html(hbsTemplate(data));
require('./index/cart').init(self);
require('./index/good').init(self);
$('.btn-edit').on('click', () => {
self.navBtnClick();
});
lazyLoad($('img.lazy'));
return Promise.resolve();
}
... ...
... ... @@ -17,7 +17,7 @@ let cartObj = {
self.handle = handle;
$('.cart-nav').on('click', 'li', function(e) {
$('.cart-nav').on('click', '.nav-item', function(e) {
self.cartNavClick(e);
});
$('.more-box>.down-arrow').on('click', function(e) {
... ...
... ... @@ -45,22 +45,56 @@
}
.cart-nav {
position: relative;
color: #c6c6c6;
border-bottom: 1PX solid #e0e0e0;
background: #fff;
display: none;
&.more {
display: flex;
}
li {
float: left;
width: 50%;
.nav-item {
padding: 35px 0;
height: 35px;
box-sizing: content-box;
flex: 1;
position: relative;
}
li.active {
.nav-item.active {
color: #000;
}
&.more {
.btn-edit {
position: relative;
margin-top: 24px;
margin-right: 30px;
top: initial;
right: initial;
}
}
.btn-edit {
&:before {
content: "编辑";
}
display: none;
width: 100px;
height: 60px;
border-radius: 5PX;
background-color: #efefef;
color: #808080;
position: absolute;
top: 24px;
right: 30px;
font-size: 30px;
padding: 0;
}
span {
display: block;
box-sizing: border-box;
... ... @@ -69,13 +103,14 @@
line-height: 35px;
font-size: 35px;
text-align: center;
border-left: 1PX solid #e0e0e0;
}
li:first-child span {
border-right: 1PX solid #e0e0e0;
.nav-item:first-child span {
border: none;
}
li:last-child {
.nav-item:last-child {
position: relative;
}
... ... @@ -130,6 +165,16 @@
}
}
.wechat-body {
.cart-nav {
display: flex;
.btn-edit {
display: block;
}
}
}
.more-box {
transition: all 0.2s;
}
... ... @@ -294,10 +339,12 @@
}
.main-wrap.edit {
.nav-btn {
&:before {
content: "完成";
}
.nav-btn:before {
content: "完成";
}
.btn-edit:before {
content: "完成";
}
.all-gift-box {
... ... @@ -481,6 +528,7 @@
color: #444;
font-size: 29px;
border-radius: 4px;
padding: 0px;
}
}
}
... ...
... ... @@ -28,6 +28,7 @@ const formatPromotionTitle = (promo) => {
let match = regPromoTitle.exec(promo.promotion_title);
let promotionTitle = match !== null && match.length > 1 ? match[1] : promo.promotion_title;
promotionTitle = promotionTitle.replace('¥', '¥');
return `${title}${promotionTitle}】`;
};
const formatPromotionOpt = (promo) => {
... ...