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.

353 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
  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. token: 'a1bef735d336831ccb0cc3f532093b60'
  92. })
  93. console.log(res)
  94. if (res.code == 200) {
  95. this.historyList = res.data.map(item => {
  96. const images = [item.image1, item.image2, item.image3].filter(img => !!img)
  97. return {
  98. id: item.id,
  99. createdAt: item.createdAt,
  100. content: item.content,
  101. images,
  102. dccode: item.dccode
  103. }
  104. })
  105. }
  106. },
  107. previewImage(list, index) {
  108. if (typeof uni !== 'undefined' && uni.previewImage) {
  109. uni.previewImage({
  110. current: list[index],
  111. urls: list
  112. });
  113. } else {
  114. window.open(list[index], '_blank');
  115. }
  116. }
  117. }
  118. };
  119. </script>
  120. <style scoped>
  121. .main {
  122. display: flex;
  123. flex-direction: column;
  124. height: 100vh;
  125. background-color: #ffffff;
  126. }
  127. .header {
  128. display: flex;
  129. justify-content: space-between;
  130. align-items: center;
  131. padding: 20rpx 30rpx;
  132. background-color: #ffffff;
  133. }
  134. .title {
  135. color: #000000;
  136. text-align: center;
  137. font-size: 32rpx;
  138. font-style: normal;
  139. font-weight: 400;
  140. }
  141. .back-icon,
  142. .notification-icon {
  143. width: 40rpx;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. }
  148. .header-icon-image {
  149. width: 40rpx;
  150. height: 40rpx;
  151. object-fit: contain;
  152. }
  153. .content-container {
  154. padding: 20rpx;
  155. padding-top: 0;
  156. width: 100%;
  157. box-sizing: border-box;
  158. overflow-x: hidden;
  159. }
  160. /* 列表包装器,居中卡片 */
  161. .list-wrapper {
  162. width: 90%;
  163. margin: 0 auto;
  164. padding: 20rpx 40rpx;
  165. flex-direction: column;
  166. align-items: center;
  167. gap: 20rpx;
  168. box-sizing: border-box;
  169. border-radius: 12rpx;
  170. border: 4rpx solid #FCC8D4;
  171. background: linear-gradient(180deg, #FCC8D3 0%, #FEF0F3 30%, #FFF 100%);
  172. }
  173. .content-header {
  174. width: 100%;
  175. display: flex;
  176. align-items: center;
  177. justify-content: space-between;
  178. }
  179. .content-title {
  180. color: #000000;
  181. font-size: 32rpx;
  182. font-style: normal;
  183. font-weight: 400;
  184. line-height: normal;
  185. }
  186. .card-line {
  187. margin-top: 20rpx;
  188. width: 100%;
  189. height: 2rpx;
  190. border-radius: 2rpx;
  191. background: #FFF;
  192. }
  193. /* 每一条历史卡片 */
  194. .history-item {
  195. border-radius: 10rpx;
  196. padding: 20rpx;
  197. margin-bottom: 20rpx;
  198. box-sizing: border-box;
  199. box-shadow: 0 4rpx 12rpx rgba(255, 77, 128, 0.06);
  200. }
  201. .item-line{
  202. margin-bottom: 20rpx;
  203. width: 100%;
  204. height: 2rpx;
  205. border-radius: 2rpx;
  206. background: #D9D9D9;
  207. }
  208. .item-head {
  209. display: flex;
  210. align-items: center;
  211. gap: 12rpx;
  212. margin-bottom: 12rpx;
  213. }
  214. .dot-outer {
  215. width: 24rpx;
  216. height: 24rpx;
  217. border-radius: 50%;
  218. background: rgba(255, 214, 230, 0.5);
  219. /*粉色外圈*/
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. box-shadow: 0 0 0 4rpx #ffffff;
  224. /* 最外层白色 */
  225. }
  226. .dot-inner {
  227. width: 14rpx;
  228. height: 14rpx;
  229. border-radius: 50%;
  230. background: #ff4150;
  231. /* 中心红色 */
  232. }
  233. .feedback-time {
  234. color: #000000;
  235. flex: 1;
  236. font-size: 22rpx;
  237. font-style: normal;
  238. font-weight: 400;
  239. line-height: normal;
  240. padding-left: 26rpx;
  241. }
  242. .feedback-status {
  243. color: #ff4150;
  244. font-size: 12rpx;
  245. font-style: normal;
  246. font-weight: 400;
  247. line-height: normal;
  248. display: flex;
  249. align-items: center;
  250. }
  251. .smile-icon {
  252. width: 32rpx;
  253. height: 32rpx;
  254. }
  255. /* 内容框 */
  256. .content-box {
  257. border: 2rpx solid #f0e6ea;
  258. background: #fff;
  259. border-radius: 8rpx;
  260. padding: 18rpx;
  261. position: relative;
  262. box-sizing: border-box;
  263. min-height: 160rpx;
  264. }
  265. .content-text {
  266. display: block;
  267. white-space: pre-wrap;
  268. word-break: break-word;
  269. color: #8a8a8a;
  270. font-size: 24rpx;
  271. font-style: normal;
  272. font-weight: 700;
  273. line-height: normal;
  274. padding-bottom: 26rpx;
  275. }
  276. .count {
  277. position: absolute;
  278. right: 14rpx;
  279. bottom: 10rpx;
  280. color: #000000;
  281. font-size: 24rpx;
  282. font-style: normal;
  283. font-weight: 400;
  284. line-height: normal;
  285. }
  286. .thumb-row {
  287. display: flex;
  288. flex-wrap: wrap;
  289. justify-content: flex-start;
  290. align-items: flex-start;
  291. align-content: flex-start;
  292. width: 100%;
  293. box-sizing: border-box;
  294. gap: 20rpx;
  295. margin-top: 14rpx;
  296. background: #F9FAFE;
  297. padding: 20rpx;
  298. }
  299. .thumb-slot {
  300. width: calc((100% - 2 * 25rpx) / 3);
  301. aspect-ratio: 1 / 1;
  302. border-radius: 7rpx;
  303. border: 1.2rpx solid #F0F1F1;
  304. display: flex;
  305. align-items: center;
  306. justify-content: center;
  307. overflow: hidden;
  308. }
  309. .thumb-img {
  310. width: 100%;
  311. height: 100%;
  312. }
  313. .empty {
  314. padding: 50rpx 0;
  315. text-align: center;
  316. color: #afafaf;
  317. font-size: 32rpx;
  318. font-style: normal;
  319. font-weight: 500;
  320. line-height: 48rpx;
  321. }
  322. .empty-img {
  323. width: 100%;
  324. }
  325. </style>