You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

352 lines
7.4 KiB

4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
  1. <template>
  2. <view class="main">
  3. <view class="top" :style="{height:iSMT+'px'}"></view>
  4. <!-- 头部导航 -->
  5. <view class="header">
  6. <view class="back-icon">
  7. <image @click="goBack()" src="/static/customer-service-platform/cs-platform-back.png"
  8. class="header-icon-image"></image>
  9. </view>
  10. <view class="title">智能客服中台</view>
  11. <view class="notification-icon">
  12. <image src="/static/customer-service-platform/message.png" class="header-icon-image"></image>
  13. </view>
  14. </view>
  15. <!-- 内容区域 - 使用滚动视图 -->
  16. <scroll-view scroll-y class="content-container">
  17. <view class="list-wrapper" v-if="historyList.length > 0">
  18. <view class="content-header">
  19. <text class="content-title">历史反馈内容</text>
  20. </view>
  21. <view class="card-line"></view>
  22. <view v-for="(item, idx) in historyList" :key="item.id" class="history-item card">
  23. <view class="item-line" v-if="idx != 0"></view>
  24. <view class="item-head">
  25. <view class="dot-outer">
  26. <view class="dot-inner"></view>
  27. </view>
  28. <text class="feedback-time">{{ formatTime(item.createdAt) }}</text>
  29. <text class="feedback-status">
  30. {{ statusText }}
  31. <image class="smile-icon" src="/static/customer-service-platform/smile-icon.png"></image>
  32. </text>
  33. </view>
  34. <view class="content-box">
  35. <text class="content-text">{{ item.content }}</text>
  36. <text class="count">{{ item.content.length }}/200</text>
  37. </view>
  38. <view v-if="item.images && item.images.length" class="thumb-row">
  39. <view v-for="(img, i) in item.images" :key="i" class="thumb-slot"
  40. @click="previewImage(item.images, i)">
  41. <image :src="img" mode="scaleToFill" class="thumb-img" />
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 如果没有历史显示空态 -->
  47. <view v-if="historyList.length === 0" class="empty">
  48. <image mode="aspectFit" class="empty-img" src="/static/customer-service-platform/empty-content.png">
  49. </image>
  50. <text class="empty-tip">暂无内容~</text>
  51. </view>
  52. </scroll-view>
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. getFeedbackRecordsApi,
  58. } from "../../api/customerServicePlatform/customerServicePlatform";
  59. export default {
  60. data() {
  61. return {
  62. iSMT: 0,
  63. statusText: '反馈成功',
  64. historyList: [],
  65. };
  66. },
  67. mounted() {
  68. this.iSMT = uni.getSystemInfoSync().statusBarHeight;
  69. this.loadHistoryList()
  70. },
  71. methods: {
  72. formatTime(str) {
  73. if (!str) return '';
  74. const d = new Date(str);
  75. const yyyy = d.getFullYear();
  76. const mm = String(d.getMonth() + 1).padStart(2, '0');
  77. const dd = String(d.getDate()).padStart(2, '0');
  78. const hh = String(d.getHours()).padStart(2, '0');
  79. const mi = String(d.getMinutes()).padStart(2, '0');
  80. return `${yyyy}-${mm}-${dd} ${hh}:${mi}`;
  81. },
  82. goBack() {
  83. if (typeof uni !== 'undefined' && uni.navigateBack) {
  84. uni.navigateBack();
  85. } else {
  86. window.history.back();
  87. }
  88. },
  89. async loadHistoryList() {
  90. const res = await getFeedbackRecordsApi()
  91. console.log(res)
  92. if (res.code == 200) {
  93. this.historyList = res.data.map(item => {
  94. const images = [item.image1, item.image2, item.image3].filter(img => !!img)
  95. return {
  96. id: item.id,
  97. createdAt: item.createdAt,
  98. content: item.content,
  99. images,
  100. dccode: item.dccode
  101. }
  102. })
  103. }
  104. },
  105. previewImage(list, index) {
  106. if (typeof uni !== 'undefined' && uni.previewImage) {
  107. uni.previewImage({
  108. current: list[index],
  109. urls: list
  110. });
  111. } else {
  112. window.open(list[index], '_blank');
  113. }
  114. }
  115. }
  116. };
  117. </script>
  118. <style scoped>
  119. .main {
  120. display: flex;
  121. flex-direction: column;
  122. height: 100vh;
  123. background-color: #ffffff;
  124. }
  125. .header {
  126. display: flex;
  127. justify-content: space-between;
  128. align-items: center;
  129. padding: 20rpx 30rpx;
  130. background-color: #ffffff;
  131. }
  132. .title {
  133. color: #000000;
  134. text-align: center;
  135. font-size: 32rpx;
  136. font-style: normal;
  137. font-weight: 400;
  138. }
  139. .back-icon,
  140. .notification-icon {
  141. width: 40rpx;
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. }
  146. .header-icon-image {
  147. width: 40rpx;
  148. height: 40rpx;
  149. object-fit: contain;
  150. }
  151. .content-container {
  152. padding: 20rpx;
  153. padding-top: 0;
  154. width: 100%;
  155. box-sizing: border-box;
  156. overflow-x: hidden;
  157. }
  158. /* 列表包装器,居中卡片 */
  159. .list-wrapper {
  160. width: 90%;
  161. margin: 0 auto;
  162. padding: 20rpx 40rpx;
  163. flex-direction: column;
  164. align-items: center;
  165. gap: 20rpx;
  166. box-sizing: border-box;
  167. border-radius: 12rpx;
  168. border: 4rpx solid #FCC8D4;
  169. background: linear-gradient(180deg, #FCC8D3 0%, #FEF0F3 30%, #FFF 100%);
  170. }
  171. .content-header {
  172. width: 100%;
  173. display: flex;
  174. align-items: center;
  175. justify-content: space-between;
  176. }
  177. .content-title {
  178. color: #000000;
  179. font-size: 32rpx;
  180. font-style: normal;
  181. font-weight: 400;
  182. line-height: normal;
  183. }
  184. .card-line {
  185. margin-top: 20rpx;
  186. width: 100%;
  187. height: 2rpx;
  188. border-radius: 2rpx;
  189. background: #FFF;
  190. }
  191. /* 每一条历史卡片 */
  192. .history-item {
  193. border-radius: 10rpx;
  194. padding: 20rpx;
  195. margin-bottom: 20rpx;
  196. box-sizing: border-box;
  197. box-shadow: 0 4rpx 12rpx rgba(255, 77, 128, 0.06);
  198. }
  199. .item-line{
  200. margin-bottom: 20rpx;
  201. width: 100%;
  202. height: 2rpx;
  203. border-radius: 2rpx;
  204. background: #D9D9D9;
  205. }
  206. .item-head {
  207. display: flex;
  208. align-items: center;
  209. gap: 12rpx;
  210. margin-bottom: 12rpx;
  211. }
  212. .dot-outer {
  213. width: 24rpx;
  214. height: 24rpx;
  215. border-radius: 50%;
  216. background: rgba(255, 214, 230, 0.5);
  217. /*粉色外圈*/
  218. display: flex;
  219. align-items: center;
  220. justify-content: center;
  221. box-shadow: 0 0 0 4rpx #ffffff;
  222. /* 最外层白色 */
  223. }
  224. .dot-inner {
  225. width: 14rpx;
  226. height: 14rpx;
  227. border-radius: 50%;
  228. background: #ff4150;
  229. /* 中心红色 */
  230. }
  231. .feedback-time {
  232. color: #000000;
  233. flex: 1;
  234. font-size: 22rpx;
  235. font-style: normal;
  236. font-weight: 400;
  237. line-height: normal;
  238. padding-left: 26rpx;
  239. }
  240. .feedback-status {
  241. color: #ff4150;
  242. font-size: 12rpx;
  243. font-style: normal;
  244. font-weight: 400;
  245. line-height: normal;
  246. display: flex;
  247. align-items: center;
  248. }
  249. .smile-icon {
  250. width: 32rpx;
  251. height: 32rpx;
  252. }
  253. /* 内容框 */
  254. .content-box {
  255. border: 2rpx solid #f0e6ea;
  256. background: #fff;
  257. border-radius: 8rpx;
  258. padding: 18rpx;
  259. position: relative;
  260. box-sizing: border-box;
  261. min-height: 160rpx;
  262. }
  263. .content-text {
  264. display: block;
  265. white-space: pre-wrap;
  266. word-break: break-word;
  267. color: #8a8a8a;
  268. font-size: 24rpx;
  269. font-style: normal;
  270. font-weight: 700;
  271. line-height: normal;
  272. padding-bottom: 26rpx;
  273. }
  274. .count {
  275. position: absolute;
  276. right: 14rpx;
  277. bottom: 10rpx;
  278. color: #000000;
  279. font-size: 24rpx;
  280. font-style: normal;
  281. font-weight: 400;
  282. line-height: normal;
  283. }
  284. .thumb-row {
  285. display: flex;
  286. flex-wrap: wrap;
  287. justify-content: flex-start;
  288. align-items: flex-start;
  289. align-content: flex-start;
  290. width: 100%;
  291. box-sizing: border-box;
  292. gap: 20rpx;
  293. margin-top: 14rpx;
  294. background: #F9FAFE;
  295. padding: 20rpx;
  296. }
  297. .thumb-slot {
  298. width: calc((100% - 2 * 25rpx) / 3);
  299. aspect-ratio: 1 / 1;
  300. border-radius: 7rpx;
  301. border: 1.2rpx solid #F0F1F1;
  302. display: flex;
  303. align-items: center;
  304. justify-content: center;
  305. overflow: hidden;
  306. }
  307. .thumb-img {
  308. width: 100%;
  309. height: 100%;
  310. }
  311. .empty {
  312. padding: 50rpx 0;
  313. text-align: center;
  314. color: #afafaf;
  315. font-size: 32rpx;
  316. font-style: normal;
  317. font-weight: 500;
  318. line-height: 48rpx;
  319. }
  320. .empty-img {
  321. width: 100%;
  322. }
  323. </style>