...
|
...
|
@@ -12,11 +12,28 @@ |
|
|
<link rel="stylesheet" type="text/css" href="css/style.css"/>
|
|
|
<script type="text/javascript" src="js/jquery.min.js"></script>
|
|
|
<script type="text/javascript" src="js/autoSize.js"></script>
|
|
|
<style>
|
|
|
.diaCover-p{
|
|
|
position: fixed;
|
|
|
background: black;
|
|
|
top: 50px;
|
|
|
font-size: 15px;
|
|
|
left: 50%;
|
|
|
height: 40px;
|
|
|
width: 400px;
|
|
|
margin-left: -200px;
|
|
|
color: white;
|
|
|
text-align: center;
|
|
|
line-height: 40px;
|
|
|
border-radius: 10px;
|
|
|
opacity: 0.8;
|
|
|
}
|
|
|
</style>
|
|
|
<script>
|
|
|
var uid;//用户ID
|
|
|
var setOut = "";
|
|
|
$(
|
|
|
function () {
|
|
|
|
|
|
//判定登录
|
|
|
var dataRequestUrl="http://m.yohobuy.com/passport/login/user";
|
|
|
$.getJSON(dataRequestUrl+"?callback=?",
|
...
|
...
|
@@ -34,16 +51,15 @@ |
|
|
$(".good-c .add-btn").click(
|
|
|
function () {
|
|
|
var skn = $(this).parents("li").attr("sknNum");
|
|
|
alert (skn);
|
|
|
$.ajax({
|
|
|
url: '/activity/favorite/addFavorite?productSkn=' + skn +'&uid=' + uid,
|
|
|
type: "get",
|
|
|
dataType: 'json',
|
|
|
success: function (data) {
|
|
|
if (data.code === 200) {
|
|
|
alert(data.message);
|
|
|
diaCover(data.message);
|
|
|
} else {
|
|
|
alert(data.message);
|
|
|
diaCover(data.message);
|
|
|
}
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -51,6 +67,13 @@ |
|
|
);
|
|
|
}
|
|
|
);
|
|
|
function diaCover(msg) {
|
|
|
clearTimeout(setOut);
|
|
|
$(".diaCover-p").remove();
|
|
|
$("body").append("<div class='diaCover-p'>" + msg + "</div>");
|
|
|
setOut = setTimeout("$('.diaCover-p').remove();",3000);
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
...
|
...
|
|