audit-records.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. <template>
  2. <view class="audit-records">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <view class="back-btn" @click="goBack"></view>
  6. <text class="header-title">撮合成功通知</text>
  7. <view class="placeholder"></view>
  8. </view>
  9. <scroll-view scroll-y class="content" @scrolltolower="loadMore">
  10. <!-- 加载中 -->
  11. <view v-if="loading && records.length === 0" class="loading-container">
  12. <text>加载中...</text>
  13. </view>
  14. <!-- 记录列表 -->
  15. <view v-else-if="records.length > 0" class="record-list">
  16. <view
  17. v-for="record in records"
  18. :key="record.id"
  19. class="record-item"
  20. :class="{ unread: !record.isRead && (record.auditStatus === 1 || record.auditStatus === 2) }"
  21. @click="openDetail(record)"
  22. >
  23. <!-- 状态标签 -->
  24. <view class="status-tag"
  25. :class="{
  26. 'status-pending': record.auditStatus === 0,
  27. 'status-success': record.auditStatus === 1,
  28. 'status-fail': record.auditStatus === 2,
  29. 'status-checking': record.auditStatus === 3
  30. }">
  31. {{ getStatusText(record.auditStatus) }}
  32. </view>
  33. <!-- 未读红点 -->
  34. <view v-if="!record.isRead && (record.auditStatus === 1 || record.auditStatus === 2)" class="unread-dot"></view>
  35. <!-- 记录内容 -->
  36. <view class="record-content">
  37. <view class="record-title">
  38. <text class="couple-names">{{ record.maleRealName }} & {{ record.femaleRealName }}</text>
  39. <text class="case-type">{{ record.caseType === 1 ? '订婚' : '结婚' }}</text>
  40. </view>
  41. <view class="record-summary">
  42. <text v-if="record.auditStatus === 0">您提交的撮合成功案例正在等待审核</text>
  43. <text v-else-if="record.auditStatus === 3">您的案例正在核实中,请耐心等待</text>
  44. <text v-else-if="record.auditStatus === 1">
  45. 恭喜!审核通过,获得{{ record.pointsReward || 0 }}积分
  46. <text v-if="record.cashReward > 0">+{{ record.cashReward }}元现金</text>
  47. 奖励
  48. </text>
  49. <text v-else-if="record.auditStatus === 2">审核未通过:{{ record.auditRemark || '未说明原因' }}</text>
  50. </view>
  51. <view class="record-time">{{ formatTime(record.createdAt) }}</view>
  52. </view>
  53. </view>
  54. <!-- 加载更多 -->
  55. <view v-if="loading" class="loading-more">
  56. <text>加载中...</text>
  57. </view>
  58. <view v-else-if="!hasMore" class="no-more">
  59. <text>没有更多了</text>
  60. </view>
  61. </view>
  62. <!-- 空状态 -->
  63. <view v-else class="empty-container">
  64. <view class="empty-icon">📋</view>
  65. <text class="empty-text">暂无审核记录</text>
  66. <text class="empty-hint">提交撮合成功案例后,审核进度将在这里显示</text>
  67. </view>
  68. </scroll-view>
  69. <!-- 详情弹窗 -->
  70. <uni-popup ref="detailPopup" type="center">
  71. <view class="detail-popup" v-if="currentRecord">
  72. <view class="popup-header">
  73. <text class="popup-title">审核详情</text>
  74. <view class="close-btn" @click="closeDetail">×</view>
  75. </view>
  76. <view class="popup-content">
  77. <!-- 状态 -->
  78. <view class="detail-status"
  79. :class="{
  80. 'status-pending': currentRecord.auditStatus === 0,
  81. 'status-success': currentRecord.auditStatus === 1,
  82. 'status-fail': currentRecord.auditStatus === 2,
  83. 'status-checking': currentRecord.auditStatus === 3
  84. }">
  85. <view class="status-icon" v-if="currentRecord.auditStatus !== 2">
  86. <text v-if="currentRecord.auditStatus === 0">⏳</text>
  87. <text v-else-if="currentRecord.auditStatus === 3">🔍</text>
  88. <text v-else-if="currentRecord.auditStatus === 1">✅</text>
  89. </view>
  90. <text class="status-text">{{ getStatusText(currentRecord.auditStatus) }}</text>
  91. </view>
  92. <!-- 案例信息 -->
  93. <view class="detail-section">
  94. <view class="section-title">案例信息</view>
  95. <view class="info-row">
  96. <text class="info-label">男方姓名</text>
  97. <text class="info-value">{{ currentRecord.maleRealName }}</text>
  98. </view>
  99. <view class="info-row">
  100. <text class="info-label">女方姓名</text>
  101. <text class="info-value">{{ currentRecord.femaleRealName }}</text>
  102. </view>
  103. <view class="info-row">
  104. <text class="info-label">案例类型</text>
  105. <text class="info-value">{{ currentRecord.caseType === 1 ? '订婚' : '结婚' }}</text>
  106. </view>
  107. <view class="info-row" v-if="currentRecord.caseDate">
  108. <text class="info-label">成功日期</text>
  109. <text class="info-value">{{ currentRecord.caseDate }}</text>
  110. </view>
  111. <view class="info-row">
  112. <text class="info-label">提交时间</text>
  113. <text class="info-value">{{ formatTime(currentRecord.createdAt) }}</text>
  114. </view>
  115. </view>
  116. <!-- 审核通过:显示奖励 -->
  117. <view v-if="currentRecord.auditStatus === 1" class="detail-section reward-section">
  118. <view class="section-title">🎉 奖励信息</view>
  119. <view class="reward-content">
  120. <view class="reward-item" v-if="currentRecord.pointsReward > 0">
  121. <text class="reward-icon">🏆</text>
  122. <text class="reward-text">积分奖励:+{{ currentRecord.pointsReward }}积分</text>
  123. </view>
  124. <view class="reward-item" v-if="currentRecord.cashReward > 0">
  125. <text class="reward-icon">💰</text>
  126. <text class="reward-text">现金奖励:+{{ currentRecord.cashReward }}元</text>
  127. </view>
  128. <view class="reward-status">
  129. <text v-if="currentRecord.rewardStatus === 1" class="issued">奖励已发放</text>
  130. <text v-else class="pending">奖励待发放</text>
  131. </view>
  132. </view>
  133. </view>
  134. <!-- 审核失败:显示原因 -->
  135. <view v-if="currentRecord.auditStatus === 2" class="detail-section fail-section">
  136. <view class="section-title">审核未通过</view>
  137. <view class="fail-reason">
  138. <text>{{ currentRecord.auditRemark || '未说明具体原因,如有疑问请联系客服' }}</text>
  139. </view>
  140. <view class="fail-hint" @click="goToResubmit">
  141. <text>您可以修改后重新提交审核</text>
  142. <text class="resubmit-link">去提交 ></text>
  143. </view>
  144. </view>
  145. <!-- 待审核/核实中 -->
  146. <view v-if="currentRecord.auditStatus === 0 || currentRecord.auditStatus === 3" class="detail-section pending-section">
  147. <view class="section-title">{{ currentRecord.auditStatus === 0 ? '⏳ 等待审核' : '🔍 核实中' }}</view>
  148. <view class="pending-hint">
  149. <text v-if="currentRecord.auditStatus === 0">您的案例已提交,工作人员将尽快审核,请耐心等待</text>
  150. <text v-else>工作人员正在核实您的案例信息,请保持电话畅通</text>
  151. </view>
  152. </view>
  153. <!-- 审核时间 -->
  154. <view v-if="currentRecord.updatedAt" class="detail-section">
  155. <view class="info-row">
  156. <text class="info-label">审核时间</text>
  157. <text class="info-value">{{ formatTime(currentRecord.updatedAt) }}</text>
  158. </view>
  159. </view>
  160. </view>
  161. <view class="popup-footer">
  162. <button class="confirm-btn" @click="closeDetail">我知道了</button>
  163. </view>
  164. </view>
  165. </uni-popup>
  166. </view>
  167. </template>
  168. <script>
  169. import api from '@/utils/api.js'
  170. export default {
  171. data() {
  172. return {
  173. loading: false,
  174. records: [],
  175. currentRecord: null,
  176. matchmakerId: null,
  177. pageNum: 1,
  178. pageSize: 20,
  179. hasMore: true
  180. }
  181. },
  182. onLoad() {
  183. this.loadMatchmakerInfo()
  184. },
  185. onShow() {
  186. // 页面显示时刷新列表
  187. if (this.matchmakerId) {
  188. this.refreshList()
  189. }
  190. },
  191. methods: {
  192. goBack() {
  193. uni.navigateBack()
  194. },
  195. async loadMatchmakerInfo() {
  196. try {
  197. const userInfo = uni.getStorageSync('userInfo')
  198. if (userInfo && userInfo.userId) {
  199. const matchmakerInfo = await api.matchmaker.getByUserId(userInfo.userId)
  200. if (matchmakerInfo) {
  201. this.matchmakerId = matchmakerInfo.matchmakerId || matchmakerInfo.matchmaker_id || null
  202. if (this.matchmakerId) {
  203. this.loadRecords()
  204. } else {
  205. uni.showToast({ title: '未找到红娘信息', icon: 'none' })
  206. }
  207. }
  208. }
  209. } catch (e) {
  210. uni.showToast({ title: '获取红娘信息失败', icon: 'none' })
  211. }
  212. },
  213. async loadRecords() {
  214. if (this.loading || !this.hasMore) return
  215. this.loading = true
  216. try {
  217. const res = await api.successCaseUpload.getAuditRecords(
  218. this.matchmakerId,
  219. null, // 不筛选状态,显示全部
  220. this.pageNum,
  221. this.pageSize
  222. )
  223. const pageData = res?.records || res?.data?.records || []
  224. const total = res?.total || res?.data?.total || 0
  225. if (this.pageNum === 1) {
  226. this.records = pageData
  227. } else {
  228. this.records = [...this.records, ...pageData]
  229. }
  230. this.hasMore = this.records.length < total
  231. this.pageNum++
  232. } catch (e) {
  233. uni.showToast({ title: '加载失败', icon: 'none' })
  234. } finally {
  235. this.loading = false
  236. }
  237. },
  238. refreshList() {
  239. this.pageNum = 1
  240. this.hasMore = true
  241. this.records = []
  242. this.loadRecords()
  243. },
  244. loadMore() {
  245. if (this.hasMore && !this.loading) {
  246. this.loadRecords()
  247. }
  248. },
  249. async openDetail(record) {
  250. this.currentRecord = record
  251. this.$refs.detailPopup.open()
  252. // 如果是已审核完成且未读,标记为已读
  253. if ((record.auditStatus === 1 || record.auditStatus === 2) && !record.isRead) {
  254. try {
  255. await api.successCaseUpload.markAsRead(record.id)
  256. // 更新本地状态
  257. record.isRead = 1
  258. } catch (e) {
  259. }
  260. }
  261. },
  262. closeDetail() {
  263. this.$refs.detailPopup.close()
  264. this.currentRecord = null
  265. },
  266. // 跳转到重新提交审核页面
  267. goToResubmit() {
  268. if (!this.currentRecord) return
  269. // 关闭弹窗
  270. this.$refs.detailPopup.close()
  271. // 跳转到提交页面,携带记录ID用于回显数据
  272. uni.navigateTo({
  273. url: `/pages/matchmaker-workbench/success-case-upload?resubmitId=${this.currentRecord.id}`
  274. })
  275. },
  276. getStatusText(status) {
  277. const statusMap = {
  278. 0: '待审核',
  279. 1: '审核通过',
  280. 2: '审核失败',
  281. 3: '核实中'
  282. }
  283. return statusMap[status] || '未知'
  284. },
  285. // getStatusClass 方法已移除,改用内联对象语法
  286. formatTime(timeStr) {
  287. if (!timeStr) return ''
  288. const date = new Date(timeStr)
  289. const now = new Date()
  290. const diff = now - date
  291. // 一分钟内
  292. if (diff < 60000) {
  293. return '刚刚'
  294. }
  295. // 一小时内
  296. if (diff < 3600000) {
  297. return Math.floor(diff / 60000) + '分钟前'
  298. }
  299. // 今天
  300. if (date.toDateString() === now.toDateString()) {
  301. return date.getHours() + ':' + String(date.getMinutes()).padStart(2, '0')
  302. }
  303. // 昨天
  304. const yesterday = new Date(now)
  305. yesterday.setDate(yesterday.getDate() - 1)
  306. if (date.toDateString() === yesterday.toDateString()) {
  307. return '昨天 ' + date.getHours() + ':' + String(date.getMinutes()).padStart(2, '0')
  308. }
  309. // 更早
  310. const month = date.getMonth() + 1
  311. const day = date.getDate()
  312. return `${month}-${day} ${date.getHours()}:${String(date.getMinutes()).padStart(2, '0')}`
  313. }
  314. }
  315. }
  316. </script>
  317. <style lang="scss" scoped>
  318. .audit-records {
  319. min-height: 100vh;
  320. background: linear-gradient(180deg, #fff1f7 0%, #f6ebff 45%, #fbf7ff 75%, #ffffff 100%);
  321. display: flex;
  322. flex-direction: column;
  323. }
  324. /* 顶部导航栏 */
  325. .header {
  326. display: flex;
  327. align-items: center;
  328. justify-content: space-between;
  329. padding: 25rpx 30rpx;
  330. padding-top: calc(25rpx + env(safe-area-inset-top));
  331. background: transparent;
  332. .back-btn {
  333. width: 70rpx;
  334. height: 70rpx;
  335. display: flex;
  336. align-items: center;
  337. justify-content: center;
  338. background: rgba(240, 240, 240, 0.5);
  339. border-radius: 50%;
  340. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
  341. background-size: 40rpx 40rpx;
  342. background-repeat: no-repeat;
  343. background-position: center;
  344. }
  345. .header-title {
  346. font-size: 38rpx;
  347. font-weight: bold;
  348. color: #333;
  349. }
  350. .placeholder {
  351. width: 70rpx;
  352. }
  353. }
  354. .content {
  355. flex: 1;
  356. padding: 20rpx 24rpx;
  357. box-sizing: border-box;
  358. }
  359. /* 记录列表 */
  360. .record-list {
  361. padding-bottom: 40rpx;
  362. }
  363. .record-item {
  364. background: #ffffff;
  365. border-radius: 24rpx;
  366. padding: 28rpx;
  367. margin-bottom: 20rpx;
  368. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.05);
  369. position: relative;
  370. &.unread {
  371. background: linear-gradient(135deg, #fff8fb 0%, #fef5ff 100%);
  372. border: 2rpx solid rgba(233, 30, 99, 0.15);
  373. }
  374. }
  375. /* 状态标签 */
  376. .status-tag {
  377. position: absolute;
  378. top: 0;
  379. left: 28rpx;
  380. padding: 6rpx 16rpx;
  381. border-radius: 0 0 12rpx 12rpx;
  382. font-size: 22rpx;
  383. font-weight: 500;
  384. &.status-pending {
  385. background: #fff3e0;
  386. color: #f57c00;
  387. }
  388. &.status-success {
  389. background: #e8f5e9;
  390. color: #43a047;
  391. }
  392. &.status-fail {
  393. background: #ffebee;
  394. color: #e53935;
  395. }
  396. &.status-checking {
  397. background: #e3f2fd;
  398. color: #1976d2;
  399. }
  400. }
  401. /* 未读红点 */
  402. .unread-dot {
  403. position: absolute;
  404. top: 20rpx;
  405. right: 20rpx;
  406. width: 16rpx;
  407. height: 16rpx;
  408. background: #e91e63;
  409. border-radius: 50%;
  410. }
  411. /* 记录内容 */
  412. .record-content {
  413. padding-top: 30rpx;
  414. }
  415. .record-title {
  416. display: flex;
  417. align-items: center;
  418. margin-bottom: 12rpx;
  419. .couple-names {
  420. font-size: 32rpx;
  421. font-weight: 600;
  422. color: #333;
  423. margin-right: 16rpx;
  424. }
  425. .case-type {
  426. font-size: 24rpx;
  427. color: #9c27b0;
  428. background: #f3e5f5;
  429. padding: 4rpx 12rpx;
  430. border-radius: 8rpx;
  431. }
  432. }
  433. .record-summary {
  434. font-size: 26rpx;
  435. color: #666;
  436. line-height: 1.5;
  437. margin-bottom: 12rpx;
  438. }
  439. .record-time {
  440. font-size: 24rpx;
  441. color: #999;
  442. }
  443. /* 加载状态 */
  444. .loading-container,
  445. .empty-container {
  446. display: flex;
  447. flex-direction: column;
  448. justify-content: center;
  449. align-items: center;
  450. padding: 100rpx 0;
  451. color: #999;
  452. font-size: 28rpx;
  453. }
  454. .empty-icon {
  455. font-size: 80rpx;
  456. margin-bottom: 20rpx;
  457. }
  458. .empty-text {
  459. font-size: 32rpx;
  460. color: #666;
  461. margin-bottom: 12rpx;
  462. }
  463. .empty-hint {
  464. font-size: 26rpx;
  465. color: #999;
  466. }
  467. .loading-more,
  468. .no-more {
  469. text-align: center;
  470. padding: 30rpx 0;
  471. color: #999;
  472. font-size: 26rpx;
  473. }
  474. /* 详情弹窗 */
  475. .detail-popup {
  476. width: 650rpx;
  477. background: #ffffff;
  478. border-radius: 24rpx;
  479. overflow: hidden;
  480. }
  481. .popup-header {
  482. display: flex;
  483. align-items: center;
  484. justify-content: space-between;
  485. padding: 30rpx;
  486. border-bottom: 1rpx solid #f0f0f0;
  487. .popup-title {
  488. font-size: 34rpx;
  489. font-weight: 600;
  490. color: #333;
  491. }
  492. .close-btn {
  493. width: 50rpx;
  494. height: 50rpx;
  495. display: flex;
  496. align-items: center;
  497. justify-content: center;
  498. font-size: 40rpx;
  499. color: #999;
  500. }
  501. }
  502. .popup-content {
  503. padding: 30rpx;
  504. max-height: 70vh;
  505. overflow-y: auto;
  506. }
  507. /* 详情状态 */
  508. .detail-status {
  509. display: flex;
  510. flex-direction: column;
  511. align-items: center;
  512. padding: 30rpx;
  513. border-radius: 16rpx;
  514. margin-bottom: 30rpx;
  515. &.status-pending {
  516. background: #fff3e0;
  517. }
  518. &.status-success {
  519. background: #e8f5e9;
  520. }
  521. &.status-fail {
  522. background: #ffebee;
  523. }
  524. &.status-checking {
  525. background: #e3f2fd;
  526. }
  527. .status-icon {
  528. font-size: 60rpx;
  529. margin-bottom: 12rpx;
  530. }
  531. .status-text {
  532. font-size: 32rpx;
  533. font-weight: 600;
  534. }
  535. }
  536. /* 详情区块 */
  537. .detail-section {
  538. margin-bottom: 30rpx;
  539. .section-title {
  540. font-size: 28rpx;
  541. font-weight: 600;
  542. color: #333;
  543. margin-bottom: 16rpx;
  544. padding-bottom: 12rpx;
  545. border-bottom: 1rpx solid #f0f0f0;
  546. }
  547. }
  548. .info-row {
  549. display: flex;
  550. justify-content: space-between;
  551. padding: 12rpx 0;
  552. .info-label {
  553. font-size: 26rpx;
  554. color: #999;
  555. }
  556. .info-value {
  557. font-size: 26rpx;
  558. color: #333;
  559. }
  560. }
  561. /* 奖励区块 */
  562. .reward-section {
  563. background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  564. padding: 24rpx;
  565. border-radius: 16rpx;
  566. .section-title {
  567. border-bottom: none;
  568. padding-bottom: 0;
  569. }
  570. }
  571. .reward-content {
  572. .reward-item {
  573. display: flex;
  574. align-items: center;
  575. padding: 12rpx 0;
  576. .reward-icon {
  577. font-size: 36rpx;
  578. margin-right: 12rpx;
  579. }
  580. .reward-text {
  581. font-size: 28rpx;
  582. color: #333;
  583. font-weight: 500;
  584. }
  585. }
  586. .reward-status {
  587. margin-top: 16rpx;
  588. text-align: center;
  589. .issued {
  590. color: #43a047;
  591. font-size: 26rpx;
  592. }
  593. .pending {
  594. color: #f57c00;
  595. font-size: 26rpx;
  596. }
  597. }
  598. }
  599. /* 失败区块 */
  600. .fail-section {
  601. background: #fff5f5;
  602. padding: 24rpx;
  603. border-radius: 16rpx;
  604. .section-title {
  605. border-bottom: none;
  606. padding-bottom: 0;
  607. color: #e53935;
  608. }
  609. .fail-reason {
  610. font-size: 28rpx;
  611. color: #333;
  612. line-height: 1.6;
  613. padding: 12rpx 0;
  614. }
  615. .fail-hint {
  616. font-size: 24rpx;
  617. color: #999;
  618. margin-top: 12rpx;
  619. display: flex;
  620. justify-content: space-between;
  621. align-items: center;
  622. .resubmit-link {
  623. color: #9c27b0;
  624. font-weight: 500;
  625. }
  626. }
  627. }
  628. /* 待审核区块 */
  629. .pending-section {
  630. background: #f5f5f5;
  631. padding: 24rpx;
  632. border-radius: 16rpx;
  633. .section-title {
  634. border-bottom: none;
  635. padding-bottom: 0;
  636. }
  637. .pending-hint {
  638. font-size: 26rpx;
  639. color: #666;
  640. line-height: 1.6;
  641. }
  642. }
  643. /* 弹窗底部 */
  644. .popup-footer {
  645. padding: 20rpx 30rpx 30rpx;
  646. .confirm-btn {
  647. width: 100%;
  648. height: 88rpx;
  649. background: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
  650. color: #ffffff;
  651. font-size: 32rpx;
  652. font-weight: 500;
  653. border-radius: 44rpx;
  654. display: flex;
  655. align-items: center;
  656. justify-content: center;
  657. border: none;
  658. }
  659. }
  660. </style>