移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

197 строки
5.5 KiB

  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_green.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. :title="item.subjectName"
  21. :label="'时间:'+item.startTime.substr(0,10)+' - '+item.endTime.substr(0,10)"
  22. center
  23. :to="{name: item.isVote || showBtn ? 'sunVillageInfoListVoteDetail':'sunVillageInfoListVoteForm',query:{id:item.id,type:show?'':'code'}}"
  24. >
  25. <template #right-icon>
  26. <p style="color: #1D6FE9">投票</p>
  27. </template>
  28. <template #icon>
  29. <img src="../../assets/images/sunVillage_info/icon_vote.png" style="width: .5rem;margin-right: 2%;">
  30. </template>
  31. </van-cell>
  32. <template #right v-if="showBtn">
  33. <div style="background-color: #ee0a24;height: 100%" @click="goRemove(item.id)">删除</div>
  34. <div style="background-color: #07c160" @click="goEdit(item.id)">修改</div>
  35. <div style="background-color: rgb(255, 166, 62);" v-if="item.status != '3'" @click="goRanking(item.id)">发布</div>
  36. </template>
  37. </van-swipe-cell>
  38. </van-list>
  39. </div>
  40. </template>
  41. <script>
  42. import { adviceList , delPoll , publicPoll } from "@/api/sunVillage_info/fixedAssets";
  43. import Cookies from "js-cookie";
  44. import request from '@/utils/request'
  45. export default {
  46. name: "certificateList",
  47. data() {
  48. return {
  49. applicationList:[],
  50. loading: false,
  51. finished: false,
  52. show: false,
  53. fileList:[],
  54. showBtn:true,
  55. };
  56. },
  57. created() {
  58. if (Cookies.get('user')){
  59. this.queryParams.userId = JSON.parse(Cookies.get('user')).id
  60. }
  61. },
  62. methods: {
  63. getList(){
  64. var _this = this;
  65. let queryParams = {
  66. advicePhone:JSON.parse(Cookies.get('user')).phone
  67. }
  68. adviceList(queryParams).then(response => {
  69. _this.listLength = response.total;
  70. response.rows.map(res=>{
  71. _this.applicationList.push(res);
  72. })
  73. if(_this.applicationList.length >= response.total){
  74. _this.finished = true;
  75. return;
  76. }else{
  77. _this.loading = false;
  78. _this.queryParams.pageNum += 1 ;
  79. }
  80. });
  81. },
  82. goAdd(){
  83. this.$router.push('/sunVillage_info/list_complaint_add')
  84. },
  85. goDetail(id){
  86. this.$router.push({path:'/sunVillage_info/list_vote_detail',query: {id:id}})
  87. },
  88. goEdit(id){
  89. this.$router.push({path:'/sunVillage_info/list_vote_edit',query: {id:id}})
  90. },
  91. goRanking(id){
  92. this.$dialog.alert({
  93. title: '提示',
  94. message: '确认发布?',
  95. showCancelButton:true,
  96. })
  97. .then(() => {
  98. publicPoll(id).then(response => {
  99. this.$notify({ type: 'success', message: '发布成功' });
  100. this.applicationList = [];
  101. this.getList()
  102. });
  103. })
  104. .catch(() => {
  105. // on cancel
  106. });
  107. },
  108. goRemove(id){
  109. this.$dialog.alert({
  110. title: '提示',
  111. message: '确认删除?',
  112. showCancelButton:true,
  113. })
  114. .then(() => {
  115. delPoll(id).then(response => {
  116. this.$notify({ type: 'success', message: '删除成功' });
  117. this.applicationList = [];
  118. this.getList()
  119. });
  120. })
  121. .catch(() => {
  122. // on cancel
  123. });
  124. }
  125. },
  126. }
  127. </script>
  128. <style scoped lang="scss">
  129. .home_wrapper{
  130. background: #e9e9e9;
  131. min-height: 100vh;
  132. width: 100vw;
  133. .header_main{
  134. height: 116px;
  135. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  136. background-size: 100% 100%;
  137. position: fixed;
  138. top: 0;
  139. left: 0;
  140. width: 100%;
  141. font-size: 36px;
  142. line-height: 116px;
  143. text-align: center;
  144. color: #fff;
  145. position: relative;
  146. .return_btn{
  147. width: 24px;
  148. height: 43.2px;
  149. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  150. background-size: 20px 36px;
  151. position: absolute;
  152. left: 38px;
  153. top: 36px;
  154. }
  155. .add_btn{
  156. width: 56.4px;
  157. height: 40.8px;
  158. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  159. background-size: 47px 34px;
  160. position: absolute;
  161. right: 38px;
  162. top: 36px;
  163. }
  164. }
  165. .van-swipe-cell {
  166. position: relative;
  167. overflow: hidden;
  168. cursor: grab;
  169. width: 96%;
  170. margin: 0 auto;
  171. margin-top: 15PX;
  172. box-shadow: 5PX 5PX 2PX #ccc;
  173. border-radius: 10PX;
  174. }
  175. /deep/ .van-swipe-cell__right{
  176. display: flex;
  177. align-items: center;
  178. width: 150PX;
  179. margin-left: 5PX;
  180. a,div{
  181. margin: 0;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. color: #ffffff;
  186. font-size: 14PX;
  187. height: 100%;
  188. flex: 1;
  189. }
  190. }
  191. }
  192. </style>