Nav apraksta

chat-assess.html 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!doctype html>
  2. <html lang="en" class="feedback">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title></title>
  7. <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
  8. <link href="../css/iconfont.css" rel="stylesheet" />
  9. <link rel="stylesheet" type="text/css" href="../css/app.css" />
  10. <style>
  11. #textbox {
  12. position: relative;
  13. }
  14. .text_count {
  15. position: absolute;
  16. right: 0;
  17. bottom: 0;
  18. font-size: 12px;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <header class="mui-bar mui-bar-nav toptitbox">
  24. <!--mui-action-back-->
  25. <span class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></span>
  26. <h1 class="mui-title toptit">评价</h1>
  27. <span id="submit" class="mui-pull-right topsave">发送</span>
  28. </header>
  29. <div class="mui-content">
  30. <div class="assessbox">
  31. <div class="mui-content-padded ">
  32. <div class="mui-inline">整体评价</div>
  33. <div class="icons mui-inline levelbox" style="margin-left: 6px;" id="starContainer">
  34. <span data-index="1" class="mui-icon iconfont icon-favor"></span>
  35. <span data-index="2" class="mui-icon iconfont icon-favor"></span>
  36. <span data-index="3" class="mui-icon iconfont icon-favor"></span>
  37. <span data-index="4" class="mui-icon iconfont icon-favor"></span>
  38. <span data-index="5" class="mui-icon iconfont icon-favor"></span>
  39. </div>
  40. </div>
  41. <div class="mui-content-padded">
  42. <div class="mui-inline">评价留言</div>
  43. </div>
  44. <div class="row mui-input-row" id="textbox">
  45. <div id='question' class="mui-input-clear question textareabox" contenteditable="true"></div>
  46. <div class="text_count"><span><span id="text-count">0</span>/300字</span></div>
  47. <input type="text" value="0" style="display: none;" id="inp"/>
  48. </div>
  49. </div>
  50. </div>
  51. <script src="../js/public/mui.min.js"></script>
  52. <script src="../js/public/base.js"></script>
  53. <script src="../js/chat-assess.js"></script>
  54. <script type="text/javascript">
  55. mui.init();
  56. mui('.mui-scroll-wrapper').scroll();
  57. (function() {
  58. var index = 1;
  59. var size = null;
  60. var imageIndexIdNum = 0;
  61. var starIndex = 0;
  62. var feedback = {
  63. question: document.getElementById('question'),
  64. submitBtn: document.getElementById('submit')
  65. };
  66. /**
  67. *提交成功之后,恢复表单项
  68. */
  69. feedback.clearForm = function() {
  70. feedback.question.value = '';
  71. index = 0;
  72. size = 0;
  73. imageIndexIdNum = 0;
  74. starIndex = 0;
  75. //清除所有星标
  76. mui('.icons span').each(function (index,element) {
  77. if (element.classList.contains('icon-favorfill')) {
  78. element.classList.add('icon-favor')
  79. element.classList.remove('icon-favorfill')
  80. }
  81. })
  82. };
  83. //应用评分
  84. mui('.icons').on('tap','span',function(){
  85. var index = parseInt(this.getAttribute("data-index"));
  86. var parent = this.parentNode;
  87. var children = parent.children;
  88. if(this.classList.contains("icon-favor")){
  89. for(var i=0;i<index;i++){
  90. children[i].classList.remove('icon-favor');
  91. children[i].classList.add('icon-favorfill');
  92. }
  93. }else{
  94. for (var i = index; i < 5; i++) {
  95. children[i].classList.add('icon-favor')
  96. children[i].classList.remove('icon-favorfill')
  97. }
  98. }
  99. starIndex = index;
  100. });
  101. })();
  102. </script>
  103. </body>
  104. </html>