list.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="wrapper">
  3. <view class v-for="(item, oIndex) in list" :key="oIndex" @click="navigateTo(`/pages/mine/feedback/detail?id=${item.id}`)">
  4. <view class="view-item">
  5. <view class="view-item-detail">
  6. <view class="-title">{{ item.createTime }}</view>
  7. <view class="-number">
  8. 问题类型:{{ typeList.find((i) => {
  9. return i.value === item.feedbackType;
  10. }).text }}
  11. </view>
  12. <view class="-number" v-if="item.connectorId">充电枪编号:{{ item.connectorId }}</view>
  13. <view class="-content">{{ item.feedbackContent }}</view>
  14. <image
  15. style="width: 160rpx; height: 160rpx;margin:10rpx 20rpx 0 0;border-radius: 10rpx;"
  16. :src="i"
  17. mode="aspectFill"
  18. v-for="(i, index) in item.imgUrls"
  19. :key="index"
  20. @click="preview(item.imgUrls, index)"
  21. />
  22. </view>
  23. <view class="view-item-detail mt-30" v-if="item.replyFlag == 1">
  24. <view class="-title">
  25. <img src="/static/index/support.png" class="img" />客服回复
  26. </view>
  27. <view class="-number">{{ item.updateTime }}</view>
  28. <view class="-content">{{ item.replyContent }}</view>
  29. </view>
  30. </view>
  31. </view>
  32. <u-empty style="margin-top:20%;" text="欢迎提供意见建议" v-if="list.length == 0"></u-empty>
  33. <uni-load-more :status="loadStatus"></uni-load-more>
  34. <!-- 底部 -->
  35. <div class="bottom-bar mp-iphonex-bottom">
  36. <view class="button">
  37. <u-button type="success" :ripple="true" shape="circle" @click="navigateTo('/pages/mine/feedback/submit')">反馈意见</u-button>
  38. </view>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import { getFeedbackList } from "@/api/members";
  44. export default {
  45. data() {
  46. return {
  47. keyword: "",
  48. params: {
  49. pageNum: 1,
  50. pageSize: 10,
  51. },
  52. list: [], // 店铺列表
  53. loadStatus: 'more',
  54. statusText: ['未开票', '已开票', '已发送'],
  55. typeList: [
  56. { text: "无法启动", value: 1 },
  57. { text: "枪头损坏", value: 2 },
  58. { text: "充电慢", value: 3 },
  59. { text: "车位被占用", value: 4 },
  60. { text: "其他", value: 99 },
  61. ],
  62. total: 10
  63. };
  64. },
  65. onReachBottom() {
  66. if(this.list.length < this.total){
  67. this.params.pageNum++;
  68. this.init();
  69. }
  70. },
  71. onPullDownRefresh() {
  72. this.params.pageNum = 1
  73. this.list = []
  74. this.init();
  75. },
  76. onShow() {
  77. this.params.pageNum = 1
  78. this.list = []
  79. this.init();
  80. },
  81. methods: {
  82. /**
  83. * 点击图片放大或保存
  84. */
  85. preview(urls, index) {
  86. uni.previewImage({
  87. current: index,
  88. urls: urls,
  89. longPressActions: {
  90. itemList: ["保存图片"],
  91. success: function (data) { },
  92. fail: function (err) { },
  93. },
  94. });
  95. },
  96. navigateTo(url) {
  97. uni.navigateTo({
  98. url,
  99. });
  100. },
  101. search() {
  102. this.list = [];
  103. this.init();
  104. },
  105. async init() {
  106. uni.stopPullDownRefresh()
  107. let res = await getFeedbackList(this.params);
  108. if (res.data.code == 200) {
  109. let data = res.data.rows;
  110. this.total = res.data.total
  111. this.list.push(...data);
  112. if(this.list.length >= res.data.total){
  113. this.loadStatus = 'noMore'
  114. }
  115. }
  116. },
  117. },
  118. };
  119. </script>
  120. <style lang="scss" scoped>
  121. .wrapper {
  122. padding: 0 0 100rpx;
  123. }
  124. .bottom-bar {
  125. position: fixed;
  126. bottom: 0;
  127. left: 0;
  128. width: 100%;
  129. height: 100rpx;
  130. overflow: hidden;
  131. line-height: 100rpx;
  132. margin-bottom: 0px !important;
  133. background: #ffffff;
  134. display: flex;
  135. justify-content: space-between;
  136. > .button {
  137. margin: 0 30rpx;
  138. flex: 1;
  139. }
  140. }
  141. /* DarkMode 下的样式 start */
  142. @media (prefers-color-scheme: dark) {
  143. .bottom-bar {
  144. background: #121425;
  145. }
  146. }
  147. .view-item {
  148. padding: 32rpx;
  149. align-items: center;
  150. box-shadow: 0px 0px 2px 1px #b7b7b740;
  151. border-radius: 10px;
  152. margin: 30rpx;
  153. }
  154. .view-item-change {
  155. text-align: right;
  156. > .-money {
  157. font-size: 36rpx;
  158. color: $main-color;
  159. font-weight: bold;
  160. }
  161. > .-time {
  162. font-size: 22rpx;
  163. color: #999;
  164. }
  165. }
  166. .view-item-detail {
  167. line-height: 1.75;
  168. flex: 1;
  169. > .-title {
  170. font-size: 28rpx;
  171. }
  172. > .-number {
  173. font-size: 24rpx;
  174. color: #bdbfc0;
  175. }
  176. > .-content {
  177. font-size: 24rpx;
  178. }
  179. }
  180. .img {
  181. width: 30rpx;
  182. height: 30rpx;
  183. margin-right: 4rpx;
  184. margin-bottom: 4rpx;
  185. vertical-align: middle;
  186. }
  187. </style>