Authored by ccbikai(👎🏻🍜)

Merge remote-tracking branch 'origin/feature/fotmatJs' into feature/webpack2

@@ -20,7 +20,6 @@ const path = require('path'); @@ -20,7 +20,6 @@ const path = require('path');
20 const compression = require('compression'); 20 const compression = require('compression');
21 const bodyParser = require('body-parser'); 21 const bodyParser = require('body-parser');
22 const cookieParser = require('cookie-parser'); 22 const cookieParser = require('cookie-parser');
23 -const favicon = require('serve-favicon');  
24 const uuid = require('uuid'); 23 const uuid = require('uuid');
25 24
26 const pkg = require('./package.json'); 25 const pkg = require('./package.json');
@@ -74,7 +73,6 @@ app.use(global.yoho.hbs({ @@ -74,7 +73,6 @@ app.use(global.yoho.hbs({
74 73
75 app.use(global.yoho.middleware()); 74 app.use(global.yoho.middleware());
76 75
77 -app.use(favicon(path.join(__dirname, '/favicon.ico')));  
78 app.use(bodyParser.json()); 76 app.use(bodyParser.json());
79 app.use(bodyParser.urlencoded({ 77 app.use(bodyParser.urlencoded({
80 extended: false 78 extended: false
@@ -21,6 +21,7 @@ exports.submit = (req, res) => { @@ -21,6 +21,7 @@ exports.submit = (req, res) => {
21 21
22 if (req.body.captcha === captchaCode) { 22 if (req.body.captcha === captchaCode) {
23 let key = `pc:limiter:${remoteIp}`; 23 let key = `pc:limiter:${remoteIp}`;
  24 +
24 cache.delAsync(key).then(() => { 25 cache.delAsync(key).then(() => {
25 return res.json({ 26 return res.json({
26 code: 200 27 code: 200
@@ -7,7 +7,7 @@ exports.index = function(req, res, next) { @@ -7,7 +7,7 @@ exports.index = function(req, res, next) {
7 type: req.query.type 7 type: req.query.type
8 }).then((result) => { 8 }).then((result) => {
9 if (!result) { 9 if (!result) {
10 - return next(); 10 + return next();
11 } 11 }
12 res.render('feature', { 12 res.render('feature', {
13 module: 'activity', 13 module: 'activity',
@@ -10,7 +10,7 @@ const inviteTitle = { @@ -10,7 +10,7 @@ const inviteTitle = {
10 normal: '有货 邀请好友赢福利' 10 normal: '有货 邀请好友赢福利'
11 }; 11 };
12 const _ = require('lodash'); 12 const _ = require('lodash');
13 -const md5 = require('md5'); 13 +const md5 = require('yoho-md5');
14 const secretKey = '5466ee572bcbc75830d044e66ab429bc';// 秘钥 14 const secretKey = '5466ee572bcbc75830d044e66ab429bc';// 秘钥
15 15
16 16
@@ -580,6 +580,7 @@ exports.needKnow = function(req, res) { @@ -580,6 +580,7 @@ exports.needKnow = function(req, res) {
580 }); 580 });
581 581
582 let type = req.query.type; 582 let type = req.query.type;
  583 +
583 switch (type) { 584 switch (type) {
584 case '1': 585 case '1':
585 res.render('trend/need-know1', responseData); 586 res.render('trend/need-know1', responseData);
@@ -189,7 +189,7 @@ const oldList = (params) => { @@ -189,7 +189,7 @@ const oldList = (params) => {
189 if (result && result.data) { 189 if (result && result.data) {
190 resu = result.data; 190 resu = result.data;
191 } 191 }
192 - 192 +
193 return resu; 193 return resu;
194 }); 194 });
195 }; 195 };
@@ -1089,7 +1089,7 @@ const orderDetail = (params) => { @@ -1089,7 +1089,7 @@ const orderDetail = (params) => {
1089 } 1089 }
1090 return adviserDetail(newNarams).then(newResult => { 1090 return adviserDetail(newNarams).then(newResult => {
1091 1091
1092 - let adviserDetail= ''; 1092 + let adviserDetail = '';
1093 1093
1094 if (newResult && newResult.data) { 1094 if (newResult && newResult.data) {
1095 adviserDetail = { 1095 adviserDetail = {
@@ -201,7 +201,7 @@ const payCod = (req, res, next) => { @@ -201,7 +201,7 @@ const payCod = (req, res, next) => {
201 201
202 let param = { 202 let param = {
203 uid: req.user.uid, 203 uid: req.user.uid,
204 - udid: req.sessionID || require('md5')(req.ip) || 'yoho', 204 + udid: req.sessionID || require('yoho-md5')(req.ip) || 'yoho',
205 orderCode: req.query.order_code, 205 orderCode: req.query.order_code,
206 contentCode: '78d0fb6c97d691863286edcb4d8abfa9', 206 contentCode: '78d0fb6c97d691863286edcb4d8abfa9',
207 client_id: req.cookies._yasvd || '', 207 client_id: req.cookies._yasvd || '',
@@ -247,7 +247,7 @@ const payAli = (req, res, next) => { @@ -247,7 +247,7 @@ const payAli = (req, res, next) => {
247 247
248 let param = { 248 let param = {
249 uid: req.user.uid, 249 uid: req.user.uid,
250 - udid: req.sessionID || require('md5')(req.ip) || 'yoho', 250 + udid: req.sessionID || require('yoho-md5')(req.ip) || 'yoho',
251 orderCode: req.query.out_trade_no, 251 orderCode: req.query.out_trade_no,
252 contentCode: '78d0fb6c97d691863286edcb4d8abfa9' 252 contentCode: '78d0fb6c97d691863286edcb4d8abfa9'
253 }; 253 };
@@ -298,7 +298,7 @@ const payZero = (req, res, next) => { @@ -298,7 +298,7 @@ const payZero = (req, res, next) => {
298 298
299 let param = { 299 let param = {
300 uid: req.user.uid, 300 uid: req.user.uid,
301 - udid: req.sessionID || require('md5')(req.ip) || 'yoho', 301 + udid: req.sessionID || require('yoho-md5')(req.ip) || 'yoho',
302 orderCode: req.query.order_code, 302 orderCode: req.query.order_code,
303 contentCode: '78d0fb6c97d691863286edcb4d8abfa9', 303 contentCode: '78d0fb6c97d691863286edcb4d8abfa9',
304 isPay: true 304 isPay: true
@@ -11,7 +11,7 @@ const helpers = global.yoho.helpers; @@ -11,7 +11,7 @@ const helpers = global.yoho.helpers;
11 const common = require('./common'); 11 const common = require('./common');
12 const sign = require('./sign'); 12 const sign = require('./sign');
13 const payHelpersBank = require('./bank'); 13 const payHelpersBank = require('./bank');
14 -const md5 = require('md5'); 14 +const md5 = require('yoho-md5');
15 const logger = global.yoho.logger; 15 const logger = global.yoho.logger;
16 16
17 const ALIPAY_URL = 'https://mapi.alipay.com/gateway.do'; 17 const ALIPAY_URL = 'https://mapi.alipay.com/gateway.do';
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 const config = global.yoho.config; 9 const config = global.yoho.config;
10 const helpers = global.yoho.helpers; 10 const helpers = global.yoho.helpers;
11 const sign = require('./sign'); 11 const sign = require('./sign');
12 -const md5 = require('md5'); 12 +const md5 = require('yoho-md5');
13 const moment = require('moment'); 13 const moment = require('moment');
14 const logger = global.yoho.logger; 14 const logger = global.yoho.logger;
15 const AlipayConfig = config.alipayConfig; 15 const AlipayConfig = config.alipayConfig;
@@ -14,7 +14,7 @@ const rp = require('request-promise'); @@ -14,7 +14,7 @@ const rp = require('request-promise');
14 const Promise = require('bluebird'); 14 const Promise = require('bluebird');
15 const co = Promise.coroutine; 15 const co = Promise.coroutine;
16 const sign = require('./sign'); 16 const sign = require('./sign');
17 -const md5 = require('md5'); 17 +const md5 = require('yoho-md5');
18 const moment = require('moment'); 18 const moment = require('moment');
19 const common = require('./common'); 19 const common = require('./common');
20 20
@@ -11,7 +11,7 @@ const serviceAPI = global.yoho.ServiceAPI; @@ -11,7 +11,7 @@ const serviceAPI = global.yoho.ServiceAPI;
11 const utils = '../../../utils'; 11 const utils = '../../../utils';
12 const productProcess = require(`${utils}/product-process`); 12 const productProcess = require(`${utils}/product-process`);
13 const ApipayConfig = global.yoho.config.alipayConfig; 13 const ApipayConfig = global.yoho.config.alipayConfig;
14 -const md5 = require('md5'); 14 +const md5 = require('yoho-md5');
15 const payApi = require('./pay-api'); 15 const payApi = require('./pay-api');
16 const helpers = global.yoho.helpers; 16 const helpers = global.yoho.helpers;
17 const _ = require('lodash'); 17 const _ = require('lodash');
@@ -25,7 +25,7 @@ const praiseArticle = (req, res, next) => { @@ -25,7 +25,7 @@ const praiseArticle = (req, res, next) => {
25 /* 判断参数是否有效 */ 25 /* 判断参数是否有效 */
26 let id = req.body.id, 26 let id = req.body.id,
27 opt = req.body.opt || 'ok', 27 opt = req.body.opt || 'ok',
28 - udid = req.sessionID || require('md5')(req.ip) || 'yoho'; 28 + udid = req.sessionID || require('yoho-md5')(req.ip) || 'yoho';
29 29
30 if (!stringProcess.isNumeric(id)) { 30 if (!stringProcess.isNumeric(id)) {
31 res.json({ code: 400, message: '非法请求', data: '' }); 31 res.json({ code: 400, message: '非法请求', data: '' });
@@ -21,7 +21,7 @@ exports.index = (req, res, next) => { @@ -21,7 +21,7 @@ exports.index = (req, res, next) => {
21 let params = { 21 let params = {
22 uid: req.user.uid, 22 uid: req.user.uid,
23 channel: req.query.channel || 1, 23 channel: req.query.channel || 1,
24 - udid: require('md5')(req.ip) 24 + udid: require('yoho-md5')(req.ip)
25 }; 25 };
26 26
27 let studentSwitch = !_.get(req.app.locals.wap, 'user.removeStudentIdentification', true); 27 let studentSwitch = !_.get(req.app.locals.wap, 'user.removeStudentIdentification', true);
@@ -15,7 +15,7 @@ const AlipayStrategy = require('./models/passport-alipay').Strategy; @@ -15,7 +15,7 @@ const AlipayStrategy = require('./models/passport-alipay').Strategy;
15 15
16 const _ = require('lodash'); 16 const _ = require('lodash');
17 17
18 -// const md5 = require('md5'); 18 +// const md5 = require('yoho-md5');
19 19
20 const config = global.yoho.config; 20 const config = global.yoho.config;
21 const logger = global.yoho.logger; 21 const logger = global.yoho.logger;
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 const _ = require('lodash'); 8 const _ = require('lodash');
9 const passport = require('passport'); 9 const passport = require('passport');
10 10
11 -// const md5 = require('md5'); 11 +// const md5 = require('yoho-md5');
12 const uuid = require('uuid'); 12 const uuid = require('uuid');
13 const cookie = global.yoho.cookie; 13 const cookie = global.yoho.cookie;
14 const helpers = global.yoho.helpers; 14 const helpers = global.yoho.helpers;
@@ -434,6 +434,7 @@ let setPassword = (req, res, next) => { @@ -434,6 +434,7 @@ let setPassword = (req, res, next) => {
434 if (!resultCopy) { 434 if (!resultCopy) {
435 return; 435 return;
436 } 436 }
  437 +
437 // 返回跳转到来源页面 438 // 返回跳转到来源页面
438 let refer = req.cookies.refer; 439 let refer = req.cookies.refer;
439 440
@@ -196,6 +196,7 @@ exports.indexCheck = (req, res, next) => { @@ -196,6 +196,7 @@ exports.indexCheck = (req, res, next) => {
196 196
197 197
198 logger.info(`captcha validate result${captcode.toString() === captcodeValid},user:${captcode};server:${captcodeValid}`); 198 logger.info(`captcha validate result${captcode.toString() === captcodeValid},user:${captcode};server:${captcodeValid}`);
  199 +
199 // 验证 200 // 验证
200 if ([area, mobile].some(val => val === '')) { 201 if ([area, mobile].some(val => val === '')) {
201 return em.emit('reject', Object.assign(errorData, { message: '请填写手机号'})); 202 return em.emit('reject', Object.assign(errorData, { message: '请填写手机号'}));
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 'use strict'; 8 'use strict';
9 const util = require('util'); 9 const util = require('util');
10 const _ = require('lodash'); 10 const _ = require('lodash');
11 -const md5 = require('md5'); 11 +const md5 = require('yoho-md5');
12 const passport = require('passport-strategy'); 12 const passport = require('passport-strategy');
13 13
14 // 支付宝网关地址 14 // 支付宝网关地址
@@ -241,6 +241,7 @@ let getProductData = (data) => { @@ -241,6 +241,7 @@ let getProductData = (data) => {
241 productList: productProcess.processProductList(bundleData && bundleData.productList) 241 productList: productProcess.processProductList(bundleData && bundleData.productList)
242 }; 242 };
243 } 243 }
  244 +
244 /* 量贩 */ 245 /* 量贩 */
245 if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 2) { 246 if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 2) {
246 finalResult.discountBuy = { 247 finalResult.discountBuy = {
@@ -23,7 +23,7 @@ const newDetail = { @@ -23,7 +23,7 @@ const newDetail = {
23 .catch() 23 .catch()
24 .then(result => { 24 .then(result => {
25 let data = {}; 25 let data = {};
26 - 26 +
27 if (result.data) { 27 if (result.data) {
28 data = result.data; 28 data = result.data;
29 if (data.storageSum > 0) { 29 if (data.storageSum > 0) {
@@ -150,11 +150,11 @@ exports.saveEvalute = (req, res) => { @@ -150,11 +150,11 @@ exports.saveEvalute = (req, res) => {
150 params.promoter = req.body.promoter; 150 params.promoter = req.body.promoter;
151 params.stars = req.body.stars; 151 params.stars = req.body.stars;
152 152
153 - if(req.body.reasonIds) { 153 + if (req.body.reasonIds) {
154 params.reasonIds = req.body.reasonIds; 154 params.reasonIds = req.body.reasonIds;
155 } 155 }
156 156
157 - if(req.body.reasonMsg) { 157 + if (req.body.reasonMsg) {
158 params.reasonMsg = req.body.reasonMsg; 158 params.reasonMsg = req.body.reasonMsg;
159 } 159 }
160 160
@@ -10,6 +10,7 @@ const captchaPolicy = require('./policies/captcha'); @@ -10,6 +10,7 @@ const captchaPolicy = require('./policies/captcha');
10 const reporterPolicy = require('./policies/reporter'); 10 const reporterPolicy = require('./policies/reporter');
11 11
12 const IP_WHITE_LIST = [ 12 const IP_WHITE_LIST = [
  13 +
13 // '106.38.38.146', 14 // '106.38.38.146',
14 // '218.94.75.58' 15 // '218.94.75.58'
15 ]; 16 ];
@@ -20,6 +21,7 @@ const limiter = (rule, policy, context) => { @@ -20,6 +21,7 @@ const limiter = (rule, policy, context) => {
20 21
21 module.exports = (req, res, next) => { 22 module.exports = (req, res, next) => {
22 let remoteIp = req.get('X-Forwarded-For') || req.connection.remoteAddress; 23 let remoteIp = req.get('X-Forwarded-For') || req.connection.remoteAddress;
  24 +
23 logger.debug('request remote ip: ', remoteIp); 25 logger.debug('request remote ip: ', remoteIp);
24 26
25 if (remoteIp.indexOf(',') > 0) { 27 if (remoteIp.indexOf(',') > 0) {
@@ -22,7 +22,7 @@ module.exports = (limiter, policy) => { @@ -22,7 +22,7 @@ module.exports = (limiter, policy) => {
22 return cache.getAsync(key).then((result) => { 22 return cache.getAsync(key).then((result) => {
23 if (result) { 23 if (result) {
24 if (result > 100) { 24 if (result > 100) {
25 - return Promise.resolve(policy);//policy(req, res, next); 25 + return Promise.resolve(policy);// policy(req, res, next);
26 } else { 26 } else {
27 return Promise.resolve(true); 27 return Promise.resolve(true);
28 } 28 }
@@ -34,7 +34,6 @@ @@ -34,7 +34,6 @@
34 "feed": "^0.3.1", 34 "feed": "^0.3.1",
35 "geetest": "^4.1.1", 35 "geetest": "^4.1.1",
36 "lodash": "^4.17.4", 36 "lodash": "^4.17.4",
37 - "md5": "^2.1.0",  
38 "memory-cache": "^0.1.6", 37 "memory-cache": "^0.1.6",
39 "moment": "^2.18.1", 38 "moment": "^2.18.1",
40 "oneapm": "^1.2.20", 39 "oneapm": "^1.2.20",
@@ -47,11 +46,11 @@ @@ -47,11 +46,11 @@
47 "postcss-sprites": "^4.2.0", 46 "postcss-sprites": "^4.2.0",
48 "request": "^2.81.0", 47 "request": "^2.81.0",
49 "request-promise": "^3.0.0", 48 "request-promise": "^3.0.0",
50 - "serve-favicon": "^2.4.0",  
51 "uuid": "^3.0.1", 49 "uuid": "^3.0.1",
52 "xml2js": "^0.4.17", 50 "xml2js": "^0.4.17",
53 "yoho-express-session": "^2.0.0", 51 "yoho-express-session": "^2.0.0",
54 "yoho-node-lib": "=0.2.11", 52 "yoho-node-lib": "=0.2.11",
  53 + "yoho-md5": "^2.0.0",
55 "yoho-zookeeper": "^1.0.8" 54 "yoho-zookeeper": "^1.0.8"
56 }, 55 },
57 "devDependencies": { 56 "devDependencies": {
1 require('3party/check.page.css'); 1 require('3party/check.page.css');
2 require('../common'); 2 require('../common');
  3 +
3 // 图片验证码 4 // 图片验证码
4 let ImgCheck = require('plugin/img-check'); 5 let ImgCheck = require('plugin/img-check');
5 6
@@ -15,6 +15,7 @@ function swiperInit() { @@ -15,6 +15,7 @@ function swiperInit() {
15 var spacebetween = $(this).data('spacebetween'); 15 var spacebetween = $(this).data('spacebetween');
16 var autoplay = $(this).data('autoplay'); 16 var autoplay = $(this).data('autoplay');
17 var pagination = $(this).find('.swiper-pagination'); 17 var pagination = $(this).find('.swiper-pagination');
  18 +
18 if (spacebetween) { 19 if (spacebetween) {
19 opt.spaceBetween = Number(spacebetween); 20 opt.spaceBetween = Number(spacebetween);
20 } 21 }
@@ -17,6 +17,7 @@ require('../common'); @@ -17,6 +17,7 @@ require('../common');
17 require('activity/promotion/promotion.page.css'); 17 require('activity/promotion/promotion.page.css');
18 18
19 var share = require('../common/share'); 19 var share = require('../common/share');
  20 +
20 share({ 21 share({
21 title: '【有货】学生认证看过来!专享特价,任性分期,立即走起→', 22 title: '【有货】学生认证看过来!专享特价,任性分期,立即走起→',
22 link: location.href, 23 link: location.href,
@@ -298,7 +299,7 @@ $( @@ -298,7 +299,7 @@ $(
298 } 299 }
299 } 300 }
300 301
301 - if (($(".login-btn").length > 0) || $(".reg-now").length > 0) { 302 + if (($('.login-btn').length > 0) || $('.reg-now').length > 0) {
302 303
303 var shareUrl = location.href.replace('userUid=', 'oldUid='); 304 var shareUrl = location.href.replace('userUid=', 'oldUid=');
304 305
@@ -51,7 +51,7 @@ function formatDate(time) { @@ -51,7 +51,7 @@ function formatDate(time) {
51 if (minutes < 10) { 51 if (minutes < 10) {
52 minutes = '0' + minutes; 52 minutes = '0' + minutes;
53 } 53 }
54 - return year + '年' + month + '月' + date + '日' + ' ' + week[day-1] + ' ' + hour + ':' + minutes; 54 + return year + '年' + month + '月' + date + '日' + ' ' + week[day - 1] + ' ' + hour + ':' + minutes;
55 } 55 }
56 56
57 function autoScroll(thisPo) { 57 function autoScroll(thisPo) {
@@ -196,7 +196,7 @@ function diaHide() { @@ -196,7 +196,7 @@ function diaHide() {
196 196
197 197
198 function removeByValue(arr, val) { 198 function removeByValue(arr, val) {
199 - for (var i=0; i<arr.length; i++) { 199 + for (var i = 0; i < arr.length; i++) {
200 if (arr[i] == val) { 200 if (arr[i] == val) {
201 arr.splice(i, 1); 201 arr.splice(i, 1);
202 break; 202 break;
@@ -276,7 +276,7 @@ function submitDia() { @@ -276,7 +276,7 @@ function submitDia() {
276 276
277 // 修改弹框样式 277 // 修改弹框样式
278 $('.tap-hightlight').css('color', '#007aff'); 278 $('.tap-hightlight').css('color', '#007aff');
279 - $('.dialog-content').css({'text-align': 'left', 'padding': '0 0.75rem 0.5rem'}); 279 + $('.dialog-content').css({'text-align': 'left', padding: '0 0.75rem 0.5rem'});
280 } 280 }
281 281
282 function setCookieArr() { 282 function setCookieArr() {
@@ -452,7 +452,7 @@ $( @@ -452,7 +452,7 @@ $(
452 $(this).css('margin-top', newTop + 'px'); 452 $(this).css('margin-top', newTop + 'px');
453 } else { 453 } else {
454 var newTop = (w_height - $(this).height()) / 2; 454 var newTop = (w_height - $(this).height()) / 2;
455 - 455 +
456 $(this).css('margin-top', newTop + 'px'); 456 $(this).css('margin-top', newTop + 'px');
457 } 457 }
458 } 458 }
@@ -481,9 +481,9 @@ $( @@ -481,9 +481,9 @@ $(
481 var minBoxIndex = $.inArray(minBoxHeight, boxArr); 481 var minBoxIndex = $.inArray(minBoxHeight, boxArr);
482 482
483 $(value).css({ 483 $(value).css({
484 - 'position': 'absolute',  
485 - 'top': minBoxHeight,  
486 - 'left': box.eq(minBoxIndex).position().left 484 + position: 'absolute',
  485 + top: minBoxHeight,
  486 + left: box.eq(minBoxIndex).position().left
487 }); 487 });
488 boxArr[minBoxIndex] += box.eq(index).height(); 488 boxArr[minBoxIndex] += box.eq(index).height();
489 var newHeight = $(this).position().top + box.eq(index).height(); 489 var newHeight = $(this).position().top + box.eq(index).height();
@@ -588,7 +588,7 @@ $( @@ -588,7 +588,7 @@ $(
588 function() { 588 function() {
589 if (window.cookie('chosenStyle').indexOf($(this).text()) > -1) { 589 if (window.cookie('chosenStyle').indexOf($(this).text()) > -1) {
590 $(this).addClass('chosen'); 590 $(this).addClass('chosen');
591 - styleNow ++; 591 + styleNow++;
592 } 592 }
593 } 593 }
594 ); 594 );
@@ -971,6 +971,7 @@ $( @@ -971,6 +971,7 @@ $(
971 } 971 }
972 972
973 var styleStr = new Array(); 973 var styleStr = new Array();
  974 +
974 $('.style-ul li').on('click', function() { 975 $('.style-ul li').on('click', function() {
975 $(this).parents('.style-ul').siblings('.style-ul').find('li').removeClass('chosen'); 976 $(this).parents('.style-ul').siblings('.style-ul').find('li').removeClass('chosen');
976 var $this = $(this); 977 var $this = $(this);
@@ -1035,4 +1036,4 @@ $( @@ -1035,4 +1036,4 @@ $(
1035 } 1036 }
1036 } 1037 }
1037 } 1038 }
1038 -);  
  1039 +);
@@ -171,7 +171,7 @@ function queryString() { @@ -171,7 +171,7 @@ function queryString() {
171 /** 171 /**
172 * 对象字段排序 172 * 对象字段排序
173 */ 173 */
174 -function mapSort (obj) { 174 +function mapSort(obj) {
175 if (!obj) { 175 if (!obj) {
176 return {}; 176 return {};
177 } 177 }
@@ -65,6 +65,7 @@ info.initInfosEvt($infosContainer); @@ -65,6 +65,7 @@ info.initInfosEvt($infosContainer);
65 // 文字介绍收起与展开 65 // 文字介绍收起与展开
66 $('#more-intro-click-range').on('click', function(e) { 66 $('#more-intro-click-range').on('click', function(e) {
67 var $this = $imt.parent(); 67 var $this = $imt.parent();
  68 +
68 e.preventDefault(); // 防止收缩后误点到商品产生跳转 69 e.preventDefault(); // 防止收缩后误点到商品产生跳转
69 70
70 $this.toggleClass('spread'); 71 $this.toggleClass('spread');
@@ -117,8 +118,8 @@ if ($('#brand-like').length) { @@ -117,8 +118,8 @@ if ($('#brand-like').length) {
117 118
118 } else if (data.code === 400 || data.code === 412) { 119 } else if (data.code === 400 || data.code === 412) {
119 if (jumpToApp === '1') { 120 if (jumpToApp === '1') {
120 - var url = location.href + '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":'  
121 - + window.queryString.id + '}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"' + $('#brand-info').data('id') + '"}},"priority":"Y"}}'; 121 + var url = location.href + '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":' +
  122 + window.queryString.id + '}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"' + $('#brand-info').data('id') + '"}},"priority":"Y"}}';
122 123
123 $('body').append('<a href=' + url + ' style="display:none;"><span class="jump-login">&nbsp;</span></a>'); 124 $('body').append('<a href=' + url + ' style="display:none;"><span class="jump-login">&nbsp;</span></a>');
124 125
@@ -90,6 +90,7 @@ page = { @@ -90,6 +90,7 @@ page = {
90 $mask.hide(); 90 $mask.hide();
91 $ways.hide(); 91 $ways.hide();
92 }, 92 },
  93 +
93 // 切换$nextBtn disable状态 94 // 切换$nextBtn disable状态
94 toggleNextBtn: function() { 95 toggleNextBtn: function() {
95 var bool = Boolean($.trim($phoneNum.val())); 96 var bool = Boolean($.trim($phoneNum.val()));
@@ -150,4 +151,4 @@ page = { @@ -150,4 +151,4 @@ page = {
150 151
151 $(function() { 152 $(function() {
152 page.init(); 153 page.init();
153 -});  
  154 +});
@@ -56,28 +56,28 @@ function show(con, btn) { @@ -56,28 +56,28 @@ function show(con, btn) {
56 56
57 if (btn && $.isArray(btn) && btn.length === 1) { 57 if (btn && $.isArray(btn) && btn.length === 1) {
58 if (!btn[0].href) { 58 if (!btn[0].href) {
59 - buttons += '<a class="order-tip-btn1 ' + btn[0].class  
60 - + '"><span>' + btn[0].text  
61 - + '</span></a>'; 59 + buttons += '<a class="order-tip-btn1 ' + btn[0].class +
  60 + '"><span>' + btn[0].text +
  61 + '</span></a>';
62 } else { 62 } else {
63 - buttons += '<a href="' + btn[0].href  
64 - + '" class="order-tip-btn1 ' + btn[0].class  
65 - + '">' + btn[0].text  
66 - + '</a>'; 63 + buttons += '<a href="' + btn[0].href +
  64 + '" class="order-tip-btn1 ' + btn[0].class +
  65 + '">' + btn[0].text +
  66 + '</a>';
67 } 67 }
68 } 68 }
69 69
70 if (btn && $.isArray(btn) && btn.length > 1) { 70 if (btn && $.isArray(btn) && btn.length > 1) {
71 $.each(btn, function(key, value) { 71 $.each(btn, function(key, value) {
72 if (!value.href) { 72 if (!value.href) {
73 - buttons += '<a class="' + value.class  
74 - + '"><span>' + value.text  
75 - + '</span></a>'; 73 + buttons += '<a class="' + value.class +
  74 + '"><span>' + value.text +
  75 + '</span></a>';
76 } else { 76 } else {
77 - buttons += '<a href="' + value.href  
78 - + '" class="' + value.class  
79 - + '">' + value.text  
80 - + '</a>'; 77 + buttons += '<a href="' + value.href +
  78 + '" class="' + value.class +
  79 + '">' + value.text +
  80 + '</a>';
81 } 81 }
82 }); 82 });
83 } 83 }
@@ -83,7 +83,7 @@ function getUrlParam(name) { @@ -83,7 +83,7 @@ function getUrlParam(name) {
83 } 83 }
84 84
85 defaultOpt = $.extend({ 85 defaultOpt = $.extend({
86 - yh_channel: getUrlParam('channel') || defaultOpt.channel || 'boys', //TODO GO ON! 86 + yh_channel: getUrlParam('channel') || defaultOpt.channel || 'boys', // TODO GO ON!
87 saleType: 1 87 saleType: 1
88 }, defaultOpt); 88 }, defaultOpt);
89 89
@@ -380,4 +380,4 @@ setTimeout(() => { @@ -380,4 +380,4 @@ setTimeout(() => {
380 }); 380 });
381 381
382 // 加载详情页的返回顶部按钮并注册事件-end 382 // 加载详情页的返回顶部按钮并注册事件-end
383 -}(productSkn, productId, brandId));  
  383 +}(productSkn, productId, brandId));
@@ -46,7 +46,7 @@ require('common'); @@ -46,7 +46,7 @@ require('common');
46 46
47 // 首屏加载标志 47 // 首屏加载标志
48 var firstScreen = $('.firstscreen-goods').children().size() > 0; 48 var firstScreen = $('.firstscreen-goods').children().size() > 0;
49 -var isRecYas = window.queryString.needSuggestion === 'Y' || $('.word-content').length ? 'Y' : 'N'; // 是否是关键词 49 +var isRecYas = window.queryString.needSuggestion === 'Y' || $('.word-content').length ? 'Y' : 'N'; // 是否是关键词
50 50
51 var $listNav = $('#list-nav'), 51 var $listNav = $('#list-nav'),
52 52
@@ -87,7 +87,7 @@ $(window).on('seckill', function(event, detailData) { @@ -87,7 +87,7 @@ $(window).on('seckill', function(event, detailData) {
87 type: 'GET', 87 type: 'GET',
88 url: ajaxUrl + '?tamp=' + timestamp, 88 url: ajaxUrl + '?tamp=' + timestamp,
89 success: function(data) { 89 success: function(data) {
90 - 90 +
91 // 秒杀是否结束 91 // 秒杀是否结束
92 if (data == '' || data.status === 0 || data.status === 3) { 92 if (data == '' || data.status === 0 || data.status === 3) {
93 window.location.replace('/product/' + $('#productSkn').val() + '.html'); // 商品url改版 93 window.location.replace('/product/' + $('#productSkn').val() + '.html'); // 商品url改版
@@ -134,7 +134,7 @@ $(window).on('seckill', function(event, detailData) { @@ -134,7 +134,7 @@ $(window).on('seckill', function(event, detailData) {
134 var seckillData = data.secKillSku; 134 var seckillData = data.secKillSku;
135 135
136 detailData.cartInfo.skus.forEach( 136 detailData.cartInfo.skus.forEach(
137 - function (val) { 137 + function(val) {
138 seckillData.forEach( 138 seckillData.forEach(
139 function(item) { 139 function(item) {
140 if (val.skuId === item.productSku) { 140 if (val.skuId === item.productSku) {
@@ -219,7 +219,7 @@ $(window).on('seckill', function(event, detailData) { @@ -219,7 +219,7 @@ $(window).on('seckill', function(event, detailData) {
219 $('.current-price').show(); 219 $('.current-price').show();
220 timeInit(data); 220 timeInit(data);
221 } 221 }
222 - 222 +
223 } 223 }
224 }, 224 },
225 error: function() { 225 error: function() {
@@ -315,7 +315,7 @@ $(window).on('seckill', function(event, detailData) { @@ -315,7 +315,7 @@ $(window).on('seckill', function(event, detailData) {
315 startTime = data.startTime; 315 startTime = data.startTime;
316 endTime = data.endTime; 316 endTime = data.endTime;
317 diffTime = data.currentTime; 317 diffTime = data.currentTime;
318 - nowTime = diffTime; 318 + nowTime = diffTime;
319 if (startTime > nowTime) { 319 if (startTime > nowTime) {
320 offsetTime = startTime - nowTime; 320 offsetTime = startTime - nowTime;
321 } else if (nowTime > startTime && nowTime < endTime) { 321 } else if (nowTime > startTime && nowTime < endTime) {
@@ -59,8 +59,8 @@ module.exports = { @@ -59,8 +59,8 @@ module.exports = {
59 }, 59 },
60 stringify: function(obj) { 60 stringify: function(obj) {
61 if (!obj) { 61 if (!obj) {
62 - return '';  
63 - } 62 + return '';
  63 + }
64 return JSON.stringify(obj); 64 return JSON.stringify(obj);
65 }, 65 },
66 repeat: function(n, options) { 66 repeat: function(n, options) {