my_suggestion.vue 3.5 KB

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