my_complaint.vue 3.5 KB

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