htlpXq.ftl 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <#assign title="求助详情"/>
  2. <#include "/home/frag.head.ftl" />
  3. <div class="weui-tab">
  4. <div class="weui-btn-area" style="display: flex; flex-direction: row;">
  5. <a class="weui-btn weui-btn_primary" href="javascript:goback();"
  6. style="width: 25vw; height: 6vh; line-height: 6vh;">返回</a>
  7. <div style="width: 65%;"></div>
  8. </div>
  9. <div class="weui-btn-area">
  10. <p class="weui-media-box__desc">求助标题</p>
  11. <h4 class="weui-media-box__title">${ task.taskTitle }</h4>
  12. <br>
  13. <p class="weui-media-box__desc">求助对象</p>
  14. <h4 class="weui-media-box__title">${ task.taskTarget }</h4>
  15. <br>
  16. <p class="weui-media-box__desc">求助内容</p>
  17. <h4 class="weui-media-box__title">${ task.remark }</h4>
  18. <br>
  19. <#if task.taskStatus == 1>
  20. <#--<div class="weui-btn-area">
  21. <p style="align-items: center">处理中</p>
  22. </div>-->
  23. </#if>
  24. <#if task.taskStatus == 2 >
  25. <div class="weui-btn-area" id="hf">
  26. <a class="weui-btn weui-btn_default" href="javascript:doTask();">回复</a>
  27. <a class="weui-btn weui-btn_primary" href="javascript:commint();">完成</a>
  28. </div>
  29. <p class="weui-media-box__desc" style="margin-top: 3vh;">回复列表:</p>
  30. <div id="qz_doing_detail" style="margin-top: 3vh;"></div>
  31. </#if>
  32. <#if task.taskStatus == 3>
  33. <div class="weui-btn_primary"
  34. style="margin-bottom: 3vh; display: flex; justify-content: center; height: 5vh; line-height: 5vh">
  35. <h4 class="weui-media-box__title">已完成</h4>
  36. </div>
  37. <p class="weui-media-box__desc" style="margin-top: 3vh;">回复列表:</p>
  38. <div id="qz_done_detail"></div>
  39. </#if>
  40. </div>
  41. <div id="qz_showPop" class="weui-popup__container popup-bottom">
  42. <div class="weui-popup__overlay"></div>
  43. <div class="weui-popup__modal">
  44. <div class="weui-btn-area">
  45. <div style="display:flex; flex-direction: row; justify-content: space-between;">
  46. <div style="width: 75%;"></div>
  47. <a class="weui-btn weui-btn_primary" style="margin-bottom: 3vh;" href="javascript:close();">关闭</a>
  48. </div>
  49. <textarea id="qz_content" class="weui-textarea" placeholder="请输入文本" rows="5" maxlength="99"></textarea>
  50. <a class="weui-btn weui-btn_primary" style="margin-top: 3vh;margin-bottom: 5vh;"
  51. href="javascript:send();">提交</a>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <#include "/home/frag.foot.ftl" />
  57. <script>
  58. var task = ${taskJson};
  59. var userId = ${userId};
  60. <#--var YeuserId = ${YeuserId};//业委会id-->
  61. (function ($) {
  62. if (task.taskStatus == 2 || task.taskStatus == 3) {
  63. getdealdetail();
  64. }
  65. console.log(task.userId)
  66. console.log(userId)
  67. if (task.userId != userId) {
  68. $('#hf').toggle();
  69. }
  70. })(jQuery);
  71. function doTask() {
  72. $("#qz_showPop").popup();
  73. }
  74. //完成
  75. function commint() {
  76. $.ajax({
  77. url: '/home/qiuzhu/reply.json',
  78. type: 'GET',
  79. data: {
  80. taskId: task.taskId,
  81. },
  82. success: function (data) {
  83. /*$.closePopup();*/
  84. window.location.href = "/user/homeIndex.html?show=qiuzhu&userId=" + userId + "&userType=" + 1;
  85. },
  86. error: function () {
  87. }
  88. });
  89. }
  90. function close() {
  91. $.closePopup();
  92. }
  93. function send() {
  94. var qzcontent = $('#qz_content').val();
  95. if (qzcontent.length <= 0) {
  96. $.alert("请输入内容");
  97. return;
  98. }
  99. $.ajax({
  100. url: '/yeweihui/qiuzhu/reply/add.json',
  101. type: 'post',
  102. data: {
  103. userId: userId,
  104. taskId: task.taskId,
  105. replyContent: qzcontent,
  106. userCreate: userId,
  107. userUpdate: userId,
  108. },
  109. success: function (data) {
  110. $.closePopup();
  111. window.location.href = "/user/homeIndex.html?show=qiuzhu&userId=" + userId + "&userType=" + 1;
  112. },
  113. error: function () {
  114. $.alert("网络异常");
  115. }
  116. });
  117. }
  118. function goback() {
  119. window.location.href = "/user/homeIndex.html?show=qiuzhu&userId=" + userId + "&userType=" + 1;
  120. //window.history.back();
  121. }
  122. function getdealdetail() {
  123. $.ajax({
  124. url: '/home/qiuzhu/getData',
  125. type: 'post',
  126. data: {
  127. taskId: task.taskId,
  128. },
  129. success: function (data) {
  130. console.log("---返回数据---", data);
  131. if (task.taskStatus == 2) {
  132. for (var i = 0; i < data.data.length; i++) {
  133. var reply = data.data[i];
  134. $("#qz_doing_detail").append('<p class="weui-media-box__desc">' + reply.nickName + '&emsp;' + reply.timeUpdate + '</p>\n' +
  135. ' <h4 class="weui-media-box__title">' + reply.replyContent + '</h4><br>');
  136. }
  137. }
  138. else if (task.taskStatus == 3) {
  139. for (var i = 0; i < data.data.length; i++) {
  140. var reply = data.data[i];
  141. $("#qz_done_detail").append('<p class="weui-media-box__desc">' + reply.nickName + '&emsp;' + reply.timeUpdate + '</p>\n' +
  142. ' <h4 class="weui-media-box__title">' + reply.replyContent + '</h4><br>');
  143. }
  144. }
  145. },
  146. error: function () {
  147. $.alert("网络异常");
  148. }
  149. });
  150. }
  151. function timestampToTime(timestamp) {
  152. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  153. var Y = date.getFullYear() + '/';
  154. var M = ((date.getMonth() + 1) < 10) ? ('0' + (date.getMonth() + 1) + '/') : ((date.getMonth() + 1) + '/');
  155. var D = (date.getDate() < 10) ? ('0' + date.getDate() + ' ') : (date.getDate() + ' ');
  156. var h = (date.getHours() < 10) ? ('0' + date.getHours() + ':') : (date.getHours() + ':');
  157. var m = (date.getMinutes() < 10) ? ('0' + date.getMinutes() + ':') : (date.getMinutes() + ':');
  158. var s = (date.getSeconds() < 10) ? ('0' + date.getSeconds()) : (date.getSeconds());
  159. return Y + M + D + h + m + s;
  160. }
  161. </script>