Authored by weiqingting

Merge branch 'feature_student' into release/4.9.1.0

# Conflicts:
#	apps/product/models/detail.js
#	config/common.js
#	public/scss/common/_good.css
@@ -98,23 +98,23 @@ const getPlatForm = (req) => { @@ -98,23 +98,23 @@ const getPlatForm = (req) => {
98 yoho.isiOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(userAgent); 98 yoho.isiOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(userAgent);
99 yoho.isAndroid = /Android/i.test(userAgent); 99 yoho.isAndroid = /Android/i.test(userAgent);
100 yoho.isApp = /YohoBuy/i.test(req.get('User-Agent')) || (req.query.app_version && req.query.client_type); 100 yoho.isApp = /YohoBuy/i.test(req.get('User-Agent')) || (req.query.app_version && req.query.client_type);
101 - yoho.app_version = req.query.app_version||''; 101 + yoho.app_version = req.query.app_version || '';
  102 + req.query.app_version="4.9.0";
102 if (req.query.app_version) { 103 if (req.query.app_version) {
103 arrs = req.query.app_version.split('.'); 104 arrs = req.query.app_version.split('.');
104 - if(arrs.length>2){  
105 - if(arrs[0]&&+arrs[0]<4){  
106 - isNewVersion=false;  
107 - }else if(arrs[1]&&+arrs[1]<9){  
108 - isNewVersion=false;  
109 - }else if(arrs[2]&&+arrs[2]<0){  
110 - isNewVersion=false;  
111 - }else{  
112 - isNewVersion=true; 105 + if (arrs.length > 2) {
  106 + if (arrs[0] && +arrs[0] < 4) {
  107 + isNewVersion = false;
  108 + } else if (arrs[1] && +arrs[1] < 9) {
  109 + isNewVersion = false;
  110 + } else if (arrs[2] && +arrs[2] <= 0) {
  111 + isNewVersion = false;
  112 + } else {
  113 + isNewVersion = true;
113 } 114 }
114 } 115 }
115 } 116 }
116 117
117 -  
118 yoho.isSupportStudent = !yoho.isApp || isNewVersion; 118 yoho.isSupportStudent = !yoho.isApp || isNewVersion;
119 yoho.http = 'http:'; 119 yoho.http = 'http:';
120 if (isProduction) { 120 if (isProduction) {
@@ -134,25 +134,6 @@ const getPlatForm = (req) => { @@ -134,25 +134,6 @@ const getPlatForm = (req) => {
134 134
135 }; 135 };
136 136
137 -// const getRequest = (url)=>{  
138 -//  
139 -// let regurl = /^[^\?]+\?([\w\W]+)$/;  
140 -// let regpara = /([^&=]+)=([\w\W]*?)(&|$|#)/g;  
141 -// let ret = {};  
142 -// let strpara,  
143 -// result;  
144 -//  
145 -// let arrurl = regurl.exec(url);  
146 -//  
147 -// if (arrurl && arrurl[1]) {  
148 -// strpara = arrurl[1];  
149 -// while ((result = regpara.exec(strpara)) !== null) {  
150 -// ret[result[1]] = result[2];  
151 -// }  
152 -// }  
153 -// return ret;  
154 -// };  
155 -  
156 137
157 exports.index = (req, res, next) => { 138 exports.index = (req, res, next) => {
158 let code = 'a83b7d55324fb65f96c1f85a3387ebd8'; 139 let code = 'a83b7d55324fb65f96c1f85a3387ebd8';
@@ -195,7 +176,7 @@ exports.index = (req, res, next) => { @@ -195,7 +176,7 @@ exports.index = (req, res, next) => {
195 } 176 }
196 }); 177 });
197 if (coupons && coupons.data) { 178 if (coupons && coupons.data) {
198 - coupons.link = link && link.data ? link.data[0].url + (req.__USER__.isApp ? '&app_version='+req.__USER__.app_version : '') : ''; 179 + coupons.link = link && link.data ? link.data[0].url + (req.__USER__.isApp ? '&app_version=' + req.__USER__.app_version : '') : '';
199 coupons.data = (coupons.data || []).map((item) => { 180 coupons.data = (coupons.data || []).map((item) => {
200 couponids.push(item.couponID); 181 couponids.push(item.couponID);
201 182
@@ -364,17 +345,17 @@ exports.verifystudent = (req, res, next) => { @@ -364,17 +345,17 @@ exports.verifystudent = (req, res, next) => {
364 prompt = '你的学校信息未通审核'; 345 prompt = '你的学校信息未通审核';
365 346
366 if (datas[2].code === 200) { 347 if (datas[2].code === 200) {
367 - if(datas[2].code===200){ 348 + if (datas[2].code === 200) {
368 if (datas[2].data.isStudent === 1) { 349 if (datas[2].data.isStudent === 1) {
369 isverify = true; 350 isverify = true;
370 prompt = datas[2].data.prompt; 351 prompt = datas[2].data.prompt;
371 } 352 }
372 - }else { 353 + } else {
373 prompt = datas[2].message; 354 prompt = datas[2].message;
374 } 355 }
375 356
376 } else { 357 } else {
377 - prompt = "认证失败"; 358 + prompt = '认证失败';
378 } 359 }
379 datas[1].data.product_list = datas[1].data.product_list.map(function(value) { 360 datas[1].data.product_list = datas[1].data.product_list.map(function(value) {
380 value.goodsId = value.goods_list[0].goods_id; 361 value.goodsId = value.goods_list[0].goods_id;