manager_complaint.vue 3.8 KB

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