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
Email Patches
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
4345c1cc84151db043286743c8f7a9be7a272da8
1 parent
7768455a
购物车功能开发
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
20 deletions
static/js/cart/good.js
static/sass/cart/_index.scss
template/m.yohobuy.com/partials/cart/cart-content.phtml
static/js/cart/good.js
View file @
4345c1c
...
...
@@ -12,7 +12,6 @@ var $ = require('jquery'),
var
dialog
=
require
(
'../me/dialog'
),
tip
=
require
(
'../plugin/tip'
);
var
$names
;
//var $curDelPanel;
...
...
@@ -55,25 +54,26 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
}
else
{
$this
.
removeClass
(
'icon-checkbox'
).
addClass
(
'icon-cb-checked'
);
}
}
$
.
ajax
({
type
:
'GET'
,
url
:
'/cart/index/getCartData'
,
data
:
{
id
:
id
},
success
:
function
(
data
)
{
if
(
data
)
{
$
(
'#good-totalprice'
).
html
(
'¥'
+
data
.
commonCart
.
price
);
$
(
'#good-activityPrice'
).
html
(
'¥'
+
data
.
commonCart
.
activityPrice
);
$
(
'#good-total'
).
html
(
data
.
commonCart
.
count
+
'件总计:¥'
+
data
.
commonCart
.
sumPrice
);
$
.
ajax
({
type
:
'GET'
,
url
:
'/cart/index/getCartData'
,
data
:
{
skuList
:
JSON
.
stringfy
(
id
)
},
success
:
function
(
data
)
{
if
(
data
)
{
$
(
'#good-totalprice'
).
html
(
'¥'
+
data
.
commonCart
.
price
);
$
(
'#good-activityPrice'
).
html
(
'¥'
+
data
.
commonCart
.
activityPrice
);
$
(
'#good-total'
).
html
(
'总计:¥'
+
data
.
commonCart
.
sumPrice
+
' ('
+
data
.
commonCart
.
count
+
'件)'
);
}
},
error
:
function
()
{
tip
.
show
(
'网络错误'
);
}
},
error
:
function
()
{
tip
.
show
(
'网络错误'
);
}
});
});
}
else
if
(
data
.
code
===
200
)
{
tip
.
show
(
'网络错误'
);
}
}).
fail
(
function
()
{
tip
.
show
(
'网络错误'
);
});
...
...
static/sass/cart/_index.scss
View file @
4345c1c
...
...
@@ -157,6 +157,7 @@
display
:
block
;
height
:
40rem
/
$pxConvertRem
;
line-height
:
40rem
/
$pxConvertRem
;
color
:
#d0253b
;
}
.tip
{
...
...
template/m.yohobuy.com/partials/cart/cart-content.phtml
View file @
4345c1c
...
...
@@ -52,7 +52,7 @@
<span class="iconfont icon-cb-checked"></span>
<p>
<span id="good-total">
{{count}}件总计:¥{{sumPrice}}
总计:¥{{sumPrice}} ({{count}}件)
</span>
<span class="tip">(不含运费)</span>
</p>
...
...
Please
register
or
login
to post a comment