my_complaint.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. <style lang="scss"scoped>
  64. /* 页面背景 */
  65. page{
  66. /* height: 100%; */
  67. /* height: auto !important; */
  68. background-color: #E2F0D9;
  69. }
  70. /* 建议列表区 */
  71. .complaintContainer{
  72. height: 100%;
  73. padding-bottom: 120rpx;
  74. }
  75. /* 单条建议的背景 */
  76. .complaint{
  77. display: flex;
  78. padding: 20rpx;
  79. margin: 20rpx 10rpx;
  80. height: 140rpx;
  81. border-radius: 30rpx;
  82. background-color: #FFF2CC;
  83. }
  84. /* 单条建议左侧标题和内容摘要 */
  85. .complain{
  86. width: 75%;
  87. }
  88. /* 标题和内容摘要布局 */
  89. .complaintHead,
  90. .complaintBody{
  91. display: flex;
  92. }
  93. /* 摘要 */
  94. .complaintBody{
  95. margin-top: 10rpx;
  96. }
  97. /* 标题详情和内容详情左边距 */
  98. .complaintTitle,
  99. .complaintContent{
  100. margin-left: 20rpx;
  101. width: 65%;
  102. }
  103. /* 标题内容详情 */
  104. .complaintTitle{
  105. white-space: nowrap;
  106. overflow: hidden;
  107. text-overflow: ellipsis;
  108. }
  109. /* 内容摘要详情 */
  110. .complaintContent{
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. display: -webkit-box;
  114. -webkit-box-orient: vertical;
  115. -webkit-line-clamp: 2;
  116. }
  117. /* 处理状态 */
  118. .dispose{
  119. font-weight: bold;
  120. color: red;
  121. margin-left: 30rpx;
  122. }
  123. /* 写建议按钮 */
  124. .toWriteComplaint{
  125. display: flex;
  126. position: relative;
  127. justify-content: center;
  128. }
  129. .writeComplaint{
  130. text-align: center;
  131. position: fixed;
  132. bottom: 0rpx;
  133. width: 100%;
  134. height: 120rpx;
  135. line-height: 120rpx;
  136. background-color: #E2F0D9;
  137. }
  138. .writeComplaint text{
  139. background-color: #8FAADC;
  140. font-size: 36rpx;
  141. color: white;
  142. border-radius: 30rpx;
  143. padding: 10rpx 20rpx;
  144. }
  145. </style>