Authored by ccbikai

Merge branch 'master' into release/5.0.0

... ... @@ -14,7 +14,9 @@ exports.index = (req, res, next) => {
}).then((result) => {
res.render('market/market', result);
res.render('market/market', Object.assign(result, {
title: 'Yoho!Buy 有货'
}));
}).catch(next);
... ...
... ... @@ -8,14 +8,32 @@
const service = global.yoho.ServiceAPI;
const helpers = global.yoho.helpers;
const _ = require('lodash');
const index = () => {
const _indexBoys = () => {
return service.get('/operations/api/v5/resource/home', {
content_code: '797c299afc4170452cf7b2048806b6b8',
gender: 1,
limit: 1000,
page: 1
}).then(result => {
});
};
const _index = () => {
return service.get('/operations/api/v5/resource/home', {
content_code: '8512bf0755cc549ac323f852c9fd945d',
gender: 1,
limit: 1000,
page: 1
});
};
const index = () => {
return service.all([
_indexBoys(),
_index()
]).then(result => {
let resu = {
swiper: [],
... ... @@ -24,17 +42,17 @@ const index = () => {
download: []
};
if (result.data.list[0]) {
if (result[0].data.list[0] && result[0].data) {
let headerTip = result.data.list[0].data.text;
let headerTip = result[0].data.list[0].data.text;
resu = Object.assign(resu, { headerTip });
}
if (result.data.list[1]) {
if (result[1].data.list[0].data && result[1].data) {
let adList = result.data.list[1].data.list;
let adList = result[1].data.list[0].data;
let build = [];
... ... @@ -47,9 +65,13 @@ const index = () => {
resu.swiper = build;
let floorList = result.data.list[1].data.list;
}
if (result[0].data.list[1] && result[0].data) {
let floorList = result[0].data.list[1].data.list;
let floorAdListTitle = result.data.list[1].data.title.title;
let floorAdListTitle = result[0].data.list[1].data.title.title;
resu = _.assign(resu, { floorAdListTitle });
... ... @@ -72,9 +94,9 @@ const index = () => {
}
if (result.data.list[2]) {
if (result[0].data.list[2] && result[0].data) {
let newsList = result.data.list[2].data.list[0];
let newsList = result[0].data.list[2].data.list[0];
let news = [{
img: helpers.image(newsList.src, 640, 370),
... ... @@ -87,9 +109,9 @@ const index = () => {
}
if (result.data.list[3]) {
if (result[0].data.list[3] && result[0].data) {
let downlist = result.data.list[3].data[0];
let downlist = result[0].data.list[3].data[0];
let down = [{
img: helpers.image(downlist.src, 640, 275),
... ...
... ... @@ -10,10 +10,11 @@
<section class='s-text'>
<h6>权益1:新品立享9折</h6>
<p>1、学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p>
<h6>权益2:每满100返100有货币</h6>
<p>1、学生购买商品时,商品金额每满100元即可获得100有货币;</p>
<p>2、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
<p>3、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细</p>
<h6>权益2:每1元返1个有货币</h6>
<p>1、学生购买商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>
<p>2、返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>
<p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
<p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>
<h6>权益3:免单抽奖</h6>
<p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>
<p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>
... ...
<div class="container">
<div class="header">
<div class="ma-container">
<div class="ma-header">
<div>{{headerTip}}</div>
</div>
<div class="tab">
... ...
... ... @@ -87,7 +87,7 @@
<h1>学生专属活动</h1>
{{#each data.list}}
<a class='s-activity' href="{{url}}">
<img src='{{image src 750 234}}' title='{{title}}'>
<img src='{{image src 640 200}}' title='{{title}}'>
</a>
{{/each}}
</section>
... ...
... ... @@ -18,7 +18,7 @@
{{#if isWechatLogin}}
<div class="other-login">
<a href="/passport/login/index">
<a href="/passport/login">
用其他方式登录
</a>
</div>
... ...
{
"name": "m-yohobuy-node",
"version": "4.9.22",
"version": "4.9.23",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
var wxShare = require('common/share');
require('./live/live_head');
require('./live/yoho_video');
... ... @@ -13,6 +12,8 @@ $('.live-wrapper').css({
height: window.innerHeight
});
/*
var wxShare = require('common/share');
$(function() {
var $share = $('.live-btn-share');
var $appBox = $('#float-layer-app');
... ... @@ -32,4 +33,4 @@ $(function() {
$appBox.hide();
});
});
*/
... ...
... ... @@ -78,13 +78,14 @@ 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;
}
... ... @@ -231,10 +232,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)) {
... ... @@ -273,9 +274,13 @@ Filter.prototype = {
province = new Filter('[data-aslider=province]', '当前地区', 'addresseeName');
$.get('/activity/student/province', function(res) {
province.set(res.data);
province.init();
$.ajax({
url: '/activity/student/province',
cache: true,
success: function(res) {
province.set(res.data);
province.init();
}
});
$(document).on('keyup', '#s-search-provinces', function() {
... ... @@ -362,9 +367,13 @@ window.JI_getselectvalue = function(type, value) {
$('.s-blue').click(function() {
localStorage.setItem(STUDENTCOOKIES, JSON.stringify(changeSuccess().data));
});
setFormByCookes(localStorage.getItem(STUDENTCOOKIES));
$(function() {
try {
setFormByCookes(localStorage.getItem(STUDENTCOOKIES));
} catch (e) {
console.log(e);
}
});
// data-aslider-in="education|fade"
$(document).on('click', '#s-education .s-item', function() {
... ... @@ -457,8 +466,3 @@ $(document).on('click', '.s-submit', function() {
$('#tb-is-read').change(function() {
changeSuccess();
});
... ...
... ... @@ -267,7 +267,7 @@
}
.s-activity {
height: 234px;
height: 200px;
width: 100%;
margin-bottom: 30px;
display: block;
... ... @@ -364,7 +364,7 @@
.s-renzhen {
font-size: 20px;
width: 140px;
width: 120px;
height: 48px;
line-height: 48px;
color: #fff;
... ...
.container {
.ma-container {
width: 100%;
max-width: 640px;
margin: 0 auto;
... ... @@ -7,37 +7,37 @@
padding-bottom: 10px;
}
.header {
width: 100%;
height: 82px;
background: resolve("activity/market/header.jpg") no-repeat center center;
background-size: contain;
}
.header {
div {
width: 375px;
line-height: 82px;
font-size: 24px;
color: #fff;
float: right;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
.ma-container {
.ma-header {
width: 100%;
height: 82px;
background: resolve("activity/market/header.jpg") no-repeat center center;
background-size: contain;
div {
width: 375px;
line-height: 82px;
font-size: 24px;
color: #fff;
float: right;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
}
}
}
.tab {
width: 100%;
height: 310px;
}
.tab {
img {
.ma-container {
.tab {
width: 100%;
height: 100%;
height: 310px;
img {
width: 100%;
height: 100%;
}
}
}
... ... @@ -57,38 +57,61 @@
background: #fff !important;
}
.floor-top {
width: 100%;
height: 68px;
}
.floor-top {
img {
.ma-container {
.floor-top {
width: 100%;
height: 100%;
height: 68px;
img {
width: 100%;
height: 100%;
}
}
}
.floor-ul {
li {
width: 100%;
height: 170px;
position: relative;
margin-bottom: 17px;
.ma-container {
.floor-ul {
li {
width: 100%;
height: 170px;
position: relative;
margin-bottom: 17px;
p {
height: 45px;
line-height: 45px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
color: #fff;
font-size: 18px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
padding: 0 25px;
}
img {
width: 100%;
height: 100%;
}
}
}
}
.floor-ul {
li {
.ma-container {
.floor-c {
background: #fff;
padding: 25px;
position: relative;
img {
width: 100%;
height: 100%;
}
}
}
.floor-ul {
li {
p {
height: 45px;
line-height: 45px;
... ... @@ -102,55 +125,24 @@
white-space: nowrap;
text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
padding: 0 25px;
margin: 0 40px 25px;
}
}
}
.floor-c {
background: #fff;
padding: 25px;
position: relative;
}
.floor-c {
img {
.ma-container {
.down {
width: 100%;
height: 100%;
}
}
.floor-c {
p {
height: 45px;
line-height: 45px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
color: #fff;
font-size: 18px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
margin: 0 40px 25px;
}
}
.down {
width: 100%;
height: 265px;
position: relative;
display: block;
}
height: 265px;
position: relative;
display: block;
.down {
img {
width: 100%;
position: absolute;
top: -10px;
left: 0;
right: 0;
img {
width: 100%;
position: absolute;
top: -10px;
left: 0;
right: 0;
}
}
}
... ...