Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
lore-w
9 years ago
Commit
a4a192709e4c1ad0d056718c2cd74fdf598d97da
2 parents
54dc0a1f
f016b501
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
36 deletions
static/js/me/order.js
static/js/product/detail/like.js
static/js/product/list.js
static/sass/me/_personal-details.scss
template/m.yohobuy.com/actions/index/home/coupons.phtml
template/m.yohobuy.com/actions/product/detail/index.phtml
static/js/me/order.js
View file @
a4a1927
...
...
@@ -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/product/detail/like.js
View file @
a4a1927
...
...
@@ -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 @
a4a1927
...
...
@@ -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/_personal-details.scss
View file @
a4a1927
...
...
@@ -28,7 +28,6 @@
>
span
{
&
:first-of-type
{
color
:
#444
;
line-height
:
100rem
/
$pxConvertRem
;
}
width
:
42%
;
height
:
100%
;
...
...
template/m.yohobuy.com/actions/index/home/coupons.phtml
View file @
a4a1927
...
...
@@ -15,7 +15,7 @@
{
{^
used
}
}
<div
class=
"null"
>
<i></i>
<p>您还没有
未使用的优惠券
</p>
<p>您还没有
优惠券!
</p>
<a
href=
"{{topURL}}"
>随便逛逛</a>
</div>
{
{/
used
}
}
...
...
@@ -32,7 +32,7 @@
{
{^
unused
}
}
<div
class=
"null"
>
<i></i>
<p>您还没有
已使用的优惠券
</p>
<p>您还没有
使用的优惠券!
</p>
<a
href=
"{{topURL}}"
>随便逛逛</a>
</div>
{
{/
unused
}
}
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
a4a1927
...
...
@@ -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,11 +132,9 @@
<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
}
}
...
...
Please
register
or
login
to post a comment