Authored by 陈峰

Merge branch 'feature/cart' into 'release/5.4.1'

Feature/cart



See merge request !217
@@ -8,6 +8,7 @@ const userModel = require('../../serverAPI/user'); @@ -8,6 +8,7 @@ const userModel = require('../../serverAPI/user');
8 const addressModel = require('../../serverAPI/user/address'); 8 const addressModel = require('../../serverAPI/user/address');
9 const orderModel = require('../models/order'); 9 const orderModel = require('../models/order');
10 const crypto = global.yoho.crypto; 10 const crypto = global.yoho.crypto;
  11 +const authcode = require(global.utils + '/authcode');
11 12
12 exports.orderEnsure = (req, res, next) => { 13 exports.orderEnsure = (req, res, next) => {
13 let headerData = headerModel.setNav({ 14 let headerData = headerModel.setNav({
@@ -180,7 +181,7 @@ exports.orderSub = (req, res) => { @@ -180,7 +181,7 @@ exports.orderSub = (req, res) => {
180 if (testQyhUnion.client_id) { 181 if (testQyhUnion.client_id) {
181 unionKey = encryData; 182 unionKey = encryData;
182 } else { 183 } else {
183 - // unionKey = helpers.unionDecode(req.cookies._QYH_UNION, 'q_union_yohobuy'); // TODO 这个方法没有 184 + unionKey = authcode(req.cookies._QYH_UNION, 'q_union_yohobuy');
184 } 185 }
185 } else { 186 } else {
186 unionKey = '{"client_id":' + req.cookies.mkt_code + '}'; 187 unionKey = '{"client_id":' + req.cookies.mkt_code + '}';
@@ -6,11 +6,9 @@ @@ -6,11 +6,9 @@
6 {{#promotions}} 6 {{#promotions}}
7 <div class="promo-item" data-id="{{promotionId}}" data-title="{{promotionOriginTitle}}" data-type="{{promotionType}}" data-status="{{status}}"> 7 <div class="promo-item" data-id="{{promotionId}}" data-title="{{promotionOriginTitle}}" data-type="{{promotionType}}" data-status="{{status}}">
8 <div class="info"><i class="iconfont cuxiao"></i>{{promotionTitle}}</div> 8 <div class="info"><i class="iconfont cuxiao"></i>{{promotionTitle}}</div>
9 - {{#if optTitle}}  
10 <div class="opt to-gift"> 9 <div class="opt to-gift">
11 <a href="javascript:;">{{optTitle}}</a><i class="iconfont to-arrow"></i> 10 <a href="javascript:;">{{optTitle}}</a><i class="iconfont to-arrow"></i>
12 </div> 11 </div>
13 - {{/if}}  
14 </div> 12 </div>
15 {{/promotions}} 13 {{/promotions}}
16 <div class="down-arrow"> 14 <div class="down-arrow">
@@ -236,7 +236,6 @@ @@ -236,7 +236,6 @@
236 236
237 .activity-title { 237 .activity-title {
238 background-color: #fff; 238 background-color: #fff;
239 - border-top: 1PX solid #e0e0e0;  
240 font-size: 32px; 239 font-size: 32px;
241 padding: 20px 20px 0; 240 padding: 20px 20px 0;
242 } 241 }
@@ -265,7 +264,7 @@ @@ -265,7 +264,7 @@
265 padding: 20px; 264 padding: 20px;
266 border-top: 1px solid #e0e0e0; 265 border-top: 1px solid #e0e0e0;
267 font-size: 28px; 266 font-size: 28px;
268 - margin-bottom: 38px; 267 + margin-bottom: 20px;
269 268
270 .title { 269 .title {
271 display: inline-block; 270 display: inline-block;
@@ -14,8 +14,8 @@ const getTimestamp = function() { @@ -14,8 +14,8 @@ const getTimestamp = function() {
14 return parseInt(unixtimeMs / 1000, 10); 14 return parseInt(unixtimeMs / 1000, 10);
15 }; 15 };
16 16
17 -module.exports = function(str, operation, key, expiry) {  
18 - operation = operation ? operation : 'encode'; 17 +module.exports = function(str, key, expiry, operation) {
  18 + operation = operation ? operation : 'decode';
19 key = key ? key : ''; 19 key = key ? key : '';
20 expiry = expiry ? expiry : 0; 20 expiry = expiry ? expiry : 0;
21 let tmpstr, tmp; 21 let tmpstr, tmp;
@@ -115,5 +115,3 @@ module.exports = function(str, operation, key, expiry) { @@ -115,5 +115,3 @@ module.exports = function(str, operation, key, expiry) {
115 115
116 return s; 116 return s;
117 }; 117 };
118 -  
119 -// console.log(module.exports('abcdef123', 'encode', 'key123', 99))