Authored by ccbikai

Merge branch 'master' into release/4.9.2

... ... @@ -8,9 +8,9 @@
const config = require('./config/common');
// use one apm
// if (config.useOneapm) {
// require('oneapm');
// }
if (config.useOneapm) {
require('oneapm');
}
const express = require('express');
const path = require('path');
... ...
... ... @@ -61,8 +61,7 @@ exports.getCoupon = (req, res, next) => {
// 获取信息成功
couponData.ordercode = ordercode;
}
// console.log(couponData);
console.log(couponData);
res.json({
result: couponData
});
... ... @@ -95,8 +94,7 @@ exports.verify = (req, res, next) => {
// 获取信息成功
couponData.ordercode = ordercode;
}
// console.log(couponData);
console.log(couponData);
res.json({
result: couponData
});
... ...
... ... @@ -10,11 +10,10 @@
<section class='s-text'>
<h6>权益1:新品立享9折</h6>
<p>1、学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p>
<h6>权益2:每1元返1个有货币</h6>
<p>1、学生购买商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>
<p>2、返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>
<p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
<p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>
<h6>权益2:每满100返100有货币</h6>
<p>1、学生购买商品时,商品金额每满100元即可获得100有货币;</p>
<p>2、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
<p>3、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细</p>
<h6>权益3:免单抽奖</h6>
<p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>
<p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>
... ...
... ... @@ -110,7 +110,7 @@ const _processIndexData = (dataList) => {
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
formatData.starAvatar.push({
noLazy: index < 6,
//noLazy: index < 6,
url: url,
cover: data.cover ? (data.cover + '?imageView2/2/w/180/h/180') : data.cover
});
... ...
... ... @@ -206,7 +206,7 @@ const wechat = {
doPassportCallback(openId, nickname, 'wechat', req, res).catch(next);
})(req, res, next);
} else {
return next('Auth State Mismatch');
return next(new Error('Auth State Mismatch'));
}
}
};
... ...
... ... @@ -14,12 +14,8 @@ module.exports = {
port: 6001,
siteUrl: '//m.yohobuy.com',
domains: {
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/'
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/'
},
subDomains: {
... ...
... ... @@ -21,16 +21,10 @@ module.exports = () => {
// 判断请求是否来自app
yoho.isApp = req.query.app_version || req.query.appVersion;
yoho.isWechat = /micromessenger/i.test(req.get('User-Agent') || '');
Object.assign(res.locals, yoho);
Object.assign(req.yoho, yoho);
// App 内请求支持跨域
if (yoho.isApp) {
res.set('Access-Control-Allow-Origin', '*');
}
next();
};
};
... ...
... ... @@ -32,7 +32,7 @@
<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)">
<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)">
</head>
<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}}">
<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}}">
<div class="main-wrap">
{{#if systemUpdate}}
{{> updata}}
... ...
{{#unless isApp}}
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
... ... @@ -12,4 +11,3 @@ function async_load(){
}
window.addEventListener('load', async_load, false);
</script>
{{/unless}}
... ...
... ... @@ -78,14 +78,13 @@ function isValidate(rules, datas) {
message = rule.name + '不可为空';
break;
}
// if (rule.regex) {
// reg = $.trim(data).match(rule.regex);
// if (!reg || (reg && !reg.length)) {
// message = rule.msg;
// break;
// }
// }
if (rule.regex) {
reg = $.trim(data).match(rule.regex);
if (!reg || (reg && !reg.length)) {
message = rule.msg;
break;
}
}
if (rule.is !== void (0) && data !== rule.is) {
message = rule.msg;
}
... ... @@ -232,10 +231,10 @@ Filter.prototype = {
var html = [],
name;
// if (this.__select__ && this.__title__ && this.__select__[this.__feild__]) {
// html.push('<h6 class=\'s-title\'>当前地区</h6>');
// html.push('<div class=\'s-item close\'>' + this.__select__[this.__feild__] + '</div>');
// }
if (this.__select__ && this.__title__ && this.__select__[this.__feild__]) {
html.push('<h6 class=\'s-title\'>当前地区</h6>');
html.push('<div class=\'s-item close\'>' + this.__select__[this.__feild__] + '</div>');
}
for (name in data) {
if (data.hasOwnProperty(name)) {
... ... @@ -274,13 +273,9 @@ Filter.prototype = {
province = new Filter('[data-aslider=province]', '当前地区', 'addresseeName');
$.ajax({
url: '/activity/student/province',
cache: true,
success: function(res) {
$.get('/activity/student/province', function(res) {
province.set(res.data);
province.init();
}
});
$(document).on('keyup', '#s-search-provinces', function() {
... ... @@ -367,13 +362,9 @@ window.JI_getselectvalue = function(type, value) {
$('.s-blue').click(function() {
localStorage.setItem(STUDENTCOOKIES, JSON.stringify(changeSuccess().data));
});
$(function() {
try {
setFormByCookes(localStorage.getItem(STUDENTCOOKIES));
} catch (e) {
console.log(e);
}
});
setFormByCookes(localStorage.getItem(STUDENTCOOKIES));
// data-aslider-in="education|fade"
$(document).on('click', '#s-education .s-item', function() {
... ... @@ -456,3 +447,8 @@ $(document).on('click', '.s-submit', function() {
$('#tb-is-read').change(function() {
changeSuccess();
});
... ...
... ... @@ -188,8 +188,6 @@ function initAction() {
$avatarWrap = $('.avatar-wrap');
bannerLen = $('.avatar-wrap').find('.swiper-slide').length;
setIndexAction();
// if ($avatarClone) {
// $avatarClone.remove();
// }
... ... @@ -202,6 +200,7 @@ function initAction() {
effect: 'fadeIn'
});
setIndexAction();
}
initAction();
... ... @@ -258,7 +257,8 @@ starIScroll.iScroll.on('scrollStart', function() {
bannerSwiper && bannerSwiper.stopAutoplay();
});
// starIScroll.iScroll.on('scroll', function() {
starIScroll.iScroll.on('scroll', function() {
$window.trigger('scroll');
// var avatarOffsetT;
//
// if (this.directionY !== -1) {
... ... @@ -300,7 +300,7 @@ starIScroll.iScroll.on('scrollStart', function() {
// } else {
// $avatarClone.hide();
// }
// });
});
starIScroll.iScroll.on('scrollEnd', function() {
// $loadingTip.slideUp();
... ...
... ... @@ -2,4 +2,4 @@
@import "star";
@import "special";
@import "collocation";
/* @import "imageflow"; */
... ...
... ... @@ -435,7 +435,6 @@
display: block;
width: 100%;
height: 100%;
background: resolve("guang/star/lazy-img.jpg");
background-color: #000;
background-repeat: no-repeat;
background-size: contain;
... ...