center.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="container">
  3. <!-- 待审核提示 -->
  4. <view v-if="isPending" class="pending-banner">
  5. <text class="pending-icon">⏳</text>
  6. <view class="pending-info">
  7. <text class="pending-title">服务商申请审核中</text>
  8. <text class="pending-desc">请等待管理员审核,预计 1-3 个工作日完成</text>
  9. </view>
  10. </view>
  11. <!-- 未审核通过时隐藏信息卡片和菜单 -->
  12. <view v-else>
  13. <view class="header">
  14. <text class="icon">🏪</text>
  15. <text class="title">服务商中心</text>
  16. <text class="status-badge" :class="'badge-' + (vendorInfoData.vendorType || '')">{{ getTypeLabel(vendorInfoData.vendorType) }}</text>
  17. </view>
  18. <view class="info-card" v-if="vendorInfoData">
  19. <view class="info-row">
  20. <text class="info-label">服务商类型</text>
  21. <text class="info-value">{{ getTypeLabel(vendorInfoData.vendorType) }}</text>
  22. </view>
  23. <view class="info-row">
  24. <text class="info-label">真实姓名</text>
  25. <text class="info-value">{{ vendorInfoData.realName || '未设置' }}</text>
  26. </view>
  27. <view class="info-row">
  28. <text class="info-label">联系电话</text>
  29. <text class="info-value">{{ vendorInfoData.phone || '未设置' }}</text>
  30. </view>
  31. <view class="info-row">
  32. <text class="info-label">联系方式</text>
  33. <text class="info-value">{{ vendorInfoData.vendorInfo || '暂无' }}</text>
  34. </view>
  35. </view>
  36. <view class="menu-list">
  37. <view class="menu-item" @click="goToProducts">
  38. <view class="menu-icon">📦</view>
  39. <text class="menu-label">商品管理</text>
  40. <text class="arrow">›</text>
  41. </view>
  42. <view class="menu-item" @click="goToOrders">
  43. <view class="menu-icon">📋</view>
  44. <text class="menu-label">订单管理</text>
  45. <text class="arrow">›</text>
  46. </view>
  47. <view class="menu-item" @click="goToTeamSystem">
  48. <view class="menu-icon">👥</view>
  49. <text class="menu-label">团队管理</text>
  50. <text class="arrow">›</text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import { vendorInfo, vendorStatus } from '../../utils/api'
  58. export default {
  59. data() {
  60. return {
  61. vendorTypes: [
  62. { value: 'planner', label: '成长规划师' },
  63. { value: 'activity_provider', label: '活动提供商' },
  64. { value: 'product_supplier', label: '商品供应商' }
  65. ],
  66. vendorInfoData: null,
  67. isPending: false
  68. }
  69. },
  70. onLoad() {
  71. this.loadStatus()
  72. this.loadVendorInfo()
  73. },
  74. methods: {
  75. getTypeLabel(value) {
  76. const item = this.vendorTypes.find(t => t.value === value)
  77. return item ? item.label : (value || '服务商')
  78. },
  79. async loadStatus() {
  80. try {
  81. const res = await vendorStatus()
  82. this.isPending = !!(res && res.data && res.data.vendorStatus === 'pending')
  83. } catch (e) {
  84. this.isPending = false
  85. }
  86. },
  87. async loadVendorInfo() {
  88. try {
  89. const res = await vendorInfo()
  90. this.vendorInfoData = res.data
  91. } catch (e) {
  92. // vendor 未审核通过时会报错,忽略
  93. }
  94. },
  95. goToProducts() {
  96. uni.navigateTo({ url: '/pages/vendor/products/products' })
  97. },
  98. goToOrders() {
  99. uni.navigateTo({ url: '/pages/vendor/orders/orders' })
  100. },
  101. goToTeamSystem() {
  102. uni.navigateTo({ url: '/pages/vendor/team-system/team-system' })
  103. }
  104. }
  105. }
  106. </script>
  107. <style>
  108. .container {
  109. padding: 30rpx;
  110. background: linear-gradient(180deg, #FFF7ED 0%, #F8F8F8 25%);
  111. min-height: 100vh;
  112. }
  113. /* 待审核提示 */
  114. .pending-banner {
  115. background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
  116. border: 2rpx solid #FDE68A;
  117. border-radius: 20rpx;
  118. padding: 40rpx 30rpx;
  119. display: flex;
  120. align-items: center;
  121. gap: 24rpx;
  122. margin-top: 30rpx;
  123. }
  124. .pending-icon {
  125. font-size: 72rpx;
  126. }
  127. .pending-info {
  128. display: flex;
  129. flex-direction: column;
  130. }
  131. .pending-title {
  132. font-size: 32rpx;
  133. font-weight: bold;
  134. color: #92400E;
  135. }
  136. .pending-desc {
  137. font-size: 24rpx;
  138. color: #B45309;
  139. margin-top: 8rpx;
  140. }
  141. /* 头部 */
  142. .header {
  143. text-align: center;
  144. padding: 50rpx 0 40rpx;
  145. display: flex;
  146. flex-direction: column;
  147. align-items: center;
  148. }
  149. .icon {
  150. font-size: 100rpx;
  151. margin-bottom: 16rpx;
  152. }
  153. .title {
  154. font-size: 40rpx;
  155. font-weight: bold;
  156. color: #1F2937;
  157. }
  158. .status-badge {
  159. margin-top: 12rpx;
  160. padding: 6rpx 20rpx;
  161. border-radius: 20rpx;
  162. font-size: 24rpx;
  163. background: #F3F4F6;
  164. color: #6B7280;
  165. }
  166. .status-badge.badge-planner { background: #ECFDF5; color: #059669; }
  167. .status-badge.badge-activity_provider { background: #EFF6FF; color: #2563EB; }
  168. .status-badge.badge-product_supplier { background: #FFF7ED; color: #EA580C; }
  169. /* 信息卡片 */
  170. .info-card {
  171. background: #fff;
  172. border-radius: 20rpx;
  173. padding: 30rpx;
  174. margin-bottom: 30rpx;
  175. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06);
  176. }
  177. .info-row {
  178. display: flex;
  179. justify-content: space-between;
  180. padding: 18rpx 0;
  181. border-bottom: 1rpx solid #F3F4F6;
  182. }
  183. .info-row:last-child {
  184. border-bottom: none;
  185. }
  186. .info-label {
  187. font-size: 26rpx;
  188. color: #9CA3AF;
  189. }
  190. .info-value {
  191. font-size: 26rpx;
  192. color: #374151;
  193. font-weight: 500;
  194. max-width: 60%;
  195. text-align: right;
  196. word-break: break-all;
  197. }
  198. /* 菜单列表 */
  199. .menu-list {
  200. background: #fff;
  201. border-radius: 20rpx;
  202. overflow: hidden;
  203. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06);
  204. }
  205. .menu-item {
  206. display: flex;
  207. justify-content: space-between;
  208. align-items: center;
  209. padding: 32rpx 30rpx;
  210. border-bottom: 1rpx solid #F3F4F6;
  211. }
  212. .menu-item:last-child {
  213. border-bottom: none;
  214. }
  215. .menu-icon {
  216. font-size: 36rpx;
  217. margin-right: 20rpx;
  218. }
  219. .menu-label {
  220. font-size: 30rpx;
  221. color: #374151;
  222. flex: 1;
  223. }
  224. .arrow {
  225. color: #D1D5DB;
  226. font-size: 36rpx;
  227. }
  228. </style>