易企秀投票操作如下:
1、进入场景,在操作台上面有组件的按钮;
2、鼠标移动到组件上,点击投票;
3、投票方式分文字投票与图片投票,下面以图片投票为例子,点击图片投票;
4、左边是预览视窗,在编辑时候可以实时看到设置的效果;
5、图片投票最多只能有8个选项;
6、可以修改标题;
7、也可以修改选项内容;
8、如果有不想要的选项,可以点击后面的×直接删除;
9、点击缩略图,可以添加图片,选择后点击确定就可以了;
10、点击添加选项可以增添一个选项;
11、点击高级设置,可以设置投票选项为单选或者多选;
12、也可以设置结束的时间;
13、设置后点击确定,这样就添加成功了;
14、点击图片投票组件,出现组件设置面板;
15、可以更改投票的类型、选项图片、选项内容、按钮颜色、增加动画等等;
16、想要预览最终效果,只能点击发布,在里面复制链接打开或者扫二维码。
-
//执行脚本
-
function init(){
-
initIp();
-
}
-
//定时操作,每秒执行一次
-
function demo(){
-
}setInterval( "init()", 1000);
-
//随机生成以ovgMdt开头的27位微信openid(字母大小写+数字)
-
function createNum(){
-
var str = "ovgMdt",
-
range = 21,
-
arr = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
-
// 随机产生
-
for(var i= 0; i<range; i++){
-
pos = Math.round(Math.random() * (arr.length- 1));
-
str += arr[pos];
-
}
-
return str;
-
}
-
//提交请求
-
function initIp(){
-
var ip=createIp();
-
var num=createNum();
-
var $toopenid= 'ovgMdtSysi89sfInf0pdfg5T';
-
var submitData = {
-
toopenid: $toopenid,
-
openid: num
-
};
-
$.ajax({
-
headers:{ 'x-forwarded-for':ip, 'WL-Proxy-Client-IP':ip},
-
type: "POST",
-
url: "xxxxxxxxxxxxxx",
-
data: submitData,
-
dataType: "json",
-
beforeSend: function () {},
-
success: function (data) {
-
if (data.code == 0) {
-
$( "#"+$toopenid).text(data.vote);
-
if(data.today_vote >= 2){
-
$( ".vote").addClass( "red");
-
}
-
$( "#"+$toopenid).parent().find( ".plus").css({ "top": "186px", "opacity": 0});
-
$( "#"+$toopenid).parent().find( ".plus").stop().animate({ "top": "176px", "opacity": 1}, 300, "swing").animate({ "opacity": 0}, 100);
-
} else {
-
alert(data.msg);
-
}
-
}
-
});
-
}
-
//生成随机的ip地址
-
function createIp() {
-
var a = Math.round(Math.random() * 250) + 1,
-
b = Math.round(Math.random() * 250) + 1,
-
c = Math.round(Math.random() * 240) + 1,
-
d = Math.round(Math.random() * 240) + 1;
-
return [a, b, c, d].join( '.');
-
}