移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

124 Zeilen
3.8 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. title="公示公告"
  5. fixed
  6. placeholder
  7. >
  8. <template #right>
  9. <!-- <van-icon name="wap-nav" color="#000" size="18"/>-->
  10. </template>
  11. </van-nav-bar>
  12. <van-pull-refresh v-model="refreshing" @refresh="getList()">
  13. <van-list
  14. v-model="loading"
  15. :finished="finished"
  16. finished-text="没有更多了"
  17. @load="getList('+1')"
  18. >
  19. <van-cell v-for="item in list" :key="item.id" is-link url="" style="margin:2%;width:96%;border-radius: 6px;box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16); min-height: 100px;" :to="{name:'proposerLite', query: {id:item.applyProposerId}}">
  20. <template #title>
  21. <p style="display:inline-block;background: #EC4B2C;height:20px;width: 20px;border-radius: 2px;margin-right: 10px;float: left"></p><p style="font-weight: bold;font-size: 18px;">{{item.projectName}}</p>
  22. </template>
  23. <template #label>
  24. <p style="font-size: 0.35rem; margin-left: 30px; margin-bottom: 0.1rem;">{{formatDict(options.announce_type, item.announceType)}}</p>
  25. <p style="font-size: 0.35rem; margin-left: 30px; margin-top: 0.1rem;">{{item.startDate}} 至 {{item.endDate}}</p>
  26. </template>
  27. </van-cell>
  28. </van-list>
  29. </van-pull-refresh>
  30. <onlineHomeIndex></onlineHomeIndex>
  31. </div>
  32. </template>
  33. <script>
  34. import { getList } from "@/api/onlineHome/homestead/information";
  35. import onlineHomeIndex from "../onlineHomeIndex";
  36. export default {
  37. components: {
  38. onlineHomeIndex
  39. },
  40. name: "publicity",
  41. created() {
  42. this.initOptions();
  43. this.getList();
  44. },
  45. data() {
  46. return {
  47. list: [],
  48. refreshing: false,
  49. loading: false,
  50. finished: false,
  51. queryParams:{
  52. pageNum:1,
  53. pageSize:10,
  54. orderByColumn:'createTime',
  55. isAsc:'desc',
  56. announceStatus: '2',
  57. },
  58. options: {
  59. announce_status: [],
  60. announce_type: [],
  61. },
  62. };
  63. },
  64. methods: {
  65. getList(target) {
  66. let type = typeof (target);
  67. console.log(type, target);
  68. if (type === 'number')
  69. this.queryParams.pageNum = target;
  70. else if (type === 'string') {
  71. this.queryParams.pageNum = eval(this.queryParams.pageNum + target)
  72. }
  73. else
  74. {
  75. this.refreshing = true;
  76. this.finished = true;
  77. this.total = 0;
  78. this.queryParams.pageNum = 1;
  79. this.list = []
  80. }
  81. getList(this.queryParams).then((response) => {
  82. console.log(response)
  83. if (response.rows.length === 0) {
  84. this.finished = true;
  85. return;
  86. }
  87. response.rows.forEach((e) => {
  88. this.list.push(e);
  89. });
  90. this.total += response.rows.length;
  91. this.finished = this.total >= response.total;
  92. }).catch(() => {
  93. this.finished = true;
  94. }).finally(() => {
  95. this.loading = false;
  96. this.refreshing = false;
  97. });
  98. },
  99. initOptions() {
  100. for(let k in this.options)
  101. {
  102. this.houseGetDicts(k).then((res) => {
  103. this.options[k] = res.data;
  104. });
  105. }
  106. },
  107. formatDict(dict, value) {
  108. return this.selectDictLabel(dict, value);
  109. },
  110. },
  111. }
  112. </script>
  113. <style scoped>
  114. >>> .my-swipe .van-swipe-item {
  115. color: #fff;
  116. font-size: 20px;
  117. line-height: 150px;
  118. text-align: center;
  119. background-color: #39a9ed;
  120. }
  121. </style>