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) => {
yoho.isiOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(userAgent);
yoho.isAndroid = /Android/i.test(userAgent);
yoho.isApp = /YohoBuy/i.test(req.get('User-Agent')) || (req.query.app_version && req.query.client_type);
yoho.app_version = req.query.app_version||'';
yoho.app_version = req.query.app_version || '';
req.query.app_version="4.9.0";
if (req.query.app_version) {
arrs = req.query.app_version.split('.');
if(arrs.length>2){
if(arrs[0]&&+arrs[0]<4){
isNewVersion=false;
}else if(arrs[1]&&+arrs[1]<9){
isNewVersion=false;
}else if(arrs[2]&&+arrs[2]<0){
isNewVersion=false;
}else{
isNewVersion=true;
if (arrs.length > 2) {
if (arrs[0] && +arrs[0] < 4) {
isNewVersion = false;
} else if (arrs[1] && +arrs[1] < 9) {
isNewVersion = false;
} else if (arrs[2] && +arrs[2] <= 0) {
isNewVersion = false;
} else {
isNewVersion = true;
}
}
}
yoho.isSupportStudent = !yoho.isApp || isNewVersion;
yoho.http = 'http:';
if (isProduction) {
... ... @@ -134,25 +134,6 @@ const getPlatForm = (req) => {
};
// const getRequest = (url)=>{
//
// let regurl = /^[^\?]+\?([\w\W]+)$/;
// let regpara = /([^&=]+)=([\w\W]*?)(&|$|#)/g;
// let ret = {};
// let strpara,
// result;
//
// let arrurl = regurl.exec(url);
//
// if (arrurl && arrurl[1]) {
// strpara = arrurl[1];
// while ((result = regpara.exec(strpara)) !== null) {
// ret[result[1]] = result[2];
// }
// }
// return ret;
// };
exports.index = (req, res, next) => {
let code = 'a83b7d55324fb65f96c1f85a3387ebd8';
... ... @@ -195,7 +176,7 @@ exports.index = (req, res, next) => {
}
});
if (coupons && coupons.data) {
coupons.link = link && link.data ? link.data[0].url + (req.__USER__.isApp ? '&app_version='+req.__USER__.app_version : '') : '';
coupons.link = link && link.data ? link.data[0].url + (req.__USER__.isApp ? '&app_version=' + req.__USER__.app_version : '') : '';
coupons.data = (coupons.data || []).map((item) => {
couponids.push(item.couponID);
... ... @@ -364,17 +345,17 @@ exports.verifystudent = (req, res, next) => {
prompt = '你的学校信息未通审核';
if (datas[2].code === 200) {
if(datas[2].code===200){
if (datas[2].code === 200) {
if (datas[2].data.isStudent === 1) {
isverify = true;
prompt = datas[2].data.prompt;
}
}else {
} else {
prompt = datas[2].message;
}
} else {
prompt = "认证失败";
prompt = '认证失败';
}
datas[1].data.product_list = datas[1].data.product_list.map(function(value) {
value.goodsId = value.goods_list[0].goods_id;
... ...