1. 修复了一些问题

This commit is contained in:
李琦
2026-06-09 17:02:13 +08:00
parent 9dd9b061c5
commit 3f6da79ece
38 changed files with 3814 additions and 343 deletions

View File

@@ -123,7 +123,9 @@ export default {
profileInfo: null,
stats: {},
menuItems: [
{ key: 'earnings', label: '我的收益', path: `${ROOT}/earnings/index` },
{ key: 'transfer', label: '传方', path: '/subPackages/sub_workbench/prescription_v2/index?salesperson_transfer=1&initial_category=1' },
// { key: 'transfer-list', label: '传方记录', path: `${ROOT}/transfer-prescription/list` },
// { key: 'earnings', label: '我的收益', path: `${ROOT}/earnings/index` },
{ key: 'leads', label: '获客记录', path: `${ROOT}/leads/index` },
{ key: 'commission', label: '分成记录', path: `${ROOT}/commission/index` },
{ key: 'settlement', label: '结算记录', path: `${ROOT}/settlement/index` },
@@ -134,6 +136,8 @@ export default {
// 动态注入多彩主题和增强文案,使用 uView 图标名称
enrichedMenuItems() {
const themes = [
{ bg: 'linear-gradient(135deg, #ECFDF5, #D1FAE5)', color: '#10B981', desc: '线下中药传方', icon: 'edit-pen-fill' },
{ bg: 'linear-gradient(135deg, #F0F9FF, #E0F2FE)', color: '#0EA5E9', desc: '历史传方记录', icon: 'file-text-fill' },
// 收益:使用钻石/钱包相关图标
{ bg: 'linear-gradient(135deg, #FFF7ED, #FFEDD5)', color: '#F97316', desc: '查看收益明细', icon: 'red-packet-fill' },
// 获客:使用目标/数据相关图标

View File

@@ -1,215 +1,430 @@
<template>
<clinic-salesperson-page-layout title="我的" :show-tabbar="true" :tab-index="1">
<view class="mine-container">
<view class="profile-panel">
<view class="avatar-squircle">
<text>{{ avatarText }}</text>
</view>
<view class="user-info">
<text class="user-name">{{ displayName }}</text>
<view class="role-badge">
<text class="role-text">推广员</text>
</view>
<text v-if="phone" class="phone-line">{{ phone }}</text>
<text v-if="storeName" class="store-line">{{ storeName }}</text>
</view>
</view>
<view class="setting-panel">
<view class="setting-item">
<text class="item-label">所属诊所</text>
<text class="item-value">{{ storeName || '-' }}</text>
</view>
</view>
<view class="setting-panel">
<account-switch-entry />
<view
class="setting-item action-item"
hover-class="item-hover"
:hover-stay-time="100"
@click="logout"
>
<text class="danger-text">退出登录</text>
<u-icon name="arrow-right" color="#C9CDD4" size="28" />
</view>
</view>
</view>
</clinic-salesperson-page-layout>
</template>
<script>
import ClinicSalespersonPageLayout from '@/subPackages/sub_clinic_salesperson/components/clinic-salesperson-page-layout.vue'
import AccountSwitchEntry from '@/components/account-switch/account-switch-entry.vue'
import { getClinicSalespersonMyInfo } from '@/api/clinicSalesperson.js'
import { clearLoginStorage } from '@/utils/loginSession.js'
export default {
components: { ClinicSalespersonPageLayout, AccountSwitchEntry },
data() {
return {
displayName: '',
phone: '',
storeName: '',
loading: false,
}
},
computed: {
avatarText() {
return (this.displayName || '推').slice(0, 1)
},
},
onShow() {
this.loadProfile()
},
methods: {
async loadProfile() {
if (this.loading) return
this.loading = true
try {
const wrap = await getClinicSalespersonMyInfo()
if (!wrap || !wrap.ok) return
const info = wrap.data || {}
this.displayName = info.salesperson?.nick_name || '推广员'
this.phone = info.salesperson?.phone || ''
this.storeName = info.store?.name || ''
uni.setStorageSync('clinic_salesperson_user', info)
} finally {
this.loading = false
}
},
logout() {
uni.showModal({
title: '提示',
content: '确定退出登录?',
confirmColor: '#f53f3f',
success: (res) => {
if (!res.confirm) return
clearLoginStorage()
uni.reLaunch({ url: '/pages/login/index' })
},
})
},
},
}
</script>
<style lang="scss" scoped>
$theme-primary: #6acdbb;
$theme-dark: #4db6a8;
$color-page-bg: #f5f7f8;
$color-text-title: #222b2a;
$color-text-muted: #86909c;
$color-border: #f2f3f5;
$color-danger: #f53f3f;
.mine-container {
padding: 0 0 60rpx;
background-color: $color-page-bg;
<template>
<clinic-salesperson-page-layout title="我的" :show-tabbar="true" :tab-index="1">
<view class="mine-container">
<view class="profile-panel">
<view class="avatar-squircle">
<text>{{ avatarText }}</text>
</view>
<view class="user-info">
<text class="user-name">{{ displayName }}</text>
<view class="role-badge">
<text class="role-text">推广员</text>
</view>
<text v-if="phone" class="phone-line">{{ phone }}</text>
<text v-if="storeName" class="store-line">{{ storeName }}</text>
</view>
</view>
<view class="setting-panel">
<view class="setting-item">
<text class="item-label">所属诊所</text>
<text class="item-value">{{ storeName || '-' }}</text>
</view>
</view>
<view class="setting-panel">
<account-switch-entry />
<view
class="setting-item action-item"
hover-class="item-hover"
:hover-stay-time="100"
@click="logout"
>
<text class="danger-text">退出登录</text>
<u-icon name="arrow-right" color="#C9CDD4" size="28" />
</view>
</view>
</view>
</clinic-salesperson-page-layout>
</template>
<script>
import ClinicSalespersonPageLayout from '@/subPackages/sub_clinic_salesperson/components/clinic-salesperson-page-layout.vue'
import AccountSwitchEntry from '@/components/account-switch/account-switch-entry.vue'
import { getClinicSalespersonMyInfo } from '@/api/clinicSalesperson.js'
import { clearLoginStorage } from '@/utils/loginSession.js'
export default {
components: { ClinicSalespersonPageLayout, AccountSwitchEntry },
data() {
return {
displayName: '',
phone: '',
storeName: '',
loading: false,
}
},
computed: {
avatarText() {
return (this.displayName || '推').slice(0, 1)
},
},
onShow() {
this.loadProfile()
},
methods: {
async loadProfile() {
if (this.loading) return
this.loading = true
try {
const wrap = await getClinicSalespersonMyInfo()
if (!wrap || !wrap.ok) return
const info = wrap.data || {}
this.displayName = info.salesperson?.nick_name || '推广员'
this.phone = info.salesperson?.phone || ''
this.storeName = info.store?.name || ''
uni.setStorageSync('clinic_salesperson_user', info)
} finally {
this.loading = false
}
},
logout() {
uni.showModal({
title: '提示',
content: '确定退出登录?',
confirmColor: '#f53f3f',
success: (res) => {
if (!res.confirm) return
clearLoginStorage()
uni.reLaunch({ url: '/pages/login/index' })
},
})
},
},
}
</script>
<style lang="scss" scoped>
$theme-primary: #6acdbb;
$theme-dark: #4db6a8;
$color-page-bg: #f5f7f8;
$color-text-title: #222b2a;
$color-text-muted: #86909c;
$color-border: #f2f3f5;
$color-danger: #f53f3f;
.mine-container {
padding: 0 0 60rpx;
background-color: $color-page-bg;
min-height: 100vh;
box-sizing: border-box;
}
.profile-panel {
display: flex;
align-items: center;
background-color: #fff;
padding: 60rpx 40rpx 50rpx;
margin-bottom: 24rpx;
}
.avatar-squircle {
width: 128rpx;
height: 128rpx;
border-radius: 40rpx;
background: linear-gradient(135deg, $theme-primary 0%, $theme-dark 100%);
box-shadow: 0 8rpx 24rpx rgba(106, 205, 187, 0.25);
color: #fff;
font-size: 52rpx;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.user-info {
margin-left: 32rpx;
display: flex;
flex-direction: column;
justify-content: center;
}
.user-name {
font-size: 40rpx;
font-weight: 700;
color: $color-text-title;
margin-bottom: 12rpx;
}
.role-badge {
align-self: flex-start;
background-color: rgba(106, 205, 187, 0.1);
border: 1rpx solid rgba(106, 205, 187, 0.2);
padding: 4rpx 16rpx;
border-radius: 8rpx;
margin-bottom: 12rpx;
}
.role-text {
font-size: 22rpx;
color: $theme-dark;
font-weight: 600;
}
.phone-line,
.store-line {
font-size: 26rpx;
color: $color-text-muted;
margin-top: 8rpx;
}
.setting-panel {
background-color: #fff;
margin-bottom: 24rpx;
padding: 0 40rpx;
}
.setting-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx 0;
border-bottom: 1rpx solid $color-border;
}
.setting-panel .setting-item:last-child {
border-bottom: none;
}
.item-label {
font-size: 30rpx;
color: $color-text-title;
font-weight: 500;
}
.item-value {
font-size: 30rpx;
color: $color-text-muted;
}
.action-item {
margin: 0 -40rpx;
padding: 36rpx 40rpx;
}
.item-hover {
background-color: #f7f8fa;
}
.danger-text {
font-size: 30rpx;
color: $color-danger;
font-weight: 500;
}
</style>

View File

@@ -0,0 +1,13 @@
<template>
<view />
</template>
<script>
const TRANSFER_RX_URL = '/subPackages/sub_workbench/prescription_v2/index?salesperson_transfer=1&initial_category=1'
export default {
onLoad() {
uni.redirectTo({ url: TRANSFER_RX_URL })
},
}
</script>

View File

@@ -0,0 +1,55 @@
<template>
<clinic-salesperson-page-layout title="传方记录" :show-back="true">
<view class="page">
<view v-if="!list.length" class="empty">暂无传方记录</view>
<view v-for="item in list" :key="item.id" class="row" @click="goDetail(item.id)">
<view class="top">
<text class="name">{{ item.patient_name }} {{ item.patient_mobile }}</text>
<u-tag :text="item.is_imported ? '已导入' : '待导入'" :type="item.is_imported ? 'success' : 'warning'" size="mini" />
</view>
<text class="diag">诊断{{ item.clinical_diagnose || '-' }}</text>
<text class="time">{{ item.transfer_time_text }}</text>
</view>
<u-button v-if="list.length" plain type="primary" class="mt" @click="goForm">新建传方</u-button>
</view>
</clinic-salesperson-page-layout>
</template>
<script>
import ClinicSalespersonPageLayout from '@/subPackages/sub_clinic_salesperson/components/clinic-salesperson-page-layout.vue'
import { getClinicSalespersonTransferPrescriptionList } from '@/api/clinicSalesperson.js'
export default {
components: { ClinicSalespersonPageLayout },
data() {
return { list: [] }
},
onShow() {
this.loadList()
},
methods: {
async loadList() {
const wrap = await getClinicSalespersonTransferPrescriptionList({ page: 1, pageSize: 50 })
if (wrap && wrap.ok) {
this.list = wrap.data?.items || []
}
},
goForm() {
uni.navigateTo({ url: '/subPackages/sub_clinic_salesperson/transfer-prescription/form' })
},
goDetail(id) {
uni.showToast({ title: `传方#${id}`, icon: 'none' })
},
},
}
</script>
<style lang="scss" scoped>
.page { padding: 24rpx; }
.empty { text-align: center; color: #999; padding: 80rpx 0; }
.row { background: #fff; border-radius: 12rpx; padding: 24rpx; margin-bottom: 16rpx; }
.top { display: flex; justify-content: space-between; align-items: center; }
.name { font-size: 28rpx; font-weight: 600; }
.diag, .time { display: block; font-size: 24rpx; color: #666; margin-top: 8rpx; }
.mt { margin-top: 24rpx; }
</style>