Authored by 周少峰

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into feature/web-list

Showing 70 changed files with 1352 additions and 298 deletions
... ... @@ -30,4 +30,8 @@ script/nginx/logs/
*.DS_Store
compile/
nbproject/
web-static/npm-debug.log
\ No newline at end of file
web-static/npm-debug.log
.tags
.tags_sorted_by_file
yohobuyP.sublime-project
yohobuyP.sublime-workspace
\ No newline at end of file
... ...
... ... @@ -489,6 +489,10 @@
},
...
],
customPrice: {
min: 1,
max: 99
},
color: [
{
href: '',
... ...
... ... @@ -31,6 +31,7 @@ class Yohobuy
// /* 测试环境 */
// const API_URL = 'http://testapi.yoho.cn:28078/';
// const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://test2.open.yohobuy.com/';
... ...
... ... @@ -58,4 +58,6 @@ class CacheConfig
const KEY_INDEX_BRANDS_LIST_DATA = 'key_index_brands_list_data';//频道brands数据
const KEY_CODE_YOHOCOIN_BANNER = 'key_code_yohocoin_banner';// 有货币banner数据
}
... ...
... ... @@ -198,11 +198,18 @@ class UserData
*/
public static function yohoCoinTotal($uid)
{
$param = Yohobuy::param();
/*$param = Yohobuy::param();
$param['method'] = 'app.yohocoin.total';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);*/
$param = Yohobuy::param();
$param['method'] = 'app.yoho.yohocoin';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ...
... ... @@ -64,16 +64,22 @@ class DetailData
/**
* 咨询内容列表
*
* @param int $uid 用户ID
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public static function consultList($productId, $pageNum, $pageSize)
public static function consultList($uid, $productId, $pageNum, $pageSize)
{
$param = Yohobuy::param();
$param['method'] = 'h5.consult.li';
$param['method'] = 'app.consult.li';
$param['product_id'] = $productId;
if (!empty($uid)) {
$param['uid'] = $uid;
}
$param['page'] = $pageNum;
$param['limit'] = $pageSize;
$param['client_secret'] = Sign::getSign($param);
... ... @@ -154,4 +160,40 @@ class DetailData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 咨询点赞
*
* @param int $uid 用户ID
* @param int $id 咨询ID
* @return array
*/
public static function upvoteConsult($uid, $id)
{
$param = Yohobuy::param();
$param['method'] = 'app.consult.like';
$param['id'] = $id;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 咨询有用
*
* @param int $uid 用户ID
* @param int $id 咨询ID
* @return array
*/
public static function usefulConsult($uid, $id)
{
$param = Yohobuy::param();
$param['method'] = 'app.consult.useful';
$param['id'] = $id;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -34,7 +34,7 @@ class SearchData
case 'preview':
case 'developer':
default:
return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search.json';//'http://101.200.31.165/yohosearch/search.json';
}
}
... ...
... ... @@ -208,7 +208,7 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
// isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ... @@ -273,7 +273,7 @@ class FloorProcess
isset(self::$channel[$type]) && $urlParam['gender'] = self::$channel[$type];
$value['more_url'] = Helpers::url('', $urlParam, 'guang');
}
if ($key == 'list') {
if ($key == 'list' && is_array($value)) {
foreach ($value as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
... ... @@ -379,9 +379,6 @@ class FloorProcess
*/
private static function small_pic($data, $type)
{
// 按照以前业务操作,不显示
return array();
$result = array();
foreach ($data as &$one) {
... ... @@ -391,7 +388,9 @@ class FloorProcess
$one['img'] = Helpers::getImageUrl($one['src'], 98, 98);
unset($one['src']);
}
$result['small_pic'] = $data;
if (!empty($data)) {
$result['smallPic']['list'] = $data;
}
return $result;
}
... ...
... ... @@ -118,12 +118,17 @@ class Process
$height = 450;
if ($data['focus_type'] == 1) {
foreach ($data['data'] as $val) {
$ret = array();
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 1);
$val['url'] = Helpers::transUrl($val['url'], $type);
$temp[] = array(
$ret = array (
'href' => $val['url'],
'img' => $val['src']
'img' => $val['src'],
);
if(!empty($val['bgColor'])) {
$ret['bgColor'] = $val['bgColor'];
}
$temp[] = $ret;
}
$result['slide']['list'] = $temp;
}
... ...
... ... @@ -13,6 +13,7 @@ var swiper,
$fixTitleBar,
$brandList = $('.brand-list'),
$icon = $('.search-icon'),
$genderItem = $('.genderNav li'),
hotBrandsSwiper;
var searchH = $('.newbrand-search').outerHeight(),
... ... @@ -177,3 +178,11 @@ if ($('.brand-search-page').length) {
});
}
if ($genderItem.length > 0) {
$genderItem.on('touchstart', function() {
$('.genderNav ul .active').removeClass('active');
$(this).addClass('active');
window.location.search = 'channel=' + ($(this).data('id') + 1);
});
}
... ...
... ... @@ -193,4 +193,4 @@ exports.set = function(c) {
});
};
require('./maybe-like');
\ No newline at end of file
require('./maybe-like')();
... ...
... ... @@ -4,146 +4,157 @@
* @date: 2015/10/12
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../plugin/tip'),
loading = require('../plugin/loading'),
lazyLoad = require('yoho.lazyload');
var navHammer,
winH = $(window).height(),
$goodList = $('#goods-list'),
searching = false,
page = 0,
gender = null,
kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
lifestyleType = $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false,
num,
url;
var $curNav,
index,
$navList = $('#maybe-like-nav');
//ajax url
if (kidsType) {
url = '/product/recom/maylikekids';
} else if (lifestyleType) {
url = '/product/recom/maylikelife';
} else {
gender = $('.mobile-wrap').hasClass('boys-wrap') ? '1,3' : '2,3',
url = '/product/recom/maylike?gender=' + gender;
}
$curNav = $navList.children('.focus');
if (lifestyleType) {
navHammer = new Hammer($navList[0]);
navHammer.on('tap', function(e) {
var $this = $(e.target).closest('li'),
$goods = $('.goods-list'),
$content;
e.preventDefault();
if ($this.hasClass('focus')) {
return;
}
module.exports = function(specificGender) {
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../plugin/tip'),
loading = require('../plugin/loading'),
lazyLoad = require('yoho.lazyload');
var navHammer,
winH = $(window).height(),
$goodList = $('#goods-list'),
searching = false,
page = 0,
gender = null,
num,
url;
//The kidsType can be specified by the parameter. Add by @ZhaoBiao
var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
lifestyleType = specificGender === 'lifestyle' ||
$('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false;
var $curNav,
index,
$navList = $('#maybe-like-nav');
//ajax url
if (kidsType) {
url = '/product/recom/maylikekids';
} else if (lifestyleType) {
url = '/product/recom/maylikelife';
} else {
gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
'1,3' : '2,3',
url = '/product/recom/maylike?gender=' + gender;
}
$curNav = $navList.children('.focus');
index = $this.index();
if (lifestyleType) {
navHammer = new Hammer($navList[0]);
navHammer.on('tap', function(e) {
var $this = $(e.target).closest('li'),
$goods = $('.goods-list'),
$content;
$this.addClass('focus');
$curNav.removeClass('focus');
e.preventDefault();
if ($this.hasClass('focus')) {
return;
}
$goods.not('.hide').addClass('hide');
$content = $goods.eq(index);
$content.removeClass('hide');
index = $this.index();
$curNav = $this;
$this.addClass('focus');
$curNav.removeClass('focus');
$(document).trigger('scroll'); //Trigger lazyLoad
e.srcEvent.stopPropagation();
});
}
$goods.not('.hide').addClass('hide');
$content = $goods.eq(index);
$content.removeClass('hide');
loading.init($('.maybe-like'));
$curNav = $this;
function search() {
if (searching) {
return;
$(document).trigger('scroll'); //Trigger lazyLoad
e.srcEvent.stopPropagation();
});
}
searching = true;
loading.showLoadingMask();
//num = $goodList.find('.good-info').length;
$.ajax({
type: 'GET',
url: url,
data: {
page: page + 1
},
success: function(data) {
if (data === ' ') {
searching = false;
loading.hideLoadingMask();
if (gender) {
if (gender === '1,3') {
url = '/boys/bottomBanner';
} else {
url = '/girls/bottomBanner';
}
$.ajax({
type: 'GET',
url: url,
success: function(data) {
if (data && data.img) {
$('#load-more-img').show();
$('#load-more-img a').attr('href', data.url);
$('#load-more-img a > img').attr('src', data.img);
}
},
error: function() {
loading.init($('.maybe-like'));
function search() {
if (searching) {
return;
}
searching = true;
loading.showLoadingMask();
//num = $goodList.find('.good-info').length;
$.ajax({
type: 'GET',
url: url,
data: {
page: page + 1
},
success: function(data) {
if (data === ' ') {
searching = false;
loading.hideLoadingMask();
if (gender) {
if (gender === '1,3') {
url = '/boys/bottomBanner';
} else {
url = '/girls/bottomBanner';
}
});
$.ajax({
type: 'GET',
url: url,
success: function(data) {
if (data && data.img) {
$('#load-more-img').show();
$('#load-more-img a').attr('href', data.url);
$('#load-more-img a > img').attr('src', data.img);
}
},
error: function() {
}
});
}
return;
}
return;
}
num = $goodList.find('.good-info').length;
num = $goodList.find('.good-info').length;
$goodList.append(data);
$goodList.append(data);
// 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题
if (num === 0) {
lazyLoad($goodList.find('.good-info').find('img.lazy'));
} else {
lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
}
// 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题
if (num === 0) {
lazyLoad($goodList.find('.good-info').find('img.lazy'));
} else {
lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
searching = false;
loading.hideLoadingMask();
page++;
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
}
searching = false;
loading.hideLoadingMask();
page++;
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
$('.maybe-like p').on('touchstart', function(e) {
search();
});
}
$('.maybe-like p').on('touchstart', function(e) {
search();
});
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 200) {
search();
}
}
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 200) {
// 优惠券页面直接加载你可能喜欢。add by @zhaobiao
if (specificGender) {
search();
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
\ No newline at end of file
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
};
... ...
... ... @@ -21,6 +21,7 @@ var $addressForm = $('.edit-address'),
isSubmiting,
currentPage = 'edit',
newArea = [],
chinaAddressList,
queryString = $.queryString();
$($editAddressPage, $addressListPage).css('min-height', function() {
... ... @@ -118,12 +119,7 @@ $submit.on('touchend', function() {
$(this).removeClass('highlight');
});
// 省市区列表异步加载
$.ajax({
method: 'GET',
url: '/home/locationList',
timeout: 60000
}).then(function(html) {
function bindAddressListEvent(html) {
$addressListPage.html(html);
// 省市区
... ... @@ -185,6 +181,27 @@ $.ajax({
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
}).fail(function() {
tip.show('获取省市区列表失败');
});
}
// 读取省市区列表缓存
if (window.localStorage && window.localStorage.getItem) {
chinaAddressList = window.localStorage.getItem('chinaAddressList');
}
if (chinaAddressList) {
bindAddressListEvent(chinaAddressList);
} else {
// 省市区列表异步加载
$.ajax({
method: 'GET',
url: '/home/locationList',
timeout: 60000
}).then(function(html) {
bindAddressListEvent(html);
if (window.localStorage && window.localStorage.setItem) {
window.localStorage.setItem('chinaAddressList', html);
}
}).fail(function() {
tip.show('获取省市区列表失败');
});
}
... ...
/**
* 新有货币界面
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/12/30
*/
function getGender() {
return window.cookie('_Channel');
}
require('../home/maybe-like')(getGender());
... ...
... ... @@ -19,3 +19,4 @@ require('./logistic');
require('./pay');
require('./personal-details');
require('./currency');
require('./currency-new');
... ...
... ... @@ -9,11 +9,18 @@ var $ = require('jquery'),
var commentsNum,consultsNum;
var navtabEle = document.getElementById('nav-tab'),
var consultFooterEle = $('.consult-content-footer')[0],
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
navtabEle = document.getElementById('nav-tab'),
navtabHammer = navtabEle && new Hammer(navtabEle),
gotoConsultEle = document.getElementById('goto-consult'),
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle);
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
readmore = document.getElementById('readmore'),
readmoreHammer = readmore && new Hammer(readmore);
(function() {
... ... @@ -63,6 +70,12 @@ if (navtabHammer) {
});
}
if (consultFooterHammer) {
consultFooterHammer.on('tap', function() {
location.href = $(consultFooterEle).data('href');
});
}
if (gotoConsultHammer) {
gotoConsultHammer.on('tap', function() {
location.href = $(gotoConsultEle).find('a').attr('href');
... ... @@ -74,3 +87,16 @@ if ($('.goods-consults-page').length > 0) {
$('#yoho-header').css('position', 'fixed').css('top', '0');
}
if ($('.goods-consults-page').length > 0) {
$('#yoho-footer').css('border-top', '1px solid #e0e0e0');
}
if (readmoreHammer) {
readmoreHammer.on('tap', function() {
$('.readmore').hide();
$('.goods-consults .consult-item').show();
return false;
});
}
require('./fav');
... ...
/**
* 商品详情咨询页 --点赞和帮助功能
* @author: Lynnic
* @date: 2015/12/09
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
var goodsConsultsEle = $('#goods-consults')[0],
goodsConsultsHammer = goodsConsultsEle && new Hammer(goodsConsultsEle);
function showCountPlus($el) {
var $count = $el.find('.animate-count');
$count.css('display', 'inline');
$count.animate({
opacity: 0.25,
fontSize: '0.7rem',
right: '-=5'
}, 300, function() {
$count.css('display', 'none');
});
}
if (goodsConsultsHammer) {
goodsConsultsHammer.on('tap', function(e) {
var $this = $(e.target).closest('li'),
id = $this.closest('.consult-item').data('id'),
count = $this.find('.count').html() - 0,
url;
if (!$this.hasClass('highlight')) {
if ($this.hasClass('fav')) {
url = '/product/detail/consultupvote';
} else if ($this.hasClass('useful')) {
url = '/product/detail/consultuseful';
}
$.ajax({
method: 'post',
url: url,
data: {
id: id
}
}).done(function(data) {
if (data.code === 200) {
showCountPlus($this);
$this.addClass('highlight');
$this.find('.count').html(count + 1);
} else if (data.code === 401) {
location.href = data.data;//未登录跳转登录页
}
}).fail(function(data) {
tip.show('网络断开连接了~');
});
}
});
}
... ...
.brand-page {
.re-pos-search {
top: 170rem / $pxConvertRem !important;
}
.genderNav {
display: block;
width: 100%;
height: 80rem / $pxConvertRem;
line-height: 80rem / $pxConvertRem;
overflow: hidden;
color: #aeaeae;
z-index: 3;
position: fixed;
top: 90rem / $pxConvertRem;
border-bottom: 1px solid #e1e1e1;
background-color: #fff;
ul{
width: 100%;
height: 90%;
overflow: hidden;
li{
width: 25%;
height: 100%;
overflow: hidden;
float: left;
text-align: center;
position: relative;
font-size: 28rem / $pxConvertRem;
i{
width: 100%;
height: 40%;
overflow: hidden;
display: block;
}
span:not(.split-border){
width: 100%;
height: auto;
overflow: hidden;
display: block;
//line-height: 40rem / $pxConvertRem;
}
.split-border {
display: inline-block;
width: 2px;
height: 1rem;
background-color: #e1e1e1;
position: absolute;
top: 30%;
right: 0;
}
}
li:last-child {
.split-border {
display: none;
}
}
li.active {
color: #444;
}
}
}
.newbrand-search {
width: 93.75%;
height: 60rem / $pxConvertRem;
... ...
@import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "maybe-like",
"icons-enter","trendsetter-collocation",
"trend-topics","goods-category","hot-brands", "hot-category", "home-header";
"trend-topics","goods-category","hot-brands", "hot-category", "home-header", "thumb-row";
.mobile-container{
width: 100%;
overflow: hidden;
... ... @@ -21,7 +21,7 @@
.overlay {
display: none;
position: absolute;
top: 0;
top: 0;
left: 0;
right: 0;
bottom: 0;
... ...
#thumb-row {
@include flexbox((
display: box,
box-pack: justify
), $version: 1);
@include flexbox((
display: flex,
justify-content: space-around
), $version: 3);
background-color: #f0f0f0;
text-align: center;
padding: 32rem/$pxConvertRem 14rem/$pxConvertRem 0;
.thumb-row-box {
display: inline-block;
width: 275rem/$pxConvertRem;
height: 160rem/$pxConvertRem;
border-radius: 4px;
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
}
}
... ...
... ... @@ -55,6 +55,7 @@
height: pxToRem(120px);
background-color: #ffffff;
border-bottom: 1px solid $borderC;
z-index: 10;
i,
span,
a {
... ... @@ -73,12 +74,20 @@
.goods-consults {
margin-top: 5.25rem;
overflow: hidden;
.consult-item:nth-child(1) {
display: block;
}
.consult-item:nth-child(2) {
display: block;
}
.consult-item {
margin-top: pxToRem(30px);
padding: pxToRem(20px) pxToRem(28px);
background-color: #fff;
border-bottom: 1px solid $borderC;
border-top: 1px solid $borderC;
display:none;
.question {
font-size: pxToRem(24px);
color: $mainFontC;
... ... @@ -114,6 +123,84 @@
overflow: hidden;
}
}
.operation {
width: 120%;
height: pxToRem(60px);
line-height: pxToRem(80px);
position: relative;
right: 12%;
border-top: 1px solid #e0e0e0;
margin-top: pxToRem(20px);
li{
&.highlight{
color: $basicBtnC;
}
font-size:pxToRem(28px);
float:left;
width: 50%;
text-align: center;
color:$subFontC;
.iconfont{
display: inline-block;
padding-right: 5px;
font-size: inherit;
}
position: relative;
.animate-count {
display: none;
position: absolute;
top: 0;
font-size: pxToRem(20px);
z-index: 5;
}
i.count {
position: absolute;
}
}
li.fav {
.animate-count {
right: pxToRem(100px);
}
}
li.useful {
.animate-count {
right: pxToRem(88px);
}
}
}
}
}
.readmore{
display: block;
height: pxToRem(88px);
line-height: pxToRem(88px);
background-color: #fff;
text-align: center;
color: $subFontC;
margin-top: pxToRem(30px);
border-top: 1px solid $borderC;
border-bottom: 1px solid $borderC;
font-size: pxToRem(28px);
i{
font-size: inherit;
}
}
.faq-title{
height: pxToRem(88px);
line-height: pxToRem(88px);
text-align: center;
font-size: pxToRem(32px);
}
.goods-consults .faq-item{
@extend .consult-item;
margin-top: 0;
margin-bottom: pxToRem(30px);
.answer{
border-bottom: none;
}
}
// .gap-block {
... ... @@ -174,6 +261,9 @@
&.focus {
color: #000;
}
.comments-num {
display: none;
}
}
.comment-nav {
border-right: 1px solid #ccc;
... ...
{{> layout/header}}
<div class="brand-page yoho-page">
{{# channel}}
<div class="newbrand-search">
<div class="genderNav">
<ul>
{{# channels}}
<li {{#if active}}class="active"{{/if}} data-id="{{@index}}">
<span>{{name}}</span>
<span class="split-border"></span>
</li>
{{/channels}}
</ul>
</div>
<div class="newbrand-search re-pos-search">
<div class="search-box clearfix">
<a href="{{searchUrl}}" >
<input type="text" class="search-input" placeholder="查找品牌" readonly="true">
... ...
{{> layout/header}}
<div class="yoho-coin-new-page yoho-page">
<div class="coin">
{{# yohoCoin}}
<p class="coin-num">
7876
{{coinNum}}
</p>
<p class="info">
<span class="dollar"></span>
YOHO
</p>
<a href="" class="more">查看明细</a>
<a href="/home/currencyDetail" class="more">查看明细</a>
{{#if notice}}
<div class="coin-tip">
<span class="icon">!</span>
您有300个YOHO币即将于20171231日过期,请尽快使用
{{notice}}
</div>
{{/if}}
{{/ yohoCoin}}
</div>
<div class="banner">
<a href="">
{{#banner}}
<a href="{{url}}">
{{!-- 演示图片 --}}
<img src="http://temp.im/640x200" alt="">
<img src="{{img}}" alt="img">
</a>
{{/banner}}
</div>
{{> home/maybe_like}}
... ...
... ... @@ -81,7 +81,7 @@
优惠券
<span class="iconfont num">{{coupon_num}} &#xe604;</span>
</a>
<a class="list-item" href="/home/currencyDetail">
<a class="list-item" href="/home/currency">
<span class="iconfont icon">&#xe635;</span>
YOHO
<span class="iconfont num">{{yoho_coin_num}} &#xe604;</span>
... ...
... ... @@ -6,14 +6,61 @@
<a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults" id="goods-consults">
<div class="goods-consults" id="goods-consults">
{{#list}}
<div class="consult-item">
<div class="question">
<div class="consult-item" data-id="{{id}}">
<div class="question">
<span class="iconfont">&#xe639;</span>
<p>
{{question}}<br>
<span class="time">{{time}}</span>
</p>
</div>
<div class="answer">
<span class="iconfont">&#xe63f;</span>
<p>{{answer}}</p>
</div>
<ul class="operation">
<li class="fav {{#if isLike}}highlight{{/if}}">
<i class="iconfont ">&#xe601;</i>
<i class="count">{{#if like}}{{like}}{{/if}}</i>
<span class="animate-count">+1</span>
</li>
<li class="useful {{#if isUseful}}highlight{{/if}}">
<i class="iconfont ">&#xe605;</i>
有用
<i class="count">{{#if useful}}{{useful}}{{/if}}</i>
<span class="animate-count">+1</span>
</li>
</ul>
</div>
{{/list}}
</div>
{{/ consults}}
{{#showReadMore}}
<a href="javascript:;" id="readmore" class="readmore tap-hightlight" >查看更多 <i class="iconfont">&#xe604;</i></a>
{{/showReadMore}}
{{#faq}}
<h1 class="faq-title">
常见问题
</h1>
{{/faq}}
{{#faq}}
<div class="goods-consults" style="margin-top:0">
{{#list}}
<div class="faq-item">
<div class="question">
<span class="iconfont">&#xe639;</span>
<p>
{{question}}<br>
<span class="time">{{time}}</span>
{{question}}
</p>
</div>
... ... @@ -21,10 +68,10 @@
<span class="iconfont">&#xe63f;</span>
<p>{{answer}}</p>
</div>
</div>
{{/list}}
</div>
{{/list}}
</div>
{{/ consults}}
{{/faq}}
</div>
{{> layout/footer}}
... ...
... ... @@ -14,6 +14,11 @@
{{> home/banner}}
{{/ banner}}
{{! 两个小图}}
{{# smallPic}}
{{> home/thumb_row}}
{{/ smallPic}}
{{! 热门品类}}
{{# hotCategory}}
{{> home/hot_category}}
... ... @@ -38,7 +43,7 @@
{{# trendTopics}}
{{> home/trend_topics}}
{{/ trendTopics}}
{{! 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装}}
{{# goodsCategory}}
{{> home/goods_category}}
... ... @@ -55,5 +60,5 @@
{{/ plusStar}}
{{/ content}}
{{! 可能喜欢}}
{{> home/maybe_like}}
\ No newline at end of file
{{! 可能喜欢}}
{{> home/maybe_like}}
... ...
<div id="thumb-row">
{{# list}}
<a href="{{url}}">
<div class="thumb-row-box" style="background-image:url({{img}})"></div>
</a>
{{/ list}}
</div>
... ...
... ... @@ -334,3 +334,9 @@
seajs.use('js/me/currency');
</script>
{{/if}}
{{#if currencyPage}}
<script>
seajs.use('js/me/currency-new');
</script>
{{/if}}
... ...
... ... @@ -4,6 +4,9 @@
{{# girls}}
{{! 头部banner}}
{{# slide}}
{{>index/slide-banner}}
{{/ slide}}
{{# debrisSlider}}
<div class="debris-slider clearfix">
<div class="left-col col">
... ...
... ... @@ -15,8 +15,8 @@
{{# list}}
{{#unless @last}}
<li>
<a href="{{href}}">
<img class="lazy" data-original="{{img}}" alt="">
<a href="{{href}}" target= "_blank">
<img class="lazy" data-original="{{img}}" alt="" >
</a>
</li>
{{/unless}}
... ... @@ -26,7 +26,7 @@
{{# list}}
{{#if @last}}
<div class="last-item">
<a href="{{href}}">
<a href="{{href}}" target= "_blank">
<img class="lazy" data-original="{{img}}" alt="">
</a>
</div>
... ... @@ -43,7 +43,7 @@
<ul class="img-list clearfix">
{{# imgBrand}}
<li class="img-item">
<a href="{{href}}">
<a href="{{href}}" target= "_blank">
<img src="{{img}}" alt="">
</a>
</li>
... ... @@ -70,7 +70,7 @@
{{! 广告}}
{{# adbanner}}
<div class="floor-ad">
<a href="{{href}}" target= "_blank"><img class="lazy" data-original="{{img}}"/></a>
<a href="{{href}}" target= "_blank"><img class="lazy" data-original="{{img}}"/></a>
</div>
{{/ adbanner}}
... ...
... ... @@ -48,6 +48,9 @@
</span>
</li>
<li class="third-party-login">
<a href="{{weixinLogin}}">
<span class="icon weixin"></span>
</a>
<a href="{{qqLogin}}">
<span class="icon qq"></span>
</a>
... ... @@ -70,4 +73,4 @@
</div>
{{/ passport}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="login-page passport-page yoho-page clearfix">
{{> layout/simple-header}}
<div class="passport-page yoho-page clearfix">
{{# passport}}
{{> passport/cover}}
<div class="content">
<div class="register-page">
<form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off">
<ul>
<li class="clearfix">
<select id="region" class="region" name="region">
{{#each region}}
<option {{#if selected}}selected="selected"{{/if}} value="{{id}}">{{name}}</option>
{{/each}}
</select>
</li>
<li class="clearfix" data-index="0">
<span id="country-code" class="country-code">{{location}}</span>
<input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off">
</li>
<li class="w330 clearfix" data-index="1">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
<a class="link change-captcha">换一张</a>
</li>
<li class="clearfix" data-index="2">
<input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4">
<input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码">
<span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span>
</li>
<li class="clearfix" data-index="3">
<input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password">
<div class="pwd-intensity-container">
<span class="pwd-intensity low">低</span>
<span class="pwd-intensity mid">中</span>
<span class="pwd-intensity high">高</span>
</div>
<div id="pwd-tips" class="hide pwd-tips">
<div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div>
</div>
</li>
<li class="items-container clearfix">
<input id="agree-terms" class="agree-terms" type="checkbox" checked="">
<span>
我已阅读并同意遵守
<a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a>
</span>
</li>
<li class="clearfix">
<input name="refer" id="refer" type="hidden" value="{{referUrl}}">
<input id="register-btn" class="btn register-btn disable" type="submit" value="立即注册" disabled="">
</li>
<li class="quick-login-container">
我已注册YOHO!有货账号
<a class="link go-login" href="{{loginUrl}}">快速登录</a>
</li>
</ul>
<div id="err-tip" class="err-tip hide">
<span></span>
<b></b>
</div>
</form>
</div>
{{> passport/register}}
</div>
{{/ passport}}
</div>
... ...
{{> layout/simple-header}}
<div class="passport-page yoho-page clearfix">
{{# passport}}
{{> passport/cover}}
<div class="content">
{{> passport/register}}
</div>
{{/ passport}}
<div class="page-tip clearfix">为了给您更好的购物体验, 建议您创建YOHO!Family账号</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<div class="slide-wrapper">
<ul>
{{# list}}
<li style="backgroundColor:{{bgColor}}">
<li style="background:{{bgColor}}">
<a href="{{href}}" target= "_blank">
<img class="lazy" data-original="{{img}}" alt="">
</a>
... ...
... ... @@ -10,28 +10,40 @@
<meta name="description" content="{{description}}">
<title>{{title}}</title>
{{#if rlsEnv}}
<!-- [if (gte IE 6)&(lte IE 8)>
<script src="http://cdn.yoho.cn/yohobuy/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
<!--[if lt IE 9]>
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
{{#if preEnv}}
<!-- [if (gte IE 6)&(lte IE 8)>
<script src="http://cdn.yoho.cn/yohobuy/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
<!--[if lt IE 9]>
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
{{#if testEnv}}
<!-- [if (gte IE 6)&(lte IE 8)>
<script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/yohobuy/{{version}}/index.css">
<!--[if lt IE 9]>
<script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.min.js"></script>
<link href="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.proxy.js"></script>
<link href="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
{{#if devEnv}}
<!-- [if (gte IE 6)&(lte IE 8)>
<script src="http://webstatic.dev.yohobuy.com/plugin/page-use/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://webstatic.dev.yohobuy.com/css/index.css">
<!--[if lt IE 9]>
<script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.min.js"></script>
<link href="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.proxy.js"></script>
<link href="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
</head>
<body>
... ...
<div class="register-page">
<!--<form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off">-->
<ul>
<li class="clearfix">
<select id="region" class="region" name="region">
{{#each region}}
<option {{#if selected}}selected="selected"{{/if}} value="{{id}}">{{name}}</option>
{{/each}}
</select>
</li>
<li class="clearfix" data-index="0">
<span id="country-code" class="country-code">{{location}}</span>
<input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off">
</li>
<li class="w330 clearfix" data-index="1">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
<a class="link change-captcha">换一张</a>
</li>
<li class="clearfix" data-index="2">
<input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4">
<input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码">
<span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span>
</li>
<li class="clearfix" data-index="3">
<input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password">
<div class="pwd-intensity-container">
<span class="pwd-intensity low">低</span>
<span class="pwd-intensity mid">中</span>
<span class="pwd-intensity high">高</span>
</div>
<div id="pwd-tips" class="hide pwd-tips">
<div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div>
</div>
</li>
<li class="items-container clearfix">
<input id="agree-terms" class="agree-terms" type="checkbox" checked="">
<span>
我已阅读并同意遵守
<a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a>
</span>
</li>
<li class="clearfix">
<input name="refer" id="refer" type="hidden" value="{{referUrl}}">
<input id="register-btn" class="btn register-btn disable" type="submit" value="{{regBtnText}}" disabled="">
</li>
{{# loginUrl}}
<li class="quick-login-container">
我已注册YOHO!有货账号
<a class="link go-login" href="{{.}}">完善信息</a>
</li>
{{/loginUrl}}
{{# skipUrl}}
<li class="skip-user-info">
<a href="{{.}}">跳过此步</a>
</li>
{{/skipUrl}}
</ul>
<div id="err-tip" class="err-tip hide">
<span></span>
<b></b>
</div>
<!--</form>-->
</div>
\ No newline at end of file
... ...
... ... @@ -133,9 +133,9 @@
<div class="ud-price-range">
¥
<input type="text" class="min limit">
<input type="text" class="min limit" value="{{customPrice.min}}">
<span class="price-sep">-</span>
<input type="text" class="max limit">
<input type="text" class="max limit" value="{{customPrice.max}}">
<button class="price-sure hide">确定</button>
</div>
... ...
... ... @@ -2404,6 +2404,10 @@ var $ = require("jquery"),
Slider.prototype = {
init: function() {
if (!this.$element) {
return;
}
if (this.len <= 1) {
lazyLoad(this.$element.find('img.lazy'));
return;
... ... @@ -2509,7 +2513,13 @@ var $ = require("jquery"),
this.smallItem.eq(this.index).addClass('focus').siblings().removeClass('focus');
this.bigItem.eq(this.index).fadeIn().siblings().fadeOut();
this.bigItem.eq(this.index).show().stop().animate({
opacity: 1
}).siblings().stop().animate({
opacity: 0
}, function() {
$(this).hide();
});
},
_autoplay: function() {
var that = this;
... ... @@ -2749,9 +2759,8 @@ if (homePage === 'boys') {
$('.slide-container').slider({
pagination: '.thumb-pagination'
});
} else if (homePage === 'girls') {
$('.center-col').slider();
} else {
$('.center-col').slider();
$('.slide-container').slider();
}
... ... @@ -3738,7 +3747,7 @@ InfiniteLoad.prototype.stop = function() {
InfiniteLoad.prototype.__directionCalculation = function() {
var p = this.options;
if (p.offset.height && p.offset.height() > 0 && $(window).scrollTop() + window.innerHeight >= p.offset.height()) {
if (p.offset.height && p.offset.height() > 0 && $(window).scrollTop() + $(window).height() >= p.offset.height()) {
return true;
}
return false;
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -195,6 +195,6 @@ gulp.task('business', ['libs'], function() {
//页面需要直接标签引用的JS
gulp.task('script', function() {
gulp.src('plugin/page-use/*')
gulp.src('plugin/page/**/*')
.pipe(gulp.dest(rootDist));
});
\ No newline at end of file
... ...
... ... @@ -4,5 +4,6 @@ require('./js/common');
require('./js/product/entry');
require('./js/home/entry');
require('./js/passport/entry');
module.exports = webYohobuy;
... ...
... ... @@ -83,7 +83,7 @@ InfiniteLoad.prototype.stop = function() {
InfiniteLoad.prototype.__directionCalculation = function() {
var p = this.options;
if (p.offset.height && p.offset.height() > 0 && $(window).scrollTop() + window.innerHeight >= p.offset.height()) {
if (p.offset.height && p.offset.height() > 0 && $(window).scrollTop() + $(window).height() >= p.offset.height()) {
return true;
}
return false;
... ...
... ... @@ -21,6 +21,10 @@ var $ = require('yoho.jquery'),
Slider.prototype = {
init: function() {
if (!this.$element) {
return;
}
if (this.len <= 1) {
lazyLoad(this.$element.find('img.lazy'));
return;
... ... @@ -126,7 +130,13 @@ var $ = require('yoho.jquery'),
this.smallItem.eq(this.index).addClass('focus').siblings().removeClass('focus');
this.bigItem.eq(this.index).fadeIn().siblings().fadeOut();
this.bigItem.eq(this.index).show().stop().animate({
opacity: 1
}).siblings().stop().animate({
opacity: 0
}, function() {
$(this).hide();
});
},
_autoplay: function() {
var that = this;
... ...
... ... @@ -41,9 +41,8 @@ if (homePage === 'boys') {
$('.slide-container').slider({
pagination: '.thumb-pagination'
});
} else if (homePage === 'girls') {
$('.center-col').slider();
} else {
$('.center-col').slider();
$('.slide-container').slider();
}
... ...
/*
* 密码中心打包入口文件
*/
require('./reg');
require('./back');
require('./login');
require('./reset');
\ No newline at end of file
... ...
... ... @@ -97,8 +97,8 @@ function phoneAjaxFn(callback) {
validateResult[0].message = '';
validateResult[0].status = true;
break;
case 404:
validateResult[0].message = '改账号已经存在';
case 400:
validateResult[0].message = data.message;
validateResult[0].status = false;
break;
}
... ... @@ -464,7 +464,48 @@ $registerBtn.click(function() {
if ($(this).hasClass('disable')) {
return;
} else {
('#register-form').submit();
//ajax提交
$.ajax({
type: 'POST',
url: '/passport/register/mobileregister',
data: {
area: $region.text().split('+')[1],
mobile: $pn.val(),
captcha: $ca.val(),
code: $mc.val(),
password: $pwd.val()
}
}).then(function(data) {
var time = 0,
t,
refer = data.href;
t = setTimeout(function() {
time++;
}, 1000);
$.ajax({
type: 'POST',
url: '/passport/register/mobileregister',
data: {
session: data.session
}
}).then(function(data) {
if (data.code === 200 && t < 3) {
clearInterval(t);
location.href = refer;
}
});
if (t >= 3) {
clearInterval(t);
location.href = refer;
}
});
}
});
... ...
<!-- Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Respond JS Proxy</title>
</head>
<body>
<script>
(function () {
var domain, css, query, getQueryString, ajax, xmlHttp;
/*
http://stackoverflow.com/questions/4963673/get-url-array-variables-in-javascript-jquery/4963817#4963817
*/
getQueryString = function() {
var ret = {}, parts, i, p;
parts = (document.location.toString().split("?")[1]).split("&");
for (i = 0; i < parts.length; i++) {
p = parts[i].split("=");
// so strings will be correctly parsed:
p[1] = decodeURIComponent(p[1].replace(/\+/g, " "));
if (p[0].search(/\[\]/) >= 0) { // then it"s an array
p[0] = p[0].replace("[]", "");
if (typeof ret[p[0]] != "object") {
ret[p[0]] = [];
}
ret[p[0]].push(p[1]);
} else {
ret[p[0]] = p[1];
}
}
return ret;
};
ajax = function( url, callback ) {
var req = xmlHttp();
if (!req){
return;
}
req.open( "GET", url, true );
req.onreadystatechange = function () {
if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
return;
}
callback( req.responseText );
};
if ( req.readyState == 4 ){
return;
}
req.send();
};
//define ajax obj
xmlHttp = (function() {
var xmlhttpmethod = false,
attempts = [
function(){ return new XMLHttpRequest(); },
function(){ return new ActiveXObject("Microsoft.XMLHTTP"); },
function(){ return new ActiveXObject("MSXML2.XMLHTTP.3.0"); }
],
al = attempts.length;
while( al-- ){
try {
xmlhttpmethod = attempts[ al ]();
}
catch(e) {
continue;
}
break;
}
return function(){
return xmlhttpmethod;
};
})();
query = getQueryString();
css = query["css"];
domain = query["url"];
if (css && domain) {
ajax(css, function (response) {
window.name = response;
window.location.href = domain;
});
}
}());
</script>
</body>
</html>
\ No newline at end of file
... ...
/*! Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
(function(win, doc, undefined){
var docElem = doc.documentElement,
proxyURL = doc.getElementById("respond-proxy").href,
redirectURL = (doc.getElementById("respond-redirect") || location).href,
baseElem = doc.getElementsByTagName("base")[0],
urls = [],
refNode;
function encode(url){
return win.encodeURIComponent(url);
}
function fakejax( url, callback ){
var iframe,
AXO;
// All hail Google http://j.mp/iKMI19
// Behold, an iframe proxy without annoying clicky noises.
if ( "ActiveXObject" in win ) {
AXO = new ActiveXObject( "htmlfile" );
AXO.open();
AXO.write( '<iframe id="x"></iframe>' );
AXO.close();
iframe = AXO.getElementById( "x" );
} else {
iframe = doc.createElement( "iframe" );
iframe.style.cssText = "position:absolute;top:-99em";
docElem.insertBefore(iframe, docElem.firstElementChild || docElem.firstChild );
}
iframe.src = checkBaseURL(proxyURL) + "?url=" + encode(redirectURL) + "&css=" + encode(checkBaseURL(url));
function checkFrameName() {
var cssText;
try {
cssText = iframe.contentWindow.name;
}
catch (e) { }
if (cssText) {
// We've got what we need. Stop the iframe from loading further content.
iframe.src = "about:blank";
iframe.parentNode.removeChild(iframe);
iframe = null;
// Per http://j.mp/kn9EPh, not taking any chances. Flushing the ActiveXObject
if (AXO) {
AXO = null;
if (win.CollectGarbage) {
win.CollectGarbage();
}
}
callback(cssText);
}
else{
win.setTimeout(checkFrameName, 100);
}
}
win.setTimeout(checkFrameName, 500);
}
// http://stackoverflow.com/a/472729
function checkBaseURL(href) {
var el = document.createElement('div'),
escapedURL = href.split('&').join('&amp;').
split('<').join('&lt;').
split('"').join('&quot;');
el.innerHTML = '<a href="' + escapedURL + '">x</a>';
return el.firstChild.href;
}
function checkRedirectURL() {
// IE6 & IE7 don't build out absolute urls in <link /> attributes.
// So respond.proxy.gif remains relative instead of http://example.com/respond.proxy.gif.
// This trickery resolves that issue.
if (~ !redirectURL.indexOf(location.host)) {
var fakeLink = doc.createElement("div");
fakeLink.innerHTML = '<a href="' + redirectURL + '"></a>';
docElem.insertBefore(fakeLink, docElem.firstElementChild || docElem.firstChild );
// Grab the parsed URL from that dummy object
redirectURL = fakeLink.firstChild.href;
// Clean up
fakeLink.parentNode.removeChild(fakeLink);
fakeLink = null;
}
}
function buildUrls(){
var links = doc.getElementsByTagName( "link" );
for( var i = 0, linkl = links.length; i < linkl; i++ ){
var thislink = links[i],
href = links[i].href,
extreg = (/^([a-zA-Z:]*\/\/(www\.)?)/).test( href ),
ext = (baseElem && !extreg) || extreg;
//make sure it's an external stylesheet
if( thislink.rel.indexOf( "stylesheet" ) >= 0 && ext ){
(function( link ){
fakejax( href, function( css ){
link.styleSheet.rawCssText = css;
respond.update();
} );
})( thislink );
}
}
}
if( !respond.mediaQueriesSupported ){
checkRedirectURL();
buildUrls();
}
})( window, document );
... ...
... ... @@ -172,6 +172,20 @@ $tip: sprite-map("passport/tip/*.png", $spacing: 10px);
margin-right: 5px;
}
}
/*完善信息提示框*/
.page-tip {
display: block;
width: 100%;
height: 30px;
line-height: 30px;
text-align: center;
font-size: 20px;
font-weight: bold;
color: #ccc;
clear: both;
margin-bottom: 15px;
}
}
.passport-cover {
... ...
... ... @@ -86,7 +86,7 @@ $third: sprite-map("passport/third/*.png");
a {
display: table-cell;
width: 54px;
width: 45px;
background-size: 100% 100%;
}
... ... @@ -97,6 +97,10 @@ $third: sprite-map("passport/third/*.png");
margin: 0 auto;
}
.weixin {
background: sprite($third, weixin) no-repeat;
}
.qq {
background: sprite($third, qq) no-repeat;
}
... ... @@ -117,4 +121,4 @@ $third: sprite-map("passport/third/*.png");
background: sprite($third, renren) no-repeat;
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -11,7 +11,7 @@
color: #b9b9b9;
}
.register-form {
.register-page {
height: auto;
li {
... ... @@ -200,6 +200,15 @@
text-align: right;
white-space: nowrap;
}
&.skip-user-info {
font-size: 18px;
text-align: center;
a {
color: #ff1901;
text-decoration: underline;
}
}
}
.err-tip {
... ...
... ... @@ -20,6 +20,10 @@
.attr-content {
margin-left: 90px;
.default {
padding-right: 140px;
}
}
.multi-select {
... ...
... ... @@ -261,9 +261,12 @@ class HomeController extends AbstractAction
$this->setNavHeader('YOHO币', true, false);
$currency = UserModel::getYohoCoinData($this->_uid);
// banenr数据
$currency['banner'] = UserModel::getYohoCoinBanner();
$currency['pageFooter'] = true;
$currency['currencyPage'] = true;
$this->_view->display('currency', $currency);
$this->_view->display('currency-new', $currency);
}
/**
... ...
... ... @@ -8,7 +8,7 @@ use Plugin\Helpers;
/**
* 品牌相关的模板数据模型
*
*
* @name BrandModel
* @package Models/Category
* @copyright yoho.inc
... ... @@ -29,7 +29,7 @@ class BrandModel
/**
* 根据频道获取品牌一览数据
*
*
* @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
* @return array
*/
... ... @@ -38,6 +38,24 @@ class BrandModel
$result = array();
$brand = array();
// 设置品牌一览顶部频道导航
$channels = array(
array(
'name' => 'Boy'
),
array(
'name' => 'Girl'
),
array(
'name' => 'Kid'
),
array(
'name' => 'Lifestyle'
)
);
$channels[$channel-1]['active'] = true;
$result['channels'] = $channels;
/* 根据频道调用接口 */
switch (intval($channel)) {
case 1: // 男生
... ... @@ -91,7 +109,7 @@ class BrandModel
/**
* 获取搜索的品牌列表
*
*
* @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
* @return array
*/
... ...
... ... @@ -3,6 +3,7 @@
namespace Index;
use Configs\CacheConfig;
use LibModels\Wap\Home\IndexData;
use LibModels\Wap\Home\UserData;
use Plugin\Cache;
use Plugin\Helpers;
... ... @@ -18,6 +19,7 @@ use Plugin\Images;
*/
class UserModel
{
const CODE_YOHOCOIN_BANNER = '05afedf76886d732573f10f7451a1703';
/**
* 处理用户个人详情数据
... ... @@ -358,14 +360,58 @@ class UserModel
*/
public static function getYohoCoinData($uid)
{
$result = array();
$result = array(
'yohoCoin' => array(
'coinNum' => 0
)
);
// 调用接口获取YOHO币
$yohoCoin = UserData::yohoCoinTotal($uid);
// 处理YOHO币数据
if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) {
$result['yohoCoin']['coinNum'] = $yohoCoin['data']['total'];
$result['yohoCoin']['coinNum'] = $yohoCoin['data']['yohocoin_num'];
$result['yohoCoin']['notice'] = $yohoCoin['data']['notice'];
}
return $result;
}
public static function getYohoCoinBanner()
{
$result = false;
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_CODE_YOHOCOIN_BANNER, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口获取数据
$banner = IndexData::getBannerStart(self::CODE_YOHOCOIN_BANNER);
if (isset($banner['code']) && $banner['code'] == 200 && !empty($banner['data'])) {
$result = array();
// 处理数据
foreach ($banner['data'] as $val) {
foreach ($val['data'] as $single) {
$result['url'] = '';
$result['img'] = Helpers::getImageUrl($single['src'], 640, 200);
}
}
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_CODE_YOHOCOIN_BANNER, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_CODE_YOHOCOIN_BANNER, $result);
}
}
return $result;
... ...
... ... @@ -549,24 +549,31 @@ class DetailModel
/**
* 获取咨询列表
*
*
* @param int $uid 用户ID
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public static function getConsults($productId, $pageNum = 1, $pageSize = 300)
public static function getConsults($uid, $productId, $pageNum = 1, $pageSize = 300)
{
$result = array();
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$consultList = DetailData::consultList($productId, $pageNum, $pageSize);
if (!empty($consultList)) {
$consultList = DetailData::consultList($uid, $productId, $pageNum, $pageSize);
if (isset($consultList['code']) && $consultList['code'] === 200) {
$consultList = $consultList['data']['list'];
$build = array();
foreach ($consultList as $value) {
$build['question'] = $value['ask'];
$build['time'] = $value['askTime'];
$build['time'] = $value['ask_time'];
$build['answer'] = $value['answer'];
$build['id'] = $value['id'];
$build['isLike'] = $value['is_like'] === 'Y';
$build['like'] = $value['like'];
$build['isUseful'] = $value['is_useful'] === 'Y';
$build['useful'] = $value['useful'];
$result[] = $build;
}
}
... ... @@ -577,6 +584,70 @@ class DetailModel
}
/**
* 咨询点赞
*
* @param int $uid 用户ID
* @param int $id 咨询ID
* @param int $productId 商品ID
* @return array
*/
public static function upvoteConsult($uid, $id, $productId)
{
$result = array('code' => 400, 'message' => '出错啦~');
do {
$record = DetailData::upvoteConsult($uid, $id);
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
$result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consultform', array('product_id' => $productId))));
break;
}
// 处理数据
if ($record && isset($record['code'])) {
$result['code'] = $record['code'];
$result['message'] = $record['message'];
}
}while(false);
return $result;
}
/**
* 咨询有用
*
* @param int $uid 用户ID
* @param int $id 咨询ID
* @param int $productId 商品ID
* @return array
*/
public static function usefulConsult($uid, $id, $productId)
{
$result = array('code' => 400, 'message' => '出错啦~');
do {
$record = DetailData::usefulConsult($uid, $id);
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
$result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consultform', array('product_id' => $productId))));
break;
}
// 处理数据
if ($record && isset($record['code'])) {
$result['code'] = $record['code'];
$result['message'] = $record['message'];
}
}while(false);
return $result;
}
/**
* 获取为你优选的商品
*
* @param int $productSkn 商品SKN
... ...
... ... @@ -225,7 +225,8 @@ class BindController extends AbstractAction
$areaCode = $this->post('areaCode', '86');
$sourceType = $this->post('sourceType');
// $nickname = $this->post('nickname');//nickname不同步信息
$password = !empty($this->post('password')) ? $this->post('password') : '';
$password = $this->post('password');
$password = empty($password) ? '' : $password;
if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) {
break;
... ...
... ... @@ -12,7 +12,7 @@ class DetailController extends AbstractAction
/**
* 商品详情
*
*
* @param int productId
* @param int goodsId
*/
... ... @@ -50,7 +50,7 @@ class DetailController extends AbstractAction
/**
* 商品详情 (SKN)
*
*
* @param int productSkn
*/
public function showAction()
... ... @@ -100,7 +100,7 @@ class DetailController extends AbstractAction
/**
* 购买评价列表
*
*
* @param int productId
* @param int total
*/
... ... @@ -132,7 +132,7 @@ class DetailController extends AbstractAction
/**
* 购买咨询列表
*
*
* @param int productId
* @param int total
*/
... ... @@ -150,12 +150,15 @@ class DetailController extends AbstractAction
}
$this->setTitle('购买咨询');
$uid = $this->getUid();
$consults = \Product\DetailModel::getConsults($uid, $productId);
$data = array(
'goodsConsultsPage' => true,
'pageFooter' => true,
'consults' => array(
'list' => \Product\DetailModel::getConsults($productId),
'list' => $consults
),
'showReadMore' => count($consults) > 2,
'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)),
);
... ... @@ -163,6 +166,40 @@ class DetailController extends AbstractAction
$this->_view->display('consults', $data);
}
/*
* 咨询点赞
*/
public function consultupvoteAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->get('product_id', 0);
$uid = $this->getUid();
$id = $this->post('id');
$result = \Product\DetailModel::upvoteConsult($uid, $id, $productId);
}
$this->echoJson($result);
}
/*
* 咨询有用
*/
public function consultusefulAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->get('product_id', 0);
$uid = $this->getUid();
$id = $this->post('id');
$result = \Product\DetailModel::usefulConsult($uid, $id, $productId);
}
$this->echoJson($result);
}
/**
* 我要咨询表单
*/
... ... @@ -188,7 +225,7 @@ class DetailController extends AbstractAction
/**
* 添加咨询操作
*
*
* @param int product_id 商品ID
* @param string content 咨询内容
* @return json
... ... @@ -209,7 +246,7 @@ class DetailController extends AbstractAction
/**
* 为你优选
*
*
* @param int productSkn 商品SKN号
* @return json
*/
... ...
... ... @@ -80,9 +80,9 @@ class CommonController extends WebAction
public function getbannerAction()
{
$url = 'http://service.api.yohobuy.com/operations/api/v4/resource/get?';
$content_code = $this->_get('content_code', '');
$client_type = $this->_get('client_type', 'web');
$callback = $this->_get('callback', '');
$content_code = $this->get('content_code', '');
$client_type = $this->get('client_type', 'web');
$callback = $this->get('callback', '');
$params = array(
'content_code' => $content_code,
'client_type' => $client_type
... ...
... ... @@ -74,7 +74,7 @@ class HomeModel
'index_main' => 0,
'is_hot' => $val['is_hot'] == 'Y' ? true : false,
'is_new' => $val['is_new'] == 'Y' ? true : false,
'subnav' => array()
// 'subnav' => array()
);
foreach ($val['sub'] as $sub) { // 二级
$index_sub = 0;
... ... @@ -84,7 +84,7 @@ class HomeModel
'link' => $sub['sort_url'],
'is_hot' => $sub['is_hot'] == 'Y' ? true : false,
'is_new' => $sub['is_new'] == 'Y' ? true : false,
'thirdnav' => array(),
// 'thirdnav' => array(),
'index_sub' => $index_sub ++
);
if (isset($sub['sub'])) {
... ... @@ -93,7 +93,7 @@ class HomeModel
'title' => $thirdsub['sort_name'],
'name_en' => $thirdsub['sort_name_en'],
'link' => $thirdsub['sort_url'],
'branditems' => array()
// 'branditems' => array()
);
if (isset($thirdsub['sub'])) {
foreach ($thirdsub['sub'] as $fourthnav) { // 四级
... ... @@ -107,6 +107,7 @@ class HomeModel
$subnav['thirdnav'][] = $thirdnav;
}
}
$item['subnav'][] = $subnav;
}
$menu[] = $item;
... ... @@ -235,6 +236,16 @@ class HomeModel
if ($val['price'] == false) {
$val['price'] = $val['salePrice'];
}
//TODO 字段要调整
$val['isFew'] = $val['is_soon_sold_out'];
$val['tags']['isLimit'] = $val['tags']['is_limited'];
$val['tags']['isSale'] = false;//$val['tags']['is_discount'];暂时不显示
$val['tags']['isNew'] = false;//$val['tags']['is_new'];暂时不显示
$val['tags']['isYearMidPromotion'] = $val['tags']['midYear'];
$val['tags']['isYearEndPromotion'] = $val['tags']['yearEnd'];
$val['tags']['isReNew'] = false;//$val['tags']['is_advance'];暂时不显示
unset($val['tags']['is_advance'], $val['tags']['is_discount'], $val['tags']['is_limited'], $val['tags']['is_new'],
$val['tags']['is_yohood'], $val['tags']['midYear'], $val['tags']['yearEnd']);
if (! empty($val)) {
$result[] = $val;
}
... ...
... ... @@ -3,6 +3,7 @@ use Action\WebAction;
use LibModels\Web\Passport\RegData;
use Passport\PassportModel;
use Plugin\Helpers;
use LibModels\Wap\Passport\BackData;
class BackController extends WebAction
{
... ... @@ -37,12 +38,15 @@ class BackController extends WebAction
public function emailAction()
{
$phoneNum = $this->post('phoneNum','');
$area = $this->post('area','86');
$captcha = $this->post('captcha','');
if(Helpers::verifyEmail($phoneNum)){ //验证邮箱
$email = $phoneNum;
BackData::sendCodeToEmail($email);
$this->redirect('sendemail');
} else if(Helpers::verifyMobile($phoneNum)) {//验证手机号
$mobile = $phoneNum;
BackData::sendCodeToMobile($mobile);
$this->redirect('verification');
}
}
... ...
... ... @@ -61,6 +61,7 @@ class LoginController extends AbstractAction
'countryList' => RegData::getAreasData(),
'forgetPwd' => Helpers::url('/passport/back/index'),
'fastReg' => Helpers::url('/reg.html'),
'weixinLogin' => Helpers::url('/passport/autosign/weixin'),
'qqLogin' => Helpers::url('/passport/autosign/qq'),
'weiboLogin' => Helpers::url('/passport/autosign/sina'),
'alipayLogin' => Helpers::url('/passport/autosign/alipay'),
... ... @@ -74,7 +75,7 @@ class LoginController extends AbstractAction
/**
* 登录操作
*
*
* @param string areaCode 地区编号, 不需要+号
* @param string account 账号(邮箱或手机号)
* @param string password 密码
... ...
... ... @@ -20,17 +20,46 @@ class RegisterController extends WebAction
'actionUrl' => '/passport/register/mobileregister',
'region' => RegData::getAreasData(),
'location' => '+86',
'captchaUrl' => 'http://web.dev.yohobuy.com/passport/images?t=1449799445',
'captchaUrl' => '/passport/images?t=1449799445',
'itemUrl' => '##',
'referUrl' => $refer,
'loginUrl' => '/signin.html?refer='.$refer,
'coverHref' => $cover['url'],
'coverImg' => $cover['img']
'coverImg' => $cover['img'],
'regBtnText' => '快速登录'
)
);
$this->setCookie('refer', $refer);
$this->_view->display('index', $data);
}
/**
* 第三方登录
*/
public function thirdAction()
{
$refer = $this->get('refer', SITE_MAIN);
$cover = PassportModel::getLeftBanner(PassportModel::REGISTER_LEFT_BANNER_CODE);
$this->setSession('effective_time', time() + 1800);
$data = array(
'registerPage' => true,
'passport' => array(
'actionUrl' => '/passport/register/mobileregister',
'region' => RegData::getAreasData(),
'location' => '+86',
'captchaUrl' => '/passport/images?t=1449799445',
'itemUrl' => '##',
'referUrl' => $refer,
'skipUrl' => '/signin.html?refer='.$refer,
'coverHref' => $cover['url'],
'coverImg' => $cover['img'],
'regBtnText' => '完善信息'
)
);
$this->setCookie('refer', $refer);
$this->_view->display('third-register', $data);
}
/**
* 检测手机号
... ... @@ -59,7 +88,8 @@ class RegisterController extends WebAction
$data['message'] = '由于你IP受限无法注册';
break;
}
if(!empty(PassportModel::getUserInfoByMobile($area, $mobile))) {
$user = PassportModel::getUserInfoByMobile($area, $mobile);
if(!empty($user)) {
$data['message'] = '手机号码已经存在';
break;
}
... ... @@ -124,11 +154,11 @@ class RegisterController extends WebAction
*/
public function mobileregisterAction()
{
$mobile = trim($this->post('phoneNum'), ' ');//mobile
$area = intval(trim($this->post('region'), ' '));//area
$mobile = trim($this->post('mobile'), ' ');//mobile
$area = intval(trim($this->post('area'), ' '));//area
$verifyCode = strtolower(trim($this->post('captcha'),' '));//captcha
$code = trim($this->post('msgCaptcha'),'');//code
$password = $this->post('pwd');
$code = trim($this->post('code'),'');//code
$password = $this->post('password');
$url = '/passport/register/index';
$refer = $this->getCookie('refer');
$data = array('code' => 400, 'message' => '', 'data' => '');
... ...
... ... @@ -198,6 +198,10 @@ class Index1Controller extends AbstractAction
'name' => '240-329'
)
),
'customPrice' => array(
'min' => 1,
'max' => 99
),
'color' => array(
array(
'href' => '',
... ...