Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
uedxwg
9 years ago
Commit
1e7d0e956d0192480c449d7d58d27d4c02c6ca4e
2 parents
af3a8963
e48bca0e
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
192 additions
and
85 deletions
static/js/me/address.js
static/js/me/online-service.js
static/js/me/order.js
static/js/me/suggest.js
static/js/product/detail/like.js
static/js/product/list.js
static/sass/me/_address.scss
static/sass/me/_online-service.scss
static/sass/me/_suggest.scss
static/sass/product/_detail.scss
template/m.yohobuy.com/actions/index/home/suggest.phtml
template/m.yohobuy.com/actions/product/detail/index.phtml
static/js/me/address.js
View file @
1e7d0e9
...
...
@@ -28,7 +28,6 @@ var $action = $('.action'),
// 清除返回按钮原有链接
$backBtn
.
attr
(
'href'
,
'javascript:void(0);'
);
window
.
rePosFooter
();
// 自定义返回按钮事件
...
...
@@ -39,6 +38,7 @@ $backBtn.on('touchend', function(e) {
e
.
preventDefault
();
currentPage
=
'address'
;
$navTitle
.
html
(
'地址管理'
);
window
.
rePosFooter
();
}
else
if
(
currentPage
===
'list'
)
{
$pageWrap
.
hide
();
$editAddressPage
.
show
();
...
...
@@ -60,9 +60,10 @@ function editAddress(data) {
$addressForm
.
find
(
'[name="address"]'
).
val
(
data
.
address
||
''
);
currentPage
=
'edit'
;
$footer
.
hide
();
$pageWrap
.
hide
();
$editAddressPage
.
show
();
$footer
.
addClass
(
'bottom'
);
}
$confim
.
on
(
'touchend'
,
'.cancel'
,
function
()
{
...
...
@@ -94,30 +95,7 @@ $confim.on('touchend', '.cancel', function() {
});
});
// 添加地址
$addAddress
.
on
(
'touchend'
,
function
()
{
if
(
$addressItem
.
length
>=
5
)
{
tip
.
show
(
'您最多添加5个收货地址'
);
return
false
;
}
editAddress
();
$navTitle
.
html
(
'添加新地址'
);
});
// 编辑或删除
$action
.
on
(
'touchend'
,
'.edit'
,
function
()
{
editAddress
(
$
(
this
).
data
());
$navTitle
.
html
(
'修改地址'
);
}).
on
(
'touchend'
,
'.del'
,
function
()
{
deleteId
=
$
(
this
).
data
(
'id'
);
$confim
.
show
();
});
$submit
.
on
(
'touchend'
,
function
()
{
$addressForm
.
submit
();
return
false
;
});
// 提交表单请求
$addressForm
.
on
(
'submit'
,
function
()
{
if
(
isSubmiting
)
{
return
false
;
...
...
@@ -126,12 +104,14 @@ $addressForm.on('submit', function() {
// 简单的表单校验
if
(
!
$
(
this
).
find
(
'[name="consignee"]'
).
val
())
{
tip
.
show
(
'收件人不能为空'
);
$
(
this
).
find
(
'[name="consignee"]'
).
focus
();
// $(this).find('[name="consignee"]').focus();
return
false
;
}
if
(
!
$
(
this
).
find
(
'[name="mobile"]'
).
val
())
{
tip
.
show
(
'手机号不能为空'
);
$
(
this
).
find
(
'[name="mobile"]'
).
focus
();
// $(this).find('[name="mobile"]').focus();
return
false
;
}
if
(
!
$
(
this
).
find
(
'[name="area_code"]'
).
val
()
||
!
$
(
this
).
find
(
'[name="area"]'
).
val
())
{
...
...
@@ -140,7 +120,8 @@ $addressForm.on('submit', function() {
}
if
(
!
$
(
this
).
find
(
'[name="address"]'
).
val
())
{
tip
.
show
(
'地址不能为空'
);
$
(
this
).
find
(
'[name="address"]'
).
focus
();
// $(this).find('[name="address"]').focus();
return
false
;
}
...
...
@@ -168,6 +149,34 @@ $addressForm.on('submit', function() {
return
false
;
});
// 添加地址
$addAddress
.
on
(
'touchend'
,
function
()
{
if
(
$addressItem
.
length
>=
5
)
{
tip
.
show
(
'您最多添加5个收货地址'
);
return
false
;
}
editAddress
();
$navTitle
.
html
(
'添加新地址'
);
});
// 编辑或删除
$action
.
on
(
'touchend'
,
'.edit'
,
function
()
{
editAddress
(
$
(
this
).
data
());
$navTitle
.
html
(
'修改地址'
);
}).
on
(
'touchend'
,
'.del'
,
function
()
{
deleteId
=
$
(
this
).
data
(
'id'
);
$confim
.
show
();
});
$submit
.
on
(
'touchend'
,
function
()
{
$addressForm
.
submit
();
return
false
;
}).
on
(
'touchstart'
,
function
()
{
$
(
this
).
addClass
(
'highlight'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
removeClass
(
'highlight'
);
});
// 省市区
$area
.
on
(
'touchend'
,
function
()
{
$footer
.
hide
();
...
...
@@ -176,10 +185,9 @@ $area.on('touchend', function() {
currentPage
=
'list'
;
});
// 省市区联动
$addressListPage
.
on
(
'touchend'
,
'.address'
,
function
()
{
var
caption
=
$
(
this
).
children
(
'.caption'
).
text
();
newArea
.
push
(
caption
);
newArea
.
push
(
$
(
this
).
children
(
'.caption'
).
text
());
$
(
this
).
siblings
().
hide
();
$
(
this
).
children
(
'ul'
).
show
();
return
false
;
...
...
@@ -193,6 +201,7 @@ $addressListPage.on('touchend', '.address', function() {
$editAddressPage
.
show
();
currentPage
=
'edit'
;
$navTitle
.
html
(
'修改地址'
);
$footer
.
show
();
// 恢复默认的三级选择
$addressListPage
.
hide
();
...
...
@@ -201,3 +210,17 @@ $addressListPage.on('touchend', '.address', function() {
newArea
=
[];
return
false
;
});
$
(
$editAddressPage
,
$addressListPage
).
css
(
'min-height'
,
function
()
{
return
$
(
window
).
height
()
-
$
(
'#yoho-header'
).
height
();
});
$pageWrap
.
first
().
css
(
'min-height'
,
function
()
{
return
$
(
window
).
height
()
-
$
(
'#yoho-header'
).
height
()
-
$footer
.
height
();
});
$
(
'input, textarea'
).
on
(
'focus'
,
function
()
{
$footer
.
hide
();
}).
on
(
'blur'
,
function
()
{
$footer
.
show
();
});
\ No newline at end of file
...
...
static/js/me/online-service.js
View file @
1e7d0e9
...
...
@@ -18,3 +18,10 @@ $questionTab.on('touchend', function() {
$
(
'.question-list'
).
removeClass
(
'current'
);
$
(
clickTab
).
addClass
(
'current'
);
});
$
(
'.yoho-page'
).
on
(
'touchstart'
,
'.connect-item, .question-item'
,
function
()
{
$
(
this
).
siblings
().
removeClass
(
'highlight'
);
$
(
this
).
addClass
(
'highlight'
);
}).
on
(
'touchend touchcancel'
,
'.connect-item, .question-item'
,
function
()
{
$
(
this
).
removeClass
(
'highlight'
);
});
...
...
static/js/me/order.js
View file @
1e7d0e9
...
...
@@ -26,6 +26,8 @@ var inAjax = false;
var
loading
=
require
(
'../plugin/loading'
);
var
dialog
=
require
(
'./dialog'
);
var
orderHammer
;
//加载订单
...
...
@@ -110,36 +112,52 @@ orderHammer.on('tap', function(e) {
if
(
$cur
.
closest
(
'.del'
).
length
>
0
)
{
//Order delete
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/delOrder'
,
data
:
{
id
:
id
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
//删除订单页面刷新
location
.
href
=
location
.
href
;
}
dialog
.
showDialog
({
dialogText
:
'确定删除订单吗?'
,
hasFooter
:
{
leftBtnText
:
'取消'
,
rightBtnText
:
'确定'
}
},
function
()
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/delOrder'
,
data
:
{
id
:
id
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
//删除订单页面刷新
location
.
href
=
location
.
href
;
}
}
});
});
}
else
if
(
$cur
.
closest
(
'.cancel'
).
length
>
0
)
{
//Order cancel
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/cancelOrder'
,
data
:
{
id
:
id
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
//取消订单页面刷新
location
.
href
=
location
.
href
;
}
dialog
.
showDialog
({
dialogText
:
'确定取消订单吗?'
,
hasFooter
:
{
leftBtnText
:
'取消'
,
rightBtnText
:
'确定'
}
},
function
()
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/cancelOrder'
,
data
:
{
id
:
id
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
//取消订单页面刷新
location
.
href
=
location
.
href
;
}
}
});
});
}
else
{
...
...
static/js/me/suggest.js
View file @
1e7d0e9
...
...
@@ -7,6 +7,7 @@
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
lazyLoad
=
require
(
'yoho.lazyload'
),
Handlebars
=
require
(
'yoho.handlebars'
);
var
diaLog
=
require
(
'./dialog'
);
...
...
@@ -53,6 +54,8 @@ $('#upload-img').uploadifive({
}
});
lazyLoad
();
headerNavHammer
=
new
Hammer
(
document
.
getElementById
(
'yoho-header'
));
headerNavHammer
.
on
(
'tap'
,
function
(
e
)
{
...
...
static/js/product/detail/like.js
View file @
1e7d0e9
...
...
@@ -7,18 +7,24 @@ var $ = require('jquery'),
Hammer
=
require
(
'yoho.hammer'
),
tip
=
require
(
'../../plugin/tip'
);
var
likeHammer
=
new
Hammer
(
document
.
getElementById
(
'likeBtn'
));
var
likeHammer
=
new
Hammer
(
document
.
getElementById
(
'likeBtn'
)),
addToCartHammer
=
new
Hammer
(
document
.
getElementById
(
'addtoCart'
));
var
productId
=
$
(
'#productId'
).
val
();
likeHammer
.
on
(
'tap'
,
function
(
e
)
{
var
productId
=
$
(
'#productId'
).
val
(),
opt
;
var
opt
,
favorite
;
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'liked'
))
{
opt
=
'cancel'
;
favorite
=
0
;
}
else
{
opt
=
'ok'
;
favorite
=
1
;
}
$
.
ajax
({
...
...
@@ -36,6 +42,14 @@ likeHammer.on('tap', function(e) {
}
else
{
tip
.
show
(
data
.
message
);
}
// 统计代码:用于统计用户加入或取消商品收藏的动作
if
(
window
.
_yas
)
{
window
.
_yas
.
sendCustomInfo
({
pd
:
productId
,
fa
:
favorite
});
}
},
error
:
function
()
{
tip
.
show
(
'网络断开连接了~'
);
...
...
@@ -44,6 +58,15 @@ likeHammer.on('tap', function(e) {
});
// $('#likeBtn').on('click', function(e) {
// return false;
// });
\ No newline at end of file
addToCartHammer
.
on
(
'tap'
,
function
(
e
)
{
// 统计代码:用于统计用户加入购物车的动作
if
(
window
.
_yas
)
{
window
.
_yas
.
sendCustomInfo
({
pd
:
productId
,
by
:
1
});
}
});
...
...
static/js/product/list.js
View file @
1e7d0e9
...
...
@@ -442,3 +442,8 @@ $listNav.on('touchstart', 'li', function() {
}).
on
(
'touchend touchcancel'
,
'li'
,
function
()
{
$listNav
.
find
(
'li'
).
removeClass
(
'bytouch'
);
});
// 用于统计点击了商品列表的第几个商品,序号从1开始计算。
if
(
window
.
_yas
)
{
window
.
_yas
(
1
*
new
Date
(),
'1.0.13.1'
,
'yohobuy_m'
,
window
.
_ozuid
,
'#goods-container >div >div .good-thumb >img'
);
}
\ No newline at end of file
...
...
static/sass/me/_address.scss
View file @
1e7d0e9
.my-address-page
{
width
:
100%
;
background
:
#f0f0f0
;
padding-bottom
:
pxToRem
(
20px
);
.page-wrap
:first-child
{
padding-bottom
:
pxToRem
(
10px
);
}
.address-item
{
padding
:
pxToRem
(
20px
)
pxToRem
(
30px
);
...
...
@@ -169,6 +172,10 @@
text-align
:
center
;
font-size
:
pxToRem
(
32px
);
line-height
:
pxToRem
(
88px
);
&
.highlight
{
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
}
}
}
...
...
static/sass/me/_online-service.scss
View file @
1e7d0e9
...
...
@@ -31,6 +31,7 @@
margin
:
0
rem
(
32
);
border-left
:
1px
solid
#b0b0b0
;
}
}
.question-list
{
...
...
@@ -43,15 +44,15 @@
}
li
{
margin-left
:
rem
(
30
);
width
:
rem
(
610
);
font-size
:
rem
(
28
);
line-height
:
rem
(
90
);
border-bottom
:
1px
solid
#ccc
;
a
{
display
:
block
;
color
:
#444
;
width
:
rem
(
610
);
margin-left
:
rem
(
30
);
border-bottom
:
1px
solid
#ccc
;
}
.iconfont
{
...
...
@@ -64,6 +65,10 @@
&
:last-child
{
border-bottom
:
none
;
}
&
.highlight
{
background
:
#eee
;
}
}
}
...
...
@@ -112,6 +117,9 @@
content
:
none
;
}
}
&
.highlight
{
background
:
#eee
;
}
}
.icon
{
display
:
inline-block
;
...
...
@@ -132,6 +140,7 @@
border-bottom
:
1px
solid
#c8c7cc
;
color
:
#444
;
background
:
#fff
;
&
:last-child
{
margin-bottom
:
0
;
}
...
...
@@ -146,6 +155,7 @@
.question
{
@extend
%qa
;
position
:
relative
;
color
:
#000
;
&
:after
{
content
:
''
;
position
:
absolute
;
...
...
static/sass/me/_suggest.scss
View file @
1e7d0e9
...
...
@@ -123,8 +123,8 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
//发表意见
.create-new-suggest
{
display
:
inline-block
;
color
:
#444
;
display
:
block
;
width
:
100%
;
height
:
pxToRem
(
88px
);
line-height
:
pxToRem
(
88px
);
...
...
@@ -132,7 +132,11 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
font-size
:
pxToRem
(
30px
);
border-top
:
1px
solid
#e0e0e0
;
border-bottom
:
1px
solid
#e0e0e0
;
margin-top
:
-1px
;
a
{
color
:
#444
;
display
:
block
;
}
>
span
{
color
:
#b0b0b0
;
...
...
static/sass/product/_detail.scss
View file @
1e7d0e9
...
...
@@ -100,8 +100,8 @@ $basicBtnC:#eb0313;
margin-left
:
.5px
;
font-size
:
pxToRem
(
23px
);
text-align
:
center
;
line-height
:
pxToRem
(
35px
);
padding
:
0
8px
;
line-height
:
pxToRem
(
33px
);
padding
:
0
5px
;
}
.new-tag
{
background-color
:
#78dc7e
;
...
...
@@ -121,6 +121,7 @@ $basicBtnC:#eb0313;
}
.limit-tag
{
border
:
1px
solid
#000
;
background-color
:
#fff
;
color
:
#000
;
}
.soonSoldOut-tag
{
...
...
@@ -219,6 +220,7 @@ $basicBtnC:#eb0313;
.periodOfMarket
{
font-size
:
pxToRem
(
24px
);
float
:
right
;
color
:
#d0021b
;
h1
{
display
:
inline-block
;
line-height
:
pxToRem
(
88px
);
...
...
@@ -390,9 +392,11 @@ $basicBtnC:#eb0313;
}
}
.recommend-for-you
{
margin-bottom
:
pxToRem
(
12
0px
);
margin-bottom
:
pxToRem
(
3
0px
);
}
}
.bottom-blank
{
height
:
pxToRem
(
120px
);
}
@import
"comments-consults"
;
@import
"product-description"
;
...
...
template/m.yohobuy.com/actions/index/home/suggest.phtml
View file @
1e7d0e9
...
...
@@ -9,7 +9,9 @@
<div
class=
"suggest-content"
id=
"suggest-content"
>
{
{#
suggestContent
}
}
<div
class=
"suggest-item"
data-id=
"{{suggest_id}}"
>
<img
src=
"{{imgUrl}}"
alt=
""
/>
{
{#
imgUrl
}
}
<img
class=
"lazy"
data-original=
"{{.}}"
alt=
""
/>
{
{/
imgUrl
}
}
<h
2
>
{
{title
}
}</h
2
>
<p>
{
{content
}
}</p>
...
...
@@ -42,9 +44,11 @@
{
{/
suggestContent
}
}
</div>
<a
class=
"create-new-suggest"
href=
"./suggestSub"
>
反馈问题<span>(功能意见,界面意见)</span>
</a>
<div
class=
"create-new-suggest"
>
<a
href=
"./suggestSub"
>
反馈问题<span>(功能意见,界面意见)</span>
</a>
</div>
{
{/
suggest
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
1e7d0e9
...
...
@@ -2,7 +2,7 @@
<div
class=
"good-detail-page yoho-page"
>
<div
class=
"banner-container"
>
<div
class=
"tag-container"
>
<!--
<p
class=
"good-tag
soonSoldOut-tag"
>即将售罄
</p>
-->
<!--
<p
class=
"good-tag
new-tag"
>NEW
</p>
-->
{
{#
tags
}
}
{
{#
is_new
}
}
<p
class=
"good-tag new-tag"
>NEW</p>
...
...
@@ -44,12 +44,12 @@
</div>
{
{/
goodsPrice
}
}
{
{#
periodOfMarket
}
}
{
{#
if
periodOfMarket
}
}
<div
class=
"periodOfMarket"
>
<h
1
>上市期:</h
1
>
<h
1
>
{
{
.
}
}</h
1
>
<h
1
>
{
{
peridOfMarket
}
}</h
1
>
</div>
{
{/
periodOfMarket
}
}
{
{/
if
}
}
</div>
{
{#
vipLevel
}
}
...
...
@@ -124,7 +124,7 @@
{
{/if
}
}
<a
href=
"/shoppingCart"
class=
"num-incart iconfont"
>
62
c;</a>
{
{#if
goodsInstore
}
}
<a
href=
"/shoppingCart"
class=
"addto-cart
"
>加入购物车</a>
<a
href=
"/shoppingCart"
id=
"addtoCart"
class=
"addto-cart
"
>加入购物车</a>
{
{else
}
}
<a
href=
"javascript:;"
class=
"sold-out"
>已售罄</a>
{
{/if
}
}
...
...
@@ -132,14 +132,13 @@
<a
href=
"javascript:;"
id=
"likeBtn"
class=
"favorite iconfont {{#isCollect}}liked{{/isCollect}}"
>
605
;</a>
</div>
{
{/cartInfo
}
}
{
{#if
introUrl
}
}
<input
id=
"introUrl"
type=
"hidden"
value=
{
{introUrl
}
}>
{
{/if
}
}
{
{#if
id
}
}
<input
id=
"productId"
type=
"hidden"
value=
{
{id
}
}>
{
{/if
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
{
{>
layout/footer
}
}
<div
class=
"bottom-blank"
></div>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment