Authored by 郭成尧

disableBFCache

@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 const router = require('express').Router(); //eslint-disable-line 9 const router = require('express').Router(); //eslint-disable-line
10 const cRoot = './controllers'; 10 const cRoot = './controllers';
11 const authMW = require('../../doraemon/middleware/auth'); 11 const authMW = require('../../doraemon/middleware/auth');
12 - 12 +const disableBFCache = require('../../doraemon/middleware/disable-BFCache');
13 const seckill = require(cRoot + '/seckill'); 13 const seckill = require(cRoot + '/seckill');
14 const order = require(cRoot + '/order'); 14 const order = require(cRoot + '/order');
15 const countController = require(`${cRoot}/count`); 15 const countController = require(`${cRoot}/count`);
@@ -33,7 +33,7 @@ router.get('/shopping/pay/payZero', payController.payZero);// 支付成功,支 @@ -33,7 +33,7 @@ router.get('/shopping/pay/payZero', payController.payZero);// 支付成功,支
33 router.get('/index/new/pay', authMW, payController.pay);// 统一支付 URL,支持微信,支付宝 33 router.get('/index/new/pay', authMW, payController.pay);// 统一支付 URL,支持微信,支付宝
34 router.get('/index/new/pay/alipayresult', authMW, payController.payAli);// 支付宝付款支付成功 34 router.get('/index/new/pay/alipayresult', authMW, payController.payAli);// 支付宝付款支付成功
35 35
36 -router.get('/index/new/orderEnsure', authMW, order.orderEnsure); // 订单结算 36 +router.get('/index/new/orderEnsure', authMW, disableBFCache, order.orderEnsure); // 订单结算
37 router.post('/index/new/orderCompute', authMW, order.orderCompute); // 结算页参数改变,重新运算 37 router.post('/index/new/orderCompute', authMW, order.orderCompute); // 结算页参数改变,重新运算
38 router.post('/index/new/orderSub', authMW, order.orderSub); // 订单提交 38 router.post('/index/new/orderSub', authMW, order.orderSub); // 订单提交
39 router.get('/index/new/selectCoupon', authMW, order.selectCoupon); // 选择优惠券 页面 39 router.get('/index/new/selectCoupon', authMW, order.selectCoupon); // 选择优惠券 页面
@@ -64,7 +64,7 @@ router.post('/index/new/giftinfo', indexController.giftinfo); // 获取购物车 @@ -64,7 +64,7 @@ router.post('/index/new/giftinfo', indexController.giftinfo); // 获取购物车
64 router.post('/index/new/incrbundle', indexController.incrBundle); // 购物车增加套餐数量 64 router.post('/index/new/incrbundle', indexController.incrBundle); // 购物车增加套餐数量
65 router.post('/index/new/decrbundle', indexController.decrBundle); // 购物车减少加套餐数量 65 router.post('/index/new/decrbundle', indexController.decrBundle); // 购物车减少加套餐数量
66 66
67 -router.get('/index/buynow/orderensure', authMW, BuyNowController.orderEnsure); // 立即购买订单确认页面 67 +router.get('/index/buynow/orderensure', authMW, disableBFCache, BuyNowController.orderEnsure); // 立即购买订单确认页面
68 router.post('/index/buynow/ordercompute', authMW, BuyNowController.orderCompute); // 立即购买订单重新计算 68 router.post('/index/buynow/ordercompute', authMW, BuyNowController.orderCompute); // 立即购买订单重新计算
69 router.post('/index/buynow/ordersub', authMW, BuyNowController.orderSub); // 立即购买订单提交 69 router.post('/index/buynow/ordersub', authMW, BuyNowController.orderSub); // 立即购买订单提交
70 router.get('/index/buynow/selectAddress', authMW, BuyNowController.selectAddress); // 选择地址 70 router.get('/index/buynow/selectAddress', authMW, BuyNowController.selectAddress); // 选择地址
@@ -15,8 +15,7 @@ let $ = require('yoho-jquery'), @@ -15,8 +15,7 @@ let $ = require('yoho-jquery'),
15 15
16 let isGetData; 16 let isGetData;
17 17
18 -let $newCoupon = $('#new-coupon'),  
19 - linkUrl = document.referrer; 18 +let $newCoupon = $('#new-coupon');
20 let $couponAvailable = $('#couponAvailable'); 19 let $couponAvailable = $('#couponAvailable');
21 let $couponUnavailable = $('#couponUnavailable'); 20 let $couponUnavailable = $('#couponUnavailable');
22 let $useCoupon = $('#useCoupon'); 21 let $useCoupon = $('#useCoupon');
@@ -44,11 +43,7 @@ function fixedLayOut() { @@ -44,11 +43,7 @@ function fixedLayOut() {
44 ellipsis.init(); 43 ellipsis.init();
45 44
46 function goToBack() { 45 function goToBack() {
47 - if (linkUrl) {  
48 - window.location.href = linkUrl;  
49 - } else {  
50 - history.go(-1);  
51 - } 46 + history.go(-1);
52 } 47 }
53 48
54 /** 49 /**
@@ -14,8 +14,7 @@ let $ = require('yoho-jquery'), @@ -14,8 +14,7 @@ let $ = require('yoho-jquery'),
14 14
15 let isGetData; 15 let isGetData;
16 16
17 -let $newCoupon = $('#new-coupon'),  
18 - linkUrl = document.referrer; 17 +let $newCoupon = $('#new-coupon');
19 let $couponAvailable = $('#couponAvailable'); 18 let $couponAvailable = $('#couponAvailable');
20 let $couponUnavailable = $('#couponUnavailable'); 19 let $couponUnavailable = $('#couponUnavailable');
21 let $useCoupon = $('#useCoupon'); 20 let $useCoupon = $('#useCoupon');
@@ -43,11 +42,7 @@ function fixedLayOut() { @@ -43,11 +42,7 @@ function fixedLayOut() {
43 ellipsis.init(); 42 ellipsis.init();
44 43
45 function goToBack() { 44 function goToBack() {
46 - if (linkUrl) {  
47 - window.location.href = linkUrl;  
48 - } else {  
49 - history.go(-1);  
50 - } 45 + history.go(-1);
51 } 46 }
52 47
53 /** 48 /**