negotiation-history.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="negotiation-history-page">
  3. <view class="history-list" v-if="list.length > 0">
  4. <view class="history-item" v-for="(item, index) in list" :key="index">
  5. <!-- 左侧头像 -->
  6. <view class="avatar-box">
  7. <image class="avatar" :src="item.imgPath || '/static/default-avatar.png'" mode="aspectFill"></image>
  8. </view>
  9. <!-- 右侧内容 -->
  10. <view class="content-box">
  11. <view class="user-info">
  12. <text class="name">{{ item.userName || '用户' }}</text>
  13. <text class="time">{{ item.createTime }}</text>
  14. </view>
  15. <view class="message-card">
  16. <view class="msg-title" v-if="item.title">{{ item.title }}</view>
  17. <view class="msg-content" v-if="item.content">
  18. <text>{{ item.content }}</text>
  19. </view>
  20. <!-- 凭证图片 -->
  21. <view class="img-grid" v-if="item.imgList && item.imgList.length > 0">
  22. <image
  23. class="grid-img"
  24. v-for="(img, imgIndex) in item.imgList"
  25. :key="imgIndex"
  26. :src="img"
  27. mode="aspectFill"
  28. @click="previewImage(item.imgList, imgIndex)"
  29. ></image>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 空状态 -->
  36. <view class="empty-box" v-else-if="!loading">
  37. <u-empty text="暂无协商历史" mode="history"></u-empty>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. refundOrderId: '',
  46. list: [],
  47. loading: true
  48. };
  49. },
  50. onLoad(options) {
  51. if (options.refundOrderId) {
  52. this.refundOrderId = options.refundOrderId;
  53. this.getList();
  54. }
  55. },
  56. methods: {
  57. getList() {
  58. this.loading = true;
  59. uni.showLoading({ title: '加载中' });
  60. this.$u.api.refundDisposeListAjax({ refundOrderId: this.refundOrderId }).then(res => {
  61. uni.hideLoading();
  62. this.loading = false;
  63. if (res.code == 200) {
  64. this.list = res.data || [];
  65. } else {
  66. uni.showToast({
  67. title: res.msg || '获取失败',
  68. icon: 'none'
  69. });
  70. }
  71. }).catch(() => {
  72. uni.hideLoading();
  73. this.loading = false;
  74. });
  75. },
  76. previewImage(imgList, current) {
  77. uni.previewImage({
  78. urls: imgList,
  79. current: current
  80. });
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .negotiation-history-page {
  87. min-height: 100vh;
  88. background-color: #F5F5F5;
  89. padding: 30rpx;
  90. .history-list {
  91. background-color: #fff;
  92. border-radius: 16rpx;
  93. padding: 30rpx 20rpx;
  94. .history-item {
  95. display: flex;
  96. margin-bottom: 40rpx;
  97. &:last-child {
  98. margin-bottom: 0;
  99. .content-box {
  100. border-bottom: none;
  101. }
  102. }
  103. .avatar-box {
  104. width: 80rpx;
  105. margin-right: 20rpx;
  106. flex-shrink: 0;
  107. .avatar {
  108. width: 80rpx;
  109. height: 80rpx;
  110. border-radius: 50%;
  111. background-color: #eee;
  112. }
  113. }
  114. .content-box {
  115. flex: 1;
  116. padding-bottom: 40rpx;
  117. border-bottom: 1rpx solid #F0F0F0;
  118. .user-info {
  119. display: flex;
  120. flex-direction: column;
  121. margin-bottom: 16rpx;
  122. .name {
  123. font-size: 28rpx;
  124. font-weight: bold;
  125. color: #666;
  126. margin-bottom: 6rpx;
  127. }
  128. .time {
  129. font-size: 24rpx;
  130. color: #999;
  131. }
  132. }
  133. .message-card {
  134. .msg-title {
  135. font-size: 28rpx;
  136. font-weight: bold;
  137. color: #333;
  138. margin-bottom: 10rpx;
  139. }
  140. .msg-content {
  141. font-size: 28rpx;
  142. color: #333;
  143. line-height: 1.6;
  144. word-break: break-all;
  145. }
  146. .img-grid {
  147. display: flex;
  148. flex-wrap: wrap;
  149. margin-top: 20rpx;
  150. .grid-img {
  151. width: 160rpx;
  152. height: 160rpx;
  153. border-radius: 8rpx;
  154. margin-right: 16rpx;
  155. margin-bottom: 16rpx;
  156. background-color: #f8f8f8;
  157. &:nth-child(3n) {
  158. margin-right: 0;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. .empty-box {
  167. padding-top: 200rpx;
  168. }
  169. }
  170. </style>