my_complaint.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view>
  3. <view class="complaintContainer">
  4. <view class="complaint" @click="toComplaintDetail(item)" v-for="(item, index) in complaint" :key="index">
  5. <view class="complain">
  6. <view class="complaintHead">
  7. <view>标题</view>
  8. <view class="complaintTitle">{{item.complaintTitle}}</view>
  9. </view>
  10. <view class="complaintBody">
  11. <view>内容摘要</view>
  12. <view class="complaintContent">{{item.complaintDetail}}</view>
  13. </view>
  14. </view>
  15. <view>
  16. <view class="dispose">{{item.status}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- 开始写建议按钮 -->
  21. <view class="toWriteComplaint">
  22. <view class="writeComplaint" @click="toWriteComplaint">
  23. <text>写投诉</text>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. complaint: [],
  33. queryObj: {
  34. pageNum: 1,
  35. pageSize: 5
  36. }
  37. };
  38. },
  39. onShow() {
  40. this.init();
  41. },
  42. methods:{
  43. async init(){
  44. const { data: result } =await uni.$http.get('/education/my-complaint/findPersonComplaint',this.queryObj)
  45. this.complaint = result.data.data;
  46. },
  47. // 点击建议列表,跳转到对应的建议详情页
  48. toComplaintDetail(item){
  49. let complaint = JSON.stringify(item)
  50. uni.navigateTo({
  51. url: '/subpkg/my/complaint/my_complaint_detail?item=' + encodeURIComponent(complaint)
  52. })
  53. },
  54. // 跳转到写建议页面
  55. toWriteComplaint(){
  56. uni.navigateTo({
  57. url: '/subpkg/my/complaint/my_complaint_write'
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <!-- 设置页面背景 -->
  64. <style lang="scss">
  65. page{
  66. height: 100%;
  67. // background-color: #FFF;
  68. }
  69. </style>
  70. <style lang="scss" scoped>
  71. /* 页面背景 */
  72. // page{
  73. // /* height: 100%; */
  74. // /* height: auto !important; */
  75. // background-color: #E2F0D9;
  76. // }
  77. /* 建议列表区 */
  78. .complaintContainer{
  79. height: 100%;
  80. padding-bottom: 120rpx;
  81. }
  82. /* 单条建议的背景 */
  83. .complaint{
  84. display: flex;
  85. padding: 20rpx;
  86. margin: 20rpx 10rpx;
  87. height: 140rpx;
  88. border-radius: 30rpx;
  89. background-color: #FFF;
  90. }
  91. /* 单条建议左侧标题和内容摘要 */
  92. .complain{
  93. width: 75%;
  94. }
  95. /* 标题和内容摘要布局 */
  96. .complaintHead,
  97. .complaintBody{
  98. display: flex;
  99. }
  100. /* 摘要 */
  101. .complaintBody{
  102. margin-top: 10rpx;
  103. }
  104. /* 标题详情和内容详情左边距 */
  105. .complaintTitle,
  106. .complaintContent{
  107. margin-left: 20rpx;
  108. width: 65%;
  109. }
  110. /* 标题内容详情 */
  111. .complaintTitle{
  112. white-space: nowrap;
  113. overflow: hidden;
  114. text-overflow: ellipsis;
  115. }
  116. /* 内容摘要详情 */
  117. .complaintContent{
  118. overflow: hidden;
  119. text-overflow: ellipsis;
  120. display: -webkit-box;
  121. -webkit-box-orient: vertical;
  122. -webkit-line-clamp: 2;
  123. }
  124. /* 处理状态 */
  125. .dispose{
  126. font-weight: bold;
  127. color: red;
  128. margin-left: 30rpx;
  129. }
  130. /* 写建议按钮 */
  131. .toWriteComplaint{
  132. display: flex;
  133. position: relative;
  134. justify-content: center;
  135. }
  136. .writeComplaint{
  137. text-align: center;
  138. position: fixed;
  139. bottom: 0rpx;
  140. width: 100%;
  141. height: 120rpx;
  142. line-height: 120rpx;
  143. //background-color: #E2F0D9;
  144. }
  145. .writeComplaint text{
  146. background-color: #35b882;
  147. font-size: 45rpx;
  148. color: white;
  149. border-radius: 30rpx;
  150. padding: 10rpx 20rpx;
  151. }
  152. </style>