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
329c57496ec1d640a8db7fc5dc9a4cd9a0f91779
1 parent
7a87d814
加价购增加信息读取
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
33 deletions
static/js/cart/gift-advance.js
template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
template/m.yohobuy.com/partials/cart/gift-advance-good.phtml
static/js/cart/gift-advance.js
View file @
329c574
...
...
@@ -5,25 +5,48 @@
*/
var
$
=
require
(
'jquery'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
lazyLoad
=
require
(
'yoho.lazyload'
),
Handlebars
=
require
(
'yoho.handlebars'
),
tip
=
require
(
'../plugin/tip'
),
chosePanel
=
require
(
'./chose-panel'
);
//var chosePanel = require('./chose-panel');
var
panelTmpl
,
$page
=
$
(
'.gift-advance-page'
),
$chosePanel
=
$
(
'#chose-panel'
);
lazyLoad
(
$
(
'.lazy'
));
//$('.gift-advance-page').on('touchstart', '.chose', function() {
// var id = $(this).closest('.gift-advance-good').data('id');
//
// $.ajax({
// type: 'GET',
// url: '/shoppingCart/goodinfo',
// data: {
// id: id
// },
// success: function(data) {
// if (data.code === 200) {
// chosePanel.show(data.data);
// }
// }
// });
//});
\ No newline at end of file
$
.
get
(
'/cart/index/giftinfoTpl'
,
function
(
html
)
{
if
(
!
html
)
{
tip
.
show
(
'网络错误'
);
return
;
}
panelTmpl
=
Handlebars
.
compile
(
html
);
}).
fail
(
function
()
{
tip
.
show
(
'网络错误'
);
});
function
getProductInfo
(
skn
,
promotionId
)
{
$
.
get
(
'/cart/index/giftinfo'
,
{
skn
:
skn
,
promotionId
:
promotionId
}).
then
(
function
(
res
)
{
if
(
!
res
)
{
tip
.
show
(
'网络错误'
);
return
;
}
console
.
log
(
res
);
$chosePanel
.
html
(
panelTmpl
(
res
));
chosePanel
.
show
();
}).
fail
(
function
()
{
tip
.
show
(
'网络错误'
);
});
}
$page
.
on
(
'touchend'
,
'.chose'
,
function
()
{
var
$this
=
$
(
this
),
id
=
$this
.
closest
(
'.gift-advance-good'
).
data
(
'id'
),
promotionId
=
$this
.
closest
(
'.advance-block'
).
data
(
'promotion-id'
);
getProductInfo
(
id
,
promotionId
);
});
...
...
template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
View file @
329c574
...
...
@@ -2,7 +2,7 @@
<div
class=
"gift-advance-page yoho-page"
>
{
{#if
advanceBuyPage
}
}
{
{#
advanceBuy
}
}
<div
class=
"advance-block"
>
<div
class=
"advance-block"
data-promotion-id=
"{{promotionId}}"
>
<p
class=
"title"
>
{
{title
}
}</p>
{
{#goods
}
}
{
{>
cart/gift-advance-good
}
}
...
...
@@ -15,6 +15,6 @@
{
{/
gift
}
}
{
{/if
}
}
<div
id=
"chose-panel"
></div>
</div>
{
{>
layout/footer
}
}
...
...
template/m.yohobuy.com/partials/cart/gift-advance-good.phtml
View file @
329c574
...
...
@@ -6,19 +6,6 @@
<div class="deps">
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
<span class="color">
颜色:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
尺码:{{size}}
</span>
{{/if}}
</p>
<p class="row">
<span class="price">
¥{{price}}
</span>
...
...
Please
register
or
login
to post a comment