Authored by whb

Merge branch 'web' of http://git.dev.yoho.cn/web/yohobuy.git into web

Showing 69 changed files with 4576 additions and 105 deletions

Too many changes to show.

To preserve performance only 69 of 69+ files are displayed.

... ... @@ -61,6 +61,103 @@
]
}
## 站点头部
{
gobuytype: 'gobuyboys',//购物车样式
searchcate: 'searchcateboys', //搜索栏样式
navbars: [{//一级导航
name_cn: '男生',
name_en: 'BOYS',
link: '',
classname: 'boys',
index_main: 0,
subnav: [{
name: '新品到着',
link: '',
index_sub:0,
thirdnav: [
{
title: '上装',
branditems: [
{
brandname: '背心',
link: ''
},
{
brandname: 'T恤',
link: ''
},
{
brandname: '衬衫',
link: ''
},
{
brandname: 'POLO',
link: ''
},
{
brandname: '毛衣/针织',
link: ''
}]
}
]
}, {
name: '品牌一览',
link: '',
thirdnav: []
}]
}],
myyoho: {
email: 'caomei@163.com',
viptype: '普通会员',
currentscore: 495,
totalscore: 600,
cardtype: '银卡',
infolist: [{
name: '待处理的订单',
link: '',
num: '0'
}, {
name: '我的收藏',
link: '',
num: '1'
}, {
name: '我的优惠券',
link: '',
num: '2'
}, {
name: '我的YOHO币',
link: '',
num: '1'
}, {
name: '我的退货换货',
link: '',
num: '1'
}],
updlink: ''
},
gobuy: {
gobuynum: 3
},
breadcrumbnav: [{
notend: {
link: 'http://www.yohobuy.com',
name: 'BOYS首页'
}
}, {
notend: {
link: 'http://www.yohobuy.com',
name: '上衣'
}
}, {
isend: {
link: 'http://list.yohobuy.com/?msort=1&gender=1,3',
name: '衬衫'
}
}]
}
## 男首
{
... ... @@ -490,98 +587,256 @@
}
}
<<<<<<< HEAD
## 逛
### 【公用】资讯
=======
## Passport
### 【公用】左侧YohoFamily LOGO
{
coverHref: '', //跳转链接,需要有跳转就传,不需要就不传
coverImg: '' //图片地址
}
### 登录页
{
passport: {
coverHref: '', //跳转链接,需要有跳转就传,不需要就不传
coverImg: '' //图片地址
countryCode: '86', //无+
countryName: '中国',
countryList: [
{
code: '',
name: ''
},
...
]
}
}
## 站点头部
>>>>>>> 17d25992b3d621fa97bd9318bff69ee5dcbeff5a
{
gobuytype: 'gobuyboys',//购物车样式
searchcate: 'searchcateboys', //搜索栏样式
navbars: [{//一级导航
name_cn: '男生',
name_en: 'BOYS',
link: '',
classname: 'boys',
index_main: 0,
subnav: [{
name: '新品到着',
link: '',
index_sub:0,
thirdnav: [
{
title: '上装',
branditems: [
{
brandname: '背心',
link: ''
},
{
brandname: 'T恤',
link: ''
},
{
brandname: '衬衫',
link: ''
},
{
brandname: 'POLO',
link: ''
},
id: '',
classification: '最新',
isReco: true, //是否推荐
url: '',
isSquareImg: true, //是否是正方形图
img: '',
title: '',
editorUrl: '',
author: '',
pTime: '',
pView: '',
content: '',
tags: [
{
url: '',
tag: ''
},
...
],
liked: true,
like: 10,
comment: 10
}
### 【共用】右侧栏
{
exRecos: [
{
url: '',
img: '',
title: ''
},
..
],
hotTags: [
{
url: '',
tagName: ''
},
...
],
ads: [
{
url: '',
img: ''
},
...
]
}
### 首页
{
guang: {
slider: [
{
url: '',
img: ''
},
...
],
msgTypes: [
{
typeId: '',
isActive: true,
navUrl: '',
type: '最新'
},
...
],
msgs: [
{
...//资讯
}
],
msgPager: ''//HTML
}
}
### 列表页
{
guang: {
tag: '户外', //XX关联的文章
msgs: [
{
..//资讯
},
...
],
msgPager: ''
}
}
### 编辑页
{
guang: {
editor: {
avatar: '',
name: '',
intro: ''
},
msgs: [],
msgPager: ''
}
}
### 逛详情页
{
guang:{
id: 1, //详情页id
header: {
title: '', //大标题
avatar: '', //作者头像
name: '' , //作者名字
authorUrl: '', //作者主页url
intro: '', //作者简介
time: '', //时间
click: '', //点击数
commentNum: '' //评论数
},
content: [
{
pic: '' //内容大图
},
{
text: '' //内容文字
},
{
smallPic: [ //内容两张并列小图
'http://img02.static.yohobuy.com/cms/2015/06/26/12/027eb72bc880b4fe1aad361296c871c2ea.jpg',
'http://img02.static.yohobuy.com/cms/2015/06/26/12/027eb72bc880b4fe1aad361296c871c2ea.jpg'
]
},
{
relatedReco: { //相关推荐
recos: [
{
brandname: '毛衣/针织',
link: ''
}]
..//通用商品信息
}
...
],
moreReco: '', //标题是否有more,有传url,没有不传
}
]
}, {
name: '品牌一览',
link: '',
thirdnav: []
}]
}],
myyoho: {
email: 'caomei@163.com',
viptype: '普通会员',
currentscore: 495,
totalscore: 600,
cardtype: '银卡',
infolist: [{
name: '待处理的订单',
link: '',
num: '0'
}, {
name: '我的收藏',
link: '',
num: '1'
}, {
name: '我的优惠券',
link: '',
num: '2'
}, {
name: '我的YOHO币',
link: '',
num: '1'
}, {
name: '我的退货换货',
link: '',
num: '1'
}],
updlink: ''
},
gobuy: {
gobuynum: 3
},
breadcrumbnav: [{
notend: {
link: 'http://www.yohobuy.com',
name: 'BOYS首页'
}
}, {
notend: {
link: 'http://www.yohobuy.com',
name: '上衣'
}
}, {
isend: {
link: 'http://list.yohobuy.com/?msort=1&amp;gender=1,3',
name: '衬衫'
}
],
brands: [ //相关品牌
{
'thumb' => '', //品牌图片
'name' => '004', //品牌名称
'url' => '' //品牌url
}
...
],
userInfo: { //用户点赞收藏
isLike: true, //当前用户是否点赞
likeNum: 84, //点赞次数
isCollected: true //当前用户是否收藏
},
tag: [ //内容标签
{
name: LEE, //标签内容
url: www.baidu.com //标签链接
}
...
],
relatedPost:[ //相关文章
{
url => '', //链接
thumb => '', //图片
title => '' //标题
}
...
],
commentInfo: '', //初始内容,用于登陆页跳转回来后的内容不丢失
comment: {
commentNum: 4, //如果没有评论,数字为0,list和commentPager可以不传
list: [ //评论列表
{
avatar: '', //评论用户头像
name: '', //用户名字
content: '', //评论内容
time: '' //发表时间
}
...
]
}
}]
}
}
## 注册页
{
registerPage: true, //用于加载js
passport: {
actionUrl: '/passport/register/mobileregister', //action
region: [
{
id: 86, //国家地区码
name: '中国',
selected: true
}
],
location: '+86', //默认在哪个地区
captchaUrl: 'http://www.yohobuy.com/passport/images?t=1449799445', //验证码请求地址
itemUrl' => '##', //服务条款地址
referUrl' => 'http://www.yohobuy.com/', //注册后跳转链接
loginUrl' => '/signin.html?refer=http://www.yohobuy.com/', //登录链接
coverHref' => '/passport', //右侧封面跳转链接
coverImg' => '##', //右侧封面地址
}
}
\ No newline at end of file
... ...
{{> layout/header}}
{{# guang}}
<div class="guang-detail-page guang-page yoho-page clearfix" data-id="{{id}}">
<div class="left-side detail-body">
{{# header}}
<div class="detail-title">{{title}}</div>
<div class="article-info clearfix">
<div class="article-author">
<div class="author-avatar">
<img src="{{avatar}}" alt="">
</div>
</div>
<div class="author-info">
<a class="author-name" href="{{authorUrl}}">{{name}}</a>
</div>
<div class="article-status clearfix">
<span class="article-time">{{time}}</span>
<span class="article-click">点击:{{click}}</span>
<span id="article-comment" class="article-comment"><em class="comment-num">{{commentNum}}</em>条评论</span>
</div>
</div>
{{/ header}}
<div class="article-main">
{{# content}}
{{# pic}}
<div class="article-pic block">
<img class="lazy" data-original="{{.}}">
</div>
{{/ pic}}
{{# text}}
<div class="article-text block">
<p>{{.}}</p>
</div>
{{/ text}}
{{#if smallPic}}
<div class="article-small-pic block clearfix">
{{# smallPic}}
<img class="lazy" data-original="{{.}}">
{{/ smallPic}}
</div>
{{/if}}
{{# relatedReco}}
<div class="related-reco block clearfix">
<div class="block-header">
相关推荐
{{# moreReco}}
<a class="more-reco" href="{{.}}">MORE ></a>
{{/ moreReco}}
</div>
<div class="recos clearfix">
{{# recos}}
{{> product/good}}
{{/ recos}}
</div>
</div>
{{/ relatedReco}}
{{/ content}}
</div>
<div class="related-brand block clearfix">
<div class="block-header">相关品牌</div>
<div class="brands">
{{# brands}}
<div class="brand">
<a class="thumb" href="{{url}}">
<img class="lazy" data-original="{{thumb}}">
</a>
<p class="brand-name">{{name}}</p>
</div>
{{/ brands}}
</div>
</div>
{{# userInfo}}
<div class="user-handle">
<ul class="clearfix">
<li id="prise-btn" class="like-status{{#isLike}} liked{{/isLike}}">
<a href="javascript:;">
<i class="iconfont">&#xe626;</i>
<span class="like-num">{{likeNum}}</span>
</a>
</li>
<li id="collect-btn" class="sort-collect{{#isCollected}} collected{{/isCollected}}">
<a href="javascript:;">
<i class="iconfont">&#xe616;</i>
<span>收藏</span>
<span class="cancel-collect">取消收藏</span>
</a>
</li>
</ul>
</div>
{{/ userInfo}}
<div class="article-bottom-info clearfix">
{{#if tag}}
<div class="article-tag clearfix">
<i class="tag-icon iconfont">&#xe624;</i>
<ul class="clearfix">
{{# tag}}
<li>
<a href="{{url}}">{{name}}</a>
</li>
{{/ tag}}
</ul>
</div>
{{/if}}
<div class="article-share">
<span class="share-to">
分享至:
<a class="share-a share-sina" data-type="weibo" title="分享到新浪微博"></a>
<a class="share-a share-weixin" data-type="weixin" title="分享到微信朋友圈"></a>
<a class="share-a share-tencent" data-type="tqq" title="分享到腾讯微博"></a>
<a class="share-a share-qzone" data-type="qzone" title="分享到QQ空间"></a>
<a class="share-a share-qq" data-type="qq" title="分享到QQ好友"></a>
<a class="share-a share-renren" data-type="renren" title="分享到人人网"></a>
<a class="share-a share-douban" data-type="douban" title="分享到豆瓣"></a>
<div class="shareWeixin"></div>
</span>
<input id="share-img" type="hidden" value="{{sharedImg}}">
<input id="share-title" type="hidden" value="{{title}}">
<input id="weixin-url" type="hidden" value="{{weixinUrl}}">
</div>
</div>
{{#if relatedPost}}
<div class="detail-related-posts">
<ul class="clearfix">
{{# relatedPost}}
<li>
<a href="{{url}}">
<span class="bg-img">
<img src="{{thumb}}" alt="">
</span>
<div class="post-title">
<h2>{{title}}</h2>
</div>
</a>
</li>
{{/ relatedPost}}
</ul>
</div>
{{/if}}
<div id="comment-area" class="comment-area">
<div class="comment-textarea">
<textarea id="comment-info" placeholder="我有话要说。。。">{{commentInfo}}</textarea>
</div>
<div class="comment-publish clearfix">
<span id="word-count-tip" class="word-count-tip"></span>
<a id="comment-btn" class="publish-btn disable">评论</a>
</div>
<div id="pjax-container" class="comments-wrap">
{{# comment}}
<h4>
<span class="comment-num">{{commentNum}}</span>
条评论 <i></i>
</h4>
<p class="comments-empty">还没有评论,快抢沙发吧</p>
<div class="commnets-resultwrapper">
<ul class="comments-list">
{{# list}}
<li class="clearfix">
<div class="avatar">
<img class="comment-user-avatar" src="{{avatar}}" alt=""></div>
<div class="comment-info">
<p class="comment-user-name">{{name}}</p>
<p class="comment-content">{{content}}</p>
<p class="comment-time">{{time}}</p>
</div>
</li>
{{/ list}}
</ul>
<div class="comment-pager pager">{{{commentPager}}}</div>
</div>
{{/ comment}}
</div>
</div>
</div>
<div class="right-side detail-side">
{{> guang/right-side}}
</div>
</div>
{{/ guang}}
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="guang-editor-page guang-page yoho-page clearfix">
{{# guang}}
{{# editor}}
<div class="editor-info clearfix">
<div class="author-avatar">
<img src="{{avatar}}" alt="">
</div>
<div class="author-info">
<p class="author-name">{{name}}</p>
<p class="author-introduce">{{intro}}</p>
</div>
</div>
{{/ editor}}
<div class="left-side">
<div id="msg-list" class="msg-list">
{{# msgs}}
{{> guang/msg}}
{{/ msgs}}
</div>
<div class="msg-pager pager">
{{{msgPager}}}
</div>
</div>
<div class="right-side">
{{> guang/right-side}}
</div>
{{/ guang}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="guang-index-page guang-page yoho-page clearfix">
{{# guang}}
<div class="left-side">
<div id="slider" class="slider">
<ul class="slide-wrapper">
{{#each slider}}
<li>
<a href="{{url}}">
{{#if @first}}
<img src="{{img}}">
{{^}}
<img class="lazy" data-original="{{img}}">
{{/if}}
</a>
</li>
{{/each}}
</ul>
</div>
<div id="pjax-container" class="msg">
<ul class="msg-nav">
{{# msgTypes}}
<li data-type="{{typeId}}" {{#if isActive}}class="actived"{{/if}}>
<a class="pjax-link" href="{{navUrl}}">{{type}}</a>
</li>
{{/ msgTypes}}
</ul>
<div id="msg-list" class="msg-list">
{{# msgs}}
{{> guang/msg}}
{{/ msgs}}
</div>
<div class="msg-pager pager">
{{{msgPager}}}
</div>
</div>
</div>
<div class="right-side">
{{> guang/right-side}}
</div>
{{/ guang}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="guang-list-page guang-page yoho-page clearfix">
{{# guang}}
<div class="left-side">
<div class="tag-header">
<span>{{tag}}</span>
关联的文章
</div>
<div id="msg-list" class="msg-list">
{{# msgs}}
{{> guang/msg}}
{{/ msgs}}
</div>
<div class="msg-pager pager">
{{{msgPager}}}
</div>
</div>
<div class="right-side">
{{> guang/right-side}}
</div>
{{/ guang}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="back-page passport-page yoho-page clearfix">
{{# back}}
{{> passport/cover}}
<div class="content">
<div class="back-header clearfix">
<h2 class="title">找回密码</h2>
<span id="country-code" class="country-code">
<em>{{countryName}} +{{countryCode}}</em>
<i class="iconfont">&#xe61d;</i>
</span>
<ul id="country-code-list" class="country-code-list">
{{# countryList}}
<li data-cc="+{{code}}">{{name}} +{{code}}</li>
{{/ countryList}}
</ul>
</div>
<form id="back-form" class="back-form" action="">
<input id="country-code-hide" type="hidden" name="country-code" value="+86">
<ul>
<li class="input-container-li clearfix">
<input id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="邮箱/手机号码" autocomplete="off">
<ul id="tip-panel" class="tip-panel"></ul>
<span id="account-err" class="err-tip hide">
<i></i>
<em>账户名不能为空</em>
</span>
</li>
<li class="input-container-li clearfix">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="http://www.yohobuy.com/passport/images" alt="">
<a id="change-captcha" class="link change-captcha">换一张</a>
<span id="captcha-err" class="err-tip captcha-err hide">
<i></i>
<em>验证码不能为空</em>
</span>
</li>
<li class="input-container-li clearfix">
<input name="refer" id="refer" type="hidden" value="http%3A%2F%2Fwww.yohobuy.com%2F">
<input id="find-btn" class="btn find-btn disable" type="submit" value="下一步" disabled="">
</li>
</ul>
</form>
</div>
{{/ back}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="reset-pwd-page back-page passport-page yoho-page clearfix">
{{# resetPwd}}
{{> passport/cover}}
<div class="content">
<h2 class="title2">重置密码</h2>
<form id="reset-pwd-form" class="reset-pwd-form" method="POST" action="/passport/back/update">
<ul>
<li class="input-container-li po-re">
<input id="pwd" class="input va pwd" type="password" name="pwd" placeholder="新密码" maxlength="20">
<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="pwd-tips hide">
<div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div>
</div>
<span id="pwd-err" class="err-tip hide">
<i></i>
<em>请输入密码</em>
</span>
</li>
<li class="input-container-li clearfix po-re">
<input id="re-input" class="input va re-input repwd" type="password" name="re-input" placeholder="再次输入" maxlength="20">
<span id="repwd-err" class="err-tip hide">
<i></i>
<em>请输入密码确认</em>
</span>
</li>
<li class="input-container-li clearfix">
<input type="hidden" name="code" value="159bI6arxsuaPBxG2iV9OE9BrgDnAPiTecUqYh2iUC3ntt6S0eOtxXpVu+jWIlveXx9NRuwS9zdrXzcUyOd+d3ikzYBAo0k">
<input id="reset-pwd-btn" class="btn reset-pwd-btn" type="submit" value="提交" disabled="">
</li>
</ul>
</form>
</div>
{{/ resetPwd}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="reset-success-page back-page passport-page yoho-page clearfix">
{{# resetSuccess}}
{{> passport/cover}}
<div class="content">
<div class="success-text">
<i class="iconfont">&#xe620;</i><span>恭喜!</span>密码修改成功,&nbsp;<span id="count-down">5</span>&nbsp;&nbsp;秒后将跳转至首页
</div>
<a class="success-btn" href="/">随便逛逛</a>
</div>
{{/ resetSuccess}}
</div>
{{> layout/footer}}
... ...
{{> layout/simple-header}}
<div class="send-email-page passport-page yoho-page clearfix">
{{# sendEmail}}
{{> passport/cover}}
<div class="content">
<div class="send-tips"><i class="iconfont">&#xe61e;</i>我们已经把验证邮件发送至您的邮箱,请在24小时内通过邮件内的<br>链接继续设置新的密码。</div>
<div class="no-find">没有收到?到您邮箱的垃圾邮件里找找。</div>
<div class="to-my-email">
<a href="http://mail.qq.com" target="_blank" class="btn_b_ar_r">去我的邮箱&gt;</a>
</div>
</div>
{{/ sendEmail}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="verification-page back-page passport-page yoho-page clearfix">
{{# verification}}
{{> passport/cover}}
<div class="content">
<form id="verification-form" class="verification-form" method="POST" action="/passport/back/backmobile">
<ul>
<li class="head-title">验证身份</li>
<li class="po-re">
<label class="pn-label">手机号码</label>
<span class="country-code">+86</span>
<span class="phone-num">18115624066</span>
</li>
<li class="po-re">
<input id="captcha" class="input va captcha" type="text" name="captcha">
<input id="send-captcha" class="btn send-captcha" type="button" value="发送验证码" disabled="">
<div id="captcha-tip" class="captcha-tips"><i class="iconfont">&#xe61f;</i>验证码已发送至您的手机,请查收</div>
<span id="err-tip" class="err-tip hide">
<i></i>
<em>请输入验证码</em>
</span>
</li>
<li>
<input name="area" id="area" type="hidden" value="86">
<input name="mobile" id="mobile" type="hidden" value="18115624066">
<input name="captchaPic" id="captchaPic" type="hidden" value="g7ce">
<input name="refer" id="refer" type="hidden" value="">
<input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled="">
</li>
</ul>
</form>
</div>
{{/ verification}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="login-page passport-page yoho-page clearfix">
{{# passport}}
{{> passport/cover}}
<div class="content">
<form id="login-form" method="POST" action="/passport/index/login">
<ul class="login-ul">
<li class="relative clearfix">
<h2 class="title">会员登录</h2>
<span id="country-code" class="country-code right">
<em>{{countryName}} +{{countryCode}}</em>
<i class="iconfont">&#xe600;</i>
<ul id="country-list" class="country-list">
{{#each countryList}}
<li data-cc="{{code}}">{{name}} +{{code}}</li>
{{/each}}
</ul>
</span>
</li>
<li class="relative">
<input id="account" class="account input va" name="account" type="text" placeholder="邮箱/手机号码" autocomplete="off">
<ul id="email-autocomplete" class="email-autocomplete hide"></ul>
<span class="err-tip hide">
<i></i>
<em></em>
</span>
</li>
<li class="relative">
<input id="password" class="password input va" name="password" type="text" placeholder="密码" autocomplete="off" maxlength="20">
<span id="caps-lock" class="caps-lock hide">大写状态开启</span>
<span class="err-tip hide">
<i></i>
<em>请输入密码</em>
</span>
</li>
<li>
<span id="login-btn" class="login-btn btn">登录</span>
</li>
<li class="other-opts">
<span class="remeber-me">
<i class="iconfont">&#xe613;</i>
记住登录状态
</span>
<span class="right">
<a class="forget-password" href="{{forgetPwd}}">忘记密码?</a>
|
<a class="fast-reg" href="{{fastReg}}">快速注册</a>
</span>
</li>
<li class="third-party-login">
<a href="{{qqLogin}}">
<span class="icon qq"></span>
</a>
<a href="{{weiboLogin}}">
<span class="icon weibo"></span>
</a>
<a href="{{alipayLogin}}">
<span class="icon alipay"></span>
</a>
<a href="{{doubanLogin}}">
<span class="icon douban"></span>
</a>
<a href="{{renrenLogin}}">
<span class="icon renren"></span>
</a>
</li>
</ul>
<input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}">
</form>
</div>
{{/ passport}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="login-page 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>
</div>
{{/ passport}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
<div class="msg-content clearfix" data-id="{{id}}">
<div class="msg-img">
<div class="classification">
{{classification}}
</div>
{{#if isReco}}
<div class="reco"></div>
{{/if}}
<a href="{{url}}">
<img class="lazy{{#if isSquareImg}} square{{/if}}" data-original="{{img}}">
</a>
</div>
<div class="msg-info">
<a class="msg-title" href="{{url}}">{{title}}</a>
<p class="msg-app">
<a href="{{editorUrl}}">
<span class="author">{{author}}</span>
</a>
<span class="publish-time">
<i class="iconfont">&#xe625;</i>
{{pTime}}
</span>
<span class="page-view">
<i class="iconfont">&#xe627;</i>
{{pView}}
</span>
</p>
<p class="content">{{content}}</p>
<div class="footer">
<div class="tags">
{{# tags}}
<a class="msg-tag" href="{{url}}" target="_blank">{{tag}}</a>
{{/ tags}}
</div>
<div class="like-comment">
<span class="like">
<i class="iconfont like-icon{{#if liked}} liked{{/if}}">&#xe626;</i>
{{#if like}}<b class="like-num">(<em class="num">{{like}}</em>)</b>{{/if}}
</span>
<span class="comment">
<i class="iconfont">&#xe623;</i>
{{# comment}}
({{.}})
{{/ comment}}
</span>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="ex-reco">
<h1 class="ex-reco-title">精彩推荐</h1>
<div id="ex-reco-list" class="ex-reco-list">
{{# exRecos}}
<div class="ex-reco-item clearfix">
<a class="ex-reco-img" href="{{url}}" target="_blank">
<span class="bg-img" style="background-image:url({{img}})"></span>
</a>
<a href="{{url}}" target="_blank">
<p class="ex-reco-context">{{title}}</p>
</a>
</div>
{{/ exRecos}}
</div>
</div>
<div class="hot">
<h1 class="hot-title">热门标签</h1>
<div class="hot-tag-list">
{{#hotTags}}
<a class="hot-tag" href="{{url}}">
{{tagName}}
</a>
{{/hotTags}}
</div>
</div>
<div class="ads">
{{# ads}}
<a class="ad" href="{{url}}">
<img class="lazy" data-original="{{img}}">
</a>
{{/ ads}}
</div>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="renderer" content="webkit">
<link rel="shortcut icon" href="http://www.yohobuy.com/favicon.ico" type="image/x-icon" />
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<title>{{title}}</title>
<!-- [if (gte IE 6)&(lte IE 8)>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://webstatic.dev.yohobuy.com/css/index.css">
</head>
<body>
{{# simpleHeader}}
<div class="simple-header">
<div class="header-inner clearfix">
{{# logo}}
<h1 class="logo">
<a href="{{url}}">
<img src="{{img}}" alt="">
</a>
</h1>
{{/ logo}}
<ul class="header-tool clearfix">
{{# tool}}
<li {{#if options}}class="tool-options"{{/if}}{{#if loginUrl}}class="login-box"{{/if}}>
{{# tell}}
<i class="tell-icon iconfont">&#xe61c;</i>
{{/ tell}}
{{#if url}}
<a href="{{url}}">{{title}}</a>
{{/if}}
{{#unless url}}
<span>{{title}}</span>
{{/unless}}
{{#if options}}
<i class="options-icon down iconfont">&#xe604;</i>
<i class="options-icon up iconfont">&#xe603;</i>
<div class="tool-select">
{{# options}}
<a href="{{url}}">{{textCn}}</a>
{{/ options}}
</div>
{{/if}}
{{# loginInfo}}
<a href="{{url}}">{{textCn}}</a>
{{/ loginInfo}}
</li>
{{/ tool}}
</ul>
</div>
</div>
{{/ simpleHeader}}
\ No newline at end of file
... ...
... ... @@ -19,9 +19,65 @@
{{!-- 列表 --}}
{{#if productListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
});
</script>
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
});
</script>
{{/if}}
{{!-- 逛 --}}
{{#if guangIndexPage}}
<script>
seajs.use('js/guang/index');
</script>
{{/if}}
{{!-- 逛详情页 --}}
{{#if guangDetailPage}}
<script>
seajs.use('js/guang/detail');
</script>
{{/if}}
{{!-- 逛列表页 --}}
{{#if guangListPage}}
<script>
seajs.use('js/guang/list');
</script>
{{/if}}
{{!-- 登录注册找回密码--}}
{{#if loginPage}}
<script>
seajs.use('js/passport/login');
</script>
{{/if}}
{{!-- 注册页--}}
{{#if registerPage}}
<script>
seajs.use('js/passport/reg');
</script>
{{/if}}
{{!-- 找回密码--}}
{{#if backPage}}
<script>
seajs.use('js/passport/back');
</script>
{{/if}}
{{!-- 重置密码--}}
{{#if resetPage}}
<script>
seajs.use('js/passport/reset');
</script>
{{/if}}
{{!-- 验证手机 --}}
{{#if vertificationPage}}
<script>
seajs.use('js/passport/vertification');
</script>
{{/if}}
\ No newline at end of file
... ...
<div class="passport-cover">
<div class="cover-content">
{{#if coverHref}}
<a href="{{coverHref}}" target="_bank">
<img class="cover-img" src="{{coverImg}}">
</a>
{{^}}
<img class="cover-img" src="{{coverImg}}">
{{/if}}
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Thu Dec 10 11:10:57 2015
Created by FontForge 20120731 at Wed Dec 16 20:00:14 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Dec 10 11:10:57 2015
bbox="0 -214 1172.1 864"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E61B"
unicode-range="U+0078-E627"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -97,5 +97,42 @@ d="M903 493l-68 69l-388 -388l-231 230l-68 -68l299 -298l65 65z" />
<glyph glyph-name="uniE61B" unicode="&#xe61b;"
d="M505 253l2 -2q2 -1 4 -1l3 1l430 364q2 2 1 6l-2 2q-1 1 -3 1h-435h-424q-2 0 -3 -1l-2 -2l1 -6zM72 585q-3 2 -6 0l-3 -4v-584q0 -4 3.5 -5t5.5 1l288 346zM953 585h-5l-288 -246l287 -346q3 -2 6 -1t3 5v584q0 3 -3 4zM641 322l-131 -111l-5 5l-125 103l-275 -328
q-2 -3 -1 -6l2 -2q1 -1 3 -1h396h407q4 0 5 3t-1 6z" />
<glyph glyph-name="uniE61C" unicode="&#xe61c;"
d="M982 137l-4 6l-10 12q-12 13 -42 38q-12 10 -25.5 20.5t-27.5 21t-26 17.5l-48 31l-21 11q-5 2 -11.5 3t-13 0.5t-11.5 -2.5q-7 -2 -13.5 -7.5t-9.5 -10.5l-17 -25q-4 -6 -8 -13l-12 -24q-9 -18 -15 -28q-7 -14 -21 -24t-32 -13.5t-36 7.5q-102 57 -171 123
q-101 95 -135 172q-8 13 -1.5 37t26.5 34q12 6 25 11.5t23 9.5t18 9q7 4 14.5 8.5t18.5 11.5l2 1l4 4l2 1l3 3q19 18 9 43l-3 8q-1 4 -4 10t-12.5 24.5t-19.5 34.5q-8 14 -19.5 31t-21.5 31q-10 13 -20.5 24t-18.5 17.5t-14.5 11.5t-9.5 6l-4 2l-13 7q-9 4 -17.5 4.5t-16 -1
t-16.5 -4.5q-5 -2 -9.5 -4.5t-8.5 -4t-9 -4.5l-7 -4q-3 -2 -8 -6t-7 -5t-7.5 -5.5t-7 -5.5t-8 -6.5t-7.5 -5.5q-44 -37 -69.5 -82.5t-19.5 -86.5q10 -72 88 -198.5t182.5 -225.5t237.5 -173t209 -84q79 -10 169 73q16 15 31.5 34.5t24.5 38.5q6 14 7.5 30t-5.5 31v0z
M982 137z" />
<glyph glyph-name="uniE61D" unicode="&#xe61d;"
d="M888 620q8 8 18.5 10.5t20.5 0t18 -10.5q4 -4 6.5 -8.5t4 -9.5t1.5 -10.5t-1.5 -10t-4 -9.5t-6.5 -9l-406 -405q-12 -12 -28.5 -12t-27.5 12q-6 5 -9 12.5t-3 15.5t3 15t9 13zM539 214q3 -3 5 -6t3.5 -7t2 -7.5t0.5 -7.5t-0.5 -8t-2 -7.5t-3.5 -6.5t-5 -6
q-12 -12 -28.5 -12t-28.5 12l-406 405q-7 8 -10 18.5t0 20.5t10 18q6 6 13.5 9t15 3t15 -3t13.5 -9zM539 214z" />
<glyph glyph-name="uniE61E" unicode="&#xe61e;"
d="M127 769v-770h770v770h-770zM555 170h-86v86h86v-86zM555 298h-86v257h86v-257z" />
<glyph glyph-name="uniE61F" unicode="&#xe61f;"
d="M511.5 747q-72.5 0 -141 -22.5t-123.5 -64t-96 -96.5t-63.5 -123t-22.5 -141q0 -91 35 -173.5t95 -142.5t143 -95.5t173.5 -35.5t173.5 35.5t143 95.5t95 142.5t35 173.5q1 73 -22 141t-64 123t-96 96.5t-123.5 64t-141 22.5zM452 100h-1v0l-38 38l-179 180l38 37
l179 -179l318 318l38 -38zM512 -147q-91 0 -175 35q-80 34 -142 96t-96 142q-8 21 -15 42t-11 43t-6.5 44t-2.5 45q0 91 35 174q34 81 96 142.5t142 95.5q84 36 175 36q45 0 88.5 -9t85.5 -27q40 -16 75.5 -40.5t66.5 -54.5q20 -21 38 -44t32.5 -47.5t25.5 -51.5
q35 -83 35 -174t-35 -174q-34 -80 -96 -142t-142 -96q-14 -6 -28 -11t-28.5 -9t-29 -6.5t-29 -4.5t-29.5 -3t-30 -1zM511.5 747q-90.5 0 -173 -35.5t-142.5 -95.5t-95.5 -142.5t-35.5 -173.5t35.5 -173.5t95.5 -142.5t142.5 -95t173 -35t173.5 35t142.5 95t95 142.5
t35.5 173.5t-35.5 173.5t-95 142.5t-142.5 95.5t-173.5 35.5zM451 99l-38 39l-180 180l39 38l179 -180l318 318l39 -38zM414 138l37 -37l355 355l-37 37l-318 -318l-179 180l-38 -37z" />
<glyph glyph-name="uniE620" unicode="&#xe620;"
d="M958 662q0 30 -21 51.5t-51 21.5h-749q-30 0 -51 -21.5t-21 -51.5v-748q0 -30 21 -51t51 -21h749q30 0 51 21t21 51v748zM778 358l-267 -267q-14 -14 -34 -14q-9 0 -18 3.5t-16 10.5l-168 168q-14 14 -14 34t14 34q9 10 21.5 13t25 0t21.5 -13l134 -133l233 232
q9 10 21.5 13t25 0t21.5 -13q14 -14 14 -34t-14 -34z" />
<glyph glyph-name="uniE621" unicode="&#xe621;"
d="M384 556v-513l321 257z" />
<glyph glyph-name="uniE622" unicode="&#xe622;" horiz-adv-x="1000"
d="M662 566v-499l-299 250zM662 566z" />
<glyph glyph-name="uniE623" unicode="&#xe623;" horiz-adv-x="1000"
d="M744 502h-488q-25 0 -46 -12t-33 -33t-12 -46v-290q0 -38 26.5 -64.5t64.5 -26.5h227l200 -138v138h61q38 0 64.5 26.5t26.5 64.5v290q0 15 -4.5 29t-13 25t-19.5 19.5t-25 13t-29 4.5zM744 262z" />
<glyph glyph-name="uniE624" unicode="&#xe624;" horiz-adv-x="1025"
d="M1024 396v338q0 32 -23 55t-55 23h-331h-14q-55 0 -76 -21l-506 -506q-19 -19 -19 -46t19 -45l387 -387q18 -19 45 -19t46 19l506 506q10 10 15 25.5t5.5 26.5t0.5 31zM764 465q-36 0 -61.5 25.5t-25.5 61.5q0 17 7 33t18.5 28t27.5 18.5t34 6.5q36 0 61 -25t25 -61
t-25 -61.5t-61 -25.5z" />
<glyph glyph-name="uniE625" unicode="&#xe625;"
d="M511 748q-91 0 -173.5 -35.5t-142 -95t-95 -142t-35.5 -173.5q0 -61 16 -118.5t45 -106.5t70 -90t90 -70t106.5 -45t118.5 -16q91 0 173.5 35.5t142.5 95t95 142t35 173.5q0 185 -130.5 315.5t-315.5 130.5zM734 253h-237q-7 0 -14 3q-22 9 -22 33v237q0 10 5 18.5
t13 13.5t18 5q8 0 14.5 -3t11.5 -8t8 -11.5t3 -14.5v-200h200q10 0 18.5 -5t13.5 -13.5t5 -18.5t-5 -18t-13.5 -13t-18.5 -5zM734 253z" />
<glyph glyph-name="uniE626" unicode="&#xe626;" horiz-adv-x="1025"
d="M994 79q-18 9 -16 30.5t27 46.5q24 27 17.5 54.5t-33.5 40.5q-17 8 -24.5 17.5t-2 20t26.5 19.5q20 7 27 30.5t-1 52.5t-28 53q-17 19 -92 24.5t-142 1.5l-67 -4q3 2 3 145q0 69 -14 109t-37.5 53.5t-60.5 12.5q-18 0 -28.5 -5t-17 -13t-11 -26.5t-7.5 -38t-10 -56.5
t-16 -74q-12 -47 -38 -94t-54 -80t-55.5 -59t-44 -39t-17.5 -13v-386q8 -12 20 -21t25.5 -15.5t25 -11t23.5 -8.5t16 -6q9 -4 65 -10.5t105.5 -11t51.5 -4.5q4 0 11 0.5t30 2.5t45 4.5t52 6.5t56.5 8t53.5 9.5t47 11t33.5 13t15.5 14.5q5 17 4 30.5t-3.5 23t2.5 17.5t21 15
q14 5 23 14.5t12 20.5t3 23t-3.5 22t-8.5 18t-10 11zM0 295v-380q0 -28 20 -48.5t49 -20.5h137v518h-137q-29 0 -49 -20.5t-20 -48.5zM0 295z" />
<glyph glyph-name="uniE627" unicode="&#xe627;" horiz-adv-x="1025"
d="M512 623q-167 0 -304.5 -89.5t-205.5 -236.5q-4 -9 0 -18q45 -96 121 -169.5t177 -115t212 -41.5q167 0 304.5 89.5t205.5 236.5q1 3 1.5 6t0 6t-1.5 6q-68 147 -205.5 236.5t-304.5 89.5zM512 57q-96 0 -163.5 67.5t-67.5 163.5t67.5 163.5t163.5 67.5t163.5 -67.5
t67.5 -163.5q0 -47 -18.5 -89.5t-49.5 -73.5t-73.5 -49.5t-89.5 -18.5zM364 288q0 -61 43.5 -104.5t104.5 -43.5t104.5 43.5t43.5 104.5t-43.5 104.5t-104.5 43.5t-104.5 -43.5t-43.5 -104.5z" />
</font>
</defs></svg>
... ...
/*var $ = require('yoho.jquery');
module.exports = function(options) {
var openUrl = '';
var defOption = {
title: '',
url: window.location.href,
weixinUrl: '',
image: '',
desc: '',
channel: ''
};
var shareChannels = ['weibo', 'tqq', 'qzone', 'renren', 'qq', 'douban','weixin'];
var sharebox;
var shareCon = '<em><i></i></em>';
defOption = $.extend(defOption, options);
this.weibo = function() {
openUrl = 'http://service.weibo.com/share/share.php?url=' +
defOption.url + '&title=' + defOption.title +
'&appkey=3739328910&searchPic=true&pic=' + defOption.image;
};
this.tqq = function() {
openUrl = 'http://share.v.t.qq.com/index.php?c=share&a=index&url=' +
defOption.url + '&title=' + defOption.title +
'&appkey=c0af9c29e0900813028c2ccb42021792&pic=' + defOption.image;
};
this.qzone = function() {
openUrl = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' +
defOption.url + '&title=' + defOption.title +
'&desc=&summary=' + defOption.desc + '&site=YOHO!有货&pics=' + defOption.image;
};
this.renren = function() {
openUrl = 'http://widget.renren.com/dialog/share?resourceUrl=' +
defOption.url + '&srcUrl=' + defOption.url + '&desc=' + defOption.desc +
'&title=' + defOption.title + '&description=' +
defOption.desc + '&pic=' + defOption.image;
};
this.qq = function() {
openUrl = 'http://connect.qq.com/widget/shareqq/index.html?url=' +
defOption.url + '&desc=' + defOption.desc + '&title=' +
defOption.title.replace('%', '') + '&desc=&summary=' + defOption.desc +
'&site=YOHO!有货&pics=' + defOption.image;
};
this.weixin = function() {
openUrl = 'http://s.jiathis.com/qrcode.php?url=' +
defOption.weixinUrl + '&desc=' + defOption.desc + '&title=' + defOption.title +
'&description=' + defOption.desc + '&pic=' + defOption.image;
};
this.douban = function() {
openUrl = 'http://www.douban.com/share/service?href=' +
defOption.url + '&text=' + defOption.desc + '&image=' + defOption.image +
'&title=' + defOption.title + '&comment=';
};
if ($.inArray(defOption.channel, shareChannels) === -1) {
alert('不存在的分享平台!');
return false;
}
eval(defOption.channel + '();');
if (defOption.channel === 'weixin') {
if (defOption.self && defOption.self.closest('.share-to').find('.shareWeixin')) {
sharebox = defOption.self.closest('.share-to').find('.shareWeixin');
shareCon += '<div class="con"><h2>分享到微信朋友圈</h2><p class="pic">' +
'<img src="' + openUrl + '" /></p><p class="w">打开微信,点击底部得“发现”,使用<br/>“扫一扫“即可将网页分享到我的朋友圈。</p>' +
'<a href="javascript:void(0)" class="close">x</a></div>';
sharebox.find('div').length > 0 ? sharebox.show() : sharebox.html(shareCon).show();
sharebox.find('.close').click(function() {
$(this).closest('.shareWeixin').hide();
});
}
} else {
window.open(encodeURI(openUrl));
}
};*/
\ No newline at end of file
... ...
... ... @@ -26,10 +26,27 @@ var $ = require('yoho.jquery'),
} else {
this._createPage();
}
if (this.options.orient) {
this._createOrient();
}
this._slideShow();
this._bindEvent();
this._autoplay();
},
_createOrient: function() {
var orientHtml = '<div class="slide-switch">' +
'<a class="prev" href="javascript:;"><span class="iconfont">&#xe60c;</span></a>' +
'<a class="next" href="javascript:;"><span class="iconfont">&#xe60b;</span></a>' +
'</div>';
if (this.$element.find('.slide-switch').length > 0) {
return;
}
this.$element.append(orientHtml);
},
_createPage: function() {
var pageHtml = '<div class="slide-pagination"><div class="slide-pagination-inner">' +
'<div class="slide-shade"></div><div class="slide-pagination-last">',
... ... @@ -69,6 +86,12 @@ var $ = require('yoho.jquery'),
}).on('mouseleave', function() {
that._autoplay();
});
this.$element.on('mouseenter', function() {
$(this).find('.slide-switch').addClass('show');
}).on('mouseleave', function() {
$(this).find('.slide-switch').removeClass('show');
});
},
_nextSlide: function() {
if (this.index === this.len - 1) {
... ... @@ -89,12 +112,14 @@ var $ = require('yoho.jquery'),
_slideShow: function() {
var $img = this.bigItem.eq(this.index).find('img.lazy');
//未加载图片的及时显示
if ($img.attr('src') !== $img.data('original')) {
lazyLoad($img.trigger('appear'));
}
if (this.len > 1) {
this.$element.find('.slide-switch').addClass('show');
lazyLoad($img, {
event: 'sporty'
});
$img.trigger('sporty');
}
this.smallItem.eq(this.index).addClass('focus').siblings().removeClass('focus');
this.bigItem.eq(this.index).fadeIn().siblings().fadeOut();
},
... ... @@ -124,6 +149,7 @@ var $ = require('yoho.jquery'),
$.fn.slider.Constructor = Slider;
$.fn.slider.defaults = {
time: 5000,
orient: true, //左右切换箭头的显示
pagination: null
};
})($);
\ No newline at end of file
... ...
/**
* 逛详情页
* @author: liuyue<yue.liu@yoho.cn>
* @date: 2015/12/16
*/
var $ = require('yoho.jquery'),
lazyLoad = require('yoho.lazyload'),
$commentArea = $('#comment-area'),
articleId = $('#detail-container').data('id'),
yoShare = require('../common/share');
var $commentList = $commentArea.find('.comments-wrap'),
$commentNum = $('#article-comment > .comment-num'),
commenting = false, //评论请求尚未返回变量
locating = false, //评论页面正在跳转
$commentBtn = $('#comment-btn'),
MAX_COMMENTS_WORDS = 100,
$wordCountTip = $('#word-count-tip');
require('./right-side');
require('./img-blink');
//Pjax
require('yoho.pjax');
lazyLoad({
failure_limit: 50
});
//点击评论滑到评论区
$('#article-comment').click(function() {
$('html, body').animate({
scrollTop: $commentArea.offset().top
}, 800);
});
//文章点赞与取消点赞
$('#prise-btn').click(function() {
var prising = false,
url,
$this = $(this);
if (prising) {
return;
}
$this.toggleClass('liked');
if ($this.hasClass('liked')) {
//点赞
url = '/msg/prise';
} else {
//取消点赞
url = '/msg/cancelprise';
}
prising = true;
$.ajax({
type: 'GET',
url: url,
data: {
id: articleId
}
}).then(function(data) {
if (data.code === 200) {
$this.find('.like-num').html(data.data);
}
prising = false;
});
}).bind('mouseenter mouseleave', function() {
$(this).toggleClass('hover');
});
//文章收藏与取消收藏
$('#collect-btn').click(function() {
var collecting = false,
url,
col,
$this = $(this);
if (collecting) {
return;
}
if ($this.hasClass('collected')) {
//取消点赞
url = '/msg/cancelcollect';
col = 0;
} else {
//点赞
url = '/msg/collect';
col = 1;
}
collecting = true;
$.ajax({
type: 'GET',
url: url,
data: {
id: articleId
}
}).then(function(data) {
var hrefUrl;
switch (data.code) {
case 401:
//防止从已有col的页面再次进行跳转后出错的情况
if (/\?col=(1|0)/.test(location.href)) {
hrefUrl = location.href.replace(/\?col=(1|0)/, '?col=' + col);
} else {
hrefUrl = location.href + '?col=' + col;
}
location.href = 'http://www.yohobuy.com/signin.html?refer=' + encodeURI(hrefUrl);
break;
case 400:
alert(data.message);
break;
case 200:
if (/\?col=(1|0)/.test(location.href)) {
//如果页面url中含有col,为了防止页面刷新时收藏或者取消收藏会根据col来的问题,进行页面跳转拿掉参数
location.href = location.href.replace(/\?col=(1|0)/, '');
} else {
$this.toggleClass('collected');
}
break;
}
collecting = false;
});
}).bind('mouseenter mouseleave', function() {
$(this).toggleClass('hover');
});
//Share
function share(channel, self) {
var title = $('#share-title').val();
var desc = document.title.replace(/(^\s*)|(\s*$)/g, '');
var image = $('#share-img').val();
var weixinUrl = $('#weixin-url').val();
if (channel === 'weibo' || channel === 'tqq') {
yoShare({
channel: channel,
title: title,
image: image
});
} else {
yoShare({
channel: channel,
title: '【YOHO!有货】最快、最全、最权威的潮流品牌型录发布平台',
desc: desc,
image: image,
self: self,
weixinUrl: weixinUrl
});
}
}
$('.article-share').delegate('.share-a', 'click', function(e) {
var $el = $(this),
type = $el.data('type');
e.preventDefault();
if (type === 'weixin') {
share(type, $el);
} else {
share(type);
}
});
//评论
function comment(id) {
var commentInfo = $('#comment-info').val();
if (commentInfo === '') {
alert('评论不能为空');
return false;
}
commenting = true;
$.ajax({
url: '/msg/comment',
data: {
article_id: id,
comment: commentInfo
},
type: 'post',
success: function(data) {
switch (data.code) {
case 401:
locating = true;
location.href = 'http://www.yohobuy.com/signin.html?refer=' +
window.escape(location.href + '#comment-info');
break;
case 400:
alert(data.message);
break;
case 200:
if (data.data) {
$commentList.html(data.data.content);
$commentNum.html(data.data.count);
//clear comment-text
$('#comment-info').val('').keyup();
}
break;
}
commenting = false;
}
});
}
$commentBtn.click(function(e) {
//页面正在跳转或者正在AJAX请求时评论无效
if (locating || commenting) {
return false;
}
//字数不符合要求
if ($('#comment-info').val().length - MAX_COMMENTS_WORDS > 0) {
return;
}
e.preventDefault();
comment($('#detail-container').data('id'));
});
//comment pager pjax
$(document).pjax('.comment-pager a', '#pjax-container', {
timeout: 5000
});
//分页后移动到评论框的位置
$(document).on('pjax:end', function() {
$('html,body').scrollTop($('#comment-info').offset().top);
});
$(document).ready(function() {
var commonlist = $('.comments-list').find('li').length;
if (commonlist === 0) {
$('.commnets-resultwrapper').hide();
$('.comments-empty').show();
} else {
$('.commnets-resultwrapper').show();
$('.comments-empty').hide();
}
});
$('#comment-info').keyup(function() {
var len = $(this).val().length,
showTxt;
if (len === 0) {
$wordCountTip.html('');
$commentBtn.addClass('disable');
} else {
if (len - MAX_COMMENTS_WORDS <= 0) {
showTxt = '还可以输入' + (MAX_COMMENTS_WORDS - len) + '字';
$commentBtn.removeClass('disable');
} else {
showTxt = '已超过<span class="exceed-count">' + (len - MAX_COMMENTS_WORDS) + '</span>字';
$commentBtn.addClass('disable');
}
}
$wordCountTip.html(showTxt);
});
//init
$('#comment-info').trigger('keyup');
\ No newline at end of file
... ...
/**
* 图片移入闪动效果JS
* @auhor: xuqi<qi.xu@yoho.cn>
* @date: 2015/7/29
*/
var $ = require('yoho.jquery');
$('.guang-page').on('mouseover', 'a img, a .bg-img', function(e) {
var $el = $(e.target);
//slider中的图片不做此效果
if ($el.closest('.slider').length > 0) {
return;
}
$el.addClass('blink');
setTimeout(function() {
$el.removeClass('blink');
}, 100);
});
\ No newline at end of file
... ...
/**
* 逛首页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/15
*/
var $ = require('yoho.jquery');
var msg = require('./msg');
require('yoho.pjax');
require('../common/slider');
require('./img-blink');
require('./right-side');
$('#slider').slider(); //初始化slider
$(document).pjax('.pjax-link, .msg-pager a', '#pjax-container', {
timeout: 2000
});
$(document).on('pjax:end', function() {
msg.dotLazy();
});
\ No newline at end of file
... ...
/**
* 逛编辑页、列表页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/15
*/
require('./msg');
require('./img-blink');
require('./right-side');
\ No newline at end of file
... ...
var $ = require('yoho.jquery'),
lazyLoad = require('yoho.lazyload');
var prising;
require('yoho.dotdotdot');
//资讯文字截取和lazyload
function dotLazy() {
//文字截取
$('.msg-title, .msg-content .content').dotdotdot({
wrap: 'letter'
});
//Lazyload
lazyLoad($('#msg-list img.lazy'));
}
//资讯点赞
$('.guang-page').on('click', '.like-icon', function() {
var $this = $(this),
msgId = $this.closest('.msg-content').data('id'),
url;
//同一资讯多次点击归一处理
if (prising === msgId) {
return;
}
prising = msgId;
$this.toggleClass('liked');
//点赞或取消点赞
if ($this.hasClass('liked')) {
url = '/msg/prise';
} else {
url = '/msg/cancelprise';
}
$.ajax({
type: 'GET',
url: url,
data: {
id: msgId,
time: new Date().getTime()
}
}).then(function(data) {
if (data.code === 200) {
if (data.data * 1 === 0) {
$this.next('span').addClass('num-0').children('.num').html('0'); //隐藏数字显示
} else {
$this.next('span').removeClass('num-0').children('.num').html(data.data);
}
}
prising = false;
});
}).on('mouseenter mouseleave', '.like-icon', function() {
$(this).closest('.like').toggleClass('hover');
});
dotLazy();
exports.dotLazy = dotLazy;
\ No newline at end of file
... ...
/**
* 右侧栏文字截取js
*/
var $ = require('yoho.jquery'),
lazyLoad = require('yoho.lazyload');
require('yoho.dotdotdot');
$('.ex-reco-context').dotdotdot({
wrap: 'letter'
});
lazyLoad($('.ads img.lazy'));
\ No newline at end of file
... ...
/**
* 找回密码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('yoho.jquery'),
phoneRegx = require('./mail-phone-regx').phoneRegx;
var $cr = $('#country-code-hide'),
$phoneNum = $('#phone-num'),
$ca = $('#captcha'),
$tipPanel = $('#tip-panel'),
emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,
acAccount = [
['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'], //数字顺序
['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'] //组合顺序
],
$ccList = $('#country-code-list'),
$cc = $('#country-code'),
$btn = $('#find-btn'),
$accErr = $('#account-err'),
$caErr = $('#captcha-err'),
time, //timeout-id
caCount = 4, //验证码位数
hasPh = false,
hasCa = false;
require('../../plugin/jquery.placeholder');
/*function getSource(column, postition, event) {
try {
dataLayer.push({
louceng: column,
weizhi: postition,
event: event
});
} catch (e) {}
}*/
function imgcode() {
$('#captcha-img').attr('src', 'http://www.yohobuy.com/passport/images?t=' + Math.random());
//getSource('yoho_family_web', '换一张', 'homepage_man');
}
function enableBtn() {
if (hasPh && hasCa) {
$btn.removeClass('disable').prop('disabled', false);
} else {
$btn.addClass('disable').prop('disabled', true);
}
}
function vaPn(v) {
var pass = true,
errTxt = '';
v = $.trim(v);
if (v !== '') {
if (/^[0-9]+$/.test(v)) {
if (phoneRegx[$cr.val()].test(v)) {
pass = true;
} else {
errTxt = '手机号码格式不正确, 请重新输入';
pass = false;
}
} else {
if (emailReg.test(v)) {
pass = true;
} else {
errTxt = '邮箱格式不正确, 请重新输入';
pass = false;
}
}
} else {
errTxt = '账户名不能为空';
pass = false;
}
hasPh = pass;
return {
pass: pass,
errTxt: errTxt
};
}
function vaCa() {
var v = $.trim($ca.val());
if (v === '' || v.length < caCount) {
hasCa = false;
enableBtn();
return;
} else {
$.ajax({
type: 'POST',
url: '/passport/back/authcode',
data: {
code: v,
mobile: $('#phone-num').val(),
area: $('#country-code-hide').val()
}
}).then(function(data) {
if (data.code === 200) {
hasCa = true;
} else {
hasCa = false;
imgcode();
}
enableBtn();
});
}
}
$ca.attr('maxlength', caCount);
//IE8 placeholder
$('input').placeholder();
$('#change-captcha, #captcha-img').on('click', function() {
imgcode();
});
$cc.on('click', function(e) {
e.stopPropagation();
if ($ccList.css('style') === 'block') {
$ccList.slideUp('fast');
} else {
$ccList.slideDown('fast');
}
});
$ccList.delegate('li', 'click', function(e) {
var $cur = $(this),
code = $cur.data('cc'),
pnVa;
e.stopPropagation();
$cr.val(code);
$cc.find('em').html($cur.text());
//切换后验证手机号码
if ($.trim($phoneNum.val()) !== '') {
pnVa = vaPn($phoneNum.val());
enableBtn();
if (hasPh) {
$accErr.addClass('hide');
$phoneNum.removeClass('error');
} else {
$accErr.removeClass('hide').text(pnVa.errTxt);
$phoneNum.addClass('error');
}
}
$ccList.slideUp('fast');
});
$(document).click(function() {
if ($tipPanel.css('display') === 'block') {
$tipPanel.slideUp();
}
if ($ccList.css('display') === 'block') {
$ccList.slideUp();
}
});
$phoneNum.keyup(function() {
var account = $.trim($(this).val()),
html = '',
acs,
i;
//输入@时显示自动补全列表
if (account.indexOf('@') !== -1 && account.lastIndexOf('@') === account.indexOf('@')) {
if (/^[0-9]*@$/.test(account)) {
//数字顺序
acs = acAccount[0];
} else {
acs = acAccount[1];
}
for (i = 0; i < acs.length; i++) {
html += '<li>' + account.slice(0, account.indexOf('@')) + '@' + acs[i] + '</li>';
}
$tipPanel.html(html).slideDown();
} else {
$tipPanel.slideUp();
}
vaPn(account);
enableBtn();
}).blur(function() {
time = setTimeout(function() {
var pnVa = vaPn($phoneNum.val());
if (pnVa.pass) {
$accErr.addClass('hide');
$phoneNum.removeClass('error');
} else {
$accErr.removeClass('hide').find('em').text(pnVa.errTxt);
$phoneNum.addClass('error');
}
}, 170);
}).focus(function() {
$(this).removeClass('error');
//focus隐藏错误提示
$accErr.addClass('hide');
});
//验证码在鼠标移开后验证, keyup时不再验证
$ca.blur(function() {
var errTxt = $.trim($ca.val()) === '' ? '验证码不能为空' : '验证码不正确';
if (hasCa) {
$caErr.addClass('hide');
$ca.removeClass('error');
} else {
$caErr.removeClass('hide').find('em').text(errTxt);
$ca.addClass('error');
//验证码错误则刷新验证码
imgcode();
}
}).focus(function() {
$(this).removeClass('error');
//focus隐藏错误提示
$caErr.addClass('hide');
}).keyup(function() {
vaCa();
});
$tipPanel.delegate('li', 'click', function(e) {
var account = $(this).text(),
pnVa;
e.stopPropagation();
$phoneNum.val(account);
if (time) {
clearTimeout(time);
pnVa = vaPn(account);
enableBtn();
if (pnVa.pass) {
$accErr.addClass('hide');
$phoneNum.removeClass('error');
} else {
$accErr.removeClass('hide').find('em').text(pnVa.errTx);
$phoneNum.addClass('error');
}
time = null;
}
$tipPanel.slideUp();
});
$('#find-btn').click(function(e) {
//getSource('yoho_family_web', '下一步按钮', 'homepage_man');
if (/^[0-9]+$/.test($.trim($phoneNum.val()))) {
$('#find-form').attr('action', '/passport/back/mobile');
}
if ($(this).hasClass('disable')) {
return;
}
if (!hasCa || !hasPh) {
e.preventDefault();
return true;
}
});
\ No newline at end of file
... ...
/**
* 登录
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/11
*/
var $ = require('yoho.jquery');
var mailPostfix = {
num: ['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com', 'sohu.com', 'hotmail.com', '139.com', '189.com'],
other: ['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com', 'sohu.com', 'hotmail.com', '139.com', '189.com']
};
var $account = $('#account'),
$password = $('#password');
var $accountTip = $account.siblings('.err-tip'),
$passwordTip = $password.siblings('.err-tip'),
$capsLock = $('#caps-lock');
var $countryCodeHide = $('#country-code-hide'),
$countryCodeEm = $('#country-code > em'),
$countryList = $('#country-list');
var $emailAutoComplete = $('#email-autocomplete');
var mailPhoneRegx = require('./mail-phone-regx');
//checkbox status unicode
var checkbox = {
checked: '&#xe612;',
unchecked: '&#xe613;'
};
var emailAcTime;
require('yoho.placeholder');
//验证账户名
function validateAccount() {
var pass = false,
account = $.trim($account.val()),
err;
if (account !== '') {
if (/^[0-9]+$/.test(account)) {
//如果是纯数字,则作为手机号码处理
if (mailPhoneRegx.phoneRegx['+' + $countryCodeHide.val()].test(account)) {
pass = true;
} else {
pass = false;
err = '手机号码不正确,请重新输入';
}
} else {
if (mailPhoneRegx.emailRegx.test(account)) {
pass = true;
} else {
pass = false;
err = '邮箱格式不正确,请重新输入';
}
}
} else {
err = '请输入账户名';
}
if (pass) {
$accountTip.addClass('hide');
$account.removeClass('error');
} else {
$accountTip.removeClass('hide').children('em').text(err);
$account.addClass('error');
}
return pass;
}
//验证密码
function validatePassword() {
var pass = false,
password = $.trim($password.val()),
err;
if (password !== '') {
if (password.length < 6) {
err = '请输入长度为6-20字符的密码';
} else {
pass = true;
}
} else {
err = '请输入密码';
}
if (pass) {
$passwordTip.addClass('hide');
$password.removeClass('error');
} else {
$passwordTip.removeClass('hide').children('em').text(err);
$password.addClass('error');
}
}
//验证
function validate() {
var pass = true,
account = $.trim($account.val()),
password = $.trim($password.val());
if (account !== '') {
pass = validateAccount() && validatePassword();
} else {
pass = false;
$account.addClass('error');
if (password === '') {
//账户名和密码都为空的情况下点击登陆,只在账户输入框后显示错误提示
$accountTip.addClass('both-error').removeClass('hide').children('em').text('请输入账户名和密码');
$passwordTip.addClass('hide');
$password.addClass('error');
} else {
$accountTip.removeClass('hide').children('em').text('请输入账户名');
}
}
return pass;
}
$('[placeholder]').placeholder();
//展开地区列表
$('#country-code').on('click', function() {
if ($countryList.css('display') === 'none') {
$countryList.slideDown();
}
});
//选中地区列表项
$countryList.on('click', 'li', function() {
var $this = $(this),
cc = $this.data('cc');
$countryCodeEm.html($this.html());
$countryCodeHide.val(cc);
$countryList.slideUp();
});
//点击其他区域,收起区域列表
$(document).on('click', function(e) {
if ($(e.target).closest('#country-code').length > 0) {
return;
}
if ($countryList.css('display') === 'block') {
$countryList.slideUp();
}
});
//邮箱
$account.on('keyup', function() {
var account = $.trim($(this).val()),
html = '',
accountMatch,
matchStr,
postfix,
i;
//输入@时自动补全邮箱后缀
//此处>0非错误,用于避免输入的第一个字符为@被识别为邮箱
if (account.indexOf('@') > 0) {
accountMatch = account.match(/^[0-9]+@(.*)/);
if (accountMatch) {
//数字邮箱补全
postfix = mailPostfix.num;
} else {
postfix = mailPostfix.other;
}
matchStr = accountMatch[1];
for (i = 0; i < postfix.length; i++) {
if (postfix[i].indexOf(matchStr) > -1) {
html += '<li>' + account.slice(0, account.indexOf('@')) + '@' + postfix[i] + '</li>';
}
}
if (html !== '') {
$emailAutoComplete.html(html).removeClass('hide');
} else {
//隐藏autocomplete
$emailAutoComplete.html('').addClass('hide');
}
}
}).on('blur', function() {
emailAcTime = setTimeout(function() {
$emailAutoComplete.addClass('hide');
//验证
validateAccount();
}, 200);
});
//密码
$password.on('blur', function() {
validatePassword();
}).on('keypress', function(e) {
var code = e.which,
isShift = e.shiftKey || (code === 16) || false;
//CapsLock检测
if ((!isShift && (code >= 65 && code <= 90)) ||
(isShift && (code >= 97 && code <= 122))) {
$capsLock.removeClass('hide');
return;
}
$capsLock.addClass('hide');
});
//邮箱自动完成列表项点击
$emailAutoComplete.on('click', 'li', function() {
clearTimeout(emailAcTime); //清空默认关闭
$account.val($(this).text()).focus();
$emailAutoComplete.addClass('hide');
});
//记住登录状态
$('.remeber-me').on('click', function() {
var $this = $(this);
$this.toggleClass('checked');
if ($this.hasClass('checked')) {
$this.children('i').html(checkbox.checked);
} else {
$this.children('i').html(checkbox.unchecked);
}
});
//focus到输入框则隐藏错误提示和样式
$('.va').on('focus', function() {
var $this = $(this);
$this.removeClass('error');
$this.siblings('.err-tip').addClass('hide');
});
//登录
$('#login-btn').on('click', function() {
var pass = validate();
if (pass) {
$('#login-form').submit();
}
});
\ No newline at end of file
... ...
/**
* 国家区号Map手机号码以及邮箱验证正则
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/11
*/
var countryPhoneRegx = {
'+86': /^1[35847]{1}[0-9]{9}$/,
'+852': /^[965]{1}[0-9]{7}$/,
'+853': /^[0-9]{8}$/,
'+886': /^[0-9]{10}$/,
'+65': /^[98]{1}[0-9]{7}$/,
'+60': /^1[1234679]{1}[0-9]{8}$/,
'+1': /^[0-9]{10}$/,
'+82': /^01[0-9]{9}$/,
'+44': /^7[789]{1}[0-9]{8}$/,
'+81': /^0[9|8|7][0-9]{9}$/,
'+61': /^[0-9]{11}$/
};
var emailRegx = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/;
exports.phoneRegx = countryPhoneRegx;
exports.emailRegx = emailRegx;
\ No newline at end of file
... ...
/*
* 计算密码复杂度
*/
function gettype(str, i) {
if (str.charCodeAt(i) >= 48 && str.charCodeAt(i) <= 57) {
return 1;
} else if (str.charCodeAt(i) >= 97 && str.charCodeAt(i) <= 122) {
return 2;
} else if (str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 90) {
return 3;
}
return 4;
}
function isregular(cur, pre, type) {
var curCode = cur.charCodeAt(0);
var preCode = pre.charCodeAt(0);
if (curCode - preCode === 0) {
return true;
}
if (type !== 4 && (curCode - preCode === 1 || curCode - preCode === -1)) {
return true;
}
return false;
}
function getcomplex(curType, preType) {
if (preType === 0 || curType === preType) {
return 0;
} else if (curType === 4 || preType === 4) {
return 2;
} else {
return 1;
}
}
function computeComplex(password) {
var complex = 0,
length = password.length,
pre = '',
preType = 0,
i = 0,
cur,
curType;
for (i = 0; i < length; i++) {
cur = password.charAt(i);
curType = gettype(password, i);
if (preType !== curType || !isregular(cur, pre, curType)) {
complex += curType + getcomplex(curType, preType);
}
pre = cur;
preType = curType;
}
return complex;
}
module.exports = computeComplex;
\ No newline at end of file
... ...
/*
* @description 注册页js
* @time 2015/12/14
*/
var $ = require('yoho.jquery'),
regValidate = require('./mail-phone-regx'),
computeComplex = require('./pwd-strength');
var $registerPage = $('.register-page'),
$pwdTips = $('#pwd-tips'),
$pwdTip1 = $pwdTips.find('#pwd-tip1'),
$errTip = $('#err-tip'),
$registerBtn = $('#register-btn');
var $sendCaptcha = $('#send-captcha'),
caCount = 4,
validateResult = [];
var $pn = $('#phone-num'),
$mc = $('#msg-captcha'),
$pwd = $('#pwd'),
$repwd = $('#repwd'),
$ca = $('#captcha');
// 密码强度验证
var $pwdIntensity = $('.pwd-intensity'),
$pwdParent = $pwdIntensity.closest('.pwd-intensity-container');
//signup验证
var $region = $('#country-code'),
$regionSelect = $('#region');
setTimeout(function() {
$pn.val('');
$mc.val('');
$pwd.val('');
$repwd.val('');
$ca.val('');
}, 100);
//验证码位数
$ca.attr('maxlength', caCount);
//密码规则提示
$pwd.focus(function() {
$pwdTips.removeClass('hide');
}).blur(function() {
$pwdTips.addClass('hide');
});
//IE8 placeholder
//$('[placeholder]').placeholder();
// 存储校验信息
validateResult = [
{
id: 'phone-num',
message: '', //错误信息
status: false //当前的状态
},
{
id: 'captcha',
message: '',
status: false
},
{
id: 'msg-captcha',
message: '',
status: false
},
{
id: 'pwd',
message: '',
status: false
},
{
id: 'repwd',
message: '',
status: false
}
];
//手机号ajax校验
function phoneAjaxFn(callback) {
$.ajax({
url: '/passport/register/checkmobile',
type: 'POST',
data: {
mobile: $pn.val(),
area: $region.text().split('+')[1]
}
}).then(function(data) {
switch (data.code) {
case 200:
validateResult[0].message = '';
validateResult[0].status = true;
break;
case 404:
validateResult[0].message = '改账号已经存在';
validateResult[0].status = false;
break;
}
callback();
});
}
//图形验证码ajax校验
function picCaptchaAjaxFn(callback) {
$.ajax({
type: 'POST',
url: '/passport/register/piccaptcha',
data: {
code: $ca.val(),
mobile: $pn.val(),
area: $region.text().split('+')[1]
}
}).then(function(data) {
switch (data.code) {
case 200:
validateResult[1].message = '';
validateResult[1].status = true;
break;
case 404:
validateResult[1].message = '图形验证码错误';
validateResult[1].status = false;
break;
}
callback();
});
}
//短信验证码ajax校验
function msgCaptchaAjaxFn(callback) {
$.ajax({
type: 'POST',
url: '/passport/register/msgcaptcha',
data: {
code: $ca.val(),
mobile: $pn.val(),
area: $region.text().split('+')[1]
}
}).then(function(data) {
switch (data.code) {
case 200:
validateResult[2].message = '';
validateResult[2].status = true;
break;
case 404:
validateResult[2].message = '短信验证码错误';
validateResult[2].status = false;
break;
}
callback();
});
}
// 验证
function validateRule($element, callback) {
var val = $.trim($element.val()),
regionCode;
//手机号校验
if ($element.hasClass('phone-num')) {
regionCode = $region.text();
if (val === '') {
validateResult[0].message = '请输入手机号码';
validateResult[0].status = false;
callback();
} else if (!regValidate.phoneRegx[regionCode].test(val)) {
validateResult[0].message = '手机号码格式不正确,请重新输入';
validateResult[0].status = false;
callback();
} else {
phoneAjaxFn(callback);
}
//图形验证码校验
} else if ($element.hasClass('captcha')) {
if (val === '') {
validateResult[1].message = '请输入图形验证码';
validateResult[1].status = false;
callback();
} else if (val.length <= 3) {
validateResult[1].message = '图形验证码为4位';
validateResult[1].status = false;
callback();
} else {
// 并且手机号正确
if (validateResult[0].status) {
picCaptchaAjaxFn(callback);
} else {
validateResult[1].message = '图形验证码错误';
validateResult[1].status = false;
callback();
}
}
//短信验证码校验
} else if ($element.hasClass('msg-captcha')) {
if (val === '') {
validateResult[2].message = '请输入短信验证码';
validateResult[2].status = false;
callback();
} else if (val.length <= 3) {
validateResult[2].message = '短信验证码为4位';
validateResult[2].status = false;
callback();
} else {
// 并且图形验证码正确
if (validateResult[1].status) {
msgCaptchaAjaxFn(callback);
} else {
validateResult[2].message = '短信验证码错误';
validateResult[2].status = false;
}
}
//密码校验
} else if ($element.hasClass('pwd')) {
if (val === '') {
validateResult[3].message = '请输入密码';
validateResult[3].status = false;
} else if (val.length < 6 || val.length > 20) {
validateResult[3].message = '密码只支持6-20位字符';
validateResult[3].status = false;
} else if (/\s/.test($element.val())) {
validateResult[3].message = '密码不能包含空格';
validateResult[3].status = false;
} else {
validateResult[3].message = '';
validateResult[3].status = true;
}
callback();
//二次密码校验
} else if ($element.hasClass('repwd')) {
if (val === '') {
validateResult[4].message = '请输入密码确认';
validateResult[4].status = false;
} else if ($pwd.val() !== val) {
validateResult[4].message = '与密码不一致,请重新输入';
validateResult[4].status = false;
} else {
validateResult[4].message = '';
validateResult[4].status = true;
}
callback();
}
}
//显示提示信息
function showErrTip() {
var show = false,
tipPosition,
$container,
i,
validateResultLen = validateResult.length;
for (i = 0; i < validateResultLen; i++) {
if (!show) {
//不可以通过status判断
if (!!validateResult[i].message) {
//显示错误提示
$errTip.find('span').text(validateResult[i].message);
$container = $('#' + validateResult[i].id);
tipPosition = $container.offset();
$errTip.css({
top: tipPosition.top - 40,
left: tipPosition.left
}).removeClass('hide');
show = true; //停止判断
} else {
$errTip.addClass('hide');
}
}
}
}
//显示红色边框
function showBorder() {
var $errInput,
i,
validateResultLen = validateResult.length;
for (i = 0; i < validateResultLen; i++) {
if (!!validateResult[i].message) {
//显示红色边框
$errInput = $('#' + validateResult[i].id);
$errInput.addClass('error');
} else {
//去掉红色边框
$errInput = $('#' + validateResult[i].id);
$errInput.removeClass('error');
}
}
}
// 密码强度验证
function pwdFn($obj) {
var pwd = $obj.val(),
pwdStrength = computeComplex(pwd),
level = 0;
if (pwdStrength === 0) {
level = 0;
} else if (pwdStrength <= 10) {
level = 1;
} else if (pwdStrength <= 20) {
level = 2;
} else {
level = 3;
}
switch (level) {
case 0:
$pwdParent.removeClass('red yellow green');
$pwdIntensity.removeClass('color');
break;
case 1:
$pwdParent.addClass('red').removeClass('yellow green');
$pwdIntensity.filter('.low').addClass('color');
$pwdIntensity.filter('.mid,.high').removeClass('color');
break;
case 2:
$pwdParent.addClass('yellow').removeClass('red green');
$pwdIntensity.filter('.low,.mid').addClass('color');
$pwdIntensity.filter('.high').removeClass('color');
break;
case 3:
$pwdParent.addClass('green').removeClass('yellow red');
$pwdIntensity.addClass('color');
break;
}
//提示框
if (pwd === '') {
$pwdTip1.removeClass('red yes no').addClass('default');
} else if (pwd.length < 6 || pwd.length > 20) {
$pwdTip1.removeClass('default yes').addClass('no red');
} else {
$pwdTip1.removeClass('default no red').addClass('yes');
}
}
// 失去焦点时开始校验
// Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题
$registerPage.find('.va').keyup(function() {
var j,
statusLen = 0,
vLen = validateResult.length,
$that = $(this);
validateRule($(this), function() {
showErrTip(); // 显示错误提示
showBorder(); // 显示红色边框
// 如果validateResult中有4个status为true表示验证通过
for (j = 0; j < vLen; j++) {
if (validateResult[j].status) {
statusLen++;
}
}
if (statusLen === 4 && $('#agree-terms').is(':checked')) {
$registerBtn.removeClass('disable');
} else {
$registerBtn.addClass('disable');
}
// 图形验证通过时,发送短信按钮可点击
if (validateResult[1].status) {
$sendCaptcha.removeClass('disable');
} else {
$sendCaptcha.addClass('disable');
}
//图形验证通过时,发送短信按钮可点击 end
});
// 如果是密码则校验强度
if (($that).hasClass('pwd')) {
pwdFn($that);
}
}).blur(function() {
/*validateRule($(this), function() {
showErrTip();
showBorder(); // 显示红色边框
});*/
});
$regionSelect.change(function() {
$region.text('+' + $('#region').val());
validateRule($pn, showErrTip); //验证
});
// 点击发送验证码
$sendCaptcha.click(function() {
var timeResidue = 10,
t;
if ($(this).hasClass('disable')) {
return;
}
//todo ajax
t = setInterval(function() {
if (timeResidue <= 0) {
$sendCaptcha.removeClass('disable').val('获取短信验证码');
clearInterval(t);
return;
}
$sendCaptcha.addClass('disable').val(timeResidue-- + '秒可重新发送');
}, 1000);
});
\ No newline at end of file
... ...
/**
* 找回密码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('yoho.jquery');
var $pwd = $('#pwd'),
$repwd = $('#re-input'),
$next = $('#reset-pwd-btn'),
$pwdErr = $('#pwd-err'),
$repwdErr = $('#repwd-err'),
$pwdTips = $('#pwd-tips');
var hasNoErrPw = false;
var $pwdIntensity = $('.pwd-intensity'),
$pwdParent = $pwdIntensity.closest('.pwd-intensity-container'),
$pwdTip1 = $('#pwd-tip1');
require('../../plugin/jquery.placeholder');
/*
* 计算密码复杂度
*/
function gettype(str, i) {
if (str.charCodeAt(i) >= 48 && str.charCodeAt(i) <= 57) {
return 1;
} else if (str.charCodeAt(i) >= 97 && str.charCodeAt(i) <= 122) {
return 2;
} else if (str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 90) {
return 3;
}
return 4;
}
function isregular(cur, pre, type) {
var curCode = cur.charCodeAt(0);
var preCode = pre.charCodeAt(0);
if (curCode - preCode === 0) {
return true;
}
if (type !== 4 && (curCode - preCode === 1 || curCode - preCode === -1)) {
return true;
}
return false;
}
function getcomplex(curType, preType) {
if (preType === 0 || curType === preType) {
return 0;
} else if (curType === 4 || preType === 4) {
return 2;
} else {
return 1;
}
}
function computeComplex(password) {
var complex = 0,
length = password.length,
pre = '',
preType = 0,
i = 0,
cur,
curType;
for (i = 0; i < length; i++) {
cur = password.charAt(i);
curType = gettype(password, i);
if (preType !== curType || !isregular(cur, pre, curType)) {
complex += curType + getcomplex(curType, preType);
}
pre = cur;
preType = curType;
}
return complex;
}
function pwdKeyupEvt() {
var pwd = $pwd.val(),
pwdStrength = computeComplex(pwd),
level = 0;
//TODO:自定义密码强度规则,需要修正
if (pwdStrength === 0) {
level = 0;
} else if (pwdStrength <= 10) {
level = 1;
} else if (pwdStrength <= 20) {
level = 2;
} else {
level = 3;
}
switch (level) {
case 0:
$pwdParent.removeClass('red yellow green');
$pwdIntensity.removeClass('color');
break;
case 1:
$pwdParent.addClass('red').removeClass('yellow green');
$pwdIntensity.filter('.low').addClass('color');
$pwdIntensity.filter('.mid,.high').removeClass('color');
break;
case 2:
$pwdParent.addClass('yellow').removeClass('red green');
$pwdIntensity.filter('.low,.mid').addClass('color');
$pwdIntensity.filter('.high').removeClass('color');
break;
case 3:
$pwdParent.addClass('green').removeClass('yellow red');
$pwdIntensity.addClass('color');
break;
}
//
if (pwd === '') {
hasNoErrPw = false;
$pwdTip1.removeClass('red yes no').addClass('default');
} else {
if (pwd.length < 6 || pwd.length > 20) {
hasNoErrPw = false;
$pwdTip1.removeClass('default yes').addClass('no red');
} else {
hasNoErrPw = true;
$pwdTip1.removeClass('default no red').addClass('yes');
}
//提示2不做验证
}
}
//IE8 placeholder
$('input').placeholder();
$('.va').keyup(function() {
var pass = true;
if ($(this).hasClass('pwd')) {
pwdKeyupEvt();
} else {
if ($(this).val() === '') {
pass = false;
}
}
if (pass && hasNoErrPw && $pwd.val() === $repwd.val()) {
pass = true;
} else {
pass = false;
}
if (pass) {
$next.removeClass('disable').prop('disabled', false);
} else {
$next.addClass('disable').prop('disabled', true);
}
}).blur(function() {
var v = $(this).val();
if ($(this).hasClass('pwd')) {
if (v === '') {
$(this).addClass('error');
$pwdErr.removeClass('hide').find('em').text('请输入密码');
} else if (v.length < 6 || v.length > 20) {
$(this).addClass('error');
$pwdErr.removeClass('hide').find('em').text('密码只支持6-20位');
} else {
$pwdErr.addClass('hide');
if ($repwd.val() !== '') {
if (v !== $repwd.val()) {
$repwd.addClass('error');
$repwdErr.removeClass('hide').find('em').text('两次密码输入不一致,请重新输入');
} else {
$repwd.removeClass('error');
$repwdErr.addClass('hide');
}
}
}
} else {
if (v === '') {
$(this).addClass('error');
$repwdErr.removeClass('hide').find('em').text('请输入密码确认');
} else {
if ($pwd.val() !== '' && v !== $pwd.val()) {
$(this).addClass('error');
$repwdErr.removeClass('hide').find('em').text('两次密码输入不一致,请重新输入');
} else {
$(this).removeClass('error');
$repwdErr.addClass('hide');
}
}
}
}).focus(function() {
$(this).removeClass('error');
//focus后错误提示隐藏
if ($(this).hasClass('pwd')) {
$pwdErr.addClass('hide');
} else {
$repwdErr.addClass('hide');
}
});
$pwd.focus(function() {
$pwdErr.addClass('hide');
$pwdTips.removeClass('hide');
}).blur(function() {
$pwdTips.addClass('hide');
});
$('#pwd, #repwd').keydown(function(e) {
var code = e.keyCode || e.which;
//空格输入过滤
if (code === 32) {
e.preventDefault();
return;
}
});
... ...
/**
* 验证手机
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('yoho.jquery');
var $sc = $('#send-captcha'),
$msgTip = $('#captcha-tip'),
$errTip = $('#err-tip'),
$next = $('#next-step'),
seconds,
itime;
$sc.click(function() {
$.post('/passport/register/authcode', {
mobile: $('#mobile').val(),
area: $('#area').val(),
captcha: $('#captchaPic').val(),
project: 'repassword'
}, function(jsonData) {
if (jsonData.code === 200) {
$errTip.hide();
if ($(this).hasClass('disable')) {
return;
}
seconds = 60;
//$sc.addClass('disable').prop('disabled', true);
$sc.addClass('disable').attr('disabled', true);
$msgTip.removeClass('hide');
$sc.val(seconds-- + '秒后可重新操作');
itime = setInterval(function() {
if (seconds === 0) {
clearInterval(itime);
//$sc.val('发送验证码').removeClass('disable').prop('disabled', false);
$sc.val('发送验证码').removeClass('disable').removeAttr('disabled');
} else {
$sc.val(seconds-- + '秒后可重新操作');
}
}, 1000);
} else {
$(this).addClass('error');
$errTip.removeClass('hide').text('发送失败');
}
});
});
if ($(this).hasClass('disable')) {
return;
}
seconds = 60;
//$sc.addClass('disable').prop('disabled', true);
$sc.addClass('disable').attr('disabled', true);
$msgTip.removeClass('hide');
$sc.val(seconds-- + '秒后可重新操作');
itime = setInterval(function() {
if (seconds === 0) {
clearInterval(itime);
//$sc.val('发送验证码').removeClass('disable').prop('disabled', false);
$sc.val('发送验证码').removeClass('disable').removeAttr('disabled');
} else {
$sc.val(seconds-- + '秒后可重新操作');
}
}, 1000);
$('#captcha').keyup(function() {
var v = $.trim($(this).val());
if (v !== '') {
//添加验证码正确验证
//$next.removeClass('disable').prop('disabled', false);
$next.removeClass('disable').removeAttr('disabled');
} else {
//$next.addClass('disable').prop('disabled', true);
$next.addClass('disable').attr('disabled', true);
}
}).blur(function() {
var v = $.trim($(this).val());
if (v === '') {
//添加验证码正确验证
$(this).addClass('error');
$errTip.removeClass('hide');
} else {
$(this).removeClass('error');
$errTip.addClass('hide');
}
}).focus(function() {
$(this).removeClass('error');
});
\ No newline at end of file
... ...
... ... @@ -16,7 +16,10 @@
"yoho.lazyload": "1.0.0",
"yoho.handlebars": "3.0.3",
"yoho.jquery": "1.8.3",
"json2": "1.0.0"
"json2": "1.0.0",
"yoho.pjax": "1.0.0",
"yoho.dotdotdot": "1.0.0",
"yoho.placeholder": "0.0.1"
},
"devDependencies": {
"expect.js": "0.3.1"
... ...
/*!
* HTML5 Placeholder jQuery Plugin v1.8.3
* @link http://mths.be/placeholder
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
var jQuery = require('yoho.jquery');
(function(f){var e='placeholder' in document.createElement('input'),a='placeholder' in document.createElement('textarea');if(e&&a){f.fn.placeholder=function(){return this};f.fn.placeholder.input=f.fn.placeholder.textarea=true}else{f.fn.placeholder=function(){return this.filter((e?'textarea':':input')+'[placeholder]').bind('focus.placeholder',b).bind('blur.placeholder',d).trigger('blur.placeholder').end()};f.fn.placeholder.input=e;f.fn.placeholder.textarea=a;f(function(){f('form').bind('submit.placeholder',function(){var g=f('.placeholder',this).each(b);setTimeout(function(){g.each(d)},10)})});f(window).bind('unload.placeholder',function(){f('.placeholder').val('')})}function c(h){var g={},i=/^jQuery\d+$/;f.each(h.attributes,function(k,j){if(j.specified&&!i.test(j.name)){g[j.name]=j.value}});return g}function b(){var g=f(this);if(g.val()===g.attr('placeholder')&&g.hasClass('placeholder')){if(g.data('placeholder-password')){g.hide().next().attr('id',g.removeAttr('id').data('placeholder-id')).show().focus()}else{g.val('').removeClass('placeholder')}}}function d(h){var l,k=f(this),g=k,j=this.id;if(k.val()===''){if(k.is(':password')){if(!k.data('placeholder-textinput')){try{l=k.clone().attr({type:'text'})}catch(i){l=f('<input>').attr(f.extend(c(this),{type:'text'}))}l.removeAttr('name').data('placeholder-password',true).data('placeholder-id',j).bind('focus.placeholder',b);k.data('placeholder-textinput',l).data('placeholder-id',j).before(l)}k=k.removeAttr('id').hide().prev().attr('id',j).show()}k.addClass('placeholder').val(k.attr('placeholder'))}else{k.removeClass('placeholder')}}}(jQuery));
\ No newline at end of file
... ...
... ... @@ -1048,6 +1048,99 @@
line-height: 16px;
}
}
.simple-header {
height: 66px;
margin: 0 0 20px 0;
border-bottom: 2px solid #222;
.header-inner {
width: 990px;
height: 100%;
margin: 0 auto;
}
.logo {
float: left;
line-height: 66px;
font-size: 0;
img {
vertical-align: middle;
}
}
}
.simple-header .header-tool {
float: right;
line-height: 66px;
font-size: 0;
li {
@include inline-block;
padding: 0 10px;
*margin: 19px 0 0;
line-height: 28px;
font-size: 12px;
span, a {
font-size: 12px;
vertical-align: middle;
}
.tell-icon {
font-size: 12px;
}
.tell-icon ~ span {
font-weight: bold;
}
}
.login-box {
a {
color: #666;
}
}
.tool-options {
position: relative;
font-size: 0;
cursor: pointer;
&:hover {
background-color: #eaeceb;
.iconfont {
&.up {
display: inline-block;
*display: inline;
*zoom: 1;
}
&.down {
display: none;
}
}
}
.iconfont, span{
@include inline-block;
font-size: 12px;
height: 28px;
line-height: 28px;
&.up {
display: none;
}
}
.tool-select {
display: none;
position: absolute;
width: 74px;
left: 0;
background: #eaeceb;
z-index: 9;
a {
display: block;
padding: 0 0 0 10px;
border-top: 1px solid #ddd;
}
}
}
}
@media (max-width:1180px) {
.yoho-header {
.header-topwrapper {
... ...
.guang-detail-page {
width: 1150px;
margin: 0 auto 95px;
b {
font-weight: bold;
}
i {
font-style: italic;
}
.block {
margin: 15px 0;
}
.excellent-recommendation-title {
margin-top: 4px;
}
.block-header {
position: relative;
border-bottom: 1px solid #c1c1c1;
font-size: 18px;
height: 38px;
line-height: 38px;
text-align: center;
margin-bottom: 24px;
color: #333;
.more-reco {
position: absolute;
right: 0;
color: #000;
font-size: 14px;
text-decoration: none;
}
}
// 830+22:兼容IE8不认识:nth-child导致brand换行的问题
.related-brand .brands {
width:852px;
}
.related-reco .recos {
width: 850px;
}
}
.detail-title {
font-size: 28px;
line-height: 64px;
border-bottom: 1px dotted #c1c1c1;
word-wrap:break-word;
}
.article-author {
float: left;
line-height: 64px;
.author-avatar {
clear: both;
width: 38px;
height: 64px;
img {
width: 38px;
height: 38px;
border-radius: 50%;
vertical-align: middle;
}
}
}
.author-info {
float: left;
margin-left: 10px;
font-size: 14px;
max-width: 447px;
.author-name {
display: block;
height: 64px;
line-height: 64px;
cursor: pointer;
color: #000;
&:hover {
color: #cc3300;
}
}
.author-introduce {
color: #999;
}
}
.article-status {
float: right;
height: 64px;
line-height: 64px;
color: #999;
font-size: 13px;
.article-click {
margin: 0 25px;
}
.article-comment {
color: #cc3300;
cursor: pointer;
}
}
.article-main {
img {
display: block;
max-width: 100%;
margin:0 auto;
}
.article-text {
margin: 2px 0 20px;
line-height: 28px;
font-size: 14px;
}
.article-small-pic {
text-align: center;
font-size: 0;
img {
display: inline-block;
*display: inline;
*zoom: 1;
max-width: 412px;
&:first-child {
margin: 0 6px 0 0;
}
}
}
.block:first-child {
margin-top: 10px;
}
}
/*user handle*/
.user-handle {
margin: 30px 0 0 0;
text-align: center;
ul {
display: inline-block;
li {
float: left;
margin: 0 15px;
cursor: pointer;
a {
position: relative;
display: block;
padding: 0 10px;
height: 36px;
line-height: 36px;
color: #535353;
font-size: 0;
background: #efefef;
text-align: left;
i, span{
@include inline-block;
font-style: normal;
font-size: 14px;
}
i {
margin: 0 5px 0 0;
@include opacity(0.5);
font-size: 18px;
}
.cancel-collect {
display: none;
}
}
}
.like-status.liked i,
.like-status.hover i{
@include opacity(1);
}
.like-statis.hover .like-num {
color: #000;
}
.sort-collect a {
i {
width: 21px;
}
}
.sort-collect.collected a {
i {
@include opacity(1);
}
span {
display: none;
}
.cancel-collect {
display: inline;
}
}
.sort-collect.hover i {
@include opacity(1);
}
.sort-collect.hover span {
color: #000;
}
}
}
.article-bottom-info {
margin: 44px 0 0 0;
padding: 0 0 10px;
border-bottom: 1px dotted #c1c1c1;
}
.article-tag {
float: left;
width: 588px;
.tag-icon {
float: left;
margin: 0 12px 0 0;
font-size: 20px;
font-style: normal;
}
ul {
float: left;
max-width: 555px;
li {
float: left;
margin: 0 10px 10px 0;
a {
display: block;
padding: 0 15px;
height: 20px;
line-height: 20px;
font-size: 12px;
color: #fff;
font-weight: bold;
background: #c1c1c1;
}
&:hover a {
background:#333;
}
}
li:first-child {
margin-left: 0;
}
}
}
.article-share {
float: right;
.share-to {
position: relative;
font-size: 12px;
}
}
.detail-related-posts {
margin: 14px 0 0 0;
li {
float: left;
width: 264px;
margin-left: 19px;
a {
display: block;
}
.bg-img {
display: block;
width: 100%;
height: 173px;
line-height: 173px;
text-align: center;
font-size: 0;
img {
max-width: 100%;
max-height: 100%;
vertical-align: middle;
}
}
.post-title {
margin: 8px 0 0 0;
h2 {
line-height: 16px;
font-size: 14px;
color: #000;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.post-title:hover h2 {
color: #cc3300 !important;
}
}
li:first-child {
margin-left: 0;
}
}
.comment-area {
margin: 58px 0 0 0;
.comment-publish {
height: 48px;
}
}
.comment-textarea {
textarea {
display: block;
width: 812px;
height: 86px;
padding: 12px 12px;
resize: none;
outline: none;
font-size: 14px;
line-height: 18px;
color: #535353;
font-family: "arial","helvetica","微软雅黑";
border: 1px solid #e7e7e7;
}
}
.word-count-tip {
display: inline-block;
height: 48px;
line-height: 48px;
font-size: 12px;
color: #c8c8c8;
.exceed-count {
color: #f00;
}
}
.publish-btn {
margin: 10px 0 0 0;
float: right;
width: 90px;
height: 33px;
line-height: 33px;
text-align: center;
color: #fff;
font-size: 14px;
background: #cb3a3e;
cursor: pointer;
&:hover {
background: #c03234;
}
&.disable {
background-color: #e79c9e;
}
}
.comments-wrap{
h4{
position: relative;
line-height: 32px;
border-bottom: 1px solid #e7e7e7;
.comment-num{
margin-right: 5px;
color: #c11e00;
}
i{
position: absolute;
width: 13px;
height: 7px;
left: 30px;
bottom: -7px;
background: image-url('guang/detail/comment-icon.png') no-repeat;
}
}
.comment-pager {
float: right;
margin: 20px 0;
}
}
.comments-empty {
display: none;
color: #ccc;
margin: 20px 0;
font-size: 12px;
line-height: 12px;
text-align: center;
}
.commnets-resultwrapper {
display: none;
}
.comments-list{
li{
margin: 14px 0 0;
padding: 0 0 15px;
border-bottom: 1px dotted #e7e7e7;
.avatar{
float: left;
width: 40px;
height: 40px;
overflow: hidden;
img{
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.comment-info{
float: left;
width: 774px;
margin: 0 0 0 16px;
.comment-user-name{
color: #c11e00;
font-size: 15px;
line-height: 15px;
}
.comment-content{
margin-top: 10px;
line-height: 16px;
font-size: 12px;
word-wrap:break-word;
}
.comment-time{
margin: 10px 0 0 0;
color: #c8c8c8;
font-size: 12px;
line-height: 12px;
clear: both;
}
}
}
}
.brand {
margin-right: 22px;
margin-bottom: 20px;
float: left;
.thumb {
display: table-cell;
border: 1px solid #f5f5f5;
height: 120px;
width: 120px;
box-sizing: border-box;
text-align: center;
vertical-align: middle;
img {
display: block;
max-width: 120px;
max-height: 120px;
margin: 0 auto;
}
}
.brand-name {
width: 120px;
font-size: 13px;
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
color: #333;
}
}
$commodityWidth: 192px;
.good-info {
width: $commodityWidth;
height: 325px;
margin-right: 20px;
margin-bottom: 20px;
}
.share-to .share-a {
width: 16px;
height: 16px;
display: inline-block;
vertical-align: top;
margin: 0 2px 0 3px;
cursor: pointer;
}
.share-to .share-sina {
background: image-url('guang/detail/icon-share.png') no-repeat 0 0;
}
.share-to .share-weixin {
background: image-url('guang/detail/icon-share.png') no-repeat 0 -96px;
}
.share-to .share-tencent {
background: image-url('guang/detail/icon-share.png') no-repeat 0 -16px;
}
.share-to .share-renren {
background: image-url('guang/detail/icon-share.png') no-repeat 0 -32px;
}
.share-to .share-qzone {
background: image-url('guang/detail/icon-share.png') no-repeat 0 -48px;
}
.share-to .share-qq {
background: image-url('guang/detail/icon-share.png') no-repeat 0 -64px;
}
.share-to .share-douban {
background: image-url('guang/detail/icon-share.png') no-repeat 0 -80px;
}
/* weixin share start */
.shareWeixin{width:282px;height:302px;position:absolute;padding-top:9px;text-align: center;font-family: Microsoft Yahei, Arial, Verdana;top: 22px;right: -3px;display:none;z-index:2;}
.shareWeixin em, .shareWeixin em i{width: 0;height: 0;font-size: 0;position: absolute;border-width:0 10px 9px;border-style:dashed dashed solid;}
.shareWeixin em{border-color:transparent transparent #d6d6d6;top: 0px;left: 50%;margin-left: -10px;}
.shareWeixin em i{border-color:transparent transparent #e8e8e8;overflow:hidden;top: 1px;left: -10px;}
.shareWeixin .con{width:280px;height:300px;overflow:hidden;background-color: #FFFFFF;border:1px solid #d6d6d6;box-shadow: 0px 2px 4px #d1d1d1;position:relative;}
.shareWeixin h2{height:46px;line-height: 46px;background-color: #e8e8e8;color:#000000;font-size: 18px;display: block;}
.shareWeixin p.pic, .shareWeixin p.pic img{width:168px;height:168px;}
.shareWeixin p.pic{overflow:hidden;margin:16px auto;}
.shareWeixin p.w{font-size: 13px;color:#9f9f9f;line-height: 20px;}
.shareWeixin a.close{width:45px;height:45px;line-height:45px;overflow:hidden;position: absolute;top: 9px;right: 0;font-size: 16px;color: #999999;}
/* weixin share end */
\ No newline at end of file
... ...
.guang-index-page {
.msg-nav {
border-bottom: 1px solid #000;
margin-top: 24px;
height: 30px;
li {
float: left;
height: 30px;
line-height: 30px;
text-align: center;
font-size: 18px;
padding: 0 28px;
a {
display: block;
height: 100%;
width: 100%;
color: #333;
}
&.actived {
background-color: #111;
a {
color: #fff;
}
}
}
}
.msg-pager {
float: right;
margin: 20px 0;
}
}
\ No newline at end of file
... ...
.guang-page {
width: 1150px;
margin: 0 auto;
.left-side {
float: left;
width: 830px;
}
.right-side {
float: left;
width: 290px;
margin-left: 30px;
}
img.blink,
.bg-img.blink {
opacity: 0.8;
filter: alpha(opacity=80);
}
/*精彩推荐*/
.ex-reco-title {
color: #333;
line-height: 24px;
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
font-size: 20px;
font-weight: bold;
}
.ex-reco-list {
margin-top: 14px;
}
.ex-reco-item {
box-sizing: border-box;
height: 60px;
margin-bottom: 14px;
&:last-child {
margin-bottom: 0;
}
}
.ex-reco-img {
display: block;
float: left;
width: 90px;
height: 60px;
span {
display: block;
height: 100%;
width: 100%;
-webkit-background-size:cover;
-moz-background-size:cover;
background-size:cover;
background-position: center;
img {
width: 100%;
height: 100%;
}
}
margin-right: 5px;
}
.ex-reco-context {
float: left;
max-width: 195px;
height: 40px;
line-height: 20px;
font-size: 13px;
color: #666;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:hover {
color: #cc3300;
}
}
/*热门标签*/
.hot {
margin-top: 40px;
.hot-title {
color: #333;
line-height: 24px;
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
font-weight: bold;
font-size: 20px;
}
.hot-tag-list {
margin-top: 14px;
max-height: 150px;
overflow: hidden;
}
.hot-tag {
display: inline-block;
float: left;
padding: 5px;
font-size: 12px;
background-color: #ccc;
border: none;
margin-right: 10px;
margin-bottom: 10px;
color: white;
font-weight: bold;
&:hover {
background-color: #333;
}
}
}
/*广告位*/
.ads {
margin-top: 30px;
.ad {
display: block;
box-sizing: border-box;
margin-bottom: 24px;
width: 290px;
img {
display: block;
width: 100%;
}
}
}
/*资讯*/
.msg-content {
padding: 24px 0;
border-bottom: 1px solid #ccc;
position: relative;
.content {
height: 80px;
line-height: 24px;
}
.iconfont {
color: #ccc;
}
.msg-img {
position: relative;
float: left;
margin-right: 26px;
img {
display: block;
width: 360px;
height: 240px;
}
img.square {
height: 360px;
}
}
.classification {
position: absolute;
background-color: #000;
color: #fff;
text-align: center;
width: 80px;
height: 32px;
line-height: 32px;
font-size: 13px;
opacity: 0.9;
filter: Alpha(opacity=90);
z-index: 99;
}
.reco {
position: absolute;
top: 0;
left: 66px;
height: 32px;
width: 32px;
background: image-url("guang/msg-reco.png");
background-size: 100% 100%;
z-index: 100;
}
.msg-info {
float: left;
width: 440px;
}
.msg-title {
display: block;
font-size: 22px;
color: #333;
line-height: 30px;
max-height: 64px;
&:hover {
color: #CC3300;
}
}
.content {
font-size: 14px;
color: #666;
}
.msg-app {
line-height: 34px;
color: #999;
font-size: 13px;
}
.author {
display: block;
float: left;
color: #333;
margin-right: 22px;
max-width: 180px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:hover {
color: #CC3300;
}
}
.publish-time, .page-view {
color: #999;
}
.tags, .like-comment {
position: absolute;
bottom: 24px;
font-size: 12px;
&.tags {
left: 386px;
max-width: 350px;
height: 20px;
overflow: hidden;
}
&.like-comment {
right: 0;
color: #999;
}
.like {
margin-right: 10px;
&:hover * {
color: #000;
}
}
.like-icon {
cursor: pointer;
}
}
.msg-tag {
display: inline-block;
text-align: center;
height: 20px;
line-height: 20px;
padding: 0 10px;
margin-right: 10px;
background-color: #ccc;
color: #fff;
&:last-child {
margin-right: 0;
}
&:hover {
background-color: #333;
}
}
}
.pager {
font-size: 12px;
a {
height: 24px;
padding: 0 9px;
line-height: 24px;
display: inline-block;
text-align: center;
margin-right: 8px;
color: #222;
&.cur {
background-color: #222;
color: #fff;
}
}
}
}
@import "home", "detail", "list";
... ...
.guang-editor-page,
.guang-list-page {
.tag-header {
height: 45px;
line-height: 45px;
color: #333;
font-size: 14px;
font-weight: bold;
border-bottom: 1px solid #ccc;
> span {
font-size: 20px;
}
}
.msg-pager {
float: right;
margin: 20px 0;
}
}
.guang-editor-page .right-side {
margin-top: 20px;
}
.guang-list-page .right-side {
margin-top: 11px;
}
.guang-editor-page .editor-info {
padding: 10px 10px;
background: #fafafa;
.author-avatar {
float: left;
width: 80px;
height: 100%;
img {
width: 80px;
height: 80px;
vertical-align: middle;
border-radius: 50%;
}
}
.author-info {
float: left;
margin: 0 0 0 10px;
max-width: 1060px;
}
.author-name {
margin-top: 11px;
font-size: 20px;
height: 30px !important;
line-height: 30px !important;
}
.author-introduce {
line-height: 24px;
font-size: 14px;
color: #999;
}
.intro-content {
margin: 15px 0 0 0;
line-height: 18px;
font-size: 14px;
color: #999;
}
}
\ No newline at end of file
... ...
... ... @@ -13,9 +13,9 @@
}
/*大banner大图*/
.slide-wrapper {
.slide-wrapper {
position: relative;
height: 387px;
height: 387px;
overflow: hidden;
ul {
... ...
... ... @@ -4,7 +4,8 @@
"compass/reset",
"header",
"footer",
"path-nav";
"path-nav",
"plugin/slider";
body {
font-family: arial,"Microsoft YaHei";
... ... @@ -79,4 +80,5 @@ a:focus {
width: 990px;
}
}
@import "home/index", "product/index";
@import "home/index", "product/index", "guang/index", "passport/index";
... ...
.back-page {
font-size: 14px;
.content {
margin: 175px 0 0 !important;
}
.back-header {
position: relative;
width: 268px;
line-height: 40px;
margin-bottom: 5px;
.country-code {
float: right;
cursor: pointer;
color: #b9b9b9;
.iconfont {
font-size: 14px;
vertical-align: middle;
}
}
}
.title {
float: left;
margin: 0px;
font-size: 22px;
line-height: 40px;
color: #000;
font-weight: normal;
}
.title2 {
margin: 0 0 5px;
font-size: 22px;
line-height: 40px;
color: #000;
font-weight: normal;
}
.err-tip.captcha-err {
top: 10px;
left: 326px;
}
.country-code-list {
display: none;
position: absolute;
padding: 0 10px;
color: #000;
background-color: #fff;
border: 1px solid #000;
margin-top: 5px;
cursor: pointer;
z-index: 100;
top: 30px;
right: 0;
@include border-radius(5px);
li {
height: 20px;
line-height: 20px;
}
}
input {
padding: 0;
outline: none;
font-family: Regular, arial, 'Microsoft YaHei';
}
.input-container-li {
position: relative;
margin-bottom: 22px;
.btn {
width: 270px;
height: 45px;
line-height: 45px;
cursor: pointer;
font-size: 20px;
border: none;
letter-spacing: 0;
}
.captcha {
width: 160px;
}
.captcha-img {
height: 37px;
width: 90px;
border: 0;
margin-left: 10px;
vertical-align: middle;
outline: none;
cursor: pointer;
}
.change-captcha {
color: #ff1901;
font-size: 12px;
text-decoration: underline;
margin-left: 10px;
cursor: pointer;
}
}
}
.send-email-page {
font-size: 14px;
.content {
margin: 216px 0 0 !important;
}
.send-tips {
line-height: 28px;
color: #4c4c4c;
text-align: center;
font-size: 15px;
.iconfont {
margin: 0 8px 0 0;
}
}
.no-find {
margin: 10px 0 0 0;
line-height: 20px;
color: #a5a4a4;
text-align: center;
}
.to-my-email {
a {
display: block;
margin: 53px auto 0;
width: 270px;
height: 45px;
line-height: 45px;
background: #ff1901;
text-align: center;
color: #fff;
letter-spacing: 2px;
}
}
}
.verification-page .content{
li {
position: relative;
margin-bottom: 43px;
}
.btn {
@include inline-block;
border: none;
}
.head-title {
font-size: 24px;
color: #000;
}
.pn-label {
color: #828282;
font-size: 16px;
}
.country-code {
margin: 0 10px;
}
.country-code, .phone-num {
color: #000;
font-size: 16px;
}
.captcha {
width: 160px !important;
}
.send-captcha {
width: 133px;
font-size: 12px;
position: relative;
top: -1px;
letter-spacing: 0;
}
.err-tip {
left: 310px;
}
.captcha-tips {
position: absolute;
top: 50px;
color: #a5a4a4;
.iconfont {
color: #0F9ACD;
font-size: 14px;
margin: 0 8px 0 0;
vertical-align: 12%;
}
}
}
.reset-success-page {
.content {
margin: 255px 0 0 !important;
}
.success-text {
line-height: 35px;
.iconfont {
font-size: 30px;
color: #ee3f14;
}
span {
font-size: 24px;
margin: 0 18px;
}
#count-down {
color: #ee3f14;
}
}
.success-btn {
display: block;
margin: 43px auto 0;
width: 269px;
line-height: 269px;
height: 45px;
line-height: 45px;
font-size: 14px;
color: #fff;
text-align: center;
background-color: #ff1901;
}
}
\ No newline at end of file
... ...
$tip: sprite-map("passport/tip/*.png", $spacing: 10px);
@import "login", "register", "back";
/**/
.passport-page {
width: 1150px;
margin-left: auto;
margin-right: auto;
.content {
float: left;
margin-top: 107px;
padding-left: 85px;
}
.input {
height: 43px;
font-size: 16px;
line-height: 1.2;
line-height: 43px\9;
width: 268px;
border: 1px solid #dbdbdb;
text-indent: 10px;
color: #9a9a9a;
color: rgba(0,0,0,.5);
}
.error {
border-color: #f00 !important;
}
.btn {
display: block;
height: 46px;
line-height: 46px;
width: 100%;
text-align: center;
color: #fff;
background-color: #ff1901;
letter-spacing: 10px;
font-size: 20px;
cursor: pointer;
&.disable {
background-color: #555;
cursor: default;
}
}
.pwd-intensity-container {
width: 270px;
text-align: right;
padding-top: 5px;
&.red {
.pwd-intensity {
color: #ee0011;
}
.color {
background: #ee0011;
color: #fff;
}
}
&.yellow {
.pwd-intensity {
color: #f6da1e;
}
.color {
background: #f6da1e;
color: #fff;
}
}
&.green {
.pwd-intensity {
color: #3ee392;
}
.color {
background: #3ee392;
color: #fff;
}
}
.pwd-intensity {
height: 15px;
font-size: 12px;
background-color: #e8e8e8;
padding: 0px 10px;
text-align: center;
color: #b9b9b9;
}
}
.pwd-tips {
position: absolute;
top: -10px;
left: 285px;
width: 160px !important;
height: 72px;
padding-top: 7px;
font-size: 12px;
background: sprite($tip, block) no-repeat;
>div {
position: relative;
height: 22px;
line-height: 22px;
margin-left: 15px;
padding-left: 15px;
font-size: 12px;
color: #b9b9b9;
i {
position: absolute;
width: 14px;
height: 14px;
left: -2px;
top: 50%;
margin: -7px 0 0;
background: sprite($tip, info);
}
&.no {
color: red;
i {
background: sprite($tip, error);
}
}
&.yes {
i {
background: sprite($tip, success);
}
}
}
}
.tip-panel {
position: absolute;
display: none;
width: 248px;
padding: 0 10px;
z-index: 100;
background-color: #161616;
border: 1px solid rgba(255, 255, 255, 0.7);
margin-top: 5px;
cursor: pointer;
@include border-radius(5px);
li {
height: 20px;
line-height: 20px;
color: #b9b9b9;
}
}
.err-tip {
position: absolute;
font-size: 14px;
white-space: nowrap;
top: 8px;
left: 285px;
padding: 6px 0;
color: #f00;
i {
display: block;
float: left;
height: 14px;
width: 14px;
background: sprite($tip, error) no-repeat;
margin-right: 5px;
}
}
}
.passport-cover {
float: left;
margin: 107px 0;
width: 575px;
.cover-content {
width: 100%;
height: 318px;
padding: 50px 0;
border-right: 1px solid #dfdfdf;
}
.cover-img {
display: block;
width: 252px;
height: 190px;
margin: 0 auto;
margin-top: 50px;
}
}
\ No newline at end of file
... ...