center.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="container">
  3. <view class="header">
  4. <text class="icon">🏪</text>
  5. <text class="title">服务商中心</text>
  6. </view>
  7. <view class="info-card" v-if="vendorInfoData">
  8. <view class="info-row">
  9. <text class="info-label">服务商类型</text>
  10. <text class="info-value">{{ getTypeLabel(vendorInfoData.vendorType) }}</text>
  11. </view>
  12. <view class="info-row">
  13. <text class="info-label">真实姓名</text>
  14. <text class="info-value">{{ vendorInfoData.realName || '未设置' }}</text>
  15. </view>
  16. <view class="info-row">
  17. <text class="info-label">联系电话</text>
  18. <text class="info-value">{{ vendorInfoData.phone || '未设置' }}</text>
  19. </view>
  20. </view>
  21. <view class="menu-list">
  22. <view class="menu-item" @click="goToProducts">
  23. <text>📦 商品管理</text>
  24. <text class="arrow">›</text>
  25. </view>
  26. <view class="menu-item" @click="goToOrders">
  27. <text>📋 订单管理</text>
  28. <text class="arrow">›</text>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import { vendorInfo } from '../../utils/api'
  35. export default {
  36. data() {
  37. return {
  38. vendorTypes: [
  39. { value: 'planner', label: '成长规划师' },
  40. { value: 'activity_provider', label: '活动提供商' },
  41. { value: 'product_supplier', label: '商品供应商' }
  42. ],
  43. vendorInfoData: null
  44. }
  45. },
  46. onLoad() {
  47. this.loadVendorInfo()
  48. },
  49. methods: {
  50. getTypeLabel(value) {
  51. const item = this.vendorTypes.find(t => t.value === value)
  52. return item ? item.label : value
  53. },
  54. async loadVendorInfo() {
  55. try {
  56. const res = await vendorInfo()
  57. this.vendorInfoData = res.data
  58. } catch (e) {
  59. // handled by api.js
  60. }
  61. },
  62. goToProducts() {
  63. uni.navigateTo({ url: '/pages/vendor/products/products' })
  64. },
  65. goToOrders() {
  66. uni.navigateTo({ url: '/pages/vendor/orders/orders' })
  67. }
  68. }
  69. }
  70. </script>
  71. <style>
  72. .container {
  73. padding: 30rpx;
  74. background: #f8f8f8;
  75. min-height: 100vh;
  76. }
  77. .header {
  78. text-align: center;
  79. padding: 40rpx 0;
  80. display: flex;
  81. flex-direction: column;
  82. align-items: center;
  83. }
  84. .icon {
  85. font-size: 100rpx;
  86. margin-bottom: 20rpx;
  87. }
  88. .title {
  89. font-size: 36rpx;
  90. font-weight: bold;
  91. color: #333;
  92. }
  93. .info-card {
  94. background: #fff;
  95. border-radius: 20rpx;
  96. padding: 30rpx;
  97. margin-bottom: 30rpx;
  98. }
  99. .info-row {
  100. display: flex;
  101. justify-content: space-between;
  102. padding: 15rpx 0;
  103. border-bottom: 2rpx solid #f5f5f5;
  104. }
  105. .info-row:last-child {
  106. border-bottom: none;
  107. }
  108. .info-label {
  109. font-size: 28rpx;
  110. color: #999;
  111. }
  112. .info-value {
  113. font-size: 28rpx;
  114. color: #333;
  115. }
  116. .menu-list {
  117. background: #fff;
  118. border-radius: 20rpx;
  119. }
  120. .menu-item {
  121. display: flex;
  122. justify-content: space-between;
  123. align-items: center;
  124. padding: 30rpx;
  125. border-bottom: 2rpx solid #f5f5f5;
  126. font-size: 30rpx;
  127. }
  128. .menu-item:last-child {
  129. border-bottom: none;
  130. }
  131. .arrow {
  132. color: #ccc;
  133. font-size: 36rpx;
  134. }
  135. .coming-soon {
  136. text-align: center;
  137. padding: 60rpx;
  138. color: #ccc;
  139. font-size: 26rpx;
  140. }
  141. </style>