Authored by 陈轩

结算-选择地址页面

... ... @@ -148,3 +148,37 @@ exports.couponSearch = (req, res, next) => {
})();
};
exports.selectAddress = (req, res, next) => {
let uid = req.user.uid;
return addressModel.addressData(uid)
.then(address => {
let moreUrl = req.get('Referer') || '/cart/index/orderEnsure'; // 取跳过来的url
address = address.data;
// 购物车订单进来,秒杀进来
if (
moreUrl.indexOf('/cart/index/new/orderEnsure') !== -1 ||
moreUrl.indexOf('/cart/index/seckill') !== -1
) {
req.session.addressMore = moreUrl; // TODO: 注意cookie-session
}
moreUrl = req.session.addressMore;
let headerData = headerModel.setNav({
navTitle: '选择地址',
navBtn: false,
backUrl: moreUrl
});
res.render('select-address', {
pageHeader: headerData,
pageFooter: true,
moreUrl,
address
});
});
};
... ...
... ... @@ -27,10 +27,10 @@ router.get('/paySuccess/payCod', payController.payCod);// 支付成功,货到
router.get('/shopping/pay/aliwapreturn', payController.payAli);// 支付成功,支付宝付款
router.get('/index/new/orderEnsure', authMW, order.orderEnsure); // 订单结算
router.get('/index/new/selectAddress', authMW, order.selectAddress); // 选择地址
router.get('/index/new/selectCoupon', authMW, order.selectCoupon); // 选择优惠券 页面
router.get('/index/new/couponList', order.couponList); // [ajax]获取优惠券列表
router.post('/index/new/couponSearch', order.couponSearch); // [ajax]购物车输入优惠券码使用优惠券
router.get('/index/new/selectAddress', authMW, order.selectAddress); // 选择地址
module.exports = router;
... ...
<div class="my-address-page select-address-page yoho-page">
<div class="page-wrap clearfix">
{{# address}}
<div class="address-item" data-address-id="{{address_id}}" data-is-support="{{is_support}}" data-href="{{../moreUrl}}">
<span class="name">{{consignee}}</span>
<span class="tel">{{mobile}}</span>
<p class="address-info">{{area}} {{address}}</p>
<div class="action iconfont">
<span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=shopping">&#xe61e;</span>
<span class="del" data-id="{{address_id}}">&#xe621;</span>
</div>
</div>
{{/ address}}
<a class="add-address" data-href="/home/addressAct?refer=shopping">
添加新地址
</a>
<div class="confim-mask hide">
<div class="confim-box">
<div class="content">
您确定要删除地址?
</div>
<div class="action">
<span class="cancel">
取消
</span>
<span class="confim">
确认
</span>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...