移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list_message.vue 6.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <div class="home_wrapper">
  3. <div
  4. class="header_main"
  5. :style="`background-image:url(${require('@/assets/images/sunVillage_info/list_head_red.png')})`"
  6. >
  7. 留言板
  8. <div class="return_btn" @click="onClickLeft"></div>
  9. <div class="add_btn" @click="goAdd" v-show="showBtn"></div>
  10. </div>
  11. <van-list
  12. v-model="loading"
  13. :finished="finished"
  14. finished-text="没有更多了"
  15. @load="getList"
  16. >
  17. <van-swipe-cell v-for="(item,index) in applicationList" :key="index" >
  18. <van-cell
  19. :border="false"
  20. center
  21. :to="{name: 'sunVillageInfoListMessageDetail',query:{id:item.id}}"
  22. >
  23. <template #right-icon>
  24. <p style="color: #3977e7">{{item.releaseBy}}</p>
  25. </template>
  26. <template #title>
  27. <p class="tit">{{item.messageContent}}</p>
  28. <p class="time">{{item.messageTime}}</p>
  29. </template>
  30. <template #icon>
  31. <img src="../../assets/images/sunVillage_info/message_icon_01.png" style="width: 1rem;margin-right: 2%;">
  32. </template>
  33. </van-cell>
  34. <!-- <template #right v-if="showBtn">-->
  35. <!-- <div style="background-color: #ee0a24;height: 100%" @click="goRemove(item.id)">删除</div>-->
  36. <!-- <div style="background-color: #07c160" @click="goEdit(item.id)">修改</div>-->
  37. <!-- <div style="background-color: rgb(255, 166, 62);" v-if="item.status != '3'" @click="goRanking(item.id)">发布</div>-->
  38. <!-- </template>-->
  39. </van-swipe-cell>
  40. </van-list>
  41. </div>
  42. </template>
  43. <script>
  44. import { listMessage , delPoll , publicPoll } from "@/api/sunVillage_info/fixedAssets";
  45. import Cookies from "js-cookie";
  46. import request from '@/utils/request'
  47. import {Dialog} from "vant";
  48. export default {
  49. name: "certificateList",
  50. data() {
  51. return {
  52. applicationList:[],
  53. loading: false,
  54. finished: false,
  55. show: true,
  56. fileList:[],
  57. showBtn:true,
  58. queryParams:{}
  59. };
  60. },
  61. created() {
  62. this.queryParams = {
  63. deptId:Cookies.get('deptId'),
  64. translate_dict:1,
  65. }
  66. },
  67. methods: {
  68. getList(){
  69. var _this = this;
  70. listMessage(this.queryParams).then(response => {
  71. _this.listLength = response.total;
  72. response.rows.map(res=>{
  73. _this.applicationList.push(res);
  74. })
  75. if(_this.applicationList.length >= response.total){
  76. _this.finished = true;
  77. return;
  78. }else{
  79. _this.loading = false;
  80. _this.queryParams.pageNum += 1 ;
  81. }
  82. });
  83. },
  84. goAdd(){
  85. this.$router.push({path:'/sunVillage_info/list_message_add', query: {type: 'code'}})
  86. },
  87. goDetail(id){
  88. this.$router.push({path:'/sunVillage_info/list_vote_detail',query: {id:id}})
  89. },
  90. goEdit(id){
  91. this.$router.push({path:'/sunVillage_info/list_vote_edit',query: {id:id}})
  92. },
  93. goRanking(id){
  94. this.$dialog.alert({
  95. title: '提示',
  96. message: '确认发布?',
  97. showCancelButton:true,
  98. })
  99. .then(() => {
  100. publicPoll(id).then(response => {
  101. this.$notify({ type: 'success', message: '发布成功' });
  102. this.applicationList = [];
  103. this.getList()
  104. });
  105. })
  106. .catch(() => {
  107. // on cancel
  108. });
  109. },
  110. goRemove(id){
  111. this.$dialog.alert({
  112. title: '提示',
  113. message: '确认删除?',
  114. showCancelButton:true,
  115. })
  116. .then(() => {
  117. delPoll(id).then(response => {
  118. this.$notify({ type: 'success', message: '删除成功' });
  119. this.applicationList = [];
  120. this.getList()
  121. });
  122. })
  123. .catch(() => {
  124. // on cancel
  125. });
  126. }
  127. },
  128. }
  129. </script>
  130. <style scoped lang="scss">
  131. .home_wrapper{
  132. background: #e9e9e9;
  133. min-height: 100vh;
  134. width: 100vw;
  135. .header_main{
  136. height: 116px;
  137. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  138. background-size: 100% 100%;
  139. position: fixed;
  140. top: 0;
  141. left: 0;
  142. width: 100%;
  143. font-size: 36px;
  144. line-height: 116px;
  145. text-align: center;
  146. color: #fff;
  147. position: relative;
  148. .return_btn{
  149. width: 24px;
  150. height: 43.2px;
  151. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  152. background-size: 20px 36px;
  153. position: absolute;
  154. left: 38px;
  155. top: 36px;
  156. }
  157. .add_btn{
  158. width: 56.4px;
  159. height: 40.8px;
  160. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  161. background-size: 47px 34px;
  162. position: absolute;
  163. right: 38px;
  164. top: 36px;
  165. }
  166. }
  167. .van-swipe-cell {
  168. position: relative;
  169. overflow: hidden;
  170. cursor: grab;
  171. width: 96%;
  172. margin: 0 auto;
  173. margin-top: 15PX;
  174. box-shadow: 5PX 5PX 2PX #ccc;
  175. border-radius: 10PX;
  176. }
  177. /deep/ .van-swipe-cell__right{
  178. display: flex;
  179. align-items: center;
  180. width: 150PX;
  181. margin-left: 5PX;
  182. a,div{
  183. margin: 0;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. color: #ffffff;
  188. font-size: 14PX;
  189. height: 100%;
  190. flex: 1;
  191. }
  192. }
  193. .tit{
  194. color: #333333;
  195. }
  196. .time{
  197. color: #aaaaaa;
  198. font-size: .3rem;
  199. display: -webkit-box;
  200. -webkit-box-orient: vertical;
  201. -webkit-line-clamp: 1;
  202. word-break: break-all;
  203. overflow: hidden;
  204. }
  205. .dept{
  206. color: #3977e7;
  207. font-size: .35rem;
  208. display: flex;
  209. align-items: center;
  210. }
  211. .state1{
  212. background: #e4f8f4;
  213. border: 1px solid #c5efe7;
  214. color: #2ec6a9;
  215. padding: 0 3vw;
  216. border-radius: 5vw;
  217. }
  218. .state2{
  219. background: #fedfe3;
  220. border: 1px solid #fcb9c2;
  221. color: #f60325;
  222. padding: 0 3vw;
  223. border-radius: 5vw;
  224. }
  225. }
  226. </style>