Authored by ccbikai

Merge branch 'master' into release/4.9.2

@@ -8,9 +8,9 @@ @@ -8,9 +8,9 @@
8 const config = require('./config/common'); 8 const config = require('./config/common');
9 9
10 // use one apm 10 // use one apm
11 -// if (config.useOneapm) {  
12 -// require('oneapm');  
13 -// } 11 +if (config.useOneapm) {
  12 + require('oneapm');
  13 +}
14 14
15 const express = require('express'); 15 const express = require('express');
16 const path = require('path'); 16 const path = require('path');
@@ -61,8 +61,7 @@ exports.getCoupon = (req, res, next) => { @@ -61,8 +61,7 @@ exports.getCoupon = (req, res, next) => {
61 // 获取信息成功 61 // 获取信息成功
62 couponData.ordercode = ordercode; 62 couponData.ordercode = ordercode;
63 } 63 }
64 -  
65 - // console.log(couponData); 64 + console.log(couponData);
66 res.json({ 65 res.json({
67 result: couponData 66 result: couponData
68 }); 67 });
@@ -95,8 +94,7 @@ exports.verify = (req, res, next) => { @@ -95,8 +94,7 @@ exports.verify = (req, res, next) => {
95 // 获取信息成功 94 // 获取信息成功
96 couponData.ordercode = ordercode; 95 couponData.ordercode = ordercode;
97 } 96 }
98 -  
99 - // console.log(couponData); 97 + console.log(couponData);
100 res.json({ 98 res.json({
101 result: couponData 99 result: couponData
102 }); 100 });
@@ -10,11 +10,10 @@ @@ -10,11 +10,10 @@
10 <section class='s-text'> 10 <section class='s-text'>
11 <h6>权益1:新品立享9折</h6> 11 <h6>权益1:新品立享9折</h6>
12 <p>1、学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p> 12 <p>1、学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p>
13 - <h6>权益2:每1元返1个有货币</h6>  
14 - <p>1、学生购买商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>  
15 - <p>2、返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>  
16 - <p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>  
17 - <p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p> 13 + <h6>权益2:每满100返100有货币</h6>
  14 + <p>1、学生购买商品时,商品金额每满100元即可获得100有货币;</p>
  15 + <p>2、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
  16 + <p>3、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细</p>
