| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <view class="container" :style="{ '--font-scale': fontScale }">
- <!-- 待审核提示 -->
- <view v-if="isPending" class="pending-banner">
- <text class="pending-icon">⏳</text>
- <view class="pending-info">
- <text class="pending-title">服务商申请审核中</text>
- <text class="pending-desc">请等待管理员审核,预计 1-3 个工作日完成</text>
- </view>
- </view>
- <!-- 未审核通过时隐藏信息卡片和菜单 -->
- <view v-else>
- <view class="header">
- <text class="icon">🏪</text>
- <text class="title">服务商中心</text>
- <text class="status-badge" :class="'badge-' + (vendorInfoData.vendorType || '')">{{ getTypeLabel(vendorInfoData.vendorType) }}</text>
- </view>
- <view class="info-card" v-if="vendorInfoData">
- <view class="info-row">
- <text class="info-label">服务商类型</text>
- <text class="info-value">{{ getTypeLabel(vendorInfoData.vendorType) }}</text>
- </view>
- <view class="info-row">
- <text class="info-label">真实姓名</text>
- <text class="info-value">{{ vendorInfoData.realName || '未设置' }}</text>
- </view>
- <view class="info-row">
- <text class="info-label">联系电话</text>
- <text class="info-value">{{ vendorInfoData.phone || '未设置' }}</text>
- </view>
- <view class="info-row">
- <text class="info-label">联系方式</text>
- <text class="info-value">{{ vendorInfoData.vendorInfo || '暂无' }}</text>
- </view>
- </view>
- <view class="menu-list">
- <view class="menu-item" @click="goToProducts">
- <view class="menu-icon">📦</view>
- <text class="menu-label">商品管理</text>
- <text class="arrow">›</text>
- </view>
- <view class="menu-item" @click="goToOrders">
- <view class="menu-icon">📋</view>
- <text class="menu-label">订单管理</text>
- <text class="arrow">›</text>
- </view>
- <view class="menu-item" @click="goToTeamSystem">
- <view class="menu-icon">👥</view>
- <text class="menu-label">团队管理</text>
- <text class="arrow">›</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { vendorInfo, vendorStatus } from '../../utils/api'
- import fontScaleMixin from '@/mixins/font-scale.js'
- export default {
- mixins: [fontScaleMixin],
- data() {
- return {
- vendorTypes: [
- { value: 'planner', label: '成长规划师' },
- { value: 'activity_provider', label: '活动提供商' },
- { value: 'product_supplier', label: '商品供应商' }
- ],
- vendorInfoData: null,
- isPending: false
- }
- },
- onLoad() {
- this.loadStatus()
- this.loadVendorInfo()
- },
- methods: {
- getTypeLabel(value) {
- const item = this.vendorTypes.find(t => t.value === value)
- return item ? item.label : (value || '服务商')
- },
- async loadStatus() {
- try {
- const res = await vendorStatus()
- this.isPending = !!(res && res.data && res.data.vendorStatus === 'pending')
- } catch (e) {
- this.isPending = false
- }
- },
- async loadVendorInfo() {
- try {
- const res = await vendorInfo()
- this.vendorInfoData = res.data
- } catch (e) {
- // vendor 未审核通过时会报错,忽略
- }
- },
- goToProducts() {
- uni.navigateTo({ url: '/pages/vendor/products/products' })
- },
- goToOrders() {
- uni.navigateTo({ url: '/pages/vendor/orders/orders' })
- },
- goToTeamSystem() {
- uni.navigateTo({ url: '/pages/vendor/team-system/team-system' })
- }
- }
- }
- </script>
- <style lang="scss">
- .container {
- padding: $uni-space-page;
- background: linear-gradient(180deg, $uni-primary-pale 0%, $facade-fill-page 25%);
- min-height: 100vh;
- }
- /* 待审核提示 */
- .pending-banner {
- background: linear-gradient(135deg, $status-warning-soft, $dim-wealth-tint);
- border: 2rpx solid $status-warning-light;
- border-radius: 24rpx;
- padding: 40rpx $uni-space-page;
- display: flex;
- align-items: center;
- gap: 24rpx;
- margin-top: $uni-space-lg;
- }
- .pending-icon {
- font-size: calc($uni-font-size-5xl * var(--font-scale, 1));
- }
- .pending-info {
- display: flex;
- flex-direction: column;
- }
- .pending-title {
- font-size: calc(32rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $status-warning-strong;
- }
- .pending-desc {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $status-warning-strong-2;
- margin-top: 8rpx;
- }
- /* 头部 */
- .header {
- text-align: center;
- padding: 50rpx 0 40rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .icon {
- font-size: calc($uni-font-size-6xl * var(--font-scale, 1));
- margin-bottom: 16rpx;
- }
- .title {
- font-size: calc(40rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $facade-text-gray-800;
- }
- .status-badge {
- margin-top: 12rpx;
- padding: 6rpx 20rpx;
- border-radius: 24rpx;
- font-size: calc(24rpx * var(--font-scale, 1));
- background: $facade-fill-gray-100;
- color: $facade-text-slate;
- }
- .status-badge.badge-planner { background: $status-success-tint; color: $status-success-deep; }
- .status-badge.badge-activity_provider { background: $status-info-tint; color: $status-info-deep; }
- .status-badge.badge-product_supplier { background: $uni-primary-pale; color: $brand-primary-dark; }
- /* 信息卡片 */
- .info-card {
- background: $app-surface;
- border-radius: 24rpx;
- padding: $uni-space-lg;
- margin-bottom: $uni-space-lg;
- box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06);
- }
- .info-row {
- display: flex;
- justify-content: space-between;
- padding: 18rpx 0;
- border-bottom: 1rpx solid $facade-fill-gray-100;
- }
- .info-row:last-child {
- border-bottom: none;
- }
- .info-label {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $facade-text-gray-400;
- }
- .info-value {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $facade-text-gray-700;
- font-weight: 500;
- max-width: 60%;
- text-align: right;
- word-break: break-all;
- }
- /* 菜单列表 */
- .menu-list {
- background: $app-surface;
- border-radius: 24rpx;
- overflow: hidden;
- box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06);
- }
- .menu-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 32rpx $uni-space-page;
- border-bottom: 1rpx solid $facade-fill-gray-100;
- }
- .menu-item:last-child {
- border-bottom: none;
- }
- .menu-icon {
- font-size: calc(36rpx * var(--font-scale, 1));
- margin-right: 20rpx;
- }
- .menu-label {
- font-size: calc(30rpx * var(--font-scale, 1));
- color: $facade-text-gray-700;
- flex: 1;
- }
- .arrow {
- color: $app-border-strong;
- font-size: calc(36rpx * var(--font-scale, 1));
- }
- </style>
|