manager_complaint.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. <!-- 设置页面背景 -->
  82. <style lang="scss">
  83. page{
  84. height: 100%;
  85. // background-color: #FFF;
  86. }
  87. </style>
  88. <style lang="scss" scoped>
  89. /* 页面背景 */
  90. // page{
  91. // /* height: 100%; */
  92. // /* height: auto !important; */
  93. // background-color: #E2F0D9;
  94. // }
  95. /* 建议列表区 */
  96. .suggestContainer{
  97. height: 100%;
  98. padding-bottom: 120rpx;
  99. }
  100. /* 单条建议的背景 */
  101. .suggest{
  102. display: flex;
  103. padding: 20rpx;
  104. margin: 20rpx 10rpx;
  105. height: 100rpx;
  106. border-radius: 30rpx;
  107. background-color: #FFF;
  108. }
  109. /* 单条建议左侧标题和内容摘要 */
  110. .suggestion{
  111. width: 75%;
  112. }
  113. /* 标题和内容摘要布局 */
  114. .suggestHead,
  115. .suggestBody{
  116. display: flex;
  117. }
  118. /* 摘要 */
  119. .suggestBody{
  120. margin-top: 10rpx;
  121. }
  122. /* 标题详情和内容详情左边距 */
  123. .suggestTitle,
  124. .suggestContent{
  125. margin-left: 20rpx;
  126. }
  127. /* 标题内容详情 */
  128. .suggestTitle{
  129. width: 65%;
  130. white-space: nowrap;
  131. overflow: hidden;
  132. text-overflow: ellipsis;
  133. }
  134. /* 内容摘要详情 */
  135. .suggestContent{
  136. width: 80%;
  137. overflow: hidden;
  138. text-overflow: ellipsis;
  139. display: -webkit-box;
  140. -webkit-box-orient: vertical;
  141. -webkit-line-clamp: 2;
  142. }
  143. /* 处理状态 */
  144. .dispose{
  145. font-weight: bold;
  146. color: red;
  147. margin-left: 30rpx;
  148. }
  149. /* 写建议按钮 */
  150. .toWriteSuggestion{
  151. display: flex;
  152. position: relative;
  153. justify-content: center;
  154. }
  155. .writeSuggestion{
  156. text-align: center;
  157. position: fixed;
  158. bottom: 0rpx;
  159. width: 100%;
  160. height: 120rpx;
  161. line-height: 120rpx;
  162. background-color: #E2F0D9;
  163. }
  164. .writeSuggestion text{
  165. background-color: #8FAADC;
  166. font-size: 36rpx;
  167. color: white;
  168. border-radius: 30rpx;
  169. padding: 10rpx 20rpx;
  170. }
  171. </style>