巴青农资商城

entry-detail.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view v-if="detail" class="entry-detail-wrap">
  3. <safe-nav-bar title="申请详情" />
  4. <view class="form-page">
  5. <view class="form-card detail-card">
  6. <view class="detail-row">
  7. <text class="detail-row__label">申请单号</text>
  8. <text class="detail-row__val">{{ detail.applyNo }}</text>
  9. </view>
  10. <view class="detail-row">
  11. <text class="detail-row__label">状态</text>
  12. <text class="detail-row__val" :style="{ color: statusInfo.color }">{{ statusInfo.label }}</text>
  13. </view>
  14. <view class="detail-row">
  15. <text class="detail-row__label">申请时间</text>
  16. <text class="detail-row__val">{{ detail.applyTime || '—' }}</text>
  17. </view>
  18. <view v-if="detail.auditTime" class="detail-row">
  19. <text class="detail-row__label">审核时间</text>
  20. <text class="detail-row__val">{{ detail.auditTime }}</text>
  21. </view>
  22. <view
  23. v-if="detail.applyStatus === APPLY_STATUS_PUBLICITY"
  24. class="detail-publicity"
  25. >
  26. <text class="detail-publicity__title">公示期</text>
  27. <text>{{ detail.publicityStartTime || '—' }} 至 {{ detail.publicityEndTime || '—' }}</text>
  28. <text class="detail-publicity__tip">公示结束后将完成开店建档</text>
  29. </view>
  30. <view
  31. v-if="detail.applyStatus === APPLY_STATUS_REJECT && detail.rejectReason"
  32. class="detail-reject"
  33. >
  34. <text class="detail-reject__title">驳回原因</text>
  35. <text>{{ detail.rejectReason }}</text>
  36. </view>
  37. <view v-if="detail.applyStatus === APPLY_STATUS_DONE" class="detail-done">
  38. <text>入驻已完成,请使用经营账号登录商家后台进行发品与店铺经营。</text>
  39. <text v-if="detail.merchantId" class="detail-done__sub">商户 ID:{{ detail.merchantId }}</text>
  40. <text v-if="detail.shopId" class="detail-done__sub">店铺 ID:{{ detail.shopId }}</text>
  41. </view>
  42. </view>
  43. <view v-if="detail.applyStatus === APPLY_STATUS_REJECT && canReapply" class="form-footer">
  44. <button class="form-footer__btn" @click="goReapply">重新申请</button>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script setup>
  50. import { ref, computed } from 'vue'
  51. import SafeNavBar from '@/components/common/SafeNavBar.vue'
  52. import { onLoad } from '@dcloudio/uni-app'
  53. import { getMyEntryApplies, getEntryStatus } from '@/api/merchantEntry'
  54. import { ensureApiToken } from '@/utils/apiAuth'
  55. import {
  56. formatApplyStatus,
  57. APPLY_STATUS_REJECT,
  58. APPLY_STATUS_PUBLICITY,
  59. APPLY_STATUS_DONE,
  60. canSubmitNewApply
  61. } from '@/utils/entryConstants'
  62. import { PAGE_ENTRY_APPLY } from '@/utils/pageRoute'
  63. const applyId = ref(null)
  64. const detail = ref(null)
  65. const entryOpen = ref(true)
  66. const listCache = ref([])
  67. const statusInfo = computed(() => formatApplyStatus(detail.value?.applyStatus))
  68. const canReapply = computed(() => canSubmitNewApply(listCache.value, entryOpen.value))
  69. onLoad((options) => {
  70. if (!ensureApiToken()) return
  71. applyId.value = Number(options.applyId)
  72. loadDetail()
  73. })
  74. function loadDetail() {
  75. Promise.all([getMyEntryApplies(), getEntryStatus()])
  76. .then(([myRes, stRes]) => {
  77. listCache.value = myRes.data || []
  78. entryOpen.value = stRes.data?.entryOpen !== false
  79. detail.value = listCache.value.find((x) => x.applyId === applyId.value) || null
  80. if (!detail.value) {
  81. uni.showToast({ title: '申请不存在', icon: 'none' })
  82. }
  83. })
  84. .catch(() => {})
  85. }
  86. function goReapply() {
  87. uni.navigateTo({ url: PAGE_ENTRY_APPLY })
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. @import '@/styles/mine.scss';
  92. .detail-card {
  93. padding: 16rpx 24rpx;
  94. }
  95. .detail-row {
  96. display: flex;
  97. padding: 20rpx 0;
  98. border-bottom: 1rpx solid #f5f5f5;
  99. }
  100. .detail-row__label {
  101. width: 180rpx;
  102. font-size: 28rpx;
  103. color: #9a938c;
  104. }
  105. .detail-row__val {
  106. flex: 1;
  107. font-size: 28rpx;
  108. color: #4a4542;
  109. }
  110. .detail-reject {
  111. margin-top: 24rpx;
  112. padding: 20rpx;
  113. background: #ffebee;
  114. border-radius: 12rpx;
  115. color: #c62828;
  116. font-size: 26rpx;
  117. line-height: 1.5;
  118. }
  119. .detail-reject__title {
  120. display: block;
  121. font-weight: 600;
  122. margin-bottom: 8rpx;
  123. }
  124. .detail-publicity {
  125. margin-top: 24rpx;
  126. padding: 20rpx;
  127. background: #e3f2fd;
  128. border-radius: 12rpx;
  129. font-size: 26rpx;
  130. color: #1565c0;
  131. line-height: 1.5;
  132. }
  133. .detail-publicity__title {
  134. display: block;
  135. font-weight: 600;
  136. margin-bottom: 8rpx;
  137. }
  138. .detail-publicity__tip {
  139. display: block;
  140. margin-top: 8rpx;
  141. font-size: 24rpx;
  142. }
  143. .detail-done {
  144. margin-top: 24rpx;
  145. padding: 20rpx;
  146. background: #e8f5e9;
  147. border-radius: 12rpx;
  148. font-size: 26rpx;
  149. color: #2e7d32;
  150. line-height: 1.5;
  151. }
  152. .detail-done__sub {
  153. display: block;
  154. margin-top: 8rpx;
  155. font-size: 24rpx;
  156. }
  157. </style>