complaintManage.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <!--pages/suggestList/suggestList.wxml-->
  3. <view>
  4. <!-- 建议列表 -->
  5. <view class="suggestContainer">
  6. <view class="suggest" @click="toSuggestDetail(item)" v-for="(item, index) in currentList" :key="item">
  7. <view class="suggestion">
  8. <view class="suggestHead">
  9. <view>标题</view>
  10. <view class="suggestTitle">{{item.complaintTitle}}</view>
  11. </view>
  12. <view class="suggestBody">
  13. <view>日期</view>
  14. <view class="suggestContent">{{item.fistDatetime}}</view>
  15. </view>
  16. </view>
  17. <view>
  18. <view class="dispose">{{item.status}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. complaint: [],
  29. obj: {
  30. pageSize: 6,
  31. pageNum: 1
  32. },
  33. total: 0,
  34. currentList: []
  35. };
  36. },
  37. onPullDownRefresh() {
  38. this.obj.pageNum = 1;
  39. this.init();
  40. uni.stopPullDownRefresh();
  41. },
  42. onReachBottom() {
  43. // 判断是否有下一页的数据
  44. if (this.obj.pageNum * this.obj.pageSize >= this.total){
  45. uni.$showMsg('已经是最后一页数据了!')
  46. }
  47. else{
  48. this.obj.pageNum += 1
  49. setTimeout(() => {
  50. this.init()
  51. }, 1000)
  52. }
  53. },
  54. onShow(){
  55. this.obj.pageNum = 1;
  56. this.init();
  57. },
  58. methods:{
  59. async init(){
  60. const { data: result } =await uni.$http.get('/education/my-complaint/findAllComplaint',this.obj)
  61. this.complaint = result.data.data;
  62. this.total = result.data.count;
  63. if(this.obj.pageNum==1){
  64. this.currentList = this.complaint;
  65. }
  66. else{
  67. for(var item of this.complaint)
  68. {
  69. this.currentList.push(item);
  70. }
  71. }
  72. },
  73. // 点击建议列表,跳转到对应的建议详情页
  74. toSuggestDetail(item){
  75. let complaint = JSON.stringify(item)
  76. uni.navigateTo({
  77. url: '/subpkg/allcomplaintDetail/allcomplaintDetail?item=' + complaint
  78. })
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss"scoped>
  84. /* pages/suggestList/suggestList.wxss */
  85. /* 页面背景 */
  86. page{
  87. /* height: 100%; */
  88. /* height: auto !important; */
  89. background-color: #E2F0D9;
  90. }
  91. /* 建议列表区 */
  92. .suggestContainer{
  93. height: 100%;
  94. padding-bottom: 120rpx;
  95. }
  96. /* 单条建议的背景 */
  97. .suggest{
  98. display: flex;
  99. padding: 20rpx;
  100. margin: 20rpx 10rpx;
  101. height: 140rpx;
  102. border-radius: 30rpx;
  103. background-color: #FFF2CC;
  104. }
  105. /* 单条建议左侧标题和内容摘要 */
  106. .suggestion{
  107. width: 75%;
  108. }
  109. /* 标题和内容摘要布局 */
  110. .suggestHead,
  111. .suggestBody{
  112. display: flex;
  113. }
  114. /* 摘要 */
  115. .suggestBody{
  116. margin-top: 10rpx;
  117. }
  118. /* 标题详情和内容详情左边距 */
  119. .suggestTitle,
  120. .suggestContent{
  121. margin-left: 20rpx;
  122. }
  123. /* 标题内容详情 */
  124. .suggestTitle{
  125. width: 65%;
  126. white-space: nowrap;
  127. overflow: hidden;
  128. text-overflow: ellipsis;
  129. }
  130. /* 内容摘要详情 */
  131. .suggestContent{
  132. width: 80%;
  133. overflow: hidden;
  134. text-overflow: ellipsis;
  135. display: -webkit-box;
  136. -webkit-box-orient: vertical;
  137. -webkit-line-clamp: 2;
  138. }
  139. /* 处理状态 */
  140. .dispose{
  141. font-weight: bold;
  142. color: red;
  143. margin-left: 30rpx;
  144. }
  145. /* 写建议按钮 */
  146. .toWriteSuggestion{
  147. display: flex;
  148. position: relative;
  149. justify-content: center;
  150. }
  151. .writeSuggestion{
  152. text-align: center;
  153. position: fixed;
  154. bottom: 0rpx;
  155. width: 100%;
  156. height: 120rpx;
  157. line-height: 120rpx;
  158. background-color: #E2F0D9;
  159. }
  160. .writeSuggestion text{
  161. background-color: #8FAADC;
  162. font-size: 36rpx;
  163. color: white;
  164. border-radius: 30rpx;
  165. padding: 10rpx 20rpx;
  166. }
  167. </style>