Authored by 王水玲

Merge branch 'release/5.0.0' of git.yoho.cn:fe/yohobuywap-node into release/5.0.0

... ... @@ -17,7 +17,7 @@ function humanNum_wan(num) {
exports.beforeIn = (req, res, next) => {
// 将APP登录状态正常化
if (req.yoho.isApp && req.query.uid) {
if (req.yoho.isApp) {
req.user.uid = Number(req.user.uid || req.query.uid);
}
... ... @@ -162,15 +162,7 @@ exports.saveMsg = (req, res, next) => {
// 获取 会员日的 用户留言
exports.fetchMsg = (req, res, next) => {
let uid;
if (global.yoho.isApp) {
uid = req.query.uid;
} else {
uid = req.user.uid;
}
uid = uid || 0;
let uid = req.user.uid || (req.yoho.isApp && Number(req.query.uid)) || 0;
vipDayModel.queryLeaveWordsList(uid).then(result => {
return res.json(result);
... ...
/* eslint-disable camelcase */
'use strict';
const url = require('url');
const _ = require('lodash');
const API = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
... ... @@ -102,6 +103,9 @@ exports.getGoods = cate => {
productList.forEach(product=> {
let skn = product.productSkn;
let imgSrc = url.parse(product.defaultImages);
product.defaultImages = ['//', imgSrc.hostname, imgSrc.pathname].join('');
product.url = helpers.appUrlFormat(product.url, 'go.productDetail', {
product_skn: skn
... ...
... ... @@ -6,9 +6,15 @@
<section class="vip-day-sec qiangjuan" id="qiangquan">
<div class="content">
<ul class="chits">
<li class="chit chit10"></li>
<li class="chit chit30"></li>
<li class="chit chit60"></li>
<li>
<div class="chit chit10"></div>
</li>
<li>
<div class="chit chit30"></div>
</li>
<li>
<div class="chit chit60"></div>
</li>
</ul>
<button class="qiangjuan-foucs" data-toggle="ymodal" data-target="#chit-qcode">立刻关注抢优惠券</button>
</div>
... ... @@ -94,13 +100,7 @@
<textarea class="vip-msg-content"></textarea>
<button class="vip-msg-send" type="button">写好啦!</button>
</div>
<p class="label">
<strong>写留言去抽奖!</strong>
<br>
<strong>100%中奖机会</strong>
<br><br>
潮/酷/屌炸天为你而造~告诉我们你的想法可再次参与抽奖,100%中奖哦。
</p>
<img class="txt" src="{{imgSrc 'img/activity/vip_day/leava-msg.png'}}" alt="">
</div>
<div class="vip-day-msg-input"></div>
</div>
... ... @@ -113,7 +113,7 @@
{{! footer }}
<footer class="vip-day-footer">
<a href="http://www.yohoshow.com/about/index/yohobuyqr/" class="app-download"></a>
{{#unless isApp}} <a href="http://www.yohoshow.com/about/index/yohobuyqr/" class="app-download"></a> {{/unless}}
</footer>
{{> vip_day/footer-nav }}
... ...
<li class="vip-good">
<img class="vip-good-show" src="{{image defaultImages 220 115}}" alt="">
<div class="vip-good-price">
{{!--
<div class="text-right">
<sup>¥</sup><span>539</span>
<div style="border: 1px solid #000;">
<img class="vip-good-show" src="{{image defaultImages 220 115}}" alt="">
<div class="vip-good-price">
{{!--
<div class="text-right">
<sup>¥</sup><span>539</span>
</div>
<div class="text-left">
<span class="disable-price">¥539</span>
</div>
--}}
{{#if marketPrice}}
<sup>¥</sup><span>{{salesPrice}}</span><span class="disable-price">¥{{marketPrice}}</span>
{{else}}
<sup>¥</sup><span>{{salesPrice}}</span>
{{/if}}
</div>
<div class="text-left">
<span class="disable-price">¥539</span>
<div class="vip-good-bottom">
<h6 class="vip-good-name line-clamp-2">{{productName}}</h6>
<button class="vip-good-fav" type="button">马上购买</button>
</div>
--}}
{{#if marketPrice}}
<sup>¥</sup><span>{{salesPrice}}</span><span class="disable-price">¥{{marketPrice}}</span>
{{else}}
<sup>¥</sup><span>{{salesPrice}}</span>
{{/if}}
</div>
<div class="vip-good-bottom">
<h6 class="vip-good-name line-clamp-2">{{productName}}</h6>
<button class="vip-good-fav" type="button">马上购买</button>
</div>
<a class="vip-good-link" href='{{url}}'></a>
</li>
\ No newline at end of file
... ...
... ... @@ -32,13 +32,14 @@ function appJump(where, option) {
var page = {
rollTimer: null,
init: function() {
this.domInit();
this.bindEvents();
this.fetchMsg();
share({
title: 'YOHO!BUY有货【会员日】潮集狂欢,限时六大福利,震撼开启,仅此一天,每月28日,尽情释放',
title: '有货【会员日】开启啦!9月28日潮集狂欢趴等你来HI!限时6大福利,快参与起来喽~',
link: location.href,
desc: 'YOHO!BUY',
imgUrl: 'http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png'
... ... @@ -130,7 +131,8 @@ var page = {
},
leaveMsg: function(content) {
console.log('hi');
var self = this;
$.post('/activity/vip-day/msg/save.json?app_version=1&uid=' + yoho.getUid(), {
content: content
})
... ... @@ -162,7 +164,7 @@ var page = {
}, 2000);
return;
}
self.fetchMsg();
tip.show('发布成功~');
})
.fail(function() {
... ... @@ -178,6 +180,8 @@ var page = {
return;
}
window.clearTimeout(this.rollTimer);
var $frag = $('<ul></ul>'),
$fragClone;
... ... @@ -192,7 +196,10 @@ var page = {
$fragClone = $frag.clone();
$msgRoll
.append($frag, $frag.clone());
.html('')
.append($frag, $frag.clone())
.clearQueue()
.scrollTop(0);
// .css({ visibility: 'visible' });
... ... @@ -206,7 +213,7 @@ var page = {
function rolling() {
$msgRoll.animate({
$msgRoll.delay(2000).animate({
scrollTop: '+='.concat(oneMsgH)
}, 400, function() {
var curT = $msgRoll[0].scrollTop;
... ... @@ -215,7 +222,7 @@ var page = {
$msgRoll[0].scrollTop = curT - $frag[0].getBoundingClientRect().height;
}
setTimeout(rolling, 1000);
// self.rollTimer = setTimeout(rolling, 2000);
});
}
... ...
... ... @@ -16,6 +16,7 @@ var ClassName = {
};
var Modal = function(elem, config) {
this.$element = $(elem);
this.$body = $(document.body);
this._backdrop = null;
this._config = $.extend(
{},
... ... @@ -36,6 +37,7 @@ Modal.prototype.show = function(relatedTarget) {
if (this._isShown) {
return this;
}
this.$body.toggleClass('ymodal-open', true);
this.$element.trigger('show.yoho.modal', relatedTarget);
this.$element.on('click.dismiss.yoho.modal', Selector.DATA_DISMISS, $.proxy(this.hide, this));
... ... @@ -57,6 +59,7 @@ Modal.prototype.hide = function(e) {
this.$element
.off('click.dismiss.yoho.modal')
.hide();
this.$body.removeClass('ymodal-open');
this.backdrop();
this.$element.trigger('hiden.yoho.modal');
};
... ...
... ... @@ -75,7 +75,7 @@ var yoho = {
getUid: function() {
if (window.queryString.app_version) {
return window.queryString.uid;
return window.queryString.uid || 0;
}
return window.getUid() || 0;
... ...
... ... @@ -13,7 +13,7 @@
position: relative;
height: 466px;
background: resolve("activity/vip_day/foot-app.png");
background-size: cover;
background-size: 100% 100%;
margin-bottom: 116px;
.app-download {
... ... @@ -71,22 +71,27 @@
margin-top: 31px;
margin-bottom: 25px;
overflow: hidden;
li {
float: left;
width: 33.3333333%;
padding-right: 7px;
&:last-of-type {
padding-right: 0;
}
}
}
.chit {
display: inline-block;
width: 212px;
display: block;
height: 89px;
margin-right: 7px;
}
.chit:last-of-type {
margin-right: 0;
background-size: 100% 100%;
}
.chit10 { background-image: url("/activity/vip_day/chit10.png"); }
.chit30 { background-image: url("/activity/vip_day/chit30.png"); }
.chit60 { background-image: url("/activity/vip_day/chit60.png"); }
.chit10 { background-image: resolve("activity/vip_day/chit10.png"); }
.chit30 { background-image: resolve("activity/vip_day/chit30.png"); }
.chit60 { background-image: resolve("activity/vip_day/chit60.png"); }
}
.qiangjuan-foucs {
... ... @@ -222,9 +227,10 @@
.vip-good {
position: relative;
float: left;
width: 222px;
border: 1PX solid #000;
margin-right: 8px;
// width: 222px;
width: 33.3333%;
// border: 1PX solid #000;
padding-right: 8px;
&:nth-child(3n) {
margin-right: 0;
... ... @@ -250,15 +256,6 @@
position: relative;
text-align: center;
/*
> div {
font-size: 20px;
float: left;
width: 50%;
line-height: 38px;
}
*/
sup {
font-size: 10px;
vertical-align: text-top;
... ... @@ -301,7 +298,7 @@
.vip-good-name {
font-size: 20px;
color: #fff;
height: 53px;
height: 2em;
margin-bottom: 10px;
}
... ... @@ -337,16 +334,16 @@
.mirror {
float: left;
width: 400px;
width: 60%;
// width: 430px;
margin-right: 35px;
color: block;
padding: 5px;
background-color: #e9e9ea;
border-radius: 4px;
}
.vip-msg-content {
height: 136px;
display: block;
height: 128px;
background-color: #e9e9ea;
border: none;
outline: none;
... ... @@ -364,15 +361,12 @@
border-radius: 8px;
}
.label {
padding-right: 40px;
overflow: hidden;
font-size: 19px;
strong {
font-size: 27px;
color: #e95d3f;
}
.txt {
float: left;
margin-top: 23px;
margin-bottom: 23px;
width: 195px;
height: 132px;
}
}
... ... @@ -469,7 +463,7 @@
height: 47px;
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
background-size: 100% 100%;
}
.bg-chit {
background-image: resolve("activity/vip_day/get-chit.png");
... ...
.ymodal-open {
overflow: hidden;
}
.ymodal {
position: fixed;
top: 0;
... ...