history.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="content">
  3. <block v-for="(item,index) in pageList" :key="index">
  4. <view class="box" @click="toDetail(item.id)">
  5. <view class="title">{{item.title}}</view>
  6. <view class="text">问题描述:{{item.content}}</view>
  7. <view class="reply" v-if="item.reply">{{item.reply}}</view>
  8. <view class="bottom hflex acenter jbetween">
  9. <view class="date">{{item.create_time}}</view>
  10. <view class="hflex acenter">
  11. <view class="btn" @click.stop="detele(item.id)">删除</view>
  12. <view class="btn1" v-if="!item.reply" @click.stop="toEdit(item.id)">编辑</view>
  13. </view>
  14. </view>
  15. </view>
  16. </block>
  17. </view>
  18. </template>
  19. <script>
  20. import $api from '@/static/js/api.js'
  21. var that = ''
  22. export default {
  23. data() {
  24. return {
  25. pageList: [
  26. ],
  27. total: 1,
  28. limit: 10,
  29. page: 1,
  30. }
  31. },
  32. onLoad() {
  33. that = this
  34. },
  35. onShow() {
  36. that.getList()
  37. },
  38. methods: {
  39. getList() {
  40. $api.req({
  41. url: '/data/api.business.User/feedback_list',
  42. data: {
  43. page: that.page
  44. }
  45. }, function(res) {
  46. if(res.code == 1) {
  47. that.pageList = res.data
  48. // that.total = res.data.length()
  49. }
  50. })
  51. },
  52. // 详情
  53. toDetail(id) {
  54. $api.jump('/pages/mine/service/feed/detail?id=' + id)
  55. },
  56. // 删除
  57. detele(id) {
  58. $api.req({
  59. url: '/data/api.business.User/del_feedback',
  60. method: 'POST',
  61. data: {
  62. feedback_id: id
  63. }
  64. }, function(res) {
  65. if(res.code == 1) {
  66. console.log(res.data);
  67. $api.info(res.info)
  68. that.getList()
  69. }
  70. })
  71. },
  72. toEdit(id) {
  73. console.log(id);
  74. $api.jump('/pages/mine/service/feed/feed?id='+id)
  75. },
  76. onReachBottom() {
  77. console.log("到底了");
  78. if (that.page == that.total) {
  79. $api.info("没有更多了")
  80. } else {
  81. this.page++
  82. this.getList()
  83. }
  84. }
  85. },
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .content {
  90. background: #F5F5F5;
  91. padding: 0 30rpx;
  92. .box {
  93. width: 100%;
  94. margin: 20rpx 0 0;
  95. background-color: #fff;
  96. border-radius: 20rpx;
  97. box-sizing: border-box;
  98. padding: 28rpx 20rpx;
  99. .title {
  100. font-size: 30rpx;
  101. font-weight: 500;
  102. color: #222222;
  103. }
  104. .text {
  105. font-size: 26rpx;
  106. font-weight: 400;
  107. color: #777777;
  108. margin: 18rpx 0 24rpx;
  109. line-height: 18px;
  110. }
  111. .reply {
  112. width: 100%;
  113. height: 76rpx;
  114. background: #F5F5F5;
  115. border-radius: 16rpx;
  116. font-size: 26rpx;
  117. font-weight: 400;
  118. color: #222222;
  119. line-height: 76rpx;
  120. overflow: hidden;
  121. text-overflow: ellipsis;
  122. white-space: nowrap;
  123. margin-bottom: 24rpx;
  124. box-sizing: border-box;
  125. padding: 0 8rpx 0 36rpx;
  126. position: relative;
  127. }
  128. .reply::before {
  129. content: "";
  130. position: absolute;
  131. top: 34rpx;
  132. left: 12rpx;
  133. width: 12rpx;
  134. height: 12rpx;
  135. background: #506DFF;
  136. border-radius: 50%;
  137. }
  138. .bottom {
  139. width: 100%;
  140. padding-top: 24rpx;
  141. border-top: 1rpx solid #f5f5f5;
  142. .date {
  143. font-size: 24rpx;
  144. font-weight: 400;
  145. color: #777777;
  146. line-height: 34rpx;
  147. }
  148. .btn {
  149. width: 120rpx;
  150. height: 56rpx;
  151. border-radius: 28rpx;
  152. border: 1rpx solid #D3D3D3;
  153. font-size: 26rpx;
  154. color: #222222;
  155. margin-left: 20rpx;
  156. text-align: center;
  157. line-height: 56rpx;
  158. }
  159. .btn1 {
  160. width: 120rpx;
  161. height: 56rpx;
  162. border-radius: 28rpx;
  163. border: 1rpx solid #506DFF;
  164. font-size: 26rpx;
  165. color: #506DFF;
  166. margin-left: 20rpx;
  167. text-align: center;
  168. line-height: 56rpx;
  169. }
  170. }
  171. }
  172. }
  173. </style>