移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

256 rindas
6.9 KiB

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