Authored by 郭成尧

product_sku

@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2017-06-21 10:15:38 3 * @Date: 2017-06-21 10:15:38
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2017-06-22 16:44:24 5 + * @Last Modified time: 2017-06-22 16:59:54
6 */ 6 */
7 const co = require('bluebird').coroutine; 7 const co = require('bluebird').coroutine;
8 const headerModel = require('../../../doraemon/models/header'); 8 const headerModel = require('../../../doraemon/models/header');
@@ -34,16 +34,22 @@ class BuyNowController { @@ -34,16 +34,22 @@ class BuyNowController {
34 res.clearCookie('buynow-order-info', actCkOpthn); 34 res.clearCookie('buynow-order-info', actCkOpthn);
35 } 35 }
36 36
  37 + let product_sku = req.query.product_sku;
  38 +
  39 + if (!product_sku) {
  40 + return next();
  41 + }
  42 +
37 co(function * () { 43 co(function * () {
38 let result = yield req.ctx(BuyNowModel).payment({ 44 let result = yield req.ctx(BuyNowModel).payment({
39 uid: req.user.uid, 45 uid: req.user.uid,
40 - product_sku: req.query.product_sku || '2026740', // TODO 46 + product_sku: product_sku,
41 sku_type: req.query.sku_type, 47 sku_type: req.query.sku_type,
42 buy_number: req.query.buy_number, 48 buy_number: req.query.buy_number,
43 }); 49 });
44 let computeData = yield req.ctx(BuyNowModel).compute({ 50 let computeData = yield req.ctx(BuyNowModel).compute({
45 uid: req.user.uid, 51 uid: req.user.uid,
46 - product_sku: req.query.product_sku || '2026740', // TODO 52 + product_sku: product_sku,
47 sku_type: req.query.sku_type, 53 sku_type: req.query.sku_type,
48 buy_number: req.query.buy_number, 54 buy_number: req.query.buy_number,
49 use_yoho_coin: parseInt(orderInfo.use_yoho_coin, 10) 55 use_yoho_coin: parseInt(orderInfo.use_yoho_coin, 10)
@@ -78,7 +84,7 @@ class BuyNowController { @@ -78,7 +84,7 @@ class BuyNowController {
78 cart_type: req.body.cart_type, 84 cart_type: req.body.cart_type,
79 delivery_way: req.body.delivery_way, 85 delivery_way: req.body.delivery_way,
80 payment_type: req.body.payment_type, 86 payment_type: req.body.payment_type,
81 - product_sku: req.body.product_sku || '2026740', // TODO 87 + product_sku: req.body.product_sku,
82 coupon_code: req.body.coupon_code, 88 coupon_code: req.body.coupon_code,
83 use_yoho_coin: req.body.use_yoho_coin, 89 use_yoho_coin: req.body.use_yoho_coin,
84 }); 90 });
@@ -108,7 +114,7 @@ class BuyNowController { @@ -108,7 +114,7 @@ class BuyNowController {
108 114
109 let params = { 115 let params = {
110 uid: req.user.uid, 116 uid: req.user.uid,
111 - product_sku: req.body.product_sku || '2026740', // TODO 117 + product_sku: req.body.product_sku,
112 sku_type: req.body.sku_type, 118 sku_type: req.body.sku_type,
113 buy_number: req.body.buy_number, 119 buy_number: req.body.buy_number,
114 address_id: req.body.address_id, 120 address_id: req.body.address_id,
@@ -2,12 +2,13 @@ @@ -2,12 +2,13 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2017-06-21 10:30:21 3 * @Date: 2017-06-21 10:30:21
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2017-06-22 16:32:27 5 + * @Last Modified time: 2017-06-22 16:58:56
6 */ 6 */
7 require('buynow/order-ensure.page.css'); 7 require('buynow/order-ensure.page.css');
8 const $ = require('yoho-jquery'); 8 const $ = require('yoho-jquery');
9 const lazyLoad = require('yoho-jquery-lazyload'); 9 const lazyLoad = require('yoho-jquery-lazyload');
10 const cookie = require('yoho-cookie'); 10 const cookie = require('yoho-cookie');
  11 +const qs = require('yoho-qs');
11 12
12 let tip = require('plugin/tip'), 13 let tip = require('plugin/tip'),
13 loading = require('plugin/loading'), 14 loading = require('plugin/loading'),
@@ -187,6 +188,7 @@ function orderCompute() { @@ -187,6 +188,7 @@ function orderCompute() {
187 let use_yoho_coin = orderInfo('use_yoho_coin'), 188 let use_yoho_coin = orderInfo('use_yoho_coin'),
188 deliver_way = orderInfo('delivery_way'), 189 deliver_way = orderInfo('delivery_way'),
189 data = { 190 data = {
  191 + product_sku: qs.product_sku,
190 cart_type: orderInfo('cartType') || 'ordinary', 192 cart_type: orderInfo('cartType') || 'ordinary',
191 delivery_way: orderInfo('delivery_way'), 193 delivery_way: orderInfo('delivery_way'),
192 payment_type: orderInfo('payment_type'), 194 payment_type: orderInfo('payment_type'),
@@ -258,6 +260,7 @@ function submitOrder() { @@ -258,6 +260,7 @@ function submitOrder() {
258 method: 'POST', 260 method: 'POST',
259 url: '/cart/index/buynow/ordersub', 261 url: '/cart/index/buynow/ordersub',
260 data: { 262 data: {
  263 + product_sku: qs.product_sku,
261 address_id: orderInfo('address_id'), 264 address_id: orderInfo('address_id'),
262 delivery_way: orderInfo('delivery_way'), 265 delivery_way: orderInfo('delivery_way'),
263 delivery_time: orderInfo('delivery_time'), 266 delivery_time: orderInfo('delivery_time'),