index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="city-page">
  3. <view class="city-list" v-if="recordList.length">
  4. <view class="city-card" v-for="item in recordList" :key="item.id">
  5. <view class="card-head">
  6. <text class="center-name">{{ item.cityName }}-{{ item.operationCenterName }}</text>
  7. <text class="status-tag" :class="item.status==0?'pending':item.status==1?'opened':'rejected'">
  8. {{ item.status==0?'审核中':item.status==1?'已开通':'审核驳回' }}
  9. </text>
  10. </view>
  11. <view class="card-divider"></view>
  12. <view class="card-body">
  13. <view class="meta-row">
  14. <text class="meta-label">开通原因</text>
  15. <text class="meta-value">{{ item.applyReason || '暂无' }}</text>
  16. </view>
  17. <view class="meta-row">
  18. <text class="meta-label">开通时间</text>
  19. <text class="meta-value">{{ item.actualApprovalTime }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="empty" v-else>暂无城市记录</view>
  25. <view class="footer-bar">
  26. <view class="submit-btn" @click="goApply">开通新城市</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { MOCK_CITY_RECORDS, CITY_STATUS_MAP } from './mock.js'
  32. import { getCityList } from '@/api/workbench.js'
  33. export default {
  34. data() {
  35. return {
  36. recordList: [],
  37. }
  38. },
  39. onShow() {
  40. this.loadList()
  41. },
  42. methods: {
  43. loadList() {
  44. this.recordList = [...MOCK_CITY_RECORDS]
  45. //接口就绪后替换
  46. getCityList({
  47. merchantId: uni.getStorageSync('userId'),
  48. }).then(res => {
  49. console.log(res)
  50. if (res.data.code == 200) {
  51. this.recordList = res.data.data
  52. }
  53. })
  54. },
  55. goApply() {
  56. uni.navigateTo({ url: '/workbench/city/apply' })
  57. },
  58. },
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .city-page {
  63. min-height: 100vh;
  64. background: #f5f5f5;
  65. padding: 24rpx 24rpx 140rpx;
  66. box-sizing: border-box;
  67. }
  68. .city-list {
  69. display: flex;
  70. flex-direction: column;
  71. gap: 20rpx;
  72. }
  73. .city-card {
  74. background: #fff;
  75. border-radius: 16rpx;
  76. padding: 32rpx;
  77. }
  78. .card-head {
  79. display: flex;
  80. align-items: center;
  81. justify-content: space-between;
  82. }
  83. .center-name {
  84. flex: 1;
  85. font-size: 32rpx;
  86. color: #333;
  87. font-weight: 600;
  88. line-height: 1.4;
  89. padding-right: 16rpx;
  90. }
  91. .status-tag {
  92. flex-shrink: 0;
  93. font-size: 22rpx;
  94. padding: 6rpx 16rpx;
  95. border-radius: 8rpx;
  96. line-height: 1.4;
  97. &.opened {
  98. color: #1db870;
  99. background: #e8faf0;
  100. }
  101. &.pending {
  102. color: #ff8800;
  103. background: #fff4e6;
  104. }
  105. &.rejected {
  106. color: #ff4d4f;
  107. background: #fff0f0;
  108. }
  109. }
  110. .card-divider {
  111. height: 1rpx;
  112. background: #f0f0f0;
  113. margin: 24rpx 0;
  114. }
  115. .card-body {
  116. display: flex;
  117. flex-direction: column;
  118. gap: 16rpx;
  119. }
  120. .meta-row {
  121. display: flex;
  122. align-items: center;
  123. justify-content: space-between;
  124. }
  125. .meta-label {
  126. font-size: 26rpx;
  127. color: #999;
  128. flex-shrink: 0;
  129. }
  130. .meta-value {
  131. flex: 1;
  132. text-align: right;
  133. font-size: 26rpx;
  134. color: #333;
  135. margin-left: 24rpx;
  136. }
  137. .empty {
  138. text-align: center;
  139. padding: 120rpx 0;
  140. font-size: 28rpx;
  141. color: #999;
  142. }
  143. .footer-bar {
  144. position: fixed;
  145. left: 0;
  146. right: 0;
  147. bottom: 0;
  148. padding: 20rpx 32rpx;
  149. padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
  150. }
  151. .submit-btn {
  152. margin: 0 auto;
  153. width: 654rpx;
  154. height: 88rpx;
  155. line-height: 88rpx;
  156. text-align: center;
  157. font-weight: 500;
  158. font-size: 32rpx;
  159. color: #FFFFFF;
  160. background: #333335;
  161. border-radius: 60rpx 60rpx 60rpx 60rpx;
  162. }
  163. </style>