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.

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