| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- var pagePath = $("meta[name='_ctx']").attr("content");
- pagePath = pagePath.substring(0, pagePath.length - 1);
- document.writeln("<div class=\"fixed-menu\">");
- document.writeln(" <div class=\"fixed-menu-nav\">");
- document.writeln(" <div class=\"fixed-menu-nav-title\">导航栏</div>");
- document.writeln(" <div class=\"fixed-menu-nav-list\">");
- document.writeln(" <ul>");
- document.writeln(" <li>");
- document.writeln(" <a href=\'"+pagePath+"/policy/toPolicyExamination\'>创新能力体检</a>");
- document.writeln(" </li>");
- document.writeln(" <li>");
- document.writeln(" <a href=\'"+pagePath+"/policy/toRecommendProject\'>项目能力申报</a>");
- document.writeln(" </li>");
- document.writeln(" </ul>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" <div class=\"fixed-menu-nav pj-link\">");
- document.writeln(" <p class=\"ft-color-blue\">诊断满意度</p>");
- document.writeln(" <p class=\"ft-12\"><a href=\"javascript:;\" onClick=\"modaldemo()\">您对本次诊断是否满意<br>点击这里进行评价</a></p>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" <!--评价弹出层-->");
- document.writeln(" <div id=\"modal-demo\" class=\"modal fade\">");
- document.writeln(" <div class=\"modal-dialog\">");
- document.writeln(" <div class=\"modal-content radius\">");
- document.writeln(" <div class=\"modal-header pingjia\">");
- document.writeln(" <h3 class=\"modal-title\">诊断满意度打分 :</h3>");
- document.writeln(" <a class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" href=\"javascript:;\">×</a>");
- document.writeln(" </div>");
- document.writeln(" <div class=\"modal-body\">");
- document.writeln(" <p>请针对页面下述诊断报告进行满意度打分及建议</p>");
- document.writeln(" <div class=\"clearfix\" style=\"margin: 30px;\">");
- document.writeln(" <span class=\"pull-left\" style=\"margin-top: 5px;\">打分:</span>");
- document.writeln(" <ul class=\"stars pull-left\">");
- document.writeln(" <li startVal=\"1\"><i class=\"iconfont\"></i></li>");
- document.writeln(" <li startVal=\"2\"><i class=\"iconfont\"></i></li>");
- document.writeln(" <li startVal=\"3\"><i class=\"iconfont\"></i></li>");
- document.writeln(" <li startVal=\"4\"><i class=\"iconfont\"></i></li>");
- document.writeln(" <li startVal=\"5\"><i class=\"iconfont\"></i></li>");
- document.writeln(" </ul>");
- document.writeln(" <span id=\"pjdj\" class=\"dj-style\"></span>");
- document.writeln(" </div>");
- document.writeln(" <div class=\"clearfix\" style=\"margin-top: 20px;\">");
- document.writeln(" <span class=\"pull-left\" style=\"margin-top: 5px;\">反馈和建议:</span>");
- document.writeln(" <div class=\"pull-left\" style=\"width: 480px;\">");
- document.writeln(" <textarea class=\"textarea-style\" id=\"feedback\" name=\"feedback\"></textarea>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" <div class=\"modal-footer\">");
- document.writeln(" <button class=\"btn btn-primary\" onClick=\"modaldemo2()\">提交</button>");
- document.writeln(" <button class=\"btn\" data-dismiss=\"modal\" aria-hidden=\"true\">返回</button>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" <!--/评价弹出层-->");
- document.writeln(" <!--评价成功后弹出层-->");
- document.writeln(" <div id=\"evaluation\" class=\"modal fade\">");
- document.writeln(" <div class=\"modal-dialog\">");
- document.writeln(" <div class=\"modal-content radius\">");
- document.writeln(" <div class=\"modal-header pingjia\">");
- document.writeln(" <h3 class=\"modal-title\">提交成功</h3>");
- document.writeln(" <a class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" href=\"javascript:;\" onClick=\"modalHide()\">×</a>");
- document.writeln(" </div>");
- document.writeln(" <div class=\"modal-body\" style=\"text-align: center; line-height: 2;\">");
- document.writeln(" <p>满意度打分提交成功!</p>");
- document.writeln(" <p>报告详情与打分可前往后台政务服务管理-> <a href=\'"+pagePath+"/admin/home\' class=\"ft-color-blue\">政策雷达查看</a> </p>");
- document.writeln(" <p>点击“确定”返回门户</p>");
- document.writeln(" </div>");
- document.writeln(" <div class=\"modal-footer\">");
- document.writeln(" <a href=\'"+pagePath+"/home\' class=\"btn btn-primary\" onClick=\"modalHide()\">确定</a>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- document.writeln(" </div>");
- var star = $("#satisfaction_score").val();
- var feedback = $("#report_feedback").val();
- $(function() {
- var url = window.location.href
- if(star > 0) {
- $(".fixed-menu .pj-link").hide()
- }
- // 评价后显示状态
- $("#feedback").val(feedback);
- for (var i = 1; i <= star; i++) {
- $('.stars li:nth-child(' + i + ')').css('color', '#F0AD4E');
- if (star == 1) {
- $('#pjdj').text("不满意")
- }
- else if (star == 2) {
- $('#pjdj').text("不太满意")
- }
- else if (star == 3) {
- $('#pjdj').text("马马虎虎")
- }
- else if (star == 4) {
- $('#pjdj').text("比较满意")
- }
- else {
- $('#pjdj').text("满意")
- }
- }
- $(".fixed-menu-nav-list ul li a").each(function () {
- var menuUrl = $(this).attr("href")
- var urlIndex = menuUrl.lastIndexOf('/')
- var pathName = menuUrl.substring(urlIndex+1)
- if(url.indexOf(pathName) > -1){
- $(this).parent().addClass("active")
- }
- else {
- $(this).parent().removeClass("active")
- }
- });
- //为星星设置hover效果
- var isClicked = false;
- var beforeClickedIndex = -1;
- var clickNum = 0; //点击同一颗星次数
- $('.stars li').hover(
- function () {
- if (!isClicked && star<0) {
- $(this).css('color', '#F0AD4E');
- var index = $(this).index();
- for (var i = 0; i <= index; i++) {
- $('li:nth-child(' + i + ')').css('color', '#F0AD4E');
- }
- }
- },
- function () {
- if (!isClicked && star<0) {
- $('li').css('color', '#ADADAD');
- }
- }
- );
- //星星点击事件
- $('.stars li').click(function () {
- startVal = $(this).attr("startVal");
- $("#startVal").val(startVal);
- $('li').css('color', '#ADADAD');
- isClicked = true;
- var index = $(this).index()+1;
- for (var i = 1; i <= index; i++) {
- $('li:nth-child(' + i + ')').css('color', '#F0AD4E');
- star = index
- if (index == 1) {
- $('#pjdj').text("不满意")
- }
- else if (index == 2) {
- $('#pjdj').text("不太满意")
- }
- else if (index == 3) {
- $('#pjdj').text("马马虎虎")
- }
- else if (index == 4) {
- $('#pjdj').text("比较满意")
- }
- else {
- $('#pjdj').text("满意")
- }
- }
- // if (index == beforeClickedIndex) { //两次点击同一颗星星 该星星颜色变化
- // clickNum++;
- // if (clickNum % 2 == 1) {
- // $('li:nth-child(' + (index + 1) + ')').css('color', '#ADADAD');
- // if(startVal == 1) {
- // startVal = 0
- // star = 0
- // }
- // $('#pjdj').text("")
- // console.log("if")
- // } else {
- // $('li:nth-child(' + (index + 1) + ')').css('color', '#F0AD4E');
- // console.log("else")
- // }
- //
- // } else {
- // clickNum = 0;
- // beforeClickedIndex = index;
- // }
- // star = startVal
- });
- });
- // 评价弹出层
- function modaldemo(){
- $("#modal-demo").modal("show")
- };
- function modaldemo2(){
- // var data = $("#scoreForm").serializeArray();
- // data.feedback = "123456";
- // console.log(data);
- if(star > 0) {
- $("#scoreForm").ajaxSubmit({
- url: pagePath + "/policy/submitFeedback",
- type: "post",
- data: {
- feedback: $("#feedback").val()
- },
- dataType: "json",
- success: function (result) {
- $(".fixed-menu .pj-link").hide()
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- $("#modal-demo").hide();
- $("#evaluation").modal("show");
- }
- else {
- errorMessage("请打分")
- // alert("请打分")
- }
- };
- function modalHide() {
- $("#modal-demo").modal("hide");
- $("#evaluation").modal("hide");
- }
|