Authored by michaelcao

update

... ... @@ -135,7 +135,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d1" class="vote"></div>
<div id="1" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_06.jpg">
</div>
... ... @@ -154,7 +154,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d2" class="vote"></div>
<div id="2" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_08.jpg">
</div>
... ... @@ -173,7 +173,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d3" class="vote"></div>
<div id="3" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_10.jpg">
</div>
... ... @@ -192,7 +192,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d4" class="vote"></div>
<div id="4" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_12.jpg">
</div>
... ... @@ -211,7 +211,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d5" class="vote"></div>
<div id="5" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_14.jpg">
</div>
... ... @@ -230,7 +230,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d6" class="vote"></div>
<div id="6" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_16.jpg">
</div>
... ... @@ -249,7 +249,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d7" class="vote"></div>
<div id="7" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_18.jpg">
</div>
... ... @@ -268,7 +268,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d8" class="vote"></div>
<div id="8" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_20.jpg">
</div>
... ... @@ -287,7 +287,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d9" class="vote"></div>
<div id="9" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_22.jpg">
</div>
... ... @@ -306,7 +306,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d10" class="vote"></div>
<div id="10" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_24.jpg">
</div>
... ... @@ -325,7 +325,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d11" class="vote"></div>
<div id="11" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_26.jpg">
</div>
... ... @@ -344,7 +344,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d12" class="vote"></div>
<div id="12" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_28.jpg">
</div>
... ... @@ -363,7 +363,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d13" class="vote"></div>
<div id="13" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_30.jpg">
</div>
... ... @@ -382,7 +382,7 @@
<div class="mod_row">
<a class="anchor" style="width: 44%; height: 15%; left: 0; top: 85%;" href=''></a>
<a class="anchor" style="width: 55%; height: 60%; left: 45%; top: 0;" href=''></a>
<div id="d14" class="vote"></div>
<div id="14" class="vote"></div>
<div class="simple-banner">
<img class="banner-img" src="images/bg_32.jpg">
</div>
... ... @@ -412,56 +412,137 @@
<script type="text/javascript" src="http://cdn.yoho.cn/huodong/libs/jquery.min.js"></script>
<script type="text/javascript">
var voteNum = 0;//已选投票数目
var limitVoteNum = 3;//最大投票数目
var uid;//用户ID
var setOut = "";
//活动细则
$('.detail_click').click(function(){
if($(this).hasClass('isclick')){
$('.detail').slideUp(500);
$('.icon').attr('src','images/bg_03.jpg');
$(this).removeClass('isclick');
}else{
$('.detail').slideDown(500);
$('.icon').attr('src','images/bg_033.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 <= limitVoteNum) {
//alert(voteNum);
} else {
diaCover("最多只能选3个!!!");
$(this).removeClass("vote_click");
}
});
var dataRequestUrl="http://m.yohobuy.com/passport/login/user";
var nums = 0;
var setOut = "";
var votedNum = 0;
//AJAX获取数据
// $.ajax({
// url:"",
// type:"post",
// data:"",
// success: function () {
// },
// error:function(){
// },
// complete:function(){
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 +"']").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++;
}
});
$('#float_bottom').click(function(){
if (votedNum > 0) {
diaCover("您已经投过票");
return;
}
$.getJSON(dataRequestUrl+"?callback=?", function(json) {
if (json.code != 200) {
diaCover("请先登录!!!");
var jumpURL = window.location.href;
var url = "https://m.yohobuy.com/signin.html?openby:yohobuy={'action':'go.weblogin','params':{'jumpurl':{'url':"+jumpURL+",'param':{'from':'app'}},'requesturl':{'url':'','param':{}},'priority':'Y'}}";
window.location.href=url;
return;
}
if (!json.data) {
diaCover("请先登录!!!");
var jumpURL = window.location.href;
var url = "https://m.yohobuy.com/signin.html?openby:yohobuy={'action':'go.weblogin','params':{'jumpurl':{'url':"+jumpURL+",'param':{'from':'app'}},'requesturl':{'url':'','param':{}},'priority':'Y'}}";
window.location.href=url;
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];
// }
w.YohoAcquisitionObject = f;
// });
w[f] = function() {
w[f].p = arguments;
};
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a,m);
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas');
/*
//判定登录,确认投票
$('#float_bottom').click(function(){
var dataRequestUrl="http://m.yohobuy.com/passport/login/user";
... ... @@ -484,37 +565,15 @@
}
} else {
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"}}`;
var jumpURL = window.location.href;
var url = "https://m.yohobuy.com/signin.html?openby:yohobuy={'action':'go.weblogin','params':{'jumpurl':{'url':"+jumpURL+",'param':{'from':'app'}},'requesturl':{'url':'','param':{}},'priority':'Y'}}";
window.location.href=url;
}
}
);
});
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) {
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
}); */
w.YohoAcquisitionObject = f;
w[f] = function() {
w[f].p = arguments;
};
a.async = 1;
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>
... ...
... ... @@ -204,7 +204,7 @@ img{
}
votedNum = data.data ? data.data.length : 0;
$(data.data).each(function(index, item) {
$("div[id='"+ item.voteItemId +"']").removeClass("vote").addClass("vote_click");
$("div[id='"+ item.voteItemId +"']").addClass("vote_click");
});
}, "json");
});
... ... @@ -255,7 +255,7 @@ img{
return;
}
if (voted.length > 3) {
diaCover("人最多投三张票");
diaCover("人最多投三张票");
return;
}
$(voted).each(function(index, item) {
... ...