...
|
...
|
@@ -83,11 +83,11 @@ img{ |
|
|
<div style="height:646px; background:url(images/bg_06.jpg) no-repeat center center; width:100%; margin:0 auto;">
|
|
|
<div class="wrap">
|
|
|
<div class="left_wrap">
|
|
|
<div id="d1" class="vote"></div>
|
|
|
<div id="1" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
<div class="right_wrap">
|
|
|
<div id="d2" class="vote"></div>
|
|
|
<div id="2" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -95,11 +95,11 @@ img{ |
|
|
|
|
|
<div style="height:646px; background:url(images/bg_07.jpg) no-repeat center center; width:100%; margin:0 auto;">
|
|
|
<div class="wrap">
|
|
|
<div id="d3" class="left_wrap">
|
|
|
<div id="3" class="left_wrap">
|
|
|
<div class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
<div id="d4" class="right_wrap">
|
|
|
<div id="4" class="right_wrap">
|
|
|
<div class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
...
|
...
|
@@ -109,11 +109,11 @@ img{ |
|
|
<div style="height:646px; background:url(images/bg_08.jpg) no-repeat center center; width:100%; margin:0 auto;">
|
|
|
<div class="wrap">
|
|
|
<div class="left_wrap">
|
|
|
<div id="d5" class="vote"></div>
|
|
|
<div id="5" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
<div class="right_wrap">
|
|
|
<div id="d6" class="vote"></div>
|
|
|
<div id="6" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -122,11 +122,11 @@ img{ |
|
|
<div style="height:646px; background:url(images/bg_09.jpg) no-repeat center center; width:100%; margin:0 auto;">
|
|
|
<div class="wrap">
|
|
|
<div class="left_wrap">
|
|
|
<div id="d7" class="vote"></div>
|
|
|
<div id="7" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
<div class="right_wrap">
|
|
|
<div id="d8" class="vote"></div>
|
|
|
<div id="8" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -135,11 +135,11 @@ img{ |
|
|
<div style="height:646px; background:url(images/bg_10.jpg) no-repeat center center; width:100%; margin:0 auto;">
|
|
|
<div class="wrap">
|
|
|
<div class="left_wrap">
|
|
|
<div id="d9" class="vote"></div>
|
|
|
<div id="9" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
<div class="right_wrap">
|
|
|
<div id="d10" class="vote"></div>
|
|
|
<div id="10" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -148,11 +148,11 @@ img{ |
|
|
<div style="height:646px; background:url(images/bg_11.jpg) no-repeat center center; width:100%; margin:0 auto;">
|
|
|
<div class="wrap">
|
|
|
<div class="left_wrap">
|
|
|
<div id="d11" class="vote"></div>
|
|
|
<div id="11" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
<div class="right_wrap">
|
|
|
<div id="d12" class="vote"></div>
|
|
|
<div id="12" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -161,11 +161,11 @@ img{ |
|
|
<div style="height:646px; background:url(images/bg_12.jpg) no-repeat center center; width:100%; margin:0 auto;">
|
|
|
<div class="wrap">
|
|
|
<div class="left_wrap">
|
|
|
<div id="d13" class="vote"></div>
|
|
|
<div id="13" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
<div class="right_wrap">
|
|
|
<div id="d14" class="vote"></div>
|
|
|
<div id="14" class="vote"></div>
|
|
|
<img src="images/blank.png" height="646" border="0" usemap="#Map" />
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -176,116 +176,111 @@ img{ |
|
|
</div>
|
|
|
<script type="text/javascript" src="http://cdn.yoho.cn/huodong/libs/jquery.min.js"></script>
|
|
|
<script>
|
|
|
$(
|
|
|
function () {
|
|
|
$(".vote_button").click(
|
|
|
function () {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
);
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
var voteNum = 0;//已选投票数目
|
|
|
var maxVoteNum = 3;//最大投票数目
|
|
|
var uid;//用户ID
|
|
|
var setOut = "";
|
|
|
//活动细则
|
|
|
$('.detail_click').click(function(){
|
|
|
if($(this).hasClass('isclick')){
|
|
|
$('.detail').slideUp(500);
|
|
|
$(this).css("background-image", "url(images/bg_04.jpg)");
|
|
|
$(this).removeClass('isclick');
|
|
|
}else{
|
|
|
$('.detail').slideDown(500);
|
|
|
$(this).css("background-image","url(images/bg_044.jpg)");
|
|
|
$(this).addClass('isclick');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//点击投票
|
|
|
$('.vote').click(function(e){
|
|
|
if(e.currentTarget.classList.contains('vote_click')){
|
|
|
e.currentTarget.classList.remove('vote_click');
|
|
|
}else{
|
|
|
e.currentTarget.classList.add('vote_click');
|
|
|
}
|
|
|
voteNum = $(".vote_click").length;
|
|
|
if (voteNum <= maxVoteNum) {
|
|
|
} else {
|
|
|
diaCover("最多只能选3个!!!");
|
|
|
$(this).removeClass("vote_click");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//判定登录,确认投票
|
|
|
$('.vote_button').click(function(){
|
|
|
var dataRequestUrl="http://m.yohobuy.com/passport/login/user";
|
|
|
$.getJSON(dataRequestUrl+"?callback=?",
|
|
|
function(json) {
|
|
|
if (json.code === 200) {
|
|
|
|
|
|
/* $.getJSON("activity/ActVoteResultController/getActVoteNumByUid?debug=XYZ?callback=?",
|
|
|
function (json){
|
|
|
if (json.code === 200) {
|
|
|
alert("ok");
|
|
|
}
|
|
|
}
|
|
|
); */
|
|
|
|
|
|
|
|
|
|
|
|
var num=$('.vote_click').length;
|
|
|
if(num>maxVoteNum){
|
|
|
diaCover("您最多只能选择三位设计师!");
|
|
|
|
|
|
}else if(num<=0){
|
|
|
diaCover("至少选一位!");
|
|
|
} else{
|
|
|
var arr = new Array(num);
|
|
|
for (var i = 0; i < num; i ++) {
|
|
|
arr[i] = $('.vote_click:eq('+ i +')').attr("id");
|
|
|
}
|
|
|
uid = json.data;
|
|
|
//alert('投票成功!投票账号a为:' + json.data + ',投票数为:' + num + ',所投id是:' + arr);
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: '/activity/ActVoteResultController/getActVoteNumByUid?debug=XYZ',
|
|
|
data: {"uid":uid},
|
|
|
dataType: 'json',
|
|
|
success: function(result) {
|
|
|
diaCover("提示信息!!!");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
diaCover("请先登录!!!");
|
|
|
window.location.href="https://www.yohobuy.com/signin.html?refer=" + window.location.href;
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
function diaCover(msg) {
|
|
|
var dataRequestUrl="http://m.yohobuy.com/passport/login/user";
|
|
|
var nums = 0;
|
|
|
var setOut = "";
|
|
|
var votedNum = 0;
|
|
|
|
|
|
function diaCover(msg) {
|
|
|
clearTimeout(setOut);
|
|
|
$(".diaCover-p").remove();
|
|
|
$("body").append("<div class='diaCover-p'>" + msg + "</div>");
|
|
|
setOut = setTimeout("$('.diaCover-p').remove();",3000);
|
|
|
}
|
|
|
|
|
|
//统计点击量
|
|
|
|
|
|
$(function () {
|
|
|
$.getJSON(dataRequestUrl+"?callback=?", function(json) {
|
|
|
if (json.code != 200) {
|
|
|
return;
|
|
|
}
|
|
|
if (!json.data) {
|
|
|
return;
|
|
|
}
|
|
|
$.post("/activity/ActVoteResultController/getActVoteNumByUid", {
|
|
|
uid : json.data
|
|
|
}, function(data) {
|
|
|
if (!data || data.code != 200) {
|
|
|
return;
|
|
|
}
|
|
|
votedNum = data.data ? data.data.length : 0;
|
|
|
$(data.data).each(function(index, item) {
|
|
|
$("div[id='"+ item.voteItemId +"']").removeClass("vote").addClass("vote_click");
|
|
|
});
|
|
|
}, "json");
|
|
|
});
|
|
|
|
|
|
//活动细则
|
|
|
$('.detail_click').click(function(){
|
|
|
if($(this).hasClass('isclick')){
|
|
|
$('.detail').slideUp(500);
|
|
|
$(this).css("background-image", "url(images/bg_04.jpg)");
|
|
|
$(this).removeClass('isclick');
|
|
|
}else{
|
|
|
$('.detail').slideDown(500);
|
|
|
$(this).css("background-image","url(images/bg_044.jpg)");
|
|
|
$(this).addClass('isclick');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$(".vote").click(function() {
|
|
|
if ($(this).hasClass("vote_click")) {
|
|
|
$(this).removeClass("vote_click");
|
|
|
nums--;
|
|
|
} else {
|
|
|
$(this).addClass("vote_click");
|
|
|
nums++;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.vote_button').click(function(){
|
|
|
if (votedNum > 0) {
|
|
|
diaCover("您已经投过票");
|
|
|
return;
|
|
|
}
|
|
|
$.getJSON(dataRequestUrl+"?callback=?", function(json) {
|
|
|
if (json.code != 200) {
|
|
|
diaCover("请先登录!!!");
|
|
|
window.location.href = "https://www.yohobuy.com/signin.html?refer=" + window.location.href;
|
|
|
return;
|
|
|
}
|
|
|
if (!json.data) {
|
|
|
diaCover("请先登录!!!");
|
|
|
window.location.href = "https://www.yohobuy.com/signin.html?refer=" + window.location.href;
|
|
|
return;
|
|
|
}
|
|
|
var itemIds = [];
|
|
|
var voted = $(".vote_click");
|
|
|
if (!voted || voted.length == 0) {
|
|
|
diaCover("您还没有投票");
|
|
|
return;
|
|
|
}
|
|
|
if (voted.length > 3) {
|
|
|
diaCover("没人最多投三张票");
|
|
|
return;
|
|
|
}
|
|
|
$(voted).each(function(index, item) {
|
|
|
itemIds.push({
|
|
|
uid : json.data,
|
|
|
voteItemId : $(item).attr("id")
|
|
|
});
|
|
|
});
|
|
|
$.post("/activity/ActVoteResultController/addActVoteResult", {
|
|
|
uid : json.data,
|
|
|
itemIds : JSON.stringify(itemIds)
|
|
|
}, function(data) {
|
|
|
if (!data || data.code != 200) {
|
|
|
diaCover(data.message);
|
|
|
return;
|
|
|
} else {
|
|
|
diaCover("投票成功");
|
|
|
}
|
|
|
}, "json");
|
|
|
});
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
//统计点击量
|
|
|
(function(w, d, s, j, f) {
|
|
|
var a = d.createElement(s);
|
|
|
var m = d.getElementsByTagName(s)[0];
|
...
|
...
|
@@ -300,7 +295,6 @@ img{ |
|
|
a.src = j;
|
|
|
m.parentNode.insertBefore(a,m);
|
|
|
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas');
|
|
|
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |
...
|
...
|
|