Authored by Rock Zhang

Merge branch 'beta/wap' into develop/wap

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>如何获得限购码</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta content="telephone=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
}());
})(document, window);
</script>
<style>
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, .yoho-header .nav-back, .yoho-header .nav-home, .yoho-header .nav-btn {
margin: 0;
padding: 0;
border: 0;
font: inherit;
font-size: 100%;
vertical-align: baseline;
}
html {
line-height: 1;
}
ol, ul {
list-style: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
vertical-align: middle;
}
q, blockquote {
quotes: none;
}
q:before, q:after, blockquote:before, blockquote:after {
content: "";
content: none;
}
a img {
border: none;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary, .yoho-header .nav-back, .yoho-header .nav-home, .yoho-header .nav-btn {
display: block;
}
/*Reset End*/
.clearfix:after{
content: '';
display: table;
clear: both;
}
* {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-moz-tap-highlight-color: rgba(0,0,0,0);
tap-highlight-color: rgba(0,0,0,0);
}
html, body {
font-family: helvetica,Arial,"黑体";
width: 100%;
font-size: 12PX;
line-height: 1.4;
}
button, input, select, textarea {
font-size: 100%;
margin: 0;
}
img {
max-width: 100%;
display: block;
border: 0;
margin: 0 auto;
}
a {
text-decoration: none;
outline: none;
color: #000
}
a:link, a:visited, a:hover, a:actived{
color: #000;
}
*:focus {
outline: none;
}
.hide {
display: none;
}
.overflow-hidden {
overflow: hidden;
}
@font-face {
font-family: "iconfont";
src: url('../font/iconfont.eot'); /* IE9*/
src: url('../font/iconfont.eot?#iefix') format('embedded-opentype'),
url('../font/iconfont.woff') format('woff'),
url('../font/iconfont.ttf') format('truetype'),
url('../font/iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16PX;
font-style: normal;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2PX;
-moz-osx-font-smoothing: grayscale;
}
.limit-help-page{
padding: 0.7rem;
color: #444;
}
.limit-help-page h2{
font-size: 0.75rem;
font-weight: bold;
}
.limit-help-page .method{
display: block;
width: 2.3rem;
height: 0.875rem;
line-height: 0.9rem;
background-color: #444;
color: #fff;
border-radius: 0.5rem;
text-align: center;
margin: 0.5rem 0;
}
.limit-help-page li{
font-size: 0.6rem;
}
.limit-help-page .intro-img{
width: 100%;
height: 5.5rem;
background-size: 100%;
background-repeat: no-repeat;
margin: 0.5rem 0;
}
.limit-help-page .method-1 li:nth-child(1) .intro-img{
background-image: url('../assets/img/product/help/1.png');
}
.limit-help-page .method-1 li:nth-child(2) .intro-img{
background-image: url('../assets/img/product/help/2.png');
}
.limit-help-page .method-1 li:nth-child(3) .intro-img{
background-image: url('../assets/img/product/help/3.png');
}
.limit-help-page .method-2 li:nth-child(1) .intro-img{
background-image: url('../assets/img/product/help/4.png');
}
.limit-help-page .method-2 li:nth-child(2) .intro-img{
background-image: url('../assets/img/product/help/5.png');
}
.limit-help-page .method-2 li:nth-child(3) .intro-img{
background-image: url('../assets/img/product/help/6.png');
}
.limit-help-page .method-2 li:nth-child(4) .intro-img{
background-image: url('../assets/img/product/help/7.png');
}
.limit-help-page .how li:nth-child(1) .intro-img{
background-image: url('../assets/img/product/help/8.png');
}
.limit-help-page .how li:nth-child(2) .intro-img{
background-image: url('../assets/img/product/help/9.png');
margin-bottom: 0;
}
</style>
</head>
<body>
<div class="limit-help-page yoho-page">
<h2>不同限定商品获取限购码方式不同,获取限购码目前有两种方式:</h2>
<span class="method">方式一</span>
<ul class="method-1">
<li>1.在限定发售详情页点击分享或者底部“获取限购码”图标。
<div class="intro-img"></div>
</li>
<li>2.从弹出的分享中选取需要分享的渠道。
<div class="intro-img"></div>
</li>
<li>3.分享成功后返回Yoho!Buy有货APP会提示已获得限购码。
<div class="intro-img"></div>
</li>
</ul>
<span class="method">方式二</span>
<ul class="method-2">
<li>1.在限定发售详情页点击参加排队赢取限购码图标。
<div class="intro-img"></div>
</li>
<li>2.进入限定发售排队页面,点击参加排队。
<div class="intro-img"></div>
</li>
<li>3.排队成功后凭排队序列号作为抽奖凭证,等待开奖时间。
<div class="intro-img"></div>
</li>
<li>4.开奖后,排队页面会公布中奖名单,限购码会直接发送至账户。
<div class="intro-img"></div>
</li>
</ul>
<h2>查看和使用限购码</h2>
<ul class="how">
<li>1.从个人中心进入我的限购码页面,可查看所获取的限购码。
<div class="intro-img"></div>
</li>
<li>2.商品开售后,可凭此限购码购买对应商品。
<div class="intro-img"></div>
</li>
</ul>
</div>
</body>
</html>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>什么是限购码</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
}());
})(document, window);
</script>
<style>
html, body, p {
margin: 0;
padding: 0;
font-family: helvetica,Arial,"黑体";
}
div {
padding: 0.7rem
}
p {
font-size: 0.7rem;
color: #444;
margin: 0.3rem 0;
line-height: 1rem;
}
span {
font-weight: bold;
}
</style>
</head>
<body>
<div>
<p>
<span>介绍:</span>
限购码是指用于删除商品的一种权利,达到一定条件即可获得。
</p>
<p>
<span>优势:</span>
限定商品购买权
</p>
<p>
<span>用户:</span>
Yoho!Buy有货忠实用户
</p>
<p>
<span>如何使用:</span>
相关商品开放购买的时候,页面会出现使用限购码的按钮,点击购买即可。
<br>
限购码对应的商品是唯一的,一个码只可买一个商品。
</p>
</div>
</body>
</html>
... ...
... ... @@ -35,26 +35,26 @@
<div class="limit-good-page yoho-page">
<div class="goodDesc">
{{#mainImg}}
<img class="lazy" src="{{mainImg}}" alt="">
{{/mainImg}}
{{# goodDescList}}
{{#goodDescription}}
<p class="desc">{{goodDescription}}</p>
{{/goodDescription}}
{{# item}}
{{#if img}}
<img class="lazy" src="{{.}}" alt="">
{{/if}}
{{#imgList}}
<img class="lazy" src="{{img}}" alt="">
{{/imgList}}
{{#if text}}
<p class=" desc">{{.}}</p>
{{/if}}
{{#vedio}}
<video poster="{{img}}" controls="controls" controls="controls" preload="metadata" loop="loop" width="100%" name="media">
{{#list}}
<source src="{{src}}" type="video/ogg;codecs=" theora,vorbis"" media="screen" />
<source src="{{src}}"/>
{{/list}}
</video>
{{/vedio}}
{{#if video}}
<video poster="{{img}}" controls="controls" controls="controls" preload="metadata" loop="loop" width="100%" name="media">
<source src="{{src}}" type="video/ogg;codecs=" theora,vorbis"" media="screen" />
<source src="{{src}}"/>
</video>
{{/if}}
{{/ item}}
{{/ goodDescList}}
</div>
</div>
</body>
... ...
... ... @@ -1689,6 +1689,7 @@ define("js/home/home", ["jquery","swiper","lazyload","hammer","index"], function
var $ = require("jquery"),
Swiper = require("swiper"),
lazyLoad = require("lazyload"),
noticeScroll = require("js/plugin/notice-scroll"),
$mobileWrap = $('.mobile-wrap'),
$overlay = $('.overlay'),
$sideNav = $('.side-nav'),
... ... @@ -1707,6 +1708,7 @@ var start = 0,
isen = true;
lazyLoad($('img.lazy'));
noticeScroll('.notice', $('.notice').data('time') * 1000);
$('.nav-btn').on('touchstart', function() {
$sideNav.css('pointer-events', 'none');
... ... @@ -1836,7 +1838,8 @@ if ($('.fresh-list-swiper').find('li').size() > 1) {
lazyLoadingInPrevNext: true,
grabCursor: true,
slidesPerView: 'auto',
slideElement: 'li'
slideElement: 'li',
watchSlidesVisibility: true
});
}
... ... @@ -1906,6 +1909,38 @@ exports.set = function(c) {
require("js/home/maybe-like")();
});
define("js/plugin/notice-scroll", ["jquery"], function(require, exports, module){
/**
* 公告栏目滚动
* bikai kai.bi@yoho.cn
*/
var $ = require("jquery");
function noticeScroll(selecter, time) {
var $notice = $(selecter),
$noticeItem = $notice.find('.notice-item'),
count = $noticeItem.length,
i = 1;
selecter = selecter || '.notice';
time = time || 3000;
if (count > 1) {
setInterval(function() {
if (i >= count) {
i = 0;
}
$noticeItem.fadeOut();
$notice.find('.item-' + i).fadeIn();
i++;
}, time);
}
}
module.exports = noticeScroll;
});
define("js/home/maybe-like", ["jquery","hammer","lazyload"], function(require, exports, module){
/**
* “你可能喜欢”模块JS
... ... @@ -5467,7 +5502,7 @@ $('#likeBtn').on('touchstart', function() {
$('#addtoCart').on('touchstart', function() {
$('.cart-bar').hide();
chosePanel.setLimitGoodModeWithSknId(productCode, skn);
productCode && chosePanel.setLimitGoodModeWithSknId(productCode, skn);
chosePanel.show();
//统计代码:用于统计用户加入购物车的动作
... ... @@ -5579,7 +5614,7 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) {
* @return {undefined}
*/
function setLimitGoodModeWithSknId(code, sknId) {
$('#chose-btn-sure').html('结算');
$('#chose-btn-sure').html('立即购买');
limitProductCode = code;
skn = sknId;
}
... ... @@ -5657,7 +5692,7 @@ function updateConformButtonClassAndText() {
if (2 === $chosed.closest('.zero-stock').length) {
$('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄');
} else if (limitProductCode) {
$('#chose-btn-sure').css('background-color', '#eb0313').html('结算');
$('#chose-btn-sure').css('background-color', '#eb0313').html('立即购买');
} else {
$('#chose-btn-sure').css('background-color', '#eb0313').html(isEdit ? '确认' : '加入购物车');
}
... ... @@ -5958,8 +5993,8 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
} else if (limitProductCode) {
// 当前面板选择的是限购商品
url = 'http://m.yohobuy.com/cart/index/orderEnsure?code=' + limitProductCode + '&&sku=' +
productSku + '&&skn=' + skn + '&&buy_num=' + buyNumber;
url = $('#limitProductPay').val() + '?limitproductcode=' + limitProductCode + '&sku=' +
productSku + '&skn=' + skn + '&buy_number=' + buyNumber;
//打开结算页面,结束函数执行。
window.location.href = url;
... ... @@ -7048,6 +7083,8 @@ var $ = require("jquery"),
var diaLog = require("js/me/dialog");
var tip = require("js/plugin/tip");
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content > .fav-type'),
swiperObj = {},
... ... @@ -7129,11 +7166,13 @@ function loadData($parent, url, page) {
if (data === ' ') {
$loadingMask.addClass('hide');
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
window.rePosFooter();
} else if (data === 'end') {
//处理data等于end时如果loadingMask存在且没有hide样式的情况
if ($loadingMask && !$loadingMask.hasClass('hide')) {
$loadingMask.addClass('hide');
//$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
}
... ... @@ -7296,7 +7335,7 @@ $(document).on('touchend', '.swiper-header', function() {
}
});
$('.invalidGoods').on('touchstart touchend', function() {
$('.invalidGoods').on('touchstart touchend', function(e) {
var $this = $(e.target).closest('span');
if ($this.hasClass('del-fav')) {
... ... @@ -7305,6 +7344,7 @@ $('.invalidGoods').on('touchstart touchend', function() {
tip.show('商品已下架');
return false;
});
});
define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
/**
... ... @@ -8375,7 +8415,9 @@ define("js/me/index", ["jquery","swiper","index"], function(require, exports, mo
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery");
var $ = require("jquery"),
noticeScroll = require("js/plugin/notice-scroll");
var $userAvatar = $('.user-avatar'),
$listItem = $('.list-item');
var myImage = new Image(),
... ... @@ -8391,6 +8433,8 @@ myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
noticeScroll('.notice', $('.notice').data('time') * 1000);
$('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', function() {
$listItem.removeClass('highlight');
$(this).addClass('highlight');
... ... @@ -9903,6 +9947,26 @@ require("js/common");
lazyLoad();
function getQueryParam() {
var queryArray = location.search.substr(1).split('&'),
i,
subArr = [],
obj = {};
for (i = 0; i < queryArray.length; i++) {
subArr = queryArray[i].split('=');
obj[subArr[0]] = subArr[1];
subArr = [];
}
return obj;
}
function isLimitGood() {
return getQueryParam().limitproductcode;
}
if (window.getUid() !== orderInfo('uid')) {
order.init();
window.location.reload();
... ... @@ -9919,6 +9983,18 @@ if (document.referrer && document.referrer.indexOf('/cart/index/index') !== -1)
orderInfo('couponName', null);
}
isLimitGood() && (function() {
var a = [];
var data = getQueryParam();
data['type'] = 'limitcode';
a.push(data);
orderInfo('skuList', JSON.stringify(a));
orderInfo('limitUrlSufix', location.search);
})();
if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) {
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
}
... ... @@ -9975,7 +10051,8 @@ function orderCompute() {
deliveryId: orderInfo('deliveryId'),
paymentTypeId: orderInfo('paymentTypeId'),
couponCode: orderInfo('couponCode'),
yohoCoin: yohoCoin
yohoCoin: yohoCoin,
skuList: isLimitGood() ? orderInfo('skuList') : undefined
}
}).then(function(res) {
var priceHtml;
... ... @@ -10050,7 +10127,9 @@ function submitOrder() {
paymentTypeId: orderInfo('paymentTypeId'),
paymentType: orderInfo('paymentType'), //支付方式
couponCode: orderInfo('couponCode'),
yohoCoin: orderInfo('yohoCoin')
yohoCoin: orderInfo('yohoCoin'),
skuList: isLimitGood() ? orderInfo('skuList') : undefined
}
}).then(function(res) {
var url;
... ... @@ -10455,7 +10534,7 @@ $('.address-item').on('touchend', function() {
orderInfo('addressId', addressId);
orderInfo('address', address);
window.location.href = $this.data('href');
window.location.href = $this.data('href') + (orderInfo('limitUrlSufix') || '');
}).on('touchend', '.edit', function() {
window.location.href = $(this).data('href');
return false;
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

23.3 KB | W: | H:

17.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -7,4 +7,5 @@
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
lazyLoad($('img.lazy'));
\ No newline at end of file
... ...
... ... @@ -83,22 +83,28 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
}
limitSaleHammer && limitSaleHammer.on('tap', function(e) {
var loginUrl = $('#loginUrl').val();
e.srcEvent.stopPropagation();
dialog.showDialog({
dialogText: '打开有货APP限定发售频道\n获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
window.location.href = appUrl;
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
e.stopPropagation();
if ($(e.target).hasClass('dialog-wrapper')) {
dialog.hideDialog();
}
});
if(loginUrl) {
window.location = loginUrl;
} else {
dialog.showDialog({
dialogText: '打开有货APP限定发售频道\n获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
window.location.href = appUrl;
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
e.stopPropagation();
if ($(e.target).hasClass('dialog-wrapper')) {
dialog.hideDialog();
}
});
}
});
require('./desc');
... ...
... ... @@ -177,5 +177,9 @@
<input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}">
{{/if}}
{{#loginUrl}}
<input type="hidden" name="loginUrl" id="loginUrl" value="{{.}}">
{{/loginUrl}}
</div>
{{> layout/footer}}
... ...
... ... @@ -16,13 +16,13 @@
</div>
</div>
<div class="my-swiper-button-prev prev-grey iconfont">&#xe610;</div>
<div class="my-swiper-button-next next-grey iconfont">&#xe604;</div>
<div class="my-swiper-button-prev prev-grey"></div>
<div class="my-swiper-button-next next-grey"></div>
</div>
{{^}}
{{^}}
<div class="banner-top-single">
<a href={{url}}>
<img class="img" src="{{img}}">
</a>
<a href={{url}}>
<img class="img" src="{{img}}">
</a>
</div>
{{/if}}
{{/if}}
\ No newline at end of file
... ...
... ... @@ -47,6 +47,11 @@ class DetailModel
$result['goodsName'] = $baseInfo['productName'];
// 用户未登录时
if (empty($uid)) {
$result['loginUrl'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/show_' . $baseInfo['erpProductId']. '.html')));
}
// 商品促销短语
if (!empty($baseInfo['salesPhrase'])) {
$result['goodsSubtitle'] = $baseInfo['salesPhrase'];
... ... @@ -862,6 +867,9 @@ class DetailModel
$data['gotCode'] = true;
$data['cartInfo']['limitNotForSale'] = true;
break;
case 7: // 开售后,用户已经用获得的限购码购买过商品
$data['gotCode'] = true;
$data['cartInfo']['noLimitCode'] = true;
default:
break;
}
... ...