Showing
2 changed files
with
58 additions
and
13 deletions
@@ -63,7 +63,21 @@ | @@ -63,7 +63,21 @@ | ||
63 | background: url("images/click_on.jpg") 0 0 no-repeat; | 63 | background: url("images/click_on.jpg") 0 0 no-repeat; |
64 | background-size: 100%; | 64 | background-size: 100%; |
65 | } | 65 | } |
66 | - | 66 | + .diaCover-p{ |
67 | + position: fixed; | ||
68 | + background: black; | ||
69 | + top: 50px; | ||
70 | + font-size: 15px; | ||
71 | + left: 50%; | ||
72 | + height: 40px; | ||
73 | + width: 400px; | ||
74 | + margin-left: -200px; | ||
75 | + color: white; | ||
76 | + text-align: center; | ||
77 | + line-height: 40px; | ||
78 | + border-radius: 10px; | ||
79 | + opacity: 0.8; | ||
80 | + } | ||
67 | </style> | 81 | </style> |
68 | </head> | 82 | </head> |
69 | <body class="keBody"> | 83 | <body class="keBody"> |
@@ -400,6 +414,8 @@ | @@ -400,6 +414,8 @@ | ||
400 | <script type="text/javascript"> | 414 | <script type="text/javascript"> |
401 | var voteNum = 0;//已选投票数目 | 415 | var voteNum = 0;//已选投票数目 |
402 | var limitVoteNum = 3;//最大投票数目 | 416 | var limitVoteNum = 3;//最大投票数目 |
417 | + var uid;//用户ID | ||
418 | + var setOut = ""; | ||
403 | //活动细则 | 419 | //活动细则 |
404 | $('.detail_click').click(function(){ | 420 | $('.detail_click').click(function(){ |
405 | if($(this).hasClass('isclick')){ | 421 | if($(this).hasClass('isclick')){ |
@@ -424,7 +440,7 @@ | @@ -424,7 +440,7 @@ | ||
424 | if (voteNum <= limitVoteNum) { | 440 | if (voteNum <= limitVoteNum) { |
425 | //alert(voteNum); | 441 | //alert(voteNum); |
426 | } else { | 442 | } else { |
427 | - alert("最多只能选3个!!!"); | 443 | + diaCover("最多只能选3个!!!"); |
428 | $(this).removeClass("vote_click"); | 444 | $(this).removeClass("vote_click"); |
429 | } | 445 | } |
430 | }); | 446 | }); |
@@ -455,18 +471,19 @@ | @@ -455,18 +471,19 @@ | ||
455 | var num=$('.vote_click').length; | 471 | var num=$('.vote_click').length; |
456 | //alert(num); | 472 | //alert(num); |
457 | if(num>limitVoteNum){ | 473 | if(num>limitVoteNum){ |
458 | - alert('您最多只能选择三位设计师!'); | 474 | + diaCover("您最多只能选择三位设计师!"); |
459 | }else if(num<=0){ | 475 | }else if(num<=0){ |
460 | - alert('至少选一位!'); | 476 | + diaCover("至少选一位!"); |
461 | } else{ | 477 | } else{ |
462 | var arr = new Array(num); | 478 | var arr = new Array(num); |
463 | for (var i = 0; i < num; i ++) { | 479 | for (var i = 0; i < num; i ++) { |
464 | arr[i] = $('.vote_click:eq('+ i +')').attr("id"); | 480 | arr[i] = $('.vote_click:eq('+ i +')').attr("id"); |
465 | } | 481 | } |
466 | - alert('投票成功!投票账号a为:' + json.data + ',投票数为:' + num + ',所投id是:' + arr); | 482 | + uid = json.data; |
483 | + //diaCover('投票成功!投票账号a为:' + json.data + ',投票数为:' + num + ',所投id是:' + arr); | ||
467 | } | 484 | } |
468 | } else { | 485 | } else { |
469 | - alert("请先登录!!!"); | 486 | + diaCover("请先登录!!!"); |
470 | 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"}}`; | 487 | 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"}}`; |
471 | window.location.href=url; | 488 | window.location.href=url; |
472 | } | 489 | } |
@@ -474,6 +491,12 @@ | @@ -474,6 +491,12 @@ | ||
474 | ); | 491 | ); |
475 | }); | 492 | }); |
476 | 493 | ||
494 | + function diaCover(msg) { | ||
495 | + clearTimeout(setOut); | ||
496 | + $(".diaCover-p").remove(); | ||
497 | + $("body").append("<div class='diaCover-p'>" + msg + "</div>"); | ||
498 | + setOut = setTimeout("$('.diaCover-p').remove();",3000); | ||
499 | + } | ||
477 | 500 | ||
478 | 501 | ||
479 | 502 |
@@ -52,7 +52,21 @@ img{ | @@ -52,7 +52,21 @@ img{ | ||
52 | /*text-align: center;*/ | 52 | /*text-align: center;*/ |
53 | cursor: pointer; | 53 | cursor: pointer; |
54 | } | 54 | } |
55 | - | 55 | +.diaCover-p{ |
56 | + position: fixed; | ||
57 | + background: black; | ||
58 | + top: 50px; | ||
59 | + font-size: 15px; | ||
60 | + left: 50%; | ||
61 | + height: 40px; | ||
62 | + width: 400px; | ||
63 | + margin-left: -200px; | ||
64 | + color: white; | ||
65 | + text-align: center; | ||
66 | + line-height: 40px; | ||
67 | + border-radius: 10px; | ||
68 | + opacity: 0.8; | ||
69 | +} | ||
56 | </style> | 70 | </style> |
57 | </head> | 71 | </head> |
58 | 72 | ||
@@ -185,6 +199,7 @@ img{ | @@ -185,6 +199,7 @@ img{ | ||
185 | var voteNum = 0;//已选投票数目 | 199 | var voteNum = 0;//已选投票数目 |
186 | var maxVoteNum = 3;//最大投票数目 | 200 | var maxVoteNum = 3;//最大投票数目 |
187 | var uid;//用户ID | 201 | var uid;//用户ID |
202 | + var setOut = ""; | ||
188 | //活动细则 | 203 | //活动细则 |
189 | $('.detail_click').click(function(){ | 204 | $('.detail_click').click(function(){ |
190 | if($(this).hasClass('isclick')){ | 205 | if($(this).hasClass('isclick')){ |
@@ -207,9 +222,8 @@ img{ | @@ -207,9 +222,8 @@ img{ | ||
207 | } | 222 | } |
208 | voteNum = $(".vote_click").length; | 223 | voteNum = $(".vote_click").length; |
209 | if (voteNum <= maxVoteNum) { | 224 | if (voteNum <= maxVoteNum) { |
210 | - //alert(voteNum); | ||
211 | } else { | 225 | } else { |
212 | - alert("最多只能选3个!!!"); | 226 | + diaCover("最多只能选3个!!!"); |
213 | $(this).removeClass("vote_click"); | 227 | $(this).removeClass("vote_click"); |
214 | } | 228 | } |
215 | }); | 229 | }); |
@@ -233,9 +247,10 @@ img{ | @@ -233,9 +247,10 @@ img{ | ||
233 | 247 | ||
234 | var num=$('.vote_click').length; | 248 | var num=$('.vote_click').length; |
235 | if(num>maxVoteNum){ | 249 | if(num>maxVoteNum){ |
236 | - alert('您最多只能选择三位设计师!'); | 250 | + diaCover("您最多只能选择三位设计师!"); |
251 | + | ||
237 | }else if(num<=0){ | 252 | }else if(num<=0){ |
238 | - alert('至少选一位!'); | 253 | + diaCover("至少选一位!"); |
239 | } else{ | 254 | } else{ |
240 | var arr = new Array(num); | 255 | var arr = new Array(num); |
241 | for (var i = 0; i < num; i ++) { | 256 | for (var i = 0; i < num; i ++) { |
@@ -249,12 +264,12 @@ img{ | @@ -249,12 +264,12 @@ img{ | ||
249 | data: {"uid":uid}, | 264 | data: {"uid":uid}, |
250 | dataType: 'json', | 265 | dataType: 'json', |
251 | success: function(result) { | 266 | success: function(result) { |
252 | - alert("ok"); | 267 | + diaCover("提示信息!!!"); |
253 | } | 268 | } |
254 | }); | 269 | }); |
255 | } | 270 | } |
256 | } else { | 271 | } else { |
257 | - alert("请先登录!!!"); | 272 | + diaCover("请先登录!!!"); |
258 | window.location.href="https://www.yohobuy.com/signin.html?refer=" + window.location.href; | 273 | window.location.href="https://www.yohobuy.com/signin.html?refer=" + window.location.href; |
259 | } | 274 | } |
260 | } | 275 | } |
@@ -263,6 +278,13 @@ img{ | @@ -263,6 +278,13 @@ img{ | ||
263 | 278 | ||
264 | }); | 279 | }); |
265 | 280 | ||
281 | + function diaCover(msg) { | ||
282 | + clearTimeout(setOut); | ||
283 | + $(".diaCover-p").remove(); | ||
284 | + $("body").append("<div class='diaCover-p'>" + msg + "</div>"); | ||
285 | + setOut = setTimeout("$('.diaCover-p').remove();",3000); | ||
286 | + } | ||
287 | + | ||
266 | //统计点击量 | 288 | //统计点击量 |
267 | (function(w, d, s, j, f) { | 289 | (function(w, d, s, j, f) { |
268 | var a = d.createElement(s); | 290 | var a = d.createElement(s); |
-
Please register or login to post a comment