center.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="container" :style="{ '--font-scale': fontScale }">
  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. import fontScaleMixin from '@/mixins/font-scale.js'
  59. export default {
  60. mixins: [fontScaleMixin],
  61. data() {
  62. return {
  63. vendorTypes: [
  64. { value: 'planner', label: '成长规划师' },
  65. { value: 'activity_provider', label: '活动提供商' },
  66. { value: 'product_supplier', label: '商品供应商' }
  67. ],
  68. vendorInfoData: null,
  69. isPending: false
  70. }
  71. },
  72. onLoad() {
  73. this.loadStatus()
  74. this.loadVendorInfo()
  75. },
  76. methods: {
  77. getTypeLabel(value) {
  78. const item = this.vendorTypes.find(t => t.value === value)
  79. return item ? item.label : (value || '服务商')
  80. },
  81. async loadStatus() {
  82. try {
  83. const res = await vendorStatus()
  84. this.isPending = !!(res && res.data && res.data.vendorStatus === 'pending')
  85. } catch (e) {
  86. this.isPending = false
  87. }
  88. },
  89. async loadVendorInfo() {
  90. try {
  91. const res = await vendorInfo()
  92. this.vendorInfoData = res.data
  93. } catch (e) {
  94. // vendor 未审核通过时会报错,忽略
  95. }
  96. },
  97. goToProducts() {
  98. uni.navigateTo({ url: '/pages/vendor/products/products' })
  99. },
  100. goToOrders() {
  101. uni.navigateTo({ url: '/pages/vendor/orders/orders' })
  102. },
  103. goToTeamSystem() {
  104. uni.navigateTo({ url: '/pages/vendor/team-system/team-system' })
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss">
  110. .container {
  111. padding: $uni-space-page;
  112. background: linear-gradient(180deg, $uni-primary-pale 0%, $facade-fill-page 25%);
  113. min-height: 100vh;
  114. }
  115. /* 待审核提示 */
  116. .pending-banner {
  117. background: linear-gradient(135deg, $status-warning-soft, $dim-wealth-tint);
  118. border: 2rpx solid $status-warning-light;
  119. border-radius: 24rpx;
  120. padding: 40rpx $uni-space-page;
  121. display: flex;
  122. align-items: center;
  123. gap: 24rpx;
  124. margin-top: $uni-space-lg;
  125. }
  126. .pending-icon {
  127. font-size: calc($uni-font-size-5xl * var(--font-scale, 1));
  128. }
  129. .pending-info {
  130. display: flex;
  131. flex-direction: column;
  132. }
  133. .pending-title {
  134. font-size: calc(32rpx * var(--font-scale, 1));
  135. font-weight: bold;
  136. color: $status-warning-strong;
  137. }
  138. .pending-desc {
  139. font-size: calc(24rpx * var(--font-scale, 1));
  140. color: $status-warning-strong-2;
  141. margin-top: 8rpx;
  142. }
  143. /* 头部 */
  144. .header {
  145. text-align: center;
  146. padding: 50rpx 0 40rpx;
  147. display: flex;
  148. flex-direction: column;
  149. align-items: center;
  150. }
  151. .icon {
  152. font-size: calc($uni-font-size-6xl * var(--font-scale, 1));
  153. margin-bottom: 16rpx;
  154. }
  155. .title {
  156. font-size: calc(40rpx * var(--font-scale, 1));
  157. font-weight: bold;
  158. color: $facade-text-gray-800;
  159. }
  160. .status-badge {
  161. margin-top: 12rpx;
  162. padding: 6rpx 20rpx;
  163. border-radius: 24rpx;
  164. font-size: calc(24rpx * var(--font-scale, 1));
  165. background: $facade-fill-gray-100;
  166. color: $facade-text-slate;
  167. }
  168. .status-badge.badge-planner { background: $status-success-tint; color: $status-success-deep; }
  169. .status-badge.badge-activity_provider { background: $status-info-tint; color: $status-info-deep; }
  170. .status-badge.badge-product_supplier { background: $uni-primary-pale; color: $brand-primary-dark; }
  171. /* 信息卡片 */
  172. .info-card {
  173. background: $app-surface;
  174. border-radius: 24rpx;
  175. padding: $uni-space-lg;
  176. margin-bottom: $uni-space-lg;
  177. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06);
  178. }
  179. .info-row {
  180. display: flex;
  181. justify-content: space-between;
  182. padding: 18rpx 0;
  183. border-bottom: 1rpx solid $facade-fill-gray-100;
  184. }
  185. .info-row:last-child {
  186. border-bottom: none;
  187. }
  188. .info-label {
  189. font-size: calc(26rpx * var(--font-scale, 1));
  190. color: $facade-text-gray-400;
  191. }
  192. .info-value {
  193. font-size: calc(26rpx * var(--font-scale, 1));
  194. color: $facade-text-gray-700;
  195. font-weight: 500;
  196. max-width: 60%;
  197. text-align: right;
  198. word-break: break-all;
  199. }
  200. /* 菜单列表 */
  201. .menu-list {
  202. background: $app-surface;
  203. border-radius: 24rpx;
  204. overflow: hidden;
  205. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06);
  206. }
  207. .menu-item {
  208. display: flex;
  209. justify-content: space-between;
  210. align-items: center;
  211. padding: 32rpx $uni-space-page;
  212. border-bottom: 1rpx solid $facade-fill-gray-100;
  213. }
  214. .menu-item:last-child {
  215. border-bottom: none;
  216. }
  217. .menu-icon {
  218. font-size: calc(36rpx * var(--font-scale, 1));
  219. margin-right: 20rpx;
  220. }
  221. .menu-label {
  222. font-size: calc(30rpx * var(--font-scale, 1));
  223. color: $facade-text-gray-700;
  224. flex: 1;
  225. }
  226. .arrow {
  227. color: $app-border-strong;
  228. font-size: calc(36rpx * var(--font-scale, 1));
  229. }
  230. </style>