Authored by htoooth

Merge remote-tracking branch 'origin/release/6.3' into release/6.3

... ... @@ -837,7 +837,9 @@ module.exports = class extends global.yoho.BaseModel {
name: it.product_name,
img: it.default_images ? helpers.image(it.default_images, 190, 256) : '',
price: '¥' + chelper.transPrice(it.sales_price),
href: helpers.getUrlBySkc(it.product_skn)
href: helpers.getUrlBySkc(it.product_skn),
marketPrice: (it.market_price && +it.market_price > +it.sales_price) ?
'¥' + chelper.transPrice(it.market_price) : ''
};
}));
... ...
... ... @@ -33,12 +33,12 @@ exports.index = (req, res, next) => {
exports.editAddress = (req, res, next) => {
let uid = req.user.uid;
if (!req.query.id) {
return {code: 400};
if (!req.body.id) {
return res.json({code: 400});
}
// 真实数据输出
req.ctx(addressModel).editAddress(req.query, uid).then(result => {
req.ctx(addressModel).editAddress(req.body, uid).then(result => {
res.json(result);
}).catch(next);
};
... ... @@ -62,10 +62,10 @@ exports.delAddress = (req, res, next) => {
let uid = req.user.uid;
if (!req.query.id) {
return {
return res.json({
code: 400,
message: '缺失必填项'
};
});
}
// 真实数据输出
... ... @@ -80,15 +80,15 @@ exports.delAddress = (req, res, next) => {
exports.defaultAddress = (req, res, next) => {
let uid = req.user.uid;
if (!req.query.id) {
return {
if (!req.body.id) {
return res.json({
code: 400,
message: '缺失必填项'
};
});
}
// 真实数据输出
req.ctx(addressModel).defaultAddress(req.query, uid).then(result => {
req.ctx(addressModel).defaultAddress(req.body, uid).then(result => {
res.json(result);
}).catch(next);
};
... ...
... ... @@ -118,7 +118,6 @@ module.exports = class extends global.yoho.BaseModel {
let that = this;
return co(function*() {
let id = params.id,
respData = {};
let addressDataModel = new AddressApi(that.ctx);
... ...
... ... @@ -257,13 +257,13 @@ router.get('/address', tabsMiddleware.getCommonHeader, AddressController.index);
router.get('/address/area', UserController.getProviceList);
router.get('/address/editAddress', AddressController.editAddress);
router.post('/address/editAddress', AddressController.editAddress);
router.post('/address/saveAddress', AddressController.saveAddress);
router.get('/address/delAddress', AddressController.delAddress);
router.get('/address/defaultAddress', AddressController.defaultAddress);
router.post('/address/defaultAddress', AddressController.defaultAddress);
// 兑换礼品卡
... ...
... ... @@ -110,7 +110,7 @@ module.exports = {
port: '4444' // influxdb port
},
console: {
level: 'debug',
level: 'info',
colorize: 'all',
prettyPrint: true
}
... ...
... ... @@ -17,7 +17,12 @@
</a>
<a class="name" href="{{href}}" target="_blank">{{name}}</a>
<p class="price">
<span class="sale-price">{{price}}</span>
{{#if marketPrice}}
<span class="sale-price red">{{price}}</span>
<span class="market-price">{{marketPrice}}</span>
{{^}}
<span class="sale-price">{{price}}</span>
{{/if}}
</p>
<a class="btn-add-cart"
{{#if id}}data-id="{{id}}"{{/if}}
... ...
... ... @@ -45,7 +45,11 @@ var address = {
},
editAddr: function(id) {
$.getJSON('/home/address/editAddress?id=' + id, function(jsonData) {
$.ajax({
url: '/home/address/editAddress',
type: 'POST',
data: {id: id},
}).done(function(jsonData) {
if (jsonData.code === 200) {
$('#form-status').html('修改地址');
$('#addressName').val(jsonData.data.consignee);
... ... @@ -82,7 +86,7 @@ var address = {
delAddr: function(addrId) {
$.getJSON('/home/address/delAddress?id=' + addrId, function(jsonData) {
if (jsonData.code === 200) {
$('.address-list').find('li[addressId=' + addrId + ']').remove();
$('.address-list').find('li[addressId="' + addrId + '"]').remove();
if (addrId === $('#addrId').val()) {
address.clearAddrForm();
}
... ... @@ -96,10 +100,14 @@ var address = {
setDefaultAddr: function(addrId) {
var oldBtn = $('.address-list').find('.default-btn'),
oldLi = $('.address-list').find('.default-btn').parents('li'),
curLi = $('.address-list').find('li[addressId=' + addrId + ']'),
curLi = $('.address-list').find('li[addressId="' + addrId + '"]'),
curBtn = curLi.find('.set-default-btn');
$.getJSON('/home/address/defaultAddress?id=' + addrId, function(jsonData) {
$.ajax({
url: '/home/address/defaultAddress',
type: 'POST',
data: {id: addrId},
}).done(function(jsonData) {
if (jsonData.code === 200) {
oldBtn.attr('class', 'btn-c3 set-default-btn');
oldLi.removeClass('preferred');
... ...
... ... @@ -793,7 +793,7 @@
margin: 0 !important;
.cart-together-product-list {
width: 880px;
width: 680px;
padding: 0;
font-size: 14px;
background-color: #fff;
... ... @@ -808,8 +808,8 @@
}
.title {
height: 50px;
line-height: 50px;
height: 40px;
line-height: 40px;
background-color: #000;
color: #fff;
text-align: center;
... ... @@ -817,7 +817,7 @@
.close-btn {
color: #fff;
line-height: 48px;
line-height: 38px;
font-size: 30px;
position: absolute;
top: 0;
... ... @@ -826,7 +826,7 @@
.price-tabs {
text-align: left;
padding: 30px 40px 20px;
padding: 20px 20px 4px;
li {
float: left;
... ... @@ -849,19 +849,19 @@
}
.product-wrap {
width: 800px;
padding: 0 40px;
width: 640px;
padding: 0 20px;
}
.goods-item {
float: left;
width: 190px;
width: 150px;
margin-right: 10px;
margin-bottom: 10px;
.img {
width: 190px;
height: 256px;
width: 150px;
height: 200px;
display: block;
margin-bottom: 6px;
}
... ... @@ -871,6 +871,10 @@
height: 100%;
}
.red {
color: #c51c1c;
}
.name,
.price {
font-size: 12px;
... ... @@ -881,6 +885,11 @@
display: block;
}
.market-price {
text-decoration: line-through;
margin-left: 15px;
}
.btn-add-cart {
width: 100px;
height: 30px;
... ... @@ -888,14 +897,14 @@
color: #3a3a3a;
border: 1px solid #b0b0b0;
display: inline-block;
margin: 10px auto;
margin: 8px auto;
cursor: pointer;
}
}
.foot-pager {
border: none;
padding: 10px 0;
padding: 0 0 10px;
text-align: left;
}
... ...