Authored by zzzzzzz

合并学生营销

... ... @@ -237,7 +237,7 @@ exports.index = (req, res, next) => {
isStudent: req.__USER__.isStudent,
isSupportStudent: req.__USER__.isSupportStudent,
isLogin: req.__USER__.isLogin,
title: '有货学生专享优惠',
title: '有货学生专享权益',
http: req.__USER__.http,
uid: req.__USER__.uid,
app_version: req.__USER__.app_version,
... ...
... ... @@ -9,7 +9,7 @@
<div class="mobile-wrap yoho-page student">
<section class='s-text'>
<h6>权益1:新品立享9折</h6>
<p>1、学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p>
<p>1、学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p>
<h6>权益2:每1元返1个有货币</h6>
<p>1、学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>
<p>2、返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>
... ...
... ... @@ -39,8 +39,7 @@
</label>
同意<a class="s-blue" href='//m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"{{http}}//m.yohobuy.com/activity/student/detail/renzhen"}}'>Yoho!Buy有货学生认证协议</a>
</section>
<a class="s-submit" href="javascript:void(0);">去支付宝完成认证</a>
<p class="s-sub-tip">与蚂蚁金服旗下的芝麻信用(支付宝)合作认证</p>
<a class="s-submit" href="javascript:void(0);">立即认证</a>
</div>
</div>
... ...
... ... @@ -11,7 +11,7 @@
<h1>学生权益<a class='more s-quan' href='//m.yohobuy.com/activity/student/detail/quanyi?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"{{../http}}//m.yohobuy.com/activity/student/detail/quanyi"}}'>更多权益</a></h1>
<div class='s-content'>
{{#each data.list}}
<div class='s-section'>
<div class='s-section s-dialog'>
<a href="javascript:void(0)">
<img src='{{image src 320 149}}' title="{{title}}">
</a>
... ...
... ... @@ -19,6 +19,9 @@
<p class='s-verify-txt'>您可以<a class='red' href='//m.yohobuy.com/activity/student/register'>重新验证 ></a></p>
</section>
{{/if}}
{{#if next111}}
<a class='s-yohocoin' href='//m.yohobuy.com/home/mycurrency'>查看有货币明细</a>
{{/if}}
<section class='s-section clearfix'>
<h1>学生专享商品<a class="more iconfont" href="//search.m.yohobuy.com/?students=1&title=学生专享商品&uid={{uid}}{{#isApp}}&app_version={{@root.app_version}}{{/isApp}}?openby:yohobuy={'action':'go.h5','params':{'islogin':'N','url':'{{@root.http}}//search.m.yohobuy.com/','param':{'students':'1','title':'学生专享商品','uid':'{{uid}}'}}}">&#xe618;</a></h1>
<div class='goods-list clearfix'>
... ...
... ... @@ -171,6 +171,7 @@ const search = (req, res, next) => {
let params = Object.assign({}, req.query);
params.isApp = req.yoho.isApp;
searchModel.getSearchData(params).then((result) => {
res.render('search/page', {
layout: false,
... ...
... ... @@ -121,6 +121,17 @@ const _searchGoods = (params) => {
params.order = 's_t_asc';
}
// 学生返币查询
if (params.coin) {
method = 'app.student.rebate';
delete params.filter_poolId;
if (params.type === 'newest') {
delete params.order;
delete params.type;
}
}
return api.get('', _.assign({
method: method
}, params), {
... ... @@ -135,7 +146,7 @@ const getSearchData = (params) => {
return _searchGoods(params).then((result) => {
if (result && result.code === 200) {
return productProcess.processProductList(result.data.product_list || [], {
isApp: params.appVersion && params.appVersion !== 'false',
isApp: params.isApp || (params.appVersion && params.appVersion !== 'false'),
gender: _coverChannel[params.coverChannel]
});
} else {
... ...
{{#if list}} {{!-- 剔除值为false的项 --}}
{{!-- {{log this}} --}}
{{#list}}
<div class="good-info {{#if @root.saleViplogin}}sale-vip{{/if}}" data-id="{{productSkn}}" data-bp-id="guang_goodList_{{productName}}_false">
<div class="tag-container clearfix">
{{#each tags}}
{{#if isNew}}
<p class="good-tag new-tag">NEW</p>
{{/if}}
{{#if isAdvance}}
<p class="good-tag renew-tag">再到着</p>
{{/if}}
{{#if isDiscount}}
<p class="good-tag sale-tag">SALE</p>
{{/if}}
{{#if isYohoood}}
<p class="good-tag running-man-tag">跑男同款</p>
{{/if}}
{{#if isLimited}}
<p class="good-tag limit-tag">限量商品</p>
{{/if}}
{{/each}}
</div>
<div class="good-detail-img">
<a class="good-thumb" href="{{url}}">
<img class="lazy" data-original="{{image defaultImages 235 314}}">
</a>
{{!-- {{log isSoonSoldOut}} --}}
{{#if isSoonSoldOut}}
<p class="few-tag">即将售罄</p>
{{/if}}
{{#if noStorage}}
<div class="no-storage">
<div class="no-storage-img"></div>
</div>
{{/if}}
</div>
<div class="good-detail-text">
<div class="name">
<a href="{{url}}">{{productName}}</a>
</div>
<div class="price">
{{#if @root.saleViplogin}}
<i class="vip-grade vip-grade-{{@root.vipLevel}}"></i>
<span class="sale-price {{^marketPrice}}no-price{{/marketPrice}}">¥
{{#if @root.vipPrice1}}{{round vip1Price}}{{/if}}
{{#if @root.vipPrice2}}{{round vip2Price}}{{/if}}
{{#if @root.vipPrice3}}{{round vip3Price}}{{/if}}
</span>
{{else}}
<span class="sale-price {{^marketPrice}}no-price{{/marketPrice}}">¥{{round salesPrice}}</span>
{{/if}}
{{#marketPrice}}
<span class="market-price">¥{{round .}}</span>
{{/marketPrice}}
</div>
{{#if @root.saleVip}}
<div class="vip-info">
<i class="vip-icon"></i>更优惠
</div>
{{/if}}
</div>
</div>
{{/list}}
{{/if}}
... ...
... ... @@ -20,12 +20,11 @@ module.exports = {
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/'
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -61,6 +61,7 @@
{{/unless}}
{{{body}}}
{{#unless isApp}}
{{> footer}}
{{/unless}}
... ...
... ... @@ -2,7 +2,9 @@ var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
lazyLoad = require('yoho-jquery-lazyload'),
fastclick = require('yoho-fastclick'),
tip = require('../plugin/tip');
tip = require('../plugin/tip'),
dialog = require('../plugin/dialog'),
Hammer = require('yoho-hammer');
var _weChatInterface = '//m.yohobuy.com/life/getSignPackage',
wx = window.wx,
... ... @@ -13,6 +15,21 @@ var _weChatInterface = '//m.yohobuy.com/life/getSignPackage',
require('../common');
// 根据ua判断页头
(function uaHeader() {
var UALIST = ['MicroMessenger', 'QQ/', 'Weibo'],
UA = navigator.userAgent,
i;
for (i = 0; i < UALIST.length; i++) {
if (UA.indexOf(UALIST[i]) > -1) {
$('#yoho-header').remove();
return;
}
}
}());
getChannel = function() {
var name = window.cookie('_Channel');
... ... @@ -393,3 +410,74 @@ $('.s-renzhen').click(function() {
window._yas.sendCustomInfo(options, true);
}
});
$('.dialog-wrapper').addClass('s-dialog-wrapper');
$('.s-dialog').on('click', function() {
var text = [{
dialogText: '<h2>权益1: 新品立享9折</h2><p>1、学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受</p>',
}, {
dialogText: '<h2>权益2: 每1元返1个有货币</h2><p>1、学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>' +
'<p>2、返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>' +
'<p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>' +
'<p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>',
}, {
dialogText: '<h2>权益3: 免单抽奖</h2><p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>' +
'<p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>' +
'<p>3、免单用户将在中奖次日获得与实付金额等额的现金券,使用时间:中奖当月。</p>',
}, {
dialogText: '<h2>权益4: 学生专享活动</h2><p>1、每月不定期的开展学生专享活动,可打开有货APP推送,及时查收学生专享活动通知。</p>',
}];
var dialogBoxHammer, dialogRightBtn;
dialog.showDialog({
student: true,
dialogText: text[$(this).index()].dialogText,
hasFooter: {
rightBtnText: '我知道了'
}
}, function() {
$('body').css({
overflow: '',
position: '',
});
dialog.hideDialog();
}, undefined, true);
$('.dialog-content').css({
padding: '0 1.5rem 1rem 1.5rem',
});
$('.dialog-box').css({
'border-radius': '0.25rem',
background: '#fff',
});
$('.dialog-right-btn').css({
border: 'none',
color: '#d0021b',
});
$('body').css({
overflow: 'hidden',
position: 'fixed',
});
dialogBoxHammer = new Hammer(document.getElementsByClassName('dialog-box')[0]);
dialogRightBtn = new Hammer(document.getElementsByClassName('dialog-right-btn')[0]);
dialogBoxHammer.on('tap', function(event) {
event.srcEvent.stopPropagation();
});
dialogRightBtn.on('tap', function(event) {
$('body').css({
overflow: '',
position: '',
});
dialog.hideDialog();
event.preventDefault();
event.srcEvent.stopPropagation();
});
$('.dialog-content').addClass('s-dialog-content');
});
\ No newline at end of file
... ...
... ... @@ -27,8 +27,9 @@ exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'<div class="dialog-header">{{.}}</div>' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'<div class="dialog-content">{{{dialogText}}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
... ... @@ -94,9 +95,11 @@ exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
}
// 禁止在dialog上可以上下滚动
$dialogWrapper.on('touchmove', function() {
return false;
});
if (!data.student) {
$dialogWrapper.on('touchmove', function() {
return false;
});
}
dialogWrapperHammer.on('tap', function(event) {
... ... @@ -107,6 +110,12 @@ exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
return callback();
} else {
$('.dialog-wrapper').remove();
$('body').css({
overflow: '',
position: '',
});
}
// 防止出现点透问题
... ...
... ... @@ -33,7 +33,7 @@ var $input = $('#search-input input'),
$buriedpoint = $('.buriedpoint'),
$search = $('#search');
var shopId, sort, brand, outlets, app_type, age_level, msort, misort;
var shopId, sort, brand, outlets, app_type, age_level, msort, misort, coin, app_version;
// 默认筛选条件
var defaultOpt = require('../../common/query-param');
... ... @@ -196,6 +196,8 @@ age_level = getQueryString('age_level');
app_type = getQueryString('app_type');
msort = getQueryString('msort');
misort = getQueryString('misort');
coin = getQueryString('coin');
app_version = getQueryString('app_version') || getQueryString('appVersion');
/**
* 筛选注册的回调,筛选子项点击后逻辑
... ... @@ -344,8 +346,15 @@ function search(opt) {
params.misort = misort;
}
$.extend(setting, defaultOpt, params);
if (coin) {
params.coin = coin;
}
if (app_version) {
params.app_version = app_version;
}
$.extend(setting, defaultOpt, params);
searching = true;
loading.showLoadingMask();
... ...
... ... @@ -608,9 +608,54 @@
width: 30px;
transform: translate(-50%, 0%);
-webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
a {
display: block;
}
}
.s-dialog-wrapper {
z-index: 99;
}
.s-dialog-content {
max-height: 460px;
max-width: 540px;
overflow-y: scroll;
text-align: left;
color: #444;
font-family: 'PingFangSC-Regular', 'helvetica', 'Arial', '黑体';
-webkit-overflow-scrolling: touch;
h2 {
padding: 50px 0 40px 20px;
text-align: center;
font-weight: bold;
font-size: 34px;
color: #000;
}
p {
font-size: 28px;
padding-bottom: 30px;
}
}
.s-yohocoin {
display: block;
height: 59px;
width: 258px;
border: 2px solid #444;
border-radius: 5px;
color: #444;
font-size: 28px;
line-height: 59px;
text-align: center;
margin: 0 auto 20px;
}
::-webkit-scrollbar{
opacity: 0;
}
... ...
... ... @@ -125,14 +125,12 @@
}
}
#float-layer-close {
position: absolute;
left: 0;
top: 0;
width: 50PX;
height: 50PX;
width: 100px;
height: 100px;
.close-icon {
position: absolute;
left: 0;
... ... @@ -142,7 +140,6 @@
font-size: 18PX;
}
}
#float-layer-btn {
position: absolute;
top: 50%;
... ... @@ -171,4 +168,4 @@
border:0 solid #323232;
border-bottom:25PX solid #323232;
border-radius:0 0 25PX 0;
}
\ No newline at end of file
}
... ...
... ... @@ -283,8 +283,14 @@
padding: 60px 30px;
}
.dialog-header {
padding: 50px 0 40px;
font-size: 34px;
text-align: center;
font-weight: bold;
}
.dialog-footer {
border-top: 1px solid #ccc;
height: 88px;
line-height: 88px;
... ... @@ -297,6 +303,7 @@
&:nth-last-of-type(1) {
border-left: 1px solid #ccc;
border-radius: 0 0 10px 10px;
color: #e01;
}
}
... ... @@ -305,4 +312,18 @@
background-color: #ccc;
}
}
/*边框在物理机上1px变粗*/
.dialog-footer::before {
content: "";
position: absolute;
left: 0;
width: 200%;
height: 0;
border-top: 1px solid #cccccc;
transform-origin: left top;
transform: scale3d(0.5,0.5,0.5);
-webkit-transform: scale3d(0.5,0.5,0.5); /* Chrome, Safari, Opera */
-ms-transform: scale3d(0.5,0.5,0.5); /* IE 9 */
}
}
... ...