huanggang hace 7 años
padre
commit
8391e5f574
Se han modificado 2 ficheros con 442 adiciones y 118 borrados
  1. 172 37
      data/resource/mobile/ugc/css/main.css
  2. 270 81
      data/resource/mobile/ugc/js/main.js

+ 172 - 37
data/resource/mobile/ugc/css/main.css

@@ -15,7 +15,8 @@ time, mark, audio, video {
   border: 0;
   outline: 0;
   vertical-align: baseline;
-  background: transparent; }
+  background: transparent;
+  -webkit-tap-highlight-color: transparent; }
 
 body {
   line-height: 1; }
@@ -24,7 +25,7 @@ body {
   outline: 1; }
 
 article, aside, canvas, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section, summary {
+footer, header, hgroup, menu, nav, section, summary, video {
   display: block; }
 
 nav ul {
@@ -46,7 +47,8 @@ a {
   vertical-align: baseline;
   background: transparent;
   text-decoration: none;
-  color: inherit; }
+  color: inherit;
+  -webkit-tap-highlight-color: transparent; }
 
 ins {
   background-color: #ff9;
@@ -86,30 +88,30 @@ body {
   padding-right: 50px;
   font-family: "PingFang SC Light", "Heiti SC";
   color: #000000;
-  padding-bottom: 100px; }
+  padding-bottom: 97px; }
 
 img {
   width: 100%; }
 
-.title, .thumbnail, .thumbnail .thumbnail_image, .comment .comment_list, .comment .comment_list .comment_item, .comment .comment_list .comment_item .subject .subject_name, .vote .vote_options, .vote .vote_options .vote_option, .vote .results .result .status .status_line {
+.title, .thumbnail, .thumbnail .thumbnail_image, .comment .comment_list, .comment .comment_list .comment_item, .comment .comment_list .comment_item .subject .subject_name, .vote .vote_options, .vote .vote_options .vote_option, .vote .results .result .status .status_line, .question_list .question_options, .question_list .question_options .question_option, .bottom_flex .comment_label {
   position: relative; }
 
 .bottom_flex {
   position: fixed; }
 
-.title span.br, .thumbnail .play_icon, .thumbnail .thumbnail_image .play_icon, .comment .comment_list .br, .comment .comment_list .comment_item .br, .pop .answer_comments, .vote .vote_options .vote_option:after, .vote .results .result .status .status_line .stat, .vote .results .result .status .status_line .status_bg {
+.title span.br, .thumbnail video, .thumbnail .play_icon, .thumbnail .thumbnail_image .play_icon, .comment .comment_list .br, .comment .comment_list .comment_item .br, .pop .answer_comments, .pop .bonus_page, .pop .close_icon, .vote .vote_options .vote_option:after, .vote .results .result .status .status_line .stat, .vote .results .result .status .status_line .status_bg, .question_list .question_options .question_option:after, .bottom_flex .comment_label .superscript {
   position: absolute; }
 
 .bonus_icon {
   margin: 0 auto; }
 
-.comment .pro .pro_title, .comment .comment_list .comment_item .subject .subject_box, .comment .comment_list .comment_item .subject .subject_image, .comment .comment_list .comment_item .subject .subject_name, .pop .handle .close, .vote .vote_pro .vote_question {
+.author .author_msg, .comment .pro .pro_title, .comment .comment_list .comment_item .subject .subject_box, .comment .comment_list .comment_item .subject .subject_image, .comment .comment_list .comment_item .subject .subject_name, .pop .handle .close, .vote .vote_pro .vote_question, .question_list .question_pro .question_title, .bottom_flex .msg_btn {
   float: left; }
 
-.comment .comment_list .comment_item .subject .like, .pop .handle .submit, .vote .vote_pro .vote_type {
+.author .focus, .comment .comment_list .comment_item .subject .like, .pop .handle .submit, .vote .vote_pro .vote_type, .question_list .question_pro .question_type {
   float: right; }
 
-.comment .pro, .comment .comment_list .comment_item .subject, .pop .handle, .vote .vote_options .vote_option, .vote .vote_pro {
+.author, .comment .pro, .comment .comment_list .comment_item .subject, .pop .handle, .vote .vote_options .vote_option, .vote .vote_pro, .question_list .question_options .question_option, .question_list .question_pro {
   overflow: hidden; }
 
 .like_icon_null {
@@ -138,18 +140,32 @@ img {
   height: 50px;
   margin-right: 20px;
   vertical-align: middle; }
-
-article {
-  font-size: 28px;
-  line-height: 52px;
-  letter-spacing: 2px;
-  margin-top: 27px;
-  text-align: justify; }
+.author .focus {
+  text-align: center;
+  width: 100px;
+  height: 40px;
+  line-height: 40px;
+  margin-top: 23px;
+  cursor: pointer;
+  border: 1px solid #000;
+  border-radius: 10px;
+  font-size: 24px; }
+.author .focus.active {
+  color: #fff;
+  background: red;
+  border: none; }
 
 .thumbnail {
   margin-top: 47px; }
+.thumbnail .video_box {
+  overflow: hidden;
+  width: 500px;
+  height: 380px; }
 .thumbnail video {
-  width: 100%;
+  font-size: 28px;
+  top: 0;
+  left: 0;
+  width: 650px;
   height: 380px; }
 .thumbnail .play_icon {
   background: url("../images/play_icon.png") no-repeat;
@@ -171,7 +187,7 @@ article {
   margin-top: -54px; }
 .thumbnail .thumbnail_pro {
   font-size: 28px;
-  margin-top: 33px; }
+  margin-top: 10px; }
 
 .bonus_icon {
   display: block;
@@ -240,19 +256,40 @@ article {
   position: fixed;
   left: 0;
   top: 0;
+  right: 0;
+  bottom: 0;
   display: none;
-  width: 100%;
-  height: 100%;
-  background: rgba(0, 0, 0, 0.3);
+  background: rgba(0, 0, 0, 0.6);
   z-index: 1000;
   font-size: 28px; }
 .pop .answer_comments {
+  display: none;
   width: 100%;
-  bottom: 50px;
+  bottom: 0;
   left: 0; }
+.pop .bonus_page {
+  display: none;
+  width: 397px;
+  height: 659px;
+  top: 227px;
+  left: 50%;
+  margin-left: -198px;
+  background: url("../images/bonus_page.png") no-repeat;
+  background-size: 100%;
+  z-index: 1001; }
+.pop .close_icon {
+  display: none;
+  width: 40px;
+  height: 40px;
+  top: 40px;
+  right: 40px;
+  margin-left: -198px;
+  background: url("../images/close_icon.jpg") no-repeat;
+  background-size: 100%;
+  z-index: 1001; }
 .pop .msg_num {
   font-size: 24px;
-  height: 30px;
+  height: 40px;
   background: #fff;
   text-align: right; }
 .pop .msg_num p {
@@ -276,8 +313,7 @@ article {
   background: #fff;
   font-size: 28px; }
 .pop .handle .close {
-  padding: 20px;
-  color: #c7c7c7; }
+  padding: 20px; }
 .pop .handle .submit {
   padding: 20px; }
 
@@ -329,6 +365,7 @@ article {
 .vote .vote_pro {
   margin-bottom: 37px; }
 .vote .vote_pro .vote_question {
+  width: 450px;
   font-size: 32px; }
 .vote .vote_pro .vote_type {
   font-size: 28px; }
@@ -372,6 +409,61 @@ article {
   padding-left: 25px;
   vertical-align: middle; }
 
+.question_list {
+  margin-top: 58px;
+  font-size: 28px; }
+.question_list .question {
+  margin-top: 58px; }
+.question_list .question_options {
+  border: 1px solid #9B9B9B;
+  padding-bottom: 36px;
+  padding-top: 15px; }
+.question_list .question_options .question_option {
+  display: table;
+  padding: 25px 0;
+  width: 580px;
+  margin: 0 auto; }
+.question_list .question_options .question_option label {
+  display: block;
+  width: 100%;
+  height: auto; }
+.question_list .question_options .question_option label .check {
+  display: table-cell;
+  vertical-align: middle;
+  width: 20px;
+  min-height: 88px;
+  border: none;
+  background: url(../images/icon-radio.png) no-repeat left center transparent;
+  background-size: 100%;
+  border-radius: 0;
+  appearance: none;
+  -moz-appearance: none;
+  -webkit-appearance: none;
+  padding: 0;
+  margin: 0; }
+.question_list .question_options .question_option label .check:checked {
+  background-image: url(../images/icon-radio-checked.png); }
+.question_list .question_options .question_option label .label {
+  display: table-cell;
+  vertical-align: middle;
+  width: 560px;
+  text-align: justify;
+  padding-left: 20px; }
+.question_list .question_options .question_option:after {
+  content: "";
+  width: 100%;
+  height: 1px;
+  background: #C7C7C7;
+  left: 0;
+  bottom: 0; }
+.question_list .question_pro {
+  margin-bottom: 37px; }
+.question_list .question_pro .question_title {
+  width: 450px;
+  font-size: 32px; }
+.question_list .question_pro .question_type {
+  font-size: 28px; }
+
 .button_default, .button_vote, .button_null {
   display: block;
   width: 650px;
@@ -398,22 +490,36 @@ article {
   line-height: 97px;
   background: #fff;
   color: #9B9B9B;
-  padding-left: 33px; }
-.bottom_flex:after {
-  content: "";
-  width: 100%;
-  height: 1px;
-  background: #C7C7C7;
-  position: absolute;
-  top: 0;
-  left: 0; }
+  padding-left: 33px;
+  box-shadow: 0 7px 30px #999999; }
 .bottom_flex a {
   display: inline-block;
-  margin-right: 30px; }
+  margin-right: 60px; }
+.bottom_flex .comment_label .superscript {
+  right: -24px;
+  top: 23px;
+  width: 41px;
+  height: 26px;
+  line-height: 26px;
+  border-radius: 20px;
+  background: red;
+  color: #fff;
+  text-align: center;
+  font-size: 20px; }
 .bottom_flex a.active {
   color: #F95858; }
 .bottom_flex .like_icon_null, .bottom_flex .share_icon_null, .bottom_flex .msg_icon_null {
-  vertical-align: text-bottom; }
+  vertical-align: middle; }
+.bottom_flex .msg_btn {
+  width: 300px;
+  height: 65px;
+  line-height: 65px;
+  background: #e8e8e8;
+  color: #a0a0a0;
+  border-radius: 20px;
+  margin-top: 16px;
+  margin-right: 60px;
+  padding-left: 20px; }
 
 .like_icon_null {
   display: inline-block;
@@ -440,7 +546,7 @@ article {
 .msg_icon_null {
   display: inline-block;
   width: 37px;
-  height: 30px;
+  height: 36px;
   background: url("../images/msg_null_icon.png") no-repeat;
   background-size: 100%; }
 
@@ -455,4 +561,33 @@ article {
   opacity: 0;
   -webkit-transform: translate3d(100px, 0, 0); }
 
+.fade-in {
+  -webkit-animation: fade-in .8s ease forwards; }
+
+.rotate {
+  -webkit-animation: rotate 2s ease-out forwards; }
+
+@-webkit-keyframes rotate {
+  0% {
+    opacity: 0;
+    -webkit-transform: rotate(0); }
+  100% {
+    opacity: 1;
+    -webkit-transform: rotate(720deg); } }
+@-webkit-keyframes fade-in {
+  0% {
+    -webkit-transform: scale(0); }
+  25% {
+    -webkit-transform: scale(1.2); }
+  75% {
+    -webkit-transform: scale(0.8); }
+  100% {
+    -webkit-transform: scale(1); } }
+article {
+  font-size: 28px;
+  line-height: 52px;
+  letter-spacing: 2px;
+  margin-top: 27px;
+  text-align: justify; }
+
 /*# sourceMappingURL=main.css.map */

+ 270 - 81
data/resource/mobile/ugc/js/main.js

@@ -2,14 +2,14 @@ var event = function (obj, eventType, callback) {
     obj.live(eventType, callback);
 };
 var Verification = function () {
-    this.isEmpty = function (objVal,msg) {
+    this.isEmpty = function (objVal, msg) {
         if (!objVal) {
-            this.alert("empty",msg);
+            this.alert("empty", msg);
             return false;
         }
         return objVal;
     };
-    this.alert = function (type,msg) {
+    this.alert = function (type, msg) {
         switch (type) {
             case "empty" : {
                 alert(msg);
@@ -22,50 +22,86 @@ var Verification = function () {
     }
 };
 
-var ajax = function (url,callback) {
+var ajax = function (url, callback) {
     $.ajax({
         type: "get",
         async: false,
         url: url,
         dataType: "jsonp",
-        jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认为:callback)
-        jsonpCallback:"flightHandler",//自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名,也可以写"?",jQuery会自动为你处理数据
-        success:callback,
-        error: function(){
+        jsonp: "callback",
+        jsonpCallback: "flightHandler",
+        success: callback,
+        error: function () {
 
         }
     });
 };
 
-var Vote = function () {
+
+var Vote = function (type) {
+    var _self = this;
+    this.type = type;
+    this.answer = [];
+    this.obj = $('input[name="submit_vote"]');
     this.M = function () {
-        var _self = this;
+        var options = function () {
+            var options = [];
+            for (var i = 0; i < $('.vote_options label').length; i++) {
+                var option = $.trim($('.vote_options label').eq(i).text());
+                options.push(option);
+            }
+            return options;
+        };
+        var sum_num = function (datas) {
+            var sum = 0;
+            for (var i = 0; i < datas['vote_result'].length; i++) {
+                sum += parseFloat(datas['vote_result'][i]);
+            }
+            return sum;
+        };
+        var result = function (data) {
+            var option_items = options();
+            var sum = sum_num(data);
+            var vote_res = [];
+            for (var i = 0; i < data['vote_result'].length; i++) {
+                var g = {};
+                g.name = option_items[i];
+                g.num = parseInt(data['vote_result'][i]);
+                g.percentage = data['vote_result'][i] ? Math.round(data['vote_result'][i] / sum * 100) : 0;
+                vote_res.push(g);
+            }
+            return vote_res;
+        };
         return {
-            voteRes:function(datas){
+            voteRes: function (datas, callback) {
+                console.log(datas);
                 var special_id = $('.vote').attr('data-special_id');
-                var url = document.location.protocol+"//"+document.location.host+'/mobile/index.php?act=special&op=vote&client_type=ajax&special_id='+special_id+'&options='+datas;
-                // var url = 'http://192.168.0.200/mobile/index.php?act=special&op=vote&client_type=ajax&special_id='+special_id+'&options='+datas;
-                ajax(url,function(data){
-                    console.log(data);
-                    $('.vote_pro').after(_self.V(data));
+                // var url = document.location.protocol+"//"+document.location.host+'/mobile/index.php?act=special&op=vote&client_type=ajax&special_id='+special_id+'&options='+datas;
+                var url = 'http://192.168.0.200/mobile/index.php?act=special&op=vote&client_type=ajax&special_id=' + special_id + '&options=' + datas;
+                ajax(url, function (data) {
+                    if (data.code !== 200) {
+                        alert(data.message);
+                        return;
+                    }
+                    var res = result(data.datas);
+                    callback(res);
                 });
             }
         }
-
     };
     this.V = function (datas) {
         var resData = datas;
         var html = '<div class="results">';
-        for (var i = 0; i < datas.length; i++) {
+        for (var i = 0; i < resData.length; i++) {
             html += '<div class="result">' +
-                '<div class="result_option">' + datas[i].name + '</div>' +
+                '<div class="result_option">' + resData[i].name + '</div>' +
                 '<div class="status">' +
                 '<div class="status_line">' +
                 '<div class="stat"></div>' +
                 '<div class="status_bg"></div>' +
                 '</div>' +
-                '<span class="num">' + datas[i].num + '票</span>' +
-                '<span class="percentage">' + datas[i].percentage + '%</span>' +
+                '<span class="num">' + resData[i].num + '票</span>' +
+                '<span class="percentage">' + resData[i].percentage + '%</span>' +
                 '</div>' +
                 '</div>';
         }
@@ -73,40 +109,187 @@ var Vote = function () {
         return html;
     };
     this.C = function () {
-        var _self = this;
+        var statShow = function () {
+            if ($('.percentage').length > 0) {
+                setTimeout(function () {
+                    for (var i = 0; i < $('.percentage').length; i++) {
+                        var num = $('.percentage')[i].innerHTML;
+                        $('.stat')[i].style.width = num;
+                    }
+                }, 300);
+                clearInterval(a);
+            }
+        };
+        var a = setInterval(statShow, 10);
+        event(_self.obj, 'change', function () {
+            switch (_self.type) {
+                case 0:
+                case 1 : {
+                    _self.answer = [];
+                    $.each(_self.obj, function () {
+                        if (this.checked) {
+                            _self.answer.push($(this).val());
+                        }
+                    });
+                    break;
+                }
+                case 2: {
+                    var val = $(this).val();
+                    if ($(this).prop('checked')) {
+                        if (_self.answer.length >= 2) {
+                            for (var g = 0; g < _self.obj.length; g++) {
+                                if (_self.obj.eq(g).val() == _self.answer[0]) {
+                                    _self.obj.eq(g).prop('checked', false);
+                                    _self.answer.splice(0, 1);
+                                    _self.answer.push(val);
+                                    break;
+                                }
+                            }
+                        }
+                        else {
+                            _self.answer = [];
+                            $.each(_self.obj, function () {
+                                if (this.checked) {
+                                    _self.answer.push($(this).val());
+                                }
+                            });
+                        }
+                    }
+                    else {
+                        _self.answer = [];
+                        $.each(_self.obj, function () {
+                            if (this.checked) {
+                                _self.answer.push($(this).val());
+                            }
+                        });
+                    }
+                }
+            }
+        });
         event($('#submit_btn'), 'click', function () {
-            if($(this).hasClass('button_null')) {
+            if ($(this).hasClass('button_null')) {
                 return;
             }
-            var verification = new Verification();
-            var checkbox = $('input[name="submit_vote"]:checked').val();
-            var vateVal = verification.isEmpty(checkbox,'亲,请投票!');
-            var checkedArray = [];
-            $.each($('input[name="submit_vote"]'),function(){
-                if(this.checked) {
-                    checkedArray.push($(this).val());
-                }
+            if (_self.answer.length == '') {
+                alert('亲,请投票!');
+                return false;
+            }
+            _self.M().voteRes(_self.answer, function (res) {
+                $('.vote_pro').after(_self.V(res));
             });
-            if (vateVal) {
-                _self.M().voteRes(checkedArray);
-                $('.vote_options').css('display', 'none');
-                $(this).addClass('button_null').html('已完成投票');
-                if ($('.percentage').length > 0) {
-                    setTimeout(function () {
-                        for (var i = 0; i < $('.percentage').length; i++) {
-                            var num = $('.percentage')[i].innerHTML;
-                            $('.stat')[i].style.width = num;
+            $('.vote_options').css('display', 'none');
+            $(this).addClass('button_null').html('已完成投票');
+            statShow();
+        })
+    };
+};
+
+
+var Question = function (obj, handleType) {
+    this.obj = obj;
+    this.handleType = handleType;
+    this.answer = [];
+    this.getAnswer = function () {
+        return this.answer;
+    };
+    this.C = function () {
+        var _self = this;
+        _self.obj.on('change', function () {
+            switch (_self.handleType) {
+                case 0:
+                case 1 : {
+                    _self.answer = [];
+                    $.each(_self.obj, function () {
+                        if (this.checked) {
+                            _self.answer.push($(this).val());
                         }
-                    }, 300);
+                    });
+                    break;
+                }
+                case 2: {
+                    var val = $(this).val();
+                    if ($(this).prop('checked')) {
+                        if (_self.answer.length >= 2) {
+                            for (var g = 0; g < _self.obj.length; g++) {
+                                if (obj.eq(g).val() == _self.answer[0]) {
+                                    obj.eq(g).prop('checked', false);
+                                    _self.answer.splice(0, 1);
+                                    _self.answer.push(val);
+                                    break;
+                                }
+                            }
+                        }
+                        else {
+                            _self.answer = [];
+                            $.each(_self.obj, function () {
+                                if (this.checked) {
+                                    _self.answer.push($(this).val());
+                                }
+                            });
+                        }
+                    }
+                    else {
+                        _self.answer = [];
+                        $.each(_self.obj, function () {
+                            if (this.checked) {
+                                _self.answer.push($(this).val());
+                            }
+                        });
+                    }
+                    break;
                 }
             }
+        });
+    }
+};
+
+
+var QuestionList = function () {
+    var question_items = [];
+    (function (question_items) {
+        var questions = $('.question').length;
+        var num = 1;
+        var question_nums = 'q' + num;
+        for (var j = 0; j < questions; j++) {
+            question_nums = new Question($('input[name="question' + num + '"]'), parseInt($('.question_type').eq(j).attr('data-type')));
+            question_items.push(question_nums);
+            question_nums.C();
+            num++;
+        }
+    })(question_items);
+    var answers = function () {
+        var answers = {};
+        answers.type = 'question';
+        answers['answers'] = [];
+        for (var i = 0; i < question_items.length; i++) {
+            answers['answers'].push(question_items[i].getAnswer());
+        }
+        return answers;
+    };
+    this.submit = function () {
+        $('#submit_question').on('click', function () {
+            var resAnswers = answers();
+            console.log(resAnswers);
+            for(var i = 0;i < resAnswers['answers'].length;i++) {
+                if(resAnswers['answers'][i].length == 0) {
+                    var noQuestion = $('input[name="question'+(i+1)+'"]').offset().top;
+                    window.scrollTo(0,noQuestion-120);
+                    alert('请回答第'+(i+1)+'题');
+                    return;
+                }
+
+            }
+
         })
     };
 };
 
+
 var CommentsBox = function () {
     this.V = function () {
         var html = '<div class="pop">' +
+            '<a href="javascript:void(0)" class="bonus_page"></a>' +
+            '<a href="javascript:void(0)" class="close_icon"></a>' +
             '<div class="answer_comments">' +
             '<div class="handle">' +
             '<div><a href="javascript:void(0)" class="close">取消</a></div>' +
@@ -130,20 +313,17 @@ var CommentsBox = function () {
         var _self = this;
         var maxSize = 250;
         return {
-            appendHtml:function(){
+            appendHtml: function () {
                 $('body').append(_self.V());
             },
             show: function () {
-                event($('.msg_btn'),'touchstart',function(){
-                    $(this).addClass('active');
-                    $('.msg_icon_null').addClass('msg_icon');
-                });
-                event($('.msg_btn'),'touchend',function(){
+                event($('.msg_btn'), 'touchend', function () {
                     $(this).removeClass('active');
                     $('.msg_icon_null').removeClass('msg_icon');
-                    $('.pop').css('display', 'block');
+                    $('.pop').show();
+                    $('.answer_comments').show();
                     $('#comments').focus();
-                    $("body").on("touchmove",function(event){
+                    $("body").on("touchmove", function (event) {
                         event.preventDefault;
                     }, false)
                 });
@@ -152,7 +332,8 @@ var CommentsBox = function () {
                 event($('.close'), 'click', function () {
                     $('#comments').val('');
                     $('.surplus').html(maxSize);
-                    $('.pop').css('display', 'none');
+                    $('.pop').hide();
+                    $('.answer_comments').hide();
                     $("body").off("touchmove");
                 })
             },
@@ -160,19 +341,19 @@ var CommentsBox = function () {
                 event($('#comments'), 'input', function () {
                     var val = $(this).val().length;
                     var surplus = 0;
-                    if(val <= maxSize){
+                    if (val <= maxSize) {
                         surplus = maxSize - val;
                     }
                     else {
-                        $(this).val($(this).val().substring(0,maxSize));
+                        $(this).val($(this).val().substring(0, maxSize));
                     }
                     $('.surplus').html(surplus);
                 })
             },
-            submit:function(){
-                event($('.submit'),"click",function(){
+            submit: function () {
+                event($('.submit'), "click", function () {
                     var verification = new Verification();
-                    verification.isEmpty($('#comments').val(),'亲,内容不能为空哦');
+                    verification.isEmpty($('#comments').val(), '亲,内容不能为空哦');
                     $('.pop').css('display', 'none');
                     $('#comments').val('');
                     $("body").off("touchmove");
@@ -184,45 +365,53 @@ var CommentsBox = function () {
     }
 };
 
-
-var ua = navigator.userAgent.toLowerCase();
-if(!/iphone|ipad|ipod/.test(ua)){
-    $('video').after('<span class="play_icon"></span>');
-    var videoLength = document.getElementsByTagName('video').length;
-    for(var i = 0;i < videoLength;i++) {
-        document.getElementsByClassName('play_icon')[i].addEventListener('click',function(){
-            document.getElementsByTagName('video')[i].play();
-        })
-    }
-
-    // document.getElementsByClassName('play_icon')[0].addEventListener('click',function(){
-    //     document.getElementsByTagName('video')[0].play();
-    // })
-    // event($('.play_icon'),'click',function(){
-    //     document.getElementsByTagName('video')[0].play();
-    //     $(this).css('display','none');
-    //     // document.getElementById('video').play();
-    //    // $('#video').trigger('play');
-    // })
-}
-
-
-
+var PageVideo = function(){
+    var createDom = function(videosrc){
+        var a = document.createElement('video');
+        a.poster = './images/image01.png';
+        a.src = videosrc;
+        return a;
+    };
+    this.append = function(){
+        for(var i = 0;i<$('.video_box').length;i++) {
+            var videosrc = $('.video_box').eq(i).attr('data-src');
+            $('.video_box').eq(i).append(createDom(videosrc));
+        }
+    };
+};
 
 
+var Pagevideo = new PageVideo();
+Pagevideo.append();
 
-var vote = new Vote();
+var vote = new Vote(parseInt($('.vote_type').attr('data-type')));
 vote.C();
 
+var questionList = new QuestionList();
+questionList.submit();
+
 var commentsBox = new CommentsBox();
 for (var i in commentsBox.C()) {
     commentsBox.C()[i]();
 }
-event($('.like_btn'),'click',function(){
+event($('.like_btn'), 'click', function () {
     $(this).toggleClass('active');
     $(this).find('.like_icon_null').toggleClass('like_icon');
 });
 
+event($('.close_icon'), 'click', function () {
+    $('.pop').hide();
+    $('.bonus_page').hide();
+    $('.close_icon').hide();
+});
+
+event($('.comment_label'), 'click', function () {
+    $('.pop').show();
+    $('.bonus_page').addClass('fade-in').show();
+    $('.close_icon').addClass('rotate').show();
+});
+
+