my_suggestion.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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="b-button-wrapper">
  23. <view class="b-button" @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. font-size: 30rpx;
  79. }
  80. /* 单条建议的背景 */
  81. .suggest{
  82. display: flex;
  83. padding: 20rpx;
  84. margin: 30rpx;
  85. height: 100rpx;
  86. border-radius: 30rpx;
  87. background-color: #FFF;
  88. align-items: center;
  89. justify-content: center;
  90. }
  91. /* 单条建议左侧标题和内容摘要 */
  92. .suggestion{
  93. width: 75%;
  94. }
  95. /* 标题和内容摘要布局 */
  96. .suggestHead,
  97. .suggestBody{
  98. display: flex;
  99. }
  100. /* 摘要 */
  101. .suggestBody{
  102. margin-top: 10rpx;
  103. }
  104. /* 标题详情和内容详情左边距 */
  105. .suggestTitle,
  106. .suggestContent{
  107. margin-left: 20rpx;
  108. }
  109. /* 标题内容详情 */
  110. .suggestTitle{
  111. width: 65%;
  112. white-space: nowrap;
  113. overflow: hidden;
  114. text-overflow: ellipsis;
  115. }
  116. /* 内容摘要详情 */
  117. .suggestContent{
  118. width: 65%;
  119. overflow: hidden;
  120. text-overflow: ellipsis;
  121. display: -webkit-box;
  122. -webkit-box-orient: vertical;
  123. -webkit-line-clamp: 2;
  124. }
  125. /* 处理状态 */
  126. .dispose{
  127. font-weight: bold;
  128. color: red;
  129. margin-left: 30rpx;
  130. }
  131. // 底部按钮
  132. .b-button-wrapper{
  133. display: flex;//要加上,否则,剧中无效
  134. position: absolute;
  135. bottom: 60rpx;
  136. height: 140rpx;
  137. width: 100%;
  138. align-items: center;
  139. justify-content: center;
  140. }
  141. .b-button {
  142. width: 300rpx;
  143. border-radius: 50rpx;
  144. // margin-bottom: 40rpx;
  145. background-color: #35b882;
  146. height: 85rpx;
  147. font-size: 30rpx;
  148. color:#fff;
  149. display: flex;//要加上,否则,剧中无效
  150. align-items: center;
  151. justify-content: center;
  152. }
  153. </style>