Showing
5 changed files
with
26 additions
and
40 deletions
@@ -20,6 +20,8 @@ exports.ensure = (req, res, next) => { | @@ -20,6 +20,8 @@ exports.ensure = (req, res, next) => { | ||
20 | 20 | ||
21 | co(function*() { | 21 | co(function*() { |
22 | let paymentOption = { | 22 | let paymentOption = { |
23 | + buy_number: 1, | ||
24 | + yoho_coin_mode: 1, | ||
23 | product_sku: sku, | 25 | product_sku: sku, |
24 | sku_type: 'S', | 26 | sku_type: 'S', |
25 | uid | 27 | uid |
@@ -18,18 +18,18 @@ exports.payment = options => { | @@ -18,18 +18,18 @@ exports.payment = options => { | ||
18 | 18 | ||
19 | } | 19 | } |
20 | return result; | 20 | return result; |
21 | - }) | 21 | + }); |
22 | 22 | ||
23 | // mock | 23 | // mock |
24 | - .catch() | ||
25 | - .then(() => { | ||
26 | - let mockData = require('./_buynow-mock').payment; | ||
27 | - | ||
28 | - return { | ||
29 | - code: 200, | ||
30 | - data: paymentProcess.tranformPayment(mockData.data) | ||
31 | - }; | ||
32 | - }); | 24 | + // .catch() |
25 | + // .then(() => { | ||
26 | + // let mockData = require('./_buynow-mock').payment; | ||
27 | + | ||
28 | + // return { | ||
29 | + // code: 200, | ||
30 | + // data: paymentProcess.tranformPayment(mockData.data) | ||
31 | + // }; | ||
32 | + // }); | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | 35 | ||
@@ -39,15 +39,15 @@ exports.compute = options => { | @@ -39,15 +39,15 @@ exports.compute = options => { | ||
39 | method: 'app.Buynow.compute', | 39 | method: 'app.Buynow.compute', |
40 | }, options); | 40 | }, options); |
41 | 41 | ||
42 | - return API.post(url, queryData) | 42 | + return API.post(url, queryData); |
43 | 43 | ||
44 | // mock | 44 | // mock |
45 | - .catch() | ||
46 | - .then(() => { | ||
47 | - let mockData = require('./_buynow-mock').compute; | 45 | + // .catch() |
46 | + // .then(() => { | ||
47 | + // let mockData = require('./_buynow-mock').compute; | ||
48 | 48 | ||
49 | - return mockData; | ||
50 | - }); | 49 | + // return mockData; |
50 | + // }); | ||
51 | }; | 51 | }; |
52 | 52 | ||
53 | 53 | ||
@@ -57,13 +57,13 @@ exports.submit = options => { | @@ -57,13 +57,13 @@ exports.submit = options => { | ||
57 | method: 'app.Buynow.submit' | 57 | method: 'app.Buynow.submit' |
58 | }, options); | 58 | }, options); |
59 | 59 | ||
60 | - return API.post(url, queryData) | 60 | + return API.post(url, queryData); |
61 | 61 | ||
62 | // mock | 62 | // mock |
63 | - .catch() | ||
64 | - .then(()=> { | ||
65 | - let mockData = require('./_buynow-mock').submit; | 63 | + // .catch() |
64 | + // .then(()=> { | ||
65 | + // let mockData = require('./_buynow-mock').submit; | ||
66 | 66 | ||
67 | - return mockData; | ||
68 | - }); | 67 | + // return mockData; |
68 | + // }); | ||
69 | }; | 69 | }; |
@@ -12,14 +12,5 @@ exports.skillData = product_skn => { | @@ -12,14 +12,5 @@ exports.skillData = product_skn => { | ||
12 | product_skn | 12 | product_skn |
13 | }; | 13 | }; |
14 | 14 | ||
15 | - return API.post('', queryData) | ||
16 | - | ||
17 | - // mock | ||
18 | - .catch() | ||
19 | - .then(()=> { | ||
20 | - let mock = require('./_seckill-mock').seckillData; | ||
21 | - | ||
22 | - return mock; | ||
23 | - }); | ||
24 | - | 15 | + return API.post('', queryData); |
25 | }; | 16 | }; |
@@ -72,6 +72,7 @@ const index = (req, res, next) => { | @@ -72,6 +72,7 @@ const index = (req, res, next) => { | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | return seckillModel.queryActivity().then((resultActivity) => { | 74 | return seckillModel.queryActivity().then((resultActivity) => { |
75 | + // console.log(resultActivity) | ||
75 | if (resultActivity.code !== 200) { | 76 | if (resultActivity.code !== 200) { |
76 | return next(); | 77 | return next(); |
77 | } | 78 | } |
@@ -17,15 +17,7 @@ const mock = require('./seckill-mock'); | @@ -17,15 +17,7 @@ const mock = require('./seckill-mock'); | ||
17 | const queryActivity = () => { | 17 | const queryActivity = () => { |
18 | return api.get('', { | 18 | return api.get('', { |
19 | method: 'app.seckill.queryActivity' | 19 | method: 'app.seckill.queryActivity' |
20 | - }, { | ||
21 | - cache: true | ||
22 | }); | 20 | }); |
23 | - | ||
24 | - // TODO: REMOVE follow | ||
25 | - // .catch() | ||
26 | - // .then(() => { | ||
27 | - // return _.cloneDeep(mock.activities); | ||
28 | - // }); | ||
29 | }; | 21 | }; |
30 | 22 | ||
31 | /** | 23 | /** |
-
Please register or login to post a comment