Showing
4 changed files
with
49 additions
and
11 deletions
@@ -105,6 +105,8 @@ exports.selectCoupon = (req, res) => { | @@ -105,6 +105,8 @@ exports.selectCoupon = (req, res) => { | ||
105 | }); | 105 | }); |
106 | 106 | ||
107 | res.render('select-coupon', { | 107 | res.render('select-coupon', { |
108 | + module: 'cart', | ||
109 | + page: 'select-coupon', | ||
108 | title: '选择优惠券', | 110 | title: '选择优惠券', |
109 | selectCouponPage: true, | 111 | selectCouponPage: true, |
110 | pageHeader: headerData, | 112 | pageHeader: headerData, |
@@ -153,7 +155,7 @@ exports.selectAddress = (req, res, next) => { | @@ -153,7 +155,7 @@ exports.selectAddress = (req, res, next) => { | ||
153 | 155 | ||
154 | return addressModel.addressData(uid) | 156 | return addressModel.addressData(uid) |
155 | .then(address => { | 157 | .then(address => { |
156 | - let moreUrl = req.get('Referer') || '/cart/index/orderEnsure'; // 取跳过来的url | 158 | + let moreUrl = req.get('Referer') || '/cart/index/new/orderEnsure'; // 取跳过来的url |
157 | 159 | ||
158 | address = address.data; | 160 | address = address.data; |
159 | 161 | ||
@@ -174,6 +176,8 @@ exports.selectAddress = (req, res, next) => { | @@ -174,6 +176,8 @@ exports.selectAddress = (req, res, next) => { | ||
174 | }); | 176 | }); |
175 | 177 | ||
176 | res.render('select-address', { | 178 | res.render('select-address', { |
179 | + module: 'cart', | ||
180 | + page: 'select-address', | ||
177 | pageHeader: headerData, | 181 | pageHeader: headerData, |
178 | pageFooter: true, | 182 | pageFooter: true, |
179 | moreUrl, | 183 | moreUrl, |
@@ -21,15 +21,6 @@ module.exports = { | @@ -21,15 +21,6 @@ module.exports = { | ||
21 | // liveApi: 'http://api.live.yoho.cn/', | 21 | // liveApi: 'http://api.live.yoho.cn/', |
22 | // singleApi: 'http://single.yoho.cn/' | 22 | // singleApi: 'http://single.yoho.cn/' |
23 | 23 | ||
24 | -<<<<<<< HEAD | ||
25 | - api: 'http://api.gray.yohops.com', | ||
26 | - service: 'service.gray.yohops.com' | ||
27 | - | ||
28 | - // api: 'http://api.yoho.cn/', | ||
29 | - // service: 'http://service.yoho.cn/', | ||
30 | - // liveApi: 'http://api.live.yoho.cn/', | ||
31 | - // singleApi: 'http://single.yoho.cn/' | ||
32 | -======= | ||
33 | api: 'http://api-test3.yohops.com:9999/', | 24 | api: 'http://api-test3.yohops.com:9999/', |
34 | service: 'http://service-test3.yohops.com:9999/', | 25 | service: 'http://service-test3.yohops.com:9999/', |
35 | liveApi: 'http://testapi.live.yohops.com:9999/', | 26 | liveApi: 'http://testapi.live.yohops.com:9999/', |
@@ -49,7 +40,6 @@ module.exports = { | @@ -49,7 +40,6 @@ module.exports = { | ||
49 | // service: 'http://dev-service.yohops.com:9999/', | 40 | // service: 'http://dev-service.yohops.com:9999/', |
50 | // liveApi: 'http://testapi.live.yohops.com:9999/', | 41 | // liveApi: 'http://testapi.live.yohops.com:9999/', |
51 | // singleApi: 'http://api-test1.yohops.com:9999/' | 42 | // singleApi: 'http://api-test1.yohops.com:9999/' |
52 | ->>>>>>> origin/master | ||
53 | }, | 43 | }, |
54 | subDomains: { | 44 | subDomains: { |
55 | host: '.m.yohobuy.com', | 45 | host: '.m.yohobuy.com', |
public/js/cart/select-address.page.js
0 → 100644
1 | +/** | ||
2 | + * 购物车 地址选择 | ||
3 | + * @author: bikai<kai.bi@yoho.cn> | ||
4 | + * @date: 2015/12/14 | ||
5 | + */ | ||
6 | + | ||
7 | +var $ = require('jquery'), | ||
8 | + orderInfo = require('./order-info').orderInfo; | ||
9 | + | ||
10 | +require('home/address.page.js'); | ||
11 | + | ||
12 | +var $confim = $('.confim-mask'), | ||
13 | + deleteId; | ||
14 | + | ||
15 | +require('../common'); | ||
16 | + | ||
17 | +$('.address-item').on('click', function() { | ||
18 | + var $this = $(this); | ||
19 | + var addressId = decodeURIComponent($this.data('address-id')); | ||
20 | + var address = { | ||
21 | + address_id: addressId, | ||
22 | + consignee: $this.find('.name').text(), | ||
23 | + mobile: $this.find('.tel').text(), | ||
24 | + address_info: $this.find('.address-info').text(), | ||
25 | + is_support: $this.data('is-support') | ||
26 | + }; | ||
27 | + | ||
28 | + orderInfo('addressId', addressId); | ||
29 | + orderInfo('address', address); | ||
30 | + window.location.href = $this.data('href') + (orderInfo('limitUrlSufix') || ''); | ||
31 | + | ||
32 | +}).on('click', '.edit', function() { | ||
33 | + window.location.href = $(this).data('href'); | ||
34 | + return false; | ||
35 | +}).on('click', '.del', function() { | ||
36 | + deleteId = $(this).data('id'); | ||
37 | +}); | ||
38 | + | ||
39 | +$confim.on('click', '.confim', function() { | ||
40 | + if (orderInfo('addressId') === deleteId) { | ||
41 | + orderInfo('addressId', null); | ||
42 | + orderInfo('address', null); | ||
43 | + } | ||
44 | +}); |
-
Please register or login to post a comment