18 <h6>权益3:免单抽奖</h6> 17 <h6>权益3:免单抽奖</h6>
19 <p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p> 18 <p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>
20 <p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p> 19 <p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>
@@ -110,7 +110,7 @@ const _processIndexData = (dataList) => { @@ -110,7 +110,7 @@ const _processIndexData = (dataList) => {
110 let url = `/guang/star/detail?tag=${data.tagName}&openby:yohobuy{"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http://m.yohobuy.com/guang/star/detail","param":{"tag":"${data.tagName}"}}}`; // eslint-disable-line 110 let url = `/guang/star/detail?tag=${data.tagName}&openby:yohobuy{"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http://m.yohobuy.com/guang/star/detail","param":{"tag":"${data.tagName}"}}}`; // eslint-disable-line
111 111
112 formatData.starAvatar.push({ 112 formatData.starAvatar.push({
113 - noLazy: index < 6, 113 + //noLazy: index < 6,
114 url: url, 114 url: url,
115 cover: data.cover ? (data.cover + '?imageView2/2/w/180/h/180') : data.cover 115 cover: data.cover ? (data.cover + '?imageView2/2/w/180/h/180') : data.cover
116 }); 116 });
@@ -206,7 +206,7 @@ const wechat = { @@ -206,7 +206,7 @@ const wechat = {
206 doPassportCallback(openId, nickname, 'wechat', req, res).catch(next); 206 doPassportCallback(openId, nickname, 'wechat', req, res).catch(next);
207 })(req, res, next); 207 })(req, res, next);
208 } else { 208 } else {
209 - return next('Auth State Mismatch'); 209 + return next(new Error('Auth State Mismatch'));
210 } 210 }
211 } 211 }
212 }; 212 };
@@ -14,12 +14,8 @@ module.exports = { @@ -14,12 +14,8 @@ module.exports = {
14 port: 6001, 14 port: 6001,
15 siteUrl: '//m.yohobuy.com', 15 siteUrl: '//m.yohobuy.com',
16 domains: { 16 domains: {
17 - // api: 'http://api-test3.yohops.com:9999/',  
18 - // service: 'http://service-test3.yohops.com:9999/',  
19 - // liveApi: 'http://testapi.live.yohops.com:9999/'  
20 -  
21 - api: 'http://api.yoho.cn/',  
22 - service: 'http://service.yoho.cn/', 17 + api: 'http://api-test3.yohops.com:9999/',
  18 + service: 'http://service-test3.yohops.com:9999/',
23 liveApi: 'http://testapi.live.yohops.com:9999/' 19 liveApi: 'http://testapi.live.yohops.com:9999/'
24 }, 20 },
25 subDomains: { 21 subDomains: {
@@ -21,16 +21,10 @@ module.exports = () => { @@ -21,16 +21,10 @@ module.exports = () => {
21 21
22 // 判断请求是否来自app 22 // 判断请求是否来自app
23 yoho.isApp = req.query.app_version || req.query.appVersion; 23 yoho.isApp = req.query.app_version || req.query.appVersion;
24 - yoho.isWechat = /micromessenger/i.test(req.get('User-Agent') || '');  
25 24
26 Object.assign(res.locals, yoho); 25 Object.assign(res.locals, yoho);
27 Object.assign(req.yoho, yoho); 26 Object.assign(req.yoho, yoho);
28 27
29 - // App 内请求支持跨域  
30 - if (yoho.isApp) {  
31 - res.set('Access-Control-Allow-Origin', '*');  
32 - }  
33 -  
34 next(); 28 next();
35 }; 29 };
36 }; 30 };
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 <link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)"> 32 <link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
33 <link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)"> 33 <link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
34 </head> 34 </head>
35 - <body class="{{#if width750}}width750{{/if}} {{#if isWechat}}wechat-body{{/if}} {{#if isPassportPage}}passport-body{{/if}} {{#if isStarIndexPage}}star-index-bg{{/if}} {{#if isStarDetailPage}}star-class-body{{/if}} {{#if isInstallmentPage}}installment-body{{/if}}"> 35 + <body class="{{#if width750}}width750{{/if}} {{#if isPassportPage}}passport-body{{/if}} {{#if isStarIndexPage}}star-index-bg{{/if}} {{#if isStarDetailPage}}star-class-body{{/if}} {{#if isInstallmentPage}}installment-body{{/if}}">
36 <div class="main-wrap"> 36 <div class="main-wrap">
37 {{#if systemUpdate}} 37 {{#if systemUpdate}}
38 {{> updata}} 38 {{> updata}}
1 -{{#unless isApp}}  
2 <!-- Google Tag Manager --> 1 <!-- Google Tag Manager -->
3 <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 2 <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
4 <script> 3 <script>
@@ -12,4 +11,3 @@ function async_load(){ @@ -12,4 +11,3 @@ function async_load(){
12 } 11 }
13 window.addEventListener('load', async_load, false); 12 window.addEventListener('load', async_load, false);
14 </script> 13 </script>
15 -{{/unless}}  
@@ -78,14 +78,13 @@ function isValidate(rules, datas) { @@ -78,14 +78,13 @@ function isValidate(rules, datas) {
78 message = rule.name + '不可为空'; 78 message = rule.name + '不可为空';
79 break; 79 break;
80 } 80 }
81 -  
82 - // if (rule.regex) {  
83 - // reg = $.trim(data).match(rule.regex);  
84 - // if (!reg || (reg && !reg.length)) {  
85 - // message = rule.msg;  
86 - // break;  
87 - // }  
88 - // } 81 + if (rule.regex) {
  82 + reg = $.trim(data).match(rule.regex);
  83 + if (!reg || (reg && !reg.length)) {
  84 + message = rule.msg;
  85 + break;
  86 + }
  87 + }
89 if (rule.is !== void (0) && data !== rule.is) { 88 if (rule.is !== void (0) && data !== rule.is) {
90 message = rule.msg; 89 message = rule.msg;
91 } 90 }
@@ -232,10 +231,10 @@ Filter.prototype = { @@ -232,10 +231,10 @@ Filter.prototype = {
232 var html = [], 231 var html = [],
233 name; 232 name;
234 233
235 - // if (this.__select__ && this.__title__ && this.__select__[this.__feild__]) {  
236 - // html.push('<h6 class=\'s-title\'>当前地区</h6>');  
237 - // html.push('<div class=\'s-item close\'>' + this.__select__[this.__feild__] + '</div>');  
238 - // } 234 + if (this.__select__ && this.__title__ && this.__select__[this.__feild__]) {
  235 + html.push('<h6 class=\'s-title\'>当前地区</h6>');
  236 + html.push('<div class=\'s-item close\'>' + this.__select__[this.__feild__] + '</div>');
  237 + }
239 238
240 for (name in data) { 239 for (name in data) {
241 if (data.hasOwnProperty(name)) { 240 if (data.hasOwnProperty(name)) {
@@ -274,13 +273,9 @@ Filter.prototype = { @@ -274,13 +273,9 @@ Filter.prototype = {
274 273
275 province = new Filter('[data-aslider=province]', '当前地区', 'addresseeName'); 274 province = new Filter('[data-aslider=province]', '当前地区', 'addresseeName');
276 275
277 -$.ajax({  
278 - url: '/activity/student/province',  
279 - cache: true,  
280 - success: function(res) {  
281 - province.set(res.data);  
282 - province.init();  
283 - } 276 +$.get('/activity/student/province', function(res) {
  277 + province.set(res.data);
  278 + province.init();
284 }); 279 });
285 280
286 $(document).on('keyup', '#s-search-provinces', function() { 281 $(document).on('keyup', '#s-search-provinces', function() {
@@ -367,13 +362,9 @@ window.JI_getselectvalue = function(type, value) { @@ -367,13 +362,9 @@ window.JI_getselectvalue = function(type, value) {
367 $('.s-blue').click(function() { 362 $('.s-blue').click(function() {
368 localStorage.setItem(STUDENTCOOKIES, JSON.stringify(changeSuccess().data)); 363 localStorage.setItem(STUDENTCOOKIES, JSON.stringify(changeSuccess().data));
369 }); 364 });
370 -$(function() {  
371 - try {  
372 - setFormByCookes(localStorage.getItem(STUDENTCOOKIES));  
373 - } catch (e) {  
374 - console.log(e);  
375 - }  
376 -}); 365 +setFormByCookes(localStorage.getItem(STUDENTCOOKIES));
  366 +
  367 +
377 368
378 // data-aslider-in="education|fade" 369 // data-aslider-in="education|fade"
379 $(document).on('click', '#s-education .s-item', function() { 370 $(document).on('click', '#s-education .s-item', function() {
@@ -456,3 +447,8 @@ $(document).on('click', '.s-submit', function() { @@ -456,3 +447,8 @@ $(document).on('click', '.s-submit', function() {
456 $('#tb-is-read').change(function() { 447 $('#tb-is-read').change(function() {
457 changeSuccess(); 448 changeSuccess();
458 }); 449 });
  450 +
  451 +
  452 +
  453 +
  454 +
@@ -188,8 +188,6 @@ function initAction() { @@ -188,8 +188,6 @@ function initAction() {
188 $avatarWrap = $('.avatar-wrap'); 188 $avatarWrap = $('.avatar-wrap');
189 bannerLen = $('.avatar-wrap').find('.swiper-slide').length; 189 bannerLen = $('.avatar-wrap').find('.swiper-slide').length;
190 190
191 - setIndexAction();  
192 -  
193 // if ($avatarClone) { 191 // if ($avatarClone) {
194 // $avatarClone.remove(); 192 // $avatarClone.remove();
195 // } 193 // }
@@ -202,6 +200,7 @@ function initAction() { @@ -202,6 +200,7 @@ function initAction() {
202 effect: 'fadeIn' 200 effect: 'fadeIn'
203 }); 201 });
204 202
  203 + setIndexAction();
205 } 204 }
206 205
207 initAction(); 206 initAction();
@@ -258,7 +257,8 @@ starIScroll.iScroll.on('scrollStart', function() { @@ -258,7 +257,8 @@ starIScroll.iScroll.on('scrollStart', function() {
258 bannerSwiper && bannerSwiper.stopAutoplay(); 257 bannerSwiper && bannerSwiper.stopAutoplay();
259 }); 258 });
260 259
261 -// starIScroll.iScroll.on('scroll', function() { 260 + starIScroll.iScroll.on('scroll', function() {
  261 + $window.trigger('scroll');
262 // var avatarOffsetT; 262 // var avatarOffsetT;
263 // 263 //
264 // if (this.directionY !== -1) { 264 // if (this.directionY !== -1) {
@@ -300,7 +300,7 @@ starIScroll.iScroll.on('scrollStart', function() { @@ -300,7 +300,7 @@ starIScroll.iScroll.on('scrollStart', function() {
300 // } else { 300 // } else {
301 // $avatarClone.hide(); 301 // $avatarClone.hide();
302 // } 302 // }
303 -// }); 303 + });
304 304
305 starIScroll.iScroll.on('scrollEnd', function() { 305 starIScroll.iScroll.on('scrollEnd', function() {
306 // $loadingTip.slideUp(); 306 // $loadingTip.slideUp();
@@ -2,4 +2,4 @@ @@ -2,4 +2,4 @@
2 @import "star"; 2 @import "star";
3 @import "special"; 3 @import "special";
4 @import "collocation"; 4 @import "collocation";
5 -/* @import "imageflow"; */ 5 +
@@ -435,7 +435,6 @@ @@ -435,7 +435,6 @@
435 display: block; 435 display: block;
436 width: 100%; 436 width: 100%;
437 height: 100%; 437 height: 100%;
438 - background: resolve("guang/star/lazy-img.jpg");  
439 background-color: #000; 438 background-color: #000;
440 background-repeat: no-repeat; 439 background-repeat: no-repeat;
441 background-size: contain; 440 background-size: contain;