Authored by lijing

交互

... ... @@ -63,7 +63,21 @@
background: url("images/click_on.jpg") 0 0 no-repeat;
background-size: 100%;
}
.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>
</head>
<body class="keBody">
... ... @@ -400,6 +414,8 @@
<script type="text/javascript">
var voteNum = 0;//已选投票数目
var limitVoteNum = 3;//最大投票数目
var uid;//用户ID
var setOut = "";
//活动细则
$('.detail_click').click(function(){
if($(this).hasClass('isclick')){
... ... @@ -424,7 +440,7 @@
if (voteNum <= limitVoteNum) {
//alert(voteNum);
} else {
alert("最多只能选3个!!!");
diaCover("最多只能选3个!!!");
$(this).removeClass("vote_click");
}
});
... ... @@ -455,18 +471,19 @@
var num=$('.vote_click').length;
//alert(num);
if(num>limitVoteNum){
alert('您最多只能选择三位设计师!');
diaCover("您最多只能选择三位设计师!");
}else if(num<=0){
alert('至少选一位!');
diaCover("至少选一位!");
} else{
var arr = new Array(num);
for (var i = 0; i < num; i ++) {
arr[i] = $('.vote_click:eq('+ i +')').attr("id");
}
alert('投票成功!投票账号a为:' + json.data + ',投票数为:' + num + ',所投id是:' + arr);
uid = json.data;
//diaCover('投票成功!投票账号a为:' + json.data + ',投票数为:' + num + ',所投id是:' + arr);
}
} else {
alert("请先登录!!!");
diaCover("请先登录!!!");
var url = `https://m.yohobuy.com/signin.html?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/localhost\/YOHOPE\/index.html","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"Y"}}`;
window.location.href=url;
}
... ... @@ -474,6 +491,12 @@
);
});
function diaCover(msg) {
clearTimeout(setOut);
$(".diaCover-p").remove();
$("body").append("<div class='diaCover-p'>" + msg + "</div>");
setOut = setTimeout("$('.diaCover-p').remove();",3000);
}
... ...
... ... @@ -52,7 +52,21 @@ img{
/*text-align: center;*/
cursor: pointer;
}
.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>
</head>
... ... @@ -185,6 +199,7 @@ img{
var voteNum = 0;//已选投票数目
var maxVoteNum = 3;//最大投票数目
var uid;//用户ID
var setOut = "";
//活动细则
$('.detail_click').click(function(){
if($(this).hasClass('isclick')){
... ... @@ -207,9 +222,8 @@ img{
}
voteNum = $(".vote_click").length;
if (voteNum <= maxVoteNum) {
//alert(voteNum);
} else {
alert("最多只能选3个!!!");
diaCover("最多只能选3个!!!");
$(this).removeClass("vote_click");
}
});
... ... @@ -233,9 +247,10 @@ img{
var num=$('.vote_click').length;
if(num>maxVoteNum){
alert('您最多只能选择三位设计师!');
diaCover("您最多只能选择三位设计师!");
}else if(num<=0){
alert('至少选一位!');
diaCover("至少选一位!");
} else{
var arr = new Array(num);
for (var i = 0; i < num; i ++) {
... ... @@ -249,12 +264,12 @@ img{
data: {"uid":uid},
dataType: 'json',
success: function(result) {
alert("ok");
diaCover("提示信息!!!");
}
});
}
} else {
alert("请先登录!!!");
diaCover("请先登录!!!");
window.location.href="https://www.yohobuy.com/signin.html?refer=" + window.location.href;
}
}
... ... @@ -262,6 +277,13 @@ img{
});
function diaCover(msg) {
clearTimeout(setOut);
$(".diaCover-p").remove();
$("body").append("<div class='diaCover-p'>" + msg + "</div>");
setOut = setTimeout("$('.diaCover-p').remove();",3000);
}
//统计点击量
(function(w, d, s, j, f) {
... ...