feat: chat integration, tenant admin spec, backend chat service, miniprogram updates, DEMO moved to tmp, XCX-TEST removed, migrations & docs
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationBarTextStyle": "black",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"ai-float-button": "/components/ai-float-button/ai-float-button",
|
||||
"dev-fab": "/components/dev-fab/dev-fab"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { mockUserProfile } from '../../utils/mock-data'
|
||||
import { getMenuRoute, navigateTo } from '../../utils/router'
|
||||
|
||||
// TODO: 联调时替换为真实 API 获取用户信息
|
||||
Page({
|
||||
data: {
|
||||
userInfo: mockUserProfile,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 同步 custom-tab-bar 选中态
|
||||
const tabBar = this.getTabBar?.()
|
||||
if (tabBar) tabBar.setData({ active: 'my' })
|
||||
// TODO: 联调时在此刷新用户信息
|
||||
},
|
||||
|
||||
onMenuTap(e: WechatMiniprogram.TouchEvent) {
|
||||
const key = e.currentTarget.dataset.key as string
|
||||
const route = getMenuRoute(key)
|
||||
if (route) {
|
||||
navigateTo(route)
|
||||
}
|
||||
},
|
||||
|
||||
onLogout() {
|
||||
wx.showModal({
|
||||
title: '确认退出',
|
||||
content: '确认退出当前账号吗?',
|
||||
confirmColor: '#e34d59',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
wx.clearStorageSync()
|
||||
wx.reLaunch({ url: '/pages/login/login' })
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,66 @@
|
||||
<!-- 我的页面 -->
|
||||
<view class="page-my-profile">
|
||||
|
||||
<!-- 用户信息区域 -->
|
||||
<view class="user-card">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar" src="{{userInfo.avatar}}" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="user-info">
|
||||
<view class="name-row">
|
||||
<text class="name">{{userInfo.name}}</text>
|
||||
<text class="role-tag">{{userInfo.role}}</text>
|
||||
</view>
|
||||
<text class="store-name">{{userInfo.storeName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 菜单列表 -->
|
||||
<view class="menu-list">
|
||||
|
||||
<!-- 备注记录 -->
|
||||
<view class="menu-item" hover-class="menu-item--hover" bind:tap="onMenuTap" data-key="notes">
|
||||
<view class="menu-left">
|
||||
<view class="menu-icon icon-notes">
|
||||
<image src="/assets/icons/menu-notes.svg" class="menu-icon-img" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="menu-text">备注记录</text>
|
||||
</view>
|
||||
<view class="menu-chevron">
|
||||
<t-icon name="chevron-right" size="28rpx" color="#c5c5c5" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 助手对话记录 -->
|
||||
<view class="menu-item" hover-class="menu-item--hover" bind:tap="onMenuTap" data-key="chat-history">
|
||||
<view class="menu-left">
|
||||
<view class="menu-icon icon-chat">
|
||||
<image src="/assets/icons/menu-chat.svg" class="menu-icon-img" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="menu-text">助手对话记录</text>
|
||||
</view>
|
||||
<view class="menu-chevron">
|
||||
<t-icon name="chevron-right" size="28rpx" color="#c5c5c5" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出账号 -->
|
||||
<view class="menu-item menu-item--last" hover-class="menu-item--hover" bind:tap="onLogout">
|
||||
<view class="menu-left">
|
||||
<view class="menu-icon icon-logout">
|
||||
<image src="/assets/icons/menu-logout.svg" class="menu-icon-img" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="menu-text">退出账号</text>
|
||||
</view>
|
||||
<view class="menu-chevron">
|
||||
<t-icon name="chevron-right" size="28rpx" color="#c5c5c5" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- AI 悬浮按钮 — TabBar 页面 bottom 200rpx -->
|
||||
<ai-float-button visible="{{true}}" />
|
||||
|
||||
<dev-fab wx:if="{{false}}" />
|
||||
@@ -0,0 +1,135 @@
|
||||
.page-my-profile {
|
||||
min-height: 100vh;
|
||||
background: var(--color-bg-page, #f3f3f3);
|
||||
}
|
||||
|
||||
/* 用户信息卡片 */
|
||||
.user-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 28rpx;
|
||||
padding: 44rpx 40rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.avatar-wrap {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.10);
|
||||
flex-shrink: 0;
|
||||
border: 4rpx solid #fff;
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: var(--color-text-primary, #242424);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.role-tag {
|
||||
padding: 4rpx 16rpx;
|
||||
background: rgba(0, 82, 217, 0.10);
|
||||
color: #0052d9;
|
||||
font-size: 22rpx;
|
||||
border-radius: 10rpx;
|
||||
font-weight: 500;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.store-name {
|
||||
font-size: 24rpx;
|
||||
color: var(--color-text-placeholder, #8b8b8b);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 菜单列表 */
|
||||
.menu-list {
|
||||
margin-top: 24rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 28rpx 36rpx;
|
||||
background: #fff;
|
||||
border-bottom: 2rpx solid #f3f3f3;
|
||||
}
|
||||
|
||||
.menu-item--last {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.menu-item--hover {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.menu-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.menu-icon-img {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.icon-notes {
|
||||
background: rgba(0, 82, 217, 0.08);
|
||||
}
|
||||
|
||||
.icon-chat {
|
||||
background: rgba(0, 168, 112, 0.08);
|
||||
}
|
||||
|
||||
.icon-logout {
|
||||
background: rgba(227, 77, 89, 0.08);
|
||||
}
|
||||
|
||||
.menu-text {
|
||||
font-size: 28rpx;
|
||||
color: var(--color-text-primary, #242424);
|
||||
line-height: 1.5;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.menu-chevron {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user