Authored by 郭成尧

Merge remote-tracking branch 'origin/master' into feature/vip2

@@ -56,6 +56,11 @@ app.enable('trust proxy'); @@ -56,6 +56,11 @@ app.enable('trust proxy');
56 56
57 app.disable('x-powered-by'); 57 app.disable('x-powered-by');
58 58
  59 +// docker验证项目是否正常发布
  60 +app.use('/node/status.html', (req, res) => {
  61 + return res.status(204).end();
  62 +});
  63 +
59 app.use((req, res, next) => { 64 app.use((req, res, next) => {
60 req.url = stringProcess.decodeURIComponent(req.url) || '/404';// 错误的网址编码重定向404 65 req.url = stringProcess.decodeURIComponent(req.url) || '/404';// 错误的网址编码重定向404
61 req.isApmReport = _.get(req.app.locals, 'wap.open.bughd', false); // 把错误上报的开关绑定到上下文,node-lib 库要使用 66 req.isApmReport = _.get(req.app.locals, 'wap.open.bughd', false); // 把错误上报的开关绑定到上下文,node-lib 库要使用
@@ -171,11 +176,6 @@ try { @@ -171,11 +176,6 @@ try {
171 app.use(downloadBar()); 176 app.use(downloadBar());
172 app.use(riskManagement()); 177 app.use(riskManagement());
173 178
174 - // docker验证项目是否正常发布  
175 - app.use('/node/status.html', (req, res) => {  
176 - return res.status(204).end();  
177 - });  
178 -  
179 require('./dispatch')(app); 179 require('./dispatch')(app);
180 app.all('*', errorHanlder.notFound()); // 404 180 app.all('*', errorHanlder.notFound()); // 404
181 181
1 <div class="trend-c no-pb share-activity" id="no-download"> 1 <div class="trend-c no-pb share-activity" id="no-download">
2 - <div class="package-top">  
3 - <span></span>  
4 - 预约后需到店付款  
5 - </div>  
6 {{# list}} 2 {{# list}}
7 {{> trend/activity}} 3 {{> trend/activity}}
8 {{/ list}} 4 {{/ list}}
@@ -5,10 +5,6 @@ @@ -5,10 +5,6 @@
5 <span class="scroll-item" id={{id}}>{{name}}</span> 5 <span class="scroll-item" id={{id}}>{{name}}</span>
6 {{/typeList}} 6 {{/typeList}}
7 </div> 7 </div>
8 - <div class="package-top">  
9 - <span></span>  
10 - 预约后需到店付款  
11 - </div>  
12 <div class="class-c"> 8 <div class="class-c">
13 {{# list}} 9 {{# list}}
14 {{> trend/class}} 10 {{> trend/class}}
@@ -2,10 +2,6 @@ @@ -2,10 +2,6 @@
2 {{> trend/adviser-info}} 2 {{> trend/adviser-info}}
3 {{#if packageList}} 3 {{#if packageList}}
4 <div class="big-title">造型套餐</div> 4 <div class="big-title">造型套餐</div>
5 - <div class="package-top">  
6 - <span></span>  
7 - 预约后需到店付款  
8 - </div>  
9 {{/if}} 5 {{/if}}
10 <div> 6 <div>
11 {{# packageList}} 7 {{# packageList}}
@@ -22,10 +22,6 @@ @@ -22,10 +22,6 @@
22 {{/ cutterList}} 22 {{/ cutterList}}
23 </div> 23 </div>
24 <div class="big-title">造型套餐</div> 24 <div class="big-title">造型套餐</div>
25 - <div class="package-top">  
26 - <span></span>  
27 - 预约后需到店付款  
28 - </div>  
29 <div> 25 <div>
30 {{# packageList}} 26 {{# packageList}}
31 {{> trend/cutter-package}} 27 {{> trend/cutter-package}}
@@ -36,10 +36,6 @@ @@ -36,10 +36,6 @@
36 <span>推荐套餐</span> 36 <span>推荐套餐</span>
37 </div> 37 </div>
38 <div class="tab-item"> 38 <div class="tab-item">
39 - <div class="package-top">  
40 - <span></span>  
41 - 预约后需到店付款  
42 - </div>  
43 <ul class="package"> 39 <ul class="package">
44 {{# packageList}} 40 {{# packageList}}
45 {{> trend/package}} 41 {{> trend/package}}
@@ -11,6 +11,7 @@ const moment = require('moment'); @@ -11,6 +11,7 @@ const moment = require('moment');
11 const mRoot = '../models'; 11 const mRoot = '../models';
12 const headerModel = require('../../../doraemon/models/header'); 12 const headerModel = require('../../../doraemon/models/header');
13 const seckillModel = require(`${mRoot}/seckill`); 13 const seckillModel = require(`${mRoot}/seckill`);
  14 +const _ = require('lodash');
14 15
15 let headerData = headerModel.setNav({ 16 let headerData = headerModel.setNav({
16 navTitle: '秒杀活动', 17 navTitle: '秒杀活动',
@@ -18,6 +19,16 @@ let headerData = headerModel.setNav({ @@ -18,6 +19,16 @@ let headerData = headerModel.setNav({
18 }); 19 });
19 20
20 /** 21 /**
  22 + * hotfix ios 6.5.5 版本隐藏设置提醒按钮
  23 + */
  24 +const _iosHideRemindBtn = (products) => {
  25 + return _.map(products, goods => {
  26 + goods.hideRemind = true;
  27 + return goods;
  28 + });
  29 +};
  30 +
  31 +/**
21 * [时间缺0补0] 32 * [时间缺0补0]
22 */ 33 */
23 const _timeFormat = (tick) => { 34 const _timeFormat = (tick) => {
@@ -228,6 +239,10 @@ const indexData = (req, res, next) => { @@ -228,6 +239,10 @@ const indexData = (req, res, next) => {
228 return fetchProductList(activityInfo, uid).then((resultProducts) => { 239 return fetchProductList(activityInfo, uid).then((resultProducts) => {
229 result.products = resultProducts; 240 result.products = resultProducts;
230 241
  242 + if (/^6.5.5/.test(req.query.app_version) && req.query.client_type === 'iphone') {
  243 + result.products = _iosHideRemindBtn(resultProducts);
  244 + }
  245 +
231 res.json(result); 246 res.json(result);
232 }); 247 });
233 }); 248 });
@@ -256,6 +271,9 @@ const getProductList = (req, res, next) => { @@ -256,6 +271,9 @@ const getProductList = (req, res, next) => {
256 }; 271 };
257 272
258 return fetchProductList(activityInfo, uid).then(resultProducts => { 273 return fetchProductList(activityInfo, uid).then(resultProducts => {
  274 + if (/^6.5.5/.test(req.query.app_version) && req.query.client_type === 'iphone') {
  275 + resultProducts = _iosHideRemindBtn(resultProducts);
  276 + }
259 res.json({products: resultProducts}); 277 res.json({products: resultProducts});
260 }).catch(error => { 278 }).catch(error => {
261 logger.error(error); 279 logger.error(error);
@@ -45,7 +45,8 @@ const PATH_WHITE_LIST = [ @@ -45,7 +45,8 @@ const PATH_WHITE_LIST = [
45 '/product/shop/hfxRaNY27L.txt', 45 '/product/shop/hfxRaNY27L.txt',
46 '/product/hfxRaNY27L.txt', 46 '/product/hfxRaNY27L.txt',
47 '/.well-known/apple-app-site-association', 47 '/.well-known/apple-app-site-association',
48 - '/service/sitemap.xml' 48 + '/service/sitemap.xml',
  49 + '/node/status.html'
49 ]; 50 ];
50 51
51 const limiter = (rule, policy, context) => { 52 const limiter = (rule, policy, context) => {
@@ -19,7 +19,7 @@ const _getClientIp = req => { @@ -19,7 +19,7 @@ const _getClientIp = req => {
19 if (remoteIp.indexOf(',') > 0) { 19 if (remoteIp.indexOf(',') > 0) {
20 let arr = remoteIp.split(','); 20 let arr = remoteIp.split(',');
21 21
22 - remoteIp = _.trim(arr[arr.length - 1]); 22 + remoteIp = _.trim(arr[0]);
23 } 23 }
24 24
25 if (_.startsWith(remoteIp, '10.66.')) { 25 if (_.startsWith(remoteIp, '10.66.')) {
1 { 1 {
2 "name": "yohobuywap-node", 2 "name": "yohobuywap-node",
3 - "version": "6.5.52", 3 + "version": "6.5.53",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 "xml2js": "^0.4.19", 86 "xml2js": "^0.4.19",
87 "yoho-express-session": "^2.0.0", 87 "yoho-express-session": "^2.0.0",
88 "yoho-md5": "^2.0.0", 88 "yoho-md5": "^2.0.0",
89 - "yoho-node-lib": "=0.6.10", 89 + "yoho-node-lib": "=0.6.12",
90 "yoho-zookeeper": "^1.0.9" 90 "yoho-zookeeper": "^1.0.9"
91 }, 91 },
92 "devDependencies": { 92 "devDependencies": {
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <span class="tag">{{tag}}</span> 4 <span class="tag">{{tag}}</span>
5 <img src="{{image2 image mode=2 q=60}}"> 5 <img src="{{image2 image mode=2 q=60}}">
6 <div class="info"> 6 <div class="info">
7 - <span class="name">{{name}}</span> 7 + <span class="name eps">{{name}}</span>
8 {{#if free}} 8 {{#if free}}
9 <span class="free">免费</span> 9 <span class="free">免费</span>
10 {{else}} 10 {{else}}
@@ -32,4 +32,4 @@ @@ -32,4 +32,4 @@
32 </div> 32 </div>
33 </a> 33 </a>
34 </div> 34 </div>
35 -</div>  
  35 +</div>
@@ -11,6 +11,7 @@ let $ = require('yoho-jquery'), @@ -11,6 +11,7 @@ let $ = require('yoho-jquery'),
11 loading = require('plugin/loading'), 11 loading = require('plugin/loading'),
12 lazyload = require('yoho-jquery-lazyload'), 12 lazyload = require('yoho-jquery-lazyload'),
13 tip = require('plugin/tip'); 13 tip = require('plugin/tip');
  14 +let qs = require('yoho-qs');
14 15
15 loading.init($(document.body)); 16 loading.init($(document.body));
16 17
@@ -243,16 +244,22 @@ seckillObj = { @@ -243,16 +244,22 @@ seckillObj = {
243 refreshProductList: function(activityId, startTime) { 244 refreshProductList: function(activityId, startTime) {
244 let self = this; 245 let self = this;
245 let url = '/product/seckill/get-product-list'; 246 let url = '/product/seckill/get-product-list';
  247 + let reqData = {
  248 + uid: yoho.isLogin(), // only app use;
  249 + activityId: activityId,
  250 + startTime: startTime
  251 + };
  252 +
  253 + if (qs.app_version && qs.client_type) {
  254 + reqData.app_version = qs.app_version;
  255 + reqData.client_type = qs.client_type;
  256 + }
246 257
247 loading.showLoading(); 258 loading.showLoading();
248 self.el.$navList.toggleClass('fix-top', false); 259 self.el.$navList.toggleClass('fix-top', false);
249 $.ajax({ 260 $.ajax({
250 url: url, 261 url: url,
251 - data: {  
252 - uid: yoho.isLogin(), // only app use;  
253 - activityId: activityId,  
254 - startTime: startTime  
255 - }, 262 + data: reqData,
256 success: function(data) { 263 success: function(data) {
257 data = $.extend(data, {isApp: yoho.isApp}); 264 data = $.extend(data, {isApp: yoho.isApp});
258 $('.product-list').html(self.listTemplate(data)); 265 $('.product-list').html(self.listTemplate(data));