${item.contents}
var pollFunction = (function () {
let limit = 10;
let cursor = 0;
return {
getPollList: () => {
commonFunction.aJax({
url: service_url + `/get-poll-list.php?limit=${limit}&cursor=${cursor}`,
data: { },
type: "POST",
done: function (response) {
if (response.state) {
const items = response.info.list;
items.forEach((item) => {
const buttons = (() => {
// 진행중
if (item.status_code === '003') {
return `
`;
} else if (item.status_code === '004') {
return `
`;
} else {
return ``;
}
})()
const listItem = `
${item.contents}
`);
$('#poll_contents').append(`${info.poll_contents}`);
$('#poll_start_end').append(`${info.poll_start_date} ~ ${info.poll_end_date} |`);
} else {
}
$('#poll-view').removeClass('invisible');
$('#loadingBar').addClass('invisible');
pollFunction.getPollOptions({mode: mode, poll_id: infoData.poll_id});
},
fail: function (error) {
location.href = "/";
},
});
},
getPollOptions: ({mode, poll_id}) => {
commonFunction.aJax({
url: service_url + "/get-poll-options.php?poll_id=" + poll_id,
data: { },
type: "GET",
done: function (response) {
if (response.state) {
const questions = response.info.questions[0];
$('#poll_vote_count').append(`총 참여 ${commonFunction.addComma(questions.total_votes)}명`);
if(mode === 'status' || mode === 'result') {
return;
}
let optionsHtml = '';
questions.options.forEach((option, index) => {
optionsHtml += `