Authored by 徐炜

Merge remote-tracking branch 'origin/release/4.9.1.0' into release/4.9.1.0

... ... @@ -7,6 +7,7 @@ const queryString = require('querystring');
const Promise = require('bluebird');
const co = Promise.coroutine;
const headerModel = require('../../../doraemon/models/header'); // 头部model
const _=require('lodash');
const getResource = code => {
... ... @@ -91,6 +92,7 @@ const getPlatForm = (req) => {
let userAgent = req.get('User-Agent');
let yoho = {};
let uids = req.get('User-Agent').match(/uid=([^;]+)/i);
let versions = req.get('User-Agent').match(/app_version=([^;]+)/i);
let arrs = [];
let isNewVersion = false;
const isProduction = process.env.NODE_ENV === 'production';
... ... @@ -98,8 +100,13 @@ 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 = versions && versions.length === 2 ? versions[1] : '';
yoho.app_version = yoho.app_version || req.query.app_version || '';
console.log("yoho.app_version");
console.log(yoho.app_version);
if (yoho.app_version) {
yoho.app_version=_.toString(yoho.app_version);
arrs = yoho.app_version.split('.');
if (arrs.length > 2) {
if (arrs[0] && +arrs[0] < 4) {
... ... @@ -126,6 +133,7 @@ const getPlatForm = (req) => {
let data = yield getUser(yoho.uid);
yoho.isStudent = data.data && data.data.vip_info && data.data.vip_info.is_student ? true : false;
// yoho.isStudent = false;
return yoho;
})();
... ... @@ -233,7 +241,8 @@ exports.index = (req, res, next) => {
title: '有货学生专享优惠',
http: req.__USER__.http,
uid: req.__USER__.uid,
app_version: req.__USER__.app_version
app_version: req.__USER__.app_version,
isAppNoLogin: req.__USER__.isApp && !req.__USER__.isLogin
};
if (!req.__USER__.isApp) {
options.pageHeader = headerModel.setNav({
... ... @@ -341,7 +350,7 @@ exports.verifystudent = (req, res, next) => {
Promise.all([verifiedStudentTotal(), vip(), verifyStudent(uid, params.college_name, params.education_degree, params.enrollment_year, params.token)])
.then((datas) => {
let isverify = false,
prompt = '的学校信息未通审核';
prompt = '的学校信息未通审核';
if (datas[2].code === 200) {
if (datas[2].code === 200) {
... ...
... ... @@ -38,26 +38,42 @@
<div class="coupon-floor" coupon-id="{{couponID}}">
<div class="floor-main" style="background-image: url({{image image.src 0 0}});">
<a href='{{image.url}}' class="main-left"></a>
<a href='{{image.url}}' class="main-right-use" >
{{#isEqual status 1}}
<span class="on-receive on-lingqu no-bg">
<p>点击</p>
<p>领取</p>
</span>
{{#if @root.isAppNoLogin}}
<a href='{{../image.url}}' class="main-right-use" >
<span class="on-receive on-lingqu no-bg">
<p>点击</p>
<p>领取</p>
</span>
</a>
{{else}}
<div class="main-right-use" >
<span class="on-receive on-lingqu no-bg">
<p>点击</p>
<p>领取</p>
</span>
</div>
{{/if}}
{{/isEqual}}
{{#isEqual status 2}}
<a href='{{image.url}}' class="main-right-use" >
<span class="zero"></span>
</a>
{{/isEqual}}
{{#isEqual status 3}}
<a href='{{image.url}}' class="main-right-use" >
<span class="received"></span>
</a>
{{/isEqual}}
{{#isEqual status 4}}
<a href='{{image.url}}' class="main-right-use" >
<span class="on-receive no-bg" >
<p>已经</p>
<p>过期</p>
</span>
</a>
{{/isEqual}}
</a>
</div>
</div>
{{/each}}
... ...
... ... @@ -478,6 +478,7 @@ AsideSlider.prototype._bindAsideSlider = function($initialator, $slider) {
}
if (isShow) {
this.isFirst=true;
$('input').blur();
this.asideSlideIn($slider);
} else {
tip.show('请先选择省份');
... ...
... ... @@ -62,7 +62,7 @@ function getUrlParam(name) {
$('.on-lingqu').on('click', function() {
$('.on-lingqu', 'div.main-right-use').on('click', function() {
var $curDom = $(this),
req = '';
... ...