feedback.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <{include file="header.html"}>
  2. <link rel="stylesheet" type="text/css" href="<{$web_cfg.cdn}>/haili/css/comment.css" />
  3. <!--公用标题居中显示-->
  4. <{include file="common_header.html"}>
  5. <style>
  6. .layui-upload-file {
  7. display: none;
  8. }
  9. </style>
  10. <section class="comment">
  11. <h2>发表您的评价反馈</h2>
  12. <section class="comment-imgs-box">
  13. <h5>试用产品图片(最多9张)</h5>
  14. <ul>
  15. <{if $feedback && $feedback.pic}>
  16. <{foreach from=$feedback.pic item=v}>
  17. <li><img src="<{$v}>" class="pics"><em class="close"></em></li>
  18. <{/foreach}>
  19. <{/if}>
  20. <li class="fileselect image_upload" v="1" id="file-upload">
  21. <input type="text" disabled name="file" id="file" accept="image/*" style="cursor:pointer;">
  22. </li>
  23. </ul>
  24. </section>
  25. <section class="comment-text-box">
  26. <input type="hidden" name="pic" id="pic" value="<{$feedback.pic}>" />
  27. <input type="hidden" name="lottery_data_id" id="lottery_data_id" value="<{$lottery_data_id}>" />
  28. <textarea maxlength="200" placeholder="输入您的评价(200字内)" name="content" id="content"><{$feedback.content}></textarea>
  29. </section>
  30. <section class="comment-button-box">
  31. <section class="button-wrapper">
  32. <input class="button" type="submit" name="submit" id="submit" value="提交">
  33. </section>
  34. </section>
  35. </section>
  36. <!--公用提示背景遮罩层-->
  37. <div class="a_cover"></div>
  38. <div class="v_tips_box v_tips_box2" id="error_tips_box">
  39. <div class="v_close_btn" id="tips_close_btn"></div>
  40. <p class="tips_msg" id="error_msg">错误信息</p>
  41. </div>
  42. <{include file="left.html"}>
  43. <script>
  44. function close()
  45. {
  46. if ($('.close').length) {
  47. $(".close").unbind('click').bind('click', function(i)
  48. {
  49. $(this).parent().remove();
  50. })
  51. }
  52. }
  53. $(function()
  54. {
  55. if($(".image_upload").length)
  56. {
  57. $(".image_upload").each(function(i)
  58. {
  59. loadUpload(i,$(this),1,'/?c=kindeditor&a=updateJson&dir=image');//三个参数说明1:第几个上传框2:文件对象3:图片的基本配置标题
  60. })
  61. }
  62. close();
  63. })
  64. KISSY.use('node, io', function (S, Node, IO) {
  65. // 提示
  66. function showTipsBox(msg,close){
  67. $("#error_msg").html(msg);
  68. $("#tips_close_btn").hide();
  69. if(close){
  70. $("#tips_close_btn").show();
  71. }
  72. $("#error_tips_box").fadeIn();
  73. $('.a_cover').fadeIn();
  74. }
  75. // 关闭提示
  76. $("#tips_close_btn").on('click', function(){
  77. $("#error_tips_box").fadeOut();
  78. $('.a_cover').fadeOut();
  79. });
  80. $('#submit').on('click', function () {
  81. var content = S.trim($('textarea[name=content]').val());
  82. if (content == '') {
  83. showTipsBox('评价内容不能为空',true);
  84. return false;
  85. }
  86. var pic = [];
  87. $('.pics').each(function()
  88. {
  89. pic.push($(this).attr('src'));
  90. });
  91. if (!pic) {
  92. showTipsBox('请上传图片',true);
  93. return false;
  94. }
  95. pic = pic.join(',');
  96. IO.get('<{$web_cfg.domain}>/?c=FeedBack&a=Up'
  97. , {
  98. lottery_data_id: '<{$lotteryData.id}>',
  99. content: content,
  100. pic: pic
  101. }
  102. , function (data) {
  103. if (data.ok) {
  104. //showTipsBox('提交成功');
  105. //return true;
  106. <{if $refer}>
  107. url ='<{$refer}>';
  108. <{else}>
  109. url ='<{$giftsUrl}>';
  110. <{/if}>
  111. toast('提交成功', url);
  112. } else {
  113. showTipsBox(data.msg);
  114. return false;
  115. }
  116. }
  117. , 'json'
  118. );
  119. });
  120. });
  121. </script>
  122. <script type="text/javascript" src="<{$web_cfg.cdn}>/public/layui/upload.js?v1211"></script>
  123. <script type="text/javascript" src="<{$web_cfg.cdn}>/public/layui/layui.js"></script>
  124. <{include file="bottom.html"}>